From 4c4c2704a0c1c9d4df7c08c11c22688544785f7c Mon Sep 17 00:00:00 2001 From: chengpeiquan Date: Thu, 7 Jan 2021 23:16:07 +0800 Subject: [PATCH] update demo. --- .gitignore | 1 + README.md | 123 +- demo/css/style.css | 12 + demo/js/main-for-vue2.js | 56 + demo/js/main-for-vue3.js | 2 +- demo/js/main.js | 67 - demo/vue2.html | 66 + demo/vue3.html | 6 +- dist/vue-baidu-analytics.js | 4 +- dist/vue-baidu-analytics.js.map | 2 +- dist/vue-baidu-analytics.min.js | 2 +- dist/vue-baidu-analytics.min.js.map | 2 +- node_modules/.bin/browserslist | 15 - node_modules/.bin/browserslist.cmd | 17 - node_modules/.bin/browserslist.ps1 | 18 - node_modules/.bin/jsesc | 15 - node_modules/.bin/jsesc.cmd | 17 - node_modules/.bin/jsesc.ps1 | 18 - node_modules/.bin/json5 | 15 - node_modules/.bin/json5.cmd | 17 - node_modules/.bin/json5.ps1 | 18 - node_modules/.bin/parser | 15 - node_modules/.bin/parser.cmd | 17 - node_modules/.bin/parser.ps1 | 18 - node_modules/.bin/regjsparser | 15 - node_modules/.bin/regjsparser.cmd | 17 - node_modules/.bin/regjsparser.ps1 | 18 - node_modules/.bin/semver | 15 - node_modules/.bin/semver.cmd | 17 - node_modules/.bin/semver.ps1 | 18 - node_modules/.bin/terser | 15 - node_modules/.bin/terser.cmd | 17 - node_modules/.bin/terser.ps1 | 18 - .../6e96f10b2453abe2284fcac86f4f114057c5af72 | 1 - .../71d0728306715942daacf4676366fd6a07b6b666 | 1 - .../79a0ca098b9c0da0b5b8984bc656183b2a60db5f | 1 - .../a4bf385668c5452744f05d7af0ec88c79f8b6e31 | 1 - .../6e96f10b2453abe2284fcac86f4f114057c5af72 | 1 - .../71d0728306715942daacf4676366fd6a07b6b666 | 1 - .../79a0ca098b9c0da0b5b8984bc656183b2a60db5f | 1 - .../a4bf385668c5452744f05d7af0ec88c79f8b6e31 | 1 - .../6e96f10b2453abe2284fcac86f4f114057c5af72 | 1 - .../71d0728306715942daacf4676366fd6a07b6b666 | 1 - .../79a0ca098b9c0da0b5b8984bc656183b2a60db5f | 1 - .../a4bf385668c5452744f05d7af0ec88c79f8b6e31 | 1 - .../1c71620f0f64c282751681bcbbf1857fa7b7b906 | 0 .../22c7731e225cfb17a9b74dedae0216837a12d163 | 0 .../41c393035312d6bc3286d4224ecba574f0de1915 | 0 .../8507ed218024f52c1ee576a6f7f04b4740e12996 | 0 .../a9368f7e7383c0e591fb7e73549570e38aade49f | 0 .../af7c746871ddaade47bc7ee702b80e980877bc94 | 0 .../e79b9f180b673e0eb891e4974b2b9006e56cf60b | 0 .../ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df | 0 .../71d0728306715942daacf4676366fd6a07b6b666 | 1 - .../79a0ca098b9c0da0b5b8984bc656183b2a60db5f | 1 - .../f6237713b6c1a1c850dff265f54577dfa2c1cf9c | 1 - .../71d0728306715942daacf4676366fd6a07b6b666 | 1 - .../79a0ca098b9c0da0b5b8984bc656183b2a60db5f | 1 - .../f6237713b6c1a1c850dff265f54577dfa2c1cf9c | 1 - .../71d0728306715942daacf4676366fd6a07b6b666 | 1 - .../79a0ca098b9c0da0b5b8984bc656183b2a60db5f | 1 - .../f6237713b6c1a1c850dff265f54577dfa2c1cf9c | 1 - .../1c71620f0f64c282751681bcbbf1857fa7b7b906 | 0 .../22c7731e225cfb17a9b74dedae0216837a12d163 | 0 .../472dd740db5f8940713eec824d1f866ae3a38218 | 0 .../8507ed218024f52c1ee576a6f7f04b4740e12996 | 0 .../a9368f7e7383c0e591fb7e73549570e38aade49f | 0 .../af7c746871ddaade47bc7ee702b80e980877bc94 | 0 .../e79b9f180b673e0eb891e4974b2b9006e56cf60b | 0 .../ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df | 0 .../0f0fac159449201b6d39193472434fbb085c928d | 1 - .../71d0728306715942daacf4676366fd6a07b6b666 | 1 - .../79a0ca098b9c0da0b5b8984bc656183b2a60db5f | 1 - .../0f0fac159449201b6d39193472434fbb085c928d | 1 - .../71d0728306715942daacf4676366fd6a07b6b666 | 1 - .../79a0ca098b9c0da0b5b8984bc656183b2a60db5f | 1 - .../0f0fac159449201b6d39193472434fbb085c928d | 1 - .../71d0728306715942daacf4676366fd6a07b6b666 | 1 - .../79a0ca098b9c0da0b5b8984bc656183b2a60db5f | 1 - .../1c71620f0f64c282751681bcbbf1857fa7b7b906 | 0 .../22c7731e225cfb17a9b74dedae0216837a12d163 | 0 .../472dd740db5f8940713eec824d1f866ae3a38218 | 0 .../8507ed218024f52c1ee576a6f7f04b4740e12996 | 0 .../a9368f7e7383c0e591fb7e73549570e38aade49f | 0 .../af7c746871ddaade47bc7ee702b80e980877bc94 | 0 .../e79b9f180b673e0eb891e4974b2b9006e56cf60b | 0 .../ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df | 0 .../71d0728306715942daacf4676366fd6a07b6b666 | 1 - .../79a0ca098b9c0da0b5b8984bc656183b2a60db5f | 1 - .../a4bf385668c5452744f05d7af0ec88c79f8b6e31 | 1 - .../b797606cd05a0fab2bbc583e3b5bb9070aef8875 | 1 - .../71d0728306715942daacf4676366fd6a07b6b666 | 1 - .../79a0ca098b9c0da0b5b8984bc656183b2a60db5f | 1 - .../a4bf385668c5452744f05d7af0ec88c79f8b6e31 | 1 - .../b797606cd05a0fab2bbc583e3b5bb9070aef8875 | 1 - .../71d0728306715942daacf4676366fd6a07b6b666 | 1 - .../79a0ca098b9c0da0b5b8984bc656183b2a60db5f | 1 - .../a4bf385668c5452744f05d7af0ec88c79f8b6e31 | 1 - .../b797606cd05a0fab2bbc583e3b5bb9070aef8875 | 1 - .../1c71620f0f64c282751681bcbbf1857fa7b7b906 | 0 .../22c7731e225cfb17a9b74dedae0216837a12d163 | 0 .../41c393035312d6bc3286d4224ecba574f0de1915 | 0 .../8507ed218024f52c1ee576a6f7f04b4740e12996 | 0 .../a9368f7e7383c0e591fb7e73549570e38aade49f | 0 .../af7c746871ddaade47bc7ee702b80e980877bc94 | 0 .../e79b9f180b673e0eb891e4974b2b9006e56cf60b | 0 .../ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df | 0 node_modules/@babel/code-frame/README.md | 2 +- node_modules/@babel/code-frame/package.json | 70 +- .../compat-data/data/corejs2-built-ins.json | 42 +- .../compat-data/data/native-modules.json | 3 +- .../@babel/compat-data/data/plugins.json | 41 +- node_modules/@babel/compat-data/package.json | 84 +- node_modules/@babel/core/README.md | 2 +- .../@babel/core/lib/config/caching.js | 3 - .../@babel/core/lib/config/config-chain.js | 57 +- .../core/lib/config/files/configuration.js | 15 +- .../@babel/core/lib/config/files/plugins.js | 65 +- node_modules/@babel/core/lib/config/full.js | 192 +- node_modules/@babel/core/lib/config/item.js | 14 +- .../@babel/core/lib/config/partial.js | 42 +- node_modules/@babel/core/lib/config/plugin.js | 8 - .../core/lib/config/validation/options.js | 6 +- .../lib/parser/util/missing-plugin-helper.js | 22 +- .../core/lib/transformation/file/file.js | 2 - .../core/lib/transformation/plugin-pass.js | 5 - node_modules/@babel/core/package.json | 127 +- .../core/src/config/files/index-browser.js | 96 - .../@babel/core/src/config/files/index.js | 31 - .../@babel/core/src/transform-file-browser.js | 29 - .../@babel/core/src/transform-file.js | 40 - node_modules/@babel/generator/README.md | 2 +- node_modules/@babel/generator/lib/buffer.js | 33 +- .../generator/lib/generators/classes.js | 19 - .../@babel/generator/lib/generators/index.js | 11 - .../generator/lib/generators/modules.js | 3 - .../@babel/generator/lib/generators/types.js | 18 +- .../generator/lib/generators/typescript.js | 20 +- node_modules/@babel/generator/lib/index.js | 5 +- .../@babel/generator/lib/node/parentheses.js | 2 +- node_modules/@babel/generator/lib/printer.js | 17 +- node_modules/@babel/generator/package.json | 77 +- .../@babel/helper-annotate-as-pure/README.md | 2 +- .../helper-annotate-as-pure/lib/index.js | 2 +- .../helper-annotate-as-pure/package.json | 64 +- .../package.json | 61 +- .../helper-compilation-targets/lib/index.js | 52 +- .../helper-compilation-targets/lib/utils.js | 9 +- .../helper-compilation-targets/package.json | 93 +- .../lib/index.js | 19 +- .../package.json | 90 +- .../README.md | 2 +- .../lib/index.js | 10 +- .../package.json | 85 +- .../@babel/helper-define-map/package.json | 61 +- .../package.json | 68 +- .../@babel/helper-function-name/README.md | 2 +- .../@babel/helper-function-name/package.json | 71 +- .../helper-get-function-arity/README.md | 2 +- .../helper-get-function-arity/package.json | 62 +- .../helper-hoist-variables/package.json | 63 +- .../README.md | 2 +- .../lib/index.js | 80 +- .../lib/index.js.map | 1 - .../package.json | 67 +- .../@babel/helper-module-imports/README.md | 2 +- .../@babel/helper-module-imports/package.json | 67 +- .../helper-module-transforms/lib/index.js | 84 +- .../lib/normalize-and-load-metadata.js | 42 +- .../lib/rewrite-live-references.js | 9 +- .../lib/rewrite-this.js | 32 +- .../helper-module-transforms/package.json | 75 +- .../helper-optimise-call-expression/README.md | 2 +- .../lib/index.js | 8 +- .../package.json | 68 +- .../@babel/helper-plugin-utils/package.json | 112 +- .../package.json | 74 +- .../@babel/helper-replace-supers/README.md | 2 +- .../@babel/helper-replace-supers/lib/index.js | 14 +- .../@babel/helper-replace-supers/package.json | 71 +- .../@babel/helper-simple-access/package.json | 60 +- .../package.json | 70 +- .../helper-split-export-declaration/README.md | 2 +- .../package.json | 64 +- .../helper-validator-identifier/README.md | 2 +- .../helper-validator-identifier/package.json | 69 +- .../@babel/helper-validator-option/LICENSE | 22 - .../@babel/helper-validator-option/README.md | 19 - .../lib/find-suggestion.js | 45 - .../helper-validator-option/lib/index.js | 21 - .../helper-validator-option/lib/validator.js | 58 - .../helper-validator-option/package.json | 52 - .../@babel/helper-wrap-function/lib/index.js | 2 +- .../@babel/helper-wrap-function/package.json | 62 +- node_modules/@babel/helpers/README.md | 2 +- node_modules/@babel/helpers/lib/helpers.js | 4 +- node_modules/@babel/helpers/package.json | 68 +- node_modules/@babel/highlight/package.json | 69 +- node_modules/@babel/parser/README.md | 2 +- node_modules/@babel/parser/lib/index.js | 6156 +++-- node_modules/@babel/parser/lib/index.js.map | 2 +- node_modules/@babel/parser/package.json | 96 +- .../@babel/parser/typings/babel-parser.d.ts | 227 +- .../README.md | 2 +- .../package.json | 86 +- .../package.json | 83 +- .../package.json | 74 +- .../lib/index.js | 4 +- .../package.json | 74 +- .../plugin-proposal-json-strings/package.json | 74 +- .../package.json | 78 +- .../lib/index.js | 11 +- .../package.json | 74 +- .../README.md | 2 +- .../lib/index.js | 28 +- .../package.json | 74 +- .../package.json | 84 +- .../package.json | 74 +- .../README.md | 2 +- .../lib/index.js | 161 +- .../lib/index.js.map | 1 - .../package.json | 85 +- .../package.json | 82 +- .../package.json | 79 +- .../package.json | 71 +- .../package.json | 78 +- .../plugin-syntax-dynamic-import/package.json | 71 +- .../package.json | 65 +- .../plugin-syntax-json-strings/package.json | 71 +- .../package.json | 74 +- .../package.json | 71 +- .../package.json | 74 +- .../package.json | 71 +- .../package.json | 71 +- .../package.json | 71 +- .../package.json | 78 +- .../plugin-syntax-typescript/package.json | 72 +- .../package.json | 82 +- .../package.json | 84 +- .../package.json | 80 +- .../plugin-transform-block-scoping/README.md | 2 +- .../lib/index.js | 22 +- .../package.json | 80 +- .../plugin-transform-classes/package.json | 70 +- .../package.json | 80 +- .../package.json | 80 +- .../package.json | 79 +- .../package.json | 80 +- .../package.json | 74 +- .../plugin-transform-for-of/package.json | 80 +- .../package.json | 74 +- .../plugin-transform-literals/package.json | 80 +- .../package.json | 80 +- .../plugin-transform-modules-amd/package.json | 84 +- .../package.json | 88 +- .../lib/index.js | 85 +- .../package.json | 89 +- .../plugin-transform-modules-umd/package.json | 82 +- .../package.json | 79 +- .../plugin-transform-new-target/package.json | 84 +- .../package.json | 82 +- .../plugin-transform-parameters/package.json | 82 +- .../package.json | 80 +- .../plugin-transform-regenerator/package.json | 74 +- .../package.json | 80 +- .../package.json | 80 +- .../plugin-transform-spread/package.json | 81 +- .../plugin-transform-sticky-regex/README.md | 2 +- .../lib/index.js | 8 +- .../package.json | 81 +- .../package.json | 81 +- .../plugin-transform-typeof-symbol/README.md | 2 +- .../package.json | 87 +- .../plugin-transform-typescript/lib/index.js | 50 +- .../plugin-transform-typescript/package.json | 77 +- .../package.json | 80 +- .../package.json | 82 +- node_modules/@babel/preset-env/README.md | 2 +- .../preset-env/lib/normalize-options.js | 92 +- node_modules/@babel/preset-env/lib/utils.js | 4 +- node_modules/@babel/preset-env/package.json | 182 +- .../@babel/preset-modules/package.json | 161 +- .../@babel/preset-typescript/README.md | 2 +- .../@babel/preset-typescript/lib/index.js | 35 +- .../@babel/preset-typescript/package.json | 73 +- node_modules/@babel/runtime/README.md | 2 +- .../runtime/helpers/esm/AsyncGenerator.js | 2 +- .../runtime/helpers/esm/arrayWithoutHoles.js | 2 +- .../helpers/esm/awaitAsyncGenerator.js | 2 +- .../@babel/runtime/helpers/esm/construct.js | 4 +- .../helpers/esm/createForOfIteratorHelper.js | 2 +- .../esm/createForOfIteratorHelperLoose.js | 2 +- .../@babel/runtime/helpers/esm/createSuper.js | 6 +- .../@babel/runtime/helpers/esm/decorate.js | 4 +- .../@babel/runtime/helpers/esm/get.js | 2 +- .../@babel/runtime/helpers/esm/inherits.js | 2 +- .../helpers/esm/interopRequireWildcard.js | 2 +- .../runtime/helpers/esm/maybeArrayLike.js | 2 +- .../runtime/helpers/esm/objectSpread.js | 2 +- .../runtime/helpers/esm/objectSpread2.js | 2 +- .../helpers/esm/objectWithoutProperties.js | 2 +- .../helpers/esm/possibleConstructorReturn.js | 4 +- .../runtime/helpers/esm/readOnlyError.js | 2 +- .../@babel/runtime/helpers/esm/set.js | 4 +- .../runtime/helpers/esm/slicedToArray.js | 8 +- .../runtime/helpers/esm/slicedToArrayLoose.js | 8 +- .../runtime/helpers/esm/superPropBase.js | 2 +- .../@babel/runtime/helpers/esm/temporalRef.js | 4 +- .../@babel/runtime/helpers/esm/toArray.js | 8 +- .../runtime/helpers/esm/toConsumableArray.js | 8 +- .../@babel/runtime/helpers/esm/toPrimitive.js | 2 +- .../runtime/helpers/esm/toPropertyKey.js | 4 +- .../helpers/esm/unsupportedIterableToArray.js | 2 +- .../runtime/helpers/esm/wrapAsyncGenerator.js | 2 +- .../runtime/helpers/esm/wrapNativeSuper.js | 8 +- .../@babel/runtime/helpers/esm/wrapRegExp.js | 10 +- .../runtime/helpers/interopRequireWildcard.js | 2 +- .../helpers/possibleConstructorReturn.js | 2 +- .../@babel/runtime/helpers/readOnlyError.js | 2 +- .../@babel/runtime/helpers/toPrimitive.js | 2 +- .../@babel/runtime/helpers/toPropertyKey.js | 2 +- .../@babel/runtime/helpers/wrapRegExp.js | 2 +- node_modules/@babel/runtime/package.json | 230 +- node_modules/@babel/template/README.md | 2 +- .../@babel/template/lib/formatters.js | 24 +- node_modules/@babel/template/lib/literal.js | 8 +- node_modules/@babel/template/package.json | 66 +- node_modules/@babel/traverse/README.md | 2 +- node_modules/@babel/traverse/lib/context.js | 9 +- .../@babel/traverse/lib/path/family.js | 50 +- .../@babel/traverse/lib/path/index.js | 32 +- .../traverse/lib/path/inference/index.js | 30 +- .../@babel/traverse/lib/path/modification.js | 8 +- .../@babel/traverse/lib/path/removal.js | 3 - .../@babel/traverse/lib/path/replacement.js | 8 - .../@babel/traverse/lib/scope/binding.js | 8 +- .../@babel/traverse/lib/scope/index.js | 15 +- .../@babel/traverse/lib/scope/lib/renamer.js | 10 +- node_modules/@babel/traverse/package.json | 84 +- node_modules/@babel/types/README.md | 2 +- .../types/lib/asserts/generated/index.js | 580 +- .../types/lib/ast-types/generated/index.js | 0 .../types/lib/builders/generated/index.js | 1458 +- .../types/lib/builders/generated/uppercase.js | 1483 -- .../builders/typescript/createTSUnionType.js | 2 +- .../@babel/types/lib/clone/cloneNode.js | 8 +- .../@babel/types/lib/converters/Scope.js | 0 .../types/lib/converters/toExpression.js | 5 +- .../types/lib/converters/toStatement.js | 5 +- .../types/lib/converters/valueToNode.js | 5 +- .../@babel/types/lib/definitions/core.js | 23 +- .../types/lib/definitions/experimental.js | 17 +- .../@babel/types/lib/definitions/flow.js | 9 +- .../types/lib/definitions/typescript.js | 7 +- .../@babel/types/lib/definitions/utils.js | 4 +- .../@babel/types/lib/index-legacy.d.ts | 2620 -- node_modules/@babel/types/lib/index.d.ts | 5392 ++-- node_modules/@babel/types/lib/index.js | 52 +- node_modules/@babel/types/lib/index.js.flow | 1505 +- .../flow/removeTypeDuplicates.js | 6 +- .../typescript/removeTypeDuplicates.js | 2 +- .../lib/retrievers/getBindingIdentifiers.js | 2 +- .../retrievers/getOuterBindingIdentifiers.js | 5 +- .../types/lib/validators/generated/index.js | 122 +- .../types/lib/validators/isReferenced.js | 14 +- .../@babel/types/lib/validators/isScope.js | 12 +- .../types/lib/validators/isValidIdentifier.js | 4 +- node_modules/@babel/types/package.json | 107 +- .../types/scripts/generators/asserts.js | 51 - .../types/scripts/generators/ast-types.js | 140 - .../types/scripts/generators/builders.js | 165 - .../types/scripts/generators/constants.js | 16 - .../@babel/types/scripts/generators/flow.js | 136 +- .../scripts/generators/typescript-legacy.js | 371 - .../types/scripts/generators/validators.js | 88 - .../@rollup/plugin-babel/CHANGELOG.md | 17 - node_modules/@rollup/plugin-babel/README.md | 5 +- .../@rollup/plugin-babel/dist/index.es.js | 38 +- .../@rollup/plugin-babel/dist/index.js | 64 +- .../@rollup/plugin-babel/package.json | 178 +- .../@rollup/plugin-commonjs/CHANGELOG.md | 9 - .../@rollup/plugin-commonjs/README.md | 55 +- .../@rollup/plugin-commonjs/dist/index.es.js | 54 +- .../plugin-commonjs/dist/index.es.js.map | 2 +- .../@rollup/plugin-commonjs/dist/index.js | 54 +- .../@rollup/plugin-commonjs/dist/index.js.map | 2 +- .../node_modules/estree-walker/CHANGELOG.md | 4 - .../node_modules/estree-walker/LICENSE | 7 - .../estree-walker/dist/esm/estree-walker.js | 333 - .../estree-walker/dist/esm/package.json | 1 - .../estree-walker/dist/umd/estree-walker.js | 344 - .../node_modules/estree-walker/package.json | 86 +- .../node_modules/estree-walker/src/async.js | 118 - .../node_modules/estree-walker/src/index.js | 35 - .../estree-walker/src/package.json | 1 - .../node_modules/estree-walker/src/sync.js | 118 - .../node_modules/estree-walker/src/walker.js | 61 - .../estree-walker/types/async.d.ts | 64 +- .../estree-walker/types/index.d.ts | 61 +- .../estree-walker/types/sync.d.ts | 64 +- .../estree-walker/types/tsconfig.tsbuildinfo | 345 - .../estree-walker/types/walker.d.ts | 39 +- .../@rollup/plugin-commonjs/package.json | 157 +- .../@rollup/plugin-commonjs/types/index.d.ts | 135 +- node_modules/@rollup/plugin-json/package.json | 122 +- .../@rollup/plugin-node-resolve/package.json | 163 +- node_modules/@rollup/pluginutils/package.json | 177 +- node_modules/@types/babel__core/README.md | 2 +- node_modules/@types/babel__core/index.d.ts | 8 +- node_modules/@types/babel__core/package.json | 76 +- node_modules/@types/babel__generator/LICENSE | 2 +- .../@types/babel__generator/README.md | 4 +- .../@types/babel__generator/package.json | 76 +- node_modules/@types/babel__template/LICENSE | 2 +- node_modules/@types/babel__template/README.md | 12 +- .../@types/babel__template/index.d.ts | 58 +- .../@types/babel__template/package.json | 79 +- node_modules/@types/babel__traverse/README.md | 6 +- .../@types/babel__traverse/index.d.ts | 1095 +- .../@types/babel__traverse/package.json | 81 +- node_modules/@types/estree/LICENSE | 42 +- node_modules/@types/estree/README.md | 8 +- node_modules/@types/estree/index.d.ts | 1117 +- node_modules/@types/estree/package.json | 61 +- node_modules/@types/node/README.md | 6 +- node_modules/@types/node/assert.d.ts | 91 +- node_modules/@types/node/async_hooks.d.ts | 226 - node_modules/@types/node/base.d.ts | 1 + node_modules/@types/node/buffer.d.ts | 22 - node_modules/@types/node/child_process.d.ts | 509 - node_modules/@types/node/cluster.d.ts | 262 - node_modules/@types/node/console.d.ts | 133 - node_modules/@types/node/constants.d.ts | 8 - node_modules/@types/node/crypto.d.ts | 1154 - node_modules/@types/node/dgram.d.ts | 141 - node_modules/@types/node/dns.d.ts | 371 - node_modules/@types/node/domain.d.ts | 24 - node_modules/@types/node/events.d.ts | 83 - node_modules/@types/node/fs.d.ts | 2239 -- node_modules/@types/node/fs/promises.d.ts | 555 - node_modules/@types/node/globals.d.ts | 614 - node_modules/@types/node/globals.global.d.ts | 1 - node_modules/@types/node/http.d.ts | 422 - node_modules/@types/node/http2.d.ts | 953 - node_modules/@types/node/https.d.ts | 37 - node_modules/@types/node/index.d.ts | 3 +- node_modules/@types/node/inspector.d.ts | 3041 --- node_modules/@types/node/module.d.ts | 52 - node_modules/@types/node/net.d.ts | 268 - node_modules/@types/node/os.d.ts | 239 - node_modules/@types/node/package.json | 204 +- node_modules/@types/node/path.d.ts | 153 - node_modules/@types/node/perf_hooks.d.ts | 271 - node_modules/@types/node/process.d.ts | 408 - node_modules/@types/node/punycode.d.ts | 68 - node_modules/@types/node/querystring.d.ts | 28 - node_modules/@types/node/readline.d.ts | 171 - node_modules/@types/node/repl.d.ts | 395 - node_modules/@types/node/stream.d.ts | 354 - node_modules/@types/node/string_decoder.d.ts | 7 - node_modules/@types/node/timers.d.ts | 16 - node_modules/@types/node/tls.d.ts | 779 - node_modules/@types/node/trace_events.d.ts | 61 - node_modules/@types/node/ts3.4/assert.d.ts | 100 - node_modules/@types/node/ts3.4/base.d.ts | 47 +- .../@types/node/ts3.4/globals.global.d.ts | 1 - node_modules/@types/node/ts3.4/index.d.ts | 8 +- node_modules/@types/node/ts3.6/base.d.ts | 5 +- node_modules/@types/node/ts3.6/index.d.ts | 3 +- node_modules/@types/node/tty.d.ts | 66 - node_modules/@types/node/url.d.ts | 110 - node_modules/@types/node/util.d.ts | 207 - node_modules/@types/node/v8.d.ts | 187 - node_modules/@types/node/vm.d.ts | 146 - node_modules/@types/node/wasi.d.ts | 86 - node_modules/@types/node/worker_threads.d.ts | 238 - node_modules/@types/node/zlib.d.ts | 361 - node_modules/@types/resolve/package.json | 65 +- node_modules/ansi-styles/package.json | 79 +- .../babel-plugin-add-module-exports/README.md | 144 - .../lib/index.js | 182 - .../lib/index.js.map | 1 - .../package.json | 92 - .../package.json | 117 +- node_modules/balanced-match/package.json | 69 +- node_modules/brace-expansion/package.json | 71 +- node_modules/browserslist/CHANGELOG.md | 29 - node_modules/browserslist/README.md | 17 +- node_modules/browserslist/error.d.ts | 7 - node_modules/browserslist/index.d.ts | 172 - node_modules/browserslist/index.js | 13 +- node_modules/browserslist/package.json | 93 +- node_modules/browserslist/update-db.js | 141 +- node_modules/buffer-from/package.json | 62 +- .../builtin-modules/builtin-modules.json | 2 - node_modules/builtin-modules/index.js | 4 +- node_modules/builtin-modules/license | 2 +- node_modules/builtin-modules/package.json | 70 +- node_modules/builtin-modules/readme.md | 21 +- node_modules/call-bind/.eslintrc | 15 - node_modules/call-bind/.github/FUNDING.yml | 12 - node_modules/call-bind/.github/rebase.yml | 15 - .../call-bind/.github/require-allow-edits.yml | 12 - node_modules/call-bind/.travis.yml | 9 - node_modules/call-bind/CHANGELOG.md | 21 - node_modules/call-bind/LICENSE | 21 - node_modules/call-bind/README.md | 2 - node_modules/call-bind/callBound.js | 15 - node_modules/call-bind/index.js | 33 - node_modules/call-bind/package.json | 111 - node_modules/call-bind/test/callBound.js | 55 - node_modules/call-bind/test/index.js | 52 - node_modules/caniuse-lite/CHANGELOG.md | 40 - node_modules/caniuse-lite/data/agents.js | 2 +- .../caniuse-lite/data/browserVersions.js | 2 +- node_modules/caniuse-lite/data/features.js | 2 +- .../caniuse-lite/data/features/aac.js | 2 +- .../data/features/abortcontroller.js | 2 +- .../caniuse-lite/data/features/ac3-ec3.js | 2 +- .../data/features/accelerometer.js | 2 +- .../data/features/addeventlistener.js | 2 +- .../data/features/alternate-stylesheet.js | 2 +- .../data/features/ambient-light.js | 2 +- .../caniuse-lite/data/features/apng.js | 2 +- .../data/features/array-find-index.js | 2 +- .../caniuse-lite/data/features/array-find.js | 2 +- .../caniuse-lite/data/features/array-flat.js | 2 +- .../data/features/array-includes.js | 2 +- .../data/features/arrow-functions.js | 2 +- .../caniuse-lite/data/features/asmjs.js | 2 +- .../data/features/async-clipboard.js | 2 +- .../data/features/async-functions.js | 2 +- .../async-iterations-and-generators.js | 2 +- .../caniuse-lite/data/features/atob-btoa.js | 2 +- .../caniuse-lite/data/features/audio-api.js | 2 +- .../caniuse-lite/data/features/audio.js | 2 +- .../caniuse-lite/data/features/audiotracks.js | 2 +- .../caniuse-lite/data/features/autofocus.js | 2 +- .../caniuse-lite/data/features/auxclick.js | 2 +- .../caniuse-lite/data/features/av1.js | 2 +- .../caniuse-lite/data/features/avif.js | 2 +- .../data/features/background-attachment.js | 2 +- .../data/features/background-clip-text.js | 2 +- .../data/features/background-img-opts.js | 2 +- .../data/features/background-position-x-y.js | 2 +- .../features/background-repeat-round-space.js | 2 +- .../data/features/background-sync.js | 2 +- .../data/features/battery-status.js | 2 +- .../caniuse-lite/data/features/beacon.js | 2 +- .../data/features/beforeafterprint.js | 2 +- .../caniuse-lite/data/features/bigint.js | 2 +- .../caniuse-lite/data/features/blobbuilder.js | 2 +- .../caniuse-lite/data/features/bloburls.js | 2 +- .../data/features/border-image.js | 2 +- .../data/features/border-radius.js | 2 +- .../data/features/broadcastchannel.js | 2 +- .../caniuse-lite/data/features/brotli.js | 2 +- .../caniuse-lite/data/features/calc.js | 2 +- .../data/features/canvas-blending.js | 2 +- .../caniuse-lite/data/features/canvas-text.js | 2 +- .../caniuse-lite/data/features/canvas.js | 2 +- .../caniuse-lite/data/features/ch-unit.js | 2 +- .../data/features/chacha20-poly1305.js | 2 +- .../data/features/channel-messaging.js | 2 +- .../data/features/childnode-remove.js | 2 +- .../caniuse-lite/data/features/classlist.js | 2 +- .../data/features/clear-site-data-header.js | 2 +- .../client-hints-dpr-width-viewport.js | 2 +- .../caniuse-lite/data/features/clipboard.js | 2 +- .../data/features/comparedocumentposition.js | 2 +- .../data/features/console-basic.js | 2 +- .../data/features/console-time.js | 2 +- .../caniuse-lite/data/features/const.js | 2 +- .../data/features/constraint-validation.js | 2 +- .../data/features/contenteditable.js | 2 +- .../data/features/contentsecuritypolicy.js | 2 +- .../data/features/contentsecuritypolicy2.js | 2 +- .../data/features/cookie-store-api.js | 1 - .../caniuse-lite/data/features/cors.js | 2 +- .../data/features/createimagebitmap.js | 2 +- .../data/features/credential-management.js | 2 +- .../data/features/cryptography.js | 2 +- .../caniuse-lite/data/features/css-all.js | 2 +- .../data/features/css-animation.js | 2 +- .../data/features/css-any-link.js | 2 +- .../data/features/css-appearance.js | 2 +- .../data/features/css-apply-rule.js | 2 +- .../data/features/css-at-counter-style.js | 2 +- .../data/features/css-backdrop-filter.js | 2 +- .../data/features/css-background-offsets.js | 2 +- .../data/features/css-backgroundblendmode.js | 2 +- .../data/features/css-boxdecorationbreak.js | 2 +- .../data/features/css-boxshadow.js | 2 +- .../caniuse-lite/data/features/css-canvas.js | 2 +- .../data/features/css-caret-color.js | 2 +- .../data/features/css-case-insensitive.js | 2 +- .../data/features/css-clip-path.js | 2 +- .../data/features/css-color-adjust.js | 2 +- .../data/features/css-color-function.js | 2 +- .../data/features/css-conic-gradients.js | 2 +- .../data/features/css-containment.js | 2 +- .../data/features/css-content-visibility.js | 1 - .../data/features/css-counters.js | 2 +- .../data/features/css-crisp-edges.js | 2 +- .../data/features/css-cross-fade.js | 2 +- .../data/features/css-default-pseudo.js | 2 +- .../data/features/css-descendant-gtgt.js | 2 +- .../data/features/css-deviceadaptation.js | 2 +- .../data/features/css-dir-pseudo.js | 2 +- .../data/features/css-display-contents.js | 2 +- .../data/features/css-element-function.js | 2 +- .../data/features/css-env-function.js | 2 +- .../data/features/css-exclusions.js | 2 +- .../data/features/css-featurequeries.js | 2 +- .../data/features/css-filter-function.js | 2 +- .../caniuse-lite/data/features/css-filters.js | 2 +- .../data/features/css-first-letter.js | 2 +- .../data/features/css-first-line.js | 2 +- .../caniuse-lite/data/features/css-fixed.js | 2 +- .../data/features/css-focus-visible.js | 2 +- .../data/features/css-focus-within.js | 2 +- .../features/css-font-rendering-controls.js | 2 +- .../data/features/css-font-stretch.js | 2 +- .../data/features/css-gencontent.js | 2 +- .../data/features/css-gradients.js | 2 +- .../caniuse-lite/data/features/css-grid.js | 2 +- .../data/features/css-hanging-punctuation.js | 2 +- .../caniuse-lite/data/features/css-has.js | 2 +- .../data/features/css-hyphenate.js | 2 +- .../caniuse-lite/data/features/css-hyphens.js | 2 +- .../data/features/css-image-orientation.js | 2 +- .../data/features/css-image-set.js | 2 +- .../data/features/css-in-out-of-range.js | 2 +- .../data/features/css-indeterminate-pseudo.js | 2 +- .../data/features/css-initial-letter.js | 2 +- .../data/features/css-initial-value.js | 2 +- .../data/features/css-letter-spacing.js | 2 +- .../data/features/css-line-clamp.js | 2 +- .../data/features/css-logical-props.js | 2 +- .../data/features/css-marker-pseudo.js | 2 +- .../caniuse-lite/data/features/css-masks.js | 2 +- .../data/features/css-matches-pseudo.js | 2 +- .../data/features/css-math-functions.js | 2 +- .../data/features/css-media-interaction.js | 2 +- .../data/features/css-media-resolution.js | 2 +- .../data/features/css-media-scripting.js | 2 +- .../data/features/css-mediaqueries.js | 2 +- .../data/features/css-mixblendmode.js | 2 +- .../data/features/css-motion-paths.js | 2 +- .../data/features/css-namespaces.js | 2 +- .../data/features/css-not-sel-list.js | 2 +- .../data/features/css-nth-child-of.js | 2 +- .../caniuse-lite/data/features/css-opacity.js | 2 +- .../data/features/css-optional-pseudo.js | 2 +- .../data/features/css-overflow-anchor.js | 2 +- .../data/features/css-overflow.js | 2 +- .../data/features/css-overscroll-behavior.js | 2 +- .../data/features/css-page-break.js | 2 +- .../data/features/css-paged-media.js | 2 +- .../data/features/css-paint-api.js | 2 +- .../data/features/css-placeholder-shown.js | 2 +- .../data/features/css-placeholder.js | 2 +- .../data/features/css-read-only-write.js | 2 +- .../data/features/css-rebeccapurple.js | 2 +- .../data/features/css-reflections.js | 2 +- .../caniuse-lite/data/features/css-regions.js | 2 +- .../data/features/css-repeating-gradients.js | 2 +- .../caniuse-lite/data/features/css-resize.js | 2 +- .../data/features/css-revert-value.js | 2 +- .../data/features/css-rrggbbaa.js | 2 +- .../data/features/css-scroll-behavior.js | 2 +- .../data/features/css-scrollbar.js | 2 +- .../caniuse-lite/data/features/css-sel2.js | 2 +- .../caniuse-lite/data/features/css-sel3.js | 2 +- .../data/features/css-selection.js | 2 +- .../caniuse-lite/data/features/css-shapes.js | 2 +- .../data/features/css-snappoints.js | 2 +- .../caniuse-lite/data/features/css-sticky.js | 2 +- .../caniuse-lite/data/features/css-subgrid.js | 2 +- .../data/features/css-supports-api.js | 2 +- .../caniuse-lite/data/features/css-table.js | 2 +- .../data/features/css-text-align-last.js | 2 +- .../data/features/css-text-indent.js | 2 +- .../data/features/css-text-justify.js | 2 +- .../data/features/css-text-orientation.js | 2 +- .../data/features/css-text-spacing.js | 2 +- .../data/features/css-textshadow.js | 2 +- .../data/features/css-touch-action-2.js | 2 +- .../data/features/css-touch-action.js | 2 +- .../data/features/css-transitions.js | 2 +- .../data/features/css-unicode-bidi.js | 2 +- .../data/features/css-unset-value.js | 2 +- .../data/features/css-variables.js | 2 +- .../data/features/css-widows-orphans.js | 2 +- .../data/features/css-writing-mode.js | 2 +- .../caniuse-lite/data/features/css-zoom.js | 2 +- .../caniuse-lite/data/features/css3-attr.js | 2 +- .../data/features/css3-boxsizing.js | 2 +- .../caniuse-lite/data/features/css3-colors.js | 2 +- .../data/features/css3-cursors-grab.js | 2 +- .../data/features/css3-cursors-newer.js | 2 +- .../data/features/css3-cursors.js | 2 +- .../data/features/css3-tabsize.js | 2 +- .../data/features/currentcolor.js | 2 +- .../data/features/custom-elements.js | 2 +- .../data/features/custom-elementsv1.js | 2 +- .../caniuse-lite/data/features/customevent.js | 2 +- .../caniuse-lite/data/features/datalist.js | 2 +- .../caniuse-lite/data/features/dataset.js | 2 +- .../caniuse-lite/data/features/datauri.js | 2 +- .../data/features/date-tolocaledatestring.js | 2 +- .../caniuse-lite/data/features/details.js | 2 +- .../data/features/deviceorientation.js | 2 +- .../data/features/devicepixelratio.js | 2 +- .../caniuse-lite/data/features/dialog.js | 2 +- .../data/features/dispatchevent.js | 2 +- .../caniuse-lite/data/features/dnssec.js | 2 +- .../data/features/do-not-track.js | 2 +- .../data/features/document-currentscript.js | 2 +- .../data/features/document-evaluate-xpath.js | 2 +- .../data/features/document-execcommand.js | 2 +- .../data/features/document-policy.js | 2 +- .../features/document-scrollingelement.js | 2 +- .../data/features/documenthead.js | 2 +- .../data/features/dom-manip-convenience.js | 2 +- .../caniuse-lite/data/features/dom-range.js | 2 +- .../data/features/domcontentloaded.js | 2 +- .../features/domfocusin-domfocusout-events.js | 2 +- .../caniuse-lite/data/features/dommatrix.js | 2 +- .../caniuse-lite/data/features/download.js | 2 +- .../caniuse-lite/data/features/dragndrop.js | 2 +- .../data/features/element-closest.js | 2 +- .../data/features/element-from-point.js | 2 +- .../data/features/element-scroll-methods.js | 2 +- .../caniuse-lite/data/features/eme.js | 2 +- .../caniuse-lite/data/features/eot.js | 2 +- .../caniuse-lite/data/features/es5.js | 2 +- .../caniuse-lite/data/features/es6-class.js | 2 +- .../data/features/es6-generators.js | 2 +- .../features/es6-module-dynamic-import.js | 2 +- .../caniuse-lite/data/features/es6-module.js | 2 +- .../caniuse-lite/data/features/es6-number.js | 2 +- .../data/features/es6-string-includes.js | 2 +- .../caniuse-lite/data/features/es6.js | 2 +- .../caniuse-lite/data/features/eventsource.js | 2 +- .../data/features/extended-system-fonts.js | 2 +- .../data/features/feature-policy.js | 2 +- .../caniuse-lite/data/features/fetch.js | 2 +- .../data/features/fieldset-disabled.js | 2 +- .../caniuse-lite/data/features/fileapi.js | 2 +- .../caniuse-lite/data/features/filereader.js | 2 +- .../data/features/filereadersync.js | 2 +- .../caniuse-lite/data/features/filesystem.js | 2 +- .../caniuse-lite/data/features/flac.js | 2 +- .../caniuse-lite/data/features/flexbox-gap.js | 2 +- .../caniuse-lite/data/features/flexbox.js | 2 +- .../caniuse-lite/data/features/flow-root.js | 2 +- .../data/features/focusin-focusout-events.js | 2 +- .../features/focusoptions-preventscroll.js | 2 +- .../data/features/font-family-system-ui.js | 2 +- .../data/features/font-feature.js | 2 +- .../data/features/font-kerning.js | 2 +- .../data/features/font-loading.js | 2 +- .../data/features/font-size-adjust.js | 2 +- .../caniuse-lite/data/features/font-smooth.js | 2 +- .../data/features/font-unicode-range.js | 2 +- .../data/features/font-variant-alternates.js | 2 +- .../data/features/font-variant-east-asian.js | 2 +- .../data/features/font-variant-numeric.js | 2 +- .../caniuse-lite/data/features/fontface.js | 2 +- .../data/features/form-attribute.js | 2 +- .../data/features/form-submit-attributes.js | 2 +- .../data/features/form-validation.js | 2 +- .../caniuse-lite/data/features/forms.js | 2 +- .../caniuse-lite/data/features/fullscreen.js | 2 +- .../caniuse-lite/data/features/gamepad.js | 2 +- .../caniuse-lite/data/features/geolocation.js | 2 +- .../data/features/getboundingclientrect.js | 2 +- .../data/features/getcomputedstyle.js | 2 +- .../data/features/getelementsbyclassname.js | 2 +- .../data/features/getrandomvalues.js | 2 +- .../caniuse-lite/data/features/gyroscope.js | 2 +- .../data/features/hardwareconcurrency.js | 2 +- .../caniuse-lite/data/features/hashchange.js | 2 +- .../caniuse-lite/data/features/heif.js | 2 +- .../caniuse-lite/data/features/hevc.js | 2 +- .../caniuse-lite/data/features/hidden.js | 2 +- .../data/features/high-resolution-time.js | 2 +- .../caniuse-lite/data/features/history.js | 2 +- .../data/features/html-media-capture.js | 2 +- .../data/features/html5semantic.js | 2 +- .../data/features/http-live-streaming.js | 2 +- .../caniuse-lite/data/features/http2.js | 2 +- .../caniuse-lite/data/features/http3.js | 2 +- .../data/features/iframe-sandbox.js | 2 +- .../data/features/iframe-seamless.js | 2 +- .../data/features/iframe-srcdoc.js | 2 +- .../data/features/imagecapture.js | 2 +- .../caniuse-lite/data/features/ime.js | 2 +- .../img-naturalwidth-naturalheight.js | 2 +- .../caniuse-lite/data/features/import-maps.js | 1 - .../caniuse-lite/data/features/imports.js | 2 +- .../data/features/indeterminate-checkbox.js | 2 +- .../caniuse-lite/data/features/indexeddb.js | 2 +- .../caniuse-lite/data/features/indexeddb2.js | 2 +- .../data/features/inline-block.js | 2 +- .../caniuse-lite/data/features/innertext.js | 2 +- .../data/features/input-autocomplete-onoff.js | 2 +- .../caniuse-lite/data/features/input-color.js | 2 +- .../data/features/input-datetime.js | 2 +- .../data/features/input-email-tel-url.js | 2 +- .../caniuse-lite/data/features/input-event.js | 2 +- .../data/features/input-file-accept.js | 2 +- .../data/features/input-file-directory.js | 2 +- .../data/features/input-file-multiple.js | 2 +- .../data/features/input-inputmode.js | 2 +- .../data/features/input-minlength.js | 2 +- .../data/features/input-number.js | 2 +- .../data/features/input-pattern.js | 2 +- .../data/features/input-placeholder.js | 2 +- .../caniuse-lite/data/features/input-range.js | 2 +- .../data/features/input-search.js | 2 +- .../data/features/input-selection.js | 2 +- .../data/features/insert-adjacent.js | 2 +- .../data/features/insertadjacenthtml.js | 2 +- .../data/features/internationalization.js | 2 +- .../data/features/intersectionobserver-v2.js | 2 +- .../data/features/intersectionobserver.js | 2 +- .../data/features/intl-pluralrules.js | 2 +- .../data/features/intrinsic-width.js | 2 +- .../caniuse-lite/data/features/jpeg2000.js | 2 +- .../caniuse-lite/data/features/jpegxr.js | 2 +- .../data/features/js-regexp-lookbehind.js | 2 +- .../caniuse-lite/data/features/json.js | 2 +- .../features/justify-content-space-evenly.js | 2 +- .../data/features/kerning-pairs-ligatures.js | 2 +- .../data/features/keyboardevent-charcode.js | 2 +- .../data/features/keyboardevent-code.js | 2 +- .../keyboardevent-getmodifierstate.js | 2 +- .../data/features/keyboardevent-key.js | 2 +- .../data/features/keyboardevent-location.js | 2 +- .../data/features/keyboardevent-which.js | 2 +- .../caniuse-lite/data/features/lazyload.js | 2 +- .../caniuse-lite/data/features/let.js | 2 +- .../data/features/link-icon-png.js | 2 +- .../data/features/link-icon-svg.js | 2 +- .../data/features/link-rel-dns-prefetch.js | 2 +- .../data/features/link-rel-modulepreload.js | 2 +- .../data/features/link-rel-preconnect.js | 2 +- .../data/features/link-rel-prefetch.js | 2 +- .../data/features/link-rel-preload.js | 2 +- .../data/features/link-rel-prerender.js | 2 +- .../data/features/loading-lazy-attr.js | 2 +- .../data/features/localecompare.js | 2 +- .../data/features/magnetometer.js | 2 +- .../data/features/matchesselector.js | 2 +- .../caniuse-lite/data/features/matchmedia.js | 2 +- .../caniuse-lite/data/features/mathml.js | 2 +- .../caniuse-lite/data/features/maxlength.js | 2 +- .../data/features/media-attribute.js | 2 +- .../data/features/media-fragments.js | 2 +- .../data/features/media-session-api.js | 2 +- .../data/features/mediacapture-fromelement.js | 2 +- .../data/features/mediarecorder.js | 2 +- .../caniuse-lite/data/features/mediasource.js | 2 +- .../caniuse-lite/data/features/menu.js | 2 +- .../data/features/meta-theme-color.js | 2 +- .../caniuse-lite/data/features/meter.js | 2 +- .../caniuse-lite/data/features/midi.js | 2 +- .../caniuse-lite/data/features/minmaxwh.js | 2 +- .../caniuse-lite/data/features/mp3.js | 2 +- .../caniuse-lite/data/features/mpeg-dash.js | 2 +- .../caniuse-lite/data/features/mpeg4.js | 2 +- .../data/features/multibackgrounds.js | 2 +- .../caniuse-lite/data/features/multicolumn.js | 2 +- .../data/features/mutation-events.js | 2 +- .../data/features/mutationobserver.js | 2 +- .../data/features/namevalue-storage.js | 2 +- .../data/features/native-filesystem-api.js | 2 +- .../caniuse-lite/data/features/nav-timing.js | 2 +- .../data/features/navigator-language.js | 2 +- .../caniuse-lite/data/features/netinfo.js | 2 +- .../data/features/node-contains.js | 2 +- .../data/features/node-parentelement.js | 2 +- .../data/features/notifications.js | 2 +- .../data/features/object-entries.js | 2 +- .../caniuse-lite/data/features/object-fit.js | 2 +- .../data/features/object-observe.js | 2 +- .../data/features/object-values.js | 2 +- .../caniuse-lite/data/features/objectrtc.js | 2 +- .../data/features/offline-apps.js | 2 +- .../data/features/offscreencanvas.js | 2 +- .../caniuse-lite/data/features/ogg-vorbis.js | 2 +- .../caniuse-lite/data/features/ogv.js | 2 +- .../caniuse-lite/data/features/ol-reversed.js | 2 +- .../data/features/once-event-listener.js | 2 +- .../data/features/online-status.js | 2 +- .../caniuse-lite/data/features/opus.js | 2 +- .../data/features/orientation-sensor.js | 2 +- .../caniuse-lite/data/features/outline.js | 2 +- .../data/features/pad-start-end.js | 2 +- .../data/features/page-transition-events.js | 2 +- .../data/features/pagevisibility.js | 2 +- .../data/features/passive-event-listener.js | 2 +- .../data/features/passwordrules.js | 2 +- .../caniuse-lite/data/features/path2d.js | 2 +- .../data/features/payment-request.js | 2 +- .../caniuse-lite/data/features/pdf-viewer.js | 2 +- .../data/features/permissions-api.js | 2 +- .../data/features/permissions-policy.js | 2 +- .../data/features/picture-in-picture.js | 2 +- .../caniuse-lite/data/features/picture.js | 2 +- .../caniuse-lite/data/features/ping.js | 2 +- .../caniuse-lite/data/features/png-alpha.js | 2 +- .../data/features/pointer-events.js | 2 +- .../caniuse-lite/data/features/pointer.js | 2 +- .../caniuse-lite/data/features/pointerlock.js | 2 +- .../caniuse-lite/data/features/portals.js | 2 +- .../data/features/prefers-color-scheme.js | 2 +- .../data/features/prefers-reduced-motion.js | 2 +- .../data/features/private-class-fields.js | 2 +- .../features/private-methods-and-accessors.js | 2 +- .../caniuse-lite/data/features/progress.js | 2 +- .../data/features/promise-finally.js | 2 +- .../caniuse-lite/data/features/promises.js | 2 +- .../caniuse-lite/data/features/proximity.js | 2 +- .../caniuse-lite/data/features/proxy.js | 2 +- .../data/features/public-class-fields.js | 2 +- .../data/features/publickeypinning.js | 2 +- .../caniuse-lite/data/features/push-api.js | 2 +- .../data/features/queryselector.js | 2 +- .../data/features/readonly-attr.js | 2 +- .../data/features/referrer-policy.js | 2 +- .../data/features/registerprotocolhandler.js | 2 +- .../data/features/rel-noopener.js | 2 +- .../data/features/rel-noreferrer.js | 2 +- .../caniuse-lite/data/features/rellist.js | 2 +- .../caniuse-lite/data/features/rem.js | 2 +- .../caniuse-lite/data/features/replace-all.js | 2 +- .../data/features/requestanimationframe.js | 2 +- .../data/features/requestidlecallback.js | 2 +- .../data/features/resizeobserver.js | 2 +- .../data/features/resource-timing.js | 2 +- .../data/features/rest-parameters.js | 2 +- .../data/features/rtcpeerconnection.js | 2 +- .../caniuse-lite/data/features/ruby.js | 2 +- .../caniuse-lite/data/features/run-in.js | 2 +- .../features/same-site-cookie-attribute.js | 2 +- .../data/features/screen-orientation.js | 2 +- .../data/features/script-async.js | 2 +- .../data/features/script-defer.js | 2 +- .../data/features/scrollintoview.js | 2 +- .../data/features/scrollintoviewifneeded.js | 2 +- .../caniuse-lite/data/features/sdch.js | 2 +- .../data/features/selection-api.js | 2 +- .../data/features/server-timing.js | 2 +- .../data/features/serviceworkers.js | 2 +- .../data/features/setimmediate.js | 2 +- .../caniuse-lite/data/features/sha-2.js | 2 +- .../caniuse-lite/data/features/shadowdom.js | 2 +- .../caniuse-lite/data/features/shadowdomv1.js | 2 +- .../data/features/sharedarraybuffer.js | 2 +- .../data/features/sharedworkers.js | 2 +- .../caniuse-lite/data/features/sni.js | 2 +- .../caniuse-lite/data/features/spdy.js | 2 +- .../data/features/speech-recognition.js | 2 +- .../data/features/speech-synthesis.js | 2 +- .../data/features/spellcheck-attribute.js | 2 +- .../caniuse-lite/data/features/sql-storage.js | 2 +- .../caniuse-lite/data/features/srcset.js | 2 +- .../data/features/stopimmediatepropagation.js | 2 +- .../caniuse-lite/data/features/stream.js | 2 +- .../caniuse-lite/data/features/streams.js | 2 +- .../data/features/stricttransportsecurity.js | 2 +- .../data/features/style-scoped.js | 2 +- .../data/features/subresource-integrity.js | 2 +- .../caniuse-lite/data/features/svg-css.js | 2 +- .../caniuse-lite/data/features/svg-filters.js | 2 +- .../caniuse-lite/data/features/svg-fonts.js | 2 +- .../data/features/svg-fragment.js | 2 +- .../caniuse-lite/data/features/svg-html.js | 2 +- .../caniuse-lite/data/features/svg-html5.js | 2 +- .../caniuse-lite/data/features/svg-img.js | 2 +- .../caniuse-lite/data/features/svg-smil.js | 2 +- .../caniuse-lite/data/features/svg.js | 2 +- .../caniuse-lite/data/features/sxg.js | 2 +- .../caniuse-lite/data/features/symbols.js | 2 +- .../data/features/tabindex-attr.js | 2 +- .../data/features/template-literals.js | 2 +- .../caniuse-lite/data/features/template.js | 2 +- .../caniuse-lite/data/features/testfeat.js | 2 +- .../data/features/text-decoration.js | 2 +- .../data/features/text-emphasis.js | 2 +- .../data/features/text-overflow.js | 2 +- .../data/features/text-size-adjust.js | 2 +- .../caniuse-lite/data/features/text-stroke.js | 2 +- .../data/features/text-underline-offset.js | 2 +- .../caniuse-lite/data/features/textcontent.js | 2 +- .../caniuse-lite/data/features/textencoder.js | 2 +- .../caniuse-lite/data/features/tls1-1.js | 2 +- .../caniuse-lite/data/features/tls1-2.js | 2 +- .../caniuse-lite/data/features/tls1-3.js | 2 +- .../data/features/token-binding.js | 2 +- .../caniuse-lite/data/features/touch.js | 2 +- .../data/features/transforms2d.js | 2 +- .../data/features/transforms3d.js | 2 +- .../data/features/trusted-types.js | 2 +- .../caniuse-lite/data/features/ttf.js | 2 +- .../caniuse-lite/data/features/typedarrays.js | 2 +- .../caniuse-lite/data/features/u2f.js | 2 +- .../data/features/unhandledrejection.js | 2 +- .../data/features/upgradeinsecurerequests.js | 2 +- .../features/url-scroll-to-text-fragment.js | 2 +- .../caniuse-lite/data/features/url.js | 2 +- .../data/features/urlsearchparams.js | 2 +- .../caniuse-lite/data/features/use-strict.js | 2 +- .../data/features/user-select-none.js | 2 +- .../caniuse-lite/data/features/user-timing.js | 2 +- .../data/features/variable-fonts.js | 2 +- .../caniuse-lite/data/features/vibration.js | 2 +- .../caniuse-lite/data/features/video.js | 2 +- .../caniuse-lite/data/features/videotracks.js | 2 +- .../data/features/viewport-units.js | 2 +- .../caniuse-lite/data/features/wai-aria.js | 2 +- .../caniuse-lite/data/features/wake-lock.js | 2 +- .../caniuse-lite/data/features/wasm.js | 2 +- .../caniuse-lite/data/features/wav.js | 2 +- .../caniuse-lite/data/features/wbr-element.js | 2 +- .../data/features/web-animation.js | 2 +- .../data/features/web-app-manifest.js | 2 +- .../data/features/web-bluetooth.js | 2 +- .../caniuse-lite/data/features/web-share.js | 2 +- .../caniuse-lite/data/features/webauthn.js | 2 +- .../caniuse-lite/data/features/webgl.js | 2 +- .../caniuse-lite/data/features/webgl2.js | 2 +- .../caniuse-lite/data/features/webgpu.js | 2 +- .../caniuse-lite/data/features/webhid.js | 2 +- .../caniuse-lite/data/features/webm.js | 2 +- .../caniuse-lite/data/features/webnfc.js | 2 +- .../caniuse-lite/data/features/webp.js | 2 +- .../caniuse-lite/data/features/websockets.js | 2 +- .../caniuse-lite/data/features/webusb.js | 2 +- .../caniuse-lite/data/features/webvr.js | 2 +- .../caniuse-lite/data/features/webvtt.js | 2 +- .../caniuse-lite/data/features/webworkers.js | 2 +- .../caniuse-lite/data/features/webxr.js | 2 +- .../caniuse-lite/data/features/will-change.js | 2 +- .../caniuse-lite/data/features/woff.js | 2 +- .../caniuse-lite/data/features/woff2.js | 2 +- .../caniuse-lite/data/features/word-break.js | 2 +- .../caniuse-lite/data/features/wordwrap.js | 2 +- .../data/features/x-doc-messaging.js | 2 +- .../data/features/x-frame-options.js | 2 +- .../caniuse-lite/data/features/xhr2.js | 2 +- .../caniuse-lite/data/features/xhtml.js | 2 +- .../caniuse-lite/data/features/xhtmlsmil.js | 2 +- .../data/features/xml-serializer.js | 2 +- node_modules/caniuse-lite/data/regions/AD.js | 2 +- node_modules/caniuse-lite/data/regions/AE.js | 2 +- node_modules/caniuse-lite/data/regions/AF.js | 2 +- node_modules/caniuse-lite/data/regions/AG.js | 2 +- node_modules/caniuse-lite/data/regions/AI.js | 2 +- node_modules/caniuse-lite/data/regions/AL.js | 2 +- node_modules/caniuse-lite/data/regions/AM.js | 2 +- node_modules/caniuse-lite/data/regions/AO.js | 2 +- node_modules/caniuse-lite/data/regions/AR.js | 2 +- node_modules/caniuse-lite/data/regions/AS.js | 2 +- node_modules/caniuse-lite/data/regions/AT.js | 2 +- node_modules/caniuse-lite/data/regions/AU.js | 2 +- node_modules/caniuse-lite/data/regions/AW.js | 2 +- node_modules/caniuse-lite/data/regions/AX.js | 2 +- node_modules/caniuse-lite/data/regions/AZ.js | 2 +- node_modules/caniuse-lite/data/regions/BA.js | 2 +- node_modules/caniuse-lite/data/regions/BB.js | 2 +- node_modules/caniuse-lite/data/regions/BD.js | 2 +- node_modules/caniuse-lite/data/regions/BE.js | 2 +- node_modules/caniuse-lite/data/regions/BF.js | 2 +- node_modules/caniuse-lite/data/regions/BG.js | 2 +- node_modules/caniuse-lite/data/regions/BH.js | 2 +- node_modules/caniuse-lite/data/regions/BI.js | 2 +- node_modules/caniuse-lite/data/regions/BJ.js | 2 +- node_modules/caniuse-lite/data/regions/BM.js | 2 +- node_modules/caniuse-lite/data/regions/BN.js | 2 +- node_modules/caniuse-lite/data/regions/BO.js | 2 +- node_modules/caniuse-lite/data/regions/BR.js | 2 +- node_modules/caniuse-lite/data/regions/BS.js | 2 +- node_modules/caniuse-lite/data/regions/BT.js | 2 +- node_modules/caniuse-lite/data/regions/BW.js | 2 +- node_modules/caniuse-lite/data/regions/BY.js | 2 +- node_modules/caniuse-lite/data/regions/BZ.js | 2 +- node_modules/caniuse-lite/data/regions/CA.js | 2 +- node_modules/caniuse-lite/data/regions/CD.js | 2 +- node_modules/caniuse-lite/data/regions/CF.js | 2 +- node_modules/caniuse-lite/data/regions/CG.js | 2 +- node_modules/caniuse-lite/data/regions/CH.js | 2 +- node_modules/caniuse-lite/data/regions/CI.js | 2 +- node_modules/caniuse-lite/data/regions/CK.js | 2 +- node_modules/caniuse-lite/data/regions/CL.js | 2 +- node_modules/caniuse-lite/data/regions/CM.js | 2 +- node_modules/caniuse-lite/data/regions/CN.js | 2 +- node_modules/caniuse-lite/data/regions/CO.js | 2 +- node_modules/caniuse-lite/data/regions/CR.js | 2 +- node_modules/caniuse-lite/data/regions/CU.js | 2 +- node_modules/caniuse-lite/data/regions/CV.js | 2 +- node_modules/caniuse-lite/data/regions/CX.js | 2 +- node_modules/caniuse-lite/data/regions/CY.js | 2 +- node_modules/caniuse-lite/data/regions/CZ.js | 2 +- node_modules/caniuse-lite/data/regions/DE.js | 2 +- node_modules/caniuse-lite/data/regions/DJ.js | 2 +- node_modules/caniuse-lite/data/regions/DK.js | 2 +- node_modules/caniuse-lite/data/regions/DM.js | 2 +- node_modules/caniuse-lite/data/regions/DO.js | 2 +- node_modules/caniuse-lite/data/regions/DZ.js | 2 +- node_modules/caniuse-lite/data/regions/EC.js | 2 +- node_modules/caniuse-lite/data/regions/EE.js | 2 +- node_modules/caniuse-lite/data/regions/EG.js | 2 +- node_modules/caniuse-lite/data/regions/ER.js | 2 +- node_modules/caniuse-lite/data/regions/ES.js | 2 +- node_modules/caniuse-lite/data/regions/ET.js | 2 +- node_modules/caniuse-lite/data/regions/FI.js | 2 +- node_modules/caniuse-lite/data/regions/FJ.js | 2 +- node_modules/caniuse-lite/data/regions/FK.js | 2 +- node_modules/caniuse-lite/data/regions/FM.js | 2 +- node_modules/caniuse-lite/data/regions/FO.js | 2 +- node_modules/caniuse-lite/data/regions/FR.js | 2 +- node_modules/caniuse-lite/data/regions/GA.js | 2 +- node_modules/caniuse-lite/data/regions/GB.js | 2 +- node_modules/caniuse-lite/data/regions/GD.js | 2 +- node_modules/caniuse-lite/data/regions/GE.js | 2 +- node_modules/caniuse-lite/data/regions/GF.js | 2 +- node_modules/caniuse-lite/data/regions/GG.js | 2 +- node_modules/caniuse-lite/data/regions/GH.js | 2 +- node_modules/caniuse-lite/data/regions/GI.js | 2 +- node_modules/caniuse-lite/data/regions/GL.js | 2 +- node_modules/caniuse-lite/data/regions/GM.js | 2 +- node_modules/caniuse-lite/data/regions/GN.js | 2 +- node_modules/caniuse-lite/data/regions/GP.js | 2 +- node_modules/caniuse-lite/data/regions/GQ.js | 2 +- node_modules/caniuse-lite/data/regions/GR.js | 2 +- node_modules/caniuse-lite/data/regions/GT.js | 2 +- node_modules/caniuse-lite/data/regions/GU.js | 2 +- node_modules/caniuse-lite/data/regions/GW.js | 2 +- node_modules/caniuse-lite/data/regions/GY.js | 2 +- node_modules/caniuse-lite/data/regions/HK.js | 2 +- node_modules/caniuse-lite/data/regions/HN.js | 2 +- node_modules/caniuse-lite/data/regions/HR.js | 2 +- node_modules/caniuse-lite/data/regions/HT.js | 2 +- node_modules/caniuse-lite/data/regions/HU.js | 2 +- node_modules/caniuse-lite/data/regions/ID.js | 2 +- node_modules/caniuse-lite/data/regions/IE.js | 2 +- node_modules/caniuse-lite/data/regions/IL.js | 2 +- node_modules/caniuse-lite/data/regions/IM.js | 2 +- node_modules/caniuse-lite/data/regions/IN.js | 2 +- node_modules/caniuse-lite/data/regions/IQ.js | 2 +- node_modules/caniuse-lite/data/regions/IR.js | 2 +- node_modules/caniuse-lite/data/regions/IS.js | 2 +- node_modules/caniuse-lite/data/regions/IT.js | 2 +- node_modules/caniuse-lite/data/regions/JE.js | 2 +- node_modules/caniuse-lite/data/regions/JM.js | 2 +- node_modules/caniuse-lite/data/regions/JO.js | 2 +- node_modules/caniuse-lite/data/regions/JP.js | 2 +- node_modules/caniuse-lite/data/regions/KE.js | 2 +- node_modules/caniuse-lite/data/regions/KG.js | 2 +- node_modules/caniuse-lite/data/regions/KH.js | 2 +- node_modules/caniuse-lite/data/regions/KI.js | 2 +- node_modules/caniuse-lite/data/regions/KM.js | 2 +- node_modules/caniuse-lite/data/regions/KN.js | 2 +- node_modules/caniuse-lite/data/regions/KP.js | 2 +- node_modules/caniuse-lite/data/regions/KR.js | 2 +- node_modules/caniuse-lite/data/regions/KW.js | 2 +- node_modules/caniuse-lite/data/regions/KY.js | 2 +- node_modules/caniuse-lite/data/regions/KZ.js | 2 +- node_modules/caniuse-lite/data/regions/LA.js | 2 +- node_modules/caniuse-lite/data/regions/LB.js | 2 +- node_modules/caniuse-lite/data/regions/LC.js | 2 +- node_modules/caniuse-lite/data/regions/LI.js | 2 +- node_modules/caniuse-lite/data/regions/LK.js | 2 +- node_modules/caniuse-lite/data/regions/LR.js | 2 +- node_modules/caniuse-lite/data/regions/LS.js | 2 +- node_modules/caniuse-lite/data/regions/LT.js | 2 +- node_modules/caniuse-lite/data/regions/LU.js | 2 +- node_modules/caniuse-lite/data/regions/LV.js | 2 +- node_modules/caniuse-lite/data/regions/LY.js | 2 +- node_modules/caniuse-lite/data/regions/MA.js | 2 +- node_modules/caniuse-lite/data/regions/MC.js | 2 +- node_modules/caniuse-lite/data/regions/MD.js | 2 +- node_modules/caniuse-lite/data/regions/ME.js | 2 +- node_modules/caniuse-lite/data/regions/MG.js | 2 +- node_modules/caniuse-lite/data/regions/MH.js | 2 +- node_modules/caniuse-lite/data/regions/MK.js | 2 +- node_modules/caniuse-lite/data/regions/ML.js | 2 +- node_modules/caniuse-lite/data/regions/MM.js | 2 +- node_modules/caniuse-lite/data/regions/MN.js | 2 +- node_modules/caniuse-lite/data/regions/MO.js | 2 +- node_modules/caniuse-lite/data/regions/MP.js | 2 +- node_modules/caniuse-lite/data/regions/MQ.js | 2 +- node_modules/caniuse-lite/data/regions/MR.js | 2 +- node_modules/caniuse-lite/data/regions/MS.js | 2 +- node_modules/caniuse-lite/data/regions/MT.js | 2 +- node_modules/caniuse-lite/data/regions/MU.js | 2 +- node_modules/caniuse-lite/data/regions/MV.js | 2 +- node_modules/caniuse-lite/data/regions/MW.js | 2 +- node_modules/caniuse-lite/data/regions/MX.js | 2 +- node_modules/caniuse-lite/data/regions/MY.js | 2 +- node_modules/caniuse-lite/data/regions/MZ.js | 2 +- node_modules/caniuse-lite/data/regions/NA.js | 2 +- node_modules/caniuse-lite/data/regions/NC.js | 2 +- node_modules/caniuse-lite/data/regions/NE.js | 2 +- node_modules/caniuse-lite/data/regions/NF.js | 2 +- node_modules/caniuse-lite/data/regions/NG.js | 2 +- node_modules/caniuse-lite/data/regions/NI.js | 2 +- node_modules/caniuse-lite/data/regions/NL.js | 2 +- node_modules/caniuse-lite/data/regions/NO.js | 2 +- node_modules/caniuse-lite/data/regions/NP.js | 2 +- node_modules/caniuse-lite/data/regions/NR.js | 2 +- node_modules/caniuse-lite/data/regions/NU.js | 2 +- node_modules/caniuse-lite/data/regions/NZ.js | 2 +- node_modules/caniuse-lite/data/regions/OM.js | 2 +- node_modules/caniuse-lite/data/regions/PA.js | 2 +- node_modules/caniuse-lite/data/regions/PE.js | 2 +- node_modules/caniuse-lite/data/regions/PF.js | 2 +- node_modules/caniuse-lite/data/regions/PG.js | 2 +- node_modules/caniuse-lite/data/regions/PH.js | 2 +- node_modules/caniuse-lite/data/regions/PK.js | 2 +- node_modules/caniuse-lite/data/regions/PL.js | 2 +- node_modules/caniuse-lite/data/regions/PM.js | 2 +- node_modules/caniuse-lite/data/regions/PN.js | 2 +- node_modules/caniuse-lite/data/regions/PR.js | 2 +- node_modules/caniuse-lite/data/regions/PS.js | 2 +- node_modules/caniuse-lite/data/regions/PT.js | 2 +- node_modules/caniuse-lite/data/regions/PW.js | 2 +- node_modules/caniuse-lite/data/regions/PY.js | 2 +- node_modules/caniuse-lite/data/regions/QA.js | 2 +- node_modules/caniuse-lite/data/regions/RE.js | 2 +- node_modules/caniuse-lite/data/regions/RO.js | 2 +- node_modules/caniuse-lite/data/regions/RS.js | 2 +- node_modules/caniuse-lite/data/regions/RU.js | 2 +- node_modules/caniuse-lite/data/regions/RW.js | 2 +- node_modules/caniuse-lite/data/regions/SA.js | 2 +- node_modules/caniuse-lite/data/regions/SB.js | 2 +- node_modules/caniuse-lite/data/regions/SC.js | 2 +- node_modules/caniuse-lite/data/regions/SD.js | 2 +- node_modules/caniuse-lite/data/regions/SE.js | 2 +- node_modules/caniuse-lite/data/regions/SG.js | 2 +- node_modules/caniuse-lite/data/regions/SH.js | 2 +- node_modules/caniuse-lite/data/regions/SI.js | 2 +- node_modules/caniuse-lite/data/regions/SK.js | 2 +- node_modules/caniuse-lite/data/regions/SL.js | 2 +- node_modules/caniuse-lite/data/regions/SM.js | 2 +- node_modules/caniuse-lite/data/regions/SN.js | 2 +- node_modules/caniuse-lite/data/regions/SO.js | 2 +- node_modules/caniuse-lite/data/regions/SR.js | 2 +- node_modules/caniuse-lite/data/regions/ST.js | 2 +- node_modules/caniuse-lite/data/regions/SV.js | 2 +- node_modules/caniuse-lite/data/regions/SY.js | 2 +- node_modules/caniuse-lite/data/regions/SZ.js | 2 +- node_modules/caniuse-lite/data/regions/TC.js | 2 +- node_modules/caniuse-lite/data/regions/TD.js | 2 +- node_modules/caniuse-lite/data/regions/TG.js | 2 +- node_modules/caniuse-lite/data/regions/TH.js | 2 +- node_modules/caniuse-lite/data/regions/TJ.js | 2 +- node_modules/caniuse-lite/data/regions/TK.js | 2 +- node_modules/caniuse-lite/data/regions/TL.js | 2 +- node_modules/caniuse-lite/data/regions/TM.js | 2 +- node_modules/caniuse-lite/data/regions/TN.js | 2 +- node_modules/caniuse-lite/data/regions/TO.js | 2 +- node_modules/caniuse-lite/data/regions/TR.js | 2 +- node_modules/caniuse-lite/data/regions/TT.js | 2 +- node_modules/caniuse-lite/data/regions/TV.js | 2 +- node_modules/caniuse-lite/data/regions/TW.js | 2 +- node_modules/caniuse-lite/data/regions/TZ.js | 2 +- node_modules/caniuse-lite/data/regions/UA.js | 2 +- node_modules/caniuse-lite/data/regions/UG.js | 2 +- node_modules/caniuse-lite/data/regions/US.js | 2 +- node_modules/caniuse-lite/data/regions/UY.js | 2 +- node_modules/caniuse-lite/data/regions/UZ.js | 2 +- node_modules/caniuse-lite/data/regions/VA.js | 2 +- node_modules/caniuse-lite/data/regions/VC.js | 2 +- node_modules/caniuse-lite/data/regions/VE.js | 2 +- node_modules/caniuse-lite/data/regions/VG.js | 2 +- node_modules/caniuse-lite/data/regions/VI.js | 2 +- node_modules/caniuse-lite/data/regions/VN.js | 2 +- node_modules/caniuse-lite/data/regions/VU.js | 2 +- node_modules/caniuse-lite/data/regions/WF.js | 2 +- node_modules/caniuse-lite/data/regions/WS.js | 2 +- node_modules/caniuse-lite/data/regions/YE.js | 2 +- node_modules/caniuse-lite/data/regions/YT.js | 2 +- node_modules/caniuse-lite/data/regions/ZA.js | 2 +- node_modules/caniuse-lite/data/regions/ZM.js | 2 +- node_modules/caniuse-lite/data/regions/ZW.js | 2 +- .../caniuse-lite/data/regions/alt-af.js | 2 +- .../caniuse-lite/data/regions/alt-an.js | 2 +- .../caniuse-lite/data/regions/alt-as.js | 2 +- .../caniuse-lite/data/regions/alt-eu.js | 2 +- .../caniuse-lite/data/regions/alt-na.js | 2 +- .../caniuse-lite/data/regions/alt-oc.js | 2 +- .../caniuse-lite/data/regions/alt-sa.js | 2 +- .../caniuse-lite/data/regions/alt-ww.js | 2 +- node_modules/caniuse-lite/package.json | 65 +- node_modules/chalk/package.json | 91 +- node_modules/color-convert/package.json | 88 +- node_modules/color-name/package.json | 65 +- node_modules/colorette/LICENSE.md | 7 - node_modules/colorette/README.md | 111 - node_modules/colorette/colorette.d.ts | 49 - node_modules/colorette/index.cjs | 73 - node_modules/colorette/index.js | 73 - node_modules/colorette/package.json | 77 - node_modules/commander/package.json | 91 +- node_modules/commondir/package.json | 73 +- node_modules/concat-map/package.json | 74 +- node_modules/convert-source-map/package.json | 81 +- node_modules/core-js-compat/LICENSE | 2 +- node_modules/core-js-compat/data.json | 317 +- node_modules/core-js-compat/entries.json | 366 +- node_modules/core-js-compat/external.json | 1 - .../core-js-compat/modules-by-versions.json | 17 - node_modules/core-js-compat/modules.json | 13 - .../core-js-compat/node_modules/.bin/semver | 4 +- .../node_modules/.bin/semver.cmd | 4 +- .../node_modules/.bin/semver.ps1 | 4 +- .../node_modules/semver/package.json | 71 +- node_modules/core-js-compat/package.json | 56 +- node_modules/core-js-compat/targets-parser.js | 2 + node_modules/debug/package.json | 146 +- node_modules/debug/src/browser.js | 25 +- node_modules/debug/src/common.js | 51 +- node_modules/debug/src/node.js | 8 +- node_modules/deepmerge/package.json | 89 +- node_modules/define-properties/package.json | 102 +- .../electron-to-chromium/chromium-versions.js | 34 +- .../full-chromium-versions.js | 132 +- .../electron-to-chromium/full-versions.js | 92 +- .../electron-to-chromium/package.json | 82 +- node_modules/electron-to-chromium/versions.js | 6 +- node_modules/escalade/index.d.ts | 15 +- node_modules/escalade/package.json | 111 +- node_modules/escalade/readme.md | 22 - node_modules/escalade/sync/index.d.ts | 2 - .../escape-string-regexp/package.json | 79 +- node_modules/estree-walker/CHANGELOG.md | 9 + .../estree-walker/dist/estree-walker.umd.js | 312 +- .../dist/estree-walker.umd.js.map | 1 - node_modules/estree-walker/package.json | 77 +- .../estree-walker/src/estree-walker.js | 319 +- node_modules/estree-walker/src/index.ts | 150 +- node_modules/estree-walker/types/index.d.ts | 16 +- node_modules/esutils/package.json | 95 +- node_modules/find-cache-dir/package.json | 83 +- node_modules/find-up/package.json | 75 +- node_modules/fs-extra/package.json | 100 +- node_modules/fs.realpath/package.json | 74 +- node_modules/function-bind/package.json | 86 +- node_modules/gensync/index.js | 9 +- node_modules/gensync/package.json | 81 +- node_modules/gensync/test/index.test.js | 16 +- node_modules/get-intrinsic/.eslintignore | 1 - node_modules/get-intrinsic/.eslintrc | 36 - .../get-intrinsic/.github/FUNDING.yml | 12 - node_modules/get-intrinsic/.github/rebase.yml | 15 - .../.github/require-allow-edits.yml | 12 - node_modules/get-intrinsic/.nycrc | 14 - node_modules/get-intrinsic/.travis.yml | 10 - node_modules/get-intrinsic/CHANGELOG.md | 689 - node_modules/get-intrinsic/LICENSE | 21 - node_modules/get-intrinsic/README.md | 2 - node_modules/get-intrinsic/index.js | 313 - node_modules/get-intrinsic/package.json | 106 - .../get-intrinsic/test/GetIntrinsic.js | 231 - node_modules/glob/package.json | 88 +- node_modules/globals/package.json | 66 +- node_modules/graceful-fs/package.json | 89 +- node_modules/has-flag/index.js | 10 +- node_modules/has-flag/package.json | 69 +- node_modules/has-flag/readme.md | 19 + node_modules/has-symbols/package.json | 123 +- node_modules/has/LICENSE-MIT | 22 - node_modules/has/README.md | 18 - node_modules/has/package.json | 78 - node_modules/has/src/index.js | 5 - node_modules/has/test/index.js | 10 - node_modules/inflight/package.json | 70 +- node_modules/inherits/package.json | 65 +- node_modules/is-core-module/.eslintignore | 1 - node_modules/is-core-module/.eslintrc | 18 - .../is-core-module/.github/FUNDING.yml | 12 - .../.github/workflows/node-4+.yml | 54 - .../.github/workflows/node-iojs.yml | 58 - .../.github/workflows/node-pretest.yml | 26 - .../.github/workflows/node-zero.yml | 58 - .../.github/workflows/rebase.yml | 15 - .../.github/workflows/require-allow-edits.yml | 14 - node_modules/is-core-module/.nycrc | 13 - node_modules/is-core-module/CHANGELOG.md | 58 - node_modules/is-core-module/LICENSE | 20 - node_modules/is-core-module/README.md | 37 - node_modules/is-core-module/core.json | 83 - node_modules/is-core-module/index.js | 69 - node_modules/is-core-module/package.json | 98 - node_modules/is-core-module/test/index.js | 83 - node_modules/is-module/package.json | 62 +- node_modules/is-reference/package.json | 90 +- node_modules/jest-worker/README.md | 2 + node_modules/jest-worker/build/index.js | 4 +- node_modules/jest-worker/build/types.d.ts | 58 +- .../jest-worker/build/workers/processChild.js | 7 +- .../jest-worker/build/workers/threadChild.js | 7 +- .../node_modules/has-flag/index.d.ts | 39 - .../node_modules/has-flag/index.js | 8 - .../jest-worker/node_modules/has-flag/license | 9 - .../node_modules/has-flag/package.json | 82 - .../node_modules/has-flag/readme.md | 89 - .../node_modules/supports-color/package.json | 71 +- node_modules/jest-worker/package.json | 63 +- node_modules/js-tokens/package.json | 77 +- node_modules/jsesc/package.json | 96 +- node_modules/json5/package.json | 136 +- node_modules/jsonfile/package.json | 73 +- node_modules/locate-path/package.json | 69 +- .../lodash._reinterpolate/package.json | 87 +- node_modules/lodash.template/package.json | 80 +- .../lodash.templatesettings/package.json | 76 +- node_modules/lodash/package.json | 75 +- node_modules/magic-string/package.json | 82 +- .../make-dir/node_modules/.bin/semver | 4 +- .../make-dir/node_modules/.bin/semver.cmd | 4 +- .../make-dir/node_modules/.bin/semver.ps1 | 4 +- .../make-dir/node_modules/semver/package.json | 69 +- node_modules/make-dir/package.json | 85 +- node_modules/merge-stream/package.json | 68 +- node_modules/minimatch/package.json | 82 +- node_modules/minimist/package.json | 81 +- node_modules/ms/package.json | 77 +- .../node-releases/data/processed/envs.json | 114 +- .../node-releases/data/raw/nodejs.json | 48 +- .../release-schedule/release-schedule.json | 19 +- node_modules/node-releases/package.json | 73 +- node_modules/object-keys/package.json | 99 +- node_modules/object.assign/.editorconfig | 2 +- node_modules/object.assign/.eslintignore | 1 - node_modules/object.assign/.eslintrc | 19 +- .../object.assign/.github/FUNDING.yml | 12 - .../.github/workflows/rebase.yml | 15 - .../.github/workflows/require-allow-edits.yml | 14 - node_modules/object.assign/.nycrc | 14 - node_modules/object.assign/CHANGELOG.md | 24 +- node_modules/object.assign/dist/browser.js | 727 +- node_modules/object.assign/hasSymbols.js | 12 +- node_modules/object.assign/implementation.js | 13 +- node_modules/object.assign/index.js | 11 +- node_modules/object.assign/package.json | 128 +- node_modules/object.assign/polyfill.js | 12 +- node_modules/object.assign/test/native.js | 8 +- node_modules/object.assign/test/ses-compat.js | 12 - node_modules/object.assign/test/shimmed.js | 8 +- node_modules/object.assign/test/tests.js | 17 +- node_modules/once/package.json | 69 +- node_modules/p-limit/package.json | 79 +- node_modules/p-locate/package.json | 75 +- node_modules/p-try/package.json | 65 +- node_modules/path-exists/package.json | 65 +- node_modules/path-is-absolute/package.json | 61 +- node_modules/path-parse/package.json | 66 +- node_modules/picomatch/package.json | 86 +- node_modules/pkg-dir/package.json | 71 +- node_modules/randombytes/package.json | 74 +- .../package.json | 76 +- node_modules/regenerate/README.md | 6 + node_modules/regenerate/package.json | 73 +- node_modules/regenerate/regenerate.js | 7 +- node_modules/regenerator-runtime/package.json | 49 +- .../regenerator-transform/package.json | 69 +- node_modules/regexpu-core/README.md | 6 +- node_modules/regexpu-core/data/iu-mappings.js | 344 +- node_modules/regexpu-core/package.json | 106 +- node_modules/regexpu-core/rewrite-pattern.js | 16 +- node_modules/regjsgen/package.json | 76 +- .../regjsparser/node_modules/.bin/jsesc | 4 +- .../regjsparser/node_modules/.bin/jsesc.cmd | 4 +- .../regjsparser/node_modules/.bin/jsesc.ps1 | 4 +- .../node_modules/jsesc/package.json | 104 +- node_modules/regjsparser/package.json | 77 +- node_modules/resolve/.editorconfig | 24 +- .../resolve/.github/workflows/node-4+.yml | 54 - .../resolve/.github/workflows/node-iojs.yml | 55 - .../.github/workflows/node-pretest.yml | 27 - .../resolve/.github/workflows/node-zero.yml | 55 - .../resolve/.github/workflows/rebase.yml | 15 - .../.github/workflows/require-allow-edits.yml | 14 - node_modules/resolve/appveyor.yml | 42 +- node_modules/resolve/lib/async.js | 11 +- node_modules/resolve/lib/core.js | 4 +- node_modules/resolve/lib/core.json | 9 +- node_modules/resolve/lib/is-core.js | 4 +- node_modules/resolve/lib/sync.js | 11 +- node_modules/resolve/package.json | 109 +- node_modules/resolve/readme.markdown | 28 +- node_modules/resolve/test/core.js | 12 +- node_modules/resolve/test/shadowed_core.js | 16 - node_modules/resolve/test/symlinks.js | 5 +- .../rollup-plugin-banner/package.json | 72 +- .../rollup-plugin-banner2/CHANGELOG.md | 12 +- node_modules/rollup-plugin-banner2/README.md | 3 +- .../rollup-plugin-banner2/package.json | 100 +- .../rollup-plugin-terser/package.json | 87 +- .../dist/rollingcache.d.ts.map | 2 +- .../dist/rollup-plugin-typescript2.cjs.js | 156 +- .../dist/rollup-plugin-typescript2.cjs.js.map | 2 +- .../dist/rollup-plugin-typescript2.es.js | 116 +- .../dist/rollup-plugin-typescript2.es.js.map | 2 +- .../node_modules/resolve/package.json | 100 +- .../node_modules/tslib/package.json | 62 +- .../rollup-plugin-typescript2/package.json | 132 +- node_modules/rollup/CHANGELOG.md | 217 - node_modules/rollup/README.md | 4 +- node_modules/rollup/dist/bin/rollup | 120 +- node_modules/rollup/dist/es/rollup.browser.js | 6 +- node_modules/rollup/dist/es/rollup.js | 4 +- node_modules/rollup/dist/es/shared/rollup.js | 832 +- node_modules/rollup/dist/es/shared/watch.js | 214 +- node_modules/rollup/dist/loadConfigFile.js | 4 +- node_modules/rollup/dist/rollup.browser.js | 6 +- node_modules/rollup/dist/rollup.d.ts | 147 +- node_modules/rollup/dist/rollup.js | 4 +- node_modules/rollup/dist/shared/index.js | 102 +- .../rollup/dist/shared/loadConfigFile.js | 33 +- .../rollup/dist/shared/mergeOptions.js | 5 +- node_modules/rollup/dist/shared/rollup.js | 836 +- node_modules/rollup/dist/shared/watch-cli.js | 9 +- node_modules/rollup/dist/shared/watch.js | 120 +- node_modules/rollup/package.json | 216 +- node_modules/safe-buffer/index.js | 3 + node_modules/safe-buffer/package.json | 61 +- node_modules/semver/CHANGELOG.md | 35 + node_modules/semver/README.md | 93 +- node_modules/semver/bin/semver | 160 - node_modules/semver/package.json | 83 +- node_modules/semver/semver.js | 1483 -- .../serialize-javascript/package.json | 81 +- .../node_modules/source-map/package.json | 256 +- node_modules/source-map-support/package.json | 61 +- node_modules/source-map/README.md | 41 +- .../source-map/dist/source-map.debug.js | 289 +- node_modules/source-map/dist/source-map.js | 287 +- .../source-map/dist/source-map.min.js | 2 +- .../source-map/dist/source-map.min.js.map | 2 +- .../source-map/lib/source-map-consumer.js | 191 +- .../source-map/lib/source-map-generator.js | 9 + node_modules/source-map/lib/source-node.js | 4 +- node_modules/source-map/lib/util.js | 83 +- node_modules/source-map/package.json | 258 +- node_modules/sourcemap-codec/package.json | 88 +- node_modules/supports-color/index.js | 52 +- node_modules/supports-color/package.json | 73 +- node_modules/supports-color/readme.md | 16 +- node_modules/terser/CHANGELOG.md | 54 - node_modules/terser/README.md | 11 +- node_modules/terser/bin/terser.mjs | 21 - node_modules/terser/dist/bundle.min.js | 624 +- node_modules/terser/lib/ast.js | 61 +- node_modules/terser/lib/compress/index.js | 285 +- node_modules/terser/lib/equivalent-to.js | 3 - node_modules/terser/lib/minify.js | 8 +- node_modules/terser/lib/mozilla-ast.js | 63 +- node_modules/terser/lib/output.js | 38 +- node_modules/terser/lib/parse.js | 122 +- node_modules/terser/lib/scope.js | 28 +- node_modules/terser/lib/sourcemap.js | 16 +- node_modules/terser/lib/transform.js | 5 - .../node_modules/source-map/CHANGELOG.md | 43 - .../terser/node_modules/source-map/README.md | 136 +- .../source-map/dist/source-map.js | 6180 +++-- .../node_modules/source-map/lib/array-set.js | 159 +- .../node_modules/source-map/lib/base64-vlq.js | 51 +- .../node_modules/source-map/lib/base64.js | 53 +- .../source-map/lib/binary-search.js | 34 +- .../source-map/lib/mapping-list.js | 109 +- .../node_modules/source-map/lib/mappings.wasm | Bin 48693 -> 0 bytes .../node_modules/source-map/lib/read-wasm.js | 40 - .../source-map/lib/source-map-consumer.js | 1703 +- .../source-map/lib/source-map-generator.js | 324 +- .../source-map/lib/source-node.js | 479 +- .../node_modules/source-map/lib/util.js | 160 +- .../node_modules/source-map/lib/wasm.js | 107 - .../node_modules/source-map/package.json | 281 +- .../node_modules/source-map/source-map.d.ts | 359 +- .../node_modules/source-map/source-map.js | 6 +- node_modules/terser/package.json | 183 +- node_modules/terser/tools/terser.d.ts | 2 - node_modules/to-fast-properties/package.json | 61 +- node_modules/tslib/README.md | 26 +- node_modules/tslib/modules/index.js | 51 - node_modules/tslib/modules/package.json | 3 - node_modules/tslib/package.json | 66 +- node_modules/typescript/README.md | 9 +- .../lib/cs/diagnosticMessages.generated.json | 51 +- .../lib/de/diagnosticMessages.generated.json | 61 +- .../lib/es/diagnosticMessages.generated.json | 67 +- .../lib/fr/diagnosticMessages.generated.json | 77 +- .../lib/it/diagnosticMessages.generated.json | 73 +- .../lib/ja/diagnosticMessages.generated.json | 79 +- .../lib/ko/diagnosticMessages.generated.json | 53 +- node_modules/typescript/lib/lib.dom.d.ts | 185 +- .../typescript/lib/lib.dom.iterable.d.ts | 7 - .../typescript/lib/lib.es2015.iterable.d.ts | 8 +- .../typescript/lib/lib.es2015.promise.d.ts | 14 +- .../typescript/lib/lib.es2015.proxy.d.ts | 1 + .../lib/lib.es2015.symbol.wellknown.d.ts | 5 - .../lib/lib.es2017.sharedmemory.d.ts | 4 + node_modules/typescript/lib/lib.es2020.d.ts | 1 - .../typescript/lib/lib.es2020.intl.d.ts | 4 - .../lib/lib.es2020.sharedmemory.d.ts | 99 - node_modules/typescript/lib/lib.es5.d.ts | 26 +- node_modules/typescript/lib/lib.esnext.d.ts | 1 - .../typescript/lib/lib.esnext.weakref.d.ts | 75 - .../typescript/lib/lib.webworker.d.ts | 64 +- .../lib/lib.webworker.iterable.d.ts | 166 - .../lib/pl/diagnosticMessages.generated.json | 71 +- node_modules/typescript/lib/protocol.d.ts | 32 +- .../pt-br/diagnosticMessages.generated.json | 73 +- .../lib/ru/diagnosticMessages.generated.json | 79 +- .../lib/tr/diagnosticMessages.generated.json | 73 +- node_modules/typescript/lib/tsc.js | 14600 +++++------ node_modules/typescript/lib/tsserver.js | 21161 +++++++--------- .../typescript/lib/tsserverlibrary.d.ts | 593 +- .../typescript/lib/tsserverlibrary.js | 21143 +++++++-------- node_modules/typescript/lib/typescript.d.ts | 554 +- node_modules/typescript/lib/typescript.js | 20887 +++++++-------- .../typescript/lib/typescriptServices.d.ts | 554 +- .../typescript/lib/typescriptServices.js | 20887 +++++++-------- .../typescript/lib/typingsInstaller.js | 16271 +++++------- .../zh-cn/diagnosticMessages.generated.json | 71 +- .../zh-tw/diagnosticMessages.generated.json | 75 +- node_modules/typescript/package.json | 131 +- .../package.json | 62 +- .../package.json | 70 +- .../package.json | 66 +- .../package.json | 68 +- node_modules/universalify/package.json | 81 +- node_modules/wrappy/package.json | 77 +- 1640 files changed, 73579 insertions(+), 133888 deletions(-) create mode 100644 .gitignore create mode 100644 demo/js/main-for-vue2.js delete mode 100644 demo/js/main.js create mode 100644 demo/vue2.html delete mode 100644 node_modules/.bin/browserslist delete mode 100644 node_modules/.bin/browserslist.cmd delete mode 100644 node_modules/.bin/browserslist.ps1 delete mode 100644 node_modules/.bin/jsesc delete mode 100644 node_modules/.bin/jsesc.cmd delete mode 100644 node_modules/.bin/jsesc.ps1 delete mode 100644 node_modules/.bin/json5 delete mode 100644 node_modules/.bin/json5.cmd delete mode 100644 node_modules/.bin/json5.ps1 delete mode 100644 node_modules/.bin/parser delete mode 100644 node_modules/.bin/parser.cmd delete mode 100644 node_modules/.bin/parser.ps1 delete mode 100644 node_modules/.bin/regjsparser delete mode 100644 node_modules/.bin/regjsparser.cmd delete mode 100644 node_modules/.bin/regjsparser.ps1 delete mode 100644 node_modules/.bin/semver delete mode 100644 node_modules/.bin/semver.cmd delete mode 100644 node_modules/.bin/semver.ps1 delete mode 100644 node_modules/.bin/terser delete mode 100644 node_modules/.bin/terser.cmd delete mode 100644 node_modules/.bin/terser.ps1 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/6e96f10b2453abe2284fcac86f4f114057c5af72 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/71d0728306715942daacf4676366fd6a07b6b666 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/6e96f10b2453abe2284fcac86f4f114057c5af72 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/6e96f10b2453abe2284fcac86f4f114057c5af72 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/1c71620f0f64c282751681bcbbf1857fa7b7b906 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/22c7731e225cfb17a9b74dedae0216837a12d163 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/41c393035312d6bc3286d4224ecba574f0de1915 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/8507ed218024f52c1ee576a6f7f04b4740e12996 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/a9368f7e7383c0e591fb7e73549570e38aade49f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/af7c746871ddaade47bc7ee702b80e980877bc94 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/e79b9f180b673e0eb891e4974b2b9006e56cf60b delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/code/cache/71d0728306715942daacf4676366fd6a07b6b666 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/code/cache/f6237713b6c1a1c850dff265f54577dfa2c1cf9c delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/semanticDiagnostics/cache/f6237713b6c1a1c850dff265f54577dfa2c1cf9c delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/syntacticDiagnostics/cache/f6237713b6c1a1c850dff265f54577dfa2c1cf9c delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/1c71620f0f64c282751681bcbbf1857fa7b7b906 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/22c7731e225cfb17a9b74dedae0216837a12d163 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/472dd740db5f8940713eec824d1f866ae3a38218 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/8507ed218024f52c1ee576a6f7f04b4740e12996 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/a9368f7e7383c0e591fb7e73549570e38aade49f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/af7c746871ddaade47bc7ee702b80e980877bc94 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/e79b9f180b673e0eb891e4974b2b9006e56cf60b delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/code/cache/0f0fac159449201b6d39193472434fbb085c928d delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/code/cache/71d0728306715942daacf4676366fd6a07b6b666 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/semanticDiagnostics/cache/0f0fac159449201b6d39193472434fbb085c928d delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/syntacticDiagnostics/cache/0f0fac159449201b6d39193472434fbb085c928d delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/1c71620f0f64c282751681bcbbf1857fa7b7b906 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/22c7731e225cfb17a9b74dedae0216837a12d163 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/472dd740db5f8940713eec824d1f866ae3a38218 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/8507ed218024f52c1ee576a6f7f04b4740e12996 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/a9368f7e7383c0e591fb7e73549570e38aade49f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/af7c746871ddaade47bc7ee702b80e980877bc94 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/e79b9f180b673e0eb891e4974b2b9006e56cf60b delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/71d0728306715942daacf4676366fd6a07b6b666 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/b797606cd05a0fab2bbc583e3b5bb9070aef8875 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/b797606cd05a0fab2bbc583e3b5bb9070aef8875 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/b797606cd05a0fab2bbc583e3b5bb9070aef8875 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/1c71620f0f64c282751681bcbbf1857fa7b7b906 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/22c7731e225cfb17a9b74dedae0216837a12d163 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/41c393035312d6bc3286d4224ecba574f0de1915 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/8507ed218024f52c1ee576a6f7f04b4740e12996 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/a9368f7e7383c0e591fb7e73549570e38aade49f delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/af7c746871ddaade47bc7ee702b80e980877bc94 delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/e79b9f180b673e0eb891e4974b2b9006e56cf60b delete mode 100644 node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df delete mode 100644 node_modules/@babel/core/src/config/files/index-browser.js delete mode 100644 node_modules/@babel/core/src/config/files/index.js delete mode 100644 node_modules/@babel/core/src/transform-file-browser.js delete mode 100644 node_modules/@babel/core/src/transform-file.js delete mode 100644 node_modules/@babel/helper-member-expression-to-functions/lib/index.js.map delete mode 100644 node_modules/@babel/helper-validator-option/LICENSE delete mode 100644 node_modules/@babel/helper-validator-option/README.md delete mode 100644 node_modules/@babel/helper-validator-option/lib/find-suggestion.js delete mode 100644 node_modules/@babel/helper-validator-option/lib/index.js delete mode 100644 node_modules/@babel/helper-validator-option/lib/validator.js delete mode 100644 node_modules/@babel/helper-validator-option/package.json delete mode 100644 node_modules/@babel/plugin-proposal-optional-chaining/lib/index.js.map delete mode 100644 node_modules/@babel/types/lib/ast-types/generated/index.js delete mode 100644 node_modules/@babel/types/lib/builders/generated/uppercase.js delete mode 100644 node_modules/@babel/types/lib/converters/Scope.js delete mode 100644 node_modules/@babel/types/lib/index-legacy.d.ts delete mode 100644 node_modules/@babel/types/scripts/generators/asserts.js delete mode 100644 node_modules/@babel/types/scripts/generators/ast-types.js delete mode 100644 node_modules/@babel/types/scripts/generators/builders.js delete mode 100644 node_modules/@babel/types/scripts/generators/constants.js delete mode 100644 node_modules/@babel/types/scripts/generators/typescript-legacy.js delete mode 100644 node_modules/@babel/types/scripts/generators/validators.js delete mode 100644 node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/LICENSE delete mode 100644 node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/dist/esm/estree-walker.js delete mode 100644 node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/dist/esm/package.json delete mode 100644 node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/dist/umd/estree-walker.js delete mode 100644 node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/src/async.js delete mode 100644 node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/src/index.js delete mode 100644 node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/src/package.json delete mode 100644 node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/src/sync.js delete mode 100644 node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/src/walker.js delete mode 100644 node_modules/@rollup/plugin-commonjs/node_modules/estree-walker/types/tsconfig.tsbuildinfo delete mode 100644 node_modules/@types/node/async_hooks.d.ts delete mode 100644 node_modules/@types/node/buffer.d.ts delete mode 100644 node_modules/@types/node/child_process.d.ts delete mode 100644 node_modules/@types/node/cluster.d.ts delete mode 100644 node_modules/@types/node/console.d.ts delete mode 100644 node_modules/@types/node/constants.d.ts delete mode 100644 node_modules/@types/node/crypto.d.ts delete mode 100644 node_modules/@types/node/dgram.d.ts delete mode 100644 node_modules/@types/node/dns.d.ts delete mode 100644 node_modules/@types/node/domain.d.ts delete mode 100644 node_modules/@types/node/events.d.ts delete mode 100644 node_modules/@types/node/fs.d.ts delete mode 100644 node_modules/@types/node/fs/promises.d.ts delete mode 100644 node_modules/@types/node/globals.d.ts delete mode 100644 node_modules/@types/node/globals.global.d.ts delete mode 100644 node_modules/@types/node/http.d.ts delete mode 100644 node_modules/@types/node/http2.d.ts delete mode 100644 node_modules/@types/node/https.d.ts delete mode 100644 node_modules/@types/node/inspector.d.ts delete mode 100644 node_modules/@types/node/module.d.ts delete mode 100644 node_modules/@types/node/net.d.ts delete mode 100644 node_modules/@types/node/os.d.ts delete mode 100644 node_modules/@types/node/path.d.ts delete mode 100644 node_modules/@types/node/perf_hooks.d.ts delete mode 100644 node_modules/@types/node/process.d.ts delete mode 100644 node_modules/@types/node/punycode.d.ts delete mode 100644 node_modules/@types/node/querystring.d.ts delete mode 100644 node_modules/@types/node/readline.d.ts delete mode 100644 node_modules/@types/node/repl.d.ts delete mode 100644 node_modules/@types/node/stream.d.ts delete mode 100644 node_modules/@types/node/string_decoder.d.ts delete mode 100644 node_modules/@types/node/timers.d.ts delete mode 100644 node_modules/@types/node/tls.d.ts delete mode 100644 node_modules/@types/node/trace_events.d.ts delete mode 100644 node_modules/@types/node/ts3.4/assert.d.ts delete mode 100644 node_modules/@types/node/ts3.4/globals.global.d.ts delete mode 100644 node_modules/@types/node/tty.d.ts delete mode 100644 node_modules/@types/node/url.d.ts delete mode 100644 node_modules/@types/node/util.d.ts delete mode 100644 node_modules/@types/node/v8.d.ts delete mode 100644 node_modules/@types/node/vm.d.ts delete mode 100644 node_modules/@types/node/wasi.d.ts delete mode 100644 node_modules/@types/node/worker_threads.d.ts delete mode 100644 node_modules/@types/node/zlib.d.ts delete mode 100644 node_modules/babel-plugin-add-module-exports/README.md delete mode 100644 node_modules/babel-plugin-add-module-exports/lib/index.js delete mode 100644 node_modules/babel-plugin-add-module-exports/lib/index.js.map delete mode 100644 node_modules/babel-plugin-add-module-exports/package.json delete mode 100644 node_modules/browserslist/error.d.ts delete mode 100644 node_modules/browserslist/index.d.ts delete mode 100644 node_modules/call-bind/.eslintrc delete mode 100644 node_modules/call-bind/.github/FUNDING.yml delete mode 100644 node_modules/call-bind/.github/rebase.yml delete mode 100644 node_modules/call-bind/.github/require-allow-edits.yml delete mode 100644 node_modules/call-bind/.travis.yml delete mode 100644 node_modules/call-bind/CHANGELOG.md delete mode 100644 node_modules/call-bind/LICENSE delete mode 100644 node_modules/call-bind/README.md delete mode 100644 node_modules/call-bind/callBound.js delete mode 100644 node_modules/call-bind/index.js delete mode 100644 node_modules/call-bind/package.json delete mode 100644 node_modules/call-bind/test/callBound.js delete mode 100644 node_modules/call-bind/test/index.js delete mode 100644 node_modules/caniuse-lite/data/features/cookie-store-api.js delete mode 100644 node_modules/caniuse-lite/data/features/css-content-visibility.js delete mode 100644 node_modules/caniuse-lite/data/features/import-maps.js delete mode 100644 node_modules/colorette/LICENSE.md delete mode 100644 node_modules/colorette/README.md delete mode 100644 node_modules/colorette/colorette.d.ts delete mode 100644 node_modules/colorette/index.cjs delete mode 100644 node_modules/colorette/index.js delete mode 100644 node_modules/colorette/package.json delete mode 100644 node_modules/escalade/sync/index.d.ts delete mode 100644 node_modules/estree-walker/dist/estree-walker.umd.js.map delete mode 100644 node_modules/get-intrinsic/.eslintignore delete mode 100644 node_modules/get-intrinsic/.eslintrc delete mode 100644 node_modules/get-intrinsic/.github/FUNDING.yml delete mode 100644 node_modules/get-intrinsic/.github/rebase.yml delete mode 100644 node_modules/get-intrinsic/.github/require-allow-edits.yml delete mode 100644 node_modules/get-intrinsic/.nycrc delete mode 100644 node_modules/get-intrinsic/.travis.yml delete mode 100644 node_modules/get-intrinsic/CHANGELOG.md delete mode 100644 node_modules/get-intrinsic/LICENSE delete mode 100644 node_modules/get-intrinsic/README.md delete mode 100644 node_modules/get-intrinsic/index.js delete mode 100644 node_modules/get-intrinsic/package.json delete mode 100644 node_modules/get-intrinsic/test/GetIntrinsic.js delete mode 100644 node_modules/has/LICENSE-MIT delete mode 100644 node_modules/has/README.md delete mode 100644 node_modules/has/package.json delete mode 100644 node_modules/has/src/index.js delete mode 100644 node_modules/has/test/index.js delete mode 100644 node_modules/is-core-module/.eslintignore delete mode 100644 node_modules/is-core-module/.eslintrc delete mode 100644 node_modules/is-core-module/.github/FUNDING.yml delete mode 100644 node_modules/is-core-module/.github/workflows/node-4+.yml delete mode 100644 node_modules/is-core-module/.github/workflows/node-iojs.yml delete mode 100644 node_modules/is-core-module/.github/workflows/node-pretest.yml delete mode 100644 node_modules/is-core-module/.github/workflows/node-zero.yml delete mode 100644 node_modules/is-core-module/.github/workflows/rebase.yml delete mode 100644 node_modules/is-core-module/.github/workflows/require-allow-edits.yml delete mode 100644 node_modules/is-core-module/.nycrc delete mode 100644 node_modules/is-core-module/CHANGELOG.md delete mode 100644 node_modules/is-core-module/LICENSE delete mode 100644 node_modules/is-core-module/README.md delete mode 100644 node_modules/is-core-module/core.json delete mode 100644 node_modules/is-core-module/index.js delete mode 100644 node_modules/is-core-module/package.json delete mode 100644 node_modules/is-core-module/test/index.js delete mode 100644 node_modules/jest-worker/node_modules/has-flag/index.d.ts delete mode 100644 node_modules/jest-worker/node_modules/has-flag/index.js delete mode 100644 node_modules/jest-worker/node_modules/has-flag/license delete mode 100644 node_modules/jest-worker/node_modules/has-flag/package.json delete mode 100644 node_modules/jest-worker/node_modules/has-flag/readme.md delete mode 100644 node_modules/object.assign/.eslintignore delete mode 100644 node_modules/object.assign/.github/FUNDING.yml delete mode 100644 node_modules/object.assign/.github/workflows/rebase.yml delete mode 100644 node_modules/object.assign/.github/workflows/require-allow-edits.yml delete mode 100644 node_modules/object.assign/.nycrc delete mode 100644 node_modules/object.assign/test/ses-compat.js delete mode 100644 node_modules/resolve/.github/workflows/node-4+.yml delete mode 100644 node_modules/resolve/.github/workflows/node-iojs.yml delete mode 100644 node_modules/resolve/.github/workflows/node-pretest.yml delete mode 100644 node_modules/resolve/.github/workflows/node-zero.yml delete mode 100644 node_modules/resolve/.github/workflows/rebase.yml delete mode 100644 node_modules/resolve/.github/workflows/require-allow-edits.yml delete mode 100644 node_modules/semver/bin/semver delete mode 100644 node_modules/semver/semver.js delete mode 100644 node_modules/terser/bin/terser.mjs delete mode 100644 node_modules/terser/node_modules/source-map/lib/mappings.wasm delete mode 100644 node_modules/terser/node_modules/source-map/lib/read-wasm.js delete mode 100644 node_modules/terser/node_modules/source-map/lib/wasm.js delete mode 100644 node_modules/tslib/modules/index.js delete mode 100644 node_modules/tslib/modules/package.json delete mode 100644 node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts delete mode 100644 node_modules/typescript/lib/lib.esnext.weakref.d.ts delete mode 100644 node_modules/typescript/lib/lib.webworker.iterable.d.ts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/README.md b/README.md index 4fe94bd..31ed9b8 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,11 @@ vue-baidu-analytics 使用说明 基于Vue开发的百度统计插件,可以在 `Vue-CLI脚手架项目` 或者 `引入了Vue相关CDN的普通页面` 上使用,使用本插件的项目需要引入 `Vue Router`。 -注意:本插件在 `1.0.0` 版本的部分参数和api现在有所弃用,请按照当前最新文档说明使用新版本,或者安装以前的 `1.0.0` 旧版本使用。 +> @v2.0版本更新: + +> 最新版支持 Vue 3.x,同时兼容 Vue 2.x 使用,具体使用方法请看下方说明及demo。 + +> 对Vue 3.0感兴趣,但还在观望的同学,欢迎阅读我踩坑总结的:[Vue 3.0 学习教程](https://vue3.chengpeiquan.com/) (持续更新ing) ## 功能 @@ -17,11 +21,29 @@ vue-baidu-analytics 使用说明 * 支持手动提交事件分析上报 +* 自动识别Vue版本,自动适配Vue 2.0/3.0使用(插件2.0版本新增) + ## 预览 demo已开启debug模式,可开启控制台查看上报情况。 -点击预览:[vue-baidu-analytics demo](https://chengpeiquan.github.io/vue-baidu-analytics/demo/ "vue-baidu-analytics demo") +Vue 2.0 版本:[vue-baidu-analytics demo for Vue 2.x](https://chengpeiquan.github.io/vue-baidu-analytics/demo/vue2.html "vue-baidu-analytics demo for Vue 2.x") + +Vue 3.0 版本:[vue-baidu-analytics demo for Vue 3.x](https://chengpeiquan.github.io/vue-baidu-analytics/demo/vue3.html "vue-baidu-analytics demo for Vue 3.x") + +## 安装 + +方式一:通过npm安装 + +``` +npm install vue-baidu-analytics --save-dev +``` + +方式二:通过cdn安装 + +```html + +``` ## 参数 @@ -31,20 +53,6 @@ router|是|object|Vue Router,本插件基于路由使用 siteIdList|是|object Array|百度统计的站点id列表,item为站点id
只有一个站点需要上报就保留一个item即可 isDebug|否|boolean|是否开启debug模式,默认 `false`
开启后会在控制台打印上报信息,**上线前记得关闭** -## 安装 - -### 通过npm安装 - -``` -npm install vue-baidu-analytics --save-dev -``` - -### 通过cdn安装 - -```html - -``` - ## 使用 通过npm安装的项目,需要先在 `main.js` 里引入插件(通过cdn则无需该步骤)。 @@ -53,10 +61,14 @@ npm install vue-baidu-analytics --save-dev import baiduAnalytics from 'vue-baidu-analytics' ``` -安装插件后,在 `main.js` 引入以下代码,即可开启自动上报功能,首次访问页面会部署统计代码并提交第一次访问数据上报。 +安装插件后,在 `main.js` 引入以下代码(注意区分Vue2.0和Vue3.0的用法区别),即可开启自动上报功能,首次访问页面会部署统计代码并提交第一次访问数据上报。 后续在路由切换过程中,也会根据路由的切换提交相应的url信息到友盟统计。 +### 在 Vue 2.0 里使用 + +可参考demo:[main.js - Vue 2.0 demo](https://chengpeiquan.github.io/vue-baidu-analytics/demo/js/main-for-vue2.js) + ```js Vue.use(baiduAnalytics, { router: router, @@ -69,6 +81,33 @@ Vue.use(baiduAnalytics, { }); ``` +### 在 Vue 3.0 里使用 + +可参考demo:[main.js - Vue 3.0 demo](https://chengpeiquan.github.io/vue-baidu-analytics/demo/js/main-for-vue3.js) + +```js +/** + * 初始化Vue + */ +createApp(app) + // 启动路由 + .use(router) + + // 启动插件 + .use(baiduAnalytics, { + router: router, + siteIdList: [ + 'aaaaaaaaaaaaaaaaaaa', + 'bbbbbbbbbbbbbbbbbbb', + 'ccccccccccccccccccc' + ], + isDebug: true + }) + + // 挂载到节点上 + .mount('#app'); +``` + 可在开发环境打开debug模式了解相关的上报情况(上线前记得关闭debug)。 ## 方法 @@ -91,17 +130,19 @@ pageUrl|否|String|提交上报的url,必须是以 `/` 开头的相对路径手动上报PV -``` - -在method里使用 +在 Vue 2.0 里使用 ```js -// this是Vue实例 -this.$pushBAIDU.pv('/home'); +this.$pushBAIDU.pv(this.pageUrl); +``` + +在 Vue 3.0 里使用(需要遵循Vue3的规范,引入一个Vue自带的代理组件) + +```js +const { getCurrentInstance } = Vue; +const { proxy } = getCurrentInstance(); + +proxy.$pushBAIDU.pv(pageUrl.value); ``` ### 手动上报事件分析 @@ -121,15 +162,27 @@ value|否|number|该事件的分值,默认0 **使用示范** -在template里使用(比如:点击了一个id为123的首页banner) - -```html - -``` - -在method里使用(比如:点击了一个id为123的首页banner,并设置该事件的价值为1) +在 Vue 2.0 里使用 ```js -// this是Vue实例 -this.$pushBAIDU.event('首页banner', '点击', 'bannerId_123', 1); +this.$pushBAIDU.event( + this.category, + this.action, + this.label, + this.value +); +``` + +在 Vue 3.0 里使用(需要遵循Vue3的规范,引入一个Vue自带的代理组件) + +```js +const { getCurrentInstance } = Vue; +const { proxy } = getCurrentInstance(); + +proxy.$pushBAIDU.event( + category.value, + action.value, + label.value, + value.value +); ``` \ No newline at end of file diff --git a/demo/css/style.css b/demo/css/style.css index f1cc04e..27b96d1 100644 --- a/demo/css/style.css +++ b/demo/css/style.css @@ -8,6 +8,17 @@ .section { margin-bottom: 40px; } +.title { + font-size: 40px; + color: #000; +} +.link { + color: #666; + text-decoration: none; +} +.link:hover { + color: #000; +} .nav { margin-bottom: 20px; } @@ -31,6 +42,7 @@ align-items: center; width: 60px; font-size: 14px; + color: #333; margin-right: 20px; } .input { diff --git a/demo/js/main-for-vue2.js b/demo/js/main-for-vue2.js new file mode 100644 index 0000000..62881a9 --- /dev/null +++ b/demo/js/main-for-vue2.js @@ -0,0 +1,56 @@ +/** + * 初始化路由 + * routes是来自 js/routes.js 里面的配置 + */ +const router = new VueRouter({ + routes, + linkActiveClass: 'cur', + linkExactActiveClass: 'cur' +}); + + +/** + * 引入统计插件 + */ +Vue.use(baiduAnalytics, { + router: router, + siteIdList: [ + 'aaaaaaaaaaaaaaaaaaa', + 'bbbbbbbbbbbbbbbbbbb', + 'ccccccccccccccccccc' + ], + isDebug: true +}); + + +/** + * 初始化Vue + */ +const app = new Vue({ + el: '#app', + router, + data () { + return { + pageUrl: '', + category: '', + action: '', + label: '', + value: '' + } + }, + mounted () { + }, + methods: { + pv () { + this.$pushBAIDU.pv(this.pageUrl); + }, + event () { + this.$pushBAIDU.event( + this.category, + this.action, + this.label, + this.value + ); + } + } +}); \ No newline at end of file diff --git a/demo/js/main-for-vue3.js b/demo/js/main-for-vue3.js index f50e92c..013c5c2 100644 --- a/demo/js/main-for-vue3.js +++ b/demo/js/main-for-vue3.js @@ -2,7 +2,7 @@ * 导入需要用到的组件 */ const { createRouter, createWebHashHistory } = VueRouter; -const { createApp, defineComponent, getCurrentInstance, ref } = Vue; +const { createApp, getCurrentInstance, ref } = Vue; /** diff --git a/demo/js/main.js b/demo/js/main.js deleted file mode 100644 index d9da3e7..0000000 --- a/demo/js/main.js +++ /dev/null @@ -1,67 +0,0 @@ -// 定义路由信息 -const routes = [ - { - path: '/', - redirect: '/page1' - }, - { - path: '/page1', - component: { - template: '
当前是 Page1 的路由
' - } - }, - { - path: '/page2', - component: { - template: '
当前是 Page2 的路由
' - } - }, - { - path: '/page3', - component: { - template: '
当前是 Page3 的路由
' - } - } -]; - -// 初始化路由 -const router = new VueRouter({ - routes, - linkActiveClass: 'cur', - linkExactActiveClass: 'cur' -}); - -// 引入统计插件 -Vue.use(baiduAnalytics, { - router: router, - siteIdList: [ - '8dca8e2532df48ea7f1b15c714588691' - ], - isDebug: true -}); - -// 初始化Vue -const app = new Vue({ - el: '#app', - router, - data () { - return { - pageUrl: '', - category: '', - action: '', - label: '', - value: '' - } - }, - mounted () { - }, - methods: { - pv () { - // this.$pushBAIDU.pv(this.pageUrl); - console.log(baiduAnalytics.pushBAIDU); - }, - event () { - this.$pushBAIDU.event(this.category, this.action, this.label, this.value); - } - } -}); \ No newline at end of file diff --git a/demo/vue2.html b/demo/vue2.html new file mode 100644 index 0000000..b6ac963 --- /dev/null +++ b/demo/vue2.html @@ -0,0 +1,66 @@ + + + + + + [Vue2] vue baidu analytics demo + + + + + + +
+ +
+

Hello Vue2 App!

+ [ 切换到vue3 ] +
+ +
+

切换路由自动上报测试

+ + +
+ +
+

提交pv测试

+ + +
+ +
+

提交event测试

+ + + + + +
+
+ + + + + + + \ No newline at end of file diff --git a/demo/vue3.html b/demo/vue3.html index 5ef161d..680c0a2 100644 --- a/demo/vue3.html +++ b/demo/vue3.html @@ -11,7 +11,11 @@
-

Hello Vue3 App!

+ +
+

Hello Vue3 App!

+ [ 切换到vue2 ] +

切换路由自动上报测试

diff --git a/dist/vue-baidu-analytics.js b/dist/vue-baidu-analytics.js index b083a61..8952f3d 100644 --- a/dist/vue-baidu-analytics.js +++ b/dist/vue-baidu-analytics.js @@ -6,7 +6,7 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.baiduAnalytics = factory()); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.baiduAnalytics = factory()); }(this, (function () { 'use strict'; var BAIDU = (function () { @@ -116,7 +116,7 @@ throw new Error('[vue-baidu-analytics] Missing tracking domain ID, add at least one of baidu analytics.'); } var pushBAIDU = new PushBAIDU(siteIdList, isDebug); - var VUE_VERSION = getVueVersion(Vue) || 0; + var VUE_VERSION = getVueVersion(Vue) || 2; if (VUE_VERSION === 2) { Vue.prototype.$pushBAIDU = pushBAIDU; } diff --git a/dist/vue-baidu-analytics.js.map b/dist/vue-baidu-analytics.js.map index d68853d..e3222a5 100644 --- a/dist/vue-baidu-analytics.js.map +++ b/dist/vue-baidu-analytics.js.map @@ -1 +1 @@ -{"version":3,"file":"vue-baidu-analytics.js","sources":["../src/modules/baidu.ts","../src/modules/pushBAIDU.ts","../src/modules/getVueVersion.ts","../src/main.ts"],"sourcesContent":["/** \n * 定义基础配置\n * 官方文档 https://tongji.baidu.com/open/api/more?p=guide_overview\n */\nclass BAIDU {\n siteId: string;\n isDebug: boolean;\n\n constructor (siteId: string = '', isDebug: boolean = false) {\n this.siteId = siteId;\n this.isDebug = isDebug;\n }\n\n /** \n * 初始化\n */\n init () {\n window._hmt = window._hmt ? window._hmt : [];\n const SCRIPT = document.createElement('script');\n SCRIPT['async'] = true;\n SCRIPT['src'] = `https://hm.baidu.com/hm.js?${this.siteId}`;\n document.querySelector('head').appendChild(SCRIPT);\n\n if ( this.isDebug ) {\n console.log(`[vue-baidu-analytics] siteId load done.\\nsiteId: ${this.siteId}`);\n }\n }\n\n /** \n * 设置要响应的站点\n */\n setAccount () {\n window._hmt.push(['_setAccount', this.siteId]);\n }\n\n /** \n * 提交PV、UV\n */\n trackPageview (pageUrl: string) {\n // 如果页面链接没传或者无效链接,则默认为根域名\n if ( !pageUrl || typeof pageUrl !== 'string' ) {\n pageUrl = '/';\n }\n\n // 如果页面链接带上了域名,则需要过滤掉\n if ( pageUrl.includes('http') ) {\n const PAGE_CUT = pageUrl.split('/');\n const HOST_NAME = `${PAGE_CUT[0]}//${PAGE_CUT[2]}`;\n pageUrl = pageUrl.replace(HOST_NAME, '');\n }\n\n // 设置响应id并提交数据\n this.setAccount();\n window._hmt.push(['_trackPageview', pageUrl]);\n\n if ( this.isDebug ) {\n console.log(`[vue-baidu-analytics] track pv done.\\nsiteId: ${this.siteId}\\npageUrl: ${pageUrl}`);\n }\n }\n\n /** \n * 提交点击事件\n */\n trackEvent (category: string, action: string, label: string, value: number) {\n // 前两个是必填项\n if ( typeof category !== 'string' || typeof action !== 'string' || !category || !action ) {\n throw new Error('[vue-baidu-analytics] Missing necessary category and operation information, and must be of type string.');\n return false;\n }\n\n // 重置一些无效的默认值\n if ( !label || typeof label !== 'string' ) {\n label = '';\n }\n\n if ( !Number(value) ) {\n value = 1;\n }\n\n // 设置响应id并提交数据\n this.setAccount();\n window._hmt.push(['_trackEvent', category, action, label, value]);\n\n if ( this.isDebug ) {\n console.log(`[vue-baidu-analytics] track event done.\\nsiteId: ${this.siteId}\\ncategory: ${category}\\naction: ${action}\\nlabel: ${label}\\nvalue: ${value}`);\n }\n }\n}\n\nexport default BAIDU;","import BAIDU from '@m/baidu'\n\n/** \n * 定义推送操作\n */\nclass PushBAIDU {\n siteIdList: string[];\n isDebug: boolean;\n\n constructor (siteIdList: string[], isDebug: boolean) {\n this.siteIdList = siteIdList;\n this.isDebug = isDebug;\n }\n\n /** \n * 批量部署站点\n */\n init () {\n this.siteIdList.forEach( (siteId: string) => {\n const SITE = new BAIDU(siteId, this.isDebug);\n SITE.init();\n });\n }\n\n /** \n * 批量提交pv上报\n */\n pv (pageUrl: string) {\n this.siteIdList.forEach( (siteId: string) => {\n const SITE = new BAIDU(siteId, this.isDebug);\n SITE.trackPageview(pageUrl);\n });\n }\n\n /** \n * 批量提交事件上报\n */\n event (category: string, action: string, label: string, value: number) {\n this.siteIdList.forEach( (siteId: string) => {\n const SITE = new BAIDU(siteId, this.isDebug);\n SITE.trackEvent(category, action, label, value);\n });\n }\n\n}\n\nexport default PushBAIDU;","/** \r\n * 获取Vue的版本\r\n * @return 2=Vue2.x, 3=Vue3.x\r\n */\r\nconst getVueVersion = (Vue: Vue): number => {\r\n let version: number = 2;\r\n\r\n // 获取Vue的版本号\r\n const VUE_VERSION: string = String(Vue.version);\r\n\r\n // Vue 2.x\r\n if ( VUE_VERSION.slice(0, 2) === '2.' ) {\r\n version = 2; \r\n }\r\n \r\n // Vue 3.x\r\n if ( VUE_VERSION.slice(0, 2) === '3.' ) {\r\n version = 3; \r\n }\r\n \r\n return version;\r\n}\r\n\r\nexport default getVueVersion;","import PushBAIDU from '@m/pushBAIDU'\nimport getVueVersion from '@m/getVueVersion'\n\n/** \n * 定义插件\n */\nexport default function install (Vue: Vue, { router, siteIdList, isDebug = false }: Partial) {\n\n /** \n * 一些环境和参数的检查\n */\n if ( typeof document === 'undefined' || typeof window === 'undefined' ) {\n return false;\n }\n\n if ( !router ) {\n throw new Error('[vue-baidu-analytics] Must pass a Vue-Router instance to vue-baidu-analytics.');\n }\n\n if ( !siteIdList ) {\n throw new Error('[vue-baidu-analytics] Missing tracking domain ID, add at least one of baidu analytics.');\n }\n\n /** \n * 挂载推送的方法\n */\n const pushBAIDU: any = new PushBAIDU(siteIdList, isDebug);\n \n // 获取Vue版本\n const VUE_VERSION: number = getVueVersion(Vue) || 0;\n\n // 2.x可以直接挂载到原型上\n if ( VUE_VERSION === 2 ) {\n Vue.prototype.$pushBAIDU = pushBAIDU;\n }\n\n // 3.x必须使用这个方式来挂载\n if ( VUE_VERSION === 3 ) {\n Vue.config.globalProperties.$pushBAIDU = pushBAIDU;\n }\n\n /** \n * 部署站点并初始化\n */\n if ( siteIdList ) {\n pushBAIDU.init();\n }\n\n /** \n * 路由切换时执行PV上报\n */\n router.afterEach( (to: To) => {\n const PAGE_PATH_DIR_COUNT = window.location.pathname.split('/').length;\n const PAGE_PATH = window.location.pathname.split('/').slice(0, PAGE_PATH_DIR_COUNT - 1).join('/');\n const PAGE_URL = router.mode === 'hash' ? `${PAGE_PATH}/#${to.fullPath}` : `${PAGE_PATH}${to.fullPath}`;\n\n pushBAIDU.pv(PAGE_URL);\n });\n}"],"names":[],"mappings":";;;;;;;;;;;EAIA;MAIE,eAAa,MAAmB,EAAE,OAAwB;UAA7C,uBAAA,EAAA,WAAmB;UAAE,wBAAA,EAAA,eAAwB;UACxD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;UACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;OACxB;MAKD,oBAAI,GAAJ;UACE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;UAC7C,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;UAChD,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;UACvB,MAAM,CAAC,KAAK,CAAC,GAAG,gCAA8B,IAAI,CAAC,MAAQ,CAAC;UAC5D,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;UAEnD,IAAK,IAAI,CAAC,OAAO,EAAG;cAClB,OAAO,CAAC,GAAG,CAAC,yDAAuD,IAAI,CAAC,MAAQ,CAAC,CAAC;WACnF;OACF;MAKD,0BAAU,GAAV;UACE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;OAChD;MAKD,6BAAa,GAAb,UAAe,OAAe;UAE5B,IAAK,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAG;cAC7C,OAAO,GAAG,GAAG,CAAC;WACf;UAGD,IAAK,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAG;cAC9B,IAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;cACpC,IAAM,SAAS,GAAM,QAAQ,CAAC,CAAC,CAAC,UAAK,QAAQ,CAAC,CAAC,CAAG,CAAC;cACnD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;WAC1C;UAGD,IAAI,CAAC,UAAU,EAAE,CAAC;UAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC;UAE9C,IAAK,IAAI,CAAC,OAAO,EAAG;cAClB,OAAO,CAAC,GAAG,CAAC,sDAAoD,IAAI,CAAC,MAAM,qBAAgB,OAAS,CAAC,CAAC;WACvG;OACF;MAKD,0BAAU,GAAV,UAAY,QAAgB,EAAE,MAAc,EAAE,KAAa,EAAE,KAAa;UAExE,IAAK,OAAO,QAAQ,KAAK,QAAQ,IAAK,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAG;cACzF,MAAM,IAAI,KAAK,CAAC,yGAAyG,CAAC,CAAC;WAE5H;UAGD,IAAK,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAI;cAC1C,KAAK,GAAG,EAAE,CAAC;WACZ;UAED,IAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAG;cACpB,KAAK,GAAG,CAAC,CAAC;WACX;UAGD,IAAI,CAAC,UAAU,EAAE,CAAC;UAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;UAElE,IAAK,IAAI,CAAC,OAAO,EAAG;cAClB,OAAO,CAAC,GAAG,CAAC,wDAAsD,IAAI,CAAC,MAAM,oBAAe,QAAQ,oBAAe,MAAM,oBAAe,KAAK,oBAAe,KAAO,CAAC,CAAC;WACtK;OACF;MACH,YAAC;EAAD,CAAC;;EClFD;MAIE,mBAAa,UAAoB,EAAE,OAAgB;UACjD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;UAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;OACxB;MAKD,wBAAI,GAAJ;UAAA,iBAKC;UAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;cACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;cAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;WACb,CAAC,CAAC;OACJ;MAKD,sBAAE,GAAF,UAAI,OAAe;UAAnB,iBAKC;UAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;cACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;cAC7C,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;WAC7B,CAAC,CAAC;OACJ;MAKD,yBAAK,GAAL,UAAO,QAAgB,EAAE,MAAc,EAAE,KAAa,EAAE,KAAa;UAArE,iBAKC;UAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;cACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;cAC7C,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;WACjD,CAAC,CAAC;OACJ;MAEH,gBAAC;EAAD,CAAC;;ECxCD,IAAM,aAAa,GAAG,UAAC,GAAQ;MAC7B,IAAI,OAAO,GAAW,CAAC,CAAC;MAGxB,IAAM,WAAW,GAAW,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;MAGhD,IAAK,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAG;UACtC,OAAO,GAAG,CAAC,CAAC;OACb;MAGD,IAAK,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAG;UACtC,OAAO,GAAG,CAAC,CAAC;OACb;MAED,OAAO,OAAO,CAAC;EACjB,CAAC;;WCfuB,OAAO,CAAE,GAAQ,EAAE,EAAyD;UAAvD,MAAM,YAAA,EAAE,UAAU,gBAAA,EAAE,eAAe,EAAf,OAAO,mBAAG,KAAK,KAAA;MAK9E,IAAK,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,MAAM,KAAK,WAAW,EAAG;UACtE,OAAO,KAAK,CAAC;OACd;MAED,IAAK,CAAC,MAAM,EAAG;UACb,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;OAClG;MAED,IAAK,CAAC,UAAU,EAAG;UACjB,MAAM,IAAI,KAAK,CAAC,wFAAwF,CAAC,CAAC;OAC3G;MAKD,IAAM,SAAS,GAAQ,IAAI,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;MAG1D,IAAM,WAAW,GAAW,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;MAGpD,IAAK,WAAW,KAAK,CAAC,EAAG;UACvB,GAAG,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,CAAC;OACtC;MAGD,IAAK,WAAW,KAAK,CAAC,EAAG;UACvB,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,GAAG,SAAS,CAAC;OACpD;MAKD,IAAK,UAAU,EAAG;UAChB,SAAS,CAAC,IAAI,EAAE,CAAC;OAClB;MAKD,MAAM,CAAC,SAAS,CAAE,UAAC,EAAM;UACvB,IAAM,mBAAmB,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;UACvE,IAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;UAClG,IAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,KAAK,MAAM,GAAM,SAAS,UAAK,EAAE,CAAC,QAAU,GAAG,KAAG,SAAS,GAAG,EAAE,CAAC,QAAU,CAAC;UAExG,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;OACxB,CAAC,CAAC;EACL;;;;"} \ No newline at end of file +{"version":3,"file":"vue-baidu-analytics.js","sources":["../src/modules/baidu.ts","../src/modules/pushBAIDU.ts","../src/modules/getVueVersion.ts","../src/main.ts"],"sourcesContent":["/** \r\n * 定义基础配置\r\n * 官方文档 https://tongji.baidu.com/open/api/more?p=guide_overview\r\n */\r\nclass BAIDU {\r\n siteId: string;\r\n isDebug: boolean;\r\n\r\n constructor (siteId: string = '', isDebug: boolean = false) {\r\n this.siteId = siteId;\r\n this.isDebug = isDebug;\r\n }\r\n\r\n /** \r\n * 初始化\r\n */\r\n init () {\r\n window._hmt = window._hmt ? window._hmt : [];\r\n const SCRIPT = document.createElement('script');\r\n SCRIPT['async'] = true;\r\n SCRIPT['src'] = `https://hm.baidu.com/hm.js?${this.siteId}`;\r\n document.querySelector('head').appendChild(SCRIPT);\r\n\r\n if ( this.isDebug ) {\r\n console.log(`[vue-baidu-analytics] siteId load done.\\nsiteId: ${this.siteId}`);\r\n }\r\n }\r\n\r\n /** \r\n * 设置要响应的站点\r\n */\r\n setAccount () {\r\n window._hmt.push(['_setAccount', this.siteId]);\r\n }\r\n\r\n /** \r\n * 提交PV、UV\r\n */\r\n trackPageview (pageUrl: string) {\r\n // 如果页面链接没传或者无效链接,则默认为根域名\r\n if ( !pageUrl || typeof pageUrl !== 'string' ) {\r\n pageUrl = '/';\r\n }\r\n\r\n // 如果页面链接带上了域名,则需要过滤掉\r\n if ( pageUrl.includes('http') ) {\r\n const PAGE_CUT = pageUrl.split('/');\r\n const HOST_NAME = `${PAGE_CUT[0]}//${PAGE_CUT[2]}`;\r\n pageUrl = pageUrl.replace(HOST_NAME, '');\r\n }\r\n\r\n // 设置响应id并提交数据\r\n this.setAccount();\r\n window._hmt.push(['_trackPageview', pageUrl]);\r\n\r\n if ( this.isDebug ) {\r\n console.log(`[vue-baidu-analytics] track pv done.\\nsiteId: ${this.siteId}\\npageUrl: ${pageUrl}`);\r\n }\r\n }\r\n\r\n /** \r\n * 提交点击事件\r\n */\r\n trackEvent (category: string, action: string, label: string, value: number) {\r\n // 前两个是必填项\r\n if ( typeof category !== 'string' || typeof action !== 'string' || !category || !action ) {\r\n throw new Error('[vue-baidu-analytics] Missing necessary category and operation information, and must be of type string.');\r\n return false;\r\n }\r\n\r\n // 重置一些无效的默认值\r\n if ( !label || typeof label !== 'string' ) {\r\n label = '';\r\n }\r\n\r\n if ( !Number(value) ) {\r\n value = 1;\r\n }\r\n\r\n // 设置响应id并提交数据\r\n this.setAccount();\r\n window._hmt.push(['_trackEvent', category, action, label, value]);\r\n\r\n if ( this.isDebug ) {\r\n console.log(`[vue-baidu-analytics] track event done.\\nsiteId: ${this.siteId}\\ncategory: ${category}\\naction: ${action}\\nlabel: ${label}\\nvalue: ${value}`);\r\n }\r\n }\r\n}\r\n\r\nexport default BAIDU;","import BAIDU from '@m/baidu'\r\n\r\n/** \r\n * 定义推送操作\r\n */\r\nclass PushBAIDU {\r\n siteIdList: string[];\r\n isDebug: boolean;\r\n\r\n constructor (siteIdList: string[], isDebug: boolean) {\r\n this.siteIdList = siteIdList;\r\n this.isDebug = isDebug;\r\n }\r\n\r\n /** \r\n * 批量部署站点\r\n */\r\n init () {\r\n this.siteIdList.forEach( (siteId: string) => {\r\n const SITE = new BAIDU(siteId, this.isDebug);\r\n SITE.init();\r\n });\r\n }\r\n\r\n /** \r\n * 批量提交pv上报\r\n */\r\n pv (pageUrl: string) {\r\n this.siteIdList.forEach( (siteId: string) => {\r\n const SITE = new BAIDU(siteId, this.isDebug);\r\n SITE.trackPageview(pageUrl);\r\n });\r\n }\r\n\r\n /** \r\n * 批量提交事件上报\r\n */\r\n event (category: string, action: string, label: string, value: number) {\r\n this.siteIdList.forEach( (siteId: string) => {\r\n const SITE = new BAIDU(siteId, this.isDebug);\r\n SITE.trackEvent(category, action, label, value);\r\n });\r\n }\r\n\r\n}\r\n\r\nexport default PushBAIDU;","/** \r\n * 获取Vue的版本\r\n * @return 2=Vue2.x, 3=Vue3.x\r\n */\r\nconst getVueVersion = (Vue: Vue): number => {\r\n let version: number = 2;\r\n\r\n // 获取Vue的版本号\r\n const VUE_VERSION: string = String(Vue.version);\r\n\r\n // Vue 2.x\r\n if ( VUE_VERSION.slice(0, 2) === '2.' ) {\r\n version = 2; \r\n }\r\n \r\n // Vue 3.x\r\n if ( VUE_VERSION.slice(0, 2) === '3.' ) {\r\n version = 3; \r\n }\r\n \r\n return version;\r\n}\r\n\r\nexport default getVueVersion;","import PushBAIDU from '@m/pushBAIDU'\r\nimport getVueVersion from '@m/getVueVersion'\r\n\r\n/** \r\n * 定义插件\r\n */\r\nexport default function install (Vue: Vue, { router, siteIdList, isDebug = false }: Partial) {\r\n\r\n /** \r\n * 一些环境和参数的检查\r\n */\r\n if ( typeof document === 'undefined' || typeof window === 'undefined' ) {\r\n return false;\r\n }\r\n\r\n if ( !router ) {\r\n throw new Error('[vue-baidu-analytics] Must pass a Vue-Router instance to vue-baidu-analytics.');\r\n }\r\n\r\n if ( !siteIdList ) {\r\n throw new Error('[vue-baidu-analytics] Missing tracking domain ID, add at least one of baidu analytics.');\r\n }\r\n\r\n /** \r\n * 挂载推送的方法\r\n */\r\n const pushBAIDU: any = new PushBAIDU(siteIdList, isDebug);\r\n \r\n // 获取Vue版本(获取失败则默认为2)\r\n const VUE_VERSION: number = getVueVersion(Vue) || 2;\r\n\r\n // 2.x可以直接挂载到原型上\r\n if ( VUE_VERSION === 2 ) {\r\n Vue.prototype.$pushBAIDU = pushBAIDU;\r\n }\r\n\r\n // 3.x必须使用这个方式来挂载\r\n if ( VUE_VERSION === 3 ) {\r\n Vue.config.globalProperties.$pushBAIDU = pushBAIDU;\r\n }\r\n\r\n /** \r\n * 部署站点并初始化\r\n */\r\n if ( siteIdList ) {\r\n pushBAIDU.init();\r\n }\r\n\r\n /** \r\n * 路由切换时执行PV上报\r\n */\r\n router.afterEach( (to: To) => {\r\n const PAGE_PATH_DIR_COUNT = window.location.pathname.split('/').length;\r\n const PAGE_PATH = window.location.pathname.split('/').slice(0, PAGE_PATH_DIR_COUNT - 1).join('/');\r\n const PAGE_URL = router.mode === 'hash' ? `${PAGE_PATH}/#${to.fullPath}` : `${PAGE_PATH}${to.fullPath}`;\r\n\r\n pushBAIDU.pv(PAGE_URL);\r\n });\r\n}"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/dist/vue-baidu-analytics.min.js b/dist/vue-baidu-analytics.min.js index 01f9e13..73133ef 100644 --- a/dist/vue-baidu-analytics.min.js +++ b/dist/vue-baidu-analytics.min.js @@ -3,5 +3,5 @@ * version: v2.0.0 * author: chengpeiquan */ - !function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t=t||self).baiduAnalytics=i()}(this,(function(){"use strict";var t=function(){function t(t,i){void 0===t&&(t=""),void 0===i&&(i=!1),this.siteId=t,this.isDebug=i}return t.prototype.init=function(){window._hmt=window._hmt?window._hmt:[];var t=document.createElement("script");t.async=!0,t.src="https://hm.baidu.com/hm.js?"+this.siteId,document.querySelector("head").appendChild(t),this.isDebug&&console.log("[vue-baidu-analytics] siteId load done.\nsiteId: "+this.siteId)},t.prototype.setAccount=function(){window._hmt.push(["_setAccount",this.siteId])},t.prototype.trackPageview=function(t){if(t&&"string"==typeof t||(t="/"),t.includes("http")){var i=t.split("/"),e=i[0]+"//"+i[2];t=t.replace(e,"")}this.setAccount(),window._hmt.push(["_trackPageview",t]),this.isDebug&&console.log("[vue-baidu-analytics] track pv done.\nsiteId: "+this.siteId+"\npageUrl: "+t)},t.prototype.trackEvent=function(t,i,e,n){if("string"!=typeof t||"string"!=typeof i||!t||!i)throw new Error("[vue-baidu-analytics] Missing necessary category and operation information, and must be of type string.");e&&"string"==typeof e||(e=""),Number(n)||(n=1),this.setAccount(),window._hmt.push(["_trackEvent",t,i,e,n]),this.isDebug&&console.log("[vue-baidu-analytics] track event done.\nsiteId: "+this.siteId+"\ncategory: "+t+"\naction: "+i+"\nlabel: "+e+"\nvalue: "+n)},t}(),i=function(){function i(t,i){this.siteIdList=t,this.isDebug=i}return i.prototype.init=function(){var i=this;this.siteIdList.forEach((function(e){new t(e,i.isDebug).init()}))},i.prototype.pv=function(i){var e=this;this.siteIdList.forEach((function(n){new t(n,e.isDebug).trackPageview(i)}))},i.prototype.event=function(i,e,n,o){var s=this;this.siteIdList.forEach((function(a){new t(a,s.isDebug).trackEvent(i,e,n,o)}))},i}();return function(t,e){var n=e.router,o=e.siteIdList,s=e.isDebug,a=void 0!==s&&s;if("undefined"==typeof document||"undefined"==typeof window)return!1;if(!n)throw new Error("[vue-baidu-analytics] Must pass a Vue-Router instance to vue-baidu-analytics.");if(!o)throw new Error("[vue-baidu-analytics] Missing tracking domain ID, add at least one of baidu analytics.");var r=new i(o,a),u=function(t){var i=2,e=String(t.version);return"2."===e.slice(0,2)&&(i=2),"3."===e.slice(0,2)&&(i=3),i}(t)||0;2===u&&(t.prototype.$pushBAIDU=r),3===u&&(t.config.globalProperties.$pushBAIDU=r),o&&r.init(),n.afterEach((function(t){var i=window.location.pathname.split("/").length,e=window.location.pathname.split("/").slice(0,i-1).join("/"),o="hash"===n.mode?e+"/#"+t.fullPath:""+e+t.fullPath;r.pv(o)}))}})); + !function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).baiduAnalytics=i()}(this,(function(){"use strict";var t=function(){function t(t,i){void 0===t&&(t=""),void 0===i&&(i=!1),this.siteId=t,this.isDebug=i}return t.prototype.init=function(){window._hmt=window._hmt?window._hmt:[];var t=document.createElement("script");t.async=!0,t.src="https://hm.baidu.com/hm.js?"+this.siteId,document.querySelector("head").appendChild(t),this.isDebug&&console.log("[vue-baidu-analytics] siteId load done.\nsiteId: "+this.siteId)},t.prototype.setAccount=function(){window._hmt.push(["_setAccount",this.siteId])},t.prototype.trackPageview=function(t){if(t&&"string"==typeof t||(t="/"),t.includes("http")){var i=t.split("/"),e=i[0]+"//"+i[2];t=t.replace(e,"")}this.setAccount(),window._hmt.push(["_trackPageview",t]),this.isDebug&&console.log("[vue-baidu-analytics] track pv done.\nsiteId: "+this.siteId+"\npageUrl: "+t)},t.prototype.trackEvent=function(t,i,e,n){if("string"!=typeof t||"string"!=typeof i||!t||!i)throw new Error("[vue-baidu-analytics] Missing necessary category and operation information, and must be of type string.");e&&"string"==typeof e||(e=""),Number(n)||(n=1),this.setAccount(),window._hmt.push(["_trackEvent",t,i,e,n]),this.isDebug&&console.log("[vue-baidu-analytics] track event done.\nsiteId: "+this.siteId+"\ncategory: "+t+"\naction: "+i+"\nlabel: "+e+"\nvalue: "+n)},t}(),i=function(){function i(t,i){this.siteIdList=t,this.isDebug=i}return i.prototype.init=function(){var i=this;this.siteIdList.forEach((function(e){new t(e,i.isDebug).init()}))},i.prototype.pv=function(i){var e=this;this.siteIdList.forEach((function(n){new t(n,e.isDebug).trackPageview(i)}))},i.prototype.event=function(i,e,n,o){var s=this;this.siteIdList.forEach((function(a){new t(a,s.isDebug).trackEvent(i,e,n,o)}))},i}();return function(t,e){var n=e.router,o=e.siteIdList,s=e.isDebug,a=void 0!==s&&s;if("undefined"==typeof document||"undefined"==typeof window)return!1;if(!n)throw new Error("[vue-baidu-analytics] Must pass a Vue-Router instance to vue-baidu-analytics.");if(!o)throw new Error("[vue-baidu-analytics] Missing tracking domain ID, add at least one of baidu analytics.");var r=new i(o,a),u=function(t){var i=2,e=String(t.version);return"2."===e.slice(0,2)&&(i=2),"3."===e.slice(0,2)&&(i=3),i}(t)||2;2===u&&(t.prototype.$pushBAIDU=r),3===u&&(t.config.globalProperties.$pushBAIDU=r),o&&r.init(),n.afterEach((function(t){var i=window.location.pathname.split("/").length,e=window.location.pathname.split("/").slice(0,i-1).join("/"),o="hash"===n.mode?e+"/#"+t.fullPath:""+e+t.fullPath;r.pv(o)}))}})); //# sourceMappingURL=vue-baidu-analytics.min.js.map diff --git a/dist/vue-baidu-analytics.min.js.map b/dist/vue-baidu-analytics.min.js.map index 1c15e16..8788bbb 100644 --- a/dist/vue-baidu-analytics.min.js.map +++ b/dist/vue-baidu-analytics.min.js.map @@ -1 +1 @@ -{"version":3,"file":"vue-baidu-analytics.min.js","sources":["../src/modules/baidu.ts","../src/modules/pushBAIDU.ts","../src/main.ts","../src/modules/getVueVersion.ts"],"sourcesContent":["/** \n * 定义基础配置\n * 官方文档 https://tongji.baidu.com/open/api/more?p=guide_overview\n */\nclass BAIDU {\n siteId: string;\n isDebug: boolean;\n\n constructor (siteId: string = '', isDebug: boolean = false) {\n this.siteId = siteId;\n this.isDebug = isDebug;\n }\n\n /** \n * 初始化\n */\n init () {\n window._hmt = window._hmt ? window._hmt : [];\n const SCRIPT = document.createElement('script');\n SCRIPT['async'] = true;\n SCRIPT['src'] = `https://hm.baidu.com/hm.js?${this.siteId}`;\n document.querySelector('head').appendChild(SCRIPT);\n\n if ( this.isDebug ) {\n console.log(`[vue-baidu-analytics] siteId load done.\\nsiteId: ${this.siteId}`);\n }\n }\n\n /** \n * 设置要响应的站点\n */\n setAccount () {\n window._hmt.push(['_setAccount', this.siteId]);\n }\n\n /** \n * 提交PV、UV\n */\n trackPageview (pageUrl: string) {\n // 如果页面链接没传或者无效链接,则默认为根域名\n if ( !pageUrl || typeof pageUrl !== 'string' ) {\n pageUrl = '/';\n }\n\n // 如果页面链接带上了域名,则需要过滤掉\n if ( pageUrl.includes('http') ) {\n const PAGE_CUT = pageUrl.split('/');\n const HOST_NAME = `${PAGE_CUT[0]}//${PAGE_CUT[2]}`;\n pageUrl = pageUrl.replace(HOST_NAME, '');\n }\n\n // 设置响应id并提交数据\n this.setAccount();\n window._hmt.push(['_trackPageview', pageUrl]);\n\n if ( this.isDebug ) {\n console.log(`[vue-baidu-analytics] track pv done.\\nsiteId: ${this.siteId}\\npageUrl: ${pageUrl}`);\n }\n }\n\n /** \n * 提交点击事件\n */\n trackEvent (category: string, action: string, label: string, value: number) {\n // 前两个是必填项\n if ( typeof category !== 'string' || typeof action !== 'string' || !category || !action ) {\n throw new Error('[vue-baidu-analytics] Missing necessary category and operation information, and must be of type string.');\n return false;\n }\n\n // 重置一些无效的默认值\n if ( !label || typeof label !== 'string' ) {\n label = '';\n }\n\n if ( !Number(value) ) {\n value = 1;\n }\n\n // 设置响应id并提交数据\n this.setAccount();\n window._hmt.push(['_trackEvent', category, action, label, value]);\n\n if ( this.isDebug ) {\n console.log(`[vue-baidu-analytics] track event done.\\nsiteId: ${this.siteId}\\ncategory: ${category}\\naction: ${action}\\nlabel: ${label}\\nvalue: ${value}`);\n }\n }\n}\n\nexport default BAIDU;","import BAIDU from '@m/baidu'\n\n/** \n * 定义推送操作\n */\nclass PushBAIDU {\n siteIdList: string[];\n isDebug: boolean;\n\n constructor (siteIdList: string[], isDebug: boolean) {\n this.siteIdList = siteIdList;\n this.isDebug = isDebug;\n }\n\n /** \n * 批量部署站点\n */\n init () {\n this.siteIdList.forEach( (siteId: string) => {\n const SITE = new BAIDU(siteId, this.isDebug);\n SITE.init();\n });\n }\n\n /** \n * 批量提交pv上报\n */\n pv (pageUrl: string) {\n this.siteIdList.forEach( (siteId: string) => {\n const SITE = new BAIDU(siteId, this.isDebug);\n SITE.trackPageview(pageUrl);\n });\n }\n\n /** \n * 批量提交事件上报\n */\n event (category: string, action: string, label: string, value: number) {\n this.siteIdList.forEach( (siteId: string) => {\n const SITE = new BAIDU(siteId, this.isDebug);\n SITE.trackEvent(category, action, label, value);\n });\n }\n\n}\n\nexport default PushBAIDU;","import PushBAIDU from '@m/pushBAIDU'\nimport getVueVersion from '@m/getVueVersion'\n\n/** \n * 定义插件\n */\nexport default function install (Vue: Vue, { router, siteIdList, isDebug = false }: Partial) {\n\n /** \n * 一些环境和参数的检查\n */\n if ( typeof document === 'undefined' || typeof window === 'undefined' ) {\n return false;\n }\n\n if ( !router ) {\n throw new Error('[vue-baidu-analytics] Must pass a Vue-Router instance to vue-baidu-analytics.');\n }\n\n if ( !siteIdList ) {\n throw new Error('[vue-baidu-analytics] Missing tracking domain ID, add at least one of baidu analytics.');\n }\n\n /** \n * 挂载推送的方法\n */\n const pushBAIDU: any = new PushBAIDU(siteIdList, isDebug);\n \n // 获取Vue版本\n const VUE_VERSION: number = getVueVersion(Vue) || 0;\n\n // 2.x可以直接挂载到原型上\n if ( VUE_VERSION === 2 ) {\n Vue.prototype.$pushBAIDU = pushBAIDU;\n }\n\n // 3.x必须使用这个方式来挂载\n if ( VUE_VERSION === 3 ) {\n Vue.config.globalProperties.$pushBAIDU = pushBAIDU;\n }\n\n /** \n * 部署站点并初始化\n */\n if ( siteIdList ) {\n pushBAIDU.init();\n }\n\n /** \n * 路由切换时执行PV上报\n */\n router.afterEach( (to: To) => {\n const PAGE_PATH_DIR_COUNT = window.location.pathname.split('/').length;\n const PAGE_PATH = window.location.pathname.split('/').slice(0, PAGE_PATH_DIR_COUNT - 1).join('/');\n const PAGE_URL = router.mode === 'hash' ? `${PAGE_PATH}/#${to.fullPath}` : `${PAGE_PATH}${to.fullPath}`;\n\n pushBAIDU.pv(PAGE_URL);\n });\n}","/** \r\n * 获取Vue的版本\r\n * @return 2=Vue2.x, 3=Vue3.x\r\n */\r\nconst getVueVersion = (Vue: Vue): number => {\r\n let version: number = 2;\r\n\r\n // 获取Vue的版本号\r\n const VUE_VERSION: string = String(Vue.version);\r\n\r\n // Vue 2.x\r\n if ( VUE_VERSION.slice(0, 2) === '2.' ) {\r\n version = 2; \r\n }\r\n \r\n // Vue 3.x\r\n if ( VUE_VERSION.slice(0, 2) === '3.' ) {\r\n version = 3; \r\n }\r\n \r\n return version;\r\n}\r\n\r\nexport default getVueVersion;"],"names":["siteId","isDebug","this","BAIDU","window","_hmt","SCRIPT","document","createElement","querySelector","appendChild","console","log","push","pageUrl","includes","PAGE_CUT","split","HOST_NAME","replace","setAccount","category","action","label","value","Error","Number","siteIdList","PushBAIDU","forEach","_this","init","trackPageview","trackEvent","Vue","_a","router","_b","pushBAIDU","VUE_VERSION","version","String","slice","getVueVersion","prototype","$pushBAIDU","config","globalProperties","afterEach","to","PAGE_PATH_DIR_COUNT","location","pathname","length","PAGE_PATH","join","PAGE_URL","mode","fullPath","pv"],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"vue-baidu-analytics.min.js","sources":["../src/modules/baidu.ts","../src/modules/pushBAIDU.ts","../src/main.ts","../src/modules/getVueVersion.ts"],"sourcesContent":["/** \r\n * 定义基础配置\r\n * 官方文档 https://tongji.baidu.com/open/api/more?p=guide_overview\r\n */\r\nclass BAIDU {\r\n siteId: string;\r\n isDebug: boolean;\r\n\r\n constructor (siteId: string = '', isDebug: boolean = false) {\r\n this.siteId = siteId;\r\n this.isDebug = isDebug;\r\n }\r\n\r\n /** \r\n * 初始化\r\n */\r\n init () {\r\n window._hmt = window._hmt ? window._hmt : [];\r\n const SCRIPT = document.createElement('script');\r\n SCRIPT['async'] = true;\r\n SCRIPT['src'] = `https://hm.baidu.com/hm.js?${this.siteId}`;\r\n document.querySelector('head').appendChild(SCRIPT);\r\n\r\n if ( this.isDebug ) {\r\n console.log(`[vue-baidu-analytics] siteId load done.\\nsiteId: ${this.siteId}`);\r\n }\r\n }\r\n\r\n /** \r\n * 设置要响应的站点\r\n */\r\n setAccount () {\r\n window._hmt.push(['_setAccount', this.siteId]);\r\n }\r\n\r\n /** \r\n * 提交PV、UV\r\n */\r\n trackPageview (pageUrl: string) {\r\n // 如果页面链接没传或者无效链接,则默认为根域名\r\n if ( !pageUrl || typeof pageUrl !== 'string' ) {\r\n pageUrl = '/';\r\n }\r\n\r\n // 如果页面链接带上了域名,则需要过滤掉\r\n if ( pageUrl.includes('http') ) {\r\n const PAGE_CUT = pageUrl.split('/');\r\n const HOST_NAME = `${PAGE_CUT[0]}//${PAGE_CUT[2]}`;\r\n pageUrl = pageUrl.replace(HOST_NAME, '');\r\n }\r\n\r\n // 设置响应id并提交数据\r\n this.setAccount();\r\n window._hmt.push(['_trackPageview', pageUrl]);\r\n\r\n if ( this.isDebug ) {\r\n console.log(`[vue-baidu-analytics] track pv done.\\nsiteId: ${this.siteId}\\npageUrl: ${pageUrl}`);\r\n }\r\n }\r\n\r\n /** \r\n * 提交点击事件\r\n */\r\n trackEvent (category: string, action: string, label: string, value: number) {\r\n // 前两个是必填项\r\n if ( typeof category !== 'string' || typeof action !== 'string' || !category || !action ) {\r\n throw new Error('[vue-baidu-analytics] Missing necessary category and operation information, and must be of type string.');\r\n return false;\r\n }\r\n\r\n // 重置一些无效的默认值\r\n if ( !label || typeof label !== 'string' ) {\r\n label = '';\r\n }\r\n\r\n if ( !Number(value) ) {\r\n value = 1;\r\n }\r\n\r\n // 设置响应id并提交数据\r\n this.setAccount();\r\n window._hmt.push(['_trackEvent', category, action, label, value]);\r\n\r\n if ( this.isDebug ) {\r\n console.log(`[vue-baidu-analytics] track event done.\\nsiteId: ${this.siteId}\\ncategory: ${category}\\naction: ${action}\\nlabel: ${label}\\nvalue: ${value}`);\r\n }\r\n }\r\n}\r\n\r\nexport default BAIDU;","import BAIDU from '@m/baidu'\r\n\r\n/** \r\n * 定义推送操作\r\n */\r\nclass PushBAIDU {\r\n siteIdList: string[];\r\n isDebug: boolean;\r\n\r\n constructor (siteIdList: string[], isDebug: boolean) {\r\n this.siteIdList = siteIdList;\r\n this.isDebug = isDebug;\r\n }\r\n\r\n /** \r\n * 批量部署站点\r\n */\r\n init () {\r\n this.siteIdList.forEach( (siteId: string) => {\r\n const SITE = new BAIDU(siteId, this.isDebug);\r\n SITE.init();\r\n });\r\n }\r\n\r\n /** \r\n * 批量提交pv上报\r\n */\r\n pv (pageUrl: string) {\r\n this.siteIdList.forEach( (siteId: string) => {\r\n const SITE = new BAIDU(siteId, this.isDebug);\r\n SITE.trackPageview(pageUrl);\r\n });\r\n }\r\n\r\n /** \r\n * 批量提交事件上报\r\n */\r\n event (category: string, action: string, label: string, value: number) {\r\n this.siteIdList.forEach( (siteId: string) => {\r\n const SITE = new BAIDU(siteId, this.isDebug);\r\n SITE.trackEvent(category, action, label, value);\r\n });\r\n }\r\n\r\n}\r\n\r\nexport default PushBAIDU;","import PushBAIDU from '@m/pushBAIDU'\r\nimport getVueVersion from '@m/getVueVersion'\r\n\r\n/** \r\n * 定义插件\r\n */\r\nexport default function install (Vue: Vue, { router, siteIdList, isDebug = false }: Partial) {\r\n\r\n /** \r\n * 一些环境和参数的检查\r\n */\r\n if ( typeof document === 'undefined' || typeof window === 'undefined' ) {\r\n return false;\r\n }\r\n\r\n if ( !router ) {\r\n throw new Error('[vue-baidu-analytics] Must pass a Vue-Router instance to vue-baidu-analytics.');\r\n }\r\n\r\n if ( !siteIdList ) {\r\n throw new Error('[vue-baidu-analytics] Missing tracking domain ID, add at least one of baidu analytics.');\r\n }\r\n\r\n /** \r\n * 挂载推送的方法\r\n */\r\n const pushBAIDU: any = new PushBAIDU(siteIdList, isDebug);\r\n \r\n // 获取Vue版本(获取失败则默认为2)\r\n const VUE_VERSION: number = getVueVersion(Vue) || 2;\r\n\r\n // 2.x可以直接挂载到原型上\r\n if ( VUE_VERSION === 2 ) {\r\n Vue.prototype.$pushBAIDU = pushBAIDU;\r\n }\r\n\r\n // 3.x必须使用这个方式来挂载\r\n if ( VUE_VERSION === 3 ) {\r\n Vue.config.globalProperties.$pushBAIDU = pushBAIDU;\r\n }\r\n\r\n /** \r\n * 部署站点并初始化\r\n */\r\n if ( siteIdList ) {\r\n pushBAIDU.init();\r\n }\r\n\r\n /** \r\n * 路由切换时执行PV上报\r\n */\r\n router.afterEach( (to: To) => {\r\n const PAGE_PATH_DIR_COUNT = window.location.pathname.split('/').length;\r\n const PAGE_PATH = window.location.pathname.split('/').slice(0, PAGE_PATH_DIR_COUNT - 1).join('/');\r\n const PAGE_URL = router.mode === 'hash' ? `${PAGE_PATH}/#${to.fullPath}` : `${PAGE_PATH}${to.fullPath}`;\r\n\r\n pushBAIDU.pv(PAGE_URL);\r\n });\r\n}","/** \r\n * 获取Vue的版本\r\n * @return 2=Vue2.x, 3=Vue3.x\r\n */\r\nconst getVueVersion = (Vue: Vue): number => {\r\n let version: number = 2;\r\n\r\n // 获取Vue的版本号\r\n const VUE_VERSION: string = String(Vue.version);\r\n\r\n // Vue 2.x\r\n if ( VUE_VERSION.slice(0, 2) === '2.' ) {\r\n version = 2; \r\n }\r\n \r\n // Vue 3.x\r\n if ( VUE_VERSION.slice(0, 2) === '3.' ) {\r\n version = 3; \r\n }\r\n \r\n return version;\r\n}\r\n\r\nexport default getVueVersion;"],"names":["siteId","isDebug","this","BAIDU","window","_hmt","SCRIPT","document","createElement","querySelector","appendChild","console","log","push","pageUrl","includes","PAGE_CUT","split","HOST_NAME","replace","setAccount","category","action","label","value","Error","Number","siteIdList","PushBAIDU","forEach","_this","init","trackPageview","trackEvent","Vue","_a","router","_b","pushBAIDU","VUE_VERSION","version","String","slice","getVueVersion","prototype","$pushBAIDU","config","globalProperties","afterEach","to","PAGE_PATH_DIR_COUNT","location","pathname","length","PAGE_PATH","join","PAGE_URL","mode","fullPath","pv"],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/.bin/browserslist b/node_modules/.bin/browserslist deleted file mode 100644 index 5c05ea1..0000000 --- a/node_modules/.bin/browserslist +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../browserslist/cli.js" "$@" - ret=$? -else - node "$basedir/../browserslist/cli.js" "$@" - ret=$? -fi -exit $ret diff --git a/node_modules/.bin/browserslist.cmd b/node_modules/.bin/browserslist.cmd deleted file mode 100644 index 2e6f1b3..0000000 --- a/node_modules/.bin/browserslist.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -"%_prog%" "%dp0%\..\browserslist\cli.js" %* -ENDLOCAL -EXIT /b %errorlevel% -:find_dp0 -SET dp0=%~dp0 -EXIT /b diff --git a/node_modules/.bin/browserslist.ps1 b/node_modules/.bin/browserslist.ps1 deleted file mode 100644 index 9fb149e..0000000 --- a/node_modules/.bin/browserslist.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - & "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args - $ret=$LASTEXITCODE -} else { - & "node$exe" "$basedir/../browserslist/cli.js" $args - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/jsesc b/node_modules/.bin/jsesc deleted file mode 100644 index f2bbda3..0000000 --- a/node_modules/.bin/jsesc +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../jsesc/bin/jsesc" "$@" - ret=$? -else - node "$basedir/../jsesc/bin/jsesc" "$@" - ret=$? -fi -exit $ret diff --git a/node_modules/.bin/jsesc.cmd b/node_modules/.bin/jsesc.cmd deleted file mode 100644 index 5338fa1..0000000 --- a/node_modules/.bin/jsesc.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -"%_prog%" "%dp0%\..\jsesc\bin\jsesc" %* -ENDLOCAL -EXIT /b %errorlevel% -:find_dp0 -SET dp0=%~dp0 -EXIT /b diff --git a/node_modules/.bin/jsesc.ps1 b/node_modules/.bin/jsesc.ps1 deleted file mode 100644 index 1751cf9..0000000 --- a/node_modules/.bin/jsesc.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - & "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args - $ret=$LASTEXITCODE -} else { - & "node$exe" "$basedir/../jsesc/bin/jsesc" $args - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 deleted file mode 100644 index 882cecd..0000000 --- a/node_modules/.bin/json5 +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../json5/lib/cli.js" "$@" - ret=$? -else - node "$basedir/../json5/lib/cli.js" "$@" - ret=$? -fi -exit $ret diff --git a/node_modules/.bin/json5.cmd b/node_modules/.bin/json5.cmd deleted file mode 100644 index fe63e90..0000000 --- a/node_modules/.bin/json5.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -"%_prog%" "%dp0%\..\json5\lib\cli.js" %* -ENDLOCAL -EXIT /b %errorlevel% -:find_dp0 -SET dp0=%~dp0 -EXIT /b diff --git a/node_modules/.bin/json5.ps1 b/node_modules/.bin/json5.ps1 deleted file mode 100644 index 585f9ad..0000000 --- a/node_modules/.bin/json5.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args - $ret=$LASTEXITCODE -} else { - & "node$exe" "$basedir/../json5/lib/cli.js" $args - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/parser b/node_modules/.bin/parser deleted file mode 100644 index baec122..0000000 --- a/node_modules/.bin/parser +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@" - ret=$? -else - node "$basedir/../@babel/parser/bin/babel-parser.js" "$@" - ret=$? -fi -exit $ret diff --git a/node_modules/.bin/parser.cmd b/node_modules/.bin/parser.cmd deleted file mode 100644 index 2140856..0000000 --- a/node_modules/.bin/parser.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -"%_prog%" "%dp0%\..\@babel\parser\bin\babel-parser.js" %* -ENDLOCAL -EXIT /b %errorlevel% -:find_dp0 -SET dp0=%~dp0 -EXIT /b diff --git a/node_modules/.bin/parser.ps1 b/node_modules/.bin/parser.ps1 deleted file mode 100644 index 82ec139..0000000 --- a/node_modules/.bin/parser.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args - $ret=$LASTEXITCODE -} else { - & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/regjsparser b/node_modules/.bin/regjsparser deleted file mode 100644 index 7c0fff5..0000000 --- a/node_modules/.bin/regjsparser +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../regjsparser/bin/parser" "$@" - ret=$? -else - node "$basedir/../regjsparser/bin/parser" "$@" - ret=$? -fi -exit $ret diff --git a/node_modules/.bin/regjsparser.cmd b/node_modules/.bin/regjsparser.cmd deleted file mode 100644 index b5db0d9..0000000 --- a/node_modules/.bin/regjsparser.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -"%_prog%" "%dp0%\..\regjsparser\bin\parser" %* -ENDLOCAL -EXIT /b %errorlevel% -:find_dp0 -SET dp0=%~dp0 -EXIT /b diff --git a/node_modules/.bin/regjsparser.ps1 b/node_modules/.bin/regjsparser.ps1 deleted file mode 100644 index 788dd1e..0000000 --- a/node_modules/.bin/regjsparser.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - & "$basedir/node$exe" "$basedir/../regjsparser/bin/parser" $args - $ret=$LASTEXITCODE -} else { - & "node$exe" "$basedir/../regjsparser/bin/parser" $args - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver deleted file mode 100644 index 10497aa..0000000 --- a/node_modules/.bin/semver +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../semver/bin/semver" "$@" - ret=$? -else - node "$basedir/../semver/bin/semver" "$@" - ret=$? -fi -exit $ret diff --git a/node_modules/.bin/semver.cmd b/node_modules/.bin/semver.cmd deleted file mode 100644 index f6c4ad4..0000000 --- a/node_modules/.bin/semver.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -"%_prog%" "%dp0%\..\semver\bin\semver" %* -ENDLOCAL -EXIT /b %errorlevel% -:find_dp0 -SET dp0=%~dp0 -EXIT /b diff --git a/node_modules/.bin/semver.ps1 b/node_modules/.bin/semver.ps1 deleted file mode 100644 index a3315ff..0000000 --- a/node_modules/.bin/semver.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args - $ret=$LASTEXITCODE -} else { - & "node$exe" "$basedir/../semver/bin/semver" $args - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/terser b/node_modules/.bin/terser deleted file mode 100644 index a19ab59..0000000 --- a/node_modules/.bin/terser +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../terser/bin/terser" "$@" - ret=$? -else - node "$basedir/../terser/bin/terser" "$@" - ret=$? -fi -exit $ret diff --git a/node_modules/.bin/terser.cmd b/node_modules/.bin/terser.cmd deleted file mode 100644 index 9c0b065..0000000 --- a/node_modules/.bin/terser.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -"%_prog%" "%dp0%\..\terser\bin\terser" %* -ENDLOCAL -EXIT /b %errorlevel% -:find_dp0 -SET dp0=%~dp0 -EXIT /b diff --git a/node_modules/.bin/terser.ps1 b/node_modules/.bin/terser.ps1 deleted file mode 100644 index c80f9df..0000000 --- a/node_modules/.bin/terser.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - & "$basedir/node$exe" "$basedir/../terser/bin/terser" $args - $ret=$LASTEXITCODE -} else { - & "node$exe" "$basedir/../terser/bin/terser" $args - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/6e96f10b2453abe2284fcac86f4f114057c5af72 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/6e96f10b2453abe2284fcac86f4f114057c5af72 deleted file mode 100644 index 2e21db0..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/6e96f10b2453abe2284fcac86f4f114057c5af72 +++ /dev/null @@ -1 +0,0 @@ -{"code":"import PushBAIDU from '@m/pushBAIDU';\r\nimport getVueVersion from '@m/getVueVersion';\r\nexport default function install(Vue, _a) {\r\n var router = _a.router, siteIdList = _a.siteIdList, _b = _a.isDebug, isDebug = _b === void 0 ? false : _b;\r\n if (typeof document === 'undefined' || typeof window === 'undefined') {\r\n return false;\r\n }\r\n if (!router) {\r\n throw new Error('[vue-baidu-analytics] Must pass a Vue-Router instance to vue-baidu-analytics.');\r\n }\r\n if (!siteIdList) {\r\n throw new Error('[vue-baidu-analytics] Missing tracking domain ID, add at least one of baidu analytics.');\r\n }\r\n var pushBAIDU = new PushBAIDU(siteIdList, isDebug);\r\n var VUE_VERSION = getVueVersion(Vue) || 0;\r\n if (VUE_VERSION === 2) {\r\n Vue.prototype.$pushBAIDU = pushBAIDU;\r\n }\r\n if (VUE_VERSION === 3) {\r\n Vue.config.globalProperties.$pushBAIDU = pushBAIDU;\r\n }\r\n if (siteIdList) {\r\n pushBAIDU.init();\r\n }\r\n router.afterEach(function (to) {\r\n var PAGE_PATH_DIR_COUNT = window.location.pathname.split('/').length;\r\n var PAGE_PATH = window.location.pathname.split('/').slice(0, PAGE_PATH_DIR_COUNT - 1).join('/');\r\n var PAGE_URL = router.mode === 'hash' ? PAGE_PATH + \"/#\" + to.fullPath : \"\" + PAGE_PATH + to.fullPath;\r\n pushBAIDU.pv(PAGE_URL);\r\n });\r\n}\r\n//# sourceMappingURL=main.js.map","references":["E:/Project/npm-project/vue-baidu-analytics/src/modules/pushBAIDU.ts","E:/Project/npm-project/vue-baidu-analytics/src/modules/getVueVersion.ts"],"map":"{\"version\":3,\"file\":\"main.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/main.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,SAAS,MAAM,cAAc,CAAA;AACpC,OAAO,aAAa,MAAM,kBAAkB,CAAA;AAK5C,MAAM,CAAC,OAAO,UAAU,OAAO,CAAE,GAAQ,EAAE,EAAyD;QAAvD,MAAM,YAAA,EAAE,UAAU,gBAAA,EAAE,eAAe,EAAf,OAAO,mBAAG,KAAK,KAAA;IAK9E,IAAK,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,MAAM,KAAK,WAAW,EAAG;QACtE,OAAO,KAAK,CAAC;KACd;IAED,IAAK,CAAC,MAAM,EAAG;QACb,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;KAClG;IAED,IAAK,CAAC,UAAU,EAAG;QACjB,MAAM,IAAI,KAAK,CAAC,wFAAwF,CAAC,CAAC;KAC3G;IAKD,IAAM,SAAS,GAAQ,IAAI,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAG1D,IAAM,WAAW,GAAW,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAGpD,IAAK,WAAW,KAAK,CAAC,EAAG;QACvB,GAAG,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,CAAC;KACtC;IAGD,IAAK,WAAW,KAAK,CAAC,EAAG;QACvB,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,GAAG,SAAS,CAAC;KACpD;IAKD,IAAK,UAAU,EAAG;QAChB,SAAS,CAAC,IAAI,EAAE,CAAC;KAClB;IAKD,MAAM,CAAC,SAAS,CAAE,UAAC,EAAM;QACvB,IAAM,mBAAmB,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;QACvE,IAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClG,IAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAI,SAAS,UAAK,EAAE,CAAC,QAAU,CAAC,CAAC,CAAC,KAAG,SAAS,GAAG,EAAE,CAAC,QAAU,CAAC;QAExG,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/main.d.ts","writeByteOrderMark":false,"text":"export default function install(Vue: Vue, { router, siteIdList, isDebug }: Partial): boolean;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/71d0728306715942daacf4676366fd6a07b6b666 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/71d0728306715942daacf4676366fd6a07b6b666 deleted file mode 100644 index 869ac6c..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/71d0728306715942daacf4676366fd6a07b6b666 +++ /dev/null @@ -1 +0,0 @@ -{"code":"var BAIDU = (function () {\r\n function BAIDU(siteId, isDebug) {\r\n if (siteId === void 0) { siteId = ''; }\r\n if (isDebug === void 0) { isDebug = false; }\r\n this.siteId = siteId;\r\n this.isDebug = isDebug;\r\n }\r\n BAIDU.prototype.init = function () {\r\n window._hmt = window._hmt ? window._hmt : [];\r\n var SCRIPT = document.createElement('script');\r\n SCRIPT['async'] = true;\r\n SCRIPT['src'] = \"https://hm.baidu.com/hm.js?\" + this.siteId;\r\n document.querySelector('head').appendChild(SCRIPT);\r\n if (this.isDebug) {\r\n console.log(\"[vue-baidu-analytics] siteId load done.\\nsiteId: \" + this.siteId);\r\n }\r\n };\r\n BAIDU.prototype.setAccount = function () {\r\n window._hmt.push(['_setAccount', this.siteId]);\r\n };\r\n BAIDU.prototype.trackPageview = function (pageUrl) {\r\n if (!pageUrl || typeof pageUrl !== 'string') {\r\n pageUrl = '/';\r\n }\r\n if (pageUrl.includes('http')) {\r\n var PAGE_CUT = pageUrl.split('/');\r\n var HOST_NAME = PAGE_CUT[0] + \"//\" + PAGE_CUT[2];\r\n pageUrl = pageUrl.replace(HOST_NAME, '');\r\n }\r\n this.setAccount();\r\n window._hmt.push(['_trackPageview', pageUrl]);\r\n if (this.isDebug) {\r\n console.log(\"[vue-baidu-analytics] track pv done.\\nsiteId: \" + this.siteId + \"\\npageUrl: \" + pageUrl);\r\n }\r\n };\r\n BAIDU.prototype.trackEvent = function (category, action, label, value) {\r\n if (typeof category !== 'string' || typeof action !== 'string' || !category || !action) {\r\n throw new Error('[vue-baidu-analytics] Missing necessary category and operation information, and must be of type string.');\r\n return false;\r\n }\r\n if (!label || typeof label !== 'string') {\r\n label = '';\r\n }\r\n if (!Number(value)) {\r\n value = 1;\r\n }\r\n this.setAccount();\r\n window._hmt.push(['_trackEvent', category, action, label, value]);\r\n if (this.isDebug) {\r\n console.log(\"[vue-baidu-analytics] track event done.\\nsiteId: \" + this.siteId + \"\\ncategory: \" + category + \"\\naction: \" + action + \"\\nlabel: \" + label + \"\\nvalue: \" + value);\r\n }\r\n };\r\n return BAIDU;\r\n}());\r\nexport default BAIDU;\r\n//# sourceMappingURL=baidu.js.map","references":[],"map":"{\"version\":3,\"file\":\"baidu.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../src/modules/baidu.ts\"],\"names\":[],\"mappings\":\"AAIA;IAIE,eAAa,MAAmB,EAAE,OAAwB;QAA7C,uBAAA,EAAA,WAAmB;QAAE,wBAAA,EAAA,eAAwB;QACxD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAKD,oBAAI,GAAJ;QACE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;QACvB,MAAM,CAAC,KAAK,CAAC,GAAG,gCAA8B,IAAI,CAAC,MAAQ,CAAC;QAC5D,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAEnD,IAAK,IAAI,CAAC,OAAO,EAAG;YAClB,OAAO,CAAC,GAAG,CAAC,yDAAuD,IAAI,CAAC,MAAQ,CAAC,CAAC;SACnF;IACH,CAAC;IAKD,0BAAU,GAAV;QACE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACjD,CAAC;IAKD,6BAAa,GAAb,UAAe,OAAe;QAE5B,IAAK,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAG;YAC7C,OAAO,GAAG,GAAG,CAAC;SACf;QAGD,IAAK,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAG;YAC9B,IAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACpC,IAAM,SAAS,GAAM,QAAQ,CAAC,CAAC,CAAC,UAAK,QAAQ,CAAC,CAAC,CAAG,CAAC;YACnD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;SAC1C;QAGD,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC;QAE9C,IAAK,IAAI,CAAC,OAAO,EAAG;YAClB,OAAO,CAAC,GAAG,CAAC,sDAAoD,IAAI,CAAC,MAAM,qBAAgB,OAAS,CAAC,CAAC;SACvG;IACH,CAAC;IAKD,0BAAU,GAAV,UAAY,QAAgB,EAAE,MAAc,EAAE,KAAa,EAAE,KAAa;QAExE,IAAK,OAAO,QAAQ,KAAK,QAAQ,IAAK,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAG;YACzF,MAAM,IAAI,KAAK,CAAC,yGAAyG,CAAC,CAAC;YAC3H,OAAO,KAAK,CAAC;SACd;QAGD,IAAK,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAI;YAC1C,KAAK,GAAG,EAAE,CAAC;SACZ;QAED,IAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAG;YACpB,KAAK,GAAG,CAAC,CAAC;SACX;QAGD,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAElE,IAAK,IAAI,CAAC,OAAO,EAAG;YAClB,OAAO,CAAC,GAAG,CAAC,wDAAsD,IAAI,CAAC,MAAM,oBAAe,QAAQ,oBAAe,MAAM,oBAAe,KAAK,oBAAe,KAAO,CAAC,CAAC;SACtK;IACH,CAAC;IACH,YAAC;AAAD,CAAC,AAnFD,IAmFC;AAED,eAAe,KAAK,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/modules/baidu.d.ts","writeByteOrderMark":false,"text":"declare class BAIDU {\r\n siteId: string;\r\n isDebug: boolean;\r\n constructor(siteId?: string, isDebug?: boolean);\r\n init(): void;\r\n setAccount(): void;\r\n trackPageview(pageUrl: string): void;\r\n trackEvent(category: string, action: string, label: string, value: number): boolean;\r\n}\r\nexport default BAIDU;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f deleted file mode 100644 index 0f73f7c..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f +++ /dev/null @@ -1 +0,0 @@ -{"code":"import BAIDU from '@m/baidu';\r\nvar PushBAIDU = (function () {\r\n function PushBAIDU(siteIdList, isDebug) {\r\n this.siteIdList = siteIdList;\r\n this.isDebug = isDebug;\r\n }\r\n PushBAIDU.prototype.init = function () {\r\n var _this = this;\r\n this.siteIdList.forEach(function (siteId) {\r\n var SITE = new BAIDU(siteId, _this.isDebug);\r\n SITE.init();\r\n });\r\n };\r\n PushBAIDU.prototype.pv = function (pageUrl) {\r\n var _this = this;\r\n this.siteIdList.forEach(function (siteId) {\r\n var SITE = new BAIDU(siteId, _this.isDebug);\r\n SITE.trackPageview(pageUrl);\r\n });\r\n };\r\n PushBAIDU.prototype.event = function (category, action, label, value) {\r\n var _this = this;\r\n this.siteIdList.forEach(function (siteId) {\r\n var SITE = new BAIDU(siteId, _this.isDebug);\r\n SITE.trackEvent(category, action, label, value);\r\n });\r\n };\r\n return PushBAIDU;\r\n}());\r\nexport default PushBAIDU;\r\n//# sourceMappingURL=pushBAIDU.js.map","references":["E:/Project/npm-project/vue-baidu-analytics/src/modules/baidu.ts"],"map":"{\"version\":3,\"file\":\"pushBAIDU.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../src/modules/pushBAIDU.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,KAAK,MAAM,UAAU,CAAA;AAK5B;IAIE,mBAAa,UAAoB,EAAE,OAAgB;QACjD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAKD,wBAAI,GAAJ;QAAA,iBAKC;QAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;YACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAKD,sBAAE,GAAF,UAAI,OAAe;QAAnB,iBAKC;QAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;YACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC;IAKD,yBAAK,GAAL,UAAO,QAAgB,EAAE,MAAc,EAAE,KAAa,EAAE,KAAa;QAArE,iBAKC;QAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;YACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;IAEH,gBAAC;AAAD,CAAC,AAvCD,IAuCC;AAED,eAAe,SAAS,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/modules/pushBAIDU.d.ts","writeByteOrderMark":false,"text":"declare class PushBAIDU {\r\n siteIdList: string[];\r\n isDebug: boolean;\r\n constructor(siteIdList: string[], isDebug: boolean);\r\n init(): void;\r\n pv(pageUrl: string): void;\r\n event(category: string, action: string, label: string, value: number): void;\r\n}\r\nexport default PushBAIDU;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 deleted file mode 100644 index 33a88e8..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/code/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 +++ /dev/null @@ -1 +0,0 @@ -{"code":"var getVueVersion = function (Vue) {\r\n var version = 2;\r\n var VUE_VERSION = String(Vue.version);\r\n if (VUE_VERSION.slice(0, 2) === '2.') {\r\n version = 2;\r\n }\r\n if (VUE_VERSION.slice(0, 2) === '3.') {\r\n version = 3;\r\n }\r\n return version;\r\n};\r\nexport default getVueVersion;\r\n//# sourceMappingURL=getVueVersion.js.map","references":[],"map":"{\"version\":3,\"file\":\"getVueVersion.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../src/modules/getVueVersion.ts\"],\"names\":[],\"mappings\":\"AAIA,IAAM,aAAa,GAAG,UAAC,GAAQ;IAC7B,IAAI,OAAO,GAAW,CAAC,CAAC;IAGxB,IAAM,WAAW,GAAW,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAGhD,IAAK,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAG;QACtC,OAAO,GAAG,CAAC,CAAC;KACb;IAGD,IAAK,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAG;QACtC,OAAO,GAAG,CAAC,CAAC;KACb;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAA;AAED,eAAe,aAAa,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/modules/getVueVersion.d.ts","writeByteOrderMark":false,"text":"declare const getVueVersion: (Vue: Vue) => number;\r\nexport default getVueVersion;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/6e96f10b2453abe2284fcac86f4f114057c5af72 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/6e96f10b2453abe2284fcac86f4f114057c5af72 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/6e96f10b2453abe2284fcac86f4f114057c5af72 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/semanticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/6e96f10b2453abe2284fcac86f4f114057c5af72 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/6e96f10b2453abe2284fcac86f4f114057c5af72 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/6e96f10b2453abe2284fcac86f4f114057c5af72 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/syntacticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/1c71620f0f64c282751681bcbbf1857fa7b7b906 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/1c71620f0f64c282751681bcbbf1857fa7b7b906 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/22c7731e225cfb17a9b74dedae0216837a12d163 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/22c7731e225cfb17a9b74dedae0216837a12d163 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/41c393035312d6bc3286d4224ecba574f0de1915 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/41c393035312d6bc3286d4224ecba574f0de1915 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/8507ed218024f52c1ee576a6f7f04b4740e12996 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/8507ed218024f52c1ee576a6f7f04b4740e12996 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/a9368f7e7383c0e591fb7e73549570e38aade49f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/a9368f7e7383c0e591fb7e73549570e38aade49f deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/af7c746871ddaade47bc7ee702b80e980877bc94 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/af7c746871ddaade47bc7ee702b80e980877bc94 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/e79b9f180b673e0eb891e4974b2b9006e56cf60b b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/e79b9f180b673e0eb891e4974b2b9006e56cf60b deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df b/node_modules/.cache/rollup-plugin-typescript2/rpt2_56a254290f59cca159c8414b7febc556d45be59c/types/cache/ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/code/cache/71d0728306715942daacf4676366fd6a07b6b666 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/code/cache/71d0728306715942daacf4676366fd6a07b6b666 deleted file mode 100644 index 869ac6c..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/code/cache/71d0728306715942daacf4676366fd6a07b6b666 +++ /dev/null @@ -1 +0,0 @@ -{"code":"var BAIDU = (function () {\r\n function BAIDU(siteId, isDebug) {\r\n if (siteId === void 0) { siteId = ''; }\r\n if (isDebug === void 0) { isDebug = false; }\r\n this.siteId = siteId;\r\n this.isDebug = isDebug;\r\n }\r\n BAIDU.prototype.init = function () {\r\n window._hmt = window._hmt ? window._hmt : [];\r\n var SCRIPT = document.createElement('script');\r\n SCRIPT['async'] = true;\r\n SCRIPT['src'] = \"https://hm.baidu.com/hm.js?\" + this.siteId;\r\n document.querySelector('head').appendChild(SCRIPT);\r\n if (this.isDebug) {\r\n console.log(\"[vue-baidu-analytics] siteId load done.\\nsiteId: \" + this.siteId);\r\n }\r\n };\r\n BAIDU.prototype.setAccount = function () {\r\n window._hmt.push(['_setAccount', this.siteId]);\r\n };\r\n BAIDU.prototype.trackPageview = function (pageUrl) {\r\n if (!pageUrl || typeof pageUrl !== 'string') {\r\n pageUrl = '/';\r\n }\r\n if (pageUrl.includes('http')) {\r\n var PAGE_CUT = pageUrl.split('/');\r\n var HOST_NAME = PAGE_CUT[0] + \"//\" + PAGE_CUT[2];\r\n pageUrl = pageUrl.replace(HOST_NAME, '');\r\n }\r\n this.setAccount();\r\n window._hmt.push(['_trackPageview', pageUrl]);\r\n if (this.isDebug) {\r\n console.log(\"[vue-baidu-analytics] track pv done.\\nsiteId: \" + this.siteId + \"\\npageUrl: \" + pageUrl);\r\n }\r\n };\r\n BAIDU.prototype.trackEvent = function (category, action, label, value) {\r\n if (typeof category !== 'string' || typeof action !== 'string' || !category || !action) {\r\n throw new Error('[vue-baidu-analytics] Missing necessary category and operation information, and must be of type string.');\r\n return false;\r\n }\r\n if (!label || typeof label !== 'string') {\r\n label = '';\r\n }\r\n if (!Number(value)) {\r\n value = 1;\r\n }\r\n this.setAccount();\r\n window._hmt.push(['_trackEvent', category, action, label, value]);\r\n if (this.isDebug) {\r\n console.log(\"[vue-baidu-analytics] track event done.\\nsiteId: \" + this.siteId + \"\\ncategory: \" + category + \"\\naction: \" + action + \"\\nlabel: \" + label + \"\\nvalue: \" + value);\r\n }\r\n };\r\n return BAIDU;\r\n}());\r\nexport default BAIDU;\r\n//# sourceMappingURL=baidu.js.map","references":[],"map":"{\"version\":3,\"file\":\"baidu.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../src/modules/baidu.ts\"],\"names\":[],\"mappings\":\"AAIA;IAIE,eAAa,MAAmB,EAAE,OAAwB;QAA7C,uBAAA,EAAA,WAAmB;QAAE,wBAAA,EAAA,eAAwB;QACxD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAKD,oBAAI,GAAJ;QACE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;QACvB,MAAM,CAAC,KAAK,CAAC,GAAG,gCAA8B,IAAI,CAAC,MAAQ,CAAC;QAC5D,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAEnD,IAAK,IAAI,CAAC,OAAO,EAAG;YAClB,OAAO,CAAC,GAAG,CAAC,yDAAuD,IAAI,CAAC,MAAQ,CAAC,CAAC;SACnF;IACH,CAAC;IAKD,0BAAU,GAAV;QACE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACjD,CAAC;IAKD,6BAAa,GAAb,UAAe,OAAe;QAE5B,IAAK,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAG;YAC7C,OAAO,GAAG,GAAG,CAAC;SACf;QAGD,IAAK,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAG;YAC9B,IAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACpC,IAAM,SAAS,GAAM,QAAQ,CAAC,CAAC,CAAC,UAAK,QAAQ,CAAC,CAAC,CAAG,CAAC;YACnD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;SAC1C;QAGD,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC;QAE9C,IAAK,IAAI,CAAC,OAAO,EAAG;YAClB,OAAO,CAAC,GAAG,CAAC,sDAAoD,IAAI,CAAC,MAAM,qBAAgB,OAAS,CAAC,CAAC;SACvG;IACH,CAAC;IAKD,0BAAU,GAAV,UAAY,QAAgB,EAAE,MAAc,EAAE,KAAa,EAAE,KAAa;QAExE,IAAK,OAAO,QAAQ,KAAK,QAAQ,IAAK,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAG;YACzF,MAAM,IAAI,KAAK,CAAC,yGAAyG,CAAC,CAAC;YAC3H,OAAO,KAAK,CAAC;SACd;QAGD,IAAK,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAI;YAC1C,KAAK,GAAG,EAAE,CAAC;SACZ;QAED,IAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAG;YACpB,KAAK,GAAG,CAAC,CAAC;SACX;QAGD,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAElE,IAAK,IAAI,CAAC,OAAO,EAAG;YAClB,OAAO,CAAC,GAAG,CAAC,wDAAsD,IAAI,CAAC,MAAM,oBAAe,QAAQ,oBAAe,MAAM,oBAAe,KAAK,oBAAe,KAAO,CAAC,CAAC;SACtK;IACH,CAAC;IACH,YAAC;AAAD,CAAC,AAnFD,IAmFC;AAED,eAAe,KAAK,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/modules/baidu.d.ts","writeByteOrderMark":false,"text":"declare class BAIDU {\r\n siteId: string;\r\n isDebug: boolean;\r\n constructor(siteId?: string, isDebug?: boolean);\r\n init(): void;\r\n setAccount(): void;\r\n trackPageview(pageUrl: string): void;\r\n trackEvent(category: string, action: string, label: string, value: number): boolean;\r\n}\r\nexport default BAIDU;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f deleted file mode 100644 index 0f73f7c..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f +++ /dev/null @@ -1 +0,0 @@ -{"code":"import BAIDU from '@m/baidu';\r\nvar PushBAIDU = (function () {\r\n function PushBAIDU(siteIdList, isDebug) {\r\n this.siteIdList = siteIdList;\r\n this.isDebug = isDebug;\r\n }\r\n PushBAIDU.prototype.init = function () {\r\n var _this = this;\r\n this.siteIdList.forEach(function (siteId) {\r\n var SITE = new BAIDU(siteId, _this.isDebug);\r\n SITE.init();\r\n });\r\n };\r\n PushBAIDU.prototype.pv = function (pageUrl) {\r\n var _this = this;\r\n this.siteIdList.forEach(function (siteId) {\r\n var SITE = new BAIDU(siteId, _this.isDebug);\r\n SITE.trackPageview(pageUrl);\r\n });\r\n };\r\n PushBAIDU.prototype.event = function (category, action, label, value) {\r\n var _this = this;\r\n this.siteIdList.forEach(function (siteId) {\r\n var SITE = new BAIDU(siteId, _this.isDebug);\r\n SITE.trackEvent(category, action, label, value);\r\n });\r\n };\r\n return PushBAIDU;\r\n}());\r\nexport default PushBAIDU;\r\n//# sourceMappingURL=pushBAIDU.js.map","references":["E:/Project/npm-project/vue-baidu-analytics/src/modules/baidu.ts"],"map":"{\"version\":3,\"file\":\"pushBAIDU.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../src/modules/pushBAIDU.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,KAAK,MAAM,UAAU,CAAA;AAK5B;IAIE,mBAAa,UAAoB,EAAE,OAAgB;QACjD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAKD,wBAAI,GAAJ;QAAA,iBAKC;QAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;YACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAKD,sBAAE,GAAF,UAAI,OAAe;QAAnB,iBAKC;QAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;YACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC;IAKD,yBAAK,GAAL,UAAO,QAAgB,EAAE,MAAc,EAAE,KAAa,EAAE,KAAa;QAArE,iBAKC;QAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;YACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;IAEH,gBAAC;AAAD,CAAC,AAvCD,IAuCC;AAED,eAAe,SAAS,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/modules/pushBAIDU.d.ts","writeByteOrderMark":false,"text":"declare class PushBAIDU {\r\n siteIdList: string[];\r\n isDebug: boolean;\r\n constructor(siteIdList: string[], isDebug: boolean);\r\n init(): void;\r\n pv(pageUrl: string): void;\r\n event(category: string, action: string, label: string, value: number): void;\r\n}\r\nexport default PushBAIDU;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/code/cache/f6237713b6c1a1c850dff265f54577dfa2c1cf9c b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/code/cache/f6237713b6c1a1c850dff265f54577dfa2c1cf9c deleted file mode 100644 index f23f9e7..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/code/cache/f6237713b6c1a1c850dff265f54577dfa2c1cf9c +++ /dev/null @@ -1 +0,0 @@ -{"code":"import { isVue2, isVue3 } from 'vue-demi';\r\nimport PushBAIDU from '@m/pushBAIDU';\r\nexport var pushBAIDU = null;\r\nconsole.log({\r\n 'isVue2': isVue2,\r\n 'isVue3': isVue3\r\n});\r\nexport default function install(Vue, _a) {\r\n var router = _a.router, siteIdList = _a.siteIdList, _b = _a.isDebug, isDebug = _b === void 0 ? false : _b;\r\n if (typeof document === 'undefined' || typeof window === 'undefined') {\r\n return false;\r\n }\r\n if (!router) {\r\n throw new Error('[vue-baidu-analytics] Must pass a Vue-Router instance to vue-baidu-analytics.');\r\n }\r\n if (!siteIdList) {\r\n throw new Error('[vue-baidu-analytics] Missing tracking domain ID, add at least one of baidu analytics.');\r\n }\r\n pushBAIDU = new PushBAIDU(siteIdList, isDebug);\r\n if (isVue2) {\r\n Vue.prototype.$pushBAIDU = pushBAIDU;\r\n }\r\n if (siteIdList) {\r\n pushBAIDU.init();\r\n }\r\n router.afterEach(function (to) {\r\n var PAGE_PATH_DIR_COUNT = window.location.pathname.split('/').length;\r\n var PAGE_PATH = window.location.pathname.split('/').slice(0, PAGE_PATH_DIR_COUNT - 1).join('/');\r\n var PAGE_URL = router.mode === 'hash' ? PAGE_PATH + \"/#\" + to.fullPath : \"\" + PAGE_PATH + to.fullPath;\r\n pushBAIDU.pv(PAGE_URL);\r\n });\r\n}\r\n//# sourceMappingURL=main.js.map","references":["E:/Project/npm-project/vue-baidu-analytics/node_modules/vue-demi/lib/index.d.ts","E:/Project/npm-project/vue-baidu-analytics/src/modules/pushBAIDU.ts"],"map":"{\"version\":3,\"file\":\"main.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/main.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,SAAS,MAAM,cAAc,CAAA;AAKpC,MAAM,CAAC,IAAI,SAAS,GAAQ,IAAI,CAAC;AAEjC,OAAO,CAAC,GAAG,CAAC;IACV,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;CACjB,CAAC,CAAC;AAGH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAE,GAAQ,EAAE,EAAyD;QAAvD,MAAM,YAAA,EAAE,UAAU,gBAAA,EAAE,eAAe,EAAf,OAAO,mBAAG,KAAK,KAAA;IAK9E,IAAK,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,MAAM,KAAK,WAAW,EAAG;QACtE,OAAO,KAAK,CAAC;KACd;IAED,IAAK,CAAC,MAAM,EAAG;QACb,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;KAClG;IAED,IAAK,CAAC,UAAU,EAAG;QACjB,MAAM,IAAI,KAAK,CAAC,wFAAwF,CAAC,CAAC;KAC3G;IAKD,SAAS,GAAG,IAAI,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC/C,IAAK,MAAM,EAAG;QACZ,GAAG,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,CAAC;KACtC;IAKD,IAAK,UAAU,EAAG;QAChB,SAAS,CAAC,IAAI,EAAE,CAAC;KAClB;IAKD,MAAM,CAAC,SAAS,CAAE,UAAC,EAAM;QACvB,IAAM,mBAAmB,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;QACvE,IAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClG,IAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAI,SAAS,UAAK,EAAE,CAAC,QAAU,CAAC,CAAC,CAAC,KAAG,SAAS,GAAG,EAAE,CAAC,QAAU,CAAC;QAExG,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/main.d.ts","writeByteOrderMark":false,"text":"export declare let pushBAIDU: any;\r\nexport default function install(Vue: Vue, { router, siteIdList, isDebug }: Partial): boolean;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/semanticDiagnostics/cache/f6237713b6c1a1c850dff265f54577dfa2c1cf9c b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/semanticDiagnostics/cache/f6237713b6c1a1c850dff265f54577dfa2c1cf9c deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/semanticDiagnostics/cache/f6237713b6c1a1c850dff265f54577dfa2c1cf9c +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/syntacticDiagnostics/cache/f6237713b6c1a1c850dff265f54577dfa2c1cf9c b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/syntacticDiagnostics/cache/f6237713b6c1a1c850dff265f54577dfa2c1cf9c deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/syntacticDiagnostics/cache/f6237713b6c1a1c850dff265f54577dfa2c1cf9c +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/1c71620f0f64c282751681bcbbf1857fa7b7b906 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/1c71620f0f64c282751681bcbbf1857fa7b7b906 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/22c7731e225cfb17a9b74dedae0216837a12d163 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/22c7731e225cfb17a9b74dedae0216837a12d163 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/472dd740db5f8940713eec824d1f866ae3a38218 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/472dd740db5f8940713eec824d1f866ae3a38218 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/8507ed218024f52c1ee576a6f7f04b4740e12996 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/8507ed218024f52c1ee576a6f7f04b4740e12996 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/a9368f7e7383c0e591fb7e73549570e38aade49f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/a9368f7e7383c0e591fb7e73549570e38aade49f deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/af7c746871ddaade47bc7ee702b80e980877bc94 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/af7c746871ddaade47bc7ee702b80e980877bc94 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/e79b9f180b673e0eb891e4974b2b9006e56cf60b b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/e79b9f180b673e0eb891e4974b2b9006e56cf60b deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df b/node_modules/.cache/rollup-plugin-typescript2/rpt2_d48ddb29af34e4a62f2acc1b6937eb9a9364b57d/types/cache/ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/code/cache/0f0fac159449201b6d39193472434fbb085c928d b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/code/cache/0f0fac159449201b6d39193472434fbb085c928d deleted file mode 100644 index 5247a3d..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/code/cache/0f0fac159449201b6d39193472434fbb085c928d +++ /dev/null @@ -1 +0,0 @@ -{"code":"import PushBAIDU from '@m/pushBAIDU';\r\nexport var pushBAIDU = null;\r\nexport default function install(Vue, _a) {\r\n var router = _a.router, siteIdList = _a.siteIdList, _b = _a.isDebug, isDebug = _b === void 0 ? false : _b;\r\n if (typeof document === 'undefined' || typeof window === 'undefined') {\r\n return false;\r\n }\r\n if (!router) {\r\n throw new Error('[vue-baidu-analytics] Must pass a Vue-Router instance to vue-baidu-analytics.');\r\n }\r\n if (!siteIdList) {\r\n throw new Error('[vue-baidu-analytics] Missing tracking domain ID, add at least one of baidu analytics.');\r\n }\r\n pushBAIDU = new PushBAIDU(siteIdList, isDebug);\r\n try {\r\n Vue.prototype.$pushBAIDU = pushBAIDU;\r\n }\r\n catch (e) {\r\n console.log(e);\r\n }\r\n console.log(Vue);\r\n if ('version' in Vue) {\r\n console.log(Vue.version);\r\n }\r\n if (siteIdList) {\r\n pushBAIDU.init();\r\n }\r\n router.afterEach(function (to) {\r\n var PAGE_PATH_DIR_COUNT = window.location.pathname.split('/').length;\r\n var PAGE_PATH = window.location.pathname.split('/').slice(0, PAGE_PATH_DIR_COUNT - 1).join('/');\r\n var PAGE_URL = router.mode === 'hash' ? PAGE_PATH + \"/#\" + to.fullPath : \"\" + PAGE_PATH + to.fullPath;\r\n pushBAIDU.pv(PAGE_URL);\r\n });\r\n}\r\n//# sourceMappingURL=main.js.map","references":["E:/Project/npm-project/vue-baidu-analytics/src/modules/pushBAIDU.ts"],"map":"{\"version\":3,\"file\":\"main.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/main.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,SAAS,MAAM,cAAc,CAAA;AAKpC,MAAM,CAAC,IAAI,SAAS,GAAQ,IAAI,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAE,GAAQ,EAAE,EAAyD;QAAvD,MAAM,YAAA,EAAE,UAAU,gBAAA,EAAE,eAAe,EAAf,OAAO,mBAAG,KAAK,KAAA;IAK9E,IAAK,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,MAAM,KAAK,WAAW,EAAG;QACtE,OAAO,KAAK,CAAC;KACd;IAED,IAAK,CAAC,MAAM,EAAG;QACb,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;KAClG;IAED,IAAK,CAAC,UAAU,EAAG;QACjB,MAAM,IAAI,KAAK,CAAC,wFAAwF,CAAC,CAAC;KAC3G;IAKD,SAAS,GAAG,IAAI,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC/C,IAAI;QACF,GAAG,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,CAAC;KACtC;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAChB;IAED,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjB,IAAK,SAAS,IAAI,GAAG,EAAG;QACtB,OAAO,CAAC,GAAG,CAAE,GAAW,CAAC,OAAO,CAAC,CAAC;KACnC;IAKD,IAAK,UAAU,EAAG;QAChB,SAAS,CAAC,IAAI,EAAE,CAAC;KAClB;IAKD,MAAM,CAAC,SAAS,CAAE,UAAC,EAAM;QACvB,IAAM,mBAAmB,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;QACvE,IAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClG,IAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAI,SAAS,UAAK,EAAE,CAAC,QAAU,CAAC,CAAC,CAAC,KAAG,SAAS,GAAG,EAAE,CAAC,QAAU,CAAC;QAExG,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/main.d.ts","writeByteOrderMark":false,"text":"export declare let pushBAIDU: any;\r\nexport default function install(Vue: Vue, { router, siteIdList, isDebug }: Partial): boolean;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/code/cache/71d0728306715942daacf4676366fd6a07b6b666 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/code/cache/71d0728306715942daacf4676366fd6a07b6b666 deleted file mode 100644 index 869ac6c..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/code/cache/71d0728306715942daacf4676366fd6a07b6b666 +++ /dev/null @@ -1 +0,0 @@ -{"code":"var BAIDU = (function () {\r\n function BAIDU(siteId, isDebug) {\r\n if (siteId === void 0) { siteId = ''; }\r\n if (isDebug === void 0) { isDebug = false; }\r\n this.siteId = siteId;\r\n this.isDebug = isDebug;\r\n }\r\n BAIDU.prototype.init = function () {\r\n window._hmt = window._hmt ? window._hmt : [];\r\n var SCRIPT = document.createElement('script');\r\n SCRIPT['async'] = true;\r\n SCRIPT['src'] = \"https://hm.baidu.com/hm.js?\" + this.siteId;\r\n document.querySelector('head').appendChild(SCRIPT);\r\n if (this.isDebug) {\r\n console.log(\"[vue-baidu-analytics] siteId load done.\\nsiteId: \" + this.siteId);\r\n }\r\n };\r\n BAIDU.prototype.setAccount = function () {\r\n window._hmt.push(['_setAccount', this.siteId]);\r\n };\r\n BAIDU.prototype.trackPageview = function (pageUrl) {\r\n if (!pageUrl || typeof pageUrl !== 'string') {\r\n pageUrl = '/';\r\n }\r\n if (pageUrl.includes('http')) {\r\n var PAGE_CUT = pageUrl.split('/');\r\n var HOST_NAME = PAGE_CUT[0] + \"//\" + PAGE_CUT[2];\r\n pageUrl = pageUrl.replace(HOST_NAME, '');\r\n }\r\n this.setAccount();\r\n window._hmt.push(['_trackPageview', pageUrl]);\r\n if (this.isDebug) {\r\n console.log(\"[vue-baidu-analytics] track pv done.\\nsiteId: \" + this.siteId + \"\\npageUrl: \" + pageUrl);\r\n }\r\n };\r\n BAIDU.prototype.trackEvent = function (category, action, label, value) {\r\n if (typeof category !== 'string' || typeof action !== 'string' || !category || !action) {\r\n throw new Error('[vue-baidu-analytics] Missing necessary category and operation information, and must be of type string.');\r\n return false;\r\n }\r\n if (!label || typeof label !== 'string') {\r\n label = '';\r\n }\r\n if (!Number(value)) {\r\n value = 1;\r\n }\r\n this.setAccount();\r\n window._hmt.push(['_trackEvent', category, action, label, value]);\r\n if (this.isDebug) {\r\n console.log(\"[vue-baidu-analytics] track event done.\\nsiteId: \" + this.siteId + \"\\ncategory: \" + category + \"\\naction: \" + action + \"\\nlabel: \" + label + \"\\nvalue: \" + value);\r\n }\r\n };\r\n return BAIDU;\r\n}());\r\nexport default BAIDU;\r\n//# sourceMappingURL=baidu.js.map","references":[],"map":"{\"version\":3,\"file\":\"baidu.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../src/modules/baidu.ts\"],\"names\":[],\"mappings\":\"AAIA;IAIE,eAAa,MAAmB,EAAE,OAAwB;QAA7C,uBAAA,EAAA,WAAmB;QAAE,wBAAA,EAAA,eAAwB;QACxD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAKD,oBAAI,GAAJ;QACE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;QACvB,MAAM,CAAC,KAAK,CAAC,GAAG,gCAA8B,IAAI,CAAC,MAAQ,CAAC;QAC5D,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAEnD,IAAK,IAAI,CAAC,OAAO,EAAG;YAClB,OAAO,CAAC,GAAG,CAAC,yDAAuD,IAAI,CAAC,MAAQ,CAAC,CAAC;SACnF;IACH,CAAC;IAKD,0BAAU,GAAV;QACE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACjD,CAAC;IAKD,6BAAa,GAAb,UAAe,OAAe;QAE5B,IAAK,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAG;YAC7C,OAAO,GAAG,GAAG,CAAC;SACf;QAGD,IAAK,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAG;YAC9B,IAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACpC,IAAM,SAAS,GAAM,QAAQ,CAAC,CAAC,CAAC,UAAK,QAAQ,CAAC,CAAC,CAAG,CAAC;YACnD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;SAC1C;QAGD,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC;QAE9C,IAAK,IAAI,CAAC,OAAO,EAAG;YAClB,OAAO,CAAC,GAAG,CAAC,sDAAoD,IAAI,CAAC,MAAM,qBAAgB,OAAS,CAAC,CAAC;SACvG;IACH,CAAC;IAKD,0BAAU,GAAV,UAAY,QAAgB,EAAE,MAAc,EAAE,KAAa,EAAE,KAAa;QAExE,IAAK,OAAO,QAAQ,KAAK,QAAQ,IAAK,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAG;YACzF,MAAM,IAAI,KAAK,CAAC,yGAAyG,CAAC,CAAC;YAC3H,OAAO,KAAK,CAAC;SACd;QAGD,IAAK,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAI;YAC1C,KAAK,GAAG,EAAE,CAAC;SACZ;QAED,IAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAG;YACpB,KAAK,GAAG,CAAC,CAAC;SACX;QAGD,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAElE,IAAK,IAAI,CAAC,OAAO,EAAG;YAClB,OAAO,CAAC,GAAG,CAAC,wDAAsD,IAAI,CAAC,MAAM,oBAAe,QAAQ,oBAAe,MAAM,oBAAe,KAAK,oBAAe,KAAO,CAAC,CAAC;SACtK;IACH,CAAC;IACH,YAAC;AAAD,CAAC,AAnFD,IAmFC;AAED,eAAe,KAAK,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/modules/baidu.d.ts","writeByteOrderMark":false,"text":"declare class BAIDU {\r\n siteId: string;\r\n isDebug: boolean;\r\n constructor(siteId?: string, isDebug?: boolean);\r\n init(): void;\r\n setAccount(): void;\r\n trackPageview(pageUrl: string): void;\r\n trackEvent(category: string, action: string, label: string, value: number): boolean;\r\n}\r\nexport default BAIDU;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f deleted file mode 100644 index 0f73f7c..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f +++ /dev/null @@ -1 +0,0 @@ -{"code":"import BAIDU from '@m/baidu';\r\nvar PushBAIDU = (function () {\r\n function PushBAIDU(siteIdList, isDebug) {\r\n this.siteIdList = siteIdList;\r\n this.isDebug = isDebug;\r\n }\r\n PushBAIDU.prototype.init = function () {\r\n var _this = this;\r\n this.siteIdList.forEach(function (siteId) {\r\n var SITE = new BAIDU(siteId, _this.isDebug);\r\n SITE.init();\r\n });\r\n };\r\n PushBAIDU.prototype.pv = function (pageUrl) {\r\n var _this = this;\r\n this.siteIdList.forEach(function (siteId) {\r\n var SITE = new BAIDU(siteId, _this.isDebug);\r\n SITE.trackPageview(pageUrl);\r\n });\r\n };\r\n PushBAIDU.prototype.event = function (category, action, label, value) {\r\n var _this = this;\r\n this.siteIdList.forEach(function (siteId) {\r\n var SITE = new BAIDU(siteId, _this.isDebug);\r\n SITE.trackEvent(category, action, label, value);\r\n });\r\n };\r\n return PushBAIDU;\r\n}());\r\nexport default PushBAIDU;\r\n//# sourceMappingURL=pushBAIDU.js.map","references":["E:/Project/npm-project/vue-baidu-analytics/src/modules/baidu.ts"],"map":"{\"version\":3,\"file\":\"pushBAIDU.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../src/modules/pushBAIDU.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,KAAK,MAAM,UAAU,CAAA;AAK5B;IAIE,mBAAa,UAAoB,EAAE,OAAgB;QACjD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAKD,wBAAI,GAAJ;QAAA,iBAKC;QAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;YACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAKD,sBAAE,GAAF,UAAI,OAAe;QAAnB,iBAKC;QAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;YACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC;IAKD,yBAAK,GAAL,UAAO,QAAgB,EAAE,MAAc,EAAE,KAAa,EAAE,KAAa;QAArE,iBAKC;QAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;YACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;IAEH,gBAAC;AAAD,CAAC,AAvCD,IAuCC;AAED,eAAe,SAAS,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/modules/pushBAIDU.d.ts","writeByteOrderMark":false,"text":"declare class PushBAIDU {\r\n siteIdList: string[];\r\n isDebug: boolean;\r\n constructor(siteIdList: string[], isDebug: boolean);\r\n init(): void;\r\n pv(pageUrl: string): void;\r\n event(category: string, action: string, label: string, value: number): void;\r\n}\r\nexport default PushBAIDU;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/semanticDiagnostics/cache/0f0fac159449201b6d39193472434fbb085c928d b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/semanticDiagnostics/cache/0f0fac159449201b6d39193472434fbb085c928d deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/semanticDiagnostics/cache/0f0fac159449201b6d39193472434fbb085c928d +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/syntacticDiagnostics/cache/0f0fac159449201b6d39193472434fbb085c928d b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/syntacticDiagnostics/cache/0f0fac159449201b6d39193472434fbb085c928d deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/syntacticDiagnostics/cache/0f0fac159449201b6d39193472434fbb085c928d +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/1c71620f0f64c282751681bcbbf1857fa7b7b906 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/1c71620f0f64c282751681bcbbf1857fa7b7b906 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/22c7731e225cfb17a9b74dedae0216837a12d163 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/22c7731e225cfb17a9b74dedae0216837a12d163 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/472dd740db5f8940713eec824d1f866ae3a38218 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/472dd740db5f8940713eec824d1f866ae3a38218 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/8507ed218024f52c1ee576a6f7f04b4740e12996 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/8507ed218024f52c1ee576a6f7f04b4740e12996 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/a9368f7e7383c0e591fb7e73549570e38aade49f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/a9368f7e7383c0e591fb7e73549570e38aade49f deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/af7c746871ddaade47bc7ee702b80e980877bc94 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/af7c746871ddaade47bc7ee702b80e980877bc94 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/e79b9f180b673e0eb891e4974b2b9006e56cf60b b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/e79b9f180b673e0eb891e4974b2b9006e56cf60b deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df b/node_modules/.cache/rollup-plugin-typescript2/rpt2_de52b72a25bc6a4ec3b82892d481c4d6a107d9f9/types/cache/ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/71d0728306715942daacf4676366fd6a07b6b666 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/71d0728306715942daacf4676366fd6a07b6b666 deleted file mode 100644 index 869ac6c..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/71d0728306715942daacf4676366fd6a07b6b666 +++ /dev/null @@ -1 +0,0 @@ -{"code":"var BAIDU = (function () {\r\n function BAIDU(siteId, isDebug) {\r\n if (siteId === void 0) { siteId = ''; }\r\n if (isDebug === void 0) { isDebug = false; }\r\n this.siteId = siteId;\r\n this.isDebug = isDebug;\r\n }\r\n BAIDU.prototype.init = function () {\r\n window._hmt = window._hmt ? window._hmt : [];\r\n var SCRIPT = document.createElement('script');\r\n SCRIPT['async'] = true;\r\n SCRIPT['src'] = \"https://hm.baidu.com/hm.js?\" + this.siteId;\r\n document.querySelector('head').appendChild(SCRIPT);\r\n if (this.isDebug) {\r\n console.log(\"[vue-baidu-analytics] siteId load done.\\nsiteId: \" + this.siteId);\r\n }\r\n };\r\n BAIDU.prototype.setAccount = function () {\r\n window._hmt.push(['_setAccount', this.siteId]);\r\n };\r\n BAIDU.prototype.trackPageview = function (pageUrl) {\r\n if (!pageUrl || typeof pageUrl !== 'string') {\r\n pageUrl = '/';\r\n }\r\n if (pageUrl.includes('http')) {\r\n var PAGE_CUT = pageUrl.split('/');\r\n var HOST_NAME = PAGE_CUT[0] + \"//\" + PAGE_CUT[2];\r\n pageUrl = pageUrl.replace(HOST_NAME, '');\r\n }\r\n this.setAccount();\r\n window._hmt.push(['_trackPageview', pageUrl]);\r\n if (this.isDebug) {\r\n console.log(\"[vue-baidu-analytics] track pv done.\\nsiteId: \" + this.siteId + \"\\npageUrl: \" + pageUrl);\r\n }\r\n };\r\n BAIDU.prototype.trackEvent = function (category, action, label, value) {\r\n if (typeof category !== 'string' || typeof action !== 'string' || !category || !action) {\r\n throw new Error('[vue-baidu-analytics] Missing necessary category and operation information, and must be of type string.');\r\n return false;\r\n }\r\n if (!label || typeof label !== 'string') {\r\n label = '';\r\n }\r\n if (!Number(value)) {\r\n value = 1;\r\n }\r\n this.setAccount();\r\n window._hmt.push(['_trackEvent', category, action, label, value]);\r\n if (this.isDebug) {\r\n console.log(\"[vue-baidu-analytics] track event done.\\nsiteId: \" + this.siteId + \"\\ncategory: \" + category + \"\\naction: \" + action + \"\\nlabel: \" + label + \"\\nvalue: \" + value);\r\n }\r\n };\r\n return BAIDU;\r\n}());\r\nexport default BAIDU;\r\n//# sourceMappingURL=baidu.js.map","references":[],"map":"{\"version\":3,\"file\":\"baidu.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../src/modules/baidu.ts\"],\"names\":[],\"mappings\":\"AAIA;IAIE,eAAa,MAAmB,EAAE,OAAwB;QAA7C,uBAAA,EAAA,WAAmB;QAAE,wBAAA,EAAA,eAAwB;QACxD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAKD,oBAAI,GAAJ;QACE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;QACvB,MAAM,CAAC,KAAK,CAAC,GAAG,gCAA8B,IAAI,CAAC,MAAQ,CAAC;QAC5D,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAEnD,IAAK,IAAI,CAAC,OAAO,EAAG;YAClB,OAAO,CAAC,GAAG,CAAC,yDAAuD,IAAI,CAAC,MAAQ,CAAC,CAAC;SACnF;IACH,CAAC;IAKD,0BAAU,GAAV;QACE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACjD,CAAC;IAKD,6BAAa,GAAb,UAAe,OAAe;QAE5B,IAAK,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAG;YAC7C,OAAO,GAAG,GAAG,CAAC;SACf;QAGD,IAAK,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAG;YAC9B,IAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACpC,IAAM,SAAS,GAAM,QAAQ,CAAC,CAAC,CAAC,UAAK,QAAQ,CAAC,CAAC,CAAG,CAAC;YACnD,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;SAC1C;QAGD,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC;QAE9C,IAAK,IAAI,CAAC,OAAO,EAAG;YAClB,OAAO,CAAC,GAAG,CAAC,sDAAoD,IAAI,CAAC,MAAM,qBAAgB,OAAS,CAAC,CAAC;SACvG;IACH,CAAC;IAKD,0BAAU,GAAV,UAAY,QAAgB,EAAE,MAAc,EAAE,KAAa,EAAE,KAAa;QAExE,IAAK,OAAO,QAAQ,KAAK,QAAQ,IAAK,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAG;YACzF,MAAM,IAAI,KAAK,CAAC,yGAAyG,CAAC,CAAC;YAC3H,OAAO,KAAK,CAAC;SACd;QAGD,IAAK,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAI;YAC1C,KAAK,GAAG,EAAE,CAAC;SACZ;QAED,IAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAG;YACpB,KAAK,GAAG,CAAC,CAAC;SACX;QAGD,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAElE,IAAK,IAAI,CAAC,OAAO,EAAG;YAClB,OAAO,CAAC,GAAG,CAAC,wDAAsD,IAAI,CAAC,MAAM,oBAAe,QAAQ,oBAAe,MAAM,oBAAe,KAAK,oBAAe,KAAO,CAAC,CAAC;SACtK;IACH,CAAC;IACH,YAAC;AAAD,CAAC,AAnFD,IAmFC;AAED,eAAe,KAAK,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/modules/baidu.d.ts","writeByteOrderMark":false,"text":"declare class BAIDU {\r\n siteId: string;\r\n isDebug: boolean;\r\n constructor(siteId?: string, isDebug?: boolean);\r\n init(): void;\r\n setAccount(): void;\r\n trackPageview(pageUrl: string): void;\r\n trackEvent(category: string, action: string, label: string, value: number): boolean;\r\n}\r\nexport default BAIDU;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f deleted file mode 100644 index 0f73f7c..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f +++ /dev/null @@ -1 +0,0 @@ -{"code":"import BAIDU from '@m/baidu';\r\nvar PushBAIDU = (function () {\r\n function PushBAIDU(siteIdList, isDebug) {\r\n this.siteIdList = siteIdList;\r\n this.isDebug = isDebug;\r\n }\r\n PushBAIDU.prototype.init = function () {\r\n var _this = this;\r\n this.siteIdList.forEach(function (siteId) {\r\n var SITE = new BAIDU(siteId, _this.isDebug);\r\n SITE.init();\r\n });\r\n };\r\n PushBAIDU.prototype.pv = function (pageUrl) {\r\n var _this = this;\r\n this.siteIdList.forEach(function (siteId) {\r\n var SITE = new BAIDU(siteId, _this.isDebug);\r\n SITE.trackPageview(pageUrl);\r\n });\r\n };\r\n PushBAIDU.prototype.event = function (category, action, label, value) {\r\n var _this = this;\r\n this.siteIdList.forEach(function (siteId) {\r\n var SITE = new BAIDU(siteId, _this.isDebug);\r\n SITE.trackEvent(category, action, label, value);\r\n });\r\n };\r\n return PushBAIDU;\r\n}());\r\nexport default PushBAIDU;\r\n//# sourceMappingURL=pushBAIDU.js.map","references":["E:/Project/npm-project/vue-baidu-analytics/src/modules/baidu.ts"],"map":"{\"version\":3,\"file\":\"pushBAIDU.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../src/modules/pushBAIDU.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,KAAK,MAAM,UAAU,CAAA;AAK5B;IAIE,mBAAa,UAAoB,EAAE,OAAgB;QACjD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAKD,wBAAI,GAAJ;QAAA,iBAKC;QAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;YACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAKD,sBAAE,GAAF,UAAI,OAAe;QAAnB,iBAKC;QAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;YACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC;IAKD,yBAAK,GAAL,UAAO,QAAgB,EAAE,MAAc,EAAE,KAAa,EAAE,KAAa;QAArE,iBAKC;QAJC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,UAAC,MAAc;YACtC,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;IAEH,gBAAC;AAAD,CAAC,AAvCD,IAuCC;AAED,eAAe,SAAS,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/modules/pushBAIDU.d.ts","writeByteOrderMark":false,"text":"declare class PushBAIDU {\r\n siteIdList: string[];\r\n isDebug: boolean;\r\n constructor(siteIdList: string[], isDebug: boolean);\r\n init(): void;\r\n pv(pageUrl: string): void;\r\n event(category: string, action: string, label: string, value: number): void;\r\n}\r\nexport default PushBAIDU;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 deleted file mode 100644 index 33a88e8..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 +++ /dev/null @@ -1 +0,0 @@ -{"code":"var getVueVersion = function (Vue) {\r\n var version = 2;\r\n var VUE_VERSION = String(Vue.version);\r\n if (VUE_VERSION.slice(0, 2) === '2.') {\r\n version = 2;\r\n }\r\n if (VUE_VERSION.slice(0, 2) === '3.') {\r\n version = 3;\r\n }\r\n return version;\r\n};\r\nexport default getVueVersion;\r\n//# sourceMappingURL=getVueVersion.js.map","references":[],"map":"{\"version\":3,\"file\":\"getVueVersion.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../../src/modules/getVueVersion.ts\"],\"names\":[],\"mappings\":\"AAIA,IAAM,aAAa,GAAG,UAAC,GAAQ;IAC7B,IAAI,OAAO,GAAW,CAAC,CAAC;IAGxB,IAAM,WAAW,GAAW,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAGhD,IAAK,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAG;QACtC,OAAO,GAAG,CAAC,CAAC;KACb;IAGD,IAAK,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAG;QACtC,OAAO,GAAG,CAAC,CAAC;KACb;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAA;AAED,eAAe,aAAa,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/modules/getVueVersion.d.ts","writeByteOrderMark":false,"text":"declare const getVueVersion: (Vue: Vue) => number;\r\nexport default getVueVersion;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/b797606cd05a0fab2bbc583e3b5bb9070aef8875 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/b797606cd05a0fab2bbc583e3b5bb9070aef8875 deleted file mode 100644 index b66889e..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/code/cache/b797606cd05a0fab2bbc583e3b5bb9070aef8875 +++ /dev/null @@ -1 +0,0 @@ -{"code":"import PushBAIDU from '@m/pushBAIDU';\r\nimport getVueVersion from '@m/getVueVersion';\r\nexport var pushBAIDU = null;\r\nfunction install(Vue, _a) {\r\n var router = _a.router, siteIdList = _a.siteIdList, _b = _a.isDebug, isDebug = _b === void 0 ? false : _b;\r\n if (typeof document === 'undefined' || typeof window === 'undefined') {\r\n return false;\r\n }\r\n if (!router) {\r\n throw new Error('[vue-baidu-analytics] Must pass a Vue-Router instance to vue-baidu-analytics.');\r\n }\r\n if (!siteIdList) {\r\n throw new Error('[vue-baidu-analytics] Missing tracking domain ID, add at least one of baidu analytics.');\r\n }\r\n pushBAIDU = new PushBAIDU(siteIdList, isDebug);\r\n var VUE_VERSION = getVueVersion(Vue) || 0;\r\n if (VUE_VERSION === 2) {\r\n Vue.prototype.$pushBAIDU = pushBAIDU;\r\n }\r\n if (VUE_VERSION === 3) {\r\n Vue.config.globalProperties.$pushBAIDU = pushBAIDU;\r\n }\r\n if (siteIdList) {\r\n pushBAIDU.init();\r\n }\r\n router.afterEach(function (to) {\r\n var PAGE_PATH_DIR_COUNT = window.location.pathname.split('/').length;\r\n var PAGE_PATH = window.location.pathname.split('/').slice(0, PAGE_PATH_DIR_COUNT - 1).join('/');\r\n var PAGE_URL = router.mode === 'hash' ? PAGE_PATH + \"/#\" + to.fullPath : \"\" + PAGE_PATH + to.fullPath;\r\n pushBAIDU.pv(PAGE_URL);\r\n });\r\n}\r\nexport default install;\r\n//# sourceMappingURL=main.js.map","references":["E:/Project/npm-project/vue-baidu-analytics/src/modules/pushBAIDU.ts","E:/Project/npm-project/vue-baidu-analytics/src/modules/getVueVersion.ts"],"map":"{\"version\":3,\"file\":\"main.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../../src/main.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,SAAS,MAAM,cAAc,CAAA;AACpC,OAAO,aAAa,MAAM,kBAAkB,CAAA;AAK5C,MAAM,CAAC,IAAI,SAAS,GAAQ,IAAI,CAAC;AAKjC,SAAS,OAAO,CAAE,GAAQ,EAAE,EAAyD;QAAvD,MAAM,YAAA,EAAE,UAAU,gBAAA,EAAE,eAAe,EAAf,OAAO,mBAAG,KAAK,KAAA;IAK/D,IAAK,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,MAAM,KAAK,WAAW,EAAG;QACtE,OAAO,KAAK,CAAC;KACd;IAED,IAAK,CAAC,MAAM,EAAG;QACb,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;KAClG;IAED,IAAK,CAAC,UAAU,EAAG;QACjB,MAAM,IAAI,KAAK,CAAC,wFAAwF,CAAC,CAAC;KAC3G;IAKD,SAAS,GAAG,IAAI,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAG/C,IAAM,WAAW,GAAW,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAGpD,IAAK,WAAW,KAAK,CAAC,EAAG;QACvB,GAAG,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,CAAC;KACtC;IAGD,IAAK,WAAW,KAAK,CAAC,EAAG;QACvB,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,GAAG,SAAS,CAAC;KACpD;IAKD,IAAK,UAAU,EAAG;QAChB,SAAS,CAAC,IAAI,EAAE,CAAC;KAClB;IAKD,MAAM,CAAC,SAAS,CAAE,UAAC,EAAM;QACvB,IAAM,mBAAmB,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;QACvE,IAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClG,IAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAI,SAAS,UAAK,EAAE,CAAC,QAAU,CAAC,CAAC,CAAC,KAAG,SAAS,GAAG,EAAE,CAAC,QAAU,CAAC;QAExG,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,eAAe,OAAO,CAAC\"}","dts":{"name":"E:/Project/npm-project/vue-baidu-analytics/main.d.ts","writeByteOrderMark":false,"text":"export declare let pushBAIDU: any;\r\ndeclare function install(Vue: Vue, { router, siteIdList, isDebug }: Partial): boolean;\r\nexport default install;\r\n"}} diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/b797606cd05a0fab2bbc583e3b5bb9070aef8875 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/b797606cd05a0fab2bbc583e3b5bb9070aef8875 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/semanticDiagnostics/cache/b797606cd05a0fab2bbc583e3b5bb9070aef8875 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/71d0728306715942daacf4676366fd6a07b6b666 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/79a0ca098b9c0da0b5b8984bc656183b2a60db5f +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/a4bf385668c5452744f05d7af0ec88c79f8b6e31 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/b797606cd05a0fab2bbc583e3b5bb9070aef8875 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/b797606cd05a0fab2bbc583e3b5bb9070aef8875 deleted file mode 100644 index fe51488..0000000 --- a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/syntacticDiagnostics/cache/b797606cd05a0fab2bbc583e3b5bb9070aef8875 +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/1c71620f0f64c282751681bcbbf1857fa7b7b906 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/1c71620f0f64c282751681bcbbf1857fa7b7b906 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/22c7731e225cfb17a9b74dedae0216837a12d163 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/22c7731e225cfb17a9b74dedae0216837a12d163 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/41c393035312d6bc3286d4224ecba574f0de1915 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/41c393035312d6bc3286d4224ecba574f0de1915 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/8507ed218024f52c1ee576a6f7f04b4740e12996 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/8507ed218024f52c1ee576a6f7f04b4740e12996 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/a9368f7e7383c0e591fb7e73549570e38aade49f b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/a9368f7e7383c0e591fb7e73549570e38aade49f deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/af7c746871ddaade47bc7ee702b80e980877bc94 b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/af7c746871ddaade47bc7ee702b80e980877bc94 deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/e79b9f180b673e0eb891e4974b2b9006e56cf60b b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/e79b9f180b673e0eb891e4974b2b9006e56cf60b deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df b/node_modules/.cache/rollup-plugin-typescript2/rpt2_fa59d9cc6cb5c40731d3288ea9ceac665f8a08eb/types/cache/ef6a5a2b220f47b1d5e81e5ada8faadbd8c596df deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/@babel/code-frame/README.md b/node_modules/@babel/code-frame/README.md index 08cacb0..185f93d 100644 --- a/node_modules/@babel/code-frame/README.md +++ b/node_modules/@babel/code-frame/README.md @@ -2,7 +2,7 @@ > Generate errors that contain a code frame that point to source locations. -See our website [@babel/code-frame](https://babeljs.io/docs/en/babel-code-frame) for more information. +See our website [@babel/code-frame](https://babeljs.io/docs/en/next/babel-code-frame.html) for more information. ## Install diff --git a/node_modules/@babel/code-frame/package.json b/node_modules/@babel/code-frame/package.json index a13d746..698c751 100644 --- a/node_modules/@babel/code-frame/package.json +++ b/node_modules/@babel/code-frame/package.json @@ -1,64 +1,28 @@ { - "_args": [ - [ - "@babel/code-frame@7.12.11", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/code-frame@7.12.11", - "_id": "@babel/code-frame@7.12.11", - "_inBundle": false, - "_integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "_location": "/@babel/code-frame", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/code-frame@7.12.11", - "name": "@babel/code-frame", - "escapedName": "@babel%2fcode-frame", - "scope": "@babel", - "rawSpec": "7.12.11", - "saveSpec": null, - "fetchSpec": "7.12.11" - }, - "_requiredBy": [ - "/@babel/core", - "/@babel/template", - "/@babel/traverse", - "/rollup-plugin-terser" - ], - "_resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "_spec": "7.12.11", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Sebastian McKenzie", - "email": "sebmck@gmail.com" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/highlight": "^7.10.4" - }, + "name": "@babel/code-frame", + "version": "7.10.4", "description": "Generate errors that contain a code frame that point to source locations.", - "devDependencies": { - "@types/chalk": "^2.0.0", - "chalk": "^2.0.0", - "strip-ansi": "^4.0.0" - }, + "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", - "main": "lib/index.js", - "name": "@babel/code-frame", "publishConfig": { "access": "public" }, "repository": { "type": "git", - "url": "git+https://github.com/babel/babel.git", + "url": "https://github.com/babel/babel.git", "directory": "packages/babel-code-frame" }, - "version": "7.12.11" -} + "main": "lib/index.js", + "dependencies": { + "@babel/highlight": "^7.10.4" + }, + "devDependencies": { + "chalk": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:13 GMT+0800 (中国标准时间)", + "_from": "@babel/code-frame@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/compat-data/data/corejs2-built-ins.json b/node_modules/@babel/compat-data/data/corejs2-built-ins.json index 430cdbf..7efce26 100644 --- a/node_modules/@babel/compat-data/data/corejs2-built-ins.json +++ b/node_modules/@babel/compat-data/data/corejs2-built-ins.json @@ -80,7 +80,7 @@ "node": "11", "ios": "12", "samsung": "10", - "electron": "4.0" + "electron": "4" }, "es6.array.for-each": { "chrome": "5", @@ -147,15 +147,15 @@ "electron": "0.20" }, "es6.array.iterator": { - "chrome": "66", - "opera": "53", + "chrome": "38", + "opera": "25", "edge": "12", - "firefox": "60", - "safari": "9", - "node": "10", - "ios": "9", - "samsung": "9", - "electron": "3.0" + "firefox": "28", + "safari": "7.1", + "node": "0.12", + "ios": "8", + "samsung": "3", + "electron": "0.20" }, "es6.array.last-index-of": { "chrome": "5", @@ -248,7 +248,7 @@ "ie": "9", "ios": "12", "samsung": "8", - "electron": "3.0" + "electron": "3" }, "es6.array.species": { "chrome": "51", @@ -710,7 +710,7 @@ "node": "8.10", "ios": "9", "samsung": "8", - "electron": "3.0" + "electron": "3" }, "es7.object.define-setter": { "chrome": "62", @@ -721,7 +721,7 @@ "node": "8.10", "ios": "9", "samsung": "8", - "electron": "3.0" + "electron": "3" }, "es6.object.define-property": { "chrome": "5", @@ -760,7 +760,7 @@ "node": "7", "ios": "10.3", "samsung": "6", - "electron": "1.4" + "electron": "1.5" }, "es6.object.freeze": { "chrome": "44", @@ -793,7 +793,7 @@ "node": "7", "ios": "10.3", "samsung": "6", - "electron": "1.4" + "electron": "1.5" }, "es6.object.get-own-property-names": { "chrome": "40", @@ -826,7 +826,7 @@ "node": "8.10", "ios": "9", "samsung": "8", - "electron": "3.0" + "electron": "3" }, "es7.object.lookup-setter": { "chrome": "62", @@ -837,7 +837,7 @@ "node": "8.10", "ios": "9", "samsung": "8", - "electron": "3.0" + "electron": "3" }, "es6.object.prevent-extensions": { "chrome": "44", @@ -949,7 +949,7 @@ "node": "7", "ios": "10.3", "samsung": "6", - "electron": "1.4" + "electron": "1.5" }, "es6.promise": { "chrome": "51", @@ -971,7 +971,7 @@ "node": "10", "ios": "11.3", "samsung": "8", - "electron": "3.0" + "electron": "3" }, "es6.reflect.apply": { "chrome": "49", @@ -1224,7 +1224,7 @@ "node": "10", "ios": "12", "samsung": "8", - "electron": "3.0" + "electron": "3" }, "es6.string.anchor": { "chrome": "5", @@ -1528,7 +1528,7 @@ "node": "10", "ios": "12", "samsung": "9", - "electron": "3.0" + "electron": "3" }, "es7.string.trim-right": { "chrome": "66", @@ -1539,7 +1539,7 @@ "node": "10", "ios": "12", "samsung": "9", - "electron": "3.0" + "electron": "3" }, "es6.typed.array-buffer": { "chrome": "51", diff --git a/node_modules/@babel/compat-data/data/native-modules.json b/node_modules/@babel/compat-data/data/native-modules.json index 9923db2..4ede11b 100644 --- a/node_modules/@babel/compat-data/data/native-modules.json +++ b/node_modules/@babel/compat-data/data/native-modules.json @@ -11,7 +11,6 @@ "safari": "10.1", "ios_saf": "10.3", "samsung": "8.2", - "android": "61", - "electron": "2.0" + "android": "61" } } diff --git a/node_modules/@babel/compat-data/data/plugins.json b/node_modules/@babel/compat-data/data/plugins.json index 2512538..5664681 100644 --- a/node_modules/@babel/compat-data/data/plugins.json +++ b/node_modules/@babel/compat-data/data/plugins.json @@ -1,18 +1,16 @@ { "proposal-class-properties": { "chrome": "74", - "opera": "62", + "opera": "61", "edge": "79", "node": "12", "samsung": "11", - "electron": "6.0" + "electron": "6" }, "proposal-private-methods": { "chrome": "84", - "opera": "70", "edge": "84", - "node": "14.6", - "electron": "10.0" + "electron": "10" }, "proposal-numeric-separator": { "chrome": "75", @@ -23,14 +21,13 @@ "node": "12.5", "ios": "13", "samsung": "11", - "electron": "6.0" + "electron": "6" }, "proposal-logical-assignment-operators": { "chrome": "85", "firefox": "79", "safari": "14", - "node": "15", - "electron": "10.0" + "electron": "10" }, "proposal-nullish-coalescing-operator": { "chrome": "80", @@ -40,8 +37,7 @@ "safari": "13.1", "node": "14", "ios": "13.4", - "samsung": "13", - "electron": "8.0" + "electron": "8" }, "proposal-optional-chaining": { "chrome": "80", @@ -51,8 +47,7 @@ "safari": "13.1", "node": "14", "ios": "13.4", - "samsung": "13", - "electron": "8.0" + "electron": "8" }, "proposal-json-strings": { "chrome": "66", @@ -63,7 +58,7 @@ "node": "10", "ios": "12", "samsung": "9", - "electron": "3.0" + "electron": "3" }, "proposal-optional-catch-binding": { "chrome": "66", @@ -74,7 +69,7 @@ "node": "10", "ios": "11.3", "samsung": "9", - "electron": "3.0" + "electron": "3" }, "transform-parameters": { "chrome": "49", @@ -96,7 +91,7 @@ "node": "10", "ios": "12", "samsung": "8", - "electron": "3.0" + "electron": "3" }, "proposal-object-rest-spread": { "chrome": "60", @@ -107,7 +102,7 @@ "node": "8.3", "ios": "11.3", "samsung": "8", - "electron": "2.0" + "electron": "2" }, "transform-dotall-regex": { "chrome": "62", @@ -118,7 +113,7 @@ "node": "8.10", "ios": "11.3", "samsung": "8", - "electron": "3.0" + "electron": "3" }, "proposal-unicode-property-regex": { "chrome": "64", @@ -129,7 +124,7 @@ "node": "10", "ios": "11.3", "samsung": "9", - "electron": "3.0" + "electron": "3" }, "transform-named-capturing-groups-regex": { "chrome": "64", @@ -140,7 +135,7 @@ "node": "10", "ios": "11.3", "samsung": "9", - "electron": "3.0" + "electron": "3" }, "transform-async-to-generator": { "chrome": "55", @@ -429,14 +424,10 @@ }, "proposal-export-namespace-from": { "chrome": "72", - "and_chr": "72", "edge": "79", + "opera": "60", "firefox": "80", "node": "13.2", - "opera": "60", - "op_mob": "51", - "samsung": "11.0", - "android": "72", - "electron": "5.0" + "samsung": "11.0" } } diff --git a/node_modules/@babel/compat-data/package.json b/node_modules/@babel/compat-data/package.json index 7547397..a9f1d07 100644 --- a/node_modules/@babel/compat-data/package.json +++ b/node_modules/@babel/compat-data/package.json @@ -1,47 +1,16 @@ { - "_args": [ - [ - "@babel/compat-data@7.12.7", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/compat-data@7.12.7", - "_id": "@babel/compat-data@7.12.7", - "_inBundle": false, - "_integrity": "sha512-YaxPMGs/XIWtYqrdEOZOCPsVWfEoriXopnsz3/i7apYPXQ3698UFhS6dVT1KN5qOsWmVgw/FOrmQgpRaZayGsw==", - "_location": "/@babel/compat-data", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/compat-data@7.12.7", - "name": "@babel/compat-data", - "escapedName": "@babel%2fcompat-data", - "scope": "@babel", - "rawSpec": "7.12.7", - "saveSpec": null, - "fetchSpec": "7.12.7" - }, - "_requiredBy": [ - "/@babel/helper-compilation-targets", - "/@babel/preset-env" - ], - "_resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.7.tgz", - "_spec": "7.12.7", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "The Babel Team", - "url": "https://babeljs.io/team" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, + "name": "@babel/compat-data", + "version": "7.11.0", + "author": "The Babel Team (https://babeljs.io/team)", + "license": "MIT", "description": "", - "devDependencies": { - "electron-to-chromium": "1.3.583", - "lodash": "^4.17.19", - "mdn-browser-compat-data": "1.0.38" + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-compat-data" + }, + "publishConfig": { + "access": "public" }, "exports": { "./plugins": "./data/plugins.json", @@ -51,24 +20,27 @@ "./overlapping-plugins": "./data/overlapping-plugins.json", "./plugin-bugfixes": "./data/plugin-bugfixes.json" }, - "homepage": "https://github.com/babel/babel#readme", + "scripts": { + "build-data": "./scripts/download-compat-table.sh && node ./scripts/build-data.js && node ./scripts/build-modules-support.js && node ./scripts/build-bugfixes-targets.js" + }, "keywords": [ "babel", "compat-table", "compat-data" ], - "license": "MIT", - "name": "@babel/compat-data", - "publishConfig": { - "access": "public" + "dependencies": { + "browserslist": "^4.12.0", + "invariant": "^2.2.4", + "semver": "^5.5.0" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-compat-data" + "devDependencies": { + "@babel/helper-compilation-targets": "^7.10.4", + "electron-to-chromium": "1.3.513", + "lodash": "^4.17.19", + "mdn-browser-compat-data": "1.0.31" }, - "scripts": { - "build-data": "./scripts/download-compat-table.sh && node ./scripts/build-data.js && node ./scripts/build-modules-support.js && node ./scripts/build-bugfixes-targets.js" - }, - "version": "7.12.7" -} + "gitHead": "38dda069eeac2e31bce3f56290998d30bee1ed6b", + "__npminstall_done": "Sun Sep 06 2020 16:10:16 GMT+0800 (中国标准时间)", + "_from": "@babel/compat-data@7.11.0", + "_resolved": "https://registry.npm.taobao.org/@babel/compat-data/download/@babel/compat-data-7.11.0.tgz?cache=0&sync_timestamp=1596141260090&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcompat-data%2Fdownload%2F%40babel%2Fcompat-data-7.11.0.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/core/README.md b/node_modules/@babel/core/README.md index 9b3a950..9b4b63d 100644 --- a/node_modules/@babel/core/README.md +++ b/node_modules/@babel/core/README.md @@ -2,7 +2,7 @@ > Babel compiler core. -See our website [@babel/core](https://babeljs.io/docs/en/babel-core) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen) associated with this package. +See our website [@babel/core](https://babeljs.io/docs/en/next/babel-core.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen) associated with this package. ## Install diff --git a/node_modules/@babel/core/lib/config/caching.js b/node_modules/@babel/core/lib/config/caching.js index acd576b..454c57b 100644 --- a/node_modules/@babel/core/lib/config/caching.js +++ b/node_modules/@babel/core/lib/config/caching.js @@ -182,7 +182,6 @@ class CacheConfigurator { this._invalidate = false; this._configured = false; this._pairs = []; - this._data = void 0; this._data = data; } @@ -311,8 +310,6 @@ function assertSimpleType(value) { class Lock { constructor() { this.released = false; - this.promise = void 0; - this._resolve = void 0; this.promise = new Promise(resolve => { this._resolve = resolve; }); diff --git a/node_modules/@babel/core/lib/config/config-chain.js b/node_modules/@babel/core/lib/config/config-chain.js index 60116cb..ef5bd61 100644 --- a/node_modules/@babel/core/lib/config/config-chain.js +++ b/node_modules/@babel/core/lib/config/config-chain.js @@ -49,8 +49,7 @@ function* buildPresetChain(arg, context) { return { plugins: dedupDescriptors(chain.plugins), presets: dedupDescriptors(chain.presets), - options: chain.options.map(o => normalizeOptions(o)), - files: new Set() + options: chain.options.map(o => normalizeOptions(o)) }; } @@ -112,7 +111,6 @@ function* buildRootChain(opts, context) { const pkgData = typeof context.filename === "string" ? yield* (0, _files.findPackageData)(context.filename) : null; let ignoreFile, babelrcFile; - let isIgnored = false; const fileChain = emptyChain(); if ((babelrc === true || babelrc === undefined) && pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)) { @@ -121,29 +119,17 @@ function* buildRootChain(opts, context) { config: babelrcFile } = yield* (0, _files.findRelativeConfig)(pkgData, context.envName, context.caller)); - if (ignoreFile) { - fileChain.files.add(ignoreFile.filepath); - } - if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) { - isIgnored = true; + return null; } - if (babelrcFile && !isIgnored) { + if (babelrcFile) { const validatedFile = validateBabelrcFile(babelrcFile); const babelrcLogger = new _printer.ConfigPrinter(); const result = yield* loadFileChain(validatedFile, context, undefined, babelrcLogger); - - if (!result) { - isIgnored = true; - } else { - babelRcReport = babelrcLogger.output(); - mergeChain(fileChain, result); - } - } - - if (babelrcFile && isIgnored) { - fileChain.files.add(babelrcFile.filepath); + if (!result) return null; + babelRcReport = babelrcLogger.output(); + mergeChain(fileChain, result); } } @@ -154,14 +140,12 @@ function* buildRootChain(opts, context) { const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain); return { - plugins: isIgnored ? [] : dedupDescriptors(chain.plugins), - presets: isIgnored ? [] : dedupDescriptors(chain.presets), - options: isIgnored ? [] : chain.options.map(o => normalizeOptions(o)), - fileHandling: isIgnored ? "ignored" : "transpile", + plugins: dedupDescriptors(chain.plugins), + presets: dedupDescriptors(chain.presets), + options: chain.options.map(o => normalizeOptions(o)), ignore: ignoreFile || undefined, babelrc: babelrcFile || undefined, - config: configFile || undefined, - files: chain.files + config: configFile || undefined }; } @@ -216,24 +200,13 @@ const loadProgrammaticChain = makeChainWalker({ overridesEnv: (input, index, envName) => buildOverrideEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index, envName), createLogger: (input, context, baseLogger) => buildProgrammaticLogger(input, context, baseLogger) }); -const loadFileChainWalker = makeChainWalker({ +const loadFileChain = makeChainWalker({ root: file => loadFileDescriptors(file), env: (file, envName) => loadFileEnvDescriptors(file)(envName), overrides: (file, index) => loadFileOverridesDescriptors(file)(index), overridesEnv: (file, index, envName) => loadFileOverridesEnvDescriptors(file)(index)(envName), createLogger: (file, context, baseLogger) => buildFileLogger(file.filepath, context, baseLogger) }); - -function* loadFileChain(input, context, files, baseLogger) { - const chain = yield* loadFileChainWalker(input, context, files, baseLogger); - - if (chain) { - chain.files.add(input.filepath); - } - - return chain; -} - const loadFileDescriptors = (0, _caching.makeWeakCacheSync)(file => buildRootDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors)); const loadFileEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, envName))); const loadFileOverridesDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index))); @@ -398,11 +371,6 @@ function mergeChain(target, source) { target.options.push(...source.options); target.plugins.push(...source.plugins); target.presets.push(...source.presets); - - for (const file of source.files) { - target.files.add(file); - } - return target; } @@ -421,8 +389,7 @@ function emptyChain() { return { options: [], presets: [], - plugins: [], - files: new Set() + plugins: [] }; } diff --git a/node_modules/@babel/core/lib/config/files/configuration.js b/node_modules/@babel/core/lib/config/files/configuration.js index 4835fb3..999c326 100644 --- a/node_modules/@babel/core/lib/config/files/configuration.js +++ b/node_modules/@babel/core/lib/config/files/configuration.js @@ -62,6 +62,8 @@ var _patternToRegex = _interopRequireDefault(require("../pattern-to-regex")); var fs = _interopRequireWildcard(require("../../gensync-utils/fs")); +var _resolve = _interopRequireDefault(require("../../gensync-utils/resolve")); + function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } @@ -145,17 +147,8 @@ function* loadOneConfig(names, dirname, envName, caller, previousConfig = null) } function* loadConfig(name, dirname, envName, caller) { - const filepath = (parseFloat(process.versions.node) >= 8.9 ? require.resolve : (r, { - paths: [b] - }, M = require("module")) => { - let f = M._findPath(r, M._nodeModulePaths(b).concat(b)); - - if (f) return f; - f = new Error(`Cannot resolve module '${r}'`); - f.code = "MODULE_NOT_FOUND"; - throw f; - })(name, { - paths: [dirname] + const filepath = yield* (0, _resolve.default)(name, { + basedir: dirname }); const conf = yield* readConfig(filepath, envName, caller); diff --git a/node_modules/@babel/core/lib/config/files/plugins.js b/node_modules/@babel/core/lib/config/files/plugins.js index eddce5f..6b9cb71 100644 --- a/node_modules/@babel/core/lib/config/files/plugins.js +++ b/node_modules/@babel/core/lib/config/files/plugins.js @@ -18,6 +18,16 @@ function _debug() { return data; } +function _resolve() { + const data = _interopRequireDefault(require("resolve")); + + _resolve = function () { + return data; + }; + + return data; +} + function _path() { const data = _interopRequireDefault(require("path")); @@ -88,17 +98,8 @@ function resolveStandardizedName(type, name, dirname = process.cwd()) { const standardizedName = standardizeName(type, name); try { - return (parseFloat(process.versions.node) >= 8.9 ? require.resolve : (r, { - paths: [b] - }, M = require("module")) => { - let f = M._findPath(r, M._nodeModulePaths(b).concat(b)); - - if (f) return f; - f = new Error(`Cannot resolve module '${r}'`); - f.code = "MODULE_NOT_FOUND"; - throw f; - })(standardizedName, { - paths: [dirname] + return _resolve().default.sync(standardizedName, { + basedir: dirname }); } catch (e) { if (e.code !== "MODULE_NOT_FOUND") throw e; @@ -107,18 +108,10 @@ function resolveStandardizedName(type, name, dirname = process.cwd()) { let resolvedOriginal = false; try { - (parseFloat(process.versions.node) >= 8.9 ? require.resolve : (r, { - paths: [b] - }, M = require("module")) => { - let f = M._findPath(r, M._nodeModulePaths(b).concat(b)); - - if (f) return f; - f = new Error(`Cannot resolve module '${r}'`); - f.code = "MODULE_NOT_FOUND"; - throw f; - })(name, { - paths: [dirname] + _resolve().default.sync(name, { + basedir: dirname }); + resolvedOriginal = true; } catch (_unused) {} @@ -130,18 +123,10 @@ function resolveStandardizedName(type, name, dirname = process.cwd()) { let resolvedBabel = false; try { - (parseFloat(process.versions.node) >= 8.9 ? require.resolve : (r, { - paths: [b] - }, M = require("module")) => { - let f = M._findPath(r, M._nodeModulePaths(b).concat(b)); - - if (f) return f; - f = new Error(`Cannot resolve module '${r}'`); - f.code = "MODULE_NOT_FOUND"; - throw f; - })(standardizeName(type, "@babel/" + name), { - paths: [dirname] + _resolve().default.sync(standardizeName(type, "@babel/" + name), { + basedir: dirname }); + resolvedBabel = true; } catch (_unused2) {} @@ -153,18 +138,10 @@ function resolveStandardizedName(type, name, dirname = process.cwd()) { const oppositeType = type === "preset" ? "plugin" : "preset"; try { - (parseFloat(process.versions.node) >= 8.9 ? require.resolve : (r, { - paths: [b] - }, M = require("module")) => { - let f = M._findPath(r, M._nodeModulePaths(b).concat(b)); - - if (f) return f; - f = new Error(`Cannot resolve module '${r}'`); - f.code = "MODULE_NOT_FOUND"; - throw f; - })(standardizeName(oppositeType, name), { - paths: [dirname] + _resolve().default.sync(standardizeName(oppositeType, name), { + basedir: dirname }); + resolvedOppositeType = true; } catch (_unused3) {} diff --git a/node_modules/@babel/core/lib/config/full.js b/node_modules/@babel/core/lib/config/full.js index d817a15..7946d99 100644 --- a/node_modules/@babel/core/lib/config/full.js +++ b/node_modules/@babel/core/lib/config/full.js @@ -62,111 +62,114 @@ var _default = (0, _gensync().default)(function* loadFullConfig(inputOpts) { const { options, - context, - fileHandling + context } = result; - - if (fileHandling === "ignored") { - return null; - } - const optionDefaults = {}; - const { - plugins, - presets - } = options; + const passes = [[]]; - if (!plugins || !presets) { - throw new Error("Assertion failure - plugins and presets exist"); - } + try { + const { + plugins, + presets + } = options; - const toDescriptor = item => { - const desc = (0, _item.getItemDescriptor)(item); - - if (!desc) { - throw new Error("Assertion failure - must be config item"); + if (!plugins || !presets) { + throw new Error("Assertion failure - plugins and presets exist"); } - return desc; - }; + const ignored = yield* function* recurseDescriptors(config, pass) { + const plugins = []; - const presetsDescriptors = presets.map(toDescriptor); - const initialPluginsDescriptors = plugins.map(toDescriptor); - const pluginDescriptorsByPass = [[]]; - const passes = []; - const ignored = yield* enhanceError(context, function* recursePresetDescriptors(rawPresets, pluginDescriptorsPass) { - const presets = []; - - for (let i = 0; i < rawPresets.length; i++) { - const descriptor = rawPresets[i]; - - if (descriptor.options !== false) { - try { - if (descriptor.ownPass) { - presets.push({ - preset: yield* loadPresetDescriptor(descriptor, context), - pass: [] - }); - } else { - presets.unshift({ - preset: yield* loadPresetDescriptor(descriptor, context), - pass: pluginDescriptorsPass - }); - } - } catch (e) { - if (e.code === "BABEL_UNKNOWN_OPTION") { - (0, _options.checkNoUnwrappedItemOptionPairs)(rawPresets, i, "preset", e); - } - - throw e; - } - } - } - - if (presets.length > 0) { - pluginDescriptorsByPass.splice(1, 0, ...presets.map(o => o.pass).filter(p => p !== pluginDescriptorsPass)); - - for (const { - preset, - pass - } of presets) { - if (!preset) return true; - pass.push(...preset.plugins); - const ignored = yield* recursePresetDescriptors(preset.presets, pass); - if (ignored) return true; - preset.options.forEach(opts => { - (0, _util.mergeOptions)(optionDefaults, opts); - }); - } - } - })(presetsDescriptors, pluginDescriptorsByPass[0]); - if (ignored) return null; - const opts = optionDefaults; - (0, _util.mergeOptions)(opts, options); - yield* enhanceError(context, function* loadPluginDescriptors() { - pluginDescriptorsByPass[0].unshift(...initialPluginsDescriptors); - - for (const descs of pluginDescriptorsByPass) { - const pass = []; - passes.push(pass); - - for (let i = 0; i < descs.length; i++) { - const descriptor = descs[i]; + for (let i = 0; i < config.plugins.length; i++) { + const descriptor = config.plugins[i]; if (descriptor.options !== false) { try { - pass.push(yield* loadPluginDescriptor(descriptor, context)); + plugins.push(yield* loadPluginDescriptor(descriptor, context)); } catch (e) { - if (e.code === "BABEL_UNKNOWN_PLUGIN_PROPERTY") { - (0, _options.checkNoUnwrappedItemOptionPairs)(descs, i, "plugin", e); + if (i > 0 && e.code === "BABEL_UNKNOWN_PLUGIN_PROPERTY") { + (0, _options.checkNoUnwrappedItemOptionPairs)(config.plugins[i - 1], descriptor, "plugin", i, e); } throw e; } } } + + const presets = []; + + for (let i = 0; i < config.presets.length; i++) { + const descriptor = config.presets[i]; + + if (descriptor.options !== false) { + try { + presets.push({ + preset: yield* loadPresetDescriptor(descriptor, context), + pass: descriptor.ownPass ? [] : pass + }); + } catch (e) { + if (i > 0 && e.code === "BABEL_UNKNOWN_OPTION") { + (0, _options.checkNoUnwrappedItemOptionPairs)(config.presets[i - 1], descriptor, "preset", i, e); + } + + throw e; + } + } + } + + if (presets.length > 0) { + passes.splice(1, 0, ...presets.map(o => o.pass).filter(p => p !== pass)); + + for (const { + preset, + pass + } of presets) { + if (!preset) return true; + const ignored = yield* recurseDescriptors({ + plugins: preset.plugins, + presets: preset.presets + }, pass); + if (ignored) return true; + preset.options.forEach(opts => { + (0, _util.mergeOptions)(optionDefaults, opts); + }); + } + } + + if (plugins.length > 0) { + pass.unshift(...plugins); + } + }({ + plugins: plugins.map(item => { + const desc = (0, _item.getItemDescriptor)(item); + + if (!desc) { + throw new Error("Assertion failure - must be config item"); + } + + return desc; + }), + presets: presets.map(item => { + const desc = (0, _item.getItemDescriptor)(item); + + if (!desc) { + throw new Error("Assertion failure - must be config item"); + } + + return desc; + }) + }, passes[0]); + if (ignored) return null; + } catch (e) { + if (!/^\[BABEL\]/.test(e.message)) { + e.message = `[BABEL] ${context.filename || "unknown"}: ${e.message}`; } - })(); + + throw e; + } + + const opts = optionDefaults; + (0, _util.mergeOptions)(opts, options); opts.plugins = passes[0]; opts.presets = passes.slice(1).filter(plugins => plugins.length > 0).map(plugins => ({ plugins @@ -179,21 +182,6 @@ var _default = (0, _gensync().default)(function* loadFullConfig(inputOpts) { }); exports.default = _default; - -function enhanceError(context, fn) { - return function* (arg1, arg2) { - try { - return yield* fn(arg1, arg2); - } catch (e) { - if (!/^\[BABEL\]/.test(e.message)) { - e.message = `[BABEL] ${context.filename || "unknown"}: ${e.message}`; - } - - throw e; - } - }; -} - const loadDescriptor = (0, _caching.makeWeakCache)(function* ({ value, options, diff --git a/node_modules/@babel/core/lib/config/item.js b/node_modules/@babel/core/lib/config/item.js index b4962a0..11f25ac 100644 --- a/node_modules/@babel/core/lib/config/item.js +++ b/node_modules/@babel/core/lib/config/item.js @@ -37,31 +37,19 @@ function createConfigItem(value, { } function getItemDescriptor(item) { - if (item == null ? void 0 : item[CONFIG_ITEM_BRAND]) { + if (item instanceof ConfigItem) { return item._descriptor; } return undefined; } -const CONFIG_ITEM_BRAND = Symbol.for("@babel/core@7 - ConfigItem"); - class ConfigItem { constructor(descriptor) { - this._descriptor = void 0; - this[CONFIG_ITEM_BRAND] = true; - this.value = void 0; - this.options = void 0; - this.dirname = void 0; - this.name = void 0; - this.file = void 0; this._descriptor = descriptor; Object.defineProperty(this, "_descriptor", { enumerable: false }); - Object.defineProperty(this, CONFIG_ITEM_BRAND, { - enumerable: false - }); this.value = this._descriptor.value; this.options = this._descriptor.options; this.dirname = this._descriptor.dirname; diff --git a/node_modules/@babel/core/lib/config/partial.js b/node_modules/@babel/core/lib/config/partial.js index 229e064..3f9f780 100644 --- a/node_modules/@babel/core/lib/config/partial.js +++ b/node_modules/@babel/core/lib/config/partial.js @@ -42,8 +42,6 @@ var _files = require("./files"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } - function* resolveRootMode(rootDir, rootMode) { switch (rootMode) { case "root": @@ -117,64 +115,36 @@ function* loadPrivatePartialConfig(inputOpts) { return { options, context, - fileHandling: configChain.fileHandling, ignore: configChain.ignore, babelrc: configChain.babelrc, - config: configChain.config, - files: configChain.files + config: configChain.config }; } -const loadPartialConfig = (0, _gensync().default)(function* (opts) { - let showIgnoredFiles = false; - - if (typeof opts === "object" && opts !== null && !Array.isArray(opts)) { - var _opts = opts; - ({ - showIgnoredFiles - } = _opts); - opts = _objectWithoutPropertiesLoose(_opts, ["showIgnoredFiles"]); - _opts; - } - - const result = yield* loadPrivatePartialConfig(opts); +const loadPartialConfig = (0, _gensync().default)(function* (inputOpts) { + const result = yield* loadPrivatePartialConfig(inputOpts); if (!result) return null; const { options, babelrc, ignore, - config, - fileHandling, - files + config } = result; - - if (fileHandling === "ignored" && !showIgnoredFiles) { - return null; - } - (options.plugins || []).forEach(item => { if (item.value instanceof _plugin.default) { throw new Error("Passing cached plugin instances is not supported in " + "babel.loadPartialConfig()"); } }); - return new PartialConfig(options, babelrc ? babelrc.filepath : undefined, ignore ? ignore.filepath : undefined, config ? config.filepath : undefined, fileHandling, files); + return new PartialConfig(options, babelrc ? babelrc.filepath : undefined, ignore ? ignore.filepath : undefined, config ? config.filepath : undefined); }); exports.loadPartialConfig = loadPartialConfig; class PartialConfig { - constructor(options, babelrc, ignore, config, fileHandling, files) { - this.options = void 0; - this.babelrc = void 0; - this.babelignore = void 0; - this.config = void 0; - this.fileHandling = void 0; - this.files = void 0; + constructor(options, babelrc, ignore, config) { this.options = options; this.babelignore = ignore; this.babelrc = babelrc; this.config = config; - this.fileHandling = fileHandling; - this.files = files; Object.freeze(this); } diff --git a/node_modules/@babel/core/lib/config/plugin.js b/node_modules/@babel/core/lib/config/plugin.js index 9cb1656..3c78070 100644 --- a/node_modules/@babel/core/lib/config/plugin.js +++ b/node_modules/@babel/core/lib/config/plugin.js @@ -7,14 +7,6 @@ exports.default = void 0; class Plugin { constructor(plugin, options, key) { - this.key = void 0; - this.manipulateOptions = void 0; - this.post = void 0; - this.pre = void 0; - this.visitor = void 0; - this.parserOverride = void 0; - this.generatorOverride = void 0; - this.options = void 0; this.key = plugin.name || key; this.manipulateOptions = plugin.manipulateOptions; this.post = plugin.post; diff --git a/node_modules/@babel/core/lib/config/validation/options.js b/node_modules/@babel/core/lib/config/validation/options.js index 04fb8bf..927cda7 100644 --- a/node_modules/@babel/core/lib/config/validation/options.js +++ b/node_modules/@babel/core/lib/config/validation/options.js @@ -190,11 +190,7 @@ function assertOverridesList(loc, value) { return arr; } -function checkNoUnwrappedItemOptionPairs(items, index, type, e) { - if (index === 0) return; - const lastItem = items[index - 1]; - const thisItem = items[index]; - +function checkNoUnwrappedItemOptionPairs(lastItem, thisItem, type, index, e) { if (lastItem.file && lastItem.options === undefined && typeof thisItem.value === "object") { e.message += `\n- Maybe you meant to use\n` + `"${type}": [\n ["${lastItem.file.request}", ${JSON.stringify(thisItem.value, undefined, 2)}]\n]\n` + `To be a valid ${type}, its name and options should be wrapped in a pair of brackets`; } diff --git a/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js b/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js index 7989758..ae58e1e 100644 --- a/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js +++ b/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js @@ -35,16 +35,6 @@ const pluginNameMap = { url: "https://git.io/JvpRG" } }, - classStaticBlock: { - syntax: { - name: "@babel/plugin-syntax-class-static-block", - url: "https://git.io/JTLB6" - }, - transform: { - name: "@babel/plugin-proposal-class-static-block", - url: "https://git.io/JTLBP" - } - }, decimal: { syntax: { name: "@babel/plugin-syntax-decimal", @@ -143,16 +133,10 @@ const pluginNameMap = { url: "https://git.io/JfeDR" } }, - importAssertions: { + moduleAttributes: { syntax: { - name: "@babel/plugin-syntax-import-assertions", - url: "https://git.io/JUbkv" - } - }, - moduleStringNames: { - syntax: { - name: "@babel/plugin-syntax-module-string-names", - url: "https://git.io/JTL8G" + name: "@babel/plugin-syntax-module-attributes", + url: "https://git.io/JfK3k" } }, numericSeparator: { diff --git a/node_modules/@babel/core/lib/transformation/file/file.js b/node_modules/@babel/core/lib/transformation/file/file.js index 83f6366..f2d54fa 100644 --- a/node_modules/@babel/core/lib/transformation/file/file.js +++ b/node_modules/@babel/core/lib/transformation/file/file.js @@ -90,11 +90,9 @@ class File { inputMap }) { this._map = new Map(); - this.opts = void 0; this.declarations = {}; this.path = null; this.ast = {}; - this.scope = void 0; this.metadata = {}; this.code = ""; this.inputMap = null; diff --git a/node_modules/@babel/core/lib/transformation/plugin-pass.js b/node_modules/@babel/core/lib/transformation/plugin-pass.js index ea2efdf..2c746d1 100644 --- a/node_modules/@babel/core/lib/transformation/plugin-pass.js +++ b/node_modules/@babel/core/lib/transformation/plugin-pass.js @@ -8,11 +8,6 @@ exports.default = void 0; class PluginPass { constructor(file, key, options) { this._map = new Map(); - this.key = void 0; - this.file = void 0; - this.opts = void 0; - this.cwd = void 0; - this.filename = void 0; this.key = key; this.file = file; this.opts = options || {}; diff --git a/node_modules/@babel/core/package.json b/node_modules/@babel/core/package.json index d1ef1b8..65ee4e8 100644 --- a/node_modules/@babel/core/package.json +++ b/node_modules/@babel/core/package.json @@ -1,72 +1,19 @@ { - "_from": "@babel/core@^7.11.1", - "_id": "@babel/core@7.12.10", - "_inBundle": false, - "_integrity": "sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w==", - "_location": "/@babel/core", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@babel/core@^7.11.1", - "name": "@babel/core", - "escapedName": "@babel%2fcore", - "scope": "@babel", - "rawSpec": "^7.11.1", - "saveSpec": null, - "fetchSpec": "^7.11.1" - }, - "_requiredBy": [ - "#DEV:/" - ], - "_resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.10.tgz", - "_shasum": "b79a2e1b9f70ed3d84bbfb6d8c4ef825f606bccd", - "_spec": "@babel/core@^7.11.1", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Sebastian McKenzie", - "email": "sebmck@gmail.com" - }, - "browser": { - "./lib/config/files/index.js": "./lib/config/files/index-browser.js", - "./lib/transform-file.js": "./lib/transform-file-browser.js", - "./src/config/files/index.js": "./src/config/files/index-browser.js", - "./src/transform-file.js": "./src/transform-file-browser.js" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "bundleDependencies": false, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.10", - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helpers": "^7.12.5", - "@babel/parser": "^7.12.10", - "@babel/template": "^7.12.7", - "@babel/traverse": "^7.12.10", - "@babel/types": "^7.12.10", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.19", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "deprecated": false, + "name": "@babel/core", + "version": "7.11.6", "description": "Babel compiler core.", - "devDependencies": { - "@babel/helper-transform-fixture-test-runner": "7.12.10" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - }, + "main": "lib/index.js", + "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-core" + }, "keywords": [ "6to5", "babel", @@ -82,16 +29,42 @@ "babel-core", "compiler" ], - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/core", - "publishConfig": { - "access": "public" + "engines": { + "node": ">=6.9.0" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-core" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" }, - "version": "7.12.10" -} + "browser": { + "./lib/config/files/index.js": "./lib/config/files/index-browser.js", + "./lib/transform-file.js": "./lib/transform-file-browser.js", + "./src/config/files/index.js": "./src/config/files/index-browser.js", + "./src/transform-file.js": "./src/transform-file-browser.js" + }, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.11.6", + "@babel/helper-module-transforms": "^7.11.0", + "@babel/helpers": "^7.10.4", + "@babel/parser": "^7.11.5", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.11.5", + "@babel/types": "^7.11.5", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "devDependencies": { + "@babel/helper-transform-fixture-test-runner": "^7.11.6" + }, + "gitHead": "e51139d7fd850e7f5b8cd6aafb17cc88b7010218", + "__npminstall_done": "Sun Sep 06 2020 16:10:17 GMT+0800 (中国标准时间)", + "_from": "@babel/core@7.11.6", + "_resolved": "https://registry.npm.taobao.org/@babel/core/download/@babel/core-7.11.6.tgz?cache=0&sync_timestamp=1599146804351&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcore%2Fdownload%2F%40babel%2Fcore-7.11.6.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/core/src/config/files/index-browser.js b/node_modules/@babel/core/src/config/files/index-browser.js deleted file mode 100644 index 2fb0b6e..0000000 --- a/node_modules/@babel/core/src/config/files/index-browser.js +++ /dev/null @@ -1,96 +0,0 @@ -// @flow - -import type { Handler } from "gensync"; - -import type { - ConfigFile, - IgnoreFile, - RelativeConfig, - FilePackageData, -} from "./types"; - -import type { CallerMetadata } from "../validation/options"; - -export type { ConfigFile, IgnoreFile, RelativeConfig, FilePackageData }; - -// eslint-disable-next-line require-yield -export function* findConfigUpwards( - rootDir: string, // eslint-disable-line no-unused-vars -): Handler { - return null; -} - -// eslint-disable-next-line require-yield -export function* findPackageData(filepath: string): Handler { - return { - filepath, - directories: [], - pkg: null, - isPackage: false, - }; -} - -// eslint-disable-next-line require-yield -export function* findRelativeConfig( - pkgData: FilePackageData, // eslint-disable-line no-unused-vars - envName: string, // eslint-disable-line no-unused-vars - caller: CallerMetadata | void, // eslint-disable-line no-unused-vars -): Handler { - return { pkg: null, config: null, ignore: null }; -} - -// eslint-disable-next-line require-yield -export function* findRootConfig( - dirname: string, // eslint-disable-line no-unused-vars - envName: string, // eslint-disable-line no-unused-vars - caller: CallerMetadata | void, // eslint-disable-line no-unused-vars -): Handler { - return null; -} - -// eslint-disable-next-line require-yield -export function* loadConfig( - name: string, - dirname: string, - envName: string, // eslint-disable-line no-unused-vars - caller: CallerMetadata | void, // eslint-disable-line no-unused-vars -): Handler { - throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`); -} - -// eslint-disable-next-line require-yield -export function* resolveShowConfigPath( - dirname: string, // eslint-disable-line no-unused-vars -): Handler { - return null; -} - -export const ROOT_CONFIG_FILENAMES = []; - -// eslint-disable-next-line no-unused-vars -export function resolvePlugin(name: string, dirname: string): string | null { - return null; -} - -// eslint-disable-next-line no-unused-vars -export function resolvePreset(name: string, dirname: string): string | null { - return null; -} - -export function loadPlugin( - name: string, - dirname: string, -): { filepath: string, value: mixed } { - throw new Error( - `Cannot load plugin ${name} relative to ${dirname} in a browser`, - ); -} - -export function loadPreset( - name: string, - dirname: string, -): { filepath: string, value: mixed } { - throw new Error( - `Cannot load preset ${name} relative to ${dirname} in a browser`, - ); -} diff --git a/node_modules/@babel/core/src/config/files/index.js b/node_modules/@babel/core/src/config/files/index.js deleted file mode 100644 index 2321fb7..0000000 --- a/node_modules/@babel/core/src/config/files/index.js +++ /dev/null @@ -1,31 +0,0 @@ -// @flow - -import typeof * as indexBrowserType from "./index-browser"; -import typeof * as indexType from "./index"; - -// Kind of gross, but essentially asserting that the exports of this module are the same as the -// exports of index-browser, since this file may be replaced at bundle time with index-browser. -((({}: any): $Exact): $Exact); - -export { findPackageData } from "./package"; - -export { - findConfigUpwards, - findRelativeConfig, - findRootConfig, - loadConfig, - resolveShowConfigPath, - ROOT_CONFIG_FILENAMES, -} from "./configuration"; -export type { - ConfigFile, - IgnoreFile, - RelativeConfig, - FilePackageData, -} from "./types"; -export { - resolvePlugin, - resolvePreset, - loadPlugin, - loadPreset, -} from "./plugins"; diff --git a/node_modules/@babel/core/src/transform-file-browser.js b/node_modules/@babel/core/src/transform-file-browser.js deleted file mode 100644 index fc1b12a..0000000 --- a/node_modules/@babel/core/src/transform-file-browser.js +++ /dev/null @@ -1,29 +0,0 @@ -// @flow - -// duplicated from transform-file so we do not have to import anything here -type TransformFile = { - (filename: string, callback: Function): void, - (filename: string, opts: ?Object, callback: Function): void, -}; - -export const transformFile: TransformFile = (function transformFile( - filename, - opts, - callback, -) { - if (typeof opts === "function") { - callback = opts; - } - - callback(new Error("Transforming files is not supported in browsers"), null); -}: Function); - -export function transformFileSync() { - throw new Error("Transforming files is not supported in browsers"); -} - -export function transformFileAsync() { - return Promise.reject( - new Error("Transforming files is not supported in browsers"), - ); -} diff --git a/node_modules/@babel/core/src/transform-file.js b/node_modules/@babel/core/src/transform-file.js deleted file mode 100644 index 480afc1..0000000 --- a/node_modules/@babel/core/src/transform-file.js +++ /dev/null @@ -1,40 +0,0 @@ -// @flow - -import gensync from "gensync"; - -import loadConfig, { type InputOptions, type ResolvedConfig } from "./config"; -import { - run, - type FileResult, - type FileResultCallback, -} from "./transformation"; -import * as fs from "./gensync-utils/fs"; - -import typeof * as transformFileBrowserType from "./transform-file-browser"; -import typeof * as transformFileType from "./transform-file"; - -// Kind of gross, but essentially asserting that the exports of this module are the same as the -// exports of transform-file-browser, since this file may be replaced at bundle time with -// transform-file-browser. -((({}: any): $Exact): $Exact); - -type TransformFile = { - (filename: string, callback: FileResultCallback): void, - (filename: string, opts: ?InputOptions, callback: FileResultCallback): void, -}; - -const transformFileRunner = gensync<[string, ?InputOptions], FileResult | null>( - function* (filename, opts) { - const options = { ...opts, filename }; - - const config: ResolvedConfig | null = yield* loadConfig(options); - if (config === null) return null; - - const code = yield* fs.readFile(filename, "utf8"); - return yield* run(config, code); - }, -); - -export const transformFile: TransformFile = transformFileRunner.errback; -export const transformFileSync = transformFileRunner.sync; -export const transformFileAsync = transformFileRunner.async; diff --git a/node_modules/@babel/generator/README.md b/node_modules/@babel/generator/README.md index b760238..fc980b1 100644 --- a/node_modules/@babel/generator/README.md +++ b/node_modules/@babel/generator/README.md @@ -2,7 +2,7 @@ > Turns an AST into code. -See our website [@babel/generator](https://babeljs.io/docs/en/babel-generator) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen) associated with this package. +See our website [@babel/generator](https://babeljs.io/docs/en/next/babel-generator.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen) associated with this package. ## Install diff --git a/node_modules/@babel/generator/lib/buffer.js b/node_modules/@babel/generator/lib/buffer.js index 333e08c..d81546b 100644 --- a/node_modules/@babel/generator/lib/buffer.js +++ b/node_modules/@babel/generator/lib/buffer.js @@ -97,35 +97,22 @@ class Buffer { } _append(str, line, column, identifierName, filename, force) { + if (this._map && str[0] !== "\n") { + this._map.mark(this._position.line, this._position.column, line, column, identifierName, filename, force); + } + this._buf.push(str); this._last = str[str.length - 1]; - let i = str.indexOf("\n"); - let last = 0; - if (i !== 0) { - this._mark(line, column, identifierName, filename, force); - } - - while (i !== -1) { - this._position.line++; - this._position.column = 0; - last = i + 1; - - if (last < str.length) { - this._mark(++line, 0, identifierName, filename, force); + for (let i = 0; i < str.length; i++) { + if (str[i] === "\n") { + this._position.line++; + this._position.column = 0; + } else { + this._position.column++; } - - i = str.indexOf("\n", last); } - - this._position.column += str.length - last; - } - - _mark(line, column, identifierName, filename, force) { - var _this$_map; - - (_this$_map = this._map) == null ? void 0 : _this$_map.mark(this._position.line, this._position.column, line, column, identifierName, filename, force); } removeTrailingNewline() { diff --git a/node_modules/@babel/generator/lib/generators/classes.js b/node_modules/@babel/generator/lib/generators/classes.js index aa1e622..0ba2cf4 100644 --- a/node_modules/@babel/generator/lib/generators/classes.js +++ b/node_modules/@babel/generator/lib/generators/classes.js @@ -10,7 +10,6 @@ exports.ClassPrivateProperty = ClassPrivateProperty; exports.ClassMethod = ClassMethod; exports.ClassPrivateMethod = ClassPrivateMethod; exports._classMethodHead = _classMethodHead; -exports.StaticBlock = StaticBlock; var t = _interopRequireWildcard(require("@babel/types")); @@ -112,8 +111,6 @@ function ClassProperty(node) { } function ClassPrivateProperty(node) { - this.printJoin(node.decorators, node); - if (node.static) { this.word("static"); this.space(); @@ -151,20 +148,4 @@ function _classMethodHead(node) { this.tsPrintClassMemberModifiers(node, false); this._methodHead(node); -} - -function StaticBlock(node) { - this.word("static"); - this.space(); - this.token("{"); - - if (node.body.length === 0) { - this.token("}"); - } else { - this.newline(); - this.printSequence(node.body, node, { - indent: true - }); - this.rightBrace(); - } } \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/index.js b/node_modules/@babel/generator/lib/generators/index.js index 8820db0..f2b4cec 100644 --- a/node_modules/@babel/generator/lib/generators/index.js +++ b/node_modules/@babel/generator/lib/generators/index.js @@ -8,7 +8,6 @@ var _templateLiterals = require("./template-literals"); Object.keys(_templateLiterals).forEach(function (key) { if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _templateLiterals[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -21,7 +20,6 @@ var _expressions = require("./expressions"); Object.keys(_expressions).forEach(function (key) { if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _expressions[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -34,7 +32,6 @@ var _statements = require("./statements"); Object.keys(_statements).forEach(function (key) { if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _statements[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -47,7 +44,6 @@ var _classes = require("./classes"); Object.keys(_classes).forEach(function (key) { if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _classes[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -60,7 +56,6 @@ var _methods = require("./methods"); Object.keys(_methods).forEach(function (key) { if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _methods[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -73,7 +68,6 @@ var _modules = require("./modules"); Object.keys(_modules).forEach(function (key) { if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _modules[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -86,7 +80,6 @@ var _types = require("./types"); Object.keys(_types).forEach(function (key) { if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _types[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -99,7 +92,6 @@ var _flow = require("./flow"); Object.keys(_flow).forEach(function (key) { if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _flow[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -112,7 +104,6 @@ var _base = require("./base"); Object.keys(_base).forEach(function (key) { if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _base[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -125,7 +116,6 @@ var _jsx = require("./jsx"); Object.keys(_jsx).forEach(function (key) { if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _jsx[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { @@ -138,7 +128,6 @@ var _typescript = require("./typescript"); Object.keys(_typescript).forEach(function (key) { if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _typescript[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { diff --git a/node_modules/@babel/generator/lib/generators/modules.js b/node_modules/@babel/generator/lib/generators/modules.js index ad26632..96b4eac 100644 --- a/node_modules/@babel/generator/lib/generators/modules.js +++ b/node_modules/@babel/generator/lib/generators/modules.js @@ -78,7 +78,6 @@ function ExportAllDeclaration(node) { this.word("from"); this.space(); this.print(node.source, node); - this.printAssertions(node); this.semicolon(); } @@ -151,7 +150,6 @@ function ExportDeclaration(node) { this.word("from"); this.space(); this.print(node.source, node); - this.printAssertions(node); } this.semicolon(); @@ -201,7 +199,6 @@ function ImportDeclaration(node) { } this.print(node.source, node); - this.printAssertions(node); if ((_node$attributes = node.attributes) == null ? void 0 : _node$attributes.length) { this.space(); diff --git a/node_modules/@babel/generator/lib/generators/types.js b/node_modules/@babel/generator/lib/generators/types.js index ef3054b..603a593 100644 --- a/node_modules/@babel/generator/lib/generators/types.js +++ b/node_modules/@babel/generator/lib/generators/types.js @@ -218,9 +218,13 @@ function StringLiteral(node) { return; } - const val = (0, _jsesc.default)(node.value, Object.assign(this.format.jsescOption, this.format.jsonCompatibleStrings && { - json: true - })); + const opts = this.format.jsescOption; + + if (this.format.jsonCompatibleStrings) { + opts.json = true; + } + + const val = (0, _jsesc.default)(node.value, opts); return this.token(val); } @@ -228,22 +232,22 @@ function BigIntLiteral(node) { const raw = this.getPossibleRaw(node); if (!this.format.minified && raw != null) { - this.word(raw); + this.token(raw); return; } - this.word(node.value + "n"); + this.token(node.value + "n"); } function DecimalLiteral(node) { const raw = this.getPossibleRaw(node); if (!this.format.minified && raw != null) { - this.word(raw); + this.token(raw); return; } - this.word(node.value + "m"); + this.token(node.value + "m"); } function PipelineTopicExpression(node) { diff --git a/node_modules/@babel/generator/lib/generators/typescript.js b/node_modules/@babel/generator/lib/generators/typescript.js index 4e938e6..2d4e355 100644 --- a/node_modules/@babel/generator/lib/generators/typescript.js +++ b/node_modules/@babel/generator/lib/generators/typescript.js @@ -28,7 +28,6 @@ exports.TSVoidKeyword = TSVoidKeyword; exports.TSUndefinedKeyword = TSUndefinedKeyword; exports.TSNullKeyword = TSNullKeyword; exports.TSNeverKeyword = TSNeverKeyword; -exports.TSIntrinsicKeyword = TSIntrinsicKeyword; exports.TSThisType = TSThisType; exports.TSFunctionType = TSFunctionType; exports.TSConstructorType = TSConstructorType; @@ -266,10 +265,6 @@ function TSNeverKeyword() { this.word("never"); } -function TSIntrinsicKeyword() { - this.word("intrinsic"); -} - function TSThisType() { this.word("this"); } @@ -432,7 +427,7 @@ function TSParenthesizedType(node) { } function TSTypeOperator(node) { - this.word(node.operator); + this.token(node.operator); this.space(); this.print(node.typeAnnotation, node); } @@ -446,10 +441,9 @@ function TSIndexedAccessType(node) { function TSMappedType(node) { const { - nameType, - optional, readonly, - typeParameter + typeParameter, + optional } = node; this.token("{"); this.space(); @@ -466,14 +460,6 @@ function TSMappedType(node) { this.word("in"); this.space(); this.print(typeParameter.constraint, typeParameter); - - if (nameType) { - this.space(); - this.word("as"); - this.space(); - this.print(nameType, node); - } - this.token("]"); if (optional) { diff --git a/node_modules/@babel/generator/lib/index.js b/node_modules/@babel/generator/lib/index.js index b3fcd73..2ac41d2 100644 --- a/node_modules/@babel/generator/lib/index.js +++ b/node_modules/@babel/generator/lib/index.js @@ -17,7 +17,6 @@ class Generator extends _printer.default { const format = normalizeOptions(code, opts); const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null; super(format, map); - this.ast = void 0; this.ast = ast; } @@ -38,6 +37,7 @@ function normalizeOptions(code, opts) { compact: opts.compact, minified: opts.minified, concise: opts.concise, + jsonCompatibleStrings: opts.jsonCompatibleStrings, indent: { adjustMultilineComment: true, style: " ", @@ -50,9 +50,6 @@ function normalizeOptions(code, opts) { }, opts.jsescOption), recordAndTupleSyntaxType: opts.recordAndTupleSyntaxType }; - { - format.jsonCompatibleStrings = opts.jsonCompatibleStrings; - } if (format.minified) { format.compact = true; diff --git a/node_modules/@babel/generator/lib/node/parentheses.js b/node_modules/@babel/generator/lib/node/parentheses.js index 9f848db..44e7d43 100644 --- a/node_modules/@babel/generator/lib/node/parentheses.js +++ b/node_modules/@babel/generator/lib/node/parentheses.js @@ -223,7 +223,7 @@ function isFirstInStatement(printStack, { i--; let parent = printStack[i]; - while (i >= 0) { + while (i > 0) { if (t.isExpressionStatement(parent, { expression: node }) || considerDefaultExports && t.isExportDefaultDeclaration(parent, { diff --git a/node_modules/@babel/generator/lib/printer.js b/node_modules/@babel/generator/lib/printer.js index 65ccd23..8b1061c 100644 --- a/node_modules/@babel/generator/lib/printer.js +++ b/node_modules/@babel/generator/lib/printer.js @@ -464,7 +464,7 @@ class Printer { val = val.replace(newlineRegex, "\n"); } - const indentSize = Math.max(this._getIndent().length, this.format.retainLines ? 0 : this._buf.getCurrentColumn()); + const indentSize = Math.max(this._getIndent().length, this._buf.getCurrentColumn()); val = val.replace(/\n(?!$)/g, `\n${" ".repeat(indentSize)}`); } @@ -487,21 +487,6 @@ class Printer { } } - printAssertions(node) { - var _node$assertions; - - if ((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) { - this.space(); - this.word("assert"); - this.space(); - this.token("{"); - this.space(); - this.printList(node.assertions, node); - this.space(); - this.token("}"); - } - } - } exports.default = Printer; diff --git a/node_modules/@babel/generator/package.json b/node_modules/@babel/generator/package.json index 1944f87..0c8180b 100644 --- a/node_modules/@babel/generator/package.json +++ b/node_modules/@babel/generator/package.json @@ -1,66 +1,33 @@ { - "_args": [ - [ - "@babel/generator@7.12.11", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/generator@7.12.11", - "_id": "@babel/generator@7.12.11", - "_inBundle": false, - "_integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==", - "_location": "/@babel/generator", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/generator@7.12.11", - "name": "@babel/generator", - "escapedName": "@babel%2fgenerator", - "scope": "@babel", - "rawSpec": "7.12.11", - "saveSpec": null, - "fetchSpec": "7.12.11" - }, - "_requiredBy": [ - "/@babel/core", - "/@babel/traverse" - ], - "_resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz", - "_spec": "7.12.11", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Sebastian McKenzie", - "email": "sebmck@gmail.com" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/types": "^7.12.11", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - }, + "name": "@babel/generator", + "version": "7.11.6", "description": "Turns an AST into code.", - "devDependencies": { - "@babel/helper-fixtures": "7.12.10", - "@babel/parser": "7.12.11" - }, - "files": [ - "lib" - ], + "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", - "main": "lib/index.js", - "name": "@babel/generator", "publishConfig": { "access": "public" }, "repository": { "type": "git", - "url": "git+https://github.com/babel/babel.git", + "url": "https://github.com/babel/babel.git", "directory": "packages/babel-generator" }, - "version": "7.12.11" -} + "main": "lib/index.js", + "files": [ + "lib" + ], + "dependencies": { + "@babel/types": "^7.11.5", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "devDependencies": { + "@babel/helper-fixtures": "^7.10.5", + "@babel/parser": "^7.11.5" + }, + "gitHead": "e51139d7fd850e7f5b8cd6aafb17cc88b7010218", + "__npminstall_done": "Sun Sep 06 2020 16:10:17 GMT+0800 (中国标准时间)", + "_from": "@babel/generator@7.11.6", + "_resolved": "https://registry.npm.taobao.org/@babel/generator/download/@babel/generator-7.11.6.tgz?cache=0&sync_timestamp=1599146804739&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fgenerator%2Fdownload%2F%40babel%2Fgenerator-7.11.6.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-annotate-as-pure/README.md b/node_modules/@babel/helper-annotate-as-pure/README.md index 5ac1b37..82931e4 100644 --- a/node_modules/@babel/helper-annotate-as-pure/README.md +++ b/node_modules/@babel/helper-annotate-as-pure/README.md @@ -2,7 +2,7 @@ > Helper function to annotate paths and nodes with #__PURE__ comment -See our website [@babel/helper-annotate-as-pure](https://babeljs.io/docs/en/babel-helper-annotate-as-pure) for more information. +See our website [@babel/helper-annotate-as-pure](https://babeljs.io/docs/en/next/babel-helper-annotate-as-pure.html) for more information. ## Install diff --git a/node_modules/@babel/helper-annotate-as-pure/lib/index.js b/node_modules/@babel/helper-annotate-as-pure/lib/index.js index a0d4113..4c3bd2d 100644 --- a/node_modules/@babel/helper-annotate-as-pure/lib/index.js +++ b/node_modules/@babel/helper-annotate-as-pure/lib/index.js @@ -18,7 +18,7 @@ const isPureAnnotated = ({ }) => !!leadingComments && leadingComments.some(comment => /[@#]__PURE__/.test(comment.value)); function annotateAsPure(pathOrNode) { - const node = pathOrNode["node"] || pathOrNode; + const node = pathOrNode.node || pathOrNode; if (isPureAnnotated(node)) { return; diff --git a/node_modules/@babel/helper-annotate-as-pure/package.json b/node_modules/@babel/helper-annotate-as-pure/package.json index 3ce18e9..02eb992 100644 --- a/node_modules/@babel/helper-annotate-as-pure/package.json +++ b/node_modules/@babel/helper-annotate-as-pure/package.json @@ -1,54 +1,22 @@ { - "_args": [ - [ - "@babel/helper-annotate-as-pure@7.12.10", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-annotate-as-pure@7.12.10", - "_id": "@babel/helper-annotate-as-pure@7.12.10", - "_inBundle": false, - "_integrity": "sha512-XplmVbC1n+KY6jL8/fgLVXXUauDIB+lD5+GsQEh6F6GBF1dq1qy4DP4yXWzDKcoqXB3X58t61e85Fitoww4JVQ==", - "_location": "/@babel/helper-annotate-as-pure", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-annotate-as-pure@7.12.10", - "name": "@babel/helper-annotate-as-pure", - "escapedName": "@babel%2fhelper-annotate-as-pure", - "scope": "@babel", - "rawSpec": "7.12.10", - "saveSpec": null, - "fetchSpec": "7.12.10" - }, - "_requiredBy": [ - "/@babel/helper-create-regexp-features-plugin", - "/@babel/helper-remap-async-to-generator", - "/@babel/plugin-transform-classes" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.10.tgz", - "_spec": "7.12.10", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/types": "^7.12.10" - }, - "description": "Helper function to annotate paths and nodes with #__PURE__ comment", - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "lib/index.js", "name": "@babel/helper-annotate-as-pure", + "version": "7.10.4", + "description": "Helper function to annotate paths and nodes with #__PURE__ comment", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-annotate-as-pure" + }, + "license": "MIT", "publishConfig": { "access": "public" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-annotate-as-pure" + "main": "lib/index.js", + "dependencies": { + "@babel/types": "^7.10.4" }, - "version": "7.12.10" -} + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:18 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-annotate-as-pure@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-annotate-as-pure/download/@babel/helper-annotate-as-pure-7.10.4.tgz?cache=0&sync_timestamp=1593521260284&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-annotate-as-pure%2Fdownload%2F%40babel%2Fhelper-annotate-as-pure-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-builder-binary-assignment-operator-visitor/package.json b/node_modules/@babel/helper-builder-binary-assignment-operator-visitor/package.json index 841fc28..e028b9b 100644 --- a/node_modules/@babel/helper-builder-binary-assignment-operator-visitor/package.json +++ b/node_modules/@babel/helper-builder-binary-assignment-operator-visitor/package.json @@ -1,54 +1,23 @@ { - "_args": [ - [ - "@babel/helper-builder-binary-assignment-operator-visitor@7.10.4", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-builder-binary-assignment-operator-visitor@7.10.4", - "_id": "@babel/helper-builder-binary-assignment-operator-visitor@7.10.4", - "_inBundle": false, - "_integrity": "sha512-L0zGlFrGWZK4PbT8AszSfLTM5sDU1+Az/En9VrdT8/LmEiJt4zXt+Jve9DCAnQcbqDhCI+29y/L93mrDzddCcg==", - "_location": "/@babel/helper-builder-binary-assignment-operator-visitor", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-builder-binary-assignment-operator-visitor@7.10.4", - "name": "@babel/helper-builder-binary-assignment-operator-visitor", - "escapedName": "@babel%2fhelper-builder-binary-assignment-operator-visitor", - "scope": "@babel", - "rawSpec": "7.10.4", - "saveSpec": null, - "fetchSpec": "7.10.4" + "name": "@babel/helper-builder-binary-assignment-operator-visitor", + "version": "7.10.4", + "description": "Helper function to build binary assignment operator visitors", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-builder-binary-assignment-operator-visitor" }, - "_requiredBy": [ - "/@babel/plugin-transform-exponentiation-operator" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz", - "_spec": "7.10.4", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" + "license": "MIT", + "publishConfig": { + "access": "public" }, + "main": "lib/index.js", "dependencies": { "@babel/helper-explode-assignable-expression": "^7.10.4", "@babel/types": "^7.10.4" }, - "description": "Helper function to build binary assignment operator visitors", "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helper-builder-binary-assignment-operator-visitor", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-builder-binary-assignment-operator-visitor" - }, - "version": "7.10.4" -} + "__npminstall_done": "Sun Sep 06 2020 16:10:19 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-builder-binary-assignment-operator-visitor@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-builder-binary-assignment-operator-visitor/download/@babel/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz?cache=0&sync_timestamp=1593522960718&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-builder-binary-assignment-operator-visitor%2Fdownload%2F%40babel%2Fhelper-builder-binary-assignment-operator-visitor-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-compilation-targets/lib/index.js b/node_modules/@babel/helper-compilation-targets/lib/index.js index e44dd61..bd06977 100644 --- a/node_modules/@babel/helper-compilation-targets/lib/index.js +++ b/node_modules/@babel/helper-compilation-targets/lib/index.js @@ -38,7 +38,9 @@ Object.defineProperty(exports, "isRequired", { var _browserslist = _interopRequireDefault(require("browserslist")); -var _helperValidatorOption = require("@babel/helper-validator-option"); +var _levenary = _interopRequireDefault(require("levenary")); + +var _invariant = _interopRequireDefault(require("invariant")); var _nativeModules = _interopRequireDefault(require("@babel/compat-data/native-modules")); @@ -48,8 +50,6 @@ var _targets = require("./targets"); var _options = require("./options"); -var _package = require("../package.json"); - var _pretty = require("./pretty"); var _debug = require("./debug"); @@ -62,7 +62,6 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const v = new _helperValidatorOption.OptionValidator(_package.name); const browserslistDefaults = _browserslist.default.defaults; const validBrowserslistTargets = [...Object.keys(_browserslist.default.data), ...Object.keys(_browserslist.default.aliases)]; @@ -80,10 +79,10 @@ function objectToBrowserslist(object) { function validateTargetNames(targets) { const validTargets = Object.keys(_options.TargetNames); - for (const target of Object.keys(targets)) { - if (!(target in _options.TargetNames)) { - throw new Error(v.formatMessage(`'${target}' is not a valid target -- Did you mean '${(0, _helperValidatorOption.findSuggestion)(target, validTargets)}'?`)); + for (const target in targets) { + if (!_options.TargetNames[target]) { + throw new Error(`Invalid Option: '${target}' is not a valid target + Maybe you meant to use '${(0, _levenary.default)(target, validTargets)}'?`); } } @@ -95,7 +94,7 @@ function isBrowsersQueryValid(browsers) { } function validateBrowsers(browsers) { - v.invariant(browsers === undefined || isBrowsersQueryValid(browsers), `'${String(browsers)}' is not a valid browserslist query`); + (0, _invariant.default)(typeof browsers === "undefined" || isBrowsersQueryValid(browsers), `Invalid Option: '${String(browsers)}' is not a valid browserslist query`); return browsers; } @@ -135,7 +134,7 @@ function getLowestVersions(browsers) { } function outputDecimalWarning(decimalTargets) { - if (!decimalTargets.length) { + if (!(decimalTargets == null ? void 0 : decimalTargets.length)) { return; } @@ -155,7 +154,7 @@ function semverifyTarget(target, value) { try { return (0, _utils.semverify)(value); } catch (error) { - throw new Error(v.formatMessage(`'${value}' is not a valid value for 'targets.${target}'.`)); + throw new Error(`Invalid Option: '${value}' is not a valid value for 'targets.${target}'.`); } } @@ -172,14 +171,8 @@ const targetParserMap = { }; -function generateTargets(inputTargets) { - const input = Object.assign({}, inputTargets); - delete input.esmodules; - delete input.browsers; - return input; -} - function getTargets(inputTargets = {}, options = {}) { + const targetOpts = {}; let { browsers } = inputTargets; @@ -190,7 +183,9 @@ function getTargets(inputTargets = {}, options = {}) { } const browsersquery = validateBrowsers(browsers); - const input = generateTargets(inputTargets); + const input = Object.assign({}, inputTargets); + delete input.esmodules; + delete input.browsers; let targets = validateTargetNames(input); const shouldParseBrowsers = !!browsersquery; const hasTargets = shouldParseBrowsers || Object.keys(targets).length > 0; @@ -211,16 +206,13 @@ function getTargets(inputTargets = {}, options = {}) { _browserslist.default.defaults = browserslistDefaults; } - const result = {}; - const decimalWarnings = []; - - for (const target of Object.keys(targets).sort()) { + const parsed = Object.keys(targets).sort().reduce((results, target) => { var _targetParserMap$targ; const value = targets[target]; if (typeof value === "number" && value % 1 !== 0) { - decimalWarnings.push({ + results.decimalWarnings.push({ target, value }); @@ -230,10 +222,14 @@ function getTargets(inputTargets = {}, options = {}) { const [parsedTarget, parsedValue] = parser(target, value); if (parsedValue) { - result[parsedTarget] = parsedValue; + results.targets[parsedTarget] = parsedValue; } - } - outputDecimalWarning(decimalWarnings); - return result; + return results; + }, { + targets: targetOpts, + decimalWarnings: [] + }); + outputDecimalWarning(parsed.decimalWarnings); + return parsed.targets; } \ No newline at end of file diff --git a/node_modules/@babel/helper-compilation-targets/lib/utils.js b/node_modules/@babel/helper-compilation-targets/lib/utils.js index a47844a..f02c926 100644 --- a/node_modules/@babel/helper-compilation-targets/lib/utils.js +++ b/node_modules/@babel/helper-compilation-targets/lib/utils.js @@ -9,18 +9,15 @@ exports.isUnreleasedVersion = isUnreleasedVersion; exports.getLowestUnreleased = getLowestUnreleased; exports.getLowestImplementedVersion = getLowestImplementedVersion; +var _invariant = _interopRequireDefault(require("invariant")); + var _semver = _interopRequireDefault(require("semver")); -var _helperValidatorOption = require("@babel/helper-validator-option"); - -var _package = require("../package.json"); - var _targets = require("./targets"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const versionRegExp = /^(\d+|\d+.\d+)$/; -const v = new _helperValidatorOption.OptionValidator(_package.name); function semverMin(first, second) { return first && _semver.default.lt(first, second) ? first : second; @@ -31,7 +28,7 @@ function semverify(version) { return version; } - v.invariant(typeof version === "number" || typeof version === "string" && versionRegExp.test(version), `'${version}' is not a valid version`); + (0, _invariant.default)(typeof version === "number" || typeof version === "string" && versionRegExp.test(version), `'${version}' is not a valid version`); const split = version.toString().split("."); while (split.length < 3) { diff --git a/node_modules/@babel/helper-compilation-targets/package.json b/node_modules/@babel/helper-compilation-targets/package.json index ad46cbe..fdc8a68 100644 --- a/node_modules/@babel/helper-compilation-targets/package.json +++ b/node_modules/@babel/helper-compilation-targets/package.json @@ -1,72 +1,41 @@ { - "_args": [ - [ - "@babel/helper-compilation-targets@7.12.5", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-compilation-targets@7.12.5", - "_id": "@babel/helper-compilation-targets@7.12.5", - "_inBundle": false, - "_integrity": "sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw==", - "_location": "/@babel/helper-compilation-targets", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-compilation-targets@7.12.5", - "name": "@babel/helper-compilation-targets", - "escapedName": "@babel%2fhelper-compilation-targets", - "scope": "@babel", - "rawSpec": "7.12.5", - "saveSpec": null, - "fetchSpec": "7.12.5" - }, - "_requiredBy": [ - "/@babel/preset-env" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz", - "_spec": "7.12.5", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "The Babel Team", - "url": "https://babeljs.io/team" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/compat-data": "^7.12.5", - "@babel/helper-validator-option": "^7.12.1", - "browserslist": "^4.14.5", - "semver": "^5.5.0" - }, + "name": "@babel/helper-compilation-targets", + "version": "7.10.4", + "author": "The Babel Team (https://babeljs.io/team)", + "license": "MIT", "description": "Engine compat data used in @babel/preset-env", - "devDependencies": { - "@babel/core": "7.12.3" + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-compilation-targets" }, + "main": "lib/index.js", "exports": { ".": "./lib/index.js" }, - "homepage": "https://github.com/babel/babel#readme", - "keywords": [ - "babel", - "babel-plugin" - ], - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helper-compilation-targets", - "peerDependencies": { - "@babel/core": "^7.0.0" - }, "publishConfig": { "access": "public" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-compilation-targets" + "keywords": [ + "babel", + "babel-plugin" + ], + "dependencies": { + "@babel/compat-data": "^7.10.4", + "browserslist": "^4.12.0", + "invariant": "^2.2.4", + "levenary": "^1.1.1", + "semver": "^5.5.0" }, - "version": "7.12.5" -} + "peerDependencies": { + "@babel/core": "^7.0.0" + }, + "devDependencies": { + "@babel/core": "^7.10.4", + "@babel/helper-plugin-test-runner": "^7.10.4" + }, + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:16 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-compilation-targets@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-compilation-targets/download/@babel/helper-compilation-targets-7.10.4.tgz?cache=0&sync_timestamp=1593521093775&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-compilation-targets%2Fdownload%2F%40babel%2Fhelper-compilation-targets-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-create-class-features-plugin/lib/index.js b/node_modules/@babel/helper-create-class-features-plugin/lib/index.js index 665eeab..acbd0f5 100644 --- a/node_modules/@babel/helper-create-class-features-plugin/lib/index.js +++ b/node_modules/@babel/helper-create-class-features-plugin/lib/index.js @@ -118,18 +118,6 @@ function createClassFeaturePlugin({ } if (!isDecorated) isDecorated = (0, _decorators.hasOwnDecorators)(path.node); - - if (path.isStaticBlock == null ? void 0 : path.isStaticBlock()) { - throw path.buildCodeFrameError(`Incorrect plugin order, \`@babel/plugin-proposal-class-static-block\` should be placed before class features plugins -{ - "plugins": [ - "@babel/plugin-proposal-class-static-block", - "@babel/plugin-proposal-private-property-in-object", - "@babel/plugin-proposal-private-methods", - "@babel/plugin-proposal-class-properties", - ] -}`); - } } if (!props.length && !isDecorated) return; @@ -179,12 +167,7 @@ function createClassFeaturePlugin({ }, PrivateName(path) { - if (this.file.get(versionKey) !== version || path.parentPath.isPrivate({ - key: path.node - })) { - return; - } - + if (this.file.get(versionKey) !== version) return; throw path.buildCodeFrameError(`Unknown PrivateName "${path}"`); }, diff --git a/node_modules/@babel/helper-create-class-features-plugin/package.json b/node_modules/@babel/helper-create-class-features-plugin/package.json index a7369b9..a3c2d45 100644 --- a/node_modules/@babel/helper-create-class-features-plugin/package.json +++ b/node_modules/@babel/helper-create-class-features-plugin/package.json @@ -1,73 +1,39 @@ { - "_args": [ - [ - "@babel/helper-create-class-features-plugin@7.12.1", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-create-class-features-plugin@7.12.1", - "_id": "@babel/helper-create-class-features-plugin@7.12.1", - "_inBundle": false, - "_integrity": "sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w==", - "_location": "/@babel/helper-create-class-features-plugin", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-create-class-features-plugin@7.12.1", - "name": "@babel/helper-create-class-features-plugin", - "escapedName": "@babel%2fhelper-create-class-features-plugin", - "scope": "@babel", - "rawSpec": "7.12.1", - "saveSpec": null, - "fetchSpec": "7.12.1" - }, - "_requiredBy": [ - "/@babel/plugin-proposal-class-properties", - "/@babel/plugin-proposal-private-methods", - "/@babel/plugin-transform-typescript" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz", - "_spec": "7.12.1", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "The Babel Team", - "url": "https://babeljs.io/team" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-member-expression-to-functions": "^7.12.1", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.10.4" - }, + "name": "@babel/helper-create-class-features-plugin", + "version": "7.10.5", + "author": "The Babel Team (https://babeljs.io/team)", + "license": "MIT", "description": "Compile class public and private fields, private methods and decorators to ES6", - "devDependencies": { - "@babel/core": "^7.12.1", - "@babel/helper-plugin-test-runner": "7.10.4" + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-create-class-features-plugin" + }, + "main": "lib/index.js", + "publishConfig": { + "access": "public" }, - "homepage": "https://github.com/babel/babel#readme", "keywords": [ "babel", "babel-plugin" ], - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helper-create-class-features-plugin", + "dependencies": { + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.10.5", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4" + }, "peerDependencies": { "@babel/core": "^7.0.0" }, - "publishConfig": { - "access": "public" + "devDependencies": { + "@babel/core": "^7.10.5", + "@babel/helper-plugin-test-runner": "^7.10.4" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-create-class-features-plugin" - }, - "version": "7.12.1" -} + "gitHead": "f7964a9ac51356f7df6404a25b27ba1cffba1ba7", + "__npminstall_done": "Sun Sep 06 2020 16:10:16 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-create-class-features-plugin@7.10.5", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-create-class-features-plugin/download/@babel/helper-create-class-features-plugin-7.10.5.tgz?cache=0&sync_timestamp=1594749447215&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-create-class-features-plugin%2Fdownload%2F%40babel%2Fhelper-create-class-features-plugin-7.10.5.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-create-regexp-features-plugin/README.md b/node_modules/@babel/helper-create-regexp-features-plugin/README.md index 31b7ec3..69f661b 100644 --- a/node_modules/@babel/helper-create-regexp-features-plugin/README.md +++ b/node_modules/@babel/helper-create-regexp-features-plugin/README.md @@ -2,7 +2,7 @@ > Compile ESNext Regular Expressions to ES5 -See our website [@babel/helper-create-regexp-features-plugin](https://babeljs.io/docs/en/babel-helper-create-regexp-features-plugin) for more information. +See our website [@babel/helper-create-regexp-features-plugin](https://babeljs.io/docs/en/next/babel-helper-create-regexp-features-plugin.html) for more information. ## Install diff --git a/node_modules/@babel/helper-create-regexp-features-plugin/lib/index.js b/node_modules/@babel/helper-create-regexp-features-plugin/lib/index.js index a33ee87..c576b47 100644 --- a/node_modules/@babel/helper-create-regexp-features-plugin/lib/index.js +++ b/node_modules/@babel/helper-create-regexp-features-plugin/lib/index.js @@ -15,14 +15,12 @@ var _package = _interopRequireDefault(require("../package.json")); var _core = require("@babel/core"); +var _helperRegex = require("@babel/helper-regex"); + var _helperAnnotateAsPure = _interopRequireDefault(require("@babel/helper-annotate-as-pure")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function pullFlag(node, flag) { - node.flags = node.flags.replace(flag, ""); -} - const version = _package.default.version.split(".").reduce((v, x) => v * 1e5 + +x, 0); const versionKey = "@babel/plugin-regexp-features/version"; @@ -101,11 +99,11 @@ function createRegExpFeaturePlugin({ } if ((0, _features.hasFeature)(features, _features.FEATURES.unicodeFlag)) { - pullFlag(node, "u"); + (0, _helperRegex.pullFlag)(node, "u"); } if ((0, _features.hasFeature)(features, _features.FEATURES.dotAllFlag)) { - pullFlag(node, "s"); + (0, _helperRegex.pullFlag)(node, "s"); } } diff --git a/node_modules/@babel/helper-create-regexp-features-plugin/package.json b/node_modules/@babel/helper-create-regexp-features-plugin/package.json index 6946d7c..bae6623 100644 --- a/node_modules/@babel/helper-create-regexp-features-plugin/package.json +++ b/node_modules/@babel/helper-create-regexp-features-plugin/package.json @@ -1,71 +1,36 @@ { - "_args": [ - [ - "@babel/helper-create-regexp-features-plugin@7.12.7", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-create-regexp-features-plugin@7.12.7", - "_id": "@babel/helper-create-regexp-features-plugin@7.12.7", - "_inBundle": false, - "_integrity": "sha512-idnutvQPdpbduutvi3JVfEgcVIHooQnhvhx0Nk9isOINOIGYkZea1Pk2JlJRiUnMefrlvr0vkByATBY/mB4vjQ==", - "_location": "/@babel/helper-create-regexp-features-plugin", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-create-regexp-features-plugin@7.12.7", - "name": "@babel/helper-create-regexp-features-plugin", - "escapedName": "@babel%2fhelper-create-regexp-features-plugin", - "scope": "@babel", - "rawSpec": "7.12.7", - "saveSpec": null, - "fetchSpec": "7.12.7" - }, - "_requiredBy": [ - "/@babel/plugin-proposal-unicode-property-regex", - "/@babel/plugin-transform-dotall-regex", - "/@babel/plugin-transform-named-capturing-groups-regex", - "/@babel/plugin-transform-unicode-regex" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.7.tgz", - "_spec": "7.12.7", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "The Babel Team", - "url": "https://babeljs.io/team" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.10.4", - "regexpu-core": "^4.7.1" - }, + "name": "@babel/helper-create-regexp-features-plugin", + "version": "7.10.4", + "author": "The Babel Team (https://babeljs.io/team)", + "license": "MIT", "description": "Compile ESNext Regular Expressions to ES5", - "devDependencies": { - "@babel/core": "7.12.7", - "@babel/helper-plugin-test-runner": "7.10.4" + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-create-regexp-features-plugin" + }, + "main": "lib/index.js", + "publishConfig": { + "access": "public" }, - "homepage": "https://github.com/babel/babel#readme", "keywords": [ "babel", "babel-plugin" ], - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helper-create-regexp-features-plugin", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-regex": "^7.10.4", + "regexpu-core": "^4.7.0" + }, "peerDependencies": { "@babel/core": "^7.0.0" }, - "publishConfig": { - "access": "public" + "devDependencies": { + "@babel/core": "^7.10.4", + "@babel/helper-plugin-test-runner": "^7.10.4" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-create-regexp-features-plugin" - }, - "version": "7.12.7" -} + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:18 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-create-regexp-features-plugin@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-create-regexp-features-plugin/download/@babel/helper-create-regexp-features-plugin-7.10.4.tgz?cache=0&sync_timestamp=1593522952175&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-create-regexp-features-plugin%2Fdownload%2F%40babel%2Fhelper-create-regexp-features-plugin-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-define-map/package.json b/node_modules/@babel/helper-define-map/package.json index 04cc10a..4055d6f 100644 --- a/node_modules/@babel/helper-define-map/package.json +++ b/node_modules/@babel/helper-define-map/package.json @@ -1,55 +1,24 @@ { - "_args": [ - [ - "@babel/helper-define-map@7.10.5", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-define-map@7.10.5", - "_id": "@babel/helper-define-map@7.10.5", - "_inBundle": false, - "_integrity": "sha512-fMw4kgFB720aQFXSVaXr79pjjcW5puTCM16+rECJ/plGS+zByelE8l9nCpV1GibxTnFVmUuYG9U8wYfQHdzOEQ==", - "_location": "/@babel/helper-define-map", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-define-map@7.10.5", - "name": "@babel/helper-define-map", - "escapedName": "@babel%2fhelper-define-map", - "scope": "@babel", - "rawSpec": "7.10.5", - "saveSpec": null, - "fetchSpec": "7.10.5" + "name": "@babel/helper-define-map", + "version": "7.10.5", + "description": "Helper function to define a map", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-define-map" }, - "_requiredBy": [ - "/@babel/plugin-transform-classes" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.5.tgz", - "_spec": "7.10.5", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" + "license": "MIT", + "publishConfig": { + "access": "public" }, + "main": "lib/index.js", "dependencies": { "@babel/helper-function-name": "^7.10.4", "@babel/types": "^7.10.5", "lodash": "^4.17.19" }, - "description": "Helper function to define a map", "gitHead": "f7964a9ac51356f7df6404a25b27ba1cffba1ba7", - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helper-define-map", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-define-map" - }, - "version": "7.10.5" -} + "__npminstall_done": "Sun Sep 06 2020 16:10:18 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-define-map@7.10.5", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-define-map/download/@babel/helper-define-map-7.10.5.tgz?cache=0&sync_timestamp=1594749492991&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-define-map%2Fdownload%2F%40babel%2Fhelper-define-map-7.10.5.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-explode-assignable-expression/package.json b/node_modules/@babel/helper-explode-assignable-expression/package.json index 9d41cc7..8dc322b 100644 --- a/node_modules/@babel/helper-explode-assignable-expression/package.json +++ b/node_modules/@babel/helper-explode-assignable-expression/package.json @@ -1,55 +1,25 @@ { - "_args": [ - [ - "@babel/helper-explode-assignable-expression@7.12.1", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-explode-assignable-expression@7.12.1", - "_id": "@babel/helper-explode-assignable-expression@7.12.1", - "_inBundle": false, - "_integrity": "sha512-dmUwH8XmlrUpVqgtZ737tK88v07l840z9j3OEhCLwKTkjlvKpfqXVIZ0wpK3aeOxspwGrf/5AP5qLx4rO3w5rA==", - "_location": "/@babel/helper-explode-assignable-expression", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-explode-assignable-expression@7.12.1", - "name": "@babel/helper-explode-assignable-expression", - "escapedName": "@babel%2fhelper-explode-assignable-expression", - "scope": "@babel", - "rawSpec": "7.12.1", - "saveSpec": null, - "fetchSpec": "7.12.1" - }, - "_requiredBy": [ - "/@babel/helper-builder-binary-assignment-operator-visitor" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.12.1.tgz", - "_spec": "7.12.1", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/types": "^7.12.1" - }, - "description": "Helper function to explode an assignable expression", - "devDependencies": { - "@babel/traverse": "^7.12.1" - }, - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "lib/index.js", "name": "@babel/helper-explode-assignable-expression", + "version": "7.11.4", + "description": "Helper function to explode an assignable expression", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-explode-assignable-expression" + }, + "license": "MIT", "publishConfig": { "access": "public" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-explode-assignable-expression" + "main": "lib/index.js", + "dependencies": { + "@babel/types": "^7.10.4" }, - "version": "7.12.1" -} + "devDependencies": { + "@babel/traverse": "^7.10.4" + }, + "gitHead": "90b198956995195ea00e7ac9912c2260e44d8746", + "__npminstall_done": "Sun Sep 06 2020 16:10:19 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-explode-assignable-expression@7.11.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-explode-assignable-expression/download/@babel/helper-explode-assignable-expression-7.11.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-explode-assignable-expression%2Fdownload%2F%40babel%2Fhelper-explode-assignable-expression-7.11.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-function-name/README.md b/node_modules/@babel/helper-function-name/README.md index 36a6593..a8a6809 100644 --- a/node_modules/@babel/helper-function-name/README.md +++ b/node_modules/@babel/helper-function-name/README.md @@ -2,7 +2,7 @@ > Helper function to change the property 'name' of every function -See our website [@babel/helper-function-name](https://babeljs.io/docs/en/babel-helper-function-name) for more information. +See our website [@babel/helper-function-name](https://babeljs.io/docs/en/next/babel-helper-function-name.html) for more information. ## Install diff --git a/node_modules/@babel/helper-function-name/package.json b/node_modules/@babel/helper-function-name/package.json index 92e33e7..bcb4da3 100644 --- a/node_modules/@babel/helper-function-name/package.json +++ b/node_modules/@babel/helper-function-name/package.json @@ -1,59 +1,24 @@ { - "_args": [ - [ - "@babel/helper-function-name@7.12.11", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-function-name@7.12.11", - "_id": "@babel/helper-function-name@7.12.11", - "_inBundle": false, - "_integrity": "sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA==", - "_location": "/@babel/helper-function-name", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-function-name@7.12.11", - "name": "@babel/helper-function-name", - "escapedName": "@babel%2fhelper-function-name", - "scope": "@babel", - "rawSpec": "7.12.11", - "saveSpec": null, - "fetchSpec": "7.12.11" - }, - "_requiredBy": [ - "/@babel/helper-create-class-features-plugin", - "/@babel/helper-define-map", - "/@babel/helper-wrap-function", - "/@babel/plugin-transform-classes", - "/@babel/plugin-transform-function-name", - "/@babel/traverse" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz", - "_spec": "7.12.11", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.10", - "@babel/template": "^7.12.7", - "@babel/types": "^7.12.11" - }, - "description": "Helper function to change the property 'name' of every function", - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "lib/index.js", "name": "@babel/helper-function-name", + "version": "7.10.4", + "description": "Helper function to change the property 'name' of every function", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-function-name" + }, + "license": "MIT", "publishConfig": { "access": "public" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-function-name" + "main": "lib/index.js", + "dependencies": { + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" }, - "version": "7.12.11" -} + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:16 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-function-name@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-function-name/download/@babel/helper-function-name-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-get-function-arity/README.md b/node_modules/@babel/helper-get-function-arity/README.md index 8fa48c1..1de8084 100644 --- a/node_modules/@babel/helper-get-function-arity/README.md +++ b/node_modules/@babel/helper-get-function-arity/README.md @@ -2,7 +2,7 @@ > Helper function to get function arity -See our website [@babel/helper-get-function-arity](https://babeljs.io/docs/en/babel-helper-get-function-arity) for more information. +See our website [@babel/helper-get-function-arity](https://babeljs.io/docs/en/next/babel-helper-get-function-arity.html) for more information. ## Install diff --git a/node_modules/@babel/helper-get-function-arity/package.json b/node_modules/@babel/helper-get-function-arity/package.json index 623b11f..2852ca5 100644 --- a/node_modules/@babel/helper-get-function-arity/package.json +++ b/node_modules/@babel/helper-get-function-arity/package.json @@ -1,52 +1,22 @@ { - "_args": [ - [ - "@babel/helper-get-function-arity@7.12.10", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-get-function-arity@7.12.10", - "_id": "@babel/helper-get-function-arity@7.12.10", - "_inBundle": false, - "_integrity": "sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag==", - "_location": "/@babel/helper-get-function-arity", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-get-function-arity@7.12.10", - "name": "@babel/helper-get-function-arity", - "escapedName": "@babel%2fhelper-get-function-arity", - "scope": "@babel", - "rawSpec": "7.12.10", - "saveSpec": null, - "fetchSpec": "7.12.10" - }, - "_requiredBy": [ - "/@babel/helper-function-name" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz", - "_spec": "7.12.10", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/types": "^7.12.10" - }, - "description": "Helper function to get function arity", - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "lib/index.js", "name": "@babel/helper-get-function-arity", + "version": "7.10.4", + "description": "Helper function to get function arity", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-get-function-arity" + }, + "license": "MIT", "publishConfig": { "access": "public" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-get-function-arity" + "main": "lib/index.js", + "dependencies": { + "@babel/types": "^7.10.4" }, - "version": "7.12.10" -} + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:17 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-get-function-arity@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-get-function-arity/download/@babel/helper-get-function-arity-7.10.4.tgz?cache=0&sync_timestamp=1593521259643&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-get-function-arity%2Fdownload%2F%40babel%2Fhelper-get-function-arity-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-hoist-variables/package.json b/node_modules/@babel/helper-hoist-variables/package.json index 5ef99a1..7ba65c1 100644 --- a/node_modules/@babel/helper-hoist-variables/package.json +++ b/node_modules/@babel/helper-hoist-variables/package.json @@ -1,53 +1,22 @@ { - "_args": [ - [ - "@babel/helper-hoist-variables@7.10.4", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-hoist-variables@7.10.4", - "_id": "@babel/helper-hoist-variables@7.10.4", - "_inBundle": false, - "_integrity": "sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA==", - "_location": "/@babel/helper-hoist-variables", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-hoist-variables@7.10.4", - "name": "@babel/helper-hoist-variables", - "escapedName": "@babel%2fhelper-hoist-variables", - "scope": "@babel", - "rawSpec": "7.10.4", - "saveSpec": null, - "fetchSpec": "7.10.4" - }, - "_requiredBy": [ - "/@babel/plugin-transform-modules-systemjs" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz", - "_spec": "7.10.4", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/types": "^7.10.4" - }, - "description": "Helper function to hoist variables", - "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "lib/index.js", "name": "@babel/helper-hoist-variables", + "version": "7.10.4", + "description": "Helper function to hoist variables", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-hoist-variables" + }, + "license": "MIT", "publishConfig": { "access": "public" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-hoist-variables" + "main": "lib/index.js", + "dependencies": { + "@babel/types": "^7.10.4" }, - "version": "7.10.4" -} + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:19 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-hoist-variables@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-hoist-variables/download/@babel/helper-hoist-variables-7.10.4.tgz?cache=0&sync_timestamp=1593522962909&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-hoist-variables%2Fdownload%2F%40babel%2Fhelper-hoist-variables-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-member-expression-to-functions/README.md b/node_modules/@babel/helper-member-expression-to-functions/README.md index 01c551d..1e3eb53 100644 --- a/node_modules/@babel/helper-member-expression-to-functions/README.md +++ b/node_modules/@babel/helper-member-expression-to-functions/README.md @@ -2,7 +2,7 @@ > Helper function to replace certain member expressions with function calls -See our website [@babel/helper-member-expression-to-functions](https://babeljs.io/docs/en/babel-helper-member-expression-to-functions) for more information. +See our website [@babel/helper-member-expression-to-functions](https://babeljs.io/docs/en/next/babel-helper-member-expression-to-functions.html) for more information. ## Install diff --git a/node_modules/@babel/helper-member-expression-to-functions/lib/index.js b/node_modules/@babel/helper-member-expression-to-functions/lib/index.js index 827d7a2..1383a92 100644 --- a/node_modules/@babel/helper-member-expression-to-functions/lib/index.js +++ b/node_modules/@babel/helper-member-expression-to-functions/lib/index.js @@ -1,47 +1,15 @@ -'use strict'; +"use strict"; -Object.defineProperty(exports, '__esModule', { value: true }); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = memberExpressionToFunctions; -var t = require('@babel/types'); +var t = _interopRequireWildcard(require("@babel/types")); -function willPathCastToBoolean(path) { - const maybeWrapped = path; - const { - node, - parentPath - } = maybeWrapped; +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - if (parentPath.isLogicalExpression()) { - const { - operator, - right - } = parentPath.node; - - if (operator === "&&" || operator === "||" || operator === "??" && node === right) { - return willPathCastToBoolean(parentPath); - } - } - - if (parentPath.isSequenceExpression()) { - const { - expressions - } = parentPath.node; - - if (expressions[expressions.length - 1] === node) { - return willPathCastToBoolean(parentPath); - } else { - return true; - } - } - - return parentPath.isConditional({ - test: node - }) || parentPath.isUnaryExpression({ - operator: "!" - }) || parentPath.isLoop({ - test: node - }); -} +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } class AssignmentMemoiser { constructor() { @@ -134,8 +102,7 @@ const handle = { const { node, parent, - parentPath, - scope + parentPath } = member; if (member.isOptionalMemberExpression()) { @@ -155,13 +122,6 @@ const handle = { return true; }); - - if (scope.path.isPattern()) { - endPath.replaceWith(t.callExpression(t.arrowFunctionExpression([], endPath.node), [])); - return; - } - - const willEndPathCastToBoolean = willPathCastToBoolean(endPath); const rootParentPath = endPath.parentPath; if (rootParentPath.isUpdateExpression({ @@ -196,6 +156,9 @@ const handle = { throw new Error(`Internal error: unexpected ${startingOptional.node.type}`); } + const { + scope + } = member; const startingProp = startingOptional.isOptionalMemberExpression() ? "object" : "callee"; const startingNode = startingOptional.node[startingProp]; const baseNeedsMemoised = scope.maybeGenerateMemoised(startingNode); @@ -260,13 +223,7 @@ const handle = { regular = endParentPath.node; } - if (willEndPathCastToBoolean) { - const nonNullishCheck = t.logicalExpression("&&", t.binaryExpression("!==", baseNeedsMemoised ? t.assignmentExpression("=", t.cloneNode(baseRef), t.cloneNode(startingNode)) : t.cloneNode(baseRef), t.nullLiteral()), t.binaryExpression("!==", t.cloneNode(baseRef), scope.buildUndefinedNode())); - replacementPath.replaceWith(t.logicalExpression("&&", nonNullishCheck, regular)); - } else { - const nullishCheck = t.logicalExpression("||", t.binaryExpression("===", baseNeedsMemoised ? t.assignmentExpression("=", t.cloneNode(baseRef), t.cloneNode(startingNode)) : t.cloneNode(baseRef), t.nullLiteral()), t.binaryExpression("===", t.cloneNode(baseRef), scope.buildUndefinedNode())); - replacementPath.replaceWith(t.conditionalExpression(nullishCheck, isDeleteOperation ? t.booleanLiteral(true) : scope.buildUndefinedNode(), regular)); - } + replacementPath.replaceWith(t.conditionalExpression(t.logicalExpression("||", t.binaryExpression("===", baseNeedsMemoised ? t.assignmentExpression("=", t.cloneNode(baseRef), t.cloneNode(startingNode)) : t.cloneNode(baseRef), t.nullLiteral()), t.binaryExpression("===", t.cloneNode(baseRef), scope.buildUndefinedNode())), isDeleteOperation ? t.booleanLiteral(true) : scope.buildUndefinedNode(), regular)); if (context) { const endParent = endParentPath.node; @@ -348,11 +305,6 @@ const handle = { if (parentPath.isOptionalCallExpression({ callee: node })) { - if (scope.path.isPattern()) { - parentPath.replaceWith(t.callExpression(t.arrowFunctionExpression([], parentPath.node), [])); - return; - } - parentPath.replaceWith(this.optionalCall(member, parent.arguments)); return; } @@ -376,11 +328,9 @@ const handle = { } }; + function memberExpressionToFunctions(path, visitor, state) { path.traverse(visitor, Object.assign({}, handle, state, { memoiser: new AssignmentMemoiser() })); -} - -exports.default = memberExpressionToFunctions; -//# sourceMappingURL=index.js.map +} \ No newline at end of file diff --git a/node_modules/@babel/helper-member-expression-to-functions/lib/index.js.map b/node_modules/@babel/helper-member-expression-to-functions/lib/index.js.map deleted file mode 100644 index b99b02d..0000000 --- a/node_modules/@babel/helper-member-expression-to-functions/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../src/util.js","../src/index.js"],"sourcesContent":["/**\n * Test if a NodePath will be cast to boolean when evaluated.\n *\n * @example\n * // returns true\n * const nodePathAQDotB = NodePath(\"if (a?.#b) {}\").get(\"test\"); // a?.#b\n * willPathCastToBoolean(nodePathAQDotB)\n * @example\n * // returns false\n * willPathCastToBoolean(NodePath(\"a?.#b\"))\n * @todo Respect transparent expression wrappers\n * @see {@link packages/babel-plugin-proposal-optional-chaining/src/util.js}\n * @param {NodePath} path\n * @returns {boolean}\n */\nexport function willPathCastToBoolean(path: NodePath): boolean {\n const maybeWrapped = path;\n const { node, parentPath } = maybeWrapped;\n if (parentPath.isLogicalExpression()) {\n const { operator, right } = parentPath.node;\n if (\n operator === \"&&\" ||\n operator === \"||\" ||\n (operator === \"??\" && node === right)\n ) {\n return willPathCastToBoolean(parentPath);\n }\n }\n if (parentPath.isSequenceExpression()) {\n const { expressions } = parentPath.node;\n if (expressions[expressions.length - 1] === node) {\n return willPathCastToBoolean(parentPath);\n } else {\n // if it is in the middle of a sequence expression, we don't\n // care the return value so just cast to boolean for smaller\n // output\n return true;\n }\n }\n return (\n parentPath.isConditional({ test: node }) ||\n parentPath.isUnaryExpression({ operator: \"!\" }) ||\n parentPath.isLoop({ test: node })\n );\n}\n","import * as t from \"@babel/types\";\nimport { willPathCastToBoolean } from \"./util.js\";\n\nclass AssignmentMemoiser {\n constructor() {\n this._map = new WeakMap();\n }\n\n has(key) {\n return this._map.has(key);\n }\n\n get(key) {\n if (!this.has(key)) return;\n\n const record = this._map.get(key);\n const { value } = record;\n\n record.count--;\n if (record.count === 0) {\n // The `count` access is the outermost function call (hopefully), so it\n // does the assignment.\n return t.assignmentExpression(\"=\", value, key);\n }\n return value;\n }\n\n set(key, value, count) {\n return this._map.set(key, { count, value });\n }\n}\n\nfunction toNonOptional(path, base) {\n const { node } = path;\n if (path.isOptionalMemberExpression()) {\n return t.memberExpression(base, node.property, node.computed);\n }\n\n if (path.isOptionalCallExpression()) {\n const callee = path.get(\"callee\");\n if (path.node.optional && callee.isOptionalMemberExpression()) {\n const { object } = callee.node;\n const context = path.scope.maybeGenerateMemoised(object) || object;\n callee\n .get(\"object\")\n .replaceWith(t.assignmentExpression(\"=\", context, object));\n\n return t.callExpression(t.memberExpression(base, t.identifier(\"call\")), [\n context,\n ...node.arguments,\n ]);\n }\n\n return t.callExpression(base, node.arguments);\n }\n\n return path.node;\n}\n\n// Determines if the current path is in a detached tree. This can happen when\n// we are iterating on a path, and replace an ancestor with a new node. Babel\n// doesn't always stop traversing the old node tree, and that can cause\n// inconsistencies.\nfunction isInDetachedTree(path) {\n while (path) {\n if (path.isProgram()) break;\n\n const { parentPath, container, listKey } = path;\n const parentNode = parentPath.node;\n if (listKey) {\n if (container !== parentNode[listKey]) return true;\n } else {\n if (container !== parentNode) return true;\n }\n\n path = parentPath;\n }\n\n return false;\n}\n\nconst handle = {\n memoise() {\n // noop.\n },\n\n handle(member) {\n const { node, parent, parentPath, scope } = member;\n\n if (member.isOptionalMemberExpression()) {\n // Transforming optional chaining requires we replace ancestors.\n if (isInDetachedTree(member)) return;\n\n // We're looking for the end of _this_ optional chain, which is actually\n // the \"rightmost\" property access of the chain. This is because\n // everything up to that property access is \"optional\".\n //\n // Let's take the case of `FOO?.BAR.baz?.qux`, with `FOO?.BAR` being our\n // member. The \"end\" to most users would be `qux` property access.\n // Everything up to it could be skipped if it `FOO` were nullish. But\n // actually, we can consider the `baz` access to be the end. So we're\n // looking for the nearest optional chain that is `optional: true`.\n const endPath = member.find(({ node, parent, parentPath }) => {\n if (parentPath.isOptionalMemberExpression()) {\n // We need to check `parent.object` since we could be inside the\n // computed expression of a `bad?.[FOO?.BAR]`. In this case, the\n // endPath is the `FOO?.BAR` member itself.\n return parent.optional || parent.object !== node;\n }\n if (parentPath.isOptionalCallExpression()) {\n // Checking `parent.callee` since we could be in the arguments, eg\n // `bad?.(FOO?.BAR)`.\n // Also skip `FOO?.BAR` in `FOO?.BAR?.()` since we need to transform the optional call to ensure proper this\n return (\n // In FOO?.#BAR?.(), endPath points the optional call expression so we skip FOO?.#BAR\n (node !== member.node && parent.optional) || parent.callee !== node\n );\n }\n return true;\n });\n\n // Replace `function (a, x = a.b?.#c) {}` to `function (a, x = (() => a.b?.#c)() ){}`\n // so the temporary variable can be injected in correct scope\n // This can be further optimized to avoid unecessary IIFE\n if (scope.path.isPattern()) {\n endPath.replaceWith(\n // The injected member will be queued and eventually transformed when visited\n t.callExpression(t.arrowFunctionExpression([], endPath.node), []),\n );\n return;\n }\n\n const willEndPathCastToBoolean = willPathCastToBoolean(endPath);\n\n const rootParentPath = endPath.parentPath;\n if (\n rootParentPath.isUpdateExpression({ argument: node }) ||\n rootParentPath.isAssignmentExpression({ left: node })\n ) {\n throw member.buildCodeFrameError(`can't handle assignment`);\n }\n const isDeleteOperation = rootParentPath.isUnaryExpression({\n operator: \"delete\",\n });\n if (\n isDeleteOperation &&\n endPath.isOptionalMemberExpression() &&\n endPath.get(\"property\").isPrivateName()\n ) {\n // @babel/parser will throw error on `delete obj?.#x`.\n // This error serves as fallback when `delete obj?.#x` is constructed from babel types\n throw member.buildCodeFrameError(\n `can't delete a private class element`,\n );\n }\n\n // Now, we're looking for the start of this optional chain, which is\n // optional to the left of this member.\n //\n // Let's take the case of `foo?.bar?.baz.QUX?.BAM`, with `QUX?.BAM` being\n // our member. The \"start\" to most users would be `foo` object access.\n // But actually, we can consider the `bar` access to be the start. So\n // we're looking for the nearest optional chain that is `optional: true`,\n // which is guaranteed to be somewhere in the object/callee tree.\n let startingOptional = member;\n for (;;) {\n if (startingOptional.isOptionalMemberExpression()) {\n if (startingOptional.node.optional) break;\n startingOptional = startingOptional.get(\"object\");\n continue;\n } else if (startingOptional.isOptionalCallExpression()) {\n if (startingOptional.node.optional) break;\n startingOptional = startingOptional.get(\"callee\");\n continue;\n }\n // prevent infinite loop: unreachable if the AST is well-formed\n throw new Error(\n `Internal error: unexpected ${startingOptional.node.type}`,\n );\n }\n\n const startingProp = startingOptional.isOptionalMemberExpression()\n ? \"object\"\n : \"callee\";\n const startingNode = startingOptional.node[startingProp];\n const baseNeedsMemoised = scope.maybeGenerateMemoised(startingNode);\n const baseRef = baseNeedsMemoised ?? startingNode;\n\n // Compute parentIsOptionalCall before `startingOptional` is replaced\n // as `node` may refer to `startingOptional.node` before replaced.\n const parentIsOptionalCall = parentPath.isOptionalCallExpression({\n callee: node,\n });\n // if parentIsCall is true, it implies that node.extra.parenthesized is always true\n const parentIsCall = parentPath.isCallExpression({ callee: node });\n startingOptional.replaceWith(toNonOptional(startingOptional, baseRef));\n if (parentIsOptionalCall) {\n if (parent.optional) {\n parentPath.replaceWith(this.optionalCall(member, parent.arguments));\n } else {\n parentPath.replaceWith(this.call(member, parent.arguments));\n }\n } else if (parentIsCall) {\n // `(a?.#b)()` to `(a == null ? void 0 : a.#b.bind(a))()`\n member.replaceWith(this.boundGet(member));\n } else {\n member.replaceWith(this.get(member));\n }\n\n let regular = member.node;\n for (let current = member; current !== endPath; ) {\n const { parentPath } = current;\n // skip transforming `Foo.#BAR?.call(FOO)`\n if (parentPath === endPath && parentIsOptionalCall && parent.optional) {\n regular = parentPath.node;\n break;\n }\n regular = toNonOptional(parentPath, regular);\n current = parentPath;\n }\n\n let context;\n const endParentPath = endPath.parentPath;\n if (\n t.isMemberExpression(regular) &&\n endParentPath.isOptionalCallExpression({\n callee: endPath.node,\n optional: true,\n })\n ) {\n const { object } = regular;\n context = member.scope.maybeGenerateMemoised(object);\n if (context) {\n regular.object = t.assignmentExpression(\"=\", context, object);\n }\n }\n\n let replacementPath = endPath;\n if (isDeleteOperation) {\n replacementPath = endParentPath;\n regular = endParentPath.node;\n }\n\n if (willEndPathCastToBoolean) {\n const nonNullishCheck = t.logicalExpression(\n \"&&\",\n t.binaryExpression(\n \"!==\",\n baseNeedsMemoised\n ? t.assignmentExpression(\n \"=\",\n t.cloneNode(baseRef),\n t.cloneNode(startingNode),\n )\n : t.cloneNode(baseRef),\n t.nullLiteral(),\n ),\n t.binaryExpression(\n \"!==\",\n t.cloneNode(baseRef),\n scope.buildUndefinedNode(),\n ),\n );\n replacementPath.replaceWith(\n t.logicalExpression(\"&&\", nonNullishCheck, regular),\n );\n } else {\n // todo: respect assumptions.noDocumentAll when assumptions are implemented\n const nullishCheck = t.logicalExpression(\n \"||\",\n t.binaryExpression(\n \"===\",\n baseNeedsMemoised\n ? t.assignmentExpression(\n \"=\",\n t.cloneNode(baseRef),\n t.cloneNode(startingNode),\n )\n : t.cloneNode(baseRef),\n t.nullLiteral(),\n ),\n t.binaryExpression(\n \"===\",\n t.cloneNode(baseRef),\n scope.buildUndefinedNode(),\n ),\n );\n replacementPath.replaceWith(\n t.conditionalExpression(\n nullishCheck,\n isDeleteOperation\n ? t.booleanLiteral(true)\n : scope.buildUndefinedNode(),\n regular,\n ),\n );\n }\n\n // context and isDeleteOperation can not be both truthy\n if (context) {\n const endParent = endParentPath.node;\n endParentPath.replaceWith(\n t.optionalCallExpression(\n t.optionalMemberExpression(\n endParent.callee,\n t.identifier(\"call\"),\n false,\n true,\n ),\n [t.cloneNode(context), ...endParent.arguments],\n false,\n ),\n );\n }\n\n return;\n }\n\n // MEMBER++ -> _set(MEMBER, (_ref = (+_get(MEMBER))) + 1), _ref\n // ++MEMBER -> _set(MEMBER, (+_get(MEMBER)) + 1)\n if (parentPath.isUpdateExpression({ argument: node })) {\n if (this.simpleSet) {\n member.replaceWith(this.simpleSet(member));\n return;\n }\n\n const { operator, prefix } = parent;\n\n // Give the state handler a chance to memoise the member, since we'll\n // reference it twice. The second access (the set) should do the memo\n // assignment.\n this.memoise(member, 2);\n\n const value = t.binaryExpression(\n operator[0],\n t.unaryExpression(\"+\", this.get(member)),\n t.numericLiteral(1),\n );\n\n if (prefix) {\n parentPath.replaceWith(this.set(member, value));\n } else {\n const { scope } = member;\n const ref = scope.generateUidIdentifierBasedOnNode(node);\n scope.push({ id: ref });\n\n value.left = t.assignmentExpression(\"=\", t.cloneNode(ref), value.left);\n\n parentPath.replaceWith(\n t.sequenceExpression([this.set(member, value), t.cloneNode(ref)]),\n );\n }\n return;\n }\n\n // MEMBER = VALUE -> _set(MEMBER, VALUE)\n // MEMBER += VALUE -> _set(MEMBER, _get(MEMBER) + VALUE)\n // MEMBER ??= VALUE -> _get(MEMBER) ?? _set(MEMBER, VALUE)\n if (parentPath.isAssignmentExpression({ left: node })) {\n if (this.simpleSet) {\n member.replaceWith(this.simpleSet(member));\n return;\n }\n\n const { operator, right: value } = parent;\n\n if (operator === \"=\") {\n parentPath.replaceWith(this.set(member, value));\n } else {\n const operatorTrunc = operator.slice(0, -1);\n if (t.LOGICAL_OPERATORS.includes(operatorTrunc)) {\n // Give the state handler a chance to memoise the member, since we'll\n // reference it twice. The first access (the get) should do the memo\n // assignment.\n this.memoise(member, 1);\n parentPath.replaceWith(\n t.logicalExpression(\n operatorTrunc,\n this.get(member),\n this.set(member, value),\n ),\n );\n } else {\n // Here, the second access (the set) is evaluated first.\n this.memoise(member, 2);\n parentPath.replaceWith(\n this.set(\n member,\n t.binaryExpression(operatorTrunc, this.get(member), value),\n ),\n );\n }\n }\n return;\n }\n\n // MEMBER(ARGS) -> _call(MEMBER, ARGS)\n if (parentPath.isCallExpression({ callee: node })) {\n parentPath.replaceWith(this.call(member, parent.arguments));\n return;\n }\n\n // MEMBER?.(ARGS) -> _optionalCall(MEMBER, ARGS)\n if (parentPath.isOptionalCallExpression({ callee: node })) {\n // Replace `function (a, x = a.b.#c?.()) {}` to `function (a, x = (() => a.b.#c?.())() ){}`\n // so the temporary variable can be injected in correct scope\n // This can be further optimized to avoid unecessary IIFE\n if (scope.path.isPattern()) {\n parentPath.replaceWith(\n // The injected member will be queued and eventually transformed when visited\n t.callExpression(t.arrowFunctionExpression([], parentPath.node), []),\n );\n return;\n }\n parentPath.replaceWith(this.optionalCall(member, parent.arguments));\n return;\n }\n\n // for (MEMBER of ARR)\n // for (MEMBER in ARR)\n // { KEY: MEMBER } = OBJ -> { KEY: _destructureSet(MEMBER) } = OBJ\n // { KEY: MEMBER = _VALUE } = OBJ -> { KEY: _destructureSet(MEMBER) = _VALUE } = OBJ\n // {...MEMBER} -> {..._destructureSet(MEMBER)}\n //\n // [MEMBER] = ARR -> [_destructureSet(MEMBER)] = ARR\n // [MEMBER = _VALUE] = ARR -> [_destructureSet(MEMBER) = _VALUE] = ARR\n // [...MEMBER] -> [..._destructureSet(MEMBER)]\n if (\n // for (MEMBER of ARR)\n // for (MEMBER in ARR)\n parentPath.isForXStatement({ left: node }) ||\n // { KEY: MEMBER } = OBJ\n (parentPath.isObjectProperty({ value: node }) &&\n parentPath.parentPath.isObjectPattern()) ||\n // { KEY: MEMBER = _VALUE } = OBJ\n (parentPath.isAssignmentPattern({ left: node }) &&\n parentPath.parentPath.isObjectProperty({ value: parent }) &&\n parentPath.parentPath.parentPath.isObjectPattern()) ||\n // [MEMBER] = ARR\n parentPath.isArrayPattern() ||\n // [MEMBER = _VALUE] = ARR\n (parentPath.isAssignmentPattern({ left: node }) &&\n parentPath.parentPath.isArrayPattern()) ||\n // {...MEMBER}\n // [...MEMBER]\n parentPath.isRestElement()\n ) {\n member.replaceWith(this.destructureSet(member));\n return;\n }\n\n // MEMBER -> _get(MEMBER)\n member.replaceWith(this.get(member));\n },\n};\n\n// We do not provide a default traversal visitor\n// Instead, caller passes one, and must call `state.handle` on the members\n// it wishes to be transformed.\n// Additionally, the caller must pass in a state object with at least\n// get, set, and call methods.\n// Optionally, a memoise method may be defined on the state, which will be\n// called when the member is a self-referential update.\nexport default function memberExpressionToFunctions(path, visitor, state) {\n path.traverse(visitor, {\n ...handle,\n ...state,\n memoiser: new AssignmentMemoiser(),\n });\n}\n"],"names":["willPathCastToBoolean","path","maybeWrapped","node","parentPath","isLogicalExpression","operator","right","isSequenceExpression","expressions","length","isConditional","test","isUnaryExpression","isLoop","AssignmentMemoiser","constructor","_map","WeakMap","has","key","get","record","value","count","t","set","toNonOptional","base","isOptionalMemberExpression","property","computed","isOptionalCallExpression","callee","optional","object","context","scope","maybeGenerateMemoised","replaceWith","arguments","isInDetachedTree","isProgram","container","listKey","parentNode","handle","memoise","member","parent","endPath","find","isPattern","willEndPathCastToBoolean","rootParentPath","isUpdateExpression","argument","isAssignmentExpression","left","buildCodeFrameError","isDeleteOperation","isPrivateName","startingOptional","Error","type","startingProp","startingNode","baseNeedsMemoised","baseRef","parentIsOptionalCall","parentIsCall","isCallExpression","optionalCall","call","boundGet","regular","current","endParentPath","replacementPath","nonNullishCheck","buildUndefinedNode","nullishCheck","endParent","simpleSet","prefix","ref","generateUidIdentifierBasedOnNode","push","id","operatorTrunc","slice","includes","isForXStatement","isObjectProperty","isObjectPattern","isAssignmentPattern","isArrayPattern","isRestElement","destructureSet","memberExpressionToFunctions","visitor","state","traverse","memoiser"],"mappings":"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"} \ No newline at end of file diff --git a/node_modules/@babel/helper-member-expression-to-functions/package.json b/node_modules/@babel/helper-member-expression-to-functions/package.json index 16f4da2..c95de79 100644 --- a/node_modules/@babel/helper-member-expression-to-functions/package.json +++ b/node_modules/@babel/helper-member-expression-to-functions/package.json @@ -1,57 +1,22 @@ { - "_args": [ - [ - "@babel/helper-member-expression-to-functions@7.12.7", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-member-expression-to-functions@7.12.7", - "_id": "@babel/helper-member-expression-to-functions@7.12.7", - "_inBundle": false, - "_integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==", - "_location": "/@babel/helper-member-expression-to-functions", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-member-expression-to-functions@7.12.7", - "name": "@babel/helper-member-expression-to-functions", - "escapedName": "@babel%2fhelper-member-expression-to-functions", - "scope": "@babel", - "rawSpec": "7.12.7", - "saveSpec": null, - "fetchSpec": "7.12.7" - }, - "_requiredBy": [ - "/@babel/helper-create-class-features-plugin", - "/@babel/helper-replace-supers" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz", - "_spec": "7.12.7", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Justin Ridgewell", - "email": "justin@ridgewell.name" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/types": "^7.12.7" - }, - "description": "Helper function to replace certain member expressions with function calls", - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "lib/index.js", "name": "@babel/helper-member-expression-to-functions", + "version": "7.11.0", + "description": "Helper function to replace certain member expressions with function calls", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-member-expression-to-functions" + }, + "license": "MIT", "publishConfig": { "access": "public" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-member-expression-to-functions" + "main": "lib/index.js", + "author": "Justin Ridgewell ", + "dependencies": { + "@babel/types": "^7.11.0" }, - "version": "7.12.7" -} + "__npminstall_done": "Sun Sep 06 2020 16:10:16 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-member-expression-to-functions@7.11.0", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-member-expression-to-functions/download/@babel/helper-member-expression-to-functions-7.11.0.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-imports/README.md b/node_modules/@babel/helper-module-imports/README.md index dfc0bb8..c1b21e6 100644 --- a/node_modules/@babel/helper-module-imports/README.md +++ b/node_modules/@babel/helper-module-imports/README.md @@ -2,7 +2,7 @@ > Babel helper functions for inserting module loads -See our website [@babel/helper-module-imports](https://babeljs.io/docs/en/babel-helper-module-imports) for more information. +See our website [@babel/helper-module-imports](https://babeljs.io/docs/en/next/babel-helper-module-imports.html) for more information. ## Install diff --git a/node_modules/@babel/helper-module-imports/package.json b/node_modules/@babel/helper-module-imports/package.json index 36493ad..217b15f 100644 --- a/node_modules/@babel/helper-module-imports/package.json +++ b/node_modules/@babel/helper-module-imports/package.json @@ -1,62 +1,27 @@ { - "_args": [ - [ - "@babel/helper-module-imports@7.12.5", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-module-imports@7.12.5", - "_id": "@babel/helper-module-imports@7.12.5", - "_inBundle": false, - "_integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", - "_location": "/@babel/helper-module-imports", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-module-imports@7.12.5", - "name": "@babel/helper-module-imports", - "escapedName": "@babel%2fhelper-module-imports", - "scope": "@babel", - "rawSpec": "7.12.5", - "saveSpec": null, - "fetchSpec": "7.12.5" - }, - "_requiredBy": [ - "/@babel/helper-module-transforms", - "/@babel/plugin-transform-async-to-generator", - "/@babel/preset-env", - "/@rollup/plugin-babel" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", - "_spec": "7.12.5", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Logan Smyth", - "email": "loganfsmyth@gmail.com" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/types": "^7.12.5" - }, + "name": "@babel/helper-module-imports", + "version": "7.10.4", "description": "Babel helper functions for inserting module loads", - "devDependencies": { - "@babel/core": "7.12.3" - }, + "author": "Logan Smyth ", "homepage": "https://babeljs.io/", "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helper-module-imports", "publishConfig": { "access": "public" }, "repository": { "type": "git", - "url": "git+https://github.com/babel/babel.git", + "url": "https://github.com/babel/babel.git", "directory": "packages/babel-helper-module-imports" }, - "version": "7.12.5" -} + "main": "lib/index.js", + "dependencies": { + "@babel/types": "^7.10.4" + }, + "devDependencies": { + "@babel/core": "^7.10.4" + }, + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:16 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-module-imports@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-module-imports/download/@babel/helper-module-imports-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/lib/index.js b/node_modules/@babel/helper-module-transforms/lib/index.js index 0ff2249..c32bdea 100644 --- a/node_modules/@babel/helper-module-transforms/lib/index.js +++ b/node_modules/@babel/helper-module-transforms/lib/index.js @@ -182,49 +182,26 @@ function buildNamespaceInitStatements(metadata, sourceMetadata, loose = false) { return statements; } -const ReexportTemplate = { - loose: _template.default.statement`EXPORTS.EXPORT_NAME = NAMESPACE_IMPORT;`, - looseComputed: _template.default.statement`EXPORTS["EXPORT_NAME"] = NAMESPACE_IMPORT;`, - spec: (0, _template.default)` - Object.defineProperty(EXPORTS, "EXPORT_NAME", { - enumerable: true, - get: function() { - return NAMESPACE_IMPORT; - }, - }); - ` +const getTemplateForReexport = loose => { + return loose ? _template.default.statement`EXPORTS.EXPORT_NAME = NAMESPACE.IMPORT_NAME;` : (0, _template.default)` + Object.defineProperty(EXPORTS, "EXPORT_NAME", { + enumerable: true, + get: function() { + return NAMESPACE.IMPORT_NAME; + }, + }); + `; }; const buildReexportsFromMeta = (meta, metadata, loose) => { const namespace = metadata.lazy ? t.callExpression(t.identifier(metadata.name), []) : t.identifier(metadata.name); - const { - stringSpecifiers - } = meta; - return Array.from(metadata.reexports, ([exportName, importName]) => { - let NAMESPACE_IMPORT; - - if (stringSpecifiers.has(importName)) { - NAMESPACE_IMPORT = t.memberExpression(t.cloneNode(namespace), t.stringLiteral(importName), true); - } else { - NAMESPACE_IMPORT = NAMESPACE_IMPORT = t.memberExpression(t.cloneNode(namespace), t.identifier(importName)); - } - - const astNodes = { - EXPORTS: meta.exportName, - EXPORT_NAME: exportName, - NAMESPACE_IMPORT - }; - - if (loose) { - if (stringSpecifiers.has(exportName)) { - return ReexportTemplate.looseComputed(astNodes); - } else { - return ReexportTemplate.loose(astNodes); - } - } else { - return ReexportTemplate.spec(astNodes); - } - }); + const templateForCurrentMode = getTemplateForReexport(loose); + return Array.from(metadata.reexports, ([exportName, importName]) => templateForCurrentMode({ + EXPORTS: meta.exportName, + EXPORT_NAME: exportName, + NAMESPACE: t.cloneNode(namespace), + IMPORT_NAME: importName + })); }; function buildESModuleHeader(metadata, enumerable = false) { @@ -244,7 +221,6 @@ function buildNamespaceReexport(metadata, namespace, loose) { Object.keys(NAMESPACE).forEach(function(key) { if (key === "default" || key === "__esModule") return; VERIFY_NAME_LIST; - if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return; EXPORTS[key] = NAMESPACE[key]; }); @@ -252,7 +228,6 @@ function buildNamespaceReexport(metadata, namespace, loose) { Object.keys(NAMESPACE).forEach(function(key) { if (key === "default" || key === "__esModule") return; VERIFY_NAME_LIST; - if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return; Object.defineProperty(EXPORTS, key, { enumerable: true, @@ -332,27 +307,10 @@ function buildExportInitializationStatements(programPath, metadata, loose = fals return initStatements; } -const InitTemplate = { - computed: _template.default.expression`EXPORTS["NAME"] = VALUE`, - default: _template.default.expression`EXPORTS.NAME = VALUE` -}; - function buildInitStatement(metadata, exportNames, initExpr) { - const { - stringSpecifiers, - exportName: EXPORTS - } = metadata; - return t.expressionStatement(exportNames.reduce((acc, exportName) => { - const params = { - EXPORTS, - NAME: exportName, - VALUE: acc - }; - - if (stringSpecifiers.has(exportName)) { - return InitTemplate.computed(params); - } else { - return InitTemplate.default(params); - } - }, initExpr)); + return t.expressionStatement(exportNames.reduce((acc, exportName) => _template.default.expression`EXPORTS.NAME = VALUE`({ + EXPORTS: metadata.exportName, + NAME: exportName, + VALUE: acc + }), initExpr)); } \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js b/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js index d57c16d..dde24b6 100644 --- a/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js +++ b/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js @@ -9,8 +9,6 @@ exports.default = normalizeModuleAndLoadMetadata; var _path = require("path"); -var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); - var _helperSplitExportDeclaration = _interopRequireDefault(require("@babel/helper-split-export-declaration")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -33,7 +31,6 @@ function normalizeModuleAndLoadMetadata(programPath, exportName, { exportName = programPath.scope.generateUidIdentifier("exports").name; } - const stringSpecifiers = new Set(); nameAnonymousExports(programPath); const { local, @@ -42,7 +39,7 @@ function normalizeModuleAndLoadMetadata(programPath, exportName, { } = getModuleMetadata(programPath, { loose, lazy - }, stringSpecifiers); + }); removeModuleDeclarations(programPath); for (const [, metadata] of source) { @@ -62,32 +59,15 @@ function normalizeModuleAndLoadMetadata(programPath, exportName, { exportNameListName: null, hasExports, local, - source, - stringSpecifiers + source }; } -function getExportSpecifierName(path, stringSpecifiers) { - if (path.isIdentifier()) { - return path.node.name; - } else if (path.isStringLiteral()) { - const stringValue = path.node.value; - - if (!(0, _helperValidatorIdentifier.isIdentifierName)(stringValue)) { - stringSpecifiers.add(stringValue); - } - - return stringValue; - } else { - throw new Error(`Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`); - } -} - function getModuleMetadata(programPath, { loose, lazy -}, stringSpecifiers) { - const localData = getLocalExportMetadata(programPath, loose, stringSpecifiers); +}) { + const localData = getLocalExportMetadata(programPath, loose); const sourceData = new Map(); const getData = sourceNode => { @@ -141,7 +121,7 @@ function getModuleMetadata(programPath, { }); } } else if (spec.isImportSpecifier()) { - const importName = getExportSpecifierName(spec.get("imported"), stringSpecifiers); + const importName = spec.get("imported").node.name; const localName = spec.get("local").node.name; data.imports.set(localName, importName); const reexport = localData.get(localName); @@ -170,8 +150,8 @@ function getModuleMetadata(programPath, { throw spec.buildCodeFrameError("Unexpected export specifier type"); } - const importName = getExportSpecifierName(spec.get("local"), stringSpecifiers); - const exportName = getExportSpecifierName(spec.get("exported"), stringSpecifiers); + const importName = spec.get("local").node.name; + const exportName = spec.get("exported").node.name; data.reexports.set(exportName, importName); if (exportName === "__esModule") { @@ -232,7 +212,7 @@ function getModuleMetadata(programPath, { }; } -function getLocalExportMetadata(programPath, loose, stringSpecifiers) { +function getLocalExportMetadata(programPath, loose) { const bindingKindLookup = new Map(); programPath.get("body").forEach(child => { let kind; @@ -311,14 +291,12 @@ function getLocalExportMetadata(programPath, loose, stringSpecifiers) { child.get("specifiers").forEach(spec => { const local = spec.get("local"); const exported = spec.get("exported"); - const localMetadata = getLocalMetadata(local); - const exportName = getExportSpecifierName(exported, stringSpecifiers); - if (exportName === "__esModule") { + if (exported.node.name === "__esModule") { throw exported.buildCodeFrameError('Illegal export "__esModule".'); } - localMetadata.names.push(exportName); + getLocalMetadata(local).names.push(exported.node.name); }); } } else if (child.isExportDefaultDeclaration()) { diff --git a/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js b/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js index b0ebe01..d148b35 100644 --- a/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js +++ b/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js @@ -72,8 +72,7 @@ function rewriteLiveReferences(programPath, metadata) { let namespace = t.identifier(meta.name); if (meta.lazy) namespace = t.callExpression(namespace, []); - const computed = metadata.stringSpecifiers.has(importName); - return t.memberExpression(namespace, computed ? t.stringLiteral(importName) : t.identifier(importName), computed); + return t.memberExpression(namespace, t.identifier(importName)); } }); } @@ -124,11 +123,7 @@ const rewriteBindingInitVisitor = { const buildBindingExportAssignmentExpression = (metadata, exportNames, localExpr) => { return (exportNames || []).reduce((expr, exportName) => { - const { - stringSpecifiers - } = metadata; - const computed = stringSpecifiers.has(exportName); - return t.assignmentExpression("=", t.memberExpression(t.identifier(metadata.exportName), computed ? t.stringLiteral(exportName) : t.identifier(exportName), computed), expr); + return t.assignmentExpression("=", t.memberExpression(t.identifier(metadata.exportName), t.identifier(exportName)), expr); }, localExpr); }; diff --git a/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js b/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js index 8a7042f..3743957 100644 --- a/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js +++ b/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js @@ -7,25 +7,25 @@ exports.default = rewriteThis; var _helperReplaceSupers = require("@babel/helper-replace-supers"); -var _traverse = _interopRequireDefault(require("@babel/traverse")); - -var t = _interopRequireWildcard(require("@babel/types")); - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function rewriteThis(programPath) { - (0, _traverse.default)(programPath.node, Object.assign({}, rewriteThisVisitor, { - noScope: true - })); + programPath.traverse(rewriteThisVisitor); } -const rewriteThisVisitor = _traverse.default.visitors.merge([_helperReplaceSupers.environmentVisitor, { +const rewriteThisVisitor = { ThisExpression(path) { - path.replaceWith(t.unaryExpression("void", t.numericLiteral(0), true)); + path.replaceWith(path.scope.buildUndefinedNode()); + }, + + Function(path) { + if (path.isMethod()) (0, _helperReplaceSupers.skipAllButComputedKey)(path);else if (!path.isArrowFunctionExpression()) path.skip(); + }, + + ClassProperty(path) { + (0, _helperReplaceSupers.skipAllButComputedKey)(path); + }, + + ClassPrivateProperty(path) { + path.skip(); } -}]); \ No newline at end of file +}; \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/package.json b/node_modules/@babel/helper-module-transforms/package.json index 29295e8..24d8bea 100644 --- a/node_modules/@babel/helper-module-transforms/package.json +++ b/node_modules/@babel/helper-module-transforms/package.json @@ -1,68 +1,29 @@ { - "_args": [ - [ - "@babel/helper-module-transforms@7.12.1", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-module-transforms@7.12.1", - "_id": "@babel/helper-module-transforms@7.12.1", - "_inBundle": false, - "_integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", - "_location": "/@babel/helper-module-transforms", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-module-transforms@7.12.1", - "name": "@babel/helper-module-transforms", - "escapedName": "@babel%2fhelper-module-transforms", - "scope": "@babel", - "rawSpec": "7.12.1", - "saveSpec": null, - "fetchSpec": "7.12.1" - }, - "_requiredBy": [ - "/@babel/core", - "/@babel/plugin-transform-modules-amd", - "/@babel/plugin-transform-modules-commonjs", - "/@babel/plugin-transform-modules-systemjs", - "/@babel/plugin-transform-modules-umd" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", - "_spec": "7.12.1", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Logan Smyth", - "email": "loganfsmyth@gmail.com" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/helper-module-imports": "^7.12.1", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-simple-access": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/helper-validator-identifier": "^7.10.4", - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1", - "lodash": "^4.17.19" - }, + "name": "@babel/helper-module-transforms", + "version": "7.11.0", "description": "Babel helper functions for implementing ES6 module transformations", + "author": "Logan Smyth ", "homepage": "https://babeljs.io/", "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helper-module-transforms", "publishConfig": { "access": "public" }, "repository": { "type": "git", - "url": "git+https://github.com/babel/babel.git", + "url": "https://github.com/babel/babel.git", "directory": "packages/babel-helper-module-transforms" }, - "version": "7.12.1" -} + "main": "lib/index.js", + "dependencies": { + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/template": "^7.10.4", + "@babel/types": "^7.11.0", + "lodash": "^4.17.19" + }, + "__npminstall_done": "Sun Sep 06 2020 16:10:18 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-module-transforms@7.11.0", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-module-transforms/download/@babel/helper-module-transforms-7.11.0.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-optimise-call-expression/README.md b/node_modules/@babel/helper-optimise-call-expression/README.md index 3fdbc9b..b232ac9 100644 --- a/node_modules/@babel/helper-optimise-call-expression/README.md +++ b/node_modules/@babel/helper-optimise-call-expression/README.md @@ -2,7 +2,7 @@ > Helper function to optimise call expression -See our website [@babel/helper-optimise-call-expression](https://babeljs.io/docs/en/babel-helper-optimise-call-expression) for more information. +See our website [@babel/helper-optimise-call-expression](https://babeljs.io/docs/en/next/babel-helper-optimise-call-expression.html) for more information. ## Install diff --git a/node_modules/@babel/helper-optimise-call-expression/lib/index.js b/node_modules/@babel/helper-optimise-call-expression/lib/index.js index 0751eb3..4e8dd60 100644 --- a/node_modules/@babel/helper-optimise-call-expression/lib/index.js +++ b/node_modules/@babel/helper-optimise-call-expression/lib/index.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = optimiseCallExpression; +exports.default = _default; var t = _interopRequireWildcard(require("@babel/types")); @@ -11,14 +11,10 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function optimiseCallExpression(callee, thisNode, args, optional) { +function _default(callee, thisNode, args, optional) { if (args.length === 1 && t.isSpreadElement(args[0]) && t.isIdentifier(args[0].argument, { name: "arguments" })) { - if (optional) { - return t.optionalCallExpression(t.optionalMemberExpression(callee, t.identifier("apply"), false, true), [thisNode, args[0].argument], false); - } - return t.callExpression(t.memberExpression(callee, t.identifier("apply")), [thisNode, args[0].argument]); } else { if (optional) { diff --git a/node_modules/@babel/helper-optimise-call-expression/package.json b/node_modules/@babel/helper-optimise-call-expression/package.json index 466748c..e85ada7 100644 --- a/node_modules/@babel/helper-optimise-call-expression/package.json +++ b/node_modules/@babel/helper-optimise-call-expression/package.json @@ -1,58 +1,22 @@ { - "_args": [ - [ - "@babel/helper-optimise-call-expression@7.12.10", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-optimise-call-expression@7.12.10", - "_id": "@babel/helper-optimise-call-expression@7.12.10", - "_inBundle": false, - "_integrity": "sha512-4tpbU0SrSTjjt65UMWSrUOPZTsgvPgGG4S8QSTNHacKzpS51IVWGDj0yCwyeZND/i+LSN2g/O63jEXEWm49sYQ==", - "_location": "/@babel/helper-optimise-call-expression", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-optimise-call-expression@7.12.10", - "name": "@babel/helper-optimise-call-expression", - "escapedName": "@babel%2fhelper-optimise-call-expression", - "scope": "@babel", - "rawSpec": "7.12.10", - "saveSpec": null, - "fetchSpec": "7.12.10" - }, - "_requiredBy": [ - "/@babel/helper-create-class-features-plugin", - "/@babel/helper-replace-supers", - "/@babel/plugin-transform-classes" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.10.tgz", - "_spec": "7.12.10", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/types": "^7.12.10" - }, - "description": "Helper function to optimise call expression", - "devDependencies": { - "@babel/generator": "7.12.10", - "@babel/parser": "7.12.10" - }, - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "lib/index.js", "name": "@babel/helper-optimise-call-expression", + "version": "7.10.4", + "description": "Helper function to optimise call expression", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-optimise-call-expression" + }, + "license": "MIT", "publishConfig": { "access": "public" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-optimise-call-expression" + "main": "lib/index.js", + "dependencies": { + "@babel/types": "^7.10.4" }, - "version": "7.12.10" -} + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:16 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-optimise-call-expression@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-optimise-call-expression/download/@babel/helper-optimise-call-expression-7.10.4.tgz?cache=0&sync_timestamp=1593521261797&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-optimise-call-expression%2Fdownload%2F%40babel%2Fhelper-optimise-call-expression-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-plugin-utils/package.json b/node_modules/@babel/helper-plugin-utils/package.json index 42a9247..dd3f4c0 100644 --- a/node_modules/@babel/helper-plugin-utils/package.json +++ b/node_modules/@babel/helper-plugin-utils/package.json @@ -1,113 +1,21 @@ { - "_args": [ - [ - "@babel/helper-plugin-utils@7.10.4", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-plugin-utils@7.10.4", - "_id": "@babel/helper-plugin-utils@7.10.4", - "_inBundle": false, - "_integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", - "_location": "/@babel/helper-plugin-utils", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-plugin-utils@7.10.4", - "name": "@babel/helper-plugin-utils", - "escapedName": "@babel%2fhelper-plugin-utils", - "scope": "@babel", - "rawSpec": "7.10.4", - "saveSpec": null, - "fetchSpec": "7.10.4" - }, - "_requiredBy": [ - "/@babel/plugin-proposal-async-generator-functions", - "/@babel/plugin-proposal-class-properties", - "/@babel/plugin-proposal-dynamic-import", - "/@babel/plugin-proposal-export-namespace-from", - "/@babel/plugin-proposal-json-strings", - "/@babel/plugin-proposal-logical-assignment-operators", - "/@babel/plugin-proposal-nullish-coalescing-operator", - "/@babel/plugin-proposal-numeric-separator", - "/@babel/plugin-proposal-object-rest-spread", - "/@babel/plugin-proposal-optional-catch-binding", - "/@babel/plugin-proposal-optional-chaining", - "/@babel/plugin-proposal-private-methods", - "/@babel/plugin-proposal-unicode-property-regex", - "/@babel/plugin-syntax-async-generators", - "/@babel/plugin-syntax-class-properties", - "/@babel/plugin-syntax-dynamic-import", - "/@babel/plugin-syntax-export-namespace-from", - "/@babel/plugin-syntax-json-strings", - "/@babel/plugin-syntax-logical-assignment-operators", - "/@babel/plugin-syntax-nullish-coalescing-operator", - "/@babel/plugin-syntax-numeric-separator", - "/@babel/plugin-syntax-object-rest-spread", - "/@babel/plugin-syntax-optional-catch-binding", - "/@babel/plugin-syntax-optional-chaining", - "/@babel/plugin-syntax-top-level-await", - "/@babel/plugin-syntax-typescript", - "/@babel/plugin-transform-arrow-functions", - "/@babel/plugin-transform-async-to-generator", - "/@babel/plugin-transform-block-scoped-functions", - "/@babel/plugin-transform-block-scoping", - "/@babel/plugin-transform-classes", - "/@babel/plugin-transform-computed-properties", - "/@babel/plugin-transform-destructuring", - "/@babel/plugin-transform-dotall-regex", - "/@babel/plugin-transform-duplicate-keys", - "/@babel/plugin-transform-exponentiation-operator", - "/@babel/plugin-transform-for-of", - "/@babel/plugin-transform-function-name", - "/@babel/plugin-transform-literals", - "/@babel/plugin-transform-member-expression-literals", - "/@babel/plugin-transform-modules-amd", - "/@babel/plugin-transform-modules-commonjs", - "/@babel/plugin-transform-modules-systemjs", - "/@babel/plugin-transform-modules-umd", - "/@babel/plugin-transform-new-target", - "/@babel/plugin-transform-object-super", - "/@babel/plugin-transform-parameters", - "/@babel/plugin-transform-property-literals", - "/@babel/plugin-transform-reserved-words", - "/@babel/plugin-transform-shorthand-properties", - "/@babel/plugin-transform-spread", - "/@babel/plugin-transform-sticky-regex", - "/@babel/plugin-transform-template-literals", - "/@babel/plugin-transform-typeof-symbol", - "/@babel/plugin-transform-typescript", - "/@babel/plugin-transform-unicode-escapes", - "/@babel/plugin-transform-unicode-regex", - "/@babel/preset-env", - "/@babel/preset-modules", - "/@babel/preset-typescript" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", - "_spec": "7.10.4", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Logan Smyth", - "email": "loganfsmyth@gmail.com" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, + "name": "@babel/helper-plugin-utils", + "version": "7.10.4", "description": "General utilities for plugins to use", - "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "author": "Logan Smyth ", "homepage": "https://babeljs.io/", "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helper-plugin-utils", "publishConfig": { "access": "public" }, "repository": { "type": "git", - "url": "git+https://github.com/babel/babel.git", + "url": "https://github.com/babel/babel.git", "directory": "packages/babel-helper-plugin-utils" }, - "version": "7.10.4" -} + "main": "lib/index.js", + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:16 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-plugin-utils@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-plugin-utils/download/@babel/helper-plugin-utils-7.10.4.tgz?cache=0&sync_timestamp=1593521123680&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-plugin-utils%2Fdownload%2F%40babel%2Fhelper-plugin-utils-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-remap-async-to-generator/package.json b/node_modules/@babel/helper-remap-async-to-generator/package.json index 05ebd1c..91a0c54 100644 --- a/node_modules/@babel/helper-remap-async-to-generator/package.json +++ b/node_modules/@babel/helper-remap-async-to-generator/package.json @@ -1,58 +1,28 @@ { - "_args": [ - [ - "@babel/helper-remap-async-to-generator@7.12.1", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-remap-async-to-generator@7.12.1", - "_id": "@babel/helper-remap-async-to-generator@7.12.1", - "_inBundle": false, - "_integrity": "sha512-9d0KQCRM8clMPcDwo8SevNs+/9a8yWVVmaE80FGJcEP8N1qToREmWEGnBn8BUlJhYRFz6fqxeRL1sl5Ogsed7A==", - "_location": "/@babel/helper-remap-async-to-generator", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-remap-async-to-generator@7.12.1", - "name": "@babel/helper-remap-async-to-generator", - "escapedName": "@babel%2fhelper-remap-async-to-generator", - "scope": "@babel", - "rawSpec": "7.12.1", - "saveSpec": null, - "fetchSpec": "7.12.1" - }, - "_requiredBy": [ - "/@babel/plugin-proposal-async-generator-functions", - "/@babel/plugin-transform-async-to-generator" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.12.1.tgz", - "_spec": "7.12.1", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.10.4", - "@babel/helper-wrap-function": "^7.10.4", - "@babel/types": "^7.12.1" - }, - "description": "Helper function to remap async functions to generators", - "devDependencies": { - "@babel/traverse": "^7.12.1" - }, - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "lib/index.js", "name": "@babel/helper-remap-async-to-generator", + "version": "7.11.4", + "description": "Helper function to remap async functions to generators", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-remap-async-to-generator" + }, + "license": "MIT", "publishConfig": { "access": "public" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-remap-async-to-generator" + "main": "lib/index.js", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.10.4", + "@babel/helper-wrap-function": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" }, - "version": "7.12.1" -} + "devDependencies": { + "@babel/traverse": "^7.10.4" + }, + "gitHead": "90b198956995195ea00e7ac9912c2260e44d8746", + "__npminstall_done": "Sun Sep 06 2020 16:10:17 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-remap-async-to-generator@7.11.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-remap-async-to-generator/download/@babel/helper-remap-async-to-generator-7.11.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-remap-async-to-generator%2Fdownload%2F%40babel%2Fhelper-remap-async-to-generator-7.11.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-replace-supers/README.md b/node_modules/@babel/helper-replace-supers/README.md index 774e0fa..60ec4cc 100644 --- a/node_modules/@babel/helper-replace-supers/README.md +++ b/node_modules/@babel/helper-replace-supers/README.md @@ -2,7 +2,7 @@ > Helper function to replace supers -See our website [@babel/helper-replace-supers](https://babeljs.io/docs/en/babel-helper-replace-supers) for more information. +See our website [@babel/helper-replace-supers](https://babeljs.io/docs/en/next/babel-helper-replace-supers.html) for more information. ## Install diff --git a/node_modules/@babel/helper-replace-supers/lib/index.js b/node_modules/@babel/helper-replace-supers/lib/index.js index f08da16..105821d 100644 --- a/node_modules/@babel/helper-replace-supers/lib/index.js +++ b/node_modules/@babel/helper-replace-supers/lib/index.js @@ -40,7 +40,7 @@ function skipAllButComputedKey(path) { } const environmentVisitor = { - [`${t.staticBlock ? "StaticBlock|" : ""}ClassPrivateProperty|TypeAnnotation`](path) { + TypeAnnotation(path) { path.skip(); }, @@ -50,7 +50,7 @@ const environmentVisitor = { path.skip(); }, - "Method|ClassProperty"(path) { + "Method|ClassProperty|ClassPrivateProperty"(path) { skipAllButComputedKey(path); } @@ -150,12 +150,6 @@ const specHandlers = { const thisRefs = this._getThisRefs(); return (0, _helperOptimiseCallExpression.default)(this._get(superMember, thisRefs), t.cloneNode(thisRefs.this), args, false); - }, - - optionalCall(superMember, args) { - const thisRefs = this._getThisRefs(); - - return (0, _helperOptimiseCallExpression.default)(this._get(superMember, thisRefs), t.cloneNode(thisRefs.this), args, true); } }; @@ -210,10 +204,6 @@ const looseHandlers = Object.assign({}, specHandlers, { call(superMember, args) { return (0, _helperOptimiseCallExpression.default)(this.get(superMember), t.thisExpression(), args, false); - }, - - optionalCall(superMember, args) { - return (0, _helperOptimiseCallExpression.default)(this.get(superMember), t.thisExpression(), args, true); } }); diff --git a/node_modules/@babel/helper-replace-supers/package.json b/node_modules/@babel/helper-replace-supers/package.json index d1d7a95..f66cfca 100644 --- a/node_modules/@babel/helper-replace-supers/package.json +++ b/node_modules/@babel/helper-replace-supers/package.json @@ -1,58 +1,25 @@ { - "_args": [ - [ - "@babel/helper-replace-supers@7.12.11", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-replace-supers@7.12.11", - "_id": "@babel/helper-replace-supers@7.12.11", - "_inBundle": false, - "_integrity": "sha512-q+w1cqmhL7R0FNzth/PLLp2N+scXEK/L2AHbXUyydxp828F4FEa5WcVoqui9vFRiHDQErj9Zof8azP32uGVTRA==", - "_location": "/@babel/helper-replace-supers", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-replace-supers@7.12.11", - "name": "@babel/helper-replace-supers", - "escapedName": "@babel%2fhelper-replace-supers", - "scope": "@babel", - "rawSpec": "7.12.11", - "saveSpec": null, - "fetchSpec": "7.12.11" - }, - "_requiredBy": [ - "/@babel/helper-create-class-features-plugin", - "/@babel/helper-module-transforms", - "/@babel/plugin-transform-classes", - "/@babel/plugin-transform-object-super" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.11.tgz", - "_spec": "7.12.11", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.12.7", - "@babel/helper-optimise-call-expression": "^7.12.10", - "@babel/traverse": "^7.12.10", - "@babel/types": "^7.12.11" - }, - "description": "Helper function to replace supers", - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "lib/index.js", "name": "@babel/helper-replace-supers", + "version": "7.10.4", + "description": "Helper function to replace supers", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-replace-supers" + }, + "license": "MIT", "publishConfig": { "access": "public" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-replace-supers" + "main": "lib/index.js", + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" }, - "version": "7.12.11" -} + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:16 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-replace-supers@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-replace-supers/download/@babel/helper-replace-supers-7.10.4.tgz?cache=0&sync_timestamp=1593522959591&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-replace-supers%2Fdownload%2F%40babel%2Fhelper-replace-supers-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-simple-access/package.json b/node_modules/@babel/helper-simple-access/package.json index a1cfde1..fb17d08 100644 --- a/node_modules/@babel/helper-simple-access/package.json +++ b/node_modules/@babel/helper-simple-access/package.json @@ -1,57 +1,25 @@ { - "_args": [ - [ - "@babel/helper-simple-access@7.12.1", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-simple-access@7.12.1", - "_id": "@babel/helper-simple-access@7.12.1", - "_inBundle": false, - "_integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", - "_location": "/@babel/helper-simple-access", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-simple-access@7.12.1", - "name": "@babel/helper-simple-access", - "escapedName": "@babel%2fhelper-simple-access", - "scope": "@babel", - "rawSpec": "7.12.1", - "saveSpec": null, - "fetchSpec": "7.12.1" - }, - "_requiredBy": [ - "/@babel/helper-module-transforms", - "/@babel/plugin-transform-modules-commonjs" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", - "_spec": "7.12.1", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Logan Smyth", - "email": "loganfsmyth@gmail.com" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/types": "^7.12.1" - }, + "name": "@babel/helper-simple-access", + "version": "7.10.4", "description": "Babel helper for ensuring that access to a given value is performed through simple accesses", + "author": "Logan Smyth ", "homepage": "https://babeljs.io/", "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helper-simple-access", "publishConfig": { "access": "public" }, "repository": { "type": "git", - "url": "git+https://github.com/babel/babel.git", + "url": "https://github.com/babel/babel.git", "directory": "packages/babel-helper-simple-access" }, - "version": "7.12.1" -} + "main": "lib/index.js", + "dependencies": { + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + }, + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:18 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-simple-access@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-simple-access/download/@babel/helper-simple-access-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-skip-transparent-expression-wrappers/package.json b/node_modules/@babel/helper-skip-transparent-expression-wrappers/package.json index 7d964a1..e3ff188 100644 --- a/node_modules/@babel/helper-skip-transparent-expression-wrappers/package.json +++ b/node_modules/@babel/helper-skip-transparent-expression-wrappers/package.json @@ -1,60 +1,28 @@ { - "_args": [ - [ - "@babel/helper-skip-transparent-expression-wrappers@7.12.1", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-skip-transparent-expression-wrappers@7.12.1", - "_id": "@babel/helper-skip-transparent-expression-wrappers@7.12.1", - "_inBundle": false, - "_integrity": "sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA==", - "_location": "/@babel/helper-skip-transparent-expression-wrappers", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-skip-transparent-expression-wrappers@7.12.1", - "name": "@babel/helper-skip-transparent-expression-wrappers", - "escapedName": "@babel%2fhelper-skip-transparent-expression-wrappers", - "scope": "@babel", - "rawSpec": "7.12.1", - "saveSpec": null, - "fetchSpec": "7.12.1" - }, - "_requiredBy": [ - "/@babel/plugin-proposal-optional-chaining", - "/@babel/plugin-transform-spread" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz", - "_spec": "7.12.1", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/types": "^7.12.1" - }, + "name": "@babel/helper-skip-transparent-expression-wrappers", + "version": "7.11.0", "description": "Helper which skips types and parentheses", - "devDependencies": { - "@babel/traverse": "^7.12.1" + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-skip-transparent-expression-wrappers" }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", "exports": { ".": "./lib/index.js", "./package.json": "./package.json" }, - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "./lib/index.js", - "name": "@babel/helper-skip-transparent-expression-wrappers", - "publishConfig": { - "access": "public" + "dependencies": { + "@babel/types": "^7.11.0" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-skip-transparent-expression-wrappers" + "devDependencies": { + "@babel/traverse": "^7.11.0" }, - "version": "7.12.1" -} + "__npminstall_done": "Sun Sep 06 2020 16:10:18 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-skip-transparent-expression-wrappers@7.11.0", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-skip-transparent-expression-wrappers/download/@babel/helper-skip-transparent-expression-wrappers-7.11.0.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-split-export-declaration/README.md b/node_modules/@babel/helper-split-export-declaration/README.md index a6f5404..d241fee 100644 --- a/node_modules/@babel/helper-split-export-declaration/README.md +++ b/node_modules/@babel/helper-split-export-declaration/README.md @@ -2,7 +2,7 @@ > -See our website [@babel/helper-split-export-declaration](https://babeljs.io/docs/en/babel-helper-split-export-declaration) for more information. +See our website [@babel/helper-split-export-declaration](https://babeljs.io/docs/en/next/babel-helper-split-export-declaration.html) for more information. ## Install diff --git a/node_modules/@babel/helper-split-export-declaration/package.json b/node_modules/@babel/helper-split-export-declaration/package.json index 56309a3..724b027 100644 --- a/node_modules/@babel/helper-split-export-declaration/package.json +++ b/node_modules/@babel/helper-split-export-declaration/package.json @@ -1,55 +1,21 @@ { - "_args": [ - [ - "@babel/helper-split-export-declaration@7.12.11", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-split-export-declaration@7.12.11", - "_id": "@babel/helper-split-export-declaration@7.12.11", - "_inBundle": false, - "_integrity": "sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g==", - "_location": "/@babel/helper-split-export-declaration", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-split-export-declaration@7.12.11", - "name": "@babel/helper-split-export-declaration", - "escapedName": "@babel%2fhelper-split-export-declaration", - "scope": "@babel", - "rawSpec": "7.12.11", - "saveSpec": null, - "fetchSpec": "7.12.11" - }, - "_requiredBy": [ - "/@babel/helper-create-class-features-plugin", - "/@babel/helper-module-transforms", - "/@babel/plugin-transform-classes", - "/@babel/traverse" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz", - "_spec": "7.12.11", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/types": "^7.12.11" - }, - "description": ">", - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "lib/index.js", "name": "@babel/helper-split-export-declaration", + "version": "7.11.0", + "description": "", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-split-export-declaration" + }, + "license": "MIT", "publishConfig": { "access": "public" }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-split-export-declaration" + "main": "lib/index.js", + "dependencies": { + "@babel/types": "^7.11.0" }, - "version": "7.12.11" -} + "__npminstall_done": "Sun Sep 06 2020 16:10:17 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-split-export-declaration@7.11.0", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-split-export-declaration/download/@babel/helper-split-export-declaration-7.11.0.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/README.md b/node_modules/@babel/helper-validator-identifier/README.md index 6733576..ab2dad1 100644 --- a/node_modules/@babel/helper-validator-identifier/README.md +++ b/node_modules/@babel/helper-validator-identifier/README.md @@ -2,7 +2,7 @@ > Validate identifier/keywords name -See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/babel-helper-validator-identifier) for more information. +See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/next/babel-helper-validator-identifier.html) for more information. ## Install diff --git a/node_modules/@babel/helper-validator-identifier/package.json b/node_modules/@babel/helper-validator-identifier/package.json index 2836781..192ed9a 100644 --- a/node_modules/@babel/helper-validator-identifier/package.json +++ b/node_modules/@babel/helper-validator-identifier/package.json @@ -1,57 +1,24 @@ { - "_args": [ - [ - "@babel/helper-validator-identifier@7.12.11", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-validator-identifier@7.12.11", - "_id": "@babel/helper-validator-identifier@7.12.11", - "_inBundle": false, - "_integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "_location": "/@babel/helper-validator-identifier", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-validator-identifier@7.12.11", - "name": "@babel/helper-validator-identifier", - "escapedName": "@babel%2fhelper-validator-identifier", - "scope": "@babel", - "rawSpec": "7.12.11", - "saveSpec": null, - "fetchSpec": "7.12.11" - }, - "_requiredBy": [ - "/@babel/helper-module-transforms", - "/@babel/highlight", - "/@babel/plugin-transform-modules-systemjs", - "/@babel/types" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "_spec": "7.12.11", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, + "name": "@babel/helper-validator-identifier", + "version": "7.10.4", "description": "Validate identifier/keywords name", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-validator-identifier" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "exports": "./lib/index.js", "devDependencies": { "charcodes": "^0.2.0", "unicode-13.0.0": "^0.8.0" }, - "exports": "./lib/index.js", - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "./lib/index.js", - "name": "@babel/helper-validator-identifier", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-validator-identifier" - }, - "version": "7.12.11" -} + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:02 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-validator-identifier@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-validator-identifier/download/@babel/helper-validator-identifier-7.10.4.tgz?cache=0&sync_timestamp=1593521125186&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-validator-identifier%2Fdownload%2F%40babel%2Fhelper-validator-identifier-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-option/LICENSE b/node_modules/@babel/helper-validator-option/LICENSE deleted file mode 100644 index f31575e..0000000 --- a/node_modules/@babel/helper-validator-option/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/helper-validator-option/README.md b/node_modules/@babel/helper-validator-option/README.md deleted file mode 100644 index b8b9e85..0000000 --- a/node_modules/@babel/helper-validator-option/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/helper-validator-option - -> Validate plugin/preset options - -See our website [@babel/helper-validator-option](https://babeljs.io/docs/en/babel-helper-validator-option) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/helper-validator-option -``` - -or using yarn: - -```sh -yarn add @babel/helper-validator-option --dev -``` diff --git a/node_modules/@babel/helper-validator-option/lib/find-suggestion.js b/node_modules/@babel/helper-validator-option/lib/find-suggestion.js deleted file mode 100644 index 019ea93..0000000 --- a/node_modules/@babel/helper-validator-option/lib/find-suggestion.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.findSuggestion = findSuggestion; -const { - min -} = Math; - -function levenshtein(a, b) { - let t = [], - u = [], - i, - j; - const m = a.length, - n = b.length; - - if (!m) { - return n; - } - - if (!n) { - return m; - } - - for (j = 0; j <= n; j++) { - t[j] = j; - } - - for (i = 1; i <= m; i++) { - for (u = [i], j = 1; j <= n; j++) { - u[j] = a[i - 1] === b[j - 1] ? t[j - 1] : min(t[j - 1], t[j], u[j - 1]) + 1; - } - - t = u; - } - - return u[n]; -} - -function findSuggestion(str, arr) { - const distances = arr.map(el => levenshtein(el, str)); - return arr[distances.indexOf(min(...distances))]; -} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-option/lib/index.js b/node_modules/@babel/helper-validator-option/lib/index.js deleted file mode 100644 index 8afe861..0000000 --- a/node_modules/@babel/helper-validator-option/lib/index.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "OptionValidator", { - enumerable: true, - get: function () { - return _validator.OptionValidator; - } -}); -Object.defineProperty(exports, "findSuggestion", { - enumerable: true, - get: function () { - return _findSuggestion.findSuggestion; - } -}); - -var _validator = require("./validator"); - -var _findSuggestion = require("./find-suggestion"); \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-option/lib/validator.js b/node_modules/@babel/helper-validator-option/lib/validator.js deleted file mode 100644 index 631b458..0000000 --- a/node_modules/@babel/helper-validator-option/lib/validator.js +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.OptionValidator = void 0; - -var _findSuggestion = require("./find-suggestion.js"); - -class OptionValidator { - constructor(descriptor) { - this.descriptor = descriptor; - } - - validateTopLevelOptions(options, TopLevelOptionShape) { - const validOptionNames = Object.keys(TopLevelOptionShape); - - for (const option of Object.keys(options)) { - if (!validOptionNames.includes(option)) { - throw new Error(this.formatMessage(`'${option}' is not a valid top-level option. -- Did you mean '${(0, _findSuggestion.findSuggestion)(option, validOptionNames)}'?`)); - } - } - } - - validateBooleanOption(name, value, defaultValue) { - if (value === undefined) { - return defaultValue; - } else { - this.invariant(typeof value === "boolean", `'${name}' option must be a boolean.`); - } - - return value; - } - - validateStringOption(name, value, defaultValue) { - if (value === undefined) { - return defaultValue; - } else { - this.invariant(typeof value === "string", `'${name}' option must be a string.`); - } - - return value; - } - - invariant(condition, message) { - if (!condition) { - throw new Error(this.formatMessage(message)); - } - } - - formatMessage(message) { - return `${this.descriptor}: ${message}`; - } - -} - -exports.OptionValidator = OptionValidator; \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-option/package.json b/node_modules/@babel/helper-validator-option/package.json deleted file mode 100644 index d4253b3..0000000 --- a/node_modules/@babel/helper-validator-option/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "_args": [ - [ - "@babel/helper-validator-option@7.12.11", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-validator-option@7.12.11", - "_id": "@babel/helper-validator-option@7.12.11", - "_inBundle": false, - "_integrity": "sha512-TBFCyj939mFSdeX7U7DDj32WtzYY7fDcalgq8v3fBZMNOJQNn7nOYzMaUCiPxPYfCup69mtIpqlKgMZLvQ8Xhw==", - "_location": "/@babel/helper-validator-option", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-validator-option@7.12.11", - "name": "@babel/helper-validator-option", - "escapedName": "@babel%2fhelper-validator-option", - "scope": "@babel", - "rawSpec": "7.12.11", - "saveSpec": null, - "fetchSpec": "7.12.11" - }, - "_requiredBy": [ - "/@babel/helper-compilation-targets", - "/@babel/preset-env", - "/@babel/preset-typescript" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.11.tgz", - "_spec": "7.12.11", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "description": "Validate plugin/preset options", - "exports": "./lib/index.js", - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "./lib/index.js", - "name": "@babel/helper-validator-option", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-validator-option" - }, - "version": "7.12.11" -} diff --git a/node_modules/@babel/helper-wrap-function/lib/index.js b/node_modules/@babel/helper-wrap-function/lib/index.js index 1c45179..3c9fad0 100644 --- a/node_modules/@babel/helper-wrap-function/lib/index.js +++ b/node_modules/@babel/helper-wrap-function/lib/index.js @@ -112,7 +112,7 @@ function plainFunction(path, callId) { } function wrapFunction(path, callId) { - if (path.isMethod()) { + if (path.isClassMethod() || path.isObjectMethod()) { classOrObjectMethod(path, callId); } else { plainFunction(path, callId); diff --git a/node_modules/@babel/helper-wrap-function/package.json b/node_modules/@babel/helper-wrap-function/package.json index 0a81a9a..39fdde3 100644 --- a/node_modules/@babel/helper-wrap-function/package.json +++ b/node_modules/@babel/helper-wrap-function/package.json @@ -1,55 +1,25 @@ { - "_args": [ - [ - "@babel/helper-wrap-function@7.12.3", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helper-wrap-function@7.12.3", - "_id": "@babel/helper-wrap-function@7.12.3", - "_inBundle": false, - "_integrity": "sha512-Cvb8IuJDln3rs6tzjW3Y8UeelAOdnpB8xtQ4sme2MSZ9wOxrbThporC0y/EtE16VAtoyEfLM404Xr1e0OOp+ow==", - "_location": "/@babel/helper-wrap-function", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helper-wrap-function@7.12.3", - "name": "@babel/helper-wrap-function", - "escapedName": "@babel%2fhelper-wrap-function", - "scope": "@babel", - "rawSpec": "7.12.3", - "saveSpec": null, - "fetchSpec": "7.12.3" + "name": "@babel/helper-wrap-function", + "version": "7.10.4", + "description": "Helper to wrap functions inside a function call.", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-wrap-function" }, - "_requiredBy": [ - "/@babel/helper-remap-async-to-generator" - ], - "_resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.12.3.tgz", - "_spec": "7.12.3", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "bugs": { - "url": "https://github.com/babel/babel/issues" + "license": "MIT", + "publishConfig": { + "access": "public" }, + "main": "lib/index.js", "dependencies": { "@babel/helper-function-name": "^7.10.4", "@babel/template": "^7.10.4", "@babel/traverse": "^7.10.4", "@babel/types": "^7.10.4" }, - "description": "Helper to wrap functions inside a function call.", - "homepage": "https://github.com/babel/babel#readme", - "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helper-wrap-function", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/babel/babel.git", - "directory": "packages/babel-helper-wrap-function" - }, - "version": "7.12.3" -} + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:20 GMT+0800 (中国标准时间)", + "_from": "@babel/helper-wrap-function@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helper-wrap-function/download/@babel/helper-wrap-function-7.10.4.tgz?cache=0&sync_timestamp=1593521275694&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-wrap-function%2Fdownload%2F%40babel%2Fhelper-wrap-function-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/helpers/README.md b/node_modules/@babel/helpers/README.md index 3b79dbf..537d8e4 100644 --- a/node_modules/@babel/helpers/README.md +++ b/node_modules/@babel/helpers/README.md @@ -2,7 +2,7 @@ > Collection of helper functions used by Babel transforms. -See our website [@babel/helpers](https://babeljs.io/docs/en/babel-helpers) for more information. +See our website [@babel/helpers](https://babeljs.io/docs/en/next/babel-helpers.html) for more information. ## Install diff --git a/node_modules/@babel/helpers/lib/helpers.js b/node_modules/@babel/helpers/lib/helpers.js index feb2e01..6782d41 100644 --- a/node_modules/@babel/helpers/lib/helpers.js +++ b/node_modules/@babel/helpers/lib/helpers.js @@ -835,7 +835,7 @@ helpers.taggedTemplateLiteralLoose = helper("7.0.0-beta.0")` `; helpers.readOnlyError = helper("7.0.0-beta.0")` export default function _readOnlyError(name) { - throw new TypeError("\\"" + name + "\\" is read-only"); + throw new Error("\\"" + name + "\\" is read-only"); } `; helpers.classNameTDZError = helper("7.0.0-beta.0")` @@ -1192,6 +1192,8 @@ helpers.applyDecoratedDescriptor = helper("7.0.0-beta.0")` } if (desc.initializer === void 0){ + // This is a hack to avoid this being processed by 'transform-runtime'. + // See issue #9. Object.defineProperty(target, property, desc); desc = null; } diff --git a/node_modules/@babel/helpers/package.json b/node_modules/@babel/helpers/package.json index 74b8f63..66f9251 100644 --- a/node_modules/@babel/helpers/package.json +++ b/node_modules/@babel/helpers/package.json @@ -1,61 +1,29 @@ { - "_args": [ - [ - "@babel/helpers@7.12.5", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/helpers@7.12.5", - "_id": "@babel/helpers@7.12.5", - "_inBundle": false, - "_integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", - "_location": "/@babel/helpers", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/helpers@7.12.5", - "name": "@babel/helpers", - "escapedName": "@babel%2fhelpers", - "scope": "@babel", - "rawSpec": "7.12.5", - "saveSpec": null, - "fetchSpec": "7.12.5" - }, - "_requiredBy": [ - "/@babel/core" - ], - "_resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", - "_spec": "7.12.5", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Sebastian McKenzie", - "email": "sebmck@gmail.com" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.5", - "@babel/types": "^7.12.5" - }, + "name": "@babel/helpers", + "version": "7.10.4", "description": "Collection of helper functions used by Babel transforms.", - "devDependencies": { - "@babel/helper-plugin-test-runner": "7.10.4" - }, + "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", - "main": "lib/index.js", - "name": "@babel/helpers", "publishConfig": { "access": "public" }, "repository": { "type": "git", - "url": "git+https://github.com/babel/babel.git", + "url": "https://github.com/babel/babel.git", "directory": "packages/babel-helpers" }, - "version": "7.12.5" -} + "main": "lib/index.js", + "dependencies": { + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + }, + "devDependencies": { + "@babel/helper-plugin-test-runner": "^7.10.4" + }, + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:17 GMT+0800 (中国标准时间)", + "_from": "@babel/helpers@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/helpers/download/@babel/helpers-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/highlight/package.json b/node_modules/@babel/highlight/package.json index 437f15e..a716ed2 100644 --- a/node_modules/@babel/highlight/package.json +++ b/node_modules/@babel/highlight/package.json @@ -1,62 +1,29 @@ { - "_args": [ - [ - "@babel/highlight@7.10.4", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "@babel/highlight@7.10.4", - "_id": "@babel/highlight@7.10.4", - "_inBundle": false, - "_integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "_location": "/@babel/highlight", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@babel/highlight@7.10.4", - "name": "@babel/highlight", - "escapedName": "@babel%2fhighlight", - "scope": "@babel", - "rawSpec": "7.10.4", - "saveSpec": null, - "fetchSpec": "7.10.4" - }, - "_requiredBy": [ - "/@babel/code-frame" - ], - "_resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "_spec": "7.10.4", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "suchipi", - "email": "me@suchipi.com" - }, - "bugs": { - "url": "https://github.com/babel/babel/issues" - }, - "dependencies": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, + "name": "@babel/highlight", + "version": "7.10.4", "description": "Syntax highlight JavaScript strings for output in terminals.", - "devDependencies": { - "strip-ansi": "^4.0.0" - }, - "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "author": "suchipi ", "homepage": "https://babeljs.io/", "license": "MIT", - "main": "lib/index.js", - "name": "@babel/highlight", "publishConfig": { "access": "public" }, "repository": { "type": "git", - "url": "git+https://github.com/babel/babel.git", + "url": "https://github.com/babel/babel.git", "directory": "packages/babel-highlight" }, - "version": "7.10.4" -} + "main": "lib/index.js", + "dependencies": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "devDependencies": { + "strip-ansi": "^4.0.0" + }, + "gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df", + "__npminstall_done": "Sun Sep 06 2020 16:10:13 GMT+0800 (中国标准时间)", + "_from": "@babel/highlight@7.10.4", + "_resolved": "https://registry.npm.taobao.org/@babel/highlight/download/@babel/highlight-7.10.4.tgz?cache=0&sync_timestamp=1593521095576&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhighlight%2Fdownload%2F%40babel%2Fhighlight-7.10.4.tgz" +} \ No newline at end of file diff --git a/node_modules/@babel/parser/README.md b/node_modules/@babel/parser/README.md index 513748c..65092a0 100644 --- a/node_modules/@babel/parser/README.md +++ b/node_modules/@babel/parser/README.md @@ -2,7 +2,7 @@ > A JavaScript parser -See our website [@babel/parser](https://babeljs.io/docs/en/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%20(babylon)%22+is%3Aopen) associated with this package. +See our website [@babel/parser](https://babeljs.io/docs/en/next/babel-parser.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen) associated with this package. ## Install diff --git a/node_modules/@babel/parser/lib/index.js b/node_modules/@babel/parser/lib/index.js index 2f888fa..f1d5e66 100644 --- a/node_modules/@babel/parser/lib/index.js +++ b/node_modules/@babel/parser/lib/index.js @@ -10,17 +10,6 @@ const prefix = true; const postfix = true; class TokenType { constructor(label, conf = {}) { - this.label = void 0; - this.keyword = void 0; - this.beforeExpr = void 0; - this.startsExpr = void 0; - this.rightAssociative = void 0; - this.isLoop = void 0; - this.isAssign = void 0; - this.prefix = void 0; - this.postfix = void 0; - this.binop = void 0; - this.updateContext = void 0; this.label = label; this.keyword = conf.keyword; this.beforeExpr = !!conf.beforeExpr; @@ -288,6 +277,48 @@ const types = { }) }; +const SCOPE_OTHER = 0b00000000, + SCOPE_PROGRAM = 0b00000001, + SCOPE_FUNCTION = 0b00000010, + SCOPE_ARROW = 0b00000100, + SCOPE_SIMPLE_CATCH = 0b00001000, + SCOPE_SUPER = 0b00010000, + SCOPE_DIRECT_SUPER = 0b00100000, + SCOPE_CLASS = 0b01000000, + SCOPE_TS_MODULE = 0b10000000, + SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE; +const BIND_KIND_VALUE = 0b00000000001, + BIND_KIND_TYPE = 0b00000000010, + BIND_SCOPE_VAR = 0b00000000100, + BIND_SCOPE_LEXICAL = 0b00000001000, + BIND_SCOPE_FUNCTION = 0b00000010000, + BIND_FLAGS_NONE = 0b00001000000, + BIND_FLAGS_CLASS = 0b00010000000, + BIND_FLAGS_TS_ENUM = 0b00100000000, + BIND_FLAGS_TS_CONST_ENUM = 0b01000000000, + BIND_FLAGS_TS_EXPORT_ONLY = 0b10000000000; +const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS, + BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0, + BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0, + BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0, + BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS, + BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0, + BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM, + BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, + BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE, + BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE, + BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM, + BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY; +const CLASS_ELEMENT_FLAG_STATIC = 0b100, + CLASS_ELEMENT_KIND_GETTER = 0b010, + CLASS_ELEMENT_KIND_SETTER = 0b001, + CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER; +const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC, + CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC, + CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER, + CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER, + CLASS_ELEMENT_OTHER = 0; + const lineBreak = /\r\n?|[\n\u2028\u2029]/; const lineBreakG = new RegExp(lineBreak.source, "g"); function isNewLine(code) { @@ -335,8 +366,6 @@ function isWhitespace(code) { class Position { constructor(line, col) { - this.line = void 0; - this.column = void 0; this.line = line; this.column = col; } @@ -344,10 +373,6 @@ class Position { } class SourceLocation { constructor(start, end) { - this.start = void 0; - this.end = void 0; - this.filename = void 0; - this.identifierName = void 0; this.start = start; this.end = end; } @@ -578,12 +603,11 @@ class CommentsParser extends BaseParser { const ErrorMessages = Object.freeze({ AccessorIsGenerator: "A %0ter cannot be a generator", - ArgumentsInClass: "'arguments' is only allowed in functions and class methods", + ArgumentsDisallowedInInitializer: "'arguments' is not allowed in class field initializer", AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block", AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function", AwaitExpressionFormalParameter: "await is not allowed in async function parameters", - AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules", - AwaitNotInAsyncFunction: "'await' is only allowed within async functions", + AwaitNotInAsyncFunction: "Can not use keyword 'await' outside an async function", BadGetterArity: "getter must not have any formal parameters", BadSetterArity: "setter must have exactly one formal parameter", BadSetterRestParameter: "setter function argument must not be a rest parameter", @@ -597,7 +621,6 @@ const ErrorMessages = Object.freeze({ DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", DecoratorExportClass: "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.", DecoratorSemicolon: "Decorators must not be followed by a semicolon", - DecoratorStaticBlock: "Decorators can't be used with a static block", DeletePrivateField: "Deleting a private field is not allowed", DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", DuplicateConstructor: "Duplicate constructor in the same class", @@ -605,17 +628,14 @@ const ErrorMessages = Object.freeze({ DuplicateExport: "`%0` has already been exported. Exported identifiers must be unique.", DuplicateProto: "Redefinition of __proto__ property", DuplicateRegExpFlags: "Duplicate regular expression flag", - DuplicateStaticBlock: "Duplicate static block in the same class", ElementAfterRest: "Rest element must be last element", EscapedCharNotAnIdentifier: "Invalid Unicode escape", - ExportBindingIsString: "A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '%0' as '%1' } from 'some-module'`?", ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'", ForInOfLoopInitializer: "%0 loop variable declaration may not have an initializer", GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block", IllegalBreakContinue: "Unsyntactic %0", IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list", IllegalReturn: "'return' outside of function", - ImportBindingIsString: 'A string literal cannot be used as an imported binding.\n- Did you mean `import { "%0" as foo }`?', ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments", ImportCallArity: "import() requires exactly %0", ImportCallNotNewExpression: "Cannot use new with import(...)", @@ -633,7 +653,6 @@ const ErrorMessages = Object.freeze({ InvalidLhs: "Invalid left-hand side in %0", InvalidLhsBinding: "Binding invalid left-hand side in %0", InvalidNumber: "Invalid number", - InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'", InvalidOrUnexpectedToken: "Unexpected character '%0'", InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern", InvalidPrivateFieldResolution: "Private name #%0 is not defined", @@ -651,7 +670,6 @@ const ErrorMessages = Object.freeze({ ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`", ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values", ModuleAttributesWithDuplicateKeys: 'Duplicate key "%0" is not allowed in module attributes', - ModuleExportNameHasLoneSurrogate: "An export name cannot include a lone surrogate, found '\\u%0'", ModuleExportUndefined: "Export '%0' is not defined", MultipleDefaultsInSwitch: "Multiple default clauses", NewlineAfterThrow: "Illegal newline after throw", @@ -720,7 +738,7 @@ const ErrorMessages = Object.freeze({ UnterminatedTemplate: "Unterminated template", VarRedeclaration: "Identifier '%0' has already been declared", YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator", - YieldInParameter: "Yield expression is not allowed in formal parameters", + YieldInParameter: "yield is not allowed in generator parameters", ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0" }); @@ -758,6 +776,10 @@ class ParserError extends CommentsParser { } +function isSimpleProperty(node) { + return node != null && node.type === "Property" && node.kind === "init" && node.method === false; +} + var estree = (superClass => class extends superClass { estreeParseRegExpLiteral({ pattern, @@ -778,14 +800,7 @@ var estree = (superClass => class extends superClass { } estreeParseBigIntLiteral(value) { - let bigInt; - - try { - bigInt = BigInt(value); - } catch (_unused) { - bigInt = null; - } - + const bigInt = typeof BigInt !== "undefined" ? BigInt(value) : null; const node = this.estreeParseLiteral(bigInt); node.bigint = String(node.value || value); return node; @@ -806,7 +821,7 @@ var estree = (superClass => class extends superClass { const directiveLiteral = directive.value; const stmt = this.startNodeAt(directive.start, directive.loc.start); const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start); - expression.value = directiveLiteral.extra.expressionValue; + expression.value = directiveLiteral.value; expression.raw = directiveLiteral.extra.raw; stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end); stmt.directive = directiveLiteral.extra.raw.slice(1, -1); @@ -819,15 +834,48 @@ var estree = (superClass => class extends superClass { } checkDeclaration(node) { - if (node != null && this.isObjectProperty(node)) { + if (isSimpleProperty(node)) { this.checkDeclaration(node.value); } else { super.checkDeclaration(node); } } - getObjectOrClassMethodParams(method) { - return method.value.params; + checkGetterSetterParams(method) { + const prop = method; + const paramCount = prop.kind === "get" ? 0 : 1; + const start = prop.start; + + if (prop.value.params.length !== paramCount) { + if (method.kind === "get") { + this.raise(start, ErrorMessages.BadGetterArity); + } else { + this.raise(start, ErrorMessages.BadSetterArity); + } + } else if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { + this.raise(start, ErrorMessages.BadSetterRestParameter); + } + } + + checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription, disallowLetBinding) { + switch (expr.type) { + case "ObjectPattern": + expr.properties.forEach(prop => { + this.checkLVal(prop.type === "Property" ? prop.value : prop, bindingType, checkClashes, "object destructuring pattern", disallowLetBinding); + }); + break; + + default: + super.checkLVal(expr, bindingType, checkClashes, contextDescription, disallowLetBinding); + } + } + + checkProto(prop, isRecord, protoRef, refExpressionErrors) { + if (prop.method) { + return; + } + + super.checkProto(prop, isRecord, protoRef, refExpressionErrors); } isValidDirective(stmt) { @@ -839,12 +887,12 @@ var estree = (superClass => class extends superClass { stmtToDirective(stmt) { const directive = super.stmtToDirective(stmt); const value = stmt.expression.value; - this.addExtra(directive.value, "expressionValue", value); + directive.value.value = value; return directive; } - parseBlockBody(node, ...args) { - super.parseBlockBody(node, ...args); + parseBlockBody(node, allowDirectives, topLevel, end) { + super.parseBlockBody(node, allowDirectives, topLevel, end); const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); node.body = directiveStatements.concat(node.body); delete node.directives; @@ -936,22 +984,22 @@ var estree = (superClass => class extends superClass { return node; } - toAssignable(node, isLHS = false) { - if (node != null && this.isObjectProperty(node)) { - this.toAssignable(node.value, isLHS); + toAssignable(node) { + if (isSimpleProperty(node)) { + this.toAssignable(node.value); return node; } - return super.toAssignable(node, isLHS); + return super.toAssignable(node); } - toAssignableObjectExpressionProp(prop, ...args) { + toAssignableObjectExpressionProp(prop, isLast) { if (prop.kind === "get" || prop.kind === "set") { - this.raise(prop.key.start, ErrorMessages.PatternHasAccessor); + throw this.raise(prop.key.start, ErrorMessages.PatternHasAccessor); } else if (prop.method) { - this.raise(prop.key.start, ErrorMessages.PatternHasMethod); + throw this.raise(prop.key.start, ErrorMessages.PatternHasMethod); } else { - super.toAssignableObjectExpressionProp(prop, ...args); + super.toAssignableObjectExpressionProp(prop, isLast); } } @@ -968,12 +1016,12 @@ var estree = (superClass => class extends superClass { return node; } - toReferencedArguments(node) { - if (node.type === "ImportExpression") { + toReferencedListDeep(exprList, isParenthesizedExpr) { + if (!exprList) { return; } - super.toReferencedArguments(node); + super.toReferencedListDeep(exprList, isParenthesizedExpr); } parseExport(node) { @@ -1017,34 +1065,10 @@ var estree = (superClass => class extends superClass { return node; } - hasPropertyAsPrivateName(node) { - if (node.type === "ChainExpression") { - node = node.expression; - } - - return super.hasPropertyAsPrivateName(node); - } - - isOptionalChain(node) { - return node.type === "ChainExpression"; - } - - isObjectProperty(node) { - return node.type === "Property" && node.kind === "init" && !node.method; - } - - isObjectMethod(node) { - return node.method || node.kind === "get" || node.kind === "set"; - } - }); class TokContext { constructor(token, isExpr, preserveSpace, override) { - this.token = void 0; - this.isExpr = void 0; - this.preserveSpace = void 0; - this.override = void 0; this.token = token; this.isExpr = !!isExpr; this.preserveSpace = !!preserveSpace; @@ -1083,7 +1107,7 @@ types.name.updateContext = function (prevType) { let allowed = false; if (prevType !== types.dot) { - if (this.state.value === "of" && !this.state.exprAllowed && prevType !== types._function && prevType !== types._class) { + if (this.state.value === "of" && !this.state.exprAllowed && prevType !== types._function && prevType !== types._class || this.state.value === "yield" && this.prodParam.hasYield) { allowed = true; } } @@ -1215,48 +1239,6 @@ function isIteratorStart(current, next) { return current === 64 && next === 64; } -const SCOPE_OTHER = 0b00000000, - SCOPE_PROGRAM = 0b00000001, - SCOPE_FUNCTION = 0b00000010, - SCOPE_ARROW = 0b00000100, - SCOPE_SIMPLE_CATCH = 0b00001000, - SCOPE_SUPER = 0b00010000, - SCOPE_DIRECT_SUPER = 0b00100000, - SCOPE_CLASS = 0b01000000, - SCOPE_TS_MODULE = 0b10000000, - SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE; -const BIND_KIND_VALUE = 0b00000000001, - BIND_KIND_TYPE = 0b00000000010, - BIND_SCOPE_VAR = 0b00000000100, - BIND_SCOPE_LEXICAL = 0b00000001000, - BIND_SCOPE_FUNCTION = 0b00000010000, - BIND_FLAGS_NONE = 0b00001000000, - BIND_FLAGS_CLASS = 0b00010000000, - BIND_FLAGS_TS_ENUM = 0b00100000000, - BIND_FLAGS_TS_CONST_ENUM = 0b01000000000, - BIND_FLAGS_TS_EXPORT_ONLY = 0b10000000000; -const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS, - BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0, - BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0, - BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0, - BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS, - BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0, - BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM, - BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, - BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE, - BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE, - BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM, - BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY; -const CLASS_ELEMENT_FLAG_STATIC = 0b100, - CLASS_ELEMENT_KIND_GETTER = 0b010, - CLASS_ELEMENT_KIND_SETTER = 0b001, - CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER; -const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC, - CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC, - CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER, - CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER, - CLASS_ELEMENT_OTHER = 0; - const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); const FlowErrors = Object.freeze({ AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", @@ -1332,1288 +1314,1279 @@ function partition(list, test) { } const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; -var flow = (superClass => { - var _temp; +var flow = (superClass => class extends superClass { + constructor(options, input) { + super(options, input); + this.flowPragma = undefined; + } - return _temp = class extends superClass { - constructor(options, input) { - super(options, input); - this.flowPragma = void 0; - this.flowPragma = undefined; - } + shouldParseTypes() { + return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; + } - shouldParseTypes() { - return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; - } + shouldParseEnums() { + return !!this.getPluginOption("flow", "enums"); + } - shouldParseEnums() { - return !!this.getPluginOption("flow", "enums"); - } - - finishToken(type, val) { - if (type !== types.string && type !== types.semi && type !== types.interpreterDirective) { - if (this.flowPragma === undefined) { - this.flowPragma = null; - } - } - - return super.finishToken(type, val); - } - - addComment(comment) { + finishToken(type, val) { + if (type !== types.string && type !== types.semi && type !== types.interpreterDirective) { if (this.flowPragma === undefined) { - const matches = FLOW_PRAGMA_REGEX.exec(comment.value); - - if (!matches) ; else if (matches[1] === "flow") { - this.flowPragma = "flow"; - } else if (matches[1] === "noflow") { - this.flowPragma = "noflow"; - } else { - throw new Error("Unexpected flow pragma"); - } + this.flowPragma = null; } - - return super.addComment(comment); } - flowParseTypeInitialiser(tok) { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(tok || types.colon); - const type = this.flowParseType(); - this.state.inType = oldInType; - return type; - } + return super.finishToken(type, val); + } - flowParsePredicate() { - const node = this.startNode(); - const moduloLoc = this.state.startLoc; - const moduloPos = this.state.start; - this.expect(types.modulo); - const checksLoc = this.state.startLoc; - this.expectContextual("checks"); + addComment(comment) { + if (this.flowPragma === undefined) { + const matches = FLOW_PRAGMA_REGEX.exec(comment.value); - if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) { - this.raise(moduloPos, FlowErrors.UnexpectedSpaceBetweenModuloChecks); - } - - if (this.eat(types.parenL)) { - node.value = this.parseExpression(); - this.expect(types.parenR); - return this.finishNode(node, "DeclaredPredicate"); + if (!matches) ; else if (matches[1] === "flow") { + this.flowPragma = "flow"; + } else if (matches[1] === "noflow") { + this.flowPragma = "noflow"; } else { - return this.finishNode(node, "InferredPredicate"); + throw new Error("Unexpected flow pragma"); } } - flowParseTypeAndPredicateInitialiser() { - const oldInType = this.state.inType; - this.state.inType = true; - this.expect(types.colon); - let type = null; - let predicate = null; + return super.addComment(comment); + } + + flowParseTypeInitialiser(tok) { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(tok || types.colon); + const type = this.flowParseType(); + this.state.inType = oldInType; + return type; + } + + flowParsePredicate() { + const node = this.startNode(); + const moduloLoc = this.state.startLoc; + const moduloPos = this.state.start; + this.expect(types.modulo); + const checksLoc = this.state.startLoc; + this.expectContextual("checks"); + + if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) { + this.raise(moduloPos, FlowErrors.UnexpectedSpaceBetweenModuloChecks); + } + + if (this.eat(types.parenL)) { + node.value = this.parseExpression(); + this.expect(types.parenR); + return this.finishNode(node, "DeclaredPredicate"); + } else { + return this.finishNode(node, "InferredPredicate"); + } + } + + flowParseTypeAndPredicateInitialiser() { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(types.colon); + let type = null; + let predicate = null; + + if (this.match(types.modulo)) { + this.state.inType = oldInType; + predicate = this.flowParsePredicate(); + } else { + type = this.flowParseType(); + this.state.inType = oldInType; if (this.match(types.modulo)) { - this.state.inType = oldInType; predicate = this.flowParsePredicate(); + } + } + + return [type, predicate]; + } + + flowParseDeclareClass(node) { + this.next(); + this.flowParseInterfaceish(node, true); + return this.finishNode(node, "DeclareClass"); + } + + flowParseDeclareFunction(node) { + this.next(); + const id = node.id = this.parseIdentifier(); + const typeNode = this.startNode(); + const typeContainer = this.startNode(); + + if (this.isRelational("<")) { + typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + typeNode.typeParameters = null; + } + + this.expect(types.parenL); + const tmp = this.flowParseFunctionTypeParams(); + typeNode.params = tmp.params; + typeNode.rest = tmp.rest; + this.expect(types.parenR); + [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); + id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); + this.resetEndLocation(id); + this.semicolon(); + return this.finishNode(node, "DeclareFunction"); + } + + flowParseDeclare(node, insideModule) { + if (this.match(types._class)) { + return this.flowParseDeclareClass(node); + } else if (this.match(types._function)) { + return this.flowParseDeclareFunction(node); + } else if (this.match(types._var)) { + return this.flowParseDeclareVariable(node); + } else if (this.eatContextual("module")) { + if (this.match(types.dot)) { + return this.flowParseDeclareModuleExports(node); } else { - type = this.flowParseType(); - this.state.inType = oldInType; - - if (this.match(types.modulo)) { - predicate = this.flowParsePredicate(); - } - } - - return [type, predicate]; - } - - flowParseDeclareClass(node) { - this.next(); - this.flowParseInterfaceish(node, true); - return this.finishNode(node, "DeclareClass"); - } - - flowParseDeclareFunction(node) { - this.next(); - const id = node.id = this.parseIdentifier(); - const typeNode = this.startNode(); - const typeContainer = this.startNode(); - - if (this.isRelational("<")) { - typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - typeNode.typeParameters = null; - } - - this.expect(types.parenL); - const tmp = this.flowParseFunctionTypeParams(); - typeNode.params = tmp.params; - typeNode.rest = tmp.rest; - this.expect(types.parenR); - [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); - id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); - this.resetEndLocation(id); - this.semicolon(); - return this.finishNode(node, "DeclareFunction"); - } - - flowParseDeclare(node, insideModule) { - if (this.match(types._class)) { - return this.flowParseDeclareClass(node); - } else if (this.match(types._function)) { - return this.flowParseDeclareFunction(node); - } else if (this.match(types._var)) { - return this.flowParseDeclareVariable(node); - } else if (this.eatContextual("module")) { - if (this.match(types.dot)) { - return this.flowParseDeclareModuleExports(node); - } else { - if (insideModule) { - this.raise(this.state.lastTokStart, FlowErrors.NestedDeclareModule); - } - - return this.flowParseDeclareModule(node); - } - } else if (this.isContextual("type")) { - return this.flowParseDeclareTypeAlias(node); - } else if (this.isContextual("opaque")) { - return this.flowParseDeclareOpaqueType(node); - } else if (this.isContextual("interface")) { - return this.flowParseDeclareInterface(node); - } else if (this.match(types._export)) { - return this.flowParseDeclareExportDeclaration(node, insideModule); - } else { - throw this.unexpected(); - } - } - - flowParseDeclareVariable(node) { - this.next(); - node.id = this.flowParseTypeAnnotatableIdentifier(true); - this.scope.declareName(node.id.name, BIND_VAR, node.id.start); - this.semicolon(); - return this.finishNode(node, "DeclareVariable"); - } - - flowParseDeclareModule(node) { - this.scope.enter(SCOPE_OTHER); - - if (this.match(types.string)) { - node.id = this.parseExprAtom(); - } else { - node.id = this.parseIdentifier(); - } - - const bodyNode = node.body = this.startNode(); - const body = bodyNode.body = []; - this.expect(types.braceL); - - while (!this.match(types.braceR)) { - let bodyNode = this.startNode(); - - if (this.match(types._import)) { - this.next(); - - if (!this.isContextual("type") && !this.match(types._typeof)) { - this.raise(this.state.lastTokStart, FlowErrors.InvalidNonTypeImportInDeclareModule); - } - - this.parseImport(bodyNode); - } else { - this.expectContextual("declare", FlowErrors.UnsupportedStatementInDeclareModule); - bodyNode = this.flowParseDeclare(bodyNode, true); + if (insideModule) { + this.raise(this.state.lastTokStart, FlowErrors.NestedDeclareModule); } - body.push(bodyNode); + return this.flowParseDeclareModule(node); } - - this.scope.exit(); - this.expect(types.braceR); - this.finishNode(bodyNode, "BlockStatement"); - let kind = null; - let hasModuleExport = false; - body.forEach(bodyElement => { - if (isEsModuleType(bodyElement)) { - if (kind === "CommonJS") { - this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind); - } - - kind = "ES"; - } else if (bodyElement.type === "DeclareModuleExports") { - if (hasModuleExport) { - this.raise(bodyElement.start, FlowErrors.DuplicateDeclareModuleExports); - } - - if (kind === "ES") { - this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind); - } - - kind = "CommonJS"; - hasModuleExport = true; - } - }); - node.kind = kind || "CommonJS"; - return this.finishNode(node, "DeclareModule"); - } - - flowParseDeclareExportDeclaration(node, insideModule) { - this.expect(types._export); - - if (this.eat(types._default)) { - if (this.match(types._function) || this.match(types._class)) { - node.declaration = this.flowParseDeclare(this.startNode()); - } else { - node.declaration = this.flowParseType(); - this.semicolon(); - } - - node.default = true; - return this.finishNode(node, "DeclareExportDeclaration"); - } else { - if (this.match(types._const) || this.isLet() || (this.isContextual("type") || this.isContextual("interface")) && !insideModule) { - const label = this.state.value; - const suggestion = exportSuggestions[label]; - throw this.raise(this.state.start, FlowErrors.UnsupportedDeclareExportKind, label, suggestion); - } - - if (this.match(types._var) || this.match(types._function) || this.match(types._class) || this.isContextual("opaque")) { - node.declaration = this.flowParseDeclare(this.startNode()); - node.default = false; - return this.finishNode(node, "DeclareExportDeclaration"); - } else if (this.match(types.star) || this.match(types.braceL) || this.isContextual("interface") || this.isContextual("type") || this.isContextual("opaque")) { - node = this.parseExport(node); - - if (node.type === "ExportNamedDeclaration") { - node.type = "ExportDeclaration"; - node.default = false; - delete node.exportKind; - } - - node.type = "Declare" + node.type; - return node; - } - } - + } else if (this.isContextual("type")) { + return this.flowParseDeclareTypeAlias(node); + } else if (this.isContextual("opaque")) { + return this.flowParseDeclareOpaqueType(node); + } else if (this.isContextual("interface")) { + return this.flowParseDeclareInterface(node); + } else if (this.match(types._export)) { + return this.flowParseDeclareExportDeclaration(node, insideModule); + } else { throw this.unexpected(); } + } - flowParseDeclareModuleExports(node) { - this.next(); - this.expectContextual("exports"); - node.typeAnnotation = this.flowParseTypeAnnotation(); - this.semicolon(); - return this.finishNode(node, "DeclareModuleExports"); + flowParseDeclareVariable(node) { + this.next(); + node.id = this.flowParseTypeAnnotatableIdentifier(true); + this.scope.declareName(node.id.name, BIND_VAR, node.id.start); + this.semicolon(); + return this.finishNode(node, "DeclareVariable"); + } + + flowParseDeclareModule(node) { + this.scope.enter(SCOPE_OTHER); + + if (this.match(types.string)) { + node.id = this.parseExprAtom(); + } else { + node.id = this.parseIdentifier(); } - flowParseDeclareTypeAlias(node) { - this.next(); - this.flowParseTypeAlias(node); - node.type = "DeclareTypeAlias"; - return node; - } + const bodyNode = node.body = this.startNode(); + const body = bodyNode.body = []; + this.expect(types.braceL); - flowParseDeclareOpaqueType(node) { - this.next(); - this.flowParseOpaqueType(node, true); - node.type = "DeclareOpaqueType"; - return node; - } + while (!this.match(types.braceR)) { + let bodyNode = this.startNode(); - flowParseDeclareInterface(node) { - this.next(); - this.flowParseInterfaceish(node); - return this.finishNode(node, "DeclareInterface"); - } - - flowParseInterfaceish(node, isClass = false) { - node.id = this.flowParseRestrictedIdentifier(!isClass, true); - this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.start); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.extends = []; - node.implements = []; - node.mixins = []; - - if (this.eat(types._extends)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (!isClass && this.eat(types.comma)); - } - - if (this.isContextual("mixins")) { + if (this.match(types._import)) { this.next(); - do { - node.mixins.push(this.flowParseInterfaceExtends()); - } while (this.eat(types.comma)); - } - - if (this.isContextual("implements")) { - this.next(); - - do { - node.implements.push(this.flowParseInterfaceExtends()); - } while (this.eat(types.comma)); - } - - node.body = this.flowParseObjectType({ - allowStatic: isClass, - allowExact: false, - allowSpread: false, - allowProto: isClass, - allowInexact: false - }); - } - - flowParseInterfaceExtends() { - const node = this.startNode(); - node.id = this.flowParseQualifiedTypeIdentifier(); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - - return this.finishNode(node, "InterfaceExtends"); - } - - flowParseInterface(node) { - this.flowParseInterfaceish(node); - return this.finishNode(node, "InterfaceDeclaration"); - } - - checkNotUnderscore(word) { - if (word === "_") { - this.raise(this.state.start, FlowErrors.UnexpectedReservedUnderscore); - } - } - - checkReservedType(word, startLoc, declaration) { - if (!reservedTypes.has(word)) return; - this.raise(startLoc, declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, word); - } - - flowParseRestrictedIdentifier(liberal, declaration) { - this.checkReservedType(this.state.value, this.state.start, declaration); - return this.parseIdentifier(liberal); - } - - flowParseTypeAlias(node) { - node.id = this.flowParseRestrictedIdentifier(false, true); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.right = this.flowParseTypeInitialiser(types.eq); - this.semicolon(); - return this.finishNode(node, "TypeAlias"); - } - - flowParseOpaqueType(node, declare) { - this.expectContextual("type"); - node.id = this.flowParseRestrictedIdentifier(true, true); - this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.supertype = null; - - if (this.match(types.colon)) { - node.supertype = this.flowParseTypeInitialiser(types.colon); - } - - node.impltype = null; - - if (!declare) { - node.impltype = this.flowParseTypeInitialiser(types.eq); - } - - this.semicolon(); - return this.finishNode(node, "OpaqueType"); - } - - flowParseTypeParameter(requireDefault = false) { - const nodeStart = this.state.start; - const node = this.startNode(); - const variance = this.flowParseVariance(); - const ident = this.flowParseTypeAnnotatableIdentifier(); - node.name = ident.name; - node.variance = variance; - node.bound = ident.typeAnnotation; - - if (this.match(types.eq)) { - this.eat(types.eq); - node.default = this.flowParseType(); - } else { - if (requireDefault) { - this.raise(nodeStart, FlowErrors.MissingTypeParamDefault); + if (!this.isContextual("type") && !this.match(types._typeof)) { + this.raise(this.state.lastTokStart, FlowErrors.InvalidNonTypeImportInDeclareModule); } + + this.parseImport(bodyNode); + } else { + this.expectContextual("declare", FlowErrors.UnsupportedStatementInDeclareModule); + bodyNode = this.flowParseDeclare(bodyNode, true); } - return this.finishNode(node, "TypeParameter"); + body.push(bodyNode); } - flowParseTypeParameterDeclaration() { - const oldInType = this.state.inType; - const node = this.startNode(); - node.params = []; - this.state.inType = true; + this.scope.exit(); + this.expect(types.braceR); + this.finishNode(bodyNode, "BlockStatement"); + let kind = null; + let hasModuleExport = false; + body.forEach(bodyElement => { + if (isEsModuleType(bodyElement)) { + if (kind === "CommonJS") { + this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind); + } - if (this.isRelational("<") || this.match(types.jsxTagStart)) { - this.next(); + kind = "ES"; + } else if (bodyElement.type === "DeclareModuleExports") { + if (hasModuleExport) { + this.raise(bodyElement.start, FlowErrors.DuplicateDeclareModuleExports); + } + + if (kind === "ES") { + this.raise(bodyElement.start, FlowErrors.AmbiguousDeclareModuleKind); + } + + kind = "CommonJS"; + hasModuleExport = true; + } + }); + node.kind = kind || "CommonJS"; + return this.finishNode(node, "DeclareModule"); + } + + flowParseDeclareExportDeclaration(node, insideModule) { + this.expect(types._export); + + if (this.eat(types._default)) { + if (this.match(types._function) || this.match(types._class)) { + node.declaration = this.flowParseDeclare(this.startNode()); } else { - this.unexpected(); + node.declaration = this.flowParseType(); + this.semicolon(); } - let defaultRequired = false; + node.default = true; + return this.finishNode(node, "DeclareExportDeclaration"); + } else { + if (this.match(types._const) || this.isLet() || (this.isContextual("type") || this.isContextual("interface")) && !insideModule) { + const label = this.state.value; + const suggestion = exportSuggestions[label]; + throw this.raise(this.state.start, FlowErrors.UnsupportedDeclareExportKind, label, suggestion); + } + + if (this.match(types._var) || this.match(types._function) || this.match(types._class) || this.isContextual("opaque")) { + node.declaration = this.flowParseDeclare(this.startNode()); + node.default = false; + return this.finishNode(node, "DeclareExportDeclaration"); + } else if (this.match(types.star) || this.match(types.braceL) || this.isContextual("interface") || this.isContextual("type") || this.isContextual("opaque")) { + node = this.parseExport(node); + + if (node.type === "ExportNamedDeclaration") { + node.type = "ExportDeclaration"; + node.default = false; + delete node.exportKind; + } + + node.type = "Declare" + node.type; + return node; + } + } + + throw this.unexpected(); + } + + flowParseDeclareModuleExports(node) { + this.next(); + this.expectContextual("exports"); + node.typeAnnotation = this.flowParseTypeAnnotation(); + this.semicolon(); + return this.finishNode(node, "DeclareModuleExports"); + } + + flowParseDeclareTypeAlias(node) { + this.next(); + this.flowParseTypeAlias(node); + node.type = "DeclareTypeAlias"; + return node; + } + + flowParseDeclareOpaqueType(node) { + this.next(); + this.flowParseOpaqueType(node, true); + node.type = "DeclareOpaqueType"; + return node; + } + + flowParseDeclareInterface(node) { + this.next(); + this.flowParseInterfaceish(node); + return this.finishNode(node, "DeclareInterface"); + } + + flowParseInterfaceish(node, isClass = false) { + node.id = this.flowParseRestrictedIdentifier(!isClass, true); + this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.start); + + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + + node.extends = []; + node.implements = []; + node.mixins = []; + + if (this.eat(types._extends)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (!isClass && this.eat(types.comma)); + } + + if (this.isContextual("mixins")) { + this.next(); do { - const typeParameter = this.flowParseTypeParameter(defaultRequired); - node.params.push(typeParameter); - - if (typeParameter.default) { - defaultRequired = true; - } - - if (!this.isRelational(">")) { - this.expect(types.comma); - } - } while (!this.isRelational(">")); - - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterDeclaration"); + node.mixins.push(this.flowParseInterfaceExtends()); + } while (this.eat(types.comma)); } - flowParseTypeParameterInstantiation() { - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; - this.state.inType = true; - this.expectRelational("<"); - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = false; + if (this.isContextual("implements")) { + this.next(); - while (!this.isRelational(">")) { - node.params.push(this.flowParseType()); - - if (!this.isRelational(">")) { - this.expect(types.comma); - } - } - - this.state.noAnonFunctionType = oldNoAnonFunctionType; - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterInstantiation"); + do { + node.implements.push(this.flowParseInterfaceExtends()); + } while (this.eat(types.comma)); } - flowParseTypeParameterInstantiationCallOrNew() { - const node = this.startNode(); - const oldInType = this.state.inType; - node.params = []; - this.state.inType = true; - this.expectRelational("<"); + node.body = this.flowParseObjectType({ + allowStatic: isClass, + allowExact: false, + allowSpread: false, + allowProto: isClass, + allowInexact: false + }); + } - while (!this.isRelational(">")) { - node.params.push(this.flowParseTypeOrImplicitInstantiation()); + flowParseInterfaceExtends() { + const node = this.startNode(); + node.id = this.flowParseQualifiedTypeIdentifier(); - if (!this.isRelational(">")) { - this.expect(types.comma); - } - } - - this.expectRelational(">"); - this.state.inType = oldInType; - return this.finishNode(node, "TypeParameterInstantiation"); - } - - flowParseInterfaceType() { - const node = this.startNode(); - this.expectContextual("interface"); - node.extends = []; - - if (this.eat(types._extends)) { - do { - node.extends.push(this.flowParseInterfaceExtends()); - } while (this.eat(types.comma)); - } - - node.body = this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: false, - allowProto: false, - allowInexact: false - }); - return this.finishNode(node, "InterfaceTypeAnnotation"); - } - - flowParseObjectPropertyKey() { - return this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true); - } - - flowParseObjectTypeIndexer(node, isStatic, variance) { - node.static = isStatic; - - if (this.lookahead().type === types.colon) { - node.id = this.flowParseObjectPropertyKey(); - node.key = this.flowParseTypeInitialiser(); - } else { - node.id = null; - node.key = this.flowParseType(); - } - - this.expect(types.bracketR); - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - return this.finishNode(node, "ObjectTypeIndexer"); - } - - flowParseObjectTypeInternalSlot(node, isStatic) { - node.static = isStatic; - node.id = this.flowParseObjectPropertyKey(); - this.expect(types.bracketR); - this.expect(types.bracketR); - - if (this.isRelational("<") || this.match(types.parenL)) { - node.method = true; - node.optional = false; - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); - } else { - node.method = false; - - if (this.eat(types.question)) { - node.optional = true; - } - - node.value = this.flowParseTypeInitialiser(); - } - - return this.finishNode(node, "ObjectTypeInternalSlot"); - } - - flowParseObjectTypeMethodish(node) { - node.params = []; - node.rest = null; + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { node.typeParameters = null; - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - this.expect(types.parenL); - - while (!this.match(types.parenR) && !this.match(types.ellipsis)) { - node.params.push(this.flowParseFunctionTypeParam()); - - if (!this.match(types.parenR)) { - this.expect(types.comma); - } - } - - if (this.eat(types.ellipsis)) { - node.rest = this.flowParseFunctionTypeParam(); - } - - this.expect(types.parenR); - node.returnType = this.flowParseTypeInitialiser(); - return this.finishNode(node, "FunctionTypeAnnotation"); } - flowParseObjectTypeCallProperty(node, isStatic) { - const valueNode = this.startNode(); - node.static = isStatic; - node.value = this.flowParseObjectTypeMethodish(valueNode); - return this.finishNode(node, "ObjectTypeCallProperty"); + return this.finishNode(node, "InterfaceExtends"); + } + + flowParseInterface(node) { + this.flowParseInterfaceish(node); + return this.finishNode(node, "InterfaceDeclaration"); + } + + checkNotUnderscore(word) { + if (word === "_") { + this.raise(this.state.start, FlowErrors.UnexpectedReservedUnderscore); + } + } + + checkReservedType(word, startLoc, declaration) { + if (!reservedTypes.has(word)) return; + this.raise(startLoc, declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, word); + } + + flowParseRestrictedIdentifier(liberal, declaration) { + this.checkReservedType(this.state.value, this.state.start, declaration); + return this.parseIdentifier(liberal); + } + + flowParseTypeAlias(node) { + node.id = this.flowParseRestrictedIdentifier(false, true); + this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); + + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; } - flowParseObjectType({ - allowStatic, - allowExact, - allowSpread, - allowProto, - allowInexact - }) { - const oldInType = this.state.inType; - this.state.inType = true; - const nodeStart = this.startNode(); - nodeStart.callProperties = []; - nodeStart.properties = []; - nodeStart.indexers = []; - nodeStart.internalSlots = []; - let endDelim; - let exact; - let inexact = false; + node.right = this.flowParseTypeInitialiser(types.eq); + this.semicolon(); + return this.finishNode(node, "TypeAlias"); + } - if (allowExact && this.match(types.braceBarL)) { - this.expect(types.braceBarL); - endDelim = types.braceBarR; - exact = true; - } else { - this.expect(types.braceL); - endDelim = types.braceR; - exact = false; + flowParseOpaqueType(node, declare) { + this.expectContextual("type"); + node.id = this.flowParseRestrictedIdentifier(true, true); + this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); + + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + + node.supertype = null; + + if (this.match(types.colon)) { + node.supertype = this.flowParseTypeInitialiser(types.colon); + } + + node.impltype = null; + + if (!declare) { + node.impltype = this.flowParseTypeInitialiser(types.eq); + } + + this.semicolon(); + return this.finishNode(node, "OpaqueType"); + } + + flowParseTypeParameter(requireDefault = false) { + const nodeStart = this.state.start; + const node = this.startNode(); + const variance = this.flowParseVariance(); + const ident = this.flowParseTypeAnnotatableIdentifier(); + node.name = ident.name; + node.variance = variance; + node.bound = ident.typeAnnotation; + + if (this.match(types.eq)) { + this.eat(types.eq); + node.default = this.flowParseType(); + } else { + if (requireDefault) { + this.raise(nodeStart, FlowErrors.MissingTypeParamDefault); + } + } + + return this.finishNode(node, "TypeParameter"); + } + + flowParseTypeParameterDeclaration() { + const oldInType = this.state.inType; + const node = this.startNode(); + node.params = []; + this.state.inType = true; + + if (this.isRelational("<") || this.match(types.jsxTagStart)) { + this.next(); + } else { + this.unexpected(); + } + + let defaultRequired = false; + + do { + const typeParameter = this.flowParseTypeParameter(defaultRequired); + node.params.push(typeParameter); + + if (typeParameter.default) { + defaultRequired = true; } - nodeStart.exact = exact; + if (!this.isRelational(">")) { + this.expect(types.comma); + } + } while (!this.isRelational(">")); - while (!this.match(endDelim)) { - let isStatic = false; - let protoStart = null; - let inexactStart = null; - const node = this.startNode(); + this.expectRelational(">"); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterDeclaration"); + } - if (allowProto && this.isContextual("proto")) { - const lookahead = this.lookahead(); + flowParseTypeParameterInstantiation() { + const node = this.startNode(); + const oldInType = this.state.inType; + node.params = []; + this.state.inType = true; + this.expectRelational("<"); + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = false; - if (lookahead.type !== types.colon && lookahead.type !== types.question) { - this.next(); - protoStart = this.state.start; - allowStatic = false; - } + while (!this.isRelational(">")) { + node.params.push(this.flowParseType()); + + if (!this.isRelational(">")) { + this.expect(types.comma); + } + } + + this.state.noAnonFunctionType = oldNoAnonFunctionType; + this.expectRelational(">"); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterInstantiation"); + } + + flowParseTypeParameterInstantiationCallOrNew() { + const node = this.startNode(); + const oldInType = this.state.inType; + node.params = []; + this.state.inType = true; + this.expectRelational("<"); + + while (!this.isRelational(">")) { + node.params.push(this.flowParseTypeOrImplicitInstantiation()); + + if (!this.isRelational(">")) { + this.expect(types.comma); + } + } + + this.expectRelational(">"); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterInstantiation"); + } + + flowParseInterfaceType() { + const node = this.startNode(); + this.expectContextual("interface"); + node.extends = []; + + if (this.eat(types._extends)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (this.eat(types.comma)); + } + + node.body = this.flowParseObjectType({ + allowStatic: false, + allowExact: false, + allowSpread: false, + allowProto: false, + allowInexact: false + }); + return this.finishNode(node, "InterfaceTypeAnnotation"); + } + + flowParseObjectPropertyKey() { + return this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true); + } + + flowParseObjectTypeIndexer(node, isStatic, variance) { + node.static = isStatic; + + if (this.lookahead().type === types.colon) { + node.id = this.flowParseObjectPropertyKey(); + node.key = this.flowParseTypeInitialiser(); + } else { + node.id = null; + node.key = this.flowParseType(); + } + + this.expect(types.bracketR); + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; + return this.finishNode(node, "ObjectTypeIndexer"); + } + + flowParseObjectTypeInternalSlot(node, isStatic) { + node.static = isStatic; + node.id = this.flowParseObjectPropertyKey(); + this.expect(types.bracketR); + this.expect(types.bracketR); + + if (this.isRelational("<") || this.match(types.parenL)) { + node.method = true; + node.optional = false; + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); + } else { + node.method = false; + + if (this.eat(types.question)) { + node.optional = true; + } + + node.value = this.flowParseTypeInitialiser(); + } + + return this.finishNode(node, "ObjectTypeInternalSlot"); + } + + flowParseObjectTypeMethodish(node) { + node.params = []; + node.rest = null; + node.typeParameters = null; + + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + + this.expect(types.parenL); + + while (!this.match(types.parenR) && !this.match(types.ellipsis)) { + node.params.push(this.flowParseFunctionTypeParam()); + + if (!this.match(types.parenR)) { + this.expect(types.comma); + } + } + + if (this.eat(types.ellipsis)) { + node.rest = this.flowParseFunctionTypeParam(); + } + + this.expect(types.parenR); + node.returnType = this.flowParseTypeInitialiser(); + return this.finishNode(node, "FunctionTypeAnnotation"); + } + + flowParseObjectTypeCallProperty(node, isStatic) { + const valueNode = this.startNode(); + node.static = isStatic; + node.value = this.flowParseObjectTypeMethodish(valueNode); + return this.finishNode(node, "ObjectTypeCallProperty"); + } + + flowParseObjectType({ + allowStatic, + allowExact, + allowSpread, + allowProto, + allowInexact + }) { + const oldInType = this.state.inType; + this.state.inType = true; + const nodeStart = this.startNode(); + nodeStart.callProperties = []; + nodeStart.properties = []; + nodeStart.indexers = []; + nodeStart.internalSlots = []; + let endDelim; + let exact; + let inexact = false; + + if (allowExact && this.match(types.braceBarL)) { + this.expect(types.braceBarL); + endDelim = types.braceBarR; + exact = true; + } else { + this.expect(types.braceL); + endDelim = types.braceR; + exact = false; + } + + nodeStart.exact = exact; + + while (!this.match(endDelim)) { + let isStatic = false; + let protoStart = null; + let inexactStart = null; + const node = this.startNode(); + + if (allowProto && this.isContextual("proto")) { + const lookahead = this.lookahead(); + + if (lookahead.type !== types.colon && lookahead.type !== types.question) { + this.next(); + protoStart = this.state.start; + allowStatic = false; } + } - if (allowStatic && this.isContextual("static")) { - const lookahead = this.lookahead(); + if (allowStatic && this.isContextual("static")) { + const lookahead = this.lookahead(); - if (lookahead.type !== types.colon && lookahead.type !== types.question) { - this.next(); - isStatic = true; - } + if (lookahead.type !== types.colon && lookahead.type !== types.question) { + this.next(); + isStatic = true; } + } - const variance = this.flowParseVariance(); + const variance = this.flowParseVariance(); + + if (this.eat(types.bracketL)) { + if (protoStart != null) { + this.unexpected(protoStart); + } if (this.eat(types.bracketL)) { - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (this.eat(types.bracketL)) { - if (variance) { - this.unexpected(variance.start); - } - - nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); - } else { - nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); - } - } else if (this.match(types.parenL) || this.isRelational("<")) { - if (protoStart != null) { - this.unexpected(protoStart); - } - if (variance) { this.unexpected(variance.start); } - nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); + nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); } else { - let kind = "init"; + nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); + } + } else if (this.match(types.parenL) || this.isRelational("<")) { + if (protoStart != null) { + this.unexpected(protoStart); + } - if (this.isContextual("get") || this.isContextual("set")) { - const lookahead = this.lookahead(); + if (variance) { + this.unexpected(variance.start); + } - if (lookahead.type === types.name || lookahead.type === types.string || lookahead.type === types.num) { - kind = this.state.value; - this.next(); - } - } + nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); + } else { + let kind = "init"; - const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); + if (this.isContextual("get") || this.isContextual("set")) { + const lookahead = this.lookahead(); - if (propOrInexact === null) { - inexact = true; - inexactStart = this.state.lastTokStart; - } else { - nodeStart.properties.push(propOrInexact); + if (lookahead.type === types.name || lookahead.type === types.string || lookahead.type === types.num) { + kind = this.state.value; + this.next(); } } - this.flowObjectTypeSemicolon(); + const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); - if (inexactStart && !this.match(types.braceR) && !this.match(types.braceBarR)) { - this.raise(inexactStart, FlowErrors.UnexpectedExplicitInexactInObject); + if (propOrInexact === null) { + inexact = true; + inexactStart = this.state.lastTokStart; + } else { + nodeStart.properties.push(propOrInexact); } } - this.expect(endDelim); + this.flowObjectTypeSemicolon(); - if (allowSpread) { - nodeStart.inexact = inexact; + if (inexactStart && !this.match(types.braceR) && !this.match(types.braceBarR)) { + this.raise(inexactStart, FlowErrors.UnexpectedExplicitInexactInObject); } - - const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); - this.state.inType = oldInType; - return out; } - flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact) { - if (this.eat(types.ellipsis)) { - const isInexactToken = this.match(types.comma) || this.match(types.semi) || this.match(types.braceR) || this.match(types.braceBarR); + this.expect(endDelim); - if (isInexactToken) { - if (!allowSpread) { - this.raise(this.state.lastTokStart, FlowErrors.InexactInsideNonObject); - } else if (!allowInexact) { - this.raise(this.state.lastTokStart, FlowErrors.InexactInsideExact); - } + if (allowSpread) { + nodeStart.inexact = inexact; + } - if (variance) { - this.raise(variance.start, FlowErrors.InexactVariance); - } + const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); + this.state.inType = oldInType; + return out; + } - return null; - } + flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact) { + if (this.eat(types.ellipsis)) { + const isInexactToken = this.match(types.comma) || this.match(types.semi) || this.match(types.braceR) || this.match(types.braceBarR); + if (isInexactToken) { if (!allowSpread) { - this.raise(this.state.lastTokStart, FlowErrors.UnexpectedSpreadType); + this.raise(this.state.lastTokStart, FlowErrors.InexactInsideNonObject); + } else if (!allowInexact) { + this.raise(this.state.lastTokStart, FlowErrors.InexactInsideExact); } + if (variance) { + this.raise(variance.start, FlowErrors.InexactVariance); + } + + return null; + } + + if (!allowSpread) { + this.raise(this.state.lastTokStart, FlowErrors.UnexpectedSpreadType); + } + + if (protoStart != null) { + this.unexpected(protoStart); + } + + if (variance) { + this.raise(variance.start, FlowErrors.SpreadVariance); + } + + node.argument = this.flowParseType(); + return this.finishNode(node, "ObjectTypeSpreadProperty"); + } else { + node.key = this.flowParseObjectPropertyKey(); + node.static = isStatic; + node.proto = protoStart != null; + node.kind = kind; + let optional = false; + + if (this.isRelational("<") || this.match(types.parenL)) { + node.method = true; + if (protoStart != null) { this.unexpected(protoStart); } if (variance) { - this.raise(variance.start, FlowErrors.SpreadVariance); + this.unexpected(variance.start); } - node.argument = this.flowParseType(); - return this.finishNode(node, "ObjectTypeSpreadProperty"); + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); + + if (kind === "get" || kind === "set") { + this.flowCheckGetterSetterParams(node); + } } else { - node.key = this.flowParseObjectPropertyKey(); - node.static = isStatic; - node.proto = protoStart != null; - node.kind = kind; - let optional = false; - - if (this.isRelational("<") || this.match(types.parenL)) { - node.method = true; - - if (protoStart != null) { - this.unexpected(protoStart); - } - - if (variance) { - this.unexpected(variance.start); - } - - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start)); - - if (kind === "get" || kind === "set") { - this.flowCheckGetterSetterParams(node); - } - } else { - if (kind !== "init") this.unexpected(); - node.method = false; - - if (this.eat(types.question)) { - optional = true; - } - - node.value = this.flowParseTypeInitialiser(); - node.variance = variance; - } - - node.optional = optional; - return this.finishNode(node, "ObjectTypeProperty"); - } - } - - flowCheckGetterSetterParams(property) { - const paramCount = property.kind === "get" ? 0 : 1; - const start = property.start; - const length = property.value.params.length + (property.value.rest ? 1 : 0); - - if (length !== paramCount) { - if (property.kind === "get") { - this.raise(start, ErrorMessages.BadGetterArity); - } else { - this.raise(start, ErrorMessages.BadSetterArity); - } - } - - if (property.kind === "set" && property.value.rest) { - this.raise(start, ErrorMessages.BadSetterRestParameter); - } - } - - flowObjectTypeSemicolon() { - if (!this.eat(types.semi) && !this.eat(types.comma) && !this.match(types.braceR) && !this.match(types.braceBarR)) { - this.unexpected(); - } - } - - flowParseQualifiedTypeIdentifier(startPos, startLoc, id) { - startPos = startPos || this.state.start; - startLoc = startLoc || this.state.startLoc; - let node = id || this.flowParseRestrictedIdentifier(true); - - while (this.eat(types.dot)) { - const node2 = this.startNodeAt(startPos, startLoc); - node2.qualification = node; - node2.id = this.flowParseRestrictedIdentifier(true); - node = this.finishNode(node2, "QualifiedTypeIdentifier"); - } - - return node; - } - - flowParseGenericType(startPos, startLoc, id) { - const node = this.startNodeAt(startPos, startLoc); - node.typeParameters = null; - node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } - - return this.finishNode(node, "GenericTypeAnnotation"); - } - - flowParseTypeofType() { - const node = this.startNode(); - this.expect(types._typeof); - node.argument = this.flowParsePrimaryType(); - return this.finishNode(node, "TypeofTypeAnnotation"); - } - - flowParseTupleType() { - const node = this.startNode(); - node.types = []; - this.expect(types.bracketL); - - while (this.state.pos < this.length && !this.match(types.bracketR)) { - node.types.push(this.flowParseType()); - if (this.match(types.bracketR)) break; - this.expect(types.comma); - } - - this.expect(types.bracketR); - return this.finishNode(node, "TupleTypeAnnotation"); - } - - flowParseFunctionTypeParam() { - let name = null; - let optional = false; - let typeAnnotation = null; - const node = this.startNode(); - const lh = this.lookahead(); - - if (lh.type === types.colon || lh.type === types.question) { - name = this.parseIdentifier(); + if (kind !== "init") this.unexpected(); + node.method = false; if (this.eat(types.question)) { optional = true; } - typeAnnotation = this.flowParseTypeInitialiser(); - } else { - typeAnnotation = this.flowParseType(); + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; } - node.name = name; node.optional = optional; - node.typeAnnotation = typeAnnotation; - return this.finishNode(node, "FunctionTypeParam"); + return this.finishNode(node, "ObjectTypeProperty"); + } + } + + flowCheckGetterSetterParams(property) { + const paramCount = property.kind === "get" ? 0 : 1; + const start = property.start; + const length = property.value.params.length + (property.value.rest ? 1 : 0); + + if (length !== paramCount) { + if (property.kind === "get") { + this.raise(start, ErrorMessages.BadGetterArity); + } else { + this.raise(start, ErrorMessages.BadSetterArity); + } } - reinterpretTypeAsFunctionTypeParam(type) { - const node = this.startNodeAt(type.start, type.loc.start); - node.name = null; - node.optional = false; - node.typeAnnotation = type; - return this.finishNode(node, "FunctionTypeParam"); + if (property.kind === "set" && property.value.rest) { + this.raise(start, ErrorMessages.BadSetterRestParameter); + } + } + + flowObjectTypeSemicolon() { + if (!this.eat(types.semi) && !this.eat(types.comma) && !this.match(types.braceR) && !this.match(types.braceBarR)) { + this.unexpected(); + } + } + + flowParseQualifiedTypeIdentifier(startPos, startLoc, id) { + startPos = startPos || this.state.start; + startLoc = startLoc || this.state.startLoc; + let node = id || this.flowParseRestrictedIdentifier(true); + + while (this.eat(types.dot)) { + const node2 = this.startNodeAt(startPos, startLoc); + node2.qualification = node; + node2.id = this.flowParseRestrictedIdentifier(true); + node = this.finishNode(node2, "QualifiedTypeIdentifier"); } - flowParseFunctionTypeParams(params = []) { - let rest = null; + return node; + } - while (!this.match(types.parenR) && !this.match(types.ellipsis)) { - params.push(this.flowParseFunctionTypeParam()); + flowParseGenericType(startPos, startLoc, id) { + const node = this.startNodeAt(startPos, startLoc); + node.typeParameters = null; + node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id); - if (!this.match(types.parenR)) { - this.expect(types.comma); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } + + return this.finishNode(node, "GenericTypeAnnotation"); + } + + flowParseTypeofType() { + const node = this.startNode(); + this.expect(types._typeof); + node.argument = this.flowParsePrimaryType(); + return this.finishNode(node, "TypeofTypeAnnotation"); + } + + flowParseTupleType() { + const node = this.startNode(); + node.types = []; + this.expect(types.bracketL); + + while (this.state.pos < this.length && !this.match(types.bracketR)) { + node.types.push(this.flowParseType()); + if (this.match(types.bracketR)) break; + this.expect(types.comma); + } + + this.expect(types.bracketR); + return this.finishNode(node, "TupleTypeAnnotation"); + } + + flowParseFunctionTypeParam() { + let name = null; + let optional = false; + let typeAnnotation = null; + const node = this.startNode(); + const lh = this.lookahead(); + + if (lh.type === types.colon || lh.type === types.question) { + name = this.parseIdentifier(); + + if (this.eat(types.question)) { + optional = true; + } + + typeAnnotation = this.flowParseTypeInitialiser(); + } else { + typeAnnotation = this.flowParseType(); + } + + node.name = name; + node.optional = optional; + node.typeAnnotation = typeAnnotation; + return this.finishNode(node, "FunctionTypeParam"); + } + + reinterpretTypeAsFunctionTypeParam(type) { + const node = this.startNodeAt(type.start, type.loc.start); + node.name = null; + node.optional = false; + node.typeAnnotation = type; + return this.finishNode(node, "FunctionTypeParam"); + } + + flowParseFunctionTypeParams(params = []) { + let rest = null; + + while (!this.match(types.parenR) && !this.match(types.ellipsis)) { + params.push(this.flowParseFunctionTypeParam()); + + if (!this.match(types.parenR)) { + this.expect(types.comma); + } + } + + if (this.eat(types.ellipsis)) { + rest = this.flowParseFunctionTypeParam(); + } + + return { + params, + rest + }; + } + + flowIdentToTypeAnnotation(startPos, startLoc, node, id) { + switch (id.name) { + case "any": + return this.finishNode(node, "AnyTypeAnnotation"); + + case "bool": + case "boolean": + return this.finishNode(node, "BooleanTypeAnnotation"); + + case "mixed": + return this.finishNode(node, "MixedTypeAnnotation"); + + case "empty": + return this.finishNode(node, "EmptyTypeAnnotation"); + + case "number": + return this.finishNode(node, "NumberTypeAnnotation"); + + case "string": + return this.finishNode(node, "StringTypeAnnotation"); + + case "symbol": + return this.finishNode(node, "SymbolTypeAnnotation"); + + default: + this.checkNotUnderscore(id.name); + return this.flowParseGenericType(startPos, startLoc, id); + } + } + + flowParsePrimaryType() { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const node = this.startNode(); + let tmp; + let type; + let isGroupedType = false; + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + + switch (this.state.type) { + case types.name: + if (this.isContextual("interface")) { + return this.flowParseInterfaceType(); } - } - if (this.eat(types.ellipsis)) { - rest = this.flowParseFunctionTypeParam(); - } + return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier()); - return { - params, - rest - }; - } + case types.braceL: + return this.flowParseObjectType({ + allowStatic: false, + allowExact: false, + allowSpread: true, + allowProto: false, + allowInexact: true + }); - flowIdentToTypeAnnotation(startPos, startLoc, node, id) { - switch (id.name) { - case "any": - return this.finishNode(node, "AnyTypeAnnotation"); + case types.braceBarL: + return this.flowParseObjectType({ + allowStatic: false, + allowExact: true, + allowSpread: true, + allowProto: false, + allowInexact: false + }); - case "bool": - case "boolean": - return this.finishNode(node, "BooleanTypeAnnotation"); - - case "mixed": - return this.finishNode(node, "MixedTypeAnnotation"); - - case "empty": - return this.finishNode(node, "EmptyTypeAnnotation"); - - case "number": - return this.finishNode(node, "NumberTypeAnnotation"); - - case "string": - return this.finishNode(node, "StringTypeAnnotation"); - - case "symbol": - return this.finishNode(node, "SymbolTypeAnnotation"); - - default: - this.checkNotUnderscore(id.name); - return this.flowParseGenericType(startPos, startLoc, id); - } - } - - flowParsePrimaryType() { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const node = this.startNode(); - let tmp; - let type; - let isGroupedType = false; - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - - switch (this.state.type) { - case types.name: - if (this.isContextual("interface")) { - return this.flowParseInterfaceType(); - } - - return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier()); - - case types.braceL: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: false, - allowSpread: true, - allowProto: false, - allowInexact: true - }); - - case types.braceBarL: - return this.flowParseObjectType({ - allowStatic: false, - allowExact: true, - allowSpread: true, - allowProto: false, - allowInexact: false - }); - - case types.bracketL: - this.state.noAnonFunctionType = false; - type = this.flowParseTupleType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - return type; - - case types.relational: - if (this.state.value === "<") { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - this.expect(types.parenL); - tmp = this.flowParseFunctionTypeParams(); - node.params = tmp.params; - node.rest = tmp.rest; - this.expect(types.parenR); - this.expect(types.arrow); - node.returnType = this.flowParseType(); - return this.finishNode(node, "FunctionTypeAnnotation"); - } - - break; - - case types.parenL: - this.next(); - - if (!this.match(types.parenR) && !this.match(types.ellipsis)) { - if (this.match(types.name)) { - const token = this.lookahead().type; - isGroupedType = token !== types.question && token !== types.colon; - } else { - isGroupedType = true; - } - } - - if (isGroupedType) { - this.state.noAnonFunctionType = false; - type = this.flowParseType(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - - if (this.state.noAnonFunctionType || !(this.match(types.comma) || this.match(types.parenR) && this.lookahead().type === types.arrow)) { - this.expect(types.parenR); - return type; - } else { - this.eat(types.comma); - } - } - - if (type) { - tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); - } else { - tmp = this.flowParseFunctionTypeParams(); - } + case types.bracketL: + this.state.noAnonFunctionType = false; + type = this.flowParseTupleType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + return type; + case types.relational: + if (this.state.value === "<") { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + this.expect(types.parenL); + tmp = this.flowParseFunctionTypeParams(); node.params = tmp.params; node.rest = tmp.rest; this.expect(types.parenR); this.expect(types.arrow); node.returnType = this.flowParseType(); - node.typeParameters = null; return this.finishNode(node, "FunctionTypeAnnotation"); + } - case types.string: - return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); + break; - case types._true: - case types._false: - node.value = this.match(types._true); - this.next(); - return this.finishNode(node, "BooleanLiteralTypeAnnotation"); + case types.parenL: + this.next(); - case types.plusMin: - if (this.state.value === "-") { - this.next(); - - if (this.match(types.num)) { - return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start); - } - - if (this.match(types.bigint)) { - return this.parseLiteral(-this.state.value, "BigIntLiteralTypeAnnotation", node.start, node.loc.start); - } - - throw this.raise(this.state.start, FlowErrors.UnexpectedSubtractionOperand); + if (!this.match(types.parenR) && !this.match(types.ellipsis)) { + if (this.match(types.name)) { + const token = this.lookahead().type; + isGroupedType = token !== types.question && token !== types.colon; + } else { + isGroupedType = true; } + } - throw this.unexpected(); + if (isGroupedType) { + this.state.noAnonFunctionType = false; + type = this.flowParseType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; - case types.num: - return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); - - case types.bigint: - return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); - - case types._void: - this.next(); - return this.finishNode(node, "VoidTypeAnnotation"); - - case types._null: - this.next(); - return this.finishNode(node, "NullLiteralTypeAnnotation"); - - case types._this: - this.next(); - return this.finishNode(node, "ThisTypeAnnotation"); - - case types.star: - this.next(); - return this.finishNode(node, "ExistsTypeAnnotation"); - - default: - if (this.state.type.keyword === "typeof") { - return this.flowParseTypeofType(); - } else if (this.state.type.keyword) { - const label = this.state.type.label; - this.next(); - return super.createIdentifier(node, label); + if (this.state.noAnonFunctionType || !(this.match(types.comma) || this.match(types.parenR) && this.lookahead().type === types.arrow)) { + this.expect(types.parenR); + return type; + } else { + this.eat(types.comma); } + } - } + if (type) { + tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); + } else { + tmp = this.flowParseFunctionTypeParams(); + } - throw this.unexpected(); - } - - flowParsePostfixType() { - const startPos = this.state.start, - startLoc = this.state.startLoc; - let type = this.flowParsePrimaryType(); - - while (this.match(types.bracketL) && !this.canInsertSemicolon()) { - const node = this.startNodeAt(startPos, startLoc); - node.elementType = type; - this.expect(types.bracketL); - this.expect(types.bracketR); - type = this.finishNode(node, "ArrayTypeAnnotation"); - } - - return type; - } - - flowParsePrefixType() { - const node = this.startNode(); - - if (this.eat(types.question)) { - node.typeAnnotation = this.flowParsePrefixType(); - return this.finishNode(node, "NullableTypeAnnotation"); - } else { - return this.flowParsePostfixType(); - } - } - - flowParseAnonFunctionWithoutParens() { - const param = this.flowParsePrefixType(); - - if (!this.state.noAnonFunctionType && this.eat(types.arrow)) { - const node = this.startNodeAt(param.start, param.loc.start); - node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; - node.rest = null; + node.params = tmp.params; + node.rest = tmp.rest; + this.expect(types.parenR); + this.expect(types.arrow); node.returnType = this.flowParseType(); node.typeParameters = null; return this.finishNode(node, "FunctionTypeAnnotation"); - } - return param; - } - - flowParseIntersectionType() { - const node = this.startNode(); - this.eat(types.bitwiseAND); - const type = this.flowParseAnonFunctionWithoutParens(); - node.types = [type]; - - while (this.eat(types.bitwiseAND)) { - node.types.push(this.flowParseAnonFunctionWithoutParens()); - } - - return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); - } - - flowParseUnionType() { - const node = this.startNode(); - this.eat(types.bitwiseOR); - const type = this.flowParseIntersectionType(); - node.types = [type]; - - while (this.eat(types.bitwiseOR)) { - node.types.push(this.flowParseIntersectionType()); - } - - return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); - } - - flowParseType() { - const oldInType = this.state.inType; - this.state.inType = true; - const type = this.flowParseUnionType(); - this.state.inType = oldInType; - this.state.exprAllowed = this.state.exprAllowed || this.state.noAnonFunctionType; - return type; - } - - flowParseTypeOrImplicitInstantiation() { - if (this.state.type === types.name && this.state.value === "_") { - const startPos = this.state.start; - const startLoc = this.state.startLoc; - const node = this.parseIdentifier(); - return this.flowParseGenericType(startPos, startLoc, node); - } else { - return this.flowParseType(); - } - } - - flowParseTypeAnnotation() { - const node = this.startNode(); - node.typeAnnotation = this.flowParseTypeInitialiser(); - return this.finishNode(node, "TypeAnnotation"); - } - - flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { - const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); - - if (this.match(types.colon)) { - ident.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(ident); - } - - return ident; - } - - typeCastToParameter(node) { - node.expression.typeAnnotation = node.typeAnnotation; - this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end); - return node.expression; - } - - flowParseVariance() { - let variance = null; - - if (this.match(types.plusMin)) { - variance = this.startNode(); - - if (this.state.value === "+") { - variance.kind = "plus"; - } else { - variance.kind = "minus"; - } + case types.string: + return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); + case types._true: + case types._false: + node.value = this.match(types._true); this.next(); - this.finishNode(variance, "Variance"); - } + return this.finishNode(node, "BooleanLiteralTypeAnnotation"); - return variance; - } - - parseFunctionBody(node, allowExpressionBody, isMethod = false) { - if (allowExpressionBody) { - return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); - } - - return super.parseFunctionBody(node, false, isMethod); - } - - parseFunctionBodyAndFinish(node, type, isMethod = false) { - if (this.match(types.colon)) { - const typeNode = this.startNode(); - [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; - } - - super.parseFunctionBodyAndFinish(node, type, isMethod); - } - - parseStatement(context, topLevel) { - if (this.state.strict && this.match(types.name) && this.state.value === "interface") { - const lookahead = this.lookahead(); - - if (lookahead.type === types.name || isKeyword(lookahead.value)) { - const node = this.startNode(); + case types.plusMin: + if (this.state.value === "-") { this.next(); - return this.flowParseInterface(node); + + if (this.match(types.num)) { + return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start); + } + + if (this.match(types.bigint)) { + return this.parseLiteral(-this.state.value, "BigIntLiteralTypeAnnotation", node.start, node.loc.start); + } + + throw this.raise(this.state.start, FlowErrors.UnexpectedSubtractionOperand); } - } else if (this.shouldParseEnums() && this.isContextual("enum")) { - const node = this.startNode(); + + throw this.unexpected(); + + case types.num: + return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); + + case types.bigint: + return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); + + case types._void: this.next(); - return this.flowParseEnumDeclaration(node); + return this.finishNode(node, "VoidTypeAnnotation"); + + case types._null: + this.next(); + return this.finishNode(node, "NullLiteralTypeAnnotation"); + + case types._this: + this.next(); + return this.finishNode(node, "ThisTypeAnnotation"); + + case types.star: + this.next(); + return this.finishNode(node, "ExistsTypeAnnotation"); + + default: + if (this.state.type.keyword === "typeof") { + return this.flowParseTypeofType(); + } else if (this.state.type.keyword) { + const label = this.state.type.label; + this.next(); + return super.createIdentifier(node, label); + } + + } + + throw this.unexpected(); + } + + flowParsePostfixType() { + const startPos = this.state.start, + startLoc = this.state.startLoc; + let type = this.flowParsePrimaryType(); + + while (this.match(types.bracketL) && !this.canInsertSemicolon()) { + const node = this.startNodeAt(startPos, startLoc); + node.elementType = type; + this.expect(types.bracketL); + this.expect(types.bracketR); + type = this.finishNode(node, "ArrayTypeAnnotation"); + } + + return type; + } + + flowParsePrefixType() { + const node = this.startNode(); + + if (this.eat(types.question)) { + node.typeAnnotation = this.flowParsePrefixType(); + return this.finishNode(node, "NullableTypeAnnotation"); + } else { + return this.flowParsePostfixType(); + } + } + + flowParseAnonFunctionWithoutParens() { + const param = this.flowParsePrefixType(); + + if (!this.state.noAnonFunctionType && this.eat(types.arrow)) { + const node = this.startNodeAt(param.start, param.loc.start); + node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; + node.rest = null; + node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); + } + + return param; + } + + flowParseIntersectionType() { + const node = this.startNode(); + this.eat(types.bitwiseAND); + const type = this.flowParseAnonFunctionWithoutParens(); + node.types = [type]; + + while (this.eat(types.bitwiseAND)) { + node.types.push(this.flowParseAnonFunctionWithoutParens()); + } + + return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); + } + + flowParseUnionType() { + const node = this.startNode(); + this.eat(types.bitwiseOR); + const type = this.flowParseIntersectionType(); + node.types = [type]; + + while (this.eat(types.bitwiseOR)) { + node.types.push(this.flowParseIntersectionType()); + } + + return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); + } + + flowParseType() { + const oldInType = this.state.inType; + this.state.inType = true; + const type = this.flowParseUnionType(); + this.state.inType = oldInType; + this.state.exprAllowed = this.state.exprAllowed || this.state.noAnonFunctionType; + return type; + } + + flowParseTypeOrImplicitInstantiation() { + if (this.state.type === types.name && this.state.value === "_") { + const startPos = this.state.start; + const startLoc = this.state.startLoc; + const node = this.parseIdentifier(); + return this.flowParseGenericType(startPos, startLoc, node); + } else { + return this.flowParseType(); + } + } + + flowParseTypeAnnotation() { + const node = this.startNode(); + node.typeAnnotation = this.flowParseTypeInitialiser(); + return this.finishNode(node, "TypeAnnotation"); + } + + flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { + const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); + + if (this.match(types.colon)) { + ident.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(ident); + } + + return ident; + } + + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end); + return node.expression; + } + + flowParseVariance() { + let variance = null; + + if (this.match(types.plusMin)) { + variance = this.startNode(); + + if (this.state.value === "+") { + variance.kind = "plus"; + } else { + variance.kind = "minus"; } + this.next(); + this.finishNode(variance, "Variance"); + } + + return variance; + } + + parseFunctionBody(node, allowExpressionBody, isMethod = false) { + if (allowExpressionBody) { + return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); + } + + return super.parseFunctionBody(node, false, isMethod); + } + + parseFunctionBodyAndFinish(node, type, isMethod = false) { + if (this.match(types.colon)) { + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; + } + + super.parseFunctionBodyAndFinish(node, type, isMethod); + } + + parseStatement(context, topLevel) { + if (this.state.strict && this.match(types.name) && this.state.value === "interface") { + const node = this.startNode(); + this.next(); + return this.flowParseInterface(node); + } else if (this.shouldParseEnums() && this.isContextual("enum")) { + const node = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(node); + } else { const stmt = super.parseStatement(context, topLevel); if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { @@ -2622,1445 +2595,1429 @@ var flow = (superClass => { return stmt; } + } - parseExpressionStatement(node, expr) { - if (expr.type === "Identifier") { - if (expr.name === "declare") { - if (this.match(types._class) || this.match(types.name) || this.match(types._function) || this.match(types._var) || this.match(types._export)) { - return this.flowParseDeclare(node); - } - } else if (this.match(types.name)) { - if (expr.name === "interface") { - return this.flowParseInterface(node); - } else if (expr.name === "type") { - return this.flowParseTypeAlias(node); - } else if (expr.name === "opaque") { - return this.flowParseOpaqueType(node, false); - } + parseExpressionStatement(node, expr) { + if (expr.type === "Identifier") { + if (expr.name === "declare") { + if (this.match(types._class) || this.match(types.name) || this.match(types._function) || this.match(types._var) || this.match(types._export)) { + return this.flowParseDeclare(node); + } + } else if (this.match(types.name)) { + if (expr.name === "interface") { + return this.flowParseInterface(node); + } else if (expr.name === "type") { + return this.flowParseTypeAlias(node); + } else if (expr.name === "opaque") { + return this.flowParseOpaqueType(node, false); } } - - return super.parseExpressionStatement(node, expr); } - shouldParseExportDeclaration() { - return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || this.shouldParseEnums() && this.isContextual("enum") || super.shouldParseExportDeclaration(); - } + return super.parseExpressionStatement(node, expr); + } - isExportDefaultSpecifier() { - if (this.match(types.name) && (this.state.value === "type" || this.state.value === "interface" || this.state.value === "opaque" || this.shouldParseEnums() && this.state.value === "enum")) { - return false; - } - - return super.isExportDefaultSpecifier(); - } - - parseExportDefaultExpression() { - if (this.shouldParseEnums() && this.isContextual("enum")) { - const node = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(node); - } - - return super.parseExportDefaultExpression(); - } - - parseConditional(expr, startPos, startLoc, refNeedsArrowPos) { - if (!this.match(types.question)) return expr; - - if (refNeedsArrowPos) { - const result = this.tryParse(() => super.parseConditional(expr, startPos, startLoc)); - - if (!result.node) { - refNeedsArrowPos.start = result.error.pos || this.state.start; - return expr; - } - - if (result.error) this.state = result.failState; - return result.node; - } - - this.expect(types.question); - const state = this.state.clone(); - const originalNoArrowAt = this.state.noArrowAt; - const node = this.startNodeAt(startPos, startLoc); - let { - consequent, - failed - } = this.tryParseConditionalConsequent(); - let [valid, invalid] = this.getArrowLikeExpressions(consequent); - - if (failed || invalid.length > 0) { - const noArrowAt = [...originalNoArrowAt]; - - if (invalid.length > 0) { - this.state = state; - this.state.noArrowAt = noArrowAt; - - for (let i = 0; i < invalid.length; i++) { - noArrowAt.push(invalid[i].start); - } - - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); - [valid, invalid] = this.getArrowLikeExpressions(consequent); - } - - if (failed && valid.length > 1) { - this.raise(state.start, FlowErrors.AmbiguousConditionalArrow); - } - - if (failed && valid.length === 1) { - this.state = state; - this.state.noArrowAt = noArrowAt.concat(valid[0].start); - ({ - consequent, - failed - } = this.tryParseConditionalConsequent()); - } - } - - this.getArrowLikeExpressions(consequent, true); - this.state.noArrowAt = originalNoArrowAt; - this.expect(types.colon); - node.test = expr; - node.consequent = consequent; - node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined, undefined)); - return this.finishNode(node, "ConditionalExpression"); - } - - tryParseConditionalConsequent() { - this.state.noArrowParamsConversionAt.push(this.state.start); - const consequent = this.parseMaybeAssignAllowIn(); - const failed = !this.match(types.colon); - this.state.noArrowParamsConversionAt.pop(); - return { - consequent, - failed - }; - } - - getArrowLikeExpressions(node, disallowInvalid) { - const stack = [node]; - const arrows = []; - - while (stack.length !== 0) { - const node = stack.pop(); - - if (node.type === "ArrowFunctionExpression") { - if (node.typeParameters || !node.returnType) { - this.finishArrowValidation(node); - } else { - arrows.push(node); - } - - stack.push(node.body); - } else if (node.type === "ConditionalExpression") { - stack.push(node.consequent); - stack.push(node.alternate); - } - } - - if (disallowInvalid) { - arrows.forEach(node => this.finishArrowValidation(node)); - return [arrows, []]; - } - - return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); - } - - finishArrowValidation(node) { - var _node$extra; - - this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingComma, false); - this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); - super.checkParams(node, false, true); - this.scope.exit(); - } - - forwardNoArrowParamsConversionAt(node, parse) { - let result; - - if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - this.state.noArrowParamsConversionAt.push(this.state.start); - result = parse(); - this.state.noArrowParamsConversionAt.pop(); - } else { - result = parse(); - } - - return result; - } - - parseParenItem(node, startPos, startLoc) { - node = super.parseParenItem(node, startPos, startLoc); - - if (this.eat(types.question)) { - node.optional = true; - this.resetEndLocation(node); - } - - if (this.match(types.colon)) { - const typeCastNode = this.startNodeAt(startPos, startLoc); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TypeCastExpression"); - } - - return node; - } - - assertModuleNodeAllowed(node) { - if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { - return; - } - - super.assertModuleNodeAllowed(node); - } - - parseExport(node) { - const decl = super.parseExport(node); - - if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") { - decl.exportKind = decl.exportKind || "value"; - } - - return decl; - } - - parseExportDeclaration(node) { - if (this.isContextual("type")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - - if (this.match(types.braceL)) { - node.specifiers = this.parseExportSpecifiers(); - this.parseExportFrom(node); - return null; - } else { - return this.flowParseTypeAlias(declarationNode); - } - } else if (this.isContextual("opaque")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseOpaqueType(declarationNode, false); - } else if (this.isContextual("interface")) { - node.exportKind = "type"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseInterface(declarationNode); - } else if (this.shouldParseEnums() && this.isContextual("enum")) { - node.exportKind = "value"; - const declarationNode = this.startNode(); - this.next(); - return this.flowParseEnumDeclaration(declarationNode); - } else { - return super.parseExportDeclaration(node); - } - } - - eatExportStar(node) { - if (super.eatExportStar(...arguments)) return true; - - if (this.isContextual("type") && this.lookahead().type === types.star) { - node.exportKind = "type"; - this.next(); - this.next(); - return true; - } + shouldParseExportDeclaration() { + return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || this.shouldParseEnums() && this.isContextual("enum") || super.shouldParseExportDeclaration(); + } + isExportDefaultSpecifier() { + if (this.match(types.name) && (this.state.value === "type" || this.state.value === "interface" || this.state.value === "opaque" || this.shouldParseEnums() && this.state.value === "enum")) { return false; } - maybeParseExportNamespaceSpecifier(node) { - const pos = this.state.start; - const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); + return super.isExportDefaultSpecifier(); + } - if (hasNamespace && node.exportKind === "type") { - this.unexpected(pos); - } - - return hasNamespace; + parseExportDefaultExpression() { + if (this.shouldParseEnums() && this.isContextual("enum")) { + const node = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(node); } - parseClassId(node, isStatement, optionalId) { - super.parseClassId(node, isStatement, optionalId); + return super.parseExportDefaultExpression(); + } - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); + parseConditional(expr, startPos, startLoc, refNeedsArrowPos) { + if (!this.match(types.question)) return expr; + + if (refNeedsArrowPos) { + const result = this.tryParse(() => super.parseConditional(expr, startPos, startLoc)); + + if (!result.node) { + refNeedsArrowPos.start = result.error.pos || this.state.start; + return expr; } + + if (result.error) this.state = result.failState; + return result.node; } - parseClassMember(classBody, member, state) { - const pos = this.state.start; + this.expect(types.question); + const state = this.state.clone(); + const originalNoArrowAt = this.state.noArrowAt; + const node = this.startNodeAt(startPos, startLoc); + let { + consequent, + failed + } = this.tryParseConditionalConsequent(); + let [valid, invalid] = this.getArrowLikeExpressions(consequent); - if (this.isContextual("declare")) { - if (this.parseClassMemberFromModifier(classBody, member)) { - return; + if (failed || invalid.length > 0) { + const noArrowAt = [...originalNoArrowAt]; + + if (invalid.length > 0) { + this.state = state; + this.state.noArrowAt = noArrowAt; + + for (let i = 0; i < invalid.length; i++) { + noArrowAt.push(invalid[i].start); } - member.declare = true; + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); + [valid, invalid] = this.getArrowLikeExpressions(consequent); } - super.parseClassMember(classBody, member, state); + if (failed && valid.length > 1) { + this.raise(state.start, FlowErrors.AmbiguousConditionalArrow); + } - if (member.declare) { - if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty") { - this.raise(pos, FlowErrors.DeclareClassElement); - } else if (member.value) { - this.raise(member.value.start, FlowErrors.DeclareClassFieldInitializer); - } + if (failed && valid.length === 1) { + this.state = state; + this.state.noArrowAt = noArrowAt.concat(valid[0].start); + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); } } - getTokenFromCode(code) { - const next = this.input.charCodeAt(this.state.pos + 1); - - if (code === 123 && next === 124) { - return this.finishOp(types.braceBarL, 2); - } else if (this.state.inType && (code === 62 || code === 60)) { - return this.finishOp(types.relational, 1); - } else if (this.state.inType && code === 63) { - return this.finishOp(types.question, 1); - } else if (isIteratorStart(code, next)) { - this.state.isIterator = true; - return super.readWord(); - } else { - return super.getTokenFromCode(code); - } - } - - isAssignable(node, isBinding) { - switch (node.type) { - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - return true; - - case "ObjectExpression": - { - const last = node.properties.length - 1; - return node.properties.every((prop, i) => { - return prop.type !== "ObjectMethod" && (i === last || prop.type === "SpreadElement") && this.isAssignable(prop); - }); - } - - case "ObjectProperty": - return this.isAssignable(node.value); - - case "SpreadElement": - return this.isAssignable(node.argument); - - case "ArrayExpression": - return node.elements.every(element => this.isAssignable(element)); - - case "AssignmentExpression": - return node.operator === "="; - - case "ParenthesizedExpression": - case "TypeCastExpression": - return this.isAssignable(node.expression); - - case "MemberExpression": - case "OptionalMemberExpression": - return !isBinding; - - default: - return false; - } - } - - toAssignable(node, isLHS = false) { - if (node.type === "TypeCastExpression") { - return super.toAssignable(this.typeCastToParameter(node), isLHS); - } else { - return super.toAssignable(node, isLHS); - } - } - - toAssignableList(exprList, trailingCommaPos, isLHS) { - for (let i = 0; i < exprList.length; i++) { - const expr = exprList[i]; - - if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { - exprList[i] = this.typeCastToParameter(expr); - } - } - - return super.toAssignableList(exprList, trailingCommaPos, isLHS); - } - - toReferencedList(exprList, isParenthesizedExpr) { - for (let i = 0; i < exprList.length; i++) { - var _expr$extra; - - const expr = exprList[i]; - - if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) == null ? void 0 : _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { - this.raise(expr.typeAnnotation.start, FlowErrors.TypeCastInPattern); - } - } - - return exprList; - } - - parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { - const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); - - if (canBePattern && !this.state.maybeInArrowParameters) { - this.toReferencedList(node.elements); - } - - return node; - } - - checkLVal(expr, ...args) { - if (expr.type !== "TypeCastExpression") { - return super.checkLVal(expr, ...args); - } - } - - parseClassProperty(node) { - if (this.match(types.colon)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - - return super.parseClassProperty(node); - } - - parseClassPrivateProperty(node) { - if (this.match(types.colon)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - - return super.parseClassPrivateProperty(node); - } - - isClassMethod() { - return this.isRelational("<") || super.isClassMethod(); - } - - isClassProperty() { - return this.match(types.colon) || super.isClassProperty(); - } - - isNonstaticConstructor(method) { - return !this.match(types.colon) && super.isNonstaticConstructor(method); - } - - pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { - if (method.variance) { - this.unexpected(method.variance.start); - } - - delete method.variance; - - if (this.isRelational("<")) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); - } - - pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { - if (method.variance) { - this.unexpected(method.variance.start); - } - - delete method.variance; - - if (this.isRelational("<")) { - method.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); - } - - parseClassSuper(node) { - super.parseClassSuper(node); - - if (node.superClass && this.isRelational("<")) { - node.superTypeParameters = this.flowParseTypeParameterInstantiation(); - } - - if (this.isContextual("implements")) { - this.next(); - const implemented = node.implements = []; - - do { - const node = this.startNode(); - node.id = this.flowParseRestrictedIdentifier(true); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - - implemented.push(this.finishNode(node, "ClassImplements")); - } while (this.eat(types.comma)); - } - } - - parsePropertyName(node, isPrivateNameAllowed) { - const variance = this.flowParseVariance(); - const key = super.parsePropertyName(node, isPrivateNameAllowed); - node.variance = variance; - return key; - } - - parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { - if (prop.variance) { - this.unexpected(prop.variance.start); - } - - delete prop.variance; - let typeParameters; - - if (this.isRelational("<") && !isAccessor) { - typeParameters = this.flowParseTypeParameterDeclaration(); - if (!this.match(types.parenL)) this.unexpected(); - } - - super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); - - if (typeParameters) { - (prop.value || prop).typeParameters = typeParameters; - } - } - - parseAssignableListItemTypes(param) { - if (this.eat(types.question)) { - if (param.type !== "Identifier") { - this.raise(param.start, FlowErrors.OptionalBindingPattern); - } - - param.optional = true; - } - - if (this.match(types.colon)) { - param.typeAnnotation = this.flowParseTypeAnnotation(); - } - - this.resetEndLocation(param); - return param; - } - - parseMaybeDefault(startPos, startLoc, left) { - const node = super.parseMaybeDefault(startPos, startLoc, left); - - if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { - this.raise(node.typeAnnotation.start, FlowErrors.TypeBeforeInitializer); - } - - return node; - } - - shouldParseDefaultImport(node) { - if (!hasTypeImportKind(node)) { - return super.shouldParseDefaultImport(node); - } - - return isMaybeDefaultImport(this.state); - } - - parseImportSpecifierLocal(node, specifier, type, contextDescription) { - specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); - this.checkLVal(specifier.local, contextDescription, BIND_LEXICAL); - node.specifiers.push(this.finishNode(specifier, type)); - } - - maybeParseDefaultImportSpecifier(node) { - node.importKind = "value"; - let kind = null; - - if (this.match(types._typeof)) { - kind = "typeof"; - } else if (this.isContextual("type")) { - kind = "type"; - } - - if (kind) { - const lh = this.lookahead(); - - if (kind === "type" && lh.type === types.star) { - this.unexpected(lh.start); - } - - if (isMaybeDefaultImport(lh) || lh.type === types.braceL || lh.type === types.star) { - this.next(); - node.importKind = kind; - } - } - - return super.maybeParseDefaultImportSpecifier(node); - } - - parseImportSpecifier(node) { - const specifier = this.startNode(); - const firstIdentLoc = this.state.start; - const firstIdent = this.parseModuleExportName(); - let specifierTypeKind = null; - - if (firstIdent.type === "Identifier") { - if (firstIdent.name === "type") { - specifierTypeKind = "type"; - } else if (firstIdent.name === "typeof") { - specifierTypeKind = "typeof"; - } - } - - let isBinding = false; - - if (this.isContextual("as") && !this.isLookaheadContextual("as")) { - const as_ident = this.parseIdentifier(true); - - if (specifierTypeKind !== null && !this.match(types.name) && !this.state.type.keyword) { - specifier.imported = as_ident; - specifier.importKind = specifierTypeKind; - specifier.local = as_ident.__clone(); + this.getArrowLikeExpressions(consequent, true); + this.state.noArrowAt = originalNoArrowAt; + this.expect(types.colon); + node.test = expr; + node.consequent = consequent; + node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined, undefined)); + return this.finishNode(node, "ConditionalExpression"); + } + + tryParseConditionalConsequent() { + this.state.noArrowParamsConversionAt.push(this.state.start); + const consequent = this.parseMaybeAssignAllowIn(); + const failed = !this.match(types.colon); + this.state.noArrowParamsConversionAt.pop(); + return { + consequent, + failed + }; + } + + getArrowLikeExpressions(node, disallowInvalid) { + const stack = [node]; + const arrows = []; + + while (stack.length !== 0) { + const node = stack.pop(); + + if (node.type === "ArrowFunctionExpression") { + if (node.typeParameters || !node.returnType) { + this.finishArrowValidation(node); } else { - specifier.imported = firstIdent; - specifier.importKind = null; - specifier.local = this.parseIdentifier(); + arrows.push(node); } - } else if (specifierTypeKind !== null && (this.match(types.name) || this.state.type.keyword)) { - specifier.imported = this.parseIdentifier(true); - specifier.importKind = specifierTypeKind; - if (this.eatContextual("as")) { - specifier.local = this.parseIdentifier(); - } else { - isBinding = true; - specifier.local = specifier.imported.__clone(); - } + stack.push(node.body); + } else if (node.type === "ConditionalExpression") { + stack.push(node.consequent); + stack.push(node.alternate); + } + } + + if (disallowInvalid) { + arrows.forEach(node => this.finishArrowValidation(node)); + return [arrows, []]; + } + + return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); + } + + finishArrowValidation(node) { + var _node$extra; + + this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingComma); + this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW); + super.checkParams(node, false, true); + this.scope.exit(); + } + + forwardNoArrowParamsConversionAt(node, parse) { + let result; + + if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { + this.state.noArrowParamsConversionAt.push(this.state.start); + result = parse(); + this.state.noArrowParamsConversionAt.pop(); + } else { + result = parse(); + } + + return result; + } + + parseParenItem(node, startPos, startLoc) { + node = super.parseParenItem(node, startPos, startLoc); + + if (this.eat(types.question)) { + node.optional = true; + this.resetEndLocation(node); + } + + if (this.match(types.colon)) { + const typeCastNode = this.startNodeAt(startPos, startLoc); + typeCastNode.expression = node; + typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); + return this.finishNode(typeCastNode, "TypeCastExpression"); + } + + return node; + } + + assertModuleNodeAllowed(node) { + if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { + return; + } + + super.assertModuleNodeAllowed(node); + } + + parseExport(node) { + const decl = super.parseExport(node); + + if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") { + decl.exportKind = decl.exportKind || "value"; + } + + return decl; + } + + parseExportDeclaration(node) { + if (this.isContextual("type")) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + + if (this.match(types.braceL)) { + node.specifiers = this.parseExportSpecifiers(); + this.parseExportFrom(node); + return null; } else { - if (firstIdent.type === "StringLiteral") { - throw this.raise(specifier.start, ErrorMessages.ImportBindingIsString, firstIdent.value); - } - - isBinding = true; - specifier.imported = firstIdent; - specifier.importKind = null; - specifier.local = specifier.imported.__clone(); + return this.flowParseTypeAlias(declarationNode); } + } else if (this.isContextual("opaque")) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseOpaqueType(declarationNode, false); + } else if (this.isContextual("interface")) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseInterface(declarationNode); + } else if (this.shouldParseEnums() && this.isContextual("enum")) { + node.exportKind = "value"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(declarationNode); + } else { + return super.parseExportDeclaration(node); + } + } - const nodeIsTypeImport = hasTypeImportKind(node); - const specifierIsTypeImport = hasTypeImportKind(specifier); + eatExportStar(node) { + if (super.eatExportStar(...arguments)) return true; - if (nodeIsTypeImport && specifierIsTypeImport) { - this.raise(firstIdentLoc, FlowErrors.ImportTypeShorthandOnlyInPureImport); - } - - if (nodeIsTypeImport || specifierIsTypeImport) { - this.checkReservedType(specifier.local.name, specifier.local.start, true); - } - - if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) { - this.checkReservedWord(specifier.local.name, specifier.start, true, true); - } - - this.checkLVal(specifier.local, "import specifier", BIND_LEXICAL); - node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); + if (this.isContextual("type") && this.lookahead().type === types.star) { + node.exportKind = "type"; + this.next(); + this.next(); + return true; } - parseFunctionParams(node, allowModifiers) { - const kind = node.kind; + return false; + } - if (kind !== "get" && kind !== "set" && this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } + maybeParseExportNamespaceSpecifier(node) { + const pos = this.state.start; + const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); - super.parseFunctionParams(node, allowModifiers); + if (hasNamespace && node.exportKind === "type") { + this.unexpected(pos); } - parseVarId(decl, kind) { - super.parseVarId(decl, kind); + return hasNamespace; + } - if (this.match(types.colon)) { - decl.id.typeAnnotation = this.flowParseTypeAnnotation(); - this.resetEndLocation(decl.id); - } + parseClassId(node, isStatement, optionalId) { + super.parseClassId(node, isStatement, optionalId); + + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); } + } - parseAsyncArrowFromCallExpression(node, call) { - if (this.match(types.colon)) { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - node.returnType = this.flowParseTypeAnnotation(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - } + parseClassMember(classBody, member, state, constructorAllowsSuper) { + const pos = this.state.start; - return super.parseAsyncArrowFromCallExpression(node, call); - } - - shouldParseAsyncArrow() { - return this.match(types.colon) || super.shouldParseAsyncArrow(); - } - - parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos) { - var _jsx; - - let state = null; - let jsx; - - if (this.hasPlugin("jsx") && (this.match(types.jsxTagStart) || this.isRelational("<"))) { - state = this.state.clone(); - jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos), state); - if (!jsx.error) return jsx.node; - const { - context - } = this.state; - - if (context[context.length - 1] === types$1.j_oTag) { - context.length -= 2; - } else if (context[context.length - 1] === types$1.j_expr) { - context.length -= 1; - } - } - - if (((_jsx = jsx) == null ? void 0 : _jsx.error) || this.isRelational("<")) { - var _jsx2, _jsx3; - - state = state || this.state.clone(); - let typeParameters; - const arrow = this.tryParse(abort => { - var _arrowExpression$extr; - - typeParameters = this.flowParseTypeParameterDeclaration(); - const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { - const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos); - this.resetStartLocationFromNode(result, typeParameters); - return result; - }); - - if (arrowExpression.type !== "ArrowFunctionExpression" && ((_arrowExpression$extr = arrowExpression.extra) == null ? void 0 : _arrowExpression$extr.parenthesized)) { - abort(); - } - - const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); - expr.typeParameters = typeParameters; - this.resetStartLocationFromNode(expr, typeParameters); - return arrowExpression; - }, state); - let arrowExpression = null; - - if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { - if (!arrow.error && !arrow.aborted) { - if (arrow.node.async) { - this.raise(typeParameters.start, FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction); - } - - return arrow.node; - } - - arrowExpression = arrow.node; - } - - if ((_jsx2 = jsx) == null ? void 0 : _jsx2.node) { - this.state = jsx.failState; - return jsx.node; - } - - if (arrowExpression) { - this.state = arrow.failState; - return arrowExpression; - } - - if ((_jsx3 = jsx) == null ? void 0 : _jsx3.thrown) throw jsx.error; - if (arrow.thrown) throw arrow.error; - throw this.raise(typeParameters.start, FlowErrors.UnexpectedTokenAfterTypeParameter); - } - - return super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos); - } - - parseArrow(node) { - if (this.match(types.colon)) { - const result = this.tryParse(() => { - const oldNoAnonFunctionType = this.state.noAnonFunctionType; - this.state.noAnonFunctionType = true; - const typeNode = this.startNode(); - [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); - this.state.noAnonFunctionType = oldNoAnonFunctionType; - if (this.canInsertSemicolon()) this.unexpected(); - if (!this.match(types.arrow)) this.unexpected(); - return typeNode; - }); - if (result.thrown) return null; - if (result.error) this.state = result.failState; - node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; - } - - return super.parseArrow(node); - } - - shouldParseArrow() { - return this.match(types.colon) || super.shouldParseArrow(); - } - - setArrowFunctionParameters(node, params) { - if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { - node.params = params; - } else { - super.setArrowFunctionParameters(node, params); - } - } - - checkParams(node, allowDuplicates, isArrowFunction) { - if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { + if (this.isContextual("declare")) { + if (this.parseClassMemberFromModifier(classBody, member)) { return; } - return super.checkParams(...arguments); + member.declare = true; } - parseParenAndDistinguishExpression(canBeArrow) { - return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1); + super.parseClassMember(classBody, member, state, constructorAllowsSuper); + + if (member.declare) { + if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty") { + this.raise(pos, FlowErrors.DeclareClassElement); + } else if (member.value) { + this.raise(member.value.start, FlowErrors.DeclareClassFieldInitializer); + } + } + } + + getTokenFromCode(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + + if (code === 123 && next === 124) { + return this.finishOp(types.braceBarL, 2); + } else if (this.state.inType && (code === 62 || code === 60)) { + return this.finishOp(types.relational, 1); + } else if (this.state.inType && code === 63) { + return this.finishOp(types.question, 1); + } else if (isIteratorStart(code, next)) { + this.state.isIterator = true; + return super.readWord(); + } else { + return super.getTokenFromCode(code); + } + } + + isAssignable(node, isBinding) { + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + return true; + + case "ObjectExpression": + { + const last = node.properties.length - 1; + return node.properties.every((prop, i) => { + return prop.type !== "ObjectMethod" && (i === last || prop.type === "SpreadElement") && this.isAssignable(prop); + }); + } + + case "ObjectProperty": + return this.isAssignable(node.value); + + case "SpreadElement": + return this.isAssignable(node.argument); + + case "ArrayExpression": + return node.elements.every(element => this.isAssignable(element)); + + case "AssignmentExpression": + return node.operator === "="; + + case "ParenthesizedExpression": + case "TypeCastExpression": + return this.isAssignable(node.expression); + + case "MemberExpression": + case "OptionalMemberExpression": + return !isBinding; + + default: + return false; + } + } + + toAssignable(node) { + if (node.type === "TypeCastExpression") { + return super.toAssignable(this.typeCastToParameter(node)); + } else { + return super.toAssignable(node); + } + } + + toAssignableList(exprList, trailingCommaPos) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + + if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { + exprList[i] = this.typeCastToParameter(expr); + } } - parseSubscripts(base, startPos, startLoc, noCalls) { - if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startPos) !== -1) { + return super.toAssignableList(exprList, trailingCommaPos); + } + + toReferencedList(exprList, isParenthesizedExpr) { + for (let i = 0; i < exprList.length; i++) { + var _expr$extra; + + const expr = exprList[i]; + + if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) == null ? void 0 : _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { + this.raise(expr.typeAnnotation.start, FlowErrors.TypeCastInPattern); + } + } + + return exprList; + } + + checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) { + if (expr.type !== "TypeCastExpression") { + return super.checkLVal(expr, bindingType, checkClashes, contextDescription); + } + } + + parseClassProperty(node) { + if (this.match(types.colon)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + + return super.parseClassProperty(node); + } + + parseClassPrivateProperty(node) { + if (this.match(types.colon)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + + return super.parseClassPrivateProperty(node); + } + + isClassMethod() { + return this.isRelational("<") || super.isClassMethod(); + } + + isClassProperty() { + return this.match(types.colon) || super.isClassProperty(); + } + + isNonstaticConstructor(method) { + return !this.match(types.colon) && super.isNonstaticConstructor(method); + } + + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + if (method.variance) { + this.unexpected(method.variance.start); + } + + delete method.variance; + + if (this.isRelational("<")) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } + + super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); + } + + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + if (method.variance) { + this.unexpected(method.variance.start); + } + + delete method.variance; + + if (this.isRelational("<")) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } + + super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); + } + + parseClassSuper(node) { + super.parseClassSuper(node); + + if (node.superClass && this.isRelational("<")) { + node.superTypeParameters = this.flowParseTypeParameterInstantiation(); + } + + if (this.isContextual("implements")) { + this.next(); + const implemented = node.implements = []; + + do { + const node = this.startNode(); + node.id = this.flowParseRestrictedIdentifier(true); + + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } + + implemented.push(this.finishNode(node, "ClassImplements")); + } while (this.eat(types.comma)); + } + } + + parsePropertyName(node, isPrivateNameAllowed) { + const variance = this.flowParseVariance(); + const key = super.parsePropertyName(node, isPrivateNameAllowed); + node.variance = variance; + return key; + } + + parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + if (prop.variance) { + this.unexpected(prop.variance.start); + } + + delete prop.variance; + let typeParameters; + + if (this.isRelational("<") && !isAccessor) { + typeParameters = this.flowParseTypeParameterDeclaration(); + if (!this.match(types.parenL)) this.unexpected(); + } + + super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); + + if (typeParameters) { + (prop.value || prop).typeParameters = typeParameters; + } + } + + parseAssignableListItemTypes(param) { + if (this.eat(types.question)) { + if (param.type !== "Identifier") { + this.raise(param.start, FlowErrors.OptionalBindingPattern); + } + + param.optional = true; + } + + if (this.match(types.colon)) { + param.typeAnnotation = this.flowParseTypeAnnotation(); + } + + this.resetEndLocation(param); + return param; + } + + parseMaybeDefault(startPos, startLoc, left) { + const node = super.parseMaybeDefault(startPos, startLoc, left); + + if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { + this.raise(node.typeAnnotation.start, FlowErrors.TypeBeforeInitializer); + } + + return node; + } + + shouldParseDefaultImport(node) { + if (!hasTypeImportKind(node)) { + return super.shouldParseDefaultImport(node); + } + + return isMaybeDefaultImport(this.state); + } + + parseImportSpecifierLocal(node, specifier, type, contextDescription) { + specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); + this.checkLVal(specifier.local, BIND_LEXICAL, undefined, contextDescription); + node.specifiers.push(this.finishNode(specifier, type)); + } + + maybeParseDefaultImportSpecifier(node) { + node.importKind = "value"; + let kind = null; + + if (this.match(types._typeof)) { + kind = "typeof"; + } else if (this.isContextual("type")) { + kind = "type"; + } + + if (kind) { + const lh = this.lookahead(); + + if (kind === "type" && lh.type === types.star) { + this.unexpected(lh.start); + } + + if (isMaybeDefaultImport(lh) || lh.type === types.braceL || lh.type === types.star) { this.next(); - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - base = this.finishNode(node, "CallExpression"); - } else if (base.type === "Identifier" && base.name === "async" && this.isRelational("<")) { - const state = this.state.clone(); - const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort(), state); - if (!arrow.error && !arrow.aborted) return arrow.node; - const result = this.tryParse(() => super.parseSubscripts(base, startPos, startLoc, noCalls), state); - if (result.node && !result.error) return result.node; + node.importKind = kind; + } + } + + return super.maybeParseDefaultImportSpecifier(node); + } + + parseImportSpecifier(node) { + const specifier = this.startNode(); + const firstIdentLoc = this.state.start; + const firstIdent = this.parseIdentifier(true); + let specifierTypeKind = null; + + if (firstIdent.name === "type") { + specifierTypeKind = "type"; + } else if (firstIdent.name === "typeof") { + specifierTypeKind = "typeof"; + } + + let isBinding = false; + + if (this.isContextual("as") && !this.isLookaheadContextual("as")) { + const as_ident = this.parseIdentifier(true); + + if (specifierTypeKind !== null && !this.match(types.name) && !this.state.type.keyword) { + specifier.imported = as_ident; + specifier.importKind = specifierTypeKind; + specifier.local = as_ident.__clone(); + } else { + specifier.imported = firstIdent; + specifier.importKind = null; + specifier.local = this.parseIdentifier(); + } + } else if (specifierTypeKind !== null && (this.match(types.name) || this.state.type.keyword)) { + specifier.imported = this.parseIdentifier(true); + specifier.importKind = specifierTypeKind; + + if (this.eatContextual("as")) { + specifier.local = this.parseIdentifier(); + } else { + isBinding = true; + specifier.local = specifier.imported.__clone(); + } + } else { + isBinding = true; + specifier.imported = firstIdent; + specifier.importKind = null; + specifier.local = specifier.imported.__clone(); + } + + const nodeIsTypeImport = hasTypeImportKind(node); + const specifierIsTypeImport = hasTypeImportKind(specifier); + + if (nodeIsTypeImport && specifierIsTypeImport) { + this.raise(firstIdentLoc, FlowErrors.ImportTypeShorthandOnlyInPureImport); + } + + if (nodeIsTypeImport || specifierIsTypeImport) { + this.checkReservedType(specifier.local.name, specifier.local.start, true); + } + + if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) { + this.checkReservedWord(specifier.local.name, specifier.start, true, true); + } + + this.checkLVal(specifier.local, BIND_LEXICAL, undefined, "import specifier"); + node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); + } + + parseFunctionParams(node, allowModifiers) { + const kind = node.kind; + + if (kind !== "get" && kind !== "set" && this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + + super.parseFunctionParams(node, allowModifiers); + } + + parseVarId(decl, kind) { + super.parseVarId(decl, kind); + + if (this.match(types.colon)) { + decl.id.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(decl.id); + } + } + + parseAsyncArrowFromCallExpression(node, call) { + if (this.match(types.colon)) { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + node.returnType = this.flowParseTypeAnnotation(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + } + + return super.parseAsyncArrowFromCallExpression(node, call); + } + + shouldParseAsyncArrow() { + return this.match(types.colon) || super.shouldParseAsyncArrow(); + } + + parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos) { + var _jsx; + + let state = null; + let jsx; + + if (this.hasPlugin("jsx") && (this.match(types.jsxTagStart) || this.isRelational("<"))) { + state = this.state.clone(); + jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos), state); + if (!jsx.error) return jsx.node; + const { + context + } = this.state; + + if (context[context.length - 1] === types$1.j_oTag) { + context.length -= 2; + } else if (context[context.length - 1] === types$1.j_expr) { + context.length -= 1; + } + } + + if (((_jsx = jsx) == null ? void 0 : _jsx.error) || this.isRelational("<")) { + var _jsx2, _jsx3; + + state = state || this.state.clone(); + let typeParameters; + const arrow = this.tryParse(abort => { + var _arrowExpression$extr; + + typeParameters = this.flowParseTypeParameterDeclaration(); + const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { + const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos); + this.resetStartLocationFromNode(result, typeParameters); + return result; + }); + + if (arrowExpression.type !== "ArrowFunctionExpression" && ((_arrowExpression$extr = arrowExpression.extra) == null ? void 0 : _arrowExpression$extr.parenthesized)) { + abort(); + } + + const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); + expr.typeParameters = typeParameters; + this.resetStartLocationFromNode(expr, typeParameters); + return arrowExpression; + }, state); + let arrowExpression = null; + + if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { + if (!arrow.error && !arrow.aborted) { + if (arrow.node.async) { + this.raise(typeParameters.start, FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction); + } - if (arrow.node) { - this.state = arrow.failState; return arrow.node; } - if (result.node) { - this.state = result.failState; - return result.node; - } - - throw arrow.error || result.error; + arrowExpression = arrow.node; } - return super.parseSubscripts(base, startPos, startLoc, noCalls); + if ((_jsx2 = jsx) == null ? void 0 : _jsx2.node) { + this.state = jsx.failState; + return jsx.node; + } + + if (arrowExpression) { + this.state = arrow.failState; + return arrowExpression; + } + + if ((_jsx3 = jsx) == null ? void 0 : _jsx3.thrown) throw jsx.error; + if (arrow.thrown) throw arrow.error; + throw this.raise(typeParameters.start, FlowErrors.UnexpectedTokenAfterTypeParameter); } - parseSubscript(base, startPos, startLoc, noCalls, subscriptState) { - if (this.match(types.questionDot) && this.isLookaheadToken_lt()) { - subscriptState.optionalChainMember = true; + return super.parseMaybeAssign(refExpressionErrors, afterLeftParse, refNeedsArrowPos); + } - if (noCalls) { - subscriptState.stop = true; - return base; - } + parseArrow(node) { + if (this.match(types.colon)) { + const result = this.tryParse(() => { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + if (this.canInsertSemicolon()) this.unexpected(); + if (!this.match(types.arrow)) this.unexpected(); + return typeNode; + }); + if (result.thrown) return null; + if (result.error) this.state = result.failState; + node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; + } - this.next(); - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.typeArguments = this.flowParseTypeParameterInstantiation(); + return super.parseArrow(node); + } + + shouldParseArrow() { + return this.match(types.colon) || super.shouldParseArrow(); + } + + setArrowFunctionParameters(node, params) { + if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { + node.params = params; + } else { + super.setArrowFunctionParameters(node, params); + } + } + + checkParams(node, allowDuplicates, isArrowFunction) { + if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) { + return; + } + + return super.checkParams(...arguments); + } + + parseParenAndDistinguishExpression(canBeArrow) { + return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1); + } + + parseSubscripts(base, startPos, startLoc, noCalls) { + if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startPos) !== -1) { + this.next(); + const node = this.startNodeAt(startPos, startLoc); + node.callee = base; + node.arguments = this.parseCallExpressionArguments(types.parenR, false); + base = this.finishNode(node, "CallExpression"); + } else if (base.type === "Identifier" && base.name === "async" && this.isRelational("<")) { + const state = this.state.clone(); + const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort(), state); + if (!arrow.error && !arrow.aborted) return arrow.node; + const result = this.tryParse(() => super.parseSubscripts(base, startPos, startLoc, noCalls), state); + if (result.node && !result.error) return result.node; + + if (arrow.node) { + this.state = arrow.failState; + return arrow.node; + } + + if (result.node) { + this.state = result.failState; + return result.node; + } + + throw arrow.error || result.error; + } + + return super.parseSubscripts(base, startPos, startLoc, noCalls); + } + + parseSubscript(base, startPos, startLoc, noCalls, subscriptState) { + if (this.match(types.questionDot) && this.isLookaheadToken_lt()) { + subscriptState.optionalChainMember = true; + + if (noCalls) { + subscriptState.stop = true; + return base; + } + + this.next(); + const node = this.startNodeAt(startPos, startLoc); + node.callee = base; + node.typeArguments = this.flowParseTypeParameterInstantiation(); + this.expect(types.parenL); + node.arguments = this.parseCallExpressionArguments(types.parenR, false); + node.optional = true; + return this.finishCallExpression(node, true); + } else if (!noCalls && this.shouldParseTypes() && this.isRelational("<")) { + const node = this.startNodeAt(startPos, startLoc); + node.callee = base; + const result = this.tryParse(() => { + node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); this.expect(types.parenL); node.arguments = this.parseCallExpressionArguments(types.parenR, false); - node.optional = true; - return this.finishCallExpression(node, true); - } else if (!noCalls && this.shouldParseTypes() && this.isRelational("<")) { - const node = this.startNodeAt(startPos, startLoc); - node.callee = base; - const result = this.tryParse(() => { - node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); - this.expect(types.parenL); - node.arguments = this.parseCallExpressionArguments(types.parenR, false); - if (subscriptState.optionalChainMember) node.optional = false; - return this.finishCallExpression(node, subscriptState.optionalChainMember); - }); + if (subscriptState.optionalChainMember) node.optional = false; + return this.finishCallExpression(node, subscriptState.optionalChainMember); + }); - if (result.node) { - if (result.error) this.state = result.failState; - return result.node; - } + if (result.node) { + if (result.error) this.state = result.failState; + return result.node; } - - return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState); } - parseNewArguments(node) { - let targs = null; + return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState); + } - if (this.shouldParseTypes() && this.isRelational("<")) { - targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; - } + parseNewArguments(node) { + let targs = null; - node.typeArguments = targs; - super.parseNewArguments(node); + if (this.shouldParseTypes() && this.isRelational("<")) { + targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; } - parseAsyncArrowWithTypeParameters(startPos, startLoc) { - const node = this.startNodeAt(startPos, startLoc); - this.parseFunctionParams(node); - if (!this.parseArrow(node)) return; - return this.parseArrowExpression(node, undefined, true); + node.typeArguments = targs; + super.parseNewArguments(node); + } + + parseAsyncArrowWithTypeParameters(startPos, startLoc) { + const node = this.startNodeAt(startPos, startLoc); + this.parseFunctionParams(node); + if (!this.parseArrow(node)) return; + return this.parseArrowExpression(node, undefined, true); + } + + readToken_mult_modulo(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + + if (code === 42 && next === 47 && this.state.hasFlowComment) { + this.state.hasFlowComment = false; + this.state.pos += 2; + this.nextToken(); + return; } - readToken_mult_modulo(code) { - const next = this.input.charCodeAt(this.state.pos + 1); + super.readToken_mult_modulo(code); + } - if (code === 42 && next === 47 && this.state.hasFlowComment) { - this.state.hasFlowComment = false; - this.state.pos += 2; - this.nextToken(); - return; - } + readToken_pipe_amp(code) { + const next = this.input.charCodeAt(this.state.pos + 1); - super.readToken_mult_modulo(code); + if (code === 124 && next === 125) { + this.finishOp(types.braceBarR, 2); + return; } - readToken_pipe_amp(code) { - const next = this.input.charCodeAt(this.state.pos + 1); + super.readToken_pipe_amp(code); + } - if (code === 124 && next === 125) { - this.finishOp(types.braceBarR, 2); - return; - } + parseTopLevel(file, program) { + const fileNode = super.parseTopLevel(file, program); - super.readToken_pipe_amp(code); + if (this.state.hasFlowComment) { + this.raise(this.state.pos, FlowErrors.UnterminatedFlowComment); } - parseTopLevel(file, program) { - const fileNode = super.parseTopLevel(file, program); + return fileNode; + } + skipBlockComment() { + if (this.hasPlugin("flowComments") && this.skipFlowComment()) { if (this.state.hasFlowComment) { - this.raise(this.state.pos, FlowErrors.UnterminatedFlowComment); + this.unexpected(null, FlowErrors.NestedFlowComment); } - return fileNode; + this.hasFlowCommentCompletion(); + this.state.pos += this.skipFlowComment(); + this.state.hasFlowComment = true; + return; } - skipBlockComment() { - if (this.hasPlugin("flowComments") && this.skipFlowComment()) { - if (this.state.hasFlowComment) { - this.unexpected(null, FlowErrors.NestedFlowComment); - } - - this.hasFlowCommentCompletion(); - this.state.pos += this.skipFlowComment(); - this.state.hasFlowComment = true; - return; - } - - if (this.state.hasFlowComment) { - const end = this.input.indexOf("*-/", this.state.pos += 2); - - if (end === -1) { - throw this.raise(this.state.pos - 2, ErrorMessages.UnterminatedComment); - } - - this.state.pos = end + 3; - return; - } - - super.skipBlockComment(); - } - - skipFlowComment() { - const { - pos - } = this.state; - let shiftToFirstNonWhiteSpace = 2; - - while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { - shiftToFirstNonWhiteSpace++; - } - - const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); - const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); - - if (ch2 === 58 && ch3 === 58) { - return shiftToFirstNonWhiteSpace + 2; - } - - if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { - return shiftToFirstNonWhiteSpace + 12; - } - - if (ch2 === 58 && ch3 !== 58) { - return shiftToFirstNonWhiteSpace; - } - - return false; - } - - hasFlowCommentCompletion() { - const end = this.input.indexOf("*/", this.state.pos); + if (this.state.hasFlowComment) { + const end = this.input.indexOf("*-/", this.state.pos += 2); if (end === -1) { - throw this.raise(this.state.pos, ErrorMessages.UnterminatedComment); - } - } - - flowEnumErrorBooleanMemberNotInitialized(pos, { - enumName, - memberName - }) { - this.raise(pos, FlowErrors.EnumBooleanMemberNotInitialized, memberName, enumName); - } - - flowEnumErrorInvalidMemberName(pos, { - enumName, - memberName - }) { - const suggestion = memberName[0].toUpperCase() + memberName.slice(1); - this.raise(pos, FlowErrors.EnumInvalidMemberName, memberName, suggestion, enumName); - } - - flowEnumErrorDuplicateMemberName(pos, { - enumName, - memberName - }) { - this.raise(pos, FlowErrors.EnumDuplicateMemberName, memberName, enumName); - } - - flowEnumErrorInconsistentMemberValues(pos, { - enumName - }) { - this.raise(pos, FlowErrors.EnumInconsistentMemberValues, enumName); - } - - flowEnumErrorInvalidExplicitType(pos, { - enumName, - suppliedType - }) { - return this.raise(pos, suppliedType === null ? FlowErrors.EnumInvalidExplicitTypeUnknownSupplied : FlowErrors.EnumInvalidExplicitType, enumName, suppliedType); - } - - flowEnumErrorInvalidMemberInitializer(pos, { - enumName, - explicitType, - memberName - }) { - let message = null; - - switch (explicitType) { - case "boolean": - case "number": - case "string": - message = FlowErrors.EnumInvalidMemberInitializerPrimaryType; - break; - - case "symbol": - message = FlowErrors.EnumInvalidMemberInitializerSymbolType; - break; - - default: - message = FlowErrors.EnumInvalidMemberInitializerUnknownType; + throw this.raise(this.state.pos - 2, ErrorMessages.UnterminatedComment); } - return this.raise(pos, message, enumName, memberName, explicitType); + this.state.pos = end + 3; + return; } - flowEnumErrorNumberMemberNotInitialized(pos, { - enumName, - memberName - }) { - this.raise(pos, FlowErrors.EnumNumberMemberNotInitialized, enumName, memberName); + super.skipBlockComment(); + } + + skipFlowComment() { + const { + pos + } = this.state; + let shiftToFirstNonWhiteSpace = 2; + + while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { + shiftToFirstNonWhiteSpace++; } - flowEnumErrorStringMemberInconsistentlyInitailized(pos, { - enumName - }) { - this.raise(pos, FlowErrors.EnumStringMemberInconsistentlyInitailized, enumName); + const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); + const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); + + if (ch2 === 58 && ch3 === 58) { + return shiftToFirstNonWhiteSpace + 2; } - flowEnumMemberInit() { - const startPos = this.state.start; + if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { + return shiftToFirstNonWhiteSpace + 12; + } - const endOfInit = () => this.match(types.comma) || this.match(types.braceR); + if (ch2 === 58 && ch3 !== 58) { + return shiftToFirstNonWhiteSpace; + } - switch (this.state.type) { - case types.num: - { - const literal = this.parseLiteral(this.state.value, "NumericLiteral"); + return false; + } - if (endOfInit()) { - return { - type: "number", - pos: literal.start, - value: literal - }; - } + hasFlowCommentCompletion() { + const end = this.input.indexOf("*/", this.state.pos); + if (end === -1) { + throw this.raise(this.state.pos, ErrorMessages.UnterminatedComment); + } + } + + flowEnumErrorBooleanMemberNotInitialized(pos, { + enumName, + memberName + }) { + this.raise(pos, FlowErrors.EnumBooleanMemberNotInitialized, memberName, enumName); + } + + flowEnumErrorInvalidMemberName(pos, { + enumName, + memberName + }) { + const suggestion = memberName[0].toUpperCase() + memberName.slice(1); + this.raise(pos, FlowErrors.EnumInvalidMemberName, memberName, suggestion, enumName); + } + + flowEnumErrorDuplicateMemberName(pos, { + enumName, + memberName + }) { + this.raise(pos, FlowErrors.EnumDuplicateMemberName, memberName, enumName); + } + + flowEnumErrorInconsistentMemberValues(pos, { + enumName + }) { + this.raise(pos, FlowErrors.EnumInconsistentMemberValues, enumName); + } + + flowEnumErrorInvalidExplicitType(pos, { + enumName, + suppliedType + }) { + return this.raise(pos, suppliedType === null ? FlowErrors.EnumInvalidExplicitTypeUnknownSupplied : FlowErrors.EnumInvalidExplicitType, enumName, suppliedType); + } + + flowEnumErrorInvalidMemberInitializer(pos, { + enumName, + explicitType, + memberName + }) { + let message = null; + + switch (explicitType) { + case "boolean": + case "number": + case "string": + message = FlowErrors.EnumInvalidMemberInitializerPrimaryType; + break; + + case "symbol": + message = FlowErrors.EnumInvalidMemberInitializerSymbolType; + break; + + default: + message = FlowErrors.EnumInvalidMemberInitializerUnknownType; + } + + return this.raise(pos, message, enumName, memberName, explicitType); + } + + flowEnumErrorNumberMemberNotInitialized(pos, { + enumName, + memberName + }) { + this.raise(pos, FlowErrors.EnumNumberMemberNotInitialized, enumName, memberName); + } + + flowEnumErrorStringMemberInconsistentlyInitailized(pos, { + enumName + }) { + this.raise(pos, FlowErrors.EnumStringMemberInconsistentlyInitailized, enumName); + } + + flowEnumMemberInit() { + const startPos = this.state.start; + + const endOfInit = () => this.match(types.comma) || this.match(types.braceR); + + switch (this.state.type) { + case types.num: + { + const literal = this.parseLiteral(this.state.value, "NumericLiteral"); + + if (endOfInit()) { return { - type: "invalid", - pos: startPos + type: "number", + pos: literal.start, + value: literal }; } - case types.string: - { - const literal = this.parseLiteral(this.state.value, "StringLiteral"); - - if (endOfInit()) { - return { - type: "string", - pos: literal.start, - value: literal - }; - } - - return { - type: "invalid", - pos: startPos - }; - } - - case types._true: - case types._false: - { - const literal = this.parseBooleanLiteral(); - - if (endOfInit()) { - return { - type: "boolean", - pos: literal.start, - value: literal - }; - } - - return { - type: "invalid", - pos: startPos - }; - } - - default: return { type: "invalid", pos: startPos }; - } + } + + case types.string: + { + const literal = this.parseLiteral(this.state.value, "StringLiteral"); + + if (endOfInit()) { + return { + type: "string", + pos: literal.start, + value: literal + }; + } + + return { + type: "invalid", + pos: startPos + }; + } + + case types._true: + case types._false: + { + const literal = this.parseBooleanLiteral(); + + if (endOfInit()) { + return { + type: "boolean", + pos: literal.start, + value: literal + }; + } + + return { + type: "invalid", + pos: startPos + }; + } + + default: + return { + type: "invalid", + pos: startPos + }; + } + } + + flowEnumMemberRaw() { + const pos = this.state.start; + const id = this.parseIdentifier(true); + const init = this.eat(types.eq) ? this.flowEnumMemberInit() : { + type: "none", + pos + }; + return { + id, + init + }; + } + + flowEnumCheckExplicitTypeMismatch(pos, context, expectedType) { + const { + explicitType + } = context; + + if (explicitType === null) { + return; } - flowEnumMemberRaw() { - const pos = this.state.start; - const id = this.parseIdentifier(true); - const init = this.eat(types.eq) ? this.flowEnumMemberInit() : { - type: "none", - pos - }; - return { + if (explicitType !== expectedType) { + this.flowEnumErrorInvalidMemberInitializer(pos, context); + } + } + + flowEnumMembers({ + enumName, + explicitType + }) { + const seenNames = new Set(); + const members = { + booleanMembers: [], + numberMembers: [], + stringMembers: [], + defaultedMembers: [] + }; + + while (!this.match(types.braceR)) { + const memberNode = this.startNode(); + const { id, init - }; - } + } = this.flowEnumMemberRaw(); + const memberName = id.name; - flowEnumCheckExplicitTypeMismatch(pos, context, expectedType) { - const { - explicitType - } = context; - - if (explicitType === null) { - return; + if (memberName === "") { + continue; } - if (explicitType !== expectedType) { - this.flowEnumErrorInvalidMemberInitializer(pos, context); - } - } - - flowEnumMembers({ - enumName, - explicitType - }) { - const seenNames = new Set(); - const members = { - booleanMembers: [], - numberMembers: [], - stringMembers: [], - defaultedMembers: [] - }; - - while (!this.match(types.braceR)) { - const memberNode = this.startNode(); - const { - id, - init - } = this.flowEnumMemberRaw(); - const memberName = id.name; - - if (memberName === "") { - continue; - } - - if (/^[a-z]/.test(memberName)) { - this.flowEnumErrorInvalidMemberName(id.start, { - enumName, - memberName - }); - } - - if (seenNames.has(memberName)) { - this.flowEnumErrorDuplicateMemberName(id.start, { - enumName, - memberName - }); - } - - seenNames.add(memberName); - const context = { + if (/^[a-z]/.test(memberName)) { + this.flowEnumErrorInvalidMemberName(id.start, { enumName, - explicitType, memberName - }; - memberNode.id = id; - - switch (init.type) { - case "boolean": - { - this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "boolean"); - memberNode.init = init.value; - members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); - break; - } - - case "number": - { - this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "number"); - memberNode.init = init.value; - members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); - break; - } - - case "string": - { - this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "string"); - memberNode.init = init.value; - members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); - break; - } - - case "invalid": - { - throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context); - } - - case "none": - { - switch (explicitType) { - case "boolean": - this.flowEnumErrorBooleanMemberNotInitialized(init.pos, context); - break; - - case "number": - this.flowEnumErrorNumberMemberNotInitialized(init.pos, context); - break; - - default: - members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); - } - } - } - - if (!this.match(types.braceR)) { - this.expect(types.comma); - } + }); } - return members; - } - - flowEnumStringMembers(initializedMembers, defaultedMembers, { - enumName - }) { - if (initializedMembers.length === 0) { - return defaultedMembers; - } else if (defaultedMembers.length === 0) { - return initializedMembers; - } else if (defaultedMembers.length > initializedMembers.length) { - for (let _i = 0; _i < initializedMembers.length; _i++) { - const member = initializedMembers[_i]; - this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, { - enumName - }); - } - - return defaultedMembers; - } else { - for (let _i2 = 0; _i2 < defaultedMembers.length; _i2++) { - const member = defaultedMembers[_i2]; - this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, { - enumName - }); - } - - return initializedMembers; - } - } - - flowEnumParseExplicitType({ - enumName - }) { - if (this.eatContextual("of")) { - if (!this.match(types.name)) { - throw this.flowEnumErrorInvalidExplicitType(this.state.start, { - enumName, - suppliedType: null - }); - } - - const { - value - } = this.state; - this.next(); - - if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { - this.flowEnumErrorInvalidExplicitType(this.state.start, { - enumName, - suppliedType: value - }); - } - - return value; + if (seenNames.has(memberName)) { + this.flowEnumErrorDuplicateMemberName(id.start, { + enumName, + memberName + }); } - return null; - } - - flowEnumBody(node, { - enumName, - nameLoc - }) { - const explicitType = this.flowEnumParseExplicitType({ - enumName - }); - this.expect(types.braceL); - const members = this.flowEnumMembers({ + seenNames.add(memberName); + const context = { enumName, - explicitType - }); + explicitType, + memberName + }; + memberNode.id = id; - switch (explicitType) { + switch (init.type) { case "boolean": - node.explicitType = true; - node.members = members.booleanMembers; - this.expect(types.braceR); - return this.finishNode(node, "EnumBooleanBody"); + { + this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "boolean"); + memberNode.init = init.value; + members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); + break; + } case "number": - node.explicitType = true; - node.members = members.numberMembers; - this.expect(types.braceR); - return this.finishNode(node, "EnumNumberBody"); + { + this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "number"); + memberNode.init = init.value; + members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); + break; + } case "string": - node.explicitType = true; - node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { - enumName - }); - this.expect(types.braceR); - return this.finishNode(node, "EnumStringBody"); - - case "symbol": - node.members = members.defaultedMembers; - this.expect(types.braceR); - return this.finishNode(node, "EnumSymbolBody"); - - default: { - const empty = () => { - node.members = []; - this.expect(types.braceR); - return this.finishNode(node, "EnumStringBody"); - }; + this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "string"); + memberNode.init = init.value; + members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); + break; + } - node.explicitType = false; - const boolsLen = members.booleanMembers.length; - const numsLen = members.numberMembers.length; - const strsLen = members.stringMembers.length; - const defaultedLen = members.defaultedMembers.length; + case "invalid": + { + throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context); + } - if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { - return empty(); - } else if (!boolsLen && !numsLen) { - node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { - enumName - }); - this.expect(types.braceR); - return this.finishNode(node, "EnumStringBody"); - } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { - for (let _i3 = 0, _members$defaultedMem = members.defaultedMembers; _i3 < _members$defaultedMem.length; _i3++) { - const member = _members$defaultedMem[_i3]; - this.flowEnumErrorBooleanMemberNotInitialized(member.start, { - enumName, - memberName: member.id.name - }); - } + case "none": + { + switch (explicitType) { + case "boolean": + this.flowEnumErrorBooleanMemberNotInitialized(init.pos, context); + break; - node.members = members.booleanMembers; - this.expect(types.braceR); - return this.finishNode(node, "EnumBooleanBody"); - } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { - for (let _i4 = 0, _members$defaultedMem2 = members.defaultedMembers; _i4 < _members$defaultedMem2.length; _i4++) { - const member = _members$defaultedMem2[_i4]; - this.flowEnumErrorNumberMemberNotInitialized(member.start, { - enumName, - memberName: member.id.name - }); - } + case "number": + this.flowEnumErrorNumberMemberNotInitialized(init.pos, context); + break; - node.members = members.numberMembers; - this.expect(types.braceR); - return this.finishNode(node, "EnumNumberBody"); - } else { - this.flowEnumErrorInconsistentMemberValues(nameLoc, { - enumName - }); - return empty(); + default: + members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); } } } - } - flowParseEnumDeclaration(node) { - const id = this.parseIdentifier(); - node.id = id; - node.body = this.flowEnumBody(this.startNode(), { - enumName: id.name, - nameLoc: id.start - }); - return this.finishNode(node, "EnumDeclaration"); - } - - updateContext(prevType) { - if (this.match(types.name) && this.state.value === "of" && prevType === types.name && this.input.slice(this.state.lastTokStart, this.state.lastTokEnd) === "interface") { - this.state.exprAllowed = false; - } else { - super.updateContext(prevType); + if (!this.match(types.braceR)) { + this.expect(types.comma); } } - isLookaheadToken_lt() { - const next = this.nextTokenStart(); + return members; + } - if (this.input.charCodeAt(next) === 60) { - const afterNext = this.input.charCodeAt(next + 1); - return afterNext !== 60 && afterNext !== 61; + flowEnumStringMembers(initializedMembers, defaultedMembers, { + enumName + }) { + if (initializedMembers.length === 0) { + return defaultedMembers; + } else if (defaultedMembers.length === 0) { + return initializedMembers; + } else if (defaultedMembers.length > initializedMembers.length) { + for (let _i = 0; _i < initializedMembers.length; _i++) { + const member = initializedMembers[_i]; + this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, { + enumName + }); } - return false; + return defaultedMembers; + } else { + for (let _i2 = 0; _i2 < defaultedMembers.length; _i2++) { + const member = defaultedMembers[_i2]; + this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, { + enumName + }); + } + + return initializedMembers; + } + } + + flowEnumParseExplicitType({ + enumName + }) { + if (this.eatContextual("of")) { + if (!this.match(types.name)) { + throw this.flowEnumErrorInvalidExplicitType(this.state.start, { + enumName, + suppliedType: null + }); + } + + const { + value + } = this.state; + this.next(); + + if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { + this.flowEnumErrorInvalidExplicitType(this.state.start, { + enumName, + suppliedType: value + }); + } + + return value; } - maybeUnwrapTypeCastExpression(node) { - return node.type === "TypeCastExpression" ? node.expression : node; + return null; + } + + flowEnumBody(node, { + enumName, + nameLoc + }) { + const explicitType = this.flowEnumParseExplicitType({ + enumName + }); + this.expect(types.braceL); + const members = this.flowEnumMembers({ + enumName, + explicitType + }); + + switch (explicitType) { + case "boolean": + node.explicitType = true; + node.members = members.booleanMembers; + this.expect(types.braceR); + return this.finishNode(node, "EnumBooleanBody"); + + case "number": + node.explicitType = true; + node.members = members.numberMembers; + this.expect(types.braceR); + return this.finishNode(node, "EnumNumberBody"); + + case "string": + node.explicitType = true; + node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { + enumName + }); + this.expect(types.braceR); + return this.finishNode(node, "EnumStringBody"); + + case "symbol": + node.members = members.defaultedMembers; + this.expect(types.braceR); + return this.finishNode(node, "EnumSymbolBody"); + + default: + { + const empty = () => { + node.members = []; + this.expect(types.braceR); + return this.finishNode(node, "EnumStringBody"); + }; + + node.explicitType = false; + const boolsLen = members.booleanMembers.length; + const numsLen = members.numberMembers.length; + const strsLen = members.stringMembers.length; + const defaultedLen = members.defaultedMembers.length; + + if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { + return empty(); + } else if (!boolsLen && !numsLen) { + node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { + enumName + }); + this.expect(types.braceR); + return this.finishNode(node, "EnumStringBody"); + } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { + for (let _i3 = 0, _members$defaultedMem = members.defaultedMembers; _i3 < _members$defaultedMem.length; _i3++) { + const member = _members$defaultedMem[_i3]; + this.flowEnumErrorBooleanMemberNotInitialized(member.start, { + enumName, + memberName: member.id.name + }); + } + + node.members = members.booleanMembers; + this.expect(types.braceR); + return this.finishNode(node, "EnumBooleanBody"); + } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { + for (let _i4 = 0, _members$defaultedMem2 = members.defaultedMembers; _i4 < _members$defaultedMem2.length; _i4++) { + const member = _members$defaultedMem2[_i4]; + this.flowEnumErrorNumberMemberNotInitialized(member.start, { + enumName, + memberName: member.id.name + }); + } + + node.members = members.numberMembers; + this.expect(types.braceR); + return this.finishNode(node, "EnumNumberBody"); + } else { + this.flowEnumErrorInconsistentMemberValues(nameLoc, { + enumName + }); + return empty(); + } + } + } + } + + flowParseEnumDeclaration(node) { + const id = this.parseIdentifier(); + node.id = id; + node.body = this.flowEnumBody(this.startNode(), { + enumName: id.name, + nameLoc: id.start + }); + return this.finishNode(node, "EnumDeclaration"); + } + + updateContext(prevType) { + if (this.match(types.name) && this.state.value === "of" && prevType === types.name && this.input.slice(this.state.lastTokStart, this.state.lastTokEnd) === "interface") { + this.state.exprAllowed = false; + } else { + super.updateContext(prevType); + } + } + + isLookaheadToken_lt() { + const next = this.nextTokenStart(); + + if (this.input.charCodeAt(next) === 60) { + const afterNext = this.input.charCodeAt(next + 1); + return afterNext !== 60 && afterNext !== 61; } - }, _temp; + return false; + } + + maybeUnwrapTypeCastExpression(node) { + return node.type === "TypeCastExpression" ? node.expression : node; + } + }); const entities = { @@ -4325,7 +4282,6 @@ const JsxErrors = Object.freeze({ AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression", MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>", MissingClosingTagElement: "Expected corresponding JSX closing tag for <%0>", - UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text", UnterminatedJsxContent: "Unterminated JSX contents", UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?" @@ -4610,8 +4566,7 @@ var jsx = (superClass => class extends superClass { if (this.match(types.braceR)) { node.expression = this.jsxParseEmptyExpression(); } else { - const expression = this.parseExpression(); - node.expression = expression; + node.expression = this.parseExpression(); } this.expect(types.braceR); @@ -4821,7 +4776,6 @@ var jsx = (superClass => class extends superClass { class Scope { constructor(flags) { - this.flags = void 0; this.var = []; this.lexical = []; this.functions = []; @@ -5102,25 +5056,20 @@ function assert(x) { const TSErrors = Object.freeze({ ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier", ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier", - ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", - DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", - DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", + DeclareClassFieldHasInitializer: "'declare' class fields cannot have an initializer", DuplicateModifier: "Duplicate modifier: '%0'", EmptyHeritageClauseType: "'%0' list cannot be empty.", - EmptyTypeArguments: "Type argument list cannot be empty.", - EmptyTypeParameters: "Type parameter list cannot be empty.", IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier", IndexSignatureHasAccessibility: "Index signatures cannot have an accessibility modifier ('%0')", IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier", - IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier", InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", MixedLabeledAndUnlabeledElements: "Tuple members must all have names or all not have names.", OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", PrivateElementHasAccessibility: "Private elements cannot have an accessibility modifier ('%0')", + TemplateTypeHasSubstitution: "Template literal types cannot have any substitution", TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`", - UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", UnexpectedTypeAnnotation: "Did not expect a type annotation here.", UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", @@ -5177,7 +5126,7 @@ var typescript = (superClass => class extends superClass { tsNextTokenCanFollowModifier() { this.next(); - return (this.match(types.bracketL) || this.match(types.braceL) || this.match(types.star) || this.match(types.ellipsis) || this.match(types.hash) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak(); + return !this.hasPrecedingLineBreak() && !this.match(types.parenL) && !this.match(types.parenR) && !this.match(types.colon) && !this.match(types.eq) && !this.match(types.question) && !this.match(types.bang); } tsParseModifier(allowedModifiers) { @@ -5347,7 +5296,6 @@ var typescript = (superClass => class extends superClass { const node = this.startNodeAtNode(lhs); node.parameterName = lhs; node.typeAnnotation = this.tsParseTypeAnnotation(false); - node.asserts = false; return this.finishNode(node, "TSTypePredicate"); } @@ -5394,11 +5342,6 @@ var typescript = (superClass => class extends superClass { } node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this), false, true); - - if (node.params.length === 0) { - this.raise(node.start, TSErrors.EmptyTypeParameters); - } - return this.finishNode(node, "TSTypeParameterDeclaration"); } @@ -5577,7 +5520,6 @@ var typescript = (superClass => class extends superClass { this.expect(types.bracketL); node.typeParameter = this.tsParseMappedTypeParameter(); - node.nameType = this.eatContextual("as") ? this.tsParseType() : null; this.expect(types.bracketR); if (this.match(types.plusMin)) { @@ -5706,13 +5648,14 @@ var typescript = (superClass => class extends superClass { tsParseTemplateLiteralType() { const node = this.startNode(); - node.literal = this.parseTemplate(false); - return this.finishNode(node, "TSLiteralType"); - } + const templateNode = this.parseTemplate(false); - parseTemplateSubstitution() { - if (this.state.inType) return this.tsParseType(); - return super.parseTemplateSubstitution(); + if (templateNode.expressions.length > 0) { + this.raise(templateNode.expressions[0].start, TSErrors.TemplateTypeHasSubstitution); + } + + node.literal = templateNode; + return this.finishNode(node, "TSLiteralType"); } tsParseThisTypeOrThisTypePredicate() { @@ -5954,7 +5897,7 @@ var typescript = (superClass => class extends superClass { return this.tsInType(() => { const t = this.startNode(); this.expect(returnToken); - const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); + const asserts = this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); if (asserts && this.match(types._this)) { let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); @@ -6109,7 +6052,7 @@ var typescript = (superClass => class extends superClass { tsParseInterfaceDeclaration(node) { node.id = this.parseIdentifier(); - this.checkLVal(node.id, "typescript interface declaration", BIND_TS_INTERFACE); + this.checkLVal(node.id, BIND_TS_INTERFACE, undefined, "typescript interface declaration"); node.typeParameters = this.tsTryParseTypeParameters(); if (this.eat(types._extends)) { @@ -6124,19 +6067,9 @@ var typescript = (superClass => class extends superClass { tsParseTypeAliasDeclaration(node) { node.id = this.parseIdentifier(); - this.checkLVal(node.id, "typescript type alias", BIND_TS_TYPE); + this.checkLVal(node.id, BIND_TS_TYPE, undefined, "typescript type alias"); node.typeParameters = this.tsTryParseTypeParameters(); - node.typeAnnotation = this.tsInType(() => { - this.expect(types.eq); - - if (this.isContextual("intrinsic") && this.lookahead().type !== types.dot) { - const node = this.startNode(); - this.next(); - return this.finishNode(node, "TSIntrinsicKeyword"); - } - - return this.tsParseType(); - }); + node.typeAnnotation = this.tsExpectThenParseType(types.eq); this.semicolon(); return this.finishNode(node, "TSTypeAliasDeclaration"); } @@ -6196,7 +6129,7 @@ var typescript = (superClass => class extends superClass { tsParseEnumDeclaration(node, isConst) { if (isConst) node.const = true; node.id = this.parseIdentifier(); - this.checkLVal(node.id, "typescript enum declaration", isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM); + this.checkLVal(node.id, isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM, undefined, "typescript enum declaration"); this.expect(types.braceL); node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); this.expect(types.braceR); @@ -6216,7 +6149,7 @@ var typescript = (superClass => class extends superClass { node.id = this.parseIdentifier(); if (!nested) { - this.checkLVal(node.id, "module or namespace declaration", BIND_TS_NAMESPACE); + this.checkLVal(node.id, BIND_TS_NAMESPACE, null, "module or namespace declaration"); } if (this.eat(types.dot)) { @@ -6260,7 +6193,7 @@ var typescript = (superClass => class extends superClass { tsParseImportEqualsDeclaration(node, isExport) { node.isExport = isExport || false; node.id = this.parseIdentifier(); - this.checkLVal(node.id, "import equals declaration", BIND_LEXICAL); + this.checkLVal(node.id, BIND_LEXICAL, undefined, "import equals declaration"); this.expect(types.eq); node.moduleReference = this.tsParseModuleReference(); this.semicolon(); @@ -6328,39 +6261,36 @@ var typescript = (superClass => class extends superClass { kind = "let"; } - return this.tsInDeclareContext(() => { - switch (starttype) { - case types._function: - nany.declare = true; - return this.parseFunctionStatement(nany, false, true); + switch (starttype) { + case types._function: + return this.parseFunctionStatement(nany, false, true); - case types._class: - nany.declare = true; - return this.parseClass(nany, true, false); + case types._class: + nany.declare = true; + return this.parseClass(nany, true, false); - case types._const: - if (this.match(types._const) && this.isLookaheadContextual("enum")) { - this.expect(types._const); - this.expectContextual("enum"); - return this.tsParseEnumDeclaration(nany, true); + case types._const: + if (this.match(types._const) && this.isLookaheadContextual("enum")) { + this.expect(types._const); + this.expectContextual("enum"); + return this.tsParseEnumDeclaration(nany, true); + } + + case types._var: + kind = kind || this.state.value; + return this.parseVarStatement(nany, kind); + + case types.name: + { + const value = this.state.value; + + if (value === "global") { + return this.tsParseAmbientExternalModuleDeclaration(nany); + } else { + return this.tsParseDeclaration(nany, value, true); } - - case types._var: - kind = kind || this.state.value; - return this.parseVarStatement(nany, kind); - - case types.name: - { - const value = this.state.value; - - if (value === "global") { - return this.tsParseAmbientExternalModuleDeclaration(nany); - } else { - return this.tsParseDeclaration(nany, value, true); - } - } - } - }); + } + } } tsTryParseExportDeclaration() { @@ -6476,7 +6406,11 @@ var typescript = (superClass => class extends superClass { } const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + const oldYieldPos = this.state.yieldPos; + const oldAwaitPos = this.state.awaitPos; this.state.maybeInArrowParameters = true; + this.state.yieldPos = -1; + this.state.awaitPos = -1; const res = this.tsTryParseAndCatch(() => { const node = this.startNodeAt(startPos, startLoc); node.typeParameters = this.tsParseTypeParameters(); @@ -6486,6 +6420,8 @@ var typescript = (superClass => class extends superClass { return node; }); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + this.state.yieldPos = oldYieldPos; + this.state.awaitPos = oldAwaitPos; if (!res) { return undefined; @@ -6500,11 +6436,6 @@ var typescript = (superClass => class extends superClass { this.expectRelational("<"); return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); })); - - if (node.params.length === 0) { - this.raise(node.start, TSErrors.EmptyTypeArguments); - } - this.state.exprAllowed = false; this.expectRelational(">"); return this.finishNode(node, "TSTypeParameterInstantiation"); @@ -6538,13 +6469,9 @@ var typescript = (superClass => class extends superClass { let accessibility; let readonly = false; - if (allowModifiers !== undefined) { + if (allowModifiers) { accessibility = this.parseAccessModifier(); readonly = !!this.tsParseModifier(["readonly"]); - - if (allowModifiers === false && (accessibility || readonly)) { - this.raise(startPos, TSErrors.UnexpectedParameterModifier); - } } const left = this.parseMaybeDefault(); @@ -6588,49 +6515,17 @@ var typescript = (superClass => class extends superClass { return; } - if (bodilessType === "TSDeclareFunction" && this.state.isDeclareContext) { - this.raise(node.start, TSErrors.DeclareFunctionHasImplementation); - - if (node.declare) { - super.parseFunctionBodyAndFinish(node, bodilessType, isMethod); - return; - } - } - super.parseFunctionBodyAndFinish(node, type, isMethod); } registerFunctionStatementId(node) { if (!node.body && node.id) { - this.checkLVal(node.id, "function name", BIND_TS_AMBIENT); + this.checkLVal(node.id, BIND_TS_AMBIENT, null, "function name"); } else { super.registerFunctionStatementId(...arguments); } } - tsCheckForInvalidTypeCasts(items) { - items.forEach(node => { - if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") { - this.raise(node.typeAnnotation.start, TSErrors.UnexpectedTypeAnnotation); - } - }); - } - - toReferencedList(exprList, isInParens) { - this.tsCheckForInvalidTypeCasts(exprList); - return exprList; - } - - parseArrayLike(...args) { - const node = super.parseArrayLike(...args); - - if (node.type === "ArrayExpression") { - this.tsCheckForInvalidTypeCasts(node.elements); - } - - return node; - } - parseSubscript(base, startPos, startLoc, noCalls, state) { if (!this.hasPrecedingLineBreak() && this.match(types.bang)) { this.state.exprAllowed = false; @@ -6657,7 +6552,6 @@ var typescript = (superClass => class extends superClass { if (typeArguments) { if (!noCalls && this.eat(types.parenL)) { node.arguments = this.parseCallExpressionArguments(types.parenR, false); - this.tsCheckForInvalidTypeCasts(node.arguments); node.typeParameters = typeArguments; return this.finishCallExpression(node, state.optionalChainMember); } else if (this.match(types.backQuote)) { @@ -6727,13 +6621,11 @@ var typescript = (superClass => class extends superClass { if (this.isContextual("type") && ahead.type !== types.comma && !(ahead.type === types.name && ahead.value === "from")) { node.importKind = "type"; this.next(); + } else { + node.importKind = "value"; } } - if (!node.importKind) { - node.importKind = "value"; - } - const importNode = super.parseImport(node); if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") { @@ -6810,24 +6702,15 @@ var typescript = (superClass => class extends superClass { return this.tsParseModifier(["public", "protected", "private"]); } - parseClassMember(classBody, member, state) { + parseClassMember(classBody, member, state, constructorAllowsSuper) { this.tsParseModifiers(member, ["declare"]); const accessibility = this.parseAccessModifier(); if (accessibility) member.accessibility = accessibility; this.tsParseModifiers(member, ["declare"]); - - const callParseClassMember = () => { - super.parseClassMember(classBody, member, state); - }; - - if (member.declare) { - this.tsInDeclareContext(callParseClassMember); - } else { - callParseClassMember(); - } + super.parseClassMember(classBody, member, state, constructorAllowsSuper); } - parseClassMemberWithIsStatic(classBody, member, state, isStatic) { + parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper) { this.tsParseModifiers(member, ["abstract", "readonly", "declare"]); const idx = this.tsTryParseIndexSignature(member); @@ -6846,14 +6729,10 @@ var typescript = (superClass => class extends superClass { this.raise(member.start, TSErrors.IndexSignatureHasAccessibility, member.accessibility); } - if (member.declare) { - this.raise(member.start, TSErrors.IndexSignatureHasDeclare); - } - return; } - super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); + super.parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper); } parsePostMemberNameModifiers(methodOrProp) { @@ -6961,7 +6840,7 @@ var typescript = (superClass => class extends superClass { parseClassProperty(node) { this.parseClassPropertyAnnotation(node); - if (this.state.isDeclareContext && this.match(types.eq)) { + if (node.declare && this.match(types.equal)) { this.raise(this.state.start, TSErrors.DeclareClassFieldHasInitializer); } @@ -6983,11 +6862,6 @@ var typescript = (superClass => class extends superClass { pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { const typeParameters = this.tsTryParseTypeParameters(); - - if (typeParameters && isConstructor) { - this.raise(typeParameters.start, TSErrors.ConstructorHasTypeParameters); - } - if (typeParameters) method.typeParameters = typeParameters; super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); } @@ -7147,7 +7021,7 @@ var typescript = (superClass => class extends superClass { parseAssignableListItemTypes(param) { if (this.eat(types.question)) { - if (param.type !== "Identifier" && !this.state.isDeclareContext && !this.state.inType) { + if (param.type !== "Identifier") { this.raise(param.start, TSErrors.PatternIsOptional); } @@ -7160,42 +7034,42 @@ var typescript = (superClass => class extends superClass { return param; } - toAssignable(node, isLHS = false) { + toAssignable(node) { switch (node.type) { case "TSTypeCastExpression": - return super.toAssignable(this.typeCastToParameter(node), isLHS); + return super.toAssignable(this.typeCastToParameter(node)); case "TSParameterProperty": - return super.toAssignable(node, isLHS); + return super.toAssignable(node); case "TSAsExpression": case "TSNonNullExpression": case "TSTypeAssertion": - node.expression = this.toAssignable(node.expression, isLHS); + node.expression = this.toAssignable(node.expression); return node; default: - return super.toAssignable(node, isLHS); + return super.toAssignable(node); } } - checkLVal(expr, contextDescription, ...args) { + checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) { switch (expr.type) { case "TSTypeCastExpression": return; case "TSParameterProperty": - this.checkLVal(expr.parameter, "parameter property", ...args); + this.checkLVal(expr.parameter, bindingType, checkClashes, "parameter property"); return; case "TSAsExpression": case "TSNonNullExpression": case "TSTypeAssertion": - this.checkLVal(expr.expression, contextDescription, ...args); + this.checkLVal(expr.expression, bindingType, checkClashes, contextDescription); return; default: - super.checkLVal(expr, contextDescription, ...args); + super.checkLVal(expr, bindingType, checkClashes, contextDescription); return; } } @@ -7294,6 +7168,18 @@ var typescript = (superClass => class extends superClass { return node.expression; } + toReferencedList(exprList, isInParens) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + + if ((expr == null ? void 0 : expr.type) === "TSTypeCastExpression") { + this.raise(expr.start, TSErrors.UnexpectedTypeAnnotation); + } + } + + return exprList; + } + shouldParseArrow() { return this.match(types.colon) || super.shouldParseArrow(); } @@ -7317,8 +7203,7 @@ var typescript = (superClass => class extends superClass { getGetterSetterExpectedParamCount(method) { const baseCount = super.getGetterSetterExpectedParamCount(method); - const params = this.getObjectOrClassMethodParams(method); - const firstParam = params[0]; + const firstParam = method.params[0]; const hasContextParam = firstParam && firstParam.type === "Identifier" && firstParam.name === "this"; return hasContextParam ? baseCount + 1 : baseCount; } @@ -7335,17 +7220,6 @@ var typescript = (superClass => class extends superClass { return param; } - tsInDeclareContext(cb) { - const oldIsDeclareContext = this.state.isDeclareContext; - this.state.isDeclareContext = true; - - try { - return cb(); - } finally { - this.state.isDeclareContext = oldIsDeclareContext; - } - } - }); types.placeholder = new TokenType("%%", { @@ -7631,10 +7505,6 @@ function validatePlugins(plugins) { } if (hasPlugin(plugins, "moduleAttributes")) { - if (hasPlugin(plugins, "importAssertions")) { - throw new Error("Cannot combine importAssertions and moduleAttributes plugins."); - } - const moduleAttributesVerionPluginOption = getPluginOption(plugins, "moduleAttributes", "version"); if (moduleAttributesVerionPluginOption !== "may-2020") { @@ -7685,22 +7555,19 @@ function getOptions(opts) { class State { constructor() { - this.strict = void 0; - this.curLine = void 0; - this.startLoc = void 0; - this.endLoc = void 0; this.errors = []; this.potentialArrowAt = -1; this.noArrowAt = []; this.noArrowParamsConversionAt = []; + this.inParameters = false; this.maybeInArrowParameters = false; + this.maybeInAsyncArrowHead = false; this.inPipeline = false; this.inType = false; this.noAnonFunctionType = false; this.inPropertyName = false; this.hasFlowComment = false; this.isIterator = false; - this.isDeclareContext = false; this.topicContext = { maxNumOfResolvableTopics: 0, maxTopicIndex: null @@ -7709,6 +7576,8 @@ class State { this.inFSharpPipelineDirectBody = false; this.labels = []; this.decoratorStack = [[]]; + this.yieldPos = -1; + this.awaitPos = -1; this.comments = []; this.trailingComments = []; this.leadingComments = []; @@ -7727,7 +7596,7 @@ class State { this.context = [types$1.braceStatement]; this.exprAllowed = true; this.containsEsc = false; - this.strictErrors = new Map(); + this.octalPositions = []; this.exportedIdentifiers = []; this.tokensLength = 0; } @@ -7788,7 +7657,6 @@ class Token { class Tokenizer extends ParserError { constructor(options, input) { super(); - this.isLookahead = void 0; this.tokens = []; this.state = new State(); this.state.init(options); @@ -7859,11 +7727,15 @@ class Tokenizer extends ParserError { setStrict(strict) { this.state.strict = strict; + if (!this.match(types.num) && !this.match(types.string)) return; + this.state.pos = this.state.start; - if (strict) { - this.state.strictErrors.forEach((message, pos) => this.raise(pos, message)); - this.state.strictErrors.clear(); + while (this.state.pos < this.state.lineStart) { + this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1; + --this.state.curLine; } + + this.nextToken(); } curContext() { @@ -7873,6 +7745,7 @@ class Tokenizer extends ParserError { nextToken() { const curContext = this.curContext(); if (!(curContext == null ? void 0 : curContext.preserveSpace)) this.skipSpace(); + this.state.octalPositions = []; this.state.start = this.state.pos; this.state.startLoc = this.state.curPosition(); @@ -8599,9 +8472,10 @@ class Tokenizer extends ParserError { if (hasLeadingZero) { const integer = this.input.slice(start, this.state.pos); - this.recordStrictModeErrors(start, ErrorMessages.StrictOctalLiteral); - if (!this.state.strict) { + if (this.state.strict) { + this.raise(start, ErrorMessages.StrictOctalLiteral); + } else { const underscorePos = integer.indexOf("_"); if (underscorePos > 0) { @@ -8628,10 +8502,7 @@ class Tokenizer extends ParserError { ++this.state.pos; } - if (this.readInt(10) === null) { - this.raise(start, ErrorMessages.InvalidOrMissingExponent); - } - + if (this.readInt(10) === null) this.raise(start, ErrorMessages.InvalidNumber); isFloat = true; hasExponent = true; next = this.input.charCodeAt(this.state.pos); @@ -8800,14 +8671,6 @@ class Tokenizer extends ParserError { } } - recordStrictModeErrors(pos, message) { - if (this.state.strict && !this.state.strictErrors.has(pos)) { - this.raise(pos, message); - } else { - this.state.strictErrors.set(pos, message); - } - } - readEscapedChar(inTemplate) { const throwOnInvalid = !inTemplate; const ch = this.input.charCodeAt(++this.state.pos); @@ -8861,8 +8724,8 @@ class Tokenizer extends ParserError { case 57: if (inTemplate) { return null; - } else { - this.recordStrictModeErrors(this.state.pos - 1, ErrorMessages.StrictNumericEscape); + } else if (this.state.strict) { + this.raise(this.state.pos - 1, ErrorMessages.StrictNumericEscape); } default: @@ -8883,8 +8746,10 @@ class Tokenizer extends ParserError { if (octalStr !== "0" || next === 56 || next === 57) { if (inTemplate) { return null; + } else if (this.state.strict) { + this.raise(codePos, ErrorMessages.StrictNumericEscape); } else { - this.recordStrictModeErrors(codePos, ErrorMessages.StrictNumericEscape); + this.state.octalPositions.push(codePos); } } @@ -9119,6 +8984,16 @@ class UtilParser extends Tokenizer { } } + checkYieldAwaitInDefaultParams() { + if (this.state.yieldPos !== -1 && (this.state.awaitPos === -1 || this.state.yieldPos < this.state.awaitPos)) { + this.raise(this.state.yieldPos, ErrorMessages.YieldBindingIdentifier); + } + + if (this.state.awaitPos !== -1) { + this.raise(this.state.awaitPos, ErrorMessages.AwaitBindingIdentifier); + } + } + tryParse(fn, oldState = this.state.clone()) { const abortSignal = { node: null @@ -9198,30 +9073,6 @@ class UtilParser extends Tokenizer { return this.match(types.name) || !!this.state.type.keyword || this.match(types.string) || this.match(types.num) || this.match(types.bigint) || this.match(types.decimal); } - isPrivateName(node) { - return node.type === "PrivateName"; - } - - getPrivateNameSV(node) { - return node.id.name; - } - - hasPropertyAsPrivateName(node) { - return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property); - } - - isOptionalChain(node) { - return node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression"; - } - - isObjectProperty(node) { - return node.type === "ObjectProperty"; - } - - isObjectMethod(node) { - return node.type === "ObjectMethod"; - } - } class ExpressionErrors { constructor() { @@ -9233,15 +9084,6 @@ class ExpressionErrors { class Node { constructor(parser, pos, loc) { - this.type = void 0; - this.start = void 0; - this.end = void 0; - this.loc = void 0; - this.range = void 0; - this.leadingComments = void 0; - this.trailingComments = void 0; - this.innerComments = void 0; - this.extra = void 0; this.type = ""; this.start = pos; this.end = 0; @@ -9317,7 +9159,7 @@ const unwrapParenthesizedExpression = node => { }; class LValParser extends NodeUtils { - toAssignable(node, isLHS = false) { + toAssignable(node) { var _node$extra, _node$extra3; let parenthesized = undefined; @@ -9325,13 +9167,7 @@ class LValParser extends NodeUtils { if (node.type === "ParenthesizedExpression" || ((_node$extra = node.extra) == null ? void 0 : _node$extra.parenthesized)) { parenthesized = unwrapParenthesizedExpression(node); - if (isLHS) { - if (parenthesized.type === "Identifier") { - this.expressionScope.recordParenthesizedIdentifierError(node.start, ErrorMessages.InvalidParenthesizedAssignment); - } else if (parenthesized.type !== "MemberExpression") { - this.raise(node.start, ErrorMessages.InvalidParenthesizedAssignment); - } - } else { + if (parenthesized.type !== "Identifier" && parenthesized.type !== "MemberExpression") { this.raise(node.start, ErrorMessages.InvalidParenthesizedAssignment); } } @@ -9351,7 +9187,7 @@ class LValParser extends NodeUtils { const prop = node.properties[i]; const isLast = i === last; - this.toAssignableObjectExpressionProp(prop, isLast, isLHS); + this.toAssignableObjectExpressionProp(prop, isLast); if (isLast && prop.type === "RestElement" && ((_node$extra2 = node.extra) == null ? void 0 : _node$extra2.trailingComma)) { this.raiseRestNotLast(node.extra.trailingComma); @@ -9361,7 +9197,7 @@ class LValParser extends NodeUtils { break; case "ObjectProperty": - this.toAssignable(node.value, isLHS); + this.toAssignable(node.value); break; case "SpreadElement": @@ -9369,13 +9205,13 @@ class LValParser extends NodeUtils { this.checkToRestConversion(node); node.type = "RestElement"; const arg = node.argument; - this.toAssignable(arg, isLHS); + this.toAssignable(arg); break; } case "ArrayExpression": node.type = "ArrayPattern"; - this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingComma, isLHS); + this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingComma); break; case "AssignmentExpression": @@ -9385,29 +9221,29 @@ class LValParser extends NodeUtils { node.type = "AssignmentPattern"; delete node.operator; - this.toAssignable(node.left, isLHS); + this.toAssignable(node.left); break; case "ParenthesizedExpression": - this.toAssignable(parenthesized, isLHS); + this.toAssignable(parenthesized); break; } return node; } - toAssignableObjectExpressionProp(prop, isLast, isLHS) { + toAssignableObjectExpressionProp(prop, isLast) { if (prop.type === "ObjectMethod") { const error = prop.kind === "get" || prop.kind === "set" ? ErrorMessages.PatternHasAccessor : ErrorMessages.PatternHasMethod; this.raise(prop.key.start, error); } else if (prop.type === "SpreadElement" && !isLast) { this.raiseRestNotLast(prop.start); } else { - this.toAssignable(prop, isLHS); + this.toAssignable(prop); } } - toAssignableList(exprList, trailingCommaPos, isLHS) { + toAssignableList(exprList, trailingCommaPos) { let end = exprList.length; if (end) { @@ -9417,9 +9253,8 @@ class LValParser extends NodeUtils { --end; } else if ((last == null ? void 0 : last.type) === "SpreadElement") { last.type = "RestElement"; - let arg = last.argument; - this.toAssignable(arg, isLHS); - arg = unwrapParenthesizedExpression(arg); + const arg = last.argument; + this.toAssignable(arg); if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern" && arg.type !== "ObjectPattern") { this.unexpected(arg.start); @@ -9437,7 +9272,7 @@ class LValParser extends NodeUtils { const elt = exprList[i]; if (elt) { - this.toAssignable(elt, isLHS); + this.toAssignable(elt); if (elt.type === "RestElement") { this.raiseRestNotLast(elt.start); @@ -9562,37 +9397,33 @@ class LValParser extends NodeUtils { return this.finishNode(node, "AssignmentPattern"); } - checkLVal(expr, contextDescription, bindingType = BIND_NONE, checkClashes, disallowLetBinding, strictModeChanged = false) { + checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription, disallowLetBinding, strictModeChanged = false) { switch (expr.type) { case "Identifier": - { - const { - name - } = expr; - - if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(name, this.inModule) : isStrictBindOnlyReservedWord(name))) { - this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.StrictEvalArguments : ErrorMessages.StrictEvalArgumentsBinding, name); - } - - if (checkClashes) { - if (checkClashes.has(name)) { - this.raise(expr.start, ErrorMessages.ParamDupe); - } else { - checkClashes.add(name); - } - } - - if (disallowLetBinding && name === "let") { - this.raise(expr.start, ErrorMessages.LetInLexicalBinding); - } - - if (!(bindingType & BIND_NONE)) { - this.scope.declareName(name, bindingType, expr.start); - } - - break; + if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(expr.name, this.inModule) : isStrictBindOnlyReservedWord(expr.name))) { + this.raise(expr.start, bindingType === BIND_NONE ? ErrorMessages.StrictEvalArguments : ErrorMessages.StrictEvalArgumentsBinding, expr.name); } + if (checkClashes) { + const key = `_${expr.name}`; + + if (checkClashes[key]) { + this.raise(expr.start, ErrorMessages.ParamDupe); + } else { + checkClashes[key] = true; + } + } + + if (disallowLetBinding && expr.name === "let") { + this.raise(expr.start, ErrorMessages.LetInLexicalBinding); + } + + if (!(bindingType & BIND_NONE)) { + this.scope.declareName(expr.name, bindingType, expr.start); + } + + break; + case "MemberExpression": if (bindingType !== BIND_NONE) { this.raise(expr.start, ErrorMessages.InvalidPropertyBindingPattern); @@ -9603,8 +9434,8 @@ class LValParser extends NodeUtils { case "ObjectPattern": for (let _i2 = 0, _expr$properties = expr.properties; _i2 < _expr$properties.length; _i2++) { let prop = _expr$properties[_i2]; - if (this.isObjectProperty(prop)) prop = prop.value;else if (this.isObjectMethod(prop)) continue; - this.checkLVal(prop, "object destructuring pattern", bindingType, checkClashes, disallowLetBinding); + if (prop.type === "ObjectProperty") prop = prop.value;else if (prop.type === "ObjectMethod") continue; + this.checkLVal(prop, bindingType, checkClashes, "object destructuring pattern", disallowLetBinding); } break; @@ -9614,22 +9445,22 @@ class LValParser extends NodeUtils { const elem = _expr$elements[_i3]; if (elem) { - this.checkLVal(elem, "array destructuring pattern", bindingType, checkClashes, disallowLetBinding); + this.checkLVal(elem, bindingType, checkClashes, "array destructuring pattern", disallowLetBinding); } } break; case "AssignmentPattern": - this.checkLVal(expr.left, "assignment pattern", bindingType, checkClashes); + this.checkLVal(expr.left, bindingType, checkClashes, "assignment pattern"); break; case "RestElement": - this.checkLVal(expr.argument, "rest element", bindingType, checkClashes); + this.checkLVal(expr.argument, bindingType, checkClashes, "rest element"); break; case "ParenthesizedExpression": - this.checkLVal(expr.expression, "parenthesized expression", bindingType, checkClashes); + this.checkLVal(expr.expression, bindingType, checkClashes, "parenthesized expression"); break; default: @@ -9665,147 +9496,9 @@ class LValParser extends NodeUtils { } -const kExpression = 0, - kMaybeArrowParameterDeclaration = 1, - kMaybeAsyncArrowParameterDeclaration = 2, - kParameterDeclaration = 3; - -class ExpressionScope { - constructor(type = kExpression) { - this.type = void 0; - this.type = type; - } - - canBeArrowParameterDeclaration() { - return this.type === kMaybeAsyncArrowParameterDeclaration || this.type === kMaybeArrowParameterDeclaration; - } - - isCertainlyParameterDeclaration() { - return this.type === kParameterDeclaration; - } - -} - -class ArrowHeadParsingScope extends ExpressionScope { - constructor(type) { - super(type); - this.errors = new Map(); - } - - recordDeclarationError(pos, message) { - this.errors.set(pos, message); - } - - clearDeclarationError(pos) { - this.errors.delete(pos); - } - - iterateErrors(iterator) { - this.errors.forEach(iterator); - } - -} - -class ExpressionScopeHandler { - constructor(raise) { - this.stack = [new ExpressionScope()]; - this.raise = raise; - } - - enter(scope) { - this.stack.push(scope); - } - - exit() { - this.stack.pop(); - } - - recordParameterInitializerError(pos, message) { - const { - stack - } = this; - let i = stack.length - 1; - let scope = stack[i]; - - while (!scope.isCertainlyParameterDeclaration()) { - if (scope.canBeArrowParameterDeclaration()) { - scope.recordDeclarationError(pos, message); - } else { - return; - } - - scope = stack[--i]; - } - - this.raise(pos, message); - } - - recordParenthesizedIdentifierError(pos, message) { - const { - stack - } = this; - const scope = stack[stack.length - 1]; - - if (scope.isCertainlyParameterDeclaration()) { - this.raise(pos, message); - } else if (scope.canBeArrowParameterDeclaration()) { - scope.recordDeclarationError(pos, message); - } else { - return; - } - } - - recordAsyncArrowParametersError(pos, message) { - const { - stack - } = this; - let i = stack.length - 1; - let scope = stack[i]; - - while (scope.canBeArrowParameterDeclaration()) { - if (scope.type === kMaybeAsyncArrowParameterDeclaration) { - scope.recordDeclarationError(pos, message); - } - - scope = stack[--i]; - } - } - - validateAsPattern() { - const { - stack - } = this; - const currentScope = stack[stack.length - 1]; - if (!currentScope.canBeArrowParameterDeclaration()) return; - currentScope.iterateErrors((message, pos) => { - this.raise(pos, message); - let i = stack.length - 2; - let scope = stack[i]; - - while (scope.canBeArrowParameterDeclaration()) { - scope.clearDeclarationError(pos); - scope = stack[--i]; - } - }); - } - -} -function newParameterDeclarationScope() { - return new ExpressionScope(kParameterDeclaration); -} -function newArrowHeadScope() { - return new ArrowHeadParsingScope(kMaybeArrowParameterDeclaration); -} -function newAsyncArrowScope() { - return new ArrowHeadParsingScope(kMaybeAsyncArrowParameterDeclaration); -} -function newExpressionScope() { - return new ExpressionScope(); -} - class ExpressionParser extends LValParser { checkProto(prop, isRecord, protoRef, refExpressionErrors) { - if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) { + if (prop.type === "SpreadElement" || prop.type === "ObjectMethod" || prop.computed || prop.shorthand) { return; } @@ -9899,7 +9592,6 @@ class ExpressionParser extends LValParser { if (this.isContextual("yield")) { if (this.prodParam.hasYield) { - this.state.exprAllowed = true; let left = this.parseYield(); if (afterLeftParse) { @@ -9907,6 +9599,8 @@ class ExpressionParser extends LValParser { } return left; + } else { + this.state.exprAllowed = false; } } @@ -9935,7 +9629,7 @@ class ExpressionParser extends LValParser { node.operator = operator; if (this.match(types.eq)) { - node.left = this.toAssignable(left, true); + node.left = this.toAssignable(left); refExpressionErrors.doubleProto = -1; } else { node.left = left; @@ -9945,7 +9639,7 @@ class ExpressionParser extends LValParser { refExpressionErrors.shorthandAssign = -1; } - this.checkLVal(left, "assignment expression"); + this.checkLVal(left, undefined, undefined, "assignment expression"); this.next(); node.right = this.parseMaybeAssign(); return this.finishNode(node, "AssignmentExpression"); @@ -10106,7 +9800,7 @@ class ExpressionParser extends LValParser { if (arg.type === "Identifier") { this.raise(node.start, ErrorMessages.StrictDelete); - } else if (this.hasPropertyAsPrivateName(arg)) { + } else if ((arg.type === "MemberExpression" || arg.type === "OptionalMemberExpression") && arg.property.type === "PrivateName") { this.raise(node.start, ErrorMessages.DeletePrivateField); } } @@ -10121,7 +9815,7 @@ class ExpressionParser extends LValParser { parseUpdate(node, update, refExpressionErrors) { if (update) { - this.checkLVal(node.argument, "prefix operation"); + this.checkLVal(node.argument, undefined, undefined, "prefix operation"); return this.finishNode(node, "UpdateExpression"); } @@ -10135,7 +9829,7 @@ class ExpressionParser extends LValParser { node.operator = this.state.value; node.prefix = false; node.argument = expr; - this.checkLVal(expr, "postfix operation"); + this.checkLVal(expr, undefined, undefined, "postfix operation"); this.next(); expr = this.finishNode(node, "UpdateExpression"); } @@ -10164,8 +9858,15 @@ class ExpressionParser extends LValParser { }; do { + const oldMaybeInAsyncArrowHead = this.state.maybeInAsyncArrowHead; + + if (state.maybeAsyncArrow) { + this.state.maybeInAsyncArrowHead = true; + } + base = this.parseSubscript(base, startPos, startLoc, noCalls, state); state.maybeAsyncArrow = false; + this.state.maybeInAsyncArrowHead = oldMaybeInAsyncArrowHead; } while (!state.stop); return base; @@ -10181,12 +9882,13 @@ class ExpressionParser extends LValParser { let optional = false; if (this.match(types.questionDot)) { + state.optionalChainMember = optional = true; + if (noCalls && this.lookaheadCharCode() === 40) { state.stop = true; return base; } - state.optionalChainMember = optional = true; this.next(); } @@ -10207,12 +9909,12 @@ class ExpressionParser extends LValParser { node.computed = computed; const property = computed ? this.parseExpression() : this.parseMaybePrivateName(true); - if (this.isPrivateName(property)) { + if (property.type === "PrivateName") { if (node.object.type === "Super") { this.raise(startPos, ErrorMessages.SuperPrivateField); } - this.classScope.usePrivateName(this.getPrivateNameSV(property), property.start); + this.classScope.usePrivateName(property.id.name, property.start); } node.property = property; @@ -10239,15 +9941,15 @@ class ExpressionParser extends LValParser { parseCoverCallAndAsyncArrowHead(base, startPos, startLoc, state, optional) { const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + const oldYieldPos = this.state.yieldPos; + const oldAwaitPos = this.state.awaitPos; this.state.maybeInArrowParameters = true; + this.state.yieldPos = -1; + this.state.awaitPos = -1; this.next(); let node = this.startNodeAt(startPos, startLoc); node.callee = base; - if (state.maybeAsyncArrow) { - this.expressionScope.enter(newAsyncArrowScope()); - } - if (state.optionalChainMember) { node.optional = optional; } @@ -10262,25 +9964,23 @@ class ExpressionParser extends LValParser { if (state.maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { state.stop = true; - this.expressionScope.validateAsPattern(); - this.expressionScope.exit(); node = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); + this.checkYieldAwaitInDefaultParams(); + this.state.yieldPos = oldYieldPos; + this.state.awaitPos = oldAwaitPos; } else { - if (state.maybeAsyncArrow) { - this.expressionScope.exit(); - } + this.toReferencedListDeep(node.arguments); + if (oldYieldPos !== -1) this.state.yieldPos = oldYieldPos; - this.toReferencedArguments(node); + if (!this.isAwaitAllowed() && !oldMaybeInArrowParameters || oldAwaitPos !== -1) { + this.state.awaitPos = oldAwaitPos; + } } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return node; } - toReferencedArguments(node, isParenthesizedExpr) { - this.toReferencedListDeep(node.arguments, isParenthesizedExpr); - } - parseTaggedTemplateExpression(base, startPos, startLoc, state) { const node = this.startNodeAt(startPos, startLoc); node.tag = base; @@ -10300,13 +10000,11 @@ class ExpressionParser extends LValParser { finishCallExpression(node, optional) { if (node.callee.type === "Import") { if (node.arguments.length === 2) { - if (!this.hasPlugin("moduleAttributes")) { - this.expectPlugin("importAssertions"); - } + this.expectPlugin("moduleAttributes"); } if (node.arguments.length === 0 || node.arguments.length > 2) { - this.raise(node.start, ErrorMessages.ImportCallArity, this.hasPlugin("importAssertions") || this.hasPlugin("moduleAttributes") ? "one or two arguments" : "one argument"); + this.raise(node.start, ErrorMessages.ImportCallArity, this.hasPlugin("moduleAttributes") ? "one or two arguments" : "one argument"); } else { for (let _i = 0, _node$arguments = node.arguments; _i < _node$arguments.length; _i++) { const arg = _node$arguments[_i]; @@ -10323,6 +10021,7 @@ class ExpressionParser extends LValParser { parseCallExpressionArguments(close, possibleAsyncArrow, dynamicImport, allowPlaceholder, nodeForExtra) { const elts = []; + let innerParenStart; let first = true; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; @@ -10334,7 +10033,7 @@ class ExpressionParser extends LValParser { this.expect(types.comma); if (this.match(close)) { - if (dynamicImport && !this.hasPlugin("importAssertions") && !this.hasPlugin("moduleAttributes")) { + if (dynamicImport && !this.hasPlugin("moduleAttributes")) { this.raise(this.state.lastTokStart, ErrorMessages.ImportCallArgumentTrailingComma); } @@ -10347,11 +10046,19 @@ class ExpressionParser extends LValParser { } } + if (this.match(types.parenL) && !innerParenStart) { + innerParenStart = this.state.start; + } + elts.push(this.parseExprListItem(false, possibleAsyncArrow ? new ExpressionErrors() : undefined, possibleAsyncArrow ? { start: 0 } : undefined, allowPlaceholder)); } + if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) { + this.unexpected(); + } + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return elts; } @@ -10578,15 +10285,26 @@ class ExpressionParser extends LValParser { parseAsyncArrowUnaryFunction(id) { const node = this.startNodeAtNode(id); - this.prodParam.enter(functionFlags(true, this.prodParam.hasYield)); + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + const oldMaybeInAsyncArrowHead = this.state.maybeInAsyncArrowHead; + const oldYieldPos = this.state.yieldPos; + const oldAwaitPos = this.state.awaitPos; + this.state.maybeInArrowParameters = true; + this.state.maybeInAsyncArrowHead = true; + this.state.yieldPos = -1; + this.state.awaitPos = -1; const params = [this.parseIdentifier()]; - this.prodParam.exit(); if (this.hasPrecedingLineBreak()) { this.raise(this.state.pos, ErrorMessages.LineTerminatorBeforeArrow); } this.expect(types.arrow); + this.checkYieldAwaitInDefaultParams(); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + this.state.maybeInAsyncArrowHead = oldMaybeInAsyncArrowHead; + this.state.yieldPos = oldYieldPos; + this.state.awaitPos = oldAwaitPos; this.parseArrowExpression(node, params, true); return node; } @@ -10713,10 +10431,13 @@ class ExpressionParser extends LValParser { const startLoc = this.state.startLoc; let val; this.next(); - this.expressionScope.enter(newArrowHeadScope()); const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + const oldYieldPos = this.state.yieldPos; + const oldAwaitPos = this.state.awaitPos; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.maybeInArrowParameters = true; + this.state.yieldPos = -1; + this.state.awaitPos = -1; this.state.inFSharpPipelineDirectBody = false; const innerStartPos = this.state.start; const innerStartLoc = this.state.startLoc; @@ -10761,13 +10482,28 @@ class ExpressionParser extends LValParser { let arrowNode = this.startNodeAt(startPos, startLoc); if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) { - this.expressionScope.validateAsPattern(); - this.expressionScope.exit(); + if (!this.isAwaitAllowed() && !this.state.maybeInAsyncArrowHead) { + this.state.awaitPos = oldAwaitPos; + } + + this.checkYieldAwaitInDefaultParams(); + this.state.yieldPos = oldYieldPos; + this.state.awaitPos = oldAwaitPos; + + for (let _i2 = 0; _i2 < exprList.length; _i2++) { + const param = exprList[_i2]; + + if (param.extra && param.extra.parenthesized) { + this.unexpected(param.extra.parenStart); + } + } + this.parseArrowExpression(arrowNode, exprList, false); return arrowNode; } - this.expressionScope.exit(); + if (oldYieldPos !== -1) this.state.yieldPos = oldYieldPos; + if (oldAwaitPos !== -1) this.state.awaitPos = oldAwaitPos; if (!exprList.length) { this.unexpected(this.state.lastTokStart); @@ -10843,7 +10579,7 @@ class ExpressionParser extends LValParser { if (node.callee.type === "Import") { this.raise(node.callee.start, ErrorMessages.ImportCallNotNewExpression); - } else if (this.isOptionalChain(node.callee)) { + } else if (node.callee.type === "OptionalMemberExpression" || node.callee.type === "OptionalCallExpression") { this.raise(this.state.lastTokEnd, ErrorMessages.OptionalChainingNoNew); } else if (this.eat(types.questionDot)) { this.raise(this.state.start, ErrorMessages.OptionalChainingNoNew); @@ -10890,7 +10626,7 @@ class ExpressionParser extends LValParser { while (!curElt.tail) { this.expect(types.dollarBraceL); - node.expressions.push(this.parseTemplateSubstitution()); + node.expressions.push(this.parseExpression()); this.expect(types.braceR); node.quasis.push(curElt = this.parseTemplateElement(isTagged)); } @@ -10899,10 +10635,6 @@ class ExpressionParser extends LValParser { return this.finishNode(node, "TemplateLiteral"); } - parseTemplateSubstitution() { - return this.parseExpression(); - } - parseObjectLike(close, isPattern, isRecord, refExpressionErrors) { if (isRecord) { this.expectPlugin("recordAndTuple"); @@ -10916,7 +10648,7 @@ class ExpressionParser extends LValParser { node.properties = []; this.next(); - while (!this.match(close)) { + while (!this.eat(close)) { if (first) { first = false; } else { @@ -10924,6 +10656,7 @@ class ExpressionParser extends LValParser { if (this.match(close)) { this.addExtra(node, "trailingComma", this.state.lastTokStart); + this.next(); break; } } @@ -10934,7 +10667,7 @@ class ExpressionParser extends LValParser { this.checkProto(prop, isRecord, propHash, refExpressionErrors); } - if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") { + if (isRecord && prop.type !== "ObjectProperty" && prop.type !== "SpreadElement") { this.raise(prop.start, ErrorMessages.InvalidRecordProperty); } @@ -10945,8 +10678,6 @@ class ExpressionParser extends LValParser { node.properties.push(prop); } - this.state.exprAllowed = false; - this.next(); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; let type = "ObjectExpression"; @@ -11046,18 +10777,11 @@ class ExpressionParser extends LValParser { return method.kind === "get" ? 0 : 1; } - getObjectOrClassMethodParams(method) { - return method.params; - } - checkGetterSetterParams(method) { - var _params; - const paramCount = this.getGetterSetterExpectedParamCount(method); - const params = this.getObjectOrClassMethodParams(method); const start = method.start; - if (params.length !== paramCount) { + if (method.params.length !== paramCount) { if (method.kind === "get") { this.raise(start, ErrorMessages.BadGetterArity); } else { @@ -11065,7 +10789,7 @@ class ExpressionParser extends LValParser { } } - if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") { + if (method.kind === "set" && method.params[method.params.length - 1].type === "RestElement") { this.raise(start, ErrorMessages.BadSetterRestParameter); } } @@ -11129,7 +10853,7 @@ class ExpressionParser extends LValParser { this.state.inPropertyName = true; prop.key = this.match(types.num) || this.match(types.string) || this.match(types.bigint) || this.match(types.decimal) ? this.parseExprAtom() : this.parseMaybePrivateName(isPrivateNameAllowed); - if (!this.isPrivateName(prop.key)) { + if (prop.key.type !== "PrivateName") { prop.computed = false; } @@ -11146,6 +10870,10 @@ class ExpressionParser extends LValParser { } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { + const oldYieldPos = this.state.yieldPos; + const oldAwaitPos = this.state.awaitPos; + this.state.yieldPos = -1; + this.state.awaitPos = -1; this.initFunction(node, isAsync); node.generator = !!isGenerator; const allowModifiers = isConstructor; @@ -11155,6 +10883,8 @@ class ExpressionParser extends LValParser { this.parseFunctionBodyAndFinish(node, type, true); this.prodParam.exit(); this.scope.exit(); + this.state.yieldPos = oldYieldPos; + this.state.awaitPos = oldAwaitPos; return node; } @@ -11168,6 +10898,11 @@ class ExpressionParser extends LValParser { const node = this.startNode(); this.next(); node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node); + + if (canBePattern && !this.state.maybeInArrowParameters) { + this.toReferencedList(node.elements); + } + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); } @@ -11183,6 +10918,8 @@ class ExpressionParser extends LValParser { this.prodParam.enter(flags); this.initFunction(node, isAsync); const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + const oldYieldPos = this.state.yieldPos; + const oldAwaitPos = this.state.awaitPos; if (params) { this.state.maybeInArrowParameters = true; @@ -11190,15 +10927,19 @@ class ExpressionParser extends LValParser { } this.state.maybeInArrowParameters = false; + this.state.yieldPos = -1; + this.state.awaitPos = -1; this.parseFunctionBody(node, true); this.prodParam.exit(); this.scope.exit(); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + this.state.yieldPos = oldYieldPos; + this.state.awaitPos = oldAwaitPos; return this.finishNode(node, "ArrowFunctionExpression"); } setArrowFunctionParameters(node, params, trailingCommaPos) { - node.params = this.toAssignableList(params, trailingCommaPos, false); + node.params = this.toAssignableList(params, trailingCommaPos); } parseFunctionBodyAndFinish(node, type, isMethod = false) { @@ -11208,7 +10949,8 @@ class ExpressionParser extends LValParser { parseFunctionBody(node, allowExpression, isMethod = false) { const isExpression = allowExpression && !this.match(types.braceL); - this.expressionScope.enter(newExpressionScope()); + const oldInParameters = this.state.inParameters; + this.state.inParameters = false; if (isExpression) { node.body = this.parseMaybeAssign(); @@ -11230,13 +10972,14 @@ class ExpressionParser extends LValParser { this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged); if (this.state.strict && node.id) { - this.checkLVal(node.id, "function name", BIND_OUTSIDE, undefined, undefined, strictModeChanged); + this.checkLVal(node.id, BIND_OUTSIDE, undefined, "function name", undefined, strictModeChanged); } }); this.prodParam.exit(); - this.expressionScope.exit(); this.state.labels = oldLabels; } + + this.state.inParameters = oldInParameters; } isSimpleParamList(params) { @@ -11248,11 +10991,10 @@ class ExpressionParser extends LValParser { } checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { - const checkClashes = new Set(); + const nameHash = Object.create(null); - for (let _i2 = 0, _node$params = node.params; _i2 < _node$params.length; _i2++) { - const param = _node$params[_i2]; - this.checkLVal(param, "function parameter list", BIND_VAR, allowDuplicates ? null : checkClashes, undefined, strictModeChanged); + for (let i = 0; i < node.params.length; i++) { + this.checkLVal(node.params[i], BIND_VAR, allowDuplicates ? null : nameHash, "function parameter list", undefined, strictModeChanged); } } @@ -11364,13 +11106,15 @@ class ExpressionParser extends LValParser { if (this.prodParam.hasAwait) { this.raise(startLoc, ErrorMessages.AwaitBindingIdentifier); return; - } else { - this.expressionScope.recordAsyncArrowParametersError(startLoc, ErrorMessages.AwaitBindingIdentifier); + } + + if (this.state.awaitPos === -1 && (this.state.maybeInAsyncArrowHead || this.isAwaitAllowed())) { + this.state.awaitPos = this.state.start; } } if (this.scope.inClass && !this.scope.inNonArrowFunction && word === "arguments") { - this.raise(startLoc, ErrorMessages.ArgumentsInClass); + this.raise(startLoc, ErrorMessages.ArgumentsDisallowedInInitializer); return; } @@ -11383,7 +11127,7 @@ class ExpressionParser extends LValParser { if (reservedTest(word, this.inModule)) { if (!this.prodParam.hasAwait && word === "await") { - this.raise(startLoc, this.hasPlugin("topLevelAwait") ? ErrorMessages.AwaitNotInAsyncContext : ErrorMessages.AwaitNotInAsyncFunction); + this.raise(startLoc, ErrorMessages.AwaitNotInAsyncFunction); } else { this.raise(startLoc, ErrorMessages.UnexpectedReservedWord, word); } @@ -11391,10 +11135,11 @@ class ExpressionParser extends LValParser { } isAwaitAllowed() { - if (this.prodParam.hasAwait) return true; + if (this.scope.inFunction) return this.prodParam.hasAwait; + if (this.options.allowAwaitOutsideFunction) return true; - if (this.options.allowAwaitOutsideFunction && !this.scope.inFunction) { - return true; + if (this.hasPlugin("topLevelAwait")) { + return this.inModule && this.prodParam.hasAwait; } return false; @@ -11403,7 +11148,12 @@ class ExpressionParser extends LValParser { parseAwait() { const node = this.startNode(); this.next(); - this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.AwaitExpressionFormalParameter); + + if (this.state.inParameters) { + this.raise(node.start, ErrorMessages.AwaitExpressionFormalParameter); + } else if (this.state.awaitPos === -1) { + this.state.awaitPos = node.start; + } if (this.eat(types.star)) { this.raise(node.start, ErrorMessages.ObsoleteAwaitStar); @@ -11426,7 +11176,13 @@ class ExpressionParser extends LValParser { parseYield() { const node = this.startNode(); - this.expressionScope.recordParameterInitializerError(node.start, ErrorMessages.YieldInParameter); + + if (this.state.inParameters) { + this.raise(node.start, ErrorMessages.YieldInParameter); + } else if (this.state.yieldPos === -1) { + this.state.yieldPos = node.start; + } + this.next(); if (this.match(types.semi) || !this.match(types.star) && !this.state.type.startsExpr || this.hasPrecedingLineBreak()) { @@ -11599,7 +11355,6 @@ const FUNC_NO_FLAGS = 0b000, FUNC_STATEMENT = 0b001, FUNC_HANGING_STATEMENT = 0b010, FUNC_NULLABLE_ID = 0b100; -const loneSurrogate = /[\uD800-\uDFFF]/u; class StatementParser extends ExpressionParser { parseTopLevel(file, program) { program.sourceType = this.options.sourceType; @@ -12004,9 +11759,9 @@ class StatementParser extends ExpressionParser { const init = this.parseExpression(true, refExpressionErrors); if (this.match(types._in) || this.isContextual("of")) { - this.toAssignable(init, true); + this.toAssignable(init); const description = this.isContextual("of") ? "for-of statement" : "for-in statement"; - this.checkLVal(init, description); + this.checkLVal(init, undefined, undefined, description); return this.parseForIn(node, init, awaitAt); } else { this.checkExpressionErrors(refExpressionErrors, true); @@ -12110,7 +11865,7 @@ class StatementParser extends ExpressionParser { const param = this.parseBindingAtom(); const simple = param.type === "Identifier"; this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0); - this.checkLVal(param, "catch clause", BIND_LEXICAL); + this.checkLVal(param, BIND_LEXICAL, null, "catch clause"); return param; } @@ -12219,11 +11974,6 @@ class StatementParser extends ExpressionParser { parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) { const node = this.startNode(); - - if (allowDirectives) { - this.state.strictErrors.clear(); - } - this.expect(types.braceL); if (createNewLexicalScope) { @@ -12250,33 +12000,41 @@ class StatementParser extends ExpressionParser { } parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) { + const octalPositions = []; const oldStrict = this.state.strict; let hasStrictModeDirective = false; let parsedNonDirective = false; while (!this.match(end)) { - const stmt = this.parseStatement(null, topLevel); - - if (directives && !parsedNonDirective) { - if (this.isValidDirective(stmt)) { - const directive = this.stmtToDirective(stmt); - directives.push(directive); - - if (!hasStrictModeDirective && directive.value.value === "use strict") { - hasStrictModeDirective = true; - this.setStrict(true); - } - - continue; - } - - parsedNonDirective = true; - this.state.strictErrors.clear(); + if (!parsedNonDirective && this.state.octalPositions.length) { + octalPositions.push(...this.state.octalPositions); } + const stmt = this.parseStatement(null, topLevel); + + if (directives && !parsedNonDirective && this.isValidDirective(stmt)) { + const directive = this.stmtToDirective(stmt); + directives.push(directive); + + if (!hasStrictModeDirective && directive.value.value === "use strict") { + hasStrictModeDirective = true; + this.setStrict(true); + } + + continue; + } + + parsedNonDirective = true; body.push(stmt); } + if (this.state.strict && octalPositions.length) { + for (let _i3 = 0; _i3 < octalPositions.length; _i3++) { + const pos = octalPositions[_i3]; + this.raise(pos, ErrorMessages.StrictOctalLiteral); + } + } + if (afterBlockParse) { afterBlockParse.call(this, hasStrictModeDirective); } @@ -12340,7 +12098,7 @@ class StatementParser extends ExpressionParser { } else { if (kind === "const" && !(this.match(types._in) || this.isContextual("of"))) { if (!isTypescript) { - this.raise(this.state.lastTokEnd, ErrorMessages.DeclarationMissingInitializer, "Const declarations"); + this.unexpected(); } } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(types._in) || this.isContextual("of")))) { this.raise(this.state.lastTokEnd, ErrorMessages.DeclarationMissingInitializer, "Complex binding patterns"); @@ -12358,7 +12116,7 @@ class StatementParser extends ExpressionParser { parseVarId(decl, kind) { decl.id = this.parseBindingAtom(); - this.checkLVal(decl.id, "variable declaration", kind === "var" ? BIND_VAR : BIND_LEXICAL, undefined, kind !== "var"); + this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, undefined, "variable declaration", kind !== "var"); } parseFunction(node, statement = FUNC_NO_FLAGS, isAsync = false) { @@ -12378,7 +12136,11 @@ class StatementParser extends ExpressionParser { } const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + const oldYieldPos = this.state.yieldPos; + const oldAwaitPos = this.state.awaitPos; this.state.maybeInArrowParameters = false; + this.state.yieldPos = -1; + this.state.awaitPos = -1; this.scope.enter(SCOPE_FUNCTION); this.prodParam.enter(functionFlags(isAsync, node.generator)); @@ -12386,7 +12148,7 @@ class StatementParser extends ExpressionParser { node.id = this.parseFunctionId(); } - this.parseFunctionParams(node, false); + this.parseFunctionParams(node); this.withTopicForbiddingContext(() => { this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); }); @@ -12398,6 +12160,8 @@ class StatementParser extends ExpressionParser { } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + this.state.yieldPos = oldYieldPos; + this.state.awaitPos = oldAwaitPos; return node; } @@ -12406,10 +12170,12 @@ class StatementParser extends ExpressionParser { } parseFunctionParams(node, allowModifiers) { + const oldInParameters = this.state.inParameters; + this.state.inParameters = true; this.expect(types.parenL); - this.expressionScope.enter(newParameterDeclarationScope()); node.params = this.parseBindingList(types.parenR, 41, false, allowModifiers); - this.expressionScope.exit(); + this.state.inParameters = oldInParameters; + this.checkYieldAwaitInDefaultParams(); } registerFunctionStatementId(node) { @@ -12443,9 +12209,7 @@ class StatementParser extends ExpressionParser { parseClassBody(constructorAllowsSuper, oldStrict) { this.classScope.enter(); const state = { - constructorAllowsSuper, - hadConstructor: false, - hadStaticBlock: false + hadConstructor: false }; let decorators = []; const classBody = this.startNode(); @@ -12474,7 +12238,7 @@ class StatementParser extends ExpressionParser { decorators = []; } - this.parseClassMember(classBody, member, state); + this.parseClassMember(classBody, member, state, constructorAllowsSuper); if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { this.raise(member.start, ErrorMessages.DecoratorConstructor); @@ -12515,24 +12279,17 @@ class StatementParser extends ExpressionParser { return false; } - parseClassMember(classBody, member, state) { + parseClassMember(classBody, member, state, constructorAllowsSuper) { const isStatic = this.isContextual("static"); - if (isStatic) { - if (this.parseClassMemberFromModifier(classBody, member)) { - return; - } - - if (this.eat(types.braceL)) { - this.parseClassStaticBlock(classBody, member, state); - return; - } + if (isStatic && this.parseClassMemberFromModifier(classBody, member)) { + return; } - this.parseClassMemberWithIsStatic(classBody, member, state, isStatic); + this.parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper); } - parseClassMemberWithIsStatic(classBody, member, state, isStatic) { + parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper) { const publicMethod = member; const privateMethod = member; const publicProp = member; @@ -12545,7 +12302,7 @@ class StatementParser extends ExpressionParser { method.kind = "method"; this.parseClassElementName(method); - if (this.isPrivateName(method.key)) { + if (method.key.type === "PrivateName") { this.pushClassPrivateMethod(classBody, privateMethod, true, false); return; } @@ -12560,7 +12317,7 @@ class StatementParser extends ExpressionParser { const containsEsc = this.state.containsEsc; const key = this.parseClassElementName(member); - const isPrivate = this.isPrivateName(key); + const isPrivate = key.type === "PrivateName"; const isSimple = key.type === "Identifier"; const maybeQuestionTokenStart = this.state.start; this.parsePostMemberNameModifiers(publicMember); @@ -12584,7 +12341,7 @@ class StatementParser extends ExpressionParser { } state.hadConstructor = true; - allowsDirectSuper = state.constructorAllowsSuper; + allowsDirectSuper = constructorAllowsSuper; } this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); @@ -12605,7 +12362,7 @@ class StatementParser extends ExpressionParser { this.parseClassElementName(method); this.parsePostMemberNameModifiers(publicMember); - if (this.isPrivateName(method.key)) { + if (method.key.type === "PrivateName") { this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); } else { if (this.isNonstaticConstructor(publicMethod)) { @@ -12618,7 +12375,7 @@ class StatementParser extends ExpressionParser { method.kind = key.name; this.parseClassElementName(publicMethod); - if (this.isPrivateName(method.key)) { + if (method.key.type === "PrivateName") { this.pushClassPrivateMethod(classBody, privateMethod, false, false); } else { if (this.isNonstaticConstructor(publicMethod)) { @@ -12647,41 +12404,13 @@ class StatementParser extends ExpressionParser { this.raise(key.start, ErrorMessages.StaticPrototype); } - if (this.isPrivateName(key) && this.getPrivateNameSV(key) === "constructor") { + if (key.type === "PrivateName" && key.id.name === "constructor") { this.raise(key.start, ErrorMessages.ConstructorClassPrivateField); } return key; } - parseClassStaticBlock(classBody, member, state) { - var _member$decorators; - - this.expectPlugin("classStaticBlock", member.start); - this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); - this.expressionScope.enter(newExpressionScope()); - const oldLabels = this.state.labels; - this.state.labels = []; - this.prodParam.enter(PARAM); - const body = member.body = []; - this.parseBlockOrModuleBlockBody(body, undefined, false, types.braceR); - this.prodParam.exit(); - this.expressionScope.exit(); - this.scope.exit(); - this.state.labels = oldLabels; - classBody.body.push(this.finishNode(member, "StaticBlock")); - - if (state.hadStaticBlock) { - this.raise(member.start, ErrorMessages.DuplicateStaticBlock); - } - - if ((_member$decorators = member.decorators) == null ? void 0 : _member$decorators.length) { - this.raise(member.start, ErrorMessages.DecoratorStaticBlock); - } - - state.hadStaticBlock = true; - } - pushClassProperty(classBody, prop) { if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) { this.raise(prop.key.start, ErrorMessages.ConstructorClassField); @@ -12694,7 +12423,7 @@ class StatementParser extends ExpressionParser { this.expectPlugin("classPrivateProperties", prop.key.start); const node = this.parseClassPrivateProperty(prop); classBody.body.push(node); - this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.start); + this.classScope.declarePrivateName(node.key.id.name, CLASS_ELEMENT_OTHER, node.key.start); } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { @@ -12706,35 +12435,41 @@ class StatementParser extends ExpressionParser { const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true); classBody.body.push(node); const kind = node.kind === "get" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER; - this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.start); + this.classScope.declarePrivateName(node.key.id.name, kind, node.key.start); } parsePostMemberNameModifiers(methodOrProp) {} parseClassPrivateProperty(node) { - this.parseInitializer(node); + this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); + this.prodParam.enter(PARAM); + node.value = this.eat(types.eq) ? this.parseMaybeAssignAllowIn() : null; this.semicolon(); + this.prodParam.exit(); + this.scope.exit(); return this.finishNode(node, "ClassPrivateProperty"); } parseClassProperty(node) { - if (!node.typeAnnotation || this.match(types.eq)) { + if (!node.typeAnnotation) { this.expectPlugin("classProperties"); } - this.parseInitializer(node); - this.semicolon(); - return this.finishNode(node, "ClassProperty"); - } - - parseInitializer(node) { this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); - this.expressionScope.enter(newExpressionScope()); this.prodParam.enter(PARAM); - node.value = this.eat(types.eq) ? this.parseMaybeAssignAllowIn() : null; - this.expressionScope.exit(); + + if (this.match(types.eq)) { + this.expectPlugin("classProperties"); + this.next(); + node.value = this.parseMaybeAssignAllowIn(); + } else { + node.value = null; + } + + this.semicolon(); this.prodParam.exit(); this.scope.exit(); + return this.finishNode(node, "ClassProperty"); } parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) { @@ -12742,7 +12477,7 @@ class StatementParser extends ExpressionParser { node.id = this.parseIdentifier(); if (isStatement) { - this.checkLVal(node.id, "class name", bindingType); + this.checkLVal(node.id, bindingType, undefined, "class name"); } } else { if (optionalId || !isStatement) { @@ -12821,7 +12556,7 @@ class StatementParser extends ExpressionParser { if (!node.specifiers) node.specifiers = []; const specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc); this.next(); - specifier.exported = this.parseModuleExportName(); + specifier.exported = this.parseIdentifier(true); node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); return true; } @@ -12931,11 +12666,6 @@ class StatementParser extends ExpressionParser { if (this.eatContextual("from")) { node.source = this.parseImportSource(); this.checkExport(node); - const assertions = this.maybeParseImportAssertions(); - - if (assertions) { - node.assertions = assertions; - } } else { if (expect) { this.unexpected(); @@ -12978,25 +12708,13 @@ class StatementParser extends ExpressionParser { } } } else if (node.specifiers && node.specifiers.length) { - for (let _i3 = 0, _node$specifiers = node.specifiers; _i3 < _node$specifiers.length; _i3++) { - const specifier = _node$specifiers[_i3]; - const { - exported - } = specifier; - const exportedName = exported.type === "Identifier" ? exported.name : exported.value; - this.checkDuplicateExports(specifier, exportedName); + for (let _i4 = 0, _node$specifiers = node.specifiers; _i4 < _node$specifiers.length; _i4++) { + const specifier = _node$specifiers[_i4]; + this.checkDuplicateExports(specifier, specifier.exported.name); if (!isFrom && specifier.local) { - const { - local - } = specifier; - - if (local.type === "StringLiteral") { - this.raise(specifier.start, ErrorMessages.ExportBindingIsString, local.value, exportedName); - } else { - this.checkReservedWord(local.name, local.start, true, false); - this.scope.checkLocalExport(local); - } + this.checkReservedWord(specifier.local.name, specifier.local.start, true, false); + this.scope.checkLocalExport(specifier.local); } } } else if (node.declaration) { @@ -13005,8 +12723,8 @@ class StatementParser extends ExpressionParser { if (!id) throw new Error("Assertion failure"); this.checkDuplicateExports(node, id.name); } else if (node.declaration.type === "VariableDeclaration") { - for (let _i4 = 0, _node$declaration$dec = node.declaration.declarations; _i4 < _node$declaration$dec.length; _i4++) { - const declaration = _node$declaration$dec[_i4]; + for (let _i5 = 0, _node$declaration$dec = node.declaration.declarations; _i5 < _node$declaration$dec.length; _i5++) { + const declaration = _node$declaration$dec[_i5]; this.checkDeclaration(declaration.id); } } @@ -13024,13 +12742,13 @@ class StatementParser extends ExpressionParser { if (node.type === "Identifier") { this.checkDuplicateExports(node, node.name); } else if (node.type === "ObjectPattern") { - for (let _i5 = 0, _node$properties = node.properties; _i5 < _node$properties.length; _i5++) { - const prop = _node$properties[_i5]; + for (let _i6 = 0, _node$properties = node.properties; _i6 < _node$properties.length; _i6++) { + const prop = _node$properties[_i6]; this.checkDeclaration(prop); } } else if (node.type === "ArrayPattern") { - for (let _i6 = 0, _node$elements = node.elements; _i6 < _node$elements.length; _i6++) { - const elem = _node$elements[_i6]; + for (let _i7 = 0, _node$elements = node.elements; _i7 < _node$elements.length; _i7++) { + const elem = _node$elements[_i7]; if (elem) { this.checkDeclaration(elem); @@ -13067,30 +12785,14 @@ class StatementParser extends ExpressionParser { } const node = this.startNode(); - node.local = this.parseModuleExportName(); - node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local.__clone(); + node.local = this.parseIdentifier(true); + node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone(); nodes.push(this.finishNode(node, "ExportSpecifier")); } return nodes; } - parseModuleExportName() { - if (this.match(types.string)) { - this.expectPlugin("moduleStringNames"); - const result = this.parseLiteral(this.state.value, "StringLiteral"); - const surrogate = result.value.match(loneSurrogate); - - if (surrogate) { - this.raise(result.start, ErrorMessages.ModuleExportNameHasLoneSurrogate, surrogate[0].charCodeAt(0).toString(16)); - } - - return result; - } - - return this.parseIdentifier(true); - } - parseImport(node) { node.specifiers = []; @@ -13103,17 +12805,11 @@ class StatementParser extends ExpressionParser { } node.source = this.parseImportSource(); - const assertions = this.maybeParseImportAssertions(); + const attributes = this.maybeParseModuleAttributes(); - if (assertions) { - node.assertions = assertions; - } else { - const attributes = this.maybeParseModuleAttributes(); - - if (attributes) { - node.attributes = attributes; - } - } + if (attributes) { + node.attributes = attributes; + } this.semicolon(); return this.finishNode(node, "ImportDeclaration"); @@ -13130,52 +12826,10 @@ class StatementParser extends ExpressionParser { parseImportSpecifierLocal(node, specifier, type, contextDescription) { specifier.local = this.parseIdentifier(); - this.checkLVal(specifier.local, contextDescription, BIND_LEXICAL); + this.checkLVal(specifier.local, BIND_LEXICAL, undefined, contextDescription); node.specifiers.push(this.finishNode(specifier, type)); } - parseAssertEntries() { - const attrs = []; - const attrNames = new Set(); - - do { - if (this.match(types.braceR)) { - break; - } - - const node = this.startNode(); - const keyName = this.state.value; - - if (this.match(types.string)) { - node.key = this.parseLiteral(keyName, "StringLiteral"); - } else { - node.key = this.parseIdentifier(true); - } - - this.expect(types.colon); - - if (keyName !== "type") { - this.raise(node.key.start, ErrorMessages.ModuleAttributeDifferentFromType, keyName); - } - - if (attrNames.has(keyName)) { - this.raise(node.key.start, ErrorMessages.ModuleAttributesWithDuplicateKeys, keyName); - } - - attrNames.add(keyName); - - if (!this.match(types.string)) { - throw this.unexpected(this.state.start, ErrorMessages.ModuleAttributeInvalidValue); - } - - node.value = this.parseLiteral(this.state.value, "StringLiteral"); - this.finishNode(node, "ImportAttribute"); - attrs.push(node); - } while (this.eat(types.comma)); - - return attrs; - } - maybeParseModuleAttributes() { if (this.match(types._with) && !this.hasPrecedingLineBreak()) { this.expectPlugin("moduleAttributes"); @@ -13215,21 +12869,6 @@ class StatementParser extends ExpressionParser { return attrs; } - maybeParseImportAssertions() { - if (this.isContextual("assert") && !this.hasPrecedingLineBreak()) { - this.expectPlugin("importAssertions"); - this.next(); - } else { - if (this.hasPlugin("importAssertions")) return []; - return null; - } - - this.eat(types.braceL); - const attrs = this.parseAssertEntries(); - this.eat(types.braceR); - return attrs; - } - maybeParseDefaultImportSpecifier(node) { if (this.shouldParseDefaultImport(node)) { this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier", "default import specifier"); @@ -13273,24 +12912,16 @@ class StatementParser extends ExpressionParser { parseImportSpecifier(node) { const specifier = this.startNode(); - specifier.imported = this.parseModuleExportName(); + specifier.imported = this.parseIdentifier(true); if (this.eatContextual("as")) { specifier.local = this.parseIdentifier(); } else { - const { - imported - } = specifier; - - if (imported.type === "StringLiteral") { - throw this.raise(specifier.start, ErrorMessages.ImportBindingIsString, imported.value); - } - - this.checkReservedWord(imported.name, specifier.start, true, true); - specifier.local = imported.__clone(); + this.checkReservedWord(specifier.imported.name, specifier.start, true, true); + specifier.local = specifier.imported.__clone(); } - this.checkLVal(specifier.local, "import specifier", BIND_LEXICAL); + this.checkLVal(specifier.local, BIND_LEXICAL, undefined, "import specifier"); node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); } @@ -13390,7 +13021,6 @@ class Parser extends StatementParser { this.scope = new ScopeHandler(this.raise.bind(this), this.inModule); this.prodParam = new ProductionParameterHandler(); this.classScope = new ClassScopeHandler(this.raise.bind(this)); - this.expressionScope = new ExpressionScopeHandler(this.raise.bind(this)); this.plugins = pluginsMap(this.options.plugins); this.filename = options.sourceFilename; } diff --git a/node_modules/@babel/parser/lib/index.js.map b/node_modules/@babel/parser/lib/index.js.map index 09ceec9..28899bb 100644 --- a/node_modules/@babel/parser/lib/index.js.map +++ b/node_modules/@babel/parser/lib/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../src/tokenizer/types.js","../src/util/whitespace.js","../src/util/location.js","../src/parser/base.js","../src/parser/comments.js","../src/parser/error-message.js","../src/parser/error.js","../src/plugins/estree.js","../src/tokenizer/context.js","../../babel-helper-validator-identifier/src/identifier.ts","../../babel-helper-validator-identifier/src/keyword.ts","../src/util/identifier.js","../src/util/scopeflags.js","../src/plugins/flow.js","../src/plugins/jsx/xhtml.js","../src/plugins/jsx/index.js","../src/util/scope.js","../src/plugins/typescript/scope.js","../src/util/production-parameter.js","../src/plugins/typescript/index.js","../src/plugins/placeholders.js","../src/plugins/v8intrinsic.js","../src/plugin-utils.js","../src/options.js","../src/tokenizer/state.js","../src/tokenizer/index.js","../src/parser/util.js","../src/parser/node.js","../src/parser/lval.js","../src/util/expression-scope.js","../src/parser/expression.js","../src/parser/statement.js","../src/util/class-scope.js","../src/parser/index.js","../src/index.js"],"sourcesContent":["// @flow\n\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between regular\n// expressions and divisions. It is set on all token types that can\n// be followed by an expression (thus, a slash after them would be a\n// regular expression).\n\n// The `startsExpr` property is used to determine whether an expression\n// may be the “argument” subexpression of a `yield` expression or\n// `yield` statement. It is set on all token types that may be at the\n// start of a subexpression.\n\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\n\ntype TokenOptions = {\n keyword?: string,\n beforeExpr?: boolean,\n startsExpr?: boolean,\n rightAssociative?: boolean,\n isLoop?: boolean,\n isAssign?: boolean,\n prefix?: boolean,\n postfix?: boolean,\n binop?: ?number,\n};\n\nexport class TokenType {\n label: string;\n keyword: ?string;\n beforeExpr: boolean;\n startsExpr: boolean;\n rightAssociative: boolean;\n isLoop: boolean;\n isAssign: boolean;\n prefix: boolean;\n postfix: boolean;\n binop: ?number;\n updateContext: ?(prevType: TokenType) => void;\n\n constructor(label: string, conf: TokenOptions = {}) {\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n this.updateContext = null;\n }\n}\n\nexport const keywords = new Map();\n\nfunction createKeyword(name: string, options: TokenOptions = {}): TokenType {\n options.keyword = name;\n const token = new TokenType(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name: string, binop: number) {\n return new TokenType(name, { beforeExpr, binop });\n}\n\nexport const types: { [name: string]: TokenType } = {\n num: new TokenType(\"num\", { startsExpr }),\n bigint: new TokenType(\"bigint\", { startsExpr }),\n decimal: new TokenType(\"decimal\", { startsExpr }),\n regexp: new TokenType(\"regexp\", { startsExpr }),\n string: new TokenType(\"string\", { startsExpr }),\n name: new TokenType(\"name\", { startsExpr }),\n eof: new TokenType(\"eof\"),\n\n // Punctuation token types.\n bracketL: new TokenType(\"[\", { beforeExpr, startsExpr }),\n bracketHashL: new TokenType(\"#[\", { beforeExpr, startsExpr }),\n bracketBarL: new TokenType(\"[|\", { beforeExpr, startsExpr }),\n bracketR: new TokenType(\"]\"),\n bracketBarR: new TokenType(\"|]\"),\n braceL: new TokenType(\"{\", { beforeExpr, startsExpr }),\n braceBarL: new TokenType(\"{|\", { beforeExpr, startsExpr }),\n braceHashL: new TokenType(\"#{\", { beforeExpr, startsExpr }),\n braceR: new TokenType(\"}\"),\n braceBarR: new TokenType(\"|}\"),\n parenL: new TokenType(\"(\", { beforeExpr, startsExpr }),\n parenR: new TokenType(\")\"),\n comma: new TokenType(\",\", { beforeExpr }),\n semi: new TokenType(\";\", { beforeExpr }),\n colon: new TokenType(\":\", { beforeExpr }),\n doubleColon: new TokenType(\"::\", { beforeExpr }),\n dot: new TokenType(\".\"),\n question: new TokenType(\"?\", { beforeExpr }),\n questionDot: new TokenType(\"?.\"),\n arrow: new TokenType(\"=>\", { beforeExpr }),\n template: new TokenType(\"template\"),\n ellipsis: new TokenType(\"...\", { beforeExpr }),\n backQuote: new TokenType(\"`\", { startsExpr }),\n dollarBraceL: new TokenType(\"${\", { beforeExpr, startsExpr }),\n at: new TokenType(\"@\"),\n hash: new TokenType(\"#\", { startsExpr }),\n\n // Special hashbang token.\n interpreterDirective: new TokenType(\"#!...\"),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n eq: new TokenType(\"=\", { beforeExpr, isAssign }),\n assign: new TokenType(\"_=\", { beforeExpr, isAssign }),\n incDec: new TokenType(\"++/--\", { prefix, postfix, startsExpr }),\n bang: new TokenType(\"!\", { beforeExpr, prefix, startsExpr }),\n tilde: new TokenType(\"~\", { beforeExpr, prefix, startsExpr }),\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n relational: createBinop(\"/<=/>=\", 7),\n bitShift: createBinop(\"<>/>>>\", 8),\n plusMin: new TokenType(\"+/-\", { beforeExpr, binop: 9, prefix, startsExpr }),\n // startsExpr: required by v8intrinsic plugin\n modulo: new TokenType(\"%\", { beforeExpr, binop: 10, startsExpr }),\n // unset `beforeExpr` as it can be `function *`\n star: new TokenType(\"*\", { binop: 10 }),\n slash: createBinop(\"/\", 10),\n exponent: new TokenType(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true,\n }),\n\n // Keywords\n // Don't forget to update packages/babel-helper-validator-identifier/src/keyword.js\n // when new keywords are added\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", { beforeExpr }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", { beforeExpr }),\n _do: createKeyword(\"do\", { isLoop, beforeExpr }),\n _else: createKeyword(\"else\", { beforeExpr }),\n _finally: createKeyword(\"finally\"),\n _for: createKeyword(\"for\", { isLoop }),\n _function: createKeyword(\"function\", { startsExpr }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", { beforeExpr }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", { beforeExpr, prefix, startsExpr }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _while: createKeyword(\"while\", { isLoop }),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", { beforeExpr, startsExpr }),\n _this: createKeyword(\"this\", { startsExpr }),\n _super: createKeyword(\"super\", { startsExpr }),\n _class: createKeyword(\"class\", { startsExpr }),\n _extends: createKeyword(\"extends\", { beforeExpr }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", { startsExpr }),\n _null: createKeyword(\"null\", { startsExpr }),\n _true: createKeyword(\"true\", { startsExpr }),\n _false: createKeyword(\"false\", { startsExpr }),\n _in: createKeyword(\"in\", { beforeExpr, binop: 7 }),\n _instanceof: createKeyword(\"instanceof\", { beforeExpr, binop: 7 }),\n _typeof: createKeyword(\"typeof\", { beforeExpr, prefix, startsExpr }),\n _void: createKeyword(\"void\", { beforeExpr, prefix, startsExpr }),\n _delete: createKeyword(\"delete\", { beforeExpr, prefix, startsExpr }),\n};\n","// @flow\n\nimport * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n?|[\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n","// @flow\n\nimport { lineBreakG } from \"./whitespace\";\n\nexport type Pos = {\n start: number,\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n\n constructor(line: number, col: number) {\n this.line = line;\n this.column = col;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string;\n identifierName: ?string;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // $FlowIgnore (may start as null, but initialized later)\n this.end = end;\n }\n}\n\n// The `getLineInfo` function is mostly useful when the\n// `locations` option is off (for performance reasons) and you\n// want to find the line/column position for a given character\n// offset. `input` should be the code string that the offset refers\n// into.\n\nexport function getLineInfo(input: string, offset: number): Position {\n let line = 1;\n let lineStart = 0;\n let match;\n lineBreakG.lastIndex = 0;\n while ((match = lineBreakG.exec(input)) && match.index < offset) {\n line++;\n lineStart = lineBreakG.lastIndex;\n }\n\n return new Position(line, offset - lineStart);\n}\n","// @flow\n\nimport type { Options } from \"../options\";\nimport type State from \"../tokenizer/state\";\nimport type { PluginsMap } from \"./index\";\nimport type ScopeHandler from \"../util/scope\";\nimport type ExpressionScopeHandler from \"../util/expression-scope\";\nimport type ClassScopeHandler from \"../util/class-scope\";\nimport type ProductionParameterHandler from \"../util/production-parameter\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare inModule: boolean;\n declare scope: ScopeHandler<*>;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: ?string;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n\n hasPlugin(name: string): boolean {\n return this.plugins.has(name);\n }\n\n getPluginOption(plugin: string, name: string) {\n // $FlowIssue\n if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name];\n }\n}\n","// @flow\n\n/**\n * Based on the comment attachment algorithm used in espree and estraverse.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport BaseParser from \"./base\";\nimport type { Comment, Node } from \"../types\";\n\nfunction last(stack: $ReadOnlyArray): T {\n return stack[stack.length - 1];\n}\n\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n this.state.trailingComments.push(comment);\n this.state.leadingComments.push(comment);\n }\n\n adjustCommentsAfterTrailingComma(\n node: Node,\n elements: (Node | null)[],\n // When the current node is followed by a token which hasn't a respective AST node, we\n // need to take all the trailing comments to prevent them from being attached to an\n // unrelated node. e.g. in\n // var { x } /* cmt */ = { y }\n // we don't want /* cmt */ to be attached to { y }.\n // On the other hand, in\n // fn(x) [new line] /* cmt */ [new line] y\n // /* cmt */ is both a trailing comment of fn(x) and a leading comment of y\n takeAllComments?: boolean,\n ) {\n if (this.state.leadingComments.length === 0) {\n return;\n }\n\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null) {\n return;\n }\n\n for (let j = 0; j < this.state.leadingComments.length; j++) {\n if (\n this.state.leadingComments[j].end < this.state.commentPreviousNode.end\n ) {\n this.state.leadingComments.splice(j, 1);\n j--;\n }\n }\n\n const newTrailingComments = [];\n for (let i = 0; i < this.state.leadingComments.length; i++) {\n const leadingComment = this.state.leadingComments[i];\n if (leadingComment.end < node.end) {\n newTrailingComments.push(leadingComment);\n\n // Perf: we don't need to splice if we are going to reset the array anyway\n if (!takeAllComments) {\n this.state.leadingComments.splice(i, 1);\n i--;\n }\n } else {\n if (node.trailingComments === undefined) {\n node.trailingComments = [];\n }\n node.trailingComments.push(leadingComment);\n }\n }\n if (takeAllComments) this.state.leadingComments = [];\n\n if (newTrailingComments.length > 0) {\n lastElement.trailingComments = newTrailingComments;\n } else if (lastElement.trailingComments !== undefined) {\n lastElement.trailingComments = [];\n }\n }\n\n processComment(node: Node): void {\n if (node.type === \"Program\" && node.body.length > 0) return;\n\n const stack = this.state.commentStack;\n\n let firstChild, lastChild, trailingComments, i, j;\n\n if (this.state.trailingComments.length > 0) {\n // If the first comment in trailingComments comes after the\n // current node, then we're good - all comments in the array will\n // come after the node and so it's safe to add them as official\n // trailingComments.\n if (this.state.trailingComments[0].start >= node.end) {\n trailingComments = this.state.trailingComments;\n this.state.trailingComments = [];\n } else {\n // Otherwise, if the first comment doesn't come after the\n // current node, that means we have a mix of leading and trailing\n // comments in the array and that leadingComments contains the\n // same items as trailingComments. Reset trailingComments to\n // zero items and we'll handle this by evaluating leadingComments\n // later.\n this.state.trailingComments.length = 0;\n }\n } else if (stack.length > 0) {\n const lastInStack = last(stack);\n if (\n lastInStack.trailingComments &&\n lastInStack.trailingComments[0].start >= node.end\n ) {\n trailingComments = lastInStack.trailingComments;\n delete lastInStack.trailingComments;\n }\n }\n\n // Eating the stack.\n if (stack.length > 0 && last(stack).start >= node.start) {\n firstChild = stack.pop();\n }\n\n while (stack.length > 0 && last(stack).start >= node.start) {\n lastChild = stack.pop();\n }\n\n if (!lastChild && firstChild) lastChild = firstChild;\n\n // Adjust comments that follow a trailing comma on the last element in a\n // comma separated list of nodes to be the trailing comments on the last\n // element\n if (firstChild) {\n switch (node.type) {\n case \"ObjectExpression\":\n this.adjustCommentsAfterTrailingComma(node, node.properties);\n break;\n case \"ObjectPattern\":\n this.adjustCommentsAfterTrailingComma(node, node.properties, true);\n break;\n case \"CallExpression\":\n this.adjustCommentsAfterTrailingComma(node, node.arguments);\n break;\n case \"ArrayExpression\":\n this.adjustCommentsAfterTrailingComma(node, node.elements);\n break;\n case \"ArrayPattern\":\n this.adjustCommentsAfterTrailingComma(node, node.elements, true);\n break;\n }\n } else if (\n this.state.commentPreviousNode &&\n ((this.state.commentPreviousNode.type === \"ImportSpecifier\" &&\n node.type !== \"ImportSpecifier\") ||\n (this.state.commentPreviousNode.type === \"ExportSpecifier\" &&\n node.type !== \"ExportSpecifier\"))\n ) {\n this.adjustCommentsAfterTrailingComma(node, [\n this.state.commentPreviousNode,\n ]);\n }\n\n if (lastChild) {\n if (lastChild.leadingComments) {\n if (\n lastChild !== node &&\n lastChild.leadingComments.length > 0 &&\n last(lastChild.leadingComments).end <= node.start\n ) {\n node.leadingComments = lastChild.leadingComments;\n delete lastChild.leadingComments;\n } else {\n // A leading comment for an anonymous class had been stolen by its first ClassMethod,\n // so this takes back the leading comment.\n // See also: https://github.com/eslint/espree/issues/158\n for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {\n if (lastChild.leadingComments[i].end <= node.start) {\n node.leadingComments = lastChild.leadingComments.splice(0, i + 1);\n break;\n }\n }\n }\n }\n } else if (this.state.leadingComments.length > 0) {\n if (last(this.state.leadingComments).end <= node.start) {\n if (this.state.commentPreviousNode) {\n for (j = 0; j < this.state.leadingComments.length; j++) {\n if (\n this.state.leadingComments[j].end <\n this.state.commentPreviousNode.end\n ) {\n this.state.leadingComments.splice(j, 1);\n j--;\n }\n }\n }\n if (this.state.leadingComments.length > 0) {\n node.leadingComments = this.state.leadingComments;\n this.state.leadingComments = [];\n }\n } else {\n // https://github.com/eslint/espree/issues/2\n //\n // In special cases, such as return (without a value) and\n // debugger, all comments will end up as leadingComments and\n // will otherwise be eliminated. This step runs when the\n // commentStack is empty and there are comments left\n // in leadingComments.\n //\n // This loop figures out the stopping point between the actual\n // leading and trailing comments by finding the location of the\n // first comment that comes after the given node.\n for (i = 0; i < this.state.leadingComments.length; i++) {\n if (this.state.leadingComments[i].end > node.start) {\n break;\n }\n }\n\n // Split the array based on the location of the first comment\n // that comes after the node. Keep in mind that this could\n // result in an empty array, and if so, the array must be\n // deleted.\n const leadingComments = this.state.leadingComments.slice(0, i);\n\n if (leadingComments.length) {\n node.leadingComments = leadingComments;\n }\n\n // Similarly, trailing comments are attached later. The variable\n // must be reset to null if there are no trailing comments.\n trailingComments = this.state.leadingComments.slice(i);\n if (trailingComments.length === 0) {\n trailingComments = null;\n }\n }\n }\n\n this.state.commentPreviousNode = node;\n\n if (trailingComments) {\n if (\n trailingComments.length &&\n trailingComments[0].start >= node.start &&\n last(trailingComments).end <= node.end\n ) {\n node.innerComments = trailingComments;\n } else {\n // TrailingComments maybe contain innerComments\n const firstTrailingCommentIndex = trailingComments.findIndex(\n comment => comment.end >= node.end,\n );\n\n if (firstTrailingCommentIndex > 0) {\n node.innerComments = trailingComments.slice(\n 0,\n firstTrailingCommentIndex,\n );\n node.trailingComments = trailingComments.slice(\n firstTrailingCommentIndex,\n );\n } else {\n node.trailingComments = trailingComments;\n }\n }\n }\n\n stack.push(node);\n }\n}\n","// @flow\n/* eslint sort-keys: \"error\" */\n\n/**\n * @module parser/error-message\n */\n\n// The Errors key follows https://cs.chromium.org/chromium/src/v8/src/common/message-template.h unless it does not exist\nexport const ErrorMessages = Object.freeze({\n AccessorIsGenerator: \"A %0ter cannot be a generator\",\n ArgumentsInClass:\n \"'arguments' is only allowed in functions and class methods\",\n AsyncFunctionInSingleStatementContext:\n \"Async functions can only be declared at the top level or inside a block\",\n AwaitBindingIdentifier:\n \"Can not use 'await' as identifier inside an async function\",\n AwaitExpressionFormalParameter:\n \"await is not allowed in async function parameters\",\n AwaitNotInAsyncContext:\n \"'await' is only allowed within async functions and at the top levels of modules\",\n AwaitNotInAsyncFunction: \"'await' is only allowed within async functions\",\n BadGetterArity: \"getter must not have any formal parameters\",\n BadSetterArity: \"setter must have exactly one formal parameter\",\n BadSetterRestParameter:\n \"setter function argument must not be a rest parameter\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'\",\n ConstructorClassPrivateField:\n \"Classes may not have a private field named '#constructor'\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor\",\n ConstructorIsAsync: \"Constructor can't be an async function\",\n ConstructorIsGenerator: \"Constructor can't be a generator\",\n DeclarationMissingInitializer: \"%0 require an initialization value\",\n DecoratorBeforeExport:\n \"Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax\",\n DecoratorConstructor:\n \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass:\n \"Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block\",\n DeletePrivateField: \"Deleting a private field is not allowed\",\n DestructureNamedImport:\n \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport:\n \"`%0` has already been exported. Exported identifiers must be unique.\",\n DuplicateProto: \"Redefinition of __proto__ property\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag\",\n DuplicateStaticBlock: \"Duplicate static block in the same class\",\n ElementAfterRest: \"Rest element must be last element\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape\",\n ExportBindingIsString:\n \"A string literal cannot be used as an exported binding without `from`.\\n- Did you mean `export { '%0' as '%1' } from 'some-module'`?\",\n ExportDefaultFromAsIdentifier:\n \"'from' is not allowed as an identifier after 'export default'\",\n ForInOfLoopInitializer:\n \"%0 loop variable declaration may not have an initializer\",\n GeneratorInSingleStatementContext:\n \"Generators can only be declared at the top level or inside a block\",\n IllegalBreakContinue: \"Unsyntactic %0\",\n IllegalLanguageModeDirective:\n \"Illegal 'use strict' directive in function with non-simple parameter list\",\n IllegalReturn: \"'return' outside of function\",\n ImportBindingIsString:\n 'A string literal cannot be used as an imported binding.\\n- Did you mean `import { \"%0\" as foo }`?',\n ImportCallArgumentTrailingComma:\n \"Trailing comma is disallowed inside import(...) arguments\",\n ImportCallArity: \"import() requires exactly %0\",\n ImportCallNotNewExpression: \"Cannot use new with import(...)\",\n ImportCallSpreadArgument: \"... is not allowed in import()\",\n ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: \"module\"'`,\n ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n InvalidBigIntLiteral: \"Invalid BigIntLiteral\",\n InvalidCodePoint: \"Code point out of bounds\",\n InvalidDecimal: \"Invalid decimal\",\n InvalidDigit: \"Expected number in radix %0\",\n InvalidEscapeSequence: \"Bad character escape sequence\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template\",\n InvalidEscapedReservedWord: \"Escape sequence in keyword %0\",\n InvalidIdentifier: \"Invalid identifier %0\",\n InvalidLhs: \"Invalid left-hand side in %0\",\n InvalidLhsBinding: \"Binding invalid left-hand side in %0\",\n InvalidNumber: \"Invalid number\",\n InvalidOrMissingExponent:\n \"Floating-point numbers require a valid exponent after the 'e'\",\n InvalidOrUnexpectedToken: \"Unexpected character '%0'\",\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern\",\n InvalidPrivateFieldResolution: \"Private name #%0 is not defined\",\n InvalidPropertyBindingPattern: \"Binding member expression\",\n InvalidRecordProperty:\n \"Only properties and spread elements are allowed in record definitions\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument\",\n LabelRedeclaration: \"Label '%0' is already declared\",\n LetInLexicalBinding:\n \"'let' is not allowed to be used as a name in 'let' or 'const' declarations.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'\",\n MalformedRegExpFlags: \"Invalid regular expression flag\",\n MissingClassName: \"A class name is required\",\n MissingEqInAssignment:\n \"Only '=' operator can be used for specifying default value.\",\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX\",\n MixingCoalesceWithLogical:\n \"Nullish coalescing operator(??) requires parens when mixing with logical operators\",\n ModuleAttributeDifferentFromType:\n \"The only accepted module attribute is `type`\",\n ModuleAttributeInvalidValue:\n \"Only string literals are allowed as module attribute values\",\n ModuleAttributesWithDuplicateKeys:\n 'Duplicate key \"%0\" is not allowed in module attributes',\n ModuleExportNameHasLoneSurrogate:\n \"An export name cannot include a lone surrogate, found '\\\\u%0'\",\n ModuleExportUndefined: \"Export '%0' is not defined\",\n MultipleDefaultsInSwitch: \"Multiple default clauses\",\n NewlineAfterThrow: \"Illegal newline after throw\",\n NoCatchOrFinally: \"Missing catch or finally clause\",\n NumberIdentifier: \"Identifier directly after number\",\n NumericSeparatorInEscapeSequence:\n \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences\",\n ObsoleteAwaitStar:\n \"await* has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew:\n \"constructors in/after an Optional Chain are not allowed\",\n OptionalChainingNoTemplate:\n \"Tagged Template Literals are not allowed in optionalChain\",\n ParamDupe: \"Argument name clash\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter\",\n PatternHasMethod: \"Object pattern can't contain methods\",\n PipelineBodyNoArrow:\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized',\n PipelineBodySequenceExpression:\n \"Pipeline body may not be a comma-separated sequence expression\",\n PipelineHeadSequenceExpression:\n \"Pipeline head should not be a comma-separated sequence expression\",\n PipelineTopicUnused:\n \"Pipeline is in topic style but does not use topic reference\",\n PrimaryTopicNotAllowed:\n \"Topic reference was used in a lexical context without topic binding\",\n PrimaryTopicRequiresSmartPipeline:\n \"Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.\",\n PrivateInExpectedIn:\n \"Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`)\",\n PrivateNameRedeclaration: \"Duplicate private name #%0\",\n RecordExpressionBarIncorrectEndSyntaxType:\n \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'\",\n RecordExpressionBarIncorrectStartSyntaxType:\n \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'\",\n RecordExpressionHashIncorrectStartSyntaxType:\n \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions\",\n RestTrailingComma: \"Unexpected trailing comma after rest element\",\n SloppyFunction:\n \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement\",\n StaticPrototype: \"Classes may not have static property named prototype\",\n StrictDelete: \"Deleting local variable in strict mode\",\n StrictEvalArguments: \"Assigning to '%0' in strict mode\",\n StrictEvalArgumentsBinding: \"Binding '%0' in strict mode\",\n StrictFunction:\n \"In strict mode code, functions can only be declared at top level or inside a block\",\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'\",\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode\",\n StrictWith: \"'with' in strict mode\",\n SuperNotAllowed:\n \"super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super\",\n TrailingDecorator: \"Decorators must be attached to a class element\",\n TupleExpressionBarIncorrectEndSyntaxType:\n \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'\",\n TupleExpressionBarIncorrectStartSyntaxType:\n \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'\",\n TupleExpressionHashIncorrectStartSyntaxType:\n \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder\",\n UnexpectedAwaitAfterPipelineBody:\n 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token\",\n UnexpectedImportExport:\n \"'import' and 'export' may only appear at the top level\",\n UnexpectedKeyword: \"Unexpected keyword '%0'\",\n UnexpectedLeadingDecorator:\n \"Leading decorators must be attached to a class declaration\",\n UnexpectedLexicalDeclaration:\n \"Lexical declaration cannot appear in a single-statement context\",\n UnexpectedNewTarget: \"new.target can only be used in functions\",\n UnexpectedNumericSeparator:\n \"A numeric separator is only allowed between two digits\",\n UnexpectedPrivateField:\n \"Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\\n or a property of member expression (i.e. this.#p).\",\n UnexpectedReservedWord: \"Unexpected reserved word '%0'\",\n UnexpectedSuper: \"super is only allowed in object methods and classes\",\n UnexpectedToken: \"Unexpected token '%0'\",\n UnexpectedTokenUnaryExponentiation:\n \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport:\n \"A decorated export must export a class declaration\",\n UnsupportedDefaultExport:\n \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport: \"import can only be used in import() or import.meta\",\n UnsupportedMetaProperty: \"The only valid meta property for %0 is %0.%1\",\n UnsupportedParameterDecorator:\n \"Decorators cannot be used to decorate parameters\",\n UnsupportedPropertyDecorator:\n \"Decorators cannot be used to decorate object literal properties\",\n UnsupportedSuper:\n \"super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop])\",\n UnterminatedComment: \"Unterminated comment\",\n UnterminatedRegExp: \"Unterminated regular expression\",\n UnterminatedString: \"Unterminated string constant\",\n UnterminatedTemplate: \"Unterminated template\",\n VarRedeclaration: \"Identifier '%0' has already been declared\",\n YieldBindingIdentifier:\n \"Can not use 'yield' as identifier inside a generator\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters\",\n ZeroDigitNumericSeparator:\n \"Numeric separator can not be used after leading 0\",\n});\n","// @flow\n/* eslint sort-keys: \"error\" */\nimport { getLineInfo, type Position } from \"../util/location\";\nimport CommentsParser from \"./comments\";\n\n// This function is used to raise exceptions on parse errors. It\n// takes an offset integer (into the current `input`) to indicate\n// the location of the error, attaches the position to the end\n// of the error message, and then raises a `SyntaxError` with that\n// message.\n\ntype ErrorContext = {\n pos: number,\n loc: Position,\n missingPlugin?: Array,\n code?: string,\n};\n\nexport { ErrorMessages as Errors } from \"./error-message.js\";\n\nexport default class ParserError extends CommentsParser {\n // Forward-declaration: defined in tokenizer/index.js\n /*::\n +isLookahead: boolean;\n */\n\n getLocationForPosition(pos: number): Position {\n let loc;\n if (pos === this.state.start) loc = this.state.startLoc;\n else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;\n else if (pos === this.state.end) loc = this.state.endLoc;\n else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;\n else loc = getLineInfo(this.input, pos);\n\n return loc;\n }\n\n raise(pos: number, errorTemplate: string, ...params: any): Error | empty {\n return this.raiseWithData(pos, undefined, errorTemplate, ...params);\n }\n\n raiseWithData(\n pos: number,\n data?: {\n missingPlugin?: Array,\n code?: string,\n },\n errorTemplate: string,\n ...params: any\n ): Error | empty {\n const loc = this.getLocationForPosition(pos);\n const message =\n errorTemplate.replace(/%(\\d+)/g, (_, i: number) => params[i]) +\n ` (${loc.line}:${loc.column})`;\n return this._raise(Object.assign(({ loc, pos }: Object), data), message);\n }\n\n _raise(errorContext: ErrorContext, message: string): Error | empty {\n // $FlowIgnore\n const err: SyntaxError & ErrorContext = new SyntaxError(message);\n Object.assign(err, errorContext);\n if (this.options.errorRecovery) {\n if (!this.isLookahead) this.state.errors.push(err);\n return err;\n } else {\n throw err;\n }\n }\n}\n","// @flow\n\nimport { types as tt, TokenType } from \"../tokenizer/types\";\nimport type Parser from \"../parser\";\nimport type { ExpressionErrors } from \"../parser/util\";\nimport * as N from \"../types\";\nimport type { Position } from \"../util/location\";\nimport { Errors } from \"../parser/error\";\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n estreeParseRegExpLiteral({ pattern, flags }: N.RegExpLiteral): N.Node {\n let regex = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (e) {\n // In environments that don't support these flags value will\n // be null as the regex can't be represented natively.\n }\n const node = this.estreeParseLiteral(regex);\n node.regex = { pattern, flags };\n\n return node;\n }\n\n estreeParseBigIntLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral\n let bigInt;\n try {\n // $FlowIgnore\n bigInt = BigInt(value);\n } catch {\n bigInt = null;\n }\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n\n return node;\n }\n\n estreeParseDecimalLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/experimental/decimal.md\n // todo: use BigDecimal when node supports it.\n const decimal = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n\n return node;\n }\n\n estreeParseLiteral(value: any): N.Node {\n return this.parseLiteral(value, \"Literal\");\n }\n\n directiveToStmt(directive: N.Directive): N.ExpressionStatement {\n const directiveLiteral = directive.value;\n\n const stmt = this.startNodeAt(directive.start, directive.loc.start);\n const expression = this.startNodeAt(\n directiveLiteral.start,\n directiveLiteral.loc.start,\n );\n\n expression.value = directiveLiteral.extra.expressionValue;\n expression.raw = directiveLiteral.extra.raw;\n\n stmt.expression = this.finishNodeAt(\n expression,\n \"Literal\",\n directiveLiteral.end,\n directiveLiteral.loc.end,\n );\n stmt.directive = directiveLiteral.extra.raw.slice(1, -1);\n\n return this.finishNodeAt(\n stmt,\n \"ExpressionStatement\",\n directive.end,\n directive.loc.end,\n );\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n initFunction(\n node: N.BodilessFunctionOrMethodBase,\n isAsync: ?boolean,\n ): void {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node != null && this.isObjectProperty(node)) {\n this.checkDeclaration(((node: any): N.EstreeProperty).value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return ((method: any): N.EstreeProperty | N.EstreeMethodDefinition).value\n .params;\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" &&\n typeof stmt.expression.value === \"string\" &&\n !stmt.expression.extra?.parenthesized\n );\n }\n\n stmtToDirective(stmt: N.Statement): N.Directive {\n const directive = super.stmtToDirective(stmt);\n const value = stmt.expression.value;\n\n // Record the expression value as in estree mode we want\n // the stmt to have the real value e.g. (\"use strict\") and\n // not the raw value e.g. (\"use\\\\x20strict\")\n this.addExtra(directive.value, \"expressionValue\", value);\n\n return directive;\n }\n\n parseBlockBody(\n node: N.BlockStatementLike,\n ...args: [?boolean, boolean, TokenType, void | (boolean => void)]\n ): void {\n super.parseBlockBody(node, ...args);\n\n const directiveStatements = node.directives.map(d =>\n this.directiveToStmt(d),\n );\n node.body = directiveStatements.concat(node.body);\n // $FlowIgnore - directives isn't optional in the type definition\n delete node.directives;\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n this.parseMethod(\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n \"ClassMethod\",\n true,\n );\n if (method.typeParameters) {\n // $FlowIgnore\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n classBody.body.push(method);\n }\n\n parseExprAtom(refExpressionErrors?: ?ExpressionErrors): N.Expression {\n switch (this.state.type) {\n case tt.num:\n case tt.string:\n return this.estreeParseLiteral(this.state.value);\n\n case tt.regexp:\n return this.estreeParseRegExpLiteral(this.state.value);\n\n case tt.bigint:\n return this.estreeParseBigIntLiteral(this.state.value);\n\n case tt.decimal:\n return this.estreeParseDecimalLiteral(this.state.value);\n\n case tt._null:\n return this.estreeParseLiteral(null);\n\n case tt._true:\n return this.estreeParseLiteral(true);\n\n case tt._false:\n return this.estreeParseLiteral(false);\n\n default:\n return super.parseExprAtom(refExpressionErrors);\n }\n }\n\n parseLiteral(\n value: any,\n type: /*T[\"kind\"]*/ string,\n startPos?: number,\n startLoc?: Position,\n ): T {\n const node = super.parseLiteral(value, type, startPos, startLoc);\n node.raw = node.extra.raw;\n delete node.extra;\n\n return node;\n }\n\n parseFunctionBody(\n node: N.Function,\n allowExpression: ?boolean,\n isMethod?: boolean = false,\n ): void {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n parseMethod(\n node: T,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: string,\n inClassScope: boolean = false,\n ): T {\n let funcNode = this.startNode();\n funcNode.kind = node.kind; // provide kind, so super method correctly sets state\n funcNode = super.parseMethod(\n funcNode,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n // $FlowIgnore\n node.value = funcNode;\n\n type = type === \"ClassMethod\" ? \"MethodDefinition\" : type;\n return this.finishNode(node, type);\n }\n\n parseObjectMethod(\n prop: N.ObjectMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n ): ?N.ObjectMethod {\n const node: N.EstreeProperty = (super.parseObjectMethod(\n prop,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n ): any);\n\n if (node) {\n node.type = \"Property\";\n if (((node: any): N.ClassMethod).kind === \"method\") node.kind = \"init\";\n node.shorthand = false;\n }\n\n return (node: any);\n }\n\n parseObjectProperty(\n prop: N.ObjectProperty,\n startPos: ?number,\n startLoc: ?Position,\n isPattern: boolean,\n refExpressionErrors: ?ExpressionErrors,\n ): ?N.ObjectProperty {\n const node: N.EstreeProperty = (super.parseObjectProperty(\n prop,\n startPos,\n startLoc,\n isPattern,\n refExpressionErrors,\n ): any);\n\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n\n return (node: any);\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): N.Node {\n if (node != null && this.isObjectProperty(node)) {\n this.toAssignable(node.value, isLHS);\n\n return node;\n }\n\n return super.toAssignable(node, isLHS);\n }\n\n toAssignableObjectExpressionProp(prop: N.Node, ...args) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n this.raise(prop.key.start, Errors.PatternHasAccessor);\n } else if (prop.method) {\n this.raise(prop.key.start, Errors.PatternHasMethod);\n } else {\n super.toAssignableObjectExpressionProp(prop, ...args);\n }\n }\n\n finishCallExpression(\n node: T,\n optional: boolean,\n ): N.Expression {\n super.finishCallExpression(node, optional);\n\n if (node.callee.type === \"Import\") {\n ((node: N.Node): N.EstreeImportExpression).type = \"ImportExpression\";\n ((node: N.Node): N.EstreeImportExpression).source = node.arguments[0];\n // $FlowIgnore - arguments isn't optional in the type definition\n delete node.arguments;\n // $FlowIgnore - callee isn't optional in the type definition\n delete node.callee;\n }\n\n return node;\n }\n\n toReferencedArguments(\n node:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.EstreeImportExpression,\n /* isParenthesizedExpr?: boolean, */\n ) {\n // ImportExpressions do not have an arguments array.\n if (node.type === \"ImportExpression\") {\n return;\n }\n\n super.toReferencedArguments(node);\n }\n\n parseExport(node: N.Node) {\n super.parseExport(node);\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n node.exported = null;\n break;\n\n case \"ExportNamedDeclaration\":\n if (\n node.specifiers.length === 1 &&\n node.specifiers[0].type === \"ExportNamespaceSpecifier\"\n ) {\n node.type = \"ExportAllDeclaration\";\n node.exported = node.specifiers[0].exported;\n delete node.specifiers;\n }\n\n break;\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls: ?boolean,\n state: N.ParseSubscriptState,\n ) {\n const node = super.parseSubscript(\n base,\n startPos,\n startLoc,\n noCalls,\n state,\n );\n\n if (state.optionalChainMember) {\n // https://github.com/estree/estree/blob/master/es2020.md#chainexpression\n if (\n node.type === \"OptionalMemberExpression\" ||\n node.type === \"OptionalCallExpression\"\n ) {\n node.type = node.type.substring(8); // strip Optional prefix\n }\n if (state.stop) {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNode(chain, \"ChainExpression\");\n }\n } else if (\n node.type === \"MemberExpression\" ||\n node.type === \"CallExpression\"\n ) {\n node.optional = false;\n }\n\n return node;\n }\n\n hasPropertyAsPrivateName(node: N.Node): boolean {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n\n isOptionalChain(node: N.Node): boolean {\n return node.type === \"ChainExpression\";\n }\n\n isObjectProperty(node: N.Node): boolean {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n\n isObjectMethod(node: N.Node): boolean {\n return node.method || node.kind === \"get\" || node.kind === \"set\";\n }\n };\n","// @flow\n\n// The algorithm used to determine whether a regexp can appear at a\n// given point in the program is loosely based on sweet.js' approach.\n// See https://github.com/mozilla/sweet.js/wiki/design\n\nimport { types as tt } from \"./types\";\n\nexport class TokContext {\n constructor(\n token: string,\n isExpr?: boolean,\n preserveSpace?: boolean,\n override?: ?Function, // Takes a Tokenizer as a this-parameter, and returns void.\n ) {\n this.token = token;\n this.isExpr = !!isExpr;\n this.preserveSpace = !!preserveSpace;\n this.override = override;\n }\n\n token: string;\n isExpr: boolean;\n preserveSpace: boolean;\n override: ?Function;\n}\n\nexport const types: {\n [key: string]: TokContext,\n} = {\n braceStatement: new TokContext(\"{\", false),\n braceExpression: new TokContext(\"{\", true),\n recordExpression: new TokContext(\"#{\", true),\n templateQuasi: new TokContext(\"${\", false),\n parenStatement: new TokContext(\"(\", false),\n parenExpression: new TokContext(\"(\", true),\n template: new TokContext(\"`\", true, true, p => p.readTmplToken()),\n functionExpression: new TokContext(\"function\", true),\n functionStatement: new TokContext(\"function\", false),\n};\n\n// Token-specific context update code\n// Note that we should avoid accessing `this.prodParam` in context update,\n// because it is executed immediately when last token is consumed, which may be\n// before `this.prodParam` is updated. e.g.\n// ```\n// function *g() { () => yield / 2 }\n// ```\n// When `=>` is eaten, the context update of `yield` is executed, however,\n// `this.prodParam` still has `[Yield]` production because it is not yet updated\n\ntt.parenR.updateContext = tt.braceR.updateContext = function () {\n if (this.state.context.length === 1) {\n this.state.exprAllowed = true;\n return;\n }\n\n let out = this.state.context.pop();\n if (out === types.braceStatement && this.curContext().token === \"function\") {\n out = this.state.context.pop();\n }\n\n this.state.exprAllowed = !out.isExpr;\n};\n\ntt.name.updateContext = function (prevType) {\n let allowed = false;\n if (prevType !== tt.dot) {\n if (\n this.state.value === \"of\" &&\n !this.state.exprAllowed &&\n prevType !== tt._function &&\n prevType !== tt._class\n ) {\n allowed = true;\n }\n }\n this.state.exprAllowed = allowed;\n\n if (this.state.isIterator) {\n this.state.isIterator = false;\n }\n};\n\ntt.braceL.updateContext = function (prevType) {\n this.state.context.push(\n this.braceIsBlock(prevType) ? types.braceStatement : types.braceExpression,\n );\n this.state.exprAllowed = true;\n};\n\ntt.dollarBraceL.updateContext = function () {\n this.state.context.push(types.templateQuasi);\n this.state.exprAllowed = true;\n};\n\ntt.parenL.updateContext = function (prevType) {\n const statementParens =\n prevType === tt._if ||\n prevType === tt._for ||\n prevType === tt._with ||\n prevType === tt._while;\n this.state.context.push(\n statementParens ? types.parenStatement : types.parenExpression,\n );\n this.state.exprAllowed = true;\n};\n\ntt.incDec.updateContext = function () {\n // tokExprAllowed stays unchanged\n};\n\ntt._function.updateContext = tt._class.updateContext = function (prevType) {\n if (\n prevType.beforeExpr &&\n prevType !== tt.semi &&\n prevType !== tt._else &&\n !(prevType === tt._return && this.hasPrecedingLineBreak()) &&\n !(\n (prevType === tt.colon || prevType === tt.braceL) &&\n this.curContext() === types.b_stat\n )\n ) {\n this.state.context.push(types.functionExpression);\n } else {\n this.state.context.push(types.functionStatement);\n }\n\n this.state.exprAllowed = false;\n};\n\ntt.backQuote.updateContext = function () {\n if (this.curContext() === types.template) {\n this.state.context.pop();\n } else {\n this.state.context.push(types.template);\n }\n this.state.exprAllowed = false;\n};\n\n// we don't need to update context for tt.braceBarL because we do not pop context for tt.braceBarR\ntt.braceHashL.updateContext = function () {\n this.state.context.push(types.recordExpression);\n this.state.exprAllowed = true; /* tt.braceHashL.beforeExpr */\n};\n","import * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u08a0-\\u08b4\\u08b6-\\u08c7\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\u9ffc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7bf\\ua7c2-\\ua7ca\\ua7f5-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u08d3-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf\\u1ac0\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1df9\\u1dfb-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (const char of Array.from(name)) {\n const cp = char.codePointAt(0);\n if (isFirst) {\n if (!isIdentifierStart(cp)) {\n return false;\n }\n isFirst = false;\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n","const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n","/* eslint max-len: 0 */\n\n// @flow\n\nimport * as charCodes from \"charcodes\";\n\nexport {\n isIdentifierStart,\n isIdentifierChar,\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(current: number, next: number): boolean {\n return current === charCodes.atSign && next === charCodes.atSign;\n}\n","// @flow\n\n// Each scope gets a bitset that may contain these flags\n// prettier-ignore\nexport const SCOPE_OTHER = 0b00000000,\n SCOPE_PROGRAM = 0b00000001,\n SCOPE_FUNCTION = 0b00000010,\n SCOPE_ARROW = 0b00000100,\n SCOPE_SIMPLE_CATCH = 0b00001000,\n SCOPE_SUPER = 0b00010000,\n SCOPE_DIRECT_SUPER = 0b00100000,\n SCOPE_CLASS = 0b01000000,\n SCOPE_TS_MODULE = 0b10000000,\n SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;\n\nexport type ScopeFlags =\n | typeof SCOPE_OTHER\n | typeof SCOPE_PROGRAM\n | typeof SCOPE_FUNCTION\n | typeof SCOPE_VAR\n | typeof SCOPE_ARROW\n | typeof SCOPE_SIMPLE_CATCH\n | typeof SCOPE_SUPER\n | typeof SCOPE_DIRECT_SUPER\n | typeof SCOPE_CLASS;\n\n// These flags are meant to be _only_ used inside the Scope class (or subclasses).\n// prettier-ignore\nexport const BIND_KIND_VALUE = 0b00000_0000_01,\n BIND_KIND_TYPE = 0b00000_0000_10,\n // Used in checkLVal and declareName to determine the type of a binding\n BIND_SCOPE_VAR = 0b00000_0001_00, // Var-style binding\n BIND_SCOPE_LEXICAL = 0b00000_0010_00, // Let- or const-style binding\n BIND_SCOPE_FUNCTION = 0b00000_0100_00, // Function declaration\n BIND_SCOPE_OUTSIDE = 0b00000_1000_00, // Special case for function names as\n // bound inside the function\n // Misc flags\n BIND_FLAGS_NONE = 0b00001_0000_00,\n BIND_FLAGS_CLASS = 0b00010_0000_00,\n BIND_FLAGS_TS_ENUM = 0b00100_0000_00,\n BIND_FLAGS_TS_CONST_ENUM = 0b01000_0000_00,\n BIND_FLAGS_TS_EXPORT_ONLY = 0b10000_0000_00;\n\n// These flags are meant to be _only_ used by Scope consumers\n// prettier-ignore\n/* = is value? | is type? | scope | misc flags */\nexport const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS ,\n BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0 ,\n BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0 ,\n BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0 ,\n BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS ,\n BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0 ,\n BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,\n BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n // These bindings don't introduce anything in the scope. They are used for assignments and\n // function expressions IDs.\n BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE ,\n BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE ,\n\n BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,\n BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY;\n\nexport type BindingTypes =\n | typeof BIND_NONE\n | typeof BIND_OUTSIDE\n | typeof BIND_VAR\n | typeof BIND_LEXICAL\n | typeof BIND_CLASS\n | typeof BIND_FUNCTION\n | typeof BIND_TS_INTERFACE\n | typeof BIND_TS_TYPE\n | typeof BIND_TS_ENUM\n | typeof BIND_TS_AMBIENT\n | typeof BIND_TS_NAMESPACE;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_FLAG_STATIC = 0b1_00,\n CLASS_ELEMENT_KIND_GETTER = 0b0_10,\n CLASS_ELEMENT_KIND_SETTER = 0b0_01,\n CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,\n CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,\n CLASS_ELEMENT_OTHER = 0;\n\nexport type ClassElementTypes =\n | typeof CLASS_ELEMENT_STATIC_GETTER\n | typeof CLASS_ELEMENT_STATIC_SETTER\n | typeof CLASS_ELEMENT_INSTANCE_GETTER\n | typeof CLASS_ELEMENT_INSTANCE_SETTER\n | typeof CLASS_ELEMENT_OTHER;\n","// @flow\n\n/*:: declare var invariant; */\n\n// Error messages are colocated with the plugin.\n/* eslint-disable @babel/development-internal/dry-error-messages */\n\nimport type Parser from \"../parser\";\nimport { types as tt, type TokenType } from \"../tokenizer/types\";\nimport * as N from \"../types\";\nimport type { Options } from \"../options\";\nimport type { Pos, Position } from \"../util/location\";\nimport type State from \"../tokenizer/state\";\nimport { types as tc } from \"../tokenizer/context\";\nimport * as charCodes from \"charcodes\";\nimport { isIteratorStart, isKeyword } from \"../util/identifier\";\nimport {\n type BindingTypes,\n BIND_LEXICAL,\n BIND_VAR,\n BIND_FUNCTION,\n SCOPE_ARROW,\n SCOPE_FUNCTION,\n SCOPE_OTHER,\n} from \"../util/scopeflags\";\nimport type { ExpressionErrors } from \"../parser/util\";\nimport { Errors } from \"../parser/error\";\n\nconst reservedTypes = new Set([\n \"_\",\n \"any\",\n \"bool\",\n \"boolean\",\n \"empty\",\n \"extends\",\n \"false\",\n \"interface\",\n \"mixed\",\n \"null\",\n \"number\",\n \"static\",\n \"string\",\n \"true\",\n \"typeof\",\n \"void\",\n]);\n\n/* eslint sort-keys: \"error\" */\n// The Errors key follows https://github.com/facebook/flow/blob/master/src/parser/parse_error.ml unless it does not exist\nconst FlowErrors = Object.freeze({\n AmbiguousConditionalArrow:\n \"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.\",\n AmbiguousDeclareModuleKind:\n \"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module\",\n AssignReservedType: \"Cannot overwrite reserved type %0\",\n DeclareClassElement:\n \"The `declare` modifier can only appear on class fields.\",\n DeclareClassFieldInitializer:\n \"Initializers are not allowed in fields with the `declare` modifier.\",\n DuplicateDeclareModuleExports: \"Duplicate `declare module.exports` statement\",\n EnumBooleanMemberNotInitialized:\n \"Boolean enum members need to be initialized. Use either `%0 = true,` or `%0 = false,` in enum `%1`.\",\n EnumDuplicateMemberName:\n \"Enum member names need to be unique, but the name `%0` has already been used before in enum `%1`.\",\n EnumInconsistentMemberValues:\n \"Enum `%0` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.\",\n EnumInvalidExplicitType:\n \"Enum type `%1` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.\",\n EnumInvalidExplicitTypeUnknownSupplied:\n \"Supplied enum type is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.\",\n EnumInvalidMemberInitializerPrimaryType:\n \"Enum `%0` has type `%2`, so the initializer of `%1` needs to be a %2 literal.\",\n EnumInvalidMemberInitializerSymbolType:\n \"Symbol enum members cannot be initialized. Use `%1,` in enum `%0`.\",\n EnumInvalidMemberInitializerUnknownType:\n \"The enum member initializer for `%1` needs to be a literal (either a boolean, number, or string) in enum `%0`.\",\n EnumInvalidMemberName:\n \"Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%0`, consider using `%1`, in enum `%2`.\",\n EnumNumberMemberNotInitialized:\n \"Number enum members need to be initialized, e.g. `%1 = 1` in enum `%0`.\",\n EnumStringMemberInconsistentlyInitailized:\n \"String enum members need to consistently either all use initializers, or use no initializers, in enum `%0`.\",\n ImportTypeShorthandOnlyInPureImport:\n \"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements\",\n InexactInsideExact:\n \"Explicit inexact syntax cannot appear inside an explicit exact object type\",\n InexactInsideNonObject:\n \"Explicit inexact syntax cannot appear in class or interface definitions\",\n InexactVariance: \"Explicit inexact syntax cannot have variance\",\n InvalidNonTypeImportInDeclareModule:\n \"Imports within a `declare module` body must always be `import type` or `import typeof`\",\n MissingTypeParamDefault:\n \"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.\",\n NestedDeclareModule:\n \"`declare module` cannot be used inside another `declare module`\",\n NestedFlowComment: \"Cannot have a flow comment inside another flow comment\",\n OptionalBindingPattern:\n \"A binding pattern parameter cannot be optional in an implementation signature.\",\n SpreadVariance: \"Spread properties cannot have variance\",\n TypeBeforeInitializer:\n \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`\",\n TypeCastInPattern:\n \"The type cast expression is expected to be wrapped with parenthesis\",\n UnexpectedExplicitInexactInObject:\n \"Explicit inexact syntax must appear at the end of an inexact object\",\n UnexpectedReservedType: \"Unexpected reserved type %0\",\n UnexpectedReservedUnderscore:\n \"`_` is only allowed as a type argument to call or new\",\n UnexpectedSpaceBetweenModuloChecks:\n \"Spaces between `%` and `checks` are not allowed here.\",\n UnexpectedSpreadType:\n \"Spread operator cannot appear in class or interface definitions\",\n UnexpectedSubtractionOperand:\n 'Unexpected token, expected \"number\" or \"bigint\"',\n UnexpectedTokenAfterTypeParameter:\n \"Expected an arrow function after this type parameter declaration\",\n UnexpectedTypeParameterBeforeAsyncArrowFunction:\n \"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`\",\n UnsupportedDeclareExportKind:\n \"`declare export %0` is not supported. Use `%1` instead\",\n UnsupportedStatementInDeclareModule:\n \"Only declares and type imports are allowed inside declare module\",\n UnterminatedFlowComment: \"Unterminated flow-comment\",\n});\n/* eslint-disable sort-keys */\n\nfunction isEsModuleType(bodyElement: N.Node): boolean {\n return (\n bodyElement.type === \"DeclareExportAllDeclaration\" ||\n (bodyElement.type === \"DeclareExportDeclaration\" &&\n (!bodyElement.declaration ||\n (bodyElement.declaration.type !== \"TypeAlias\" &&\n bodyElement.declaration.type !== \"InterfaceDeclaration\")))\n );\n}\n\nfunction hasTypeImportKind(node: N.Node): boolean {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n}\n\nfunction isMaybeDefaultImport(state: State): boolean {\n return (\n (state.type === tt.name || !!state.type.keyword) && state.value !== \"from\"\n );\n}\n\nconst exportSuggestions = {\n const: \"declare export var\",\n let: \"declare export var\",\n type: \"export type\",\n interface: \"export interface\",\n};\n\n// Like Array#filter, but returns a tuple [ acceptedElements, discardedElements ]\nfunction partition(\n list: T[],\n test: (T, number, T[]) => ?boolean,\n): [T[], T[]] {\n const list1 = [];\n const list2 = [];\n for (let i = 0; i < list.length; i++) {\n (test(list[i], i, list) ? list1 : list2).push(list[i]);\n }\n return [list1, list2];\n}\n\nconst FLOW_PRAGMA_REGEX = /\\*?\\s*@((?:no)?flow)\\b/;\n\n// Flow enums types\ntype EnumExplicitType = null | \"boolean\" | \"number\" | \"string\" | \"symbol\";\ntype EnumContext = {|\n enumName: string,\n explicitType: EnumExplicitType,\n memberName: string,\n|};\ntype EnumMemberInit =\n | {| type: \"number\", pos: number, value: N.Node |}\n | {| type: \"string\", pos: number, value: N.Node |}\n | {| type: \"boolean\", pos: number, value: N.Node |}\n | {| type: \"invalid\", pos: number |}\n | {| type: \"none\", pos: number |};\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n // The value of the @flow/@noflow pragma. Initially undefined, transitions\n // to \"@flow\" or \"@noflow\" if we see a pragma. Transitions to null if we are\n // past the initial comment.\n flowPragma: void | null | \"flow\" | \"noflow\";\n\n constructor(options: ?Options, input: string) {\n super(options, input);\n this.flowPragma = undefined;\n }\n\n shouldParseTypes(): boolean {\n return this.getPluginOption(\"flow\", \"all\") || this.flowPragma === \"flow\";\n }\n\n shouldParseEnums(): boolean {\n return !!this.getPluginOption(\"flow\", \"enums\");\n }\n\n finishToken(type: TokenType, val: any): void {\n if (\n type !== tt.string &&\n type !== tt.semi &&\n type !== tt.interpreterDirective\n ) {\n if (this.flowPragma === undefined) {\n this.flowPragma = null;\n }\n }\n return super.finishToken(type, val);\n }\n\n addComment(comment: N.Comment): void {\n if (this.flowPragma === undefined) {\n // Try to parse a flow pragma.\n const matches = FLOW_PRAGMA_REGEX.exec(comment.value);\n if (!matches) {\n // do nothing\n } else if (matches[1] === \"flow\") {\n this.flowPragma = \"flow\";\n } else if (matches[1] === \"noflow\") {\n this.flowPragma = \"noflow\";\n } else {\n throw new Error(\"Unexpected flow pragma\");\n }\n }\n return super.addComment(comment);\n }\n\n flowParseTypeInitialiser(tok?: TokenType): N.FlowType {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tok || tt.colon);\n\n const type = this.flowParseType();\n this.state.inType = oldInType;\n return type;\n }\n\n flowParsePredicate(): N.FlowType {\n const node = this.startNode();\n const moduloLoc = this.state.startLoc;\n const moduloPos = this.state.start;\n this.expect(tt.modulo);\n const checksLoc = this.state.startLoc;\n this.expectContextual(\"checks\");\n // Force '%' and 'checks' to be adjacent\n if (\n moduloLoc.line !== checksLoc.line ||\n moduloLoc.column !== checksLoc.column - 1\n ) {\n this.raise(moduloPos, FlowErrors.UnexpectedSpaceBetweenModuloChecks);\n }\n if (this.eat(tt.parenL)) {\n node.value = this.parseExpression();\n this.expect(tt.parenR);\n return this.finishNode(node, \"DeclaredPredicate\");\n } else {\n return this.finishNode(node, \"InferredPredicate\");\n }\n }\n\n flowParseTypeAndPredicateInitialiser(): [?N.FlowType, ?N.FlowPredicate] {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tt.colon);\n let type = null;\n let predicate = null;\n if (this.match(tt.modulo)) {\n this.state.inType = oldInType;\n predicate = this.flowParsePredicate();\n } else {\n type = this.flowParseType();\n this.state.inType = oldInType;\n if (this.match(tt.modulo)) {\n predicate = this.flowParsePredicate();\n }\n }\n return [type, predicate];\n }\n\n flowParseDeclareClass(node: N.FlowDeclareClass): N.FlowDeclareClass {\n this.next();\n this.flowParseInterfaceish(node, /*isClass*/ true);\n return this.finishNode(node, \"DeclareClass\");\n }\n\n flowParseDeclareFunction(\n node: N.FlowDeclareFunction,\n ): N.FlowDeclareFunction {\n this.next();\n\n const id = (node.id = this.parseIdentifier());\n\n const typeNode = this.startNode();\n const typeContainer = this.startNode();\n\n if (this.isRelational(\"<\")) {\n typeNode.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n typeNode.typeParameters = null;\n }\n\n this.expect(tt.parenL);\n const tmp = this.flowParseFunctionTypeParams();\n typeNode.params = tmp.params;\n typeNode.rest = tmp.rest;\n this.expect(tt.parenR);\n\n [\n // $FlowFixMe (destructuring not supported yet)\n typeNode.returnType,\n // $FlowFixMe (destructuring not supported yet)\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n typeContainer.typeAnnotation = this.finishNode(\n typeNode,\n \"FunctionTypeAnnotation\",\n );\n\n id.typeAnnotation = this.finishNode(typeContainer, \"TypeAnnotation\");\n\n this.resetEndLocation(id);\n this.semicolon();\n\n return this.finishNode(node, \"DeclareFunction\");\n }\n\n flowParseDeclare(\n node: N.FlowDeclare,\n insideModule?: boolean,\n ): N.FlowDeclare {\n if (this.match(tt._class)) {\n return this.flowParseDeclareClass(node);\n } else if (this.match(tt._function)) {\n return this.flowParseDeclareFunction(node);\n } else if (this.match(tt._var)) {\n return this.flowParseDeclareVariable(node);\n } else if (this.eatContextual(\"module\")) {\n if (this.match(tt.dot)) {\n return this.flowParseDeclareModuleExports(node);\n } else {\n if (insideModule) {\n this.raise(this.state.lastTokStart, FlowErrors.NestedDeclareModule);\n }\n return this.flowParseDeclareModule(node);\n }\n } else if (this.isContextual(\"type\")) {\n return this.flowParseDeclareTypeAlias(node);\n } else if (this.isContextual(\"opaque\")) {\n return this.flowParseDeclareOpaqueType(node);\n } else if (this.isContextual(\"interface\")) {\n return this.flowParseDeclareInterface(node);\n } else if (this.match(tt._export)) {\n return this.flowParseDeclareExportDeclaration(node, insideModule);\n } else {\n throw this.unexpected();\n }\n }\n\n flowParseDeclareVariable(\n node: N.FlowDeclareVariable,\n ): N.FlowDeclareVariable {\n this.next();\n node.id = this.flowParseTypeAnnotatableIdentifier(\n /*allowPrimitiveOverride*/ true,\n );\n this.scope.declareName(node.id.name, BIND_VAR, node.id.start);\n this.semicolon();\n return this.finishNode(node, \"DeclareVariable\");\n }\n\n flowParseDeclareModule(node: N.FlowDeclareModule): N.FlowDeclareModule {\n this.scope.enter(SCOPE_OTHER);\n\n if (this.match(tt.string)) {\n node.id = this.parseExprAtom();\n } else {\n node.id = this.parseIdentifier();\n }\n\n const bodyNode = (node.body = this.startNode());\n const body = (bodyNode.body = []);\n this.expect(tt.braceL);\n while (!this.match(tt.braceR)) {\n let bodyNode = this.startNode();\n\n if (this.match(tt._import)) {\n this.next();\n if (!this.isContextual(\"type\") && !this.match(tt._typeof)) {\n this.raise(\n this.state.lastTokStart,\n FlowErrors.InvalidNonTypeImportInDeclareModule,\n );\n }\n this.parseImport(bodyNode);\n } else {\n this.expectContextual(\n \"declare\",\n FlowErrors.UnsupportedStatementInDeclareModule,\n );\n\n bodyNode = this.flowParseDeclare(bodyNode, true);\n }\n\n body.push(bodyNode);\n }\n\n this.scope.exit();\n\n this.expect(tt.braceR);\n\n this.finishNode(bodyNode, \"BlockStatement\");\n\n let kind = null;\n let hasModuleExport = false;\n body.forEach(bodyElement => {\n if (isEsModuleType(bodyElement)) {\n if (kind === \"CommonJS\") {\n this.raise(\n bodyElement.start,\n FlowErrors.AmbiguousDeclareModuleKind,\n );\n }\n kind = \"ES\";\n } else if (bodyElement.type === \"DeclareModuleExports\") {\n if (hasModuleExport) {\n this.raise(\n bodyElement.start,\n FlowErrors.DuplicateDeclareModuleExports,\n );\n }\n if (kind === \"ES\") {\n this.raise(\n bodyElement.start,\n FlowErrors.AmbiguousDeclareModuleKind,\n );\n }\n kind = \"CommonJS\";\n hasModuleExport = true;\n }\n });\n\n node.kind = kind || \"CommonJS\";\n return this.finishNode(node, \"DeclareModule\");\n }\n\n flowParseDeclareExportDeclaration(\n node: N.FlowDeclareExportDeclaration,\n insideModule: ?boolean,\n ): N.FlowDeclareExportDeclaration {\n this.expect(tt._export);\n\n if (this.eat(tt._default)) {\n if (this.match(tt._function) || this.match(tt._class)) {\n // declare export default class ...\n // declare export default function ...\n node.declaration = this.flowParseDeclare(this.startNode());\n } else {\n // declare export default [type];\n node.declaration = this.flowParseType();\n this.semicolon();\n }\n node.default = true;\n\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else {\n if (\n this.match(tt._const) ||\n this.isLet() ||\n ((this.isContextual(\"type\") || this.isContextual(\"interface\")) &&\n !insideModule)\n ) {\n const label = this.state.value;\n const suggestion = exportSuggestions[label];\n\n throw this.raise(\n this.state.start,\n FlowErrors.UnsupportedDeclareExportKind,\n label,\n suggestion,\n );\n }\n\n if (\n this.match(tt._var) || // declare export var ...\n this.match(tt._function) || // declare export function ...\n this.match(tt._class) || // declare export class ...\n this.isContextual(\"opaque\") // declare export opaque ..\n ) {\n node.declaration = this.flowParseDeclare(this.startNode());\n node.default = false;\n\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else if (\n this.match(tt.star) || // declare export * from ''\n this.match(tt.braceL) || // declare export {} ...\n this.isContextual(\"interface\") || // declare export interface ...\n this.isContextual(\"type\") || // declare export type ...\n this.isContextual(\"opaque\") // declare export opaque type ...\n ) {\n node = this.parseExport(node);\n if (node.type === \"ExportNamedDeclaration\") {\n // flow does not support the ExportNamedDeclaration\n // $FlowIgnore\n node.type = \"ExportDeclaration\";\n // $FlowFixMe\n node.default = false;\n delete node.exportKind;\n }\n\n // $FlowIgnore\n node.type = \"Declare\" + node.type;\n\n return node;\n }\n }\n\n throw this.unexpected();\n }\n\n flowParseDeclareModuleExports(\n node: N.FlowDeclareModuleExports,\n ): N.FlowDeclareModuleExports {\n this.next();\n this.expectContextual(\"exports\");\n node.typeAnnotation = this.flowParseTypeAnnotation();\n this.semicolon();\n\n return this.finishNode(node, \"DeclareModuleExports\");\n }\n\n flowParseDeclareTypeAlias(\n node: N.FlowDeclareTypeAlias,\n ): N.FlowDeclareTypeAlias {\n this.next();\n this.flowParseTypeAlias(node);\n // Don't do finishNode as we don't want to process comments twice\n node.type = \"DeclareTypeAlias\";\n return node;\n }\n\n flowParseDeclareOpaqueType(\n node: N.FlowDeclareOpaqueType,\n ): N.FlowDeclareOpaqueType {\n this.next();\n this.flowParseOpaqueType(node, true);\n // Don't do finishNode as we don't want to process comments twice\n node.type = \"DeclareOpaqueType\";\n return node;\n }\n\n flowParseDeclareInterface(\n node: N.FlowDeclareInterface,\n ): N.FlowDeclareInterface {\n this.next();\n this.flowParseInterfaceish(node);\n return this.finishNode(node, \"DeclareInterface\");\n }\n\n // Interfaces\n\n flowParseInterfaceish(\n node: N.FlowDeclare,\n isClass?: boolean = false,\n ): void {\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ !isClass,\n /* declaration */ true,\n );\n\n this.scope.declareName(\n node.id.name,\n isClass ? BIND_FUNCTION : BIND_LEXICAL,\n node.id.start,\n );\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.extends = [];\n node.implements = [];\n node.mixins = [];\n\n if (this.eat(tt._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (!isClass && this.eat(tt.comma));\n }\n\n if (this.isContextual(\"mixins\")) {\n this.next();\n do {\n node.mixins.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n if (this.isContextual(\"implements\")) {\n this.next();\n do {\n node.implements.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: isClass,\n allowExact: false,\n allowSpread: false,\n allowProto: isClass,\n allowInexact: false,\n });\n }\n\n flowParseInterfaceExtends(): N.FlowInterfaceExtends {\n const node = this.startNode();\n\n node.id = this.flowParseQualifiedTypeIdentifier();\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n\n return this.finishNode(node, \"InterfaceExtends\");\n }\n\n flowParseInterface(node: N.FlowInterface): N.FlowInterface {\n this.flowParseInterfaceish(node);\n return this.finishNode(node, \"InterfaceDeclaration\");\n }\n\n checkNotUnderscore(word: string) {\n if (word === \"_\") {\n this.raise(this.state.start, FlowErrors.UnexpectedReservedUnderscore);\n }\n }\n\n checkReservedType(word: string, startLoc: number, declaration?: boolean) {\n if (!reservedTypes.has(word)) return;\n\n this.raise(\n startLoc,\n declaration\n ? FlowErrors.AssignReservedType\n : FlowErrors.UnexpectedReservedType,\n word,\n );\n }\n\n flowParseRestrictedIdentifier(\n liberal?: boolean,\n declaration?: boolean,\n ): N.Identifier {\n this.checkReservedType(this.state.value, this.state.start, declaration);\n return this.parseIdentifier(liberal);\n }\n\n // Type aliases\n\n flowParseTypeAlias(node: N.FlowTypeAlias): N.FlowTypeAlias {\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ false,\n /* declaration */ true,\n );\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.right = this.flowParseTypeInitialiser(tt.eq);\n this.semicolon();\n\n return this.finishNode(node, \"TypeAlias\");\n }\n\n flowParseOpaqueType(\n node: N.FlowOpaqueType,\n declare: boolean,\n ): N.FlowOpaqueType {\n this.expectContextual(\"type\");\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ true,\n /* declaration */ true,\n );\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n // Parse the supertype\n node.supertype = null;\n if (this.match(tt.colon)) {\n node.supertype = this.flowParseTypeInitialiser(tt.colon);\n }\n\n node.impltype = null;\n if (!declare) {\n node.impltype = this.flowParseTypeInitialiser(tt.eq);\n }\n this.semicolon();\n\n return this.finishNode(node, \"OpaqueType\");\n }\n\n // Type annotations\n\n flowParseTypeParameter(requireDefault?: boolean = false): N.TypeParameter {\n const nodeStart = this.state.start;\n\n const node = this.startNode();\n\n const variance = this.flowParseVariance();\n\n const ident = this.flowParseTypeAnnotatableIdentifier();\n node.name = ident.name;\n node.variance = variance;\n node.bound = ident.typeAnnotation;\n\n if (this.match(tt.eq)) {\n this.eat(tt.eq);\n node.default = this.flowParseType();\n } else {\n if (requireDefault) {\n this.raise(nodeStart, FlowErrors.MissingTypeParamDefault);\n }\n }\n\n return this.finishNode(node, \"TypeParameter\");\n }\n\n flowParseTypeParameterDeclaration(): N.TypeParameterDeclaration {\n const oldInType = this.state.inType;\n const node = this.startNode();\n node.params = [];\n\n this.state.inType = true;\n\n // istanbul ignore else: this condition is already checked at all call sites\n if (this.isRelational(\"<\") || this.match(tt.jsxTagStart)) {\n this.next();\n } else {\n this.unexpected();\n }\n\n let defaultRequired = false;\n\n do {\n const typeParameter = this.flowParseTypeParameter(defaultRequired);\n\n node.params.push(typeParameter);\n\n if (typeParameter.default) {\n defaultRequired = true;\n }\n\n if (!this.isRelational(\">\")) {\n this.expect(tt.comma);\n }\n } while (!this.isRelational(\">\"));\n this.expectRelational(\">\");\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterDeclaration\");\n }\n\n flowParseTypeParameterInstantiation(): N.TypeParameterInstantiation {\n const node = this.startNode();\n const oldInType = this.state.inType;\n node.params = [];\n\n this.state.inType = true;\n\n this.expectRelational(\"<\");\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = false;\n while (!this.isRelational(\">\")) {\n node.params.push(this.flowParseType());\n if (!this.isRelational(\">\")) {\n this.expect(tt.comma);\n }\n }\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n this.expectRelational(\">\");\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseTypeParameterInstantiationCallOrNew(): N.TypeParameterInstantiation {\n const node = this.startNode();\n const oldInType = this.state.inType;\n node.params = [];\n\n this.state.inType = true;\n\n this.expectRelational(\"<\");\n while (!this.isRelational(\">\")) {\n node.params.push(this.flowParseTypeOrImplicitInstantiation());\n if (!this.isRelational(\">\")) {\n this.expect(tt.comma);\n }\n }\n this.expectRelational(\">\");\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseInterfaceType(): N.FlowInterfaceType {\n const node = this.startNode();\n this.expectContextual(\"interface\");\n\n node.extends = [];\n if (this.eat(tt._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: false,\n allowProto: false,\n allowInexact: false,\n });\n\n return this.finishNode(node, \"InterfaceTypeAnnotation\");\n }\n\n flowParseObjectPropertyKey(): N.Expression {\n return this.match(tt.num) || this.match(tt.string)\n ? this.parseExprAtom()\n : this.parseIdentifier(true);\n }\n\n flowParseObjectTypeIndexer(\n node: N.FlowObjectTypeIndexer,\n isStatic: boolean,\n variance: ?N.FlowVariance,\n ): N.FlowObjectTypeIndexer {\n node.static = isStatic;\n\n // Note: bracketL has already been consumed\n if (this.lookahead().type === tt.colon) {\n node.id = this.flowParseObjectPropertyKey();\n node.key = this.flowParseTypeInitialiser();\n } else {\n node.id = null;\n node.key = this.flowParseType();\n }\n this.expect(tt.bracketR);\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n\n return this.finishNode(node, \"ObjectTypeIndexer\");\n }\n\n flowParseObjectTypeInternalSlot(\n node: N.FlowObjectTypeInternalSlot,\n isStatic: boolean,\n ): N.FlowObjectTypeInternalSlot {\n node.static = isStatic;\n // Note: both bracketL have already been consumed\n node.id = this.flowParseObjectPropertyKey();\n this.expect(tt.bracketR);\n this.expect(tt.bracketR);\n if (this.isRelational(\"<\") || this.match(tt.parenL)) {\n node.method = true;\n node.optional = false;\n node.value = this.flowParseObjectTypeMethodish(\n this.startNodeAt(node.start, node.loc.start),\n );\n } else {\n node.method = false;\n if (this.eat(tt.question)) {\n node.optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n }\n return this.finishNode(node, \"ObjectTypeInternalSlot\");\n }\n\n flowParseObjectTypeMethodish(\n node: N.FlowFunctionTypeAnnotation,\n ): N.FlowFunctionTypeAnnotation {\n node.params = [];\n node.rest = null;\n node.typeParameters = null;\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n this.expect(tt.parenL);\n while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n node.params.push(this.flowParseFunctionTypeParam());\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n\n if (this.eat(tt.ellipsis)) {\n node.rest = this.flowParseFunctionTypeParam();\n }\n this.expect(tt.parenR);\n node.returnType = this.flowParseTypeInitialiser();\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n\n flowParseObjectTypeCallProperty(\n node: N.FlowObjectTypeCallProperty,\n isStatic: boolean,\n ): N.FlowObjectTypeCallProperty {\n const valueNode = this.startNode();\n node.static = isStatic;\n node.value = this.flowParseObjectTypeMethodish(valueNode);\n return this.finishNode(node, \"ObjectTypeCallProperty\");\n }\n\n flowParseObjectType({\n allowStatic,\n allowExact,\n allowSpread,\n allowProto,\n allowInexact,\n }: {\n allowStatic: boolean,\n allowExact: boolean,\n allowSpread: boolean,\n allowProto: boolean,\n allowInexact: boolean,\n }): N.FlowObjectTypeAnnotation {\n const oldInType = this.state.inType;\n this.state.inType = true;\n\n const nodeStart = this.startNode();\n\n nodeStart.callProperties = [];\n nodeStart.properties = [];\n nodeStart.indexers = [];\n nodeStart.internalSlots = [];\n\n let endDelim;\n let exact;\n let inexact = false;\n if (allowExact && this.match(tt.braceBarL)) {\n this.expect(tt.braceBarL);\n endDelim = tt.braceBarR;\n exact = true;\n } else {\n this.expect(tt.braceL);\n endDelim = tt.braceR;\n exact = false;\n }\n\n nodeStart.exact = exact;\n\n while (!this.match(endDelim)) {\n let isStatic = false;\n let protoStart: ?number = null;\n let inexactStart: ?number = null;\n const node = this.startNode();\n\n if (allowProto && this.isContextual(\"proto\")) {\n const lookahead = this.lookahead();\n\n if (lookahead.type !== tt.colon && lookahead.type !== tt.question) {\n this.next();\n protoStart = this.state.start;\n allowStatic = false;\n }\n }\n\n if (allowStatic && this.isContextual(\"static\")) {\n const lookahead = this.lookahead();\n\n // static is a valid identifier name\n if (lookahead.type !== tt.colon && lookahead.type !== tt.question) {\n this.next();\n isStatic = true;\n }\n }\n\n const variance = this.flowParseVariance();\n\n if (this.eat(tt.bracketL)) {\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n if (this.eat(tt.bracketL)) {\n if (variance) {\n this.unexpected(variance.start);\n }\n nodeStart.internalSlots.push(\n this.flowParseObjectTypeInternalSlot(node, isStatic),\n );\n } else {\n nodeStart.indexers.push(\n this.flowParseObjectTypeIndexer(node, isStatic, variance),\n );\n }\n } else if (this.match(tt.parenL) || this.isRelational(\"<\")) {\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n if (variance) {\n this.unexpected(variance.start);\n }\n nodeStart.callProperties.push(\n this.flowParseObjectTypeCallProperty(node, isStatic),\n );\n } else {\n let kind = \"init\";\n\n if (this.isContextual(\"get\") || this.isContextual(\"set\")) {\n const lookahead = this.lookahead();\n if (\n lookahead.type === tt.name ||\n lookahead.type === tt.string ||\n lookahead.type === tt.num\n ) {\n kind = this.state.value;\n this.next();\n }\n }\n\n const propOrInexact = this.flowParseObjectTypeProperty(\n node,\n isStatic,\n protoStart,\n variance,\n kind,\n allowSpread,\n allowInexact ?? !exact,\n );\n\n if (propOrInexact === null) {\n inexact = true;\n inexactStart = this.state.lastTokStart;\n } else {\n nodeStart.properties.push(propOrInexact);\n }\n }\n\n this.flowObjectTypeSemicolon();\n\n if (\n inexactStart &&\n !this.match(tt.braceR) &&\n !this.match(tt.braceBarR)\n ) {\n this.raise(\n inexactStart,\n FlowErrors.UnexpectedExplicitInexactInObject,\n );\n }\n }\n\n this.expect(endDelim);\n\n /* The inexact flag should only be added on ObjectTypeAnnotations that\n * are not the body of an interface, declare interface, or declare class.\n * Since spreads are only allowed in object types, checking that is\n * sufficient here.\n */\n if (allowSpread) {\n nodeStart.inexact = inexact;\n }\n\n const out = this.finishNode(nodeStart, \"ObjectTypeAnnotation\");\n\n this.state.inType = oldInType;\n\n return out;\n }\n\n flowParseObjectTypeProperty(\n node: N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty,\n isStatic: boolean,\n protoStart: ?number,\n variance: ?N.FlowVariance,\n kind: string,\n allowSpread: boolean,\n allowInexact: boolean,\n ): (N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty) | null {\n if (this.eat(tt.ellipsis)) {\n const isInexactToken =\n this.match(tt.comma) ||\n this.match(tt.semi) ||\n this.match(tt.braceR) ||\n this.match(tt.braceBarR);\n\n if (isInexactToken) {\n if (!allowSpread) {\n this.raise(\n this.state.lastTokStart,\n FlowErrors.InexactInsideNonObject,\n );\n } else if (!allowInexact) {\n this.raise(this.state.lastTokStart, FlowErrors.InexactInsideExact);\n }\n if (variance) {\n this.raise(variance.start, FlowErrors.InexactVariance);\n }\n\n return null;\n }\n\n if (!allowSpread) {\n this.raise(this.state.lastTokStart, FlowErrors.UnexpectedSpreadType);\n }\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n if (variance) {\n this.raise(variance.start, FlowErrors.SpreadVariance);\n }\n\n node.argument = this.flowParseType();\n return this.finishNode(node, \"ObjectTypeSpreadProperty\");\n } else {\n node.key = this.flowParseObjectPropertyKey();\n node.static = isStatic;\n node.proto = protoStart != null;\n node.kind = kind;\n\n let optional = false;\n if (this.isRelational(\"<\") || this.match(tt.parenL)) {\n // This is a method property\n node.method = true;\n\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n if (variance) {\n this.unexpected(variance.start);\n }\n\n node.value = this.flowParseObjectTypeMethodish(\n this.startNodeAt(node.start, node.loc.start),\n );\n if (kind === \"get\" || kind === \"set\") {\n this.flowCheckGetterSetterParams(node);\n }\n } else {\n if (kind !== \"init\") this.unexpected();\n\n node.method = false;\n\n if (this.eat(tt.question)) {\n optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n }\n\n node.optional = optional;\n\n return this.finishNode(node, \"ObjectTypeProperty\");\n }\n }\n\n // This is similar to checkGetterSetterParams, but as\n // @babel/parser uses non estree properties we cannot reuse it here\n flowCheckGetterSetterParams(\n property: N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty,\n ): void {\n const paramCount = property.kind === \"get\" ? 0 : 1;\n const start = property.start;\n const length =\n property.value.params.length + (property.value.rest ? 1 : 0);\n if (length !== paramCount) {\n if (property.kind === \"get\") {\n this.raise(start, Errors.BadGetterArity);\n } else {\n this.raise(start, Errors.BadSetterArity);\n }\n }\n\n if (property.kind === \"set\" && property.value.rest) {\n this.raise(start, Errors.BadSetterRestParameter);\n }\n }\n\n flowObjectTypeSemicolon(): void {\n if (\n !this.eat(tt.semi) &&\n !this.eat(tt.comma) &&\n !this.match(tt.braceR) &&\n !this.match(tt.braceBarR)\n ) {\n this.unexpected();\n }\n }\n\n flowParseQualifiedTypeIdentifier(\n startPos?: number,\n startLoc?: Position,\n id?: N.Identifier,\n ): N.FlowQualifiedTypeIdentifier {\n startPos = startPos || this.state.start;\n startLoc = startLoc || this.state.startLoc;\n let node = id || this.flowParseRestrictedIdentifier(true);\n\n while (this.eat(tt.dot)) {\n const node2 = this.startNodeAt(startPos, startLoc);\n node2.qualification = node;\n node2.id = this.flowParseRestrictedIdentifier(true);\n node = this.finishNode(node2, \"QualifiedTypeIdentifier\");\n }\n\n return node;\n }\n\n flowParseGenericType(\n startPos: number,\n startLoc: Position,\n id: N.Identifier,\n ): N.FlowGenericTypeAnnotation {\n const node = this.startNodeAt(startPos, startLoc);\n\n node.typeParameters = null;\n node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n }\n\n return this.finishNode(node, \"GenericTypeAnnotation\");\n }\n\n flowParseTypeofType(): N.FlowTypeofTypeAnnotation {\n const node = this.startNode();\n this.expect(tt._typeof);\n node.argument = this.flowParsePrimaryType();\n return this.finishNode(node, \"TypeofTypeAnnotation\");\n }\n\n flowParseTupleType(): N.FlowTupleTypeAnnotation {\n const node = this.startNode();\n node.types = [];\n this.expect(tt.bracketL);\n // We allow trailing commas\n while (this.state.pos < this.length && !this.match(tt.bracketR)) {\n node.types.push(this.flowParseType());\n if (this.match(tt.bracketR)) break;\n this.expect(tt.comma);\n }\n this.expect(tt.bracketR);\n return this.finishNode(node, \"TupleTypeAnnotation\");\n }\n\n flowParseFunctionTypeParam(): N.FlowFunctionTypeParam {\n let name = null;\n let optional = false;\n let typeAnnotation = null;\n const node = this.startNode();\n const lh = this.lookahead();\n if (lh.type === tt.colon || lh.type === tt.question) {\n name = this.parseIdentifier();\n if (this.eat(tt.question)) {\n optional = true;\n }\n typeAnnotation = this.flowParseTypeInitialiser();\n } else {\n typeAnnotation = this.flowParseType();\n }\n node.name = name;\n node.optional = optional;\n node.typeAnnotation = typeAnnotation;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n reinterpretTypeAsFunctionTypeParam(\n type: N.FlowType,\n ): N.FlowFunctionTypeParam {\n const node = this.startNodeAt(type.start, type.loc.start);\n node.name = null;\n node.optional = false;\n node.typeAnnotation = type;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n flowParseFunctionTypeParams(\n params: N.FlowFunctionTypeParam[] = [],\n ): { params: N.FlowFunctionTypeParam[], rest: ?N.FlowFunctionTypeParam } {\n let rest: ?N.FlowFunctionTypeParam = null;\n while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n params.push(this.flowParseFunctionTypeParam());\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n if (this.eat(tt.ellipsis)) {\n rest = this.flowParseFunctionTypeParam();\n }\n return { params, rest };\n }\n\n flowIdentToTypeAnnotation(\n startPos: number,\n startLoc: Position,\n node: N.FlowTypeAnnotation,\n id: N.Identifier,\n ): N.FlowTypeAnnotation {\n switch (id.name) {\n case \"any\":\n return this.finishNode(node, \"AnyTypeAnnotation\");\n\n case \"bool\":\n case \"boolean\":\n return this.finishNode(node, \"BooleanTypeAnnotation\");\n\n case \"mixed\":\n return this.finishNode(node, \"MixedTypeAnnotation\");\n\n case \"empty\":\n return this.finishNode(node, \"EmptyTypeAnnotation\");\n\n case \"number\":\n return this.finishNode(node, \"NumberTypeAnnotation\");\n\n case \"string\":\n return this.finishNode(node, \"StringTypeAnnotation\");\n\n case \"symbol\":\n return this.finishNode(node, \"SymbolTypeAnnotation\");\n\n default:\n this.checkNotUnderscore(id.name);\n return this.flowParseGenericType(startPos, startLoc, id);\n }\n }\n\n // The parsing of types roughly parallels the parsing of expressions, and\n // primary types are kind of like primary expressions...they're the\n // primitives with which other types are constructed.\n flowParsePrimaryType(): N.FlowTypeAnnotation {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const node = this.startNode();\n let tmp;\n let type;\n let isGroupedType = false;\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n\n switch (this.state.type) {\n case tt.name:\n if (this.isContextual(\"interface\")) {\n return this.flowParseInterfaceType();\n }\n\n return this.flowIdentToTypeAnnotation(\n startPos,\n startLoc,\n node,\n this.parseIdentifier(),\n );\n\n case tt.braceL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: true,\n allowProto: false,\n allowInexact: true,\n });\n\n case tt.braceBarL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: true,\n allowSpread: true,\n allowProto: false,\n allowInexact: false,\n });\n\n case tt.bracketL:\n this.state.noAnonFunctionType = false;\n type = this.flowParseTupleType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n return type;\n\n case tt.relational:\n if (this.state.value === \"<\") {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n this.expect(tt.parenL);\n tmp = this.flowParseFunctionTypeParams();\n node.params = tmp.params;\n node.rest = tmp.rest;\n this.expect(tt.parenR);\n\n this.expect(tt.arrow);\n\n node.returnType = this.flowParseType();\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n break;\n\n case tt.parenL:\n this.next();\n\n // Check to see if this is actually a grouped type\n if (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n if (this.match(tt.name)) {\n const token = this.lookahead().type;\n isGroupedType = token !== tt.question && token !== tt.colon;\n } else {\n isGroupedType = true;\n }\n }\n\n if (isGroupedType) {\n this.state.noAnonFunctionType = false;\n type = this.flowParseType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n // A `,` or a `) =>` means this is an anonymous function type\n if (\n this.state.noAnonFunctionType ||\n !(\n this.match(tt.comma) ||\n (this.match(tt.parenR) && this.lookahead().type === tt.arrow)\n )\n ) {\n this.expect(tt.parenR);\n return type;\n } else {\n // Eat a comma if there is one\n this.eat(tt.comma);\n }\n }\n\n if (type) {\n tmp = this.flowParseFunctionTypeParams([\n this.reinterpretTypeAsFunctionTypeParam(type),\n ]);\n } else {\n tmp = this.flowParseFunctionTypeParams();\n }\n\n node.params = tmp.params;\n node.rest = tmp.rest;\n\n this.expect(tt.parenR);\n\n this.expect(tt.arrow);\n\n node.returnType = this.flowParseType();\n\n node.typeParameters = null;\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n\n case tt.string:\n return this.parseLiteral(\n this.state.value,\n \"StringLiteralTypeAnnotation\",\n );\n\n case tt._true:\n case tt._false:\n node.value = this.match(tt._true);\n this.next();\n return this.finishNode(node, \"BooleanLiteralTypeAnnotation\");\n\n case tt.plusMin:\n if (this.state.value === \"-\") {\n this.next();\n if (this.match(tt.num)) {\n return this.parseLiteral(\n -this.state.value,\n \"NumberLiteralTypeAnnotation\",\n node.start,\n node.loc.start,\n );\n }\n\n if (this.match(tt.bigint)) {\n return this.parseLiteral(\n -this.state.value,\n \"BigIntLiteralTypeAnnotation\",\n node.start,\n node.loc.start,\n );\n }\n\n throw this.raise(\n this.state.start,\n FlowErrors.UnexpectedSubtractionOperand,\n );\n }\n\n throw this.unexpected();\n case tt.num:\n return this.parseLiteral(\n this.state.value,\n \"NumberLiteralTypeAnnotation\",\n );\n\n case tt.bigint:\n return this.parseLiteral(\n this.state.value,\n \"BigIntLiteralTypeAnnotation\",\n );\n\n case tt._void:\n this.next();\n return this.finishNode(node, \"VoidTypeAnnotation\");\n\n case tt._null:\n this.next();\n return this.finishNode(node, \"NullLiteralTypeAnnotation\");\n\n case tt._this:\n this.next();\n return this.finishNode(node, \"ThisTypeAnnotation\");\n\n case tt.star:\n this.next();\n return this.finishNode(node, \"ExistsTypeAnnotation\");\n\n default:\n if (this.state.type.keyword === \"typeof\") {\n return this.flowParseTypeofType();\n } else if (this.state.type.keyword) {\n const label = this.state.type.label;\n this.next();\n return super.createIdentifier(node, label);\n }\n }\n\n throw this.unexpected();\n }\n\n flowParsePostfixType(): N.FlowTypeAnnotation {\n const startPos = this.state.start,\n startLoc = this.state.startLoc;\n let type = this.flowParsePrimaryType();\n while (this.match(tt.bracketL) && !this.canInsertSemicolon()) {\n const node = this.startNodeAt(startPos, startLoc);\n node.elementType = type;\n this.expect(tt.bracketL);\n this.expect(tt.bracketR);\n type = this.finishNode(node, \"ArrayTypeAnnotation\");\n }\n return type;\n }\n\n flowParsePrefixType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n if (this.eat(tt.question)) {\n node.typeAnnotation = this.flowParsePrefixType();\n return this.finishNode(node, \"NullableTypeAnnotation\");\n } else {\n return this.flowParsePostfixType();\n }\n }\n\n flowParseAnonFunctionWithoutParens(): N.FlowTypeAnnotation {\n const param = this.flowParsePrefixType();\n if (!this.state.noAnonFunctionType && this.eat(tt.arrow)) {\n // TODO: This should be a type error. Passing in a SourceLocation, and it expects a Position.\n const node = this.startNodeAt(param.start, param.loc.start);\n node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];\n node.rest = null;\n node.returnType = this.flowParseType();\n node.typeParameters = null;\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n return param;\n }\n\n flowParseIntersectionType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n this.eat(tt.bitwiseAND);\n const type = this.flowParseAnonFunctionWithoutParens();\n node.types = [type];\n while (this.eat(tt.bitwiseAND)) {\n node.types.push(this.flowParseAnonFunctionWithoutParens());\n }\n return node.types.length === 1\n ? type\n : this.finishNode(node, \"IntersectionTypeAnnotation\");\n }\n\n flowParseUnionType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n this.eat(tt.bitwiseOR);\n const type = this.flowParseIntersectionType();\n node.types = [type];\n while (this.eat(tt.bitwiseOR)) {\n node.types.push(this.flowParseIntersectionType());\n }\n return node.types.length === 1\n ? type\n : this.finishNode(node, \"UnionTypeAnnotation\");\n }\n\n flowParseType(): N.FlowTypeAnnotation {\n const oldInType = this.state.inType;\n this.state.inType = true;\n const type = this.flowParseUnionType();\n this.state.inType = oldInType;\n // Ensure that a brace after a function generic type annotation is a\n // statement, except in arrow functions (noAnonFunctionType)\n this.state.exprAllowed =\n this.state.exprAllowed || this.state.noAnonFunctionType;\n return type;\n }\n\n flowParseTypeOrImplicitInstantiation(): N.FlowTypeAnnotation {\n if (this.state.type === tt.name && this.state.value === \"_\") {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const node = this.parseIdentifier();\n return this.flowParseGenericType(startPos, startLoc, node);\n } else {\n return this.flowParseType();\n }\n }\n\n flowParseTypeAnnotation(): N.FlowTypeAnnotation {\n const node = this.startNode();\n node.typeAnnotation = this.flowParseTypeInitialiser();\n return this.finishNode(node, \"TypeAnnotation\");\n }\n\n flowParseTypeAnnotatableIdentifier(\n allowPrimitiveOverride?: boolean,\n ): N.Identifier {\n const ident = allowPrimitiveOverride\n ? this.parseIdentifier()\n : this.flowParseRestrictedIdentifier();\n if (this.match(tt.colon)) {\n ident.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(ident);\n }\n return ident;\n }\n\n typeCastToParameter(node: N.Node): N.Node {\n node.expression.typeAnnotation = node.typeAnnotation;\n\n this.resetEndLocation(\n node.expression,\n node.typeAnnotation.end,\n node.typeAnnotation.loc.end,\n );\n\n return node.expression;\n }\n\n flowParseVariance(): ?N.FlowVariance {\n let variance = null;\n if (this.match(tt.plusMin)) {\n variance = this.startNode();\n if (this.state.value === \"+\") {\n variance.kind = \"plus\";\n } else {\n variance.kind = \"minus\";\n }\n this.next();\n this.finishNode(variance, \"Variance\");\n }\n return variance;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n parseFunctionBody(\n node: N.Function,\n allowExpressionBody: ?boolean,\n isMethod?: boolean = false,\n ): void {\n if (allowExpressionBody) {\n return this.forwardNoArrowParamsConversionAt(node, () =>\n super.parseFunctionBody(node, true, isMethod),\n );\n }\n\n return super.parseFunctionBody(node, false, isMethod);\n }\n\n parseFunctionBodyAndFinish(\n node: N.BodilessFunctionOrMethodBase,\n type: string,\n isMethod?: boolean = false,\n ): void {\n if (this.match(tt.colon)) {\n const typeNode = this.startNode();\n\n [\n // $FlowFixMe (destructuring not supported yet)\n typeNode.typeAnnotation,\n // $FlowFixMe (destructuring not supported yet)\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n node.returnType = typeNode.typeAnnotation\n ? this.finishNode(typeNode, \"TypeAnnotation\")\n : null;\n }\n\n super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n // interfaces and enums\n parseStatement(context: ?string, topLevel?: boolean): N.Statement {\n // strict mode handling of `interface` since it's a reserved word\n if (\n this.state.strict &&\n this.match(tt.name) &&\n this.state.value === \"interface\"\n ) {\n const lookahead = this.lookahead();\n if (lookahead.type === tt.name || isKeyword(lookahead.value)) {\n const node = this.startNode();\n this.next();\n return this.flowParseInterface(node);\n }\n } else if (this.shouldParseEnums() && this.isContextual(\"enum\")) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n const stmt = super.parseStatement(context, topLevel);\n // We will parse a flow pragma in any comment before the first statement.\n if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {\n this.flowPragma = null;\n }\n return stmt;\n }\n\n // declares, interfaces and type aliases\n parseExpressionStatement(\n node: N.ExpressionStatement,\n expr: N.Expression,\n ): N.ExpressionStatement {\n if (expr.type === \"Identifier\") {\n if (expr.name === \"declare\") {\n if (\n this.match(tt._class) ||\n this.match(tt.name) ||\n this.match(tt._function) ||\n this.match(tt._var) ||\n this.match(tt._export)\n ) {\n return this.flowParseDeclare(node);\n }\n } else if (this.match(tt.name)) {\n if (expr.name === \"interface\") {\n return this.flowParseInterface(node);\n } else if (expr.name === \"type\") {\n return this.flowParseTypeAlias(node);\n } else if (expr.name === \"opaque\") {\n return this.flowParseOpaqueType(node, false);\n }\n }\n }\n\n return super.parseExpressionStatement(node, expr);\n }\n\n // export type\n shouldParseExportDeclaration(): boolean {\n return (\n this.isContextual(\"type\") ||\n this.isContextual(\"interface\") ||\n this.isContextual(\"opaque\") ||\n (this.shouldParseEnums() && this.isContextual(\"enum\")) ||\n super.shouldParseExportDeclaration()\n );\n }\n\n isExportDefaultSpecifier(): boolean {\n if (\n this.match(tt.name) &&\n (this.state.value === \"type\" ||\n this.state.value === \"interface\" ||\n this.state.value === \"opaque\" ||\n (this.shouldParseEnums() && this.state.value === \"enum\"))\n ) {\n return false;\n }\n\n return super.isExportDefaultSpecifier();\n }\n\n parseExportDefaultExpression(): N.Expression | N.Declaration {\n if (this.shouldParseEnums() && this.isContextual(\"enum\")) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n return super.parseExportDefaultExpression();\n }\n\n parseConditional(\n expr: N.Expression,\n startPos: number,\n startLoc: Position,\n refNeedsArrowPos?: ?Pos,\n ): N.Expression {\n if (!this.match(tt.question)) return expr;\n\n // only use the expensive \"tryParse\" method if there is a question mark\n // and if we come from inside parens\n if (refNeedsArrowPos) {\n const result = this.tryParse(() =>\n super.parseConditional(expr, startPos, startLoc),\n );\n\n if (!result.node) {\n // $FlowIgnore\n refNeedsArrowPos.start = result.error.pos || this.state.start;\n return expr;\n }\n\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n this.expect(tt.question);\n const state = this.state.clone();\n const originalNoArrowAt = this.state.noArrowAt;\n const node = this.startNodeAt(startPos, startLoc);\n let { consequent, failed } = this.tryParseConditionalConsequent();\n let [valid, invalid] = this.getArrowLikeExpressions(consequent);\n\n if (failed || invalid.length > 0) {\n const noArrowAt = [...originalNoArrowAt];\n\n if (invalid.length > 0) {\n this.state = state;\n this.state.noArrowAt = noArrowAt;\n\n for (let i = 0; i < invalid.length; i++) {\n noArrowAt.push(invalid[i].start);\n }\n\n ({ consequent, failed } = this.tryParseConditionalConsequent());\n [valid, invalid] = this.getArrowLikeExpressions(consequent);\n }\n\n if (failed && valid.length > 1) {\n // if there are two or more possible correct ways of parsing, throw an\n // error.\n // e.g. Source: a ? (b): c => (d): e => f\n // Result 1: a ? b : (c => ((d): e => f))\n // Result 2: a ? ((b): c => d) : (e => f)\n this.raise(state.start, FlowErrors.AmbiguousConditionalArrow);\n }\n\n if (failed && valid.length === 1) {\n this.state = state;\n this.state.noArrowAt = noArrowAt.concat(valid[0].start);\n ({ consequent, failed } = this.tryParseConditionalConsequent());\n }\n }\n\n this.getArrowLikeExpressions(consequent, true);\n\n this.state.noArrowAt = originalNoArrowAt;\n this.expect(tt.colon);\n\n node.test = expr;\n node.consequent = consequent;\n node.alternate = this.forwardNoArrowParamsConversionAt(node, () =>\n this.parseMaybeAssign(undefined, undefined, undefined),\n );\n\n return this.finishNode(node, \"ConditionalExpression\");\n }\n\n tryParseConditionalConsequent(): {\n consequent: N.Expression,\n failed: boolean,\n } {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n\n const consequent = this.parseMaybeAssignAllowIn();\n const failed = !this.match(tt.colon);\n\n this.state.noArrowParamsConversionAt.pop();\n\n return { consequent, failed };\n }\n\n // Given an expression, walks through out its arrow functions whose body is\n // an expression and through out conditional expressions. It returns every\n // function which has been parsed with a return type but could have been\n // parenthesized expressions.\n // These functions are separated into two arrays: one containing the ones\n // whose parameters can be converted to assignable lists, one containing the\n // others.\n getArrowLikeExpressions(\n node: N.Expression,\n disallowInvalid?: boolean,\n ): [N.ArrowFunctionExpression[], N.ArrowFunctionExpression[]] {\n const stack = [node];\n const arrows: N.ArrowFunctionExpression[] = [];\n\n while (stack.length !== 0) {\n const node = stack.pop();\n if (node.type === \"ArrowFunctionExpression\") {\n if (node.typeParameters || !node.returnType) {\n // This is an arrow expression without ambiguity, so check its parameters\n this.finishArrowValidation(node);\n } else {\n arrows.push(node);\n }\n stack.push(node.body);\n } else if (node.type === \"ConditionalExpression\") {\n stack.push(node.consequent);\n stack.push(node.alternate);\n }\n }\n\n if (disallowInvalid) {\n arrows.forEach(node => this.finishArrowValidation(node));\n return [arrows, []];\n }\n\n return partition(arrows, node =>\n node.params.every(param => this.isAssignable(param, true)),\n );\n }\n\n finishArrowValidation(node: N.ArrowFunctionExpression) {\n this.toAssignableList(\n // node.params is Expression[] instead of $ReadOnlyArray because it\n // has not been converted yet.\n ((node.params: any): N.Expression[]),\n node.extra?.trailingComma,\n /* isLHS */ false,\n );\n // Enter scope, as checkParams defines bindings\n this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);\n // Use super's method to force the parameters to be checked\n super.checkParams(node, false, true);\n this.scope.exit();\n }\n\n forwardNoArrowParamsConversionAt(node: N.Node, parse: () => T): T {\n let result: T;\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n result = parse();\n this.state.noArrowParamsConversionAt.pop();\n } else {\n result = parse();\n }\n\n return result;\n }\n\n parseParenItem(\n node: N.Expression,\n startPos: number,\n startLoc: Position,\n ): N.Expression {\n node = super.parseParenItem(node, startPos, startLoc);\n if (this.eat(tt.question)) {\n node.optional = true;\n // Include questionmark in location of node\n // Don't use this.finishNode() as otherwise we might process comments twice and\n // include already consumed parens\n this.resetEndLocation(node);\n }\n\n if (this.match(tt.colon)) {\n const typeCastNode = this.startNodeAt(startPos, startLoc);\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();\n\n return this.finishNode(typeCastNode, \"TypeCastExpression\");\n }\n\n return node;\n }\n\n assertModuleNodeAllowed(node: N.Node) {\n if (\n (node.type === \"ImportDeclaration\" &&\n (node.importKind === \"type\" || node.importKind === \"typeof\")) ||\n (node.type === \"ExportNamedDeclaration\" &&\n node.exportKind === \"type\") ||\n (node.type === \"ExportAllDeclaration\" && node.exportKind === \"type\")\n ) {\n // Allow Flowtype imports and exports in all conditions because\n // Flow itself does not care about 'sourceType'.\n return;\n }\n\n super.assertModuleNodeAllowed(node);\n }\n\n parseExport(node: N.Node): N.AnyExport {\n const decl = super.parseExport(node);\n if (\n decl.type === \"ExportNamedDeclaration\" ||\n decl.type === \"ExportAllDeclaration\"\n ) {\n decl.exportKind = decl.exportKind || \"value\";\n }\n return decl;\n }\n\n parseExportDeclaration(node: N.ExportNamedDeclaration): ?N.Declaration {\n if (this.isContextual(\"type\")) {\n node.exportKind = \"type\";\n\n const declarationNode = this.startNode();\n this.next();\n\n if (this.match(tt.braceL)) {\n // export type { foo, bar };\n node.specifiers = this.parseExportSpecifiers();\n this.parseExportFrom(node);\n return null;\n } else {\n // export type Foo = Bar;\n return this.flowParseTypeAlias(declarationNode);\n }\n } else if (this.isContextual(\"opaque\")) {\n node.exportKind = \"type\";\n\n const declarationNode = this.startNode();\n this.next();\n // export opaque type Foo = Bar;\n return this.flowParseOpaqueType(declarationNode, false);\n } else if (this.isContextual(\"interface\")) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseInterface(declarationNode);\n } else if (this.shouldParseEnums() && this.isContextual(\"enum\")) {\n node.exportKind = \"value\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(declarationNode);\n } else {\n return super.parseExportDeclaration(node);\n }\n }\n\n eatExportStar(node: N.Node): boolean {\n if (super.eatExportStar(...arguments)) return true;\n\n if (this.isContextual(\"type\") && this.lookahead().type === tt.star) {\n node.exportKind = \"type\";\n this.next();\n this.next();\n return true;\n }\n\n return false;\n }\n\n maybeParseExportNamespaceSpecifier(node: N.Node): boolean {\n const pos = this.state.start;\n const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);\n if (hasNamespace && node.exportKind === \"type\") {\n this.unexpected(pos);\n }\n return hasNamespace;\n }\n\n parseClassId(node: N.Class, isStatement: boolean, optionalId: ?boolean) {\n super.parseClassId(node, isStatement, optionalId);\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n }\n\n parseClassMember(\n classBody: N.ClassBody,\n member: any,\n state: N.ParseClassMemberState,\n ): void {\n const pos = this.state.start;\n if (this.isContextual(\"declare\")) {\n if (this.parseClassMemberFromModifier(classBody, member)) {\n // 'declare' is a class element name\n return;\n }\n\n member.declare = true;\n }\n\n super.parseClassMember(classBody, member, state);\n\n if (member.declare) {\n if (\n member.type !== \"ClassProperty\" &&\n member.type !== \"ClassPrivateProperty\"\n ) {\n this.raise(pos, FlowErrors.DeclareClassElement);\n } else if (member.value) {\n this.raise(\n member.value.start,\n FlowErrors.DeclareClassFieldInitializer,\n );\n }\n }\n }\n\n // ensure that inside flow types, we bypass the jsx parser plugin\n getTokenFromCode(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (code === charCodes.leftCurlyBrace && next === charCodes.verticalBar) {\n return this.finishOp(tt.braceBarL, 2);\n } else if (\n this.state.inType &&\n (code === charCodes.greaterThan || code === charCodes.lessThan)\n ) {\n return this.finishOp(tt.relational, 1);\n } else if (this.state.inType && code === charCodes.questionMark) {\n // allow double nullable types in Flow: ??string\n return this.finishOp(tt.question, 1);\n } else if (isIteratorStart(code, next)) {\n this.state.isIterator = true;\n return super.readWord();\n } else {\n return super.getTokenFromCode(code);\n }\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n switch (node.type) {\n case \"Identifier\":\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n return true;\n\n case \"ObjectExpression\": {\n const last = node.properties.length - 1;\n return node.properties.every((prop, i) => {\n return (\n prop.type !== \"ObjectMethod\" &&\n (i === last || prop.type === \"SpreadElement\") &&\n this.isAssignable(prop)\n );\n });\n }\n\n case \"ObjectProperty\":\n return this.isAssignable(node.value);\n\n case \"SpreadElement\":\n return this.isAssignable(node.argument);\n\n case \"ArrayExpression\":\n return node.elements.every(element => this.isAssignable(element));\n\n case \"AssignmentExpression\":\n return node.operator === \"=\";\n\n case \"ParenthesizedExpression\":\n case \"TypeCastExpression\":\n return this.isAssignable(node.expression);\n\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n return !isBinding;\n\n default:\n return false;\n }\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): N.Node {\n if (node.type === \"TypeCastExpression\") {\n return super.toAssignable(this.typeCastToParameter(node), isLHS);\n } else {\n return super.toAssignable(node, isLHS);\n }\n }\n\n // turn type casts that we found in function parameter head into type annotated params\n toAssignableList(\n exprList: N.Expression[],\n trailingCommaPos?: ?number,\n isLHS: boolean,\n ): $ReadOnlyArray {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (expr?.type === \"TypeCastExpression\") {\n exprList[i] = this.typeCastToParameter(expr);\n }\n }\n return super.toAssignableList(exprList, trailingCommaPos, isLHS);\n }\n\n // this is a list of nodes, from something like a call expression, we need to filter the\n // type casts that we've found that are illegal in this context\n toReferencedList(\n exprList: $ReadOnlyArray,\n isParenthesizedExpr?: boolean,\n ): $ReadOnlyArray {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (\n expr &&\n expr.type === \"TypeCastExpression\" &&\n !expr.extra?.parenthesized &&\n (exprList.length > 1 || !isParenthesizedExpr)\n ) {\n this.raise(expr.typeAnnotation.start, FlowErrors.TypeCastInPattern);\n }\n }\n\n return exprList;\n }\n\n parseArrayLike(\n close: TokenType,\n canBePattern: boolean,\n isTuple: boolean,\n refExpressionErrors: ?ExpressionErrors,\n ): N.ArrayExpression | N.TupleExpression {\n const node = super.parseArrayLike(\n close,\n canBePattern,\n isTuple,\n refExpressionErrors,\n );\n\n // This could be an array pattern:\n // ([a: string, b: string]) => {}\n // In this case, we don't have to call toReferencedList. We will\n // call it, if needed, when we are sure that it is a parenthesized\n // expression by calling toReferencedListDeep.\n if (canBePattern && !this.state.maybeInArrowParameters) {\n this.toReferencedList(node.elements);\n }\n\n return node;\n }\n\n checkLVal(\n expr: N.Expression,\n ...args:\n | [string, BindingTypes | void]\n | [\n string,\n BindingTypes | void,\n ?Set,\n boolean | void,\n boolean | void,\n ]\n ): void {\n if (expr.type !== \"TypeCastExpression\") {\n return super.checkLVal(expr, ...args);\n }\n }\n\n // parse class property type annotations\n parseClassProperty(node: N.ClassProperty): N.ClassProperty {\n if (this.match(tt.colon)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassProperty(node);\n }\n\n parseClassPrivateProperty(\n node: N.ClassPrivateProperty,\n ): N.ClassPrivateProperty {\n if (this.match(tt.colon)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassPrivateProperty(node);\n }\n\n // determine whether or not we're currently in the position where a class method would appear\n isClassMethod(): boolean {\n return this.isRelational(\"<\") || super.isClassMethod();\n }\n\n // determine whether or not we're currently in the position where a class property would appear\n isClassProperty(): boolean {\n return this.match(tt.colon) || super.isClassProperty();\n }\n\n isNonstaticConstructor(method: N.ClassMethod | N.ClassProperty): boolean {\n return !this.match(tt.colon) && super.isNonstaticConstructor(method);\n }\n\n // parse type parameters for class methods\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n if ((method: $FlowFixMe).variance) {\n this.unexpected((method: $FlowFixMe).variance.start);\n }\n delete (method: $FlowFixMe).variance;\n if (this.isRelational(\"<\")) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassMethod(\n classBody,\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n );\n }\n\n pushClassPrivateMethod(\n classBody: N.ClassBody,\n method: N.ClassPrivateMethod,\n isGenerator: boolean,\n isAsync: boolean,\n ): void {\n if ((method: $FlowFixMe).variance) {\n this.unexpected((method: $FlowFixMe).variance.start);\n }\n delete (method: $FlowFixMe).variance;\n if (this.isRelational(\"<\")) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n // parse a the super class type parameters and implements\n parseClassSuper(node: N.Class): void {\n super.parseClassSuper(node);\n if (node.superClass && this.isRelational(\"<\")) {\n node.superTypeParameters = this.flowParseTypeParameterInstantiation();\n }\n if (this.isContextual(\"implements\")) {\n this.next();\n const implemented: N.FlowClassImplements[] = (node.implements = []);\n do {\n const node = this.startNode();\n node.id = this.flowParseRestrictedIdentifier(/*liberal*/ true);\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n implemented.push(this.finishNode(node, \"ClassImplements\"));\n } while (this.eat(tt.comma));\n }\n }\n\n parsePropertyName(\n node: N.ObjectOrClassMember | N.ClassMember | N.TsNamedTypeElementBase,\n isPrivateNameAllowed: boolean,\n ): N.Identifier {\n const variance = this.flowParseVariance();\n const key = super.parsePropertyName(node, isPrivateNameAllowed);\n // $FlowIgnore (\"variance\" not defined on TsNamedTypeElementBase)\n node.variance = variance;\n return key;\n }\n\n // parse type parameters for object method shorthand\n parseObjPropValue(\n prop: N.ObjectMember,\n startPos: ?number,\n startLoc: ?Position,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n refExpressionErrors: ?ExpressionErrors,\n ): void {\n if ((prop: $FlowFixMe).variance) {\n this.unexpected((prop: $FlowFixMe).variance.start);\n }\n delete (prop: $FlowFixMe).variance;\n\n let typeParameters;\n\n // method shorthand\n if (this.isRelational(\"<\") && !isAccessor) {\n typeParameters = this.flowParseTypeParameterDeclaration();\n if (!this.match(tt.parenL)) this.unexpected();\n }\n\n super.parseObjPropValue(\n prop,\n startPos,\n startLoc,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n refExpressionErrors,\n );\n\n // add typeParameters if we found them\n if (typeParameters) {\n (prop.value || prop).typeParameters = typeParameters;\n }\n }\n\n parseAssignableListItemTypes(param: N.Pattern): N.Pattern {\n if (this.eat(tt.question)) {\n if (param.type !== \"Identifier\") {\n this.raise(param.start, FlowErrors.OptionalBindingPattern);\n }\n\n ((param: any): N.Identifier).optional = true;\n }\n if (this.match(tt.colon)) {\n param.typeAnnotation = this.flowParseTypeAnnotation();\n }\n this.resetEndLocation(param);\n return param;\n }\n\n parseMaybeDefault(\n startPos?: ?number,\n startLoc?: ?Position,\n left?: ?N.Pattern,\n ): N.Pattern {\n const node = super.parseMaybeDefault(startPos, startLoc, left);\n\n if (\n node.type === \"AssignmentPattern\" &&\n node.typeAnnotation &&\n node.right.start < node.typeAnnotation.start\n ) {\n this.raise(node.typeAnnotation.start, FlowErrors.TypeBeforeInitializer);\n }\n\n return node;\n }\n\n shouldParseDefaultImport(node: N.ImportDeclaration): boolean {\n if (!hasTypeImportKind(node)) {\n return super.shouldParseDefaultImport(node);\n }\n\n return isMaybeDefaultImport(this.state);\n }\n\n parseImportSpecifierLocal(\n node: N.ImportDeclaration,\n specifier: N.Node,\n type: string,\n contextDescription: string,\n ): void {\n specifier.local = hasTypeImportKind(node)\n ? this.flowParseRestrictedIdentifier(\n /* liberal */ true,\n /* declaration */ true,\n )\n : this.parseIdentifier();\n\n this.checkLVal(specifier.local, contextDescription, BIND_LEXICAL);\n node.specifiers.push(this.finishNode(specifier, type));\n }\n\n // parse typeof and type imports\n maybeParseDefaultImportSpecifier(node: N.ImportDeclaration): boolean {\n node.importKind = \"value\";\n\n let kind = null;\n if (this.match(tt._typeof)) {\n kind = \"typeof\";\n } else if (this.isContextual(\"type\")) {\n kind = \"type\";\n }\n if (kind) {\n const lh = this.lookahead();\n\n // import type * is not allowed\n if (kind === \"type\" && lh.type === tt.star) {\n this.unexpected(lh.start);\n }\n\n if (\n isMaybeDefaultImport(lh) ||\n lh.type === tt.braceL ||\n lh.type === tt.star\n ) {\n this.next();\n node.importKind = kind;\n }\n }\n\n return super.maybeParseDefaultImportSpecifier(node);\n }\n\n // parse import-type/typeof shorthand\n parseImportSpecifier(node: N.ImportDeclaration): void {\n const specifier = this.startNode();\n const firstIdentLoc = this.state.start;\n const firstIdent = this.parseModuleExportName();\n\n let specifierTypeKind = null;\n if (firstIdent.type === \"Identifier\") {\n if (firstIdent.name === \"type\") {\n specifierTypeKind = \"type\";\n } else if (firstIdent.name === \"typeof\") {\n specifierTypeKind = \"typeof\";\n }\n }\n\n let isBinding = false;\n if (this.isContextual(\"as\") && !this.isLookaheadContextual(\"as\")) {\n const as_ident = this.parseIdentifier(true);\n if (\n specifierTypeKind !== null &&\n !this.match(tt.name) &&\n !this.state.type.keyword\n ) {\n // `import {type as ,` or `import {type as }`\n specifier.imported = as_ident;\n specifier.importKind = specifierTypeKind;\n specifier.local = as_ident.__clone();\n } else {\n // `import {type as foo`\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = this.parseIdentifier();\n }\n } else if (\n specifierTypeKind !== null &&\n (this.match(tt.name) || this.state.type.keyword)\n ) {\n // `import {type foo`\n specifier.imported = this.parseIdentifier(true);\n specifier.importKind = specifierTypeKind;\n if (this.eatContextual(\"as\")) {\n specifier.local = this.parseIdentifier();\n } else {\n isBinding = true;\n specifier.local = specifier.imported.__clone();\n }\n } else {\n if (firstIdent.type === \"StringLiteral\") {\n throw this.raise(\n specifier.start,\n Errors.ImportBindingIsString,\n firstIdent.value,\n );\n }\n isBinding = true;\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = specifier.imported.__clone();\n }\n\n const nodeIsTypeImport = hasTypeImportKind(node);\n const specifierIsTypeImport = hasTypeImportKind(specifier);\n\n if (nodeIsTypeImport && specifierIsTypeImport) {\n this.raise(\n firstIdentLoc,\n FlowErrors.ImportTypeShorthandOnlyInPureImport,\n );\n }\n\n if (nodeIsTypeImport || specifierIsTypeImport) {\n this.checkReservedType(\n specifier.local.name,\n specifier.local.start,\n /* declaration */ true,\n );\n }\n\n if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) {\n this.checkReservedWord(\n specifier.local.name,\n specifier.start,\n true,\n true,\n );\n }\n\n this.checkLVal(specifier.local, \"import specifier\", BIND_LEXICAL);\n node.specifiers.push(this.finishNode(specifier, \"ImportSpecifier\"));\n }\n\n // parse function type parameters - function foo() {}\n parseFunctionParams(node: N.Function, allowModifiers?: boolean): void {\n // $FlowFixMe\n const kind = node.kind;\n if (kind !== \"get\" && kind !== \"set\" && this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n super.parseFunctionParams(node, allowModifiers);\n }\n\n // parse flow type annotations on variable declarator heads - let foo: string = bar\n parseVarId(\n decl: N.VariableDeclarator,\n kind: \"var\" | \"let\" | \"const\",\n ): void {\n super.parseVarId(decl, kind);\n if (this.match(tt.colon)) {\n decl.id.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(decl.id); // set end position to end of type\n }\n }\n\n // parse the return type of an async arrow function - let foo = (async (): number => {});\n parseAsyncArrowFromCallExpression(\n node: N.ArrowFunctionExpression,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n node.returnType = this.flowParseTypeAnnotation();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n }\n\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n // todo description\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseAsyncArrow();\n }\n\n // We need to support type parameter declarations for arrow functions. This\n // is tricky. There are three situations we need to handle\n //\n // 1. This is either JSX or an arrow function. We'll try JSX first. If that\n // fails, we'll try an arrow function. If that fails, we'll throw the JSX\n // error.\n // 2. This is an arrow function. We'll parse the type parameter declaration,\n // parse the rest, make sure the rest is an arrow function, and go from\n // there\n // 3. This is neither. Just call the super method\n parseMaybeAssign(\n refExpressionErrors?: ?ExpressionErrors,\n afterLeftParse?: Function,\n refNeedsArrowPos?: ?Pos,\n ): N.Expression {\n let state = null;\n\n let jsx;\n\n if (\n this.hasPlugin(\"jsx\") &&\n (this.match(tt.jsxTagStart) || this.isRelational(\"<\"))\n ) {\n state = this.state.clone();\n\n jsx = this.tryParse(\n () =>\n super.parseMaybeAssign(\n refExpressionErrors,\n afterLeftParse,\n refNeedsArrowPos,\n ),\n state,\n );\n /*:: invariant(!jsx.aborted) */\n\n if (!jsx.error) return jsx.node;\n\n // Remove `tc.j_expr` and `tc.j_oTag` from context added\n // by parsing `jsxTagStart` to stop the JSX plugin from\n // messing with the tokens\n const { context } = this.state;\n if (context[context.length - 1] === tc.j_oTag) {\n context.length -= 2;\n } else if (context[context.length - 1] === tc.j_expr) {\n context.length -= 1;\n }\n }\n\n if (jsx?.error || this.isRelational(\"<\")) {\n state = state || this.state.clone();\n\n let typeParameters;\n\n const arrow = this.tryParse(abort => {\n typeParameters = this.flowParseTypeParameterDeclaration();\n\n const arrowExpression = this.forwardNoArrowParamsConversionAt(\n typeParameters,\n () => {\n const result = super.parseMaybeAssign(\n refExpressionErrors,\n afterLeftParse,\n refNeedsArrowPos,\n );\n\n this.resetStartLocationFromNode(result, typeParameters);\n\n return result;\n },\n );\n\n // (() => {}: any);\n if (\n arrowExpression.type !== \"ArrowFunctionExpression\" &&\n arrowExpression.extra?.parenthesized\n ) {\n abort();\n }\n\n // The above can return a TypeCastExpression when the arrow\n // expression is not wrapped in parens. See also `this.parseParenItem`.\n const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);\n expr.typeParameters = typeParameters;\n this.resetStartLocationFromNode(expr, typeParameters);\n\n return arrowExpression;\n }, state);\n\n let arrowExpression: ?(\n | N.ArrowFunctionExpression\n | N.TypeCastExpression\n ) = null;\n\n if (\n arrow.node &&\n this.maybeUnwrapTypeCastExpression(arrow.node).type ===\n \"ArrowFunctionExpression\"\n ) {\n if (!arrow.error && !arrow.aborted) {\n // async () => {}\n if (arrow.node.async) {\n /*:: invariant(typeParameters) */\n this.raise(\n typeParameters.start,\n FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction,\n );\n }\n\n return arrow.node;\n }\n\n arrowExpression = arrow.node;\n }\n\n // If we are here, both JSX and Flow parsing attempts failed.\n // Give the precedence to the JSX error, except if JSX had an\n // unrecoverable error while Flow didn't.\n // If the error is recoverable, we can only re-report it if there is\n // a node we can return.\n\n if (jsx?.node) {\n /*:: invariant(jsx.failState) */\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrowExpression) {\n /*:: invariant(arrow.failState) */\n this.state = arrow.failState;\n return arrowExpression;\n }\n\n if (jsx?.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n\n /*:: invariant(typeParameters) */\n throw this.raise(\n typeParameters.start,\n FlowErrors.UnexpectedTokenAfterTypeParameter,\n );\n }\n\n return super.parseMaybeAssign(\n refExpressionErrors,\n afterLeftParse,\n refNeedsArrowPos,\n );\n }\n\n // handle return types for arrow functions\n parseArrow(node: N.ArrowFunctionExpression): ?N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n const result = this.tryParse(() => {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n\n const typeNode = this.startNode();\n\n [\n // $FlowFixMe (destructuring not supported yet)\n typeNode.typeAnnotation,\n // $FlowFixMe (destructuring not supported yet)\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n if (this.canInsertSemicolon()) this.unexpected();\n if (!this.match(tt.arrow)) this.unexpected();\n\n return typeNode;\n });\n\n if (result.thrown) return null;\n /*:: invariant(result.node) */\n\n if (result.error) this.state = result.failState;\n\n // assign after it is clear it is an arrow\n node.returnType = result.node.typeAnnotation\n ? this.finishNode(result.node, \"TypeAnnotation\")\n : null;\n }\n\n return super.parseArrow(node);\n }\n\n shouldParseArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseArrow();\n }\n\n setArrowFunctionParameters(\n node: N.ArrowFunctionExpression,\n params: N.Expression[],\n ): void {\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n node.params = params;\n } else {\n super.setArrowFunctionParameters(node, params);\n }\n }\n\n checkParams(\n node: N.Function,\n allowDuplicates: boolean,\n isArrowFunction: ?boolean,\n ): void {\n if (\n isArrowFunction &&\n this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1\n ) {\n return;\n }\n\n return super.checkParams(...arguments);\n }\n\n parseParenAndDistinguishExpression(canBeArrow: boolean): N.Expression {\n return super.parseParenAndDistinguishExpression(\n canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1,\n );\n }\n\n parseSubscripts(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls?: ?boolean,\n ): N.Expression {\n if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.state.noArrowAt.indexOf(startPos) !== -1\n ) {\n this.next();\n\n const node = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n node.arguments = this.parseCallExpressionArguments(tt.parenR, false);\n base = this.finishNode(node, \"CallExpression\");\n } else if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.isRelational(\"<\")\n ) {\n const state = this.state.clone();\n const arrow = this.tryParse(\n abort =>\n this.parseAsyncArrowWithTypeParameters(startPos, startLoc) ||\n abort(),\n state,\n );\n\n if (!arrow.error && !arrow.aborted) return arrow.node;\n\n const result = this.tryParse(\n () => super.parseSubscripts(base, startPos, startLoc, noCalls),\n state,\n );\n\n if (result.node && !result.error) return result.node;\n\n if (arrow.node) {\n this.state = arrow.failState;\n return arrow.node;\n }\n\n if (result.node) {\n this.state = result.failState;\n return result.node;\n }\n\n throw arrow.error || result.error;\n }\n\n return super.parseSubscripts(base, startPos, startLoc, noCalls);\n }\n\n parseSubscript(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls: ?boolean,\n subscriptState: N.ParseSubscriptState,\n ): N.Expression {\n if (this.match(tt.questionDot) && this.isLookaheadToken_lt()) {\n subscriptState.optionalChainMember = true;\n if (noCalls) {\n subscriptState.stop = true;\n return base;\n }\n this.next();\n const node: N.OptionalCallExpression = this.startNodeAt(\n startPos,\n startLoc,\n );\n node.callee = base;\n node.typeArguments = this.flowParseTypeParameterInstantiation();\n this.expect(tt.parenL);\n // $FlowFixMe\n node.arguments = this.parseCallExpressionArguments(tt.parenR, false);\n node.optional = true;\n return this.finishCallExpression(node, /* optional */ true);\n } else if (\n !noCalls &&\n this.shouldParseTypes() &&\n this.isRelational(\"<\")\n ) {\n const node = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n\n const result = this.tryParse(() => {\n node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();\n this.expect(tt.parenL);\n node.arguments = this.parseCallExpressionArguments(tt.parenR, false);\n if (subscriptState.optionalChainMember) node.optional = false;\n return this.finishCallExpression(\n node,\n subscriptState.optionalChainMember,\n );\n });\n\n if (result.node) {\n if (result.error) this.state = result.failState;\n return result.node;\n }\n }\n\n return super.parseSubscript(\n base,\n startPos,\n startLoc,\n noCalls,\n subscriptState,\n );\n }\n\n parseNewArguments(node: N.NewExpression): void {\n let targs = null;\n if (this.shouldParseTypes() && this.isRelational(\"<\")) {\n targs = this.tryParse(() =>\n this.flowParseTypeParameterInstantiationCallOrNew(),\n ).node;\n }\n node.typeArguments = targs;\n\n super.parseNewArguments(node);\n }\n\n parseAsyncArrowWithTypeParameters(\n startPos: number,\n startLoc: Position,\n ): ?N.ArrowFunctionExpression {\n const node = this.startNodeAt(startPos, startLoc);\n this.parseFunctionParams(node);\n if (!this.parseArrow(node)) return;\n return this.parseArrowExpression(\n node,\n /* params */ undefined,\n /* isAsync */ true,\n );\n }\n\n readToken_mult_modulo(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.asterisk &&\n next === charCodes.slash &&\n this.state.hasFlowComment\n ) {\n this.state.hasFlowComment = false;\n this.state.pos += 2;\n this.nextToken();\n return;\n }\n\n super.readToken_mult_modulo(code);\n }\n\n readToken_pipe_amp(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.verticalBar &&\n next === charCodes.rightCurlyBrace\n ) {\n // '|}'\n this.finishOp(tt.braceBarR, 2);\n return;\n }\n\n super.readToken_pipe_amp(code);\n }\n\n parseTopLevel(file: N.File, program: N.Program): N.File {\n const fileNode = super.parseTopLevel(file, program);\n if (this.state.hasFlowComment) {\n this.raise(this.state.pos, FlowErrors.UnterminatedFlowComment);\n }\n return fileNode;\n }\n\n skipBlockComment(): void {\n if (this.hasPlugin(\"flowComments\") && this.skipFlowComment()) {\n if (this.state.hasFlowComment) {\n this.unexpected(null, FlowErrors.NestedFlowComment);\n }\n this.hasFlowCommentCompletion();\n this.state.pos += this.skipFlowComment();\n this.state.hasFlowComment = true;\n return;\n }\n\n if (this.state.hasFlowComment) {\n const end = this.input.indexOf(\"*-/\", (this.state.pos += 2));\n if (end === -1) {\n throw this.raise(this.state.pos - 2, Errors.UnterminatedComment);\n }\n this.state.pos = end + 3;\n return;\n }\n\n super.skipBlockComment();\n }\n\n skipFlowComment(): number | boolean {\n const { pos } = this.state;\n let shiftToFirstNonWhiteSpace = 2;\n while (\n [charCodes.space, charCodes.tab].includes(\n this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace),\n )\n ) {\n shiftToFirstNonWhiteSpace++;\n }\n\n const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);\n const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);\n\n if (ch2 === charCodes.colon && ch3 === charCodes.colon) {\n return shiftToFirstNonWhiteSpace + 2; // check for /*::\n }\n if (\n this.input.slice(\n shiftToFirstNonWhiteSpace + pos,\n shiftToFirstNonWhiteSpace + pos + 12,\n ) === \"flow-include\"\n ) {\n return shiftToFirstNonWhiteSpace + 12; // check for /*flow-include\n }\n if (ch2 === charCodes.colon && ch3 !== charCodes.colon) {\n return shiftToFirstNonWhiteSpace; // check for /*:, advance up to :\n }\n return false;\n }\n\n hasFlowCommentCompletion(): void {\n const end = this.input.indexOf(\"*/\", this.state.pos);\n if (end === -1) {\n throw this.raise(this.state.pos, Errors.UnterminatedComment);\n }\n }\n\n // Flow enum parsing\n\n flowEnumErrorBooleanMemberNotInitialized(\n pos: number,\n { enumName, memberName }: { enumName: string, memberName: string },\n ): void {\n this.raise(\n pos,\n FlowErrors.EnumBooleanMemberNotInitialized,\n memberName,\n enumName,\n );\n }\n\n flowEnumErrorInvalidMemberName(\n pos: number,\n { enumName, memberName }: { enumName: string, memberName: string },\n ): void {\n const suggestion = memberName[0].toUpperCase() + memberName.slice(1);\n this.raise(\n pos,\n FlowErrors.EnumInvalidMemberName,\n memberName,\n suggestion,\n enumName,\n );\n }\n\n flowEnumErrorDuplicateMemberName(\n pos: number,\n { enumName, memberName }: { enumName: string, memberName: string },\n ): void {\n this.raise(pos, FlowErrors.EnumDuplicateMemberName, memberName, enumName);\n }\n\n flowEnumErrorInconsistentMemberValues(\n pos: number,\n { enumName }: { enumName: string },\n ): void {\n this.raise(pos, FlowErrors.EnumInconsistentMemberValues, enumName);\n }\n\n flowEnumErrorInvalidExplicitType(\n pos: number,\n {\n enumName,\n suppliedType,\n }: { enumName: string, suppliedType: null | string },\n ) {\n return this.raise(\n pos,\n suppliedType === null\n ? FlowErrors.EnumInvalidExplicitTypeUnknownSupplied\n : FlowErrors.EnumInvalidExplicitType,\n enumName,\n suppliedType,\n );\n }\n\n flowEnumErrorInvalidMemberInitializer(\n pos: number,\n { enumName, explicitType, memberName }: EnumContext,\n ) {\n let message = null;\n switch (explicitType) {\n case \"boolean\":\n case \"number\":\n case \"string\":\n message = FlowErrors.EnumInvalidMemberInitializerPrimaryType;\n break;\n case \"symbol\":\n message = FlowErrors.EnumInvalidMemberInitializerSymbolType;\n break;\n default:\n // null\n message = FlowErrors.EnumInvalidMemberInitializerUnknownType;\n }\n return this.raise(pos, message, enumName, memberName, explicitType);\n }\n\n flowEnumErrorNumberMemberNotInitialized(\n pos: number,\n { enumName, memberName }: { enumName: string, memberName: string },\n ): void {\n this.raise(\n pos,\n FlowErrors.EnumNumberMemberNotInitialized,\n enumName,\n memberName,\n );\n }\n\n flowEnumErrorStringMemberInconsistentlyInitailized(\n pos: number,\n { enumName }: { enumName: string },\n ): void {\n this.raise(\n pos,\n FlowErrors.EnumStringMemberInconsistentlyInitailized,\n enumName,\n );\n }\n\n flowEnumMemberInit(): EnumMemberInit {\n const startPos = this.state.start;\n const endOfInit = () => this.match(tt.comma) || this.match(tt.braceR);\n switch (this.state.type) {\n case tt.num: {\n const literal = this.parseLiteral(this.state.value, \"NumericLiteral\");\n if (endOfInit()) {\n return { type: \"number\", pos: literal.start, value: literal };\n }\n return { type: \"invalid\", pos: startPos };\n }\n case tt.string: {\n const literal = this.parseLiteral(this.state.value, \"StringLiteral\");\n if (endOfInit()) {\n return { type: \"string\", pos: literal.start, value: literal };\n }\n return { type: \"invalid\", pos: startPos };\n }\n case tt._true:\n case tt._false: {\n const literal = this.parseBooleanLiteral();\n if (endOfInit()) {\n return {\n type: \"boolean\",\n pos: literal.start,\n value: literal,\n };\n }\n return { type: \"invalid\", pos: startPos };\n }\n default:\n return { type: \"invalid\", pos: startPos };\n }\n }\n\n flowEnumMemberRaw(): { id: N.Node, init: EnumMemberInit } {\n const pos = this.state.start;\n const id = this.parseIdentifier(true);\n const init = this.eat(tt.eq)\n ? this.flowEnumMemberInit()\n : { type: \"none\", pos };\n return { id, init };\n }\n\n flowEnumCheckExplicitTypeMismatch(\n pos: number,\n context: EnumContext,\n expectedType: EnumExplicitType,\n ): void {\n const { explicitType } = context;\n if (explicitType === null) {\n return;\n }\n if (explicitType !== expectedType) {\n this.flowEnumErrorInvalidMemberInitializer(pos, context);\n }\n }\n\n flowEnumMembers({\n enumName,\n explicitType,\n }: {\n enumName: string,\n explicitType: EnumExplicitType,\n }): {|\n booleanMembers: Array,\n numberMembers: Array,\n stringMembers: Array,\n defaultedMembers: Array,\n |} {\n const seenNames = new Set();\n const members = {\n booleanMembers: [],\n numberMembers: [],\n stringMembers: [],\n defaultedMembers: [],\n };\n while (!this.match(tt.braceR)) {\n const memberNode = this.startNode();\n const { id, init } = this.flowEnumMemberRaw();\n const memberName = id.name;\n if (memberName === \"\") {\n continue;\n }\n if (/^[a-z]/.test(memberName)) {\n this.flowEnumErrorInvalidMemberName(id.start, {\n enumName,\n memberName,\n });\n }\n if (seenNames.has(memberName)) {\n this.flowEnumErrorDuplicateMemberName(id.start, {\n enumName,\n memberName,\n });\n }\n seenNames.add(memberName);\n const context = { enumName, explicitType, memberName };\n memberNode.id = id;\n switch (init.type) {\n case \"boolean\": {\n this.flowEnumCheckExplicitTypeMismatch(\n init.pos,\n context,\n \"boolean\",\n );\n memberNode.init = init.value;\n members.booleanMembers.push(\n this.finishNode(memberNode, \"EnumBooleanMember\"),\n );\n break;\n }\n case \"number\": {\n this.flowEnumCheckExplicitTypeMismatch(init.pos, context, \"number\");\n memberNode.init = init.value;\n members.numberMembers.push(\n this.finishNode(memberNode, \"EnumNumberMember\"),\n );\n break;\n }\n case \"string\": {\n this.flowEnumCheckExplicitTypeMismatch(init.pos, context, \"string\");\n memberNode.init = init.value;\n members.stringMembers.push(\n this.finishNode(memberNode, \"EnumStringMember\"),\n );\n break;\n }\n case \"invalid\": {\n throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context);\n }\n case \"none\": {\n switch (explicitType) {\n case \"boolean\":\n this.flowEnumErrorBooleanMemberNotInitialized(\n init.pos,\n context,\n );\n break;\n case \"number\":\n this.flowEnumErrorNumberMemberNotInitialized(init.pos, context);\n break;\n default:\n members.defaultedMembers.push(\n this.finishNode(memberNode, \"EnumDefaultedMember\"),\n );\n }\n }\n }\n\n if (!this.match(tt.braceR)) {\n this.expect(tt.comma);\n }\n }\n return members;\n }\n\n flowEnumStringMembers(\n initializedMembers: Array,\n defaultedMembers: Array,\n { enumName }: { enumName: string },\n ): Array {\n if (initializedMembers.length === 0) {\n return defaultedMembers;\n } else if (defaultedMembers.length === 0) {\n return initializedMembers;\n } else if (defaultedMembers.length > initializedMembers.length) {\n for (const member of initializedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(\n member.start,\n { enumName },\n );\n }\n return defaultedMembers;\n } else {\n for (const member of defaultedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(\n member.start,\n { enumName },\n );\n }\n return initializedMembers;\n }\n }\n\n flowEnumParseExplicitType({\n enumName,\n }: {\n enumName: string,\n }): EnumExplicitType {\n if (this.eatContextual(\"of\")) {\n if (!this.match(tt.name)) {\n throw this.flowEnumErrorInvalidExplicitType(this.state.start, {\n enumName,\n suppliedType: null,\n });\n }\n\n const { value } = this.state;\n this.next();\n\n if (\n value !== \"boolean\" &&\n value !== \"number\" &&\n value !== \"string\" &&\n value !== \"symbol\"\n ) {\n this.flowEnumErrorInvalidExplicitType(this.state.start, {\n enumName,\n suppliedType: value,\n });\n }\n\n return value;\n }\n return null;\n }\n\n flowEnumBody(node: N.Node, { enumName, nameLoc }): N.Node {\n const explicitType = this.flowEnumParseExplicitType({ enumName });\n this.expect(tt.braceL);\n const members = this.flowEnumMembers({ enumName, explicitType });\n\n switch (explicitType) {\n case \"boolean\":\n node.explicitType = true;\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n case \"number\":\n node.explicitType = true;\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n case \"string\":\n node.explicitType = true;\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n case \"symbol\":\n node.members = members.defaultedMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumSymbolBody\");\n default: {\n // `explicitType` is `null`\n const empty = () => {\n node.members = [];\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n };\n node.explicitType = false;\n\n const boolsLen = members.booleanMembers.length;\n const numsLen = members.numberMembers.length;\n const strsLen = members.stringMembers.length;\n const defaultedLen = members.defaultedMembers.length;\n\n if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {\n return empty();\n } else if (!boolsLen && !numsLen) {\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorBooleanMemberNotInitialized(member.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorNumberMemberNotInitialized(member.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n } else {\n this.flowEnumErrorInconsistentMemberValues(nameLoc, { enumName });\n return empty();\n }\n }\n }\n }\n\n flowParseEnumDeclaration(node: N.Node): N.Node {\n const id = this.parseIdentifier();\n node.id = id;\n node.body = this.flowEnumBody(this.startNode(), {\n enumName: id.name,\n nameLoc: id.start,\n });\n return this.finishNode(node, \"EnumDeclaration\");\n }\n\n updateContext(prevType: TokenType): void {\n if (\n this.match(tt.name) &&\n this.state.value === \"of\" &&\n prevType === tt.name &&\n this.input.slice(this.state.lastTokStart, this.state.lastTokEnd) ===\n \"interface\"\n ) {\n this.state.exprAllowed = false;\n } else {\n super.updateContext(prevType);\n }\n }\n\n // check if the next token is a tt.relation(\"<\")\n isLookaheadToken_lt(): boolean {\n const next = this.nextTokenStart();\n if (this.input.charCodeAt(next) === charCodes.lessThan) {\n const afterNext = this.input.charCodeAt(next + 1);\n return (\n afterNext !== charCodes.lessThan && afterNext !== charCodes.equalsTo\n );\n }\n return false;\n }\n\n maybeUnwrapTypeCastExpression(node: N.Node) {\n return node.type === \"TypeCastExpression\" ? node.expression : node;\n }\n };\n","// @flow\n\nconst entities: { [name: string]: string } = {\n quot: \"\\u0022\",\n amp: \"&\",\n apos: \"\\u0027\",\n lt: \"<\",\n gt: \">\",\n nbsp: \"\\u00A0\",\n iexcl: \"\\u00A1\",\n cent: \"\\u00A2\",\n pound: \"\\u00A3\",\n curren: \"\\u00A4\",\n yen: \"\\u00A5\",\n brvbar: \"\\u00A6\",\n sect: \"\\u00A7\",\n uml: \"\\u00A8\",\n copy: \"\\u00A9\",\n ordf: \"\\u00AA\",\n laquo: \"\\u00AB\",\n not: \"\\u00AC\",\n shy: \"\\u00AD\",\n reg: \"\\u00AE\",\n macr: \"\\u00AF\",\n deg: \"\\u00B0\",\n plusmn: \"\\u00B1\",\n sup2: \"\\u00B2\",\n sup3: \"\\u00B3\",\n acute: \"\\u00B4\",\n micro: \"\\u00B5\",\n para: \"\\u00B6\",\n middot: \"\\u00B7\",\n cedil: \"\\u00B8\",\n sup1: \"\\u00B9\",\n ordm: \"\\u00BA\",\n raquo: \"\\u00BB\",\n frac14: \"\\u00BC\",\n frac12: \"\\u00BD\",\n frac34: \"\\u00BE\",\n iquest: \"\\u00BF\",\n Agrave: \"\\u00C0\",\n Aacute: \"\\u00C1\",\n Acirc: \"\\u00C2\",\n Atilde: \"\\u00C3\",\n Auml: \"\\u00C4\",\n Aring: \"\\u00C5\",\n AElig: \"\\u00C6\",\n Ccedil: \"\\u00C7\",\n Egrave: \"\\u00C8\",\n Eacute: \"\\u00C9\",\n Ecirc: \"\\u00CA\",\n Euml: \"\\u00CB\",\n Igrave: \"\\u00CC\",\n Iacute: \"\\u00CD\",\n Icirc: \"\\u00CE\",\n Iuml: \"\\u00CF\",\n ETH: \"\\u00D0\",\n Ntilde: \"\\u00D1\",\n Ograve: \"\\u00D2\",\n Oacute: \"\\u00D3\",\n Ocirc: \"\\u00D4\",\n Otilde: \"\\u00D5\",\n Ouml: \"\\u00D6\",\n times: \"\\u00D7\",\n Oslash: \"\\u00D8\",\n Ugrave: \"\\u00D9\",\n Uacute: \"\\u00DA\",\n Ucirc: \"\\u00DB\",\n Uuml: \"\\u00DC\",\n Yacute: \"\\u00DD\",\n THORN: \"\\u00DE\",\n szlig: \"\\u00DF\",\n agrave: \"\\u00E0\",\n aacute: \"\\u00E1\",\n acirc: \"\\u00E2\",\n atilde: \"\\u00E3\",\n auml: \"\\u00E4\",\n aring: \"\\u00E5\",\n aelig: \"\\u00E6\",\n ccedil: \"\\u00E7\",\n egrave: \"\\u00E8\",\n eacute: \"\\u00E9\",\n ecirc: \"\\u00EA\",\n euml: \"\\u00EB\",\n igrave: \"\\u00EC\",\n iacute: \"\\u00ED\",\n icirc: \"\\u00EE\",\n iuml: \"\\u00EF\",\n eth: \"\\u00F0\",\n ntilde: \"\\u00F1\",\n ograve: \"\\u00F2\",\n oacute: \"\\u00F3\",\n ocirc: \"\\u00F4\",\n otilde: \"\\u00F5\",\n ouml: \"\\u00F6\",\n divide: \"\\u00F7\",\n oslash: \"\\u00F8\",\n ugrave: \"\\u00F9\",\n uacute: \"\\u00FA\",\n ucirc: \"\\u00FB\",\n uuml: \"\\u00FC\",\n yacute: \"\\u00FD\",\n thorn: \"\\u00FE\",\n yuml: \"\\u00FF\",\n OElig: \"\\u0152\",\n oelig: \"\\u0153\",\n Scaron: \"\\u0160\",\n scaron: \"\\u0161\",\n Yuml: \"\\u0178\",\n fnof: \"\\u0192\",\n circ: \"\\u02C6\",\n tilde: \"\\u02DC\",\n Alpha: \"\\u0391\",\n Beta: \"\\u0392\",\n Gamma: \"\\u0393\",\n Delta: \"\\u0394\",\n Epsilon: \"\\u0395\",\n Zeta: \"\\u0396\",\n Eta: \"\\u0397\",\n Theta: \"\\u0398\",\n Iota: \"\\u0399\",\n Kappa: \"\\u039A\",\n Lambda: \"\\u039B\",\n Mu: \"\\u039C\",\n Nu: \"\\u039D\",\n Xi: \"\\u039E\",\n Omicron: \"\\u039F\",\n Pi: \"\\u03A0\",\n Rho: \"\\u03A1\",\n Sigma: \"\\u03A3\",\n Tau: \"\\u03A4\",\n Upsilon: \"\\u03A5\",\n Phi: \"\\u03A6\",\n Chi: \"\\u03A7\",\n Psi: \"\\u03A8\",\n Omega: \"\\u03A9\",\n alpha: \"\\u03B1\",\n beta: \"\\u03B2\",\n gamma: \"\\u03B3\",\n delta: \"\\u03B4\",\n epsilon: \"\\u03B5\",\n zeta: \"\\u03B6\",\n eta: \"\\u03B7\",\n theta: \"\\u03B8\",\n iota: \"\\u03B9\",\n kappa: \"\\u03BA\",\n lambda: \"\\u03BB\",\n mu: \"\\u03BC\",\n nu: \"\\u03BD\",\n xi: \"\\u03BE\",\n omicron: \"\\u03BF\",\n pi: \"\\u03C0\",\n rho: \"\\u03C1\",\n sigmaf: \"\\u03C2\",\n sigma: \"\\u03C3\",\n tau: \"\\u03C4\",\n upsilon: \"\\u03C5\",\n phi: \"\\u03C6\",\n chi: \"\\u03C7\",\n psi: \"\\u03C8\",\n omega: \"\\u03C9\",\n thetasym: \"\\u03D1\",\n upsih: \"\\u03D2\",\n piv: \"\\u03D6\",\n ensp: \"\\u2002\",\n emsp: \"\\u2003\",\n thinsp: \"\\u2009\",\n zwnj: \"\\u200C\",\n zwj: \"\\u200D\",\n lrm: \"\\u200E\",\n rlm: \"\\u200F\",\n ndash: \"\\u2013\",\n mdash: \"\\u2014\",\n lsquo: \"\\u2018\",\n rsquo: \"\\u2019\",\n sbquo: \"\\u201A\",\n ldquo: \"\\u201C\",\n rdquo: \"\\u201D\",\n bdquo: \"\\u201E\",\n dagger: \"\\u2020\",\n Dagger: \"\\u2021\",\n bull: \"\\u2022\",\n hellip: \"\\u2026\",\n permil: \"\\u2030\",\n prime: \"\\u2032\",\n Prime: \"\\u2033\",\n lsaquo: \"\\u2039\",\n rsaquo: \"\\u203A\",\n oline: \"\\u203E\",\n frasl: \"\\u2044\",\n euro: \"\\u20AC\",\n image: \"\\u2111\",\n weierp: \"\\u2118\",\n real: \"\\u211C\",\n trade: \"\\u2122\",\n alefsym: \"\\u2135\",\n larr: \"\\u2190\",\n uarr: \"\\u2191\",\n rarr: \"\\u2192\",\n darr: \"\\u2193\",\n harr: \"\\u2194\",\n crarr: \"\\u21B5\",\n lArr: \"\\u21D0\",\n uArr: \"\\u21D1\",\n rArr: \"\\u21D2\",\n dArr: \"\\u21D3\",\n hArr: \"\\u21D4\",\n forall: \"\\u2200\",\n part: \"\\u2202\",\n exist: \"\\u2203\",\n empty: \"\\u2205\",\n nabla: \"\\u2207\",\n isin: \"\\u2208\",\n notin: \"\\u2209\",\n ni: \"\\u220B\",\n prod: \"\\u220F\",\n sum: \"\\u2211\",\n minus: \"\\u2212\",\n lowast: \"\\u2217\",\n radic: \"\\u221A\",\n prop: \"\\u221D\",\n infin: \"\\u221E\",\n ang: \"\\u2220\",\n and: \"\\u2227\",\n or: \"\\u2228\",\n cap: \"\\u2229\",\n cup: \"\\u222A\",\n int: \"\\u222B\",\n there4: \"\\u2234\",\n sim: \"\\u223C\",\n cong: \"\\u2245\",\n asymp: \"\\u2248\",\n ne: \"\\u2260\",\n equiv: \"\\u2261\",\n le: \"\\u2264\",\n ge: \"\\u2265\",\n sub: \"\\u2282\",\n sup: \"\\u2283\",\n nsub: \"\\u2284\",\n sube: \"\\u2286\",\n supe: \"\\u2287\",\n oplus: \"\\u2295\",\n otimes: \"\\u2297\",\n perp: \"\\u22A5\",\n sdot: \"\\u22C5\",\n lceil: \"\\u2308\",\n rceil: \"\\u2309\",\n lfloor: \"\\u230A\",\n rfloor: \"\\u230B\",\n lang: \"\\u2329\",\n rang: \"\\u232A\",\n loz: \"\\u25CA\",\n spades: \"\\u2660\",\n clubs: \"\\u2663\",\n hearts: \"\\u2665\",\n diams: \"\\u2666\",\n};\nexport default entities;\n","// @flow\n\n// Error messages are colocated with the plugin.\n/* eslint-disable @babel/development-internal/dry-error-messages */\n\nimport * as charCodes from \"charcodes\";\n\nimport XHTMLEntities from \"./xhtml\";\nimport type Parser from \"../../parser\";\nimport type { ExpressionErrors } from \"../../parser/util\";\nimport { TokenType, types as tt } from \"../../tokenizer/types\";\nimport { TokContext, types as tc } from \"../../tokenizer/context\";\nimport * as N from \"../../types\";\nimport { isIdentifierChar, isIdentifierStart } from \"../../util/identifier\";\nimport type { Position } from \"../../util/location\";\nimport { isNewLine } from \"../../util/whitespace\";\nimport { Errors } from \"../../parser/error\";\n\nconst HEX_NUMBER = /^[\\da-fA-F]+$/;\nconst DECIMAL_NUMBER = /^\\d+$/;\n\nconst JsxErrors = Object.freeze({\n AttributeIsEmpty:\n \"JSX attributes must only be assigned a non-empty expression\",\n MissingClosingTagFragment: \"Expected corresponding JSX closing tag for <>\",\n MissingClosingTagElement: \"Expected corresponding JSX closing tag for <%0>\",\n UnexpectedSequenceExpression:\n \"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?\",\n UnsupportedJsxValue:\n \"JSX value should be either an expression or a quoted JSX text\",\n UnterminatedJsxContent: \"Unterminated JSX contents\",\n UnwrappedAdjacentJSXElements:\n \"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?\",\n});\n\n// Be aware that this file is always executed and not only when the plugin is enabled.\n// Therefore this contexts and tokens do always exist.\ntc.j_oTag = new TokContext(\"...\", true, true);\n\ntt.jsxName = new TokenType(\"jsxName\");\ntt.jsxText = new TokenType(\"jsxText\", { beforeExpr: true });\ntt.jsxTagStart = new TokenType(\"jsxTagStart\", { startsExpr: true });\ntt.jsxTagEnd = new TokenType(\"jsxTagEnd\");\n\ntt.jsxTagStart.updateContext = function () {\n this.state.context.push(tc.j_expr); // treat as beginning of JSX expression\n this.state.context.push(tc.j_oTag); // start opening tag context\n this.state.exprAllowed = false;\n};\n\ntt.jsxTagEnd.updateContext = function (prevType) {\n const out = this.state.context.pop();\n if ((out === tc.j_oTag && prevType === tt.slash) || out === tc.j_cTag) {\n this.state.context.pop();\n this.state.exprAllowed = this.curContext() === tc.j_expr;\n } else {\n this.state.exprAllowed = true;\n }\n};\n\nfunction isFragment(object: ?N.JSXElement): boolean {\n return object\n ? object.type === \"JSXOpeningFragment\" ||\n object.type === \"JSXClosingFragment\"\n : false;\n}\n\n// Transforms JSX element name to string.\n\nfunction getQualifiedJSXName(\n object: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression,\n): string {\n if (object.type === \"JSXIdentifier\") {\n return object.name;\n }\n\n if (object.type === \"JSXNamespacedName\") {\n return object.namespace.name + \":\" + object.name.name;\n }\n\n if (object.type === \"JSXMemberExpression\") {\n return (\n getQualifiedJSXName(object.object) +\n \".\" +\n getQualifiedJSXName(object.property)\n );\n }\n\n // istanbul ignore next\n throw new Error(\"Node had unexpected type: \" + object.type);\n}\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n // Reads inline JSX contents token.\n\n jsxReadToken(): void {\n let out = \"\";\n let chunkStart = this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(this.state.start, JsxErrors.UnterminatedJsxContent);\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n\n switch (ch) {\n case charCodes.lessThan:\n case charCodes.leftCurlyBrace:\n if (this.state.pos === this.state.start) {\n if (ch === charCodes.lessThan && this.state.exprAllowed) {\n ++this.state.pos;\n return this.finishToken(tt.jsxTagStart);\n }\n return super.getTokenFromCode(ch);\n }\n out += this.input.slice(chunkStart, this.state.pos);\n return this.finishToken(tt.jsxText, out);\n\n case charCodes.ampersand:\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n break;\n\n default:\n if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(true);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n }\n }\n\n jsxReadNewLine(normalizeCRLF: boolean): string {\n const ch = this.input.charCodeAt(this.state.pos);\n let out;\n ++this.state.pos;\n if (\n ch === charCodes.carriageReturn &&\n this.input.charCodeAt(this.state.pos) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n out = normalizeCRLF ? \"\\n\" : \"\\r\\n\";\n } else {\n out = String.fromCharCode(ch);\n }\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n\n return out;\n }\n\n jsxReadString(quote: number): void {\n let out = \"\";\n let chunkStart = ++this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(this.state.start, Errors.UnterminatedString);\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n if (ch === quote) break;\n if (ch === charCodes.ampersand) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(false);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n out += this.input.slice(chunkStart, this.state.pos++);\n return this.finishToken(tt.string, out);\n }\n\n jsxReadEntity(): string {\n let str = \"\";\n let count = 0;\n let entity;\n let ch = this.input[this.state.pos];\n\n const startPos = ++this.state.pos;\n while (this.state.pos < this.length && count++ < 10) {\n ch = this.input[this.state.pos++];\n if (ch === \";\") {\n if (str[0] === \"#\") {\n if (str[1] === \"x\") {\n str = str.substr(2);\n if (HEX_NUMBER.test(str)) {\n entity = String.fromCodePoint(parseInt(str, 16));\n }\n } else {\n str = str.substr(1);\n if (DECIMAL_NUMBER.test(str)) {\n entity = String.fromCodePoint(parseInt(str, 10));\n }\n }\n } else {\n entity = XHTMLEntities[str];\n }\n break;\n }\n str += ch;\n }\n if (!entity) {\n this.state.pos = startPos;\n return \"&\";\n }\n return entity;\n }\n\n // Read a JSX identifier (valid tag or attribute name).\n //\n // Optimized version since JSX identifiers can\"t contain\n // escape characters and so can be read as single slice.\n // Also assumes that first character was already checked\n // by isIdentifierStart in readToken.\n\n jsxReadWord(): void {\n let ch;\n const start = this.state.pos;\n do {\n ch = this.input.charCodeAt(++this.state.pos);\n } while (isIdentifierChar(ch) || ch === charCodes.dash);\n return this.finishToken(\n tt.jsxName,\n this.input.slice(start, this.state.pos),\n );\n }\n\n // Parse next token as JSX identifier\n\n jsxParseIdentifier(): N.JSXIdentifier {\n const node = this.startNode();\n if (this.match(tt.jsxName)) {\n node.name = this.state.value;\n } else if (this.state.type.keyword) {\n node.name = this.state.type.keyword;\n } else {\n this.unexpected();\n }\n this.next();\n return this.finishNode(node, \"JSXIdentifier\");\n }\n\n // Parse namespaced identifier.\n\n jsxParseNamespacedName(): N.JSXNamespacedName {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const name = this.jsxParseIdentifier();\n if (!this.eat(tt.colon)) return name;\n\n const node = this.startNodeAt(startPos, startLoc);\n node.namespace = name;\n node.name = this.jsxParseIdentifier();\n return this.finishNode(node, \"JSXNamespacedName\");\n }\n\n // Parses element name in any form - namespaced, member\n // or single identifier.\n\n jsxParseElementName():\n | N.JSXIdentifier\n | N.JSXNamespacedName\n | N.JSXMemberExpression {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n let node = this.jsxParseNamespacedName();\n if (node.type === \"JSXNamespacedName\") {\n return node;\n }\n while (this.eat(tt.dot)) {\n const newNode = this.startNodeAt(startPos, startLoc);\n newNode.object = node;\n newNode.property = this.jsxParseIdentifier();\n node = this.finishNode(newNode, \"JSXMemberExpression\");\n }\n return node;\n }\n\n // Parses any type of JSX attribute value.\n\n jsxParseAttributeValue(): N.Expression {\n let node;\n switch (this.state.type) {\n case tt.braceL:\n node = this.startNode();\n this.next();\n node = this.jsxParseExpressionContainer(node);\n if (node.expression.type === \"JSXEmptyExpression\") {\n this.raise(node.start, JsxErrors.AttributeIsEmpty);\n }\n return node;\n\n case tt.jsxTagStart:\n case tt.string:\n return this.parseExprAtom();\n\n default:\n throw this.raise(this.state.start, JsxErrors.UnsupportedJsxValue);\n }\n }\n\n // JSXEmptyExpression is unique type since it doesn't actually parse anything,\n // and so it should start at the end of last read token (left brace) and finish\n // at the beginning of the next one (right brace).\n\n jsxParseEmptyExpression(): N.JSXEmptyExpression {\n const node = this.startNodeAt(\n this.state.lastTokEnd,\n this.state.lastTokEndLoc,\n );\n return this.finishNodeAt(\n node,\n \"JSXEmptyExpression\",\n this.state.start,\n this.state.startLoc,\n );\n }\n\n // Parse JSX spread child\n\n jsxParseSpreadChild(node: N.JSXSpreadChild): N.JSXSpreadChild {\n this.next(); // ellipsis\n node.expression = this.parseExpression();\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"JSXSpreadChild\");\n }\n\n // Parses JSX expression enclosed into curly brackets.\n\n jsxParseExpressionContainer(\n node: N.JSXExpressionContainer,\n ): N.JSXExpressionContainer {\n if (this.match(tt.braceR)) {\n node.expression = this.jsxParseEmptyExpression();\n } else {\n const expression = this.parseExpression();\n\n if (process.env.BABEL_8_BREAKING) {\n if (\n expression.type === \"SequenceExpression\" &&\n !expression.extra?.parenthesized\n ) {\n this.raise(\n expression.expressions[1].start,\n JsxErrors.UnexpectedSequenceExpression,\n );\n }\n }\n\n node.expression = expression;\n }\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"JSXExpressionContainer\");\n }\n\n // Parses following JSX attribute name-value pair.\n\n jsxParseAttribute(): N.JSXAttribute {\n const node = this.startNode();\n if (this.eat(tt.braceL)) {\n this.expect(tt.ellipsis);\n node.argument = this.parseMaybeAssignAllowIn();\n this.expect(tt.braceR);\n return this.finishNode(node, \"JSXSpreadAttribute\");\n }\n node.name = this.jsxParseNamespacedName();\n node.value = this.eat(tt.eq) ? this.jsxParseAttributeValue() : null;\n return this.finishNode(node, \"JSXAttribute\");\n }\n\n // Parses JSX opening tag starting after \"<\".\n\n jsxParseOpeningElementAt(\n startPos: number,\n startLoc: Position,\n ): N.JSXOpeningElement {\n const node = this.startNodeAt(startPos, startLoc);\n if (this.match(tt.jsxTagEnd)) {\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXOpeningFragment\");\n }\n node.name = this.jsxParseElementName();\n return this.jsxParseOpeningElementAfterName(node);\n }\n\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement {\n const attributes: N.JSXAttribute[] = [];\n while (!this.match(tt.slash) && !this.match(tt.jsxTagEnd)) {\n attributes.push(this.jsxParseAttribute());\n }\n node.attributes = attributes;\n node.selfClosing = this.eat(tt.slash);\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXOpeningElement\");\n }\n\n // Parses JSX closing tag starting after \" JSX open tag -> ... anymore\n this.state.context.push(tc.j_cTag); // reconsider as closing tag context\n this.state.exprAllowed = false;\n } else {\n return super.updateContext(prevType);\n }\n }\n };\n","// @flow\nimport {\n SCOPE_ARROW,\n SCOPE_DIRECT_SUPER,\n SCOPE_FUNCTION,\n SCOPE_SIMPLE_CATCH,\n SCOPE_SUPER,\n SCOPE_PROGRAM,\n SCOPE_VAR,\n SCOPE_CLASS,\n BIND_SCOPE_FUNCTION,\n BIND_SCOPE_VAR,\n BIND_SCOPE_LEXICAL,\n BIND_KIND_VALUE,\n type ScopeFlags,\n type BindingTypes,\n} from \"./scopeflags\";\nimport * as N from \"../types\";\nimport { Errors } from \"../parser/error\";\n\n// Start an AST node, attaching a start offset.\nexport class Scope {\n flags: ScopeFlags;\n // A list of var-declared names in the current lexical scope\n var: string[] = [];\n // A list of lexically-declared names in the current lexical scope\n lexical: string[] = [];\n // A list of lexically-declared FunctionDeclaration names in the current lexical scope\n functions: string[] = [];\n\n constructor(flags: ScopeFlags) {\n this.flags = flags;\n }\n}\n\ntype raiseFunction = (number, string, ...any) => void;\n\n// The functions in this module keep track of declared variables in the\n// current scope in order to detect duplicate variable names.\nexport default class ScopeHandler {\n scopeStack: Array = [];\n declare raise: raiseFunction;\n declare inModule: boolean;\n undefinedExports: Map = new Map();\n undefinedPrivateNames: Map = new Map();\n\n constructor(raise: raiseFunction, inModule: boolean) {\n this.raise = raise;\n this.inModule = inModule;\n }\n\n get inFunction() {\n return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;\n }\n get allowSuper() {\n return (this.currentThisScope().flags & SCOPE_SUPER) > 0;\n }\n get allowDirectSuper() {\n return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0;\n }\n get inClass() {\n return (this.currentThisScope().flags & SCOPE_CLASS) > 0;\n }\n get inNonArrowFunction() {\n return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0;\n }\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n\n createScope(flags: ScopeFlags): Scope {\n return new Scope(flags);\n }\n // This method will be overwritten by subclasses\n /*:: +createScope: (flags: ScopeFlags) => IScope; */\n\n enter(flags: ScopeFlags) {\n this.scopeStack.push(this.createScope(flags));\n }\n\n exit() {\n this.scopeStack.pop();\n }\n\n // The spec says:\n // > At the top level of a function, or script, function declarations are\n // > treated like var declarations rather than like lexical declarations.\n treatFunctionsAsVarInScope(scope: IScope): boolean {\n return !!(\n scope.flags & SCOPE_FUNCTION ||\n (!this.inModule && scope.flags & SCOPE_PROGRAM)\n );\n }\n\n declareName(name: string, bindingType: BindingTypes, pos: number) {\n let scope = this.currentScope();\n if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n scope.functions.push(name);\n } else {\n scope.lexical.push(name);\n }\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BIND_SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n scope.var.push(name);\n this.maybeExportDefined(scope, name);\n\n if (scope.flags & SCOPE_VAR) break;\n }\n }\n if (this.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n maybeExportDefined(scope: IScope, name: string) {\n if (this.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n checkRedeclarationInScope(\n scope: IScope,\n name: string,\n bindingType: BindingTypes,\n pos: number,\n ) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.raise(pos, Errors.VarRedeclaration, name);\n }\n }\n\n isRedeclaredInScope(\n scope: IScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (!(bindingType & BIND_KIND_VALUE)) return false;\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n return (\n scope.lexical.indexOf(name) > -1 ||\n scope.functions.indexOf(name) > -1 ||\n scope.var.indexOf(name) > -1\n );\n }\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n return (\n scope.lexical.indexOf(name) > -1 ||\n (!this.treatFunctionsAsVarInScope(scope) &&\n scope.var.indexOf(name) > -1)\n );\n }\n\n return (\n (scope.lexical.indexOf(name) > -1 &&\n !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical[0] === name)) ||\n (!this.treatFunctionsAsVarInScope(scope) &&\n scope.functions.indexOf(name) > -1)\n );\n }\n\n checkLocalExport(id: N.Identifier) {\n if (\n this.scopeStack[0].lexical.indexOf(id.name) === -1 &&\n this.scopeStack[0].var.indexOf(id.name) === -1 &&\n // In strict mode, scope.functions will always be empty.\n // Modules are strict by default, but the `scriptMode` option\n // can overwrite this behavior.\n this.scopeStack[0].functions.indexOf(id.name) === -1\n ) {\n this.undefinedExports.set(id.name, id.start);\n }\n }\n\n currentScope(): IScope {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n\n // $FlowIgnore\n currentVarScope(): IScope {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const scope = this.scopeStack[i];\n if (scope.flags & SCOPE_VAR) {\n return scope;\n }\n }\n }\n\n // Could be useful for `arguments`, `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n // $FlowIgnore\n currentThisScope(): IScope {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const scope = this.scopeStack[i];\n if (\n (scope.flags & SCOPE_VAR || scope.flags & SCOPE_CLASS) &&\n !(scope.flags & SCOPE_ARROW)\n ) {\n return scope;\n }\n }\n }\n}\n","// @flow\n\nimport ScopeHandler, { Scope } from \"../../util/scope\";\nimport {\n BIND_KIND_TYPE,\n BIND_FLAGS_TS_ENUM,\n BIND_FLAGS_TS_CONST_ENUM,\n BIND_FLAGS_TS_EXPORT_ONLY,\n BIND_KIND_VALUE,\n BIND_FLAGS_CLASS,\n type ScopeFlags,\n type BindingTypes,\n} from \"../../util/scopeflags\";\nimport * as N from \"../../types\";\n\nclass TypeScriptScope extends Scope {\n types: string[] = [];\n\n // enums (which are also in .types)\n enums: string[] = [];\n\n // const enums (which are also in .enums and .types)\n constEnums: string[] = [];\n\n // classes (which are also in .lexical) and interface (which are also in .types)\n classes: string[] = [];\n\n // namespaces and ambient functions (or classes) are too difficult to track,\n // especially without type analysis.\n // We need to track them anyway, to avoid \"X is not defined\" errors\n // when exporting them.\n exportOnlyBindings: string[] = [];\n}\n\n// See https://github.com/babel/babel/pull/9766#discussion_r268920730 for an\n// explanation of how typescript handles scope.\n\nexport default class TypeScriptScopeHandler extends ScopeHandler {\n createScope(flags: ScopeFlags): TypeScriptScope {\n return new TypeScriptScope(flags);\n }\n\n declareName(name: string, bindingType: BindingTypes, pos: number) {\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {\n this.maybeExportDefined(scope, name);\n scope.exportOnlyBindings.push(name);\n return;\n }\n\n super.declareName(...arguments);\n\n if (bindingType & BIND_KIND_TYPE) {\n if (!(bindingType & BIND_KIND_VALUE)) {\n // \"Value\" bindings have already been registered by the superclass.\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n this.maybeExportDefined(scope, name);\n }\n scope.types.push(name);\n }\n if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.push(name);\n if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.push(name);\n if (bindingType & BIND_FLAGS_CLASS) scope.classes.push(name);\n }\n\n isRedeclaredInScope(\n scope: TypeScriptScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (scope.enums.indexOf(name) > -1) {\n if (bindingType & BIND_FLAGS_TS_ENUM) {\n // Enums can be merged with other enums if they are both\n // const or both non-const.\n const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);\n const wasConst = scope.constEnums.indexOf(name) > -1;\n return isConst !== wasConst;\n }\n return true;\n }\n if (bindingType & BIND_FLAGS_CLASS && scope.classes.indexOf(name) > -1) {\n if (scope.lexical.indexOf(name) > -1) {\n // Classes can be merged with interfaces\n return !!(bindingType & BIND_KIND_VALUE);\n } else {\n // Interface can be merged with other classes or interfaces\n return false;\n }\n }\n if (bindingType & BIND_KIND_TYPE && scope.types.indexOf(name) > -1) {\n return true;\n }\n\n return super.isRedeclaredInScope(...arguments);\n }\n\n checkLocalExport(id: N.Identifier) {\n if (\n this.scopeStack[0].types.indexOf(id.name) === -1 &&\n this.scopeStack[0].exportOnlyBindings.indexOf(id.name) === -1\n ) {\n super.checkLocalExport(id);\n }\n }\n}\n","// @flow\nexport const PARAM = 0b0000, // Initial Parameter flags\n PARAM_YIELD = 0b0001, // track [Yield] production parameter\n PARAM_AWAIT = 0b0010, // track [Await] production parameter\n PARAM_RETURN = 0b0100, // track [Return] production parameter\n PARAM_IN = 0b1000; // track [In] production parameter\n\n// ProductionParameterHandler is a stack fashioned production parameter tracker\n// https://tc39.es/ecma262/#sec-grammar-notation\n// The tracked parameters are defined above.\n//\n// Whenever [+Await]/[+Yield] appears in the right-hand sides of a production,\n// we must enter a new tracking stack. For example when parsing\n//\n// AsyncFunctionDeclaration [Yield, Await]:\n// async [no LineTerminator here] function BindingIdentifier[?Yield, ?Await]\n// ( FormalParameters[~Yield, +Await] ) { AsyncFunctionBody }\n//\n// we must follow such process:\n//\n// 1. parse async keyword\n// 2. parse function keyword\n// 3. parse bindingIdentifier <= inherit current parameters: [?Await]\n// 4. enter new stack with (PARAM_AWAIT)\n// 5. parse formal parameters <= must have [Await] parameter [+Await]\n// 6. parse function body\n// 7. exit current stack\n\nexport type ParamKind =\n | typeof PARAM\n | typeof PARAM_AWAIT\n | typeof PARAM_IN\n | typeof PARAM_RETURN\n | typeof PARAM_YIELD;\n\nexport default class ProductionParameterHandler {\n stacks: Array = [];\n enter(flags: ParamKind) {\n this.stacks.push(flags);\n }\n\n exit() {\n this.stacks.pop();\n }\n\n currentFlags(): ParamKind {\n return this.stacks[this.stacks.length - 1];\n }\n\n get hasAwait(): boolean {\n return (this.currentFlags() & PARAM_AWAIT) > 0;\n }\n\n get hasYield(): boolean {\n return (this.currentFlags() & PARAM_YIELD) > 0;\n }\n\n get hasReturn(): boolean {\n return (this.currentFlags() & PARAM_RETURN) > 0;\n }\n\n get hasIn(): boolean {\n return (this.currentFlags() & PARAM_IN) > 0;\n }\n}\n\nexport function functionFlags(\n isAsync: boolean,\n isGenerator: boolean,\n): ParamKind {\n return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);\n}\n","// @flow\n\n/*:: declare var invariant; */\n\n// Error messages are colocated with the plugin.\n/* eslint-disable @babel/development-internal/dry-error-messages */\n\nimport type { TokenType } from \"../../tokenizer/types\";\nimport type State from \"../../tokenizer/state\";\nimport { types as tt } from \"../../tokenizer/types\";\nimport { types as ct } from \"../../tokenizer/context\";\nimport * as N from \"../../types\";\nimport type { Pos, Position } from \"../../util/location\";\nimport type Parser from \"../../parser\";\nimport {\n type BindingTypes,\n SCOPE_TS_MODULE,\n SCOPE_OTHER,\n BIND_TS_ENUM,\n BIND_TS_CONST_ENUM,\n BIND_TS_TYPE,\n BIND_TS_INTERFACE,\n BIND_TS_AMBIENT,\n BIND_TS_NAMESPACE,\n BIND_CLASS,\n BIND_LEXICAL,\n} from \"../../util/scopeflags\";\nimport TypeScriptScopeHandler from \"./scope\";\nimport * as charCodes from \"charcodes\";\nimport type { ExpressionErrors } from \"../../parser/util\";\nimport { PARAM } from \"../../util/production-parameter\";\nimport { Errors } from \"../../parser/error\";\n\ntype TsModifier =\n | \"readonly\"\n | \"abstract\"\n | \"declare\"\n | \"static\"\n | \"public\"\n | \"private\"\n | \"protected\";\n\nfunction nonNull(x: ?T): T {\n if (x == null) {\n // $FlowIgnore\n throw new Error(`Unexpected ${x} value.`);\n }\n return x;\n}\n\nfunction assert(x: boolean): void {\n if (!x) {\n throw new Error(\"Assert fail\");\n }\n}\n\ntype ParsingContext =\n | \"EnumMembers\"\n | \"HeritageClauseElement\"\n | \"TupleElementTypes\"\n | \"TypeMembers\"\n | \"TypeParametersOrArguments\";\n\nconst TSErrors = Object.freeze({\n ClassMethodHasDeclare: \"Class methods cannot have the 'declare' modifier\",\n ClassMethodHasReadonly: \"Class methods cannot have the 'readonly' modifier\",\n ConstructorHasTypeParameters:\n \"Type parameters cannot appear on a constructor declaration.\",\n DeclareClassFieldHasInitializer:\n \"Initializers are not allowed in ambient contexts.\",\n DeclareFunctionHasImplementation:\n \"An implementation cannot be declared in ambient contexts.\",\n DuplicateModifier: \"Duplicate modifier: '%0'\",\n EmptyHeritageClauseType: \"'%0' list cannot be empty.\",\n EmptyTypeArguments: \"Type argument list cannot be empty.\",\n EmptyTypeParameters: \"Type parameter list cannot be empty.\",\n IndexSignatureHasAbstract:\n \"Index signatures cannot have the 'abstract' modifier\",\n IndexSignatureHasAccessibility:\n \"Index signatures cannot have an accessibility modifier ('%0')\",\n IndexSignatureHasStatic: \"Index signatures cannot have the 'static' modifier\",\n IndexSignatureHasDeclare:\n \"Index signatures cannot have the 'declare' modifier\",\n InvalidTupleMemberLabel:\n \"Tuple members must be labeled with a simple identifier.\",\n MixedLabeledAndUnlabeledElements:\n \"Tuple members must all have names or all not have names.\",\n OptionalTypeBeforeRequired:\n \"A required element cannot follow an optional element.\",\n PatternIsOptional:\n \"A binding pattern parameter cannot be optional in an implementation signature.\",\n PrivateElementHasAbstract:\n \"Private elements cannot have the 'abstract' modifier.\",\n PrivateElementHasAccessibility:\n \"Private elements cannot have an accessibility modifier ('%0')\",\n TypeAnnotationAfterAssign:\n \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`\",\n UnexpectedParameterModifier:\n \"A parameter property is only allowed in a constructor implementation.\",\n UnexpectedReadonly:\n \"'readonly' type modifier is only permitted on array and tuple literal types.\",\n UnexpectedTypeAnnotation: \"Did not expect a type annotation here.\",\n UnexpectedTypeCastInParameter: \"Unexpected type cast in parameter position.\",\n UnsupportedImportTypeArgument:\n \"Argument in a type import must be a string literal\",\n UnsupportedParameterPropertyKind:\n \"A parameter property may not be declared using a binding pattern.\",\n UnsupportedSignatureParameterKind:\n \"Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got %0\",\n});\n\n// Doesn't handle \"void\" or \"null\" because those are keywords, not identifiers.\n// It also doesn't handle \"intrinsic\", since usually it's not a keyword.\nfunction keywordTypeFromName(\n value: string,\n): N.TsKeywordTypeType | typeof undefined {\n switch (value) {\n case \"any\":\n return \"TSAnyKeyword\";\n case \"boolean\":\n return \"TSBooleanKeyword\";\n case \"bigint\":\n return \"TSBigIntKeyword\";\n case \"never\":\n return \"TSNeverKeyword\";\n case \"number\":\n return \"TSNumberKeyword\";\n case \"object\":\n return \"TSObjectKeyword\";\n case \"string\":\n return \"TSStringKeyword\";\n case \"symbol\":\n return \"TSSymbolKeyword\";\n case \"undefined\":\n return \"TSUndefinedKeyword\";\n case \"unknown\":\n return \"TSUnknownKeyword\";\n default:\n return undefined;\n }\n}\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n getScopeHandler(): Class {\n return TypeScriptScopeHandler;\n }\n\n tsIsIdentifier(): boolean {\n // TODO: actually a bit more complex in TypeScript, but shouldn't matter.\n // See https://github.com/Microsoft/TypeScript/issues/15008\n return this.match(tt.name);\n }\n\n tsNextTokenCanFollowModifier() {\n // Note: TypeScript's implementation is much more complicated because\n // more things are considered modifiers there.\n // This implementation only handles modifiers not handled by @babel/parser itself. And \"static\".\n // TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method...\n this.next();\n return (\n (this.match(tt.bracketL) ||\n this.match(tt.braceL) ||\n this.match(tt.star) ||\n this.match(tt.ellipsis) ||\n this.match(tt.hash) ||\n this.isLiteralPropertyName()) &&\n !this.hasPrecedingLineBreak()\n );\n }\n\n /** Parses a modifier matching one the given modifier names. */\n tsParseModifier(allowedModifiers: T[]): ?T {\n if (!this.match(tt.name)) {\n return undefined;\n }\n\n const modifier = this.state.value;\n if (\n allowedModifiers.indexOf(modifier) !== -1 &&\n this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))\n ) {\n return modifier;\n }\n return undefined;\n }\n\n /** Parses a list of modifiers, in any order.\n * If you need a specific order, you must call this function multiple times:\n * this.tsParseModifiers(node, [\"public\"]);\n * this.tsParseModifiers(node, [\"abstract\", \"readonly\"]);\n */\n tsParseModifiers(\n modified: { [key: TsModifier]: ?true },\n allowedModifiers: T[],\n ): void {\n for (;;) {\n const startPos = this.state.start;\n const modifier: ?T = this.tsParseModifier(allowedModifiers);\n\n if (!modifier) break;\n\n if (Object.hasOwnProperty.call(modified, modifier)) {\n this.raise(startPos, TSErrors.DuplicateModifier, modifier);\n }\n modified[modifier] = true;\n }\n }\n\n tsIsListTerminator(kind: ParsingContext): boolean {\n switch (kind) {\n case \"EnumMembers\":\n case \"TypeMembers\":\n return this.match(tt.braceR);\n case \"HeritageClauseElement\":\n return this.match(tt.braceL);\n case \"TupleElementTypes\":\n return this.match(tt.bracketR);\n case \"TypeParametersOrArguments\":\n return this.isRelational(\">\");\n }\n\n throw new Error(\"Unreachable\");\n }\n\n tsParseList(kind: ParsingContext, parseElement: () => T): T[] {\n const result: T[] = [];\n while (!this.tsIsListTerminator(kind)) {\n // Skipping \"parseListElement\" from the TS source since that's just for error handling.\n result.push(parseElement());\n }\n return result;\n }\n\n tsParseDelimitedList(\n kind: ParsingContext,\n parseElement: () => T,\n ): T[] {\n return nonNull(\n this.tsParseDelimitedListWorker(\n kind,\n parseElement,\n /* expectSuccess */ true,\n ),\n );\n }\n\n /**\n * If !expectSuccess, returns undefined instead of failing to parse.\n * If expectSuccess, parseElement should always return a defined value.\n */\n tsParseDelimitedListWorker(\n kind: ParsingContext,\n parseElement: () => ?T,\n expectSuccess: boolean,\n ): ?(T[]) {\n const result = [];\n\n for (;;) {\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n\n const element = parseElement();\n if (element == null) {\n return undefined;\n }\n result.push(element);\n\n if (this.eat(tt.comma)) {\n continue;\n }\n\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n\n if (expectSuccess) {\n // This will fail with an error about a missing comma\n this.expect(tt.comma);\n }\n return undefined;\n }\n\n return result;\n }\n\n tsParseBracketedList(\n kind: ParsingContext,\n parseElement: () => T,\n bracket: boolean,\n skipFirstToken: boolean,\n ): T[] {\n if (!skipFirstToken) {\n if (bracket) {\n this.expect(tt.bracketL);\n } else {\n this.expectRelational(\"<\");\n }\n }\n\n const result = this.tsParseDelimitedList(kind, parseElement);\n\n if (bracket) {\n this.expect(tt.bracketR);\n } else {\n this.expectRelational(\">\");\n }\n\n return result;\n }\n\n tsParseImportType(): N.TsImportType {\n const node: N.TsImportType = this.startNode();\n this.expect(tt._import);\n this.expect(tt.parenL);\n if (!this.match(tt.string)) {\n this.raise(this.state.start, TSErrors.UnsupportedImportTypeArgument);\n }\n\n // For compatibility to estree we cannot call parseLiteral directly here\n node.argument = this.parseExprAtom();\n this.expect(tt.parenR);\n\n if (this.eat(tt.dot)) {\n node.qualifier = this.tsParseEntityName(/* allowReservedWords */ true);\n }\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSImportType\");\n }\n\n tsParseEntityName(allowReservedWords: boolean): N.TsEntityName {\n let entity: N.TsEntityName = this.parseIdentifier();\n while (this.eat(tt.dot)) {\n const node: N.TsQualifiedName = this.startNodeAtNode(entity);\n node.left = entity;\n node.right = this.parseIdentifier(allowReservedWords);\n entity = this.finishNode(node, \"TSQualifiedName\");\n }\n return entity;\n }\n\n tsParseTypeReference(): N.TsTypeReference {\n const node: N.TsTypeReference = this.startNode();\n node.typeName = this.tsParseEntityName(/* allowReservedWords */ false);\n if (!this.hasPrecedingLineBreak() && this.isRelational(\"<\")) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSTypeReference\");\n }\n\n tsParseThisTypePredicate(lhs: N.TsThisType): N.TsTypePredicate {\n this.next();\n const node: N.TsTypePredicate = this.startNodeAtNode(lhs);\n node.parameterName = lhs;\n node.typeAnnotation = this.tsParseTypeAnnotation(/* eatColon */ false);\n node.asserts = false;\n return this.finishNode(node, \"TSTypePredicate\");\n }\n\n tsParseThisTypeNode(): N.TsThisType {\n const node: N.TsThisType = this.startNode();\n this.next();\n return this.finishNode(node, \"TSThisType\");\n }\n\n tsParseTypeQuery(): N.TsTypeQuery {\n const node: N.TsTypeQuery = this.startNode();\n this.expect(tt._typeof);\n if (this.match(tt._import)) {\n node.exprName = this.tsParseImportType();\n } else {\n node.exprName = this.tsParseEntityName(/* allowReservedWords */ true);\n }\n return this.finishNode(node, \"TSTypeQuery\");\n }\n\n tsParseTypeParameter(): N.TsTypeParameter {\n const node: N.TsTypeParameter = this.startNode();\n node.name = this.parseIdentifierName(node.start);\n node.constraint = this.tsEatThenParseType(tt._extends);\n node.default = this.tsEatThenParseType(tt.eq);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n\n tsTryParseTypeParameters(): ?N.TsTypeParameterDeclaration {\n if (this.isRelational(\"<\")) {\n return this.tsParseTypeParameters();\n }\n }\n\n tsParseTypeParameters() {\n const node: N.TsTypeParameterDeclaration = this.startNode();\n\n if (this.isRelational(\"<\") || this.match(tt.jsxTagStart)) {\n this.next();\n } else {\n this.unexpected();\n }\n\n node.params = this.tsParseBracketedList(\n \"TypeParametersOrArguments\",\n this.tsParseTypeParameter.bind(this),\n /* bracket */ false,\n /* skipFirstToken */ true,\n );\n if (node.params.length === 0) {\n this.raise(node.start, TSErrors.EmptyTypeParameters);\n }\n return this.finishNode(node, \"TSTypeParameterDeclaration\");\n }\n\n tsTryNextParseConstantContext(): ?N.TsTypeReference {\n if (this.lookahead().type === tt._const) {\n this.next();\n return this.tsParseTypeReference();\n }\n return null;\n }\n\n // Note: In TypeScript implementation we must provide `yieldContext` and `awaitContext`,\n // but here it's always false, because this is only used for types.\n tsFillSignature(\n returnToken: TokenType,\n signature: N.TsSignatureDeclaration,\n ): void {\n // Arrow fns *must* have return token (`=>`). Normal functions can omit it.\n const returnTokenRequired = returnToken === tt.arrow;\n signature.typeParameters = this.tsTryParseTypeParameters();\n this.expect(tt.parenL);\n signature.parameters = this.tsParseBindingListForSignature();\n if (returnTokenRequired) {\n signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(\n returnToken,\n );\n } else if (this.match(returnToken)) {\n signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(\n returnToken,\n );\n }\n }\n\n tsParseBindingListForSignature(): $ReadOnlyArray<\n N.Identifier | N.RestElement | N.ObjectPattern | N.ArrayPattern,\n > {\n return this.parseBindingList(tt.parenR, charCodes.rightParenthesis).map(\n pattern => {\n if (\n pattern.type !== \"Identifier\" &&\n pattern.type !== \"RestElement\" &&\n pattern.type !== \"ObjectPattern\" &&\n pattern.type !== \"ArrayPattern\"\n ) {\n this.raise(\n pattern.start,\n TSErrors.UnsupportedSignatureParameterKind,\n pattern.type,\n );\n }\n return (pattern: any);\n },\n );\n }\n\n tsParseTypeMemberSemicolon(): void {\n if (!this.eat(tt.comma)) {\n this.semicolon();\n }\n }\n\n tsParseSignatureMember(\n kind: \"TSCallSignatureDeclaration\" | \"TSConstructSignatureDeclaration\",\n node: N.TsCallSignatureDeclaration | N.TsConstructSignatureDeclaration,\n ): N.TsCallSignatureDeclaration | N.TsConstructSignatureDeclaration {\n this.tsFillSignature(tt.colon, node);\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, kind);\n }\n\n tsIsUnambiguouslyIndexSignature() {\n this.next(); // Skip '{'\n return this.eat(tt.name) && this.match(tt.colon);\n }\n\n tsTryParseIndexSignature(node: N.Node): ?N.TsIndexSignature {\n if (\n !(\n this.match(tt.bracketL) &&\n this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))\n )\n ) {\n return undefined;\n }\n\n this.expect(tt.bracketL);\n const id = this.parseIdentifier();\n id.typeAnnotation = this.tsParseTypeAnnotation();\n this.resetEndLocation(id); // set end position to end of type\n\n this.expect(tt.bracketR);\n node.parameters = [id];\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, \"TSIndexSignature\");\n }\n\n tsParsePropertyOrMethodSignature(\n node: N.TsPropertySignature | N.TsMethodSignature,\n readonly: boolean,\n ): N.TsPropertySignature | N.TsMethodSignature {\n if (this.eat(tt.question)) node.optional = true;\n const nodeAny: any = node;\n\n if (!readonly && (this.match(tt.parenL) || this.isRelational(\"<\"))) {\n const method: N.TsMethodSignature = nodeAny;\n this.tsFillSignature(tt.colon, method);\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(method, \"TSMethodSignature\");\n } else {\n const property: N.TsPropertySignature = nodeAny;\n if (readonly) property.readonly = true;\n const type = this.tsTryParseTypeAnnotation();\n if (type) property.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(property, \"TSPropertySignature\");\n }\n }\n\n tsParseTypeMember(): N.TsTypeElement {\n const node: any = this.startNode();\n\n if (this.match(tt.parenL) || this.isRelational(\"<\")) {\n return this.tsParseSignatureMember(\"TSCallSignatureDeclaration\", node);\n }\n\n if (this.match(tt._new)) {\n const id: N.Identifier = this.startNode();\n this.next();\n if (this.match(tt.parenL) || this.isRelational(\"<\")) {\n return this.tsParseSignatureMember(\n \"TSConstructSignatureDeclaration\",\n node,\n );\n } else {\n node.key = this.createIdentifier(id, \"new\");\n return this.tsParsePropertyOrMethodSignature(node, false);\n }\n }\n\n const readonly = !!this.tsParseModifier([\"readonly\"]);\n\n const idx = this.tsTryParseIndexSignature(node);\n if (idx) {\n if (readonly) node.readonly = true;\n return idx;\n }\n\n this.parsePropertyName(node, /* isPrivateNameAllowed */ false);\n return this.tsParsePropertyOrMethodSignature(node, readonly);\n }\n\n tsParseTypeLiteral(): N.TsTypeLiteral {\n const node: N.TsTypeLiteral = this.startNode();\n node.members = this.tsParseObjectTypeMembers();\n return this.finishNode(node, \"TSTypeLiteral\");\n }\n\n tsParseObjectTypeMembers(): $ReadOnlyArray {\n this.expect(tt.braceL);\n const members = this.tsParseList(\n \"TypeMembers\",\n this.tsParseTypeMember.bind(this),\n );\n this.expect(tt.braceR);\n return members;\n }\n\n tsIsStartOfMappedType(): boolean {\n this.next();\n if (this.eat(tt.plusMin)) {\n return this.isContextual(\"readonly\");\n }\n if (this.isContextual(\"readonly\")) {\n this.next();\n }\n if (!this.match(tt.bracketL)) {\n return false;\n }\n this.next();\n if (!this.tsIsIdentifier()) {\n return false;\n }\n this.next();\n return this.match(tt._in);\n }\n\n tsParseMappedTypeParameter(): N.TsTypeParameter {\n const node: N.TsTypeParameter = this.startNode();\n node.name = this.parseIdentifierName(node.start);\n node.constraint = this.tsExpectThenParseType(tt._in);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n\n tsParseMappedType(): N.TsMappedType {\n const node: N.TsMappedType = this.startNode();\n\n this.expect(tt.braceL);\n\n if (this.match(tt.plusMin)) {\n node.readonly = this.state.value;\n this.next();\n this.expectContextual(\"readonly\");\n } else if (this.eatContextual(\"readonly\")) {\n node.readonly = true;\n }\n\n this.expect(tt.bracketL);\n node.typeParameter = this.tsParseMappedTypeParameter();\n node.nameType = this.eatContextual(\"as\") ? this.tsParseType() : null;\n\n this.expect(tt.bracketR);\n\n if (this.match(tt.plusMin)) {\n node.optional = this.state.value;\n this.next();\n this.expect(tt.question);\n } else if (this.eat(tt.question)) {\n node.optional = true;\n }\n\n node.typeAnnotation = this.tsTryParseType();\n this.semicolon();\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"TSMappedType\");\n }\n\n tsParseTupleType(): N.TsTupleType {\n const node: N.TsTupleType = this.startNode();\n node.elementTypes = this.tsParseBracketedList(\n \"TupleElementTypes\",\n this.tsParseTupleElementType.bind(this),\n /* bracket */ true,\n /* skipFirstToken */ false,\n );\n\n // Validate the elementTypes to ensure that no mandatory elements\n // follow optional elements\n let seenOptionalElement = false;\n let labeledElements = null;\n node.elementTypes.forEach(elementNode => {\n let { type } = elementNode;\n\n if (\n seenOptionalElement &&\n type !== \"TSRestType\" &&\n type !== \"TSOptionalType\" &&\n !(type === \"TSNamedTupleMember\" && elementNode.optional)\n ) {\n this.raise(elementNode.start, TSErrors.OptionalTypeBeforeRequired);\n }\n\n // Flow doesn't support ||=\n seenOptionalElement =\n seenOptionalElement ||\n (type === \"TSNamedTupleMember\" && elementNode.optional) ||\n type === \"TSOptionalType\";\n\n // When checking labels, check the argument of the spread operator\n if (type === \"TSRestType\") {\n elementNode = elementNode.typeAnnotation;\n type = elementNode.type;\n }\n\n const isLabeled = type === \"TSNamedTupleMember\";\n // Flow doesn't support ??=\n labeledElements = labeledElements ?? isLabeled;\n if (labeledElements !== isLabeled) {\n this.raise(\n elementNode.start,\n TSErrors.MixedLabeledAndUnlabeledElements,\n );\n }\n });\n\n return this.finishNode(node, \"TSTupleType\");\n }\n\n tsParseTupleElementType(): N.TsType | N.TsNamedTupleMember {\n // parses `...TsType[]`\n\n const { start: startPos, startLoc } = this.state;\n\n const rest = this.eat(tt.ellipsis);\n let type = this.tsParseType();\n const optional = this.eat(tt.question);\n const labeled = this.eat(tt.colon);\n\n if (labeled) {\n const labeledNode: N.TsNamedTupleMember = this.startNodeAtNode(type);\n labeledNode.optional = optional;\n\n if (\n type.type === \"TSTypeReference\" &&\n !type.typeParameters &&\n type.typeName.type === \"Identifier\"\n ) {\n labeledNode.label = (type.typeName: N.Identifier);\n } else {\n this.raise(type.start, TSErrors.InvalidTupleMemberLabel);\n // This produces an invalid AST, but at least we don't drop\n // nodes representing the invalid source.\n // $FlowIgnore\n labeledNode.label = type;\n }\n\n labeledNode.elementType = this.tsParseType();\n type = this.finishNode(labeledNode, \"TSNamedTupleMember\");\n } else if (optional) {\n const optionalTypeNode: N.TsOptionalType = this.startNodeAtNode(type);\n optionalTypeNode.typeAnnotation = type;\n type = this.finishNode(optionalTypeNode, \"TSOptionalType\");\n }\n\n if (rest) {\n const restNode: N.TsRestType = this.startNodeAt(startPos, startLoc);\n restNode.typeAnnotation = type;\n type = this.finishNode(restNode, \"TSRestType\");\n }\n\n return type;\n }\n\n tsParseParenthesizedType(): N.TsParenthesizedType {\n const node = this.startNode();\n this.expect(tt.parenL);\n node.typeAnnotation = this.tsParseType();\n this.expect(tt.parenR);\n return this.finishNode(node, \"TSParenthesizedType\");\n }\n\n tsParseFunctionOrConstructorType(\n type: \"TSFunctionType\" | \"TSConstructorType\",\n ): N.TsFunctionOrConstructorType {\n const node: N.TsFunctionOrConstructorType = this.startNode();\n if (type === \"TSConstructorType\") {\n this.expect(tt._new);\n }\n this.tsFillSignature(tt.arrow, node);\n return this.finishNode(node, type);\n }\n\n tsParseLiteralTypeNode(): N.TsLiteralType {\n const node: N.TsLiteralType = this.startNode();\n node.literal = (() => {\n switch (this.state.type) {\n case tt.num:\n case tt.bigint:\n case tt.string:\n case tt._true:\n case tt._false:\n // For compatibility to estree we cannot call parseLiteral directly here\n return this.parseExprAtom();\n default:\n throw this.unexpected();\n }\n })();\n return this.finishNode(node, \"TSLiteralType\");\n }\n\n tsParseTemplateLiteralType(): N.TsType {\n const node: N.TsLiteralType = this.startNode();\n node.literal = this.parseTemplate(false);\n return this.finishNode(node, \"TSLiteralType\");\n }\n\n parseTemplateSubstitution(): N.TsType {\n if (this.state.inType) return this.tsParseType();\n return super.parseTemplateSubstitution();\n }\n\n tsParseThisTypeOrThisTypePredicate(): N.TsThisType | N.TsTypePredicate {\n const thisKeyword = this.tsParseThisTypeNode();\n if (this.isContextual(\"is\") && !this.hasPrecedingLineBreak()) {\n return this.tsParseThisTypePredicate(thisKeyword);\n } else {\n return thisKeyword;\n }\n }\n\n tsParseNonArrayType(): N.TsType {\n switch (this.state.type) {\n case tt.name:\n case tt._void:\n case tt._null: {\n const type = this.match(tt._void)\n ? \"TSVoidKeyword\"\n : this.match(tt._null)\n ? \"TSNullKeyword\"\n : keywordTypeFromName(this.state.value);\n if (\n type !== undefined &&\n this.lookaheadCharCode() !== charCodes.dot\n ) {\n const node: N.TsKeywordType = this.startNode();\n this.next();\n return this.finishNode(node, type);\n }\n return this.tsParseTypeReference();\n }\n case tt.string:\n case tt.num:\n case tt.bigint:\n case tt._true:\n case tt._false:\n return this.tsParseLiteralTypeNode();\n case tt.plusMin:\n if (this.state.value === \"-\") {\n const node: N.TsLiteralType = this.startNode();\n const nextToken = this.lookahead();\n if (nextToken.type !== tt.num && nextToken.type !== tt.bigint) {\n throw this.unexpected();\n }\n node.literal = this.parseMaybeUnary();\n return this.finishNode(node, \"TSLiteralType\");\n }\n break;\n case tt._this:\n return this.tsParseThisTypeOrThisTypePredicate();\n case tt._typeof:\n return this.tsParseTypeQuery();\n case tt._import:\n return this.tsParseImportType();\n case tt.braceL:\n return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))\n ? this.tsParseMappedType()\n : this.tsParseTypeLiteral();\n case tt.bracketL:\n return this.tsParseTupleType();\n case tt.parenL:\n return this.tsParseParenthesizedType();\n case tt.backQuote:\n return this.tsParseTemplateLiteralType();\n }\n\n throw this.unexpected();\n }\n\n tsParseArrayTypeOrHigher(): N.TsType {\n let type = this.tsParseNonArrayType();\n while (!this.hasPrecedingLineBreak() && this.eat(tt.bracketL)) {\n if (this.match(tt.bracketR)) {\n const node: N.TsArrayType = this.startNodeAtNode(type);\n node.elementType = type;\n this.expect(tt.bracketR);\n type = this.finishNode(node, \"TSArrayType\");\n } else {\n const node: N.TsIndexedAccessType = this.startNodeAtNode(type);\n node.objectType = type;\n node.indexType = this.tsParseType();\n this.expect(tt.bracketR);\n type = this.finishNode(node, \"TSIndexedAccessType\");\n }\n }\n return type;\n }\n\n tsParseTypeOperator(\n operator: \"keyof\" | \"unique\" | \"readonly\",\n ): N.TsTypeOperator {\n const node: N.TsTypeOperator = this.startNode();\n this.expectContextual(operator);\n node.operator = operator;\n node.typeAnnotation = this.tsParseTypeOperatorOrHigher();\n\n if (operator === \"readonly\") {\n this.tsCheckTypeAnnotationForReadOnly(node);\n }\n\n return this.finishNode(node, \"TSTypeOperator\");\n }\n\n tsCheckTypeAnnotationForReadOnly(node: N.Node) {\n switch (node.typeAnnotation.type) {\n case \"TSTupleType\":\n case \"TSArrayType\":\n return;\n default:\n this.raise(node.start, TSErrors.UnexpectedReadonly);\n }\n }\n\n tsParseInferType(): N.TsInferType {\n const node = this.startNode();\n this.expectContextual(\"infer\");\n const typeParameter = this.startNode();\n typeParameter.name = this.parseIdentifierName(typeParameter.start);\n node.typeParameter = this.finishNode(typeParameter, \"TSTypeParameter\");\n return this.finishNode(node, \"TSInferType\");\n }\n\n tsParseTypeOperatorOrHigher(): N.TsType {\n const operator = [\"keyof\", \"unique\", \"readonly\"].find(kw =>\n this.isContextual(kw),\n );\n return operator\n ? this.tsParseTypeOperator(operator)\n : this.isContextual(\"infer\")\n ? this.tsParseInferType()\n : this.tsParseArrayTypeOrHigher();\n }\n\n tsParseUnionOrIntersectionType(\n kind: \"TSUnionType\" | \"TSIntersectionType\",\n parseConstituentType: () => N.TsType,\n operator: TokenType,\n ): N.TsType {\n this.eat(operator);\n let type = parseConstituentType();\n if (this.match(operator)) {\n const types = [type];\n while (this.eat(operator)) {\n types.push(parseConstituentType());\n }\n const node: N.TsUnionType | N.TsIntersectionType = this.startNodeAtNode(\n type,\n );\n node.types = types;\n type = this.finishNode(node, kind);\n }\n return type;\n }\n\n tsParseIntersectionTypeOrHigher(): N.TsType {\n return this.tsParseUnionOrIntersectionType(\n \"TSIntersectionType\",\n this.tsParseTypeOperatorOrHigher.bind(this),\n tt.bitwiseAND,\n );\n }\n\n tsParseUnionTypeOrHigher() {\n return this.tsParseUnionOrIntersectionType(\n \"TSUnionType\",\n this.tsParseIntersectionTypeOrHigher.bind(this),\n tt.bitwiseOR,\n );\n }\n\n tsIsStartOfFunctionType() {\n if (this.isRelational(\"<\")) {\n return true;\n }\n return (\n this.match(tt.parenL) &&\n this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))\n );\n }\n\n tsSkipParameterStart(): boolean {\n if (this.match(tt.name) || this.match(tt._this)) {\n this.next();\n return true;\n }\n\n if (this.match(tt.braceL)) {\n let braceStackCounter = 1;\n this.next();\n\n while (braceStackCounter > 0) {\n if (this.match(tt.braceL)) {\n ++braceStackCounter;\n } else if (this.match(tt.braceR)) {\n --braceStackCounter;\n }\n this.next();\n }\n return true;\n }\n\n if (this.match(tt.bracketL)) {\n let braceStackCounter = 1;\n this.next();\n\n while (braceStackCounter > 0) {\n if (this.match(tt.bracketL)) {\n ++braceStackCounter;\n } else if (this.match(tt.bracketR)) {\n --braceStackCounter;\n }\n this.next();\n }\n return true;\n }\n\n return false;\n }\n\n tsIsUnambiguouslyStartOfFunctionType(): boolean {\n this.next();\n if (this.match(tt.parenR) || this.match(tt.ellipsis)) {\n // ( )\n // ( ...\n return true;\n }\n if (this.tsSkipParameterStart()) {\n if (\n this.match(tt.colon) ||\n this.match(tt.comma) ||\n this.match(tt.question) ||\n this.match(tt.eq)\n ) {\n // ( xxx :\n // ( xxx ,\n // ( xxx ?\n // ( xxx =\n return true;\n }\n if (this.match(tt.parenR)) {\n this.next();\n if (this.match(tt.arrow)) {\n // ( xxx ) =>\n return true;\n }\n }\n }\n return false;\n }\n\n tsParseTypeOrTypePredicateAnnotation(\n returnToken: TokenType,\n ): N.TsTypeAnnotation {\n return this.tsInType(() => {\n const t: N.TsTypeAnnotation = this.startNode();\n this.expect(returnToken);\n\n const asserts = !!this.tsTryParse(\n this.tsParseTypePredicateAsserts.bind(this),\n );\n\n if (asserts && this.match(tt._this)) {\n // When asserts is false, thisKeyword is handled by tsParseNonArrayType\n // : asserts this is type\n let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();\n // if it turns out to be a `TSThisType`, wrap it with `TSTypePredicate`\n // : asserts this\n if (thisTypePredicate.type === \"TSThisType\") {\n const node: N.TsTypePredicate = this.startNodeAtNode(t);\n node.parameterName = (thisTypePredicate: N.TsThisType);\n node.asserts = true;\n thisTypePredicate = this.finishNode(node, \"TSTypePredicate\");\n } else {\n (thisTypePredicate: N.TsTypePredicate).asserts = true;\n }\n t.typeAnnotation = thisTypePredicate;\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n const typePredicateVariable =\n this.tsIsIdentifier() &&\n this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));\n\n if (!typePredicateVariable) {\n if (!asserts) {\n // : type\n return this.tsParseTypeAnnotation(/* eatColon */ false, t);\n }\n\n const node: N.TsTypePredicate = this.startNodeAtNode(t);\n // : asserts foo\n node.parameterName = this.parseIdentifier();\n node.asserts = asserts;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n // : asserts foo is type\n const type = this.tsParseTypeAnnotation(/* eatColon */ false);\n const node = this.startNodeAtNode(t);\n node.parameterName = typePredicateVariable;\n node.typeAnnotation = type;\n node.asserts = asserts;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n });\n }\n\n tsTryParseTypeOrTypePredicateAnnotation(): ?N.TsTypeAnnotation {\n return this.match(tt.colon)\n ? this.tsParseTypeOrTypePredicateAnnotation(tt.colon)\n : undefined;\n }\n\n tsTryParseTypeAnnotation(): ?N.TsTypeAnnotation {\n return this.match(tt.colon) ? this.tsParseTypeAnnotation() : undefined;\n }\n\n tsTryParseType(): ?N.TsType {\n return this.tsEatThenParseType(tt.colon);\n }\n\n tsParseTypePredicatePrefix(): ?N.Identifier {\n const id = this.parseIdentifier();\n if (this.isContextual(\"is\") && !this.hasPrecedingLineBreak()) {\n this.next();\n return id;\n }\n }\n\n tsParseTypePredicateAsserts(): boolean {\n if (\n !this.match(tt.name) ||\n this.state.value !== \"asserts\" ||\n this.hasPrecedingLineBreak()\n ) {\n return false;\n }\n const containsEsc = this.state.containsEsc;\n this.next();\n if (!this.match(tt.name) && !this.match(tt._this)) {\n return false;\n }\n\n if (containsEsc) {\n this.raise(\n this.state.lastTokStart,\n Errors.InvalidEscapedReservedWord,\n \"asserts\",\n );\n }\n\n return true;\n }\n\n tsParseTypeAnnotation(\n eatColon = true,\n t: N.TsTypeAnnotation = this.startNode(),\n ): N.TsTypeAnnotation {\n this.tsInType(() => {\n if (eatColon) this.expect(tt.colon);\n t.typeAnnotation = this.tsParseType();\n });\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n /** Be sure to be in a type context before calling this, using `tsInType`. */\n tsParseType(): N.TsType {\n // Need to set `state.inType` so that we don't parse JSX in a type context.\n assert(this.state.inType);\n const type = this.tsParseNonConditionalType();\n if (this.hasPrecedingLineBreak() || !this.eat(tt._extends)) {\n return type;\n }\n const node: N.TsConditionalType = this.startNodeAtNode(type);\n node.checkType = type;\n node.extendsType = this.tsParseNonConditionalType();\n this.expect(tt.question);\n node.trueType = this.tsParseType();\n this.expect(tt.colon);\n node.falseType = this.tsParseType();\n return this.finishNode(node, \"TSConditionalType\");\n }\n\n tsParseNonConditionalType(): N.TsType {\n if (this.tsIsStartOfFunctionType()) {\n return this.tsParseFunctionOrConstructorType(\"TSFunctionType\");\n }\n if (this.match(tt._new)) {\n // As in `new () => Date`\n return this.tsParseFunctionOrConstructorType(\"TSConstructorType\");\n }\n return this.tsParseUnionTypeOrHigher();\n }\n\n tsParseTypeAssertion(): N.TsTypeAssertion {\n const node: N.TsTypeAssertion = this.startNode();\n const _const = this.tsTryNextParseConstantContext();\n node.typeAnnotation = _const || this.tsNextThenParseType();\n this.expectRelational(\">\");\n node.expression = this.parseMaybeUnary();\n return this.finishNode(node, \"TSTypeAssertion\");\n }\n\n tsParseHeritageClause(\n descriptor: string,\n ): $ReadOnlyArray {\n const originalStart = this.state.start;\n\n const delimitedList = this.tsParseDelimitedList(\n \"HeritageClauseElement\",\n this.tsParseExpressionWithTypeArguments.bind(this),\n );\n\n if (!delimitedList.length) {\n this.raise(originalStart, TSErrors.EmptyHeritageClauseType, descriptor);\n }\n\n return delimitedList;\n }\n\n tsParseExpressionWithTypeArguments(): N.TsExpressionWithTypeArguments {\n const node: N.TsExpressionWithTypeArguments = this.startNode();\n // Note: TS uses parseLeftHandSideExpressionOrHigher,\n // then has grammar errors later if it's not an EntityName.\n node.expression = this.tsParseEntityName(/* allowReservedWords */ false);\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n\n return this.finishNode(node, \"TSExpressionWithTypeArguments\");\n }\n\n tsParseInterfaceDeclaration(\n node: N.TsInterfaceDeclaration,\n ): N.TsInterfaceDeclaration {\n node.id = this.parseIdentifier();\n this.checkLVal(\n node.id,\n \"typescript interface declaration\",\n BIND_TS_INTERFACE,\n );\n node.typeParameters = this.tsTryParseTypeParameters();\n if (this.eat(tt._extends)) {\n node.extends = this.tsParseHeritageClause(\"extends\");\n }\n const body: N.TSInterfaceBody = this.startNode();\n body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));\n node.body = this.finishNode(body, \"TSInterfaceBody\");\n return this.finishNode(node, \"TSInterfaceDeclaration\");\n }\n\n tsParseTypeAliasDeclaration(\n node: N.TsTypeAliasDeclaration,\n ): N.TsTypeAliasDeclaration {\n node.id = this.parseIdentifier();\n this.checkLVal(node.id, \"typescript type alias\", BIND_TS_TYPE);\n\n node.typeParameters = this.tsTryParseTypeParameters();\n node.typeAnnotation = this.tsInType(() => {\n this.expect(tt.eq);\n\n if (\n this.isContextual(\"intrinsic\") &&\n this.lookahead().type !== tt.dot\n ) {\n const node: N.TsKeywordType = this.startNode();\n this.next();\n return this.finishNode(node, \"TSIntrinsicKeyword\");\n }\n\n return this.tsParseType();\n });\n\n this.semicolon();\n return this.finishNode(node, \"TSTypeAliasDeclaration\");\n }\n\n tsInNoContext(cb: () => T): T {\n const oldContext = this.state.context;\n this.state.context = [oldContext[0]];\n try {\n return cb();\n } finally {\n this.state.context = oldContext;\n }\n }\n\n /**\n * Runs `cb` in a type context.\n * This should be called one token *before* the first type token,\n * so that the call to `next()` is run in type context.\n */\n tsInType(cb: () => T): T {\n const oldInType = this.state.inType;\n this.state.inType = true;\n try {\n return cb();\n } finally {\n this.state.inType = oldInType;\n }\n }\n\n tsEatThenParseType(token: TokenType): N.TsType | typeof undefined {\n return !this.match(token) ? undefined : this.tsNextThenParseType();\n }\n\n tsExpectThenParseType(token: TokenType): N.TsType {\n return this.tsDoThenParseType(() => this.expect(token));\n }\n\n tsNextThenParseType(): N.TsType {\n return this.tsDoThenParseType(() => this.next());\n }\n\n tsDoThenParseType(cb: () => void): N.TsType {\n return this.tsInType(() => {\n cb();\n return this.tsParseType();\n });\n }\n\n tsParseEnumMember(): N.TsEnumMember {\n const node: N.TsEnumMember = this.startNode();\n // Computed property names are grammar errors in an enum, so accept just string literal or identifier.\n node.id = this.match(tt.string)\n ? this.parseExprAtom()\n : this.parseIdentifier(/* liberal */ true);\n if (this.eat(tt.eq)) {\n node.initializer = this.parseMaybeAssignAllowIn();\n }\n return this.finishNode(node, \"TSEnumMember\");\n }\n\n tsParseEnumDeclaration(\n node: N.TsEnumDeclaration,\n isConst: boolean,\n ): N.TsEnumDeclaration {\n if (isConst) node.const = true;\n node.id = this.parseIdentifier();\n this.checkLVal(\n node.id,\n \"typescript enum declaration\",\n isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM,\n );\n\n this.expect(tt.braceL);\n node.members = this.tsParseDelimitedList(\n \"EnumMembers\",\n this.tsParseEnumMember.bind(this),\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"TSEnumDeclaration\");\n }\n\n tsParseModuleBlock(): N.TsModuleBlock {\n const node: N.TsModuleBlock = this.startNode();\n this.scope.enter(SCOPE_OTHER);\n\n this.expect(tt.braceL);\n // Inside of a module block is considered \"top-level\", meaning it can have imports and exports.\n this.parseBlockOrModuleBlockBody(\n (node.body = []),\n /* directives */ undefined,\n /* topLevel */ true,\n /* end */ tt.braceR,\n );\n this.scope.exit();\n return this.finishNode(node, \"TSModuleBlock\");\n }\n\n tsParseModuleOrNamespaceDeclaration(\n node: N.TsModuleDeclaration,\n nested?: boolean = false,\n ): N.TsModuleDeclaration {\n node.id = this.parseIdentifier();\n\n if (!nested) {\n this.checkLVal(\n node.id,\n \"module or namespace declaration\",\n BIND_TS_NAMESPACE,\n );\n }\n\n if (this.eat(tt.dot)) {\n const inner = this.startNode();\n this.tsParseModuleOrNamespaceDeclaration(inner, true);\n node.body = inner;\n } else {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n }\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n\n tsParseAmbientExternalModuleDeclaration(\n node: N.TsModuleDeclaration,\n ): N.TsModuleDeclaration {\n if (this.isContextual(\"global\")) {\n node.global = true;\n node.id = this.parseIdentifier();\n } else if (this.match(tt.string)) {\n node.id = this.parseExprAtom();\n } else {\n this.unexpected();\n }\n if (this.match(tt.braceL)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n } else {\n this.semicolon();\n }\n\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n\n tsParseImportEqualsDeclaration(\n node: N.TsImportEqualsDeclaration,\n isExport?: boolean,\n ): N.TsImportEqualsDeclaration {\n node.isExport = isExport || false;\n node.id = this.parseIdentifier();\n this.checkLVal(node.id, \"import equals declaration\", BIND_LEXICAL);\n this.expect(tt.eq);\n node.moduleReference = this.tsParseModuleReference();\n this.semicolon();\n return this.finishNode(node, \"TSImportEqualsDeclaration\");\n }\n\n tsIsExternalModuleReference(): boolean {\n return (\n this.isContextual(\"require\") &&\n this.lookaheadCharCode() === charCodes.leftParenthesis\n );\n }\n\n tsParseModuleReference(): N.TsModuleReference {\n return this.tsIsExternalModuleReference()\n ? this.tsParseExternalModuleReference()\n : this.tsParseEntityName(/* allowReservedWords */ false);\n }\n\n tsParseExternalModuleReference(): N.TsExternalModuleReference {\n const node: N.TsExternalModuleReference = this.startNode();\n this.expectContextual(\"require\");\n this.expect(tt.parenL);\n if (!this.match(tt.string)) {\n throw this.unexpected();\n }\n // For compatibility to estree we cannot call parseLiteral directly here\n node.expression = this.parseExprAtom();\n this.expect(tt.parenR);\n return this.finishNode(node, \"TSExternalModuleReference\");\n }\n\n // Utilities\n\n tsLookAhead(f: () => T): T {\n const state = this.state.clone();\n const res = f();\n this.state = state;\n return res;\n }\n\n tsTryParseAndCatch(f: () => T): ?T {\n const result = this.tryParse(abort => f() || abort());\n\n if (result.aborted || !result.node) return undefined;\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n tsTryParse(f: () => ?T): ?T {\n const state = this.state.clone();\n const result = f();\n if (result !== undefined && result !== false) {\n return result;\n } else {\n this.state = state;\n return undefined;\n }\n }\n\n tsTryParseDeclare(nany: any): ?N.Declaration {\n if (this.isLineTerminator()) {\n return;\n }\n let starttype = this.state.type;\n let kind;\n\n if (this.isContextual(\"let\")) {\n starttype = tt._var;\n kind = \"let\";\n }\n\n return this.tsInDeclareContext(() => {\n switch (starttype) {\n case tt._function:\n nany.declare = true;\n return this.parseFunctionStatement(\n nany,\n /* async */ false,\n /* declarationPosition */ true,\n );\n case tt._class:\n // While this is also set by tsParseExpressionStatement, we need to set it\n // before parsing the class declaration to now how to register it in the scope.\n nany.declare = true;\n return this.parseClass(\n nany,\n /* isStatement */ true,\n /* optionalId */ false,\n );\n case tt._const:\n if (this.match(tt._const) && this.isLookaheadContextual(\"enum\")) {\n // `const enum = 0;` not allowed because \"enum\" is a strict mode reserved word.\n this.expect(tt._const);\n this.expectContextual(\"enum\");\n return this.tsParseEnumDeclaration(nany, /* isConst */ true);\n }\n // falls through\n case tt._var:\n kind = kind || this.state.value;\n return this.parseVarStatement(nany, kind);\n case tt.name: {\n const value = this.state.value;\n if (value === \"global\") {\n return this.tsParseAmbientExternalModuleDeclaration(nany);\n } else {\n return this.tsParseDeclaration(nany, value, /* next */ true);\n }\n }\n }\n });\n }\n\n // Note: this won't be called unless the keyword is allowed in `shouldParseExportDeclaration`.\n tsTryParseExportDeclaration(): ?N.Declaration {\n return this.tsParseDeclaration(\n this.startNode(),\n this.state.value,\n /* next */ true,\n );\n }\n\n tsParseExpressionStatement(node: any, expr: N.Identifier): ?N.Declaration {\n switch (expr.name) {\n case \"declare\": {\n const declaration = this.tsTryParseDeclare(node);\n if (declaration) {\n declaration.declare = true;\n return declaration;\n }\n break;\n }\n case \"global\":\n // `global { }` (with no `declare`) may appear inside an ambient module declaration.\n // Would like to use tsParseAmbientExternalModuleDeclaration here, but already ran past \"global\".\n if (this.match(tt.braceL)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n const mod: N.TsModuleDeclaration = node;\n mod.global = true;\n mod.id = expr;\n mod.body = this.tsParseModuleBlock();\n this.scope.exit();\n this.prodParam.exit();\n return this.finishNode(mod, \"TSModuleDeclaration\");\n }\n break;\n\n default:\n return this.tsParseDeclaration(node, expr.name, /* next */ false);\n }\n }\n\n // Common to tsTryParseDeclare, tsTryParseExportDeclaration, and tsParseExpressionStatement.\n tsParseDeclaration(\n node: any,\n value: string,\n next: boolean,\n ): ?N.Declaration {\n switch (value) {\n case \"abstract\":\n if (this.tsCheckLineTerminatorAndMatch(tt._class, next)) {\n const cls: N.ClassDeclaration = node;\n cls.abstract = true;\n if (next) {\n this.next();\n if (!this.match(tt._class)) {\n this.unexpected(null, tt._class);\n }\n }\n return this.parseClass(\n cls,\n /* isStatement */ true,\n /* optionalId */ false,\n );\n }\n break;\n\n case \"enum\":\n if (next || this.match(tt.name)) {\n if (next) this.next();\n return this.tsParseEnumDeclaration(node, /* isConst */ false);\n }\n break;\n\n case \"interface\":\n if (this.tsCheckLineTerminatorAndMatch(tt.name, next)) {\n if (next) this.next();\n return this.tsParseInterfaceDeclaration(node);\n }\n break;\n\n case \"module\":\n if (next) this.next();\n if (this.match(tt.string)) {\n return this.tsParseAmbientExternalModuleDeclaration(node);\n } else if (this.tsCheckLineTerminatorAndMatch(tt.name, next)) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n break;\n\n case \"namespace\":\n if (this.tsCheckLineTerminatorAndMatch(tt.name, next)) {\n if (next) this.next();\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n break;\n\n case \"type\":\n if (this.tsCheckLineTerminatorAndMatch(tt.name, next)) {\n if (next) this.next();\n return this.tsParseTypeAliasDeclaration(node);\n }\n break;\n }\n }\n\n tsCheckLineTerminatorAndMatch(tokenType: TokenType, next: boolean) {\n return (next || this.match(tokenType)) && !this.isLineTerminator();\n }\n\n tsTryParseGenericAsyncArrowFunction(\n startPos: number,\n startLoc: Position,\n ): ?N.ArrowFunctionExpression {\n if (!this.isRelational(\"<\")) {\n return undefined;\n }\n\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n this.state.maybeInArrowParameters = true;\n\n const res: ?N.ArrowFunctionExpression = this.tsTryParseAndCatch(() => {\n const node: N.ArrowFunctionExpression = this.startNodeAt(\n startPos,\n startLoc,\n );\n node.typeParameters = this.tsParseTypeParameters();\n // Don't use overloaded parseFunctionParams which would look for \"<\" again.\n super.parseFunctionParams(node);\n node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();\n this.expect(tt.arrow);\n return node;\n });\n\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n\n if (!res) {\n return undefined;\n }\n\n return this.parseArrowExpression(\n res,\n /* params are already set */ null,\n /* async */ true,\n );\n }\n\n tsParseTypeArguments(): N.TsTypeParameterInstantiation {\n const node = this.startNode();\n node.params = this.tsInType(() =>\n // Temporarily remove a JSX parsing context, which makes us scan different tokens.\n this.tsInNoContext(() => {\n this.expectRelational(\"<\");\n return this.tsParseDelimitedList(\n \"TypeParametersOrArguments\",\n this.tsParseType.bind(this),\n );\n }),\n );\n if (node.params.length === 0) {\n this.raise(node.start, TSErrors.EmptyTypeArguments);\n }\n // This reads the next token after the `>` too, so do this in the enclosing context.\n // But be sure not to parse a regex in the jsx expression ` />`, so set exprAllowed = false\n this.state.exprAllowed = false;\n this.expectRelational(\">\");\n return this.finishNode(node, \"TSTypeParameterInstantiation\");\n }\n\n tsIsDeclarationStart(): boolean {\n if (this.match(tt.name)) {\n switch (this.state.value) {\n case \"abstract\":\n case \"declare\":\n case \"enum\":\n case \"interface\":\n case \"module\":\n case \"namespace\":\n case \"type\":\n return true;\n }\n }\n\n return false;\n }\n\n // ======================================================\n // OVERRIDES\n // ======================================================\n\n isExportDefaultSpecifier(): boolean {\n if (this.tsIsDeclarationStart()) return false;\n return super.isExportDefaultSpecifier();\n }\n\n parseAssignableListItem(\n allowModifiers: ?boolean,\n decorators: N.Decorator[],\n ): N.Pattern | N.TSParameterProperty {\n // Store original location/position to include modifiers in range\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n\n let accessibility: ?N.Accessibility;\n let readonly = false;\n if (allowModifiers !== undefined) {\n accessibility = this.parseAccessModifier();\n readonly = !!this.tsParseModifier([\"readonly\"]);\n if (allowModifiers === false && (accessibility || readonly)) {\n this.raise(startPos, TSErrors.UnexpectedParameterModifier);\n }\n }\n\n const left = this.parseMaybeDefault();\n this.parseAssignableListItemTypes(left);\n const elt = this.parseMaybeDefault(left.start, left.loc.start, left);\n if (accessibility || readonly) {\n const pp: N.TSParameterProperty = this.startNodeAt(startPos, startLoc);\n if (decorators.length) {\n pp.decorators = decorators;\n }\n if (accessibility) pp.accessibility = accessibility;\n if (readonly) pp.readonly = readonly;\n if (elt.type !== \"Identifier\" && elt.type !== \"AssignmentPattern\") {\n this.raise(pp.start, TSErrors.UnsupportedParameterPropertyKind);\n }\n pp.parameter = ((elt: any): N.Identifier | N.AssignmentPattern);\n return this.finishNode(pp, \"TSParameterProperty\");\n }\n\n if (decorators.length) {\n left.decorators = decorators;\n }\n\n return elt;\n }\n\n parseFunctionBodyAndFinish(\n node: N.BodilessFunctionOrMethodBase,\n type: string,\n isMethod?: boolean = false,\n ): void {\n if (this.match(tt.colon)) {\n node.returnType = this.tsParseTypeOrTypePredicateAnnotation(tt.colon);\n }\n\n const bodilessType =\n type === \"FunctionDeclaration\"\n ? \"TSDeclareFunction\"\n : type === \"ClassMethod\"\n ? \"TSDeclareMethod\"\n : undefined;\n if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) {\n this.finishNode(node, bodilessType);\n return;\n }\n if (bodilessType === \"TSDeclareFunction\" && this.state.isDeclareContext) {\n this.raise(node.start, TSErrors.DeclareFunctionHasImplementation);\n if (\n // $FlowIgnore\n node.declare\n ) {\n super.parseFunctionBodyAndFinish(node, bodilessType, isMethod);\n return;\n }\n }\n\n super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n registerFunctionStatementId(node: N.Function): void {\n if (!node.body && node.id) {\n // Function ids are validated after parsing their body.\n // For bodyless function, we need to do it here.\n this.checkLVal(node.id, \"function name\", BIND_TS_AMBIENT);\n } else {\n super.registerFunctionStatementId(...arguments);\n }\n }\n\n tsCheckForInvalidTypeCasts(items: $ReadOnlyArray) {\n items.forEach(node => {\n if (node?.type === \"TSTypeCastExpression\") {\n this.raise(\n node.typeAnnotation.start,\n TSErrors.UnexpectedTypeAnnotation,\n );\n }\n });\n }\n\n toReferencedList(\n exprList: $ReadOnlyArray,\n isInParens?: boolean, // eslint-disable-line no-unused-vars\n ): $ReadOnlyArray {\n // Handles invalid scenarios like: `f(a:b)`, `(a:b);`, and `(a:b,c:d)`.\n //\n // Note that `f(a:b)` goes through a different path and is handled\n // in `parseSubscript` directly.\n this.tsCheckForInvalidTypeCasts(exprList);\n return exprList;\n }\n\n parseArrayLike(...args): N.ArrayExpression | N.TupleExpression {\n const node = super.parseArrayLike(...args);\n\n if (node.type === \"ArrayExpression\") {\n this.tsCheckForInvalidTypeCasts(node.elements);\n }\n\n return node;\n }\n\n parseSubscript(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls: ?boolean,\n state: N.ParseSubscriptState,\n ): N.Expression {\n if (!this.hasPrecedingLineBreak() && this.match(tt.bang)) {\n this.state.exprAllowed = false;\n this.next();\n\n const nonNullExpression: N.TsNonNullExpression = this.startNodeAt(\n startPos,\n startLoc,\n );\n nonNullExpression.expression = base;\n return this.finishNode(nonNullExpression, \"TSNonNullExpression\");\n }\n\n if (this.isRelational(\"<\")) {\n // tsTryParseAndCatch is expensive, so avoid if not necessary.\n // There are number of things we are going to \"maybe\" parse, like type arguments on\n // tagged template expressions. If any of them fail, walk it back and continue.\n const result = this.tsTryParseAndCatch(() => {\n if (!noCalls && this.atPossibleAsyncArrow(base)) {\n // Almost certainly this is a generic async function `async () => ...\n // But it might be a call with a type argument `async();`\n const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(\n startPos,\n startLoc,\n );\n if (asyncArrowFn) {\n return asyncArrowFn;\n }\n }\n\n const node: N.CallExpression = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n\n const typeArguments = this.tsParseTypeArguments();\n\n if (typeArguments) {\n if (!noCalls && this.eat(tt.parenL)) {\n // possibleAsync always false here, because we would have handled it above.\n // $FlowIgnore (won't be any undefined arguments)\n node.arguments = this.parseCallExpressionArguments(\n tt.parenR,\n /* possibleAsync */ false,\n );\n\n // Handles invalid case: `f(a:b)`\n this.tsCheckForInvalidTypeCasts(node.arguments);\n\n node.typeParameters = typeArguments;\n return this.finishCallExpression(node, state.optionalChainMember);\n } else if (this.match(tt.backQuote)) {\n const result = this.parseTaggedTemplateExpression(\n base,\n startPos,\n startLoc,\n state,\n );\n result.typeParameters = typeArguments;\n return result;\n }\n }\n\n this.unexpected();\n });\n\n if (result) return result;\n }\n\n return super.parseSubscript(base, startPos, startLoc, noCalls, state);\n }\n\n parseNewArguments(node: N.NewExpression): void {\n if (this.isRelational(\"<\")) {\n // tsTryParseAndCatch is expensive, so avoid if not necessary.\n // 99% certain this is `new C();`. But may be `new C < T;`, which is also legal.\n const typeParameters = this.tsTryParseAndCatch(() => {\n const args = this.tsParseTypeArguments();\n if (!this.match(tt.parenL)) this.unexpected();\n return args;\n });\n if (typeParameters) {\n node.typeParameters = typeParameters;\n }\n }\n\n super.parseNewArguments(node);\n }\n\n parseExprOp(\n left: N.Expression,\n leftStartPos: number,\n leftStartLoc: Position,\n minPrec: number,\n ) {\n if (\n nonNull(tt._in.binop) > minPrec &&\n !this.hasPrecedingLineBreak() &&\n this.isContextual(\"as\")\n ) {\n const node: N.TsAsExpression = this.startNodeAt(\n leftStartPos,\n leftStartLoc,\n );\n node.expression = left;\n const _const = this.tsTryNextParseConstantContext();\n if (_const) {\n node.typeAnnotation = _const;\n } else {\n node.typeAnnotation = this.tsNextThenParseType();\n }\n this.finishNode(node, \"TSAsExpression\");\n // rescan `<`, `>` because they were scanned when this.state.inType was true\n this.reScan_lt_gt();\n return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec);\n }\n\n return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec);\n }\n\n checkReservedWord(\n word: string, // eslint-disable-line no-unused-vars\n startLoc: number, // eslint-disable-line no-unused-vars\n checkKeywords: boolean, // eslint-disable-line no-unused-vars\n // eslint-disable-next-line no-unused-vars\n isBinding: boolean,\n ): void {\n // Don't bother checking for TypeScript code.\n // Strict mode words may be allowed as in `declare namespace N { const static: number; }`.\n // And we have a type checker anyway, so don't bother having the parser do it.\n }\n\n /*\n Don't bother doing this check in TypeScript code because:\n 1. We may have a nested export statement with the same name:\n export const x = 0;\n export namespace N {\n export const x = 1;\n }\n 2. We have a type checker to warn us about this sort of thing.\n */\n checkDuplicateExports() {}\n\n parseImport(node: N.Node): N.AnyImport {\n if (this.match(tt.name) || this.match(tt.star) || this.match(tt.braceL)) {\n const ahead = this.lookahead();\n\n if (this.match(tt.name) && ahead.type === tt.eq) {\n return this.tsParseImportEqualsDeclaration(node);\n }\n\n if (\n this.isContextual(\"type\") &&\n // import type, { a } from \"b\";\n ahead.type !== tt.comma &&\n // import type from \"a\";\n !(ahead.type === tt.name && ahead.value === \"from\")\n ) {\n node.importKind = \"type\";\n this.next();\n }\n }\n\n if (!node.importKind) {\n node.importKind = \"value\";\n }\n\n const importNode = super.parseImport(node);\n /*:: invariant(importNode.type !== \"TSImportEqualsDeclaration\") */\n\n // `import type` can only be used on imports with named imports or with a\n // default import - but not both\n if (\n importNode.importKind === \"type\" &&\n importNode.specifiers.length > 1 &&\n importNode.specifiers[0].type === \"ImportDefaultSpecifier\"\n ) {\n this.raise(\n importNode.start,\n \"A type-only import can specify a default import or named bindings, but not both.\",\n );\n }\n\n return importNode;\n }\n\n parseExport(node: N.Node): N.AnyExport {\n if (this.match(tt._import)) {\n // `export import A = B;`\n this.expect(tt._import);\n return this.tsParseImportEqualsDeclaration(node, /* isExport */ true);\n } else if (this.eat(tt.eq)) {\n // `export = x;`\n const assign: N.TsExportAssignment = node;\n assign.expression = this.parseExpression();\n this.semicolon();\n return this.finishNode(assign, \"TSExportAssignment\");\n } else if (this.eatContextual(\"as\")) {\n // `export as namespace A;`\n const decl: N.TsNamespaceExportDeclaration = node;\n // See `parseNamespaceExportDeclaration` in TypeScript's own parser\n this.expectContextual(\"namespace\");\n decl.id = this.parseIdentifier();\n this.semicolon();\n return this.finishNode(decl, \"TSNamespaceExportDeclaration\");\n } else {\n if (this.isContextual(\"type\") && this.lookahead().type === tt.braceL) {\n this.next();\n node.exportKind = \"type\";\n } else {\n node.exportKind = \"value\";\n }\n\n return super.parseExport(node);\n }\n }\n\n isAbstractClass(): boolean {\n return (\n this.isContextual(\"abstract\") && this.lookahead().type === tt._class\n );\n }\n\n parseExportDefaultExpression(): N.Expression | N.Declaration {\n if (this.isAbstractClass()) {\n const cls = this.startNode();\n this.next(); // Skip \"abstract\"\n this.parseClass(cls, true, true);\n cls.abstract = true;\n return cls;\n }\n\n // export default interface allowed in:\n // https://github.com/Microsoft/TypeScript/pull/16040\n if (this.state.value === \"interface\") {\n const result = this.tsParseDeclaration(\n this.startNode(),\n this.state.value,\n true,\n );\n\n if (result) return result;\n }\n\n return super.parseExportDefaultExpression();\n }\n\n parseStatementContent(context: ?string, topLevel: ?boolean): N.Statement {\n if (this.state.type === tt._const) {\n const ahead = this.lookahead();\n if (ahead.type === tt.name && ahead.value === \"enum\") {\n const node: N.TsEnumDeclaration = this.startNode();\n this.expect(tt._const);\n this.expectContextual(\"enum\");\n return this.tsParseEnumDeclaration(node, /* isConst */ true);\n }\n }\n return super.parseStatementContent(context, topLevel);\n }\n\n parseAccessModifier(): ?N.Accessibility {\n return this.tsParseModifier([\"public\", \"protected\", \"private\"]);\n }\n\n parseClassMember(\n classBody: N.ClassBody,\n member: any,\n state: N.ParseClassMemberState,\n ): void {\n this.tsParseModifiers(member, [\"declare\"]);\n const accessibility = this.parseAccessModifier();\n if (accessibility) member.accessibility = accessibility;\n this.tsParseModifiers(member, [\"declare\"]);\n\n const callParseClassMember = () => {\n super.parseClassMember(classBody, member, state);\n };\n if (member.declare) {\n this.tsInDeclareContext(callParseClassMember);\n } else {\n callParseClassMember();\n }\n }\n\n parseClassMemberWithIsStatic(\n classBody: N.ClassBody,\n member: N.ClassMember | N.TsIndexSignature,\n state: N.ParseClassMemberState,\n isStatic: boolean,\n ): void {\n this.tsParseModifiers(member, [\"abstract\", \"readonly\", \"declare\"]);\n\n const idx = this.tsTryParseIndexSignature(member);\n if (idx) {\n classBody.body.push(idx);\n\n if ((member: any).abstract) {\n this.raise(member.start, TSErrors.IndexSignatureHasAbstract);\n }\n if (isStatic) {\n this.raise(member.start, TSErrors.IndexSignatureHasStatic);\n }\n if ((member: any).accessibility) {\n this.raise(\n member.start,\n TSErrors.IndexSignatureHasAccessibility,\n (member: any).accessibility,\n );\n }\n if ((member: any).declare) {\n this.raise(member.start, TSErrors.IndexSignatureHasDeclare);\n }\n\n return;\n }\n\n /*:: invariant(member.type !== \"TSIndexSignature\") */\n\n super.parseClassMemberWithIsStatic(classBody, member, state, isStatic);\n }\n\n parsePostMemberNameModifiers(\n methodOrProp: N.ClassMethod | N.ClassProperty | N.ClassPrivateProperty,\n ): void {\n const optional = this.eat(tt.question);\n if (optional) methodOrProp.optional = true;\n\n if ((methodOrProp: any).readonly && this.match(tt.parenL)) {\n this.raise(methodOrProp.start, TSErrors.ClassMethodHasReadonly);\n }\n\n if ((methodOrProp: any).declare && this.match(tt.parenL)) {\n this.raise(methodOrProp.start, TSErrors.ClassMethodHasDeclare);\n }\n }\n\n // Note: The reason we do this in `parseExpressionStatement` and not `parseStatement`\n // is that e.g. `type()` is valid JS, so we must try parsing that first.\n // If it's really a type, we will parse `type` as the statement, and can correct it here\n // by parsing the rest.\n parseExpressionStatement(\n node: N.ExpressionStatement,\n expr: N.Expression,\n ): N.Statement {\n const decl =\n expr.type === \"Identifier\"\n ? this.tsParseExpressionStatement(node, expr)\n : undefined;\n return decl || super.parseExpressionStatement(node, expr);\n }\n\n // export type\n // Should be true for anything parsed by `tsTryParseExportDeclaration`.\n shouldParseExportDeclaration(): boolean {\n if (this.tsIsDeclarationStart()) return true;\n return super.shouldParseExportDeclaration();\n }\n\n // An apparent conditional expression could actually be an optional parameter in an arrow function.\n parseConditional(\n expr: N.Expression,\n startPos: number,\n startLoc: Position,\n refNeedsArrowPos?: ?Pos,\n ): N.Expression {\n // only do the expensive clone if there is a question mark\n // and if we come from inside parens\n if (!refNeedsArrowPos || !this.match(tt.question)) {\n return super.parseConditional(\n expr,\n startPos,\n startLoc,\n refNeedsArrowPos,\n );\n }\n\n const result = this.tryParse(() =>\n super.parseConditional(expr, startPos, startLoc),\n );\n\n if (!result.node) {\n // $FlowIgnore\n refNeedsArrowPos.start = result.error.pos || this.state.start;\n return expr;\n }\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n // Note: These \"type casts\" are *not* valid TS expressions.\n // But we parse them here and change them when completing the arrow function.\n parseParenItem(\n node: N.Expression,\n startPos: number,\n startLoc: Position,\n ): N.Expression {\n node = super.parseParenItem(node, startPos, startLoc);\n if (this.eat(tt.question)) {\n node.optional = true;\n // Include questionmark in location of node\n // Don't use this.finishNode() as otherwise we might process comments twice and\n // include already consumed parens\n this.resetEndLocation(node);\n }\n\n if (this.match(tt.colon)) {\n const typeCastNode: N.TsTypeCastExpression = this.startNodeAt(\n startPos,\n startLoc,\n );\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();\n\n return this.finishNode(typeCastNode, \"TSTypeCastExpression\");\n }\n\n return node;\n }\n\n parseExportDeclaration(node: N.ExportNamedDeclaration): ?N.Declaration {\n // Store original location/position\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n\n // \"export declare\" is equivalent to just \"export\".\n const isDeclare = this.eatContextual(\"declare\");\n\n let declaration: ?N.Declaration;\n\n if (this.match(tt.name)) {\n declaration = this.tsTryParseExportDeclaration();\n }\n if (!declaration) {\n declaration = super.parseExportDeclaration(node);\n }\n if (\n declaration &&\n (declaration.type === \"TSInterfaceDeclaration\" ||\n declaration.type === \"TSTypeAliasDeclaration\" ||\n isDeclare)\n ) {\n node.exportKind = \"type\";\n }\n\n if (declaration && isDeclare) {\n // Reset location to include `declare` in range\n this.resetStartLocation(declaration, startPos, startLoc);\n\n declaration.declare = true;\n }\n\n return declaration;\n }\n\n parseClassId(\n node: N.Class,\n isStatement: boolean,\n optionalId: ?boolean,\n ): void {\n if ((!isStatement || optionalId) && this.isContextual(\"implements\")) {\n return;\n }\n\n super.parseClassId(\n node,\n isStatement,\n optionalId,\n (node: any).declare ? BIND_TS_AMBIENT : BIND_CLASS,\n );\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) node.typeParameters = typeParameters;\n }\n\n parseClassPropertyAnnotation(\n node: N.ClassProperty | N.ClassPrivateProperty,\n ): void {\n if (!node.optional && this.eat(tt.bang)) {\n node.definite = true;\n }\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n }\n\n parseClassProperty(node: N.ClassProperty): N.ClassProperty {\n this.parseClassPropertyAnnotation(node);\n\n if (this.state.isDeclareContext && this.match(tt.eq)) {\n this.raise(this.state.start, TSErrors.DeclareClassFieldHasInitializer);\n }\n\n return super.parseClassProperty(node);\n }\n\n parseClassPrivateProperty(\n node: N.ClassPrivateProperty,\n ): N.ClassPrivateProperty {\n // $FlowIgnore\n if (node.abstract) {\n this.raise(node.start, TSErrors.PrivateElementHasAbstract);\n }\n\n // $FlowIgnore\n if (node.accessibility) {\n this.raise(\n node.start,\n TSErrors.PrivateElementHasAccessibility,\n node.accessibility,\n );\n }\n\n this.parseClassPropertyAnnotation(node);\n return super.parseClassPrivateProperty(node);\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters && isConstructor) {\n this.raise(typeParameters.start, TSErrors.ConstructorHasTypeParameters);\n }\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassMethod(\n classBody,\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n );\n }\n\n pushClassPrivateMethod(\n classBody: N.ClassBody,\n method: N.ClassPrivateMethod,\n isGenerator: boolean,\n isAsync: boolean,\n ): void {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n parseClassSuper(node: N.Class): void {\n super.parseClassSuper(node);\n if (node.superClass && this.isRelational(\"<\")) {\n node.superTypeParameters = this.tsParseTypeArguments();\n }\n if (this.eatContextual(\"implements\")) {\n node.implements = this.tsParseHeritageClause(\"implements\");\n }\n }\n\n parseObjPropValue(prop: N.ObjectMember, ...args): void {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) prop.typeParameters = typeParameters;\n\n super.parseObjPropValue(prop, ...args);\n }\n\n parseFunctionParams(node: N.Function, allowModifiers?: boolean): void {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) node.typeParameters = typeParameters;\n super.parseFunctionParams(node, allowModifiers);\n }\n\n // `let x: number;`\n parseVarId(\n decl: N.VariableDeclarator,\n kind: \"var\" | \"let\" | \"const\",\n ): void {\n super.parseVarId(decl, kind);\n if (decl.id.type === \"Identifier\" && this.eat(tt.bang)) {\n decl.definite = true;\n }\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) {\n decl.id.typeAnnotation = type;\n this.resetEndLocation(decl.id); // set end position to end of type\n }\n }\n\n // parse the return type of an async arrow function - let foo = (async (): number => {});\n parseAsyncArrowFromCallExpression(\n node: N.ArrowFunctionExpression,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n node.returnType = this.tsParseTypeAnnotation();\n }\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n parseMaybeAssign(...args): N.Expression {\n // Note: When the JSX plugin is on, type assertions (` x`) aren't valid syntax.\n\n let state: ?State;\n let jsx;\n let typeCast;\n\n if (this.match(tt.jsxTagStart)) {\n // Prefer to parse JSX if possible. But may be an arrow fn.\n state = this.state.clone();\n\n jsx = this.tryParse(() => super.parseMaybeAssign(...args), state);\n /*:: invariant(!jsx.aborted) */\n\n if (!jsx.error) return jsx.node;\n\n // Remove `tc.j_expr` and `tc.j_oTag` from context added\n // by parsing `jsxTagStart` to stop the JSX plugin from\n // messing with the tokens\n const { context } = this.state;\n if (context[context.length - 1] === ct.j_oTag) {\n context.length -= 2;\n } else if (context[context.length - 1] === ct.j_expr) {\n context.length -= 1;\n }\n }\n\n if (!jsx?.error && !this.isRelational(\"<\")) {\n return super.parseMaybeAssign(...args);\n }\n\n // Either way, we're looking at a '<': tt.jsxTagStart or relational.\n\n let typeParameters: N.TsTypeParameterDeclaration;\n state = state || this.state.clone();\n\n const arrow = this.tryParse(abort => {\n // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`.\n typeParameters = this.tsParseTypeParameters();\n const expr = super.parseMaybeAssign(...args);\n\n if (\n expr.type !== \"ArrowFunctionExpression\" ||\n (expr.extra && expr.extra.parenthesized)\n ) {\n abort();\n }\n\n // Correct TypeScript code should have at least 1 type parameter, but don't crash on bad code.\n if (typeParameters?.params.length !== 0) {\n this.resetStartLocationFromNode(expr, typeParameters);\n }\n expr.typeParameters = typeParameters;\n return expr;\n }, state);\n\n if (!arrow.error && !arrow.aborted) return arrow.node;\n\n if (!jsx) {\n // Try parsing a type cast instead of an arrow function.\n // This will never happen outside of JSX.\n // (Because in JSX the '<' should be a jsxTagStart and not a relational.\n assert(!this.hasPlugin(\"jsx\"));\n\n // This will start with a type assertion (via parseMaybeUnary).\n // But don't directly call `this.tsParseTypeAssertion` because we want to handle any binary after it.\n typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state);\n /*:: invariant(!typeCast.aborted) */\n if (!typeCast.error) return typeCast.node;\n }\n\n if (jsx?.node) {\n /*:: invariant(jsx.failState) */\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrow.node) {\n /*:: invariant(arrow.failState) */\n this.state = arrow.failState;\n return arrow.node;\n }\n\n if (typeCast?.node) {\n /*:: invariant(typeCast.failState) */\n this.state = typeCast.failState;\n return typeCast.node;\n }\n\n if (jsx?.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n if (typeCast?.thrown) throw typeCast.error;\n\n throw jsx?.error || arrow.error || typeCast?.error;\n }\n\n // Handle type assertions\n parseMaybeUnary(refExpressionErrors?: ?ExpressionErrors): N.Expression {\n if (!this.hasPlugin(\"jsx\") && this.isRelational(\"<\")) {\n return this.tsParseTypeAssertion();\n } else {\n return super.parseMaybeUnary(refExpressionErrors);\n }\n }\n\n parseArrow(node: N.ArrowFunctionExpression): ?N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n // This is different from how the TS parser does it.\n // TS uses lookahead. The Babel Parser parses it as a parenthesized expression and converts.\n\n const result = this.tryParse(abort => {\n const returnType = this.tsParseTypeOrTypePredicateAnnotation(\n tt.colon,\n );\n if (this.canInsertSemicolon() || !this.match(tt.arrow)) abort();\n return returnType;\n });\n\n if (result.aborted) return;\n\n if (!result.thrown) {\n if (result.error) this.state = result.failState;\n node.returnType = result.node;\n }\n }\n\n return super.parseArrow(node);\n }\n\n // Allow type annotations inside of a parameter list.\n parseAssignableListItemTypes(param: N.Pattern) {\n if (this.eat(tt.question)) {\n if (\n param.type !== \"Identifier\" &&\n !this.state.isDeclareContext &&\n !this.state.inType\n ) {\n this.raise(param.start, TSErrors.PatternIsOptional);\n }\n\n ((param: any): N.Identifier).optional = true;\n }\n const type = this.tsTryParseTypeAnnotation();\n if (type) param.typeAnnotation = type;\n this.resetEndLocation(param);\n\n return param;\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): N.Node {\n switch (node.type) {\n case \"TSTypeCastExpression\":\n return super.toAssignable(this.typeCastToParameter(node), isLHS);\n case \"TSParameterProperty\":\n return super.toAssignable(node, isLHS);\n case \"TSAsExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n node.expression = this.toAssignable(node.expression, isLHS);\n return node;\n default:\n return super.toAssignable(node, isLHS);\n }\n }\n\n checkLVal(\n expr: N.Expression,\n contextDescription: string,\n ...args:\n | [BindingTypes | void]\n | [BindingTypes | void, ?Set, boolean | void, boolean | void]\n ): void {\n switch (expr.type) {\n case \"TSTypeCastExpression\":\n // Allow \"typecasts\" to appear on the left of assignment expressions,\n // because it may be in an arrow function.\n // e.g. `const f = (foo: number = 0) => foo;`\n return;\n case \"TSParameterProperty\":\n this.checkLVal(expr.parameter, \"parameter property\", ...args);\n return;\n case \"TSAsExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n this.checkLVal(expr.expression, contextDescription, ...args);\n return;\n default:\n super.checkLVal(expr, contextDescription, ...args);\n return;\n }\n }\n\n parseBindingAtom(): N.Pattern {\n switch (this.state.type) {\n case tt._this:\n // \"this\" may be the name of a parameter, so allow it.\n return this.parseIdentifier(/* liberal */ true);\n default:\n return super.parseBindingAtom();\n }\n }\n\n parseMaybeDecoratorArguments(expr: N.Expression): N.Expression {\n if (this.isRelational(\"<\")) {\n const typeArguments = this.tsParseTypeArguments();\n\n if (this.match(tt.parenL)) {\n const call = super.parseMaybeDecoratorArguments(expr);\n call.typeParameters = typeArguments;\n return call;\n }\n\n this.unexpected(this.state.start, tt.parenL);\n }\n\n return super.parseMaybeDecoratorArguments(expr);\n }\n\n // === === === === === === === === === === === === === === === ===\n // Note: All below methods are duplicates of something in flow.js.\n // Not sure what the best way to combine these is.\n // === === === === === === === === === === === === === === === ===\n\n isClassMethod(): boolean {\n return this.isRelational(\"<\") || super.isClassMethod();\n }\n\n isClassProperty(): boolean {\n return (\n this.match(tt.bang) || this.match(tt.colon) || super.isClassProperty()\n );\n }\n\n parseMaybeDefault(...args): N.Pattern {\n const node = super.parseMaybeDefault(...args);\n\n if (\n node.type === \"AssignmentPattern\" &&\n node.typeAnnotation &&\n node.right.start < node.typeAnnotation.start\n ) {\n this.raise(\n node.typeAnnotation.start,\n TSErrors.TypeAnnotationAfterAssign,\n );\n }\n\n return node;\n }\n\n // ensure that inside types, we bypass the jsx parser plugin\n getTokenFromCode(code: number): void {\n if (\n this.state.inType &&\n (code === charCodes.greaterThan || code === charCodes.lessThan)\n ) {\n return this.finishOp(tt.relational, 1);\n } else {\n return super.getTokenFromCode(code);\n }\n }\n\n // used after we have finished parsing types\n reScan_lt_gt() {\n if (this.match(tt.relational)) {\n const code = this.input.charCodeAt(this.state.start);\n if (code === charCodes.lessThan || code === charCodes.greaterThan) {\n this.state.pos -= 1;\n this.readToken_lt_gt(code);\n }\n }\n }\n\n toAssignableList(exprList: N.Expression[]): $ReadOnlyArray {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (!expr) continue;\n switch (expr.type) {\n case \"TSTypeCastExpression\":\n exprList[i] = this.typeCastToParameter(expr);\n break;\n case \"TSAsExpression\":\n case \"TSTypeAssertion\":\n if (!this.state.maybeInArrowParameters) {\n exprList[i] = this.typeCastToParameter(expr);\n } else {\n this.raise(expr.start, TSErrors.UnexpectedTypeCastInParameter);\n }\n break;\n }\n }\n return super.toAssignableList(...arguments);\n }\n\n typeCastToParameter(node: N.TsTypeCastExpression): N.Node {\n node.expression.typeAnnotation = node.typeAnnotation;\n\n this.resetEndLocation(\n node.expression,\n node.typeAnnotation.end,\n node.typeAnnotation.loc.end,\n );\n\n return node.expression;\n }\n\n shouldParseArrow() {\n return this.match(tt.colon) || super.shouldParseArrow();\n }\n\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseAsyncArrow();\n }\n\n canHaveLeadingDecorator() {\n // Avoid unnecessary lookahead in checking for abstract class unless needed!\n return super.canHaveLeadingDecorator() || this.isAbstractClass();\n }\n\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement {\n if (this.isRelational(\"<\")) {\n const typeArguments = this.tsTryParseAndCatch(() =>\n this.tsParseTypeArguments(),\n );\n if (typeArguments) node.typeParameters = typeArguments;\n }\n return super.jsxParseOpeningElementAfterName(node);\n }\n\n getGetterSetterExpectedParamCount(\n method: N.ObjectMethod | N.ClassMethod,\n ): number {\n const baseCount = super.getGetterSetterExpectedParamCount(method);\n const params = this.getObjectOrClassMethodParams(method);\n const firstParam = params[0];\n const hasContextParam =\n firstParam &&\n firstParam.type === \"Identifier\" &&\n firstParam.name === \"this\";\n\n return hasContextParam ? baseCount + 1 : baseCount;\n }\n\n parseCatchClauseParam(): N.Pattern {\n const param = super.parseCatchClauseParam();\n const type = this.tsTryParseTypeAnnotation();\n\n if (type) {\n param.typeAnnotation = type;\n this.resetEndLocation(param);\n }\n\n return param;\n }\n\n tsInDeclareContext(cb: () => T): T {\n const oldIsDeclareContext = this.state.isDeclareContext;\n this.state.isDeclareContext = true;\n try {\n return cb();\n } finally {\n this.state.isDeclareContext = oldIsDeclareContext;\n }\n }\n };\n","// @flow\n\nimport * as charCodes from \"charcodes\";\n\nimport { types as tt, TokenType } from \"../tokenizer/types\";\nimport type Parser from \"../parser\";\nimport * as N from \"../types\";\n\ntt.placeholder = new TokenType(\"%%\", { startsExpr: true });\n\nexport type PlaceholderTypes =\n | \"Identifier\"\n | \"StringLiteral\"\n | \"Expression\"\n | \"Statement\"\n | \"Declaration\"\n | \"BlockStatement\"\n | \"ClassBody\"\n | \"Pattern\";\n\n// $PropertyType doesn't support enums. Use a fake \"switch\" (GetPlaceholderNode)\n//type MaybePlaceholder = $PropertyType | N.Placeholder;\n\ntype _Switch = $Call<\n (\n $ElementType<$ElementType, 0>,\n ) => $ElementType<$ElementType, 1>,\n Value,\n>;\ntype $Switch = _Switch;\n\ntype NodeOf = $Switch<\n T,\n [\n [\"Identifier\", N.Identifier],\n [\"StringLiteral\", N.StringLiteral],\n [\"Expression\", N.Expression],\n [\"Statement\", N.Statement],\n [\"Declaration\", N.Declaration],\n [\"BlockStatement\", N.BlockStatement],\n [\"ClassBody\", N.ClassBody],\n [\"Pattern\", N.Pattern],\n ],\n>;\n\n// Placeholder breaks everything, because its type is incompatible with\n// the substituted nodes.\ntype MaybePlaceholder = NodeOf; // | Placeholder\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n parsePlaceholder(\n expectedNode: T,\n ): /*?N.Placeholder*/ ?MaybePlaceholder {\n if (this.match(tt.placeholder)) {\n const node = this.startNode();\n this.next();\n this.assertNoSpace(\"Unexpected space in placeholder.\");\n\n // We can't use this.parseIdentifier because\n // we don't want nested placeholders.\n node.name = super.parseIdentifier(/* liberal */ true);\n\n this.assertNoSpace(\"Unexpected space in placeholder.\");\n this.expect(tt.placeholder);\n return this.finishPlaceholder(node, expectedNode);\n }\n }\n\n finishPlaceholder(\n node: N.Node,\n expectedNode: T,\n ): /*N.Placeholder*/ MaybePlaceholder {\n const isFinished = !!(node.expectedNode && node.type === \"Placeholder\");\n node.expectedNode = expectedNode;\n\n return isFinished ? node : this.finishNode(node, \"Placeholder\");\n }\n\n /* ============================================================ *\n * tokenizer/index.js *\n * ============================================================ */\n\n getTokenFromCode(code: number) {\n if (\n code === charCodes.percentSign &&\n this.input.charCodeAt(this.state.pos + 1) === charCodes.percentSign\n ) {\n return this.finishOp(tt.placeholder, 2);\n }\n\n return super.getTokenFromCode(...arguments);\n }\n\n /* ============================================================ *\n * parser/expression.js *\n * ============================================================ */\n\n parseExprAtom(): MaybePlaceholder<\"Expression\"> {\n return (\n this.parsePlaceholder(\"Expression\") || super.parseExprAtom(...arguments)\n );\n }\n\n parseIdentifier(): MaybePlaceholder<\"Identifier\"> {\n // NOTE: This function only handles identifiers outside of\n // expressions and binding patterns, since they are already\n // handled by the parseExprAtom and parseBindingAtom functions.\n // This is needed, for example, to parse \"class %%NAME%% {}\".\n return (\n this.parsePlaceholder(\"Identifier\") ||\n super.parseIdentifier(...arguments)\n );\n }\n\n checkReservedWord(word: string): void {\n // Sometimes we call #checkReservedWord(node.name), expecting\n // that node is an Identifier. If it is a Placeholder, name\n // will be undefined.\n if (word !== undefined) super.checkReservedWord(...arguments);\n }\n\n /* ============================================================ *\n * parser/lval.js *\n * ============================================================ */\n\n parseBindingAtom(): MaybePlaceholder<\"Pattern\"> {\n return (\n this.parsePlaceholder(\"Pattern\") || super.parseBindingAtom(...arguments)\n );\n }\n\n checkLVal(expr: N.Expression): void {\n if (expr.type !== \"Placeholder\") super.checkLVal(...arguments);\n }\n\n toAssignable(node: N.Node): N.Node {\n if (\n node &&\n node.type === \"Placeholder\" &&\n node.expectedNode === \"Expression\"\n ) {\n node.expectedNode = \"Pattern\";\n return node;\n }\n return super.toAssignable(...arguments);\n }\n\n /* ============================================================ *\n * parser/statement.js *\n * ============================================================ */\n\n verifyBreakContinue(node: N.BreakStatement | N.ContinueStatement) {\n if (node.label && node.label.type === \"Placeholder\") return;\n super.verifyBreakContinue(...arguments);\n }\n\n parseExpressionStatement(\n node: MaybePlaceholder<\"Statement\">,\n expr: N.Expression,\n ): MaybePlaceholder<\"Statement\"> {\n if (\n expr.type !== \"Placeholder\" ||\n (expr.extra && expr.extra.parenthesized)\n ) {\n return super.parseExpressionStatement(...arguments);\n }\n\n if (this.match(tt.colon)) {\n const stmt: N.LabeledStatement = node;\n stmt.label = this.finishPlaceholder(expr, \"Identifier\");\n this.next();\n stmt.body = this.parseStatement(\"label\");\n return this.finishNode(stmt, \"LabeledStatement\");\n }\n\n this.semicolon();\n\n node.name = expr.name;\n return this.finishPlaceholder(node, \"Statement\");\n }\n\n parseBlock(): MaybePlaceholder<\"BlockStatement\"> {\n return (\n this.parsePlaceholder(\"BlockStatement\") ||\n super.parseBlock(...arguments)\n );\n }\n\n parseFunctionId(): ?MaybePlaceholder<\"Identifier\"> {\n return (\n this.parsePlaceholder(\"Identifier\") ||\n super.parseFunctionId(...arguments)\n );\n }\n\n parseClass(\n node: T,\n isStatement: /* T === ClassDeclaration */ boolean,\n optionalId?: boolean,\n ): T {\n const type = isStatement ? \"ClassDeclaration\" : \"ClassExpression\";\n\n this.next();\n this.takeDecorators(node);\n const oldStrict = this.state.strict;\n\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (placeholder) {\n if (\n this.match(tt._extends) ||\n this.match(tt.placeholder) ||\n this.match(tt.braceL)\n ) {\n node.id = placeholder;\n } else if (optionalId || !isStatement) {\n node.id = null;\n node.body = this.finishPlaceholder(placeholder, \"ClassBody\");\n return this.finishNode(node, type);\n } else {\n this.unexpected(null, \"A class name is required\");\n }\n } else {\n this.parseClassId(node, isStatement, optionalId);\n }\n\n this.parseClassSuper(node);\n node.body =\n this.parsePlaceholder(\"ClassBody\") ||\n this.parseClassBody(!!node.superClass, oldStrict);\n return this.finishNode(node, type);\n }\n\n parseExport(node: N.Node): N.Node {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseExport(...arguments);\n\n if (!this.isContextual(\"from\") && !this.match(tt.comma)) {\n // export %%DECL%%;\n node.specifiers = [];\n node.source = null;\n node.declaration = this.finishPlaceholder(placeholder, \"Declaration\");\n return this.finishNode(node, \"ExportNamedDeclaration\");\n }\n\n // export %%NAME%% from \"foo\";\n this.expectPlugin(\"exportDefaultFrom\");\n const specifier = this.startNode();\n specifier.exported = placeholder;\n node.specifiers = [this.finishNode(specifier, \"ExportDefaultSpecifier\")];\n\n return super.parseExport(node);\n }\n\n isExportDefaultSpecifier(): boolean {\n if (this.match(tt._default)) {\n const next = this.nextTokenStart();\n if (this.isUnparsedContextual(next, \"from\")) {\n if (\n this.input.startsWith(\n tt.placeholder.label,\n this.nextTokenStartSince(next + 4),\n )\n ) {\n return true;\n }\n }\n }\n return super.isExportDefaultSpecifier();\n }\n\n maybeParseExportDefaultSpecifier(node: N.Node): boolean {\n if (node.specifiers && node.specifiers.length > 0) {\n // \"export %%NAME%%\" has already been parsed by #parseExport.\n return true;\n }\n return super.maybeParseExportDefaultSpecifier(...arguments);\n }\n\n checkExport(node: N.ExportNamedDeclaration): void {\n const { specifiers } = node;\n if (specifiers?.length) {\n node.specifiers = specifiers.filter(\n node => node.exported.type === \"Placeholder\",\n );\n }\n super.checkExport(node);\n node.specifiers = specifiers;\n }\n\n parseImport(\n node: N.Node,\n ): N.ImportDeclaration | N.TsImportEqualsDeclaration {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseImport(...arguments);\n\n node.specifiers = [];\n\n if (!this.isContextual(\"from\") && !this.match(tt.comma)) {\n // import %%STRING%%;\n node.source = this.finishPlaceholder(placeholder, \"StringLiteral\");\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n // import %%DEFAULT%% ...\n const specifier = this.startNodeAtNode(placeholder);\n specifier.local = placeholder;\n this.finishNode(specifier, \"ImportDefaultSpecifier\");\n node.specifiers.push(specifier);\n\n if (this.eat(tt.comma)) {\n // import %%DEFAULT%%, * as ...\n const hasStarImport = this.maybeParseStarImportSpecifier(node);\n\n // import %%DEFAULT%%, { ...\n if (!hasStarImport) this.parseNamedImportSpecifiers(node);\n }\n\n this.expectContextual(\"from\");\n node.source = this.parseImportSource();\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n parseImportSource(): MaybePlaceholder<\"StringLiteral\"> {\n // import ... from %%STRING%%;\n\n return (\n this.parsePlaceholder(\"StringLiteral\") ||\n super.parseImportSource(...arguments)\n );\n }\n };\n","import type Parser from \"../parser\";\nimport { types as tt } from \"../tokenizer/types\";\nimport * as N from \"../types\";\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n parseV8Intrinsic(): N.Expression {\n if (this.match(tt.modulo)) {\n const v8IntrinsicStart = this.state.start;\n // let the `loc` of Identifier starts from `%`\n const node = this.startNode();\n this.eat(tt.modulo);\n if (this.match(tt.name)) {\n const name = this.parseIdentifierName(this.state.start);\n const identifier = this.createIdentifier(node, name);\n identifier.type = \"V8IntrinsicIdentifier\";\n if (this.match(tt.parenL)) {\n return identifier;\n }\n }\n this.unexpected(v8IntrinsicStart);\n }\n }\n\n /* ============================================================ *\n * parser/expression.js *\n * ============================================================ */\n\n parseExprAtom(): N.Expression {\n return this.parseV8Intrinsic() || super.parseExprAtom(...arguments);\n }\n };\n","// @flow\n\nimport type Parser from \"./parser\";\n\nexport type Plugin = string | [string, Object];\n\nexport type PluginList = $ReadOnlyArray;\n\nexport type MixinPlugin = (superClass: Class) => Class;\n\nexport function hasPlugin(plugins: PluginList, name: string): boolean {\n return plugins.some(plugin => {\n if (Array.isArray(plugin)) {\n return plugin[0] === name;\n } else {\n return plugin === name;\n }\n });\n}\n\nexport function getPluginOption(\n plugins: PluginList,\n name: string,\n option: string,\n) {\n const plugin = plugins.find(plugin => {\n if (Array.isArray(plugin)) {\n return plugin[0] === name;\n } else {\n return plugin === name;\n }\n });\n\n if (plugin && Array.isArray(plugin)) {\n return plugin[1][option];\n }\n\n return null;\n}\n\nconst PIPELINE_PROPOSALS = [\"minimal\", \"smart\", \"fsharp\"];\nconst RECORD_AND_TUPLE_SYNTAX_TYPES = [\"hash\", \"bar\"];\n\nexport function validatePlugins(plugins: PluginList) {\n if (hasPlugin(plugins, \"decorators\")) {\n if (hasPlugin(plugins, \"decorators-legacy\")) {\n throw new Error(\n \"Cannot use the decorators and decorators-legacy plugin together\",\n );\n }\n\n const decoratorsBeforeExport = getPluginOption(\n plugins,\n \"decorators\",\n \"decoratorsBeforeExport\",\n );\n if (decoratorsBeforeExport == null) {\n throw new Error(\n \"The 'decorators' plugin requires a 'decoratorsBeforeExport' option,\" +\n \" whose value must be a boolean. If you are migrating from\" +\n \" Babylon/Babel 6 or want to use the old decorators proposal, you\" +\n \" should use the 'decorators-legacy' plugin instead of 'decorators'.\",\n );\n } else if (typeof decoratorsBeforeExport !== \"boolean\") {\n throw new Error(\"'decoratorsBeforeExport' must be a boolean.\");\n }\n }\n\n if (hasPlugin(plugins, \"flow\") && hasPlugin(plugins, \"typescript\")) {\n throw new Error(\"Cannot combine flow and typescript plugins.\");\n }\n\n if (hasPlugin(plugins, \"placeholders\") && hasPlugin(plugins, \"v8intrinsic\")) {\n throw new Error(\"Cannot combine placeholders and v8intrinsic plugins.\");\n }\n\n if (\n hasPlugin(plugins, \"pipelineOperator\") &&\n !PIPELINE_PROPOSALS.includes(\n getPluginOption(plugins, \"pipelineOperator\", \"proposal\"),\n )\n ) {\n throw new Error(\n \"'pipelineOperator' requires 'proposal' option whose value should be one of: \" +\n PIPELINE_PROPOSALS.map(p => `'${p}'`).join(\", \"),\n );\n }\n\n if (hasPlugin(plugins, \"moduleAttributes\")) {\n if (hasPlugin(plugins, \"importAssertions\")) {\n throw new Error(\n \"Cannot combine importAssertions and moduleAttributes plugins.\",\n );\n }\n const moduleAttributesVerionPluginOption = getPluginOption(\n plugins,\n \"moduleAttributes\",\n \"version\",\n );\n if (moduleAttributesVerionPluginOption !== \"may-2020\") {\n throw new Error(\n \"The 'moduleAttributes' plugin requires a 'version' option,\" +\n \" representing the last proposal update. Currently, the\" +\n \" only supported value is 'may-2020'.\",\n );\n }\n }\n\n if (\n hasPlugin(plugins, \"recordAndTuple\") &&\n !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(\n getPluginOption(plugins, \"recordAndTuple\", \"syntaxType\"),\n )\n ) {\n throw new Error(\n \"'recordAndTuple' requires 'syntaxType' option whose value should be one of: \" +\n RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(\", \"),\n );\n }\n}\n\n// These plugins are defined using a mixin which extends the parser class.\n\nimport estree from \"./plugins/estree\";\nimport flow from \"./plugins/flow\";\nimport jsx from \"./plugins/jsx\";\nimport typescript from \"./plugins/typescript\";\nimport placeholders from \"./plugins/placeholders\";\nimport v8intrinsic from \"./plugins/v8intrinsic\";\n\n// NOTE: order is important. estree must come first; placeholders must come last.\nexport const mixinPlugins: { [name: string]: MixinPlugin } = {\n estree,\n jsx,\n flow,\n typescript,\n v8intrinsic,\n placeholders,\n};\n\nexport const mixinPluginNames: $ReadOnlyArray = Object.keys(\n mixinPlugins,\n);\n","// @flow\n\nimport type { PluginList } from \"./plugin-utils\";\n\n// A second optional argument can be given to further configure\n// the parser process. These options are recognized:\n\nexport type SourceType = \"script\" | \"module\" | \"unambiguous\";\n\nexport type Options = {\n sourceType: SourceType,\n sourceFilename?: string,\n startLine: number,\n allowAwaitOutsideFunction: boolean,\n allowReturnOutsideFunction: boolean,\n allowImportExportEverywhere: boolean,\n allowSuperOutsideMethod: boolean,\n allowUndeclaredExports: boolean,\n plugins: PluginList,\n strictMode: ?boolean,\n ranges: boolean,\n tokens: boolean,\n createParenthesizedExpressions: boolean,\n errorRecovery: boolean,\n};\n\nexport const defaultOptions: Options = {\n // Source type (\"script\" or \"module\") for different semantics\n sourceType: \"script\",\n // Source filename.\n sourceFilename: undefined,\n // Line from which to start counting source. Useful for\n // integration with other tools.\n startLine: 1,\n // When enabled, await at the top level is not considered an\n // error.\n allowAwaitOutsideFunction: false,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program.\n allowImportExportEverywhere: false,\n // TODO\n allowSuperOutsideMethod: false,\n // When enabled, export statements can reference undeclared variables.\n allowUndeclaredExports: false,\n // An array of plugins to enable\n plugins: [],\n // TODO\n strictMode: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // Adds all parsed tokens to a `tokens` property on the `File` node\n tokens: false,\n // Whether to create ParenthesizedExpression AST nodes (if false\n // the parser sets extra.parenthesized on the expression nodes instead).\n createParenthesizedExpressions: false,\n // When enabled, errors are attached to the AST instead of being directly thrown.\n // Some errors will still throw, because @babel/parser can't always recover.\n errorRecovery: false,\n};\n\n// Interpret and default an options object\n\nexport function getOptions(opts: ?Options): Options {\n const options: any = {};\n for (const key of Object.keys(defaultOptions)) {\n options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];\n }\n return options;\n}\n","// @flow\n\nimport type { Options } from \"../options\";\nimport * as N from \"../types\";\nimport { Position } from \"../util/location\";\n\nimport { types as ct, type TokContext } from \"./context\";\nimport { types as tt, type TokenType } from \"./types\";\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number,\n\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0,\n};\n\nexport default class State {\n strict: boolean;\n curLine: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc: Position;\n endLoc: Position;\n\n init(options: Options): void {\n this.strict =\n options.strictMode === false ? false : options.sourceType === \"module\";\n\n this.curLine = options.startLine;\n this.startLoc = this.endLoc = this.curPosition();\n }\n\n errors: SyntaxError[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n maybeInArrowParameters: boolean = false;\n inPipeline: boolean = false;\n inType: boolean = false;\n noAnonFunctionType: boolean = false;\n inPropertyName: boolean = false;\n hasFlowComment: boolean = false;\n isIterator: boolean = false;\n isDeclareContext: boolean = false;\n\n // For the smartPipelines plugin:\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F# plugin\n soloAwait: boolean = false;\n inFSharpPipelineDirectBody: boolean = false;\n\n // Labels in scope.\n labels: Array<{\n kind: ?(\"loop\" | \"switch\"),\n name?: ?string,\n statementStart?: number,\n }> = [];\n\n // Leading decorators. Last element of the stack represents the decorators in current context.\n // Supports nesting of decorators, e.g. @foo(@bar class inner {}) class outer {}\n // where @foo belongs to the outer class and @bar to the inner\n decoratorStack: Array> = [[]];\n\n // Comment store.\n comments: Array = [];\n\n // Comment attachment store\n trailingComments: Array = [];\n leadingComments: Array = [];\n commentStack: Array<{\n start: number,\n leadingComments: ?Array,\n trailingComments: ?Array,\n type: string,\n }> = [];\n // $FlowIgnore this is initialized when the parser starts.\n commentPreviousNode: N.Node = null;\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n lineStart: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // $FlowIgnore this is initialized when generating the second token.\n lastTokEndLoc: Position = null;\n // $FlowIgnore this is initialized when generating the second token.\n lastTokStartLoc: Position = null;\n lastTokStart: number = 0;\n lastTokEnd: number = 0;\n\n // The context stack is used to superficially track syntactic\n // context to predict whether a regular expression is allowed in a\n // given position.\n context: Array = [ct.braceStatement];\n exprAllowed: boolean = true;\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n containsEsc: boolean = false;\n\n // This property is used to track the following errors\n // - StrictNumericEscape\n // - StrictOctalLiteral\n //\n // in a literal that occurs prior to/immediately after a \"use strict\" directive.\n\n // todo(JLHwung): set strictErrors to null and avoid recording string errors\n // after a non-directive is parsed\n strictErrors: Map = new Map();\n\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n exportedIdentifiers: Array = [];\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n curPosition(): Position {\n return new Position(this.curLine, this.pos - this.lineStart);\n }\n\n clone(skipArrays?: boolean): State {\n const state = new State();\n const keys = Object.keys(this);\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n // $FlowIgnore\n let val = this[key];\n\n if (!skipArrays && Array.isArray(val)) {\n val = val.slice();\n }\n\n // $FlowIgnore\n state[key] = val;\n }\n\n return state;\n }\n}\n","// @flow\n\n/*:: declare var invariant; */\n\nimport type { Options } from \"../options\";\nimport * as N from \"../types\";\nimport type { Position } from \"../util/location\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier\";\nimport { types as tt, keywords as keywordTypes, type TokenType } from \"./types\";\nimport { type TokContext, types as ct } from \"./context\";\nimport ParserErrors, { Errors } from \"../parser/error\";\nimport { SourceLocation } from \"../util/location\";\nimport {\n lineBreak,\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n} from \"../util/whitespace\";\nimport State from \"./state\";\n\nconst VALID_REGEX_FLAGS = new Set([\"g\", \"m\", \"s\", \"i\", \"y\", \"u\"]);\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\n\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: [\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ],\n hex: [\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ],\n};\n\nconst allowedNumericSeparatorSiblings = {};\nallowedNumericSeparatorSiblings.bin = [\n // 0 - 1\n charCodes.digit0,\n charCodes.digit1,\n];\nallowedNumericSeparatorSiblings.oct = [\n // 0 - 7\n ...allowedNumericSeparatorSiblings.bin,\n\n charCodes.digit2,\n charCodes.digit3,\n charCodes.digit4,\n charCodes.digit5,\n charCodes.digit6,\n charCodes.digit7,\n];\nallowedNumericSeparatorSiblings.dec = [\n // 0 - 9\n ...allowedNumericSeparatorSiblings.oct,\n\n charCodes.digit8,\n charCodes.digit9,\n];\n\nallowedNumericSeparatorSiblings.hex = [\n // 0 - 9, A - F, a - f,\n ...allowedNumericSeparatorSiblings.dec,\n\n charCodes.uppercaseA,\n charCodes.uppercaseB,\n charCodes.uppercaseC,\n charCodes.uppercaseD,\n charCodes.uppercaseE,\n charCodes.uppercaseF,\n\n charCodes.lowercaseA,\n charCodes.lowercaseB,\n charCodes.lowercaseC,\n charCodes.lowercaseD,\n charCodes.lowercaseE,\n charCodes.lowercaseF,\n];\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n this.type = state.type;\n this.value = state.value;\n this.start = state.start;\n this.end = state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n declare type: TokenType;\n declare value: any;\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default class Tokenizer extends ParserErrors {\n // Forward-declarations\n // parser/util.js\n /*::\n +hasPrecedingLineBreak: () => boolean;\n +unexpected: (pos?: ?number, messageOrType?: string | TokenType) => empty;\n +expectPlugin: (name: string, pos?: ?number) => true;\n */\n\n isLookahead: boolean;\n\n // Token store.\n tokens: Array = [];\n\n constructor(options: Options, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n if (!this.isLookahead) {\n this.checkKeywordEscapes();\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n }\n\n this.state.lastTokEnd = this.state.end;\n this.state.lastTokStart = this.state.start;\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n // TODO\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n // TODO\n\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n // TODO\n\n lookahead(): State {\n const old = this.state;\n this.state = old.clone(true);\n\n this.isLookahead = true;\n this.next();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos: number): number {\n skipWhiteSpace.lastIndex = pos;\n const skip = skipWhiteSpace.exec(this.input);\n // $FlowIgnore: The skipWhiteSpace ensures to match any string\n return pos + skip[0].length;\n }\n\n lookaheadCharCode(): number {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (strict) {\n // Throw an error for any string decimal escape found before/immediately\n // after a \"use strict\" directive. Strict mode will be set at parse\n // time for any literals that occur after the next node of the strict\n // directive.\n this.state.strictErrors.forEach((message, pos) =>\n /* eslint-disable @babel/development-internal/dry-error-messages */\n this.raise(pos, message),\n );\n this.state.strictErrors.clear();\n }\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related\n // properties.\n\n nextToken(): void {\n const curContext = this.curContext();\n if (!curContext?.preserveSpace) this.skipSpace();\n this.state.start = this.state.pos;\n this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n const override = curContext?.override;\n if (override) {\n override(this);\n } else {\n this.getTokenFromCode(this.input.codePointAt(this.state.pos));\n }\n }\n\n pushComment(\n block: boolean,\n text: string,\n start: number,\n end: number,\n startLoc: Position,\n endLoc: Position,\n ): void {\n const comment = {\n type: block ? \"CommentBlock\" : \"CommentLine\",\n value: text,\n start: start,\n end: end,\n loc: new SourceLocation(startLoc, endLoc),\n };\n\n if (this.options.tokens) this.pushToken(comment);\n this.state.comments.push(comment);\n this.addComment(comment);\n }\n\n skipBlockComment(): void {\n const startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(\"*/\", this.state.pos + 2);\n if (end === -1) throw this.raise(start, Errors.UnterminatedComment);\n\n this.state.pos = end + 2;\n lineBreakG.lastIndex = start;\n let match;\n while (\n (match = lineBreakG.exec(this.input)) &&\n match.index < this.state.pos\n ) {\n ++this.state.curLine;\n this.state.lineStart = match.index + match[0].length;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n\n this.pushComment(\n true,\n this.input.slice(start + 2, end),\n start,\n this.state.pos,\n startLoc,\n this.state.curPosition(),\n );\n }\n\n skipLineComment(startSkip: number): void {\n const start = this.state.pos;\n const startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n\n this.pushComment(\n false,\n this.input.slice(start + startSkip, this.state.pos),\n start,\n this.state.pos,\n startLoc,\n this.state.curPosition(),\n );\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk:\n this.skipBlockComment();\n break;\n\n case charCodes.slash:\n this.skipLineComment(2);\n break;\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else {\n break loop;\n }\n }\n }\n }\n\n // Called at the end of every token. Sets `end`, `val`, and\n // maintains `context` and `exprAllowed`, and skips the space after\n // the token, so that the next one's `start` will point at the\n // right position.\n\n finishToken(type: TokenType, val: any): void {\n this.state.end = this.state.pos;\n this.state.endLoc = this.state.curPosition();\n const prevType = this.state.type;\n this.state.type = type;\n this.state.value = val;\n\n if (!this.isLookahead) this.updateContext(prevType);\n }\n\n // ### Token reading\n\n // This is the function that is called to fetch the next token. It\n // is somewhat obscure, because it works in character codes rather\n // than characters, and because operator parsing has been inlined\n // into it.\n //\n // All in the name of speed.\n\n // number sign is \"#\"\n readToken_numberSign(): void {\n if (this.state.pos === 0 && this.readToken_interpreter()) {\n return;\n }\n\n const nextPos = this.state.pos + 1;\n const next = this.input.charCodeAt(nextPos);\n if (next >= charCodes.digit0 && next <= charCodes.digit9) {\n throw this.raise(this.state.pos, Errors.UnexpectedDigitAfterHash);\n }\n\n if (\n next === charCodes.leftCurlyBrace ||\n (next === charCodes.leftSquareBracket && this.hasPlugin(\"recordAndTuple\"))\n ) {\n // When we see `#{`, it is likely to be a hash record.\n // However we don't yell at `#[` since users may intend to use \"computed private fields\",\n // which is not allowed in the spec. Throwing expecting recordAndTuple is\n // misleading\n this.expectPlugin(\"recordAndTuple\");\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"hash\") {\n throw this.raise(\n this.state.pos,\n next === charCodes.leftCurlyBrace\n ? Errors.RecordExpressionHashIncorrectStartSyntaxType\n : Errors.TupleExpressionHashIncorrectStartSyntaxType,\n );\n }\n\n if (next === charCodes.leftCurlyBrace) {\n // #{\n this.finishToken(tt.braceHashL);\n } else {\n // #[\n this.finishToken(tt.bracketHashL);\n }\n this.state.pos += 2;\n } else {\n this.finishOp(tt.hash, 1);\n }\n }\n\n readToken_dot(): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next >= charCodes.digit0 && next <= charCodes.digit9) {\n this.readNumber(true);\n return;\n }\n\n if (\n next === charCodes.dot &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.dot\n ) {\n this.state.pos += 3;\n this.finishToken(tt.ellipsis);\n } else {\n ++this.state.pos;\n this.finishToken(tt.dot);\n }\n }\n\n readToken_slash(): void {\n // '/'\n if (this.state.exprAllowed && !this.state.inType) {\n ++this.state.pos;\n this.readRegexp();\n return;\n }\n\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.slash, 1);\n }\n }\n\n readToken_interpreter(): boolean {\n if (this.state.pos !== 0 || this.length < 2) return false;\n\n let ch = this.input.charCodeAt(this.state.pos + 1);\n if (ch !== charCodes.exclamationMark) return false;\n\n const start = this.state.pos;\n this.state.pos += 1;\n\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n\n const value = this.input.slice(start + 2, this.state.pos);\n\n this.finishToken(tt.interpreterDirective, value);\n\n return true;\n }\n\n readToken_mult_modulo(code: number): void {\n // '%*'\n let type = code === charCodes.asterisk ? tt.star : tt.modulo;\n let width = 1;\n let next = this.input.charCodeAt(this.state.pos + 1);\n const exprAllowed = this.state.exprAllowed;\n\n // Exponentiation operator **\n if (code === charCodes.asterisk && next === charCodes.asterisk) {\n width++;\n next = this.input.charCodeAt(this.state.pos + 2);\n type = tt.exponent;\n }\n\n if (next === charCodes.equalsTo && !exprAllowed) {\n width++;\n type = tt.assign;\n }\n\n this.finishOp(type, width);\n }\n\n readToken_pipe_amp(code: number): void {\n // '||' '&&' '||=' '&&='\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === code) {\n if (this.input.charCodeAt(this.state.pos + 2) === charCodes.equalsTo) {\n this.finishOp(tt.assign, 3);\n } else {\n this.finishOp(\n code === charCodes.verticalBar ? tt.logicalOR : tt.logicalAND,\n 2,\n );\n }\n return;\n }\n\n if (code === charCodes.verticalBar) {\n // '|>'\n if (next === charCodes.greaterThan) {\n this.finishOp(tt.pipeline, 2);\n return;\n }\n // '|}'\n if (\n this.hasPlugin(\"recordAndTuple\") &&\n next === charCodes.rightCurlyBrace\n ) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(\n this.state.pos,\n Errors.RecordExpressionBarIncorrectEndSyntaxType,\n );\n }\n\n this.finishOp(tt.braceBarR, 2);\n return;\n }\n\n // '|]'\n if (\n this.hasPlugin(\"recordAndTuple\") &&\n next === charCodes.rightSquareBracket\n ) {\n if (this.getPluginOption(\"recordAndTuple\", \"syntaxType\") !== \"bar\") {\n throw this.raise(\n this.state.pos,\n Errors.TupleExpressionBarIncorrectEndSyntaxType,\n );\n }\n\n this.finishOp(tt.bracketBarR, 2);\n return;\n }\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n return;\n }\n\n this.finishOp(\n code === charCodes.verticalBar ? tt.bitwiseOR : tt.bitwiseAND,\n 1,\n );\n }\n\n readToken_caret(): void {\n // '^'\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.bitwiseXOR, 1);\n }\n }\n\n readToken_plus_min(code: number): void {\n // '+-'\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === code) {\n if (\n next === charCodes.dash &&\n !this.inModule &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.greaterThan &&\n (this.state.lastTokEnd === 0 || this.hasPrecedingLineBreak())\n ) {\n // A `-->` line comment\n this.skipLineComment(3);\n this.skipSpace();\n this.nextToken();\n return;\n }\n this.finishOp(tt.incDec, 2);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.plusMin, 1);\n }\n }\n\n readToken_lt_gt(code: number): void {\n // '<>'\n const next = this.input.charCodeAt(this.state.pos + 1);\n let size = 1;\n\n if (next === code) {\n size =\n code === charCodes.greaterThan &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.greaterThan\n ? 3\n : 2;\n if (this.input.charCodeAt(this.state.pos + size) === charCodes.equalsTo) {\n this.finishOp(tt.assign, size + 1);\n return;\n }\n this.finishOp(tt.bitShift, size);\n return;\n }\n\n if (\n next === charCodes.exclamationMark &&\n code === charCodes.lessThan &&\n !this.inModule &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.dash &&\n this.input.charCodeAt(this.state.pos + 3) === charCodes.dash\n ) {\n // `` line comment\n this.skipLineComment(3);\n this.skipSpace();\n this.nextToken();\n return;\n }\n this.finishOp(tt.incDec, 2);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.plusMin, 1);\n }\n }\n\n readToken_lt_gt(code: number): void {\n // '<>'\n const next = this.input.charCodeAt(this.state.pos + 1);\n let size = 1;\n\n if (next === code) {\n size =\n code === charCodes.greaterThan &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.greaterThan\n ? 3\n : 2;\n if (this.input.charCodeAt(this.state.pos + size) === charCodes.equalsTo) {\n this.finishOp(tt.assign, size + 1);\n return;\n }\n this.finishOp(tt.bitShift, size);\n return;\n }\n\n if (\n next === charCodes.exclamationMark &&\n code === charCodes.lessThan &&\n !this.inModule &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.dash &&\n this.input.charCodeAt(this.state.pos + 3) === charCodes.dash\n ) {\n // ` * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\nconst replaceTildes = (comp, options) =>\n comp.trim().split(/\\s+/).map((comp) => {\n return replaceTilde(comp, options)\n }).join(' ')\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\nconst replaceCarets = (comp, options) =>\n comp.trim().split(/\\s+/).map((comp) => {\n return replaceCaret(comp, options)\n }).join(' ')\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp.split(/\\s+/).map((comp) => {\n return replaceXRange(comp, options)\n }).join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<')\n pr = '-0'\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp.trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return (`${from} ${to}`).trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","const ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n constructor (comp, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n const sameDirectionIncreasing =\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '>=' || comp.operator === '>')\n const sameDirectionDecreasing =\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '<=' || comp.operator === '<')\n const sameSemVer = this.semver.version === comp.semver.version\n const differentDirectionsInclusive =\n (this.operator === '>=' || this.operator === '<=') &&\n (comp.operator === '>=' || comp.operator === '<=')\n const oppositeDirectionsLessThan =\n cmp(this.semver, '<', comp.semver, options) &&\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '<=' || comp.operator === '<')\n const oppositeDirectionsGreaterThan =\n cmp(this.semver, '>', comp.semver, options) &&\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '>=' || comp.operator === '>')\n\n return (\n sameDirectionIncreasing ||\n sameDirectionDecreasing ||\n (sameSemVer && differentDirectionsInclusive) ||\n oppositeDirectionsLessThan ||\n oppositeDirectionsGreaterThan\n )\n }\n}\n\nmodule.exports = Comparator\n\nconst {re, t} = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","const Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","const Range = require('../classes/range')\n\n// Mostly just for testing and legacy API reasons\nconst toComparators = (range, options) =>\n new Range(range, options).set\n .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))\n\nmodule.exports = toComparators\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\n\nconst maxSatisfying = (versions, range, options) => {\n let max = null\n let maxSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\nmodule.exports = maxSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst minSatisfying = (versions, range, options) => {\n let min = null\n let minSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\nmodule.exports = minSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst gt = require('../functions/gt')\n\nconst minVersion = (range, loose) => {\n range = new Range(range, loose)\n\n let minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n comparators.forEach((comparator) => {\n // Clone to avoid manipulating the comparator's semver object.\n const compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!minver || gt(minver, compver)) {\n minver = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error(`Unexpected operation: ${comparator.operator}`)\n }\n })\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\nmodule.exports = minVersion\n","const Range = require('../classes/range')\nconst validRange = (range, options) => {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\nmodule.exports = validRange\n","const SemVer = require('../classes/semver')\nconst Comparator = require('../classes/comparator')\nconst {ANY} = Comparator\nconst Range = require('../classes/range')\nconst satisfies = require('../functions/satisfies')\nconst gt = require('../functions/gt')\nconst lt = require('../functions/lt')\nconst lte = require('../functions/lte')\nconst gte = require('../functions/gte')\n\nconst outside = (version, range, hilo, options) => {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n let gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisifes the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let high = null\n let low = null\n\n comparators.forEach((comparator) => {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nmodule.exports = outside\n","// Determine if version is greater than all the versions possible in the range.\nconst outside = require('./outside')\nconst gtr = (version, range, options) => outside(version, range, '>', options)\nmodule.exports = gtr\n","const outside = require('./outside')\n// Determine if version is less than all the versions possible in the range\nconst ltr = (version, range, options) => outside(version, range, '<', options)\nmodule.exports = ltr\n","const Range = require('../classes/range')\nconst intersects = (r1, r2, options) => {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2)\n}\nmodule.exports = intersects\n","// given a set of versions and a range, create a \"simplified\" range\n// that includes the same versions that the original range does\n// If the original range is shorter than the simplified one, return that.\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\nmodule.exports = (versions, range, options) => {\n const set = []\n let min = null\n let prev = null\n const v = versions.sort((a, b) => compare(a, b, options))\n for (const version of v) {\n const included = satisfies(version, range, options)\n if (included) {\n prev = version\n if (!min)\n min = version\n } else {\n if (prev) {\n set.push([min, prev])\n }\n prev = null\n min = null\n }\n }\n if (min)\n set.push([min, null])\n\n const ranges = []\n for (const [min, max] of set) {\n if (min === max)\n ranges.push(min)\n else if (!max && min === v[0])\n ranges.push('*')\n else if (!max)\n ranges.push(`>=${min}`)\n else if (min === v[0])\n ranges.push(`<=${max}`)\n else\n ranges.push(`${min} - ${max}`)\n }\n const simplified = ranges.join(' || ')\n const original = typeof range.raw === 'string' ? range.raw : String(range)\n return simplified.length < original.length ? simplified : range\n}\n","const Range = require('../classes/range.js')\nconst { ANY } = require('../classes/comparator.js')\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\n\n// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:\n// - Every simple range `r1, r2, ...` is a subset of some `R1, R2, ...`\n//\n// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:\n// - If c is only the ANY comparator\n// - If C is only the ANY comparator, return true\n// - Else return false\n// - Let EQ be the set of = comparators in c\n// - If EQ is more than one, return true (null set)\n// - Let GT be the highest > or >= comparator in c\n// - Let LT be the lowest < or <= comparator in c\n// - If GT and LT, and GT.semver > LT.semver, return true (null set)\n// - If EQ\n// - If GT, and EQ does not satisfy GT, return true (null set)\n// - If LT, and EQ does not satisfy LT, return true (null set)\n// - If EQ satisfies every C, return true\n// - Else return false\n// - If GT\n// - If GT is lower than any > or >= comp in C, return false\n// - If GT is >=, and GT.semver does not satisfy every C, return false\n// - If LT\n// - If LT.semver is greater than that of any > comp in C, return false\n// - If LT is <=, and LT.semver does not satisfy every C, return false\n// - If any C is a = range, and GT or LT are set, return false\n// - Else return true\n\nconst subset = (sub, dom, options) => {\n sub = new Range(sub, options)\n dom = new Range(dom, options)\n let sawNonNull = false\n\n OUTER: for (const simpleSub of sub.set) {\n for (const simpleDom of dom.set) {\n const isSub = simpleSubset(simpleSub, simpleDom, options)\n sawNonNull = sawNonNull || isSub !== null\n if (isSub)\n continue OUTER\n }\n // the null set is a subset of everything, but null simple ranges in\n // a complex range should be ignored. so if we saw a non-null range,\n // then we know this isn't a subset, but if EVERY simple range was null,\n // then it is a subset.\n if (sawNonNull)\n return false\n }\n return true\n}\n\nconst simpleSubset = (sub, dom, options) => {\n if (sub.length === 1 && sub[0].semver === ANY)\n return dom.length === 1 && dom[0].semver === ANY\n\n const eqSet = new Set()\n let gt, lt\n for (const c of sub) {\n if (c.operator === '>' || c.operator === '>=')\n gt = higherGT(gt, c, options)\n else if (c.operator === '<' || c.operator === '<=')\n lt = lowerLT(lt, c, options)\n else\n eqSet.add(c.semver)\n }\n\n if (eqSet.size > 1)\n return null\n\n let gtltComp\n if (gt && lt) {\n gtltComp = compare(gt.semver, lt.semver, options)\n if (gtltComp > 0)\n return null\n else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<='))\n return null\n }\n\n // will iterate one or zero times\n for (const eq of eqSet) {\n if (gt && !satisfies(eq, String(gt), options))\n return null\n\n if (lt && !satisfies(eq, String(lt), options))\n return null\n\n for (const c of dom) {\n if (!satisfies(eq, String(c), options))\n return false\n }\n return true\n }\n\n let higher, lower\n let hasDomLT, hasDomGT\n for (const c of dom) {\n hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='\n hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='\n if (gt) {\n if (c.operator === '>' || c.operator === '>=') {\n higher = higherGT(gt, c, options)\n if (higher === c)\n return false\n } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options))\n return false\n }\n if (lt) {\n if (c.operator === '<' || c.operator === '<=') {\n lower = lowerLT(lt, c, options)\n if (lower === c)\n return false\n } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options))\n return false\n }\n if (!c.operator && (lt || gt) && gtltComp !== 0)\n return false\n }\n\n // if there was a < or >, and nothing in the dom, then must be false\n // UNLESS it was limited by another range in the other direction.\n // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0\n if (gt && hasDomLT && !lt && gtltComp !== 0)\n return false\n\n if (lt && hasDomGT && !gt && gtltComp !== 0)\n return false\n\n return true\n}\n\n// >=1.2.3 is lower than >1.2.3\nconst higherGT = (a, b, options) => {\n if (!a)\n return b\n const comp = compare(a.semver, b.semver, options)\n return comp > 0 ? a\n : comp < 0 ? b\n : b.operator === '>' && a.operator === '>=' ? b\n : a\n}\n\n// <=1.2.3 is higher than <1.2.3\nconst lowerLT = (a, b, options) => {\n if (!a)\n return b\n const comp = compare(a.semver, b.semver, options)\n return comp < 0 ? a\n : comp > 0 ? b\n : b.operator === '<' && a.operator === '<=' ? b\n : a\n}\n\nmodule.exports = subset\n","// just pre-load all the stuff that index.js lazily exports\nconst internalRe = require('./internal/re')\nmodule.exports = {\n re: internalRe.re,\n src: internalRe.src,\n tokens: internalRe.t,\n SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION,\n SemVer: require('./classes/semver'),\n compareIdentifiers: require('./internal/identifiers').compareIdentifiers,\n rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers,\n parse: require('./functions/parse'),\n valid: require('./functions/valid'),\n clean: require('./functions/clean'),\n inc: require('./functions/inc'),\n diff: require('./functions/diff'),\n major: require('./functions/major'),\n minor: require('./functions/minor'),\n patch: require('./functions/patch'),\n prerelease: require('./functions/prerelease'),\n compare: require('./functions/compare'),\n rcompare: require('./functions/rcompare'),\n compareLoose: require('./functions/compare-loose'),\n compareBuild: require('./functions/compare-build'),\n sort: require('./functions/sort'),\n rsort: require('./functions/rsort'),\n gt: require('./functions/gt'),\n lt: require('./functions/lt'),\n eq: require('./functions/eq'),\n neq: require('./functions/neq'),\n gte: require('./functions/gte'),\n lte: require('./functions/lte'),\n cmp: require('./functions/cmp'),\n coerce: require('./functions/coerce'),\n Comparator: require('./classes/comparator'),\n Range: require('./classes/range'),\n satisfies: require('./functions/satisfies'),\n toComparators: require('./ranges/to-comparators'),\n maxSatisfying: require('./ranges/max-satisfying'),\n minSatisfying: require('./ranges/min-satisfying'),\n minVersion: require('./ranges/min-version'),\n validRange: require('./ranges/valid'),\n outside: require('./ranges/outside'),\n gtr: require('./ranges/gtr'),\n ltr: require('./ranges/ltr'),\n intersects: require('./ranges/intersects'),\n simplifyRange: require('./ranges/simplify'),\n subset: require('./ranges/subset'),\n}\n","var path = require('path');\n\nmodule.exports = function (basedir, relfiles) {\n if (relfiles) {\n var files = relfiles.map(function (r) {\n return path.resolve(basedir, r);\n });\n }\n else {\n var files = basedir;\n }\n \n var res = files.slice(1).reduce(function (ps, file) {\n if (!file.match(/^([A-Za-z]:)?\\/|\\\\/)) {\n throw new Error('relative path without a basedir');\n }\n \n var xs = file.split(/\\/+|\\\\+/);\n for (\n var i = 0;\n ps[i] === xs[i] && i < Math.min(ps.length, xs.length);\n i++\n );\n return ps.slice(0, i);\n }, files[0].split(/\\/+|\\\\+/));\n \n // Windows correctly handles paths with forward-slashes\n return res.length > 1 ? res.join('/') : '/'\n};\n","'use strict';\n\nconst pTry = (fn, ...arguments_) => new Promise(resolve => {\n\tresolve(fn(...arguments_));\n});\n\nmodule.exports = pTry;\n// TODO: remove this in the next major version\nmodule.exports.default = pTry;\n","'use strict';\nconst pTry = require('p-try');\n\nconst pLimit = concurrency => {\n\tif (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {\n\t\treturn Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up'));\n\t}\n\n\tconst queue = [];\n\tlet activeCount = 0;\n\n\tconst next = () => {\n\t\tactiveCount--;\n\n\t\tif (queue.length > 0) {\n\t\t\tqueue.shift()();\n\t\t}\n\t};\n\n\tconst run = (fn, resolve, ...args) => {\n\t\tactiveCount++;\n\n\t\tconst result = pTry(fn, ...args);\n\n\t\tresolve(result);\n\n\t\tresult.then(next, next);\n\t};\n\n\tconst enqueue = (fn, resolve, ...args) => {\n\t\tif (activeCount < concurrency) {\n\t\t\trun(fn, resolve, ...args);\n\t\t} else {\n\t\t\tqueue.push(run.bind(null, fn, resolve, ...args));\n\t\t}\n\t};\n\n\tconst generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args));\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.length\n\t\t}\n\t});\n\n\treturn generator;\n};\n\nmodule.exports = pLimit;\nmodule.exports.default = pLimit;\n","'use strict';\nconst pLimit = require('p-limit');\n\nclass EndError extends Error {\n\tconstructor(value) {\n\t\tsuper();\n\t\tthis.value = value;\n\t}\n}\n\n// The input can also be a promise, so we await it\nconst testElement = async (element, tester) => tester(await element);\n\n// The input can also be a promise, so we `Promise.all()` them both\nconst finder = async element => {\n\tconst values = await Promise.all(element);\n\tif (values[1] === true) {\n\t\tthrow new EndError(values[0]);\n\t}\n\n\treturn false;\n};\n\nconst pLocate = async (iterable, tester, options) => {\n\toptions = {\n\t\tconcurrency: Infinity,\n\t\tpreserveOrder: true,\n\t\t...options\n\t};\n\n\tconst limit = pLimit(options.concurrency);\n\n\t// Start all the promises concurrently with optional limit\n\tconst items = [...iterable].map(element => [element, limit(testElement, element, tester)]);\n\n\t// Check the promises either serially or concurrently\n\tconst checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);\n\n\ttry {\n\t\tawait Promise.all(items.map(element => checkLimit(finder, element)));\n\t} catch (error) {\n\t\tif (error instanceof EndError) {\n\t\t\treturn error.value;\n\t\t}\n\n\t\tthrow error;\n\t}\n};\n\nmodule.exports = pLocate;\n// TODO: Remove this for the next major release\nmodule.exports.default = pLocate;\n","'use strict';\nconst path = require('path');\nconst fs = require('fs');\nconst {promisify} = require('util');\nconst pLocate = require('p-locate');\n\nconst fsStat = promisify(fs.stat);\nconst fsLStat = promisify(fs.lstat);\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile'\n};\n\nfunction checkType({type}) {\n\tif (type in typeMappings) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => type === undefined || stat[typeMappings[type]]();\n\nmodule.exports = async (paths, options) => {\n\toptions = {\n\t\tcwd: process.cwd(),\n\t\ttype: 'file',\n\t\tallowSymlinks: true,\n\t\t...options\n\t};\n\tcheckType(options);\n\tconst statFn = options.allowSymlinks ? fsStat : fsLStat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFn(path.resolve(options.cwd, path_));\n\t\t\treturn matchType(options.type, stat);\n\t\t} catch (_) {\n\t\t\treturn false;\n\t\t}\n\t}, options);\n};\n\nmodule.exports.sync = (paths, options) => {\n\toptions = {\n\t\tcwd: process.cwd(),\n\t\tallowSymlinks: true,\n\t\ttype: 'file',\n\t\t...options\n\t};\n\tcheckType(options);\n\tconst statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFn(path.resolve(options.cwd, path_));\n\n\t\t\tif (matchType(options.type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch (_) {\n\t\t}\n\t}\n};\n","'use strict';\nconst fs = require('fs');\nconst {promisify} = require('util');\n\nconst pAccess = promisify(fs.access);\n\nmodule.exports = async path => {\n\ttry {\n\t\tawait pAccess(path);\n\t\treturn true;\n\t} catch (_) {\n\t\treturn false;\n\t}\n};\n\nmodule.exports.sync = path => {\n\ttry {\n\t\tfs.accessSync(path);\n\t\treturn true;\n\t} catch (_) {\n\t\treturn false;\n\t}\n};\n","'use strict';\nconst path = require('path');\nconst locatePath = require('locate-path');\nconst pathExists = require('path-exists');\n\nconst stop = Symbol('findUp.stop');\n\nmodule.exports = async (name, options = {}) => {\n\tlet directory = path.resolve(options.cwd || '');\n\tconst {root} = path.parse(directory);\n\tconst paths = [].concat(name);\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === stop) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\treturn path.resolve(directory, foundPath);\n\t\t}\n\n\t\tif (directory === root) {\n\t\t\treturn;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n};\n\nmodule.exports.sync = (name, options = {}) => {\n\tlet directory = path.resolve(options.cwd || '');\n\tconst {root} = path.parse(directory);\n\tconst paths = [].concat(name);\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath.sync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath.sync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === stop) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\treturn path.resolve(directory, foundPath);\n\t\t}\n\n\t\tif (directory === root) {\n\t\t\treturn;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n};\n\nmodule.exports.exists = pathExists;\n\nmodule.exports.sync.exists = pathExists.sync;\n\nmodule.exports.stop = stop;\n","'use strict';\nconst path = require('path');\nconst findUp = require('find-up');\n\nconst pkgDir = async cwd => {\n\tconst filePath = await findUp('package.json', {cwd});\n\treturn filePath && path.dirname(filePath);\n};\n\nmodule.exports = pkgDir;\n// TODO: Remove this for the next major release\nmodule.exports.default = pkgDir;\n\nmodule.exports.sync = cwd => {\n\tconst filePath = findUp.sync('package.json', {cwd});\n\treturn filePath && path.dirname(filePath);\n};\n","exports = module.exports = SemVer\n\nvar debug\n/* istanbul ignore next */\nif (typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)) {\n debug = function () {\n var args = Array.prototype.slice.call(arguments, 0)\n args.unshift('SEMVER')\n console.log.apply(console, args)\n }\n} else {\n debug = function () {}\n}\n\n// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nexports.SEMVER_SPEC_VERSION = '2.0.0'\n\nvar MAX_LENGTH = 256\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nvar MAX_SAFE_COMPONENT_LENGTH = 16\n\n// The actual regexps go on exports.re\nvar re = exports.re = []\nvar src = exports.src = []\nvar t = exports.tokens = {}\nvar R = 0\n\nfunction tok (n) {\n t[n] = R++\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ntok('NUMERICIDENTIFIER')\nsrc[t.NUMERICIDENTIFIER] = '0|[1-9]\\\\d*'\ntok('NUMERICIDENTIFIERLOOSE')\nsrc[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ntok('NONNUMERICIDENTIFIER')\nsrc[t.NONNUMERICIDENTIFIER] = '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*'\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ntok('MAINVERSION')\nsrc[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIER] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIER] + ')'\n\ntok('MAINVERSIONLOOSE')\nsrc[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ntok('PRERELEASEIDENTIFIER')\nsrc[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +\n '|' + src[t.NONNUMERICIDENTIFIER] + ')'\n\ntok('PRERELEASEIDENTIFIERLOOSE')\nsrc[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +\n '|' + src[t.NONNUMERICIDENTIFIER] + ')'\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ntok('PRERELEASE')\nsrc[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +\n '(?:\\\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'\n\ntok('PRERELEASELOOSE')\nsrc[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +\n '(?:\\\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ntok('BUILDIDENTIFIER')\nsrc[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ntok('BUILD')\nsrc[t.BUILD] = '(?:\\\\+(' + src[t.BUILDIDENTIFIER] +\n '(?:\\\\.' + src[t.BUILDIDENTIFIER] + ')*))'\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ntok('FULL')\ntok('FULLPLAIN')\nsrc[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +\n src[t.PRERELEASE] + '?' +\n src[t.BUILD] + '?'\n\nsrc[t.FULL] = '^' + src[t.FULLPLAIN] + '$'\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ntok('LOOSEPLAIN')\nsrc[t.LOOSEPLAIN] = '[v=\\\\s]*' + src[t.MAINVERSIONLOOSE] +\n src[t.PRERELEASELOOSE] + '?' +\n src[t.BUILD] + '?'\n\ntok('LOOSE')\nsrc[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'\n\ntok('GTLT')\nsrc[t.GTLT] = '((?:<|>)?=?)'\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ntok('XRANGEIDENTIFIERLOOSE')\nsrc[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\\\*'\ntok('XRANGEIDENTIFIER')\nsrc[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\\\*'\n\ntok('XRANGEPLAIN')\nsrc[t.XRANGEPLAIN] = '[v=\\\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:' + src[t.PRERELEASE] + ')?' +\n src[t.BUILD] + '?' +\n ')?)?'\n\ntok('XRANGEPLAINLOOSE')\nsrc[t.XRANGEPLAINLOOSE] = '[v=\\\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:' + src[t.PRERELEASELOOSE] + ')?' +\n src[t.BUILD] + '?' +\n ')?)?'\n\ntok('XRANGE')\nsrc[t.XRANGE] = '^' + src[t.GTLT] + '\\\\s*' + src[t.XRANGEPLAIN] + '$'\ntok('XRANGELOOSE')\nsrc[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\\\s*' + src[t.XRANGEPLAINLOOSE] + '$'\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ntok('COERCE')\nsrc[t.COERCE] = '(^|[^\\\\d])' +\n '(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +\n '(?:\\\\.(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +\n '(?:\\\\.(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +\n '(?:$|[^\\\\d])'\ntok('COERCERTL')\nre[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ntok('LONETILDE')\nsrc[t.LONETILDE] = '(?:~>?)'\n\ntok('TILDETRIM')\nsrc[t.TILDETRIM] = '(\\\\s*)' + src[t.LONETILDE] + '\\\\s+'\nre[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')\nvar tildeTrimReplace = '$1~'\n\ntok('TILDE')\nsrc[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'\ntok('TILDELOOSE')\nsrc[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ntok('LONECARET')\nsrc[t.LONECARET] = '(?:\\\\^)'\n\ntok('CARETTRIM')\nsrc[t.CARETTRIM] = '(\\\\s*)' + src[t.LONECARET] + '\\\\s+'\nre[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')\nvar caretTrimReplace = '$1^'\n\ntok('CARET')\nsrc[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'\ntok('CARETLOOSE')\nsrc[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ntok('COMPARATORLOOSE')\nsrc[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'\ntok('COMPARATOR')\nsrc[t.COMPARATOR] = '^' + src[t.GTLT] + '\\\\s*(' + src[t.FULLPLAIN] + ')$|^$'\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ntok('COMPARATORTRIM')\nsrc[t.COMPARATORTRIM] = '(\\\\s*)' + src[t.GTLT] +\n '\\\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'\n\n// this one has to use the /g flag\nre[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')\nvar comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ntok('HYPHENRANGE')\nsrc[t.HYPHENRANGE] = '^\\\\s*(' + src[t.XRANGEPLAIN] + ')' +\n '\\\\s+-\\\\s+' +\n '(' + src[t.XRANGEPLAIN] + ')' +\n '\\\\s*$'\n\ntok('HYPHENRANGELOOSE')\nsrc[t.HYPHENRANGELOOSE] = '^\\\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +\n '\\\\s+-\\\\s+' +\n '(' + src[t.XRANGEPLAINLOOSE] + ')' +\n '\\\\s*$'\n\n// Star ranges basically just allow anything at all.\ntok('STAR')\nsrc[t.STAR] = '(<|>)?=?\\\\s*\\\\*'\n\n// Compile to actual regexp objects.\n// All are flag-free, unless they were created above with a flag.\nfor (var i = 0; i < R; i++) {\n debug(i, src[i])\n if (!re[i]) {\n re[i] = new RegExp(src[i])\n }\n}\n\nexports.parse = parse\nfunction parse (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n var r = options.loose ? re[t.LOOSE] : re[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nexports.valid = valid\nfunction valid (version, options) {\n var v = parse(version, options)\n return v ? v.version : null\n}\n\nexports.clean = clean\nfunction clean (version, options) {\n var s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\n\nexports.SemVer = SemVer\n\nfunction SemVer (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n if (version instanceof SemVer) {\n if (version.loose === options.loose) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError('Invalid Version: ' + version)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')\n }\n\n if (!(this instanceof SemVer)) {\n return new SemVer(version, options)\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n\n var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError('Invalid Version: ' + version)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map(function (id) {\n if (/^[0-9]+$/.test(id)) {\n var num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n}\n\nSemVer.prototype.format = function () {\n this.version = this.major + '.' + this.minor + '.' + this.patch\n if (this.prerelease.length) {\n this.version += '-' + this.prerelease.join('.')\n }\n return this.version\n}\n\nSemVer.prototype.toString = function () {\n return this.version\n}\n\nSemVer.prototype.compare = function (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return this.compareMain(other) || this.comparePre(other)\n}\n\nSemVer.prototype.compareMain = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n}\n\nSemVer.prototype.comparePre = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n var i = 0\n do {\n var a = this.prerelease[i]\n var b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n}\n\nSemVer.prototype.compareBuild = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n var i = 0\n do {\n var a = this.build[i]\n var b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n}\n\n// preminor will bump the version up to the next minor release, and immediately\n// down to pre-release. premajor and prepatch work the same way.\nSemVer.prototype.inc = function (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 \"pre\" would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n var i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error('invalid increment argument: ' + release)\n }\n this.format()\n this.raw = this.version\n return this\n}\n\nexports.inc = inc\nfunction inc (version, release, loose, identifier) {\n if (typeof (loose) === 'string') {\n identifier = loose\n loose = undefined\n }\n\n try {\n return new SemVer(version, loose).inc(release, identifier).version\n } catch (er) {\n return null\n }\n}\n\nexports.diff = diff\nfunction diff (version1, version2) {\n if (eq(version1, version2)) {\n return null\n } else {\n var v1 = parse(version1)\n var v2 = parse(version2)\n var prefix = ''\n if (v1.prerelease.length || v2.prerelease.length) {\n prefix = 'pre'\n var defaultResult = 'prerelease'\n }\n for (var key in v1) {\n if (key === 'major' || key === 'minor' || key === 'patch') {\n if (v1[key] !== v2[key]) {\n return prefix + key\n }\n }\n }\n return defaultResult // may be undefined\n }\n}\n\nexports.compareIdentifiers = compareIdentifiers\n\nvar numeric = /^[0-9]+$/\nfunction compareIdentifiers (a, b) {\n var anum = numeric.test(a)\n var bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nexports.rcompareIdentifiers = rcompareIdentifiers\nfunction rcompareIdentifiers (a, b) {\n return compareIdentifiers(b, a)\n}\n\nexports.major = major\nfunction major (a, loose) {\n return new SemVer(a, loose).major\n}\n\nexports.minor = minor\nfunction minor (a, loose) {\n return new SemVer(a, loose).minor\n}\n\nexports.patch = patch\nfunction patch (a, loose) {\n return new SemVer(a, loose).patch\n}\n\nexports.compare = compare\nfunction compare (a, b, loose) {\n return new SemVer(a, loose).compare(new SemVer(b, loose))\n}\n\nexports.compareLoose = compareLoose\nfunction compareLoose (a, b) {\n return compare(a, b, true)\n}\n\nexports.compareBuild = compareBuild\nfunction compareBuild (a, b, loose) {\n var versionA = new SemVer(a, loose)\n var versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\n\nexports.rcompare = rcompare\nfunction rcompare (a, b, loose) {\n return compare(b, a, loose)\n}\n\nexports.sort = sort\nfunction sort (list, loose) {\n return list.sort(function (a, b) {\n return exports.compareBuild(a, b, loose)\n })\n}\n\nexports.rsort = rsort\nfunction rsort (list, loose) {\n return list.sort(function (a, b) {\n return exports.compareBuild(b, a, loose)\n })\n}\n\nexports.gt = gt\nfunction gt (a, b, loose) {\n return compare(a, b, loose) > 0\n}\n\nexports.lt = lt\nfunction lt (a, b, loose) {\n return compare(a, b, loose) < 0\n}\n\nexports.eq = eq\nfunction eq (a, b, loose) {\n return compare(a, b, loose) === 0\n}\n\nexports.neq = neq\nfunction neq (a, b, loose) {\n return compare(a, b, loose) !== 0\n}\n\nexports.gte = gte\nfunction gte (a, b, loose) {\n return compare(a, b, loose) >= 0\n}\n\nexports.lte = lte\nfunction lte (a, b, loose) {\n return compare(a, b, loose) <= 0\n}\n\nexports.cmp = cmp\nfunction cmp (a, op, b, loose) {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError('Invalid operator: ' + op)\n }\n}\n\nexports.Comparator = Comparator\nfunction Comparator (comp, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n if (!(this instanceof Comparator)) {\n return new Comparator(comp, options)\n }\n\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n}\n\nvar ANY = {}\nComparator.prototype.parse = function (comp) {\n var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n var m = comp.match(r)\n\n if (!m) {\n throw new TypeError('Invalid comparator: ' + comp)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n}\n\nComparator.prototype.toString = function () {\n return this.value\n}\n\nComparator.prototype.test = function (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n}\n\nComparator.prototype.intersects = function (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n var rangeTmp\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n rangeTmp = new Range(comp.value, options)\n return satisfies(this.value, rangeTmp, options)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n rangeTmp = new Range(this.value, options)\n return satisfies(comp.semver, rangeTmp, options)\n }\n\n var sameDirectionIncreasing =\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '>=' || comp.operator === '>')\n var sameDirectionDecreasing =\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '<=' || comp.operator === '<')\n var sameSemVer = this.semver.version === comp.semver.version\n var differentDirectionsInclusive =\n (this.operator === '>=' || this.operator === '<=') &&\n (comp.operator === '>=' || comp.operator === '<=')\n var oppositeDirectionsLessThan =\n cmp(this.semver, '<', comp.semver, options) &&\n ((this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '<=' || comp.operator === '<'))\n var oppositeDirectionsGreaterThan =\n cmp(this.semver, '>', comp.semver, options) &&\n ((this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '>=' || comp.operator === '>'))\n\n return sameDirectionIncreasing || sameDirectionDecreasing ||\n (sameSemVer && differentDirectionsInclusive) ||\n oppositeDirectionsLessThan || oppositeDirectionsGreaterThan\n}\n\nexports.Range = Range\nfunction Range (range, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (range instanceof Range) {\n if (range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n return new Range(range.value, options)\n }\n\n if (!(this instanceof Range)) {\n return new Range(range, options)\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First, split based on boolean or ||\n this.raw = range\n this.set = range.split(/\\s*\\|\\|\\s*/).map(function (range) {\n return this.parseRange(range.trim())\n }, this).filter(function (c) {\n // throw out any that are not relevant for whatever reason\n return c.length\n })\n\n if (!this.set.length) {\n throw new TypeError('Invalid SemVer Range: ' + range)\n }\n\n this.format()\n}\n\nRange.prototype.format = function () {\n this.range = this.set.map(function (comps) {\n return comps.join(' ').trim()\n }).join('||').trim()\n return this.range\n}\n\nRange.prototype.toString = function () {\n return this.range\n}\n\nRange.prototype.parseRange = function (range) {\n var loose = this.options.loose\n range = range.trim()\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace)\n debug('hyphen replace', range)\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range, re[t.COMPARATORTRIM])\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n\n // normalize spaces\n range = range.split(/\\s+/).join(' ')\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n var set = range.split(' ').map(function (comp) {\n return parseComparator(comp, this.options)\n }, this).join(' ').split(/\\s+/)\n if (this.options.loose) {\n // in loose mode, throw out any that are not valid comparators\n set = set.filter(function (comp) {\n return !!comp.match(compRe)\n })\n }\n set = set.map(function (comp) {\n return new Comparator(comp, this.options)\n }, this)\n\n return set\n}\n\nRange.prototype.intersects = function (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some(function (thisComparators) {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some(function (rangeComparators) {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every(function (thisComparator) {\n return rangeComparators.every(function (rangeComparator) {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n}\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nfunction isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// Mostly just for testing and legacy API reasons\nexports.toComparators = toComparators\nfunction toComparators (range, options) {\n return new Range(range, options).set.map(function (comp) {\n return comp.map(function (c) {\n return c.value\n }).join(' ').trim().split(' ')\n })\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nfunction parseComparator (comp, options) {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nfunction isX (id) {\n return !id || id.toLowerCase() === 'x' || id === '*'\n}\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0\nfunction replaceTildes (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceTilde(comp, options)\n }).join(' ')\n}\n\nfunction replaceTilde (comp, options) {\n var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('tilde', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0\n// ^1.2.3 --> >=1.2.3 <2.0.0\n// ^1.2.0 --> >=1.2.0 <2.0.0\nfunction replaceCarets (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceCaret(comp, options)\n }).join(' ')\n}\n\nfunction replaceCaret (comp, options) {\n debug('caret', comp, options)\n var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('caret', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n if (M === '0') {\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else {\n ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + (+M + 1) + '.0.0'\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + (+M + 1) + '.0.0'\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nfunction replaceXRanges (comp, options) {\n debug('replaceXRanges', comp, options)\n return comp.split(/\\s+/).map(function (comp) {\n return replaceXRange(comp, options)\n }).join(' ')\n}\n\nfunction replaceXRange (comp, options) {\n comp = comp.trim()\n var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, function (ret, gtlt, M, m, p, pr) {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n var xM = isX(M)\n var xm = xM || isX(m)\n var xp = xm || isX(p)\n var anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n // >1.2.3 => >= 1.2.4\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n ret = gtlt + M + '.' + m + '.' + p + pr\n } else if (xm) {\n ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr\n } else if (xp) {\n ret = '>=' + M + '.' + m + '.0' + pr +\n ' <' + M + '.' + (+m + 1) + '.0' + pr\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nfunction replaceStars (comp, options) {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0\nfunction hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}\n\n// if ANY of the sets match ALL of its comparators, then pass\nRange.prototype.test = function (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (var i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n}\n\nfunction testSet (set, version, options) {\n for (var i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n var allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n\nexports.satisfies = satisfies\nfunction satisfies (version, range, options) {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\n\nexports.maxSatisfying = maxSatisfying\nfunction maxSatisfying (versions, range, options) {\n var max = null\n var maxSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\n\nexports.minSatisfying = minSatisfying\nfunction minSatisfying (versions, range, options) {\n var min = null\n var minSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\n\nexports.minVersion = minVersion\nfunction minVersion (range, loose) {\n range = new Range(range, loose)\n\n var minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n comparators.forEach(function (comparator) {\n // Clone to avoid manipulating the comparator's semver object.\n var compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!minver || gt(minver, compver)) {\n minver = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error('Unexpected operation: ' + comparator.operator)\n }\n })\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\n\nexports.validRange = validRange\nfunction validRange (range, options) {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\n\n// Determine if version is less than all the versions possible in the range\nexports.ltr = ltr\nfunction ltr (version, range, options) {\n return outside(version, range, '<', options)\n}\n\n// Determine if version is greater than all the versions possible in the range.\nexports.gtr = gtr\nfunction gtr (version, range, options) {\n return outside(version, range, '>', options)\n}\n\nexports.outside = outside\nfunction outside (version, range, hilo, options) {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n var gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisifes the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n var high = null\n var low = null\n\n comparators.forEach(function (comparator) {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nexports.prerelease = prerelease\nfunction prerelease (version, options) {\n var parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\n\nexports.intersects = intersects\nfunction intersects (r1, r2, options) {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2)\n}\n\nexports.coerce = coerce\nfunction coerce (version, options) {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n var match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n var next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null) {\n return null\n }\n\n return parse(match[2] +\n '.' + (match[3] || '0') +\n '.' + (match[4] || '0'), options)\n}\n","'use strict';\nconst fs = require('fs');\nconst path = require('path');\nconst {promisify} = require('util');\nconst semver = require('semver');\n\nconst useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0');\n\n// https://github.com/nodejs/node/issues/8987\n// https://github.com/libuv/libuv/pull/1088\nconst checkPath = pth => {\n\tif (process.platform === 'win32') {\n\t\tconst pathHasInvalidWinCharacters = /[<>:\"|?*]/.test(pth.replace(path.parse(pth).root, ''));\n\n\t\tif (pathHasInvalidWinCharacters) {\n\t\t\tconst error = new Error(`Path contains invalid characters: ${pth}`);\n\t\t\terror.code = 'EINVAL';\n\t\t\tthrow error;\n\t\t}\n\t}\n};\n\nconst processOptions = options => {\n\t// https://github.com/sindresorhus/make-dir/issues/18\n\tconst defaults = {\n\t\tmode: 0o777 & (~process.umask()),\n\t\tfs\n\t};\n\n\treturn {\n\t\t...defaults,\n\t\t...options\n\t};\n};\n\nconst permissionError = pth => {\n\t// This replicates the exception of `fs.mkdir` with native the\n\t// `recusive` option when run on an invalid drive under Windows.\n\tconst error = new Error(`operation not permitted, mkdir '${pth}'`);\n\terror.code = 'EPERM';\n\terror.errno = -4048;\n\terror.path = pth;\n\terror.syscall = 'mkdir';\n\treturn error;\n};\n\nconst makeDir = async (input, options) => {\n\tcheckPath(input);\n\toptions = processOptions(options);\n\n\tconst mkdir = promisify(options.fs.mkdir);\n\tconst stat = promisify(options.fs.stat);\n\n\tif (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) {\n\t\tconst pth = path.resolve(input);\n\n\t\tawait mkdir(pth, {\n\t\t\tmode: options.mode,\n\t\t\trecursive: true\n\t\t});\n\n\t\treturn pth;\n\t}\n\n\tconst make = async pth => {\n\t\ttry {\n\t\t\tawait mkdir(pth, options.mode);\n\n\t\t\treturn pth;\n\t\t} catch (error) {\n\t\t\tif (error.code === 'EPERM') {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tif (error.code === 'ENOENT') {\n\t\t\t\tif (path.dirname(pth) === pth) {\n\t\t\t\t\tthrow permissionError(pth);\n\t\t\t\t}\n\n\t\t\t\tif (error.message.includes('null bytes')) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\n\t\t\t\tawait make(path.dirname(pth));\n\n\t\t\t\treturn make(pth);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst stats = await stat(pth);\n\t\t\t\tif (!stats.isDirectory()) {\n\t\t\t\t\tthrow new Error('The path is not a directory');\n\t\t\t\t}\n\t\t\t} catch (_) {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\treturn pth;\n\t\t}\n\t};\n\n\treturn make(path.resolve(input));\n};\n\nmodule.exports = makeDir;\n\nmodule.exports.sync = (input, options) => {\n\tcheckPath(input);\n\toptions = processOptions(options);\n\n\tif (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) {\n\t\tconst pth = path.resolve(input);\n\n\t\tfs.mkdirSync(pth, {\n\t\t\tmode: options.mode,\n\t\t\trecursive: true\n\t\t});\n\n\t\treturn pth;\n\t}\n\n\tconst make = pth => {\n\t\ttry {\n\t\t\toptions.fs.mkdirSync(pth, options.mode);\n\t\t} catch (error) {\n\t\t\tif (error.code === 'EPERM') {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tif (error.code === 'ENOENT') {\n\t\t\t\tif (path.dirname(pth) === pth) {\n\t\t\t\t\tthrow permissionError(pth);\n\t\t\t\t}\n\n\t\t\t\tif (error.message.includes('null bytes')) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\n\t\t\t\tmake(path.dirname(pth));\n\t\t\t\treturn make(pth);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tif (!options.fs.statSync(pth).isDirectory()) {\n\t\t\t\t\tthrow new Error('The path is not a directory');\n\t\t\t\t}\n\t\t\t} catch (_) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\n\t\treturn pth;\n\t};\n\n\treturn make(path.resolve(input));\n};\n","'use strict';\nconst path = require('path');\nconst fs = require('fs');\nconst commonDir = require('commondir');\nconst pkgDir = require('pkg-dir');\nconst makeDir = require('make-dir');\n\nconst {env, cwd} = process;\n\nconst isWritable = path => {\n\ttry {\n\t\tfs.accessSync(path, fs.constants.W_OK);\n\t\treturn true;\n\t} catch (_) {\n\t\treturn false;\n\t}\n};\n\nfunction useDirectory(directory, options) {\n\tif (options.create) {\n\t\tmakeDir.sync(directory);\n\t}\n\n\tif (options.thunk) {\n\t\treturn (...arguments_) => path.join(directory, ...arguments_);\n\t}\n\n\treturn directory;\n}\n\nfunction getNodeModuleDirectory(directory) {\n\tconst nodeModules = path.join(directory, 'node_modules');\n\n\tif (\n\t\t!isWritable(nodeModules) &&\n\t\t(fs.existsSync(nodeModules) || !isWritable(path.join(directory)))\n\t) {\n\t\treturn;\n\t}\n\n\treturn nodeModules;\n}\n\nmodule.exports = (options = {}) => {\n\tif (env.CACHE_DIR && !['true', 'false', '1', '0'].includes(env.CACHE_DIR)) {\n\t\treturn useDirectory(path.join(env.CACHE_DIR, 'find-cache-dir'), options);\n\t}\n\n\tlet {cwd: directory = cwd()} = options;\n\n\tif (options.files) {\n\t\tdirectory = commonDir(directory, options.files);\n\t}\n\n\tdirectory = pkgDir.sync(directory);\n\n\tif (!directory) {\n\t\treturn;\n\t}\n\n\tconst nodeModules = getNodeModuleDirectory(directory);\n\tif (!nodeModules) {\n\t\treturn undefined;\n\t}\n\n\treturn useDirectory(path.join(directory, 'node_modules', '.cache', options.name), options);\n};\n","import { RollupContext } from \"./rollupcontext\";\nimport { ConsoleContext, VerbosityLevel } from \"./context\";\nimport { LanguageServiceHost } from \"./host\";\nimport { TsCache, convertDiagnostic, convertEmitOutput, getAllReferences } from \"./tscache\";\nimport { tsModule, setTypescriptModule } from \"./tsproxy\";\nimport * as tsTypes from \"typescript\";\nimport * as resolve from \"resolve\";\nimport * as _ from \"lodash\";\nimport { IOptions } from \"./ioptions\";\nimport { Partial } from \"./partial\";\nimport { parseTsConfig } from \"./parse-tsconfig\";\nimport { printDiagnostics } from \"./print-diagnostics\";\nimport { TSLIB, TSLIB_VIRTUAL, tslibSource, tslibVersion } from \"./tslib\";\nimport { blue, red, yellow, green } from \"colors/safe\";\nimport { relative } from \"path\";\nimport { normalize } from \"./normalize\";\nimport { satisfies } from \"semver\";\nimport findCacheDir from \"find-cache-dir\";\nimport { PluginImpl, PluginContext, InputOptions, OutputOptions, TransformResult, Plugin } from \"rollup\";\nimport { createFilter } from \"./get-options-overrides\";\n\ntype RPT2Options = Partial;\n\nexport { RPT2Options }\n\nconst typescript: PluginImpl = (options) =>\n{\n\tlet watchMode = false;\n\tlet generateRound = 0;\n\tlet rollupOptions: InputOptions;\n\tlet context: ConsoleContext;\n\tlet filter: any;\n\tlet parsedConfig: tsTypes.ParsedCommandLine;\n\tlet tsConfigPath: string | undefined;\n\tlet servicesHost: LanguageServiceHost;\n\tlet service: tsTypes.LanguageService;\n\tlet noErrors = true;\n\tconst declarations: { [name: string]: { type: tsTypes.OutputFile; map?: tsTypes.OutputFile } } = {};\n\tconst allImportedFiles = new Set();\n\n\tlet _cache: TsCache;\n\tconst cache = (): TsCache =>\n\t{\n\t\tif (!_cache)\n\t\t\t_cache = new TsCache(pluginOptions.clean, pluginOptions.objectHashIgnoreUnknownHack, servicesHost, pluginOptions.cacheRoot, parsedConfig.options, rollupOptions, parsedConfig.fileNames, context);\n\t\treturn _cache;\n\t};\n\n\tconst pluginOptions = { ...options } as IOptions;\n\n\t_.defaults(pluginOptions,\n\t\t{\n\t\t\tcheck: true,\n\t\t\tverbosity: VerbosityLevel.Warning,\n\t\t\tclean: false,\n\t\t\tcacheRoot: findCacheDir({ name: \"rollup-plugin-typescript2\" }),\n\t\t\tinclude: [\"*.ts+(|x)\", \"**/*.ts+(|x)\"],\n\t\t\texclude: [\"*.d.ts\", \"**/*.d.ts\"],\n\t\t\tabortOnError: true,\n\t\t\trollupCommonJSResolveHack: false,\n\t\t\ttsconfig: undefined,\n\t\t\tuseTsconfigDeclarationDir: false,\n\t\t\ttsconfigOverride: {},\n\t\t\ttransformers: [],\n\t\t\ttsconfigDefaults: {},\n\t\t\tobjectHashIgnoreUnknownHack: false,\n\t\t\tcwd: process.cwd(),\n\t\t});\n\n\tif (!pluginOptions.typescript) {\n\t\tpluginOptions.typescript = require(\"typescript\");\n\t}\n\n\tsetTypescriptModule(pluginOptions.typescript);\n\n\tconst self: Plugin & { _ongenerate: () => void, _onwrite: (this: PluginContext, _output: OutputOptions) => void } = {\n\n\t\tname: \"rpt2\",\n\n\t\toptions(config)\n\t\t{\n\t\t\trollupOptions = {... config};\n\t\t\tcontext = new ConsoleContext(pluginOptions.verbosity, \"rpt2: \");\n\n\t\t\twatchMode = process.env.ROLLUP_WATCH === \"true\";\n\t\t\t({ parsedTsConfig: parsedConfig, fileName: tsConfigPath } = parseTsConfig(context, pluginOptions));\n\n\t\t\tif (generateRound === 0)\n\t\t\t{\n\t\t\t\tparsedConfig.fileNames.forEach((fileName) => { allImportedFiles.add(fileName); });\n\n\t\t\t\tcontext.info(`typescript version: ${tsModule.version}`);\n\t\t\t\tcontext.info(`tslib version: ${tslibVersion}`);\n\t\t\t\tif (this.meta)\n\t\t\t\t\tcontext.info(`rollup version: ${this.meta.rollupVersion}`);\n\n\t\t\t\tif (!satisfies(tsModule.version, \"$TS_VERSION_RANGE\", { includePrerelease : true } as any))\n\t\t\t\t\tthrow new Error(`Installed typescript version '${tsModule.version}' is outside of supported range '$TS_VERSION_RANGE'`);\n\n\t\t\t\tcontext.info(`rollup-plugin-typescript2 version: $RPT2_VERSION`);\n\t\t\t\tcontext.debug(() => `plugin options:\\n${JSON.stringify(pluginOptions, (key, value) => key === \"typescript\" ? `version ${(value as typeof tsModule).version}` : value, 4)}`);\n\t\t\t\tcontext.debug(() => `rollup config:\\n${JSON.stringify(rollupOptions, undefined, 4)}`);\n\t\t\t\tcontext.debug(() => `tsconfig path: ${tsConfigPath}`);\n\n\t\t\t\tif (pluginOptions.objectHashIgnoreUnknownHack)\n\t\t\t\t\tcontext.warn(() => `${yellow(\"You are using 'objectHashIgnoreUnknownHack' option\")}. If you enabled it because of async functions, try disabling it now.`);\n\n\t\t\t\tif (watchMode)\n\t\t\t\t\tcontext.info(`running in watch mode`);\n\t\t\t}\n\n\t\t\tfilter = createFilter(context, pluginOptions, parsedConfig);\n\n\t\t\tservicesHost = new LanguageServiceHost(parsedConfig, pluginOptions.transformers, pluginOptions.cwd);\n\n\t\t\tservice = tsModule.createLanguageService(servicesHost, tsModule.createDocumentRegistry());\n\t\t\tservicesHost.setLanguageService(service);\n\n\t\t\t// printing compiler option errors\n\t\t\tif (pluginOptions.check)\n\t\t\t\tprintDiagnostics(context, convertDiagnostic(\"options\", service.getCompilerOptionsDiagnostics()), parsedConfig.options.pretty === true);\n\n\t\t\tif (pluginOptions.clean)\n\t\t\t\tcache().clean();\n\n\t\t\treturn config;\n\t\t},\n\n\t\twatchChange(id)\n\t\t{\n\t\t\tconst key = normalize(id);\n\t\t\tdelete declarations[key];\n\t\t},\n\n\t\tresolveId(importee, importer)\n\t\t{\n\t\t\tif (importee === TSLIB)\n\t\t\t\treturn TSLIB_VIRTUAL;\n\n\t\t\tif (!importer)\n\t\t\t\treturn;\n\n\t\t\timporter = normalize(importer);\n\n\t\t\t// avoiding trying to resolve ids for things imported from files unrelated to this plugin\n\t\t\tif (!allImportedFiles.has(importer))\n\t\t\t\treturn;\n\n\t\t\t// TODO: use module resolution cache\n\t\t\tconst result = tsModule.nodeModuleNameResolver(importee, importer, parsedConfig.options, tsModule.sys);\n\n\t\t\tif (result.resolvedModule && result.resolvedModule.resolvedFileName)\n\t\t\t{\n\t\t\t\tif (filter(result.resolvedModule.resolvedFileName))\n\t\t\t\t\tcache().setDependency(result.resolvedModule.resolvedFileName, importer);\n\n\t\t\t\tif (_.endsWith(result.resolvedModule.resolvedFileName, \".d.ts\"))\n\t\t\t\t\treturn;\n\n\t\t\t\tconst resolved = pluginOptions.rollupCommonJSResolveHack\n\t\t\t\t\t? resolve.sync(result.resolvedModule.resolvedFileName)\n\t\t\t\t\t: result.resolvedModule.resolvedFileName;\n\n\t\t\t\tcontext.debug(() => `${blue(\"resolving\")} '${importee}' imported by '${importer}'`);\n\t\t\t\tcontext.debug(() => ` to '${resolved}'`);\n\n\t\t\t\treturn resolved;\n\t\t\t}\n\n\t\t\treturn;\n\t\t},\n\n\t\tload(id)\n\t\t{\n\t\t\tif (id === TSLIB_VIRTUAL)\n\t\t\t\treturn tslibSource;\n\n\t\t\treturn null;\n\t\t},\n\n\t\ttransform(code, id)\n\t\t{\n\t\t\tgenerateRound = 0; // in watch mode transform call resets generate count (used to avoid printing too many copies of the same error messages)\n\n\t\t\tif (!filter(id))\n\t\t\t\treturn undefined;\n\n\t\t\tallImportedFiles.add(normalize(id));\n\n\t\t\tconst contextWrapper = new RollupContext(pluginOptions.verbosity, pluginOptions.abortOnError, this, \"rpt2: \");\n\n\t\t\tconst snapshot = servicesHost.setSnapshot(id, code);\n\n\t\t\t// getting compiled file from cache or from ts\n\t\t\tconst result = cache().getCompiled(id, snapshot, () =>\n\t\t\t{\n\t\t\t\tconst output = service.getEmitOutput(id);\n\n\t\t\t\tif (output.emitSkipped)\n\t\t\t\t{\n\t\t\t\t\tnoErrors = false;\n\n\t\t\t\t\t// always checking on fatal errors, even if options.check is set to false\n\t\t\t\t\tconst diagnostics = _.concat(\n\t\t\t\t\t\tcache().getSyntacticDiagnostics(id, snapshot, () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn service.getSyntacticDiagnostics(id);\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tcache().getSemanticDiagnostics(id, snapshot, () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn service.getSemanticDiagnostics(id);\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t\tprintDiagnostics(contextWrapper, diagnostics, parsedConfig.options.pretty === true);\n\n\t\t\t\t\t// since no output was generated, aborting compilation\n\t\t\t\t\tcache().done();\n\t\t\t\t\tif (_.isFunction(this.error))\n\t\t\t\t\t\tthis.error(red(`failed to transpile '${id}'`));\n\t\t\t\t}\n\n\t\t\t\tconst references = getAllReferences(id, servicesHost.getScriptSnapshot(id), parsedConfig.options);\n\t\t\t\treturn convertEmitOutput(output, references);\n\t\t\t});\n\n\t\t\tif (pluginOptions.check)\n\t\t\t{\n\t\t\t\tconst diagnostics = _.concat(\n\t\t\t\t\tcache().getSyntacticDiagnostics(id, snapshot, () =>\n\t\t\t\t\t{\n\t\t\t\t\t\treturn service.getSyntacticDiagnostics(id);\n\t\t\t\t\t}),\n\t\t\t\t\tcache().getSemanticDiagnostics(id, snapshot, () =>\n\t\t\t\t\t{\n\t\t\t\t\t\treturn service.getSemanticDiagnostics(id);\n\t\t\t\t\t}),\n\t\t\t\t);\n\n\t\t\t\tif (diagnostics.length > 0)\n\t\t\t\t\tnoErrors = false;\n\n\t\t\t\tprintDiagnostics(contextWrapper, diagnostics, parsedConfig.options.pretty === true);\n\t\t\t}\n\n\t\t\tif (result)\n\t\t\t{\n\t\t\t\tif (result.references)\n\t\t\t\t\tresult.references.map(normalize).map(allImportedFiles.add, allImportedFiles);\n\n\t\t\t\tif (watchMode && this.addWatchFile && result.references)\n\t\t\t\t{\n\t\t\t\t\tif (tsConfigPath)\n\t\t\t\t\t\tthis.addWatchFile(tsConfigPath);\n\t\t\t\t\tresult.references.map(this.addWatchFile, this);\n\t\t\t\t\tcontext.debug(() => `${green(\" watching\")}: ${result.references!.join(\"\\nrpt2: \")}`);\n\t\t\t\t}\n\n\t\t\t\tif (result.dts)\n\t\t\t\t{\n\t\t\t\t\tconst key = normalize(id);\n\t\t\t\t\tdeclarations[key] = { type: result.dts, map: result.dtsmap };\n\t\t\t\t\tcontext.debug(() => `${blue(\"generated declarations\")} for '${key}'`);\n\t\t\t\t}\n\n\t\t\t\tconst transformResult: TransformResult = { code: result.code, map: { mappings: \"\" } };\n\n\t\t\t\tif (result.map)\n\t\t\t\t{\n\t\t\t\t\tif (pluginOptions.sourceMapCallback)\n\t\t\t\t\t\tpluginOptions.sourceMapCallback(id, result.map);\n\t\t\t\t\ttransformResult.map = JSON.parse(result.map);\n\t\t\t\t}\n\n\t\t\t\treturn transformResult;\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t},\n\n\t\tgenerateBundle(bundleOptions)\n\t\t{\n\t\t\tself._ongenerate();\n\t\t\tself._onwrite.call(this, bundleOptions);\n\t\t},\n\n\t\t_ongenerate(): void\n\t\t{\n\t\t\tcontext.debug(() => `generating target ${generateRound + 1}`);\n\n\t\t\tif (pluginOptions.check && watchMode && generateRound === 0)\n\t\t\t{\n\t\t\t\tcache().walkTree((id) =>\n\t\t\t\t{\n\t\t\t\t\tif (!filter(id))\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tconst snapshot = servicesHost.getScriptSnapshot(id);\n\t\t\t\t\tif (!snapshot)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tconst diagnostics = _.concat(\n\t\t\t\t\t\tcache().getSyntacticDiagnostics(id, snapshot, () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn service.getSyntacticDiagnostics(id);\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tcache().getSemanticDiagnostics(id, snapshot, () =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn service.getSemanticDiagnostics(id);\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\n\t\t\t\t\tprintDiagnostics(context, diagnostics, parsedConfig.options.pretty === true);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (!watchMode && !noErrors)\n\t\t\t\tcontext.info(yellow(\"there were errors or warnings.\"));\n\n\t\t\tcache().done();\n\n\t\t\tgenerateRound++;\n\t\t},\n\n\t\t_onwrite(this: PluginContext, _output: OutputOptions): void\n\t\t{\n\t\t\tif (!parsedConfig.options.declaration)\n\t\t\t\treturn;\n\n\t\t\t_.each(parsedConfig.fileNames, (name) =>\n\t\t\t{\n\t\t\t\tconst key = normalize(name);\n\t\t\t\tif (_.has(declarations, key))\n\t\t\t\t\treturn;\n\t\t\t\tif (!allImportedFiles.has(key))\n\t\t\t\t{\n\t\t\t\t\tcontext.debug(() => `skipping declarations for unused '${key}'`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tcontext.debug(() => `generating missed declarations for '${key}'`);\n\t\t\t\tconst output = service.getEmitOutput(key, true);\n\t\t\t\tconst out = convertEmitOutput(output);\n\t\t\t\tif (out.dts)\n\t\t\t\t\tdeclarations[key] = { type: out.dts, map: out.dtsmap };\n\t\t\t});\n\n\t\t\tconst emitDeclaration = (key: string, extension: string, entry?: tsTypes.OutputFile) =>\n\t\t\t{\n\t\t\t\tif (!entry)\n\t\t\t\t\treturn;\n\n\t\t\t\tlet fileName = entry.name;\n\t\t\t\tif (fileName.includes(\"?\")) // HACK for rollup-plugin-vue, it creates virtual modules in form 'file.vue?rollup-plugin-vue=script.ts'\n\t\t\t\t\tfileName = fileName.split(\"?\", 1) + extension;\n\n\t\t\t\t// If 'useTsconfigDeclarationDir' is given in the\n\t\t\t\t// plugin options, directly write to the path provided\n\t\t\t\t// by Typescript's LanguageService (which may not be\n\t\t\t\t// under Rollup's output directory, and thus can't be\n\t\t\t\t// emitted as an asset).\n\t\t\t\tif (pluginOptions.useTsconfigDeclarationDir)\n\t\t\t\t{\n\t\t\t\t\tcontext.debug(() => `${blue(\"emitting declarations\")} for '${key}' to '${fileName}'`);\n\t\t\t\t\ttsModule.sys.writeFile(fileName, entry.text, entry.writeByteOrderMark);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tconst relativePath = relative(pluginOptions.cwd, fileName);\n\t\t\t\t\tcontext.debug(() => `${blue(\"emitting declarations\")} for '${key}' to '${relativePath}'`);\n\t\t\t\t\tthis.emitFile({\n\t\t\t\t\t\ttype: \"asset\",\n\t\t\t\t\t\tsource: entry.text,\n\t\t\t\t\t\tfileName: relativePath,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t_.each(declarations, ({ type, map }, key) =>\n\t\t\t{\n\t\t\t\temitDeclaration(key, \".d.ts\", type);\n\t\t\t\temitDeclaration(key, \".d.ts.map\", map);\n\t\t\t});\n\t\t},\n\t};\n\n\treturn self;\n};\n\nexport default typescript;\n"],"names":["undefined","global","this","_.isFunction","_.has","_.concat","eq","assocIndexOf","listCacheClear","listCacheDelete","listCacheGet","listCacheHas","listCacheSet","ListCache","freeGlobal","Symbol","root","objectProto","nativeObjectToString","symToStringTag","getRawTag","objectToString","isObject","baseGetTag","coreJsData","funcProto","funcToString","hasOwnProperty","isMasked","isFunction","toSource","getValue","baseIsNative","getNative","nativeCreate","HASH_UNDEFINED","hashClear","hashDelete","hashGet","hashHas","hashSet","Hash","Map","isKeyable","getMapData","mapCacheClear","mapCacheDelete","mapCacheGet","mapCacheHas","mapCacheSet","MapCache","stackClear","stackDelete","stackGet","stackHas","stackSet","defineProperty","baseAssignValue","assignValue","isObjectLike","baseIsArguments","stubFalse","MAX_SAFE_INTEGER","argsTag","funcTag","isLength","nodeUtil","baseUnary","baseIsTypedArray","isArray","isArguments","isBuffer","isTypedArray","baseTimes","isIndex","overArg","isPrototype","nativeKeys","isArrayLike","arrayLikeKeys","baseKeys","copyObject","keys","nativeKeysIn","baseKeysIn","keysIn","propertyIsEnumerable","stubArray","arrayFilter","getSymbols","nativeGetSymbols","arrayPush","getPrototype","getSymbolsIn","baseGetAllKeys","Promise","Set","mapTag","objectTag","setTag","weakMapTag","dataViewTag","DataView","WeakMap","Uint8Array","cloneArrayBuffer","boolTag","dateTag","numberTag","regexpTag","stringTag","arrayBufferTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","cloneDataView","cloneTypedArray","cloneRegExp","cloneSymbol","baseCreate","getTag","baseIsMap","baseIsSet","arrayTag","errorTag","genTag","symbolTag","initCloneArray","copyArray","cloneBuffer","initCloneObject","copySymbolsIn","baseAssignIn","copySymbols","baseAssign","initCloneByTag","Stack","isSet","isMap","getAllKeysIn","getAllKeys","arrayEach","CLONE_SYMBOLS_FLAG","baseClone","createBaseFor","baseFor","createBaseEach","baseForOwn","identity","baseEach","castFunction","require$$0","setCacheAdd","setCacheHas","SetCache","arraySome","cacheHas","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","symbolProto","symbolValueOf","mapToArray","setToArray","equalArrays","equalByTag","equalObjects","baseIsEqualDeep","baseIsEqual","isStrictComparable","getMatchData","matchesStrictComparable","baseIsMatch","isSymbol","memoize","memoizeCapped","arrayMap","baseToString","isKey","stringToPath","toString","INFINITY","castPath","toKey","baseGet","hasPath","baseHasIn","get","hasIn","baseProperty","basePropertyDeep","baseMatchesProperty","baseMatches","property","baseFilter","baseIteratee","baseHas","baseMap","arrayReduce","baseReduce","rsAstralRange","rsComboMarksRange","reComboHalfMarksRange","rsComboSymbolsRange","rsComboRange","rsVarRange","rsZWJ","hasUnicode","unicodeSize","asciiSize","isString","stringSize","isFlattenable","apply","constant","shortOut","baseSetToString","setToString","overRest","strictIndexOf","baseFindIndex","baseIsNaN","baseIndexOf","noop","LARGE_ARRAY_SIZE","arrayIncludes","arrayIncludesWith","createSet","baseRest","baseUniq","baseFlatten","isArrayLikeObject","baseValues","lodash","require","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","_","Graph","PriorityQueue","dijkstra","tarjan","DEFAULT_WEIGHT_FUNC","topsort","dfs","crypto","emptyDirSync","existsSync","_.isEqual","readdirSync","readJsonSync","writeJsonSync","ensureFileSync","removeSync","renameSync","os","util","colors","path.normalize","_.endsWith","_.compact","_.map","hash","_.filter","pathExistsSync","statSync","blue","alg","_.each","yellow","green","_.some","white","red","_\r\n .chain","join","createRollupFilter","_.get","dirname","_.merge","readFileSync","debug","MAX_LENGTH","compareIdentifiers","re","t","SemVer","parse","compare","compareBuild","neq","gt","gte","lt","lte","Comparator","cmp","Range","range","ANY","satisfies","comparator","outside","internalRe","require$$16","require$$17","require$$18","require$$19","require$$20","require$$21","require$$22","require$$23","require$$24","require$$25","require$$26","require$$27","require$$28","require$$29","require$$30","require$$31","require$$32","require$$33","require$$34","require$$35","require$$36","require$$37","require$$38","require$$39","path","pTry","pLimit","fs","pLocate","promisify","semver","env","makeDir","commonDir","pkgDir","_.defaults","resolve.sync","relative"],"mappings":"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AAG;AAC/D,IAAI,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;AAC9E,IAAI,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;AAC9E,IAAI,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;AAC/D,IAAI,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;AAC/D,IAAI,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;AAC/D,IAAI,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;AAC9E,IAAI,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;AAC9E,IAAI,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG;AACjC,IAAI,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;AAChD,IAAI,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;AAC9E,IAAI,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;AAC9E,IAAI,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;AAC/D,IAAI,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;AAC/D,IAAI,QAAQ,EA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Cb,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE;AACzC,MAAM,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM;AACnC,UAAU,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC;AAC3D,UAAU,EAAE,CAAC;AACb,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE;AAC5C,MAAM,IAAI,MAAM,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AACpD,MAAM,IAAI,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAO,EAAE,CAAC;AAClB,OAAO;AACP,MAAM,IAAI,KAAK,IAAI,OAAO,KAAK,IAAI,QAAQ,IAAI,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE;AACpF,QAAQ,KAAK,GAAG,CAAC,CAAC;AAClB,QAAQ,GAAG,GAAG,MAAM,CAAC;AACrB,OAAO;AACP,MAAM,OAAO,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AAChD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,SAAS,CAAC,K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Q,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AACxC,OAAO;AACP,KAAK,CAAC,CAAC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,KAAK,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE;AACjD,MAAM,IAAI,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,GAAG,SAAS,CAAC;AAC9D,MAAM,IAAI,KAAK,IAAI,cAAc,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE;AACjE,QAAQ,SAAS,GAAGA,WAAS,CAAC;AAC9B,OAAO;AACP,MAAM,OAAO,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AACzD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,MAAM,CAAC,UAAU,EAAE,SAAS,EAAE;AAC3C,MAAM,IAAI,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,WAAW,GAAG,UAAU,CAAC;AAChE,MAAM,OAAO,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AACzD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,QAAQ,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,OAAO,CAAC,UAAU,EAAE,QAAQ,EAAE;AAC3C,MAAM,OAAO,WAAW,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;AACvD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,WAAW,CAAC,UAAU,EAAE,QAAQ,EAAE;AAC/C,MAAM,OAAO,WAAW,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC9D,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,YAAY,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE;AACvD,MAAM,KAAK,GAAG,KAAK,KAAKA,WAAS,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;AACzD,MAAM,OAAO,WAAW,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC;AAC3D,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,OAAO,CAA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SAAS;AACT,QAAQ,OAAO,MAAM,CAAC;AACtB,OAAO;AACP,MAAM,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC;AAChC,MAAM,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;AAC9B,MAAM,OAAO,SAAS,CAAC;AACvB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,KAAK,GAAG,QAAQ,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE;AAC9C,MAAM,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;AACtC,KAAK,CAAC,CAAC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,KAAK,GAAG,QAAQ,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;AACpD,MAAM,OAAO,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AACxD,KAAK,CAAC,CAAC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,IAAI,CAAC,IAAI,EAAE;AACxB,MAAM,OAAO,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;AAC9C,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE;AACrC,MAAM,IAAI,OAAO,IAAI,IAAI,UAAU,KAAK,QAAQ,IAAI,IAAI,IAAI,OAAO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,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE;AAClC,MAAM,OAAO,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;AACnD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,SAAS,GAAG;AACzB,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;AAC7B,QAAQ,OAAO,EAAE,CAAC;AAClB,OAAO;AACP,MAAM,IAAI,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC/B,MAAM,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;AAC9C,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE;AAC1B,MAAM,OAAO,SAAS,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;AAClD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE;AAC1C,MAAM,UAAU,GAAG,OAAO,UAAU,IAAI,UAAU,GAAG,UAAU,GAAGA,WAAS,CAAC;AAC5E,MAAM,OAAO,SAAS,CAAC,KAAK,EAAE,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAC9D,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,SAAS,CAAC,KAAK,EAAE;AAC9B,MAAM,OAAO,SAAS,CAAC,KAAK,EAAE,eAAe,GAAG,kBAAkB,CAAC,CAAC;AACpE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,aAAa,CAAC,KAAK,EAAE,UAAU,EAAE;AAC9C,MAAM,UAAU,GAAG,OAAO,UAAU,IAAI,UAAU,GAAG,UAAU,GAAGA,WAAS,CAAC;AAC5E,MAAM,OAAO,SAAS,CAAC,KAAK,EAAE,eAAe,GAAG,kBAAkB,EAAE,UAAU,CAAC,CAAC;AAChF,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE;AACxC,MAAM,OAAO,MAAM,IAAI,IAAI,IAAI,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC5E,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE;AAC9B,MAAM,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,KAAK,CAAC,CAAC;AACrE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,EAAE,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,GAAG,GAAG,yBAAyB,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE;AAC/D,MAAM,OAAO,KAAK,IAAI,KAAK,CAAC;AAC5B,KAAK,CAAC,CAAC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,WAAW,GAAG,eAAe,CAAC,WAAW,EAAE,OAAO,SAAS,CAAC,EAAE,EAAE,CAAC,GAAG,eAAe,GAAG,SAAS,KAAK,EAAE;AAC9G,MAAM,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC;AACxE,QAAQ,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACpD,KAAK,CAAC;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,aAAa,GAAG,iBAAiB,GAAG,SAAS,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAAC;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AI,QAAQ,IAAI,IAAI,IAAI,UAAU,CAAC,CAAC;AACvE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,YAAY,CAAC,KAAK,EAAE;AACjC,MAAM,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,IAAI,QAAQ,CAAC;AACvD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE;AACrC,MAAM,OAAO,MAAM,KAAK,MAAM,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;AACpF,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE;AACrD,MAAM,UAAU,GAAG,OAAO,UAAU,IAAI,UAAU,GAAG,UAAU,GAAGA,WAAS,CAAC;AAC5E,MAAM,OAAO,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;AAC3E,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE;AAC1B;AACA;AACA;AACA,MAAM,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC;AAChD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,QAAQ,CAAC,KAAK,EAAE;AAC7B,MAAM,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE;AAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;AACzC,OAAO;AACP,MAAM,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;AACjC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,MAAM,CAAC,KAAK,EAAE;AAC3B,MAAM,OAAO,KAAK,KAAK,IAAI,CAAC;AAC5B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE;AAC1B,MAAM,OAAO,KAAK,IAAI,IAAI,CAAC;AAC3B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,QAAQ,CAAC,KAAK,EAAE;AAC7B,MAAM,OAAO,OAAO,KAAK,IAAI,QAAQ;AACrC,SAAS,YAAY,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC;AAChE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,aAAa,CAAC,KAAK,EAAE;AAClC,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,SAAS,EAAE;AAClE,QAAQ,OAAO,KAAK,CAAC;AACrB,OAAO;AACP,MAAM,IAAI,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;AACtC,MAAM,IAAI,KAAK,KAAK,IAAI,EAAE;AAC1B,QAAQ,OAAO,IAAI,CAAC;AACpB,OAAO;AACP,MAAM,IAAI,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC;AAChF,MAAM,OAAO,OAAO,IAAI,IAAI,UAAU,IAAI,IAAI,YAAY,IAAI;AAC9D,QAAQ,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,gBAAgB,CAAC;AACpD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,aAAa,CAAC,KAAK,EAAE;AAClC,MAAM,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,gBAAgB,IAAI,KAAK,IAAI,gBAAgB,CAAC;AACzF,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,QAAQ,CAAC,KAAK,EAAE;AAC7B,MAAM,OAAO,OAAO,KAAK,IAAI,QAAQ;AACrC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC;AACnF,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,QAAQ,CAAC,KAAK,EAAE;AAC7B,MAAM,OAAO,OAAO,KAAK,IAAI,QAAQ;AACrC,SAAS,YAAY,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC;AAChE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,YAAY,GAAG,gBAAgB,GAAG,SAAS,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAAC;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,WAAW,CAAC,KAAK,EAAE;AAChC,MAAM,OAAO,KAAK,KAAKA,WAAS,CAAC;AACjC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,SAAS,CAAC,KAAK,EAAE;AAC9B,MAAM,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC;AAChE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,SAAS,CAAC,KAAK,EA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,QAAQ,GAAG,cAAc,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE;AAC3D,MAAM,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AACjD,KAAK,CAAC,CAAC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,YAAY,GAAG,cAAc,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE;AACrF,MAAM,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;AAC7D,KAAK,CAAC,CAAC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,UAAU,GAAG,cAAc,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE;AACnF,MAAM,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;AAC3D,KAAK,CAAC,CAAC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA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7E,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE;AACrC,MAAM,OAAO,MAAM,IAAI,IAAI;AAC3B,UAAU,MAAM;AAChB,UAAU,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC5D,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE;AAC1C,MAAM,OAAO,MAAM,IAAI,IAAI;AAC3B,UAAU,MAAM;AAChB,UAAU,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACjE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE;AACtC,MAAM,OAAO,MAAM,IAAI,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;AACpE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE;AAC3C,MAAM,OAAO,MAAM,IAAI,eAAe,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;AACzE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,SAAS,CAAC,MAAM,EAAE;AAC/B,MAAM,OAAO,MAAM,IAAI,IAAI,GAAG,EAAE,GAAG,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AACvE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,WAAW,CAAC,MAAM,EAAE;AACjC,MAAM,OAAO,MAAM,IAAI,IAAI,GAAG,EAAE,GAAG,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AACzE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE;AAC7C,MAAM,IAAI,MAAM,GAAG,MAAM,IAAI,IAAI,GAAGA,WAAS,GAAG,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACtE,MAAM,OAAO,MAAM,KAAKA,WAAS,GAAG,YAAY,GAAG,MAAM,CAAC;AAC1D,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE;AAC/B,MAAM,OAAO,MAAM,IAAI,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9D,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE;AACjC,MAAM,OAAO,MAAM,IAAI,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC7D,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE;AAC3C,MAAM,OAAO,MAAM,IAAI,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AACvF,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE;AAC3D,MAAM,UAAU,GAAG,OAAO,UAAU,IAAI,UAAU,GAAG,UAAU,GAAGA,WAAS,CAAC;AAC5E,MAAM,OAAO,MAAM,IAAI,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC;AACnG,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE;AAC5B,MAAM,OAAO,MAAM,IAAI,IAAI,GAAG,EAAE,GAAG,UAAU,CAAC,MAAM,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CA;AACA;AACA,IAAI,SAAS,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE;AAC5C,MAAM,OAAO,CAAC,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,KAAK,IAAI,YAAY,GAAG,KAAK,CAAC;AACvE,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,IAAI,GAAG,UAAU,EAAE,CAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,QAAQ,CAAC,KAAK,EAAE;AAC7B,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,QAAQ,CAAC,IAAI,EAAE;AAC5B,MAAM,OAAO,YAAY,CAAC,OAAO,IAAI,IAAI,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC;AAC/F,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,OAAO,CAAC,MAAM,EAAE;AAC7B,MAAM,OAAO,WAAW,CAAC,SAAS,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;AAC7D,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE;AAC7C,MAAM,OAAO,mBAAmB,CAAC,IAAI,EAAE,SAAS,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC;AAC7E,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,MAAM,GAAG,QAAQ,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE;AAC/C,MAAM,OAAO,SAAS,MAAM,EAAE;AAC9B,QAAQ,OAAO,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9C,OAAO,CAAC;AACR,KAAK,CAAC,CAAC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,QAAQ,GAAG,QAAQ,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE;AACnD,MAAM,OAAO,SAAS,IAAI,EAAE;AAC5B,QAAQ,OAAO,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9C,OAAO,CAAC;AACR,KAAK,CAAC,CAAC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;AAC5C,MAAM,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;AAC9B,UAAU,WAAW,GAAG,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACrD;AACA,MAAM,IAAI,OAAO,IAAI,IAAI;AACzB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,WAAW,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE;AACxE,QAAQ,OAAO,GAAG,MAAM,CAAC;AACzB,QAAQ,MAAM,GAAG,MAAM,CAAC;AACxB,QAAQ,MAAM,GAAG,IAAI,CAAC;AACtB,QAAQ,WAAW,GAAG,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,OAAO;AACP,MAAM,IAAI,KAAK,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK;AAC/E,UAAU,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AACtC;AACA,MAAM,SAAS,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE;AAClD,QAAQ,IAAI,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACtC,QAAQ,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;AAClC,QAAQ,IAAI,MAAM,EAAE;AACpB,UAAU,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,WAAW;AACpD,YAAY,IAAI,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;AAC1C,YAAY,IAAI,KAAK,IAAI,QAAQ,EAAE;AACnC,cAAc,IAAI,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;AACnD,kBAAkB,OAAO,GAAG,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC7E;AACA,cAAc,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;AACnF,cAAc,MAAM,CAAC,SAAS,GAAG,QAAQ,CAAC;AAC1C,cAAc,OAAO,MAAM,CAAC;AAC5B,aAAa;AACb,YAAY,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;AAC5E,WAAW,CAAC;AACZ,SAAS;AACT,OAAO,CAAC,CAAC;AACT;AACA,MAAM,OAAO,MAAM,CAAC;AACpB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,UAAU,GAAG;AAC1B,MAAM,IAAI,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE;AAC3B,QAAQ,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC;AACzB,OAAO;AACP,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,IAAI,GAAG;AACpB;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,MAAM,CAAC,CAAC,EAAE;AACvB,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,OAAO,QAAQ,CAAC,SAAS,IAAI,EAAE;AACrC,QAAQ,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAChC,OAAO,CAAC,CAAC;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,SAAS,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,QAAQ,CAAC,IAAI,EAAE;AAC5B,MAAM,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAC9E,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,UAAU,CAAC,MAAM,EAAE;AAChC,MAAM,OAAO,SAAS,IAAI,EAAE;AAC5B,QAAQ,OAAO,MAAM,IAAI,IAAI,GAAGA,WAAS,GAAG,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAClE,OAAO,CAAC;AACR,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,KAAK,GAAG,WAAW,EAAE,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,SAAS,GAAG;AACzB,MAAM,OAAO,EAAE,CAAC;AAChB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,SAAS,GAAG;AACzB,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,UAAU,GAAG;AAC1B,MAAM,OAAO,EAAE,CAAC;AAChB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,UAAU,GAAG;AAC1B,MAAM,OAAO,EAAE,CAAC;AAChB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,QAAQ,GAAG;AACxB,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE;AAChC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,gBAAgB,EAAE;AACzC,QAAQ,OAAO,EAAE,CAAC;AAClB,OAAO;AACP,MAAM,IAAI,KAAK,GAAG,gBAAgB;AAClC,UAAU,MAAM,GAAG,SAAS,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;AAClD;AACA,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;AACvC,MAAM,CAAC,IAAI,gBAAgB,CAAC;AAC5B;AACA,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAC/C,MAAM,OAAO,EAAE,KAAK,GAAG,CAAC,EAAE;AAC1B,QAAQ,QAAQ,CAAC,KAAK,CAAC,CAAC;AACxB,OAAO;AACP,MAAM,OAAO,MAAM,CAAC;AACpB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,MAAM,CAAC,KAAK,EAAE;AAC3B,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;AAC1B,QAAQ,OAAO,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACtC,OAAO;AACP,MAAM,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAClF,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,QAAQ,CAAC,MAAM,EAAE;AAC9B,MAAM,IAAI,EAAE,GAAG,EAAE,SAAS,CAAC;AAC3B,MAAM,OAAO,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;AACnC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,GAAG,GAAG,mBAAmB,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE;AAC3D,MAAM,OAAO,MAAM,GAAG,MAAM,CAAC;AAC7B,KAAK,EAAE,CAAC,CAAC,CAAC;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,MAAM,GAAG,mBAAmB,CAAC,SAAS,QAAQ,EAAE,OAAO,EAAE;AACjE,MAAM,OAAO,QAAQ,GAAG,OAAO,CAAC;AAChC,KAAK,EAAE,CAAC,CAAC,CAAC;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,GAAG,CAAC,KAAK,EAAE;AACxB,MAAM,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM;AACnC,UAAU,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC/C,UAAUA,WAAS,CAAC;AACpB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE;AACpC,MAAM,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM;AACnC,UAAU,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC;AAC/D,UAAUA,WAAS,CAAC;AACpB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,IAAI,CAAC,KAAK,EAAE;AACzB,MAAM,OAAO,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACvC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE;AACrC,MAAM,OAAO,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;AACvD,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,GAAG,CAAC,KAAK,EAAE;AACxB,MAAM,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM;AACnC,UAAU,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC/C,UAAUA,WAAS,CAAC;AACpB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE;AACpC,MAAM,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM;AACnC,UAAU,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC;AAC/D,UAAUA,WAAS,CAAC;AACpB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,QAAQ,GAAG,mBAAmB,CAAC,SAAS,UAAU,EAAE,YAAY,EAAE;AAC1E,MAAM,OAAO,UAAU,GAAG,YAAY,CAAC;AACvC,KAAK,EAAE,CAAC,CAAC,CAAC;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IA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"} \ No newline at end of file +{"version":3,"file":"rollup-plugin-typescript2.cjs.js","sources":["../node_modules/lodash/lodash.js","../src/context.ts","../src/rollupcontext.ts","../src/tsproxy.ts","../src/normalize.ts","../src/host.ts","../node_modules/lodash/_listCacheClear.js","../node_modules/lodash/eq.js","../node_modules/lodash/_assocIndexOf.js","../node_modules/lodash/_listCacheDelete.js","../node_modules/lodash/_listCacheGet.js","../node_modules/lodash/_listCacheHas.js","../node_modules/lodash/_listCacheSet.js","../node_modules/lodash/_ListCache.js","../node_modules/lodash/_stackClear.js","../node_modules/lodash/_stackDelete.js","../node_modules/lodash/_stackGet.js","../node_modules/lodash/_stackHas.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_root.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isObject.js","../node_modules/lodash/isFunction.js","../node_modules/lodash/_coreJsData.js","../node_modules/lodash/_isMasked.js","../node_modules/lodash/_toSource.js","../node_modules/lodash/_baseIsNative.js","../node_modules/lodash/_getValue.js","../node_modules/lodash/_getNative.js","../node_modules/lodash/_Map.js","../node_modules/lodash/_nativeCreate.js","../node_modules/lodash/_hashClear.js","../node_modules/lodash/_hashDelete.js","../node_modules/lodash/_hashGet.js","../node_modules/lodash/_hashHas.js","../node_modules/lodash/_hashSet.js","../node_modules/lodash/_Hash.js","../node_modules/lodash/_mapCacheClear.js","../node_modules/lodash/_isKeyable.js","../node_modules/lodash/_getMapData.js","../node_modules/lodash/_mapCacheDelete.js","../node_modules/lodash/_mapCacheGet.js","../node_modules/lodash/_mapCacheHas.js","../node_modules/lodash/_mapCacheSet.js","../node_modules/lodash/_MapCache.js","../node_modules/lodash/_stackSet.js","../node_modules/lodash/_Stack.js","../node_modules/lodash/_arrayEach.js","../node_modules/lodash/_defineProperty.js","../node_modules/lodash/_baseAssignValue.js","../node_modules/lodash/_assignValue.js","../node_modules/lodash/_copyObject.js","../node_modules/lodash/_baseTimes.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/_baseIsArguments.js","../node_modules/lodash/isArguments.js","../node_modules/lodash/isArray.js","../node_modules/lodash/stubFalse.js","../node_modules/lodash/isBuffer.js","../node_modules/lodash/_isIndex.js","../node_modules/lodash/isLength.js","../node_modules/lodash/_baseIsTypedArray.js","../node_modules/lodash/_baseUnary.js","../node_modules/lodash/_nodeUtil.js","../node_modules/lodash/isTypedArray.js","../node_modules/lodash/_arrayLikeKeys.js","../node_modules/lodash/_isPrototype.js","../node_modules/lodash/_overArg.js","../node_modules/lodash/_nativeKeys.js","../node_modules/lodash/_baseKeys.js","../node_modules/lodash/isArrayLike.js","../node_modules/lodash/keys.js","../node_modules/lodash/_baseAssign.js","../node_modules/lodash/_nativeKeysIn.js","../node_modules/lodash/_baseKeysIn.js","../node_modules/lodash/keysIn.js","../node_modules/lodash/_baseAssignIn.js","../node_modules/lodash/_cloneBuffer.js","../node_modules/lodash/_copyArray.js","../node_modules/lodash/_arrayFilter.js","../node_modules/lodash/stubArray.js","../node_modules/lodash/_getSymbols.js","../node_modules/lodash/_copySymbols.js","../node_modules/lodash/_arrayPush.js","../node_modules/lodash/_getPrototype.js","../node_modules/lodash/_getSymbolsIn.js","../node_modules/lodash/_copySymbolsIn.js","../node_modules/lodash/_baseGetAllKeys.js","../node_modules/lodash/_getAllKeys.js","../node_modules/lodash/_getAllKeysIn.js","../node_modules/lodash/_DataView.js","../node_modules/lodash/_Promise.js","../node_modules/lodash/_Set.js","../node_modules/lodash/_WeakMap.js","../node_modules/lodash/_getTag.js","../node_modules/lodash/_initCloneArray.js","../node_modules/lodash/_Uint8Array.js","../node_modules/lodash/_cloneArrayBuffer.js","../node_modules/lodash/_cloneDataView.js","../node_modules/lodash/_cloneRegExp.js","../node_modules/lodash/_cloneSymbol.js","../node_modules/lodash/_cloneTypedArray.js","../node_modules/lodash/_initCloneByTag.js","../node_modules/lodash/_baseCreate.js","../node_modules/lodash/_initCloneObject.js","../node_modules/lodash/_baseIsMap.js","../node_modules/lodash/isMap.js","../node_modules/lodash/_baseIsSet.js","../node_modules/lodash/isSet.js","../node_modules/lodash/_baseClone.js","../node_modules/lodash/clone.js","../node_modules/lodash/constant.js","../node_modules/lodash/_createBaseFor.js","../node_modules/lodash/_baseFor.js","../node_modules/lodash/_baseForOwn.js","../node_modules/lodash/_createBaseEach.js","../node_modules/lodash/_baseEach.js","../node_modules/lodash/identity.js","../node_modules/lodash/_castFunction.js","../node_modules/lodash/forEach.js","../node_modules/lodash/each.js","../node_modules/lodash/_baseFilter.js","../node_modules/lodash/_setCacheAdd.js","../node_modules/lodash/_setCacheHas.js","../node_modules/lodash/_SetCache.js","../node_modules/lodash/_arraySome.js","../node_modules/lodash/_cacheHas.js","../node_modules/lodash/_equalArrays.js","../node_modules/lodash/_mapToArray.js","../node_modules/lodash/_setToArray.js","../node_modules/lodash/_equalByTag.js","../node_modules/lodash/_equalObjects.js","../node_modules/lodash/_baseIsEqualDeep.js","../node_modules/lodash/_baseIsEqual.js","../node_modules/lodash/_baseIsMatch.js","../node_modules/lodash/_isStrictComparable.js","../node_modules/lodash/_getMatchData.js","../node_modules/lodash/_matchesStrictComparable.js","../node_modules/lodash/_baseMatches.js","../node_modules/lodash/isSymbol.js","../node_modules/lodash/_isKey.js","../node_modules/lodash/memoize.js","../node_modules/lodash/_memoizeCapped.js","../node_modules/lodash/_stringToPath.js","../node_modules/lodash/_arrayMap.js","../node_modules/lodash/_baseToString.js","../node_modules/lodash/toString.js","../node_modules/lodash/_castPath.js","../node_modules/lodash/_toKey.js","../node_modules/lodash/_baseGet.js","../node_modules/lodash/get.js","../node_modules/lodash/_baseHasIn.js","../node_modules/lodash/_hasPath.js","../node_modules/lodash/hasIn.js","../node_modules/lodash/_baseMatchesProperty.js","../node_modules/lodash/_baseProperty.js","../node_modules/lodash/_basePropertyDeep.js","../node_modules/lodash/property.js","../node_modules/lodash/_baseIteratee.js","../node_modules/lodash/filter.js","../node_modules/lodash/_baseHas.js","../node_modules/lodash/has.js","../node_modules/lodash/isEmpty.js","../node_modules/lodash/isUndefined.js","../node_modules/lodash/_baseMap.js","../node_modules/lodash/map.js","../node_modules/lodash/_arrayReduce.js","../node_modules/lodash/_baseReduce.js","../node_modules/lodash/reduce.js","../node_modules/lodash/isString.js","../node_modules/lodash/_asciiSize.js","../node_modules/lodash/_hasUnicode.js","../node_modules/lodash/_unicodeSize.js","../node_modules/lodash/_stringSize.js","../node_modules/lodash/size.js","../node_modules/lodash/transform.js","../node_modules/lodash/_isFlattenable.js","../node_modules/lodash/_baseFlatten.js","../node_modules/lodash/_apply.js","../node_modules/lodash/_overRest.js","../node_modules/lodash/_baseSetToString.js","../node_modules/lodash/_shortOut.js","../node_modules/lodash/_setToString.js","../node_modules/lodash/_baseRest.js","../node_modules/lodash/_baseFindIndex.js","../node_modules/lodash/_baseIsNaN.js","../node_modules/lodash/_strictIndexOf.js","../node_modules/lodash/_baseIndexOf.js","../node_modules/lodash/_arrayIncludes.js","../node_modules/lodash/_arrayIncludesWith.js","../node_modules/lodash/noop.js","../node_modules/lodash/_createSet.js","../node_modules/lodash/_baseUniq.js","../node_modules/lodash/isArrayLikeObject.js","../node_modules/lodash/union.js","../node_modules/lodash/_baseValues.js","../node_modules/lodash/values.js","../node_modules/graphlib/lib/lodash.js","../node_modules/graphlib/lib/graph.js","../node_modules/graphlib/lib/version.js","../node_modules/graphlib/lib/index.js","../node_modules/graphlib/lib/json.js","../node_modules/graphlib/lib/alg/components.js","../node_modules/graphlib/lib/data/priority-queue.js","../node_modules/graphlib/lib/alg/dijkstra.js","../node_modules/graphlib/lib/alg/dijkstra-all.js","../node_modules/graphlib/lib/alg/tarjan.js","../node_modules/graphlib/lib/alg/find-cycles.js","../node_modules/graphlib/lib/alg/floyd-warshall.js","../node_modules/graphlib/lib/alg/topsort.js","../node_modules/graphlib/lib/alg/is-acyclic.js","../node_modules/graphlib/lib/alg/dfs.js","../node_modules/graphlib/lib/alg/postorder.js","../node_modules/graphlib/lib/alg/preorder.js","../node_modules/graphlib/lib/alg/prim.js","../node_modules/graphlib/lib/alg/index.js","../node_modules/graphlib/index.js","../node_modules/object-hash/index.js","../src/rollingcache.ts","../node_modules/colors/lib/styles.js","../node_modules/colors/lib/system/has-flag.js","../node_modules/colors/lib/system/supports-colors.js","../node_modules/colors/lib/custom/trap.js","../node_modules/colors/lib/custom/zalgo.js","../node_modules/colors/lib/maps/america.js","../node_modules/colors/lib/maps/zebra.js","../node_modules/colors/lib/maps/rainbow.js","../node_modules/colors/lib/maps/random.js","../node_modules/colors/lib/colors.js","../node_modules/colors/safe.js","../src/diagnostics-format-host.ts","../src/nocache.ts","../src/tscache.ts","../src/print-diagnostics.ts","../src/get-options-overrides.ts","../src/check-tsconfig.ts","../src/parse-tsconfig.ts","../src/tslib.ts","../node_modules/semver/internal/constants.js","../node_modules/semver/internal/debug.js","../node_modules/semver/internal/re.js","../node_modules/semver/internal/identifiers.js","../node_modules/semver/classes/semver.js","../node_modules/semver/functions/parse.js","../node_modules/semver/functions/valid.js","../node_modules/semver/functions/clean.js","../node_modules/semver/functions/inc.js","../node_modules/semver/functions/compare.js","../node_modules/semver/functions/eq.js","../node_modules/semver/functions/diff.js","../node_modules/semver/functions/major.js","../node_modules/semver/functions/minor.js","../node_modules/semver/functions/patch.js","../node_modules/semver/functions/prerelease.js","../node_modules/semver/functions/rcompare.js","../node_modules/semver/functions/compare-loose.js","../node_modules/semver/functions/compare-build.js","../node_modules/semver/functions/sort.js","../node_modules/semver/functions/rsort.js","../node_modules/semver/functions/gt.js","../node_modules/semver/functions/lt.js","../node_modules/semver/functions/neq.js","../node_modules/semver/functions/gte.js","../node_modules/semver/functions/lte.js","../node_modules/semver/functions/cmp.js","../node_modules/semver/functions/coerce.js","../node_modules/semver/classes/range.js","../node_modules/semver/classes/comparator.js","../node_modules/semver/functions/satisfies.js","../node_modules/semver/ranges/to-comparators.js","../node_modules/semver/ranges/max-satisfying.js","../node_modules/semver/ranges/min-satisfying.js","../node_modules/semver/ranges/min-version.js","../node_modules/semver/ranges/valid.js","../node_modules/semver/ranges/outside.js","../node_modules/semver/ranges/gtr.js","../node_modules/semver/ranges/ltr.js","../node_modules/semver/ranges/intersects.js","../node_modules/semver/ranges/simplify.js","../node_modules/semver/ranges/subset.js","../node_modules/semver/index.js","../node_modules/commondir/index.js","../node_modules/p-try/index.js","../node_modules/p-limit/index.js","../node_modules/p-locate/index.js","../node_modules/locate-path/index.js","../node_modules/path-exists/index.js","../node_modules/find-up/index.js","../node_modules/pkg-dir/index.js","../node_modules/make-dir/node_modules/semver/semver.js","../node_modules/make-dir/index.js","../node_modules/find-cache-dir/index.js","../src/index.ts"],"sourcesContent":["/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.19';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading and trailing whitespace. */\n var reTrim = /^\\s+|\\s+$/g,\n reTrimStart = /^\\s+/,\n reTrimEnd = /\\s+$/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

' + func(text) + '

';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '

fred, barney, & pebbles

'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': ' - + + ``` There is a single async high level function, **`async minify(code, options)`**, @@ -1281,8 +1276,6 @@ $ rm -rf node_modules yarn.lock $ yarn ``` - - # Reporting issues In the terser CLI we use [source-map-support](https://npmjs.com/source-map-support) to produce good error stacks. In your own app, you're expected to enable source-map-support (read their docs) to have nice stack traces that will help you write good issues. diff --git a/node_modules/terser/bin/terser.mjs b/node_modules/terser/bin/terser.mjs deleted file mode 100644 index 264169f..0000000 --- a/node_modules/terser/bin/terser.mjs +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env node - -"use strict"; - -import "../tools/exit.cjs"; - -import fs from "fs" -import path from "path" -import program from "commander" - -import { run_cli } from "../lib/cli.js" - -const packageJson = { - name: "terser", - version: "experimental module CLI" -} - -run_cli({ program, packageJson, fs, path }).catch((error) => { - console.error(error); - process.exitCode = 1; -}); diff --git a/node_modules/terser/dist/bundle.min.js b/node_modules/terser/dist/bundle.min.js index 931a927..56adf4b 100644 --- a/node_modules/terser/dist/bundle.min.js +++ b/node_modules/terser/dist/bundle.min.js @@ -324,9 +324,6 @@ function set_annotation(node, annotation) { ***********************************************************************/ -var LATEST_RAW = ""; // Only used for numbers and template strings -var LATEST_TEMPLATE_END = true; - var KEYWORDS = "break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with"; var KEYWORDS_ATOM = "false null true"; var RESERVED_WORDS = "enum implements import interface package private protected public static super this " + KEYWORDS_ATOM + " " + KEYWORDS; @@ -382,9 +379,6 @@ var OPERATORS = makePredicate([ "=", "+=", "-=", - "||=", - "&&=", - "??=", "/=", "*=", "**=", @@ -482,14 +476,12 @@ function is_identifier_char(ch) { return UNICODE.ID_Continue.test(ch); } -const BASIC_IDENT = /^[a-z_$][a-z0-9_$]*$/i; - function is_basic_identifier_string(str) { - return BASIC_IDENT.test(str); + return /^[a-z_$][a-z0-9_$]*$/i.test(str); } function is_identifier_string(str, allow_surrogates) { - if (BASIC_IDENT.test(str)) { + if (/^[a-z_$][a-z0-9_$]*$/i.test(str)) { return true; } if (!allow_surrogates && /[\ud800-\udfff]/.test(str)) { @@ -647,23 +639,29 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { } else if (!is_comment) { prev_was_dot = false; } - const line = S.tokline; - const col = S.tokcol; - const pos = S.tokpos; - const nlb = S.newline_before; - const file = filename; - let comments_before = []; - let comments_after = []; - + var ret = { + type : type, + value : value, + line : S.tokline, + col : S.tokcol, + pos : S.tokpos, + endline : S.line, + endcol : S.col, + endpos : S.pos, + nlb : S.newline_before, + file : filename + }; + if (/^(?:num|string|regexp)$/i.test(type)) { + ret.raw = $TEXT.substring(ret.pos, ret.endpos); + } if (!is_comment) { - comments_before = S.comments_before; - comments_after = S.comments_before = []; + ret.comments_before = S.comments_before; + ret.comments_after = S.comments_before = []; } S.newline_before = false; - const tok = new AST_Token(type, value, line, col, pos, nlb, comments_before, comments_after, file); - - if (!is_comment) previous_token = tok; - return tok; + ret = new AST_Token(ret); + if (!is_comment) previous_token = ret; + return ret; } function skip_whitespace() { @@ -715,9 +713,6 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { return RE_NUM_LITERAL.test(ch); }); if (prefix) num = prefix + num; - - LATEST_RAW = num; - if (RE_OCT_NUMBER.test(num) && next_token.has_directive("use strict")) { parse_error("Legacy octal literals are not allowed in strict mode"); } @@ -825,17 +820,15 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { } var read_string = with_eof_error("Unterminated string constant", function() { - const start_pos = S.pos; - var quote = next(), ret = []; + var quote = next(), ret = ""; for (;;) { var ch = next(true, true); if (ch == "\\") ch = read_escaped_char(true, true); else if (ch == "\r" || ch == "\n") parse_error("Unterminated string constant"); else if (ch == quote) break; - ret.push(ch); + ret += ch; } - var tok = token("string", ret.join("")); - LATEST_RAW = S.text.slice(start_pos, S.pos); + var tok = token("string", ret); tok.quote = quote; return tok; }); @@ -854,8 +847,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { next(true, true); S.brace_counter++; tok = token(begin ? "template_head" : "template_substitution", content); - LATEST_RAW = raw; - LATEST_TEMPLATE_END = false; + tok.raw = raw; return tok; } @@ -871,8 +863,8 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { } S.template_braces.pop(); tok = token(begin ? "template_head" : "template_substitution", content); - LATEST_RAW = raw; - LATEST_TEMPLATE_END = true; + tok.raw = raw; + tok.end = true; return tok; }); @@ -905,7 +897,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { }); var read_name = with_eof_error("Unterminated identifier name", function() { - var name = [], ch, escaped = false; + var name, ch, escaped = false; var read_escaped_identifier_char = function() { escaped = true; next(); @@ -916,19 +908,17 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { }; // Read first character (ID_Start) - if ((ch = peek()) === "\\") { - ch = read_escaped_identifier_char(); - if (!is_identifier_start(ch)) { + if ((name = peek()) === "\\") { + name = read_escaped_identifier_char(); + if (!is_identifier_start(name)) { parse_error("First identifier char is an invalid identifier char"); } - } else if (is_identifier_start(ch)) { + } else if (is_identifier_start(name)) { next(); } else { return ""; } - name.push(ch); - // Read ID_Continue while ((ch = peek()) != null) { if ((ch = peek()) === "\\") { @@ -942,13 +932,12 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { } next(); } - name.push(ch); + name += ch; } - const name_str = name.join(""); - if (RESERVED_WORDS.has(name_str) && escaped) { + if (RESERVED_WORDS.has(name) && escaped) { parse_error("Escaped characters are not allowed in keywords"); } - return name_str; + return name; }); var read_regexp = with_eof_error("Unterminated regular expression", function(source) { @@ -972,7 +961,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { source += ch; } const flags = read_name(); - return token("regexp", "/" + source + "/" + flags); + return token("regexp", { source, flags }); }); function read_operator(prefix) { @@ -1165,9 +1154,7 @@ var UNARY_PREFIX = makePredicate([ var UNARY_POSTFIX = makePredicate([ "--", "++" ]); -var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "??=", "&&=", "||=", "/=", "*=", "**=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]); - -var LOGICAL_ASSIGNMENT = makePredicate([ "??=", "&&=", "||=" ]); +var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "/=", "*=", "**=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]); var PRECEDENCE = (function(a, ret) { for (var i = 0; i < a.length; ++i) { @@ -1205,7 +1192,7 @@ function parse($TEXT, options) { // Useful because comments_before property of call with parens outside // contains both comments inside and outside these parens. Used to find the // right #__PURE__ comments for an expression - const outer_comments_before_counts = new WeakMap(); + const outer_comments_before_counts = new Map(); options = defaults(options, { bare_returns : false, @@ -1339,7 +1326,7 @@ function parse($TEXT, options) { case "string": if (S.in_directives) { var token = peek(); - if (!LATEST_RAW.includes("\\") + if (!S.token.raw.includes("\\") && (is_token(token, "punc", ";") || is_token(token, "punc", "}") || has_newline_before(token) @@ -2322,12 +2309,7 @@ function parse($TEXT, options) { ret = _make_symbol(AST_SymbolRef); break; case "num": - ret = new AST_Number({ - start: tok, - end: tok, - value: tok.value, - raw: LATEST_RAW - }); + ret = new AST_Number({ start: tok, end: tok, value: tok.value }); break; case "big_int": ret = new AST_BigInt({ start: tok, end: tok, value: tok.value }); @@ -2341,9 +2323,7 @@ function parse($TEXT, options) { }); break; case "regexp": - const [_, source, flags] = tok.value.match(/^\/(.*)\/(\w*)$/); - - ret = new AST_RegExp({ start: tok, end: tok, value: { source, flags } }); + ret = new AST_RegExp({ start: tok, end: tok, value: tok.value }); break; case "atom": switch (tok.value) { @@ -2513,19 +2493,22 @@ function parse($TEXT, options) { segments.push(new AST_TemplateSegment({ start: S.token, - raw: LATEST_RAW, + raw: S.token.raw, value: S.token.value, end: S.token })); - - while (!LATEST_TEMPLATE_END) { + while (!S.token.end) { next(); handle_regexp(); segments.push(expression(true)); + if (!is_token("template_substitution")) { + unexpected(); + } + segments.push(new AST_TemplateSegment({ start: S.token, - raw: LATEST_RAW, + raw: S.token.raw, value: S.token.value, end: S.token })); @@ -2619,7 +2602,6 @@ function parse($TEXT, options) { left: value, operator: "=", right: expression(false), - logical: false, end: prev() }); } @@ -3388,13 +3370,11 @@ function parse($TEXT, options) { if (is("operator") && ASSIGNMENT.has(val)) { if (is_assignable(left) || (left = to_destructuring(left)) instanceof AST_Destructuring) { next(); - return new AST_Assign({ start : start, left : left, operator : val, right : maybe_assign(no_in), - logical : LOGICAL_ASSIGNMENT.has(val), end : prev() }); } @@ -3538,54 +3518,8 @@ function DEFNODE(type, props, methods, base = AST_Node) { return ctor; } -const has_tok_flag = (tok, flag) => Boolean(tok.flags & flag); -const set_tok_flag = (tok, flag, truth) => { - if (truth) { - tok.flags |= flag; - } else { - tok.flags &= ~flag; - } -}; - -const TOK_FLAG_NLB = 0b0001; -const TOK_FLAG_QUOTE_SINGLE = 0b0010; -const TOK_FLAG_QUOTE_EXISTS = 0b0100; - -class AST_Token { - constructor(type, value, line, col, pos, nlb, comments_before, comments_after, file) { - this.flags = (nlb ? 1 : 0); - - this.type = type; - this.value = value; - this.line = line; - this.col = col; - this.pos = pos; - this.comments_before = comments_before; - this.comments_after = comments_after; - this.file = file; - - Object.seal(this); - } - - get nlb() { - return has_tok_flag(this, TOK_FLAG_NLB); - } - - set nlb(new_nlb) { - set_tok_flag(this, TOK_FLAG_NLB, new_nlb); - } - - get quote() { - return !has_tok_flag(this, TOK_FLAG_QUOTE_EXISTS) - ? "" - : (has_tok_flag(this, TOK_FLAG_QUOTE_SINGLE) ? "'" : '"'); - } - - set quote(quote_type) { - set_tok_flag(this, TOK_FLAG_QUOTE_SINGLE, quote_type === "'"); - set_tok_flag(this, TOK_FLAG_QUOTE_EXISTS, !!quote_type); - } -} +var AST_Token = DEFNODE("Token", "type value line col pos endline endcol endpos nlb comments_before comments_after file raw quote end", { +}, null); var AST_Node = DEFNODE("Node", "start end", { _clone: function(deep) { @@ -4054,7 +3988,7 @@ var AST_TemplateSegment = DEFNODE("TemplateSegment", "value raw", { $documentation: "A segment of a template string literal", $propdoc: { value: "Content of the segment", - raw: "Raw source of the segment", + raw: "Raw content of the segment" } }); @@ -4566,11 +4500,8 @@ var AST_Conditional = DEFNODE("Conditional", "condition consequent alternative", }, }); -var AST_Assign = DEFNODE("Assign", "logical", { +var AST_Assign = DEFNODE("Assign", null, { $documentation: "An assignment expression — `a = b + 5`", - $propdoc: { - logical: "Whether it's a logical assignment" - } }, AST_Binary); var AST_DefaultAssign = DEFNODE("DefaultAssign", null, { @@ -4861,11 +4792,11 @@ var AST_String = DEFNODE("String", "value quote", { } }, AST_Constant); -var AST_Number = DEFNODE("Number", "value raw", { +var AST_Number = DEFNODE("Number", "value literal", { $documentation: "A number literal", $propdoc: { value: "[number] the numeric value", - raw: "[string] numeric value as string" + literal: "[string] numeric value as string (optional)" } }, AST_Constant); @@ -5432,10 +5363,6 @@ def_transform(AST_Sub, function(self, tw) { self.property = self.property.transform(tw); }); -def_transform(AST_Chain, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - def_transform(AST_Yield, function(self, tw) { if (self.expression) self.expression = self.expression.transform(tw); }); @@ -5944,7 +5871,6 @@ def_transform(AST_PrefixedTemplateString, function(self, tw) { return new AST_String(args); case "number": args.value = val; - args.raw = M.raw || val.toString(); return new AST_Number(args); case "boolean": return new (val ? AST_True : AST_False)(args); @@ -6469,10 +6395,22 @@ def_transform(AST_PrefixedTemplateString, function(self, tw) { def_to_moz(AST_Constant, function To_Moz_Literal(M) { var value = M.value; + if (typeof value === "number" && (value < 0 || (value === 0 && 1 / value < 0))) { + return { + type: "UnaryExpression", + operator: "-", + prefix: true, + argument: { + type: "Literal", + value: -value, + raw: M.start.raw + } + }; + } return { type: "Literal", value: value, - raw: M.raw || M.print_to_string() + raw: M.start.raw }; }); @@ -6497,36 +6435,40 @@ def_transform(AST_PrefixedTemplateString, function(self, tw) { /* -----[ tools ]----- */ + function raw_token(moznode) { + if (moznode.type == "Literal") { + return moznode.raw != null ? moznode.raw : moznode.value + ""; + } + } + function my_start_token(moznode) { var loc = moznode.loc, start = loc && loc.start; var range = moznode.range; - return new AST_Token( - "", - "", - start && start.line || 0, - start && start.column || 0, - range ? range [0] : moznode.start, - false, - [], - [], - loc && loc.source, - ); + return new AST_Token({ + file : loc && loc.source, + line : start && start.line, + col : start && start.column, + pos : range ? range[0] : moznode.start, + endline : start && start.line, + endcol : start && start.column, + endpos : range ? range[0] : moznode.start, + raw : raw_token(moznode), + }); } function my_end_token(moznode) { var loc = moznode.loc, end = loc && loc.end; var range = moznode.range; - return new AST_Token( - "", - "", - end && end.line || 0, - end && end.column || 0, - range ? range [0] : moznode.end, - false, - [], - [], - loc && loc.source, - ); + return new AST_Token({ + file : loc && loc.source, + line : end && end.line, + col : end && end.column, + pos : range ? range[1] : moznode.end, + endline : end && end.line, + endcol : end && end.column, + endpos : range ? range[1] : moznode.end, + raw : raw_token(moznode), + }); } function map(moztype, mytype, propmap) { @@ -6826,7 +6768,7 @@ function OutputStream(options) { let printed_comments = new Set(); var to_utf8 = options.ascii_only ? function(str, identifier) { - if (options.ecma >= 2015 && !options.safari10) { + if (options.ecma >= 2015) { str = str.replace(/[\ud800-\udbff][\udc00-\udfff]/g, function(ch) { var code = get_full_char_code(ch, 0).toString(16); return "\\u{" + code + "}"; @@ -7480,14 +7422,6 @@ function OutputStream(options) { PARENS(AST_Arrow, function(output) { var p = output.parent(); - - if ( - output.option("wrap_func_args") - && p instanceof AST_Call - && p.args.includes(this) - ) { - return true; - } return p instanceof AST_PropAccess && p.expression === this; }); @@ -7558,10 +7492,6 @@ function OutputStream(options) { return true; } - if (po === "??" && (so === "||" || so === "&&")) { - return true; - } - const pp = PRECEDENCE[po]; const sp = PRECEDENCE[so]; if (pp > sp @@ -7922,9 +7852,6 @@ function OutputStream(options) { } output.print("`"); }); - DEFPRINT(AST_TemplateSegment, function(self, output) { - output.print_template_string_chars(self.value); - }); AST_Arrow.DEFMETHOD("_do_print", function(output) { var self = this; @@ -8366,10 +8293,7 @@ function OutputStream(options) { var prop = self.property; var print_computed = RESERVED_WORDS.has(prop) ? output.option("ie8") - : !is_identifier_string( - prop, - output.option("ecma") >= 2015 || output.option("safari10") - ); + : !is_identifier_string(prop, output.option("ecma") >= 2015); if (self.optional) output.print("?."); @@ -8539,7 +8463,7 @@ function OutputStream(options) { var print_string = RESERVED_WORDS.has(key) ? output.option("ie8") : ( - output.option("ecma") < 2015 || output.option("safari10") + output.option("ecma") < 2015 ? !is_basic_identifier_string(key) : !is_identifier_string(key, true) ); @@ -8558,10 +8482,7 @@ function OutputStream(options) { var allowShortHand = output.option("shorthand"); if (allowShortHand && self.value instanceof AST_Symbol && - is_identifier_string( - self.key, - output.option("ecma") >= 2015 || output.option("safari10") - ) && + is_identifier_string(self.key, output.option("ecma") >= 2015) && get_name(self.value) === self.key && !RESERVED_WORDS.has(self.key) ) { @@ -8570,10 +8491,7 @@ function OutputStream(options) { } else if (allowShortHand && self.value instanceof AST_DefaultAssign && self.value.left instanceof AST_Symbol && - is_identifier_string( - self.key, - output.option("ecma") >= 2015 || output.option("safari10") - ) && + is_identifier_string(self.key, output.option("ecma") >= 2015) && get_name(self.value.left) === self.key ) { print_property_name(self.key, self.quote, output); @@ -8671,8 +8589,8 @@ function OutputStream(options) { output.print_string(self.getValue(), self.quote, output.in_directive); }); DEFPRINT(AST_Number, function(self, output) { - if ((output.option("keep_numbers") || output.use_asm) && self.raw) { - output.print(self.raw); + if ((output.option("keep_numbers") || output.use_asm) && self.start && self.start.raw != null) { + output.print(self.start.raw); } else { output.print(make_num(self.getValue())); } @@ -8977,8 +8895,6 @@ AST_Sequence.prototype.shallow_cmp = pass_through; AST_PropAccess.prototype.shallow_cmp = pass_through; -AST_Chain.prototype.shallow_cmp = pass_through; - AST_Dot.prototype.shallow_cmp = mkshallow({ property: "eq" }); @@ -9483,13 +9399,6 @@ AST_Scope.DEFMETHOD("conflicting_def", function (name) { ); }); -AST_Scope.DEFMETHOD("conflicting_def_shallow", function (name) { - return ( - this.enclosed.find(def => def.name === name) - || this.variables.has(name) - ); -}); - AST_Scope.DEFMETHOD("add_child_scope", function (scope) { // `scope` is going to be moved into `this` right now. // Update the required scopes' information @@ -9523,34 +9432,15 @@ AST_Scope.DEFMETHOD("add_child_scope", function (scope) { } }); -function find_scopes_visible_from(scopes) { - const found_scopes = new Set(); - - for (const scope of new Set(scopes)) { - (function bubble_up(scope) { - if (scope == null || found_scopes.has(scope)) return; - - found_scopes.add(scope); - - bubble_up(scope.parent_scope); - })(scope); - } - - return [...found_scopes]; -} - // Creates a symbol during compression AST_Scope.DEFMETHOD("create_symbol", function(SymClass, { source, tentative_name, scope, - conflict_scopes = [scope], init = null } = {}) { let symbol_name; - conflict_scopes = find_scopes_visible_from(conflict_scopes); - if (tentative_name) { // Implement hygiene (no new names are conflicting with existing names) tentative_name = @@ -9558,7 +9448,7 @@ AST_Scope.DEFMETHOD("create_symbol", function(SymClass, { tentative_name.replace(/(?:^[^a-z_$]|[^a-z0-9_$])/ig, "_"); let i = 0; - while (conflict_scopes.find(s => s.conflicting_def_shallow(symbol_name))) { + while (this.conflicting_def(symbol_name)) { symbol_name = tentative_name + "$" + i++; } } @@ -10730,7 +10620,6 @@ AST_Scope.DEFMETHOD("process_expression", function(insert, compressor) { function read_property(obj, key) { key = get_value(key); if (key instanceof AST_Node) return; - var value; if (obj instanceof AST_Array) { var elements = obj.elements; @@ -10745,7 +10634,6 @@ function read_property(obj, key) { if (!value && props[i].key === key) value = props[i].value; } } - return value instanceof AST_SymbolRef && value.fixed_value() || value; } @@ -10878,56 +10766,38 @@ function is_modified(compressor, tw, node, value, level, immutable) { || value instanceof AST_This; } - // A definition "escapes" when its value can leave the point of use. - // Example: `a = b || c` - // In this example, "b" and "c" are escaping, because they're going into "a" - // - // def.escaped is != 0 when it escapes. - // - // When greater than 1, it means that N chained properties will be read off - // of that def before an escape occurs. This is useful for evaluating - // property accesses, where you need to know when to stop. - function mark_escaped(tw, d, scope, node, value, level = 0, depth = 1) { + function mark_escaped(tw, d, scope, node, value, level, depth) { var parent = tw.parent(level); if (value) { if (value.is_constant()) return; if (value instanceof AST_ClassExpression) return; } - - if ( - parent instanceof AST_Assign && (parent.operator === "=" || parent.logical) && node === parent.right + if (parent instanceof AST_Assign && parent.operator == "=" && node === parent.right || parent instanceof AST_Call && (node !== parent.expression || parent instanceof AST_New) || parent instanceof AST_Exit && node === parent.value && node.scope !== d.scope || parent instanceof AST_VarDef && node === parent.value - || parent instanceof AST_Yield && node === parent.value && node.scope !== d.scope - ) { + || parent instanceof AST_Yield && node === parent.value && node.scope !== d.scope) { if (depth > 1 && !(value && value.is_constant_expression(scope))) depth = 1; if (!d.escaped || d.escaped > depth) d.escaped = depth; return; - } else if ( - parent instanceof AST_Array + } else if (parent instanceof AST_Array || parent instanceof AST_Await || parent instanceof AST_Binary && lazy_op.has(parent.operator) || parent instanceof AST_Conditional && node !== parent.condition || parent instanceof AST_Expansion - || parent instanceof AST_Sequence && node === parent.tail_node() - ) { + || parent instanceof AST_Sequence && node === parent.tail_node()) { mark_escaped(tw, d, scope, parent, parent, level + 1, depth); } else if (parent instanceof AST_ObjectKeyVal && node === parent.value) { var obj = tw.parent(level + 1); - mark_escaped(tw, d, scope, obj, obj, level + 2, depth); } else if (parent instanceof AST_PropAccess && node === parent.expression) { value = read_property(value, parent.property); - mark_escaped(tw, d, scope, parent, value, level + 1, depth + 1); if (value) return; } - if (level > 0) return; if (parent instanceof AST_Sequence && node !== parent.tail_node()) return; if (parent instanceof AST_SimpleStatement) return; - d.direct_access = true; } @@ -10951,64 +10821,32 @@ function is_modified(compressor, tw, node, value, level, immutable) { suppress(node.left); return; } - - const finish_walk = () => { - if (node.logical) { - node.left.walk(tw); - - push(tw); - node.right.walk(tw); - pop(tw); - - return true; - } - }; - var sym = node.left; - if (!(sym instanceof AST_SymbolRef)) return finish_walk(); - + if (!(sym instanceof AST_SymbolRef)) return; var def = sym.definition(); var safe = safe_to_assign(tw, def, sym.scope, node.right); def.assignments++; - if (!safe) return finish_walk(); - + if (!safe) return; var fixed = def.fixed; - if (!fixed && node.operator != "=" && !node.logical) return finish_walk(); - + if (!fixed && node.operator != "=") return; var eq = node.operator == "="; var value = eq ? node.right : node; - if (is_modified(compressor, tw, node, value, 0)) return finish_walk(); - + if (is_modified(compressor, tw, node, value, 0)) return; def.references.push(sym); - - if (!node.logical) { - if (!eq) def.chained = true; - - def.fixed = eq ? function() { - return node.right; - } : function() { - return make_node(AST_Binary, node, { - operator: node.operator.slice(0, -1), - left: fixed instanceof AST_Node ? fixed : fixed(), - right: node.right - }); - }; - } - - if (node.logical) { - mark(tw, def, false); - push(tw); - node.right.walk(tw); - pop(tw); - return true; - } - + if (!eq) def.chained = true; + def.fixed = eq ? function() { + return node.right; + } : function() { + return make_node(AST_Binary, node, { + operator: node.operator.slice(0, -1), + left: fixed instanceof AST_Node ? fixed : fixed(), + right: node.right + }); + }; mark(tw, def, false); node.right.walk(tw); mark(tw, def, true); - mark_escaped(tw, def, sym.scope, node, value, 0, 1); - return true; }); def_reduce_vars(AST_Binary, function(tw) { @@ -11611,8 +11449,7 @@ function tighten_body(statements, compressor) { } // Stop immediately if these node types are encountered var parent = scanner.parent(); - if (node instanceof AST_Assign - && (node.logical || node.operator != "=" && lhs.equivalent_to(node.left)) + if (node instanceof AST_Assign && node.operator != "=" && lhs.equivalent_to(node.left) || node instanceof AST_Await || node instanceof AST_Call && lhs instanceof AST_PropAccess && lhs.equivalent_to(node.expression) || node instanceof AST_Debugger @@ -11680,7 +11517,6 @@ function tighten_body(statements, compressor) { } return make_node(AST_Assign, candidate, { operator: "=", - logical: false, left: make_node(AST_SymbolRef, candidate.name, candidate.name), right: value }); @@ -11985,7 +11821,6 @@ function tighten_body(statements, compressor) { var parent = scanner.parent(level); if (parent instanceof AST_Assign) { if (write_only - && !parent.logical && !(parent.left instanceof AST_PropAccess || lvalues.has(parent.left.name))) { return find_stop(parent, level + 1, write_only); @@ -12040,9 +11875,7 @@ function tighten_body(statements, compressor) { } function get_lhs(expr) { - if (expr instanceof AST_Assign && expr.logical) { - return false; - } else if (expr instanceof AST_VarDef && expr.name instanceof AST_SymbolDeclaration) { + if (expr instanceof AST_VarDef && expr.name instanceof AST_SymbolDeclaration) { var def = expr.name.definition(); if (!member(expr.name, def.orig)) return; var referenced = def.references.length - def.replaced; @@ -12053,20 +11886,14 @@ function tighten_body(statements, compressor) { return make_node(AST_SymbolRef, expr.name, expr.name); } } else { - const lhs = expr instanceof AST_Assign - ? expr.left - : expr.expression; + const lhs = expr[expr instanceof AST_Assign ? "left" : "expression"]; return !is_ref_of(lhs, AST_SymbolConst) && !is_ref_of(lhs, AST_SymbolLet) && lhs; } } function get_rvalue(expr) { - if (expr instanceof AST_Assign) { - return expr.right; - } else { - return expr.value; - } + return expr[expr instanceof AST_Assign ? "right" : "value"]; } function get_lvalues(expr) { @@ -12125,9 +11952,7 @@ function tighten_body(statements, compressor) { && !(in_loop && (lvalues.has(lhs.name) || candidate instanceof AST_Unary - || (candidate instanceof AST_Assign - && !candidate.logical - && candidate.operator != "="))); + || candidate instanceof AST_Assign && candidate.operator != "=")); } function value_has_side_effects(expr) { @@ -12554,7 +12379,7 @@ function tighten_body(statements, compressor) { var def = defn.definitions[defn.definitions.length - 1]; if (!(def.value instanceof AST_Object)) return; var exprs; - if (body instanceof AST_Assign && !body.logical) { + if (body instanceof AST_Assign) { exprs = [ body ]; } else if (body instanceof AST_Sequence) { exprs = body.expressions.slice(); @@ -12777,8 +12602,6 @@ function is_undefined(node, compressor) { && (this.left._dot_throw(compressor) || this.right._dot_throw(compressor)); }); def_may_throw_on_access(AST_Assign, function(compressor) { - if (this.logical) return true; - return this.operator == "=" && this.right._dot_throw(compressor); }); @@ -14003,7 +13826,6 @@ AST_Scope.DEFMETHOD("drop_unused", function(compressor) { var drop_vars = !(self instanceof AST_Toplevel) || compressor.toplevel.vars; const assign_as_unused = r_keep_assign.test(compressor.option("unused")) ? return_false : function(node) { if (node instanceof AST_Assign - && !node.logical && (has_flag(node, WRITE_ONLY) || node.operator == "=") ) { return node.left; @@ -14222,7 +14044,6 @@ AST_Scope.DEFMETHOD("drop_unused", function(compressor) { sym.references.push(ref); var assign = make_node(AST_Assign, def, { operator: "=", - logical: false, left: ref, right: def.value }); @@ -14411,12 +14232,9 @@ AST_Scope.DEFMETHOD("hoist_declarations", function(compressor) { hoisted.push(node); return make_node(AST_EmptyStatement, node); } - if ( - hoist_vars - && node instanceof AST_Var - && !node.definitions.some(def => def.name instanceof AST_Destructuring) - ) { + if (hoist_vars && node instanceof AST_Var) { node.definitions.forEach(function(def) { + if (def.name instanceof AST_Destructuring) return; vars.set(def.name.name, def); ++vars_found; }); @@ -14496,7 +14314,8 @@ AST_Scope.DEFMETHOD("hoist_declarations", function(compressor) { continue; } if (self.body[i] instanceof AST_BlockStatement) { - self.body.splice(i, 1, ...self.body[i].body); + var tmp = [ i, 1 ].concat(self.body[i].body); + self.body.splice.apply(self.body, tmp); continue; } break; @@ -14541,14 +14360,9 @@ AST_Scope.DEFMETHOD("hoist_properties", function(compressor) { const defs = new Map(); const assignments = []; value.properties.forEach(({ key, value }) => { - const scope = find_scope(hoister); const symbol = self.create_symbol(sym.CTOR, { source: sym, - scope, - conflict_scopes: new Set([ - scope, - ...sym.definition().references.map(ref => ref.scope) - ]), + scope: find_scope(hoister), tentative_name: sym.name + "_" + key }); @@ -14658,8 +14472,6 @@ AST_Scope.DEFMETHOD("hoist_properties", function(compressor) { } }); def_drop_side_effect_free(AST_Assign, function(compressor) { - if (this.logical) return this; - var left = this.left; if (left.has_side_effects(compressor) || compressor.has_directive("use strict") @@ -15249,14 +15061,11 @@ AST_Definitions.DEFMETHOD("remove_initializers", function() { AST_Definitions.DEFMETHOD("to_assignments", function(compressor) { var reduce_vars = compressor.option("reduce_vars"); - var assignments = []; - - for (const def of this.definitions) { - if (def.value) { + var assignments = this.definitions.reduce(function(a, def) { + if (def.value && !(def.name instanceof AST_Destructuring)) { var name = make_node(AST_SymbolRef, def.name, def.name); - assignments.push(make_node(AST_Assign, def, { + a.push(make_node(AST_Assign, def, { operator : "=", - logical: false, left : name, right : def.value })); @@ -15270,13 +15079,13 @@ AST_Definitions.DEFMETHOD("to_assignments", function(compressor) { var var_ = make_node(AST_Var, def, { definitions: [ varDef ] }); - assignments.push(var_); + a.push(var_); } - const thedef = def.name.definition(); - thedef.eliminated++; - thedef.replaced--; - } - + def = def.name.definition(); + def.eliminated++; + def.replaced--; + return a; + }, []); if (assignments.length == 0) return null; return make_sequence(this, assignments); }); @@ -15287,17 +15096,6 @@ def_optimize(AST_Definitions, function(self) { return self; }); -def_optimize(AST_VarDef, function(self) { - if ( - self.name instanceof AST_SymbolLet - && self.value != null - && is_undefined(self.value) - ) { - self.value = null; - } - return self; -}); - def_optimize(AST_Import, function(self) { return self; }); @@ -15314,7 +15112,7 @@ function retain_top_func(fn, compressor) { def_optimize(AST_Call, function(self, compressor) { var exp = self.expression; var fn = exp; - inline_array_like_spread(self.args); + inline_array_like_spread(self, compressor, self.args); var simple_args = self.args.every((arg) => !(arg instanceof AST_Expansion) ); @@ -15882,7 +15680,6 @@ def_optimize(AST_Call, function(self, compressor) { def.references.push(sym); if (value) expressions.push(make_node(AST_Assign, self, { operator: "=", - logical: false, left: sym, right: value.clone() })); @@ -15926,7 +15723,6 @@ def_optimize(AST_Call, function(self, compressor) { def.references.push(sym); expressions.splice(pos++, 0, make_node(AST_Assign, var_def, { operator: "=", - logical: false, left: sym, right: make_node(AST_Undefined, name) })); @@ -16276,7 +16072,7 @@ def_optimize(AST_Binary, function(self, compressor) { && self.left.left.getValue() == "" && self.right.is_string(compressor)) { self.left = self.left.right; - return self; + return self.transform(compressor); } } if (compressor.option("evaluate")) { @@ -16375,6 +16171,25 @@ def_optimize(AST_Binary, function(self, compressor) { var associative = true; switch (self.operator) { case "+": + // "foo" + ("bar" + x) => "foobar" + x + if (self.left instanceof AST_Constant + && self.right instanceof AST_Binary + && self.right.operator == "+" + && self.right.is_string(compressor)) { + var binary = make_node(AST_Binary, self, { + operator: "+", + left: self.left, + right: self.right.left, + }); + var l = binary.optimize(compressor); + if (binary !== l) { + self = make_node(AST_Binary, self, { + operator: "+", + left: l, + right: self.right.right + }); + } + } // (x + "foo") + "bar" => x + "foobar" if (self.right instanceof AST_Constant && self.left instanceof AST_Binary @@ -16447,7 +16262,7 @@ def_optimize(AST_Binary, function(self, compressor) { var l = self.left; var r = self.right.evaluate(compressor); if (r != self.right) { - l.segments[l.segments.length - 1].value += String(r); + l.segments[l.segments.length - 1].value += r.toString(); return l; } } @@ -16456,7 +16271,7 @@ def_optimize(AST_Binary, function(self, compressor) { var r = self.right; var l = self.left.evaluate(compressor); if (l != self.left) { - r.segments[0].value = String(l) + r.segments[0].value; + r.segments[0].value = l.toString() + r.segments[0].value ; return r; } } @@ -16583,10 +16398,10 @@ def_optimize(AST_Binary, function(self, compressor) { ) { self.left = make_node(AST_Binary, self.left, { operator : self.operator, - left : self.left.transform(compressor), - right : self.right.left.transform(compressor) + left : self.left, + right : self.right.left }); - self.right = self.right.right.transform(compressor); + self.right = self.right.right; return self.transform(compressor); } var ev = self.evaluate(compressor); @@ -16659,9 +16474,7 @@ def_optimize(AST_SymbolRef, function(self, compressor) { && !(parent instanceof AST_Call && (parent.is_expr_pure(compressor)) || has_annotation(parent, _NOINLINE)) - && !(parent instanceof AST_Export - && fixed instanceof AST_Lambda - && fixed.name); + && !(fixed instanceof AST_Defun && parent instanceof AST_Export); if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) { if (retain_top_func(fixed, compressor)) { @@ -16691,8 +16504,7 @@ def_optimize(AST_SymbolRef, function(self, compressor) { && !scope_encloses_variables_in_this_scope(nearest_scope, fixed) || parent instanceof AST_Call && parent.expression === self - && !scope_encloses_variables_in_this_scope(nearest_scope, fixed) - && !(fixed.name && fixed.name.definition().recursive_refs > 0); + && !scope_encloses_variables_in_this_scope(nearest_scope, fixed); } if (single_use && fixed instanceof AST_Class) { const extends_inert = !fixed.extends @@ -16884,10 +16696,6 @@ function is_reachable(self, defs) { const ASSIGN_OPS = makePredicate("+ - / * % >> << >>> | ^ &"); const ASSIGN_OPS_COMMUTATIVE = makePredicate("* | ^ &"); def_optimize(AST_Assign, function(self, compressor) { - if (self.logical) { - return self.lift_sequences(compressor); - } - var def; if (compressor.option("dead_code") && self.left instanceof AST_SymbolRef @@ -17105,20 +16913,16 @@ def_optimize(AST_Conditional, function(self, compressor) { // | // v // exp = foo ? something : something_else; - if ( - consequent instanceof AST_Assign + if (consequent instanceof AST_Assign && alternative instanceof AST_Assign - && consequent.operator === alternative.operator - && consequent.logical === alternative.logical + && consequent.operator == alternative.operator && consequent.left.equivalent_to(alternative.left) && (!self.condition.has_side_effects(compressor) || consequent.operator == "=" - && !consequent.left.has_side_effects(compressor)) - ) { + && !consequent.left.has_side_effects(compressor))) { return make_node(AST_Assign, self, { operator: consequent.operator, left: consequent.left, - logical: consequent.logical, right: make_node(AST_Conditional, self, { condition: self.condition, consequent: consequent.right, @@ -17613,15 +17417,12 @@ function literals_in_boolean_context(self, compressor) { return self; } -function inline_array_like_spread(elements) { +function inline_array_like_spread(self, compressor, elements) { for (var i = 0; i < elements.length; i++) { var el = elements[i]; if (el instanceof AST_Expansion) { var expr = el.expression; - if ( - expr instanceof AST_Array - && !expr.elements.some(elm => elm instanceof AST_Hole) - ) { + if ( expr instanceof AST_Array) { elements.splice(i, 1, ...expr.elements); // Step back one, as the element at i is now new. i--; @@ -17630,6 +17431,7 @@ function inline_array_like_spread(elements) { // We therefore can’t optimize anything else, unlike with object spread. } } + return self; } def_optimize(AST_Array, function(self, compressor) { @@ -17637,20 +17439,21 @@ def_optimize(AST_Array, function(self, compressor) { if (optimized !== self) { return optimized; } - inline_array_like_spread(self.elements); - return self; + return inline_array_like_spread(self, compressor, self.elements); }); -function inline_object_prop_spread(props) { +def_optimize(AST_Object, function(self, compressor) { + var optimized = literals_in_boolean_context(self, compressor); + if (optimized !== self) { + return optimized; + } + var props = self.properties; for (var i = 0; i < props.length; i++) { var prop = props[i]; if (prop instanceof AST_Expansion) { - const expr = prop.expression; - if ( - expr instanceof AST_Object - && expr.properties.every(prop => prop instanceof AST_ObjectKeyVal) - ) { - props.splice(i, 1, ...expr.properties); + var expr = prop.expression; + if (expr instanceof AST_Object) { + props.splice.apply(props, [i, 1].concat(prop.expression.properties)); // Step back one, as the property at i is now new. i--; } else if (expr instanceof AST_Constant @@ -17662,14 +17465,6 @@ function inline_object_prop_spread(props) { } } } -} - -def_optimize(AST_Object, function(self, compressor) { - var optimized = literals_in_boolean_context(self, compressor); - if (optimized !== self) { - return optimized; - } - inline_object_prop_spread(self.properties); return self; }); @@ -17714,12 +17509,9 @@ def_optimize(AST_Yield, function(self, compressor) { }); def_optimize(AST_TemplateString, function(self, compressor) { - if ( - !compressor.option("evaluate") - || compressor.parent() instanceof AST_PrefixedTemplateString - ) { + if (!compressor.option("evaluate") + || compressor.parent() instanceof AST_PrefixedTemplateString) return self; - } var segments = []; for (var i = 0; i < self.segments.length; i++) { @@ -17755,17 +17547,7 @@ def_optimize(AST_TemplateString, function(self, compressor) { if (segments.length == 1) { return make_node(AST_String, self, segments[0]); } - - if ( - segments.length === 3 - && segments[1] instanceof AST_Node - && ( - segments[1].is_string(compressor) - || segments[1].is_number(compressor) - || is_nullish(segments[1]) - || compressor.option("unsafe") - ) - ) { + if (segments.length === 3 && segments[1] instanceof AST_Node) { // `foo${bar}` => "foo" + bar if (segments[2].value === "") { return make_node(AST_Binary, self, { @@ -17776,7 +17558,7 @@ def_optimize(AST_TemplateString, function(self, compressor) { right: segments[1], }); } - // `${bar}baz` => bar + "baz" + // `{bar}baz` => bar + "baz" if (segments[0].value === "") { return make_node(AST_Binary, self, { operator: "+", @@ -17882,8 +17664,7 @@ def_optimize(AST_Destructuring, function(self, compressor) { && compressor.option("unused") && !self.is_array && Array.isArray(self.names) - && !is_destructuring_export_decl(compressor) - && !(self.names[self.names.length - 1] instanceof AST_Expansion)) { + && !is_destructuring_export_decl(compressor)) { var keep = []; for (var i = 0; i < self.names.length; i++) { var elem = self.names[i]; @@ -17971,7 +17752,7 @@ def_optimize(AST_Destructuring, function(self, compressor) { ***********************************************************************/ // a small wrapper around fitzgen's source-map library -async function SourceMap(options) { +function SourceMap(options) { options = defaults(options, { file : null, root : null, @@ -17980,15 +17761,13 @@ async function SourceMap(options) { orig_line_diff : 0, dest_line_diff : 0, }); - - var orig_map; var generator = new MOZ_SourceMap.SourceMapGenerator({ file : options.file, sourceRoot : options.root }); + var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig); - if (options.orig) { - orig_map = await new MOZ_SourceMap.SourceMapConsumer(options.orig); + if (orig_map) { orig_map.sources.forEach(function(source) { var sourceContent = orig_map.sourceContentFor(source, true); if (sourceContent) { @@ -18018,16 +17797,10 @@ async function SourceMap(options) { name : name }); } - return { add : add, get : function() { return generator; }, - toString : function() { return generator.toString(); }, - destroy : function () { - if (orig_map && orig_map.destroy) { - orig_map.destroy(); - } - } + toString : function() { return JSON.stringify(generator.toJSON()); } }; } @@ -26278,7 +26051,10 @@ async function minify(files, options) { } if (!HOP(options.format, "code") || options.format.code) { if (options.sourceMap) { - options.format.source_map = await SourceMap({ + if (typeof options.sourceMap.content == "string") { + options.sourceMap.content = JSON.parse(options.sourceMap.content); + } + options.format.source_map = SourceMap({ file: options.sourceMap.filename, orig: options.sourceMap.content, root: options.sourceMap.root @@ -26316,9 +26092,6 @@ async function minify(files, options) { options.nameCache.props = cache_to_json(options.mangle.properties.cache); } } - if (options.format && options.format.source_map) { - options.format.source_map.destroy(); - } if (timings) { timings.end = Date.now(); result.timings = { @@ -26833,3 +26606,4 @@ exports._run_cli = run_cli; exports.minify = minify; }))); +//# sourceMappingURL=bundle.min.js.map diff --git a/node_modules/terser/lib/ast.js b/node_modules/terser/lib/ast.js index a8f28fa..19c1c47 100644 --- a/node_modules/terser/lib/ast.js +++ b/node_modules/terser/lib/ast.js @@ -93,54 +93,8 @@ function DEFNODE(type, props, methods, base = AST_Node) { return ctor; } -const has_tok_flag = (tok, flag) => Boolean(tok.flags & flag); -const set_tok_flag = (tok, flag, truth) => { - if (truth) { - tok.flags |= flag; - } else { - tok.flags &= ~flag; - } -}; - -const TOK_FLAG_NLB = 0b0001; -const TOK_FLAG_QUOTE_SINGLE = 0b0010; -const TOK_FLAG_QUOTE_EXISTS = 0b0100; - -class AST_Token { - constructor(type, value, line, col, pos, nlb, comments_before, comments_after, file) { - this.flags = (nlb ? 1 : 0); - - this.type = type; - this.value = value; - this.line = line; - this.col = col; - this.pos = pos; - this.comments_before = comments_before; - this.comments_after = comments_after; - this.file = file; - - Object.seal(this); - } - - get nlb() { - return has_tok_flag(this, TOK_FLAG_NLB); - } - - set nlb(new_nlb) { - set_tok_flag(this, TOK_FLAG_NLB, new_nlb); - } - - get quote() { - return !has_tok_flag(this, TOK_FLAG_QUOTE_EXISTS) - ? "" - : (has_tok_flag(this, TOK_FLAG_QUOTE_SINGLE) ? "'" : '"'); - } - - set quote(quote_type) { - set_tok_flag(this, TOK_FLAG_QUOTE_SINGLE, quote_type === "'"); - set_tok_flag(this, TOK_FLAG_QUOTE_EXISTS, !!quote_type); - } -} +var AST_Token = DEFNODE("Token", "type value line col pos endline endcol endpos nlb comments_before comments_after file raw quote end", { +}, null); var AST_Node = DEFNODE("Node", "start end", { _clone: function(deep) { @@ -609,7 +563,7 @@ var AST_TemplateSegment = DEFNODE("TemplateSegment", "value raw", { $documentation: "A segment of a template string literal", $propdoc: { value: "Content of the segment", - raw: "Raw source of the segment", + raw: "Raw content of the segment" } }); @@ -1121,11 +1075,8 @@ var AST_Conditional = DEFNODE("Conditional", "condition consequent alternative", }, }); -var AST_Assign = DEFNODE("Assign", "logical", { +var AST_Assign = DEFNODE("Assign", null, { $documentation: "An assignment expression — `a = b + 5`", - $propdoc: { - logical: "Whether it's a logical assignment" - } }, AST_Binary); var AST_DefaultAssign = DEFNODE("DefaultAssign", null, { @@ -1416,11 +1367,11 @@ var AST_String = DEFNODE("String", "value quote", { } }, AST_Constant); -var AST_Number = DEFNODE("Number", "value raw", { +var AST_Number = DEFNODE("Number", "value literal", { $documentation: "A number literal", $propdoc: { value: "[number] the numeric value", - raw: "[string] numeric value as string" + literal: "[string] numeric value as string (optional)" } }, AST_Constant); diff --git a/node_modules/terser/lib/compress/index.js b/node_modules/terser/lib/compress/index.js index 97a9b11..68a12a7 100644 --- a/node_modules/terser/lib/compress/index.js +++ b/node_modules/terser/lib/compress/index.js @@ -528,7 +528,6 @@ AST_Scope.DEFMETHOD("process_expression", function(insert, compressor) { function read_property(obj, key) { key = get_value(key); if (key instanceof AST_Node) return; - var value; if (obj instanceof AST_Array) { var elements = obj.elements; @@ -543,7 +542,6 @@ function read_property(obj, key) { if (!value && props[i].key === key) value = props[i].value; } } - return value instanceof AST_SymbolRef && value.fixed_value() || value; } @@ -676,56 +674,38 @@ function is_modified(compressor, tw, node, value, level, immutable) { || value instanceof AST_This; } - // A definition "escapes" when its value can leave the point of use. - // Example: `a = b || c` - // In this example, "b" and "c" are escaping, because they're going into "a" - // - // def.escaped is != 0 when it escapes. - // - // When greater than 1, it means that N chained properties will be read off - // of that def before an escape occurs. This is useful for evaluating - // property accesses, where you need to know when to stop. - function mark_escaped(tw, d, scope, node, value, level = 0, depth = 1) { + function mark_escaped(tw, d, scope, node, value, level, depth) { var parent = tw.parent(level); if (value) { if (value.is_constant()) return; if (value instanceof AST_ClassExpression) return; } - - if ( - parent instanceof AST_Assign && (parent.operator === "=" || parent.logical) && node === parent.right + if (parent instanceof AST_Assign && parent.operator == "=" && node === parent.right || parent instanceof AST_Call && (node !== parent.expression || parent instanceof AST_New) || parent instanceof AST_Exit && node === parent.value && node.scope !== d.scope || parent instanceof AST_VarDef && node === parent.value - || parent instanceof AST_Yield && node === parent.value && node.scope !== d.scope - ) { + || parent instanceof AST_Yield && node === parent.value && node.scope !== d.scope) { if (depth > 1 && !(value && value.is_constant_expression(scope))) depth = 1; if (!d.escaped || d.escaped > depth) d.escaped = depth; return; - } else if ( - parent instanceof AST_Array + } else if (parent instanceof AST_Array || parent instanceof AST_Await || parent instanceof AST_Binary && lazy_op.has(parent.operator) || parent instanceof AST_Conditional && node !== parent.condition || parent instanceof AST_Expansion - || parent instanceof AST_Sequence && node === parent.tail_node() - ) { + || parent instanceof AST_Sequence && node === parent.tail_node()) { mark_escaped(tw, d, scope, parent, parent, level + 1, depth); } else if (parent instanceof AST_ObjectKeyVal && node === parent.value) { var obj = tw.parent(level + 1); - mark_escaped(tw, d, scope, obj, obj, level + 2, depth); } else if (parent instanceof AST_PropAccess && node === parent.expression) { value = read_property(value, parent.property); - mark_escaped(tw, d, scope, parent, value, level + 1, depth + 1); if (value) return; } - if (level > 0) return; if (parent instanceof AST_Sequence && node !== parent.tail_node()) return; if (parent instanceof AST_SimpleStatement) return; - d.direct_access = true; } @@ -749,64 +729,32 @@ function is_modified(compressor, tw, node, value, level, immutable) { suppress(node.left); return; } - - const finish_walk = () => { - if (node.logical) { - node.left.walk(tw); - - push(tw); - node.right.walk(tw); - pop(tw); - - return true; - } - }; - var sym = node.left; - if (!(sym instanceof AST_SymbolRef)) return finish_walk(); - + if (!(sym instanceof AST_SymbolRef)) return; var def = sym.definition(); var safe = safe_to_assign(tw, def, sym.scope, node.right); def.assignments++; - if (!safe) return finish_walk(); - + if (!safe) return; var fixed = def.fixed; - if (!fixed && node.operator != "=" && !node.logical) return finish_walk(); - + if (!fixed && node.operator != "=") return; var eq = node.operator == "="; var value = eq ? node.right : node; - if (is_modified(compressor, tw, node, value, 0)) return finish_walk(); - + if (is_modified(compressor, tw, node, value, 0)) return; def.references.push(sym); - - if (!node.logical) { - if (!eq) def.chained = true; - - def.fixed = eq ? function() { - return node.right; - } : function() { - return make_node(AST_Binary, node, { - operator: node.operator.slice(0, -1), - left: fixed instanceof AST_Node ? fixed : fixed(), - right: node.right - }); - }; - } - - if (node.logical) { - mark(tw, def, false); - push(tw); - node.right.walk(tw); - pop(tw); - return true; - } - + if (!eq) def.chained = true; + def.fixed = eq ? function() { + return node.right; + } : function() { + return make_node(AST_Binary, node, { + operator: node.operator.slice(0, -1), + left: fixed instanceof AST_Node ? fixed : fixed(), + right: node.right + }); + }; mark(tw, def, false); node.right.walk(tw); mark(tw, def, true); - mark_escaped(tw, def, sym.scope, node, value, 0, 1); - return true; }); def_reduce_vars(AST_Binary, function(tw) { @@ -1409,8 +1357,7 @@ function tighten_body(statements, compressor) { } // Stop immediately if these node types are encountered var parent = scanner.parent(); - if (node instanceof AST_Assign - && (node.logical || node.operator != "=" && lhs.equivalent_to(node.left)) + if (node instanceof AST_Assign && node.operator != "=" && lhs.equivalent_to(node.left) || node instanceof AST_Await || node instanceof AST_Call && lhs instanceof AST_PropAccess && lhs.equivalent_to(node.expression) || node instanceof AST_Debugger @@ -1478,7 +1425,6 @@ function tighten_body(statements, compressor) { } return make_node(AST_Assign, candidate, { operator: "=", - logical: false, left: make_node(AST_SymbolRef, candidate.name, candidate.name), right: value }); @@ -1783,7 +1729,6 @@ function tighten_body(statements, compressor) { var parent = scanner.parent(level); if (parent instanceof AST_Assign) { if (write_only - && !parent.logical && !(parent.left instanceof AST_PropAccess || lvalues.has(parent.left.name))) { return find_stop(parent, level + 1, write_only); @@ -1838,9 +1783,7 @@ function tighten_body(statements, compressor) { } function get_lhs(expr) { - if (expr instanceof AST_Assign && expr.logical) { - return false; - } else if (expr instanceof AST_VarDef && expr.name instanceof AST_SymbolDeclaration) { + if (expr instanceof AST_VarDef && expr.name instanceof AST_SymbolDeclaration) { var def = expr.name.definition(); if (!member(expr.name, def.orig)) return; var referenced = def.references.length - def.replaced; @@ -1851,20 +1794,14 @@ function tighten_body(statements, compressor) { return make_node(AST_SymbolRef, expr.name, expr.name); } } else { - const lhs = expr instanceof AST_Assign - ? expr.left - : expr.expression; + const lhs = expr[expr instanceof AST_Assign ? "left" : "expression"]; return !is_ref_of(lhs, AST_SymbolConst) && !is_ref_of(lhs, AST_SymbolLet) && lhs; } } function get_rvalue(expr) { - if (expr instanceof AST_Assign) { - return expr.right; - } else { - return expr.value; - } + return expr[expr instanceof AST_Assign ? "right" : "value"]; } function get_lvalues(expr) { @@ -1923,9 +1860,7 @@ function tighten_body(statements, compressor) { && !(in_loop && (lvalues.has(lhs.name) || candidate instanceof AST_Unary - || (candidate instanceof AST_Assign - && !candidate.logical - && candidate.operator != "="))); + || candidate instanceof AST_Assign && candidate.operator != "=")); } function value_has_side_effects(expr) { @@ -2352,7 +2287,7 @@ function tighten_body(statements, compressor) { var def = defn.definitions[defn.definitions.length - 1]; if (!(def.value instanceof AST_Object)) return; var exprs; - if (body instanceof AST_Assign && !body.logical) { + if (body instanceof AST_Assign) { exprs = [ body ]; } else if (body instanceof AST_Sequence) { exprs = body.expressions.slice(); @@ -2575,8 +2510,6 @@ function is_undefined(node, compressor) { && (this.left._dot_throw(compressor) || this.right._dot_throw(compressor)); }); def_may_throw_on_access(AST_Assign, function(compressor) { - if (this.logical) return true; - return this.operator == "=" && this.right._dot_throw(compressor); }); @@ -3801,7 +3734,6 @@ AST_Scope.DEFMETHOD("drop_unused", function(compressor) { var drop_vars = !(self instanceof AST_Toplevel) || compressor.toplevel.vars; const assign_as_unused = r_keep_assign.test(compressor.option("unused")) ? return_false : function(node) { if (node instanceof AST_Assign - && !node.logical && (has_flag(node, WRITE_ONLY) || node.operator == "=") ) { return node.left; @@ -4020,7 +3952,6 @@ AST_Scope.DEFMETHOD("drop_unused", function(compressor) { sym.references.push(ref); var assign = make_node(AST_Assign, def, { operator: "=", - logical: false, left: ref, right: def.value }); @@ -4209,12 +4140,9 @@ AST_Scope.DEFMETHOD("hoist_declarations", function(compressor) { hoisted.push(node); return make_node(AST_EmptyStatement, node); } - if ( - hoist_vars - && node instanceof AST_Var - && !node.definitions.some(def => def.name instanceof AST_Destructuring) - ) { + if (hoist_vars && node instanceof AST_Var) { node.definitions.forEach(function(def) { + if (def.name instanceof AST_Destructuring) return; vars.set(def.name.name, def); ++vars_found; }); @@ -4294,7 +4222,8 @@ AST_Scope.DEFMETHOD("hoist_declarations", function(compressor) { continue; } if (self.body[i] instanceof AST_BlockStatement) { - self.body.splice(i, 1, ...self.body[i].body); + var tmp = [ i, 1 ].concat(self.body[i].body); + self.body.splice.apply(self.body, tmp); continue; } break; @@ -4339,14 +4268,9 @@ AST_Scope.DEFMETHOD("hoist_properties", function(compressor) { const defs = new Map(); const assignments = []; value.properties.forEach(({ key, value }) => { - const scope = find_scope(hoister); const symbol = self.create_symbol(sym.CTOR, { source: sym, - scope, - conflict_scopes: new Set([ - scope, - ...sym.definition().references.map(ref => ref.scope) - ]), + scope: find_scope(hoister), tentative_name: sym.name + "_" + key }); @@ -4456,8 +4380,6 @@ AST_Scope.DEFMETHOD("hoist_properties", function(compressor) { } }); def_drop_side_effect_free(AST_Assign, function(compressor) { - if (this.logical) return this; - var left = this.left; if (left.has_side_effects(compressor) || compressor.has_directive("use strict") @@ -5047,14 +4969,11 @@ AST_Definitions.DEFMETHOD("remove_initializers", function() { AST_Definitions.DEFMETHOD("to_assignments", function(compressor) { var reduce_vars = compressor.option("reduce_vars"); - var assignments = []; - - for (const def of this.definitions) { - if (def.value) { + var assignments = this.definitions.reduce(function(a, def) { + if (def.value && !(def.name instanceof AST_Destructuring)) { var name = make_node(AST_SymbolRef, def.name, def.name); - assignments.push(make_node(AST_Assign, def, { + a.push(make_node(AST_Assign, def, { operator : "=", - logical: false, left : name, right : def.value })); @@ -5068,13 +4987,13 @@ AST_Definitions.DEFMETHOD("to_assignments", function(compressor) { var var_ = make_node(AST_Var, def, { definitions: [ varDef ] }); - assignments.push(var_); + a.push(var_); } - const thedef = def.name.definition(); - thedef.eliminated++; - thedef.replaced--; - } - + def = def.name.definition(); + def.eliminated++; + def.replaced--; + return a; + }, []); if (assignments.length == 0) return null; return make_sequence(this, assignments); }); @@ -5085,17 +5004,6 @@ def_optimize(AST_Definitions, function(self) { return self; }); -def_optimize(AST_VarDef, function(self) { - if ( - self.name instanceof AST_SymbolLet - && self.value != null - && is_undefined(self.value) - ) { - self.value = null; - } - return self; -}); - def_optimize(AST_Import, function(self) { return self; }); @@ -5112,7 +5020,7 @@ function retain_top_func(fn, compressor) { def_optimize(AST_Call, function(self, compressor) { var exp = self.expression; var fn = exp; - inline_array_like_spread(self.args); + inline_array_like_spread(self, compressor, self.args); var simple_args = self.args.every((arg) => !(arg instanceof AST_Expansion) ); @@ -5680,7 +5588,6 @@ def_optimize(AST_Call, function(self, compressor) { def.references.push(sym); if (value) expressions.push(make_node(AST_Assign, self, { operator: "=", - logical: false, left: sym, right: value.clone() })); @@ -5724,7 +5631,6 @@ def_optimize(AST_Call, function(self, compressor) { def.references.push(sym); expressions.splice(pos++, 0, make_node(AST_Assign, var_def, { operator: "=", - logical: false, left: sym, right: make_node(AST_Undefined, name) })); @@ -6074,7 +5980,7 @@ def_optimize(AST_Binary, function(self, compressor) { && self.left.left.getValue() == "" && self.right.is_string(compressor)) { self.left = self.left.right; - return self; + return self.transform(compressor); } } if (compressor.option("evaluate")) { @@ -6173,6 +6079,25 @@ def_optimize(AST_Binary, function(self, compressor) { var associative = true; switch (self.operator) { case "+": + // "foo" + ("bar" + x) => "foobar" + x + if (self.left instanceof AST_Constant + && self.right instanceof AST_Binary + && self.right.operator == "+" + && self.right.is_string(compressor)) { + var binary = make_node(AST_Binary, self, { + operator: "+", + left: self.left, + right: self.right.left, + }); + var l = binary.optimize(compressor); + if (binary !== l) { + self = make_node(AST_Binary, self, { + operator: "+", + left: l, + right: self.right.right + }); + } + } // (x + "foo") + "bar" => x + "foobar" if (self.right instanceof AST_Constant && self.left instanceof AST_Binary @@ -6245,7 +6170,7 @@ def_optimize(AST_Binary, function(self, compressor) { var l = self.left; var r = self.right.evaluate(compressor); if (r != self.right) { - l.segments[l.segments.length - 1].value += String(r); + l.segments[l.segments.length - 1].value += r.toString(); return l; } } @@ -6254,7 +6179,7 @@ def_optimize(AST_Binary, function(self, compressor) { var r = self.right; var l = self.left.evaluate(compressor); if (l != self.left) { - r.segments[0].value = String(l) + r.segments[0].value; + r.segments[0].value = l.toString() + r.segments[0].value ; return r; } } @@ -6381,10 +6306,10 @@ def_optimize(AST_Binary, function(self, compressor) { ) { self.left = make_node(AST_Binary, self.left, { operator : self.operator, - left : self.left.transform(compressor), - right : self.right.left.transform(compressor) + left : self.left, + right : self.right.left }); - self.right = self.right.right.transform(compressor); + self.right = self.right.right; return self.transform(compressor); } var ev = self.evaluate(compressor); @@ -6457,9 +6382,7 @@ def_optimize(AST_SymbolRef, function(self, compressor) { && !(parent instanceof AST_Call && (parent.is_expr_pure(compressor)) || has_annotation(parent, _NOINLINE)) - && !(parent instanceof AST_Export - && fixed instanceof AST_Lambda - && fixed.name); + && !(fixed instanceof AST_Defun && parent instanceof AST_Export); if (single_use && (fixed instanceof AST_Lambda || fixed instanceof AST_Class)) { if (retain_top_func(fixed, compressor)) { @@ -6489,8 +6412,7 @@ def_optimize(AST_SymbolRef, function(self, compressor) { && !scope_encloses_variables_in_this_scope(nearest_scope, fixed) || parent instanceof AST_Call && parent.expression === self - && !scope_encloses_variables_in_this_scope(nearest_scope, fixed) - && !(fixed.name && fixed.name.definition().recursive_refs > 0); + && !scope_encloses_variables_in_this_scope(nearest_scope, fixed); } if (single_use && fixed instanceof AST_Class) { const extends_inert = !fixed.extends @@ -6682,10 +6604,6 @@ function is_reachable(self, defs) { const ASSIGN_OPS = makePredicate("+ - / * % >> << >>> | ^ &"); const ASSIGN_OPS_COMMUTATIVE = makePredicate("* | ^ &"); def_optimize(AST_Assign, function(self, compressor) { - if (self.logical) { - return self.lift_sequences(compressor); - } - var def; if (compressor.option("dead_code") && self.left instanceof AST_SymbolRef @@ -6903,20 +6821,16 @@ def_optimize(AST_Conditional, function(self, compressor) { // | // v // exp = foo ? something : something_else; - if ( - consequent instanceof AST_Assign + if (consequent instanceof AST_Assign && alternative instanceof AST_Assign - && consequent.operator === alternative.operator - && consequent.logical === alternative.logical + && consequent.operator == alternative.operator && consequent.left.equivalent_to(alternative.left) && (!self.condition.has_side_effects(compressor) || consequent.operator == "=" - && !consequent.left.has_side_effects(compressor)) - ) { + && !consequent.left.has_side_effects(compressor))) { return make_node(AST_Assign, self, { operator: consequent.operator, left: consequent.left, - logical: consequent.logical, right: make_node(AST_Conditional, self, { condition: self.condition, consequent: consequent.right, @@ -7411,15 +7325,12 @@ function literals_in_boolean_context(self, compressor) { return self; } -function inline_array_like_spread(elements) { +function inline_array_like_spread(self, compressor, elements) { for (var i = 0; i < elements.length; i++) { var el = elements[i]; if (el instanceof AST_Expansion) { var expr = el.expression; - if ( - expr instanceof AST_Array - && !expr.elements.some(elm => elm instanceof AST_Hole) - ) { + if ( expr instanceof AST_Array) { elements.splice(i, 1, ...expr.elements); // Step back one, as the element at i is now new. i--; @@ -7428,6 +7339,7 @@ function inline_array_like_spread(elements) { // We therefore can’t optimize anything else, unlike with object spread. } } + return self; } def_optimize(AST_Array, function(self, compressor) { @@ -7435,20 +7347,21 @@ def_optimize(AST_Array, function(self, compressor) { if (optimized !== self) { return optimized; } - inline_array_like_spread(self.elements); - return self; + return inline_array_like_spread(self, compressor, self.elements); }); -function inline_object_prop_spread(props) { +def_optimize(AST_Object, function(self, compressor) { + var optimized = literals_in_boolean_context(self, compressor); + if (optimized !== self) { + return optimized; + } + var props = self.properties; for (var i = 0; i < props.length; i++) { var prop = props[i]; if (prop instanceof AST_Expansion) { - const expr = prop.expression; - if ( - expr instanceof AST_Object - && expr.properties.every(prop => prop instanceof AST_ObjectKeyVal) - ) { - props.splice(i, 1, ...expr.properties); + var expr = prop.expression; + if (expr instanceof AST_Object) { + props.splice.apply(props, [i, 1].concat(prop.expression.properties)); // Step back one, as the property at i is now new. i--; } else if (expr instanceof AST_Constant @@ -7460,14 +7373,6 @@ function inline_object_prop_spread(props) { } } } -} - -def_optimize(AST_Object, function(self, compressor) { - var optimized = literals_in_boolean_context(self, compressor); - if (optimized !== self) { - return optimized; - } - inline_object_prop_spread(self.properties); return self; }); @@ -7512,12 +7417,9 @@ def_optimize(AST_Yield, function(self, compressor) { }); def_optimize(AST_TemplateString, function(self, compressor) { - if ( - !compressor.option("evaluate") - || compressor.parent() instanceof AST_PrefixedTemplateString - ) { + if (!compressor.option("evaluate") + || compressor.parent() instanceof AST_PrefixedTemplateString) return self; - } var segments = []; for (var i = 0; i < self.segments.length; i++) { @@ -7553,17 +7455,7 @@ def_optimize(AST_TemplateString, function(self, compressor) { if (segments.length == 1) { return make_node(AST_String, self, segments[0]); } - - if ( - segments.length === 3 - && segments[1] instanceof AST_Node - && ( - segments[1].is_string(compressor) - || segments[1].is_number(compressor) - || is_nullish(segments[1]) - || compressor.option("unsafe") - ) - ) { + if (segments.length === 3 && segments[1] instanceof AST_Node) { // `foo${bar}` => "foo" + bar if (segments[2].value === "") { return make_node(AST_Binary, self, { @@ -7574,7 +7466,7 @@ def_optimize(AST_TemplateString, function(self, compressor) { right: segments[1], }); } - // `${bar}baz` => bar + "baz" + // `{bar}baz` => bar + "baz" if (segments[0].value === "") { return make_node(AST_Binary, self, { operator: "+", @@ -7680,8 +7572,7 @@ def_optimize(AST_Destructuring, function(self, compressor) { && compressor.option("unused") && !self.is_array && Array.isArray(self.names) - && !is_destructuring_export_decl(compressor) - && !(self.names[self.names.length - 1] instanceof AST_Expansion)) { + && !is_destructuring_export_decl(compressor)) { var keep = []; for (var i = 0; i < self.names.length; i++) { var elem = self.names[i]; diff --git a/node_modules/terser/lib/equivalent-to.js b/node_modules/terser/lib/equivalent-to.js index f1e48a6..31c49db 100644 --- a/node_modules/terser/lib/equivalent-to.js +++ b/node_modules/terser/lib/equivalent-to.js @@ -7,7 +7,6 @@ import { AST_Block, AST_Call, AST_Catch, - AST_Chain, AST_Class, AST_ClassProperty, AST_ConciseMethod, @@ -227,8 +226,6 @@ AST_Sequence.prototype.shallow_cmp = pass_through; AST_PropAccess.prototype.shallow_cmp = pass_through; -AST_Chain.prototype.shallow_cmp = pass_through; - AST_Dot.prototype.shallow_cmp = mkshallow({ property: "eq" }); diff --git a/node_modules/terser/lib/minify.js b/node_modules/terser/lib/minify.js index 53b0b56..224b42b 100644 --- a/node_modules/terser/lib/minify.js +++ b/node_modules/terser/lib/minify.js @@ -205,7 +205,10 @@ async function minify(files, options) { } if (!HOP(options.format, "code") || options.format.code) { if (options.sourceMap) { - options.format.source_map = await SourceMap({ + if (typeof options.sourceMap.content == "string") { + options.sourceMap.content = JSON.parse(options.sourceMap.content); + } + options.format.source_map = SourceMap({ file: options.sourceMap.filename, orig: options.sourceMap.content, root: options.sourceMap.root @@ -243,9 +246,6 @@ async function minify(files, options) { options.nameCache.props = cache_to_json(options.mangle.properties.cache); } } - if (options.format && options.format.source_map) { - options.format.source_map.destroy(); - } if (timings) { timings.end = Date.now(); result.timings = { diff --git a/node_modules/terser/lib/mozilla-ast.js b/node_modules/terser/lib/mozilla-ast.js index d0249f2..6a314d9 100644 --- a/node_modules/terser/lib/mozilla-ast.js +++ b/node_modules/terser/lib/mozilla-ast.js @@ -544,7 +544,6 @@ import { return new AST_String(args); case "number": args.value = val; - args.raw = M.raw || val.toString(); return new AST_Number(args); case "boolean": return new (val ? AST_True : AST_False)(args); @@ -1069,10 +1068,22 @@ import { def_to_moz(AST_Constant, function To_Moz_Literal(M) { var value = M.value; + if (typeof value === "number" && (value < 0 || (value === 0 && 1 / value < 0))) { + return { + type: "UnaryExpression", + operator: "-", + prefix: true, + argument: { + type: "Literal", + value: -value, + raw: M.start.raw + } + }; + } return { type: "Literal", value: value, - raw: M.raw || M.print_to_string() + raw: M.start.raw }; }); @@ -1097,36 +1108,40 @@ import { /* -----[ tools ]----- */ + function raw_token(moznode) { + if (moznode.type == "Literal") { + return moznode.raw != null ? moznode.raw : moznode.value + ""; + } + } + function my_start_token(moznode) { var loc = moznode.loc, start = loc && loc.start; var range = moznode.range; - return new AST_Token( - "", - "", - start && start.line || 0, - start && start.column || 0, - range ? range [0] : moznode.start, - false, - [], - [], - loc && loc.source, - ); + return new AST_Token({ + file : loc && loc.source, + line : start && start.line, + col : start && start.column, + pos : range ? range[0] : moznode.start, + endline : start && start.line, + endcol : start && start.column, + endpos : range ? range[0] : moznode.start, + raw : raw_token(moznode), + }); } function my_end_token(moznode) { var loc = moznode.loc, end = loc && loc.end; var range = moznode.range; - return new AST_Token( - "", - "", - end && end.line || 0, - end && end.column || 0, - range ? range [0] : moznode.end, - false, - [], - [], - loc && loc.source, - ); + return new AST_Token({ + file : loc && loc.source, + line : end && end.line, + col : end && end.column, + pos : range ? range[1] : moznode.end, + endline : end && end.line, + endcol : end && end.column, + endpos : range ? range[1] : moznode.end, + raw : raw_token(moznode), + }); } function map(moztype, mytype, propmap) { diff --git a/node_modules/terser/lib/output.js b/node_modules/terser/lib/output.js index 08032de..10fe461 100644 --- a/node_modules/terser/lib/output.js +++ b/node_modules/terser/lib/output.js @@ -239,7 +239,7 @@ function OutputStream(options) { let printed_comments = new Set(); var to_utf8 = options.ascii_only ? function(str, identifier) { - if (options.ecma >= 2015 && !options.safari10) { + if (options.ecma >= 2015) { str = str.replace(/[\ud800-\udbff][\udc00-\udfff]/g, function(ch) { var code = get_full_char_code(ch, 0).toString(16); return "\\u{" + code + "}"; @@ -893,14 +893,6 @@ function OutputStream(options) { PARENS(AST_Arrow, function(output) { var p = output.parent(); - - if ( - output.option("wrap_func_args") - && p instanceof AST_Call - && p.args.includes(this) - ) { - return true; - } return p instanceof AST_PropAccess && p.expression === this; }); @@ -971,10 +963,6 @@ function OutputStream(options) { return true; } - if (po === "??" && (so === "||" || so === "&&")) { - return true; - } - const pp = PRECEDENCE[po]; const sp = PRECEDENCE[so]; if (pp > sp @@ -1335,9 +1323,6 @@ function OutputStream(options) { } output.print("`"); }); - DEFPRINT(AST_TemplateSegment, function(self, output) { - output.print_template_string_chars(self.value); - }); AST_Arrow.DEFMETHOD("_do_print", function(output) { var self = this; @@ -1779,10 +1764,7 @@ function OutputStream(options) { var prop = self.property; var print_computed = RESERVED_WORDS.has(prop) ? output.option("ie8") - : !is_identifier_string( - prop, - output.option("ecma") >= 2015 || output.option("safari10") - ); + : !is_identifier_string(prop, output.option("ecma") >= 2015); if (self.optional) output.print("?."); @@ -1952,7 +1934,7 @@ function OutputStream(options) { var print_string = RESERVED_WORDS.has(key) ? output.option("ie8") : ( - output.option("ecma") < 2015 || output.option("safari10") + output.option("ecma") < 2015 ? !is_basic_identifier_string(key) : !is_identifier_string(key, true) ); @@ -1971,10 +1953,7 @@ function OutputStream(options) { var allowShortHand = output.option("shorthand"); if (allowShortHand && self.value instanceof AST_Symbol && - is_identifier_string( - self.key, - output.option("ecma") >= 2015 || output.option("safari10") - ) && + is_identifier_string(self.key, output.option("ecma") >= 2015) && get_name(self.value) === self.key && !RESERVED_WORDS.has(self.key) ) { @@ -1983,10 +1962,7 @@ function OutputStream(options) { } else if (allowShortHand && self.value instanceof AST_DefaultAssign && self.value.left instanceof AST_Symbol && - is_identifier_string( - self.key, - output.option("ecma") >= 2015 || output.option("safari10") - ) && + is_identifier_string(self.key, output.option("ecma") >= 2015) && get_name(self.value.left) === self.key ) { print_property_name(self.key, self.quote, output); @@ -2084,8 +2060,8 @@ function OutputStream(options) { output.print_string(self.getValue(), self.quote, output.in_directive); }); DEFPRINT(AST_Number, function(self, output) { - if ((output.option("keep_numbers") || output.use_asm) && self.raw) { - output.print(self.raw); + if ((output.option("keep_numbers") || output.use_asm) && self.start && self.start.raw != null) { + output.print(self.start.raw); } else { output.print(make_num(self.getValue())); } diff --git a/node_modules/terser/lib/parse.js b/node_modules/terser/lib/parse.js index 0ec29f8..f2a48a4 100644 --- a/node_modules/terser/lib/parse.js +++ b/node_modules/terser/lib/parse.js @@ -157,9 +157,6 @@ import { _PURE } from "./ast.js"; -var LATEST_RAW = ""; // Only used for numbers and template strings -var LATEST_TEMPLATE_END = true; - var KEYWORDS = "break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with"; var KEYWORDS_ATOM = "false null true"; var RESERVED_WORDS = "enum implements import interface package private protected public static super this " + KEYWORDS_ATOM + " " + KEYWORDS; @@ -215,9 +212,6 @@ var OPERATORS = makePredicate([ "=", "+=", "-=", - "||=", - "&&=", - "??=", "/=", "*=", "**=", @@ -315,14 +309,12 @@ function is_identifier_char(ch) { return UNICODE.ID_Continue.test(ch); } -const BASIC_IDENT = /^[a-z_$][a-z0-9_$]*$/i; - function is_basic_identifier_string(str) { - return BASIC_IDENT.test(str); + return /^[a-z_$][a-z0-9_$]*$/i.test(str); } function is_identifier_string(str, allow_surrogates) { - if (BASIC_IDENT.test(str)) { + if (/^[a-z_$][a-z0-9_$]*$/i.test(str)) { return true; } if (!allow_surrogates && /[\ud800-\udfff]/.test(str)) { @@ -480,23 +472,29 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { } else if (!is_comment) { prev_was_dot = false; } - const line = S.tokline; - const col = S.tokcol; - const pos = S.tokpos; - const nlb = S.newline_before; - const file = filename; - let comments_before = []; - let comments_after = []; - + var ret = { + type : type, + value : value, + line : S.tokline, + col : S.tokcol, + pos : S.tokpos, + endline : S.line, + endcol : S.col, + endpos : S.pos, + nlb : S.newline_before, + file : filename + }; + if (/^(?:num|string|regexp)$/i.test(type)) { + ret.raw = $TEXT.substring(ret.pos, ret.endpos); + } if (!is_comment) { - comments_before = S.comments_before; - comments_after = S.comments_before = []; + ret.comments_before = S.comments_before; + ret.comments_after = S.comments_before = []; } S.newline_before = false; - const tok = new AST_Token(type, value, line, col, pos, nlb, comments_before, comments_after, file); - - if (!is_comment) previous_token = tok; - return tok; + ret = new AST_Token(ret); + if (!is_comment) previous_token = ret; + return ret; } function skip_whitespace() { @@ -548,9 +546,6 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { return RE_NUM_LITERAL.test(ch); }); if (prefix) num = prefix + num; - - LATEST_RAW = num; - if (RE_OCT_NUMBER.test(num) && next_token.has_directive("use strict")) { parse_error("Legacy octal literals are not allowed in strict mode"); } @@ -658,17 +653,15 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { } var read_string = with_eof_error("Unterminated string constant", function() { - const start_pos = S.pos; - var quote = next(), ret = []; + var quote = next(), ret = ""; for (;;) { var ch = next(true, true); if (ch == "\\") ch = read_escaped_char(true, true); else if (ch == "\r" || ch == "\n") parse_error("Unterminated string constant"); else if (ch == quote) break; - ret.push(ch); + ret += ch; } - var tok = token("string", ret.join("")); - LATEST_RAW = S.text.slice(start_pos, S.pos); + var tok = token("string", ret); tok.quote = quote; return tok; }); @@ -687,8 +680,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { next(true, true); S.brace_counter++; tok = token(begin ? "template_head" : "template_substitution", content); - LATEST_RAW = raw; - LATEST_TEMPLATE_END = false; + tok.raw = raw; return tok; } @@ -704,8 +696,8 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { } S.template_braces.pop(); tok = token(begin ? "template_head" : "template_substitution", content); - LATEST_RAW = raw; - LATEST_TEMPLATE_END = true; + tok.raw = raw; + tok.end = true; return tok; }); @@ -738,7 +730,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { }); var read_name = with_eof_error("Unterminated identifier name", function() { - var name = [], ch, escaped = false; + var name, ch, escaped = false; var read_escaped_identifier_char = function() { escaped = true; next(); @@ -749,19 +741,17 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { }; // Read first character (ID_Start) - if ((ch = peek()) === "\\") { - ch = read_escaped_identifier_char(); - if (!is_identifier_start(ch)) { + if ((name = peek()) === "\\") { + name = read_escaped_identifier_char(); + if (!is_identifier_start(name)) { parse_error("First identifier char is an invalid identifier char"); } - } else if (is_identifier_start(ch)) { + } else if (is_identifier_start(name)) { next(); } else { return ""; } - name.push(ch); - // Read ID_Continue while ((ch = peek()) != null) { if ((ch = peek()) === "\\") { @@ -775,13 +765,12 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { } next(); } - name.push(ch); + name += ch; } - const name_str = name.join(""); - if (RESERVED_WORDS.has(name_str) && escaped) { + if (RESERVED_WORDS.has(name) && escaped) { parse_error("Escaped characters are not allowed in keywords"); } - return name_str; + return name; }); var read_regexp = with_eof_error("Unterminated regular expression", function(source) { @@ -805,7 +794,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) { source += ch; } const flags = read_name(); - return token("regexp", "/" + source + "/" + flags); + return token("regexp", { source, flags }); }); function read_operator(prefix) { @@ -998,9 +987,7 @@ var UNARY_PREFIX = makePredicate([ var UNARY_POSTFIX = makePredicate([ "--", "++" ]); -var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "??=", "&&=", "||=", "/=", "*=", "**=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]); - -var LOGICAL_ASSIGNMENT = makePredicate([ "??=", "&&=", "||=" ]); +var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "/=", "*=", "**=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]); var PRECEDENCE = (function(a, ret) { for (var i = 0; i < a.length; ++i) { @@ -1038,7 +1025,7 @@ function parse($TEXT, options) { // Useful because comments_before property of call with parens outside // contains both comments inside and outside these parens. Used to find the // right #__PURE__ comments for an expression - const outer_comments_before_counts = new WeakMap(); + const outer_comments_before_counts = new Map(); options = defaults(options, { bare_returns : false, @@ -1172,7 +1159,7 @@ function parse($TEXT, options) { case "string": if (S.in_directives) { var token = peek(); - if (!LATEST_RAW.includes("\\") + if (!S.token.raw.includes("\\") && (is_token(token, "punc", ";") || is_token(token, "punc", "}") || has_newline_before(token) @@ -2155,12 +2142,7 @@ function parse($TEXT, options) { ret = _make_symbol(AST_SymbolRef); break; case "num": - ret = new AST_Number({ - start: tok, - end: tok, - value: tok.value, - raw: LATEST_RAW - }); + ret = new AST_Number({ start: tok, end: tok, value: tok.value }); break; case "big_int": ret = new AST_BigInt({ start: tok, end: tok, value: tok.value }); @@ -2174,9 +2156,7 @@ function parse($TEXT, options) { }); break; case "regexp": - const [_, source, flags] = tok.value.match(/^\/(.*)\/(\w*)$/); - - ret = new AST_RegExp({ start: tok, end: tok, value: { source, flags } }); + ret = new AST_RegExp({ start: tok, end: tok, value: tok.value }); break; case "atom": switch (tok.value) { @@ -2333,7 +2313,7 @@ function parse($TEXT, options) { return subscripts(cls, allow_calls); } if (is("template_head")) { - return subscripts(template_string(), allow_calls); + return subscripts(template_string(false), allow_calls); } if (ATOMIC_START_TOKEN.has(S.token.type)) { return subscripts(as_atom_node(), allow_calls); @@ -2346,19 +2326,22 @@ function parse($TEXT, options) { segments.push(new AST_TemplateSegment({ start: S.token, - raw: LATEST_RAW, + raw: S.token.raw, value: S.token.value, end: S.token })); - - while (!LATEST_TEMPLATE_END) { + while (!S.token.end) { next(); handle_regexp(); segments.push(expression(true)); + if (!is_token("template_substitution")) { + unexpected(); + } + segments.push(new AST_TemplateSegment({ start: S.token, - raw: LATEST_RAW, + raw: S.token.raw, value: S.token.value, end: S.token })); @@ -2452,7 +2435,6 @@ function parse($TEXT, options) { left: value, operator: "=", right: expression(false), - logical: false, end: prev() }); } @@ -3035,7 +3017,7 @@ function parse($TEXT, options) { return subscripts(new AST_PrefixedTemplateString({ start: start, prefix: expr, - template_string: template_string(), + template_string: template_string(true), end: prev() }), allow_calls); } @@ -3221,13 +3203,11 @@ function parse($TEXT, options) { if (is("operator") && ASSIGNMENT.has(val)) { if (is_assignable(left) || (left = to_destructuring(left)) instanceof AST_Destructuring) { next(); - return new AST_Assign({ start : start, left : left, operator : val, right : maybe_assign(no_in), - logical : LOGICAL_ASSIGNMENT.has(val), end : prev() }); } diff --git a/node_modules/terser/lib/scope.js b/node_modules/terser/lib/scope.js index eb7284c..214dd13 100644 --- a/node_modules/terser/lib/scope.js +++ b/node_modules/terser/lib/scope.js @@ -493,13 +493,6 @@ AST_Scope.DEFMETHOD("conflicting_def", function (name) { ); }); -AST_Scope.DEFMETHOD("conflicting_def_shallow", function (name) { - return ( - this.enclosed.find(def => def.name === name) - || this.variables.has(name) - ); -}); - AST_Scope.DEFMETHOD("add_child_scope", function (scope) { // `scope` is going to be moved into `this` right now. // Update the required scopes' information @@ -533,34 +526,15 @@ AST_Scope.DEFMETHOD("add_child_scope", function (scope) { } }); -function find_scopes_visible_from(scopes) { - const found_scopes = new Set(); - - for (const scope of new Set(scopes)) { - (function bubble_up(scope) { - if (scope == null || found_scopes.has(scope)) return; - - found_scopes.add(scope); - - bubble_up(scope.parent_scope); - })(scope); - } - - return [...found_scopes]; -} - // Creates a symbol during compression AST_Scope.DEFMETHOD("create_symbol", function(SymClass, { source, tentative_name, scope, - conflict_scopes = [scope], init = null } = {}) { let symbol_name; - conflict_scopes = find_scopes_visible_from(conflict_scopes); - if (tentative_name) { // Implement hygiene (no new names are conflicting with existing names) tentative_name = @@ -568,7 +542,7 @@ AST_Scope.DEFMETHOD("create_symbol", function(SymClass, { tentative_name.replace(/(?:^[^a-z_$]|[^a-z0-9_$])/ig, "_"); let i = 0; - while (conflict_scopes.find(s => s.conflicting_def_shallow(symbol_name))) { + while (this.conflicting_def(symbol_name)) { symbol_name = tentative_name + "$" + i++; } } diff --git a/node_modules/terser/lib/sourcemap.js b/node_modules/terser/lib/sourcemap.js index 178a208..86a7e02 100644 --- a/node_modules/terser/lib/sourcemap.js +++ b/node_modules/terser/lib/sourcemap.js @@ -49,7 +49,7 @@ import { } from "./utils/index.js"; // a small wrapper around fitzgen's source-map library -async function SourceMap(options) { +function SourceMap(options) { options = defaults(options, { file : null, root : null, @@ -58,15 +58,13 @@ async function SourceMap(options) { orig_line_diff : 0, dest_line_diff : 0, }); - - var orig_map; var generator = new MOZ_SourceMap.SourceMapGenerator({ file : options.file, sourceRoot : options.root }); + var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig); - if (options.orig) { - orig_map = await new MOZ_SourceMap.SourceMapConsumer(options.orig); + if (orig_map) { orig_map.sources.forEach(function(source) { var sourceContent = orig_map.sourceContentFor(source, true); if (sourceContent) { @@ -96,16 +94,10 @@ async function SourceMap(options) { name : name }); } - return { add : add, get : function() { return generator; }, - toString : function() { return generator.toString(); }, - destroy : function () { - if (orig_map && orig_map.destroy) { - orig_map.destroy(); - } - } + toString : function() { return JSON.stringify(generator.toJSON()); } }; } diff --git a/node_modules/terser/lib/transform.js b/node_modules/terser/lib/transform.js index 9aa9ffc..c6a5bc9 100644 --- a/node_modules/terser/lib/transform.js +++ b/node_modules/terser/lib/transform.js @@ -51,7 +51,6 @@ import { AST_Call, AST_Case, AST_Catch, - AST_Chain, AST_Class, AST_Conditional, AST_Definitions, @@ -237,10 +236,6 @@ def_transform(AST_Sub, function(self, tw) { self.property = self.property.transform(tw); }); -def_transform(AST_Chain, function(self, tw) { - self.expression = self.expression.transform(tw); -}); - def_transform(AST_Yield, function(self, tw) { if (self.expression) self.expression = self.expression.transform(tw); }); diff --git a/node_modules/terser/node_modules/source-map/CHANGELOG.md b/node_modules/terser/node_modules/source-map/CHANGELOG.md index ef31a09..3a8c066 100644 --- a/node_modules/terser/node_modules/source-map/CHANGELOG.md +++ b/node_modules/terser/node_modules/source-map/CHANGELOG.md @@ -1,48 +1,5 @@ # Change Log -## 0.7.3 - -* Fix a bug where nested uses of `SourceMapConsumer` could result in a - `TypeError`. [#338](https://github.com/mozilla/source-map/issues/338) - [#330](https://github.com/mozilla/source-map/issues/330) - [#319](https://github.com/mozilla/source-map/issues/319) - -## 0.7.2 - -* Another 3x speed up in `SourceMapConsumer`. Read about it here: - http://fitzgeraldnick.com/2018/02/26/speed-without-wizardry.html - -## 0.7.1 - -* Updated TypeScript typings. [#321][] - -[#321]: https://github.com/mozilla/source-map/pull/321 - -## 0.7.0 - -* `SourceMapConsumer` now uses WebAssembly, and is **much** faster! Read about - it here: - https://hacks.mozilla.org/2018/01/oxidizing-source-maps-with-rust-and-webassembly/ - -* **Breaking change:** `new SourceMapConsumer` now returns a `Promise` object - that resolves to the newly constructed `SourceMapConsumer` instance, rather - than returning the new instance immediately. - -* **Breaking change:** when you're done using a `SourceMapConsumer` instance, - you must call `SourceMapConsumer.prototype.destroy` on it. After calling - `destroy`, you must not use the instance again. - -* **Breaking change:** `SourceMapConsumer` used to be able to handle lines, - columns numbers and source and name indices up to `2^53 - 1` (aka - `Number.MAX_SAFE_INTEGER`). It can now only handle them up to `2^32 - 1`. - -* **Breaking change:** The `source-map` library now uses modern ECMAScript-isms: - `let`, arrow functions, `async`, etc. Use Babel to compile it down to - ECMAScript 5 if you need to support older JavaScript environments. - -* **Breaking change:** Drop support for Node < 8. If you want to support older -versions of node, please use v0.6 or below. - ## 0.5.6 * Fix for regression when people were using numbers as names in source maps. See diff --git a/node_modules/terser/node_modules/source-map/README.md b/node_modules/terser/node_modules/source-map/README.md index db20846..fea4beb 100644 --- a/node_modules/terser/node_modules/source-map/README.md +++ b/node_modules/terser/node_modules/source-map/README.md @@ -2,8 +2,6 @@ [![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map) -[![Coverage Status](https://coveralls.io/repos/github/mozilla/source-map/badge.svg)](https://coveralls.io/github/mozilla/source-map) - [![NPM](https://nodei.co/npm/source-map.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map) This is a library to generate and consume the source map format @@ -17,12 +15,7 @@ This is a library to generate and consume the source map format ## Use on the Web - - + -------------------------------------------------------------------------------- @@ -39,10 +32,7 @@ This is a library to generate and consume the source map format - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) - [API](#api) - [SourceMapConsumer](#sourcemapconsumer) - - [SourceMapConsumer.initialize(options)](#sourcemapconsumerinitializeoptions) - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) - - [SourceMapConsumer.with](#sourcemapconsumerwith) - - [SourceMapConsumer.prototype.destroy()](#sourcemapconsumerprototypedestroy) - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) @@ -77,7 +67,7 @@ This is a library to generate and consume the source map format ### Consuming a source map ```js -const rawSourceMap = { +var rawSourceMap = { version: 3, file: 'min.js', names: ['bar', 'baz', 'n'], @@ -86,33 +76,30 @@ const rawSourceMap = { mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' }; -const whatever = await SourceMapConsumer.with(rawSourceMap, null, consumer => { +var smc = new SourceMapConsumer(rawSourceMap); - console.log(consumer.sources); - // [ 'http://example.com/www/js/one.js', - // 'http://example.com/www/js/two.js' ] +console.log(smc.sources); +// [ 'http://example.com/www/js/one.js', +// 'http://example.com/www/js/two.js' ] - console.log(consumer.originalPositionFor({ - line: 2, - column: 28 - })); - // { source: 'http://example.com/www/js/two.js', - // line: 2, - // column: 10, - // name: 'n' } +console.log(smc.originalPositionFor({ + line: 2, + column: 28 +})); +// { source: 'http://example.com/www/js/two.js', +// line: 2, +// column: 10, +// name: 'n' } - console.log(consumer.generatedPositionFor({ - source: 'http://example.com/www/js/two.js', - line: 2, - column: 10 - })); - // { line: 2, column: 28 } +console.log(smc.generatedPositionFor({ + source: 'http://example.com/www/js/two.js', + line: 2, + column: 10 +})); +// { line: 2, column: 28 } - consumer.eachMapping(function (m) { - // ... - }); - - return computeWhatever(); +smc.eachMapping(function (m) { + // ... }); ``` @@ -195,27 +182,10 @@ const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); ### SourceMapConsumer -A `SourceMapConsumer` instance represents a parsed source map which we can query +A SourceMapConsumer instance represents a parsed source map which we can query for information about the original file positions by giving it a file position in the generated source. -#### SourceMapConsumer.initialize(options) - -When using `SourceMapConsumer` outside of node.js, for example on the Web, it -needs to know from what URL to load `lib/mappings.wasm`. You must inform it by -calling `initialize` before constructing any `SourceMapConsumer`s. - -The options object has the following properties: - -* `"lib/mappings.wasm"`: A `String` containing the URL of the - `lib/mappings.wasm` file. - -```js -sourceMap.SourceMapConsumer.initialize({ - "lib/mappings.wasm": "https://example.com/source-map/lib/mappings.wasm" -}); -``` - #### new SourceMapConsumer(rawSourceMap) The only parameter is the raw source map (either as a string which can be @@ -237,62 +207,10 @@ following attributes: * `file`: Optional. The generated filename this source map is associated with. -The promise of the constructed souce map consumer is returned. - -When the `SourceMapConsumer` will no longer be used anymore, you must call its -`destroy` method. - ```js -const consumer = await new sourceMap.SourceMapConsumer(rawSourceMapJsonData); -doStuffWith(consumer); -consumer.destroy(); +var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); ``` -Alternatively, you can use `SourceMapConsumer.with` to avoid needing to remember -to call `destroy`. - -#### SourceMapConsumer.with - -Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl` -(see the `SourceMapConsumer` constructor for details. Then, invoke the `async -function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait -for `f` to complete, call `destroy` on the consumer, and return `f`'s return -value. - -You must not use the consumer after `f` completes! - -By using `with`, you do not have to remember to manually call `destroy` on -the consumer, since it will be called automatically once `f` completes. - -```js -const xSquared = await SourceMapConsumer.with( - myRawSourceMap, - null, - async function (consumer) { - // Use `consumer` inside here and don't worry about remembering - // to call `destroy`. - - const x = await whatever(consumer); - return x * x; - } -); - -// You may not use that `consumer` anymore out here; it has -// been destroyed. But you can use `xSquared`. -console.log(xSquared); -``` - -#### SourceMapConsumer.prototype.destroy() - -Free this source map consumer's associated wasm data that is manually-managed. - -```js -consumer.destroy(); -``` - -Alternatively, you can use `SourceMapConsumer.with` to avoid needing to remember -to call `destroy`. - #### SourceMapConsumer.prototype.computeColumnSpans() Compute the last column for each generated mapping. The last column is @@ -321,6 +239,7 @@ consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) // { line: 2, // column: 20, // lastColumn: Infinity } ] + ``` #### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) @@ -660,8 +579,9 @@ Creates a SourceNode from generated code and a SourceMapConsumer. should be relative to. ```js -const consumer = await new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); -const node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), consumer); +var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); +var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), + consumer); ``` #### SourceNode.prototype.add(chunk) diff --git a/node_modules/terser/node_modules/source-map/dist/source-map.js b/node_modules/terser/node_modules/source-map/dist/source-map.js index a947957..b4eb087 100644 --- a/node_modules/terser/node_modules/source-map/dist/source-map.js +++ b/node_modules/terser/node_modules/source-map/dist/source-map.js @@ -1,3351 +1,3233 @@ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("fs"), require("path")); + module.exports = factory(); else if(typeof define === 'function' && define.amd) - define(["fs", "path"], factory); + define([], factory); else if(typeof exports === 'object') - exports["sourceMap"] = factory(require("fs"), require("path")); + exports["sourceMap"] = factory(); else - root["sourceMap"] = factory(root["fs"], root["path"]); -})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_10__, __WEBPACK_EXTERNAL_MODULE_11__) { + root["sourceMap"] = factory(); +})(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; -/******/ + /******/ // The require function /******/ function __webpack_require__(moduleId) { -/******/ + /******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { +/******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; -/******/ } + /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false /******/ }; -/******/ + /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ + /******/ // Flag the module as loaded -/******/ module.l = true; -/******/ +/******/ module.loaded = true; + /******/ // Return the exports of the module /******/ return module.exports; /******/ } -/******/ -/******/ + + /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; -/******/ + /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ + /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; -/******/ + /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 5); +/******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ -/***/ (function(module, exports) { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -/** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ -function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } - throw new Error('"' + aName + '" is a required argument.'); - -} -exports.getArg = getArg; - -const urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; -const dataUrlRegexp = /^data:.+\,.+$/; - -function urlParse(aUrl) { - const match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; -} -exports.urlParse = urlParse; - -function urlGenerate(aParsedUrl) { - let url = ""; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ":"; - } - url += "//"; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + "@"; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port; - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; -} -exports.urlGenerate = urlGenerate; - -const MAX_CACHED_INPUTS = 32; - -/** - * Takes some function `f(input) -> result` and returns a memoized version of - * `f`. - * - * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The - * memoization is a dumb-simple, linear least-recently-used cache. - */ -function lruMemoize(f) { - const cache = []; - - return function(input) { - for (let i = 0; i < cache.length; i++) { - if (cache[i].input === input) { - const temp = cache[0]; - cache[0] = cache[i]; - cache[i] = temp; - return cache[0].result; - } - } - - const result = f(input); - - cache.unshift({ - input, - result, - }); - - if (cache.length > MAX_CACHED_INPUTS) { - cache.pop(); - } - - return result; - }; -} - -/** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consecutive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ -const normalize = lruMemoize(function normalize(aPath) { - let path = aPath; - const url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - const isAbsolute = exports.isAbsolute(path); - - // Split the path into parts between `/` characters. This is much faster than - // using `.split(/\/+/g)`. - const parts = []; - let start = 0; - let i = 0; - while (true) { - start = i; - i = path.indexOf("/", start); - if (i === -1) { - parts.push(path.slice(start)); - break; - } else { - parts.push(path.slice(start, i)); - while (i < path.length && path[i] === "/") { - i++; - } - } - } - - let up = 0; - for (i = parts.length - 1; i >= 0; i--) { - const part = parts[i]; - if (part === ".") { - parts.splice(i, 1); - } else if (part === "..") { - up++; - } else if (up > 0) { - if (part === "") { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join("/"); - - if (path === "") { - path = isAbsolute ? "/" : "."; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; -}); -exports.normalize = normalize; - -/** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ -function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - const aPathUrl = urlParse(aPath); - const aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || "/"; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - const joined = aPath.charAt(0) === "/" - ? aPath - : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; -} -exports.join = join; - -exports.isAbsolute = function(aPath) { - return aPath.charAt(0) === "/" || urlRegexp.test(aPath); -}; - -/** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ -function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ""); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - let level = 0; - while (aPath.indexOf(aRoot + "/") !== 0) { - const index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); -} -exports.relative = relative; - -const supportsNullProto = (function() { - const obj = Object.create(null); - return !("__proto__" in obj); -}()); - -function identity(s) { - return s; -} - -/** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ -function toSetString(aStr) { - if (isProtoString(aStr)) { - return "$" + aStr; - } - - return aStr; -} -exports.toSetString = supportsNullProto ? identity : toSetString; - -function fromSetString(aStr) { - if (isProtoString(aStr)) { - return aStr.slice(1); - } - - return aStr; -} -exports.fromSetString = supportsNullProto ? identity : fromSetString; - -function isProtoString(s) { - if (!s) { - return false; - } - - const length = s.length; - - if (length < 9 /* "__proto__".length */) { - return false; - } - - /* eslint-disable no-multi-spaces */ - if (s.charCodeAt(length - 1) !== 95 /* '_' */ || - s.charCodeAt(length - 2) !== 95 /* '_' */ || - s.charCodeAt(length - 3) !== 111 /* 'o' */ || - s.charCodeAt(length - 4) !== 116 /* 't' */ || - s.charCodeAt(length - 5) !== 111 /* 'o' */ || - s.charCodeAt(length - 6) !== 114 /* 'r' */ || - s.charCodeAt(length - 7) !== 112 /* 'p' */ || - s.charCodeAt(length - 8) !== 95 /* '_' */ || - s.charCodeAt(length - 9) !== 95 /* '_' */) { - return false; - } - /* eslint-enable no-multi-spaces */ - - for (let i = length - 10; i >= 0; i--) { - if (s.charCodeAt(i) !== 36 /* '$' */) { - return false; - } - } - - return true; -} - -/** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ -function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - let cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByOriginalPositions = compareByOriginalPositions; - -/** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ -function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - let cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - -function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 === null) { - return 1; // aStr2 !== null - } - - if (aStr2 === null) { - return -1; // aStr1 !== null - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; -} - -/** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ -function compareByGeneratedPositionsInflated(mappingA, mappingB) { - let cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); -} -exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; - -/** - * Strip any JSON XSSI avoidance prefix from the string (as documented - * in the source maps specification), and then parse the string as - * JSON. - */ -function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, "")); -} -exports.parseSourceMapInput = parseSourceMapInput; - -/** - * Compute the URL of a source given the the source root, the source's - * URL, and the source map's URL. - */ -function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ""; - - if (sourceRoot) { - // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") { - sourceRoot += "/"; - } - // The spec says: - // Line 4: An optional source root, useful for relocating source - // files on a server or removing repeated values in the - // “sources” entry. This value is prepended to the individual - // entries in the “source” field. - sourceURL = sourceRoot + sourceURL; - } - - // Historically, SourceMapConsumer did not take the sourceMapURL as - // a parameter. This mode is still somewhat supported, which is why - // this code block is conditional. However, it's preferable to pass - // the source map URL to SourceMapConsumer, so that this function - // can implement the source URL resolution algorithm as outlined in - // the spec. This block is basically the equivalent of: - // new URL(sourceURL, sourceMapURL).toString() - // ... except it avoids using URL, which wasn't available in the - // older releases of node still supported by this library. - // - // The spec says: - // If the sources are not absolute URLs after prepending of the - // “sourceRoot”, the sources are resolved relative to the - // SourceMap (like resolving script src in a html document). - if (sourceMapURL) { - const parsed = urlParse(sourceMapURL); - if (!parsed) { - throw new Error("sourceMapURL could not be parsed"); - } - if (parsed.path) { - // Strip the last path component, but keep the "/". - const index = parsed.path.lastIndexOf("/"); - if (index >= 0) { - parsed.path = parsed.path.substring(0, index + 1); - } - } - sourceURL = join(urlGenerate(parsed), sourceURL); - } - - return normalize(sourceURL); -} -exports.computeSourceURL = computeSourceURL; +/***/ (function(module, exports, __webpack_require__) { + + /* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ + exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; + exports.SourceNode = __webpack_require__(10).SourceNode; /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ -const base64VLQ = __webpack_require__(2); -const util = __webpack_require__(0); -const ArraySet = __webpack_require__(3).ArraySet; -const MappingList = __webpack_require__(7).MappingList; + var base64VLQ = __webpack_require__(2); + var util = __webpack_require__(4); + var ArraySet = __webpack_require__(5).ArraySet; + var MappingList = __webpack_require__(6).MappingList; -/** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ -class SourceMapGenerator { - constructor(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, "file", null); - this._sourceRoot = util.getArg(aArgs, "sourceRoot", null); - this._skipValidation = util.getArg(aArgs, "skipValidation", false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; - } + /** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - static fromSourceMap(aSourceMapConsumer) { - const sourceRoot = aSourceMapConsumer.sourceRoot; - const generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot - }); - aSourceMapConsumer.eachMapping(function(mapping) { - const newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; + SourceMapGenerator.prototype._version = 3; - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function(sourceFile) { - let sourceRelative = sourceFile; - if (sourceRoot !== null) { - sourceRelative = util.relative(sourceRoot, sourceFile); - } + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } - if (!generator._sources.has(sourceRelative)) { - generator._sources.add(sourceRelative); - } + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } - const content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - } + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - addMapping(aArgs) { - const generated = util.getArg(aArgs, "generated"); - const original = util.getArg(aArgs, "original", null); - let source = util.getArg(aArgs, "source", null); - let name = util.getArg(aArgs, "name", null); + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } + /** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); - if (source != null) { - source = String(source); - if (!this._sources.has(source)) { - this._sources.add(source); - } - } + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } - if (name != null) { - name = String(name); - if (!this._names.has(name)) { - this._names.add(name); - } - } + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source, - name - }); - } + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } - /** - * Set the source content for a source file. - */ - setSourceContent(aSourceFile, aSourceContent) { - let source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = Object.create(null); - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - } + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - let sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - "SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, " + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - const sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - const newSources = this._mappings.toArray().length > 0 - ? new ArraySet() - : this._sources; - const newNames = new ArraySet(); + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function(mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - const original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source); - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); - const source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } - const name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } - }, this); - this._sources = newSources; - this._names = newNames; + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function(srcFile) { - const content = aSourceMapConsumer.sourceContentFor(srcFile); - if (content != null) { - if (aSourceMapPath != null) { - srcFile = util.join(aSourceMapPath, srcFile); - } - if (sourceRoot != null) { - srcFile = util.relative(sourceRoot, srcFile); - } - this.setSourceContent(srcFile, content); - } - }, this); - } + }, this); + this._sources = newSources; + this._names = newNames; - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - _validateMapping(aGenerated, aOriginal, aSource, aName) { - // When aOriginal is truthy but has empty values for .line and .column, - // it is most likely a programmer error. In this case we throw a very - // specific error message to try to guide them the right way. - // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") { - throw new Error( - "original.line and original.column are not numbers -- you probably meant to omit " + - "the original mapping entirely and only map the generated position. If so, pass " + - "null for the original mapping instead of an object with empty or null values." - ); - } + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; - if (aGenerated && "line" in aGenerated && "column" in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. + /** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } - } else if (aGenerated && "line" in aGenerated && "column" in aGenerated - && aOriginal && "line" in aOriginal && "column" in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; - } else { - throw new Error("Invalid mapping: " + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - } + /** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - _serializeMappings() { - let previousGeneratedColumn = 0; - let previousGeneratedLine = 1; - let previousOriginalColumn = 0; - let previousOriginalLine = 0; - let previousName = 0; - let previousSource = 0; - let result = ""; - let next; - let mapping; - let nameIdx; - let sourceIdx; + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' - const mappings = this._mappings.toArray(); - for (let i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - next = ""; + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - next += ";"; - previousGeneratedLine++; - } - } else if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - next += ","; - } + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; - next += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - next += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; - // lines are stored 0-based in SourceMap spec version 3 - next += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; - next += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - next += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } + result += next; + } - result += next; - } + return result; + }; - return result; - } + SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; - _generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function(source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - const key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) - ? this._sourcesContents[key] - : null; - }, this); - } + /** + * Externalize the source map. + */ + SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } - /** - * Externalize the source map. - */ - toJSON() { - const map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } + return map; + }; - return map; - } + /** + * Render the source map being generated to a string. + */ + SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; - /** - * Render the source map being generated to a string. - */ - toString() { - return JSON.stringify(this.toJSON()); - } -} - -SourceMapGenerator.prototype._version = 3; -exports.SourceMapGenerator = SourceMapGenerator; + exports.SourceMapGenerator = SourceMapGenerator; /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 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 THE COPYRIGHT - * OWNER OR CONTRIBUTORS 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. - */ + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 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 THE COPYRIGHT + * OWNER OR CONTRIBUTORS 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. + */ -const base64 = __webpack_require__(6); + var base64 = __webpack_require__(3); -// A single base 64 digit can contain 6 bits of data. For the base 64 variable -// length quantities we use in the source map spec, the first bit is the sign, -// the next four bits are the actual value, and the 6th bit is the -// continuation bit. The continuation bit tells us whether there are more -// digits in this value following this digit. -// -// Continuation -// | Sign -// | | -// V V -// 101011 + // A single base 64 digit can contain 6 bits of data. For the base 64 variable + // length quantities we use in the source map spec, the first bit is the sign, + // the next four bits are the actual value, and the 6th bit is the + // continuation bit. The continuation bit tells us whether there are more + // digits in this value following this digit. + // + // Continuation + // | Sign + // | | + // V V + // 101011 -const VLQ_BASE_SHIFT = 5; + var VLQ_BASE_SHIFT = 5; -// binary: 100000 -const VLQ_BASE = 1 << VLQ_BASE_SHIFT; + // binary: 100000 + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; -// binary: 011111 -const VLQ_BASE_MASK = VLQ_BASE - 1; + // binary: 011111 + var VLQ_BASE_MASK = VLQ_BASE - 1; -// binary: 100000 -const VLQ_CONTINUATION_BIT = VLQ_BASE; + // binary: 100000 + var VLQ_CONTINUATION_BIT = VLQ_BASE; -/** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ -function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; -} + /** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; + } -/** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ -// eslint-disable-next-line no-unused-vars -function fromVLQSigned(aValue) { - const isNegative = (aValue & 1) === 1; - const shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; -} + /** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; + } -/** - * Returns the base 64 VLQ encoded value. - */ -exports.encode = function base64VLQ_encode(aValue) { - let encoded = ""; - let digit; + /** + * Returns the base 64 VLQ encoded value. + */ + exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; - let vlq = toVLQSigned(aValue); + var vlq = toVLQSigned(aValue); - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); - return encoded; -}; + return encoded; + }; + + /** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; /***/ }), /* 3 */ /***/ (function(module, exports) { -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ -/** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ -class ArraySet { - constructor() { - this._array = []; - this._set = new Map(); - } + var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - /** - * Static method for creating ArraySet instances from an existing array. - */ - static fromArray(aArray, aAllowDuplicates) { - const set = new ArraySet(); - for (let i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - } + /** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); + }; - /** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ - size() { - return this._set.size; - } + /** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' - /** - * Add the given string to this set. - * - * @param String aStr - */ - add(aStr, aAllowDuplicates) { - const isDuplicate = this.has(aStr); - const idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - this._set.set(aStr, idx); - } - } + var littleA = 97; // 'a' + var littleZ = 122; // 'z' - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - has(aStr) { - return this._set.has(aStr); - } + var zero = 48; // '0' + var nine = 57; // '9' - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - indexOf(aStr) { - const idx = this._set.get(aStr); - if (idx >= 0) { - return idx; - } - throw new Error('"' + aStr + '" is not in the set.'); - } + var plus = 43; // '+' + var slash = 47; // '/' - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error("No element indexed by " + aIdx); - } + var littleOffset = 26; + var numberOffset = 52; - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - toArray() { - return this._array.slice(); - } -} -exports.ArraySet = ArraySet; + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; + }; /***/ }), /* 4 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { -/* WEBPACK VAR INJECTION */(function(__dirname) {if (typeof fetch === "function") { - // Web version of reading a wasm file into an array buffer. + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ - let mappingsWasmUrl = null; + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; - module.exports = function readWasm() { - if (typeof mappingsWasmUrl !== "string") { - throw new Error("You must provide the URL of lib/mappings.wasm by calling " + - "SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) " + - "before using SourceMapConsumer"); - } + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; - return fetch(mappingsWasmUrl) - .then(response => response.arrayBuffer()); - }; + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; - module.exports.initialize = url => mappingsWasmUrl = url; -} else { - // Node version of reading a wasm file into an array buffer. - const fs = __webpack_require__(10); - const path = __webpack_require__(11); + function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; + } + exports.urlGenerate = urlGenerate; - module.exports = function readWasm() { - return new Promise((resolve, reject) => { - const wasmPath = path.join(__dirname, "mappings.wasm"); - fs.readFile(wasmPath, null, (error, data) => { - if (error) { - reject(error); - return; - } + /** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); - resolve(data.buffer); - }); - }); - }; + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); - module.exports.initialize = _ => { - console.debug("SourceMapConsumer.initialize is a no-op when running in node.js"); - }; -} + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + } + exports.normalize = normalize; + + /** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join; + + exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); + }; + + /** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative; + + var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); + }()); + + function identity (s) { + return s; + } + + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; + } + exports.toSetString = supportsNullProto ? identity : toSetString; + + function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; + } + exports.fromSetString = supportsNullProto ? identity : fromSetString; + + function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; + } + + /** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositions = compareByOriginalPositions; + + /** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; + } + + /** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + + /** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ + function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); + } + exports.parseSourceMapInput = parseSourceMapInput; + + /** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ + function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); + } + exports.computeSourceURL = computeSourceURL; -/* WEBPACK VAR INJECTION */}.call(exports, "/")) /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { -/* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ -exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; -exports.SourceMapConsumer = __webpack_require__(8).SourceMapConsumer; -exports.SourceNode = __webpack_require__(13).SourceNode; + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + var has = Object.prototype.hasOwnProperty; + var hasNativeMap = typeof Map !== "undefined"; + + /** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); + } + + /** + * Static method for creating ArraySet instances from an existing array. + */ + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; + }; + + /** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; + }; + + /** + * Add the given string to this set. + * + * @param String aStr + */ + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } + }; + + /** + * Is the given string a member of this set? + * + * @param String aStr + */ + ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } + }; + + /** + * What is the index of the given string in the array? + * + * @param String aStr + */ + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); + }; + + /** + * What is the element at the given index? + * + * @param Number aIdx + */ + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); + }; + + /** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + + exports.ArraySet = ArraySet; /***/ }), /* 6 */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ -const intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); + var util = __webpack_require__(4); -/** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ -exports.encode = function(number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); -}; + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + + exports.MappingList = MappingList; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ -const util = __webpack_require__(0); + var util = __webpack_require__(4); + var binarySearch = __webpack_require__(8); + var ArraySet = __webpack_require__(5).ArraySet; + var base64VLQ = __webpack_require__(2); + var quickSort = __webpack_require__(9).quickSort; -/** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ -function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - const lineA = mappingA.generatedLine; - const lineB = mappingB.generatedLine; - const columnA = mappingA.generatedColumn; - const columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; -} + function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } -/** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a negligible overhead in general - * case for a large speedup in case of mappings being added in order. - */ -class MappingList { - constructor() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; - } + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); + } - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - unsortedForEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - } + SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); + } - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - } + /** + * The version of the source mapping spec that we are consuming. + */ + SourceMapConsumer.prototype._version = 3; - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; - } -} + // `__generatedMappings` and `__originalMappings` are arrays that hold the + // parsed mapping coordinates from the source map's "mappings" attribute. They + // are lazily instantiated, accessed via the `_generatedMappings` and + // `_originalMappings` getters respectively, and we only parse the mappings + // and create these arrays once queried for a source location. We jump through + // these hoops because there can be many thousands of mappings, and parsing + // them is expensive, so we only want to do it if we must. + // + // Each object in the arrays is of the form: + // + // { + // generatedLine: The line number in the generated code, + // generatedColumn: The column number in the generated code, + // source: The path to the original source file that generated this + // chunk of code, + // originalLine: The line number in the original source that + // corresponds to this chunk of generated code, + // originalColumn: The column number in the original source that + // corresponds to this chunk of generated code, + // name: The name of the original symbol which generated this chunk of + // code. + // } + // + // All properties except for `generatedLine` and `generatedColumn` can be + // `null`. + // + // `_generatedMappings` is ordered by the generated positions. + // + // `_originalMappings` is ordered by the original positions. -exports.MappingList = MappingList; + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } + }); + + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } + }); + + SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + + /** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + + /** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + + exports.SourceMapConsumer = SourceMapConsumer; + + /** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; + } + + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + + /** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ + BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; + }; + + /** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ + BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + BasicSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } + }); + + /** + * Provide the JIT with a nice shape / hidden class. + */ + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + + /** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + + exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + + /** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); + } + + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + + /** + * The version of the source mapping spec that we are consuming. + */ + IndexedSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } + }); + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + + exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; /***/ }), /* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -const util = __webpack_require__(0); -const binarySearch = __webpack_require__(9); -const ArraySet = __webpack_require__(3).ArraySet; -const base64VLQ = __webpack_require__(2); // eslint-disable-line no-unused-vars -const readWasm = __webpack_require__(4); -const wasm = __webpack_require__(12); - -const INTERNAL = Symbol("smcInternal"); - -class SourceMapConsumer { - constructor(aSourceMap, aSourceMapURL) { - // If the constructor was called by super(), just return Promise. - // Yes, this is a hack to retain the pre-existing API of the base-class - // constructor also being an async factory function. - if (aSourceMap == INTERNAL) { - return Promise.resolve(this); - } - - return _factory(aSourceMap, aSourceMapURL); - } - - static initialize(opts) { - readWasm.initialize(opts["lib/mappings.wasm"]); - } - - static fromSourceMap(aSourceMap, aSourceMapURL) { - return _factoryBSM(aSourceMap, aSourceMapURL); - } - - /** - * Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl` - * (see the `SourceMapConsumer` constructor for details. Then, invoke the `async - * function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait - * for `f` to complete, call `destroy` on the consumer, and return `f`'s return - * value. - * - * You must not use the consumer after `f` completes! - * - * By using `with`, you do not have to remember to manually call `destroy` on - * the consumer, since it will be called automatically once `f` completes. - * - * ```js - * const xSquared = await SourceMapConsumer.with( - * myRawSourceMap, - * null, - * async function (consumer) { - * // Use `consumer` inside here and don't worry about remembering - * // to call `destroy`. - * - * const x = await whatever(consumer); - * return x * x; - * } - * ); - * - * // You may not use that `consumer` anymore out here; it has - * // been destroyed. But you can use `xSquared`. - * console.log(xSquared); - * ``` - */ - static with(rawSourceMap, sourceMapUrl, f) { - // Note: The `acorn` version that `webpack` currently depends on doesn't - // support `async` functions, and the nodes that we support don't all have - // `.finally`. Therefore, this is written a bit more convolutedly than it - // should really be. - - let consumer = null; - const promise = new SourceMapConsumer(rawSourceMap, sourceMapUrl); - return promise - .then(c => { - consumer = c; - return f(c); - }) - .then(x => { - if (consumer) { - consumer.destroy(); - } - return x; - }, e => { - if (consumer) { - consumer.destroy(); - } - throw e; - }); - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - _parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - } - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - eachMapping(aCallback, aContext, aOrder) { - throw new Error("Subclasses must implement eachMapping"); - } - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - allGeneratedPositionsFor(aArgs) { - throw new Error("Subclasses must implement allGeneratedPositionsFor"); - } - - destroy() { - throw new Error("Subclasses must implement destroy"); - } -} - -/** - * The version of the source mapping spec that we are consuming. - */ -SourceMapConsumer.prototype._version = 3; -SourceMapConsumer.GENERATED_ORDER = 1; -SourceMapConsumer.ORIGINAL_ORDER = 2; - -SourceMapConsumer.GREATEST_LOWER_BOUND = 1; -SourceMapConsumer.LEAST_UPPER_BOUND = 2; - -exports.SourceMapConsumer = SourceMapConsumer; - -/** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The first parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ -class BasicSourceMapConsumer extends SourceMapConsumer { - constructor(aSourceMap, aSourceMapURL) { - return super(INTERNAL).then(that => { - let sourceMap = aSourceMap; - if (typeof aSourceMap === "string") { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - const version = util.getArg(sourceMap, "version"); - let sources = util.getArg(sourceMap, "sources"); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - const names = util.getArg(sourceMap, "names", []); - let sourceRoot = util.getArg(sourceMap, "sourceRoot", null); - const sourcesContent = util.getArg(sourceMap, "sourcesContent", null); - const mappings = util.getArg(sourceMap, "mappings"); - const file = util.getArg(sourceMap, "file", null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != that._version) { - throw new Error("Unsupported version: " + version); - } - - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } - - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function(source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - that._names = ArraySet.fromArray(names.map(String), true); - that._sources = ArraySet.fromArray(sources, true); - - that._absoluteSources = that._sources.toArray().map(function(s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - that.sourceRoot = sourceRoot; - that.sourcesContent = sourcesContent; - that._mappings = mappings; - that._sourceMapURL = aSourceMapURL; - that.file = file; - - that._computedColumnSpans = false; - that._mappingsPtr = 0; - that._wasm = null; - - return wasm().then(w => { - that._wasm = w; - return that; - }); - }); - } - - /** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ - _findSourceIndex(aSource) { - let relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); - } - - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - for (let i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; - } - } - - return -1; - } - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ - static fromSourceMap(aSourceMap, aSourceMapURL) { - return new BasicSourceMapConsumer(aSourceMap.toString()); - } - - get sources() { - return this._absoluteSources.slice(); - } - - _getMappingsPtr() { - if (this._mappingsPtr === 0) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this._mappingsPtr; - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - _parseMappings(aStr, aSourceRoot) { - const size = aStr.length; - - const mappingsBufPtr = this._wasm.exports.allocate_mappings(size); - const mappingsBuf = new Uint8Array(this._wasm.exports.memory.buffer, mappingsBufPtr, size); - for (let i = 0; i < size; i++) { - mappingsBuf[i] = aStr.charCodeAt(i); - } - - const mappingsPtr = this._wasm.exports.parse_mappings(mappingsBufPtr); - - if (!mappingsPtr) { - const error = this._wasm.exports.get_last_error(); - let msg = `Error parsing mappings (code ${error}): `; - - // XXX: keep these error codes in sync with `fitzgen/source-map-mappings`. - switch (error) { - case 1: - msg += "the mappings contained a negative line, column, source index, or name index"; - break; - case 2: - msg += "the mappings contained a number larger than 2**32"; - break; - case 3: - msg += "reached EOF while in the middle of parsing a VLQ"; - break; - case 4: - msg += "invalid base 64 character while parsing a VLQ"; - break; - default: - msg += "unknown error code"; - break; - } - - throw new Error(msg); - } - - this._mappingsPtr = mappingsPtr; - } - - eachMapping(aCallback, aContext, aOrder) { - const context = aContext || null; - const order = aOrder || SourceMapConsumer.GENERATED_ORDER; - const sourceRoot = this.sourceRoot; - - this._wasm.withMappingCallback( - mapping => { - if (mapping.source !== null) { - mapping.source = this._sources.at(mapping.source); - mapping.source = util.computeSourceURL(sourceRoot, mapping.source, this._sourceMapURL); - - if (mapping.name !== null) { - mapping.name = this._names.at(mapping.name); - } - } - - aCallback.call(context, mapping); - }, - () => { - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - this._wasm.exports.by_generated_location(this._getMappingsPtr()); - break; - case SourceMapConsumer.ORIGINAL_ORDER: - this._wasm.exports.by_original_location(this._getMappingsPtr()); - break; - default: - throw new Error("Unknown order of iteration."); - } - } - ); - } - - allGeneratedPositionsFor(aArgs) { - let source = util.getArg(aArgs, "source"); - const originalLine = util.getArg(aArgs, "line"); - const originalColumn = aArgs.column || 0; - - source = this._findSourceIndex(source); - if (source < 0) { - return []; - } - - if (originalLine < 1) { - throw new Error("Line numbers must be >= 1"); - } - - if (originalColumn < 0) { - throw new Error("Column numbers must be >= 0"); - } - - const mappings = []; - - this._wasm.withMappingCallback( - m => { - let lastColumn = m.lastGeneratedColumn; - if (this._computedColumnSpans && lastColumn === null) { - lastColumn = Infinity; - } - mappings.push({ - line: m.generatedLine, - column: m.generatedColumn, - lastColumn, - }); - }, () => { - this._wasm.exports.all_generated_locations_for( - this._getMappingsPtr(), - source, - originalLine - 1, - "column" in aArgs, - originalColumn - ); - } - ); - - return mappings; - } - - destroy() { - if (this._mappingsPtr !== 0) { - this._wasm.exports.free_mappings(this._mappingsPtr); - this._mappingsPtr = 0; - } - } - - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - computeColumnSpans() { - if (this._computedColumnSpans) { - return; - } - - this._wasm.exports.compute_column_spans(this._getMappingsPtr()); - this._computedColumnSpans = true; - } - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - originalPositionFor(aArgs) { - const needle = { - generatedLine: util.getArg(aArgs, "line"), - generatedColumn: util.getArg(aArgs, "column") - }; - - if (needle.generatedLine < 1) { - throw new Error("Line numbers must be >= 1"); - } - - if (needle.generatedColumn < 0) { - throw new Error("Column numbers must be >= 0"); - } - - let bias = util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND); - if (bias == null) { - bias = SourceMapConsumer.GREATEST_LOWER_BOUND; - } - - let mapping; - this._wasm.withMappingCallback(m => mapping = m, () => { - this._wasm.exports.original_location_for( - this._getMappingsPtr(), - needle.generatedLine - 1, - needle.generatedColumn, - bias - ); - }); - - if (mapping) { - if (mapping.generatedLine === needle.generatedLine) { - let source = util.getArg(mapping, "source", null); - if (source !== null) { - source = this._sources.at(source); - source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); - } - - let name = util.getArg(mapping, "name", null); - if (name !== null) { - name = this._names.at(name); - } - - return { - source, - line: util.getArg(mapping, "originalLine", null), - column: util.getArg(mapping, "originalColumn", null), - name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - } - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function(sc) { return sc == null; }); - } - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - const index = this._findSourceIndex(aSource); - if (index >= 0) { - return this.sourcesContent[index]; - } - - let relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } - - let url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - const fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]; - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + relativeSource)) { - return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - generatedPositionFor(aArgs) { - let source = util.getArg(aArgs, "source"); - source = this._findSourceIndex(source); - if (source < 0) { - return { - line: null, - column: null, - lastColumn: null - }; - } - - const needle = { - source, - originalLine: util.getArg(aArgs, "line"), - originalColumn: util.getArg(aArgs, "column") - }; - - if (needle.originalLine < 1) { - throw new Error("Line numbers must be >= 1"); - } - - if (needle.originalColumn < 0) { - throw new Error("Column numbers must be >= 0"); - } - - let bias = util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND); - if (bias == null) { - bias = SourceMapConsumer.GREATEST_LOWER_BOUND; - } - - let mapping; - this._wasm.withMappingCallback(m => mapping = m, () => { - this._wasm.exports.generated_location_for( - this._getMappingsPtr(), - needle.source, - needle.originalLine - 1, - needle.originalColumn, - bias - ); - }); - - if (mapping) { - if (mapping.source === needle.source) { - let lastColumn = mapping.lastGeneratedColumn; - if (this._computedColumnSpans && lastColumn === null) { - lastColumn = Infinity; - } - return { - line: util.getArg(mapping, "generatedLine", null), - column: util.getArg(mapping, "generatedColumn", null), - lastColumn, - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - } -} - -BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; -exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - -/** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The first parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * The second parameter, if given, is a string whose value is the URL - * at which the source map was found. This URL is used to compute the - * sources array. - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ -class IndexedSourceMapConsumer extends SourceMapConsumer { - constructor(aSourceMap, aSourceMapURL) { - return super(INTERNAL).then(that => { - let sourceMap = aSourceMap; - if (typeof aSourceMap === "string") { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - const version = util.getArg(sourceMap, "version"); - const sections = util.getArg(sourceMap, "sections"); - - if (version != that._version) { - throw new Error("Unsupported version: " + version); - } - - that._sources = new ArraySet(); - that._names = new ArraySet(); - that.__generatedMappings = null; - that.__originalMappings = null; - that.__generatedMappingsUnsorted = null; - that.__originalMappingsUnsorted = null; - - let lastOffset = { - line: -1, - column: 0 - }; - return Promise.all(sections.map(s => { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error("Support for url field in sections not implemented."); - } - const offset = util.getArg(s, "offset"); - const offsetLine = util.getArg(offset, "line"); - const offsetColumn = util.getArg(offset, "column"); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error("Section offsets must be ordered and non-overlapping."); - } - lastOffset = offset; - - const cons = new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL); - return cons.then(consumer => { - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer - }; - }); - })).then(s => { - that._sections = s; - return that; - }); - }); - } - - // `__generatedMappings` and `__originalMappings` are arrays that hold the - // parsed mapping coordinates from the source map's "mappings" attribute. They - // are lazily instantiated, accessed via the `_generatedMappings` and - // `_originalMappings` getters respectively, and we only parse the mappings - // and create these arrays once queried for a source location. We jump through - // these hoops because there can be many thousands of mappings, and parsing - // them is expensive, so we only want to do it if we must. - // - // Each object in the arrays is of the form: - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `_generatedMappings` is ordered by the generated positions. - // - // `_originalMappings` is ordered by the original positions. - get _generatedMappings() { - if (!this.__generatedMappings) { - this._sortGeneratedMappings(); - } - - return this.__generatedMappings; - } - - get _originalMappings() { - if (!this.__originalMappings) { - this._sortOriginalMappings(); - } - - return this.__originalMappings; - } - - get _generatedMappingsUnsorted() { - if (!this.__generatedMappingsUnsorted) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappingsUnsorted; - } - - get _originalMappingsUnsorted() { - if (!this.__originalMappingsUnsorted) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappingsUnsorted; - } - - _sortGeneratedMappings() { - const mappings = this._generatedMappingsUnsorted; - mappings.sort(util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = mappings; - } - - _sortOriginalMappings() { - const mappings = this._originalMappingsUnsorted; - mappings.sort(util.compareByOriginalPositions); - this.__originalMappings = mappings; - } - - /** - * The list of original sources. - */ - get sources() { - const sources = []; - for (let i = 0; i < this._sections.length; i++) { - for (let j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - originalPositionFor(aArgs) { - const needle = { - generatedLine: util.getArg(aArgs, "line"), - generatedColumn: util.getArg(aArgs, "column") - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - const sectionIndex = binarySearch.search(needle, this._sections, - function(aNeedle, section) { - const cmp = aNeedle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (aNeedle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - const section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - } - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - hasContentsOfAllSources() { - return this._sections.every(function(s) { - return s.consumer.hasContentsOfAllSources(); - }); - } - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - sourceContentFor(aSource, nullOnMissing) { - for (let i = 0; i < this._sections.length; i++) { - const section = this._sections[i]; - - const content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - generatedPositionFor(aArgs) { - for (let i = 0; i < this._sections.length; i++) { - const section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) { - continue; - } - const generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - const ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - _parseMappings(aStr, aSourceRoot) { - const generatedMappings = this.__generatedMappingsUnsorted = []; - const originalMappings = this.__originalMappingsUnsorted = []; - for (let i = 0; i < this._sections.length; i++) { - const section = this._sections[i]; - - const sectionMappings = []; - section.consumer.eachMapping(m => sectionMappings.push(m)); - - for (let j = 0; j < sectionMappings.length; j++) { - const mapping = sectionMappings[j]; - - // TODO: test if null is correct here. The original code used - // `source`, which would actually have gotten used as null because - // var's get hoisted. - // See: https://github.com/mozilla/source-map/issues/333 - let source = util.computeSourceURL(section.consumer.sourceRoot, null, this._sourceMapURL); - this._sources.add(source); - source = this._sources.indexOf(source); - - let name = null; - if (mapping.name) { - this._names.add(mapping.name); - name = this._names.indexOf(mapping.name); - } - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - const adjustedMapping = { - source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name - }; - - generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === "number") { - originalMappings.push(adjustedMapping); - } - } - } - } - - eachMapping(aCallback, aContext, aOrder) { - const context = aContext || null; - const order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - let mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - const sourceRoot = this.sourceRoot; - mappings.map(function(mapping) { - let source = null; - if (mapping.source !== null) { - source = this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - } - return { - source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - } - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - _findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError("Line must be greater than or equal to 1, got " - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError("Column must be greater than or equal to 0, got " - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - } - - allGeneratedPositionsFor(aArgs) { - const line = util.getArg(aArgs, "line"); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - const needle = { - source: util.getArg(aArgs, "source"), - originalLine: line, - originalColumn: util.getArg(aArgs, "column", 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - if (needle.originalLine < 1) { - throw new Error("Line numbers must be >= 1"); - } - - if (needle.originalColumn < 0) { - throw new Error("Column numbers must be >= 0"); - } - - const mappings = []; - - let index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - let mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - const originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - let lastColumn = mapping.lastGeneratedColumn; - if (this._computedColumnSpans && lastColumn === null) { - lastColumn = Infinity; - } - mappings.push({ - line: util.getArg(mapping, "generatedLine", null), - column: util.getArg(mapping, "generatedColumn", null), - lastColumn, - }); - - mapping = this._originalMappings[++index]; - } - } else { - const originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - let lastColumn = mapping.lastGeneratedColumn; - if (this._computedColumnSpans && lastColumn === null) { - lastColumn = Infinity; - } - mappings.push({ - line: util.getArg(mapping, "generatedLine", null), - column: util.getArg(mapping, "generatedColumn", null), - lastColumn, - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - } - - destroy() { - for (let i = 0; i < this._sections.length; i++) { - this._sections[i].consumer.destroy(); - } - } -} -exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; - -/* - * Cheat to get around inter-twingled classes. `factory()` can be at the end - * where it has access to non-hoisted classes, but it gets hoisted itself. - */ -function _factory(aSourceMap, aSourceMapURL) { - let sourceMap = aSourceMap; - if (typeof aSourceMap === "string") { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - const consumer = sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); - return Promise.resolve(consumer); -} - -function _factoryBSM(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); -} +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + + /** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } + } + + /** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; + }; /***/ }), /* 9 */ /***/ (function(module, exports) { -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ -exports.GREATEST_LOWER_BOUND = 1; -exports.LEAST_UPPER_BOUND = 2; + // It turns out that some (most?) JavaScript engines don't self-host + // `Array.prototype.sort`. This makes sense because C++ will likely remain + // faster than JS when doing raw CPU-intensive sorting. However, when using a + // custom comparator function, calling back and forth between the VM's C++ and + // JIT'd JS is rather slow *and* loses JIT type information, resulting in + // worse generated code for the comparator function than would be optimal. In + // fact, when sorting with a comparator, these costs outweigh the benefits of + // sorting in C++. By using our own JS-implemented Quick Sort (below), we get + // a ~3500ms mean speed-up in `bench/bench.html`. -/** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ -function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - const mid = Math.floor((aHigh - aLow) / 2) + aLow; - const cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } + /** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ + function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; + } - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } - return mid; - } + /** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); + } - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } + /** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } - return aLow < 0 ? -1 : aLow; -} + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. -/** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ -exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; - let index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } + swap(ary, pivotIndex, r); + var pivot = ary[r]; - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } - return index; -}; + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } + } + + /** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + exports.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); + }; /***/ }), /* 10 */ -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_10__; - -/***/ }), -/* 11 */ -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_11__; - -/***/ }), -/* 12 */ /***/ (function(module, exports, __webpack_require__) { -const readWasm = __webpack_require__(4); + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ -/** - * Provide the JIT with a nice shape / hidden class. - */ -function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.lastGeneratedColumn = null; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; -} + var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + var util = __webpack_require__(4); -let cachedWasm = null; + // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other + // operating systems these days (capturing the result). + var REGEX_NEWLINE = /(\r?\n)/; -module.exports = function wasm() { - if (cachedWasm) { - return cachedWasm; - } + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; - const callbackStack = []; + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; - cachedWasm = readWasm().then(buffer => { - return WebAssembly.instantiate(buffer, { - env: { - mapping_callback( - generatedLine, - generatedColumn, + /** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } - hasLastGeneratedColumn, - lastGeneratedColumn, + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); - hasOriginal, - source, - originalLine, - originalColumn, + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; - hasName, - name - ) { - const mapping = new Mapping(); - // JS uses 1-based line numbers, wasm uses 0-based. - mapping.generatedLine = generatedLine + 1; - mapping.generatedColumn = generatedColumn; + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; - if (hasLastGeneratedColumn) { - // JS uses inclusive last generated column, wasm uses exclusive. - mapping.lastGeneratedColumn = lastGeneratedColumn - 1; - } + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; - if (hasOriginal) { - mapping.source = source; - // JS uses 1-based line numbers, wasm uses 0-based. - mapping.originalLine = originalLine + 1; - mapping.originalColumn = originalColumn; + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; - if (hasName) { - mapping.name = name; - } - } + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } - callbackStack[callbackStack.length - 1](mapping); - }, + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); - start_all_generated_locations_for() { console.time("all_generated_locations_for"); }, - end_all_generated_locations_for() { console.timeEnd("all_generated_locations_for"); }, + return node; - start_compute_column_spans() { console.time("compute_column_spans"); }, - end_compute_column_spans() { console.timeEnd("compute_column_spans"); }, + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; - start_generated_location_for() { console.time("generated_location_for"); }, - end_generated_location_for() { console.timeEnd("generated_location_for"); }, + /** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; - start_original_location_for() { console.time("original_location_for"); }, - end_original_location_for() { console.timeEnd("original_location_for"); }, + /** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; - start_parse_mappings() { console.time("parse_mappings"); }, - end_parse_mappings() { console.timeEnd("parse_mappings"); }, + /** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } + }; - start_sort_by_generated_location() { console.time("sort_by_generated_location"); }, - end_sort_by_generated_location() { console.timeEnd("sort_by_generated_location"); }, + /** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; - start_sort_by_original_location() { console.time("sort_by_original_location"); }, - end_sort_by_original_location() { console.timeEnd("sort_by_original_location"); }, - } - }); - }).then(Wasm => { - return { - exports: Wasm.instance.exports, - withMappingCallback: (mappingCallback, f) => { - callbackStack.push(mappingCallback); - try { - f(); - } finally { - callbackStack.pop(); - } - } - }; - }).then(null, e => { - cachedWasm = null; - throw e; - }); + /** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; + }; - return cachedWasm; -}; + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ + /** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; + }; -const SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; -const util = __webpack_require__(0); + /** + * Returns the string representation of this source node along with a source + * map. + */ + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); -// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other -// operating systems these days (capturing the result). -const REGEX_NEWLINE = /(\r?\n)/; + return { code: generated.code, map: map }; + }; -// Newline character code for charCodeAt() comparisons -const NEWLINE_CODE = 10; - -// Private symbol for identifying `SourceNode`s when multiple versions of -// the source-map library are loaded. This MUST NOT CHANGE across -// versions! -const isSourceNode = "$$$isSourceNode$$$"; - -/** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ -class SourceNode { - constructor(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ - static fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - const node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are accessed by calling `shiftNextLine`. - const remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - let remainingLinesIndex = 0; - const shiftNextLine = function() { - const lineContents = getNextLine(); - // The last line of a file might not have a newline. - const newLine = getNextLine() || ""; - return lineContents + newLine; - - function getNextLine() { - return remainingLinesIndex < remainingLines.length ? - remainingLines[remainingLinesIndex++] : undefined; - } - }; - - // We need to remember the position of "remainingLines" - let lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - let lastMapping = null; - let nextLine; - - aSourceMapConsumer.eachMapping(function(mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - nextLine = remainingLines[remainingLinesIndex] || ""; - const code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - nextLine = remainingLines[remainingLinesIndex] || ""; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLinesIndex < remainingLines.length) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.splice(remainingLinesIndex).join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function(sourceFile) { - const content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - const source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - } - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function(chunk) { - this.add(chunk); - }, this); - } else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - } - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (let i = aChunk.length - 1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - } - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - walk(aFn) { - let chunk; - for (let i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } else if (chunk !== "") { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - join(aSep) { - let newChildren; - let i; - const len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len - 1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - } - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - replaceRight(aPattern, aReplacement) { - const lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } else if (typeof lastChild === "string") { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } else { - this.children.push("".replace(aPattern, aReplacement)); - } - return this; - } - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - } - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - walkSourceContents(aFn) { - for (let i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - const sources = Object.keys(this.sourceContents); - for (let i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - } - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - toString() { - let str = ""; - this.walk(function(chunk) { - str += chunk; - }); - return str; - } - - /** - * Returns the string representation of this source node along with a source - * map. - */ - toStringWithSourceMap(aArgs) { - const generated = { - code: "", - line: 1, - column: 0 - }; - const map = new SourceMapGenerator(aArgs); - let sourceMappingActive = false; - let lastOriginalSource = null; - let lastOriginalLine = null; - let lastOriginalColumn = null; - let lastOriginalName = null; - this.walk(function(chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if (lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (let idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function(sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map }; - } -} - -exports.SourceNode = SourceNode; + exports.SourceNode = SourceNode; /***/ }) -/******/ ]); -}); \ No newline at end of file +/******/ ]) +}); +; \ No newline at end of file diff --git a/node_modules/terser/node_modules/source-map/lib/array-set.js b/node_modules/terser/node_modules/source-map/lib/array-set.js index 40171b9..fbd5c81 100644 --- a/node_modules/terser/node_modules/source-map/lib/array-set.js +++ b/node_modules/terser/node_modules/source-map/lib/array-set.js @@ -5,96 +5,117 @@ * http://opensource.org/licenses/BSD-3-Clause */ +var util = require('./util'); +var has = Object.prototype.hasOwnProperty; +var hasNativeMap = typeof Map !== "undefined"; + /** * A data structure which is a combination of an array and a set. Adding a new * member is O(1), testing for membership is O(1), and finding the index of an * element is O(1). Removing elements from the set is not supported. Only * strings are supported for membership. */ -class ArraySet { - constructor() { - this._array = []; - this._set = new Map(); - } +function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); +} - /** - * Static method for creating ArraySet instances from an existing array. - */ - static fromArray(aArray, aAllowDuplicates) { - const set = new ArraySet(); - for (let i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; +/** + * Static method for creating ArraySet instances from an existing array. + */ +ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); } + return set; +}; - /** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ - size() { - return this._set.size; +/** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ +ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; +}; + +/** + * Add the given string to this set. + * + * @param String aStr + */ +ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); } - - /** - * Add the given string to this set. - * - * @param String aStr - */ - add(aStr, aAllowDuplicates) { - const isDuplicate = this.has(aStr); - const idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { + if (!isDuplicate) { + if (hasNativeMap) { this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; } } +}; - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - has(aStr) { - return this._set.has(aStr); +/** + * Is the given string a member of this set? + * + * @param String aStr + */ +ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); } +}; - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - indexOf(aStr) { - const idx = this._set.get(aStr); +/** + * What is the index of the given string in the array? + * + * @param String aStr + */ +ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); if (idx >= 0) { return idx; } - throw new Error('"' + aStr + '" is not in the set.'); - } - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; } - throw new Error("No element indexed by " + aIdx); } - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - toArray() { - return this._array.slice(); + throw new Error('"' + aStr + '" is not in the set.'); +}; + +/** + * What is the element at the given index? + * + * @param Number aIdx + */ +ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; } -} + throw new Error('No element indexed by ' + aIdx); +}; + +/** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ +ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); +}; + exports.ArraySet = ArraySet; diff --git a/node_modules/terser/node_modules/source-map/lib/base64-vlq.js b/node_modules/terser/node_modules/source-map/lib/base64-vlq.js index fc1049c..612b404 100644 --- a/node_modules/terser/node_modules/source-map/lib/base64-vlq.js +++ b/node_modules/terser/node_modules/source-map/lib/base64-vlq.js @@ -35,7 +35,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -const base64 = require("./base64"); +var base64 = require('./base64'); // A single base 64 digit can contain 6 bits of data. For the base 64 variable // length quantities we use in the source map spec, the first bit is the sign, @@ -49,16 +49,16 @@ const base64 = require("./base64"); // V V // 101011 -const VLQ_BASE_SHIFT = 5; +var VLQ_BASE_SHIFT = 5; // binary: 100000 -const VLQ_BASE = 1 << VLQ_BASE_SHIFT; +var VLQ_BASE = 1 << VLQ_BASE_SHIFT; // binary: 011111 -const VLQ_BASE_MASK = VLQ_BASE - 1; +var VLQ_BASE_MASK = VLQ_BASE - 1; // binary: 100000 -const VLQ_CONTINUATION_BIT = VLQ_BASE; +var VLQ_CONTINUATION_BIT = VLQ_BASE; /** * Converts from a two-complement value to a value where the sign bit is @@ -78,10 +78,9 @@ function toVLQSigned(aValue) { * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 */ -// eslint-disable-next-line no-unused-vars function fromVLQSigned(aValue) { - const isNegative = (aValue & 1) === 1; - const shifted = aValue >> 1; + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; return isNegative ? -shifted : shifted; @@ -91,10 +90,10 @@ function fromVLQSigned(aValue) { * Returns the base 64 VLQ encoded value. */ exports.encode = function base64VLQ_encode(aValue) { - let encoded = ""; - let digit; + var encoded = ""; + var digit; - let vlq = toVLQSigned(aValue); + var vlq = toVLQSigned(aValue); do { digit = vlq & VLQ_BASE_MASK; @@ -109,3 +108,33 @@ exports.encode = function base64VLQ_encode(aValue) { return encoded; }; + +/** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ +exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; +}; diff --git a/node_modules/terser/node_modules/source-map/lib/base64.js b/node_modules/terser/node_modules/source-map/lib/base64.js index b9ca319..8aa86b3 100644 --- a/node_modules/terser/node_modules/source-map/lib/base64.js +++ b/node_modules/terser/node_modules/source-map/lib/base64.js @@ -5,14 +5,63 @@ * http://opensource.org/licenses/BSD-3-Clause */ -const intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); +var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); /** * Encode an integer in the range of 0 to 63 to a single base 64 digit. */ -exports.encode = function(number) { +exports.encode = function (number) { if (0 <= number && number < intToCharMap.length) { return intToCharMap[number]; } throw new TypeError("Must be between 0 and 63: " + number); }; + +/** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ +exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; +}; diff --git a/node_modules/terser/node_modules/source-map/lib/binary-search.js b/node_modules/terser/node_modules/source-map/lib/binary-search.js index d6f898e..010ac94 100644 --- a/node_modules/terser/node_modules/source-map/lib/binary-search.js +++ b/node_modules/terser/node_modules/source-map/lib/binary-search.js @@ -31,12 +31,13 @@ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { // // 3. We did not find the exact element, and there is no next-closest // element than the one we are searching for, so we return -1. - const mid = Math.floor((aHigh - aLow) / 2) + aLow; - const cmp = aCompare(aNeedle, aHaystack[mid], true); + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); if (cmp === 0) { // Found the element we are looking for. return mid; - } else if (cmp > 0) { + } + else if (cmp > 0) { // Our needle is greater than aHaystack[mid]. if (aHigh - mid > 1) { // The element is in the upper half. @@ -47,21 +48,24 @@ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { // we are in termination case (3) or (2) and return the appropriate thing. if (aBias == exports.LEAST_UPPER_BOUND) { return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; } - return mid; } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } - return aLow < 0 ? -1 : aLow; } /** @@ -87,7 +91,7 @@ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { return -1; } - let index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND); if (index < 0) { return -1; diff --git a/node_modules/terser/node_modules/source-map/lib/mapping-list.js b/node_modules/terser/node_modules/source-map/lib/mapping-list.js index 7056861..06d1274 100644 --- a/node_modules/terser/node_modules/source-map/lib/mapping-list.js +++ b/node_modules/terser/node_modules/source-map/lib/mapping-list.js @@ -5,7 +5,7 @@ * http://opensource.org/licenses/BSD-3-Clause */ -const util = require("./util"); +var util = require('./util'); /** * Determine whether mappingB is after mappingA with respect to generated @@ -13,68 +13,67 @@ const util = require("./util"); */ function generatedPositionAfter(mappingA, mappingB) { // Optimized for most common case - const lineA = mappingA.generatedLine; - const lineB = mappingB.generatedLine; - const columnA = mappingA.generatedColumn; - const columnB = mappingB.generatedColumn; + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; } /** * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a negligible overhead in general + * performance conscious manner. It trades a neglibable overhead in general * case for a large speedup in case of mappings being added in order. */ -class MappingList { - constructor() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; - } - - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - unsortedForEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - } - - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - } - - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; - } +function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; } +/** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ +MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + +/** + * Add the given source mapping. + * + * @param Object aMapping + */ +MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } +}; + +/** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ +MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; +}; + exports.MappingList = MappingList; diff --git a/node_modules/terser/node_modules/source-map/lib/mappings.wasm b/node_modules/terser/node_modules/source-map/lib/mappings.wasm deleted file mode 100644 index 3515370723369347c024869dc4dbb3318c45a294..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48693 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 L_t8J+(Zv4?U`;jz diff --git a/node_modules/terser/node_modules/source-map/lib/read-wasm.js b/node_modules/terser/node_modules/source-map/lib/read-wasm.js deleted file mode 100644 index 9bb6492..0000000 --- a/node_modules/terser/node_modules/source-map/lib/read-wasm.js +++ /dev/null @@ -1,40 +0,0 @@ -if (typeof fetch === "function") { - // Web version of reading a wasm file into an array buffer. - - let mappingsWasmUrl = null; - - module.exports = function readWasm() { - if (typeof mappingsWasmUrl !== "string") { - throw new Error("You must provide the URL of lib/mappings.wasm by calling " + - "SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) " + - "before using SourceMapConsumer"); - } - - return fetch(mappingsWasmUrl) - .then(response => response.arrayBuffer()); - }; - - module.exports.initialize = url => mappingsWasmUrl = url; -} else { - // Node version of reading a wasm file into an array buffer. - const fs = require("fs"); - const path = require("path"); - - module.exports = function readWasm() { - return new Promise((resolve, reject) => { - const wasmPath = path.join(__dirname, "mappings.wasm"); - fs.readFile(wasmPath, null, (error, data) => { - if (error) { - reject(error); - return; - } - - resolve(data.buffer); - }); - }); - }; - - module.exports.initialize = _ => { - console.debug("SourceMapConsumer.initialize is a no-op when running in node.js"); - }; -} diff --git a/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js b/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js index 43ea1a0..7b99d1d 100644 --- a/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js +++ b/node_modules/terser/node_modules/source-map/lib/source-map-consumer.js @@ -5,161 +5,250 @@ * http://opensource.org/licenses/BSD-3-Clause */ -const util = require("./util"); -const binarySearch = require("./binary-search"); -const ArraySet = require("./array-set").ArraySet; -const base64VLQ = require("./base64-vlq"); // eslint-disable-line no-unused-vars -const readWasm = require("../lib/read-wasm"); -const wasm = require("./wasm"); +var util = require('./util'); +var binarySearch = require('./binary-search'); +var ArraySet = require('./array-set').ArraySet; +var base64VLQ = require('./base64-vlq'); +var quickSort = require('./quick-sort').quickSort; -const INTERNAL = Symbol("smcInternal"); - -class SourceMapConsumer { - constructor(aSourceMap, aSourceMapURL) { - // If the constructor was called by super(), just return Promise. - // Yes, this is a hack to retain the pre-existing API of the base-class - // constructor also being an async factory function. - if (aSourceMap == INTERNAL) { - return Promise.resolve(this); - } - - return _factory(aSourceMap, aSourceMapURL); +function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); } - static initialize(opts) { - readWasm.initialize(opts["lib/mappings.wasm"]); - } + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); +} - static fromSourceMap(aSourceMap, aSourceMapURL) { - return _factoryBSM(aSourceMap, aSourceMapURL); - } - - /** - * Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl` - * (see the `SourceMapConsumer` constructor for details. Then, invoke the `async - * function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait - * for `f` to complete, call `destroy` on the consumer, and return `f`'s return - * value. - * - * You must not use the consumer after `f` completes! - * - * By using `with`, you do not have to remember to manually call `destroy` on - * the consumer, since it will be called automatically once `f` completes. - * - * ```js - * const xSquared = await SourceMapConsumer.with( - * myRawSourceMap, - * null, - * async function (consumer) { - * // Use `consumer` inside here and don't worry about remembering - * // to call `destroy`. - * - * const x = await whatever(consumer); - * return x * x; - * } - * ); - * - * // You may not use that `consumer` anymore out here; it has - * // been destroyed. But you can use `xSquared`. - * console.log(xSquared); - * ``` - */ - static with(rawSourceMap, sourceMapUrl, f) { - // Note: The `acorn` version that `webpack` currently depends on doesn't - // support `async` functions, and the nodes that we support don't all have - // `.finally`. Therefore, this is written a bit more convolutedly than it - // should really be. - - let consumer = null; - const promise = new SourceMapConsumer(rawSourceMap, sourceMapUrl); - return promise - .then(c => { - consumer = c; - return f(c); - }) - .then(x => { - if (consumer) { - consumer.destroy(); - } - return x; - }, e => { - if (consumer) { - consumer.destroy(); - } - throw e; - }); - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - _parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - } - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - eachMapping(aCallback, aContext, aOrder) { - throw new Error("Subclasses must implement eachMapping"); - } - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number is 1-based. - * - column: Optional. the column number in the original source. - * The column number is 0-based. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - allGeneratedPositionsFor(aArgs) { - throw new Error("Subclasses must implement allGeneratedPositionsFor"); - } - - destroy() { - throw new Error("Subclasses must implement destroy"); - } +SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); } /** * The version of the source mapping spec that we are consuming. */ SourceMapConsumer.prototype._version = 3; + +// `__generatedMappings` and `__originalMappings` are arrays that hold the +// parsed mapping coordinates from the source map's "mappings" attribute. They +// are lazily instantiated, accessed via the `_generatedMappings` and +// `_originalMappings` getters respectively, and we only parse the mappings +// and create these arrays once queried for a source location. We jump through +// these hoops because there can be many thousands of mappings, and parsing +// them is expensive, so we only want to do it if we must. +// +// Each object in the arrays is of the form: +// +// { +// generatedLine: The line number in the generated code, +// generatedColumn: The column number in the generated code, +// source: The path to the original source file that generated this +// chunk of code, +// originalLine: The line number in the original source that +// corresponds to this chunk of generated code, +// originalColumn: The column number in the original source that +// corresponds to this chunk of generated code, +// name: The name of the original symbol which generated this chunk of +// code. +// } +// +// All properties except for `generatedLine` and `generatedColumn` can be +// `null`. +// +// `_generatedMappings` is ordered by the generated positions. +// +// `_originalMappings` is ordered by the original positions. + +SourceMapConsumer.prototype.__generatedMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } +}); + +SourceMapConsumer.prototype.__originalMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } +}); + +SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + SourceMapConsumer.GENERATED_ORDER = 1; SourceMapConsumer.ORIGINAL_ORDER = 2; SourceMapConsumer.GREATEST_LOWER_BOUND = 1; SourceMapConsumer.LEAST_UPPER_BOUND = 2; +/** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ +SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + +/** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + exports.SourceMapConsumer = SourceMapConsumer; /** @@ -173,7 +262,7 @@ exports.SourceMapConsumer = SourceMapConsumer; * * - version: Which version of the source map spec this map is following. * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referenced by individual mappings. + * - names: An array of identifiers which can be referrenced by individual mappings. * - sourceRoot: Optional. The URL root from which all sources are relative. * - sourcesContent: Optional. An array of contents of the original source files. * - mappings: A string of base64 VLQs which contain the actual mappings. @@ -196,342 +285,398 @@ exports.SourceMapConsumer = SourceMapConsumer; * * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# */ -class BasicSourceMapConsumer extends SourceMapConsumer { - constructor(aSourceMap, aSourceMapURL) { - return super(INTERNAL).then(that => { - let sourceMap = aSourceMap; - if (typeof aSourceMap === "string") { - sourceMap = util.parseSourceMapInput(aSourceMap); - } +function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } - const version = util.getArg(sourceMap, "version"); - let sources = util.getArg(sourceMap, "sources"); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - const names = util.getArg(sourceMap, "names", []); - let sourceRoot = util.getArg(sourceMap, "sourceRoot", null); - const sourcesContent = util.getArg(sourceMap, "sourcesContent", null); - const mappings = util.getArg(sourceMap, "mappings"); - const file = util.getArg(sourceMap, "file", null); + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != that._version) { - throw new Error("Unsupported version: " + version); - } + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } - if (sourceRoot) { - sourceRoot = util.normalize(sourceRoot); - } + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } - sources = sources - .map(String) - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function(source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - that._names = ArraySet.fromArray(names.map(String), true); - that._sources = ArraySet.fromArray(sources, true); - - that._absoluteSources = that._sources.toArray().map(function(s) { - return util.computeSourceURL(sourceRoot, s, aSourceMapURL); - }); - - that.sourceRoot = sourceRoot; - that.sourcesContent = sourcesContent; - that._mappings = mappings; - that._sourceMapURL = aSourceMapURL; - that.file = file; - - that._computedColumnSpans = false; - that._mappingsPtr = 0; - that._wasm = null; - - return wasm().then(w => { - that._wasm = w; - return that; - }); + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; +} + +BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + +/** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ +BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); } - /** - * Utility function to find the index of a source. Returns -1 if not - * found. - */ - _findSourceIndex(aSource) { - let relativeSource = aSource; - if (this.sourceRoot != null) { - relativeSource = util.relative(this.sourceRoot, relativeSource); - } + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } - if (this._sources.has(relativeSource)) { - return this._sources.indexOf(relativeSource); + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; } + } - // Maybe aSource is an absolute URL as returned by |sources|. In - // this case we can't simply undo the transform. - for (let i = 0; i < this._absoluteSources.length; ++i) { - if (this._absoluteSources[i] == aSource) { - return i; + return -1; +}; + +/** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ +BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); } + + destGeneratedMappings.push(destMapping); } - return -1; - } + quickSort(smc.__originalMappings, util.compareByOriginalPositions); - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @param String aSourceMapURL - * The URL at which the source map can be found (optional) - * @returns BasicSourceMapConsumer - */ - static fromSourceMap(aSourceMap, aSourceMapURL) { - return new BasicSourceMapConsumer(aSourceMap.toString()); - } + return smc; + }; - get sources() { +/** + * The version of the source mapping spec that we are consuming. + */ +BasicSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { return this._absoluteSources.slice(); } +}); - _getMappingsPtr() { - if (this._mappingsPtr === 0) { - this._parseMappings(this._mappings, this.sourceRoot); - } +/** + * Provide the JIT with a nice shape / hidden class. + */ +function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; +} - return this._mappingsPtr; - } +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - _parseMappings(aStr, aSourceRoot) { - const size = aStr.length; - - const mappingsBufPtr = this._wasm.exports.allocate_mappings(size); - const mappingsBuf = new Uint8Array(this._wasm.exports.memory.buffer, mappingsBufPtr, size); - for (let i = 0; i < size; i++) { - mappingsBuf[i] = aStr.charCodeAt(i); - } - - const mappingsPtr = this._wasm.exports.parse_mappings(mappingsBufPtr); - - if (!mappingsPtr) { - const error = this._wasm.exports.get_last_error(); - let msg = `Error parsing mappings (code ${error}): `; - - // XXX: keep these error codes in sync with `fitzgen/source-map-mappings`. - switch (error) { - case 1: - msg += "the mappings contained a negative line, column, source index, or name index"; - break; - case 2: - msg += "the mappings contained a number larger than 2**32"; - break; - case 3: - msg += "reached EOF while in the middle of parsing a VLQ"; - break; - case 4: - msg += "invalid base 64 character while parsing a VLQ"; - break; - default: - msg += "unknown error code"; - break; + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; - throw new Error(msg); - } + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); - this._mappingsPtr = mappingsPtr; - } + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } - eachMapping(aCallback, aContext, aOrder) { - const context = aContext || null; - const order = aOrder || SourceMapConsumer.GENERATED_ORDER; - const sourceRoot = this.sourceRoot; + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } - this._wasm.withMappingCallback( - mapping => { - if (mapping.source !== null) { - mapping.source = this._sources.at(mapping.source); - mapping.source = util.computeSourceURL(sourceRoot, mapping.source, this._sourceMapURL); + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } - if (mapping.name !== null) { - mapping.name = this._names.at(mapping.name); + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; } } - aCallback.call(context, mapping); - }, - () => { - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - this._wasm.exports.by_generated_location(this._getMappingsPtr()); - break; - case SourceMapConsumer.ORIGINAL_ORDER: - this._wasm.exports.by_original_location(this._getMappingsPtr()); - break; - default: - throw new Error("Unknown order of iteration."); + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); } } - ); - } - - allGeneratedPositionsFor(aArgs) { - let source = util.getArg(aArgs, "source"); - const originalLine = util.getArg(aArgs, "line"); - const originalColumn = aArgs.column || 0; - - source = this._findSourceIndex(source); - if (source < 0) { - return []; } - if (originalLine < 1) { - throw new Error("Line numbers must be >= 1"); + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + +/** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ +BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); } - if (originalColumn < 0) { - throw new Error("Column numbers must be >= 0"); - } + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; - const mappings = []; +/** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ +BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; - this._wasm.withMappingCallback( - m => { - let lastColumn = m.lastGeneratedColumn; - if (this._computedColumnSpans && lastColumn === null) { - lastColumn = Infinity; + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; } - mappings.push({ - line: m.generatedLine, - column: m.generatedColumn, - lastColumn, - }); - }, () => { - this._wasm.exports.all_generated_locations_for( - this._getMappingsPtr(), - source, - originalLine - 1, - "column" in aArgs, - originalColumn - ); } - ); - return mappings; - } - - destroy() { - if (this._mappingsPtr !== 0) { - this._wasm.exports.free_mappings(this._mappingsPtr); - this._mappingsPtr = 0; + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; } - } + }; - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - computeColumnSpans() { - if (this._computedColumnSpans) { - return; - } - - this._wasm.exports.compute_column_spans(this._getMappingsPtr()); - this._computedColumnSpans = true; - } - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - originalPositionFor(aArgs) { - const needle = { - generatedLine: util.getArg(aArgs, "line"), - generatedColumn: util.getArg(aArgs, "column") +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') }; - if (needle.generatedLine < 1) { - throw new Error("Line numbers must be >= 1"); - } + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); - if (needle.generatedColumn < 0) { - throw new Error("Column numbers must be >= 0"); - } + if (index >= 0) { + var mapping = this._generatedMappings[index]; - let bias = util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND); - if (bias == null) { - bias = SourceMapConsumer.GREATEST_LOWER_BOUND; - } - - let mapping; - this._wasm.withMappingCallback(m => mapping = m, () => { - this._wasm.exports.original_location_for( - this._getMappingsPtr(), - needle.generatedLine - 1, - needle.generatedColumn, - bias - ); - }); - - if (mapping) { if (mapping.generatedLine === needle.generatedLine) { - let source = util.getArg(mapping, "source", null); + var source = util.getArg(mapping, 'source', null); if (source !== null) { source = this._sources.at(source); source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); } - - let name = util.getArg(mapping, "name", null); + var name = util.getArg(mapping, 'name', null); if (name !== null) { name = this._names.at(name); } - return { - source, - line: util.getArg(mapping, "originalLine", null), - column: util.getArg(mapping, "originalColumn", null), - name + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name }; } } @@ -542,51 +687,53 @@ class BasicSourceMapConsumer extends SourceMapConsumer { column: null, name: null }; - } + }; - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - hasContentsOfAllSources() { +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { if (!this.sourcesContent) { return false; } return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function(sc) { return sc == null; }); - } + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - sourceContentFor(aSource, nullOnMissing) { +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { if (!this.sourcesContent) { return null; } - const index = this._findSourceIndex(aSource); + var index = this._findSourceIndex(aSource); if (index >= 0) { return this.sourcesContent[index]; } - let relativeSource = aSource; + var relativeSource = aSource; if (this.sourceRoot != null) { relativeSource = util.relative(this.sourceRoot, relativeSource); } - let url; + var url; if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) { // XXX: file:// URIs and absolute paths lead to unexpected behavior for // many users. We can help them out when they expect file:// URIs to // behave like it would if they were running a local HTTP server. See // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - const fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]; + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] } if ((!url.path || url.path == "/") @@ -602,35 +749,37 @@ class BasicSourceMapConsumer extends SourceMapConsumer { if (nullOnMissing) { return null; } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; - throw new Error('"' + relativeSource + '" is not in the SourceMap.'); - } - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - generatedPositionFor(aArgs) { - let source = util.getArg(aArgs, "source"); +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); source = this._findSourceIndex(source); if (source < 0) { return { @@ -640,46 +789,29 @@ class BasicSourceMapConsumer extends SourceMapConsumer { }; } - const needle = { - source, - originalLine: util.getArg(aArgs, "line"), - originalColumn: util.getArg(aArgs, "column") + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') }; - if (needle.originalLine < 1) { - throw new Error("Line numbers must be >= 1"); - } + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); - if (needle.originalColumn < 0) { - throw new Error("Column numbers must be >= 0"); - } + if (index >= 0) { + var mapping = this._originalMappings[index]; - let bias = util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND); - if (bias == null) { - bias = SourceMapConsumer.GREATEST_LOWER_BOUND; - } - - let mapping; - this._wasm.withMappingCallback(m => mapping = m, () => { - this._wasm.exports.generated_location_for( - this._getMappingsPtr(), - needle.source, - needle.originalLine - 1, - needle.originalColumn, - bias - ); - }); - - if (mapping) { if (mapping.source === needle.source) { - let lastColumn = mapping.lastGeneratedColumn; - if (this._computedColumnSpans && lastColumn === null) { - lastColumn = Infinity; - } return { - line: util.getArg(mapping, "generatedLine", null), - column: util.getArg(mapping, "generatedColumn", null), - lastColumn, + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }; } } @@ -689,10 +821,8 @@ class BasicSourceMapConsumer extends SourceMapConsumer { column: null, lastColumn: null }; - } -} + }; -BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; exports.BasicSourceMapConsumer = BasicSourceMapConsumer; /** @@ -744,191 +874,116 @@ exports.BasicSourceMapConsumer = BasicSourceMapConsumer; * * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt */ -class IndexedSourceMapConsumer extends SourceMapConsumer { - constructor(aSourceMap, aSourceMapURL) { - return super(INTERNAL).then(that => { - let sourceMap = aSourceMap; - if (typeof aSourceMap === "string") { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - const version = util.getArg(sourceMap, "version"); - const sections = util.getArg(sourceMap, "sections"); - - if (version != that._version) { - throw new Error("Unsupported version: " + version); - } - - that._sources = new ArraySet(); - that._names = new ArraySet(); - that.__generatedMappings = null; - that.__originalMappings = null; - that.__generatedMappingsUnsorted = null; - that.__originalMappingsUnsorted = null; - - let lastOffset = { - line: -1, - column: 0 - }; - return Promise.all(sections.map(s => { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error("Support for url field in sections not implemented."); - } - const offset = util.getArg(s, "offset"); - const offsetLine = util.getArg(offset, "line"); - const offsetColumn = util.getArg(offset, "column"); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error("Section offsets must be ordered and non-overlapping."); - } - lastOffset = offset; - - const cons = new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL); - return cons.then(consumer => { - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer - }; - }); - })).then(s => { - that._sections = s; - return that; - }); - }); +function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); } - // `__generatedMappings` and `__originalMappings` are arrays that hold the - // parsed mapping coordinates from the source map's "mappings" attribute. They - // are lazily instantiated, accessed via the `_generatedMappings` and - // `_originalMappings` getters respectively, and we only parse the mappings - // and create these arrays once queried for a source location. We jump through - // these hoops because there can be many thousands of mappings, and parsing - // them is expensive, so we only want to do it if we must. - // - // Each object in the arrays is of the form: - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `_generatedMappings` is ordered by the generated positions. - // - // `_originalMappings` is ordered by the original positions. - get _generatedMappings() { - if (!this.__generatedMappings) { - this._sortGeneratedMappings(); + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); - return this.__generatedMappings; - } - - get _originalMappings() { - if (!this.__originalMappings) { - this._sortOriginalMappings(); + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); } + lastOffset = offset; - return this.__originalMappings; - } - - get _generatedMappingsUnsorted() { - if (!this.__generatedMappingsUnsorted) { - this._parseMappings(this._mappings, this.sourceRoot); + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) } + }); +} - return this.__generatedMappingsUnsorted; - } +IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - get _originalMappingsUnsorted() { - if (!this.__originalMappingsUnsorted) { - this._parseMappings(this._mappings, this.sourceRoot); - } +/** + * The version of the source mapping spec that we are consuming. + */ +IndexedSourceMapConsumer.prototype._version = 3; - return this.__originalMappingsUnsorted; - } - - _sortGeneratedMappings() { - const mappings = this._generatedMappingsUnsorted; - mappings.sort(util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = mappings; - } - - _sortOriginalMappings() { - const mappings = this._originalMappingsUnsorted; - mappings.sort(util.compareByOriginalPositions); - this.__originalMappings = mappings; - } - - /** - * The list of original sources. - */ - get sources() { - const sources = []; - for (let i = 0; i < this._sections.length; i++) { - for (let j = 0; j < this._sections[i].consumer.sources.length; j++) { +/** + * The list of original sources. + */ +Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { sources.push(this._sections[i].consumer.sources[j]); } } return sources; } +}); - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. The line number - * is 1-based. - * - column: The column number in the generated source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. The - * line number is 1-based. - * - column: The column number in the original source, or null. The - * column number is 0-based. - * - name: The original identifier, or null. - */ - originalPositionFor(aArgs) { - const needle = { - generatedLine: util.getArg(aArgs, "line"), - generatedColumn: util.getArg(aArgs, "column") +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') }; // Find the section containing the generated position we're trying to map // to an original position. - const sectionIndex = binarySearch.search(needle, this._sections, - function(aNeedle, section) { - const cmp = aNeedle.generatedLine - section.generatedOffset.generatedLine; + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; if (cmp) { return cmp; } - return (aNeedle.generatedColumn - + return (needle.generatedColumn - section.generatedOffset.generatedColumn); }); - const section = this._sections[sectionIndex]; + var section = this._sections[sectionIndex]; if (!section) { return { @@ -948,28 +1003,30 @@ class IndexedSourceMapConsumer extends SourceMapConsumer { : 0), bias: aArgs.bias }); - } + }; - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - hasContentsOfAllSources() { - return this._sections.every(function(s) { +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { return s.consumer.hasContentsOfAllSources(); }); - } + }; - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - sourceContentFor(aSource, nullOnMissing) { - for (let i = 0; i < this._sections.length; i++) { - const section = this._sections[i]; +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; - const content = section.consumer.sourceContentFor(aSource, true); + var content = section.consumer.sourceContentFor(aSource, true); if (content) { return content; } @@ -977,39 +1034,42 @@ class IndexedSourceMapConsumer extends SourceMapConsumer { if (nullOnMissing) { return null; } - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. The line number - * is 1-based. - * - column: The column number in the original source. The column - * number is 0-based. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. The - * line number is 1-based. - * - column: The column number in the generated source, or null. - * The column number is 0-based. - */ - generatedPositionFor(aArgs) { - for (let i = 0; i < this._sections.length; i++) { - const section = this._sections[i]; +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; // Only consider this section if the requested source is in the list of // sources of the consumer. - if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) { + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { continue; } - const generatedPosition = section.consumer.generatedPositionFor(aArgs); + var generatedPosition = section.consumer.generatedPositionFor(aArgs); if (generatedPosition) { - const ret = { + var ret = { line: generatedPosition.line + (section.generatedOffset.generatedLine - 1), column: generatedPosition.column + @@ -1025,45 +1085,41 @@ class IndexedSourceMapConsumer extends SourceMapConsumer { line: null, column: null }; - } + }; - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - _parseMappings(aStr, aSourceRoot) { - const generatedMappings = this.__generatedMappingsUnsorted = []; - const originalMappings = this.__originalMappingsUnsorted = []; - for (let i = 0; i < this._sections.length; i++) { - const section = this._sections[i]; +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; - const sectionMappings = []; - section.consumer.eachMapping(m => sectionMappings.push(m)); - - for (let j = 0; j < sectionMappings.length; j++) { - const mapping = sectionMappings[j]; - - // TODO: test if null is correct here. The original code used - // `source`, which would actually have gotten used as null because - // var's get hoisted. - // See: https://github.com/mozilla/source-map/issues/333 - let source = util.computeSourceURL(section.consumer.sourceRoot, null, this._sourceMapURL); + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); this._sources.add(source); source = this._sources.indexOf(source); - let name = null; + var name = null; if (mapping.name) { - this._names.add(mapping.name); - name = this._names.indexOf(mapping.name); + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); } // The mappings coming from the consumer for the section have // generated positions relative to the start of the section, so we // need to offset them to be relative to the start of the concatenated // generated file. - const adjustedMapping = { - source, + var adjustedMapping = { + source: source, generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1), generatedColumn: mapping.generatedColumn + @@ -1072,183 +1128,18 @@ class IndexedSourceMapConsumer extends SourceMapConsumer { : 0), originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, - name + name: name }; - generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === "number") { - originalMappings.push(adjustedMapping); - } - } - } - } - - eachMapping(aCallback, aContext, aOrder) { - const context = aContext || null; - const order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - let mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - const sourceRoot = this.sourceRoot; - mappings.map(function(mapping) { - let source = null; - if (mapping.source !== null) { - source = this._sources.at(mapping.source); - source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); - } - return { - source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - } - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - _findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError("Line must be greater than or equal to 1, got " - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError("Column must be greater than or equal to 0, got " - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - } - - allGeneratedPositionsFor(aArgs) { - const line = util.getArg(aArgs, "line"); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - const needle = { - source: util.getArg(aArgs, "source"), - originalLine: line, - originalColumn: util.getArg(aArgs, "column", 0) - }; - - needle.source = this._findSourceIndex(needle.source); - if (needle.source < 0) { - return []; - } - - if (needle.originalLine < 1) { - throw new Error("Line numbers must be >= 1"); - } - - if (needle.originalColumn < 0) { - throw new Error("Column numbers must be >= 0"); - } - - const mappings = []; - - let index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - let mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - const originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - let lastColumn = mapping.lastGeneratedColumn; - if (this._computedColumnSpans && lastColumn === null) { - lastColumn = Infinity; - } - mappings.push({ - line: util.getArg(mapping, "generatedLine", null), - column: util.getArg(mapping, "generatedColumn", null), - lastColumn, - }); - - mapping = this._originalMappings[++index]; - } - } else { - const originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - let lastColumn = mapping.lastGeneratedColumn; - if (this._computedColumnSpans && lastColumn === null) { - lastColumn = Infinity; - } - mappings.push({ - line: util.getArg(mapping, "generatedLine", null), - column: util.getArg(mapping, "generatedColumn", null), - lastColumn, - }); - - mapping = this._originalMappings[++index]; + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); } } } - return mappings; - } + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; - destroy() { - for (let i = 0; i < this._sections.length; i++) { - this._sections[i].consumer.destroy(); - } - } -} exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; - -/* - * Cheat to get around inter-twingled classes. `factory()` can be at the end - * where it has access to non-hoisted classes, but it gets hoisted itself. - */ -function _factory(aSourceMap, aSourceMapURL) { - let sourceMap = aSourceMap; - if (typeof aSourceMap === "string") { - sourceMap = util.parseSourceMapInput(aSourceMap); - } - - const consumer = sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) - : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); - return Promise.resolve(consumer); -} - -function _factoryBSM(aSourceMap, aSourceMapURL) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); -} diff --git a/node_modules/terser/node_modules/source-map/lib/source-map-generator.js b/node_modules/terser/node_modules/source-map/lib/source-map-generator.js index 8111e06..508bcfb 100644 --- a/node_modules/terser/node_modules/source-map/lib/source-map-generator.js +++ b/node_modules/terser/node_modules/source-map/lib/source-map-generator.js @@ -5,10 +5,10 @@ * http://opensource.org/licenses/BSD-3-Clause */ -const base64VLQ = require("./base64-vlq"); -const util = require("./util"); -const ArraySet = require("./array-set").ArraySet; -const MappingList = require("./mapping-list").MappingList; +var base64VLQ = require('./base64-vlq'); +var util = require('./util'); +var ArraySet = require('./array-set').ArraySet; +var MappingList = require('./mapping-list').MappingList; /** * An instance of the SourceMapGenerator represents a source map which is @@ -18,33 +18,35 @@ const MappingList = require("./mapping-list").MappingList; * - file: The filename of the generated source. * - sourceRoot: A root for all relative URLs in this source map. */ -class SourceMapGenerator { - constructor(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, "file", null); - this._sourceRoot = util.getArg(aArgs, "sourceRoot", null); - this._skipValidation = util.getArg(aArgs, "skipValidation", false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; +function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; +} - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - static fromSourceMap(aSourceMapConsumer) { - const sourceRoot = aSourceMapConsumer.sourceRoot; - const generator = new SourceMapGenerator({ +SourceMapGenerator.prototype._version = 3; + +/** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ +SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ file: aSourceMapConsumer.file, - sourceRoot + sourceRoot: sourceRoot }); - aSourceMapConsumer.eachMapping(function(mapping) { - const newMapping = { + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { generated: { line: mapping.generatedLine, column: mapping.generatedColumn @@ -69,8 +71,8 @@ class SourceMapGenerator { generator.addMapping(newMapping); }); - aSourceMapConsumer.sources.forEach(function(sourceFile) { - let sourceRelative = sourceFile; + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; if (sourceRoot !== null) { sourceRelative = util.relative(sourceRoot, sourceFile); } @@ -79,29 +81,30 @@ class SourceMapGenerator { generator._sources.add(sourceRelative); } - const content = aSourceMapConsumer.sourceContentFor(sourceFile); + var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { generator.setSourceContent(sourceFile, content); } }); return generator; - } + }; - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - addMapping(aArgs) { - const generated = util.getArg(aArgs, "generated"); - const original = util.getArg(aArgs, "original", null); - let source = util.getArg(aArgs, "source", null); - let name = util.getArg(aArgs, "name", null); +/** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ +SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); if (!this._skipValidation) { this._validateMapping(generated, original, source, name); @@ -126,16 +129,17 @@ class SourceMapGenerator { generatedColumn: generated.column, originalLine: original != null && original.line, originalColumn: original != null && original.column, - source, - name + source: source, + name: name }); - } + }; - /** - * Set the source content for a source file. - */ - setSourceContent(aSourceFile, aSourceContent) { - let source = aSourceFile; +/** + * Set the source content for a source file. + */ +SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; if (this._sourceRoot != null) { source = util.relative(this._sourceRoot, source); } @@ -155,53 +159,52 @@ class SourceMapGenerator { this._sourcesContents = null; } } - } + }; - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - let sourceFile = aSourceFile; +/** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ +SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; // If aSourceFile is omitted, we will use the file property of the SourceMap if (aSourceFile == null) { if (aSourceMapConsumer.file == null) { throw new Error( - "SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, " + + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + 'or the source map\'s "file" property. Both were omitted.' ); } sourceFile = aSourceMapConsumer.file; } - const sourceRoot = this._sourceRoot; + var sourceRoot = this._sourceRoot; // Make "sourceFile" relative if an absolute Url is passed. if (sourceRoot != null) { sourceFile = util.relative(sourceRoot, sourceFile); } // Applying the SourceMap can add and remove items from the sources and // the names array. - const newSources = this._mappings.toArray().length > 0 - ? new ArraySet() - : this._sources; - const newNames = new ArraySet(); + var newSources = new ArraySet(); + var newNames = new ArraySet(); // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function(mapping) { + this._mappings.unsortedForEach(function (mapping) { if (mapping.source === sourceFile && mapping.originalLine != null) { // Check if it can be mapped by the source map, then update the mapping. - const original = aSourceMapConsumer.originalPositionFor({ + var original = aSourceMapConsumer.originalPositionFor({ line: mapping.originalLine, column: mapping.originalColumn }); @@ -209,7 +212,7 @@ class SourceMapGenerator { // Copy mapping mapping.source = original.source; if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source); + mapping.source = util.join(aSourceMapPath, mapping.source) } if (sourceRoot != null) { mapping.source = util.relative(sourceRoot, mapping.source); @@ -222,12 +225,12 @@ class SourceMapGenerator { } } - const source = mapping.source; + var source = mapping.source; if (source != null && !newSources.has(source)) { newSources.add(source); } - const name = mapping.name; + var name = mapping.name; if (name != null && !newNames.has(name)) { newNames.add(name); } @@ -237,99 +240,107 @@ class SourceMapGenerator { this._names = newNames; // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function(srcFile) { - const content = aSourceMapConsumer.sourceContentFor(srcFile); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { if (aSourceMapPath != null) { - srcFile = util.join(aSourceMapPath, srcFile); + sourceFile = util.join(aSourceMapPath, sourceFile); } if (sourceRoot != null) { - srcFile = util.relative(sourceRoot, srcFile); + sourceFile = util.relative(sourceRoot, sourceFile); } - this.setSourceContent(srcFile, content); + this.setSourceContent(sourceFile, content); } }, this); - } + }; - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - _validateMapping(aGenerated, aOriginal, aSource, aName) { +/** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ +SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { // When aOriginal is truthy but has empty values for .line and .column, // it is most likely a programmer error. In this case we throw a very // specific error message to try to guide them the right way. // For example: https://github.com/Polymer/polymer-bundler/pull/519 - if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") { + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { throw new Error( - "original.line and original.column are not numbers -- you probably meant to omit " + - "the original mapping entirely and only map the generated position. If so, pass " + - "null for the original mapping instead of an object with empty or null values." + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' ); } - if (aGenerated && "line" in aGenerated && "column" in aGenerated + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) { // Case 1. - - } else if (aGenerated && "line" in aGenerated && "column" in aGenerated - && aOriginal && "line" in aOriginal && "column" in aOriginal + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) { // Cases 2 and 3. - - } else { - throw new Error("Invalid mapping: " + JSON.stringify({ + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ generated: aGenerated, source: aSource, original: aOriginal, name: aName })); } - } + }; - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - _serializeMappings() { - let previousGeneratedColumn = 0; - let previousGeneratedLine = 1; - let previousOriginalColumn = 0; - let previousOriginalLine = 0; - let previousName = 0; - let previousSource = 0; - let result = ""; - let next; - let mapping; - let nameIdx; - let sourceIdx; +/** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ +SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; - const mappings = this._mappings.toArray(); - for (let i = 0, len = mappings.length; i < len; i++) { + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { mapping = mappings[i]; - next = ""; + next = '' if (mapping.generatedLine !== previousGeneratedLine) { previousGeneratedColumn = 0; while (mapping.generatedLine !== previousGeneratedLine) { - next += ";"; + next += ';'; previousGeneratedLine++; } - } else if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; } - next += ","; } next += base64VLQ.encode(mapping.generatedColumn @@ -361,28 +372,30 @@ class SourceMapGenerator { } return result; - } + }; - _generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function(source) { +SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { if (!this._sourcesContents) { return null; } if (aSourceRoot != null) { source = util.relative(aSourceRoot, source); } - const key = util.toSetString(source); + var key = util.toSetString(source); return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; }, this); - } + }; - /** - * Externalize the source map. - */ - toJSON() { - const map = { +/** + * Externalize the source map. + */ +SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { version: this._version, sources: this._sources.toArray(), names: this._names.toArray(), @@ -399,15 +412,14 @@ class SourceMapGenerator { } return map; - } + }; - /** - * Render the source map being generated to a string. - */ - toString() { +/** + * Render the source map being generated to a string. + */ +SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { return JSON.stringify(this.toJSON()); - } -} + }; -SourceMapGenerator.prototype._version = 3; exports.SourceMapGenerator = SourceMapGenerator; diff --git a/node_modules/terser/node_modules/source-map/lib/source-node.js b/node_modules/terser/node_modules/source-map/lib/source-node.js index 8a7a157..8bcdbe3 100644 --- a/node_modules/terser/node_modules/source-map/lib/source-node.js +++ b/node_modules/terser/node_modules/source-map/lib/source-node.js @@ -5,20 +5,20 @@ * http://opensource.org/licenses/BSD-3-Clause */ -const SourceMapGenerator = require("./source-map-generator").SourceMapGenerator; -const util = require("./util"); +var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; +var util = require('./util'); // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other // operating systems these days (capturing the result). -const REGEX_NEWLINE = /(\r?\n)/; +var REGEX_NEWLINE = /(\r?\n)/; // Newline character code for charCodeAt() comparisons -const NEWLINE_CODE = 10; +var NEWLINE_CODE = 10; // Private symbol for identifying `SourceNode`s when multiple versions of // the source-map library are loaded. This MUST NOT CHANGE across // versions! -const isSourceNode = "$$$isSourceNode$$$"; +var isSourceNode = "$$$isSourceNode$$$"; /** * SourceNodes provide a way to abstract over interpolating/concatenating @@ -32,41 +32,41 @@ const isSourceNode = "$$$isSourceNode$$$"; * generated JS, or other SourceNodes. * @param aName The original identifier. */ -class SourceNode { - constructor(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); - } +function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); +} - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ - static fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { +/** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ +SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { // The SourceNode we want to fill with the generated code // and the SourceMap - const node = new SourceNode(); + var node = new SourceNode(); // All even indices of this array are one line of the generated code, // while all odd indices are the newlines between two adjacent lines // (since `REGEX_NEWLINE` captures its match). // Processed fragments are accessed by calling `shiftNextLine`. - const remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - let remainingLinesIndex = 0; - const shiftNextLine = function() { - const lineContents = getNextLine(); + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); // The last line of a file might not have a newline. - const newLine = getNextLine() || ""; + var newLine = getNextLine() || ""; return lineContents + newLine; function getNextLine() { @@ -76,15 +76,14 @@ class SourceNode { }; // We need to remember the position of "remainingLines" - let lastGeneratedLine = 1, lastGeneratedColumn = 0; + var lastGeneratedLine = 1, lastGeneratedColumn = 0; // The generate SourceNodes we need a code range. // To extract it current and last mapping is used. // Here we store the last mapping. - let lastMapping = null; - let nextLine; + var lastMapping = null; - aSourceMapConsumer.eachMapping(function(mapping) { + aSourceMapConsumer.eachMapping(function (mapping) { if (lastMapping !== null) { // We add the code from "lastMapping" to "mapping": // First check if there is a new line in between. @@ -98,8 +97,8 @@ class SourceNode { // There is no new line in between. // Associate the code between "lastGeneratedColumn" and // "mapping.generatedColumn" with "lastMapping" - nextLine = remainingLines[remainingLinesIndex] || ""; - const code = nextLine.substr(0, mapping.generatedColumn - + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn); remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn); @@ -118,7 +117,7 @@ class SourceNode { lastGeneratedLine++; } if (lastGeneratedColumn < mapping.generatedColumn) { - nextLine = remainingLines[remainingLinesIndex] || ""; + var nextLine = remainingLines[remainingLinesIndex] || ''; node.add(nextLine.substr(0, mapping.generatedColumn)); remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); lastGeneratedColumn = mapping.generatedColumn; @@ -136,8 +135,8 @@ class SourceNode { } // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function(sourceFile) { - const content = aSourceMapConsumer.sourceContentFor(sourceFile); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { if (aRelativePath != null) { sourceFile = util.join(aRelativePath, sourceFile); @@ -152,7 +151,7 @@ class SourceNode { if (mapping === null || mapping.source === undefined) { node.add(code); } else { - const source = aRelativePath + var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source; node.add(new SourceNode(mapping.originalLine, @@ -162,182 +161,230 @@ class SourceNode { mapping.name)); } } - } + }; - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function(chunk) { - this.add(chunk); - }, this); - } else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); +/** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); } - return this; } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (let i = aChunk.length - 1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); +/** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); } - return this; } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - walk(aFn) { - let chunk; - for (let i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } else if (chunk !== "") { +/** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); + line: this.line, + column: this.column, + name: this.name }); } } } +}; - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - join(aSep) { - let newChildren; - let i; - const len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len - 1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } +/** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ +SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { newChildren.push(this.children[i]); - this.children = newChildren; + newChildren.push(aSep); } - return this; + newChildren.push(this.children[i]); + this.children = newChildren; } + return this; +}; - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - replaceRight(aPattern, aReplacement) { - const lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } else if (typeof lastChild === "string") { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } else { - this.children.push("".replace(aPattern, aReplacement)); - } - return this; +/** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ +SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; +}; - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - setSourceContent(aSourceFile, aSourceContent) { +/** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ +SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - } + }; - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - walkSourceContents(aFn) { - for (let i = 0, len = this.children.length; i < len; i++) { +/** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { if (this.children[i][isSourceNode]) { this.children[i].walkSourceContents(aFn); } } - const sources = Object.keys(this.sourceContents); - for (let i = 0, len = sources.length; i < len; i++) { + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); } - } + }; - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - toString() { - let str = ""; - this.walk(function(chunk) { - str += chunk; - }); - return str; - } +/** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ +SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; +}; - /** - * Returns the string representation of this source node along with a source - * map. - */ - toStringWithSourceMap(aArgs) { - const generated = { - code: "", - line: 1, - column: 0 - }; - const map = new SourceMapGenerator(aArgs); - let sourceMappingActive = false; - let lastOriginalSource = null; - let lastOriginalLine = null; - let lastOriginalColumn = null; - let lastOriginalName = null; - this.walk(function(chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if (lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { +/** + * Returns the string representation of this source node along with a source + * map. + */ +SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { map.addMapping({ source: original.source, original: { @@ -351,54 +398,16 @@ class SourceNode { name: original.name }); } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; + } else { + generated.column++; } - for (let idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function(sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); - return { code: generated.code, map }; - } -} + return { code: generated.code, map: map }; +}; exports.SourceNode = SourceNode; diff --git a/node_modules/terser/node_modules/source-map/lib/util.js b/node_modules/terser/node_modules/source-map/lib/util.js index 35bd93d..3ca92e5 100644 --- a/node_modules/terser/node_modules/source-map/lib/util.js +++ b/node_modules/terser/node_modules/source-map/lib/util.js @@ -20,17 +20,17 @@ function getArg(aArgs, aName, aDefaultValue) { return aArgs[aName]; } else if (arguments.length === 3) { return aDefaultValue; - } + } else { throw new Error('"' + aName + '" is a required argument.'); - + } } exports.getArg = getArg; -const urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; -const dataUrlRegexp = /^data:.+\,.+$/; +var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; +var dataUrlRegexp = /^data:.+\,.+$/; function urlParse(aUrl) { - const match = aUrl.match(urlRegexp); + var match = aUrl.match(urlRegexp); if (!match) { return null; } @@ -45,19 +45,19 @@ function urlParse(aUrl) { exports.urlParse = urlParse; function urlGenerate(aParsedUrl) { - let url = ""; + var url = ''; if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ":"; + url += aParsedUrl.scheme + ':'; } - url += "//"; + url += '//'; if (aParsedUrl.auth) { - url += aParsedUrl.auth + "@"; + url += aParsedUrl.auth + '@'; } if (aParsedUrl.host) { url += aParsedUrl.host; } if (aParsedUrl.port) { - url += ":" + aParsedUrl.port; + url += ":" + aParsedUrl.port } if (aParsedUrl.path) { url += aParsedUrl.path; @@ -66,43 +66,6 @@ function urlGenerate(aParsedUrl) { } exports.urlGenerate = urlGenerate; -const MAX_CACHED_INPUTS = 32; - -/** - * Takes some function `f(input) -> result` and returns a memoized version of - * `f`. - * - * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The - * memoization is a dumb-simple, linear least-recently-used cache. - */ -function lruMemoize(f) { - const cache = []; - - return function(input) { - for (let i = 0; i < cache.length; i++) { - if (cache[i].input === input) { - const temp = cache[0]; - cache[0] = cache[i]; - cache[i] = temp; - return cache[0].result; - } - } - - const result = f(input); - - cache.unshift({ - input, - result, - }); - - if (cache.length > MAX_CACHED_INPUTS) { - cache.pop(); - } - - return result; - }; -} - /** * Normalizes a path, or the path portion of a URL: * @@ -114,45 +77,26 @@ function lruMemoize(f) { * * @param aPath The path or url to normalize. */ -const normalize = lruMemoize(function normalize(aPath) { - let path = aPath; - const url = urlParse(aPath); +function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); if (url) { if (!url.path) { return aPath; } path = url.path; } - const isAbsolute = exports.isAbsolute(path); + var isAbsolute = exports.isAbsolute(path); - // Split the path into parts between `/` characters. This is much faster than - // using `.split(/\/+/g)`. - const parts = []; - let start = 0; - let i = 0; - while (true) { - start = i; - i = path.indexOf("/", start); - if (i === -1) { - parts.push(path.slice(start)); - break; - } else { - parts.push(path.slice(start, i)); - while (i < path.length && path[i] === "/") { - i++; - } - } - } - - let up = 0; - for (i = parts.length - 1; i >= 0; i--) { - const part = parts[i]; - if (part === ".") { + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { parts.splice(i, 1); - } else if (part === "..") { + } else if (part === '..') { up++; } else if (up > 0) { - if (part === "") { + if (part === '') { // The first part is blank if the path is absolute. Trying to go // above the root is a no-op. Therefore we can remove all '..' parts // directly after the root. @@ -164,10 +108,10 @@ const normalize = lruMemoize(function normalize(aPath) { } } } - path = parts.join("/"); + path = parts.join('/'); - if (path === "") { - path = isAbsolute ? "/" : "."; + if (path === '') { + path = isAbsolute ? '/' : '.'; } if (url) { @@ -175,7 +119,7 @@ const normalize = lruMemoize(function normalize(aPath) { return urlGenerate(url); } return path; -}); +} exports.normalize = normalize; /** @@ -201,10 +145,10 @@ function join(aRoot, aPath) { if (aPath === "") { aPath = "."; } - const aPathUrl = urlParse(aPath); - const aRootUrl = urlParse(aRoot); + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); if (aRootUrl) { - aRoot = aRootUrl.path || "/"; + aRoot = aRootUrl.path || '/'; } // `join(foo, '//www.example.org')` @@ -225,9 +169,9 @@ function join(aRoot, aPath) { return urlGenerate(aRootUrl); } - const joined = aPath.charAt(0) === "/" + var joined = aPath.charAt(0) === '/' ? aPath - : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath); + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); if (aRootUrl) { aRootUrl.path = joined; @@ -237,8 +181,8 @@ function join(aRoot, aPath) { } exports.join = join; -exports.isAbsolute = function(aPath) { - return aPath.charAt(0) === "/" || urlRegexp.test(aPath); +exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); }; /** @@ -252,15 +196,15 @@ function relative(aRoot, aPath) { aRoot = "."; } - aRoot = aRoot.replace(/\/$/, ""); + aRoot = aRoot.replace(/\/$/, ''); // It is possible for the path to be above the root. In this case, simply // checking whether the root is a prefix of the path won't work. Instead, we // need to remove components from the root one by one, until either we find // a prefix that fits, or we run out of components to remove. - let level = 0; - while (aPath.indexOf(aRoot + "/") !== 0) { - const index = aRoot.lastIndexOf("/"); + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); if (index < 0) { return aPath; } @@ -281,12 +225,12 @@ function relative(aRoot, aPath) { } exports.relative = relative; -const supportsNullProto = (function() { - const obj = Object.create(null); - return !("__proto__" in obj); +var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); }()); -function identity(s) { +function identity (s) { return s; } @@ -301,7 +245,7 @@ function identity(s) { */ function toSetString(aStr) { if (isProtoString(aStr)) { - return "$" + aStr; + return '$' + aStr; } return aStr; @@ -322,13 +266,12 @@ function isProtoString(s) { return false; } - const length = s.length; + var length = s.length; if (length < 9 /* "__proto__".length */) { return false; } - /* eslint-disable no-multi-spaces */ if (s.charCodeAt(length - 1) !== 95 /* '_' */ || s.charCodeAt(length - 2) !== 95 /* '_' */ || s.charCodeAt(length - 3) !== 111 /* 'o' */ || @@ -340,9 +283,8 @@ function isProtoString(s) { s.charCodeAt(length - 9) !== 95 /* '_' */) { return false; } - /* eslint-enable no-multi-spaces */ - for (let i = length - 10; i >= 0; i--) { + for (var i = length - 10; i >= 0; i--) { if (s.charCodeAt(i) !== 36 /* '$' */) { return false; } @@ -360,7 +302,7 @@ function isProtoString(s) { * stubbed out mapping. */ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - let cmp = strcmp(mappingA.source, mappingB.source); + var cmp = strcmp(mappingA.source, mappingB.source); if (cmp !== 0) { return cmp; } @@ -399,7 +341,7 @@ exports.compareByOriginalPositions = compareByOriginalPositions; * mapping with a stubbed out mapping. */ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - let cmp = mappingA.generatedLine - mappingB.generatedLine; + var cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } @@ -453,7 +395,7 @@ function strcmp(aStr1, aStr2) { * the generated positions are compared. */ function compareByGeneratedPositionsInflated(mappingA, mappingB) { - let cmp = mappingA.generatedLine - mappingB.generatedLine; + var cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } @@ -488,7 +430,7 @@ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflate * JSON. */ function parseSourceMapInput(str) { - return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, "")); + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); } exports.parseSourceMapInput = parseSourceMapInput; @@ -497,12 +439,12 @@ exports.parseSourceMapInput = parseSourceMapInput; * URL, and the source map's URL. */ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { - sourceURL = sourceURL || ""; + sourceURL = sourceURL || ''; if (sourceRoot) { // This follows what Chrome does. - if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") { - sourceRoot += "/"; + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; } // The spec says: // Line 4: An optional source root, useful for relocating source @@ -527,13 +469,13 @@ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { // “sourceRoot”, the sources are resolved relative to the // SourceMap (like resolving script src in a html document). if (sourceMapURL) { - const parsed = urlParse(sourceMapURL); + var parsed = urlParse(sourceMapURL); if (!parsed) { throw new Error("sourceMapURL could not be parsed"); } if (parsed.path) { // Strip the last path component, but keep the "/". - const index = parsed.path.lastIndexOf("/"); + var index = parsed.path.lastIndexOf('/'); if (index >= 0) { parsed.path = parsed.path.substring(0, index + 1); } diff --git a/node_modules/terser/node_modules/source-map/lib/wasm.js b/node_modules/terser/node_modules/source-map/lib/wasm.js deleted file mode 100644 index 88b18be..0000000 --- a/node_modules/terser/node_modules/source-map/lib/wasm.js +++ /dev/null @@ -1,107 +0,0 @@ -const readWasm = require("../lib/read-wasm"); - -/** - * Provide the JIT with a nice shape / hidden class. - */ -function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.lastGeneratedColumn = null; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; -} - -let cachedWasm = null; - -module.exports = function wasm() { - if (cachedWasm) { - return cachedWasm; - } - - const callbackStack = []; - - cachedWasm = readWasm().then(buffer => { - return WebAssembly.instantiate(buffer, { - env: { - mapping_callback( - generatedLine, - generatedColumn, - - hasLastGeneratedColumn, - lastGeneratedColumn, - - hasOriginal, - source, - originalLine, - originalColumn, - - hasName, - name - ) { - const mapping = new Mapping(); - // JS uses 1-based line numbers, wasm uses 0-based. - mapping.generatedLine = generatedLine + 1; - mapping.generatedColumn = generatedColumn; - - if (hasLastGeneratedColumn) { - // JS uses inclusive last generated column, wasm uses exclusive. - mapping.lastGeneratedColumn = lastGeneratedColumn - 1; - } - - if (hasOriginal) { - mapping.source = source; - // JS uses 1-based line numbers, wasm uses 0-based. - mapping.originalLine = originalLine + 1; - mapping.originalColumn = originalColumn; - - if (hasName) { - mapping.name = name; - } - } - - callbackStack[callbackStack.length - 1](mapping); - }, - - start_all_generated_locations_for() { console.time("all_generated_locations_for"); }, - end_all_generated_locations_for() { console.timeEnd("all_generated_locations_for"); }, - - start_compute_column_spans() { console.time("compute_column_spans"); }, - end_compute_column_spans() { console.timeEnd("compute_column_spans"); }, - - start_generated_location_for() { console.time("generated_location_for"); }, - end_generated_location_for() { console.timeEnd("generated_location_for"); }, - - start_original_location_for() { console.time("original_location_for"); }, - end_original_location_for() { console.timeEnd("original_location_for"); }, - - start_parse_mappings() { console.time("parse_mappings"); }, - end_parse_mappings() { console.timeEnd("parse_mappings"); }, - - start_sort_by_generated_location() { console.time("sort_by_generated_location"); }, - end_sort_by_generated_location() { console.timeEnd("sort_by_generated_location"); }, - - start_sort_by_original_location() { console.time("sort_by_original_location"); }, - end_sort_by_original_location() { console.timeEnd("sort_by_original_location"); }, - } - }); - }).then(Wasm => { - return { - exports: Wasm.instance.exports, - withMappingCallback: (mappingCallback, f) => { - callbackStack.push(mappingCallback); - try { - f(); - } finally { - callbackStack.pop(); - } - } - }; - }).then(null, e => { - cachedWasm = null; - throw e; - }); - - return cachedWasm; -}; diff --git a/node_modules/terser/node_modules/source-map/package.json b/node_modules/terser/node_modules/source-map/package.json index b944e8e..2333753 100644 --- a/node_modules/terser/node_modules/source-map/package.json +++ b/node_modules/terser/node_modules/source-map/package.json @@ -1,233 +1,76 @@ { - "_args": [ - [ - "source-map@0.7.3", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "source-map@0.7.3", - "_id": "source-map@0.7.3", - "_inBundle": false, - "_integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "_location": "/terser/source-map", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "source-map@0.7.3", - "name": "source-map", - "escapedName": "source-map", - "rawSpec": "0.7.3", - "saveSpec": null, - "fetchSpec": "0.7.3" - }, - "_requiredBy": [ - "/terser" - ], - "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "_spec": "0.7.3", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Nick Fitzgerald", - "email": "nfitzgerald@mozilla.com" - }, - "bugs": { - "url": "https://github.com/mozilla/source-map/issues" - }, - "contributors": [ - { - "name": "Tobias Koppers", - "email": "tobias.koppers@googlemail.com" - }, - { - "name": "Duncan Beevers", - "email": "duncan@dweebd.com" - }, - { - "name": "Stephen Crane", - "email": "scrane@mozilla.com" - }, - { - "name": "Ryan Seddon", - "email": "seddon.ryan@gmail.com" - }, - { - "name": "Miles Elam", - "email": "miles.elam@deem.com" - }, - { - "name": "Mihai Bazon", - "email": "mihai.bazon@gmail.com" - }, - { - "name": "Michael Ficarra", - "email": "github.public.email@michael.ficarra.me" - }, - { - "name": "Todd Wolfson", - "email": "todd@twolfson.com" - }, - { - "name": "Alexander Solovyov", - "email": "alexander@solovyov.net" - }, - { - "name": "Felix Gnass", - "email": "fgnass@gmail.com" - }, - { - "name": "Conrad Irwin", - "email": "conrad.irwin@gmail.com" - }, - { - "name": "usrbincc", - "email": "usrbincc@yahoo.com" - }, - { - "name": "David Glasser", - "email": "glasser@davidglasser.net" - }, - { - "name": "Chase Douglas", - "email": "chase@newrelic.com" - }, - { - "name": "Evan Wallace", - "email": "evan.exe@gmail.com" - }, - { - "name": "Heather Arthur", - "email": "fayearthur@gmail.com" - }, - { - "name": "Hugh Kennedy", - "email": "hughskennedy@gmail.com" - }, - { - "name": "David Glasser", - "email": "glasser@davidglasser.net" - }, - { - "name": "Simon Lydell", - "email": "simon.lydell@gmail.com" - }, - { - "name": "Jmeas Smith", - "email": "jellyes2@gmail.com" - }, - { - "name": "Michael Z Goddard", - "email": "mzgoddard@gmail.com" - }, - { - "name": "azu", - "email": "azu@users.noreply.github.com" - }, - { - "name": "John Gozde", - "email": "john@gozde.ca" - }, - { - "name": "Adam Kirkton", - "email": "akirkton@truefitinnovation.com" - }, - { - "name": "Chris Montgomery", - "email": "christopher.montgomery@dowjones.com" - }, - { - "name": "J. Ryan Stinnett", - "email": "jryans@gmail.com" - }, - { - "name": "Jack Herrington", - "email": "jherrington@walmartlabs.com" - }, - { - "name": "Chris Truter", - "email": "jeffpalentine@gmail.com" - }, - { - "name": "Daniel Espeset", - "email": "daniel@danielespeset.com" - }, - { - "name": "Jamie Wong", - "email": "jamie.lf.wong@gmail.com" - }, - { - "name": "Eddy Bruël", - "email": "ejpbruel@mozilla.com" - }, - { - "name": "Hawken Rives", - "email": "hawkrives@gmail.com" - }, - { - "name": "Gilad Peleg", - "email": "giladp007@gmail.com" - }, - { - "name": "djchie", - "email": "djchie.dev@gmail.com" - }, - { - "name": "Gary Ye", - "email": "garysye@gmail.com" - }, - { - "name": "Nicolas Lalevée", - "email": "nicolas.lalevee@hibnet.org" - } - ], + "name": "source-map", "description": "Generates and consumes source maps", - "devDependencies": { - "doctoc": "^0.15.0", - "eslint": "^4.19.1", - "live-server": "^1.2.0", - "npm-run-all": "^4.1.2", - "nyc": "^11.7.1", - "watch": "^1.0.2", - "webpack": "^3.10" - }, - "engines": { - "node": ">= 8" + "version": "0.6.1", + "homepage": "https://github.com/mozilla/source-map", + "author": "Nick Fitzgerald ", + "contributors": [ + "Tobias Koppers ", + "Duncan Beevers ", + "Stephen Crane ", + "Ryan Seddon ", + "Miles Elam ", + "Mihai Bazon ", + "Michael Ficarra ", + "Todd Wolfson ", + "Alexander Solovyov ", + "Felix Gnass ", + "Conrad Irwin ", + "usrbincc ", + "David Glasser ", + "Chase Douglas ", + "Evan Wallace ", + "Heather Arthur ", + "Hugh Kennedy ", + "David Glasser ", + "Simon Lydell ", + "Jmeas Smith ", + "Michael Z Goddard ", + "azu ", + "John Gozde ", + "Adam Kirkton ", + "Chris Montgomery ", + "J. Ryan Stinnett ", + "Jack Herrington ", + "Chris Truter ", + "Daniel Espeset ", + "Jamie Wong ", + "Eddy Bruël ", + "Hawken Rives ", + "Gilad Peleg ", + "djchie ", + "Gary Ye ", + "Nicolas Lalevée " + ], + "repository": { + "type": "git", + "url": "http://github.com/mozilla/source-map.git" }, + "main": "./source-map.js", "files": [ "source-map.js", "source-map.d.ts", "lib/", - "dist/source-map.js" + "dist/source-map.debug.js", + "dist/source-map.js", + "dist/source-map.min.js", + "dist/source-map.min.js.map" ], - "homepage": "https://github.com/mozilla/source-map", + "engines": { + "node": ">=0.10.0" + }, "license": "BSD-3-Clause", - "main": "./source-map.js", - "name": "source-map", - "nyc": { - "reporter": "html" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/mozilla/source-map.git" - }, "scripts": { + "test": "npm run build && node test/run-tests.js", "build": "webpack --color", - "clean": "rm -rf coverage .nyc_output", - "coverage": "nyc node test/run-tests.js", - "dev": "npm-run-all -p --silent dev:*", - "dev:live": "live-server --port=4103 --ignorePattern='(js|css|png)$' coverage", - "dev:watch": "watch 'npm run coverage' lib/ test/", - "lint": "eslint *.js lib/ test/", - "prebuild": "npm run lint", - "precoverage": "npm run build", - "predev": "npm run setup", - "pretest": "npm run build", - "setup": "mkdir -p coverage && cp -n .waiting.html coverage/index.html || true", - "test": "node test/run-tests.js", "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" }, - "types": "./source-map.d.ts", + "devDependencies": { + "doctoc": "^0.15.0", + "webpack": "^1.12.0" + }, "typings": "source-map", - "version": "0.7.3" -} + "__npminstall_done": "Sun Sep 06 2020 16:10:14 GMT+0800 (中国标准时间)", + "_from": "source-map@0.6.1", + "_resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz" +} \ No newline at end of file diff --git a/node_modules/terser/node_modules/source-map/source-map.d.ts b/node_modules/terser/node_modules/source-map/source-map.d.ts index 2459391..8f972b0 100644 --- a/node_modules/terser/node_modules/source-map/source-map.d.ts +++ b/node_modules/terser/node_modules/source-map/source-map.d.ts @@ -1,35 +1,14 @@ -// Type definitions for source-map 0.7 -// Project: https://github.com/mozilla/source-map -// Definitions by: Morten Houston Ludvigsen , -// Ron Buckton , -// John Vilk -// Definitions: https://github.com/mozilla/source-map -export type SourceMapUrl = string; - export interface StartOfSourceMap { file?: string; sourceRoot?: string; - skipValidation?: boolean; } -export interface RawSourceMap { - version: number; +export interface RawSourceMap extends StartOfSourceMap { + version: string; sources: string[]; names: string[]; - sourceRoot?: string; sourcesContent?: string[]; mappings: string; - file: string; -} - -export interface RawIndexMap extends StartOfSourceMap { - version: number; - sections: RawSection[]; -} - -export interface RawSection { - offset: Position; - map: RawSourceMap; } export interface Position { @@ -37,24 +16,22 @@ export interface Position { column: number; } -export interface NullablePosition { - line: number | null; - column: number | null; - lastColumn: number | null; +export interface LineRange extends Position { + lastColumn: number; } -export interface MappedPosition { +export interface FindPosition extends Position { + // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND + bias?: number; +} + +export interface SourceFindPosition extends FindPosition { source: string; - line: number; - column: number; - name?: string; } -export interface NullableMappedPosition { - source: string | null; - line: number | null; - column: number | null; - name: string | null; +export interface MappedPosition extends Position { + source: string; + name?: string; } export interface MappingItem { @@ -66,6 +43,23 @@ export interface MappingItem { name: string; } +export class SourceMapConsumer { + static GENERATED_ORDER: number; + static ORIGINAL_ORDER: number; + + static GREATEST_LOWER_BOUND: number; + static LEAST_UPPER_BOUND: number; + + constructor(rawSourceMap: RawSourceMap); + computeColumnSpans(): void; + originalPositionFor(generatedPosition: FindPosition): MappedPosition; + generatedPositionFor(originalPosition: SourceFindPosition): LineRange; + allGeneratedPositionsFor(originalPosition: MappedPosition): Position[]; + hasContentsOfAllSources(): boolean; + sourceContentFor(source: string, returnNullOnMissing?: boolean): string; + eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; +} + export interface Mapping { generated: Position; original: Position; @@ -73,297 +67,32 @@ export interface Mapping { name?: string; } +export class SourceMapGenerator { + constructor(startOfSourceMap?: StartOfSourceMap); + static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator; + addMapping(mapping: Mapping): void; + setSourceContent(sourceFile: string, sourceContent: string): void; + applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; + toString(): string; +} + export interface CodeWithSourceMap { code: string; map: SourceMapGenerator; } -export interface SourceMapConsumer { - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - computeColumnSpans(): void; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. - * - column: The column number in the generated source. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. - * - column: The column number in the original source, or null. - * - name: The original identifier, or null. - */ - originalPositionFor(generatedPosition: Position & { bias?: number }): NullableMappedPosition; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. - * - column: The column number in the original source. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. - * - column: The column number in the generated source, or null. - */ - generatedPositionFor(originalPosition: MappedPosition & { bias?: number }): NullablePosition; - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. - * - column: Optional. the column number in the original source. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. - * - column: The column number in the generated source, or null. - */ - allGeneratedPositionsFor(originalPosition: MappedPosition): NullablePosition[]; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - hasContentsOfAllSources(): boolean; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - sourceContentFor(source: string, returnNullOnMissing?: boolean): string | null; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param callback - * The function that is called with each mapping. - * @param context - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param order - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; - /** - * Free this source map consumer's associated wasm data that is manually-managed. - * Alternatively, you can use SourceMapConsumer.with to avoid needing to remember to call destroy. - */ - destroy(): void; -} - -export interface SourceMapConsumerConstructor { - prototype: SourceMapConsumer; - - GENERATED_ORDER: number; - ORIGINAL_ORDER: number; - GREATEST_LOWER_BOUND: number; - LEAST_UPPER_BOUND: number; - - new (rawSourceMap: RawSourceMap, sourceMapUrl?: SourceMapUrl): Promise; - new (rawSourceMap: RawIndexMap, sourceMapUrl?: SourceMapUrl): Promise; - new (rawSourceMap: RawSourceMap | RawIndexMap | string, sourceMapUrl?: SourceMapUrl): Promise; - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param sourceMap - * The source map that will be consumed. - */ - fromSourceMap(sourceMap: SourceMapGenerator, sourceMapUrl?: SourceMapUrl): Promise; - - /** - * Construct a new `SourceMapConsumer` from `rawSourceMap` and `sourceMapUrl` - * (see the `SourceMapConsumer` constructor for details. Then, invoke the `async - * function f(SourceMapConsumer) -> T` with the newly constructed consumer, wait - * for `f` to complete, call `destroy` on the consumer, and return `f`'s return - * value. - * - * You must not use the consumer after `f` completes! - * - * By using `with`, you do not have to remember to manually call `destroy` on - * the consumer, since it will be called automatically once `f` completes. - * - * ```js - * const xSquared = await SourceMapConsumer.with( - * myRawSourceMap, - * null, - * async function (consumer) { - * // Use `consumer` inside here and don't worry about remembering - * // to call `destroy`. - * - * const x = await whatever(consumer); - * return x * x; - * } - * ); - * - * // You may not use that `consumer` anymore out here; it has - * // been destroyed. But you can use `xSquared`. - * console.log(xSquared); - * ``` - */ - with(rawSourceMap: RawSourceMap | RawIndexMap | string, sourceMapUrl: SourceMapUrl | null | undefined, callback: (consumer: BasicSourceMapConsumer | IndexedSourceMapConsumer) => Promise | T): Promise; -} - -export const SourceMapConsumer: SourceMapConsumerConstructor; - -export interface BasicSourceMapConsumer extends SourceMapConsumer { - file: string; - sourceRoot: string; - sources: string[]; - sourcesContent: string[]; -} - -export interface BasicSourceMapConsumerConstructor { - prototype: BasicSourceMapConsumer; - - new (rawSourceMap: RawSourceMap | string): Promise; - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param sourceMap - * The source map that will be consumed. - */ - fromSourceMap(sourceMap: SourceMapGenerator): Promise; -} - -export const BasicSourceMapConsumer: BasicSourceMapConsumerConstructor; - -export interface IndexedSourceMapConsumer extends SourceMapConsumer { - sources: string[]; -} - -export interface IndexedSourceMapConsumerConstructor { - prototype: IndexedSourceMapConsumer; - - new (rawSourceMap: RawIndexMap | string): Promise; -} - -export const IndexedSourceMapConsumer: IndexedSourceMapConsumerConstructor; - -export class SourceMapGenerator { - constructor(startOfSourceMap?: StartOfSourceMap); - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param sourceMapConsumer The SourceMap. - */ - static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - addMapping(mapping: Mapping): void; - - /** - * Set the source content for a source file. - */ - setSourceContent(sourceFile: string, sourceContent: string): void; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param sourceMapConsumer The source map to be applied. - * @param sourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param sourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; - - toString(): string; - - toJSON(): RawSourceMap; -} - export class SourceNode { - children: SourceNode[]; - sourceContents: any; - line: number; - column: number; - source: string; - name: string; - constructor(); - constructor( - line: number | null, - column: number | null, - source: string | null, - chunks?: Array<(string | SourceNode)> | SourceNode | string, - name?: string - ); - - static fromStringWithSourceMap( - code: string, - sourceMapConsumer: SourceMapConsumer, - relativePath?: string - ): SourceNode; - - add(chunk: Array<(string | SourceNode)> | SourceNode | string): SourceNode; - - prepend(chunk: Array<(string | SourceNode)> | SourceNode | string): SourceNode; - + constructor(line: number, column: number, source: string); + constructor(line: number, column: number, source: string, chunk?: string, name?: string); + static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; + add(chunk: string): void; + prepend(chunk: string): void; setSourceContent(sourceFile: string, sourceContent: string): void; - walk(fn: (chunk: string, mapping: MappedPosition) => void): void; - walkSourceContents(fn: (file: string, content: string) => void): void; - join(sep: string): SourceNode; - replaceRight(pattern: string, replacement: string): SourceNode; - toString(): string; - toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap; } diff --git a/node_modules/terser/node_modules/source-map/source-map.js b/node_modules/terser/node_modules/source-map/source-map.js index a84abf1..bc88fe8 100644 --- a/node_modules/terser/node_modules/source-map/source-map.js +++ b/node_modules/terser/node_modules/source-map/source-map.js @@ -3,6 +3,6 @@ * Licensed under the New BSD license. See LICENSE.txt or: * http://opensource.org/licenses/BSD-3-Clause */ -exports.SourceMapGenerator = require("./lib/source-map-generator").SourceMapGenerator; -exports.SourceMapConsumer = require("./lib/source-map-consumer").SourceMapConsumer; -exports.SourceNode = require("./lib/source-node").SourceNode; +exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; +exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; +exports.SourceNode = require('./lib/source-node').SourceNode; diff --git a/node_modules/terser/package.json b/node_modules/terser/package.json index fa34376..cd501ca 100644 --- a/node_modules/terser/package.json +++ b/node_modules/terser/package.json @@ -1,50 +1,52 @@ { - "_args": [ - [ - "terser@5.5.1", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "terser@5.5.1", - "_id": "terser@5.5.1", - "_inBundle": false, - "_integrity": "sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ==", - "_location": "/terser", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "terser@5.5.1", - "name": "terser", - "escapedName": "terser", - "rawSpec": "5.5.1", - "saveSpec": null, - "fetchSpec": "5.5.1" + "name": "terser", + "description": "JavaScript parser, mangler/compressor and beautifier toolkit for ES6+", + "homepage": "https://terser.org", + "author": "Mihai Bazon (http://lisperator.net/)", + "license": "BSD-2-Clause", + "version": "5.3.0", + "engines": { + "node": ">=6.0.0" }, - "_requiredBy": [ - "/rollup-plugin-terser" + "maintainers": [ + "Fábio Santos " ], - "_resolved": "https://registry.npmjs.org/terser/-/terser-5.5.1.tgz", - "_spec": "5.5.1", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Mihai Bazon", - "email": "mihai.bazon@gmail.com", - "url": "http://lisperator.net/" + "repository": "https://github.com/terser/terser", + "main": "dist/bundle.min.js", + "type": "module", + "module": "./main.js", + "exports": { + ".": { + "import": "./main.js", + "require": "./dist/bundle.min.js" + }, + "./package": { + "default": "./package.json" + }, + "./package.json": { + "default": "./package.json" + } }, + "types": "tools/terser.d.ts", "bin": { "terser": "bin/terser" }, - "bugs": { - "url": "https://github.com/terser/terser/issues" - }, + "files": [ + "bin", + "dist", + "lib", + "tools", + "LICENSE", + "README.md", + "CHANGELOG.md", + "PATRONS.md", + "main.js" + ], "dependencies": { "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.19" + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" }, - "description": "JavaScript parser, mangler/compressor and beautifier toolkit for ES6+", "devDependencies": { "@ls-lint/ls-lint": "^1.9.2", "acorn": "^7.4.0", @@ -58,9 +60,36 @@ "rollup": "2.0.6", "semver": "^7.1.3" }, - "engines": { - "node": ">=10" + "scripts": { + "test": "node test/compress.js && mocha test/mocha", + "test:compress": "node test/compress.js", + "test:mocha": "mocha test/mocha", + "lint": "eslint lib", + "lint-fix": "eslint --fix lib", + "ls-lint": "ls-lint", + "build": "rimraf dist/bundle* && rollup --config --silent", + "prepare": "npm run build", + "postversion": "echo 'Remember to update the changelog!'" }, + "keywords": [ + "uglify", + "terser", + "uglify-es", + "uglify-js", + "minify", + "minifier", + "javascript", + "ecmascript", + "es5", + "es6", + "es7", + "es8", + "es2015", + "es2016", + "es2017", + "async", + "await" + ], "eslintConfig": { "parserOptions": { "sourceType": "module", @@ -112,80 +141,12 @@ ] } }, - "exports": { - ".": [ - { - "import": "./main.js", - "require": "./dist/bundle.min.js" - }, - "./dist/bundle.min.js" - ], - "./package": "./package.json", - "./package.json": "./package.json" - }, - "files": [ - "bin", - "dist", - "lib", - "tools", - "LICENSE", - "README.md", - "CHANGELOG.md", - "PATRONS.md", - "main.js" - ], - "homepage": "https://terser.org", - "keywords": [ - "uglify", - "terser", - "uglify-es", - "uglify-js", - "minify", - "minifier", - "javascript", - "ecmascript", - "es5", - "es6", - "es7", - "es8", - "es2015", - "es2016", - "es2017", - "async", - "await" - ], - "license": "BSD-2-Clause", - "main": "dist/bundle.min.js", - "maintainers": [ - { - "name": "Fábio Santos", - "email": "fabiosantosart@gmail.com" - } - ], - "module": "./main.js", - "name": "terser", "pre-commit": [ - "build", "lint-fix", "ls-lint", "test" ], - "repository": { - "type": "git", - "url": "git+https://github.com/terser/terser.git" - }, - "scripts": { - "build": "rimraf dist/bundle* && rollup --config --silent", - "lint": "eslint lib", - "lint-fix": "eslint --fix lib", - "ls-lint": "ls-lint", - "postversion": "echo 'Remember to update the changelog!'", - "prepare": "npm run build", - "test": "node test/compress.js && mocha test/mocha", - "test:compress": "node test/compress.js", - "test:mocha": "mocha test/mocha" - }, - "type": "module", - "types": "tools/terser.d.ts", - "version": "5.5.1" -} + "__npminstall_done": "Sun Sep 06 2020 16:10:14 GMT+0800 (中国标准时间)", + "_from": "terser@5.3.0", + "_resolved": "https://registry.npm.taobao.org/terser/download/terser-5.3.0.tgz?cache=0&sync_timestamp=1599141213629&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser%2Fdownload%2Fterser-5.3.0.tgz" +} \ No newline at end of file diff --git a/node_modules/terser/tools/terser.d.ts b/node_modules/terser/tools/terser.d.ts index b29e98d..3228391 100644 --- a/node_modules/terser/tools/terser.d.ts +++ b/node_modules/terser/tools/terser.d.ts @@ -144,8 +144,6 @@ export interface MinifyOptions { module?: boolean; nameCache?: object; format?: FormatOptions; - /** @deprecated */ - output?: FormatOptions; parse?: ParseOptions; safari10?: boolean; sourceMap?: boolean | SourceMapOptions; diff --git a/node_modules/to-fast-properties/package.json b/node_modules/to-fast-properties/package.json index e8d6320..613f7c7 100644 --- a/node_modules/to-fast-properties/package.json +++ b/node_modules/to-fast-properties/package.json @@ -1,52 +1,23 @@ { - "_args": [ - [ - "to-fast-properties@2.0.0", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "to-fast-properties@2.0.0", - "_id": "to-fast-properties@2.0.0", - "_inBundle": false, - "_integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "_location": "/to-fast-properties", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "to-fast-properties@2.0.0", - "name": "to-fast-properties", - "escapedName": "to-fast-properties", - "rawSpec": "2.0.0", - "saveSpec": null, - "fetchSpec": "2.0.0" - }, - "_requiredBy": [ - "/@babel/types" - ], - "_resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "_spec": "2.0.0", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", + "name": "to-fast-properties", + "version": "2.0.0", + "description": "Force V8 to use fast properties for an object", + "license": "MIT", + "repository": "sindresorhus/to-fast-properties", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "bugs": { - "url": "https://github.com/sindresorhus/to-fast-properties/issues" - }, - "description": "Force V8 to use fast properties for an object", - "devDependencies": { - "ava": "0.0.4" - }, "engines": { "node": ">=4" }, + "scripts": { + "test": "node --allow-natives-syntax test.js" + }, "files": [ "index.js" ], - "homepage": "https://github.com/sindresorhus/to-fast-properties#readme", "keywords": [ "object", "obj", @@ -58,14 +29,10 @@ "convert", "mode" ], - "license": "MIT", - "name": "to-fast-properties", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/to-fast-properties.git" + "devDependencies": { + "ava": "0.0.4" }, - "scripts": { - "test": "node --allow-natives-syntax test.js" - }, - "version": "2.0.0" -} + "__npminstall_done": "Sun Sep 06 2020 16:10:03 GMT+0800 (中国标准时间)", + "_from": "to-fast-properties@2.0.0", + "_resolved": "https://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-2.0.0.tgz" +} \ No newline at end of file diff --git a/node_modules/tslib/README.md b/node_modules/tslib/README.md index 49c0014..aea53c8 100644 --- a/node_modules/tslib/README.md +++ b/node_modules/tslib/README.md @@ -37,25 +37,19 @@ For the latest stable version, run: ## npm ```sh -# TypeScript 3.9.2 or later -npm install tslib - -# TypeScript 3.8.4 or earlier -npm install tslib@^1 +# TypeScript 2.3.3 or later +npm install --save tslib # TypeScript 2.3.2 or earlier -npm install tslib@1.6.1 +npm install --save tslib@1.6.1 ``` ## yarn ```sh -# TypeScript 3.9.2 or later +# TypeScript 2.3.3 or later yarn add tslib -# TypeScript 3.8.4 or earlier -yarn add tslib@^1 - # TypeScript 2.3.2 or earlier yarn add tslib@1.6.1 ``` @@ -63,12 +57,9 @@ yarn add tslib@1.6.1 ## bower ```sh -# TypeScript 3.9.2 or later +# TypeScript 2.3.3 or later bower install tslib -# TypeScript 3.8.4 or earlier -bower install tslib@^1 - # TypeScript 2.3.2 or earlier bower install tslib@1.6.1 ``` @@ -76,12 +67,9 @@ bower install tslib@1.6.1 ## JSPM ```sh -# TypeScript 3.9.2 or later +# TypeScript 2.3.3 or later jspm install tslib -# TypeScript 3.8.4 or earlier -jspm install tslib@^1 - # TypeScript 2.3.2 or earlier jspm install tslib@1.6.1 ``` @@ -130,7 +118,7 @@ For JSPM users: "importHelpers": true, "baseUrl": "./", "paths": { - "tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"] + "tslib" : ["jspm_packages/npm/tslib@2.0.1/tslib.d.ts"] } } } diff --git a/node_modules/tslib/modules/index.js b/node_modules/tslib/modules/index.js deleted file mode 100644 index d241d04..0000000 --- a/node_modules/tslib/modules/index.js +++ /dev/null @@ -1,51 +0,0 @@ -import tslib from '../tslib.js'; -const { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, -} = tslib; -export { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, -}; diff --git a/node_modules/tslib/modules/package.json b/node_modules/tslib/modules/package.json deleted file mode 100644 index aafa0e4..0000000 --- a/node_modules/tslib/modules/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/node_modules/tslib/package.json b/node_modules/tslib/package.json index ba7fed6..3b82243 100644 --- a/node_modules/tslib/package.json +++ b/node_modules/tslib/package.json @@ -1,46 +1,10 @@ { - "_from": "tslib@^2.0.1", - "_id": "tslib@2.0.3", - "_inBundle": false, - "_integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==", - "_location": "/tslib", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "tslib@^2.0.1", - "name": "tslib", - "escapedName": "tslib", - "rawSpec": "^2.0.1", - "saveSpec": null, - "fetchSpec": "^2.0.1" - }, - "_requiredBy": [ - "#DEV:/" - ], - "_resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", - "_shasum": "8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c", - "_spec": "tslib@^2.0.1", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Microsoft Corp." - }, - "bugs": { - "url": "https://github.com/Microsoft/TypeScript/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Runtime library for TypeScript helper functions", - "exports": { - ".": { - "module": "./tslib.es6.js", - "import": "./modules/index.js", - "default": "./tslib.js" - }, - "./": "./" - }, + "name": "tslib", + "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "jsnext:main": "tslib.es6.js", + "version": "2.0.1", + "license": "0BSD", + "description": "Runtime library for TypeScript helper functions", "keywords": [ "TypeScript", "Microsoft", @@ -50,15 +14,19 @@ "tslib", "runtime" ], - "license": "0BSD", - "main": "tslib.js", - "module": "tslib.es6.js", - "name": "tslib", + "bugs": { + "url": "https://github.com/Microsoft/TypeScript/issues" + }, "repository": { "type": "git", - "url": "git+https://github.com/Microsoft/tslib.git" + "url": "https://github.com/Microsoft/tslib.git" }, - "sideEffects": false, + "main": "tslib.js", + "module": "tslib.es6.js", + "jsnext:main": "tslib.es6.js", "typings": "tslib.d.ts", - "version": "2.0.3" -} + "sideEffects": false, + "__npminstall_done": "Sun Sep 06 2020 16:10:12 GMT+0800 (中国标准时间)", + "_from": "tslib@2.0.1", + "_resolved": "https://registry.npm.taobao.org/tslib/download/tslib-2.0.1.tgz?cache=0&sync_timestamp=1596755179989&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-2.0.1.tgz" +} \ No newline at end of file diff --git a/node_modules/typescript/README.md b/node_modules/typescript/README.md index 0b4478e..848f1f4 100644 --- a/node_modules/typescript/README.md +++ b/node_modules/typescript/README.md @@ -33,8 +33,8 @@ There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob * Help each other in the [TypeScript Community Discord](https://discord.gg/typescript). * Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter. * [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md). -* Read the archived language specification ([docx](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.docx?raw=true), - [pdf](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/master/doc/spec-archived.md)). +* Read the language specification ([docx](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true), + [pdf](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md)). This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) @@ -44,6 +44,7 @@ with any additional questions or comments. * [TypeScript in 5 minutes](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html) * [Programming handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html) +* [Language specification](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md) * [Homepage](https://www.typescriptlang.org/) ## Building @@ -66,7 +67,7 @@ Install [Gulp](https://gulpjs.com/) tools and dev dependencies: ```bash npm install -g gulp -npm ci +npm install ``` Use one of the following to build and test: @@ -78,6 +79,8 @@ gulp LKG # Replace the last known good with the built one. # Bootstrapping step to be executed when the built compiler reaches a stable state. gulp tests # Build the test infrastructure using the built compiler. gulp runtests # Run tests using the built compiler and test infrastructure. + # Some low-value tests are skipped when not on a CI machine - you can use the + # --skipPercent=0 command to override this behavior and run all tests locally. # You can override the specific suite runner used or specify a test for this command. # Use --tests= for a specific test and/or --runner= for a specific suite. # Valid runners include conformance, compiler, fourslash, project, user, and docker diff --git a/node_modules/typescript/lib/cs/diagnosticMessages.generated.json b/node_modules/typescript/lib/cs/diagnosticMessages.generated.json index 3e78bf6..8c511f5 100644 --- a/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +++ b/node_modules/typescript/lib/cs/diagnosticMessages.generated.json @@ -151,8 +151,6 @@ "Add_undefined_type_to_property_0_95018": "Přidat typ undefined k vlastnosti {0}", "Add_unknown_conversion_for_non_overlapping_types_95069": "Přidat převod unknown pro typy, které se nepřekrývají", "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": "Přidat unknown do všech převodů pro typy, které se nepřekrývají", - "Add_void_to_Promise_resolved_without_a_value_95143": "Přidat void k objektu Promise vyřešenému bez hodnoty", - "Add_void_to_all_Promises_resolved_without_a_value_95144": "Přidat void ke všem objektům Promise vyřešeným bez hodnoty", "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Přidání souboru tsconfig.json vám pomůže uspořádat projekty, které obsahují jak soubory TypeScript, tak soubory JavaScript. Další informace najdete na adrese https://aka.ms/tsconfig.", "Additional_Checks_6176": "Další kontroly", "Advanced_Options_6178": "Upřesnit možnosti", @@ -160,6 +158,7 @@ "All_declarations_of_0_must_have_identical_type_parameters_2428": "Všechny deklarace {0} musí mít stejné parametry typu.", "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Všechny deklarace abstraktní metody musí jít po sobě.", "All_destructured_elements_are_unused_6198": "Žádný z destrukturovaných elementů se nepoužívá.", + "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208": "Když se zadá příznak --isolatedModules, všechny soubory musí být moduly.", "All_imports_in_import_declaration_are_unused_6192": "Žádné importy z deklarace importu se nepoužívají.", "All_type_parameters_are_unused_6205": "Všechny parametry typů jsou nevyužité.", "All_variables_are_unused_6199": "Žádná z proměnných se nepoužívá.", @@ -235,7 +234,7 @@ "Argument_expression_expected_1135": "Očekává se výraz argumentu.", "Argument_for_0_option_must_be_Colon_1_6046": "Argument možnosti {0} musí být {1}.", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "Argument typu {0} nejde přiřadit k parametru typu {1}.", - "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "Nezadaly se argumenty pro parametr rest {0}.", + "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "Arguments for the rest parameter '{0}' were not provided.", "Array_element_destructuring_pattern_expected_1181": "Očekával se destrukturační vzor elementu pole.", "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": "Kontrolní výrazy vyžadují, aby se všechny názvy v cíli volání deklarovaly s explicitní anotací typu.", "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": "Kontrolní výrazy vyžadují, aby cíl volání byl identifikátor, nebo kvalifikovaný název.", @@ -285,20 +284,20 @@ "Cannot_find_lib_definition_for_0_2726": "Nepovedlo se najít definici knihovny pro {0}.", "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "Nepovedlo se najít definici knihovny pro {0}. Neměli jste na mysli spíš {1}?", "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Nepovedlo se najít modul {0}. Zvažte možnost importovat modul s příponou .json pomocí --resolveJsonModule.", - "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "Nepovedlo se najít modul {0}. Nechtěli jste nastavit možnost moduleResolution na node nebo přidat do možnosti paths aliasy?", + "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?", "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "Nepovedlo se najít modul {0} nebo jeho odpovídající deklarace typů.", "Cannot_find_name_0_2304": "Název {0} se nenašel.", "Cannot_find_name_0_Did_you_mean_1_2552": "Nepovedlo se najít název {0}. Měli jste na mysli {1}?", "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "Název {0} se nedá najít. Měli jste na mysli člena instance this.{0}?", "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": "Název {0} se nedá najít. Měli jste na mysli statický člen {1}.{0}?", - "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Nepovedlo se najít název {0}. Potřebujete změnit cílovou knihovnu? Zkuste změnit možnost kompilátoru lib na {1} nebo novější.", + "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Nepovedlo se najít název {0}. Potřebujete změnit cílovou knihovnu? Zkuste změnit možnost kompilátoru lib na es2015 nebo novější.", "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": "Nepovedlo se najít název {0}. Potřebujete změnit cílovou knihovnu? Zkuste změnit možnost kompilátoru lib tak, aby obsahovala dom.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": "Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro spouštěč testů? Zkuste npm i --save-dev @types/jest nebo npm i --save-dev @types/mocha.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": "Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro spouštěč testů? Zkuste npm i --save-dev @types/jest nebo npm i --save-dev @types/mocha a pak do polí typů v tsconfig přidejte jest nebo mocha.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": "Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro jQuery? Zkuste npm i --save-dev @types/jquery.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": "Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro jQuery? Zkuste npm i --save-dev @types/jquery a pak pro pole typů v tsconfig přidejte jquery.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": "Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro Node? Zkuste npm i --save-dev @types/node.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": "Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro Node? Zkuste npm i --save-dev @types/node a pak do pole typů v tsconfig přidejte node.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582": "Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro spouštěč testů? Zkuste npm i @types/jest nebo npm i @types/mocha.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593": "Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro spouštěč testů? Zkuste npm i @types/jest nebo npm i @types/mocha a pak do polí typů v tsconfig přidejte jest nebo mocha.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581": "Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro jQuery? Zkuste npm i @types/jquery.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592": "Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro jQuery? Zkuste npm i @types/jquery a pak pro pole typů v tsconfig přidejte jquery.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580": "Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro Node? Zkuste npm i @types/node.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591": "Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro Node? Zkuste npm i @types/node a pak do pole typů v tsconfig přidejte node.", "Cannot_find_namespace_0_2503": "Nenašel se obor názvů {0}.", "Cannot_find_parameter_0_1225": "Nenašel se parametr {0}.", "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": "Nenašla se společná cesta podadresářů pro vstupní soubory.", @@ -375,7 +374,6 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Není zadaný obsažený soubor a nedá se určit kořenový adresář – přeskakuje se vyhledávání ve složce node_modules.", "Containing_function_is_not_an_arrow_function_95128": "Obsahující funkce není funkcí šipky.", "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": "Převod typu {0} na typ {1} může být chyba, protože ani jeden z těchto typů se s tím druhým dostatečně nepřekrývá. Pokud je to záměr, převeďte nejdříve výraz na unknown.", - "Convert_0_to_1_in_0_95003": "Převést {0} na {1} v {0}", "Convert_0_to_mapped_object_type_95055": "Převést {0} na typ mapovaného objektu", "Convert_all_constructor_functions_to_classes_95045": "Převést všechny funkce konstruktoru na třídy", "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374": "Převést všechny importy, které se nepoužívají jako hodnota, na importy, při kterých se importují jen typy.", @@ -385,7 +383,6 @@ "Convert_all_to_async_functions_95066": "Převést vše na asynchronní funkce", "Convert_all_to_bigint_numeric_literals_95092": "Převést vše na číselné literály bigint", "Convert_all_to_default_imports_95035": "Převést vše na výchozí importy", - "Convert_all_type_literals_to_mapped_type_95021": "Převést všechny literály typů na namapovaný typ", "Convert_arrow_function_or_function_expression_95122": "Převést funkci šipky nebo výraz funkce", "Convert_const_to_let_95093": "Převést const na let", "Convert_default_export_to_named_export_95061": "Převést výchozí export na pojmenovaný export", @@ -429,8 +426,6 @@ "Declaration_expected_1146": "Očekává se deklarace.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Název deklarace je v konfliktu s integrovaným globálním identifikátorem {0}.", "Declaration_or_statement_expected_1128": "Očekává se deklarace nebo příkaz.", - "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": "Deklarace s kontrolními výrazy jednoznačného přiřazení musí mít také anotace typu.", - "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": "Deklarace s inicializátory nemůžou mít také kontrolní výrazy jednoznačného přiřazení.", "Declare_a_private_field_named_0_90053": "Deklarovat privátní pole s názvem {0}", "Declare_method_0_90023": "Deklarovat metodu {0}", "Declare_private_method_0_90038": "Deklarovat privátní metodu {0}", @@ -441,6 +436,7 @@ "Decorators_are_not_valid_here_1206": "Dekorátory tady nejsou platné.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Dekorátory nejde použít na víc přístupových objektů get/set se stejným názvem.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Výchozí export modulu má nebo používá privátní název {0}.", + "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258": "Jednoznačné kontrolní výrazy přiřazení se dají použít jen spolu s anotací typu.", "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": "Definice následujících identifikátorů je v konfliktu s definicemi v jiném souboru: {0}", "Delete_all_unused_declarations_95024": "Odstranit všechny nepoužívané deklarace", "Delete_the_outputs_of_all_projects_6365": "Odstranit výstupy všech projektů", @@ -532,7 +528,6 @@ "Excessive_stack_depth_comparing_types_0_and_1_2321": "Nadměrná hloubka zásobníku při porovnávání typů {0} a {1}", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "Očekávané argumenty typu {0}–{1}; zadejte je se značkou @extends.", "Expected_0_arguments_but_got_1_2554": "Očekával se tento počet argumentů: {0}. Počet předaných argumentů: {1}", - "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "Očekával se tento počet argumentů: {0}, ale byl přijat tento počet: {1}. Nezapomněli jste zahrnout void do argumentu typu pro objekt Promise?", "Expected_0_arguments_but_got_1_or_more_2556": "Očekával se tento počet argumentů: {0}. Počet předaných argumentů: {1} nebo více.", "Expected_0_type_arguments_but_got_1_2558": "Očekávaly se argumenty typu {0}, ale předaly se argumenty typu {1}.", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Očekávané argumenty typu {0}; zadejte je se značkou @extends.", @@ -617,7 +612,6 @@ "Generate_get_and_set_accessors_for_all_overriding_properties_95119": "Generovat přístupové objekty get a set pro všechny přepisující vlastnosti", "Generates_a_CPU_profile_6223": "Vygeneruje profil procesoru.", "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": "Pro každý odpovídající soubor .d.ts vygeneruje sourcemap.", - "Generates_an_event_trace_and_a_list_of_types_6237": "Generuje trasování události a seznam typů.", "Generates_corresponding_d_ts_file_6002": "Generuje odpovídající soubor .d.ts.", "Generates_corresponding_map_file_6043": "Generuje odpovídající soubor .map.", "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025": "Generátor má implicitně typ yield {0}, protože nevydává žádné hodnoty. Zvažte možnost přidat anotaci návratového typu.", @@ -662,7 +656,6 @@ "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "Inicializátor členu v deklaracích ambientního výčtu musí být konstantní výraz.", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "Ve výčtu s víc deklaracemi může být jenom u jedné deklarace vynechaný inicializátor u prvního elementu výčtu.", "Include_modules_imported_with_json_extension_6197": "Zahrnout moduly importované s příponou .json", - "Include_undefined_in_index_signature_results_6800": "Zahrnout položku undefined do výsledků signatury indexu", "Index_signature_in_type_0_only_permits_reading_2542": "Signatura indexu v typu {0} povoluje jen čtení.", "Index_signature_is_missing_in_type_0_2329": "V typu {0} chybí signatura indexu.", "Index_signatures_are_incompatible_2330": "Signatury indexu jsou nekompatibilní.", @@ -694,7 +687,6 @@ "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Neplatná hodnota pro jsxFactory. {0} není platný identifikátor nebo kvalifikovaný název.", "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": "Neplatná hodnota pro jsxFragmentFactory. {0} není platný identifikátor nebo kvalifikovaný název.", "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Neplatná hodnota --reactNamespace. {0} není platný identifikátor.", - "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": "Pravděpodobně chybí čárka, která by oddělila tyto dva výrazy šablony. Tvoří výraz šablony se značkami, který se nedá vyvolat.", "Its_element_type_0_is_not_a_valid_JSX_element_2789": "Typ prvku {0} není platný prvek JSX.", "Its_instance_type_0_is_not_a_valid_JSX_element_2788": "Typ instance {0} není platný prvek JSX.", "Its_return_type_0_is_not_a_valid_JSX_element_2787": "Návratový typ {0} není platný prvek JSX.", @@ -759,6 +751,7 @@ "Module_0_has_no_default_export_1192": "Modul {0} nemá žádný výchozí export.", "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": "Modul {0} nemá žádný výchozí export. Nechtěli jste místo toho použít import { {1} } from {0}?", "Module_0_has_no_exported_member_1_2305": "V modulu {0} není žádný exportovaný člen {1}.", + "Module_0_has_no_exported_member_1_Did_you_mean_2_2724": "Modul {0} nemá žádný exportovaný člen {1}. Neměli jste na mysli {2}?", "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": "Modul {0} nemá žádný exportovaný člen {1}. Nechtěli jste místo toho použít import { {1} } from {0}?", "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": "Modul {0} je skrytý místní deklarací se stejným názvem.", "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "Modul {0} používá export = a nedá se použít s možností export *.", @@ -794,7 +787,6 @@ "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": "Neabstraktní třída {0} neimplementuje zděděného abstraktního člena {1} ze třídy {2}.", "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "Výraz neabstraktní třídy neimplementuje zděděný abstraktní člen {0} z třídy {1}.", "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": "Kontrolní výrazy jiné než null se dají používat jen v typescriptových souborech.", - "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090": "Nerelativní cesty nejsou povolené, pokud není nastavená hodnota baseUrl. Nezapomněli jste na úvodní znak „./“?", "Non_simple_parameter_declared_here_1348": "Deklaroval se tady parametr, který není jednoduchý.", "Not_all_code_paths_return_a_value_7030": "Ne všechny cesty kódu vracejí hodnotu.", "Not_all_constituents_of_type_0_are_callable_2756": "Ne všichni konstituenti typu {0} se dají zavolat.", @@ -830,7 +822,6 @@ "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "Možnost {0} jde zadat jenom v souboru tsconfig.json nebo nastavit na příkazovém řádku na hodnotu false nebo null.", "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "Možnost {0} jde zadat jenom v souboru tsconfig.json nebo nastavit na příkazovém řádku na hodnotu null.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "Možnost {0} jde použít jenom při zadání možnosti --inlineSourceMap nebo možnosti --sourceMap.", - "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": "Když je možnost jsx nastavená na {1}, možnost {0} se nedá zadat.", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "Když je možnost target nastavená na ES3, možnost {0} se nedá zadat.", "Option_0_cannot_be_specified_with_option_1_5053": "Možnosti {0} a {1} nejde zadat zároveň.", "Option_0_cannot_be_specified_without_specifying_option_1_5052": "Možnost {0} nejde zadat bez možnosti {1}.", @@ -839,6 +830,7 @@ "Option_build_must_be_the_first_command_line_argument_6369": "Možnost --build musí být prvním argumentem příkazového řádku.", "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": "Možnost --incremental se dá zadat jen pomocí tsconfig, při generování do jednoho souboru nebo když se zadá možnost --tsBuildInfoFile.", "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "Možnost isolatedModules jde použít jenom v případě, že je poskytnutá možnost --module nebo že možnost target je ES2015 nebo vyšší verze.", + "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "Možnost paths se nedá použít bez zadání možnosti --baseUrl.", "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "Možnost project se na příkazovém řádku nedá kombinovat se zdrojovým souborem.", "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071": "Možnost --resolveJsonModule se dá zadat jen v případě, že generování kódu modulu je commonjs, amd, es2015 nebo esNext.", "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "Možnost --resolveJsonModule se nedá zadat bez strategie překladu modulu node.", @@ -891,7 +883,6 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Typ parametru veřejné statické metody setter {0} z exportované třídy má nebo používá privátní název {1}.", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Parsovat ve striktním režimu a generovat striktní používání pro každý zdrojový soubor", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "Vzor {0} může obsahovat nanejvýš jeden znak * (hvězdička).", - "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": "Časování výkonu pro --diagnostics nebo --extendedDiagnostics nejsou v této relaci k dispozici. Nepovedlo se najít nativní implementace rozhraní Web Performance API.", "Prefix_0_with_an_underscore_90025": "Předpona {0} s podtržítkem", "Prefix_all_incorrect_property_declarations_with_declare_95095": "Před všechny nesprávné deklarace vlastností přidejte declare.", "Prefix_all_unused_declarations_with_where_possible_95025": "Přidat příponu _ ke všem nepoužívaným deklaracím tam, kde je to možné", @@ -923,7 +914,6 @@ "Property_0_does_not_exist_on_const_enum_1_2479": "Vlastnost {0} ve výčtu const {1} neexistuje.", "Property_0_does_not_exist_on_type_1_2339": "Vlastnost {0} v typu {1} neexistuje.", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "Vlastnost {0} v typu {1} neexistuje. Měli jste na mysli {2}?", - "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": "Vlastnost {0} neexistuje u typu {1}. Potřebujete změnit cílovou knihovnu? Zkuste změnit možnost kompilátoru lib na {2} nebo novější.", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "Vlastnost {0} nemá žádný inicializátor a není jednoznačně přiřazena v konstruktoru.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "Vlastnost {0} má implicitně typ any, protože její přistupující objekt get nemá anotaci návratového typu.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "Vlastnost {0} má implicitně typ any, protože její přistupující objekt set nemá anotaci parametrového typu.", @@ -961,7 +951,6 @@ "Property_or_signature_expected_1131": "Očekává se vlastnost nebo podpis.", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "Hodnota vlastnosti může být jenom řetězcový literál, číselný literál, true, false, null, literál objektu nebo literál pole.", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "Při cílení na ES5 nebo ES3 poskytněte plnou podporu iterovatelných proměnných ve for-of, rozšíření a destrukturování.", - "Provides_a_root_package_name_when_using_outFile_with_declarations_1390": "Poskytuje název kořenového balíčku při použití položky outFile s deklaracemi.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "Veřejná metoda {0} z exportované třídy má nebo používá název {1} z externího modulu {2}, ale nedá se pojmenovat.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "Veřejná metoda {0} z exportované třídy má nebo používá název {1} z privátního modulu {2}.", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "Veřejná metoda {0} z exportované třídy má nebo používá privátní název {1}.", @@ -1088,7 +1077,6 @@ "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "Zdejte sekvenci konce řádku, která se má použít při generování souborů: CRLF (dos) nebo LF (unix).", "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": "Zadejte umístění, ve kterém by měl ladicí program najít soubory TypeScript namísto umístění zdroje.", "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "Zadejte umístění, ve kterém by měl ladicí program najít soubory mapy namísto generovaných umístění.", - "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": "Zadejte specifikátor modulu, který se má použít k importu továrních funkcí jsx a jsxs např. z funkce react.", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Zadejte kořenový adresář vstupních souborů. Slouží ke kontrole struktury výstupního adresáře pomocí --outDir.", "Split_all_invalid_type_only_imports_1367": "Rozdělit všechny neplatné importy, při kterých se importují jen typy", "Split_into_two_separate_import_declarations_1366": "Rozdělit na dvě samostatné deklarace importu", @@ -1130,8 +1118,6 @@ "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496": "Funkce šipky v ES3 a ES5 nemůže odkazovat na objekt arguments. Zvažte použití standardního výrazu funkce.", "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "V ES3 a ES5 se na objekt arguments nedá odkazovat v asynchronní funkci nebo metodě. Zvažte možnost použít standardní funkci nebo metodu.", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "Tělo příkazu if nemůže být prázdný příkaz.", - "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391": "Při použití řešení modulu outFile a node s deklarací musí být zadána možnost bundledPackageName.", - "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": "Volání by pro tuto implementaci proběhlo úspěšně, ale signatury implementace pro přetížení nejsou externě k dispozici.", "The_character_set_of_the_input_files_6163": "Znaková sada vstupních souborů", "The_containing_arrow_function_captures_the_global_value_of_this_7041": "Obsahující funkce šipky zachytává globální hodnotu pro this.", "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "Text obsahující funkce nebo modulu je pro analýzu toku řízení příliš dlouhý.", @@ -1150,10 +1136,8 @@ "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "Odvozený typ {0} se nedá pojmenovat bez odkazu na {1}. Pravděpodobně to nebude přenosné. Vyžaduje se anotace typu.", "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "Odvozený typ {0} se odkazuje na typ s cyklickou strukturou, která se nedá triviálně serializovat. Musí se použít anotace typu.", "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "Odvozený typ {0} odkazuje na nepřístupný typ {1}. Musí se použít anotace typu.", - "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": "Odvozený typ tohoto uzlu přesahuje maximální délku, kterou kompilátor může serializovat. Je potřeba zadat explicitní anotaci typu.", "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": "Průnik {0} se omezil na never, protože vlastnost {1} existuje v několika konstituentech a v některých z nich je privátní.", "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": "Průnik {0} se omezil na never, protože vlastnost {1} má v některých konstituentech konfliktní typy.", - "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": "Klíčové slovo intrinsic se dá použít jenom k deklaraci vnitřních typů poskytovaných kompilátorem.", "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": "Aby bylo možné použít fragmenty JSX s možností kompilátoru jsxFactory, je třeba zadat možnost kompilátoru jsxFragmentFactory.", "The_last_overload_gave_the_following_error_2770": "Poslední přetížení vrátilo následující chybu.", "The_last_overload_is_declared_here_2771": "Poslední přetížení je deklarované tady.", @@ -1230,7 +1214,7 @@ "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Deklarace nejvyšší úrovně v souborech .d.ts musí začínat modifikátorem declare, nebo export.", "Trailing_comma_not_allowed_1009": "Čárka na konci není povolená.", "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "Transpiluje každý soubor jako samostatný modul (podobné jako ts.transpileModule).", - "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "Vyzkoušejte deklaraci npm i --save-dev @types/{1}, pokud existuje, nebo přidejte nový soubor deklarací (.d.ts) s deklarací declare module '{0}';.", + "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035": "Vyzkoušejte deklaraci npm install @types/{1}, pokud existuje, nebo přidejte nový soubor deklarací (.d.ts) s deklarací declare module '{0}';.", "Trying_other_entries_in_rootDirs_6110": "Zkoušejí se další položky v rootDirs.", "Trying_substitution_0_candidate_module_location_Colon_1_6093": "Zkouší se nahrazení {0}, umístění modulu kandidáta: {1}.", "Tuple_members_must_all_have_names_or_all_not_have_names_5084": "Název musí mít buď všechny členy řazené kolekce členů, nebo ho nesmí mít žádný člen.", @@ -1305,7 +1289,6 @@ "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": "======== Direktiva odkazu na typ {0} se úspěšně přeložila na {1}, primární: {2}. ========", "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": "======== Direktiva odkazu na typ {0} se úspěšně přeložila na {1} s ID balíčku {2}, primární: {3}. ========", "Types_have_separate_declarations_of_a_private_property_0_2442": "Typy mají samostatné deklarace privátní vlastnosti {0}.", - "Types_of_construct_signatures_are_incompatible_2419": "Typy signatur konstruktorů nejsou kompatibilní.", "Types_of_parameters_0_and_1_are_incompatible_2328": "Typy parametrů {0} a {1} jsou nekompatibilní.", "Types_of_property_0_are_incompatible_2326": "Typy vlastnosti {0} nejsou kompatibilní.", "Unable_to_open_file_0_6050": "Soubor {0} nejde otevřít.", @@ -1378,7 +1361,6 @@ "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": "{0} se dá importovat jen pomocí volání require nebo pomocí výchozího importu.", "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": "{0} se dá importovat jen pomocí import {1} = require({2}) nebo výchozího importu.", "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": "{0} se dá importovat jen pomocí import {1} = require({2}) nebo zapnutím příznaku esModuleInterop a pomocí výchozího importu.", - "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208": "{0} není možné zkompilovat v režimu --isolatedModules, protože se považuje za globální soubor skriptu. Pokud ho chcete převést na modul, přidejte import, export nebo prázdný příkaz export {}.", "_0_cannot_be_used_as_a_JSX_component_2786": "{0} se nedá použít jako součást JSX.", "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": "{0} se nedá používat jako hodnota, protože se exportovalo pomocí export type.", "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": "{0} se nedá používat jako hodnota, protože se importovalo pomocí import type.", @@ -1386,7 +1368,6 @@ "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": "Instanci {0} by bylo možné vytvořit s libovolným typem, který by nemusel souviset s {1}.", "_0_declarations_can_only_be_used_in_TypeScript_files_8006": "Deklarace {0} se dají používat jen v typescriptových souborech.", "_0_expected_1005": "Očekával se: {0}.", - "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": "{0} nemá žádný exportovaný člen s názvem {1}. Neměli jste na mysli {2}?", "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": "{0} má implicitně návratový typ {1}, ale je možné, že lepší typ by se vyvodil z využití.", "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": "{0} obsahuje implicitně návratový typ any, protože neobsahuje anotaci návratového typu a přímo nebo nepřímo se odkazuje v jednom ze svých návratových výrazů.", "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": "{0} má implicitně typ any, protože nemá anotaci typu a odkazuje se přímo nebo nepřímo v jeho vlastním inicializátoru.", @@ -1399,19 +1380,18 @@ "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "{0} je definované jako přístupový objekt ve třídě {1}, ale v {2} se tady přepisuje jako vlastnost instance.", "_0_is_deprecated_6385": "{0} je zastaralé", "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "{0} není platnou metavlastností pro klíčové slovo {1}. Měli jste na mysli {2}?", - "_0_is_not_allowed_as_a_variable_declaration_name_1389": "{0} se nepovoluje jako název deklarace proměnné.", "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "Na {0} se přímo nebo nepřímo odkazuje ve vlastním základním výrazu.", "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "Na {0} se odkazuje přímo nebo nepřímo v jeho vlastní anotaci typu.", "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": "{0} se zadalo více než jednou, proto se toto použití přepíše.", "_0_list_cannot_be_empty_1097": "Seznam {0} nemůže být prázdný.", "_0_modifier_already_seen_1030": "Modifikátor {0} se už jednou vyskytl.", + "_0_modifier_cannot_appear_on_a_class_element_1031": "Modifikátor {0} se nemůže objevit v elementu třídy.", "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": "Modifikátor {0} se nemůže objevit v deklaraci konstruktoru.", "_0_modifier_cannot_appear_on_a_data_property_1043": "Modifikátor {0} nejde použít u vlastnosti dat.", "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": "Modifikátor {0} se nemůže objevit v elementu modulu nebo oboru názvů.", "_0_modifier_cannot_appear_on_a_parameter_1090": "Modifikátor {0} se nemůže objevit v parametru.", "_0_modifier_cannot_appear_on_a_type_member_1070": "Modifikátor {0} se nemůže objevit u člena typu.", "_0_modifier_cannot_appear_on_an_index_signature_1071": "Modifikátor {0} se nemůže objevit v signatuře indexu.", - "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": "Modifikátor {0} se nemůže objevit u elementů třídy tohoto typu.", "_0_modifier_cannot_be_used_here_1042": "Modifikátor {0} tady nejde použít.", "_0_modifier_cannot_be_used_in_an_ambient_context_1040": "Modifikátor {0} nejde použít v ambientním kontextu.", "_0_modifier_cannot_be_used_with_1_modifier_1243": "Modifikátor {0} nejde použít s modifikátorem {1}.", @@ -1421,7 +1401,6 @@ "_0_needs_an_explicit_type_annotation_2782": "{0} vyžaduje explicitní anotaci typu.", "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": "{0} jenom odkazuje na typ, ale tady se používá jako obor názvů.", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "{0} odkazuje jenom na typ, ale používá se tady jako hodnota.", - "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": "{0} odkazuje jenom na typ, ale tady se používá jako hodnota. Nechtěli jste použít {1} v {0}?", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "{0} se odkazuje jen na typ, ale používá se tady jako hodnota. Potřebujete změnit svou cílovou knihovnu? Zkuste změnit možnost kompilátoru lib na es2015 nebo novější.", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "{0} odkazuje na globální UMD, ale aktuální soubor je modul. Zvažte raději přidání importu.", "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "{0} odkazuje na hodnotu, ale tady se používá jako typ. Měli jste na mysli typeof {0}?", diff --git a/node_modules/typescript/lib/de/diagnosticMessages.generated.json b/node_modules/typescript/lib/de/diagnosticMessages.generated.json index dc1fb7e..db000dd 100644 --- a/node_modules/typescript/lib/de/diagnosticMessages.generated.json +++ b/node_modules/typescript/lib/de/diagnosticMessages.generated.json @@ -151,8 +151,6 @@ "Add_undefined_type_to_property_0_95018": "undefined-Typ zu Eigenschaft \"{0}\" hinzufügen", "Add_unknown_conversion_for_non_overlapping_types_95069": "Konvertierung \"unknown\" für Typen ohne Überschneidung hinzufügen", "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": "\"unknown\" zu allen Konvertierungen für Typen ohne Überschneidung hinzufügen", - "Add_void_to_Promise_resolved_without_a_value_95143": "\"Void\" zu ohne Wert aufgelöstem Promise hinzufügen", - "Add_void_to_all_Promises_resolved_without_a_value_95144": "\"Void\" allen ohne Wert aufgelösten Promises hinzufügen", "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Das Hinzufügen einer \"tsconfig.json\"-Datei erleichtert die Organisation von Projekten, die sowohl TypeScript- als auch JavaScript-Dateien enthalten. Weitere Informationen finden Sie unter https://aka.ms/tsconfig.", "Additional_Checks_6176": "Zusätzliche Überprüfungen", "Advanced_Options_6178": "Erweiterte Optionen", @@ -160,6 +158,7 @@ "All_declarations_of_0_must_have_identical_type_parameters_2428": "Alle Deklarationen von \"{0}\" müssen identische Typparameter aufweisen.", "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Alle Deklarationen einer abstrakten Methode müssen aufeinanderfolgend sein.", "All_destructured_elements_are_unused_6198": "Alle destrukturierten Elemente werden nicht verwendet.", + "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208": "Alle Dateien müssen Module sein, wenn das Flag \"--isolatedModules\" angegeben wird.", "All_imports_in_import_declaration_are_unused_6192": "Keiner der Importe in der Importdeklaration wird verwendet.", "All_type_parameters_are_unused_6205": "Sämtliche Typparameter werden nicht verwendet.", "All_variables_are_unused_6199": "Alle Variablen werden nicht verwendet.", @@ -235,7 +234,6 @@ "Argument_expression_expected_1135": "Es wurde ein Argumentausdruck erwartet.", "Argument_for_0_option_must_be_Colon_1_6046": "Das Argument für die Option \"{0}\" muss \"{1}\" sein.", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "Das Argument vom Typ \"{0}\" kann dem Parameter vom Typ \"{1}\" nicht zugewiesen werden.", - "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "Es wurden keine Argumente für den rest-Parameter \"{0}\" angegeben.", "Array_element_destructuring_pattern_expected_1181": "Ein Arrayelement-Destrukturierungsmuster wurde erwartet.", "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": "Assertionen erfordern, dass jeder Name im Aufrufziel mit einer expliziten Typanmerkung deklariert wird.", "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": "Assertionen erfordern, dass das Aufrufziel ein Bezeichner oder ein qualifizierter Name ist.", @@ -261,7 +259,6 @@ "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Eine Aufrufsignatur ohne Rückgabetypanmerkung weist implizit einen any-Rückgabetyp auf.", "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204": "Aufrufsignaturen ohne Argumente weisen inkompatible Rückgabetypen \"{0}\" und \"{1}\" auf.", "Call_target_does_not_contain_any_signatures_2346": "Das Aufrufziel enthält keine Signaturen.", - "Can_only_convert_logical_AND_access_chains_95142": "Es können nur Zugriffsketten mit logischem \"Und\" konvertiert werden.", "Can_only_convert_property_with_modifier_95137": "Die Eigenschaft kann nur mit einem Modifizierer konvertiert werden.", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Der Zugriff auf \"{0}.{1}\" ist nicht möglich, da \"{0}\" ein Typ ist, aber kein Namespace. Wollten Sie den Typ der Eigenschaft \"{1}\" in \"{0}\" mit \"{0}[\"{1}\"]\" abrufen?", "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748": "Auf umgebende const-Enumerationen kann nicht zugegriffen werden, wenn das Flag \"--isolatedModules\" angegeben wird.", @@ -285,20 +282,19 @@ "Cannot_find_lib_definition_for_0_2726": "Die Bibliotheksdefinition für \"{0}\" wurde nicht gefunden.", "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "Die Bibliotheksdefinition für \"{0}\" wurde nicht gefunden. Meinten Sie \"{1}\"?", "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Das Modul \"{0}\" wurde nicht gefunden. Erwägen Sie die Verwendung von \"--resolveJsonModule\" zum Importieren eines Moduls mit der Erweiterung \".json\".", - "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "Das Modul \"{0}\" wurde nicht gefunden. Möchten Sie die Option \"moduleResolution\" auf \"node\" festlegen oder Aliase zur Option \"paths\" hinzufügen?", "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "Das Modul \"{0}\" oder die zugehörigen Typdeklarationen wurden nicht gefunden.", "Cannot_find_name_0_2304": "Der Name \"{0}\" wurde nicht gefunden.", "Cannot_find_name_0_Did_you_mean_1_2552": "Der Name \"{0}\" wurde nicht gefunden. Meinten Sie \"{1}\"?", "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "Der Name \"{0}\" wurde nicht gefunden. Meinten Sie den Instanzmember \"this.{0}\"?", "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": "Der Name \"{0}\" wurde nicht gefunden. Meinten Sie den statischen Member \"{1}.{0}\"?", - "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Ihre Zielbibliothek ändern? Ändern Sie die Compileroption \"lib\" in \"{1}\" oder höher.", + "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Ihre Zielbibliothek ändern? Ändern Sie die Compileroption \"lib\" in \"es2015\" oder höher.", "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Ihre Zielbibliothek ändern? Ändern Sie die Compileroption \"lib\" so ab, dass sie \"dom\" enthält.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Typdefinitionen für einen Test Runner installieren? Versuchen Sie es mit \"npm i --save-dev @types/jest\" oder \"npm i --save-dev @types/mocha\".", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Typdefinitionen für einen Test Runner installieren? Versuchen Sie es mit \"npm i --save-dev @types/jest\" oder \"npm i --save-dev @types/mocha\", und fügen Sie dann dem Typenfeld in Ihrer tsconfig-Datei \"jest\" oder \"mocha\" hinzu.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Typdefinitionen für jQuery installieren? Versuchen Sie es mit \"npm i --save-dev @types/jquery\".", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Typdefinitionen für jQuery installieren? Versuchen Sie es mit \"npm i --save-dev @types/jquery\", und fügen Sie dann dem Typenfeld in Ihrer tsconfig-Datei \"jquery\" hinzu.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Typdefinitionen für Node installieren? Versuchen Sie es mit \"npm i --save-dev @types/node\".", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Typdefinitionen für Node installieren? Versuchen Sie es mit \"npm i --save-dev @types/node\", und fügen Sie dann dem Typenfeld in Ihrer tsconfig-Datei \"node\" hinzu.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Typdefinitionen für einen Test Runner installieren? Versuchen Sie es mit \"npm i @types/jest\" oder \"npm i @types/mocha\".", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Typdefinitionen für einen Test Runner installieren? Versuchen Sie es mit \"npm i @types/jest\" oder \"npm i @types/mocha\", und fügen Sie dann \"jest\" oder \"mocha\" zum Typenfeld in Ihrer tsconfig-Datei hinzu.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Typdefinitionen für jQuery installieren? Versuchen Sie es mit \"npm i @types/jquery\".", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Typdefinitionen für jQuery installieren? Versuchen Sie es mit \"npm i @types/jquery\", und fügen Sie dann \"jquery\" zum Typenfeld in Ihrer tsconfig-Datei hinzu.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Typdefinitionen für Node installieren? Versuchen Sie es mit \"npm i @types/node\".", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591": "Der Name \"{0}\" wurde nicht gefunden. Müssen Sie Typdefinitionen für Node installieren? Versuchen Sie es mit \"npm i @types/node\", und fügen Sie dann \"node\" zum Typenfeld in Ihrer tsconfig-Datei hinzu.", "Cannot_find_namespace_0_2503": "Der Namespace \"{0}\" wurde nicht gefunden.", "Cannot_find_parameter_0_1225": "Der Parameter \"{0}\" wurde nicht gefunden.", "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": "Das gemeinsame Unterverzeichnis für die Eingabedateien wurde nicht gefunden.", @@ -369,13 +365,10 @@ "Constructor_implementation_is_missing_2390": "Die Konstruktorimplementierung fehlt.", "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673": "Der Konstruktor der Klasse \"{0}\" ist privat. Auf ihn kann nur innerhalb der Klassendeklaration zugegriffen werden.", "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "Der Konstruktor der Klasse \"{0}\" ist geschützt. Auf ihn kann nur innerhalb der Klassendeklaration zugegriffen werden.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386": "Die Typnotation des Konstruktors muss in Klammern gesetzt werden, wenn sie in einem Union-Typ verwendet wird.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388": "Die Typnotation des Konstruktors muss in Klammern gesetzt werden, wenn sie in einem Intersection-Typ verwendet wird.", "Constructors_for_derived_classes_must_contain_a_super_call_2377": "Konstruktoren für abgeleitete Klassen müssen einen Aufruf \"super\" enthalten.", "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Die enthaltene Datei wird nicht angegeben, und das Stammverzeichnis kann nicht ermittelt werden. Die Suche im Ordner \"node_modules\" wird übersprungen.", "Containing_function_is_not_an_arrow_function_95128": "Die enthaltende Funktion ist keine Pfeilfunktion.", "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": "Die Konvertierung des Typs \"{0}\" in den Typ \"{1}\" kann ein Fehler sein, weil die Typen keine ausreichende Überschneidung aufweisen. Wenn dies beabsichtigt war, konvertieren Sie den Ausdruck zuerst in \"unknown\".", - "Convert_0_to_1_in_0_95003": "\"{0}\" in \"{1} in {0}\" konvertieren", "Convert_0_to_mapped_object_type_95055": "\"{0}\" in zugeordneten Objekttyp konvertieren", "Convert_all_constructor_functions_to_classes_95045": "Alle Konstruktorfunktionen in Klassen konvertieren", "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374": "Alle nicht als Wert verwendeten Importe in reine Typenimporte konvertieren", @@ -385,7 +378,6 @@ "Convert_all_to_async_functions_95066": "Alle in asynchrone Funktionen konvertieren", "Convert_all_to_bigint_numeric_literals_95092": "Alle in numerische bigint-Literale konvertieren", "Convert_all_to_default_imports_95035": "Alle in Standardimporte konvertieren", - "Convert_all_type_literals_to_mapped_type_95021": "Alle Typliterale in einen zugeordneten Typ konvertieren", "Convert_arrow_function_or_function_expression_95122": "Pfeilfunktion oder Funktionsausdruck konvertieren", "Convert_const_to_let_95093": "\"const\" in \"let\" konvertieren", "Convert_default_export_to_named_export_95061": "Standardexport in benannten Export konvertieren", @@ -407,17 +399,14 @@ "Convert_to_async_function_95065": "In asynchrone Funktion konvertieren", "Convert_to_default_import_95013": "In Standardimport konvertieren", "Convert_to_named_function_95124": "In benannte Funktion konvertieren", - "Convert_to_optional_chain_expression_95139": "In optionalen Kettenausdruck konvertieren", "Convert_to_template_string_95096": "In Vorlagenzeichenfolge konvertieren", "Convert_to_type_only_export_1364": "In reinen Typenexport konvertieren", "Convert_to_type_only_import_1373": "In reinen Typenimport konvertieren", "Corrupted_locale_file_0_6051": "Die Gebietsschemadatei \"{0}\" ist beschädigt.", "Could_not_find_a_containing_arrow_function_95127": "Es wurde keine enthaltende Pfeilfunktion gefunden.", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "Es wurde keine Deklarationsdatei für das Modul \"{0}\" gefunden. \"{1}\" weist implizit den Typ \"any\" auf.", - "Could_not_find_convertible_access_expression_95140": "Kein konvertierbarer Zugriffsausdruck gefunden", "Could_not_find_export_statement_95129": "Die Exportanweisung wurde nicht gefunden.", "Could_not_find_import_clause_95131": "Die Importklausel wurde nicht gefunden.", - "Could_not_find_matching_access_expressions_95141": "Keine übereinstimmenden Zugriffsausdrücke gefunden", "Could_not_find_namespace_import_or_named_imports_95132": "Der Namespaceimport oder benannte Importe wurden nicht gefunden.", "Could_not_find_property_for_which_to_generate_accessor_95135": "Die Eigenschaft, für die die Zugriffsmethode generiert werden soll, wurde nicht gefunden.", "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231": "Der Pfad \"{0}\" mit den Erweiterungen konnte nicht aufgelöst werden: {1}.", @@ -429,8 +418,6 @@ "Declaration_expected_1146": "Es wurde eine Deklaration erwartet.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Der Deklarationsname steht in Konflikt mit dem integrierten globalen Bezeichner \"{0}\".", "Declaration_or_statement_expected_1128": "Es wurde eine Deklaration oder Anweisung erwartet.", - "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": "Deklarationen mit definitiven Zuweisungsassertionen müssen auch Typanmerkungen aufweisen.", - "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": "Deklarationen mit Initialisierern dürfen keine definitiven Zuweisungsassertionen aufweisen.", "Declare_a_private_field_named_0_90053": "Deklarieren Sie ein privates Feld mit dem Namen \"{0}\".", "Declare_method_0_90023": "Methode \"{0}\" deklarieren", "Declare_private_method_0_90038": "Private Methode \"{0}\" deklarieren", @@ -441,6 +428,7 @@ "Decorators_are_not_valid_here_1206": "Decorators sind hier ungültig.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Decorators dürfen nicht auf mehrere get-/set-Zugriffsmethoden mit dem gleichen Namen angewendet werden.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Der Standardexport des Moduls besitzt oder verwendet den privaten Namen \"{0}\".", + "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258": "Definitive Zuweisungsassertionen können nur zusammen mit einer Typanmerkung verwendet werden.", "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": "Definitionen der folgenden Bezeichner stehen in Konflikt mit denen in einer anderen Datei: {0}", "Delete_all_unused_declarations_95024": "Alle nicht verwendeten Deklarationen löschen", "Delete_the_outputs_of_all_projects_6365": "Ausgaben aller Projekte löschen", @@ -458,7 +446,6 @@ "Digit_expected_1124": "Eine Ziffer wurde erwartet.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "Das Verzeichnis \"{0}\" ist nicht vorhanden, Suchvorgänge darin werden übersprungen.", "Disable_checking_for_this_file_90018": "Überprüfung für diese Datei deaktivieren", - "Disable_loading_referenced_projects_6235": "Deaktivieren Sie das Laden referenzierter Projekte.", "Disable_size_limitations_on_JavaScript_projects_6162": "Größenbeschränkungen für JavaScript-Projekte deaktivieren.", "Disable_solution_searching_for_this_project_6224": "Deaktivieren Sie die Projektmappensuche für dieses Projekt.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Deaktivieren Sie die strenge Überprüfung generischer Signaturen in Funktionstypen.", @@ -490,7 +477,7 @@ "Duplicate_number_index_signature_2375": "Doppelte Zahlenindexsignatur.", "Duplicate_property_0_2718": "Doppelte Eigenschaft: {0}", "Duplicate_string_index_signature_2374": "Doppelte Zeichenfolgen-Indexsignatur.", - "Dynamic_import_cannot_have_type_arguments_1326": "Der dynamische Import kann keine Typargumente aufweisen.", + "Dynamic_import_cannot_have_type_arguments_1326": "Der dynamische Import kann nicht über Typargumente verfügen.", "Dynamic_import_must_have_one_specifier_as_an_argument_1324": "Der dynamische Import benötigt einen Spezifizierer als Argument.", "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "Der Spezifizierer des dynamischen Imports muss den Typ \"string\" aufweisen, hier ist er jedoch vom Typ \"{0}\".", "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323": "Dynamische Importe werden nur unterstützt, wenn das Flag \"--module\" auf \"es2020\", \"esnext\", \"commonjs\", \"amd\", \"system\" oder \"umd\" festgelegt ist.", @@ -532,7 +519,6 @@ "Excessive_stack_depth_comparing_types_0_and_1_2321": "Übermäßige Stapeltiefe beim Vergleichen der Typen \"{0}\" und \"{1}\".", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "{0}-{1} Typargumente erwartet; geben Sie diese mit einem @extends-Tag an.", "Expected_0_arguments_but_got_1_2554": "{0} Argumente wurden erwartet, empfangen wurden aber {1}.", - "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "Es wurden {0} Argumente erwartet, aber {1} erhalten. Sollte \"void\" in Ihr Typargument in \"Promise\" eingeschlossen werden?", "Expected_0_arguments_but_got_1_or_more_2556": "{0} Argumente wurden erwartet, empfangen wurden aber mindestens {1}.", "Expected_0_type_arguments_but_got_1_2558": "{0} Typenargumente wurden erwartet, empfangen wurden aber {1}.", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "{0} Typargumente erwartet; geben Sie diese mit einem @extends-Tag an.", @@ -610,14 +596,11 @@ "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366": "Der Funktion fehlt die abschließende return-Anweisung, und der Rückgabetyp enthält nicht \"undefined\".", "Function_overload_must_be_static_2387": "Die Funktionsüberladung muss statisch sein.", "Function_overload_must_not_be_static_2388": "Die Funktionsüberladung darf nicht statisch sein.", - "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385": "Die Notation des Funktionstyps muss in Klammern gesetzt werden, wenn sie in einem Union-Typ verwendet wird.", - "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387": "Die Notation des Funktionstyps muss in Klammern gesetzt werden, wenn sie in einem Intersection-Typ verwendet wird.", "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014": "Ein Funktionstyp ohne Rückgabetypanmerkung weist implizit einen Rückgabetyp \"{0}\" auf.", "Generate_get_and_set_accessors_95046": "GET- und SET-Accessoren generieren", "Generate_get_and_set_accessors_for_all_overriding_properties_95119": "get- und set-Zugriffsmethoden für alle überschreibenden Eigenschaften generieren", "Generates_a_CPU_profile_6223": "Generiert ein CPU-Profil.", "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": "Generiert eine sourcemap für jede entsprechende .d.ts-Datei.", - "Generates_an_event_trace_and_a_list_of_types_6237": "Generiert eine Ereignisablaufverfolgung und eine Liste von Typen.", "Generates_corresponding_d_ts_file_6002": "Generiert die entsprechende .d.ts-Datei.", "Generates_corresponding_map_file_6043": "Generiert die entsprechende MAP-Datei.", "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025": "Der Generator weist implizit den yield-Typ \"{0}\" auf, weil er keine Werte ausgibt. Erwägen Sie die Angabe einer Rückgabetypanmerkung.", @@ -662,7 +645,6 @@ "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "In Umgebungsenumerationsdeklarationen muss der Memberinitialisierer ein konstanter Ausdruck sein.", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "In einer Enumeration mit mehreren Deklarationen kann nur eine Deklaration einen Initialisierer für das erste Enumerationselement ausgeben.", "Include_modules_imported_with_json_extension_6197": "Importierte Module mit der Erweiterung \"JSON\" einschließen", - "Include_undefined_in_index_signature_results_6800": "\"Nicht definiert\" in Indexsignaturergebnisse einbeziehen", "Index_signature_in_type_0_only_permits_reading_2542": "Die Indexsignatur in Typ \"{0}\" lässt nur Lesevorgänge zu.", "Index_signature_is_missing_in_type_0_2329": "Die Indexsignatur fehlt im Typ \"{0}\".", "Index_signatures_are_incompatible_2330": "Die Indexsignaturen sind nicht kompatibel.", @@ -694,7 +676,6 @@ "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Ungültiger Wert für \"jsxFactory\". \"{0}\" ist kein gültiger Bezeichner oder qualifizierter Name.", "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": "Ungültiger Wert für \"jsxFragmentFactory\". \"{0}\" ist kein gültiger Bezeichner oder qualifizierter Name.", "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Ungültiger Wert für \"-reactNamespace\". \"{0}\" ist kein gültiger Bezeichner.", - "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": "Möglicherweise fehlt ein Komma, um diese beiden Vorlagenausdrücke zu trennen. Sie bilden einen Vorlagenausdruck mit Tags, der nicht aufgerufen werden kann.", "Its_element_type_0_is_not_a_valid_JSX_element_2789": "Der zugehörige Elementtyp \"{0}\" ist kein gültiges JSX-Element.", "Its_instance_type_0_is_not_a_valid_JSX_element_2788": "Der zugehörige Instanztyp \"{0}\" ist kein gültiges JSX-Element.", "Its_return_type_0_is_not_a_valid_JSX_element_2787": "Der Rückgabetyp \"{0}\" ist kein gültiges JSX-Element.", @@ -759,6 +740,7 @@ "Module_0_has_no_default_export_1192": "Das Modul \"{0}\" weist keinen Standardexport auf.", "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": "Das Modul \"{0}\" weist keinen Standardexport auf. Wollten Sie stattdessen \"import { {1} } from {0}\" verwenden?", "Module_0_has_no_exported_member_1_2305": "Das Modul \"{0}\" weist keinen exportierten Member \"{1}\" auf.", + "Module_0_has_no_exported_member_1_Did_you_mean_2_2724": "Das Modul \"{0}\" umfasst keinen exportierten Member \"{1}\". Meinten Sie \"{2}\"?", "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": "Das Modul \"{0}\" umfasst keinen exportierten Member \"{1}\". Wollten Sie stattdessen \"import {1} from {0}\" verwenden?", "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": "Das Modul \"{0}\" wird durch eine lokale Deklaration mit dem gleichen Namen ausgeblendet.", "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "Das Modul \"{0}\" verwendet \"export =\" und darf nicht mit \"export *\" verwendet werden.", @@ -794,7 +776,6 @@ "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": "Die nicht abstrakte Klasse \"{0}\" implementiert nicht den geerbten abstrakten Member \"{1}\" aus der Klasse \"{2}\".", "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "Der nicht abstrakte Ausdruck implementiert nicht den geerbten abstrakten Member \"{0}\" aus der Klasse \"{1}\".", "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": "Assertionen ungleich NULL können nur in TypeScript-Dateien verwendet werden.", - "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090": "Nicht relative Pfade sind nur zulässig, wenn \"baseUrl\" festgelegt wurde. Fehlt am Anfang die Zeichenfolge \"./\"?", "Non_simple_parameter_declared_here_1348": "Hier wurde ein nicht einfacher Parameter deklariert.", "Not_all_code_paths_return_a_value_7030": "Nicht alle Codepfade geben einen Wert zurück.", "Not_all_constituents_of_type_0_are_callable_2756": "Nicht alle Bestandteile vom Typ \"{0}\" können aufgerufen werden.", @@ -830,7 +811,6 @@ "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "Die Option \"{0}\" kann nur in der Datei \"tsconfig.json\" angegeben oder in der Befehlszeile auf FALSE oder NULL festgelegt werden.", "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "Die Option \"{0}\" kann nur in der Datei \"tsconfig.json\" angegeben oder in der Befehlszeile auf NULL festgelegt werden.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "Die Option \"{0}\" kann nur verwendet werden, wenn die Option \"-inlineSourceMap\" oder \"-sourceMap\" angegeben wird.", - "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": "Die Option \"{0}\" kann nicht angegeben werden, wenn die Option \"jsx\" den Wert \"{1}\" aufweist.", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "Die Option \"{0}\" kann nicht angegeben werden, wenn die Option \"target\" den Wert \"ES3\" aufweist.", "Option_0_cannot_be_specified_with_option_1_5053": "Die Option \"{0}\" darf nicht zusammen mit der Option \"{1}\" angegeben werden.", "Option_0_cannot_be_specified_without_specifying_option_1_5052": "Die Option \"{0}\" darf nicht ohne die Option \"{1}\" angegeben werden.", @@ -839,6 +819,7 @@ "Option_build_must_be_the_first_command_line_argument_6369": "Die Option \"--build\" muss das erste Befehlszeilenargument sein.", "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": "Die Option \"--incremental\" kann nur mit \"tsconfig\" und bei Ausgabe in eine einzelne Datei oder bei Festlegung der Option \"--tsBuildInfoFile\" angegeben werden.", "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "Die Option \"isolatedModules\" kann nur verwendet werden, wenn entweder die Option \"--module\" angegeben ist oder die Option \"target\" den Wert \"ES2015\" oder höher aufweist.", + "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "Die \"path\"-Option kann nicht ohne Angabe der \"-baseUrl\"-Option angegeben werden.", "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "Die Option \"project\" darf nicht mit Quelldateien in einer Befehlszeile kombiniert werden.", "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071": "Die Option \"--resolveJsonModule\" kann nur angegeben werden, wenn die Modulcodegenerierung \"commonjs\", \"amd\", \"es2015\" oder \"esNext\" lautet.", "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "Die Option \"--resolveJsonModule\" kann nicht ohne die Modulauflösungsstrategie \"node\" angegeben werden.", @@ -891,7 +872,6 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Der Parametertyp des öffentlichen statischen Setters \"{0}\" aus der exportierten Klasse besitzt oder verwendet den privaten Namen \"{1}\".", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Im Strict-Modus analysieren und \"use strict\" für jede Quelldatei ausgeben.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "Das Muster \"{0}\" darf höchstens ein Zeichen \"*\" aufweisen.", - "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": "Leistungsdaten zum zeitlichen Ablauf sind für \"--diagnostics\" oder \"--extendedDiagnostics\" in dieser Sitzung nicht verfügbar. Eine native Implementierung der Webleistungs-API wurde nicht gefunden.", "Prefix_0_with_an_underscore_90025": "\"{0}\" einen Unterstrich voranstellen", "Prefix_all_incorrect_property_declarations_with_declare_95095": "Verwenden Sie für alle falschen Eigenschaftendeklarationen das Präfix \"declare\".", "Prefix_all_unused_declarations_with_where_possible_95025": "Alle nicht verwendeten Deklarationen nach Möglichkeit mit dem Präfix \"_\" versehen", @@ -923,7 +903,6 @@ "Property_0_does_not_exist_on_const_enum_1_2479": "Die Eigenschaft \"{0}\" ist für die const-Enumeration \"{1}\" nicht vorhanden.", "Property_0_does_not_exist_on_type_1_2339": "Die Eigenschaft \"{0}\" ist für den Typ \"{1}\" nicht vorhanden.", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "Die Eigenschaft \"{0}\" existiert nicht für Typ \"{1}\". Meinten Sie \"{2}\"?", - "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": "Die Eigenschaft \"{0}\" ist für den Typ \"{1}\" nicht vorhanden. Müssen Sie Ihre Zielbibliothek ändern? Ändern Sie die Compileroption \"lib\" in \"{2}\" oder höher.", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "Die Eigenschaft \"{0}\" weist keinen Initialisierer auf und ist im Konstruktor nicht definitiv zugewiesen.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "Die Eigenschaft \"{0}\" weist implizit den Typ \"any\" auf, weil ihrem get-Accessor eine Parametertypanmerkung fehlt.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "Die Eigenschaft \"{0}\" weist implizit den Typ \"any\" auf, weil ihrem set-Accessor eine Parametertypanmerkung fehlt.", @@ -961,7 +940,6 @@ "Property_or_signature_expected_1131": "Eine Eigenschaft oder Signatur wurde erwartet.", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "Der Eigenschaftswert kann nur ein Zeichenfolgenliteral, ein numerisches Literal, \"true\", \"false\", \"NULL\", ein Objektliteral oder ein Arrayliteral sein.", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "Bieten Sie vollständige Unterstützung für Iterablen in \"for-of\", Verteilung und Destrukturierung mit dem Ziel \"ES5\" oder \"ES3\".", - "Provides_a_root_package_name_when_using_outFile_with_declarations_1390": "Stellt einen Stammpaketnamen bereit, wenn \"outFile\" mit Deklarationen verwendet wird.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "Die öffentliche Methode \"{0}\" der exportierten Klasse besitzt oder verwendet den Namen \"{1}\" aus dem externen Modul \"{2}\", kann aber nicht benannt werden.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "Die öffentliche Methode \"{0}\" der exportierten Klasse besitzt oder verwendet den Namen \"{1}\" aus dem privaten Modul \"{2}\".", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "Die öffentliche Methode \"{0}\" der exportierten Klasse besitzt oder verwendet den privaten Namen \"{1}\".", @@ -1088,7 +1066,6 @@ "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "Geben Sie die Zeilenendesequenz an, die beim Ausgeben von Dateien verwendet werden soll: \"CRLF\" (DOS) oder \"LF\" (Unix).", "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": "Geben Sie den Speicherort an, an dem der Debugger TypeScript-Dateien ermitteln soll, anstatt Quellspeicherorte zu verwenden.", "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "Geben Sie den Speicherort an, an dem der Debugger Zuordnungsdateien ermitteln soll, anstatt generierte Speicherorte zu verwenden.", - "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": "Geben Sie den Modulspezifizierer an, aus dem die Factoryfunktionen \"jsx\" und \"jsxs\" importiert werden sollen, z. B. \"react\".", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Geben Sie das Stammverzeichnis der Eingabedateien an. Verwenden Sie diese Angabe, um die Ausgabeverzeichnisstruktur mithilfe von \"-outDir\" zu steuern.", "Split_all_invalid_type_only_imports_1367": "Alle ungültigen reinen Typenimporte teilen", "Split_into_two_separate_import_declarations_1366": "In zwei separate Importdeklarationen teilen", @@ -1130,8 +1107,6 @@ "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496": "Auf das Objekt \"arguments\" darf in einer Pfeilfunktion in ES3 und ES5 nicht verwiesen werden. Verwenden Sie ggf. einen Standardfunktionsausdruck.", "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "Auf das Objekt \"arguments\" darf in einer asynchronen Funktion oder Methode in ES3 und ES5 nicht verwiesen werden. Verwenden Sie ggf. eine Standardfunktion oder -methode.", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "Der Text einer \"if\"-Anweisung kann keine leere Anweisung sein.", - "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391": "Die Option \"bundledPackageName\" muss angegeben werden, wenn \"outFile\" und die Knotenmodulauflösung mit der Deklarationsausgabe verwendet werden.", - "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": "Der Aufruf wäre für diese Implementierung erfolgreich, aber die Implementierungssignaturen von Überladungen sind nicht extern sichtbar.", "The_character_set_of_the_input_files_6163": "Der Zeichensatz der Eingabedateien.", "The_containing_arrow_function_captures_the_global_value_of_this_7041": "Die enthaltende Pfeilfunktion erfasst den globalen Wert von \"this\".", "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "Der beinhaltende Funktions- oder Modulkörper ist zu groß für eine Ablaufsteuerungsanalyse.", @@ -1150,10 +1125,8 @@ "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "Der abgeleitete Typ von \"{0}\" kann nicht ohne einen Verweis auf \"{1}\" benannt werden. Eine Portierung ist wahrscheinlich nicht möglich. Eine Typanmerkung ist erforderlich.", "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "Der abgeleitete Typ von \"{0}\" verweist auf einen Typ mit zyklischer Struktur, die nicht trivial serialisiert werden kann. Es ist eine Typanmerkung erforderlich.", "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "Der abgeleitete Typ von \"{0}\" verweist auf einen Typ \"{1}\", auf den nicht zugegriffen werden kann. Eine Typanmerkung ist erforderlich.", - "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": "Der abgeleitete Typ dieses Knotens überschreitet die maximale Länge, die vom Compiler serialisiert wird. Eine explizite Typanmerkung ist erforderlich.", "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": "Die Schnittmenge \"{0}\" wurde auf \"niemals\" reduziert, weil die Eigenschaft \"{1}\" in mehreren Bestandteilen vorhanden und in einigen davon privat ist.", "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": "Die Schnittmenge \"{0}\" wurde auf \"niemals\" reduziert, weil die Eigenschaft \"{1}\" in einigen Bestandteilen widersprüchliche Typen aufweist.", - "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": "Das Schlüsselwort \"intrinsic\" darf nur zum Deklarieren von vom Compiler bereitgestellten intrinsischen Typen verwendet werden.", "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": "Um JSX-Fragmente mit der Compileroption \"jsxFactory\" zu verwenden, muss die Compileroption \"jsxFragmentFactory\" angegeben werden.", "The_last_overload_gave_the_following_error_2770": "Die letzte Überladung hat den folgenden Fehler verursacht.", "The_last_overload_is_declared_here_2771": "Die letzte Überladung wird hier deklariert.", @@ -1230,7 +1203,7 @@ "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Deklarationen der obersten Ebene in .d.ts-Dateien müssen entweder mit einem declare- oder einem export-Modifizierer beginnen.", "Trailing_comma_not_allowed_1009": "Ein nachgestelltes Komma ist unzulässig.", "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "Jede Datei als separates Modul transpilieren (ähnlich wie bei \"ts.transpileModule\").", - "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "Versuchen Sie es mit \"npm i --save-dev @types/{1}\", sofern vorhanden, oder fügen Sie eine neue Deklarationsdatei (.d.ts) hinzu, die \"declare module '{0}';\" enthält.", + "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035": "Versuchen Sie es mit \"npm install @types/{1}\", sofern vorhanden, oder fügen Sie eine neue Deklarationsdatei (.d.ts) hinzu, die \"declare module '{0}';\" enthält.", "Trying_other_entries_in_rootDirs_6110": "Andere Einträge in \"rootDirs\" werden versucht.", "Trying_substitution_0_candidate_module_location_Colon_1_6093": "Die Ersetzung \"{0}\" wird versucht. Speicherort des Kandidatenmoduls: \"{1}\".", "Tuple_members_must_all_have_names_or_all_not_have_names_5084": "Von den Tupelelementen müssen entweder alle oder keines einen Namen aufweisen.", @@ -1305,7 +1278,6 @@ "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": "======== Die Typverweisdirektive \"{0}\" wurde erfolgreich in \"{1}\" aufgelöst. Primär: {2}. ========", "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": "======== Die Typverweisdirektive \"{0}\" wurde erfolgreich in \"{1}\" mit Paket-ID \"{2}\" aufgelöst. Primär: {3}. ========", "Types_have_separate_declarations_of_a_private_property_0_2442": "Typen weisen separate Deklarationen einer privaten Eigenschaft \"{0}\" auf.", - "Types_of_construct_signatures_are_incompatible_2419": "Die Typen der Konstruktsignaturen sind nicht kompatibel.", "Types_of_parameters_0_and_1_are_incompatible_2328": "Die Typen der Parameter \"{0}\" und \"{1}\" sind nicht kompatibel.", "Types_of_property_0_are_incompatible_2326": "Die Typen der Eigenschaft \"{0}\" sind nicht kompatibel.", "Unable_to_open_file_0_6050": "Die Datei \"{0}\" kann nicht geöffnet werden.", @@ -1378,7 +1350,6 @@ "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": "\"{0}\" kann nur mit einem Aufruf von \"require\" oder durch Verwendung eines Standardimports importiert werden.", "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": "\"{0}\" kann nur mit \"import {1} = require({2})\" oder über einen Standardimport importiert werden.", "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": "\"{0}\" kann nur mit \"import {1} = require({2})\" oder durch Aktivieren des Flags \"esModuleInterop\" und Verwendung eines Standardimports importiert werden.", - "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208": "\"{0}\" wird als globale Skriptdatei betrachtet und kann daher nicht unter \"--isolatedModules\" kompiliert werden. Fügen Sie zum Festlegen als Modul eine Import-, Export- oder eine leere \"export {}\"-Anweisung hinzu.", "_0_cannot_be_used_as_a_JSX_component_2786": "\"{0}\" kann nicht als JSX-Komponente verwendet werden.", "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": "\"{0}\" kann nicht als Wert verwendet werden, weil der Export mit \"export type\" durchgeführt wurde.", "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": "\"{0}\" kann nicht als Wert verwendet werden, weil der Import mit \"import type\" durchgeführt wurde.", @@ -1386,7 +1357,6 @@ "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": "\"{0}\" konnte mit einem arbiträren Typ instanziiert werden, der mit \"{1}\" möglicherweise in keinem Zusammenhang steht.", "_0_declarations_can_only_be_used_in_TypeScript_files_8006": "{0}-Deklarationen können nur in TypeScript-Dateien verwendet werden.", "_0_expected_1005": "\"{0}\" wurde erwartet.", - "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": "\"{0}\" umfasst keinen exportierten Member namens \"{1}\". Meinten Sie \"{2}\"?", "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": "\"{0}\" weist implizit einen Rückgabetyp \"{1}\" auf, möglicherweise kann jedoch ein besserer Typ aus der Syntax abgeleitet werden.", "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": "\"{0}\" weist implizit den Typ \"any\" auf, weil keine Rückgabetypanmerkung vorhanden ist und darauf direkt oder indirekt in einem der Rückgabeausdrücke des Objekts verwiesen wird.", "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": "\"{0}\" weist implizit den Typ \"any\" auf, weil keine Typanmerkung vorhanden ist und darauf direkt oder indirekt im eigenen Initialisierer verwiesen wird.", @@ -1399,19 +1369,18 @@ "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "\"{0}\" ist als Accessor in der Klasse \"{1}\" definiert, wird aber hier in \"{2}\" als Instanzeigenschaft überschrieben.", "_0_is_deprecated_6385": "\"{0}\" ist veraltet.", "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "\"{0}\" ist keine gültige Metaeigenschaft für das Schlüsselwort \"{1}\". Meinten Sie \"{2}\"?", - "_0_is_not_allowed_as_a_variable_declaration_name_1389": "\"{0}\" ist als Name für Variablendeklarationen nicht zulässig.", "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "Auf \"{0}\" wird direkt oder indirekt im eigenen Basisausdruck verwiesen.", "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "Auf \"{0}\" wird direkt oder indirekt in der eigenen Typanmerkung verwiesen.", "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": "\"{0}\" wurde mehrmals angegeben, deshalb wird dieses Vorkommen überschrieben.", "_0_list_cannot_be_empty_1097": "Die {0}-Liste darf nicht leer sein.", "_0_modifier_already_seen_1030": "Der {0}-Modifizierer ist bereits vorhanden.", + "_0_modifier_cannot_appear_on_a_class_element_1031": "Der Modifizierer \"{0}\" darf nicht für ein Klassenelement verwendet werden.", "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": "Der Modifizierer \"{0}\" darf nicht für eine Konstruktordeklaration verwendet werden.", "_0_modifier_cannot_appear_on_a_data_property_1043": "Der Modifizierer \"{0}\" darf nicht für eine Dateneigenschaft verwendet werden.", "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": "Der Modifizierer \"{0}\" darf nicht für ein Modul- oder Namespaceelement verwendet werden.", "_0_modifier_cannot_appear_on_a_parameter_1090": "Der Modifizierer \"{0}\" darf nicht für einen Parameter verwendet werden.", "_0_modifier_cannot_appear_on_a_type_member_1070": "Der Modifizierer \"{0}\" darf nicht für einen Typmember verwendet werden.", "_0_modifier_cannot_appear_on_an_index_signature_1071": "Der Modifizierer \"{0}\" darf nicht für eine Indexsignatur verwendet werden.", - "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": "Der Modifizierer \"{0}\" kann nicht für Klassenelemente dieser Art verwendet werden.", "_0_modifier_cannot_be_used_here_1042": "Der Modifizierer \"{0}\" kann hier nicht verwendet werden.", "_0_modifier_cannot_be_used_in_an_ambient_context_1040": "Der Modifizierer \"{0}\" kann nicht in einem Umgebungskontext verwendet werden.", "_0_modifier_cannot_be_used_with_1_modifier_1243": "Der Modifizierer \"{0}\" darf nicht mit dem Modifizierer \"{1}\" verwendet werden.", @@ -1421,7 +1390,6 @@ "_0_needs_an_explicit_type_annotation_2782": "\"{0}\" erfordert eine explizite Typanmerkung.", "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": "\"{0}\" bezieht sich nur auf einen Typ, wird hier jedoch als Namespace verwendet.", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "\"{0}\" bezieht sich nur auf einen Typ, wird aber hier als Wert verwendet.", - "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": "\"{0}\" bezieht sich nur auf einen Typ, wird hier jedoch als Wert verwendet. Wollten Sie \"{1} in {0}\" verwenden?", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "\"{0}\" bezieht sich nur auf einen Typ, wird hier jedoch als Wert verwendet. Müssen Sie Ihre Zielbibliothek ändern? Ändern Sie die Compileroption \"lib\" in \"es2015\" oder höher.", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "\"{0}\" bezieht sich auf eine globale UMD, die aktuelle Datei ist jedoch ein Modul. Ziehen Sie in Betracht, stattdessen einen Import hinzuzufügen.", "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "\"{0}\" bezieht sich auf einen Wert, wird hier jedoch als Typ verwendet. Meinten Sie \"typeof {0}\"?", @@ -1458,7 +1426,6 @@ "extends_clause_already_seen_1172": "Die extends-Klausel ist bereits vorhanden.", "extends_clause_must_precede_implements_clause_1173": "Die extends-Klausel muss der implements-Klausel vorangestellt sein.", "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "Die \"extends\"-Klausel der exportierten Klasse \"{0}\" besitzt oder verwendet den privaten Namen \"{1}\".", - "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "Die extends-Klausel der exportierten Klasse besitzt oder verwendet den privaten Namen \"{0}\".", "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "Die \"extends\"-Klausel der exportierten Schnittstelle \"{0}\" besitzt oder verwendet den privaten Namen \"{1}\".", "file_6025": "Datei", "get_and_set_accessor_must_have_the_same_this_type_2682": "Die get- und set-Accessoren müssen den gleichen this-Typ aufweisen.", diff --git a/node_modules/typescript/lib/es/diagnosticMessages.generated.json b/node_modules/typescript/lib/es/diagnosticMessages.generated.json index 469d989..374c937 100644 --- a/node_modules/typescript/lib/es/diagnosticMessages.generated.json +++ b/node_modules/typescript/lib/es/diagnosticMessages.generated.json @@ -151,8 +151,6 @@ "Add_undefined_type_to_property_0_95018": "Agregar un tipo \"undefined\" a la propiedad \"{0}\"", "Add_unknown_conversion_for_non_overlapping_types_95069": "Agregar una conversión \"unknown\" para los tipos que no se superponen", "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": "Agregar \"unknown\" a todas las conversiones de tipos que no se superponen", - "Add_void_to_Promise_resolved_without_a_value_95143": "Agregar \"void\" a la instancia de Promise resuelta sin un valor", - "Add_void_to_all_Promises_resolved_without_a_value_95144": "Agregar \"void\" a todas las instancias de Promise resueltas sin un valor", "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Agregar un archivo tsconfig.json ayuda a organizar los proyectos que contienen archivos TypeScript y JavaScript. Más información en https://aka.ms/tsconfig.", "Additional_Checks_6176": "Comprobaciones adicionales", "Advanced_Options_6178": "Opciones avanzadas", @@ -160,6 +158,7 @@ "All_declarations_of_0_must_have_identical_type_parameters_2428": "Todas las declaraciones de '{0}' deben tener parámetros de tipo idénticos.", "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Todas las declaraciones de un método abstracto deben ser consecutivas.", "All_destructured_elements_are_unused_6198": "Todos los elementos desestructurados están sin utilizar.", + "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208": "Todos los archivos deben ser módulos cuando se proporciona la marca \"--isolatedModules\".", "All_imports_in_import_declaration_are_unused_6192": "Todas las importaciones de la declaración de importación están sin utilizar.", "All_type_parameters_are_unused_6205": "Ninguno de los parámetros de tipo se usa.", "All_variables_are_unused_6199": "Todas las variables son no utilizadas.", @@ -235,7 +234,6 @@ "Argument_expression_expected_1135": "Se esperaba una expresión de argumento.", "Argument_for_0_option_must_be_Colon_1_6046": "El argumento para la opción \"{0}\" debe ser {1}.", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "No se puede asignar un argumento de tipo \"{0}\" al parámetro de tipo \"{1}\".", - "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "No se proporcionaron argumentos para el parámetro rest \"{0}\".", "Array_element_destructuring_pattern_expected_1181": "Se esperaba un patrón de desestructuración de elementos de matriz.", "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": "Las aserciones requieren que todos los nombres del destino de llamada se declaren con una anotación de tipo explícito.", "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": "Las aserciones requieren que el destino de llamada sea un identificador o un nombre calificado.", @@ -261,7 +259,6 @@ "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "La signatura de llamada, que carece de una anotación de tipo de valor devuelto, tiene implícitamente un tipo de valor devuelto \"any\".", "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204": "Las signaturas de llamada sin argumentos tienen los tipos de valor devuelto \"{0}\" y \"{1}\" no compatibles.", "Call_target_does_not_contain_any_signatures_2346": "El destino de llamada no contiene signaturas.", - "Can_only_convert_logical_AND_access_chains_95142": "Solo pueden convertirse las cadenas lógicas Y de acceso", "Can_only_convert_property_with_modifier_95137": "Solo se puede convertir la propiedad con el modificador", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "No se puede acceder a \"{0}.{1}\" porque \"{0}\" es un tipo, no un espacio de nombres. ¿Su intención era recuperar el tipo de la propiedad \"{1}\" en \"{0}\" con \"{0}[\"{1}\"]\"?", "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748": "No se puede acceder a las enumeraciones const de ambiente cuando se proporciona la marca \"--isolatedModules\".", @@ -285,20 +282,19 @@ "Cannot_find_lib_definition_for_0_2726": "No se encuentra la definición lib para \"{0}\".", "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "No se encuentra la definición lib para \"{0}\". ¿Quiso decir \"{1}\"?", "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "No se encuentra el módulo \"{0}\". Considere la posibilidad de usar \"--resolveJsonModule\" para importar el módulo con la extensión \".json\".", - "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "No se encuentra el módulo \"{0}\". ¿Pretendía establecer la opción \"moduleResolution\" en \"node\" o agregar alias a la opción \"paths\"?", "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "No se encuentra el módulo \"{0}\" ni sus declaraciones de tipos correspondientes.", "Cannot_find_name_0_2304": "No se encuentra el nombre '{0}'.", "Cannot_find_name_0_Did_you_mean_1_2552": "No se encuentra el nombre \"{0}\". ¿Quería decir \"{1}\"?", "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "No se encuentra el nombre '{0}'. ¿Quería decir el miembro de instancia 'this.{0}'?", "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": "No se encuentra el nombre '{0}'. ¿Quería decir el miembro estático '{1}.{0}'?", - "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "No se encuentra el nombre \"{0}\". ¿Necesita cambiar la biblioteca de destino? Pruebe a cambiar la opción del compilador \"lib\" a \"{1}\" o posterior.", + "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "No se encuentra el nombre \"{0}\". ¿Necesita cambiar la biblioteca de destino? Pruebe a cambiar la opción del compilador \"lib\" a es2015 o posterior.", "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": "No se encuentra el nombre \"{0}\". ¿Necesita cambiar la biblioteca de destino? Pruebe a cambiar la opción del compilador \"lib\" para incluir \"dom\".", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": "No se encuentra el nombre \"{0}\". ¿Necesita instalar definiciones de tipo para un ejecutor de pruebas? Pruebe \"npm i --save-dev @types/jest\" o \"npm i --save-dev @types/mocha\".", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": "No se encuentra el nombre \"{0}\". ¿Necesita instalar definiciones de tipo para un ejecutor de pruebas? Pruebe \"npm i --save-dev @types/jest\" o \"npm i --save-dev @types/mocha\" y, a continuación, agregue \"jest\" o \"mocha\" al campo de tipos del archivo tsconfig.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": "No se encuentra el nombre \"{0}\". ¿Necesita instalar definiciones de tipo para jQuery? Pruebe \"npm i --save-dev @types/jquery\".", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": "No se encuentra el nombre \"{0}\". ¿Necesita instalar definiciones de tipo para jQuery? Pruebe \"npm i --save-dev @types/jquery\" y, a continuación, agregue \"jquery\" al campo de tipos del archivo tsconfig.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": "No se encuentra el nombre \"{0}\". ¿Necesita instalar definiciones de tipo para el nodo? Pruebe \"npm i --save-dev @types/node\".", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": "No se encuentra el nombre \"{0}\". ¿Necesita instalar definiciones de tipo para el nodo? Pruebe \"npm i --save-dev @types/node\" y, a continuación, agregue \"node\" al campo de tipos del archivo tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582": "No se encuentra el nombre \"{0}\". ¿Necesita instalar definiciones de tipo para un ejecutor de pruebas? Pruebe \"npm i @types/jest\" o \"npm i @types/mocha\".", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593": "No se encuentra el nombre \"{0}\". ¿Necesita instalar definiciones de tipo para un ejecutor de pruebas? Pruebe \"npm i @types/jest\" o \"npm i @types/mocha\" y, a continuación, agregue \"jest\" o \"mocha\" al campo de tipos del archivo tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581": "No se encuentra el nombre \"{0}\". ¿Necesita instalar definiciones de tipo para jQuery? Pruebe \"npm i @types/jquery\".", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592": "No se encuentra el nombre \"{0}\". ¿Necesita instalar definiciones de tipo para jQuery? Pruebe \"npm i @types/jquery\" y, a continuación, agregue \"jquery\" al campo de tipos del archivo tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580": "No se encuentra el nombre \"{0}\". ¿Necesita instalar definiciones de tipo para el nodo? Pruebe \"npm i @types/node\".", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591": "No se encuentra el nombre \"{0}\". ¿Necesita instalar definiciones de tipo para el nodo? Pruebe \"npm i @types/node\" y, a continuación, agregue \"node\" al campo de tipos del archivo tsconfig.", "Cannot_find_namespace_0_2503": "No se encuentra el espacio de nombres '{0}'.", "Cannot_find_parameter_0_1225": "No se encuentra el parámetro '{0}'.", "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": "No se encuentra la ruta de acceso de subdirectorio común para los archivos de entrada.", @@ -369,13 +365,10 @@ "Constructor_implementation_is_missing_2390": "Falta la implementación del constructor.", "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673": "El constructor de la clase '{0}' es privado y solo es accesible desde la declaración de la clase.", "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "El constructor de la clase '{0}' está protegido y solo es accesible desde la declaración de la clase.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386": "La notación de tipo de constructor debe incluirse entre paréntesis cuando se use en un tipo de unión.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388": "La notación de tipo de constructor debe incluirse entre paréntesis cuando se use en un tipo de intersección.", "Constructors_for_derived_classes_must_contain_a_super_call_2377": "Los constructores de las clases derivadas deben contener una llamada a \"super\".", "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "El archivo contenedor no se ha especificado y no se puede determinar el directorio raíz. Se omitirá la búsqueda en la carpeta 'node_modules'.", "Containing_function_is_not_an_arrow_function_95128": "La función contenedora no es una función de flecha", "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": "La conversión del tipo \"{0}\" al tipo \"{1}\" puede ser un error, porque ninguno de los tipos se superpone suficientemente al otro. Si esto era intencionado, convierta primero la expresión en \"unknown\".", - "Convert_0_to_1_in_0_95003": "Convertir \"{0}\" a \"{1} en \"{0}\"", "Convert_0_to_mapped_object_type_95055": "Convertir \"{0}\" en el tipo de objeto asignado", "Convert_all_constructor_functions_to_classes_95045": "Convertir todas las funciones de constructor en clases", "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374": "Convertir todas las importaciones no usadas como valor para las importaciones solo de tipo", @@ -385,7 +378,6 @@ "Convert_all_to_async_functions_95066": "Convertir todo en funciones asincrónicas", "Convert_all_to_bigint_numeric_literals_95092": "Convertir todo en literales numéricos bigint", "Convert_all_to_default_imports_95035": "Convertir todo en importaciones predeterminadas", - "Convert_all_type_literals_to_mapped_type_95021": "Convertir todos los literales de tipo en un tipo asignado", "Convert_arrow_function_or_function_expression_95122": "Convertir una función de flecha o una expresión de función", "Convert_const_to_let_95093": "Convertir \"const\" en \"let\"", "Convert_default_export_to_named_export_95061": "Convertir una exportación predeterminada en exportación con nombre", @@ -407,17 +399,14 @@ "Convert_to_async_function_95065": "Convertir en función asincrónica", "Convert_to_default_import_95013": "Convertir en importación predeterminada", "Convert_to_named_function_95124": "Convertir en función con nombre", - "Convert_to_optional_chain_expression_95139": "Convertir en expresión de cadena opcional", "Convert_to_template_string_95096": "Convertir en cadena de plantilla", "Convert_to_type_only_export_1364": "Convertir en exportación solo de tipo", "Convert_to_type_only_import_1373": "Convertir en importación solo de tipo", "Corrupted_locale_file_0_6051": "Archivo de configuración regional {0} dañado.", "Could_not_find_a_containing_arrow_function_95127": "No se pudo encontrar una función de flecha contenedora", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "No se encontró ningún archivo de declaración para el módulo '{0}'. '{1}' tiene un tipo \"any\" de forma implícita.", - "Could_not_find_convertible_access_expression_95140": "No se encontró la expresión de acceso convertible.", "Could_not_find_export_statement_95129": "No se pudo encontrar la instrucción export", "Could_not_find_import_clause_95131": "No se pudo encontrar la cláusula import", - "Could_not_find_matching_access_expressions_95141": "No se encontraron expresiones de acceso coincidentes.", "Could_not_find_namespace_import_or_named_imports_95132": "No se pudo encontrar la importación del espacio de nombres ni las importaciones con nombre", "Could_not_find_property_for_which_to_generate_accessor_95135": "No se pudo encontrar la propiedad para la que se debe generar el descriptor de acceso", "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231": "No se pudo resolver la ruta de acceso \"{0}\" con las extensiones: {1}.", @@ -429,8 +418,6 @@ "Declaration_expected_1146": "Se esperaba una declaración.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Conflictos entre nombres de declaración con el identificador global '{0}' integrado.", "Declaration_or_statement_expected_1128": "Se esperaba una declaración o una instrucción.", - "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": "Las declaraciones con aserciones de asignación definitiva deben tener también anotaciones de tipo.", - "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": "Las declaraciones con inicializadores no pueden tener también aserciones de asignación definitiva.", "Declare_a_private_field_named_0_90053": "Declare un campo privado denominado \"{0}\".", "Declare_method_0_90023": "Declarar el método \"{0}\"", "Declare_private_method_0_90038": "Declarar el método \"{0}\" privado", @@ -441,6 +428,7 @@ "Decorators_are_not_valid_here_1206": "Los elementos Decorator no son válidos aquí.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "No se pueden aplicar elementos Decorator a varios descriptores de acceso get o set con el mismo nombre.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "La exportación predeterminada del módulo tiene o usa el nombre privado '{0}'.", + "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258": "Las aserciones de asignación definitiva solo se pueden usar junto con una anotación de tipo.", "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": "Las definiciones de los identificadores siguientes entran en conflicto con las de otro archivo: {0}", "Delete_all_unused_declarations_95024": "Eliminar todas las declaraciones sin usar", "Delete_the_outputs_of_all_projects_6365": "Eliminar las salidas de todos los proyectos", @@ -458,7 +446,6 @@ "Digit_expected_1124": "Se esperaba un dígito.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "El directorio \"{0}\" no existe, se omitirán todas las búsquedas en él.", "Disable_checking_for_this_file_90018": "Deshabilitar la comprobación para este archivo", - "Disable_loading_referenced_projects_6235": "Deshabilite la carga de proyectos a los que se hace referencia.", "Disable_size_limitations_on_JavaScript_projects_6162": "Deshabilitar los límites de tamaño de proyectos de JavaScript.", "Disable_solution_searching_for_this_project_6224": "Deshabilite la búsqueda de la solución para este proyecto.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Deshabilite la comprobación estricta de firmas genéricas en tipos de función.", @@ -490,7 +477,7 @@ "Duplicate_number_index_signature_2375": "Signatura de índice de número duplicada.", "Duplicate_property_0_2718": "Propiedad \"{0}\" duplicada.", "Duplicate_string_index_signature_2374": "Signatura de índice de cadena duplicada.", - "Dynamic_import_cannot_have_type_arguments_1326": "La importación dinámica no puede tener argumentos de tipo.", + "Dynamic_import_cannot_have_type_arguments_1326": "La importación dinámica no puede tener argumentos de tipo", "Dynamic_import_must_have_one_specifier_as_an_argument_1324": "La importación dinámica debe tener un especificador como argumento.", "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "El especificador de la importación dinámica debe ser de tipo \"string\", pero aquí tiene el tipo \"{0}\".", "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323": "Las importaciones dinámicas solo se admiten cuando la marca \"--module\" se establece en \"es2020\", \"esnext\", \"commonjs\", \"amd\", \"system\" o \"umd\".", @@ -532,7 +519,6 @@ "Excessive_stack_depth_comparing_types_0_and_1_2321": "Profundidad excesiva de la pila al comparar los tipos '{0}' y '{1}'.", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "Se esperaban argumentos de tipo {0}-{1}; proporciónelos con una etiqueta \"@extends\".", "Expected_0_arguments_but_got_1_2554": "Se esperaban {0} argumentos, pero se obtuvieron {1}.", - "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "Se esperaban {0} argumentos, pero se obtuvo un total de {1}. ¿Olvidó incluir \"void\" en el argumento de tipo para \"Promise\"?", "Expected_0_arguments_but_got_1_or_more_2556": "Se esperaban {0} argumentos, pero se obtuvieron {1} o más.", "Expected_0_type_arguments_but_got_1_2558": "Se esperaban {0} argumentos de tipo, pero se obtuvieron {1}.", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Se esperaban argumentos de tipo {0}; proporciónelos con una etiqueta \"@extends\".", @@ -610,14 +596,11 @@ "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366": "Falta la instrucción \"return\" final en la función y el tipo de valor devuelto no incluye 'undefined'.", "Function_overload_must_be_static_2387": "La sobrecarga de función debe ser estática.", "Function_overload_must_not_be_static_2388": "La sobrecarga de función no debe ser estática.", - "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385": "La notación de tipo de función debe incluirse entre paréntesis cuando se use en un tipo de unión.", - "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387": "La notación de tipo de función debe incluirse entre paréntesis cuando se use en un tipo de intersección.", "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014": "El tipo de función, que carece de una anotación de tipo de valor devuelto, tiene implícitamente un tipo de valor devuelto \"{0}\".", "Generate_get_and_set_accessors_95046": "Generar los descriptores de acceso \"get\" y \"set\"", "Generate_get_and_set_accessors_for_all_overriding_properties_95119": "Generar los descriptores de acceso \"get\" y \"set\" para todas las propiedades de reemplazo", "Generates_a_CPU_profile_6223": "Genera un perfil de CPU.", "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": "Genera un mapa de origen para cada archivo \".d.ts\" correspondiente.", - "Generates_an_event_trace_and_a_list_of_types_6237": "Genera un seguimiento de eventos y una lista de tipos.", "Generates_corresponding_d_ts_file_6002": "Genera el archivo \".d.ts\" correspondiente.", "Generates_corresponding_map_file_6043": "Genera el archivo \".map\" correspondiente.", "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025": "El generador tiene el tipo yield \"{0}\" implícitamente porque no produce ningún valor. Considere la posibilidad de proporcionar una anotación de tipo de valor devuelto.", @@ -662,7 +645,6 @@ "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "En las declaraciones de enumeración de ambiente, el inicializador de miembro debe ser una expresión constante.", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "En una enumeración con varias declaraciones, solo una declaración puede omitir un inicializador para el primer elemento de la enumeración.", "Include_modules_imported_with_json_extension_6197": "Incluir módulos importados con la extensión \".json\"", - "Include_undefined_in_index_signature_results_6800": "Incluir \"undefined\" en los resultados de la signatura de índice", "Index_signature_in_type_0_only_permits_reading_2542": "La signatura de índice del tipo '{0}' solo permite lectura.", "Index_signature_is_missing_in_type_0_2329": "Falta la signatura de índice en el tipo '{0}'.", "Index_signatures_are_incompatible_2330": "Las signaturas de índice no son compatibles.", @@ -694,7 +676,6 @@ "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Valor no válido para \"jsxFactory\". \"{0}\" no es un nombre calificado o un identificador válido.", "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": "Valor no válido para \"jsxFactory\". \"{0}\" no es un nombre cualificado o un identificador válidos.", "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Valor no válido para '--reactNamespace'. '{0}' no es un identificador válido.", - "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": "Es probable que falte una coma para separar estas dos expresiones de plantilla. Forman una expresión de plantilla con etiquetas que no se puede invocar.", "Its_element_type_0_is_not_a_valid_JSX_element_2789": "El tipo de elemento \"{0}\" no es un elemento JSX válido.", "Its_instance_type_0_is_not_a_valid_JSX_element_2788": "El tipo de instancia \"{0}\" no es un elemento JSX válido.", "Its_return_type_0_is_not_a_valid_JSX_element_2787": "El tipo de valor devuelto \"{0}\" no es un elemento JSX válido.", @@ -759,6 +740,7 @@ "Module_0_has_no_default_export_1192": "El módulo '{0}' no tiene ninguna exportación predeterminada.", "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": "El módulo \"{0}\" no tiene ninguna exportación predeterminada. ¿Pretendía usar \"import { {1} } from {0}\" en su lugar?", "Module_0_has_no_exported_member_1_2305": "El módulo '{0}' no tiene ningún miembro '{1}' exportado.", + "Module_0_has_no_exported_member_1_Did_you_mean_2_2724": "El módulo \"{0}\" no tiene ningún miembro exportado \"{1}\". ¿Pretendía utilizar \"{2}\"?", "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": "El módulo \"{0}\" no tiene ningún miembro \"{1}\" exportado. ¿Pretendía usar \"import {1} from {0}\" en su lugar?", "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": "El módulo \"{0}\" está oculto por una declaración local con el mismo nombre.", "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "El módulo '{0}' usa \"export =\" y no se puede usar con \"export *\".", @@ -794,7 +776,6 @@ "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": "La clase '{0}' no abstracta no implementa el miembro abstracto heredado '{1}' de la clase '{2}'.", "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "Una expresión de clase no abstracta no implementa el miembro abstracto heredado '{0}' de la clase '{1}'.", "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": "Las aserciones no nulas solo se pueden usar en los archivos TypeScript.", - "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090": "No se permiten rutas de acceso no relativas si no se ha establecido \"baseUrl\". ¿Ha olvidado poner \"./\" al inicio?", "Non_simple_parameter_declared_here_1348": "Se ha declarado un parámetro no simple aquí.", "Not_all_code_paths_return_a_value_7030": "No todas las rutas de acceso de código devuelven un valor.", "Not_all_constituents_of_type_0_are_callable_2756": "No se puede llamar a todos los constituyentes del tipo \"{0}\".", @@ -830,7 +811,6 @@ "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "La opción \"{0}\" solo puede especificarse en el archivo \"tsconfig.json\" o establecerse en \"false\" o \"null\" en la línea de comandos.", "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "La opción \"{0}\" solo puede especificarse en el archivo \"tsconfig.json\" o establecerse en \"null\" en la línea de comandos.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "La opción '{0}' solo se puede usar cuando se proporciona '--inlineSourceMap' o '--sourceMap'.", - "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": "No se puede especificar la opción \"{0}\" cuando la opción \"jsx\" es \"{1}\".", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "No se puede especificar la opción \"{0}\" cuando la opción \"target\" es \"ES3\".", "Option_0_cannot_be_specified_with_option_1_5053": "La opción '{0}' no se puede especificar con la opción '{1}'.", "Option_0_cannot_be_specified_without_specifying_option_1_5052": "La opción '{0}' no se puede especificar sin la opción '{1}'.", @@ -839,6 +819,7 @@ "Option_build_must_be_the_first_command_line_argument_6369": "La opción \"--build\" debe ser el primer argumento de la línea de comandos.", "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": "La opción \"--incremental\" solo puede especificarse si se usa tsconfig, se emite en un solo archivo o se especifica la opción \"--tsBuildInfoFile\".", "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "La opción \"isolatedModules\" solo se puede usar cuando se proporciona la opción \"--module\" o si la opción \"target\" es \"ES2015\" o una versión posterior.", + "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "La opción 'paths' no se puede usar sin especificar la opción '--baseUrl'.", "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "La opción \"project\" no se puede combinar con archivos de origen en una línea de comandos.", "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071": "La opción \"--resolveJsonModule\" solo puede especificarse cuando la generación de código del módulo es \"commonjs\", \"amd\", \"es2015\" o \"esNext\".", "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "No se puede especificar la opción \"--resolveJsonModule\" sin la estrategia de resolución de módulos \"node\".", @@ -891,7 +872,6 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "El tipo de parámetro del establecedor estático público \"{0}\" de la clase exportada tiene o usa el nombre privado \"{1}\".", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Analiza en modo strict y emite \"use strict\" para cada archivo de código fuente.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "El patrón \"{0}\" puede tener un carácter '*' como máximo.", - "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": "Los intervalos de rendimiento de \"--diagnostics\" o \"--extendedDiagnostics\" no están disponibles en esta sesión. No se encontró ninguna implementación nativa de la API de rendimiento web.", "Prefix_0_with_an_underscore_90025": "Prefijo \"{0}\" con guion bajo", "Prefix_all_incorrect_property_declarations_with_declare_95095": "Agregar el prefijo \"declare\" a todas las declaraciones de propiedad incorrectas", "Prefix_all_unused_declarations_with_where_possible_95025": "Agregar \"_\" como prefijo a todas las declaraciones sin usar, cuando sea posible", @@ -923,7 +903,6 @@ "Property_0_does_not_exist_on_const_enum_1_2479": "La propiedad '{0}' no existe en la enumeración 'const' '{1}'.", "Property_0_does_not_exist_on_type_1_2339": "La propiedad '{0}' no existe en el tipo '{1}'.", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "La propiedad \"{0}\" no existe en el tipo \"{1}\". ¿Quería decir \"{2}\"?", - "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": "No existe la propiedad \"{0}\" en el tipo \"{1}\". ¿Necesita cambiar la biblioteca de destino? Pruebe a cambiar la opción del compilador \"lib\" a \"{2}\" o posterior.", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "La propiedad \"{0}\" no tiene inicializador y no está asignada de forma definitiva en el constructor.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "La propiedad '{0}' tiene el tipo 'any' de forma implícita, porque a su descriptor de acceso get le falta una anotación de tipo de valor devuelto.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "La propiedad '{0}' tiene el tipo 'any' de forma implícita, porque a su descriptor de acceso set le falta una anotación de tipo de parámetro.", @@ -961,7 +940,6 @@ "Property_or_signature_expected_1131": "Se esperaba una propiedad o una signatura.", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "El valor de la propiedad puede ser solo un literal de cadena, literal numérico, 'true', 'false', 'null', literal de objeto o literal de matriz.", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "Proporcionar compatibilidad total con objetos iterables en \"for-of\", propagaciones y desestructuraciones cuando el destino es \"ES5\" o \"ES3\".", - "Provides_a_root_package_name_when_using_outFile_with_declarations_1390": "Proporciona un nombre de paquete raíz al utilizar outFile con declaraciones.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "El método público \"{0}\" de la clase exportada tiene o usa el nombre \"{1}\" del módulo externo {2}, pero no puede tener nombre.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "El método público \"{0}\" de la clase exportada tiene o usa el nombre \"{1}\" del módulo privado \"{2}\".", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "El método público \"{0}\" de la clase exportada tiene o usa el nombre privado \"{1}\".", @@ -994,8 +972,8 @@ "Remove_unnecessary_await_95086": "Quitar elementos \"await\" innecesarios", "Remove_unreachable_code_95050": "Quitar el código inaccesible", "Remove_unused_declaration_for_Colon_0_90004": "Quitar la declaración sin usar para \"{0}\"", - "Remove_unused_declarations_for_Colon_0_90041": "Quite las declaraciones sin usar para \"{0}\"", - "Remove_unused_destructuring_declaration_90039": "Quite la declaración de desestructuración no utilizada", + "Remove_unused_declarations_for_Colon_0_90041": "Quitar las declaraciones sin usar para \"{0}\"", + "Remove_unused_destructuring_declaration_90039": "Quitar la declaración de desestructuración no utilizada", "Remove_unused_label_95053": "Quitar etiqueta no utilizada", "Remove_variable_statement_90010": "Quitar la declaración de variable", "Replace_0_with_Promise_1_90036": "Reemplazar \"{0}\" por \"Promise<{1}>\"", @@ -1088,7 +1066,6 @@ "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "Especifique la secuencia de final de línea que debe usarse para emitir archivos: 'CRLF' (Dos) o 'LF' (Unix).", "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": "Especifique la ubicación donde el depurador debe colocar los archivos de TypeScript en lugar de sus ubicaciones de origen.", "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "Especifique la ubicación donde el depurador debe colocar los archivos de asignaciones en lugar de las ubicaciones generadas.", - "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": "Especifique el especificador de módulo que se va a usar como origen de importación de las funciones de fábrica \"jsx\" y \"jsxs\"; por ejemplo, react", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Especifique el directorio raíz de los archivos de entrada. Úselo para controlar la estructura del directorio de salida con --outDir.", "Split_all_invalid_type_only_imports_1367": "Dividir todas las importaciones solo de tipo no válidas", "Split_into_two_separate_import_declarations_1366": "Dividir en dos declaraciones de importación independientes", @@ -1113,7 +1090,7 @@ "Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337": "No se permiten llamadas a \"super\" fuera de los constructores o en funciones anidadas dentro de estos.", "Suppress_excess_property_checks_for_object_literals_6072": "Suprima las comprobaciones de propiedades en exceso de los literales de objeto.", "Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055": "Eliminar errores de noImplicitAny para los objetos de indexación a los que les falten firmas de índice.", - "Switch_each_misused_0_to_1_95138": "Cambie cada elemento \"{0}\" usado incorrectamente a \"{1}\"", + "Switch_each_misused_0_to_1_95138": "Cambiar cada elemento \"{0}\" usado incorrectamente a \"{1}\"", "Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "La referencia \"Symbol\" no hace referencia al objeto de constructor Symbol global.", "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "Llame a las devoluciones de llamada de forma sincrónica y actualice el estado de los monitores de directorio en las plataformas que no admitan la supervisión recursiva de forma nativa.", "Syntax_Colon_0_6023": "Sintaxis: {0}", @@ -1130,8 +1107,6 @@ "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496": "No se puede hacer referencia al objeto \"arguments\" en una función de flecha en ES3 ni ES5. Considere la posibilidad de usar una expresión de función estándar.", "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "No se puede hacer referencia al objeto \"arguments\" en una función o método asincrónico en ES3 ni ES5. Considere la posibilidad de usar un método o función estándar.", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "El cuerpo de una instrucción \"if\" no puede ser la instrucción vacía.", - "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391": "Se debe proporcionar la opción \"bundledPackageName\" cuando se usa outFile y la resolución del módulo de nodo con emisión de declaración.", - "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": "La llamada se llevaría a cabo sin problemas en esta implementación, pero las signaturas de implementación de las sobrecargas no están visibles externamente.", "The_character_set_of_the_input_files_6163": "Conjunto de caracteres de los archivos de entrada.", "The_containing_arrow_function_captures_the_global_value_of_this_7041": "La función de flecha contenedora captura el valor global de \"this\".", "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "El cuerpo de la función o del módulo contenedor es demasiado grande para realizar un análisis de flujo de control.", @@ -1150,10 +1125,8 @@ "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "No se puede asignar un nombre al tipo inferido de \"{0}\" sin una referencia a \"{1}\". Es probable que no sea portable. Se requiere una anotación de tipo.", "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "El tipo deducido de \"{0}\" hace referencia a un tipo con una estructura cíclica que no se puede serializar trivialmente. Es necesaria una anotación de tipo.", "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "El tipo inferido de \"{0}\" hace referencia a un tipo \"{1}\" no accesible. Se requiere una anotación de tipo.", - "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": "El tipo inferido de este nodo supera la longitud máxima que el compilador podrá serializar. Se necesita una anotación de tipo explícito.", "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": "La intersección \"{0}\" se redujo a \"never\" porque la propiedad \"{1}\" existe en varios constituyentes y es privada en algunos de ellos.", "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": "La intersección \"{0}\" se redujo a \"never\" porque la propiedad \"{1}\" tiene tipos en conflicto en algunos constituyentes.", - "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": "La palabra clave \"intrinsic\" solo se puede usar para declarar tipos intrínsecos proporcionados por el compilador.", "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": "Se debe proporcionar la opción del compilador \"jsxFragmentFactory\" para usar fragmentos de JSX con la opción del compilador \"jsxFactory\".", "The_last_overload_gave_the_following_error_2770": "La última sobrecarga dio el error siguiente.", "The_last_overload_is_declared_here_2771": "La última sobrecarga se declara aquí.", @@ -1230,7 +1203,7 @@ "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Las declaraciones de nivel superior de los archivos .d.ts deben comenzar con un modificador \"declare\" o \"export\".", "Trailing_comma_not_allowed_1009": "No se permite la coma final.", "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "Transpilar cada archivo como un módulo aparte (parecido a \"ts.transpileModule\").", - "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "Pruebe \"npm i --save-dev @types/{1}\" si existe o agregue un nuevo archivo de declaración (.d.ts) que incluya \"declare module '{0}';\".", + "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035": "Pruebe \"npm install @types/{1}\" si existe o agregue un nuevo archivo de declaración (.d.ts) que incluya \"declare module '{0}';\".", "Trying_other_entries_in_rootDirs_6110": "Se probarán otras entradas de \"rootDirs\".", "Trying_substitution_0_candidate_module_location_Colon_1_6093": "Probando la sustitución '{0}', ubicación candidata para el módulo: '{1}'.", "Tuple_members_must_all_have_names_or_all_not_have_names_5084": "Todos los miembros de tupla deben tener nombres o no debe tenerlo ninguno de ellos.", @@ -1305,7 +1278,6 @@ "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": "======== La directiva de referencia de tipo '{0}' se resolvió correctamente como '{1}', principal: {2}. ========", "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": "======== La directiva de referencia de tipo \"{0}\" se resolvió correctamente como \"{1}\" con el identificador de paquete \"{2}\", principal: {3}. ========", "Types_have_separate_declarations_of_a_private_property_0_2442": "Los tipos tienen declaraciones independientes de una propiedad '{0}' privada.", - "Types_of_construct_signatures_are_incompatible_2419": "Los tipos de signaturas de construcción son incompatibles.", "Types_of_parameters_0_and_1_are_incompatible_2328": "Los tipos de parámetros '{0}' y '{1}' no son compatibles.", "Types_of_property_0_are_incompatible_2326": "Los tipos de propiedad '{0}' no son compatibles.", "Unable_to_open_file_0_6050": "No se puede abrir el archivo '{0}'.", @@ -1378,7 +1350,6 @@ "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": "\"{0}\" solo se puede importar si se usa una llamada a \"require\" o una importación predeterminada.", "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": "\"{0}\" solo se puede importar si se usa \"import {1} = require({2})\" o una importación predeterminada.", "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": "\"{0}\" solo se puede importar si se usa \"import {1} = require({2})\" o bien se activa la marca \"esModuleInterop\" y se usa una importación predeterminada.", - "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208": "\"{0}\" no se puede compilar bajo \"--isolatedModules\" porque se considera un archivo de script global. Agregue una instrucción import o export, o una instrucción \"export {}\" vacía para convertirla en un módulo.", "_0_cannot_be_used_as_a_JSX_component_2786": "No se puede usar \"{0}\" como componente JSX.", "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": "No se puede usar \"{0}\" como valor porque se exportó mediante \"export type\".", "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": "No se puede usar \"{0}\" como valor porque se importó mediante \"import type\".", @@ -1386,7 +1357,6 @@ "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": "Puede crearse una instancia de \"{0}\" con un tipo arbitrario que podría no estar relacionado con \"{1}\".", "_0_declarations_can_only_be_used_in_TypeScript_files_8006": "Las declaraciones \"{0}\" solo se pueden usar en los archivos TypeScript.", "_0_expected_1005": "Se esperaba '{0}'.", - "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": "\"{0}\" no tiene ningún miembro exportado con el nombre \"{1}\". ¿Pretendía usar \"{2}\"?", "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": "\"{0}\" tiene un tipo de valor devuelto \"{1}\" de forma implícita, pero se puede inferir un tipo más adecuado a partir del uso.", "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": "'{0}' tiene el tipo de valor devuelto \"any\" implícitamente porque no tiene una anotación de tipo de valor devuelto y se hace referencia a este directa o indirectamente en una de sus expresiones return.", "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": "'{0}' tiene el tipo de valor devuelto \"any\" implícitamente porque no tiene una anotación de tipo y se hace referencia a este directa o indirectamente en su propio inicializador.", @@ -1399,19 +1369,18 @@ "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "\"{0}\" se define como descriptor de acceso en la clase \"{1}\", pero se reemplaza aquí en \"{2}\" como propiedad de instancia.", "_0_is_deprecated_6385": "\"{0}\" está en desuso", "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "\"{0}\" no es una propiedad Meta válida para la palabra clave \"{1}\". ¿Pretendía usar \"{2}\"?", - "_0_is_not_allowed_as_a_variable_declaration_name_1389": "No se permite \"{0}\" como nombre de declaración de variable.", "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "Se hace referencia a '{0}' directa o indirectamente en su propia expresión base.", "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "Se hace referencia a '{0}' directa o indirectamente en su propia anotación de tipo.", "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": "\"{0}\" se ha especificado más de una vez, por lo que se sobrescribirá este uso.", "_0_list_cannot_be_empty_1097": "La lista '{0}' no puede estar vacía.", "_0_modifier_already_seen_1030": "El modificador '{0}' ya se ha visto.", + "_0_modifier_cannot_appear_on_a_class_element_1031": "El modificador '{0}' no puede aparecer en un elemento de clase.", "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": "El modificador '{0}' no puede aparecer en una declaración de constructor.", "_0_modifier_cannot_appear_on_a_data_property_1043": "El modificador '{0}' no puede aparecer en una propiedad data.", "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": "El modificador '{0}' no puede aparecer en un módulo o un elemento de espacio de nombres.", "_0_modifier_cannot_appear_on_a_parameter_1090": "El modificador '{0}' no puede aparecer en un parámetro.", "_0_modifier_cannot_appear_on_a_type_member_1070": "El modificador '{0}' no puede aparecer en un miembro de tipo.", "_0_modifier_cannot_appear_on_an_index_signature_1071": "El modificador '{0}' no puede aparecer en una signatura de índice.", - "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": "El modificador \"{0}\" no puede aparecer en elementos de clase de este tipo.", "_0_modifier_cannot_be_used_here_1042": "El modificador '{0}' no se puede usar aquí.", "_0_modifier_cannot_be_used_in_an_ambient_context_1040": "El modificador '{0}' no se puede usar en un contexto de ambiente.", "_0_modifier_cannot_be_used_with_1_modifier_1243": "El modificador '{0}' no se puede usar con el modificador '{1}'.", @@ -1421,7 +1390,6 @@ "_0_needs_an_explicit_type_annotation_2782": "\"{0}\" necesita una anotación de tipo explícito.", "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": "'{0}' solo hace referencia a un tipo, pero aquí se usa como espacio de nombres.", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "'{0}' solo hace referencia a un tipo, pero aquí se usa como valor.", - "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": "\"{0}\" solo hace referencia a un tipo, pero aquí se usa como valor. ¿Pretendía usar \"{1} en {0}\"?", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "\"{0}\" solo hace referencia a un tipo, pero aquí se usa como valor. ¿Necesita cambiar la biblioteca de destino? Pruebe a cambiar la opción del compilador \"lib\" a es2015 o posterior.", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "'{0}' hace referencia a un elemento UMD global, pero el archivo actual es un módulo. Puede agregar una importación en su lugar.", "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "\"{0}\" hace referencia a un valor, pero aquí se usa como tipo. ¿Quiso decir \"typeof {0}\"?", @@ -1458,7 +1426,6 @@ "extends_clause_already_seen_1172": "La cláusula \"extends\" ya se ha visto.", "extends_clause_must_precede_implements_clause_1173": "La cláusula \"extends\" debe preceder a la cláusula \"implements\".", "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "La cláusula \"extends\" de la clase \"{0}\" exportada tiene o usa el nombre privado \"{1}\".", - "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "La cláusula \"extends\" de la clase exportada tiene o usa el nombre privado \"{0}\".", "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "La cláusula \"extends\" de la interfaz \"{0}\" exportada tiene o usa el nombre privado \"{1}\".", "file_6025": "archivo", "get_and_set_accessor_must_have_the_same_this_type_2682": "Los descriptores de acceso 'get' y 'set' deben tener el mismo tipo 'this'.", diff --git a/node_modules/typescript/lib/fr/diagnosticMessages.generated.json b/node_modules/typescript/lib/fr/diagnosticMessages.generated.json index 77604a6..cc835c5 100644 --- a/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +++ b/node_modules/typescript/lib/fr/diagnosticMessages.generated.json @@ -151,8 +151,6 @@ "Add_undefined_type_to_property_0_95018": "Ajouter un type 'undefined' à la propriété '{0}'", "Add_unknown_conversion_for_non_overlapping_types_95069": "Ajouter une conversion 'unknown' pour les types qui ne se chevauchent pas", "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": "Ajouter 'unknown' à toutes les conversions de types qui ne se chevauchent pas", - "Add_void_to_Promise_resolved_without_a_value_95143": "Ajouter 'void' à un Promise résolu sans valeur", - "Add_void_to_all_Promises_resolved_without_a_value_95144": "Ajouter 'void' à toutes les promesses résolues sans valeur", "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "L'ajout d'un fichier tsconfig.json permet d'organiser les projets qui contiennent des fichiers TypeScript et JavaScript. En savoir plus sur https://aka.ms/tsconfig.", "Additional_Checks_6176": "Vérifications supplémentaires", "Advanced_Options_6178": "Options avancées", @@ -160,8 +158,9 @@ "All_declarations_of_0_must_have_identical_type_parameters_2428": "Toutes les déclarations de '{0}' doivent avoir des paramètres de type identiques.", "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Toutes les déclarations d'une méthode abstraite doivent être consécutives.", "All_destructured_elements_are_unused_6198": "Tous les éléments déstructurés sont inutilisés.", + "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208": "Tous les fichiers doivent être des modules quand l'indicateur '--isolatedModules' est fourni.", "All_imports_in_import_declaration_are_unused_6192": "Les importations de la déclaration d'importation ne sont pas toutes utilisées.", - "All_type_parameters_are_unused_6205": "Tous les paramètres de type sont inutilisés.", + "All_type_parameters_are_unused_6205": "Tous les paramètres de type sont inutilisés", "All_variables_are_unused_6199": "Toutes les variables sont inutilisées.", "Allow_accessing_UMD_globals_from_modules_95076": "Autorisez l'accès aux variables globales UMD à partir des modules.", "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Autorisez les importations par défaut à partir des modules sans exportation par défaut. Cela n'affecte pas l'émission du code, juste le contrôle de type.", @@ -193,7 +192,7 @@ "An_export_assignment_cannot_have_modifiers_1120": "Une assignation d'exportation ne peut pas avoir de modificateurs.", "An_export_declaration_can_only_be_used_in_a_module_1233": "Une déclaration d'exportation peut uniquement être utilisée dans un module.", "An_export_declaration_cannot_have_modifiers_1193": "Une déclaration d'exportation ne peut pas avoir de modificateurs.", - "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "Impossible de tester une expression de type 'void' pour déterminer si elle a la valeur true.", + "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "Impossible de tester une expression de type 'void' pour déterminer si elle a la valeur true", "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198": "Une valeur d'échappement Unicode étendue doit être comprise entre 0x0 et 0x10FFFF inclus.", "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351": "Un identificateur ou un mot clé ne peut pas suivre immédiatement un littéral numérique.", "An_implementation_cannot_be_declared_in_ambient_contexts_1183": "Impossible de déclarer une implémentation dans des contextes ambiants.", @@ -235,7 +234,6 @@ "Argument_expression_expected_1135": "Expression d'argument attendue.", "Argument_for_0_option_must_be_Colon_1_6046": "L'argument de l'option '{0}' doit être {1}.", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "L'argument de type '{0}' n'est pas attribuable au paramètre de type '{1}'.", - "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "Les arguments du paramètre de reste '{0}' n'ont pas été fournis.", "Array_element_destructuring_pattern_expected_1181": "Modèle de déstructuration d'élément de tableau attendu.", "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": "Quand vous utilisez des assertions, chaque nom de la cible d'appel doit être déclaré à l'aide d'une annotation de type explicite.", "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": "Quand vous utilisez des assertions, la cible d'appel doit être un identificateur ou un nom qualifié.", @@ -261,7 +259,6 @@ "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "La signature d'appel, qui ne dispose pas d'annotation de type de retour, possède implicitement un type de retour 'any'.", "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204": "Les signatures d'appel sans arguments ont des types de retour incompatibles : '{0}' et '{1}'.", "Call_target_does_not_contain_any_signatures_2346": "La cible de l'appel ne contient aucune signature.", - "Can_only_convert_logical_AND_access_chains_95142": "Conversion uniquement de chaînes logiques ET de chaînes d'accès", "Can_only_convert_property_with_modifier_95137": "La propriété peut uniquement être convertie avec un modificateur", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Impossible d'accéder à '{0}.{1}', car '{0}' est un type, mais pas un espace de noms. Voulez-vous plutôt récupérer le type de la propriété '{1}' dans '{0}' avec '{0}[\"{1}\"]' ?", "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748": "Impossible d'accéder aux enums const ambiants quand l'indicateur '--isolatedModules' est fourni.", @@ -284,21 +281,20 @@ "Cannot_find_global_value_0_2468": "La valeur globale '{0}' est introuvable.", "Cannot_find_lib_definition_for_0_2726": "Définition de bibliothèque introuvable pour '{0}'.", "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "Définition de bibliothèque introuvable pour '{0}'. Est-ce qu'il ne s'agit pas plutôt de '{1}' ?", - "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Le module '{0}' est introuvable. Utilisez '--resolveJsonModule' pour importer le module avec l'extension '.json'.", - "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "Le module '{0}' est introuvable. Vouliez-vous affecter à l'option 'moduleResolution' la valeur 'node' ou ajouter des alias à l'option 'paths' ?", + "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Le module '{0}' est introuvable. Utilisez '--resolveJsonModule' pour importer le module avec l'extension '.json'", "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "Impossible de localiser le module '{0}' ou les déclarations de type correspondantes.", "Cannot_find_name_0_2304": "Le nom '{0}' est introuvable.", "Cannot_find_name_0_Did_you_mean_1_2552": "Le nom '{0}' est introuvable. Est-ce qu'il ne s'agit pas plutôt de '{1}' ?", "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "Le nom '{0}' est introuvable. Voulez-vous utiliser le membre d'instance 'this.{0}' ?", "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": "Le nom '{0}' est introuvable. Voulez-vous utiliser le membre statique '{1}.{0}' ?", - "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Le nom '{0}' est introuvable. Devez-vous changer votre bibliothèque cible ? Essayez de changer l'option de compilateur 'lib' en '{1}' ou une version ultérieure.", + "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Le nom '{0}' est introuvable. Devez-vous changer votre bibliothèque cible ? Essayez de remplacer l'option de compilateur 'lib' par es2015 ou une version ultérieure.", "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": "Le nom '{0}' est introuvable. Devez-vous changer votre bibliothèque cible ? Essayez de remplacer l'option de compilateur 'lib' pour inclure 'dom'.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": "Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour un exécuteur de tests ? Essayez 'npm i --save-dev @types/jest' ou 'npm i --save-dev @types/mocha'.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": "Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour un exécuteur de tests ? Essayez 'npm i --save-dev @types/jest' ou 'npm i --save-dev @types/mocha', puis ajoutez 'jest' ou 'mocha' au champ types de votre fichier tsconfig.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": "Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour jQuery ? Essayez 'npm i --save-dev @types/jquery'.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": "Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour jQuery ? Essayez 'npm i --save-dev @types/jquery', puis ajoutez 'jquery' au champ types de votre fichier tsconfig.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": "Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour node ? Essayez 'npm i --save-dev @types/node'.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": "Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour node ? Essayez 'npm i --save-dev @types/node', puis ajoutez 'node' au champ types de votre fichier tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582": "Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour un exécuteur de tests ? Essayez 'npm i @types/jest' ou 'npm i @types/mocha'.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593": "Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour un exécuteur de tests ? Essayez 'npm i @types/jest' ou 'npm i @types/mocha', puis ajoutez 'jest' ou 'mocha' au champ types de votre fichier tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581": "Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour jQuery ? Essayez 'npm i @types/jquery'.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592": "Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour jQuery ? Essayez 'npm i @types/jquery', puis ajoutez 'jquery' au champ types de votre fichier tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580": "Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour node ? Essayez 'npm i @types/node'.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591": "Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour node ? Essayez 'npm i @types/node', puis ajoutez 'node' au champ types de votre fichier tsconfig.", "Cannot_find_namespace_0_2503": "L'espace de noms '{0}' est introuvable.", "Cannot_find_parameter_0_1225": "Paramètre '{0}' introuvable.", "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": "Impossible de trouver le chemin d'accès au sous-répertoire commun pour les fichiers d'entrée.", @@ -369,13 +365,10 @@ "Constructor_implementation_is_missing_2390": "L'implémentation de constructeur est manquante.", "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673": "Le constructeur de la classe '{0}' est privé et uniquement accessible dans la déclaration de classe.", "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "Le constructeur de la classe '{0}' est protégé et uniquement accessible dans la déclaration de classe.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386": "La notation de type d'un constructeur doit être placée entre parenthèses quand elle est utilisée dans un type union.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388": "La notation de type d'un constructeur doit être placée entre parenthèses quand elle est utilisée dans un type intersection.", "Constructors_for_derived_classes_must_contain_a_super_call_2377": "Les constructeurs pour les classes dérivées doivent contenir un appel de 'super'.", "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Fichier conteneur non spécifié et répertoire racine impossible à déterminer. Recherche ignorée dans le dossier 'node_modules'.", "Containing_function_is_not_an_arrow_function_95128": "La fonction conteneur n'est pas une fonction arrow", "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": "La conversion du type '{0}' en type '{1}' est peut-être une erreur, car aucun type ne chevauche suffisamment l'autre. Si cela est intentionnel, convertissez d'abord l'expression en 'unknown'.", - "Convert_0_to_1_in_0_95003": "Convertir '{0}' en '{1} dans {0}'", "Convert_0_to_mapped_object_type_95055": "Convertir '{0}' en type d'objet mappé", "Convert_all_constructor_functions_to_classes_95045": "Convertir toutes les fonctions de constructeur en classes", "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374": "Convertir toutes les importations non utilisées en tant que valeur en importations de types uniquement", @@ -385,7 +378,6 @@ "Convert_all_to_async_functions_95066": "Tout convertir en fonctions asynchrones", "Convert_all_to_bigint_numeric_literals_95092": "Tout convertir en littéraux numériques bigint", "Convert_all_to_default_imports_95035": "Convertir tout en importations par défaut", - "Convert_all_type_literals_to_mapped_type_95021": "Convertir tous les littéraux de type en type mappé", "Convert_arrow_function_or_function_expression_95122": "Convertir une fonction arrow ou une expression de fonction", "Convert_const_to_let_95093": "Convertir 'const' en 'let'", "Convert_default_export_to_named_export_95061": "Convertir l'exportation par défaut en exportation nommée", @@ -407,17 +399,14 @@ "Convert_to_async_function_95065": "Convertir en fonction asynchrone", "Convert_to_default_import_95013": "Convertir en importation par défaut", "Convert_to_named_function_95124": "Convertir en fonction nommée", - "Convert_to_optional_chain_expression_95139": "Convertir en expression de chaîne facultative", "Convert_to_template_string_95096": "Convertir en chaîne de modèle", "Convert_to_type_only_export_1364": "Convertir en exportation de type uniquement", "Convert_to_type_only_import_1373": "Convertir en importation de type uniquement", "Corrupted_locale_file_0_6051": "Fichier de paramètres régionaux endommagé : {0}.", "Could_not_find_a_containing_arrow_function_95127": "Fonction arrow conteneur introuvable", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "Le fichier de déclaration du module '{0}' est introuvable. '{1}' a implicitement un type 'any'.", - "Could_not_find_convertible_access_expression_95140": "L'expression d'accès convertible est introuvable", "Could_not_find_export_statement_95129": "Instruction export introuvable", "Could_not_find_import_clause_95131": "Clause import introuvable", - "Could_not_find_matching_access_expressions_95141": "L'expression d'accès correspondante est introuvable", "Could_not_find_namespace_import_or_named_imports_95132": "Impossible de localiser l'importation d'espace de noms ou les importations nommées", "Could_not_find_property_for_which_to_generate_accessor_95135": "Impossible de localiser la propriété dont l'accesseur doit être généré", "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231": "Impossible de résoudre le chemin '{0}' avec les extensions {1}.", @@ -429,8 +418,6 @@ "Declaration_expected_1146": "Déclaration attendue.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Le nom de la déclaration est en conflit avec l'identificateur global intégré '{0}'.", "Declaration_or_statement_expected_1128": "Déclaration ou instruction attendue.", - "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": "Les déclarations avec des assertions d'affectation définies doivent également avoir des annotations de type.", - "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": "Les déclarations avec des initialiseurs ne peuvent pas avoir également des assertions d'affectation définies.", "Declare_a_private_field_named_0_90053": "Déclarez un champ privé nommé '{0}'.", "Declare_method_0_90023": "Déclarer la méthode '{0}'", "Declare_private_method_0_90038": "Déclarer la méthode privée '{0}'", @@ -441,6 +428,7 @@ "Decorators_are_not_valid_here_1206": "Les éléments décoratifs ne sont pas valides ici.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Impossible d'appliquer des éléments décoratifs à plusieurs accesseurs get/set du même nom.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "L'exportation par défaut du module a utilisé ou utilise le nom privé '{0}'.", + "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258": "Les assertions d'assignation définies peuvent être utilisées uniquement avec une annotation de type.", "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": "Les définitions des identificateurs suivants sont en conflit avec celles d'un autre fichier : {0}", "Delete_all_unused_declarations_95024": "Supprimer toutes les déclarations inutilisées", "Delete_the_outputs_of_all_projects_6365": "Supprimer les sorties de tous les projets", @@ -458,7 +446,6 @@ "Digit_expected_1124": "Chiffre attendu", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "Le répertoire '{0}' n'existe pas. Toutes les recherches associées sont ignorées.", "Disable_checking_for_this_file_90018": "Désactiver la vérification de ce fichier", - "Disable_loading_referenced_projects_6235": "Désactivez le chargement des projets référencés.", "Disable_size_limitations_on_JavaScript_projects_6162": "Désactivez les limitations de taille sur les projets JavaScript.", "Disable_solution_searching_for_this_project_6224": "Désactivez la recherche de solutions pour ce projet.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Désactivez la vérification stricte des signatures génériques dans les types de fonction.", @@ -490,7 +477,7 @@ "Duplicate_number_index_signature_2375": "Signature d'index de nombre dupliquée.", "Duplicate_property_0_2718": "Propriété dupliquée '{0}'.", "Duplicate_string_index_signature_2374": "Signature d'index de chaîne dupliquée.", - "Dynamic_import_cannot_have_type_arguments_1326": "L'importation dynamique ne peut pas avoir d'arguments de type.", + "Dynamic_import_cannot_have_type_arguments_1326": "L'importation dynamique ne peut pas avoir d'arguments de type", "Dynamic_import_must_have_one_specifier_as_an_argument_1324": "L'importation dynamique doit avoir un seul spécificateur comme argument.", "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "Le spécificateur de l'importation dynamique doit être de type 'string', mais ici il est de type '{0}'.", "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323": "Les importations dynamiques sont prises en charge uniquement quand l'indicateur '--module' a la valeur 'es2020', 'esnext', 'commonjs', 'amd', 'system' ou 'umd'.", @@ -532,7 +519,6 @@ "Excessive_stack_depth_comparing_types_0_and_1_2321": "Profondeur excessive de la pile pour la comparaison des types '{0}' et '{1}'.", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "Arguments de type {0}-{1} attendus ; indiquez-les avec la balise '@extends'.", "Expected_0_arguments_but_got_1_2554": "{0} arguments attendus, mais {1} reçus.", - "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "{0} arguments attendus, mais {1} reçus. Avez-vous oublié d'inclure 'void' dans votre argument de type pour 'Promise' ?", "Expected_0_arguments_but_got_1_or_more_2556": "{0} arguments attendus, mais {1} ou plus reçus.", "Expected_0_type_arguments_but_got_1_2558": "{0} arguments de type attendus, mais {1} reçus.", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Arguments de type {0} attendus ; indiquez-les avec la balise '@extends'.", @@ -610,14 +596,11 @@ "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366": "La fonction n'a pas d'instruction return de fin, et le type de retour n'inclut pas 'undefined'.", "Function_overload_must_be_static_2387": "La surcharge de fonction doit être statique.", "Function_overload_must_not_be_static_2388": "La surcharge de fonction ne doit pas être statique.", - "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385": "La notation de type d'une fonction doit être placée entre parenthèses quand elle est utilisée dans un type union.", - "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387": "La notation de type d'une fonction doit être placée entre parenthèses quand elle est utilisée dans un type intersection.", "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014": "Le type de fonction, qui n'a pas d'annotation de type de retour, a implicitement le type de retour '{0}'.", "Generate_get_and_set_accessors_95046": "Générer les accesseurs 'get' et 'set'", "Generate_get_and_set_accessors_for_all_overriding_properties_95119": "Générer des accesseurs 'get' et 'set' pour toutes les propriétés de remplacement", "Generates_a_CPU_profile_6223": "Génère un profil de processeur.", "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": "Génère un mappage de source pour chaque fichier '.d.ts' correspondant.", - "Generates_an_event_trace_and_a_list_of_types_6237": "Génère une trace d'événement et une liste de types.", "Generates_corresponding_d_ts_file_6002": "Génère le fichier '.d.ts' correspondant.", "Generates_corresponding_map_file_6043": "Génère le fichier '.map' correspondant.", "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025": "Le générateur a implicitement le type '{0}', car il ne génère aucune valeur. Indiquez une annotation de type de retour.", @@ -662,7 +645,6 @@ "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "Dans les déclarations d'enums ambiants, l'initialiseur de membre doit être une expression constante.", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "Dans un enum avec plusieurs déclarations, seule une déclaration peut omettre un initialiseur pour son premier élément d'enum.", "Include_modules_imported_with_json_extension_6197": "Inclure les modules importés avec l'extension '.json'", - "Include_undefined_in_index_signature_results_6800": "Inclure 'undefined' dans les résultats de la signature d'index", "Index_signature_in_type_0_only_permits_reading_2542": "La signature d'index du type '{0}' autorise uniquement la lecture.", "Index_signature_is_missing_in_type_0_2329": "Signature d'index manquante dans le type '{0}'.", "Index_signatures_are_incompatible_2330": "Les signatures d'index sont incompatibles.", @@ -694,7 +676,6 @@ "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Valeur non valide pour 'jsxFactory'. '{0}' n'est pas un identificateur valide ou un nom qualifié.", "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": "Valeur non valide pour 'jsxFragmentFactory'. '{0}' n'est pas un identificateur valide ou un nom qualifié.", "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Valeur non valide pour '--reactNamespace'. '{0}' n'est pas un identificateur valide.", - "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": "Il manque probablement une virgule pour séparer ces deux expressions de modèle. Elles forment une expression de modèle étiquetée qui ne peut pas être appelée.", "Its_element_type_0_is_not_a_valid_JSX_element_2789": "Son type d'élément '{0}' n'est pas un élément JSX valide.", "Its_instance_type_0_is_not_a_valid_JSX_element_2788": "Son type d'instance '{0}' n'est pas un élément JSX valide.", "Its_return_type_0_is_not_a_valid_JSX_element_2787": "Son type de retour '{0}' n'est pas un élément JSX valide.", @@ -759,6 +740,7 @@ "Module_0_has_no_default_export_1192": "Le module '{0}' n'a pas d'exportation par défaut.", "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": "Le module '{0}' n'a aucune exportation par défaut. Est-ce que vous avez voulu utiliser 'import { {1} } from {0}' à la place ?", "Module_0_has_no_exported_member_1_2305": "Le module '{0}' n'a aucun membre exporté '{1}'.", + "Module_0_has_no_exported_member_1_Did_you_mean_2_2724": "Le module '{0}' n'a aucun membre exporté '{1}'. Pensiez-vous plutôt à '{2}' ?", "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": "Le module '{0}' n'a aucun membre exporté '{1}'. Est-ce que vous avez voulu utiliser 'import {1} from {0}' à la place ?", "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": "Le module '{0}' est masqué par une déclaration locale portant le même nom.", "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "Le module '{0}' utilise 'export =' et ne peut pas être utilisé avec 'export *'.", @@ -794,7 +776,6 @@ "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": "La classe non abstraite '{0}' n'implémente pas le membre abstrait '{1}' hérité de la classe '{2}'.", "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "L'expression de classe non abstraite '{0}' n'implémente pas le membre abstrait hérité '{0}' de la classe '{1}'.", "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": "Les assertions non null peuvent uniquement être utilisées dans les fichiers TypeScript.", - "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090": "Les chemins non relatifs ne sont pas autorisés quand 'baseUrl' n'est pas défini. Avez-vous oublié './' au début ?", "Non_simple_parameter_declared_here_1348": "Paramètre non simple déclaré ici.", "Not_all_code_paths_return_a_value_7030": "Les chemins du code ne retournent pas tous une valeur.", "Not_all_constituents_of_type_0_are_callable_2756": "Tous les constituants de type '{0}' ne peuvent pas être appelés.", @@ -830,7 +811,6 @@ "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "Vous pouvez spécifier l'option '{0}' uniquement dans le fichier 'tsconfig.json', ou lui affecter la valeur 'false' ou 'null' sur la ligne de commande.", "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "Vous pouvez spécifier l'option '{0}' uniquement dans le fichier 'tsconfig.json', ou lui affecter la valeur 'null' sur la ligne de commande.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "L'option '{0}' peut être utilisée uniquement quand l'option '--inlineSourceMap' ou l'option '--sourceMap' est spécifiée.", - "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": "Impossible de spécifier l'option '{0}' quand l'option 'jsx' a la valeur '{1}'.", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "Impossible de spécifier l'option '{0}' quand l'option 'target' est 'ES3'.", "Option_0_cannot_be_specified_with_option_1_5053": "Impossible de spécifier l'option '{0}' avec l'option '{1}'.", "Option_0_cannot_be_specified_without_specifying_option_1_5052": "Impossible de spécifier l'option '{0}' sans spécifier l'option '{1}'.", @@ -839,6 +819,7 @@ "Option_build_must_be_the_first_command_line_argument_6369": "L'option '--build' doit être le premier argument de ligne de commande.", "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": "L'option '--incremental' peut uniquement être spécifiée à l'aide de tsconfig, en cas d'émission vers un seul fichier ou quand l'option '--tsBuildInfoFile' est spécifiée.", "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "L'option 'isolatedModules' peut être utilisée seulement quand l'option '--module' est spécifiée, ou quand l'option 'target' a la valeur 'ES2015' ou une version supérieure.", + "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "Impossible d'utiliser l'option 'paths' sans spécifier l'option '--baseUrl'.", "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "Impossible d'associer l'option 'project' à des fichiers sources sur une ligne de commande.", "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071": "L'option '--resolveJsonModule' peut uniquement être spécifiée quand la génération du code de module est 'commonjs', 'amd', 'es2015' ou 'esNext'.", "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "Impossible de spécifier l'option '--resolveJsonModule' sans la stratégie de résolution de module 'node'.", @@ -891,7 +872,6 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Le type de paramètre du setter public '{0}' de la classe exportée porte ou utilise le nom privé '{1}'.", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Analyser en mode strict et émettre \"use strict\" pour chaque fichier source.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "Le modèle '{0}' ne peut avoir qu'un seul caractère '*' au maximum.", - "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": "Les minutages de performances pour '--diagnostics' ou '--extendedDiagnostics' ne sont pas disponibles dans cette session. Une implémentation native de l'API de performances web est introuvable.", "Prefix_0_with_an_underscore_90025": "Faire précéder '{0}' d'un trait de soulignement", "Prefix_all_incorrect_property_declarations_with_declare_95095": "Faire commencer toutes les déclarations de propriété incorrectes par 'declare'", "Prefix_all_unused_declarations_with_where_possible_95025": "Préfixer toutes les déclarations inutilisées avec '_' si possible", @@ -905,7 +885,7 @@ "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "Les identificateurs privés ne sont pas autorisés dans les déclarations de variable.", "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "Les identificateurs privés ne sont pas autorisés en dehors des corps de classe.", "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "Les identificateurs privés sont disponibles uniquement durant le ciblage d'ECMAScript 2015 et version ultérieure.", - "Private_identifiers_cannot_be_used_as_parameters_18009": "Les identificateurs privés ne peuvent pas être utilisés en tant que paramètres.", + "Private_identifiers_cannot_be_used_as_parameters_18009": "Les identificateurs privés ne peuvent pas être utilisés en tant que paramètres", "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "Le membre privé ou protégé '{0}' n'est pas accessible sur un paramètre de type.", "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Impossible de générer le projet '{0}' car sa dépendance '{1}' comporte des erreurs", "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383": "Impossible de générer le projet '{0}', car sa dépendance '{1}' n'a pas été générée", @@ -923,7 +903,6 @@ "Property_0_does_not_exist_on_const_enum_1_2479": "La propriété '{0}' n'existe pas sur l'enum 'const' '{1}'.", "Property_0_does_not_exist_on_type_1_2339": "La propriété '{0}' n'existe pas sur le type '{1}'.", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "La propriété '{0}' n'existe pas sur le type '{1}'. Est-ce qu'il ne s'agit pas plutôt de '{2}' ?", - "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": "La propriété '{0}' n'existe pas sur le type '{1}'. Devez-vous changer votre bibliothèque cible ? Essayez de changer l'option de compilateur 'lib' en '{2}' ou une version ultérieure.", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "La propriété '{0}' n'a aucun initialiseur et n'est pas définitivement assignée dans le constructeur.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "La propriété '{0}' a implicitement le type 'any', car son accesseur get ne dispose pas d'une annotation de type de retour.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "La propriété '{0}' a implicitement le type 'any', car son accesseur set ne dispose pas d'une annotation de type de paramètre.", @@ -932,7 +911,7 @@ "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "Impossible d'assigner la propriété '{0}' du type '{1}' à la même propriété du type de base '{2}'.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "La propriété '{0}' du type '{1}' ne peut pas être assignée au type '{2}'.", "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015": "La propriété '{0}' du type '{1}' fait référence à un membre distinct, qui n'est pas accessible à partir du type '{2}'.", - "Property_0_is_a_static_member_of_type_1_2576": "La propriété '{0}' est un membre statique de type '{1}'.", + "Property_0_is_a_static_member_of_type_1_2576": "La propriété '{0}' est un membre statique du type '{1}'", "Property_0_is_declared_but_its_value_is_never_read_6138": "La propriété '{0}' est déclarée mais sa valeur n'est jamais lue.", "Property_0_is_incompatible_with_index_signature_2530": "La propriété '{0}' est incompatible avec la signature d'index.", "Property_0_is_incompatible_with_rest_element_type_2573": "La propriété '{0}' est incompatible avec le type d'élément rest.", @@ -961,7 +940,6 @@ "Property_or_signature_expected_1131": "Propriété ou signature attendue.", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "La valeur de la propriété peut être uniquement un littéral de chaîne, un littéral numérique, 'true', 'false', 'null', un littéral d'objet ou un littéral de tableau.", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "Fournissez une prise en charge complète des éléments pouvant faire l'objet d'une itération dans 'for-of', de l'opérateur spread et de la déstructuration durant le ciblage d''ES5' ou 'ES3'.", - "Provides_a_root_package_name_when_using_outFile_with_declarations_1390": "Fournit un nom de package racine quand outFile est utilisé avec des déclarations.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "La méthode publique '{0}' de la classe exportée comporte ou utilise le nom '{1}' du module externe {2} mais ne peut pas être nommée.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "La méthode publique '{0}' de la classe exportée comporte ou utilise le nom '{1}' du module privé '{2}'.", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "La méthode publique '{0}' de la classe exportée comporte ou utilise le nom privé '{1}'.", @@ -994,7 +972,7 @@ "Remove_unnecessary_await_95086": "Supprimer toute utilisation non nécessaire de 'await'", "Remove_unreachable_code_95050": "Supprimer le code inaccessible", "Remove_unused_declaration_for_Colon_0_90004": "Supprimer la déclaration inutilisée pour : '{0}'", - "Remove_unused_declarations_for_Colon_0_90041": "Supprimer les déclarations inutilisées pour '{0}'", + "Remove_unused_declarations_for_Colon_0_90041": "Supprimer les déclarations inutilisées pour : '{0}'", "Remove_unused_destructuring_declaration_90039": "Supprimer la déclaration de déstructuration inutilisée", "Remove_unused_label_95053": "Supprimer l'étiquette inutilisée", "Remove_variable_statement_90010": "Supprimer l'instruction de variable", @@ -1088,7 +1066,6 @@ "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "Spécifiez la séquence de fin de ligne à utiliser durant l'émission des fichiers : 'CRLF' (Dos) ou 'LF' (Unix).", "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": "Spécifiez l'emplacement dans lequel le débogueur doit localiser les fichiers TypeScript au lieu des emplacements sources.", "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "Spécifiez l'emplacement dans lequel le débogueur doit localiser les fichiers de mappage au lieu des emplacements générés.", - "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": "Spécifiez le spécificateur de module à utiliser pour importer les fonctions de fabrique 'jsx' et 'jsxs' à partir de react, par exemple", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Spécifiez le répertoire racine des fichiers d'entrée. Contrôlez la structure des répertoires de sortie avec --outDir.", "Split_all_invalid_type_only_imports_1367": "Diviser toutes les importations de type uniquement non valides", "Split_into_two_separate_import_declarations_1366": "Diviser en deux déclarations import distinctes", @@ -1130,8 +1107,6 @@ "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496": "Impossible de référencer l'objet 'arguments' dans une fonction arrow dans ES3 et ES5. Utilisez plutôt une expression de fonction standard.", "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "Les objets 'arguments' ne peuvent pas être référencés dans une fonction ou méthode async en ES3 et ES5. Utilisez une fonction ou méthode standard.", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "Le corps d'une instruction 'if' ne peut pas être l'instruction vide.", - "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391": "L'option 'bundledPackageName' doit être fournie quand outFile et la résolution de module de nœud sont utilisés avec une émission de déclaration.", - "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": "L'appel aurait pu réussir sur cette implémentation, mais les signatures de surcharges de l'implémentation ne sont pas visibles en externe.", "The_character_set_of_the_input_files_6163": "Jeu de caractères des fichiers d'entrée.", "The_containing_arrow_function_captures_the_global_value_of_this_7041": "La fonction arrow conteneur capture la valeur globale de 'this'.", "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "Le corps de la fonction ou du module conteneur est trop grand pour l'analyse du flux de contrôle.", @@ -1146,14 +1121,12 @@ "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060": "Le premier paramètre de la méthode 'then' d'une promesse doit être un rappel.", "The_global_type_JSX_0_may_not_have_more_than_one_property_2608": "Le type global 'JSX.{0}' ne peut pas avoir plusieurs propriétés.", "The_implementation_signature_is_declared_here_2750": "La signature d'implémentation est déclarée ici.", - "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system_1343": "La métapropriété 'import.meta' est autorisée uniquement quand l'option '--module' a la valeur 'es2020', 'esnext' ou 'system'.", + "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system_1343": "La métapropriété 'import.meta' est autorisée uniquement quand l'option '--module' a la valeur 'esnext' ou 'system'.", "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "Le type déduit de '{0}' ne peut pas être nommé sans référence à '{1}'. Cela n'est probablement pas portable. Une annotation de type est nécessaire.", "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "Le type déduit de '{0}' référence un type avec une structure cyclique qui ne peut pas être sérialisée de manière triviale. Une annotation de type est nécessaire.", "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "Le type déduit de '{0}' référence un type '{1}' inaccessible. Une annotation de type est nécessaire.", - "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": "Le type déduit de ce nœud dépasse la longueur maximale que le compilateur va sérialiser. Une annotation de type explicite est nécessaire.", "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": "L'intersection '{0}' a été réduite à 'never', car la propriété '{1}' existe dans plusieurs constituants et est privée dans certains d'entre eux.", "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": "L'intersection '{0}' a été réduite à 'never', car la propriété '{1}' a des types en conflit dans certains constituants.", - "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": "Le mot clé 'intrinsic' peut uniquement être utilisé pour déclarer les types intrinsèques fournis par le compilateur.", "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": "L'option de compilateur 'jsxFragmentFactory' doit être fournie pour permettre l'utilisation des fragments JSX avec l'option de compilateur 'jsxFactory'.", "The_last_overload_gave_the_following_error_2770": "La dernière surcharge a généré l'erreur suivante.", "The_last_overload_is_declared_here_2771": "La dernière surcharge est déclarée ici.", @@ -1230,7 +1203,7 @@ "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Les déclarations de niveau supérieur dans les fichiers .d.ts doivent commencer par un modificateur 'declare' ou 'export'.", "Trailing_comma_not_allowed_1009": "Virgule de fin non autorisée.", "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "Transpilez chaque fichier sous forme de module distinct (semblable à 'ts.transpileModule').", - "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "Essayez 'npm i --save-dev @types/{1}' s'il existe, ou ajoutez un nouveau fichier de déclaration (.d.ts) contenant 'declare module '{0}';'", + "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035": "Essayez 'npm install @types/{1}' s'il existe, ou ajoutez un nouveau fichier de déclaration (.d.ts) contenant 'declare module '{0}';'", "Trying_other_entries_in_rootDirs_6110": "Essai avec d'autres entrées dans 'rootDirs'.", "Trying_substitution_0_candidate_module_location_Colon_1_6093": "Essai avec la substitution '{0}', emplacement de module candidat : '{1}'.", "Tuple_members_must_all_have_names_or_all_not_have_names_5084": "Les membres de tuples doivent tous avoir des noms ou ne pas en avoir.", @@ -1305,7 +1278,6 @@ "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": "======== La directive de référence de type '{0}' a été correctement résolue en '{1}', primaire : {2}. ========", "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": "======== La directive de référence de type '{0}' a été correctement résolue en '{1}' avec l'ID de package '{2}', primaire : {3}. ========", "Types_have_separate_declarations_of_a_private_property_0_2442": "Les types ont des déclarations distinctes d'une propriété privée '{0}'.", - "Types_of_construct_signatures_are_incompatible_2419": "Les types de signature de construction sont incompatibles.", "Types_of_parameters_0_and_1_are_incompatible_2328": "Les types des paramètres '{0}' et '{1}' sont incompatibles.", "Types_of_property_0_are_incompatible_2326": "Les types de la propriété '{0}' sont incompatibles.", "Unable_to_open_file_0_6050": "Impossible d'ouvrir le fichier '{0}'.", @@ -1378,7 +1350,6 @@ "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": "'{0}' peut uniquement être importé à l'aide d'un appel 'require' ou via l'utilisation d'une importation par défaut.", "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": "'{0}' peut uniquement être importé à l'aide de 'import {1} = require({2})' ou via l'utilisation d'une importation par défaut.", "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": "'{0}' peut uniquement être importé à l'aide de 'import {1} = require({2})' ou via l'activation de l'indicateur 'esModuleInterop' et l'utilisation d'une importation par défaut.", - "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208": "Impossible de compiler '{0}' sous '--isolatedModules', car il est considéré comme un fichier de script global. Ajoutez une importation, une exportation ou une instruction 'export {}' vide pour en faire un module.", "_0_cannot_be_used_as_a_JSX_component_2786": "Impossible d'utiliser '{0}' comme composant JSX.", "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": "'{0}' ne peut pas être utilisé en tant que valeur, car il a été exporté à l'aide de 'export type'.", "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": "'{0}' ne peut pas être utilisé en tant que valeur, car il a été importé à l'aide de 'import type'.", @@ -1386,7 +1357,6 @@ "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": "'{0}' a pu être instancié avec un type arbitraire qui n'est peut-être pas lié à '{1}'.", "_0_declarations_can_only_be_used_in_TypeScript_files_8006": "Les déclarations '{0}' peuvent uniquement être utilisées dans les fichiers TypeScript.", "_0_expected_1005": "'{0}' attendu.", - "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": "'{0}' n'a aucun membre exporté nommé '{1}'. Est-ce que vous pensiez à '{2}' ?", "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": "'{0}' a implicitement un type de retour '{1}', mais il est possible de déduire un meilleur type à partir de l'utilisation.", "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": "'{0}' possède implicitement le type de retour 'any', car il n'a pas d'annotation de type de retour, et est référencé directement ou indirectement dans l'une de ses expressions de retour.", "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": "'{0}' a implicitement le type 'any', car il n'a pas d'annotation de type et est référencé directement ou indirectement dans son propre initialiseur.", @@ -1399,29 +1369,27 @@ "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "'{0}' est défini en tant qu'accesseur dans la classe '{1}', mais il est remplacé ici dans '{2}' en tant que propriété d'instance.", "_0_is_deprecated_6385": "'{0}' est déprécié", "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "'{0}' n'est pas une métapropriété valide pour le mot clé '{1}'. Est-ce qu'il ne s'agit pas plutôt de '{2}' ?", - "_0_is_not_allowed_as_a_variable_declaration_name_1389": "'{0}' n'est pas autorisé en tant que nom de déclaration de variable.", "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "'{0}' est référencé directement ou indirectement dans sa propre expression de base.", "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "'{0}' est référencé directement ou indirectement dans sa propre annotation de type.", "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": "'{0}' est spécifié plusieurs fois. Cette utilisation va donc être remplacée.", "_0_list_cannot_be_empty_1097": "La liste '{0}' ne peut pas être vide.", "_0_modifier_already_seen_1030": "Modificateur '{0}' déjà rencontré.", + "_0_modifier_cannot_appear_on_a_class_element_1031": "Le modificateur '{0}' ne peut pas apparaître dans un élément de classe.", "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": "Le modificateur '{0}' ne peut pas apparaître sur une déclaration de constructeur.", "_0_modifier_cannot_appear_on_a_data_property_1043": "Le modificateur '{0}' ne peut pas apparaître dans une propriété de données.", "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": "Le modificateur '{0}' ne peut pas apparaître dans un élément de module ou d'espace de noms.", "_0_modifier_cannot_appear_on_a_parameter_1090": "Le modificateur '{0}' ne peut pas apparaître dans un paramètre.", "_0_modifier_cannot_appear_on_a_type_member_1070": "Le modificateur '{0}' ne peut pas apparaître dans un membre de type.", "_0_modifier_cannot_appear_on_an_index_signature_1071": "Le modificateur '{0}' ne peut pas apparaître dans une signature d'index.", - "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": "Le modificateur '{0}' ne peut pas apparaître sur les éléments de classe de ce genre.", "_0_modifier_cannot_be_used_here_1042": "Impossible d'utiliser le modificateur '{0}' ici.", "_0_modifier_cannot_be_used_in_an_ambient_context_1040": "Impossible d'utiliser le modificateur '{0}' dans un contexte ambiant.", "_0_modifier_cannot_be_used_with_1_modifier_1243": "Impossible d'utiliser les modificateurs '{0}' et '{1}' ensemble.", "_0_modifier_cannot_be_used_with_a_class_declaration_1041": "Impossible d'utiliser le modificateur '{0}' avec une déclaration de classe.", - "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "Le modificateur '{0}' ne peut pas être utilisé avec un identificateur privé.", + "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "Le modificateur '{0}' ne peut pas être utilisé avec un identificateur privé", "_0_modifier_must_precede_1_modifier_1029": "Le modificateur '{0}' doit précéder le modificateur '{1}'.", "_0_needs_an_explicit_type_annotation_2782": "'{0}' a besoin d'une annotation de type explicite.", "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": "'{0}' référence uniquement un type mais s'utilise en tant qu'espace de noms ici.", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "'{0}' fait uniquement référence à un type mais s'utilise en tant que valeur ici.", - "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": "'{0}' fait uniquement référence à un type, mais il est utilisé ici en tant que valeur. Voulez-vous vraiment utiliser '{1} dans {0}' ?", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "'{0}' fait uniquement référence à un type, mais il est utilisé ici en tant que valeur. Devez-vous changer votre bibliothèque cible ? Essayez de remplacer l'option de compilateur 'lib' par es2015 ou une version ultérieure.", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "'{0}' fait référence à une variable globale UMD, mais le fichier actuel est un module. Ajoutez une importation à la place.", "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "'{0}' fait référence à une valeur, mais il est utilisé ici en tant que type. Est-ce que vous avez voulu utiliser 'typeof {0}' ?", @@ -1458,7 +1426,6 @@ "extends_clause_already_seen_1172": "Clause 'extends' déjà rencontrée.", "extends_clause_must_precede_implements_clause_1173": "La clause 'extends' doit précéder la clause 'implements'.", "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "La clause 'extends' de la classe exportée '{0}' comporte ou utilise le nom privé '{1}'.", - "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "La clause 'extends' de la classe exportée comporte ou utilise le nom privé '{0}'.", "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "La clause 'extends' de l'interface exportée '{0}' comporte ou utilise le nom privé '{1}'.", "file_6025": "fichier", "get_and_set_accessor_must_have_the_same_this_type_2682": "Les accesseurs 'get' et 'set' doivent avoir le même type 'this'.", diff --git a/node_modules/typescript/lib/it/diagnosticMessages.generated.json b/node_modules/typescript/lib/it/diagnosticMessages.generated.json index 4b2f431..fa8dfd7 100644 --- a/node_modules/typescript/lib/it/diagnosticMessages.generated.json +++ b/node_modules/typescript/lib/it/diagnosticMessages.generated.json @@ -151,8 +151,6 @@ "Add_undefined_type_to_property_0_95018": "Aggiungere il tipo 'undefined' alla proprietà '{0}'", "Add_unknown_conversion_for_non_overlapping_types_95069": "Aggiungere la conversione 'unknown' per i tipi non sovrapposti", "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": "Aggiungere 'unknown' a tutte le conversioni di tipi non sovrapposti", - "Add_void_to_Promise_resolved_without_a_value_95143": "Aggiungere 'void' all'elemento Promise risolto senza un valore", - "Add_void_to_all_Promises_resolved_without_a_value_95144": "Aggiungere 'void' a tutti gli elementi Promise risolti senza un valore", "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Aggiungere un file tsconfig.json per organizzare più facilmente progetti che contengono sia file TypeScript che JavaScript. Per altre informazioni, vedere https://aka.ms/tsconfig.", "Additional_Checks_6176": "Controlli aggiuntivi", "Advanced_Options_6178": "Opzioni avanzate", @@ -160,8 +158,9 @@ "All_declarations_of_0_must_have_identical_type_parameters_2428": "Tutte le dichiarazioni di '{0}' devono contenere parametri di tipo identici.", "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Tutte le dichiarazioni di un metodo astratto devono essere consecutive.", "All_destructured_elements_are_unused_6198": "Tutti gli elementi destrutturati sono inutilizzati.", + "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208": "Quando si specifica il flag '--isolatedModules', tutti i file devono essere moduli.", "All_imports_in_import_declaration_are_unused_6192": "Tutte le importazioni nella dichiarazione di importazione sono inutilizzate.", - "All_type_parameters_are_unused_6205": "Tutti i parametri di tipo sono inutilizzati.", + "All_type_parameters_are_unused_6205": "Tutti i parametri di tipo sono inutilizzati", "All_variables_are_unused_6199": "Tutte le variabili sono inutilizzate.", "Allow_accessing_UMD_globals_from_modules_95076": "Consentire l'accesso alle istruzioni globali UMD dai moduli.", "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Consente di eseguire importazioni predefinite da moduli senza esportazione predefinita. Non influisce sulla creazione del codice ma solo sul controllo dei tipi.", @@ -193,7 +192,7 @@ "An_export_assignment_cannot_have_modifiers_1120": "Un'assegnazione di esportazione non può contenere modificatori.", "An_export_declaration_can_only_be_used_in_a_module_1233": "È possibile usare una dichiarazione di esportazione solo in un modulo.", "An_export_declaration_cannot_have_modifiers_1193": "Una dichiarazione di esportazione non può contenere modificatori.", - "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "Non è possibile testare la veridicità di un'espressione di tipo 'void'.", + "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "Non è possibile testare la veridicità di un'espressione di tipo 'void'", "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198": "Un valore di escape Unicode avanzato deve essere compreso tra 0x0 e 0x10FFFF inclusi.", "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351": "Non è possibile specificare un identificatore o una parola chiave subito dopo un valore letterale numerico.", "An_implementation_cannot_be_declared_in_ambient_contexts_1183": "Non è possibile dichiarare un'implementazione in contesti di ambiente.", @@ -235,7 +234,6 @@ "Argument_expression_expected_1135": "È prevista l'espressione di argomento.", "Argument_for_0_option_must_be_Colon_1_6046": "L'argomento per l'opzione '{0}' deve essere {1}.", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "L'argomento di tipo '{0}' non è assegnabile al parametro di tipo '{1}'.", - "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "Gli argomenti per il parametro REST '{0}' non sono stati specificati.", "Array_element_destructuring_pattern_expected_1181": "È previsto il criterio di destrutturazione dell'elemento della matrice.", "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": "Con le asserzioni ogni nome nella destinazione di chiamata deve essere dichiarato con un'annotazione di tipo esplicita.", "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": "Con le asserzioni la destinazione di chiamata deve essere un identificatore o un nome completo.", @@ -261,7 +259,6 @@ "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "La firma di chiamata, in cui manca l'annotazione di tipo restituito, contiene implicitamente un tipo restituito 'any'.", "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204": "Le firme di chiamata senza argomenti contengono i tipi restituiti incompatibili '{0}' e '{1}'.", "Call_target_does_not_contain_any_signatures_2346": "La destinazione della chiamata non contiene alcuna firma.", - "Can_only_convert_logical_AND_access_chains_95142": "È possibile convertire solo catene di accesso AND logiche", "Can_only_convert_property_with_modifier_95137": "È possibile convertire solo la proprietà con il modificatore", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Non è possibile accedere a '{0}.{1}' perché '{0}' è un tipo ma non uno spazio dei nomi. Si intendeva recuperare il tipo della proprietà '{1}' in '{0}' con '{0}[\"{1}\"]'?", "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748": "Quando si specifica il flag '--isolatedModules', non è possibile accedere a enumerazioni const di ambiente.", @@ -284,21 +281,20 @@ "Cannot_find_global_value_0_2468": "Il valore globale '{0}' non è stato trovato.", "Cannot_find_lib_definition_for_0_2726": "La definizione della libreria per '{0}' non è stata trovata.", "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "La definizione della libreria per '{0}' non è stata trovata. Si intendeva '{1}'?", - "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Non è possibile trovare il modulo '{0}'. Provare a usare '--resolveJsonModule' per importare il modulo con estensione '.json'.", - "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "Non è possibile trovare il modulo '{0}'. Si intendeva impostare l'opzione 'moduleResolution' su 'node' o aggiungere alias all'opzione 'paths'?", + "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Non è possibile trovare il modulo '{0}'. Provare a usare '--resolveJsonModule' per importare il modulo con estensione '.json'", "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "Non è possibile trovare il modulo '{0}' o le relative dichiarazioni di tipo corrispondenti.", "Cannot_find_name_0_2304": "Il nome '{0}' non è stato trovato.", "Cannot_find_name_0_Did_you_mean_1_2552": "Il nome '{0}' non è stato trovato. Si intendeva '{1}'?", "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "Il nome '{0}' non è stato trovato. Si intendeva il membro di istanza 'this.{0}'?", "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": "Il nome '{0}' non è stato trovato. Si intendeva il membro statico '{1}.{0}'?", - "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Non è possibile trovare il nome '{0}'. È necessario modificare la libreria di destinazione? Provare a impostare l'opzione `lib` del compilatore su '{1}' o versioni successive.", + "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Non è possibile trovare il nome '{0}'. È necessario modificare la libreria di destinazione? Provare a impostare l'opzione `lib` del compilatore su es2015 o versioni successive.", "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": "Non è possibile trovare il nome '{0}'. È necessario modificare la libreria di destinazione? Provare a modificare l'opzione `lib` del compilatore in modo che includa 'dom'.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": "Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per un test runner? Provare con `npm i --save-dev @types/jest` o `npm i --save-dev @types/mocha`.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": "Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per un test runner? Provare con `npm i --save-dev @types/jest` o `npm i --save-dev @types/mocha` e quindi aggiungere `jest` o `mocha` al campo types in tsconfig.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": "Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per jQuery? Provare con `npm i --save-dev @types/jquery`.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": "Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per jQuery? Provare con `npm i --save-dev @types/jquery` e quindi aggiungere `jquery` al campo types in tsconfig.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": "Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per il nodo? Provare con `npm i --save-dev @types/node`.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": "Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per il nodo? Provare con `npm i --save-dev @types/node` e quindi aggiungere `node` al campo types in tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582": "Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per un test runner? Provare con `npm i @types/jest` o `npm i @types/mocha`.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593": "Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per un test runner? Provare con `npm i @types/jest` o `npm i @types/mocha` e quindi aggiungere `jest` o `mocha` al campo types in tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581": "Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per jQuery? Provare con `npm i @types/jquery`.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592": "Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per jQuery? Provare con `npm i @types/jquery` e quindi aggiungere `jquery` al campo types in tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580": "Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per il nodo? Provare con `npm i @types/node`.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591": "Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per il nodo? Provare con `npm i @types/node` e quindi aggiungere `node` al campo types in tsconfig.", "Cannot_find_namespace_0_2503": "Lo spazio dei nomi '{0}' non è stato trovato.", "Cannot_find_parameter_0_1225": "Il parametro '{0}' non è stato trovato.", "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": "Il percorso della sottodirectory comune per i file di input non è stato trovato.", @@ -369,13 +365,10 @@ "Constructor_implementation_is_missing_2390": "Manca l'implementazione di costruttore.", "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673": "Il costruttore della classe '{0}' è privato e accessibile solo all'interno della dichiarazione di classe.", "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "Il costruttore della classe '{0}' è protetto e accessibile solo all'interno della dichiarazione di classe.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386": "La notazione del tipo di costruttore deve essere racchiusa tra parentesi quando viene usata in un tipo di unione.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388": "La notazione del tipo di costruttore deve essere racchiusa tra parentesi quando viene usata in un tipo di intersezione.", "Constructors_for_derived_classes_must_contain_a_super_call_2377": "I costruttori di classi derivate devono contenere una chiamata 'super'.", "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Il file contenitore non è specificato e non è possibile determinare la directory radice. La ricerca nella cartella 'node_modules' verrà ignorata.", "Containing_function_is_not_an_arrow_function_95128": "La funzione contenitore non è una funzione arrow", "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": "La conversione del tipo '{0}' nel tipo '{1}' può essere un errore perché nessuno dei due tipi si sovrappone sufficientemente all'altro. Se questa opzione è intenzionale, convertire prima l'espressione in 'unknown'.", - "Convert_0_to_1_in_0_95003": "Convertire '{0}' in '{1} in {0}'", "Convert_0_to_mapped_object_type_95055": "Convertire '{0}' nel tipo di oggetto con mapping", "Convert_all_constructor_functions_to_classes_95045": "Convertire tutte le funzioni di costruttore in classi", "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374": "Convertire tutte le importazioni non usate come valore in importazioni solo di tipi", @@ -385,7 +378,6 @@ "Convert_all_to_async_functions_95066": "Convertire tutto in funzioni asincrone", "Convert_all_to_bigint_numeric_literals_95092": "Convertire tutto in valori letterali numerici bigint", "Convert_all_to_default_imports_95035": "Convertire tutte le impostazioni predefinite", - "Convert_all_type_literals_to_mapped_type_95021": "Convertire tutti i valori letterali di tipo nel tipo di cui è stato eseguito il mapping", "Convert_arrow_function_or_function_expression_95122": "Convertire la funzione arrow o l'espressione di funzione", "Convert_const_to_let_95093": "Convertire 'const' in 'let'", "Convert_default_export_to_named_export_95061": "Convertire l'esportazione predefinita nell'esportazione denominata", @@ -407,17 +399,14 @@ "Convert_to_async_function_95065": "Convertire nella funzione asincrona", "Convert_to_default_import_95013": "Convertire nell'importazione predefinita", "Convert_to_named_function_95124": "Convertire nella funzione denominata", - "Convert_to_optional_chain_expression_95139": "Convertire nell'espressione di catena facoltativa", "Convert_to_template_string_95096": "Convertire nella stringa di modello", "Convert_to_type_only_export_1364": "Convertire nell'esportazione solo di tipi", "Convert_to_type_only_import_1373": "Convertire nell'importazione solo di tipi", "Corrupted_locale_file_0_6051": "Il file delle impostazioni locali {0} è danneggiato.", "Could_not_find_a_containing_arrow_function_95127": "Non è stato possibile trovare una funzione arrow contenitore", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "Non è stato trovato alcun file di dichiarazione per il modulo '{0}'. A '{1}' è assegnato implicitamente un tipo 'any'.", - "Could_not_find_convertible_access_expression_95140": "Non è stato possibile trovare l'espressione di accesso convertibile", "Could_not_find_export_statement_95129": "Non è stato possibile trovare l'istruzione di esportazione", "Could_not_find_import_clause_95131": "Non è stato possibile trovare la clausola di importazione", - "Could_not_find_matching_access_expressions_95141": "Non è stato possibile trovare espressioni di accesso corrispondenti", "Could_not_find_namespace_import_or_named_imports_95132": "Non è stato possibile trovare l'importazione spazi dei nomi o importazioni denominate", "Could_not_find_property_for_which_to_generate_accessor_95135": "Non è stato possibile trovare la proprietà per cui generare la funzione di accesso", "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231": "Non è stato possibile risolvere il percorso '{0}' con le estensioni: {1}.", @@ -429,8 +418,6 @@ "Declaration_expected_1146": "È prevista la dichiarazione.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Il nome della dichiarazione è in conflitto con l'identificatore globale predefinito '{0}'.", "Declaration_or_statement_expected_1128": "È prevista la dichiarazione o l'istruzione.", - "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": "Le dichiarazioni con asserzioni di assegnazione definite devono includere anche annotazioni di tipo.", - "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": "Le dichiarazioni con inizializzatori non possono includere anche asserzioni di assegnazione definite.", "Declare_a_private_field_named_0_90053": "Dichiarare un campo privato denominato '{0}'.", "Declare_method_0_90023": "Dichiarare il metodo '{0}'", "Declare_private_method_0_90038": "Dichiarare il metodo privato '{0}'", @@ -441,6 +428,7 @@ "Decorators_are_not_valid_here_1206": "In questo punto le espressioni Decorator non sono valide.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Non è possibile applicare le espressioni Decorator a più funzioni di accesso get/set con lo stesso nome.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "L'esportazione predefinita del modulo contiene o usa il nome privato '{0}'.", + "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258": "Le asserzioni di assegnazione definite possono essere usate solo con un'annotazione di tipo.", "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": "Le definizioni degli identificatori seguenti sono in conflitto con quelle di un altro file: {0}", "Delete_all_unused_declarations_95024": "Eliminare tutte le dichiarazioni non usate", "Delete_the_outputs_of_all_projects_6365": "Eliminare gli output di tutti i progetti", @@ -458,7 +446,6 @@ "Digit_expected_1124": "È prevista la cifra.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "La directory '{0}' non esiste. Tutte le ricerche che la interessano verranno ignorate.", "Disable_checking_for_this_file_90018": "Disabilitare la verifica per questo file", - "Disable_loading_referenced_projects_6235": "Disabilitare il caricamento dei progetti cui viene fatto riferimento.", "Disable_size_limitations_on_JavaScript_projects_6162": "Disabilita le dimensioni relative alle dimensioni per i progetti JavaScript.", "Disable_solution_searching_for_this_project_6224": "Disabilitare la ricerca della soluzione per questo progetto.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Disabilitare il controllo tassativo delle firme generiche nei tipi funzione.", @@ -490,7 +477,7 @@ "Duplicate_number_index_signature_2375": "La firma dell'indice di tipo number è duplicata.", "Duplicate_property_0_2718": "La proprietà '{0}' è duplicata.", "Duplicate_string_index_signature_2374": "La firma dell'indice di tipo string è duplicata.", - "Dynamic_import_cannot_have_type_arguments_1326": "Nell'importazione dinamica non possono essere presenti argomenti tipo.", + "Dynamic_import_cannot_have_type_arguments_1326": "Nell'importazione dinamica non possono essere presenti argomenti tipo", "Dynamic_import_must_have_one_specifier_as_an_argument_1324": "Come argomento dell'importazione dinamica si può indicare un solo identificatore.", "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "L'identificatore dell'importazione dinamica deve essere di tipo 'string', ma il tipo specificato qui è '{0}'.", "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323": "Le importazioni dinamiche sono supportate solo quando il flag '--module' è impostato su 'es2020', 'esnext', 'commonjs', 'amd', 'system' o 'umd'.", @@ -532,7 +519,6 @@ "Excessive_stack_depth_comparing_types_0_and_1_2321": "La profondità dello stack per il confronto dei tipi '{0}' e '{1}' è eccessiva.", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "Sono previsti argomento tipo {0}-{1}. Per specificarli, usare un tag '@extends'.", "Expected_0_arguments_but_got_1_2554": "Sono previsti {0} argomenti, ma ne sono stati ottenuti {1}.", - "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "Sono previsti {0} argomenti, ma ne sono stati ottenuti {1}. Si è dimenticato di includere 'void' nell'argomento di tipo per 'Promise'?", "Expected_0_arguments_but_got_1_or_more_2556": "Sono previsti {0} argomenti, ma ne sono stati ottenuti più di {1}.", "Expected_0_type_arguments_but_got_1_2558": "Sono previsti {0} argomenti tipo, ma ne sono stati ottenuti {1}.", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Sono previsti {0} argomenti tipo. Per specificarli, usare un tag '@extends'.", @@ -610,14 +596,11 @@ "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366": "Nella funzione manca l'istruzione return finale e il tipo restituito non include 'undefined'.", "Function_overload_must_be_static_2387": "L'overload della funzione deve essere statico.", "Function_overload_must_not_be_static_2388": "L'overload della funzione non deve essere statico.", - "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385": "La notazione del tipo di funzione deve essere racchiusa tra parentesi quando viene usata in un tipo di unione.", - "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387": "La notazione del tipo di funzione deve essere racchiusa tra parentesi quando viene usata in un tipo di intersezione.", "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014": "Il tipo di funzione, in cui manca l'annotazione di tipo restituito, contiene implicitamente un tipo restituito '{0}'.", "Generate_get_and_set_accessors_95046": "Generare le funzioni di accesso 'get' e 'set'", "Generate_get_and_set_accessors_for_all_overriding_properties_95119": "Generare le funzioni di accesso 'get' e 'set' per tutte le proprietà di sostituzione", "Generates_a_CPU_profile_6223": "Genera un profilo CPU.", "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": "Genera un mapping di origine per ogni file '.d.ts' corrispondente.", - "Generates_an_event_trace_and_a_list_of_types_6237": "Genera una traccia eventi e un elenco di tipi.", "Generates_corresponding_d_ts_file_6002": "Genera il file '.d.ts' corrispondente.", "Generates_corresponding_map_file_6043": "Genera il file '.map' corrispondente.", "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025": "Al generatore è assegnato in modo implicito il tipo yield '{0}' perché non contiene alcun valore. Provare a specificare un'annotazione di tipo restituito.", @@ -662,7 +645,6 @@ "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "Nelle dichiarazioni di enumerazione dell'ambiente l'inizializzatore di membro deve essere un'espressione costante.", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "In un'enumerazione con più dichiarazioni solo una di queste può omettere un inizializzatore per il primo elemento dell'enumerazione.", "Include_modules_imported_with_json_extension_6197": "Includere i moduli importati con estensione '.json'", - "Include_undefined_in_index_signature_results_6800": "Includere 'undefined' nei risultati della firma dell'indice", "Index_signature_in_type_0_only_permits_reading_2542": "La firma dell'indice nel tipo '{0}' consente solo la lettura.", "Index_signature_is_missing_in_type_0_2329": "Nel tipo '{0}' manca la firma dell'indice.", "Index_signatures_are_incompatible_2330": "Le firme dell'indice sono incompatibili.", @@ -694,7 +676,6 @@ "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Il valore non è valido per 'jsxFactory'. '{0}' non è un identificatore o un nome qualificato valido.", "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": "Il valore non è valido per 'jsxFragmentFactory'. '{0}' non è un identificatore o un nome qualificato valido.", "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Il valore di '--reactNamespace' non è valido. '{0}' non è un identificatore valido", - "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": "È probabile che manchi una virgola per separare queste due espressioni di modello. Costituiscono un'espressione di modello con tag che non può essere richiamata.", "Its_element_type_0_is_not_a_valid_JSX_element_2789": "Il relativo tipo di elemento '{0}' non è un elemento JSX valido.", "Its_instance_type_0_is_not_a_valid_JSX_element_2788": "Il relativo tipo di istanza '{0}' non è un elemento JSX valido.", "Its_return_type_0_is_not_a_valid_JSX_element_2787": "Il relativo tipo restituito '{0}' non è un elemento JSX valido.", @@ -759,6 +740,7 @@ "Module_0_has_no_default_export_1192": "Per il modulo '{0}' non esistono esportazioni predefinite.", "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": "Non esiste alcuna esportazione predefinita per il modulo '{0}'. Si intendeva usare 'import { {1} } from {0}'?", "Module_0_has_no_exported_member_1_2305": "Il modulo '{0}' non contiene un membro esportato '{1}'.", + "Module_0_has_no_exported_member_1_Did_you_mean_2_2724": "Per il modulo '{0}' non esiste alcun membro esportato '{1}'. Si intendeva '{2}'?", "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": "Non esiste alcun membro esportato '{1}' per il modulo '{0}'. Si intendeva usare 'import {1} from {0}'?", "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": "Il modulo '{0}' è nascosto da una dichiarazione locale con lo stesso nome.", "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "Il modulo '{0}' usa 'export =' e non può essere usato con 'export *'.", @@ -794,7 +776,6 @@ "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": "La classe non astratta '{0}' non implementa il membro astratto ereditato '{1}' della classe '{2}'.", "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "L'espressione di classe non astratta non implementa il membro astratto ereditato '{0}' dalla classe '{1}'.", "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": "Le asserzioni non Null possono essere usate solo in file TypeScript.", - "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090": "I percorsi non relativi non sono consentiti quando 'baseUrl' non è impostato. Si è dimenticato di aggiungere './' all'inizio?", "Non_simple_parameter_declared_here_1348": "In questo punto è dichiarato un parametro non semplice.", "Not_all_code_paths_return_a_value_7030": "Non tutti i percorsi del codice restituiscono un valore.", "Not_all_constituents_of_type_0_are_callable_2756": "Non tutti i costituenti di tipo '{0}' possono essere chiamati.", @@ -830,7 +811,6 @@ "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "L'opzione '{0}' può essere specificata solo nel file 'tsconfig.json' oppure impostata su 'false' o 'null' sulla riga di comando.", "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "L'opzione '{0}' può essere specificata solo nel file 'tsconfig.json' oppure impostata su 'null' sulla riga di comando.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "L'opzione '{0}' può essere usata solo quando si specifica l'opzione '--inlineSourceMap' o '--sourceMap'.", - "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": "Non è possibile specificare l'opzione '{0}' quando l'opzione 'jsx' è '{1}'.", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "Non è possibile specificare l'opzione '{0}' quando l'opzione 'target' è 'ES3'.", "Option_0_cannot_be_specified_with_option_1_5053": "Non è possibile specificare l'opzione '{0}' insieme all'opzione '{1}'.", "Option_0_cannot_be_specified_without_specifying_option_1_5052": "Non è possibile specificare l'opzione '{0}' senza l'opzione '{1}'.", @@ -839,6 +819,7 @@ "Option_build_must_be_the_first_command_line_argument_6369": "L'opzione '--build' deve essere il primo argomento della riga di comando.", "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": "È possibile specificare l'opzione '--incremental' solo se si usa tsconfig, si crea un singolo file o si specifica l'opzione `--tsBuildInfoFile`.", "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "L'opzione 'isolatedModules' può essere usata solo quando si specifica l'opzione '--module' oppure il valore dell'opzione 'target' è 'ES2015' o maggiore.", + "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "Non è possibile usare l'opzione 'paths' senza specificare l'opzione '--baseUrl'.", "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "Non è possibile combinare l'opzione 'project' con file di origine in una riga di comando.", "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071": "È possibile specificare l'opzione '--resolveJsonModule' solo quando la generazione del codice del modulo è impostata su 'commonjs', 'amd', 'es2015' o 'esNext'.", "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "Non è possibile specificare l'opzione '--resolveJsonModule' senza la strategia di risoluzione del modulo 'node'.", @@ -891,7 +872,6 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Il tipo di parametro del setter statico pubblico '{0}' della classe esportata contiene o usa il nome privato '{1}'.", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Esegue l'analisi in modalità strict e crea la direttiva \"use strict\" per ogni file di origine.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "Il criterio '{0}' deve contenere al massimo un carattere '*'.", - "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": "Gli intervalli delle prestazioni per '--Diagnostics' o '--extendedDiagnostics' non sono disponibili in questa sessione. Non è stato possibile trovare un'implementazione nativa dell'API Prestazioni Web.", "Prefix_0_with_an_underscore_90025": "Anteporre un carattere di sottolineatura a '{0}'", "Prefix_all_incorrect_property_declarations_with_declare_95095": "Aggiungere 'declare' come prefisso a tutte le dichiarazioni di proprietà non corrette", "Prefix_all_unused_declarations_with_where_possible_95025": "Aggiungere a tutte le dichiarazioni non usate il prefisso '_', laddove possibile", @@ -905,7 +885,7 @@ "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "Gli identificatori privati non sono consentiti nelle dichiarazioni di variabili.", "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "Gli identificatori privati non sono consentiti all'esterno del corpo della classe.", "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "Gli identificatori privati sono disponibili solo se destinati a ECMAScript 2015 e versioni successive.", - "Private_identifiers_cannot_be_used_as_parameters_18009": "Non è possibile usare gli identificatori privati come parametri.", + "Private_identifiers_cannot_be_used_as_parameters_18009": "Non è possibile usare gli identificatori privati come parametri", "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "Non è possibile accedere al membro privato o protetto '{0}' in un parametro di tipo.", "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Non è possibile compilare il progetto '{0}' perché la dipendenza '{1}' contiene errori", "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383": "Non è possibile compilare il progetto '{0}' perché la relativa dipendenza '{1}' non è stata compilata", @@ -923,7 +903,6 @@ "Property_0_does_not_exist_on_const_enum_1_2479": "La proprietà '{0}' non esiste nell'enumerazione 'const' '{1}'.", "Property_0_does_not_exist_on_type_1_2339": "La proprietà '{0}' non esiste nel tipo '{1}'.", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "La proprietà '{0}' non esiste nel tipo '{1}'. Si intendeva '{2}'?", - "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": "La proprietà '{0}' non esiste nel tipo '{1}'. È necessario modificare la libreria di destinazione? Provare a impostare l'opzione `lib` del compilatore su '{2}' o versioni successive.", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "La proprietà '{0}' non include alcun inizializzatore e non viene assolutamente assegnata nel costruttore.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "La proprietà '{0}' contiene implicitamente il tipo 'any', perché nella relativa funzione di accesso get manca un'annotazione di tipo restituito.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "La proprietà '{0}' contiene implicitamente il tipo 'any', perché nella relativa funzione di accesso set manca un'annotazione di tipo di parametro.", @@ -932,7 +911,7 @@ "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "La proprietà '{0}' nel tipo '{1}' non è assegnabile alla stessa proprietà nel tipo di base '{2}'.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "La proprietà '{0}' nel tipo '{1}' non è assegnabile al tipo '{2}'.", "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015": "La proprietà '{0}' nel tipo '{1}' fa riferimento a un membro diverso a cui non è possibile accedere dall'interno del tipo '{2}'.", - "Property_0_is_a_static_member_of_type_1_2576": "La proprietà '{0}' è un membro statico di tipo '{1}'.", + "Property_0_is_a_static_member_of_type_1_2576": "La proprietà '{0}' è un membro statico di tipo '{1}'", "Property_0_is_declared_but_its_value_is_never_read_6138": "La proprietà '{0}' è dichiarata, ma il suo valore non viene mai letto.", "Property_0_is_incompatible_with_index_signature_2530": "La proprietà '{0}' non è compatibile con la firma dell'indice.", "Property_0_is_incompatible_with_rest_element_type_2573": "La proprietà '{0}' non è compatibile con il tipo di elemento rest.", @@ -961,7 +940,6 @@ "Property_or_signature_expected_1131": "È prevista la proprietà o la firma.", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "Il valore della proprietà può essere solo un valore letterale stringa, un valore letterale numerico, 'true', 'false', 'null', un valore letterale di oggetto o un valore letterale di matrice.", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "Fornisce supporto completo per elementi iterabili in 'for-of', spread e destrutturazione quando la destinazione è 'ES5' o 'ES3'.", - "Provides_a_root_package_name_when_using_outFile_with_declarations_1390": "Fornisce un nome di pacchetto radice quando si usa outFile con le dichiarazioni.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "Il metodo pubblico '{0}' della classe esportata ha o usa il nome '{1}' del modulo esterno {2} ma non può essere rinominato.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "Il metodo pubblico '{0}' della classe esportata ha o usa il nome '{1}' del modulo privato '{2}'.", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "Il metodo pubblico '{0}' della classe esportata ha o usa il nome privato '{1}'.", @@ -1088,7 +1066,6 @@ "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "Specifica la sequenza di fine riga da usare per la creazione dei file, ovvero 'CRLF' (in DOS) o 'LF' (in UNIX).", "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": "Specifica il percorso in cui il debugger deve trovare i file TypeScript invece dei percorsi di origine.", "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "Specifica il percorso in cui il debugger deve trovare i file map invece dei percorsi generati.", - "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": "Specificare l'identificatore di modulo da usare da cui importare le funzioni di factory `jsx` e `jsxs`, ad esempio react", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Specifica la directory radice dei file di input. Usare per controllare la struttura della directory di output con --outDir.", "Split_all_invalid_type_only_imports_1367": "Dividere tutte le importazioni solo di tipi non valide", "Split_into_two_separate_import_declarations_1366": "Dividere in due dichiarazioni di importazione separate", @@ -1130,8 +1107,6 @@ "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496": "Non è possibile fare riferimento all'oggetto 'arguments' in una funzione arrow in ES3 e ES5. Provare a usare un'espressione di funzione standard.", "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "Non è possibile fare riferimento all'oggetto 'arguments' in un metodo o una funzione asincrona in ES3 e ES5. Provare a usare un metodo o una funzione standard.", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "Il corpo di un'istruzione 'if' non può essere l'istruzione vuota.", - "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391": "Non è necessario specificare l'opzione `bundledPackageName` quando si usa la risoluzione dei moduli outFile e node con la creazione di dichiarazioni.", - "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": "La chiamata sarebbe riuscita rispetto a questa implementazione, ma le firme di implementazione degli overload non sono visibili esternamente.", "The_character_set_of_the_input_files_6163": "Set di caratteri dei file di input.", "The_containing_arrow_function_captures_the_global_value_of_this_7041": "La funzione arrow contenitore acquisisce il valore globale di 'this'.", "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "Il corpo del modulo o la funzione che contiene è troppo grande per l'analisi del flusso di controllo.", @@ -1150,10 +1125,8 @@ "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "Non è possibile assegnare un nome al tipo derivato di '{0}' senza un riferimento a '{1}'. È probabile che non sia portabile. È necessaria un'annotazione di tipo.", "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "Il tipo dedotto di '{0}' fa riferimento a un tipo con una struttura ciclica che non può essere facilmente serializzata. È necessaria un'annotazione di tipo.", "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "Il tipo dedotto di '{0}' fa riferimento a un tipo '{1}' non accessibile. È necessaria un'annotazione di tipo.", - "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": "Il tipo dedotto di questo nodo supera la lunghezza massima serializzata dal compilatore. È necessaria un'annotazione di tipo esplicita.", "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": "L'intersezione '{0}' è stata ridotta a 'never' perché la proprietà '{1}' esiste in più costituenti ed è privata in alcuni.", "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": "L'intersezione '{0}' è stata ridotta a 'never' perché in alcuni costituenti della proprietà '{1}' sono presenti tipi in conflitto.", - "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": "La parola chiave 'intrinsic' può essere usata solo per dichiarare tipi intrinseci forniti dal compilatore.", "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": "Per usare frammenti JSX con l'opzione del compilatore 'jsxFactory', è necessario specificare l'opzione del compilatore 'jsxFragmentFactory'.", "The_last_overload_gave_the_following_error_2770": "L'ultimo overload ha restituito l'errore seguente.", "The_last_overload_is_declared_here_2771": "In questo punto viene dichiarato l'ultimo overload.", @@ -1230,7 +1203,7 @@ "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Le dichiarazioni di primo livello nei file con estensione d.ts devono iniziare con un modificatore 'declare' o 'export'.", "Trailing_comma_not_allowed_1009": "La virgola finale non è consentita.", "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "Esegue il transpile di ogni file in un modulo separato (simile a 'ts.transpileModule').", - "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "Provare con `npm i --save-dev @types/{1}` se esiste oppure aggiungere un nuovo file di dichiarazione con estensione d.ts contenente `declare module '{0}';`", + "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035": "Provare con `npm install @types/{1}` se esiste oppure aggiungere un nuovo file di dichiarazione con estensione d.ts contenente `declare module '{0}';`", "Trying_other_entries_in_rootDirs_6110": "Verrà effettuato un tentativo con altre voci in 'rootDirs'.", "Trying_substitution_0_candidate_module_location_Colon_1_6093": "Verrà effettuato un tentativo con la sostituzione '{0}'. Percorso candidato del modulo: '{1}'.", "Tuple_members_must_all_have_names_or_all_not_have_names_5084": "I membri di tupla devono tutti avere o non avere nomi.", @@ -1305,7 +1278,6 @@ "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": "======== La direttiva '{0}' del riferimento al tipo è stata risolta in '{1}'. Primaria: {2}. ========", "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": "======== La direttiva '{0}' del riferimento al tipo è stata risolta in '{1}' con ID pacchetto ID '{2}'. Primaria: {3}. ========", "Types_have_separate_declarations_of_a_private_property_0_2442": "I tipi contengono dichiarazioni separate di una proprietà privata '{0}'.", - "Types_of_construct_signatures_are_incompatible_2419": "I tipi delle firme del costrutto sono incompatibili.", "Types_of_parameters_0_and_1_are_incompatible_2328": "I tipi dei parametri '{0}' e '{1}' sono incompatibili.", "Types_of_property_0_are_incompatible_2326": "I tipi della proprietà '{0}' sono incompatibili.", "Unable_to_open_file_0_6050": "Non è possibile aprire il file '{0}'.", @@ -1378,7 +1350,6 @@ "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": "'{0}' può essere importato solo usando una chiamata 'require' o usando un'importazione predefinita.", "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": "'{0}' può essere importato solo usando 'import {1} = require({2})' o un'importazione predefinita.", "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": "'{0}' può essere importato solo usando 'import {1} = require({2})' o attivando il flag 'esModuleInterop' e usando un'importazione predefinita.", - "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208": "Non è possibile compilare '{0}' in '--isolatedModules' perché viene considerato un file di script globale. Aggiungere un'istruzione import, export o un'istruzione 'export {}' vuota per trasformarlo in un modulo.", "_0_cannot_be_used_as_a_JSX_component_2786": "Non è possibile usare '{0}' come componente JSX.", "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": "Non è possibile usare '{0}' come valore perché è stato esportato con 'export type'.", "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": "Non è possibile usare '{0}' come valore perché è stato importato con 'import type'.", @@ -1386,7 +1357,6 @@ "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": "Non è stato possibile creare un'istanza di '{0}' con un tipo arbitrario che potrebbe non essere correlato a '{1}'.", "_0_declarations_can_only_be_used_in_TypeScript_files_8006": "Le dichiarazioni '{0}' possono essere usate solo in file TypeScript.", "_0_expected_1005": "È previsto '{0}'.", - "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": "In '{0}' non è presente alcun membro esportato denominato '{1}'. Si intendeva '{2}'?", "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": "'{0}' include implicitamente un tipo restituito '{1}', ma è possibile dedurre un tipo migliore dall'utilizzo.", "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": "'{0}' contiene implicitamente il tipo restituito 'any', perché non contiene un'annotazione di tipo restituito e viene usato come riferimento diretto o indiretto in una delle relative espressioni restituite.", "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": "'{0}' contiene implicitamente il tipo 'any', perché non contiene un'annotazione di tipo e viene usato come riferimento diretto o indiretto nel relativo inizializzatore.", @@ -1399,29 +1369,27 @@ "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "'{0}' è definito come funzione di accesso nella classe '{1}', ma in questo punto ne viene eseguito l'override in '{2}' come proprietà di istanza.", "_0_is_deprecated_6385": "'{0}' è deprecato", "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "'{0}' non è una metaproprietà valida per la parola chiave '{1}'. Si intendeva '{2}'?", - "_0_is_not_allowed_as_a_variable_declaration_name_1389": "'{0}' non è consentito come nome di una dichiarazione di variabile.", "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "'{0}' viene usato come riferimento diretto o indiretto nella relativa espressione di base.", "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "'{0}' viene usato come riferimento diretto o indiretto nella relativa annotazione di tipo.", "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": "'{0}' è specificato più di una volta, quindi il relativo utilizzo verrà sovrascritto.", "_0_list_cannot_be_empty_1097": "L'elenco '{0}' non può essere vuoto.", "_0_modifier_already_seen_1030": "Il modificatore '{0}' è già presente.", + "_0_modifier_cannot_appear_on_a_class_element_1031": "Il modificatore '{0}' non può essere incluso in un elemento classe.", "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": "Il modificatore '{0}' non può essere incluso in una dichiarazione di costruttore.", "_0_modifier_cannot_appear_on_a_data_property_1043": "Il modificatore '{0}' non può essere incluso in una proprietà Data.", "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": "Il modificatore '{0}' non può essere incluso in un elemento modulo o spazio dei nomi.", "_0_modifier_cannot_appear_on_a_parameter_1090": "Il modificatore '{0}' non può essere incluso in un parametro.", "_0_modifier_cannot_appear_on_a_type_member_1070": "Il modificatore '{0}' non può essere incluso in un membro di tipo.", "_0_modifier_cannot_appear_on_an_index_signature_1071": "Il modificatore '{0}' non può essere incluso in una firma dell'indice.", - "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": "Il modificatore '{0}' non può essere incluso in elementi di classe di questo tipo.", "_0_modifier_cannot_be_used_here_1042": "Non è possibile usare il modificatore '{0}' in questo punto.", "_0_modifier_cannot_be_used_in_an_ambient_context_1040": "Non è possibile usare il modificatore '{0}' in un contesto di ambiente.", "_0_modifier_cannot_be_used_with_1_modifier_1243": "Non è possibile usare il modificatore '{0}' con il modificatore '{1}'.", "_0_modifier_cannot_be_used_with_a_class_declaration_1041": "Non è possibile usare il modificatore '{0}' con una dichiarazione di classe.", - "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "Non è possibile usare il modificatore '{0}' con un identificatore privato.", + "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "Non è possibile usare il modificatore '{0}' con un identificatore privato", "_0_modifier_must_precede_1_modifier_1029": "Il modificatore '{0}' deve precedere il modificatore '{1}'.", "_0_needs_an_explicit_type_annotation_2782": "'{0}' richiede un'annotazione di tipo esplicita.", "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": "'{0}' fa riferimento solo a un tipo, ma qui viene usato come spazio dei nomi.", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "'{0}' fa riferimento solo a un tipo, ma qui viene usato come valore.", - "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": "'{0}' fa riferimento solo a un tipo, ma qui viene usato come valore. Si intendeva usare '{1} in {0}'?", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "'{0}' si riferisce solo a un tipo, ma in questo punto viene usato come valore. È necessario modificare la libreria di destinazione? Provare a impostare l'opzione `lib` del compilatore su es2015 o versioni successive.", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "'{0}' fa riferimento a un istruzione globale UMD, ma il file corrente è un modulo. Provare ad aggiungere un'importazione.", "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "'{0}' fa riferimento a un valore, ma qui viene usato come tipo. Si intendeva 'typeof {0}'?", @@ -1458,7 +1426,6 @@ "extends_clause_already_seen_1172": "La clausola 'extends' è già presente.", "extends_clause_must_precede_implements_clause_1173": "La clausola 'extends' deve precedere la clausola 'implements'.", "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "La clausola 'extends' della classe esportata '{0}' contiene o usa il nome privato '{1}'.", - "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "La clausola 'extends' della classe esportata contiene o usa il nome privato '{0}'.", "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "La clausola 'extends' dell'interfaccia esportata '{0}' contiene o usa il nome privato '{1}'.", "file_6025": "file", "get_and_set_accessor_must_have_the_same_this_type_2682": "Le funzioni di accesso 'get e 'set' devono essere dello stesso tipo 'this'.", diff --git a/node_modules/typescript/lib/ja/diagnosticMessages.generated.json b/node_modules/typescript/lib/ja/diagnosticMessages.generated.json index 9298ae5..943ca99 100644 --- a/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +++ b/node_modules/typescript/lib/ja/diagnosticMessages.generated.json @@ -151,8 +151,6 @@ "Add_undefined_type_to_property_0_95018": "プロパティ '{0}' に '未定義' の型を追加します", "Add_unknown_conversion_for_non_overlapping_types_95069": "重複していない型に対して 'unknown' 変換を追加する", "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": "重複していない型のすべての変換に 'unknown' を追加する", - "Add_void_to_Promise_resolved_without_a_value_95143": "値なしで解決された Promise に 'void' を追加します", - "Add_void_to_all_Promises_resolved_without_a_value_95144": "値なしで解決されたすべての Promise に 'void' を追加します", "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "tsconfig.json ファイルを追加すると、TypeScript ファイルと JavaScript ファイルの両方を含むプロジェクトを整理できます。詳細については、https://aka.ms/tsconfig をご覧ください。", "Additional_Checks_6176": "追加のチェック", "Advanced_Options_6178": "詳細オプション", @@ -160,8 +158,9 @@ "All_declarations_of_0_must_have_identical_type_parameters_2428": "'{0}' のすべての宣言には、同一の型パラメーターがある必要があります。", "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "抽象メソッドの宣言はすべて連続している必要があります。", "All_destructured_elements_are_unused_6198": "非構造化要素はいずれも使用されていません。", + "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208": "'--isolatedModules' フラグが指定されている場合、すべてのファイルはモジュールである必要があります。", "All_imports_in_import_declaration_are_unused_6192": "インポート宣言内のインポートはすべて未使用です。", - "All_type_parameters_are_unused_6205": "すべての型パラメーターが使用されていません。", + "All_type_parameters_are_unused_6205": "すべての型パラメーターが使用されていません", "All_variables_are_unused_6199": "すべての変数は未使用です。", "Allow_accessing_UMD_globals_from_modules_95076": "モジュールから UMD グローバルへのアクセスを許可します。", "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "既定のエクスポートがないモジュールからの既定のインポートを許可します。これは、型チェックのみのため、コード生成には影響を与えません。", @@ -193,7 +192,7 @@ "An_export_assignment_cannot_have_modifiers_1120": "エクスポートの代入に修飾子を指定することはできません。", "An_export_declaration_can_only_be_used_in_a_module_1233": "エクスポート宣言はモジュールでのみ使用可能です。", "An_export_declaration_cannot_have_modifiers_1193": "エクスポート宣言に修飾子を指定することはできません。", - "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "'void' 型の式は、真実性をテストできません。", + "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "'void' 型の式は、真実性をテストできません", "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198": "拡張された Unicode エスケープ値は 0x0 と 0x10FFFF の間 (両端を含む) でなければなりません。", "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351": "識別子またはキーワードを数値リテラルのすぐ後に指定することはできません。", "An_implementation_cannot_be_declared_in_ambient_contexts_1183": "実装は環境コンテキストでは宣言できません。", @@ -235,7 +234,6 @@ "Argument_expression_expected_1135": "引数式が必要です。", "Argument_for_0_option_must_be_Colon_1_6046": "'{0}' オプションの引数は {1} である必要があります。", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "型 '{0}' の引数を型 '{1}' のパラメーターに割り当てることはできません。", - "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "rest パラメーター '{0}' の引数が指定されませんでした。", "Array_element_destructuring_pattern_expected_1181": "配列要素の非構造化パターンが必要です。", "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": "アサーションでは、呼び出し先のすべての名前が明示的な型の注釈で宣言されている必要があります。", "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": "アサーションでは、呼び出し先が識別子または修飾名である必要があります。", @@ -261,7 +259,6 @@ "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "戻り値の型の注釈がない呼び出しシグネチャの戻り値の型は、暗黙的に 'any' になります。", "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204": "引数なしの呼び出しシグネチャに、互換性のない戻り値の型 '{0}' と '{1}' が含まれています。", "Call_target_does_not_contain_any_signatures_2346": "呼び出しターゲットにシグネチャが含まれていません。", - "Can_only_convert_logical_AND_access_chains_95142": "論理 AND のアクセス チェーンのみを変換できます", "Can_only_convert_property_with_modifier_95137": "修飾子を伴うプロパティの変換のみ可能です", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "'{0}.{1}' にアクセスできません。'{0}' は型で、名前空間ではありません。'{0}[\"{1}\"]' で '{0}' のプロパティ '{1}' の型を取得するつもりでしたか?", "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748": "'--isolatedModules' フラグが指定されている場合、アンビエント const 列挙型にはアクセスできません。", @@ -284,21 +281,20 @@ "Cannot_find_global_value_0_2468": "グローバル値 '{0}' が見つかりません。", "Cannot_find_lib_definition_for_0_2726": "'{0}' のライブラリ定義が見つかりません。", "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "'{0}' のライブラリ定義が見つかりません。'{1}' ですか?", - "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "モジュール '{0}' が見つかりません。'--resolveJsonModule' を使用して '.json' 拡張子を持つモジュールをインポートすることをご検討ください。", - "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "モジュール '{0}' が見つかりません。'moduleResolution' オプションを 'node' に設定することか、'paths' オプションにエイリアスを追加することを意図していましたか?", + "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "モジュール '{0}' が見つかりません。'--resolveJsonModule ' を使用して'.json' 拡張子を持つモジュールをインポートすることを検討してください", "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "モジュール '{0}' またはそれに対応する型宣言が見つかりません。", "Cannot_find_name_0_2304": "名前 '{0}' が見つかりません。", "Cannot_find_name_0_Did_you_mean_1_2552": "'{0}' という名前は見つかりません。'{1}' ですか?", "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "名前 '{0}' が見つかりません。インスタンス メンバー 'this.{0}' ですか?", "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": "名前 '{0}' が見つかりません。静的メンバー '{1}.{0}' ですか?", - "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "名前 '{0}' が見つかりません。ターゲット ライブラリを変更する必要がありますか? `lib` コンパイラ オプションを '{1}' 以降に変更してみてください。", + "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "名前 '{0}' が見つかりません。ターゲット ライブラリを変更しますか? `lib` コンパイラ オプションを es2015 以降に変更してみてください。", "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": "名前 '{0}' が見つかりません。ターゲット ライブラリを変更しますか? `lib` コンパイラ オプションが 'dom' を含むように変更してみてください。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": "名前 '{0}' が見つかりません。テスト ランナーの型定義をインストールする必要がありますか? `npm i --save-dev @types/jest` または `npm i --save-dev @types/mocha` をお試しください。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": "名前 '{0}' が見つかりません。テスト ランナーの型定義をインストールする必要がありますか? `npm i --save-dev @types/jest` または `npm i --save-dev @types/mocha` を試してから、お客様の tsconfig の型フィールドに `jest` または `mocha` を追加してください。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": "名前 '{0}' が見つかりません。jQuery の型定義をインストールする必要がありますか? `npm i --save-dev @types/jquery` をお試しください。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": "名前 '{0}' が見つかりません。jQuery の型定義をインストールする必要がありますか? `npm i --save-dev @types/jquery` を試してから、お客様の tsconfig の型フィールドに `jquery` を追加してみてください。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": "名前 '{0}' が見つかりません。ノードの型定義をインストールする必要がありますか? `npm i --save-dev @types/node` をお試しください。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": "名前 '{0}' が見つかりません。ノードの型定義をインストールする必要がありますか? `npm i --save-dev @types/node` を試してから、お客様の tsconfig の型フィールドに `node` を追加してみてください。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582": "名前 '{0}' が見つかりません。テスト ランナーの型定義をインストールしますか? `npm i @types/jest` または `npm i @types/mocha` を試してみてください。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593": "名前 '{0}' が見つかりません。テスト ランナーの型定義をインストールしますか? `npm i @types/jest` または `npm i @types/mocha` を試してから、tsconfig の型フィールドに `jest` または `mocha` を追加してください。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581": "名前 '{0}' が見つかりません。jQuery の型定義をインストールしますか? `npm i @types/jquery` を試してみてください。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592": "名前 '{0}' が見つかりません。jQuery の型定義をインストールしますか? `npm i @types/jquery` を試してから、tsconfig の型フィールドに `jquery` を追加してみてください。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580": "名前 '{0}' が見つかりません。ノードの型定義をインストールしますか? `npm i @types/node` を試してみてください。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591": "名前 '{0}' が見つかりません。ノードの型定義をインストールしますか? `npm i @types/node` を試してから、tsconfig の型フィールドに `node` を追加してみてください。", "Cannot_find_namespace_0_2503": "名前空間 '{0}' が見つかりません。", "Cannot_find_parameter_0_1225": "パラメーター '{0}' が見つかりません。", "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": "入力ファイルの共通サブディレクトリ パスが見つかりません。", @@ -369,13 +365,10 @@ "Constructor_implementation_is_missing_2390": "コンストラクターの実装がありません。", "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673": "クラス '{0}' のコンストラクターはプライベートであり、クラス宣言内でのみアクセス可能です。", "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "クラス '{0}' のコンストラクターは保護されており、クラス宣言内でのみアクセス可能です。", - "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386": "共用体型で使用する場合、コンストラクターの型の表記はかっこで囲む必要があります。", - "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388": "交差型で使用する場合、コンストラクターの型の表記はかっこで囲む必要があります。", "Constructors_for_derived_classes_must_contain_a_super_call_2377": "派生クラスのコンストラクターには 'super' の呼び出しを含める必要があります。", "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "包含するファイルが指定されていないため、ルート ディレクトリを決定できません。'node_modules' フォルダーのルックアップをスキップします。", "Containing_function_is_not_an_arrow_function_95128": "含まれている関数はアロー関数ではありません", "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": "型 '{0}' から型 '{1}' への変換は、互いに十分に重複できないため間違っている可能性があります。意図的にそうする場合は、まず式を 'unknown' に変換してください。", - "Convert_0_to_1_in_0_95003": "'{0}' を '{0} の {1}' に変換します", "Convert_0_to_mapped_object_type_95055": "'{0}' をマップされたオブジェクト型に変換する", "Convert_all_constructor_functions_to_classes_95045": "すべてのコンストラクター関数をクラスに変換します", "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374": "値として使用されていないすべてのインポートを型のみのインポートに変換する", @@ -385,7 +378,6 @@ "Convert_all_to_async_functions_95066": "すべてを非同期関数に変換する", "Convert_all_to_bigint_numeric_literals_95092": "すべてを bigint 数値リテラルに変換する", "Convert_all_to_default_imports_95035": "すべてを既定のインポートに変換します", - "Convert_all_type_literals_to_mapped_type_95021": "すべての型リテラルをマップされた型に変換します", "Convert_arrow_function_or_function_expression_95122": "アロー関数または関数式を変換する", "Convert_const_to_let_95093": "'const' を 'let' に変換する", "Convert_default_export_to_named_export_95061": "既定のエクスポートを名前付きエクスポートに変換する", @@ -407,17 +399,14 @@ "Convert_to_async_function_95065": "非同期関数に変換する", "Convert_to_default_import_95013": "既定のインポートに変換する", "Convert_to_named_function_95124": "名前付き関数に変換する", - "Convert_to_optional_chain_expression_95139": "オプションのチェーン式に変換します", "Convert_to_template_string_95096": "テンプレート文字列に変換する", "Convert_to_type_only_export_1364": "型のみのエクスポートに変換する", "Convert_to_type_only_import_1373": "型のみのインポートに変換する", "Corrupted_locale_file_0_6051": "ロケール ファイル {0} は破損しています。", "Could_not_find_a_containing_arrow_function_95127": "含まれているアロー関数が見つかりませんでした", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "モジュール '{0}' の宣言ファイルが見つかりませんでした。'{1}' は暗黙的に 'any' 型になります。", - "Could_not_find_convertible_access_expression_95140": "変換可能なアクセス式が見つかりませんでした", "Could_not_find_export_statement_95129": "export ステートメントが見つかりませんでした", "Could_not_find_import_clause_95131": "インポート句が見つかりませんでした", - "Could_not_find_matching_access_expressions_95141": "一致するアクセス式が見つかりませんでした", "Could_not_find_namespace_import_or_named_imports_95132": "名前空間のインポートまたは名前付きインポートが見つかりませんでした", "Could_not_find_property_for_which_to_generate_accessor_95135": "アクセサーを生成するプロパティが見つかりませんでした", "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231": "次の拡張子を持つパス '{0}' を解決できませんでした: {1}。", @@ -429,8 +418,6 @@ "Declaration_expected_1146": "宣言が必要です。", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "宣言名が組み込みのグローバル識別子 '{0}' と競合しています。", "Declaration_or_statement_expected_1128": "宣言またはステートメントが必要です。", - "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": "明確な代入アサーションを使った宣言には、型の注釈も指定する必要があります。", - "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": "初期化子を使った宣言に明確な代入アサーションを含めることはできません。", "Declare_a_private_field_named_0_90053": "'{0}' という名前のプライベート フィールドを宣言します。", "Declare_method_0_90023": "メソッド '{0}' を宣言する", "Declare_private_method_0_90038": "プライベート メソッド '{0}' を宣言する", @@ -441,6 +428,7 @@ "Decorators_are_not_valid_here_1206": "デコレーターはここでは無効です。", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "デコレーターを同じ名前の複数の get/set アクセサーに適用することはできません。", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "モジュールの既定エクスポートがプライベート名 '{0}' を持っているか、使用しています。", + "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258": "明確な代入アサーションを使用できるのは、型の注釈と共に使用する場合のみです。", "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": "次の識別子の定義が、別のファイル内の定義と競合しています: {0}", "Delete_all_unused_declarations_95024": "未使用の宣言をすべて削除します", "Delete_the_outputs_of_all_projects_6365": "すべてのプロジェクトの出力を削除します", @@ -458,7 +446,6 @@ "Digit_expected_1124": "数値が必要です", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "ディレクトリ '{0}' は存在していません。ディレクトリ内のすべての参照をスキップしています。", "Disable_checking_for_this_file_90018": "このファイルのチェックを無効にする", - "Disable_loading_referenced_projects_6235": "参照されているプロジェクトの読み込みを無効にします。", "Disable_size_limitations_on_JavaScript_projects_6162": "JavaScript プロジェクトのサイズ制限を無効にします。", "Disable_solution_searching_for_this_project_6224": "このプロジェクトのソリューション検索を無効にします。", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "関数型の汎用シグネチャに対する厳密なチェックを無効にします。", @@ -490,7 +477,7 @@ "Duplicate_number_index_signature_2375": "number インデックス シグネチャが重複しています。", "Duplicate_property_0_2718": "プロパティ '{0}' が重複しています。", "Duplicate_string_index_signature_2374": "string インデックス シグネチャが重複しています。", - "Dynamic_import_cannot_have_type_arguments_1326": "動的インポートに型引数を指定することはできません。", + "Dynamic_import_cannot_have_type_arguments_1326": "動的インポートには型引数を指定することはできません", "Dynamic_import_must_have_one_specifier_as_an_argument_1324": "動的インポートには、引数として 1 つの指定子を指定する必要があります。", "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "動的インポートの指定子の型は 'string' である必要がありますが、ここでは型 '{0}' が指定されています。", "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323": "動的インポートは、'--module' フラグが 'es2020'、'esnext'、'commonjs'、'amd'、'system'、'umd' に設定されている場合にのみサポートされます。", @@ -532,7 +519,6 @@ "Excessive_stack_depth_comparing_types_0_and_1_2321": "型 '{0}' と '{1}' を比較するスタックが深すぎます。", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "{0}-{1} 型の引数が必要です。'@extends' タグで指定してください。", "Expected_0_arguments_but_got_1_2554": "{0} 個の引数が必要ですが、{1} 個指定されました。", - "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "{0} 引数が必要ですが、{1} が指定されました。'Promise' の型引数に 'void' を含めましたか?", "Expected_0_arguments_but_got_1_or_more_2556": "{0} 個の引数が必要ですが、{1} 個以上指定されました。", "Expected_0_type_arguments_but_got_1_2558": "{0} 個の型引数が必要ですが、{1} 個が指定されました。", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "{0} 型の引数が必要です。'@extends' タグで指定してください。", @@ -610,14 +596,11 @@ "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366": "関数に終了の return ステートメントがないため、戻り値の型には 'undefined' が含まれません。", "Function_overload_must_be_static_2387": "関数のオーバーロードは静的でなければなりません。", "Function_overload_must_not_be_static_2388": "関数のオーバーロードは静的にはできせん。", - "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385": "共用体型で使用する場合、関数の型の表記はかっこで囲む必要があります。", - "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387": "交差型で使用する場合、関数の型の表記はかっこで囲む必要があります。", "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014": "戻り値の型の注釈がない関数型の戻り値の型は、暗黙的に '{0}' になります。", "Generate_get_and_set_accessors_95046": "'get' および 'set' アクセサーの生成", "Generate_get_and_set_accessors_for_all_overriding_properties_95119": "すべてのオーバーライドするプロパティに対して 'get' および 'set' アクセサーを生成します", "Generates_a_CPU_profile_6223": "CPU プロファイルを生成します。", "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": "対応する各 '.d.ts' ファイルにソースマップを生成します。", - "Generates_an_event_trace_and_a_list_of_types_6237": "イベント トレースと型のリストを生成します。", "Generates_corresponding_d_ts_file_6002": "対応する '.d.ts' ファイルを生成します。", "Generates_corresponding_map_file_6043": "対応する '.map' ファイルを生成します。", "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025": "ジェネレーターは値を生成しないため、暗黙的に yield 型 '{0}' になります。戻り値の型の注釈を指定することを検討してください。", @@ -662,7 +645,6 @@ "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "アンビエント列挙型の宣言では、メンバー初期化子は定数式である必要があります。", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "複数の宣言がある列挙型で、最初の列挙要素の初期化子を省略できる宣言は 1 つのみです。", "Include_modules_imported_with_json_extension_6197": "'.json' 拡張子付きのインポートされたモジュールを含める", - "Include_undefined_in_index_signature_results_6800": "インデックス署名の結果に '未定義' を含めます", "Index_signature_in_type_0_only_permits_reading_2542": "型 '{0}' のインデックス シグネチャは、読み取りのみを許可します。", "Index_signature_is_missing_in_type_0_2329": "型 '{0}' のインデックス シグネチャがありません。", "Index_signatures_are_incompatible_2330": "インデックスの署名に互換性がありません。", @@ -694,7 +676,6 @@ "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "'jsxFactory' の値が無効です。'{0}' が有効な識別子または修飾名ではありません。", "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": "'jsxFragmentFactory' の値が無効です。'{0}' は有効な識別子でも修飾名でもありません。", "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "'--reactNamespace' の値が無効です。'{0}' は有効な識別子ではありません。", - "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": "これら 2 つのテンプレート式を区切るコンマが不足している可能性があります。タグ付きテンプレート式を形成しており、呼び出すことができません。", "Its_element_type_0_is_not_a_valid_JSX_element_2789": "その要素の型 '{0}' は有効な JSX 要素ではありません。", "Its_instance_type_0_is_not_a_valid_JSX_element_2788": "そのインスタンスの型 '{0}' は、有効な JSX 要素ではありません。", "Its_return_type_0_is_not_a_valid_JSX_element_2787": "その戻り値の型 '{0}' は、有効な JSX 要素ではありません。", @@ -759,6 +740,7 @@ "Module_0_has_no_default_export_1192": "モジュール '{0}' に既定エクスポートがありません。", "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": "モジュール '{0}' には既定のエクスポートがありません。'import { {1} } from {0}' を使用するつもりでしたか?", "Module_0_has_no_exported_member_1_2305": "モジュール '{0}' にエクスポートされたメンバー '{1}' がありません。", + "Module_0_has_no_exported_member_1_Did_you_mean_2_2724": "モジュール '{0}' にエクスポートされたメンバー '{1}' が含まれていません。候補: '{2}'", "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": "モジュール '{0}' にはエクスポートされたメンバー '{1}' がありません。'import {1} from {0}' を使用するつもりでしたか?", "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": "モジュール '{0}' は同じ名前のローカル宣言によって非表示になっています。", "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "モジュール '{0}' には 'export =' が使用されているため、'export *' は併用できません。", @@ -794,7 +776,6 @@ "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": "非抽象クラス '{0}' はクラス '{2}' からの継承抽象メンバー '{1}' を実装しません。", "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "非抽象クラスの式はクラス '{1}' からの継承抽象メンバー '{0}' を実装しません。", "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": "non-null アサーションは、TypeScript ファイルでのみ使用できます。", - "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090": "'baseUrl' が設定されていない場合、非相対パスは許可されません。先頭に './' が使用されていることをご確認ください。", "Non_simple_parameter_declared_here_1348": "ここでは複雑なパラメーターが宣言されています。", "Not_all_code_paths_return_a_value_7030": "一部のコード パスは値を返しません。", "Not_all_constituents_of_type_0_are_callable_2756": "型 '{0}' のすべての構成要素が呼び出し可能なわけではありません。", @@ -830,7 +811,6 @@ "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "オプション '{0}' は、'tsconfig.json' ファイルで指定することか、コマンド ラインで 'false' または 'null' に設定することしかできません。", "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "オプション '{0}' は、'tsconfig.json' ファイルで指定することか、コマンド ラインで 'null' に設定することしかできません。", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "オプション '{0} を使用できるのは、オプション '--inlineSourceMap' またはオプション '--sourceMap' のいずれかを指定した場合のみです。", - "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": "オプション 'jsx' が '{1}' の場合、オプション '{0}' を指定することはできません。", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "オプション 'target' が 'ES3' の場合、オプション '{0}' を指定することはできません。", "Option_0_cannot_be_specified_with_option_1_5053": "オプション '{0}' をオプション '{1}' とともに指定することはできません。", "Option_0_cannot_be_specified_without_specifying_option_1_5052": "オプション '{1}' を指定せずに、オプション '{0}' を指定することはできません。", @@ -839,6 +819,7 @@ "Option_build_must_be_the_first_command_line_argument_6369": "オプション '--build' は最初のコマンド ライン引数である必要があります。", "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": "オプション '--incremental' は、tsconfig を使用して指定して単一ファイルに出力するか、オプション `--tsBuildInfoFile` が指定された場合にのみ指定することができます。", "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "オプション 'isolatedModules' は、オプション '--module' が指定されているか、オプション 'target' が 'ES2015' 以上であるかのいずれかの場合でのみ使用できます。", + "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "オプション 'paths' は、'--baseUrl' オプションを指定せずに使用できません。", "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "オプション 'project' をコマンド ライン上でソース ファイルと一緒に指定することはできません。", "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071": "オプション '--resolveJsonModule' は、モジュール コードの生成が 'commonjs'、'amd'、'es2015'、'esNext' である場合にのみ指定できます。", "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "'node' モジュールの解決方法を使用せずにオプション '--resolveJsonModule' を指定することはできません。", @@ -891,7 +872,6 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "エクスポートされたクラスのパブリック静的セッター '{0}' のパラメーター型が、プライベート名 '{1}' を持っているか、使用しています。", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "厳格モードで解析してソース ファイルごとに \"use strict\" を生成します。", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "パターン '{0}' に使用できる '*' 文字は最大で 1 つです。", - "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": "'--diagnostics' または '--extendedDiagnostics' のパフォーマンスのタイミングは、このセッションでは使用できません。Web パフォーマンス API のネイティブ実装が見つかりませんでした。", "Prefix_0_with_an_underscore_90025": "アンダースコアを含むプレフィックス '{0}'", "Prefix_all_incorrect_property_declarations_with_declare_95095": "すべての正しくないプロパティ宣言の前に 'declare' を付ける", "Prefix_all_unused_declarations_with_where_possible_95025": "可能な場合は、使用されていないすべての宣言にプレフィックスとして '_' を付けます", @@ -905,7 +885,7 @@ "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "変数宣言では、private 識別子は許可されていません。", "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "private 識別子は、クラス本体の外では許可されていません。", "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "private 識別子は ECMAScript 2015 以上をターゲットにする場合にのみ使用できます。", - "Private_identifiers_cannot_be_used_as_parameters_18009": "private 識別子はパラメーターとして使用できません。", + "Private_identifiers_cannot_be_used_as_parameters_18009": "private 識別子はパラメーターとして使用できません", "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "private または protected メンバー '{0}' には、型パラメーターではアクセスできません。", "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "プロジェクト '{0}' はその依存関係 '{1}' にエラーがあるためビルドできません", "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383": "依存関係 '{1}' がビルドされていないため、プロジェクト '{0}' はビルドできません", @@ -923,7 +903,6 @@ "Property_0_does_not_exist_on_const_enum_1_2479": "プロパティ '{0}' が 'const' 列挙型 '{1}' に存在しません。", "Property_0_does_not_exist_on_type_1_2339": "プロパティ '{0}' は型 '{1}' に存在しません。", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "プロパティ '{0}' は型 '{1}' に存在していません。'{2}' ですか?", - "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": "プロパティ '{0}' が型 '{1}' に存在しません。ターゲット ライブラリを変更する必要がありますか? 'lib' コンパイラ オプションを '{2}' 以降に変更してみてください。", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "プロパティ '{0}' に初期化子がなく、コンストラクターで明確に割り当てられていません。", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "プロパティ '{0}' には型 'any' が暗黙的に設定されています。get アクセサーには戻り値の型の注釈がないためです。", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "プロパティ '{0}' には型 'any' が暗黙的に設定されています。set アクセサーにはパラメーター型の注釈がないためです。", @@ -932,7 +911,7 @@ "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "型 '{1}' のプロパティ '{0}' を基本データ型 '{2}' の同じプロパティに割り当てることはできません。", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "型 '{1}' のプロパティ '{0}' を型 '{2}' に割り当てることはできません。", "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015": "型 '{1}' のプロパティ '{0}' は、型 '{2}' 内からアクセスできない別のメンバーを参照しています。", - "Property_0_is_a_static_member_of_type_1_2576": "プロパティ '{0}' は型 '{1}' の静的メンバーです。", + "Property_0_is_a_static_member_of_type_1_2576": "プロパティ '{0}' は型 '{1}' の静的メンバーです", "Property_0_is_declared_but_its_value_is_never_read_6138": "プロパティ '{0}' が宣言されていますが、その値が読み取られることはありません。", "Property_0_is_incompatible_with_index_signature_2530": "プロパティ '{0}' はインデックス シグネチャと互換性がありません。", "Property_0_is_incompatible_with_rest_element_type_2573": "プロパティ '{0}' は rest 要素の型と互換性がありません。", @@ -961,7 +940,6 @@ "Property_or_signature_expected_1131": "プロパティまたはシグネチャが必要です。", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "プロパティ値には、文字列リテラル、数値リテラル、'true'、'false'、'null'、オブジェクト リテラルまたは配列リテラルのみ使用できます。", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "'for-of' の iterable、spread、'ES5' や 'ES3' をターゲットとする場合は destructuring に対してフル サポートを提供します。", - "Provides_a_root_package_name_when_using_outFile_with_declarations_1390": "宣言で outFile を使用する場合、ルート パッケージ名を指定します。", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "エクスポートされたクラスのパブリック メソッド '{0}' が外部モジュール {2} の名前 '{1}' を持っているか使用していますが、名前を指定することはできません。", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "エクスポートされたクラスのパブリック メソッド '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "エクスポートされたクラスのパブリック メソッド '{0}' がプライベート名 '{1}' を持っているか、使用しています。", @@ -994,8 +972,8 @@ "Remove_unnecessary_await_95086": "不要な 'await' を削除する", "Remove_unreachable_code_95050": "到達できないコードを削除します", "Remove_unused_declaration_for_Colon_0_90004": "'{0}' に対する使用されていない宣言を削除する", - "Remove_unused_declarations_for_Colon_0_90041": "'{0}' に対する使用されていない宣言を削除してください", - "Remove_unused_destructuring_declaration_90039": "使用されていない非構造化宣言を削除してください", + "Remove_unused_declarations_for_Colon_0_90041": "'{0}' に対する使用されていない宣言を削除する", + "Remove_unused_destructuring_declaration_90039": "未使用の非構造化宣言を削除する", "Remove_unused_label_95053": "未使用のラベルを削除します", "Remove_variable_statement_90010": "変数のステートメントを削除します", "Replace_0_with_Promise_1_90036": "'{0}' を 'Promise<{1}>' に置き換える", @@ -1088,7 +1066,6 @@ "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "ファイルの生成時に使用する行シーケンスの末尾を指定します: 'CRLF' (dos) または 'LF' (unix)。", "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": "デバッガーがソースの場所の代わりに TypeScript ファイルを検索する必要のある場所を指定します。", "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "デバッガーが、生成された場所の代わりにマップ ファイルを検索する必要のある場所を指定します。", - "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": "'jsx' と 'jsxs' のファクトリ関数をインポートするために使用されるモジュール指定子を指定します。例: react", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "入力ファイルのルート ディレクトリを指定します。--outDir とともに、出力ディレクトリ構造の制御に使用します。", "Split_all_invalid_type_only_imports_1367": "無効な型のみのインポートをすべて分割する", "Split_into_two_separate_import_declarations_1366": "2 つの別個のインポート宣言に分割する", @@ -1113,7 +1090,7 @@ "Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337": "super の呼び出しは、コンストラクターの外部、またはコンストラクター内の入れ子になった関数では使用できません。", "Suppress_excess_property_checks_for_object_literals_6072": "オブジェクト リテラルの過剰なプロパティ確認を抑制します。", "Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055": "インデックス シグニチャのないオブジェクトにインデックスを作成するため、noImplicitAny エラーを抑制します。", - "Switch_each_misused_0_to_1_95138": "誤用されている各 '{0}' を '{1}' に切り替えてください", + "Switch_each_misused_0_to_1_95138": "誤用されている各 '{0}' を '{1}' に切り替える", "Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "'Symbol' 参照は、グローバル シンボル コンストラクター オブジェクトを参照しません。", "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "再帰的な監視をネイティブでサポートしていないプラットフォーム上で、同期的にコールバックを呼び出してディレクトリ監視の状態を更新します。", "Syntax_Colon_0_6023": "構文: {0}", @@ -1130,8 +1107,6 @@ "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496": "'arguments' オブジェクトは、ES3 および ES5 のアロー関数で参照することはできません。標準の関数式の使用を考慮してください。", "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "'arguments' オブジェクトは、ES3 および ES5 の非同期関数またはメソッドで参照することはできません。標準の関数またはメソッドを使用することを検討してください。", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "'if' ステートメントの本文を空のステートメントにすることはできません。", - "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391": "宣言の生成で outFile とノード モジュールの解決を使用する場合、`bundledPackageName` オプションを指定する必要があります。", - "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": "呼び出しはこの実装に対して成功した可能性がありますが、オーバーロードの実装シグネチャは外部からは参照できません。", "The_character_set_of_the_input_files_6163": "入力ファイルの文字セット。", "The_containing_arrow_function_captures_the_global_value_of_this_7041": "含まれているアロー関数は、'this' のグローバル値をキャプチャします。", "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "含まれている関数またはモジュールの本体は、制御フロー解析には大きすぎます。", @@ -1150,10 +1125,8 @@ "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "'{0}' の推論された型には、'{1}' への参照なしで名前を付けることはできません。これは、移植性がない可能性があります。型の注釈が必要です。", "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "'{0}' の推論された型は、循環構造を持つ型を参照しています。この型のシリアル化は自明ではありません。型の注釈が必要です。", "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "'{0}' の推定型はアクセス不可能な '{1}' 型を参照します。型の注釈が必要です。", - "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": "このノードの推定型は、コンパイラがシリアル化する最大長を超えています。明示的な型の注釈が必要です。", "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": "交差 '{0}' は 'なし' に縮小されました。プロパティ '{1}' が複数の構成要素に存在し、一部ではプライベートであるためです。", "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": "交差 '{0}' は 'なし' に縮小されました。一部の構成要素でプロパティ '{1}' の型が競合しているためです。", - "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": "'組み込み' キーワードは、コンパイラが提供する組み込み型を宣言する場合にのみ使用できます。", "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": "'jsxFactory' コンパイラ オプションで JSX フラグメントを使用するには、'jsxFragmentFactory' コンパイラ オプションを指定する必要があります。", "The_last_overload_gave_the_following_error_2770": "前回のオーバーロードにより、次のエラーが発生しました。", "The_last_overload_is_declared_here_2771": "前回のオーバーロードはここで宣言されています。", @@ -1230,7 +1203,7 @@ "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts ファイルのトップレベルの宣言は、'declare' または 'export' 修飾子で始める必要があります。", "Trailing_comma_not_allowed_1009": "末尾にコンマは使用できません。", "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "個々のモジュールとして各ファイルをトランスパイルします ('ts.transpileModule' に類似)。", - "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "存在する場合は `npm i --save-dev @types/{1}` を試すか、`declare module '{0}';` を含む新しい宣言 (.d.ts) ファイルを追加します", + "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035": "存在する場合は `npm install @types/{1}` を試してください。または、`declare module '{0}';` を含む新しい宣言 (.d.ts) ファイルを追加します。", "Trying_other_entries_in_rootDirs_6110": "'rootDirs' の他のエントリを試しています。", "Trying_substitution_0_candidate_module_location_Colon_1_6093": "代入 '{0}' を試しています。候補のモジュールの場所: '{1}'。", "Tuple_members_must_all_have_names_or_all_not_have_names_5084": "タプル メンバーのすべての名前が指定されているか、すべての名前が指定されていないかのどちらかでなければなりません。", @@ -1305,7 +1278,6 @@ "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": "======== 型参照ディレクティブ '{0}' が正常に '{1}' に解決されました。プライマリ: {2}。========", "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": "======== 型参照ディレクティブ '{0}' が正常に '{1}' に解決されました (パッケージ ID '{2}'、プライマリ: {3})。========", "Types_have_separate_declarations_of_a_private_property_0_2442": "複数の型に、プライベート プロパティ '{0}' の異なる宣言が含まれています。", - "Types_of_construct_signatures_are_incompatible_2419": "コンストラクト シグネチャの型に互換性がありません。", "Types_of_parameters_0_and_1_are_incompatible_2328": "パラメーター '{0}' および '{1}' は型に互換性がありません。", "Types_of_property_0_are_incompatible_2326": "プロパティ '{0}' の型に互換性がありません。", "Unable_to_open_file_0_6050": "ファイル '{0}' を開くことができません。", @@ -1378,7 +1350,6 @@ "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": "'{0}' をインポートするには、'require' 呼び出しを使用するか、既定のインポートを使用する必要があります。", "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": "'{0}' をインポートするには、'import {1} = require({2})' または既定のインポートを使用する必要があります。", "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": "'{0}' をインポートするには、'import {1} = require ({2})' を使用するか、'esModuleInterop' フラグをオンにして既定のインポートを使用する必要があります。", - "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208": "'{0}' は、グローバル スクリプト ファイルと見なされるため、'--isolatedModules' でコンパイルすることはできません。import、export、または空の 'export {}' ステートメントを追加して、これをモジュールにしてください。", "_0_cannot_be_used_as_a_JSX_component_2786": "'{0}' を JSX コンポーネントとして使用することはできません。", "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": "'export type' を使用してエクスポートされたため、'{0}' は値として使用できません。", "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": "'import type' を使用してインポートされたため、'{0}' は値として使用できません。", @@ -1386,7 +1357,6 @@ "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": "'{1}' に関連しない可能性のある任意の型で '{0}' をインスタンス化できます。", "_0_declarations_can_only_be_used_in_TypeScript_files_8006": "'{0}' 宣言は TypeScript ファイルでのみ使用できます。", "_0_expected_1005": "'{0}' が必要です。", - "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": "'{1}' という名前のエクスポートされたメンバーが '{0}' に含まれていません。候補: '{2}'", "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": "'{0}' の戻り値の型は暗黙的に '{1}' になっていますが、使い方からより良い型を推論できます。", "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": "'{0}' は、戻り値の型の注釈がなく、いずれかの return 式で直接的にまたは間接的に参照されているため、戻り値の型は暗黙的に 'any' になります。", "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": "'{0}' には型の注釈がなく、直接または間接的に初期化子で参照されているため、暗黙的に 'any' 型が含まれています。", @@ -1399,29 +1369,27 @@ "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "'{0}' はクラス '{1}' でアクセサーとして定義されていますが、ここではインスタンス プロパティとして '{2}' でオーバーライドされています。", "_0_is_deprecated_6385": "'{0}' は非推奨です", "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "'{0}' はキーワード '{1}' に関するメタプロパティとして無効です。候補: '{2}'。", - "_0_is_not_allowed_as_a_variable_declaration_name_1389": "'{0}' は変数宣言の名前として使用できません。", "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "'{0}' はそれ自身のベース式内で直接または間接的に参照されます。", "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "'{0}' はそれ自身の型の注釈内で直接または間接的に参照されます。", "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": "'{0}' が複数回指定されているため、ここでの使用は上書きされます。", "_0_list_cannot_be_empty_1097": "'{0}' のリストを空にすることはできません。", "_0_modifier_already_seen_1030": "'{0}' 修飾子は既に存在します。", + "_0_modifier_cannot_appear_on_a_class_element_1031": "'{0}' 修飾子はクラス要素では使用できません。", "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": "'{0}' 修飾子はコンストラクター宣言では使用できません。", "_0_modifier_cannot_appear_on_a_data_property_1043": "'{0}' 修飾子はデータ プロパティでは使用できません。", "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": "'{0}' 修飾子は、モジュールまたは名前空間の要素では使用できません。", "_0_modifier_cannot_appear_on_a_parameter_1090": "'{0}' 修飾子はパラメーターでは使用できません。", "_0_modifier_cannot_appear_on_a_type_member_1070": "'{0}' 修飾子は型メンバーでは使用できません。", "_0_modifier_cannot_appear_on_an_index_signature_1071": "'{0}' 修飾子はインデックス シグネチャでは使用できません。", - "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": "'{0}' 修飾子はこの種類のクラス要素では使用できません。", "_0_modifier_cannot_be_used_here_1042": "'{0}' 修飾子はここでは使用できません。", "_0_modifier_cannot_be_used_in_an_ambient_context_1040": "'{0}' 修飾子は環境コンテキストでは使用できません。", "_0_modifier_cannot_be_used_with_1_modifier_1243": "'{0}' 修飾子と '{1}' 修飾子は同時に使用できません。", "_0_modifier_cannot_be_used_with_a_class_declaration_1041": "'{0}' 修飾子とクラス宣言は同時に使用できません。", - "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "'{0}' 修飾子を private 識別子とともに使用することはできません。", + "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "'{0}' 修飾子を private 識別子とともに使用することはできません", "_0_modifier_must_precede_1_modifier_1029": "'{0}' 修飾子は '{1}' 修飾子の前に指定する必要があります。", "_0_needs_an_explicit_type_annotation_2782": "'{0}' には、明示的な型の注釈が必要です。", "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": "'{0}' は型のみを参照しますが、ここで名前空間として使用されています。", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "'{0}' は型のみを参照しますが、ここで値として使用されています。", - "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": "'{0}' は型を参照しているだけですが、こちらでは値として使用されています。'{0} 内の {1}' を使用しますか?", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "'{0}' は型のみを参照しますが、ここでは値として使用されています。ターゲット ライブラリを変更しますか? `lib` コンパイラ オプションを es2015 以降に変更してみてください。", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "'{0}' は UMD グローバルを参照していますが、現在のファイルはモジュールです。代わりにインポートを追加することを考慮してください。", "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "'{0}' は値を参照していますが、ここでは型として使用されています。'typeof {0}' を意図していましたか?", @@ -1458,7 +1426,6 @@ "extends_clause_already_seen_1172": "'extends' 句は既に存在します。", "extends_clause_must_precede_implements_clause_1173": "extends' 句は 'implements' 句の前に指定しなければなりません。", "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "エクスポートされたクラス '{0}' の 'extends' 句がプライベート名 '{1}' を持っているか、使用しています。", - "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "エクスポートされたクラスの 'extends' 句がプライベート名 '{0}' を持っているか、使用しています。", "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "エクスポートされたインターフェイス '{0}' の 'extends' 句がプライベート名 '{1}' を持っているか、使用しています。", "file_6025": "ファイル", "get_and_set_accessor_must_have_the_same_this_type_2682": "'get' アクセサーおよび 'set' アクセサーには、同じ 'this' 型が必要です。", diff --git a/node_modules/typescript/lib/ko/diagnosticMessages.generated.json b/node_modules/typescript/lib/ko/diagnosticMessages.generated.json index afb5401..c7277ab 100644 --- a/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +++ b/node_modules/typescript/lib/ko/diagnosticMessages.generated.json @@ -151,8 +151,6 @@ "Add_undefined_type_to_property_0_95018": "'{0}' 속성에 '정의되지 않은' 형식 추가", "Add_unknown_conversion_for_non_overlapping_types_95069": "겹치지 않는 형식에 대해 'unknown' 변환 추가", "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": "겹치지 않는 형식의 모든 변환에 'unknown' 추가", - "Add_void_to_Promise_resolved_without_a_value_95143": "값 없이 확인된 Promise에 'void' 추가", - "Add_void_to_all_Promises_resolved_without_a_value_95144": "값 없이 확인된 모든 Promise에 'void' 추가", "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "tsconfig.json 파일을 추가하면 TypeScript 파일과 JavaScript 파일이 둘 다 포함된 프로젝트를 정리하는 데 도움이 됩니다. 자세한 내용은 https://aka.ms/tsconfig를 참조하세요.", "Additional_Checks_6176": "추가 검사", "Advanced_Options_6178": "고급 옵션", @@ -160,6 +158,7 @@ "All_declarations_of_0_must_have_identical_type_parameters_2428": "'{0}'의 모든 선언에는 동일한 형식 매개 변수가 있어야 합니다.", "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "추상 메서드의 모든 선언은 연속적이어야 합니다.", "All_destructured_elements_are_unused_6198": "구조 파괴된 요소가 모두 사용되지 않습니다.", + "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208": "'--isolatedModules' 플래그가 제공된 경우 모든 파일이 모듈이어야 합니다.", "All_imports_in_import_declaration_are_unused_6192": "가져오기 선언의 모든 가져오기가 사용되지 않습니다.", "All_type_parameters_are_unused_6205": "모든 형식 매개 변수가 사용되지 않습니다.", "All_variables_are_unused_6199": "모든 변수가 사용되지 않습니다.", @@ -235,7 +234,7 @@ "Argument_expression_expected_1135": "인수 식이 필요합니다.", "Argument_for_0_option_must_be_Colon_1_6046": "'{0}' 옵션의 인수는 {1}이어야(여야) 합니다.", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "'{0}' 형식의 인수는 '{1}' 형식의 매개 변수에 할당될 수 없습니다.", - "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "REST 매개 변수 '{0}'에 대한 인수가 제공되지 않았습니다.", + "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "Arguments for the rest parameter '{0}' were not provided.", "Array_element_destructuring_pattern_expected_1181": "배열 요소 구조 파괴 패턴이 필요합니다.", "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": "어설션에서 호출 대상의 모든 이름은 명시적 형식 주석을 사용하여 선언해야 합니다.", "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": "어설션에서 호출 대상은 식별자 또는 정규화된 이름이어야 합니다.", @@ -285,20 +284,20 @@ "Cannot_find_lib_definition_for_0_2726": "'{0}'에 대한 라이브러리 정의를 찾을 수 없습니다.", "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "'{0}'에 대한 라이브러리 정의를 찾을 수 없습니다. '{1}'이(가) 아닌지 확인하세요.", "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "'{0}' 모듈을 찾을 수 없습니다. '--resolveJsonModule'을 사용하여 '. json' 확장명이 포함된 모듈을 가져오는 것이 좋습니다.", - "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "'{0}' 모듈을 찾을 수 없습니다. 'moduleResolution' 옵션을 'node'로 설정하거나 'paths' 옵션에 별칭을 추가하려고 하셨습니까?", + "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?", "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "'{0}' 모듈 또는 해당 형식 선언을 찾을 수 없습니다.", "Cannot_find_name_0_2304": "'{0}' 이름을 찾을 수 없습니다.", "Cannot_find_name_0_Did_you_mean_1_2552": "'{0}' 이름을 찾을 수 없습니다. '{1}'을(를) 사용하시겠습니까?", "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "'{0}' 이름을 찾을 수 없습니다. 인스턴스 멤버 'this.{0}'을(를) 사용하시겠습니까?", "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": "'{0}' 이름을 찾을 수 없습니다. 정적 멤버 '{1}.{0}'을(를) 사용하시겠습니까?", - "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "'{0}' 이름을 찾을 수 없습니다. 대상 라이브러리를 변경하려는 경우 'lib' 컴파일러 옵션을 '{1}' 이상으로 변경해 보세요.", + "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "'{0}' 이름을 찾을 수 없습니다. 대상 라이브러리를 변경하려는 경우 'lib' 컴파일러 옵션을 es2015 이상으로 변경해 봅니다.", "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": "'{0}' 이름을 찾을 수 없습니다. 대상 라이브러리를 변경하려는 경우 'dom'을 포함하도록 'lib' 컴파일러 옵션을 변경해 봅니다.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": "'{0}' 이름을 찾을 수 없습니다. 테스트 실행기의 형식 정의를 설치하려는 경우 'npm i --save-dev @types/jest' 또는 'npm i --save-dev @types/mocha'를 시도합니다.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": "'{0}' 이름을 찾을 수 없습니다. 테스트 실행기의 형식 정의를 설치하려는 경우 'npm i --save-dev @types/jest' 또는 'npm i --save-dev @types/mocha'를 시도한 다음, tsconfig의 형식 필드에 'jest' 또는 'mocha'를 추가합니다.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": "'{0}' 이름을 찾을 수 없습니다. jQuery의 형식 정의를 설치하려는 경우 'npm i --save-dev @types/jquery'를 시도합니다.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": "'{0}' 이름을 찾을 수 없습니다. jQuery의 형식 정의를 설치하려는 경우 'npm i --save-dev @types/jquery'를 시도한 다음, tsconfig의 형식 필드에 'jquery'를 추가합니다.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": "'{0}' 이름을 찾을 수 없습니다. 노드의 형식 정의를 설치하려는 경우 'npm i --save-dev @types/node'를 시도합니다.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": "'{0}' 이름을 찾을 수 없습니다. 노드의 형식 정의를 설치하려는 경우 'npm i --save-dev @types/node'를 시도한 다음, tsconfig의 형식 필드에 'node'를 추가합니다.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582": "'{0}' 이름을 찾을 수 없습니다. 테스트 실행기의 형식 정의를 설치하려는 경우 'npm i @types/jest' 또는 'npm i @types/mocha'를 시도해 봅니다.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593": "'{0}' 이름을 찾을 수 없습니다. 테스트 실행기의 형식 정의를 설치하려는 경우 'npm i @types/jest' 또는 'npm i @types/mocha'를 시도한 다음, tsconfig의 형식 필드에 'jest' 또는 'mocha'를 추가합니다.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581": "'{0}' 이름을 찾을 수 없습니다. jQuery의 형식 정의를 설치하려는 경우 'npm i @types/jquery'를 시도합니다.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592": "'{0}' 이름을 찾을 수 없습니다. jQuery의 형식 정의를 설치하려는 경우 'npm i @types/jquery'를 시도한 다음, tsconfig의 형식 필드에 'jquery'를 추가합니다.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580": "'{0}' 이름을 찾을 수 없습니다. 노드의 형식 정의를 설치하려는 경우 'npm i @types/node'를 시도합니다.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591": "'{0}' 이름을 찾을 수 없습니다. 노드의 형식 정의를 설치하려는 경우 'npm i @types/node'를 시도한 다음, tsconfig의 형식 필드에 'node'를 추가합니다.", "Cannot_find_namespace_0_2503": "'{0}' 네임스페이스를 찾을 수 없습니다.", "Cannot_find_parameter_0_1225": "'{0}' 매개 변수를 찾을 수 없습니다.", "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": "입력 파일의 공용 하위 디렉터리 경로를 찾을 수 없습니다.", @@ -375,7 +374,6 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "포함 파일이 지정되지 않았고 루트 디렉터리를 확인할 수 없어 'node_modules' 폴더 조회를 건너뜁니다.", "Containing_function_is_not_an_arrow_function_95128": "포함 함수가 화살표 함수가 아닙니다.", "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": "'{0}' 형식을 '{1}' 형식으로 변환한 작업은 실수일 수 있습니다. 두 형식이 서로 충분히 겹치지 않기 때문입니다. 의도적으로 변환한 경우에는 먼저 'unknown'으로 식을 변환합니다.", - "Convert_0_to_1_in_0_95003": "'{0}'을(를) '{0}의 {1}'(으)로 변환", "Convert_0_to_mapped_object_type_95055": "'{0}'을(를) 매핑된 개체 형식으로 변환", "Convert_all_constructor_functions_to_classes_95045": "모든 생성자 함수를 클래스로 변환", "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374": "값으로 사용되지 않는 모든 가져오기를 형식 전용 가져오기로 변환", @@ -385,7 +383,6 @@ "Convert_all_to_async_functions_95066": "모두 비동기 함수로 변환", "Convert_all_to_bigint_numeric_literals_95092": "모두 bigint 숫자 리터럴로 변환", "Convert_all_to_default_imports_95035": "모든 항목을 기본 가져오기로 변환", - "Convert_all_type_literals_to_mapped_type_95021": "모든 형식 리터럴을 매핑된 형식으로 변환", "Convert_arrow_function_or_function_expression_95122": "화살표 함수 또는 함수 식 변환", "Convert_const_to_let_95093": "'const'를 'let'으로 변환", "Convert_default_export_to_named_export_95061": "기본 내보내기를 명명된 내보내기로 변환", @@ -429,8 +426,6 @@ "Declaration_expected_1146": "선언이 필요합니다.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "선언 이름이 기본 제공 전역 ID '{0}'과(와) 충돌합니다.", "Declaration_or_statement_expected_1128": "선언 또는 문이 필요합니다.", - "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": "한정된 할당 어설션이 포함된 선언에는 형식 주석도 있어야 합니다.", - "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": "이니셜라이저가 포함된 선언에는 한정적 할당 어설션을 사용할 수 없습니다.", "Declare_a_private_field_named_0_90053": "'{0}'(이)라는 프라이빗 필드를 선언합니다.", "Declare_method_0_90023": "'{0}' 메서드 선언", "Declare_private_method_0_90038": "프라이빗 메서드 '{0}' 선언", @@ -441,6 +436,7 @@ "Decorators_are_not_valid_here_1206": "데코레이터는 여기에 사용할 수 없습니다.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "동일한 이름의 여러 get/set 접근자에 데코레이터를 적용할 수 없습니다.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "모듈의 기본 내보내기에서 프라이빗 이름 '{0}'을(를) 가지고 있거나 사용 중입니다.", + "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258": "한정된 할당 어설션은 형식 주석과 함께여야만 사용할 수 있습니다.", "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": "{0} 식별자의 정의가 다른 파일의 정의와 충돌합니다.", "Delete_all_unused_declarations_95024": "사용하지 않는 선언 모두 삭제", "Delete_the_outputs_of_all_projects_6365": "모든 프로젝트의 출력 삭제", @@ -532,7 +528,6 @@ "Excessive_stack_depth_comparing_types_0_and_1_2321": "'{0}' 및 '{1}' 형식을 비교하는 스택 깊이가 과도합니다.", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "'@extends' 태그로 제공하는 예상되는 {0}-{1} 형식 인수입니다.", "Expected_0_arguments_but_got_1_2554": "{0}개의 인수가 필요한데 {1}개를 가져왔습니다.", - "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "{0}개 인수가 필요한데 {1}개를 가져왔습니다. 'void'를 'Promise'의 형식 인수에 포함하는 것을 잊으셨습니까?", "Expected_0_arguments_but_got_1_or_more_2556": "{0}개의 인수가 필요한데 {1}개 이상을 가져왔습니다.", "Expected_0_type_arguments_but_got_1_2558": "{0}개의 형식 인수가 필요한데 {1}개를 가져왔습니다.", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "'@extends' 태그로 제공하는 예상되는 {0} 형식 인수입니다.", @@ -617,7 +612,6 @@ "Generate_get_and_set_accessors_for_all_overriding_properties_95119": "모든 재정의 속성에 대한 'get' 및 'set' 접근자를 생성합니다.", "Generates_a_CPU_profile_6223": "CPU 프로필을 생성합니다.", "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": "해당하는 각 '.d.ts' 파일에 sourcemap을 생성합니다.", - "Generates_an_event_trace_and_a_list_of_types_6237": "이벤트 추적 및 형식 목록을 생성합니다.", "Generates_corresponding_d_ts_file_6002": "해당 '.d.ts' 파일을 생성합니다.", "Generates_corresponding_map_file_6043": "해당 '.map' 파일을 생성합니다.", "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025": "생성기는 값을 생성하지 않으므로 암시적으로 yield 형식 '{0}'입니다. 반환 형식 주석을 제공하는 것이 좋습니다.", @@ -662,7 +656,6 @@ "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "앰비언트 열거형 선언에서 멤버 이니셜라이저는 상수 식이어야 합니다.", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "다중 선언이 포함된 열거형에서는 하나의 선언만 첫 번째 열거형 요소에 대한 이니셜라이저를 생략할 수 있습니다.", "Include_modules_imported_with_json_extension_6197": "'.json' 확장을 사용하여 가져온 모듈을 포함합니다.", - "Include_undefined_in_index_signature_results_6800": "인덱스 시그니처 결과에 '정의되지 않음' 포함", "Index_signature_in_type_0_only_permits_reading_2542": "'{0}' 형식의 인덱스 시그니처는 읽기만 허용됩니다.", "Index_signature_is_missing_in_type_0_2329": "'{0}' 형식에 인덱스 시그니처가 없습니다.", "Index_signatures_are_incompatible_2330": "인덱스 시그니처가 호환되지 않습니다.", @@ -694,7 +687,6 @@ "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "'jsxFactory'에 대한 값이 잘못되었습니다. '{0}'이(가) 올바른 식별자 또는 정규화된 이름이 아닙니다.", "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": "'jsxFragmentFactory'의 값이 잘못되었습니다. '{0}'은(는) 올바른 식별자 또는 정규화된 이름이 아닙니다.", "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "'--reactNamespace'의 값이 잘못되었습니다. '{0}'은(는) 올바른 식별자가 아닙니다.", - "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": "두 템플릿 식을 구분할 쉼표가 없는 것 같습니다. 이 두 템플릿 식은 태그가 지정된 호출 불가능한 하나의 템플릿 식을 구성합니다.", "Its_element_type_0_is_not_a_valid_JSX_element_2789": "해당 요소 형식 '{0}'은(는) 유효한 JSX 요소가 아닙니다.", "Its_instance_type_0_is_not_a_valid_JSX_element_2788": "해당 인스턴스 형식 '{0}'은(는) 유효한 JSX 요소가 아닙니다.", "Its_return_type_0_is_not_a_valid_JSX_element_2787": "해당 반환 형식 '{0}'은(는) 유효한 JSX 요소가 아닙니다.", @@ -759,6 +751,7 @@ "Module_0_has_no_default_export_1192": "모듈 '{0}'에는 기본 내보내기가 없습니다.", "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": "'{0}' 모듈에 기본 내보내기가 없습니다. 대신 '{0}에서 { {1} } 가져오기'를 사용하시겠습니까?", "Module_0_has_no_exported_member_1_2305": "'{0}' 모듈에 내보낸 멤버 '{1}'이(가) 없습니다.", + "Module_0_has_no_exported_member_1_Did_you_mean_2_2724": "모듈 '{0}'에 내보낸 멤버 '{1}'이(가) 없습니다. '{2}'이(가) 아닌지 확인하세요.", "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": "'{0}' 모듈에 내보낸 멤버 '{1}'이(가) 없습니다. 대신 '{0}에서 {1} 가져오기'를 사용하시겠습니까?", "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": "'{0}' 모듈은 이름이 같은 로컬 선언으로 숨겨집니다.", "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "모듈 '{0}'은(는) 'export ='을 사용하며 'export *'와 함께 사용할 수 없습니다.", @@ -794,7 +787,6 @@ "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": "비추상 클래스 '{0}'은(는) '{2}' 클래스에서 상속된 추상 멤버 '{1}'을(를) 구현하지 않습니다.", "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "비추상 클래스 식은 '{1}' 클래스에서 상속된 추상 멤버 '{0}'을(를) 구현하지 않습니다.", "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": "null이 아닌 어설션은 TypeScript 파일에서만 사용할 수 있습니다.", - "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090": "'baseUrl'이 설정되지 않은 경우 상대 경로가 아닌 경로는 허용되지 않습니다. 선행 './'를 잊으셨습니까?", "Non_simple_parameter_declared_here_1348": "여기서 단순하지 않은 매개 변수가 선언되었습니다.", "Not_all_code_paths_return_a_value_7030": "일부 코드 경로가 값을 반환하지 않습니다.", "Not_all_constituents_of_type_0_are_callable_2756": "'{0}' 형식의 일부 구성원을 호출할 수 없습니다.", @@ -830,7 +822,6 @@ "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "'{0}' 옵션은 'tsconfig. json' 파일에만 지정하거나 명령줄에서 'false' 또는 'null'로 설정할 수 있습니다.", "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "'{0}' 옵션은 'tsconfig. json' 파일에만 지정하거나 명령줄에서 'null'로 설정할 수 있습니다.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "'{0}' 옵션은 '--inlineSourceMap' 옵션 또는 '--sourceMap' 옵션이 제공되는 경우에만 사용할 수 있습니다.", - "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": "'jsx' 옵션이 '{1}'인 경우 '{0}' 옵션을 지정할 수 없습니다.", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "'target' 옵션이 'ES3'인 경우 '{0}' 옵션을 지정할 수 없습니다.", "Option_0_cannot_be_specified_with_option_1_5053": "'{0}' 옵션은 '{1}' 옵션과 함께 지정할 수 없습니다.", "Option_0_cannot_be_specified_without_specifying_option_1_5052": "'{1}' 옵션을 지정하지 않고 '{0}' 옵션을 지정할 수 없습니다.", @@ -839,6 +830,7 @@ "Option_build_must_be_the_first_command_line_argument_6369": "'--build' 옵션은 첫 번째 명령줄 인수여야 합니다.", "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": "'--incremental' 옵션은 tsconfig를 사용하거나 단일 파일로 내보내서 지정하거나 '--tsBuildInfoFile' 옵션을 지정할 때만 지정할 수 있습니다.", "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "'isolatedModules' 옵션은 '--module' 옵션을 지정하거나 'target' 옵션이 'ES2015' 이상인 경우에만 사용할 수 있습니다.", + "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "'paths' 옵션은 '--baseUrl' 옵션을 지정하지 않고 사용할 수 없습니다.", "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "명령줄에서 'project' 옵션을 원본 파일과 혼합하여 사용할 수 없습니다.", "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071": "'--resolveJsonModule' 옵션은 모듈 코드 생성이 'commonjs', 'amd', 'es2015' 또는 'esNext'일 경우에만 지정할 수 있습니다.", "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "'node' 모듈 확인 전략 없이 '--resolveJsonModule' 옵션을 지정할 수 없습니다.", @@ -891,7 +883,6 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "내보낸 클래스에 있는 공용 정적 setter '{0}'의 매개 변수 형식이 프라이빗 이름 '{1}'을(를) 가지고 있거나 사용 중입니다.", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "strict 모드에서 구문 분석하고 각 소스 파일에 대해 \"use strict\"를 내보냅니다.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "'{0}' 패턴에는 '*' 문자를 최대 하나만 사용할 수 있습니다.", - "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": "이 세션에서는 '--diagnostics' 또는 '--extendedDiagnostics'에 대해 성능 타이밍을 사용할 수 없습니다. Web Performance API의 네이티브 구현을 찾을 수 없습니다.", "Prefix_0_with_an_underscore_90025": "'{0}' 앞에 밑줄 추가", "Prefix_all_incorrect_property_declarations_with_declare_95095": "모든 잘못된 속성 선언에 'declare'를 접두사로 추가", "Prefix_all_unused_declarations_with_where_possible_95025": "가능한 경우 사용하지 않는 모든 선언에 '_'을 접두사로 추가", @@ -923,7 +914,6 @@ "Property_0_does_not_exist_on_const_enum_1_2479": "'const' 열거형 '{1}'에 '{0}' 속성이 없습니다.", "Property_0_does_not_exist_on_type_1_2339": "'{1}' 형식에 '{0}' 속성이 없습니다.", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "'{0}' 속성이 '{1}' 형식에 없습니다. '{2}'을(를) 사용하시겠습니까?", - "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": "'{0}' 속성이 '{1}' 형식에 없습니다. 대상 라이브러리를 변경해야 하는 경우 'lib' 컴파일러 옵션을 '{2}' 이상으로 변경해 보세요.", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "속성 '{0}'은(는) 이니셜라이저가 없고 생성자에 할당되어 있지 않습니다.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "'{0}' 속성에는 해당 get 접근자에 반환 형식 주석이 없으므로 암시적으로 'any' 형식이 포함됩니다.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "'{0}' 속성에는 해당 set 접근자에 매개 변수 형식 주석이 없으므로 암시적으로 'any' 형식이 포함됩니다.", @@ -932,7 +922,7 @@ "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "'{1}' 형식의 '{0}' 속성을 기본 형식 '{2}'의 동일한 속성에 할당할 수 없습니다.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "'{1}' 형식의 '{0}' 속성을 '{2}' 형식에 할당할 수 없습니다.", "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015": "'{1}' 형식의 '{0}' 속성이 '{2}' 형식 내에서 액세스할 수 없는 다른 멤버를 참조합니다.", - "Property_0_is_a_static_member_of_type_1_2576": "'{0}' 속성이 '{1}' 형식의 정적 멤버가 아닙니다.", + "Property_0_is_a_static_member_of_type_1_2576": "'{0}' 속성이 '{1}' 형식의 정적 멤버가 아님", "Property_0_is_declared_but_its_value_is_never_read_6138": "속성 '{0}'이(가) 선언은 되었지만 해당 값이 읽히지는 않았습니다.", "Property_0_is_incompatible_with_index_signature_2530": "'{0}' 속성이 인덱스 시그니처와 호환되지 않습니다.", "Property_0_is_incompatible_with_rest_element_type_2573": "'{0}' 속성이 rest 요소 형식과 호환되지 않습니다.", @@ -961,7 +951,6 @@ "Property_or_signature_expected_1131": "속성 또는 서명이 필요합니다.", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "속성 값은 문자열 리터럴, 숫자 리터럴, 'true', 'false', 'null', 개체 리터럴 또는 배열 리터럴이어야 합니다.", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "'ES5' 또는 'ES3'을 대상으로 할 경우 'for-of', spread 및 소멸의 반복 가능한 개체를 완벽히 지원합니다.", - "Provides_a_root_package_name_when_using_outFile_with_declarations_1390": "선언에 outFile을 사용하는 경우 루트 패키지 이름을 제공합니다.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "내보낸 클래스의 공용 메서드 '{0}'이(가) 외부 모듈 {2}의 '{1}' 이름을 가지고 있거나 사용 중이지만 명명할 수 없습니다.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "내보낸 클래스의 공용 메서드 '{0}'이(가) 프라이빗 모듈 '{2}'의 '{1}' 이름을 가지고 있거나 사용 중입니다.", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "내보낸 클래스의 공용 메서드의 '{0}'이(가) 프라이빗 이름 '{1}'을(를) 가지고 있거나 사용 중입니다.", @@ -1088,7 +1077,6 @@ "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "파일을 내보낼 때 사용할 줄 시퀀스의 끝 지정: 'CRLF'(dos) 또는 'LF'(unix).", "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": "소스 위치 대신 디버거가 TypeScript 파일을 찾아야 하는 위치를 지정하세요.", "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "생성된 위치 대신 디버거가 맵 파일을 찾아야 하는 위치를 지정하세요.", - "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": "`jsx` 및 `jsxs` 팩터리 함수를 가져오는 데 사용할 모듈 지정자를 지정합니다(예: react).", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "입력 파일의 루트 디렉터리를 지정하세요. --outDir이 포함된 출력 디렉터리 구조를 제어하는 데 사용됩니다.", "Split_all_invalid_type_only_imports_1367": "잘못된 형식 전용 가져오기 모두 분할", "Split_into_two_separate_import_declarations_1366": "두 개의 개별 가져오기 선언으로 분할", @@ -1130,8 +1118,6 @@ "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496": "'arguments' 개체는 ES3 및 ES5의 화살표 함수에서 참조할 수 없습니다. 표준 함수 식을 사용해 보세요.", "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "'arguments' 개체는 ES3 및 ES5의 비동기 함수 또는 메서드에서 참조할 수 없습니다. 표준 함수 또는 메서드를 사용해 보세요.", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "'if' 문의 본문이 빈 문이면 안 됩니다.", - "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391": "선언 내보내기에 outFile 및 노드 모듈 확인을 사용하는 경우 `bundledPackageName` 옵션을 제공해야 합니다.", - "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": "이 구현에 대한 호출이 성공하겠지만, 오버로드의 구현 시그니처는 외부에 표시되지 않습니다.", "The_character_set_of_the_input_files_6163": "입력 파일의 문자 집합입니다.", "The_containing_arrow_function_captures_the_global_value_of_this_7041": "포함하는 화살표 함수는 'this'의 전역 값을 캡처합니다.", "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "제어 흐름 분석에 대해 포함된 함수 또는 모듈 본문이 너무 큽니다.", @@ -1150,10 +1136,8 @@ "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "'{0}'의 유추된 형식 이름을 지정하려면 '{1}'에 대한 참조가 있어야 합니다. 이식하지 못할 수 있습니다. 형식 주석이 필요합니다.", "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "'{0}'의 유추된 형식이 일반적으로 직렬화될 수 없는 순환 구조가 있는 형식을 참조합니다. 형식 주석이 필요합니다.", "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "'{0}'의 유추 형식이 액세스할 수 없는 '{1}' 형식을 참조합니다. 형식 주석이 필요합니다.", - "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": "이 노드의 유추된 형식이 컴파일러가 직렬화할 최대 길이를 초과합니다. 명시적 형식 주석이 필요합니다.", "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": "속성 '{1}'이(가) 여러 구성원에 있고 일부 구성원에서는 프라이빗 상태이므로 교집합 '{0}'이(가) 'never'로 감소했습니다.", "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": "일부 구성원에 속성 '{1}'에 충돌하는 형식이 있으므로 교집합 '{0}'이(가) 'never'로 감소했습니다.", - "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": "'내장' 키워드는 컴파일러에서 제공하는 내장 형식을 선언하는 데에만 사용할 수 있습니다.", "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": "'JsxFactory' 컴파일러 옵션과 함께 JSX 조각을 사용하려면 'jsxFragmentFactory' 컴파일러 옵션을 제공해야 합니다.", "The_last_overload_gave_the_following_error_2770": "마지막 오버로드에서 다음 오류가 발생했습니다.", "The_last_overload_is_declared_here_2771": "여기서 마지막 오버로드가 선언됩니다.", @@ -1230,7 +1214,7 @@ "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts 파일의 최상위 수준 선언은 'declare' 또는 'export' 한정자로 시작해야 합니다.", "Trailing_comma_not_allowed_1009": "후행 쉼표는 허용되지 않습니다.", "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "각 파일을 별도 모듈로 변환 컴파일합니다('ts.transpileModule'과 유사).", - "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "해당 항목이 있는 경우 'npm i --save-dev @types/{1}'을(를) 시도하거나, 'declare module '{0}';'을(를) 포함하는 새 선언(.d.ts) 파일 추가", + "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035": "해당 항목이 있는 경우 'npm install @types/{1}'을(를) 시도하거나, 'declare module '{0}';'을(를) 포함하는 새 선언(.d.ts) 파일 추가", "Trying_other_entries_in_rootDirs_6110": "'rootDirs'의 다른 항목을 시도하는 중입니다.", "Trying_substitution_0_candidate_module_location_Colon_1_6093": "'{0}' 대체를 시도하는 중입니다. 후보 모듈 위치: '{1}'.", "Tuple_members_must_all_have_names_or_all_not_have_names_5084": "튜플 멤버는 모두 이름이 있거나 모두 이름이 없어야 합니다.", @@ -1305,7 +1289,6 @@ "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": "======== 형식 참조 지시문 '{0}'이(가) '{1}'(으)로 확인되었습니다. 주: {2}. ========", "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": "======== 형식 참조 지시문 '{0}'이(가) 패키지 ID가 '{2}'인 '{1}'(으)로 확인되었습니다. 주: {3}. ========", "Types_have_separate_declarations_of_a_private_property_0_2442": "형식에 별도의 프라이빗 속성 '{0}' 선언이 있습니다.", - "Types_of_construct_signatures_are_incompatible_2419": "구문 시그니처 형식이 호환되지 않습니다.", "Types_of_parameters_0_and_1_are_incompatible_2328": "'{0}' 및 '{1}' 매개 변수의 형식이 호환되지 않습니다.", "Types_of_property_0_are_incompatible_2326": "'{0}' 속성의 형식이 호환되지 않습니다.", "Unable_to_open_file_0_6050": "'{0}' 파일을 열 수 없습니다.", @@ -1378,7 +1361,6 @@ "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": "'{0}'은(는) 'require' 호출을 사용하거나 기본 가져오기를 사용해서만 가져올 수 있습니다.", "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": "'{0}'은(는) 'import {1} = require({2})' 또는 기본 가져오기를 사용해서만 가져올 수 있습니다.", "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": "'{0}'은(는) 'import {1} = require({2})'를 사용하거나 'esModuleInterop' 플래그를 설정하고 기본 가져오기를 사용해서만 가져올 수 있습니다.", - "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208": "'--isolatedModules'에서는 '{0}'을(를) 컴파일할 수 없는데 전역 스크립트 파일로 간주되기 때문입니다. 모듈로 만들려면 가져오기, 내보내기 또는 빈 'export {}' 문을 추가하세요.", "_0_cannot_be_used_as_a_JSX_component_2786": "'{0}'은(는) JSX 구성 요소로 사용할 수 없습니다.", "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": "'{0}'은(는) 'export type'을 사용하여 내보냈으므로 값으로 사용할 수 없습니다.", "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": "'{0}'은(는) 'import type'을 사용하여 가져왔으므로 값으로 사용할 수 없습니다.", @@ -1386,7 +1368,6 @@ "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": "'{0}'은(는) '{1}'과(와) 관련되지 않은 임의의 형식으로 인스턴스화할 수 있습니다.", "_0_declarations_can_only_be_used_in_TypeScript_files_8006": "'{0}' 선언은 TypeScript 파일에서만 사용할 수 있습니다.", "_0_expected_1005": "'{0}'이(가) 필요합니다.", - "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": "'{0}'에 내보낸 멤버 '{1}'이(가) 없습니다. '{2}'이(가) 아닌지 확인하세요.", "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": "'{0}'은(는) 암시적으로 '{1}' 반환 형식이지만, 사용량에서 더 나은 형식을 유추할 수 있습니다.", "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": "반환 형식 주석이 없고 반환 식 중 하나에서 직간접적으로 참조되므로 '{0}'에는 암시적으로 'any' 반환 형식이 포함됩니다.", "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": "'{0}'은(는) 형식 주석이 없고 자체 이니셜라이저에서 직간접적으로 참조되므로 암시적으로 'any' 형식입니다.", @@ -1399,19 +1380,18 @@ "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "'{0}'은(는) '{1}' 클래스의 접근자로 정의되지만, '{2}'에서 인스턴스 속성으로 재정의됩니다.", "_0_is_deprecated_6385": "'{0}'은(는) 더 이상 사용되지 않습니다.", "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "'{0}'은(는) '{1}' 키워드에 대한 올바른 메타 속성이 아닙니다. '{2}'을(를) 사용하시겠습니까?", - "_0_is_not_allowed_as_a_variable_declaration_name_1389": "'{0}'은(는) 변수 선언 이름으로 사용할 수 없습니다.", "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "'{0}'은(는) 자체 기본 식에서 직간접적으로 참조됩니다.", "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "'{0}'은(는) 자체 형식 주석에서 직간접적으로 참조됩니다.", "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": "'{0}'이(가) 두 번 이상 지정되어 이 사용량을 덮어씁니다.", "_0_list_cannot_be_empty_1097": "'{0}' 목록은 비워 둘 수 없습니다.", "_0_modifier_already_seen_1030": "'{0}' 한정자가 이미 있습니다.", + "_0_modifier_cannot_appear_on_a_class_element_1031": "'{0}' 한정자는 클래스 요소에 나타날 수 없습니다.", "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": "'{0}' 한정자는 생성자 선언에 나타날 수 없습니다.", "_0_modifier_cannot_appear_on_a_data_property_1043": "'{0}' 한정자는 데이터 속성에 나타날 수 없습니다.", "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": "'{0}' 한정자는 모듈 또는 네임스페이스 요소에 나타날 수 없습니다.", "_0_modifier_cannot_appear_on_a_parameter_1090": "{0}' 한정자는 매개 변수에 표시될 수 없습니다.", "_0_modifier_cannot_appear_on_a_type_member_1070": "'{0}' 한정자는 형식 멤버에 나타날 수 없습니다.", "_0_modifier_cannot_appear_on_an_index_signature_1071": "'{0}' 한정자는 인덱스 시니그처에 나타날 수 없습니다.", - "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": "이 종류의 클래스 요소에는 '{0}' 한정자를 표시할 수 없습니다.", "_0_modifier_cannot_be_used_here_1042": "'{0}' 한정자는 여기에 사용할 수 없습니다.", "_0_modifier_cannot_be_used_in_an_ambient_context_1040": "'{0}' 한정자는 앰비언트 컨텍스트에서 사용할 수 없습니다.", "_0_modifier_cannot_be_used_with_1_modifier_1243": "'{0}' 한정자는 '{1}' 한정자와 함께 사용할 수 없습니다.", @@ -1421,7 +1401,6 @@ "_0_needs_an_explicit_type_annotation_2782": "'{0}'에는 명시적 형식 주석이 필요합니다.", "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": "'{0}'은(는) 형식만 참조하지만, 여기서는 네임스페이스로 사용되고 있습니다.", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "'{0}'은(는) 형식만 참조하지만, 여기서는 값으로 사용되고 있습니다.", - "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": "'{0}'은(는) 형식만 참조하는데 여기에서 값으로 사용되고 있습니다. '{0}에서 {1}'을(를) 사용하려고 하셨습니까?", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "'{0}'은(는) 형식만 참조하지만, 여기서는 값으로 사용되고 있습니다. 대상 라이브러리를 변경하려는 경우 'lib' 컴파일러 옵션을 es2015 이상으로 변경해 봅니다.", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "'{0}'은(는) UMD 전역을 참조하지만 현재 파일은 모듈입니다. 대신 가져오기를 추가해 보세요.", "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "'{0}'은(는) 값을 참조하지만, 여기서는 형식으로 사용되고 있습니다. 'typeof {0}'을(를) 사용하시겠습니까?", diff --git a/node_modules/typescript/lib/lib.dom.d.ts b/node_modules/typescript/lib/lib.dom.d.ts index bc00e93..83a67b3 100644 --- a/node_modules/typescript/lib/lib.dom.d.ts +++ b/node_modules/typescript/lib/lib.dom.d.ts @@ -155,21 +155,29 @@ interface AudioWorkletNodeOptions extends AudioNodeOptions { interface AuthenticationExtensionsClientInputs { appid?: string; - appidExclude?: string; - credProps?: boolean; + authnSel?: AuthenticatorSelectionList; + exts?: boolean; + loc?: boolean; + txAuthGeneric?: txAuthGenericArg; + txAuthSimple?: string; + uvi?: boolean; uvm?: boolean; } interface AuthenticationExtensionsClientOutputs { appid?: boolean; - credProps?: CredentialPropertiesOutput; + authnSel?: boolean; + exts?: AuthenticationExtensionsSupported; + loc?: Coordinates; + txAuthGeneric?: ArrayBuffer; + txAuthSimple?: string; + uvi?: ArrayBuffer; uvm?: UvmEntries; } interface AuthenticatorSelectionCriteria { authenticatorAttachment?: AuthenticatorAttachment; requireResidentKey?: boolean; - residentKey?: ResidentKeyRequirement; userVerification?: UserVerificationRequirement; } @@ -296,10 +304,6 @@ interface CredentialCreationOptions { signal?: AbortSignal; } -interface CredentialPropertiesOutput { - rk?: boolean; -} - interface CredentialRequestOptions { mediation?: CredentialMediationRequirement; publicKey?: PublicKeyCredentialRequestOptions; @@ -665,8 +669,6 @@ interface KeyboardEventInit extends EventModifierInit { code?: string; isComposing?: boolean; key?: string; - /** @deprecated */ - keyCode?: number; location?: number; repeat?: boolean; } @@ -1114,6 +1116,7 @@ interface PublicKeyCredentialDescriptor { } interface PublicKeyCredentialEntity { + icon?: string; name: string; } @@ -1913,6 +1916,11 @@ interface WorkletOptions { credentials?: RequestCredentials; } +interface txAuthGenericArg { + content: ArrayBuffer; + contentType: string; +} + interface EventListener { (evt: Event): void; } @@ -3632,6 +3640,17 @@ declare var ConvolverNode: { new(context: BaseAudioContext, options?: ConvolverOptions): ConvolverNode; }; +/** The position and altitude of the device on Earth, as well as the accuracy with which these properties are calculated. */ +interface Coordinates { + readonly accuracy: number; + readonly altitude: number | null; + readonly altitudeAccuracy: number | null; + readonly heading: number | null; + readonly latitude: number; + readonly longitude: number; + readonly speed: number | null; +} + /** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */ interface CountQueuingStrategy extends QueuingStrategy { highWaterMark: number; @@ -3800,7 +3819,7 @@ declare var DOMException: { /** An object providing methods which are not dependent on any particular document. Such an object is returned by the Document.implementation property. */ interface DOMImplementation { - createDocument(namespace: string | null, qualifiedName: string | null, doctype?: DocumentType | null): XMLDocument; + createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document; createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; createHTMLDocument(title?: string): Document; /** @deprecated */ @@ -4168,7 +4187,7 @@ interface DataTransfer { * * The possible values are "none", "copy", "link", and "move". */ - dropEffect: "none" | "copy" | "link" | "move"; + dropEffect: string; /** * Returns the kinds of operations that are to be allowed. * @@ -4176,7 +4195,7 @@ interface DataTransfer { * * The possible values are "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", and "uninitialized", */ - effectAllowed: "none" | "copy" | "copyLink" | "copyMove" | "link" | "linkMove" | "move" | "all" | "uninitialized"; + effectAllowed: string; /** * Returns a FileList of the files being dragged, if any. */ @@ -5149,8 +5168,8 @@ interface Element extends Node, Animatable, ChildNode, InnerHTML, NonDocumentTyp * Returns the qualified names of all element's attributes. Can contain duplicates. */ getAttributeNames(): string[]; - getAttributeNode(qualifiedName: string): Attr | null; - getAttributeNodeNS(namespace: string | null, localName: string): Attr | null; + getAttributeNode(name: string): Attr | null; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null; getBoundingClientRect(): DOMRect; getClientRects(): DOMRectList; /** @@ -5660,52 +5679,6 @@ interface Geolocation { watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; } -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -}; - -interface GeolocationCoordinates { - readonly accuracy: number; - readonly altitude: number | null; - readonly altitudeAccuracy: number | null; - readonly heading: number | null; - readonly latitude: number; - readonly longitude: number; - readonly speed: number | null; -} - -declare var GeolocationCoordinates: { - prototype: GeolocationCoordinates; - new(): GeolocationCoordinates; -}; - -interface GeolocationPosition { - readonly coords: GeolocationCoordinates; - readonly timestamp: number; -} - -declare var GeolocationPosition: { - prototype: GeolocationPosition; - new(): GeolocationPosition; -}; - -interface GeolocationPositionError { - readonly code: number; - readonly message: string; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -} - -declare var GeolocationPositionError: { - prototype: GeolocationPositionError; - new(): GeolocationPositionError; - readonly PERMISSION_DENIED: number; - readonly POSITION_UNAVAILABLE: number; - readonly TIMEOUT: number; -}; - interface GlobalEventHandlersEventMap { "abort": UIEvent; "animationcancel": AnimationEvent; @@ -8973,10 +8946,6 @@ interface HTMLVideoElement extends HTMLMediaElement { * Gets or sets the height of the video element. */ height: number; - /** - * Gets or sets the playsinline of the video element. for example, On iPhone, video elements will now be allowed to play inline, and will not automatically enter fullscreen mode when playback begins. - */ - playsInline: boolean; /** * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. */ @@ -9054,6 +9023,12 @@ declare var History: { new(): History; }; +interface HkdfCtrParams extends Algorithm { + context: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; + hash: string | Algorithm; + label: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; +} + interface IDBArrayKey extends Array { } @@ -9155,7 +9130,7 @@ interface IDBDatabase extends EventTarget { * * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. */ - createObjectStore(name: string, options?: IDBObjectStoreParameters): IDBObjectStore; + createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; /** * Deletes the object store with the given name. * @@ -9603,8 +9578,8 @@ interface ImageData { declare var ImageData: { prototype: ImageData; - new(sw: number, sh: number): ImageData; - new(data: Uint8ClampedArray, sw: number, sh?: number): ImageData; + new(width: number, height: number): ImageData; + new(array: Uint8ClampedArray, width: number, height?: number): ImageData; }; interface InnerHTML { @@ -11812,6 +11787,21 @@ declare var PopStateEvent: { new(type: string, eventInitDict?: PopStateEventInit): PopStateEvent; }; +/** The position of the concerned device at a given time. The position, represented by a Coordinates object, comprehends the 2D position of the device, on a spheroid representing the Earth, but also its altitude and its speed. */ +interface Position { + readonly coords: Coordinates; + readonly timestamp: number; +} + +/** The reason of an error occurring when using the geolocating device. */ +interface PositionError { + readonly code: number; + readonly message: string; + readonly PERMISSION_DENIED: number; + readonly POSITION_UNAVAILABLE: number; + readonly TIMEOUT: number; +} + /** A processing instruction embeds application-specific instructions in XML which can be ignored by other applications that don't recognize them. */ interface ProcessingInstruction extends CharacterData, LinkStyle { readonly ownerDocument: Document; @@ -12503,11 +12493,6 @@ interface ReadableByteStreamController { error(error?: any): void; } -declare var ReadableByteStreamController: { - prototype: ReadableByteStreamController; - new(): ReadableByteStreamController; -}; - /** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */ interface ReadableStream { readonly locked: boolean; @@ -12532,22 +12517,12 @@ interface ReadableStreamBYOBReader { releaseLock(): void; } -declare var ReadableStreamBYOBReader: { - prototype: ReadableStreamBYOBReader; - new(): ReadableStreamBYOBReader; -}; - interface ReadableStreamBYOBRequest { readonly view: ArrayBufferView; respond(bytesWritten: number): void; respondWithNewView(view: ArrayBufferView): void; } -declare var ReadableStreamBYOBRequest: { - prototype: ReadableStreamBYOBRequest; - new(): ReadableStreamBYOBRequest; -}; - interface ReadableStreamDefaultController { readonly desiredSize: number | null; close(): void; @@ -12555,11 +12530,6 @@ interface ReadableStreamDefaultController { error(error?: any): void; } -declare var ReadableStreamDefaultController: { - prototype: ReadableStreamDefaultController; - new(): ReadableStreamDefaultController; -}; - interface ReadableStreamDefaultReader { readonly closed: Promise; cancel(reason?: any): Promise; @@ -12567,11 +12537,6 @@ interface ReadableStreamDefaultReader { releaseLock(): void; } -declare var ReadableStreamDefaultReader: { - prototype: ReadableStreamDefaultReader; - new(): ReadableStreamDefaultReader; -}; - interface ReadableStreamReader { cancel(): Promise; read(): Promise>; @@ -15434,16 +15399,16 @@ declare var StyleSheetList: { /** This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto). */ interface SubtleCrypto { decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise; - deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise; - deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise; + deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise; + deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise; digest(algorithm: AlgorithmIdentifier, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise; encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise; exportKey(format: "jwk", key: CryptoKey): Promise; exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): Promise; exportKey(format: string, key: CryptoKey): Promise; + generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise; generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise; generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise; - generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise; importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise; importKey(format: "raw" | "pkcs8" | "spki", keyData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise; importKey(format: string, keyData: JsonWebKey | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise; @@ -15919,11 +15884,6 @@ interface TransformStreamDefaultController { terminate(): void; } -declare var TransformStreamDefaultController: { - prototype: TransformStreamDefaultController; - new(): TransformStreamDefaultController; -}; - /** Events providing information related to transitions. */ interface TransitionEvent extends Event { readonly elapsedTime: number; @@ -18724,11 +18684,6 @@ interface WritableStreamDefaultController { error(error?: any): void; } -declare var WritableStreamDefaultController: { - prototype: WritableStreamDefaultController; - new(): WritableStreamDefaultController; -}; - /** This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink. */ interface WritableStreamDefaultWriter { readonly closed: Promise; @@ -18740,11 +18695,6 @@ interface WritableStreamDefaultWriter { write(chunk: W): Promise; } -declare var WritableStreamDefaultWriter: { - prototype: WritableStreamDefaultWriter; - new(): WritableStreamDefaultWriter; -}; - /** An XML document. It inherits from the generic Document and does not add any specific methods or properties to it: nevertheless, several algorithms behave differently with the two types of documents. */ interface XMLDocument extends Document { addEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; @@ -19247,11 +19197,11 @@ interface PerformanceObserverCallback { } interface PositionCallback { - (position: GeolocationPosition): void; + (position: Position): void; } interface PositionErrorCallback { - (positionError: GeolocationPositionError): void; + (positionError: PositionError): void; } interface QueuingStrategySizeCallback { @@ -19531,8 +19481,7 @@ declare var location: Location; declare var locationbar: BarProp; declare var menubar: BarProp; declare var msContentScript: ExtensionScriptApis; -/** @deprecated */ -declare const name: void; +declare const name: never; declare var navigator: Navigator; declare var offscreenBuffering: string | boolean; declare var oncompassneedscalibration: ((this: Window, ev: Event) => any) | null; @@ -19962,6 +19911,9 @@ type PerformanceEntryList = PerformanceEntry[]; type ReadableStreamReadResult = ReadableStreamReadValueResult | ReadableStreamReadDoneResult; type VibratePattern = number | number[]; type COSEAlgorithmIdentifier = number; +type AuthenticatorSelectionList = AAGUID[]; +type AAGUID = BufferSource; +type AuthenticationExtensionsSupported = string[]; type UvmEntry = number[]; type UvmEntries = UvmEntry[]; type AlgorithmIdentifier = string | Algorithm; @@ -20001,7 +19953,7 @@ type WindowProxy = Window; type AlignSetting = "center" | "end" | "left" | "right" | "start"; type AnimationPlayState = "finished" | "idle" | "paused" | "running"; type AppendMode = "segments" | "sequence"; -type AttestationConveyancePreference = "direct" | "enterprise" | "indirect" | "none"; +type AttestationConveyancePreference = "direct" | "indirect" | "none"; type AudioContextLatencyCategory = "balanced" | "interactive" | "playback"; type AudioContextState = "closed" | "running" | "suspended"; type AuthenticatorAttachment = "cross-platform" | "platform"; @@ -20113,7 +20065,6 @@ type RequestCredentials = "include" | "omit" | "same-origin"; type RequestDestination = "" | "audio" | "audioworklet" | "document" | "embed" | "font" | "image" | "manifest" | "object" | "paintworklet" | "report" | "script" | "sharedworker" | "style" | "track" | "video" | "worker" | "xslt"; type RequestMode = "cors" | "navigate" | "no-cors" | "same-origin"; type RequestRedirect = "error" | "follow" | "manual"; -type ResidentKeyRequirement = "discouraged" | "preferred" | "required"; type ResizeQuality = "high" | "low" | "medium" | "pixelated"; type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect"; type ScopedCredentialType = "ScopedCred"; diff --git a/node_modules/typescript/lib/lib.dom.iterable.d.ts b/node_modules/typescript/lib/lib.dom.iterable.d.ts index 366de82..74112b6 100644 --- a/node_modules/typescript/lib/lib.dom.iterable.d.ts +++ b/node_modules/typescript/lib/lib.dom.iterable.d.ts @@ -129,13 +129,6 @@ interface Headers { values(): IterableIterator; } -interface IDBDatabase { - /** - * Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. - */ - transaction(storeNames: string | Iterable, mode?: IDBTransactionMode): IDBTransaction; -} - interface IDBObjectStore { /** * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException. diff --git a/node_modules/typescript/lib/lib.es2015.iterable.d.ts b/node_modules/typescript/lib/lib.es2015.iterable.d.ts index 2203756..426ea64 100644 --- a/node_modules/typescript/lib/lib.es2015.iterable.d.ts +++ b/node_modules/typescript/lib/lib.es2015.iterable.d.ts @@ -174,7 +174,7 @@ interface Set { */ entries(): IterableIterator<[T, T]>; /** - * Despite its name, returns an iterable of the values in the set. + * Despite its name, returns an iterable of the values in the set, */ keys(): IterableIterator; @@ -194,7 +194,7 @@ interface ReadonlySet { entries(): IterableIterator<[T, T]>; /** - * Despite its name, returns an iterable of the values in the set. + * Despite its name, returns an iterable of the values in the set, */ keys(): IterableIterator; @@ -242,6 +242,10 @@ interface PromiseConstructor { race(values: Iterable>): Promise; } +declare namespace Reflect { + function enumerate(target: object): IterableIterator; +} + interface String { /** Iterator */ [Symbol.iterator](): IterableIterator; diff --git a/node_modules/typescript/lib/lib.es2015.promise.d.ts b/node_modules/typescript/lib/lib.es2015.promise.d.ts index ef0c1df..372966c 100644 --- a/node_modules/typescript/lib/lib.es2015.promise.d.ts +++ b/node_modules/typescript/lib/lib.es2015.promise.d.ts @@ -30,7 +30,7 @@ interface PromiseConstructor { * a resolve callback used to resolve the promise with a value or the result of another promise, * and a reject callback used to reject the promise with a provided reason or error. */ - new (executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises @@ -133,18 +133,18 @@ interface PromiseConstructor { */ reject(reason?: any): Promise; - /** - * Creates a new resolved promise. - * @returns A resolved promise. - */ - resolve(): Promise; - /** * Creates a new resolved promise for the provided value. * @param value A promise. * @returns A promise whose internal state matches the provided promise. */ resolve(value: T | PromiseLike): Promise; + + /** + * Creates a new resolved promise . + * @returns A resolved promise. + */ + resolve(): Promise; } declare var Promise: PromiseConstructor; diff --git a/node_modules/typescript/lib/lib.es2015.proxy.d.ts b/node_modules/typescript/lib/lib.es2015.proxy.d.ts index 66a522f..2eb2c90 100644 --- a/node_modules/typescript/lib/lib.es2015.proxy.d.ts +++ b/node_modules/typescript/lib/lib.es2015.proxy.d.ts @@ -29,6 +29,7 @@ interface ProxyHandler { set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; deleteProperty? (target: T, p: PropertyKey): boolean; defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; + enumerate? (target: T): PropertyKey[]; ownKeys? (target: T): PropertyKey[]; apply? (target: T, thisArg: any, argArray?: any): any; construct? (target: T, argArray: any, newTarget?: any): object; diff --git a/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts b/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts index 8b727b8..ed296f4 100644 --- a/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +++ b/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts @@ -83,11 +83,6 @@ interface SymbolConstructor { } interface Symbol { - /** - * Converts a Symbol object to a symbol. - */ - [Symbol.toPrimitive](hint: string): symbol; - readonly [Symbol.toStringTag]: string; } diff --git a/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts b/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts index 0f69609..953a505 100644 --- a/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +++ b/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts @@ -27,6 +27,10 @@ interface SharedArrayBuffer { */ readonly byteLength: number; + /* + * The SharedArrayBuffer constructor's length property whose value is 1. + */ + length: number; /** * Returns a section of an SharedArrayBuffer. */ diff --git a/node_modules/typescript/lib/lib.es2020.d.ts b/node_modules/typescript/lib/lib.es2020.d.ts index 1f20962..d384b20 100644 --- a/node_modules/typescript/lib/lib.es2020.d.ts +++ b/node_modules/typescript/lib/lib.es2020.d.ts @@ -21,7 +21,6 @@ and limitations under the License. /// /// /// -/// /// /// /// diff --git a/node_modules/typescript/lib/lib.es2020.intl.d.ts b/node_modules/typescript/lib/lib.es2020.intl.d.ts index 5c10459..6802234 100644 --- a/node_modules/typescript/lib/lib.es2020.intl.d.ts +++ b/node_modules/typescript/lib/lib.es2020.intl.d.ts @@ -283,17 +283,13 @@ declare namespace Intl { }; interface NumberFormatOptions { - compactDisplay?: string; notation?: string; - signDisplay?: string; unit?: string; unitDisplay?: string; } interface ResolvedNumberFormatOptions { - compactDisplay?: string; notation?: string; - signDisplay?: string; unit?: string; unitDisplay?: string; } diff --git a/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts b/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts deleted file mode 100644 index b0934f0..0000000 --- a/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +++ /dev/null @@ -1,99 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - - - -/// - - -interface Atomics { - /** - * Adds a value to the value at the given position in the array, returning the original value. - * Until this atomic operation completes, any other read or write operation against the array - * will block. - */ - add(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint; - - /** - * Stores the bitwise AND of a value with the value at the given position in the array, - * returning the original value. Until this atomic operation completes, any other read or - * write operation against the array will block. - */ - and(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint; - - /** - * Replaces the value at the given position in the array if the original value equals the given - * expected value, returning the original value. Until this atomic operation completes, any - * other read or write operation against the array will block. - */ - compareExchange(typedArray: BigInt64Array | BigUint64Array, index: number, expectedValue: bigint, replacementValue: bigint): bigint; - - /** - * Replaces the value at the given position in the array, returning the original value. Until - * this atomic operation completes, any other read or write operation against the array will - * block. - */ - exchange(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint; - - /** - * Returns the value at the given position in the array. Until this atomic operation completes, - * any other read or write operation against the array will block. - */ - load(typedArray: BigInt64Array | BigUint64Array, index: number): bigint; - - /** - * Stores the bitwise OR of a value with the value at the given position in the array, - * returning the original value. Until this atomic operation completes, any other read or write - * operation against the array will block. - */ - or(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint; - - /** - * Stores a value at the given position in the array, returning the new value. Until this - * atomic operation completes, any other read or write operation against the array will block. - */ - store(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint; - - /** - * Subtracts a value from the value at the given position in the array, returning the original - * value. Until this atomic operation completes, any other read or write operation against the - * array will block. - */ - sub(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint; - - /** - * If the value at the given position in the array is equal to the provided value, the current - * agent is put to sleep causing execution to suspend until the timeout expires (returning - * `"timed-out"`) or until the agent is awoken (returning `"ok"`); otherwise, returns - * `"not-equal"`. - */ - wait(typedArray: BigInt64Array, index: number, value: bigint, timeout?: number): "ok" | "not-equal" | "timed-out"; - - /** - * Wakes up sleeping agents that are waiting on the given index of the array, returning the - * number of agents that were awoken. - * @param typedArray A shared BigInt64Array. - * @param index The position in the typedArray to wake up on. - * @param count The number of sleeping agents to notify. Defaults to +Infinity. - */ - notify(typedArray: BigInt64Array, index: number, count?: number): number; - - /** - * Stores the bitwise XOR of a value with the value at the given position in the array, - * returning the original value. Until this atomic operation completes, any other read or write - * operation against the array will block. - */ - xor(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint; -} diff --git a/node_modules/typescript/lib/lib.es5.d.ts b/node_modules/typescript/lib/lib.es5.d.ts index 0959589..267fd23 100644 --- a/node_modules/typescript/lib/lib.es5.d.ts +++ b/node_modules/typescript/lib/lib.es5.d.ts @@ -1067,7 +1067,7 @@ interface JSON { /** * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified. + * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified. * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. */ stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; @@ -1416,7 +1416,7 @@ declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; -declare type PromiseConstructorLike = new (executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; +declare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; interface PromiseLike { /** @@ -1528,26 +1528,6 @@ type ReturnType any> = T extends (...args: any) => i */ type InstanceType any> = T extends new (...args: any) => infer R ? R : any; -/** - * Convert string literal type to uppercase - */ -type Uppercase = intrinsic; - -/** - * Convert string literal type to lowercase - */ -type Lowercase = intrinsic; - -/** - * Convert first character of string literal type to uppercase - */ -type Capitalize = intrinsic; - -/** - * Convert first character of string literal type to lowercase - */ -type Uncapitalize = intrinsic; - /** * Marker for contextual 'this' type */ @@ -1732,7 +1712,6 @@ interface DataView { } interface DataViewConstructor { - readonly prototype: DataView; new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView; } declare var DataView: DataViewConstructor; @@ -4304,7 +4283,6 @@ declare namespace Intl { style?: string; currency?: string; currencyDisplay?: string; - currencySign?: string; useGrouping?: boolean; minimumIntegerDigits?: number; minimumFractionDigits?: number; diff --git a/node_modules/typescript/lib/lib.esnext.d.ts b/node_modules/typescript/lib/lib.esnext.d.ts index 380fb64..2283241 100644 --- a/node_modules/typescript/lib/lib.esnext.d.ts +++ b/node_modules/typescript/lib/lib.esnext.d.ts @@ -22,4 +22,3 @@ and limitations under the License. /// /// /// -/// diff --git a/node_modules/typescript/lib/lib.esnext.weakref.d.ts b/node_modules/typescript/lib/lib.esnext.weakref.d.ts deleted file mode 100644 index e28fede..0000000 --- a/node_modules/typescript/lib/lib.esnext.weakref.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - - - -/// - - -interface WeakRef { - readonly [Symbol.toStringTag]: "WeakRef"; - - /** - * Returns the WeakRef instance's target object, or undefined if the target object has been - * reclaimed. - */ - deref(): T | undefined; -} - -interface WeakRefConstructor { - readonly prototype: WeakRef; - - /** - * Creates a WeakRef instance for the given target object. - * @param target The target object for the WeakRef instance. - */ - new(target?: T): WeakRef; -} - -declare var WeakRef: WeakRefConstructor; - -interface FinalizationRegistry { - readonly [Symbol.toStringTag]: "FinalizationRegistry"; - - /** - * Registers an object with the registry. - * @param target The target object to register. - * @param heldValue The value to pass to the finalizer for this object. This cannot be the - * target object. - * @param unregisterToken The token to pass to the unregister method to unregister the target - * object. If provided (and not undefined), this must be an object. If not provided, the target - * cannot be unregistered. - */ - register(target: object, heldValue: any, unregisterToken?: object): void; - - /** - * Unregisters an object from the registry. - * @param unregisterToken The token that was used as the unregisterToken argument when calling - * register to register the target object. - */ - unregister(unregisterToken: object): void; -} - -interface FinalizationRegistryConstructor { - readonly prototype: FinalizationRegistry; - - /** - * Creates a finalization registry with an associated cleanup callback - * @param cleanupCallback The callback to call after an object in the registry has been reclaimed. - */ - new(cleanupCallback: (heldValue: any) => void): FinalizationRegistry; -} - -declare var FinalizationRegistry: FinalizationRegistryConstructor; diff --git a/node_modules/typescript/lib/lib.webworker.d.ts b/node_modules/typescript/lib/lib.webworker.d.ts index d454713..5c348aa 100644 --- a/node_modules/typescript/lib/lib.webworker.d.ts +++ b/node_modules/typescript/lib/lib.webworker.d.ts @@ -214,12 +214,6 @@ interface GetNotificationOptions { tag?: string; } -interface HkdfParams extends Algorithm { - hash: HashAlgorithmIdentifier; - info: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; - salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; -} - interface HmacImportParams extends Algorithm { hash: HashAlgorithmIdentifier; length?: number; @@ -1680,6 +1674,12 @@ declare var Headers: { new(init?: HeadersInit): Headers; }; +interface HkdfCtrParams extends Algorithm { + context: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; + hash: string | Algorithm; + label: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; +} + interface IDBArrayKey extends Array { } @@ -1781,7 +1781,7 @@ interface IDBDatabase extends EventTarget { * * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. */ - createObjectStore(name: string, options?: IDBObjectStoreParameters): IDBObjectStore; + createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore; /** * Deletes the object store with the given name. * @@ -2219,8 +2219,8 @@ interface ImageData { declare var ImageData: { prototype: ImageData; - new(sw: number, sh: number): ImageData; - new(data: Uint8ClampedArray, sw: number, sh?: number): ImageData; + new(width: number, height: number): ImageData; + new(array: Uint8ClampedArray, width: number, height?: number): ImageData; }; /** This Channel Messaging API interface allows us to create a new message channel and send data through it via its two MessagePort properties. */ @@ -2735,11 +2735,6 @@ interface ReadableByteStreamController { error(error?: any): void; } -declare var ReadableByteStreamController: { - prototype: ReadableByteStreamController; - new(): ReadableByteStreamController; -}; - /** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */ interface ReadableStream { readonly locked: boolean; @@ -2764,22 +2759,12 @@ interface ReadableStreamBYOBReader { releaseLock(): void; } -declare var ReadableStreamBYOBReader: { - prototype: ReadableStreamBYOBReader; - new(): ReadableStreamBYOBReader; -}; - interface ReadableStreamBYOBRequest { readonly view: ArrayBufferView; respond(bytesWritten: number): void; respondWithNewView(view: ArrayBufferView): void; } -declare var ReadableStreamBYOBRequest: { - prototype: ReadableStreamBYOBRequest; - new(): ReadableStreamBYOBRequest; -}; - interface ReadableStreamDefaultController { readonly desiredSize: number | null; close(): void; @@ -2787,11 +2772,6 @@ interface ReadableStreamDefaultController { error(error?: any): void; } -declare var ReadableStreamDefaultController: { - prototype: ReadableStreamDefaultController; - new(): ReadableStreamDefaultController; -}; - interface ReadableStreamDefaultReader { readonly closed: Promise; cancel(reason?: any): Promise; @@ -2799,11 +2779,6 @@ interface ReadableStreamDefaultReader { releaseLock(): void; } -declare var ReadableStreamDefaultReader: { - prototype: ReadableStreamDefaultReader; - new(): ReadableStreamDefaultReader; -}; - interface ReadableStreamReader { cancel(): Promise; read(): Promise>; @@ -3079,16 +3054,16 @@ declare var StorageManager: { /** This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto). */ interface SubtleCrypto { decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise; - deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise; - deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise; + deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise; + deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise; digest(algorithm: AlgorithmIdentifier, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise; encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise; exportKey(format: "jwk", key: CryptoKey): Promise; exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): Promise; exportKey(format: string, key: CryptoKey): Promise; + generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise; generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise; generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise; - generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise; importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise; importKey(format: "raw" | "pkcs8" | "spki", keyData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise; importKey(format: string, keyData: JsonWebKey | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise; @@ -3281,11 +3256,6 @@ interface TransformStreamDefaultController { terminate(): void; } -declare var TransformStreamDefaultController: { - prototype: TransformStreamDefaultController; - new(): TransformStreamDefaultController; -}; - /** The URL interface represents an object providing static methods used for creating object URLs. */ interface URL { hash: string; @@ -5562,11 +5532,6 @@ interface WritableStreamDefaultController { error(error?: any): void; } -declare var WritableStreamDefaultController: { - prototype: WritableStreamDefaultController; - new(): WritableStreamDefaultController; -}; - /** This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink. */ interface WritableStreamDefaultWriter { readonly closed: Promise; @@ -5578,11 +5543,6 @@ interface WritableStreamDefaultWriter { write(chunk: W): Promise; } -declare var WritableStreamDefaultWriter: { - prototype: WritableStreamDefaultWriter; - new(): WritableStreamDefaultWriter; -}; - interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap { "readystatechange": Event; } diff --git a/node_modules/typescript/lib/lib.webworker.iterable.d.ts b/node_modules/typescript/lib/lib.webworker.iterable.d.ts deleted file mode 100644 index 5efc7d3..0000000 --- a/node_modules/typescript/lib/lib.webworker.iterable.d.ts +++ /dev/null @@ -1,166 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - - - -/// - - -///////////////////////////// -/// Worker Iterable APIs -///////////////////////////// - -interface Cache { - addAll(requests: Iterable): Promise; -} - -interface CanvasPathDrawingStyles { - setLineDash(segments: Iterable): void; -} - -interface DOMStringList { - [Symbol.iterator](): IterableIterator; -} - -interface FileList { - [Symbol.iterator](): IterableIterator; -} - -interface FormData { - [Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>; - /** - * Returns an array of key, value pairs for every entry in the list. - */ - entries(): IterableIterator<[string, FormDataEntryValue]>; - /** - * Returns a list of keys in the list. - */ - keys(): IterableIterator; - /** - * Returns a list of values in the list. - */ - values(): IterableIterator; -} - -interface Headers { - [Symbol.iterator](): IterableIterator<[string, string]>; - /** - * Returns an iterator allowing to go through all key/value pairs contained in this object. - */ - entries(): IterableIterator<[string, string]>; - /** - * Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. - */ - keys(): IterableIterator; - /** - * Returns an iterator allowing to go through all values of the key/value pairs contained in this object. - */ - values(): IterableIterator; -} - -interface IDBDatabase { - /** - * Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. - */ - transaction(storeNames: string | Iterable, mode?: IDBTransactionMode): IDBTransaction; -} - -interface IDBObjectStore { - /** - * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException. - * - * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction. - */ - createIndex(name: string, keyPath: string | Iterable, options?: IDBIndexParameters): IDBIndex; -} - -interface URLSearchParams { - [Symbol.iterator](): IterableIterator<[string, string]>; - /** - * Returns an array of key, value pairs for every entry in the search params. - */ - entries(): IterableIterator<[string, string]>; - /** - * Returns a list of keys in the search params. - */ - keys(): IterableIterator; - /** - * Returns a list of values in the search params. - */ - values(): IterableIterator; -} - -interface WEBGL_draw_buffers { - drawBuffersWEBGL(buffers: Iterable): void; -} - -interface WebGL2RenderingContextBase { - clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable, srcOffset?: GLuint): void; - clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable, srcOffset?: GLuint): void; - clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable, srcOffset?: GLuint): void; - drawBuffers(buffers: Iterable): void; - getActiveUniforms(program: WebGLProgram, uniformIndices: Iterable, pname: GLenum): any; - getUniformIndices(program: WebGLProgram, uniformNames: Iterable): Iterable | null; - invalidateFramebuffer(target: GLenum, attachments: Iterable): void; - invalidateSubFramebuffer(target: GLenum, attachments: Iterable, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void; - transformFeedbackVaryings(program: WebGLProgram, varyings: Iterable, bufferMode: GLenum): void; - uniform1uiv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform2uiv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform3uiv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform4uiv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - vertexAttribI4iv(index: GLuint, values: Iterable): void; - vertexAttribI4uiv(index: GLuint, values: Iterable): void; -} - -interface WebGL2RenderingContextOverloads { - uniform1fv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform1iv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform2fv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform2iv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform3fv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform3iv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform4fv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniform4iv(location: WebGLUniformLocation | null, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; - uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable, srcOffset?: GLuint, srcLength?: GLuint): void; -} - -interface WebGLRenderingContextBase { - vertexAttrib1fv(index: GLuint, values: Iterable): void; - vertexAttrib2fv(index: GLuint, values: Iterable): void; - vertexAttrib3fv(index: GLuint, values: Iterable): void; - vertexAttrib4fv(index: GLuint, values: Iterable): void; -} - -interface WebGLRenderingContextOverloads { - uniform1fv(location: WebGLUniformLocation | null, v: Iterable): void; - uniform1iv(location: WebGLUniformLocation | null, v: Iterable): void; - uniform2fv(location: WebGLUniformLocation | null, v: Iterable): void; - uniform2iv(location: WebGLUniformLocation | null, v: Iterable): void; - uniform3fv(location: WebGLUniformLocation | null, v: Iterable): void; - uniform3iv(location: WebGLUniformLocation | null, v: Iterable): void; - uniform4fv(location: WebGLUniformLocation | null, v: Iterable): void; - uniform4iv(location: WebGLUniformLocation | null, v: Iterable): void; - uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable): void; - uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable): void; - uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable): void; -} diff --git a/node_modules/typescript/lib/pl/diagnosticMessages.generated.json b/node_modules/typescript/lib/pl/diagnosticMessages.generated.json index fb5cc54..40bca18 100644 --- a/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +++ b/node_modules/typescript/lib/pl/diagnosticMessages.generated.json @@ -151,8 +151,6 @@ "Add_undefined_type_to_property_0_95018": "Dodaj typ „undefined” do właściwości „{0}”", "Add_unknown_conversion_for_non_overlapping_types_95069": "Dodaj konwersję „unknown” dla nienakładających się typów", "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": "Dodaj element „unknown” do wszystkich konwersji nienakładających się typów", - "Add_void_to_Promise_resolved_without_a_value_95143": "Dodaj argument „void” do obiektu Promise rozwiązanego bez wartości", - "Add_void_to_all_Promises_resolved_without_a_value_95144": "Dodaj argument „void” do wszystkich obiektów Promise rozwiązanych bez wartości", "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Dodanie pliku tsconfig.json pomoże w organizowaniu projektów, które zawierają pliki TypeScript i JavaScript. Dowiedz się więcej: https://aka.ms/tsconfig.", "Additional_Checks_6176": "Dodatkowe kontrole", "Advanced_Options_6178": "Opcje zaawansowane", @@ -160,8 +158,9 @@ "All_declarations_of_0_must_have_identical_type_parameters_2428": "Wszystkie deklaracje „{0}” muszą mieć identyczne parametry typu.", "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Wszystkie deklaracje metody abstrakcyjnej muszą występować obok siebie.", "All_destructured_elements_are_unused_6198": "Wszystkie elementy, których strukturę usunięto, są nieużywane.", + "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208": "Wszystkie pliki muszą być modułami, gdy flaga „--isolatedModules” jest podana.", "All_imports_in_import_declaration_are_unused_6192": "Wszystkie importy w deklaracji importu są nieużywane.", - "All_type_parameters_are_unused_6205": "Wszystkie parametry typu są nieużywane.", + "All_type_parameters_are_unused_6205": "Wszystkie parametry typu są nieużywane", "All_variables_are_unused_6199": "Wszystkie zmienne są nieużywane.", "Allow_accessing_UMD_globals_from_modules_95076": "Zezwalaj na dostęp do zmiennych globalnych UMD z modułów.", "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Zezwalaj na domyślne importy z modułów bez domyślnego eksportu. To nie wpływa na emitowanie kodu, a tylko na sprawdzanie typów.", @@ -193,7 +192,7 @@ "An_export_assignment_cannot_have_modifiers_1120": "Przypisanie eksportu nie może mieć modyfikatorów.", "An_export_declaration_can_only_be_used_in_a_module_1233": "Deklaracja eksportu może być używana tylko w module.", "An_export_declaration_cannot_have_modifiers_1193": "Deklaracja eksportu nie może mieć modyfikatorów.", - "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "Wyrażenie typu „void” nie może być testowane pod kątem prawdziwości.", + "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "Wyrażenie typu „void” nie może być testowane pod kątem prawdziwości", "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198": "Rozszerzona wartość znaku ucieczki Unicode musi należeć do zakresu od 0x0 do 0x10FFFF (włącznie).", "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351": "Identyfikatora lub słowa kluczowego nie można użyć bezpośrednio po literale liczbowym.", "An_implementation_cannot_be_declared_in_ambient_contexts_1183": "Implementacja nie może być zadeklarowana w otaczających kontekstach.", @@ -235,7 +234,6 @@ "Argument_expression_expected_1135": "Oczekiwano wyrażenia argumentu.", "Argument_for_0_option_must_be_Colon_1_6046": "Argumentem opcji „{0}” musi być: {1}.", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "Nie można przypisać argumentu typu „{0}” do parametru typu „{1}”.", - "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "Nie podano argumentów dla parametru REST „{0}”.", "Array_element_destructuring_pattern_expected_1181": "Oczekiwano wzorca usuwającego strukturę elementu tablicy.", "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": "Asercje wymagają, aby każda nazwa w celu wywołania była zadeklarowana z jawną adnotacją typu.", "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": "Asercje wymagają, aby cel wywołania był identyfikatorem lub nazwą kwalifikowaną.", @@ -261,7 +259,6 @@ "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Dla sygnatury wywołania bez adnotacji zwracanego typu niejawnie określono zwracany typ „any”.", "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204": "Sygnatury wywołania bez argumentów mają niezgodne zwracane typy „{0}” i „{1}”.", "Call_target_does_not_contain_any_signatures_2346": "Cel wywołania nie zawiera żadnych podpisów.", - "Can_only_convert_logical_AND_access_chains_95142": "Można konwertować tylko łańcuchy logiczne ORAZ łańcuchy dostępu", "Can_only_convert_property_with_modifier_95137": "Właściwość można skonwertować tylko za pomocą modyfikatora", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Nie można uzyskać dostępu do elementu „{0}.{1}”, ponieważ element „{0}” jest typem, ale nie przestrzenią nazw. Czy chcesz pobrać typ właściwości „{1}” w lokalizacji „{0}” za pomocą elementu „{0}[„{1}”]”?", "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748": "Nie można uzyskać dostępu do otaczających wyliczeń const, gdy flaga „--isolatedModules” jest podana.", @@ -284,21 +281,20 @@ "Cannot_find_global_value_0_2468": "Nie można odnaleźć wartości globalnej „{0}”.", "Cannot_find_lib_definition_for_0_2726": "Nie można znaleźć definicji biblioteki dla elementu „{0}”.", "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "Nie można znaleźć definicji biblioteki dla elementu „{0}”. Czy chodziło Ci o element „{1}”?", - "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Nie można znaleźć modułu „{0}”. Rozważ użycie opcji „--resolveJsonModule” do importowania modułu z rozszerzeniem „.json”.", - "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "Nie można odnaleźć modułu „{0}”. Czy chcesz ustawić opcję „moduleResolution” na wartość „node”, czy dodać aliasy do opcji „paths”?", + "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Nie można odnaleźć modułu „{0}”. Rozważ użycie opcji „--resolveJsonModule” do importowania modułu z rozszerzeniem „.json”", "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "Nie można odnaleźć modułu „{0}” lub odpowiadających mu deklaracji typów.", "Cannot_find_name_0_2304": "Nie można odnaleźć nazwy „{0}”.", "Cannot_find_name_0_Did_you_mean_1_2552": "Nie można znaleźć nazwy „{0}”. Czy chodziło Ci o „{1}”?", "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "Nie można znaleźć nazwy „{0}”. Czy chodziło o składową wystąpienia „this.{0}”?", "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": "Nie można znaleźć nazwy „{0}”. Czy chodziło o statyczną składową „{1}.{0}”?", - "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zmienić bibliotekę docelową? Spróbuj zmienić opcję kompilatora `lib` na „{1}” lub nowszą.", + "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zmienić bibliotekę docelową? Spróbuj zmienić opcję kompilatora „lib” na es2015 lub nowszą.", "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zmienić bibliotekę docelową? Spróbuj zmienić opcję kompilatora „lib”, aby uwzględnić element „dom”.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla modułu uruchamiającego testy? Spróbuj użyć polecenia „npm i --save-dev @types/jest” lub „npm i --save-dev @types/mocha”.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla modułu uruchamiającego testy? Spróbuj użyć polecenia „npm i --save-dev @types/jest” lub „npm i --save-dev @types/mocha”, a następnie dodaj element „jest” lub „mocha” do pola types w pliku tsconfig.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla biblioteki jQuery? Spróbuj użyć polecenia „npm i --save-dev @types/jquery”.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla biblioteki jQuery? Spróbuj użyć polecenia „npm i --save-dev @types/jquery”, a następnie dodaj element „jquery” do pola types w pliku tsconfig.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla środowiska Node? Spróbuj użyć polecenia „npm i --save-dev @types/node”.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla środowiska Node? Spróbuj użyć polecenia „npm i --save-dev @types/node”, a następnie dodaj element „node” do pola types w pliku tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla modułu uruchamiającego testy? Spróbuj użyć polecenia „npm i @types/jest” lub „npm i @types/mocha”.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla modułu uruchamiającego testy? Spróbuj użyć polecenia „npm i @types/jest” lub „npm i @types/mocha”, a następnie dodaj element „jest” lub „mocha” do pola types w pliku tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla biblioteki jQuery? Spróbuj użyć polecenia „npm i @types/jquery”.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla biblioteki jQuery? Spróbuj użyć polecenia „npm i @types/jquery”, a następnie dodaj element „jquery” do pola types w pliku tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla node? Spróbuj użyć polecenia „npm i @types/node”.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591": "Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla node? Spróbuj użyć polecenia „npm i @types/node”, a następnie dodaj element „node” do pola types w pliku tsconfig.", "Cannot_find_namespace_0_2503": "Nie można odnaleźć przestrzeni nazw „{0}”.", "Cannot_find_parameter_0_1225": "Nie można odnaleźć parametru „{0}”.", "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": "Nie można odnaleźć wspólnej ścieżki podkatalogu dla plików wejściowych.", @@ -369,13 +365,10 @@ "Constructor_implementation_is_missing_2390": "Brak implementacji konstruktora.", "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673": "Konstruktor klasy „{0}” jest prywatny i dostępny tylko w ramach deklaracji klasy.", "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "Konstruktor klasy „{0}” jest chroniony i dostępny tylko w ramach deklaracji klasy.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386": "Notacja typu konstruktora musi być ujęta w nawiasy, jeśli jest używana w typie unii.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388": "Notacja typu konstruktora musi być ujęta w nawiasy, jeśli jest używana w typie przecięcia.", "Constructors_for_derived_classes_must_contain_a_super_call_2377": "Konstruktory klas pochodnych muszą zawierać wywołanie „super”.", "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Nie podano pliku zawierającego i nie można określić katalogu głównego. Pomijanie wyszukiwania w folderze „node_modules”.", "Containing_function_is_not_an_arrow_function_95128": "Funkcja zawierająca nie jest funkcją strzałki", "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": "Konwersja typu „{0}” na typ „{1}” może być błędem, ponieważ żaden z tych typów nie pokrywa się w wystarczającym stopniu z drugim. Jeśli było to zamierzone, najpierw przekonwertuj wyrażenie na typ „unknown”.", - "Convert_0_to_1_in_0_95003": "Konwertuj element „{0}” na element „{1} w {0}”.", "Convert_0_to_mapped_object_type_95055": "Konwertuj element „{0}” na zamapowany typ obiektu", "Convert_all_constructor_functions_to_classes_95045": "Przekonwertuj wszystkie funkcje konstruktora na klasy", "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374": "Konwertuj wszystkie importy nieużywane jako wartość na importy dotyczące tylko typu", @@ -385,7 +378,6 @@ "Convert_all_to_async_functions_95066": "Konwertuj wszystko na funkcje asynchroniczne", "Convert_all_to_bigint_numeric_literals_95092": "Konwertuj wszystko na literały liczbowe typu bigint", "Convert_all_to_default_imports_95035": "Przekonwertuj wszystko na domyślne importowanie", - "Convert_all_type_literals_to_mapped_type_95021": "Konwertuj wszystkie literały typu na typ zamapowany", "Convert_arrow_function_or_function_expression_95122": "Konwertuj funkcję strzałki lub wyrażenie funkcji", "Convert_const_to_let_95093": "Konwertuj zmienne „const” na „let”", "Convert_default_export_to_named_export_95061": "Konwertuj eksport domyślny na nazwany eksport", @@ -407,17 +399,14 @@ "Convert_to_async_function_95065": "Konwertuj na funkcję asynchroniczną", "Convert_to_default_import_95013": "Konwertuj na import domyślny", "Convert_to_named_function_95124": "Konwertuj na funkcję nazwaną", - "Convert_to_optional_chain_expression_95139": "Konwertuj na opcjonalne wyrażenie łańcucha", "Convert_to_template_string_95096": "Konwertuj na ciąg szablonu", "Convert_to_type_only_export_1364": "Konwertuj na eksport dotyczący tylko typu", "Convert_to_type_only_import_1373": "Konwertuj na import dotyczący tylko typu", "Corrupted_locale_file_0_6051": "Uszkodzony plik ustawień regionalnych {0}.", "Could_not_find_a_containing_arrow_function_95127": "Nie można było znaleźć zawierającej funkcji strzałki", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "Nie można znaleźć pliku deklaracji dla modułu „{0}”. Element „{1}” ma niejawnie typ „any”.", - "Could_not_find_convertible_access_expression_95140": "Nie można odnaleźć konwertowalnego wyrażenia dostępu", "Could_not_find_export_statement_95129": "Nie można było znaleźć instrukcji export", "Could_not_find_import_clause_95131": "Nie można było znaleźć klauzuli import", - "Could_not_find_matching_access_expressions_95141": "Nie można odnaleźć zgodnych wyrażeń dostępu", "Could_not_find_namespace_import_or_named_imports_95132": "Nie można było znaleźć importu przestrzeni nazw lub nazwanych importów", "Could_not_find_property_for_which_to_generate_accessor_95135": "Nie można było znaleźć właściwości, dla której ma zostać wygenerowana metoda dostępu", "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231": "Nie można rozpoznać ścieżki „{0}” z rozszerzeniami: {1}.", @@ -429,8 +418,6 @@ "Declaration_expected_1146": "Oczekiwano deklaracji.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Nazwa deklaracji powoduje konflikt z wbudowanym identyfikatorem globalnym „{0}”.", "Declaration_or_statement_expected_1128": "Oczekiwano deklaracji lub instrukcji.", - "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": "Deklaracje z asercjami określonego przypisania muszą również mieć adnotacje typu.", - "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": "Deklaracje z inicjatorami nie mogą mieć również asercji określonego przypisania.", "Declare_a_private_field_named_0_90053": "Zadeklaruj pole prywatne o nazwie „{0}”.", "Declare_method_0_90023": "Zadeklaruj metodę „{0}”", "Declare_private_method_0_90038": "Zadeklaruj metodę prywatną „{0}”", @@ -441,6 +428,7 @@ "Decorators_are_not_valid_here_1206": "Elementy Decorator nie są tutaj prawidłowe.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Nie można stosować elementów Decorator do wielu metod dostępu pobierania/ustawiania o takiej samej nazwie.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Domyślny eksport modułu ma nazwę prywatną „{0}” lub używa tej nazwy.", + "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258": "Asercje określonego przypisania mogą być używane tylko wraz z adnotacją typu.", "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": "Definicje następujących identyfikatorów powodują konflikt z tymi w innym pliku: {0}", "Delete_all_unused_declarations_95024": "Usuń wszystkie nieużywane deklaracje", "Delete_the_outputs_of_all_projects_6365": "Usuń dane wyjściowe wszystkich projektów", @@ -458,7 +446,6 @@ "Digit_expected_1124": "Oczekiwano cyfry.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "Katalog „{0}” nie istnieje. Operacje wyszukiwania w nim zostaną pominięte.", "Disable_checking_for_this_file_90018": "Wyłącz sprawdzanie dla tego pliku", - "Disable_loading_referenced_projects_6235": "Wyłącz ładowanie przywoływanych projektów.", "Disable_size_limitations_on_JavaScript_projects_6162": "Wyłącz ograniczenia rozmiarów dla projektów JavaScript.", "Disable_solution_searching_for_this_project_6224": "Wyłącz wyszukiwanie rozwiązania dla tego projektu.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Wyłącz dokładne sprawdzanie sygnatur ogólnych w typach funkcji.", @@ -490,7 +477,7 @@ "Duplicate_number_index_signature_2375": "Zduplikowana sygnatura indeksu liczbowego.", "Duplicate_property_0_2718": "Zduplikowana właściwość „{0}”.", "Duplicate_string_index_signature_2374": "Zduplikowana sygnatura indeksu ciągu.", - "Dynamic_import_cannot_have_type_arguments_1326": "Dynamiczny import nie może mieć argumentów typu.", + "Dynamic_import_cannot_have_type_arguments_1326": "Dynamiczne importowanie nie może mieć argumentów typu", "Dynamic_import_must_have_one_specifier_as_an_argument_1324": "Dynamiczne importowanie musi mieć jeden specyfikator jako argument.", "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "Specyfikator dynamicznego importowania musi być typu „string”, ale określono typ „{0}”.", "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323": "Dynamiczne importy są obsługiwane tylko wtedy, gdy flaga „--module” jest ustawiona na wartość „es2020”, „esnext”, „commonjs”, „amd”, „system” lub „umd”.", @@ -532,7 +519,6 @@ "Excessive_stack_depth_comparing_types_0_and_1_2321": "Nadmierna głębokość stosu podczas porównywania typów „{0}” i „{1}”.", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "Oczekiwano argumentów typu {0}-{1}; podaj je z tagiem „@extends”.", "Expected_0_arguments_but_got_1_2554": "Oczekiwane argumenty: {0}, uzyskano: {1}.", - "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "Oczekiwano {0} argumentów, ale otrzymano {1}. Czy zapomniano dołączyć wartość „void” w argumencie typu obiektu „Promise”?", "Expected_0_arguments_but_got_1_or_more_2556": "Oczekiwano {0} argumentów, ale otrzymano {1} lub więcej.", "Expected_0_type_arguments_but_got_1_2558": "Oczekiwane argumenty typu: {0}, uzyskano: {1}.", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Oczekiwano argumentów typu {0}; podaj je z tagiem „@extends”.", @@ -610,14 +596,11 @@ "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366": "Funkcja nie zawiera końcowej instrukcji return, a zwracany typ nie obejmuje wartości „undefined”.", "Function_overload_must_be_static_2387": "Przeciążenie funkcji musi być statyczne.", "Function_overload_must_not_be_static_2388": "Przeciążenie funkcji nie może być statyczne.", - "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385": "Notacja typu funkcji musi być ujęta w nawiasy, jeśli jest używana w typie unii.", - "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387": "Notacja typu funkcji musi być ujęta w nawiasy, jeśli jest używana w typie przecięcia.", "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014": "Dla typu funkcji bez adnotacji zwracanego typu jest niejawnie określony zwracany typ „{0}”.", "Generate_get_and_set_accessors_95046": "Generuj metody dostępu „get” i „set”.", "Generate_get_and_set_accessors_for_all_overriding_properties_95119": "Generuj metody dostępu „get” i „set” dla wszystkich właściwości przesłaniających", "Generates_a_CPU_profile_6223": "Generuje profil procesora CPU.", "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": "Generuje mapę źródła dla poszczególnych plików „.d.ts”.", - "Generates_an_event_trace_and_a_list_of_types_6237": "Generuje śledzenie zdarzeń i listę typów.", "Generates_corresponding_d_ts_file_6002": "Generuje odpowiadający plik „d.ts”.", "Generates_corresponding_map_file_6043": "Generuje odpowiadający plik „map”.", "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025": "Dla generatora niejawnie określono zwracany typ „{0}”, ponieważ nie zwraca on żadnych wartości. Rozważ podanie adnotacji zwracanego typu.", @@ -662,7 +645,6 @@ "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "W deklaracjach wyliczenia otoczenia inicjator składowej musi być wyrażeniem stałym.", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "W przypadku wyliczenia z wieloma deklaracjami tylko jedna deklaracja może pominąć inicjator dla pierwszego elementu wyliczenia.", "Include_modules_imported_with_json_extension_6197": "Uwzględnij moduły zaimportowane z rozszerzeniem „json”", - "Include_undefined_in_index_signature_results_6800": "Uwzględnij element „undefined” w wynikach sygnatury indeksu", "Index_signature_in_type_0_only_permits_reading_2542": "Sygnatura indeksu w typie „{0}” zezwala tylko na odczytywanie.", "Index_signature_is_missing_in_type_0_2329": "Brak sygnatury indeksu w typie „{0}”.", "Index_signatures_are_incompatible_2330": "Sygnatury indeksów są niezgodne.", @@ -694,7 +676,6 @@ "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Nieprawidłowa wartość elementu „jsxFactory”. „{0}” to nie jest prawidłowy identyfikator ani kwalifikowana nazwa.", "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": "Nieprawidłowa wartość elementu „jsxFragmentFactory”. „{0}” nie jest prawidłowym identyfikatorem ani kwalifikowaną nazwą.", "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Nieprawidłowa wartość opcji „--reactNamespace”. Element „{0}” nie jest prawidłowym identyfikatorem.", - "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": "Prawdopodobnie brakuje przecinka, aby oddzielić te dwa wyrażenia szablonu. Tworzą one wyrażenie szablonu z tagami, którego nie można wywołać.", "Its_element_type_0_is_not_a_valid_JSX_element_2789": "Jego typ elementu „{0}” nie jest prawidłowym elementem JSX.", "Its_instance_type_0_is_not_a_valid_JSX_element_2788": "Jego typ wystąpienia „{0}” nie jest prawidłowym elementem JSX.", "Its_return_type_0_is_not_a_valid_JSX_element_2787": "Jego zwracany typ „{0}” nie jest prawidłowym elementem JSX.", @@ -759,6 +740,7 @@ "Module_0_has_no_default_export_1192": "Moduł „{0}” nie ma eksportu domyślnego.", "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": "Moduł „{0}” nie ma eksportu domyślnego. Czy zamiast tego miał zostać użyty element „import { {1} } from {0}”?", "Module_0_has_no_exported_member_1_2305": "Moduł „{0}” nie ma wyeksportowanej składowej „{1}”.", + "Module_0_has_no_exported_member_1_Did_you_mean_2_2724": "Moduł „{0}” nie ma wyeksportowanego elementu członkowskiego „{1}”. Czy chodziło o „{2}”?", "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": "Moduł „{0}” nie ma wyeksportowanego elementu członkowskiego „{1}”. Czy zamiast tego miał zostać użyty element „import {1} from {0}”?", "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": "Moduł „{0}” został ukryty przez deklarację lokalną o takiej samej nazwie.", "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "Moduł „{0}” używa elementu „export =” i nie może być używany z elementem „export *”.", @@ -794,7 +776,6 @@ "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": "Klasa nieabstrakcyjna „{0}” nie implementuje odziedziczonej abstrakcyjnej składowej „{1}” z klasy „{2}”.", "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "Wyrażenie klasy nieabstrakcyjnej nie implementuje odziedziczonej abstrakcyjnej składowej „{0}” z klasy „{1}”.", "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": "Asercji o wartości innej niż null można używać tylko w plikach TypeScript.", - "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090": "Ścieżki inne niż względne nie są dozwolone, gdy nie jest ustawiona wartość „baseUrl”. Czy nie zostały pominięte początkowe znaki „./”?", "Non_simple_parameter_declared_here_1348": "W tym miejscu zadeklarowano parametr inny niż prosty.", "Not_all_code_paths_return_a_value_7030": "Nie wszystkie ścieżki w kodzie zwracają wartość.", "Not_all_constituents_of_type_0_are_callable_2756": "Nie wszystkie składowe typu „{0}” są wywoływalne.", @@ -830,7 +811,6 @@ "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "Opcję „{0}” można określić tylko w pliku „tsconfig.json” albo ustawić na wartość „false” lub „null” w wierszu polecenia.", "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "Opcję „{0}” można określić tylko w pliku „tsconfig.json” albo ustawić na wartość „null” w wierszu polecenia.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "Opcja „{0}” może być używana tylko w przypadku podania opcji „--inlineSourceMap” lub „--sourceMap”.", - "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": "Nie można określić opcji „{0}”, jeśli opcja „jsx” ma wartość „{1}”.", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "Nie można określić opcji „{0}”, jeśli opcja „target” ma wartość „ES3”.", "Option_0_cannot_be_specified_with_option_1_5053": "Opcji „{0}” nie można określić razem z opcją „{1}”.", "Option_0_cannot_be_specified_without_specifying_option_1_5052": "Opcji „{0}” nie można określić bez opcji „{1}”.", @@ -839,6 +819,7 @@ "Option_build_must_be_the_first_command_line_argument_6369": "Opcja „--build” musi być pierwszym argumentem wiersza polecenia.", "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": "Opcję „--incremental” można określić tylko za pomocą pliku tsconfig, emitując do pojedynczego pliku lub gdy określono opcję „--tsBuildInfoFile”.", "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "Opcji „isolatedModules” można użyć tylko wtedy, gdy podano opcję „--module” lub opcja „target” określa cel „ES2015” lub wyższy.", + "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "Opcji „paths” nie można użyć bez podawania opcji „--baseUrl”.", "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "Nie można mieszać opcji „project” z plikami źródłowymi w wierszu polecenia.", "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071": "Opcję „--resolveJsonModule” można określić tylko wtedy, gdy generacja kodu modułu to „commonjs”, „amd”, „es2015” lub „esNext”.", "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "Nie można określić opcji „--resolveJsonModule” bez strategii rozpoznawania modułów „node”.", @@ -891,7 +872,6 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Typ parametru publicznej statycznej metody ustawiającej „{0}” z wyeksportowanej klasy ma nazwę prywatną „{1}” lub używa tej nazwy.", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Analizuj w trybie z ograniczeniami i emituj ciąg „use strict” dla każdego pliku źródłowego.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "Wzorzec „{0}” może zawierać maksymalnie jeden znak „*”.", - "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": "Chronometraż wydajności dla opcji „--diagnostics” lub „--extendedDiagnostics” nie jest dostępny w tej sesji. Nie można było znaleźć natywnej implementacji interfejsu Web Performance API.", "Prefix_0_with_an_underscore_90025": "Poprzedzaj elementy „{0}” znakiem podkreślenia", "Prefix_all_incorrect_property_declarations_with_declare_95095": "Dodaj prefiks „declare” do wszystkich niepoprawnych deklaracji właściwości", "Prefix_all_unused_declarations_with_where_possible_95025": "Jeśli to możliwe, poprzedź wszystkie nieużywane deklaracje znakiem „_”", @@ -905,7 +885,7 @@ "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "Identyfikatory prywatne są niedozwolone w deklaracjach zmiennych.", "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "Identyfikatory prywatne są niedozwolone poza treściami klasy.", "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "Identyfikatory prywatne są dostępne tylko wtedy, gdy jest używany język ECMAScript 2015 lub nowszy.", - "Private_identifiers_cannot_be_used_as_parameters_18009": "Identyfikatory prywatne nie mogą być używane jako parametry.", + "Private_identifiers_cannot_be_used_as_parameters_18009": "Identyfikatory prywatne nie mogą być używane jako parametry", "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "Nie można uzyskać dostępu do prywatnego lub chronionego elementu składowego „{0}” w parametrze typu.", "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Nie można skompilować projektu „{0}”, ponieważ jego zależność „{1}” zawiera błędy", "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383": "Nie można skompilować projektu „{0}”, ponieważ jego zależność „{1}” nie została skompilowania", @@ -923,7 +903,6 @@ "Property_0_does_not_exist_on_const_enum_1_2479": "Właściwość „{0}” nie istnieje w wyliczeniu ze specyfikatorem „const” „{1}”.", "Property_0_does_not_exist_on_type_1_2339": "Właściwość „{0}” nie istnieje w typie „{1}”.", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "Właściwość „{0}” nie istnieje w typie „{1}”. Czy chodziło Ci o „{2}”?", - "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": "Właściwość „{0}” nie istnieje w typie „{1}”. Czy chcesz zmienić bibliotekę docelową? Spróbuj zmienić opcję kompilatora `lib` na „{2}” lub nowszą.", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "Właściwość „{0}” nie ma inicjatora i nie jest na pewno przypisana w konstruktorze.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "Dla właściwości „{0}” niejawnie określono typ „any”, ponieważ jego metoda dostępu „get” nie ma adnotacji zwracanego typu.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "Dla właściwości „{0}” niejawnie określono typ „any”, ponieważ jego metoda dostępu „set” nie ma adnotacji typu parametru.", @@ -932,7 +911,7 @@ "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "Właściwości „{0}” w typie „{1}” nie można przypisać do tej samej właściwości w typie podstawowym „{2}”.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "Właściwości „{0}” w typie „{1}” nie można przypisać do typu „{2}”.", "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015": "Właściwość „{0}” w typie „{1}” odwołuje się do innego elementu członkowskiego, do którego nie można uzyskać dostępu z typu „{2}”.", - "Property_0_is_a_static_member_of_type_1_2576": "Właściwość „{0}” jest statyczną składową typu „{1}”.", + "Property_0_is_a_static_member_of_type_1_2576": "Właściwość „{0}” jest statycznym elementem członkowskim typu „{1}”", "Property_0_is_declared_but_its_value_is_never_read_6138": "Właściwość „{0}” jest zadeklarowana, ale jej wartość nie jest nigdy odczytywana.", "Property_0_is_incompatible_with_index_signature_2530": "Właściwość „{0}” jest niezgodna z sygnaturą indeksu.", "Property_0_is_incompatible_with_rest_element_type_2573": "Właściwość „{0}” jest niezgodna z typem elementu rest.", @@ -961,7 +940,6 @@ "Property_or_signature_expected_1131": "Oczekiwano właściwości lub sygnatury.", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "Wartością właściwości może być jedynie literał ciągu, literał numeryczny, wartości „true”, „false” i „null”, literał obiektu i literał tablicy.", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "Udostępnij pełne wsparcie dla elementów iterowanych w elementach „for-of”, rozpiętości i usuwania, gdy elementem docelowym jest „ES5” lub „ES3”.", - "Provides_a_root_package_name_when_using_outFile_with_declarations_1390": "Dostarcza nazwę pakietu głównego podczas używania opcji outFile z deklaracjami.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "Metoda publiczna „{0}” wyeksportowanej klasy ma nazwę „{1}” z modułu zewnętrznego {2} lub używa tej nazwy, ale nie można jej nazwać.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "Metoda publiczna „{0}” wyeksportowanej klasy ma nazwę „{1}” z modułu prywatnego „{2}” lub używa tej nazwy.", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "Metoda publiczna „{0}” wyeksportowanej klasy ma nazwę prywatną „{1}” lub używa tej nazwy.", @@ -1088,7 +1066,6 @@ "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "Określ sekwencję końca wiersza, która ma być używana podczas emitowania plików: „CRLF” (dos) lub „LF” (unix).", "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": "Określ lokalizację, w której debuger ma szukać plików TypeScript zamiast szukania w lokalizacjach źródłowych.", "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "Określ lokalizację, w której debuger ma szukać plików map zamiast szukania w wygenerowanych lokalizacjach.", - "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": "Określ specyfikator modułu, który ma być używany do importowania funkcji fabryki „jsx” i „jsxs” na przykład z platformy React", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Określ katalog główny plików wejściowych. Strukturą katalogów wyjściowych można sterować przy użyciu opcji --outDir.", "Split_all_invalid_type_only_imports_1367": "Podziel wszystkie nieprawidłowe importy dotyczące tylko typu", "Split_into_two_separate_import_declarations_1366": "Podziel na dwie osobne deklaracje importu", @@ -1130,8 +1107,6 @@ "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496": "Obiekt „arguments” nie może być przywoływany w funkcji strzałkowej w językach ES3 i ES5. Rozważ użycie standardowego wyrażenia funkcji.", "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "Obiekt „arguments” nie może być przywoływany w asynchronicznej funkcji lub metodzie w języku ES3 i ES5. Rozważ użycie standardowej funkcji lub metody.", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "Treść instrukcji „if” nie może być pustą instrukcją.", - "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391": "Opcja „bundledPackageName” musi być podana, gdy używana jest opcja outFile i rozpoznawanie modułu węzła z emitowaniem deklaracji.", - "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": "Wywołanie powiodłoby się dla tej implementacji, ale sygnatury implementacji przeciążeń nie są widoczne na zewnątrz.", "The_character_set_of_the_input_files_6163": "Zestaw znaków plików wejściowych.", "The_containing_arrow_function_captures_the_global_value_of_this_7041": "Zawierająca funkcja strzałki przechwytuje wartość globalną parametru „this”.", "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "Treść zawierającej funkcji lub modułu jest za duża do analizy przepływu sterowania.", @@ -1150,10 +1125,8 @@ "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "Wywnioskowany typ „{0}” nie może być nazwany bez odwołania do elementu „{1}”. Prawdopodobnie nie jest to przenośne. Konieczna jest adnotacja typu.", "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "Wywnioskowany typ elementu „{0}” odwołuje się do typu ze strukturą cykliczną, którego nie można serializować w prosty sposób. Wymagana jest adnotacja typu.", "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "Wnioskowany typ „{0}” przywołuje niedostępny typ „{1}”. Adnotacja typu jest konieczna.", - "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": "Wywnioskowany typ tego węzła przekracza maksymalną długość, którą kompilator może serializować. Wymagana jest jawna adnotacja typu.", "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": "Przecięcie „{0}” zostało zredukowane do wartości „never”, ponieważ właściwość „{1}” istnieje w wielu elementach składowych i w części z nich jest prywatna.", "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": "Przecięcie „{0}” zostało zredukowane do wartości „never”, ponieważ właściwość „{1}” zawiera typy powodujące konflikt w niektórych elementach składowych.", - "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": "Słowa kluczowego „intrinsic” można używać tylko do deklarowania typów wewnętrznych udostępnianych przez kompilator.", "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": "Należy podać opcję kompilatora „jsxFragmentFactory”, aby używać fragmentów JSX z opcją kompilatora „jsxFactory”.", "The_last_overload_gave_the_following_error_2770": "Ostatnie przeciążenie dało następujący błąd.", "The_last_overload_is_declared_here_2771": "Ostatnie przeciążenie jest zadeklarowane tutaj.", @@ -1230,7 +1203,7 @@ "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Deklaracje najwyższego poziomu w plikach .d.ts muszą rozpoczynać się od modyfikatora „declare” lub „export”.", "Trailing_comma_not_allowed_1009": "Końcowy przecinek jest niedozwolony.", "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "Transpiluj każdy plik jako oddzielny moduł (podobne do „ts.transpileModule”).", - "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "Spróbuj użyć polecenia „npm i --save-dev @types/{1}”, jeśli istnieje, lub dodać nowy plik deklaracji (.d.ts) zawierający ciąg „declare module '{0}';”", + "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035": "Spróbuj użyć polecenia „npm install @types/{1}”, jeśli istnieje, lub dodać nowy plik deklaracji (.d.ts) zawierający ciąg „declare module '{0}';”", "Trying_other_entries_in_rootDirs_6110": "Wykonywanie prób przy użyciu innych pozycji opcji „rootDirs”.", "Trying_substitution_0_candidate_module_location_Colon_1_6093": "Wykonywanie próby przeprowadzenia podstawienia „{0}”, lokalizacja modułu kandydata: „{1}”.", "Tuple_members_must_all_have_names_or_all_not_have_names_5084": "Wszystkie składowe krotki muszą mieć nazwy albo wszystkie nie mogą mieć nazw.", @@ -1305,7 +1278,6 @@ "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": "======== Dyrektywa odwołania do typu „{0}” została pomyślnie rozpoznana jako „{1}”, podstawowe: {2}. ========", "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": "======== Dyrektywa odwołania do typu „{0}” została pomyślnie rozpoznana jako „{1}” z identyfikatorem pakietu „{2}”, podstawowe: {3}. ========", "Types_have_separate_declarations_of_a_private_property_0_2442": "Typy mają osobne deklaracje właściwości prywatnej „{0}”.", - "Types_of_construct_signatures_are_incompatible_2419": "Typy sygnatur konstrukcji są niezgodne.", "Types_of_parameters_0_and_1_are_incompatible_2328": "Typy parametrów „{0}” i „{1}” są niezgodne.", "Types_of_property_0_are_incompatible_2326": "Typy właściwości „{0}” są niezgodne.", "Unable_to_open_file_0_6050": "Nie można otworzyć pliku „{0}”.", @@ -1378,7 +1350,6 @@ "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": "Element „{0}” można zaimportować tylko za pomocą wywołania „require” lub przy użyciu importu domyślnego.", "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": "Element „{0}” można zaimportować tylko przy użyciu wyrażenia „import {1} = require({2})” lub importu domyślnego.", "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": "Element „{0}” można zaimportować tylko przy użyciu wyrażenia „import {1} = require({2})” lub przez włączenie flagi „esModuleInterop” i użycie importu domyślnego.", - "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208": "Nie można skompilować elementu „{0}” z opcją „--isolatedModules”, ponieważ jest on traktowany jako globalny plik skryptu. Dodaj instrukcję import, export lub pustą instrukcję „export {}”, aby stał się modułem.", "_0_cannot_be_used_as_a_JSX_component_2786": "Elementu „{0}” nie można użyć jako składnika JSX.", "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": "Element „{0}” nie może być używany jako wartość, ponieważ został wyeksportowany przy użyciu aliasu „export type”.", "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": "Element „{0}” nie może być używany jako wartość, ponieważ został zaimportowany przy użyciu aliasu „import type”.", @@ -1386,7 +1357,6 @@ "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": "Nie można utworzyć wystąpienia elementu „{0}” z dowolnym typem, który może być niezwiązany z elementem „{1}”.", "_0_declarations_can_only_be_used_in_TypeScript_files_8006": "Deklaracje „{0}” mogą być używane tylko w plikach TypeScript.", "_0_expected_1005": "Oczekiwano elementu „{0}”.", - "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": "Element „{0}” nie ma wyeksportowanego elementu członkowskiego „{1}”. Czy chodziło o „{2}”?", "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": "Element „{0}” niejawnie ma zwracany typ „{1}”, ale lepszy typ można wywnioskować na podstawie użycia.", "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": "Dla elementu „{0}” niejawnie określono zwracany typ „any”, ponieważ nie zawiera on adnotacji zwracanego typu i jest przywoływany bezpośrednio lub pośrednio w jednym z jego zwracanych wyrażeń.", "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": "Dla elementu „{0}” niejawnie określono typ „any”, ponieważ nie zawiera on adnotacji typu i jest przywoływany bezpośrednio lub pośrednio w jego własnym inicjatorze.", @@ -1399,19 +1369,18 @@ "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "Element „{0}” jest zdefiniowany jako metoda dostępu w klasie „{1}”, ale jest przesłaniany tutaj w elemencie „{2}” jako właściwość wystąpienia.", "_0_is_deprecated_6385": "Element „{0}” jest przestarzały", "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "„{0}” nie jest prawidłową metawłaściwością słowa kluczowego „{1}”. Czy miał to być element „{2}”?", - "_0_is_not_allowed_as_a_variable_declaration_name_1389": "Element „{0}” nie jest dozwolony jako nazwa deklaracji zmiennej.", "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "Element „{0}” jest przywoływany bezpośrednio lub pośrednio w jego własnym wyrażeniu podstawowym.", "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "Element „{0}” jest przywoływany bezpośrednio lub pośrednio w jego własnej adnotacji typu.", "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": "Element „{0}” został określony więcej niż raz, dlatego to użycie zostanie przesłonięte.", "_0_list_cannot_be_empty_1097": "Lista „{0}” nie może być pusta.", "_0_modifier_already_seen_1030": "Napotkano już modyfikator „{0}”.", + "_0_modifier_cannot_appear_on_a_class_element_1031": "Modyfikator „{0}” nie może występować w elemencie klasy.", "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": "Modyfikator „{0}” nie może występować w deklaracji konstruktora.", "_0_modifier_cannot_appear_on_a_data_property_1043": "Modyfikator „{0}” nie może występować we właściwości danych.", "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": "Modyfikator „{0}” nie może być stosowany w przypadku elementu przestrzeni nazw lub modułu.", "_0_modifier_cannot_appear_on_a_parameter_1090": "Modyfikator „{0}” nie może występować w parametrze.", "_0_modifier_cannot_appear_on_a_type_member_1070": "Modyfikator „{0}” nie może być stosowany w przypadku składowej typu.", "_0_modifier_cannot_appear_on_an_index_signature_1071": "Modyfikator „{0}” nie może być stosowany w przypadku sygnatury indeksu.", - "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": "Modyfikator „{0}” nie może występować w elementach klasy tego rodzaju.", "_0_modifier_cannot_be_used_here_1042": "Modyfikatora „{0}” nie można użyć w tym miejscu.", "_0_modifier_cannot_be_used_in_an_ambient_context_1040": "Modyfikatora „{0}” nie można użyć w otaczającym kontekście.", "_0_modifier_cannot_be_used_with_1_modifier_1243": "Modyfikatora „{0}” nie można używać z modyfikatorem „{1}”.", @@ -1421,7 +1390,6 @@ "_0_needs_an_explicit_type_annotation_2782": "Element „{0}” wymaga jawnej adnotacji typu.", "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": "Element „{0}” odwołuje się tylko do typu, ale jest używany tutaj jako przestrzeń nazw.", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "Element „{0}” odwołuje się jedynie do typu, ale jest używany w tym miejscu jako wartość.", - "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": "Element „{0}” odwołuje się do typu, ale jest używany tutaj jako wartość. Czy chodziło o użycie wyrażenia „{1} in {0}”?", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "Element „{0}” odwołuje się tylko do typu, ale jest używany tutaj jako wartość. Czy chcesz zmienić bibliotekę docelową? Spróbuj zmienić opcję kompilatora „lib” na es2015 lub nowszą.", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "„{0}” odnosi się do globalnego formatu UMD, ale bieżący plik jest modułem. Rozważ zamiast tego dodanie importu.", "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "Element „{0}” odwołuje się do wartości, ale jest używany tutaj jako typ. Czy chodziło o „typeof {0}”?", @@ -1458,7 +1426,6 @@ "extends_clause_already_seen_1172": "Napotkano już klauzulę „extends”.", "extends_clause_must_precede_implements_clause_1173": "Klauzula „extends” musi poprzedzać klauzulę „implements”.", "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "Klauzula „extends” wyeksportowanej klasy „{0}” ma nazwę prywatną „{1}” lub używa tej nazwy.", - "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "Klauzula „extends” wyeksportowanej klasy ma nazwę prywatną „{0}” lub używa tej nazwy.", "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "Klauzula „extends” wyeksportowanego interfejsu „{0}” ma nazwę prywatną „{1}” lub używa tej nazwy.", "file_6025": "plik", "get_and_set_accessor_must_have_the_same_this_type_2682": "Metody dostępu „get” i „set” muszą mieć ten sam typ „this”.", diff --git a/node_modules/typescript/lib/protocol.d.ts b/node_modules/typescript/lib/protocol.d.ts index 6eb0108..ba73474 100644 --- a/node_modules/typescript/lib/protocol.d.ts +++ b/node_modules/typescript/lib/protocol.d.ts @@ -452,11 +452,6 @@ declare namespace ts.server.protocol { * so this description should make sense by itself if the parent is inlineable=true */ description: string; - /** - * A message to show to the user if the refactoring cannot be applied in - * the current context. - */ - notApplicableReason?: string; } interface GetEditsForRefactorRequest extends Request { command: CommandTypes.GetEditsForRefactor; @@ -1240,10 +1235,6 @@ declare namespace ts.server.protocol { */ closedFiles?: string[]; } - /** - * External projects have a typeAcquisition option so they need to be added separately to compiler options for inferred projects. - */ - type InferredProjectCompilerOptions = ExternalProjectCompilerOptions & TypeAcquisition; /** * Request to set compiler options for inferred projects. * External projects are opened / closed explicitly. @@ -1264,7 +1255,7 @@ declare namespace ts.server.protocol { /** * Compiler options to be used with inferred projects. */ - options: InferredProjectCompilerOptions; + options: ExternalProjectCompilerOptions; /** * Specifies the project root path used to scope compiler options. * It is an error to provide this property if the server has not been started with @@ -1684,12 +1675,6 @@ declare namespace ts.server.protocol { readonly isGlobalCompletion: boolean; readonly isMemberCompletion: boolean; readonly isNewIdentifierLocation: boolean; - /** - * In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use - * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span - * must be used to commit that completion entry. - */ - readonly optionalReplacementSpan?: TextSpan; readonly entries: readonly CompletionEntry[]; } interface CompletionDetailsResponse extends Response { @@ -2451,7 +2436,6 @@ declare namespace ts.server.protocol { insertSpaceAfterConstructor?: boolean; insertSpaceAfterKeywordsInControlFlowStatements?: boolean; insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean; - insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean; insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean; insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; @@ -2489,7 +2473,6 @@ declare namespace ts.server.protocol { readonly allowTextChangesInNewFiles?: boolean; readonly lazyConfiguredProjectsFromExternalProject?: boolean; readonly providePrefixAndSuffixTextForRename?: boolean; - readonly provideRefactorNotApplicableReason?: boolean; readonly allowRenameOfImportPath?: boolean; readonly includePackageJsonAutoImports?: "auto" | "on" | "off"; } @@ -2569,9 +2552,7 @@ declare namespace ts.server.protocol { None = "None", Preserve = "Preserve", ReactNative = "ReactNative", - React = "React", - ReactJSX = "ReactJSX", - ReactJSXDev = "ReactJSXDev" + React = "React" } const enum ModuleKind { None = "None", @@ -2581,7 +2562,6 @@ declare namespace ts.server.protocol { System = "System", ES6 = "ES6", ES2015 = "ES2015", - ES2020 = "ES2020", ESNext = "ESNext" } const enum ModuleResolutionKind { @@ -2602,7 +2582,6 @@ declare namespace ts.server.protocol { ES2018 = "ES2018", ES2019 = "ES2019", ES2020 = "ES2020", - JSON = "JSON", ESNext = "ESNext" } } @@ -2722,18 +2701,17 @@ declare namespace ts.server.protocol { enable?: boolean; include?: string[]; exclude?: string[]; - disableFilenameBasedTypeAcquisition?: boolean; - [option: string]: CompilerOptionsValue | undefined; + [option: string]: string[] | boolean | undefined; } - export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike | PluginImport[] | ProjectReference[] | null | undefined; - export interface FileExtensionInfo { extension: string; isMixedContent: boolean; scriptKind?: ScriptKind; } + export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike | PluginImport[] | ProjectReference[] | null | undefined; + interface JSDocTagInfo { name: string; text?: string; diff --git a/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json b/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json index adeb412..f389a32 100644 --- a/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +++ b/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json @@ -151,8 +151,6 @@ "Add_undefined_type_to_property_0_95018": "Adicionar tipo 'indefinido' à propriedade '{0}'", "Add_unknown_conversion_for_non_overlapping_types_95069": "Adicionar conversão 'unknown' para tipos sem sobreposição", "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": "Adicionar 'unknown' a todas as conversões de tipos sem sobreposição", - "Add_void_to_Promise_resolved_without_a_value_95143": "Adicionar 'void' à Promessa resolvida sem um valor", - "Add_void_to_all_Promises_resolved_without_a_value_95144": "Adicionar 'void' a todas as Promessas resolvidas sem um valor", "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Adicionar um arquivo tsconfig.json ajudará a organizar projetos que contêm arquivos TypeScript e JavaScript. Saiba mais em https://aka.ms/tsconfig.", "Additional_Checks_6176": "Verificações Adicionais", "Advanced_Options_6178": "Opções Avançadas", @@ -160,8 +158,9 @@ "All_declarations_of_0_must_have_identical_type_parameters_2428": "Todas as declarações de '{0}' devem ter parâmetros de tipo idênticos.", "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Todas as declarações de um método abstrato devem ser consecutivas.", "All_destructured_elements_are_unused_6198": "Todos os elementos desestruturados são inutilizados.", + "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208": "Todos os arquivos devem ser módulos quando o sinalizador '--isolatedModules' é fornecido.", "All_imports_in_import_declaration_are_unused_6192": "Nenhuma das importações na declaração de importação está sendo utilizada.", - "All_type_parameters_are_unused_6205": "Todos os parâmetros de tipo são inutilizados.", + "All_type_parameters_are_unused_6205": "Todos os parâmetros de tipo não são usados", "All_variables_are_unused_6199": "Nenhuma das variáveis está sendo utilizada.", "Allow_accessing_UMD_globals_from_modules_95076": "Permitir o acesso a UMD globais de módulos.", "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Permita importações padrão de módulos sem exportação padrão. Isso não afeta a emissão do código, apenas a verificação de digitação.", @@ -193,7 +192,7 @@ "An_export_assignment_cannot_have_modifiers_1120": "Uma atribuição de exportação não pode ter modificadores.", "An_export_declaration_can_only_be_used_in_a_module_1233": "Uma declaração de exportação só pode ser usada em um módulo.", "An_export_declaration_cannot_have_modifiers_1193": "Uma declaração de exportação não pode ter modificadores.", - "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "Uma expressão do tipo 'nula' não pode ser testada quanto à veracidade.", + "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "Uma expressão do tipo 'void' não pode ser testada para a realidade", "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198": "Um valor de escape Unicode estendido deve estar entre 0x0 e 0x10FFFF, inclusive.", "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351": "Um identificador ou palavra-chave não pode imediatamente seguir um literal numérico.", "An_implementation_cannot_be_declared_in_ambient_contexts_1183": "Uma implementação não pode ser declarada em contextos de ambiente.", @@ -235,7 +234,6 @@ "Argument_expression_expected_1135": "Expressão de argumento esperada.", "Argument_for_0_option_must_be_Colon_1_6046": "O argumento para a opção '{0}' deve ser: {1}.", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "O argumento do tipo '{0}' não é atribuível ao parâmetro do tipo '{1}'.", - "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "Não foram fornecidos argumentos para o parâmetro REST '{0}'.", "Array_element_destructuring_pattern_expected_1181": "Padrão de desestruturação de elemento da matriz esperado.", "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": "As declarações exigem que todos os nomes no destino de chamada sejam declarados com uma anotação de tipo explícito.", "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": "As declarações exigem que o destino da chamada seja um identificador ou um nome qualificado.", @@ -261,7 +259,6 @@ "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Assinatura de chamada, que não tem a anotação de tipo de retorno, implicitamente tem um tipo de retorno 'any'.", "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204": "Assinaturas de chamada sem argumentos têm tipos de retorno incompatíveis '{0}' e '{1}'.", "Call_target_does_not_contain_any_signatures_2346": "O destino da chamada não contém nenhuma assinatura.", - "Can_only_convert_logical_AND_access_chains_95142": "Só é possível converter cadeias de acesso E lógicas", "Can_only_convert_property_with_modifier_95137": "Só é possível converter a propriedade com o modificador", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Não foi possível acessar '{0}.{1}' porque '{0}' é um tipo, mas não um namespace. Você quis dizer recuperar o tipo da propriedade '{1}' em '{0}' com '{0}[\"{1}\"]'?", "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748": "Não é possível acessar enumerações de constante de ambiente quando o sinalizador '--isolatedModules' é fornecido.", @@ -284,21 +281,20 @@ "Cannot_find_global_value_0_2468": "Não é possível encontrar o valor global '{0}'.", "Cannot_find_lib_definition_for_0_2726": "Não é possível encontrar a definição de biblioteca para '{0}'.", "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "Não é possível encontrar a definição de biblioteca para '{0}'. Você quis dizer '{1}'?", - "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Não é possível localizar o módulo '{0}'. Considere usar '--resolveJsonModule' para importar o módulo com a extensão '.json'.", - "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "Não é possível localizar o módulo '{0}'. Você quis definir a opção 'moduleResolution' como 'node' ou adicionar aliases à opção 'paths'?", + "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Não é possível localizar o módulo '{0}'. Considere usar '--resolveJsonModule' para importar o módulo com a extensão '.json'", "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "Não é possível localizar o módulo '{0}' ou suas declarações de tipo correspondentes.", "Cannot_find_name_0_2304": "Não é possível encontrar o nome '{0}'.", "Cannot_find_name_0_Did_you_mean_1_2552": "Não é possível localizar o nome '{0}'. Você quis dizer '{1}'?", "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "Não foi possível localizar o nome '{0}'. Você quis dizer o membro de instância 'this.{0}'?", "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": "Não foi possível encontrar o nome '{0}'. Você quis dizer o membro estático '{1}.{0}'?", - "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Não é possível localizar o nome '{0}'. Você precisa alterar sua biblioteca de destino? Tente alterar a opção `lib` do compilador para '{1}' ou posterior.", + "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Não é possível localizar o nome '{0}'. Você precisa alterar sua biblioteca de destino? Tente alterar a opção de compilador 'lib' para es2015 ou posterior.", "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": "Não é possível localizar o nome '{0}'. Você precisa alterar sua biblioteca de destino? Tente alterar a opção de compilador 'lib' para incluir 'dom'.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": "Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para um executor de teste? Tente `npm i --save-dev @types/jest` ou `npm i --save-dev @types/mocha`.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": "Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para um executor de teste? Tente `npm i --save-dev @types/jest` ou `npm i --save-dev @types/mocha` e, em seguida, adicione `jest` ou `mocha` aos campos de tipo no tsconfig.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": "Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o jQuery? Tente `npm i --save-dev @types/jquery`.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": "Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o jQuery? Tente `npm i --save-dev @types/jquery` e, em seguida, adicione `jquery` ao campo de tipos no tsconfig.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": "Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o nó? Tente `npm i --save-dev @types/node`.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": "Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o nó? Tente `npm i --save-dev @types/node` e, em seguida, adicione `node` ao campo de tipos no tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582": "Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para um executor de teste? Tente 'npm i @types/jest ' ou 'npm i @types/mocha'.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593": "Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para um executor de teste? Tente 'npm i @types/jest' ou 'npm i @types/mocha' e, em seguida, adicione 'jest' ou 'mocha' ao campo de tipos em seu tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581": "Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o jQuery? Tente 'npm i @types/jquery'.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592": "Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o jQuery? Tente 'npm i @types/jquery' e, em seguida, adicione 'jquery' ao campo de tipos em seu tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580": "Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o nó? Tente 'npm i @types/node'.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591": "Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o nó? Tente 'npm i @types/node' e, em seguida, adicione 'node' ao campo de tipos em seu tsconfig.", "Cannot_find_namespace_0_2503": "Não é possível encontrar o namespace '{0}'.", "Cannot_find_parameter_0_1225": "Não é possível encontrar o parâmetro '{0}'.", "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": "Não é possível encontrar o caminho do subdiretório comum para os arquivos de entrada.", @@ -369,13 +365,10 @@ "Constructor_implementation_is_missing_2390": "Implementação do construtor ausente.", "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673": "O construtor de classe '{0}' é privado e somente acessível na declaração de classe.", "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "O construtor de classe '{0}' é protegido e somente acessível na declaração de classe.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386": "A notação de tipo de construtor precisa estar entre parênteses quando usada em um tipo de união.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388": "A notação de tipo de construtor precisa estar entre parênteses quando usada em um tipo de interseção.", "Constructors_for_derived_classes_must_contain_a_super_call_2377": "Construtores para classes derivadas devem conter uma chamada 'super'.", "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "O arquivo contido não foi especificado e o diretório raiz não pode ser determinado, ignorando a pesquisa na pasta 'node_modules'.", "Containing_function_is_not_an_arrow_function_95128": "A função contentora não é uma função de seta", "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": "A conversão do tipo '{0}' para o tipo '{1}' pode ser um erro porque nenhum tipo está suficientemente sobreposto ao outro. Se isso era intencional, converta a expressão para 'unknown' primeiro.", - "Convert_0_to_1_in_0_95003": "Converter '{0}' em '{1} em {0}'", "Convert_0_to_mapped_object_type_95055": "Converter '{0}' para o tipo de objeto mapeado", "Convert_all_constructor_functions_to_classes_95045": "Converter todas as funções de construtor em classes", "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374": "Converter todas as importações não usadas como um valor para importações somente de tipo", @@ -385,7 +378,6 @@ "Convert_all_to_async_functions_95066": "Converter todos para funções assíncronas", "Convert_all_to_bigint_numeric_literals_95092": "Converter todos para literais numéricos bigint", "Convert_all_to_default_imports_95035": "Converter tudo para importações padrão", - "Convert_all_type_literals_to_mapped_type_95021": "Converter todos os literais de tipo em tipo mapeado", "Convert_arrow_function_or_function_expression_95122": "Converter a função de seta ou a expressão de função", "Convert_const_to_let_95093": "Converter 'const' para 'let'", "Convert_default_export_to_named_export_95061": "Converter exportação padrão para exportação nomeada", @@ -407,17 +399,14 @@ "Convert_to_async_function_95065": "Converter para uma função assíncrona", "Convert_to_default_import_95013": "Converter para importação padrão", "Convert_to_named_function_95124": "Converter em uma função nomeada", - "Convert_to_optional_chain_expression_95139": "Converter em expressão de cadeia opcional", "Convert_to_template_string_95096": "Converter para cadeia de caracteres de modelo", "Convert_to_type_only_export_1364": "Converter para exportação somente de tipo", "Convert_to_type_only_import_1373": "Converter para importação somente de tipo", "Corrupted_locale_file_0_6051": "Arquivo de localidade {0} corrompido.", "Could_not_find_a_containing_arrow_function_95127": "Não foi possível localizar uma função de seta contentora", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "Não foi possível localizar o arquivo de declaração para o módulo '{0}'. '{1}' tem implicitamente um tipo 'any'.", - "Could_not_find_convertible_access_expression_95140": "Não foi possível localizar a expressão de acesso conversível", "Could_not_find_export_statement_95129": "Não foi possível localizar a instrução de exportação", "Could_not_find_import_clause_95131": "Não foi possível localizar a cláusula de importação", - "Could_not_find_matching_access_expressions_95141": "Não foi possível localizar expressões de acesso correspondentes", "Could_not_find_namespace_import_or_named_imports_95132": "Não foi possível localizar a importação de namespace nem as importações nomeadas", "Could_not_find_property_for_which_to_generate_accessor_95135": "Não foi possível localizar a propriedade para a qual o acessador deve ser gerado", "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231": "Não foi possível resolver o caminho '{0}' com as extensões: {1}.", @@ -429,8 +418,6 @@ "Declaration_expected_1146": "Declaração esperada.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "O nome de declaração entra em conflito com o identificador global integrado '{0}'.", "Declaration_or_statement_expected_1128": "Declaração ou instrução esperada.", - "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": "As declarações com asserções de atribuição definitiva também precisam ter anotações de tipo.", - "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": "As declarações com inicializadores também não podem ter asserções de atribuição definitiva.", "Declare_a_private_field_named_0_90053": "Declare um campo privado chamado '{0}'.", "Declare_method_0_90023": "Declarar método '{0}'", "Declare_private_method_0_90038": "Declarar método privado '{0}'", @@ -441,6 +428,7 @@ "Decorators_are_not_valid_here_1206": "Os decoradores não são válidos aqui.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Os decoradores não podem ser aplicados a vários acessadores get/set de mesmo nome.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "A exportação padrão do módulo tem ou está usando o nome particular '{0}'.", + "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258": "As declarações de atribuição definitivas só podem ser usadas juntamente com uma anotação de tipo.", "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": "As definições dos seguintes identificadores estão em conflito com as de outro arquivo: {0}", "Delete_all_unused_declarations_95024": "Excluir todas as declarações não usadas", "Delete_the_outputs_of_all_projects_6365": "Excluir as saídas de todos os projetos", @@ -458,7 +446,6 @@ "Digit_expected_1124": "Dígito esperado.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "O diretório '{0}' não existe; ignorando todas as pesquisas nele.", "Disable_checking_for_this_file_90018": "Desabilitar a verificação para esse arquivo", - "Disable_loading_referenced_projects_6235": "Desabilite o carregamento de projetos referenciados.", "Disable_size_limitations_on_JavaScript_projects_6162": "Desabilitar as limitações de tamanho nos projetos JavaScript.", "Disable_solution_searching_for_this_project_6224": "Desabilite a pesquisa de solução deste projeto.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Desabilitar verificação estrita de assinaturas genéricas em tipos de função.", @@ -490,7 +477,7 @@ "Duplicate_number_index_signature_2375": "Assinatura de índice de número duplicado.", "Duplicate_property_0_2718": "Propriedade '{0}' duplicada.", "Duplicate_string_index_signature_2374": "Assinatura de índice de cadeia de caracteres duplicada.", - "Dynamic_import_cannot_have_type_arguments_1326": "A importação dinâmica não pode ter argumentos de tipo.", + "Dynamic_import_cannot_have_type_arguments_1326": "A importação dinâmica não pode ter argumentos de tipo", "Dynamic_import_must_have_one_specifier_as_an_argument_1324": "A importação dinâmica deve ter um especificador como um argumento.", "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "O especificador da importação dinâmica deve ser do tipo 'string', mas aqui tem o tipo '{0}'.", "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323": "Só há suporte para importações dinâmicas quando o sinalizador '--module' está definido como 'es2020', 'esnext', 'commonjs', 'amd', 'system' ou 'UMD'.", @@ -532,7 +519,6 @@ "Excessive_stack_depth_comparing_types_0_and_1_2321": "Profundidade da pilha excessiva ao comparar tipos '{0}' e '{1}'.", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "Espera-se {0}-{1} argumentos de tipo; forneça esses recursos com uma marca \"@extends\".", "Expected_0_arguments_but_got_1_2554": "{0} argumentos eram esperados, mas {1} foram obtidos.", - "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "{0} argumentos eram esperados, mas foram obtidos {1}. Você esqueceu de incluir 'void' no argumento de tipo para 'Promise'?", "Expected_0_arguments_but_got_1_or_more_2556": "Eram {0} argumentos esperados, mas {1} ou mais foram obtidos.", "Expected_0_type_arguments_but_got_1_2558": "{0} argumentos de tipo eram esperados, mas {1} foram obtidos.", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Espera-se {0} argumentos de tipo; forneça esses recursos com uma marca \"@extends\".", @@ -610,14 +596,11 @@ "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366": "A função não tem a instrução return final e o tipo de retorno não inclui 'undefined'.", "Function_overload_must_be_static_2387": "A sobrecarga de função deve ser estática.", "Function_overload_must_not_be_static_2388": "A sobrecarga de função não deve ser estática.", - "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385": "A notação de tipo de função precisa estar entre parênteses quando usada em um tipo de união.", - "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387": "A notação de tipo de função precisa estar entre parênteses quando usada em um tipo de interseção.", "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014": "O tipo de função, que não tem a anotação de tipo de retorno, implicitamente tem um tipo de retorno '{0}'.", "Generate_get_and_set_accessors_95046": "Gerar acessadores 'get' e 'set'", "Generate_get_and_set_accessors_for_all_overriding_properties_95119": "Gerar os acessadores 'get' e 'set' para todas as propriedades de substituição", "Generates_a_CPU_profile_6223": "Gera um perfil de CPU.", "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": "Gera um sourcemap para cada arquivo '.d.ts' correspondente.", - "Generates_an_event_trace_and_a_list_of_types_6237": "Gera um rastreamento de eventos e uma lista de tipos.", "Generates_corresponding_d_ts_file_6002": "Gera o arquivo '.d.ts' correspondente.", "Generates_corresponding_map_file_6043": "Gera o arquivo '.map' correspondente.", "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025": "Implicitamente, o gerador tem o tipo de rendimento '{0}' porque não produz nenhum valor. Considere fornecer uma anotação de tipo de retorno.", @@ -662,7 +645,6 @@ "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "Em declarações de enumeração de ambiente, o inicializador de membro deve ser uma expressão de constante.", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "Em uma enumeração com várias declarações, somente uma declaração pode omitir um inicializador para o primeiro elemento de enumeração.", "Include_modules_imported_with_json_extension_6197": "Incluir módulos importados com a extensão '.json'", - "Include_undefined_in_index_signature_results_6800": "Incluir 'undefined' nos resultados da assinatura de índice", "Index_signature_in_type_0_only_permits_reading_2542": "Assinatura de índice no tipo '{0}' permite somente leitura.", "Index_signature_is_missing_in_type_0_2329": "Assinatura de índice ausente no tipo '{0}'.", "Index_signatures_are_incompatible_2330": "As assinaturas de índice são incompatíveis.", @@ -694,7 +676,6 @@ "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Valor inválido para 'jsxFactory'. '{0}' não é um identificador válido ou nome qualificado.", "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": "Valor inválido para 'jsxFragmentFactory'. '{0}' não é um identificador válido ou nome qualificado.", "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Valor inválido para '--reactNamespace'. '{0}' não é um identificador válido.", - "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": "É provável que não haja uma vírgula para separar essas duas expressões de modelo. Elas formam uma expressão de modelo marcada que não pode ser invocada.", "Its_element_type_0_is_not_a_valid_JSX_element_2789": "Seu tipo de elemento '{0}' não é um elemento JSX válido.", "Its_instance_type_0_is_not_a_valid_JSX_element_2788": "Seu tipo de instância '{0}' não é um elemento JSX válido.", "Its_return_type_0_is_not_a_valid_JSX_element_2787": "Seu tipo de retorno '{0}' não é um elemento JSX válido.", @@ -759,6 +740,7 @@ "Module_0_has_no_default_export_1192": "O módulo '{0}' não tem padrão de exportação.", "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": "O módulo '{0}' não tem exportação padrão. Você quis dizer 'importar { {1} } de {0}' em vez disso?", "Module_0_has_no_exported_member_1_2305": "O módulo '{0}' não tem nenhum membro exportado '{1}'.", + "Module_0_has_no_exported_member_1_Did_you_mean_2_2724": "O módulo '{0}' não tem nenhum membro '{1}' exportado. Você quis dizer '{2}'?", "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": "O módulo '{0}' não tem membro exportado '{1}'. Você quis dizer 'importar {1} de {0}' em vez disso?", "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": "O módulo '{0}' está oculto por uma declaração de local com o mesmo nome.", "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "O módulo '{0}' usa 'export =' e não pode ser usado com 'export *'.", @@ -794,7 +776,6 @@ "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": "A classe não abstrata '{0}' não implementa o membro abstrato herdado '{1}' da classe '{2}'.", "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "A expressão da classe não abstrata não implementa o membro abstrato herdado '{0}' da classe '{1}'.", "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": "As declarações não nulas só podem ser usadas em arquivos TypeScript.", - "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090": "Os caminhos não relativos não são permitidos quando a 'baseUrl' não está definida. Você esqueceu um './' à esquerda?", "Non_simple_parameter_declared_here_1348": "Parâmetro não simples declarado aqui.", "Not_all_code_paths_return_a_value_7030": "Nem todos os caminhos de código retornam um valor.", "Not_all_constituents_of_type_0_are_callable_2756": "Nem todos os membros do tipo '{0}' podem ser chamados.", @@ -830,7 +811,6 @@ "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "A opção '{0}' somente pode ser especificada no arquivo 'tsconfig.json' ou definida como 'false' ou 'null' na linha de comando.", "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "A opção '{0}' somente pode ser especificada no arquivo 'tsconfig.json' ou definida como 'null' na linha de comando.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "A opção '{0} só pode ser usada quando qualquer uma das opções '--inlineSourceMap' ou '--sourceMap' é fornecida.", - "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": "A opção '{0}' não pode ser especificada quando a opção 'jsx' é '{1}'.", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "A opção '{0}' não pode ser especificada quando a opção 'target' é 'ES3'.", "Option_0_cannot_be_specified_with_option_1_5053": "A opção '{0}' não pode ser especificada com a opção '{1}'.", "Option_0_cannot_be_specified_without_specifying_option_1_5052": "A opção '{0}' não pode ser especificada sem especificar a opção '{1}'.", @@ -839,6 +819,7 @@ "Option_build_must_be_the_first_command_line_argument_6369": "A opção '--build' precisa ser o primeiro argumento da linha de comando.", "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": "A opção '--incremental' só pode ser especificada usando tsconfig, emitindo para um único arquivo ou quando a opção '--tsBuildInfoFile' é especificada.", "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "A opção 'isolatedModules' só pode ser usada quando nenhuma opção de '--module' for fornecida ou a opção 'target' for 'ES2015' ou superior.", + "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "A opção 'paths' não pode ser usada sem se especificar a opção '--baseUrl'.", "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "A opção 'project' não pode ser mesclada com arquivos de origem em uma linha de comando.", "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071": "A opção '--resolveJsonModule' só pode ser especificada quando a geração de código de módulo é 'commonjs', 'amd', 'es2015' ou 'esNext'.", "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "A opção '--resolveJsonModule' não pode ser especificada sem a estratégia de resolução de módulo de 'nó'.", @@ -891,7 +872,6 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "O tipo de parâmetro do setter estático público '{0}' da classe exportada tem ou está usando o nome privado '{1}'.", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Analisar em modo estrito e emitir \"usar estrito\" para cada arquivo de origem.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "O padrão '{0}' pode ter no máximo um caractere '*'.", - "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": "Os tempos de desempenho de '--diagnostics' ou '--extendedDiagnostics' não estão disponíveis nesta sessão. Não foi possível encontrar uma implementação nativa da API de Desempenho Web.", "Prefix_0_with_an_underscore_90025": "Prefixo '{0}' com um sublinhado", "Prefix_all_incorrect_property_declarations_with_declare_95095": "Prefixar todas as declarações de propriedade incorretas com 'declare'", "Prefix_all_unused_declarations_with_where_possible_95025": "Prefixar com '_' todas as declarações não usadas quando possível", @@ -905,7 +885,7 @@ "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "Identificadores privados não são permitidos em declarações de variáveis.", "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "Identificadores privados não são permitidos fora dos corpos de classe.", "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "Identificadores privados só estão disponíveis ao direcionar para o ECMAScript 2015 ou superior.", - "Private_identifiers_cannot_be_used_as_parameters_18009": "Não é possível usar identificadores privados como parâmetros.", + "Private_identifiers_cannot_be_used_as_parameters_18009": "Não é possível usar identificadores privados como parâmetros", "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "O membro privado ou protegido '{0}' não pode ser acessado em um parâmetro de tipo.", "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "O projeto '{0}' não pode ser compilado porque sua dependência '{1}' tem erros", "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383": "O projeto '{0}' não pode ser criado porque sua dependência '{1}' não foi criada", @@ -923,7 +903,6 @@ "Property_0_does_not_exist_on_const_enum_1_2479": "A propriedade '{0}' não existe na enumeração 'const' '{1}'.", "Property_0_does_not_exist_on_type_1_2339": "A propriedade '{0}' não existe no tipo '{1}'.", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "A propriedade '{0}' não existe no tipo '{1}'. Você quis dizer '{2}'?", - "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": "A propriedade '{0}' não existe no tipo '{1}'. Você precisa alterar sua biblioteca de destino? Tente alterar a opção `lib` do compilador para '{2}' ou posterior.", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "A propriedade '{0}' não tem nenhum inicializador e não está definitivamente atribuída no construtor.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "A propriedade '{0}' tem implicitamente o tipo 'any' porque o acessador get não tem uma anotação de tipo de retorno.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "A propriedade '{0}' tem implicitamente o tipo 'any' porque o acessador set não tem uma anotação de tipo de parâmetro.", @@ -932,7 +911,7 @@ "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "A propriedade '{0}' no tipo '{1}' não pode ser atribuída à mesma propriedade no tipo base '{2}'.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "A propriedade '{0}' no tipo '{1}' não pode ser atribuída ao tipo '{2}'.", "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015": "A propriedade '{0}' no tipo '{1}' se refere a um membro diferente que não pode ser acessado por meio do tipo '{2}'.", - "Property_0_is_a_static_member_of_type_1_2576": "A propriedade '{0}' é um membro estático do tipo '{1}'.", + "Property_0_is_a_static_member_of_type_1_2576": "A propriedade '{0}' é um membro estático do tipo '{1}'", "Property_0_is_declared_but_its_value_is_never_read_6138": "A propriedade '{0}' é declarada, mas seu valor nunca é lido.", "Property_0_is_incompatible_with_index_signature_2530": "A propriedade '{0}' é incompatível com a assinatura de índice.", "Property_0_is_incompatible_with_rest_element_type_2573": "A propriedade '{0}' é incompatível com o tipo de elemento REST.", @@ -961,7 +940,6 @@ "Property_or_signature_expected_1131": "Propriedade ou assinatura esperada.", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "O valor da propriedade pode ser somente um literal de cadeia, um literal numérico, 'true', 'false', 'null', literal de objeto ou literal de matriz.", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "Fornecer suporte completo para os iteráveis em 'for-of', espalhamento e desestruturação ao direcionar 'ES5' ou 'ES3'.", - "Provides_a_root_package_name_when_using_outFile_with_declarations_1390": "Fornece um nome de pacote raiz ao usar outFile com declarações.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "O método público '{0}' da classe exportada tem ou está usando o nome '{1}' do módulo externo {2}, mas não pode ser nomeado.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "O método público '{0}' da classe exportada tem ou está usando o nome '{1}' do módulo privado '{2}'.", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "O método público '{0}' da classe exportada tem ou está usando o nome privado '{1}'.", @@ -1088,7 +1066,6 @@ "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "Especifique o fim da sequência de linha a ser usado ao emitir arquivos: 'CRLF' (dos) ou 'LF' (unix).", "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": "Especifique o local onde o depurador deve localizar arquivos TypeScript em vez de locais de origem.", "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "Especifique o local onde o depurador deve localizar arquivos de mapa em vez de locais gerados.", - "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": "Especifique o especificador de módulo a ser usado para importar as funções do alocador `jsx` e `jsxs`. Por exemplo, react", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Especifique o diretório raiz de arquivos de entrada. Use para controlar a estrutura do diretório de saída com --outDir.", "Split_all_invalid_type_only_imports_1367": "Dividir todas as importações somente de tipo inválidas", "Split_into_two_separate_import_declarations_1366": "Dividir em duas declarações de importação separadas", @@ -1130,8 +1107,6 @@ "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496": "O objeto 'arguments' não pode ser referenciado em uma função de seta em ES3 e ES5. Considere usar uma expressão de função padrão.", "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "O objeto 'arguments' não pode ser referenciado em uma função assíncrona ou o método no ES3 e ES5. Considere usar uma função ou um método padrão.", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "O corpo de uma instrução 'if' não pode ser uma instrução vazia.", - "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391": "A opção `bundledPackageName` precisa ser fornecida ao usar outFile e a resolução de módulo de nó com a emissão de declaração.", - "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": "A chamada teria sido bem-sucedida nesta implementação, mas as assinaturas de implementação de sobrecargas não estão visíveis externamente.", "The_character_set_of_the_input_files_6163": "O conjunto de caracteres dos arquivos de entrada.", "The_containing_arrow_function_captures_the_global_value_of_this_7041": "A função de seta contida captura o valor global de 'this'.", "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "O corpo da função ou do módulo contido é muito grande para a análise de fluxo de controle.", @@ -1150,10 +1125,8 @@ "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "O tipo inferido de '{0}' não pode ser nomeado sem uma referência a '{1}'. Isso provavelmente não é portátil. Uma anotação de tipo é necessária.", "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "O tipo inferido '{0}' faz referência a um tipo com uma estrutura cíclica que não pode ser serializada trivialmente. Uma anotação de tipo é necessária.", "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "O tipo inferido de '{0}' faz referência a um tipo '{1}' inacessível. Uma anotação de tipo é necessária.", - "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": "O tipo inferido deste nó excede o tamanho máximo que o compilador serializará. Uma anotação de tipo explícita é necessária.", "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": "A interseção '{0}' foi reduzida para 'never' porque a propriedade '{1}' existe em vários constituintes e é privada em alguns.", "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": "A interseção '{0}' foi reduzida para 'never' porque a propriedade '{1}' tem tipos conflitantes em alguns constituintes.", - "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": "A palavra-chave 'intrinsic' só pode ser usada para declarar tipos intrínsecos fornecidos pelo compilador.", "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": "A opção do compilador 'jsxFragmentFactory' precisa ser fornecida para que se possa usar fragmentos JSX com a opção do compilador 'jsxFactory'.", "The_last_overload_gave_the_following_error_2770": "A última sobrecarga gerou o seguinte erro.", "The_last_overload_is_declared_here_2771": "A última sobrecarga é declarada aqui.", @@ -1230,7 +1203,7 @@ "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "As declarações de nível superior em arquivos .d.ts devem começar com um modificador 'declare' ou 'export'.", "Trailing_comma_not_allowed_1009": "Vírgula à direita não permitida.", "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "Transcompilar cada arquivo como um módulo separado (do mesmo modo que 'ts.transpileModule').", - "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "Tente `npm i --save-dev @types/{1}` caso exista ou adicione um novo arquivo de declaração (.d.ts) contendo `declare module '{0}';`", + "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035": "Tente `npm install @types/{1}` se existir ou adicione um novo arquivo de declaração (.d.ts) contendo `módulo declare '{0}';`", "Trying_other_entries_in_rootDirs_6110": "Tentando outras entradas em 'rootDirs'.", "Trying_substitution_0_candidate_module_location_Colon_1_6093": "Tentando substituição '{0}', local de módulo candidato: '{1}'.", "Tuple_members_must_all_have_names_or_all_not_have_names_5084": "Todos os membros de tupla precisam ter nomes ou não ter nomes.", @@ -1305,7 +1278,6 @@ "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": "======== A diretiva de referência de tipo '{0}' foi resolvida com sucesso para '{1}', primário: {2}. ========", "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": "======== A diretiva de referência de tipo '{0}' foi resolvida com sucesso para '{1}' com a ID do Pacote '{2}', primário: {3}. ========", "Types_have_separate_declarations_of_a_private_property_0_2442": "Tipos têm declarações separadas de uma propriedade privada '{0}'.", - "Types_of_construct_signatures_are_incompatible_2419": "Os tipos de assinaturas de constructo são incompatíveis.", "Types_of_parameters_0_and_1_are_incompatible_2328": "Os tipos de parâmetros '{0}' e '{1}' são incompatíveis.", "Types_of_property_0_are_incompatible_2326": "Tipos de propriedade '{0}' são incompatíveis.", "Unable_to_open_file_0_6050": "Não é possível abrir o arquivo '{0}'.", @@ -1378,7 +1350,6 @@ "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": "'{0}' só pode ser importado usando uma chamada 'require' ou usando uma importação padrão.", "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": "'{0}' só pode ser importado usando 'import {1} = require({2})' ou uma importação padrão.", "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": "'{0}' só pode ser importado usando 'import {1} = require({2})' ou ativando o sinalizador 'esModuleInterop' e usando uma importação padrão.", - "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208": "'{0}' não pode ser compilado em '--isolatedModules' porque é considerado um arquivo de script global. Adicione uma instrução de importação, de exportação ou de 'export {}' vazia para transformá-lo em módulo.", "_0_cannot_be_used_as_a_JSX_component_2786": "O módulo '{0}' não pode ser usado como um componente JSX.", "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": "'{0}' não pode ser usado como um valor porque foi exportado usando 'tipo de exportação'.", "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": "'{0}' não pode ser usado como um valor porque foi importado usando 'tipo de importação'.", @@ -1386,7 +1357,6 @@ "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": "Uma instância de '{0}' poderia ser criada com um tipo arbitrário que poderia não estar relacionado a '{1}'.", "_0_declarations_can_only_be_used_in_TypeScript_files_8006": "As declarações '{0}' só podem ser usadas em arquivos TypeScript.", "_0_expected_1005": "'{0}' esperado.", - "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": "'{0}' não tem nenhum membro exportado chamado '{1}'. Você quis dizer '{2}'?", "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": "'{0}' tem implicitamente um tipo de retorno '{1}', mas um tipo melhor pode ser inferido do uso.", "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": "Implicitamente, '{0}' tem um retorno tipo 'any' porque ele não tem uma anotação de tipo de retorno e é referenciado direta ou indiretamente em uma das suas expressões de retorno.", "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": "Implicitamente, '{0}' tem o tipo 'any' porque não tem uma anotação de tipo e é referenciado direta ou indiretamente em seu próprio inicializador.", @@ -1399,29 +1369,27 @@ "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "'{0}' está definido como um acessador na classe '{1}', mas é substituído aqui em '{2}' como uma propriedade de instância.", "_0_is_deprecated_6385": "'{0}' foi preterido", "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "'{0}' não é uma metapropriedade para a palavra-chave '{1}'. Você quis dizer '{2}'?", - "_0_is_not_allowed_as_a_variable_declaration_name_1389": "'{0}' não é permitido como um nome de declaração de variável.", "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "'{0}' é referenciado direta ou indiretamente em sua própria expressão base.", "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "'{0}' é referenciado direta ou indiretamente em sua própria anotação de tipo.", "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": "'{0}' foi especificado mais de uma vez, portanto esse uso será substituído.", "_0_list_cannot_be_empty_1097": "A lista '{0}' não pode estar vazia.", "_0_modifier_already_seen_1030": "O modificador '{0}' já foi visto.", + "_0_modifier_cannot_appear_on_a_class_element_1031": "O modificador '{0}' não pode aparecer em um elemento de classe.", "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": "O modificador '{0}' não pode aparecer em uma declaração de construtor.", "_0_modifier_cannot_appear_on_a_data_property_1043": "O modificador '{0}' não pode aparecer nas propriedades dos dados.", "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": "O modificador '{0}' não pode aparecer em um módulo ou elemento de namespace.", "_0_modifier_cannot_appear_on_a_parameter_1090": "O modificador '{0}' não pode aparecer em um parâmetro.", "_0_modifier_cannot_appear_on_a_type_member_1070": "O modificador '{0}' não pode aparecer em um membro de tipo.", "_0_modifier_cannot_appear_on_an_index_signature_1071": "O modificador '{0}' não pode aparecer em uma assinatura de índice.", - "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": "O modificador '{0}' não pode aparecer em elementos de classe deste tipo.", "_0_modifier_cannot_be_used_here_1042": "O modificador '{0}' não pode ser usado aqui.", "_0_modifier_cannot_be_used_in_an_ambient_context_1040": "O modificador '{0}' não pode ser usado em um contexto de ambiente.", "_0_modifier_cannot_be_used_with_1_modifier_1243": "O modificador '{0}' não pode ser usado com um modificador '{1}'.", "_0_modifier_cannot_be_used_with_a_class_declaration_1041": "O modificador '{0}' não pode ser usado com declarações de classes.", - "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "O modificador '{0}' não pode ser usado com um identificador privado.", + "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "O modificador '{0}' não pode ser usado com um identificador privado", "_0_modifier_must_precede_1_modifier_1029": "O modificador '{0}' deve preceder o modificador '{1}'.", "_0_needs_an_explicit_type_annotation_2782": "'{0}' precisa de uma anotação de tipo explícita.", "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": "'{0}' refere-se apenas a um tipo, mas está sendo usado como um namespace aqui.", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "'{0}' só faz referência a um tipo, mas está sendo usado como valor no momento.", - "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": "'{0}' faz referência somente a um tipo, mas está sendo usado como um valor aqui. Você quis usar '{1} em {0}'?", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "'{0}' faz referência somente a um tipo, mas está sendo usado como um valor aqui. Você precisa alterar sua biblioteca de destino? Tente alterar a opção de compilador 'lib' para es2015 ou posterior.", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "'{0}' refere-se a uma UMD global, mas o arquivo atual é um módulo. Considere adicionar uma importação.", "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "'{0}' refere-se a um valor, mas está sendo usado como um tipo aqui. Você quis dizer 'typeof {0}'?", @@ -1458,7 +1426,6 @@ "extends_clause_already_seen_1172": "A cláusula 'extends' já foi vista.", "extends_clause_must_precede_implements_clause_1173": "A cláusula 'extends' deve preceder a cláusula 'implements'.", "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "A cláusula 'extends' da classe exportada '{0}' tem ou está usando o nome particular '{1}'.", - "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "A cláusula 'extends' da classe exportada tem ou está usando o nome particular '{0}'.", "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "A cláusula 'extends' da interface exportada '{0}' tem ou está usando o nome particular '{1}'.", "file_6025": "arquivo", "get_and_set_accessor_must_have_the_same_this_type_2682": "os assessores 'set' e 'get' devem ter o mesmo tipo 'this'.", diff --git a/node_modules/typescript/lib/ru/diagnosticMessages.generated.json b/node_modules/typescript/lib/ru/diagnosticMessages.generated.json index f946a66..675c965 100644 --- a/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +++ b/node_modules/typescript/lib/ru/diagnosticMessages.generated.json @@ -151,8 +151,6 @@ "Add_undefined_type_to_property_0_95018": "Добавить тип \"undefined\" к свойству \"{0}\"", "Add_unknown_conversion_for_non_overlapping_types_95069": "Добавить преобразование \"unknown\" для неперекрывающихся типов", "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": "Добавить \"unknown\" для всех преобразований неперекрывающихся типов", - "Add_void_to_Promise_resolved_without_a_value_95143": "Добавить \"void\" в Promise (обещание), разрешенное без значения", - "Add_void_to_all_Promises_resolved_without_a_value_95144": "Добавить \"void\" во все Promise (обещания), разрешенные без значения", "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Добавление файла tsconfig.json поможет организовать проекты, содержащие файлы TypeScript и JavaScript. Дополнительные сведения: https://aka.ms/tsconfig.", "Additional_Checks_6176": "Дополнительные проверки", "Advanced_Options_6178": "Дополнительные параметры", @@ -160,8 +158,9 @@ "All_declarations_of_0_must_have_identical_type_parameters_2428": "Все объявления \"{0}\" должны иметь одинаковые параметры типа.", "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Все объявления абстрактных методов должны быть последовательными.", "All_destructured_elements_are_unused_6198": "Все деструктурированные элементы не используются.", + "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208": "Если задан флаг \"--isolatedModules\", все файлы должны быть модулями.", "All_imports_in_import_declaration_are_unused_6192": "Ни один из импортов в объявлении импорта не используется.", - "All_type_parameters_are_unused_6205": "Ни один из параметров типа не используется.", + "All_type_parameters_are_unused_6205": "Все параметры типа не используются", "All_variables_are_unused_6199": "Ни одна переменная не используется.", "Allow_accessing_UMD_globals_from_modules_95076": "Разрешение обращения к глобальным значениям UMD из модулей.", "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Разрешить импорт по умолчанию из модулей без экспорта по умолчанию. Это не повлияет на выведение кода — только на проверку типов.", @@ -193,7 +192,7 @@ "An_export_assignment_cannot_have_modifiers_1120": "Назначение экспорта не может иметь модификаторы.", "An_export_declaration_can_only_be_used_in_a_module_1233": "Объявление экспорта может быть использовано только в модуле.", "An_export_declaration_cannot_have_modifiers_1193": "Объявление экспорта не может иметь модификаторы.", - "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "Выражение типа \"void\" не может быть проверено на истинность.", + "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "Выражение типа \"void\" не может быть проверено на истинность", "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198": "Расширенное escape-значение в Юникоде должно быть в пределах от 0x0 до 0x10FFFF включительно.", "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351": "Идентификатор или ключевое слово не может следовать непосредственно за числовым литералом.", "An_implementation_cannot_be_declared_in_ambient_contexts_1183": "Реализацию невозможно объявить в окружающих контекстах.", @@ -235,7 +234,6 @@ "Argument_expression_expected_1135": "Ожидалось выражение аргумента.", "Argument_for_0_option_must_be_Colon_1_6046": "Аргумент для параметра \"{0}\" должен быть {1}.", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "Аргумент типа \"{0}\" нельзя назначить параметру типа \"{1}\".", - "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "Не указаны аргументы для параметра REST \"{0}\".", "Array_element_destructuring_pattern_expected_1181": "Ожидался шаблон деструктурирования элемента массива.", "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": "Утверждения требуют, чтобы каждое имя в целевом объекте вызова было объявлено с явной заметкой с типом.", "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": "Утверждения требуют, чтобы целевой объект вызова был идентификатором или полным именем.", @@ -261,7 +259,6 @@ "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Сигнатура вызова, у которой нет аннотации типа возвращаемого значения, неявно имеет тип возвращаемого значения any.", "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204": "Сигнатуры вызова без аргументов имеют несовместимые типы возвращаемых значений \"{0}\" и \"{1}\".", "Call_target_does_not_contain_any_signatures_2346": "Объект вызова не содержит сигнатуры.", - "Can_only_convert_logical_AND_access_chains_95142": "Можно преобразовывать только цепочки доступа с логическим И.", "Can_only_convert_property_with_modifier_95137": "Можно только преобразовать свойство с модификатором", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Не удается получить доступ к {0}.{1}, так как {0} является типом, но не является пространством имен. Вы хотели получить тип свойства {1} в {0} с использованием {0}[\"{1}\"]?", "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748": "Не удается обратиться к перечислениям внешних констант, если задан флаг \"--isolatedModules\".", @@ -284,21 +281,20 @@ "Cannot_find_global_value_0_2468": "Не удается найти глобальное значение \"{0}\".", "Cannot_find_lib_definition_for_0_2726": "Не удается найти определение lib для \"{0}\".", "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "Не удается найти определение lib для \"{0}\". Вы имели в виду \"{1}\"?", - "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Не удается найти модуль \"{0}\". Рекомендуется использовать параметр \"--resolveJsonModule\" для импорта модуля с расширением \".json\".", - "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "Не найден модуль \"{0}\". Хотели ли вы задать значение \"node\" для параметра \"moduleResolution\" или добавить псевдонимы в параметр \"paths\"?", + "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Не удается найти модуль \"{0}\". Рекомендуется использовать \"--resolveJsonModule\" для импорта модуля с расширением \".json\".", "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "Не удается найти модуль \"{0}\" или связанные с ним объявления типов.", "Cannot_find_name_0_2304": "Не удается найти имя \"{0}\".", "Cannot_find_name_0_Did_you_mean_1_2552": "Не удается найти имя \"{0}\". Вы имели в виду \"{1}\"?", "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "Не удается найти имя \"{0}\". Возможно, вы имели в виду элемент экземпляра \"this.{0}\"?", "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": "Не удается найти имя \"{0}\". Возможно, вы имели в виду статический элемент \"{1}.{0}\"?", - "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Не удается найти имя \"{0}\". Вы хотите изменить целевую библиотеку? Попробуйте изменить параметр компилятора \"lib\" на \"{1}\" или более поздней версии.", + "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "Не удается найти имя \"{0}\". Вы хотите изменить целевую библиотеку? Попробуйте изменить параметр компилятора \"lib\" на es2015 или более поздней версии.", "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": "Не удается найти имя \"{0}\". Вы хотите изменить целевую библиотеку? Попробуйте изменить параметр компилятора \"lib\", включив \"dom\".", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": "Не удается найти имя \"{0}\". Вы хотите установить определения типов для средства запуска тестов? Попробуйте использовать команды \"npm i --save-dev @types/jest\" или \"npm i --save-dev @types/mocha\".", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": "Не удается найти имя \"{0}\". Вы хотите установить определения типов для средства запуска тестов? Попробуйте использовать команды \"npm i --save-dev @types/jest\" или \"npm i --save-dev @types/mocha\", а затем добавить \"jest\" или \"mocha\" в поле типов в файле tsconfig.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": "Не удается найти имя \"{0}\". Вы хотите установить определения типов для jQuery? Попробуйте использовать команду \"npm i --save-dev @types/jquery\".", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": "Не удается найти имя \"{0}\". Вы хотите установить определения типов для jQuery? Попробуйте использовать команду \"npm i --save-dev @types/jquery\", а затем добавить \"jquery\" в поле типов в файле tsconfig.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": "Не удается найти имя \"{0}\". Вы хотите установить определения типов для узла? Попробуйте использовать команду \"npm i --save-dev @types/node\".", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": "Не удается найти имя \"{0}\". Вы хотите установить определения типов для узла? Попробуйте использовать команду \"npm i --save-dev @types/node\", а затем добавить \"node\" в поле типов в файле tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582": "Не удается найти имя \"{0}\". Вы хотите установить определения типов для средства запуска тестов? Попробуйте использовать \"npm i @types/jest\" или \"npm i @types/mocha\".", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593": "Не удается найти имя \"{0}\". Вы хотите установить определения типов для средства запуска тестов? Попробуйте использовать \"npm i @types/jest\" или \"npm i @types/mocha\", а затем добавить \"jest\" или \"mocha\" в поле типов в файле tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581": "Не удается найти имя \"{0}\". Вы хотите установить определения типов для jQuery? Попробуйте использовать \"npm i @types/jquery\".", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592": "Не удается найти имя \"{0}\". Вы хотите установить определения типов для jQuery? Попробуйте использовать \"npm i @types/jquery\" и затем добавить \"jquery\" в поле типов в файле tsconfig.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580": "Не удается найти имя \"{0}\". Вы хотите установить определения типов для узла? Попробуйте использовать \"npm i @types/node\".", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591": "Не удается найти имя \"{0}\". Вы хотите установить определения типов для узла? Попробуйте использовать \"npm i @types/node\" и затем добавить \"node\" в поле типов в файле tsconfig.", "Cannot_find_namespace_0_2503": "Не удается найти пространство имен \"{0}\".", "Cannot_find_parameter_0_1225": "Не удается найти параметр \"{0}\".", "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": "Не удается найти общий путь к подкаталогу для входных файлов.", @@ -369,13 +365,10 @@ "Constructor_implementation_is_missing_2390": "Отсутствует реализация конструктора.", "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673": "Конструктор класса \"{0}\" является частным и доступным только в объявлении класса.", "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "Конструктор класса \"{0}\" защищен и доступен только в объявлении класса.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386": "При использовании в типе объединения нотация типа конструктора должна быть заключена в круглые скобки.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388": "При использовании в типе пересечения нотация типа конструктора должна быть заключена в круглые скобки.", "Constructors_for_derived_classes_must_contain_a_super_call_2377": "Конструкторы производных классов должны содержать вызов super.", "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Содержащий файл не указан, корневой каталог невозможно определить. Выполняется пропуск поиска в папке node_modules.", "Containing_function_is_not_an_arrow_function_95128": "Содержащая функция не является стрелочной", "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": "Преобразование типа \"{0}\" в тип \"{1}\" может привести к ошибке, так как ни один из типов не перекрывается с другим в достаточной степени. Если это сделано намеренно, сначала преобразуйте выражение в \"unknown\".", - "Convert_0_to_1_in_0_95003": "Преобразовать \"{0}\" в \"{1} в {0}\"", "Convert_0_to_mapped_object_type_95055": "Преобразовать \"{0}\" в тип сопоставленного объекта", "Convert_all_constructor_functions_to_classes_95045": "Преобразовать все функции конструктора в классы", "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374": "Преобразовать все импорты, не используемые в качестве значения, в импорты, затрагивающие только тип", @@ -385,7 +378,6 @@ "Convert_all_to_async_functions_95066": "Преобразовать все в асинхронные функции", "Convert_all_to_bigint_numeric_literals_95092": "Преобразовать все в числовые литералы типа bigint", "Convert_all_to_default_imports_95035": "Преобразовать все в импорт по умолчанию", - "Convert_all_type_literals_to_mapped_type_95021": "Преобразовать все литералы типов в сопоставленный тип", "Convert_arrow_function_or_function_expression_95122": "Преобразовать стрелочную функцию или выражение функции", "Convert_const_to_let_95093": "Преобразовать \"const\" в \"let\"", "Convert_default_export_to_named_export_95061": "Преобразовать экспорт по умолчанию в именованный экспорт", @@ -407,17 +399,14 @@ "Convert_to_async_function_95065": "Преобразовать в асинхронную функцию", "Convert_to_default_import_95013": "Преобразовать в импорт по умолчанию", "Convert_to_named_function_95124": "Преобразовать в именованную функцию", - "Convert_to_optional_chain_expression_95139": "Преобразовать в необязательное выражение цепочки", "Convert_to_template_string_95096": "Преобразовать в строку шаблона", "Convert_to_type_only_export_1364": "Преобразовать в экспорт, распространяющийся только на тип", "Convert_to_type_only_import_1373": "Преобразовать в импорт, распространяющийся только на тип", "Corrupted_locale_file_0_6051": "Поврежденный файл языкового стандарта \"{0}\".", "Could_not_find_a_containing_arrow_function_95127": "Не удалось найти содержащую стрелочную функцию", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "Не удалось найти файл объявления модуля \"{0}\". \"{1}\" имеет неявный тип \"any\".", - "Could_not_find_convertible_access_expression_95140": "Не удалось найти преобразуемое выражение доступа.", "Could_not_find_export_statement_95129": "Не удалось найти инструкцию экспорта.", "Could_not_find_import_clause_95131": "Не удалось найти предложение импорта.", - "Could_not_find_matching_access_expressions_95141": "Не удалось найти соответствующие выражения доступа.", "Could_not_find_namespace_import_or_named_imports_95132": "Не удалось найти импорт пространства имен или именованные импорты.", "Could_not_find_property_for_which_to_generate_accessor_95135": "Не удалось найти свойство, для которого создается метод доступа.", "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231": "Не удалось разрешить путь \"{0}\" с расширениями: {1}.", @@ -429,8 +418,6 @@ "Declaration_expected_1146": "Ожидалось объявление.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Имя объявления конфликтует со встроенным глобальным идентификатором \"{0}\".", "Declaration_or_statement_expected_1128": "Ожидалось объявление или оператор.", - "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": "Объявления с определенными утверждениями присваивания также должны иметь заметки типов.", - "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": "Объявления с инициализаторами не могут также иметь определенные утверждения присваивания.", "Declare_a_private_field_named_0_90053": "Объявите закрытое поле с именем \"{0}\".", "Declare_method_0_90023": "Объявите метод \"{0}\"", "Declare_private_method_0_90038": "Объявление закрытого метода \"{0}\"", @@ -441,6 +428,7 @@ "Decorators_are_not_valid_here_1206": "Декораторы здесь недопустимы.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Декораторы нельзя применять к множественным методам доступа get или set с совпадающим именем.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Экспорт модуля по умолчанию использует или имеет закрытое имя \"{0}\".", + "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258": "Определенные утверждения присваивания можно использовать только вместе с заметкой с типом.", "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": "Определения следующих идентификаторов конфликтуют с определениями в другом файле: {0}", "Delete_all_unused_declarations_95024": "Удалить все неиспользуемые объявления", "Delete_the_outputs_of_all_projects_6365": "Удалить выходные данные всех проектов", @@ -458,7 +446,6 @@ "Digit_expected_1124": "Ожидалась цифра.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "Каталога \"{0}\" не существует. Поиск в нем будет пропускаться.", "Disable_checking_for_this_file_90018": "Отключите проверку для этого файла", - "Disable_loading_referenced_projects_6235": "Отключите загрузку проектов, на которые имеются ссылки.", "Disable_size_limitations_on_JavaScript_projects_6162": "Отключение ограничений на размеры в проектах JavaScript.", "Disable_solution_searching_for_this_project_6224": "Отключите поиск решений для этого проекта.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Отключить строгую проверку универсальных сигнатур в типах функций.", @@ -490,7 +477,7 @@ "Duplicate_number_index_signature_2375": "Повторяющаяся сигнатура числового индекса.", "Duplicate_property_0_2718": "Повторяющееся свойство \"{0}\".", "Duplicate_string_index_signature_2374": "Повторяющаяся сигнатура строкового индекса.", - "Dynamic_import_cannot_have_type_arguments_1326": "При динамическом импорте не могут использоваться аргументы типов.", + "Dynamic_import_cannot_have_type_arguments_1326": "При динамическом импорте не могут использоваться аргументы типов", "Dynamic_import_must_have_one_specifier_as_an_argument_1324": "При динамическом импорте необходимо указать один описатель в качестве аргумента.", "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "Описатель динамического импорта должен иметь тип \"string\", но имеет тип \"{0}\".", "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323": "Динамические импорты поддерживаются только в том случае, если флаг \"--module\" имеет значение \"es2020\", \"esnext\", \"commonjs\", \"amd\", \"system\" или \"umd\".", @@ -532,7 +519,6 @@ "Excessive_stack_depth_comparing_types_0_and_1_2321": "Чрезмерная глубина стека при сравнении типов \"{0}\" и \"{1}\".", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "Ожидается аргументов типа: {0}–{1}. Укажите их с тегом \"@extends\".", "Expected_0_arguments_but_got_1_2554": "Ожидалось аргументов: {0}, получено: {1}.", - "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "Ожидаемое число аргументов — {0}, фактическое — {1}. Возможно, вы забыли указать void в аргументе типа в Promise?", "Expected_0_arguments_but_got_1_or_more_2556": "Ожидалось аргументов: {0}, получено: {1} или больше.", "Expected_0_type_arguments_but_got_1_2558": "Ожидались аргументы типа {0}, получены: {1}.", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Ожидается аргументов типа: {0}. Укажите их с тегом \"@extends\".", @@ -610,14 +596,11 @@ "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366": "В функции отсутствует завершающий оператор return, а тип возвращаемого значения не включает \"undefined\".", "Function_overload_must_be_static_2387": "Перегрузка функции должна быть статической.", "Function_overload_must_not_be_static_2388": "Перегрузка функции не должна быть статической.", - "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385": "При использовании в типе объединения нотация типа функции должна быть заключена в круглые скобки.", - "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387": "При использовании в типе пересечения нотация типа функции должна быть заключена в круглые скобки.", "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014": "Тип функции, у которого нет заметки с типом возвращаемого значения, неявно имеет тип возвращаемого значения \"{0}\".", "Generate_get_and_set_accessors_95046": "Создать методы доступа get и set", "Generate_get_and_set_accessors_for_all_overriding_properties_95119": "Создать методы доступа get и set для всех переопределяемых свойств", "Generates_a_CPU_profile_6223": "Создает профиль ЦП.", "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": "Создает сопоставитель с исходным кодом для каждого соответствующего файла \".d.ts\".", - "Generates_an_event_trace_and_a_list_of_types_6237": "Создает трассировку событий и список типов.", "Generates_corresponding_d_ts_file_6002": "Создает соответствующий D.TS-файл.", "Generates_corresponding_map_file_6043": "Создает соответствующий файл с расширением \".map\".", "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025": "Генератор неявно имеет тип yield \"{0}\", так как он не предоставляет никаких значений. Рекомендуется указать заметку с типом возвращаемого значения.", @@ -662,7 +645,6 @@ "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "Во внешних объявлениях перечислений инициализатор элемента должен быть константным выражением.", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "В перечислении с несколькими объявлениями только одно объявление может опустить инициализатор для своего первого элемента перечисления.", "Include_modules_imported_with_json_extension_6197": "Включать модули, импортированные с расширением .json", - "Include_undefined_in_index_signature_results_6800": "Включить undefined в результаты сигнатуры индекса", "Index_signature_in_type_0_only_permits_reading_2542": "Сигнатура индекса в типе \"{0}\" разрешает только чтение.", "Index_signature_is_missing_in_type_0_2329": "В типе \"{0}\" отсутствует сигнатура индекса.", "Index_signatures_are_incompatible_2330": "Сигнатуры индекса несовместимы.", @@ -694,7 +676,6 @@ "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Недопустимое значение для jsxFactory. \"{0}\" не является допустимым идентификатором или полным именем.", "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": "Недопустимое значение \"jsxFragmentFactory\". \"{0}\" не является допустимым идентификатором или полным именем.", "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Недопустимое значение для \"--reactNamespace\". \"{0}\" не является допустимым идентификатором.", - "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": "Вероятно, не хватает запятой, разделяющей эти два выражения шаблона. Они формируют выражение шаблона с тегами, которое не может быть вызвано.", "Its_element_type_0_is_not_a_valid_JSX_element_2789": "Тип элемента \"{0}\" не является допустимым элементом JSX.", "Its_instance_type_0_is_not_a_valid_JSX_element_2788": "Тип экземпляра \"{0}\" не является допустимым элементом JSX.", "Its_return_type_0_is_not_a_valid_JSX_element_2787": "Тип возвращаемого значения \"{0}\" не является допустимым элементом JSX.", @@ -759,6 +740,7 @@ "Module_0_has_no_default_export_1192": "У модуля \"{0}\" нет экспорта по умолчанию.", "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": "В модуле \"{0}\" нет экспорта по умолчанию. Возможно, вы хотели вместо этого использовать \"import { {1} } from {0}\"?", "Module_0_has_no_exported_member_1_2305": "Модуль \"{0}\" не имеет экспортированного элемента \"{1}\".", + "Module_0_has_no_exported_member_1_Did_you_mean_2_2724": "В модуле \"{0}\" нет экспортированного элемента \"{1}\". Вы имели в виду \"{2}\"?", "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": "В модуле \"{0}\" нет экспортированного члена \"{1}\". Возможно, вы хотели вместо этого использовать \"import {1} from {0}\"?", "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": "Модуль \"{0}\" скрыт локальным объявлением с таким же именем.", "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "Модуль \"{0}\" использует параметр \"export =\" и не может использоваться с параметром \"export *\".", @@ -794,7 +776,6 @@ "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": "Класс \"{0}\", не являющийся абстрактным, не реализует наследуемый абстрактный элемент \"{1}\" класса \"{2}\".", "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "Выражение неабстрактного класса не реализует унаследованный абстрактный элемент \"{0}\" класса \"{1}\".", "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": "Утверждения, отличные от NULL, можно использовать только в файлах TypeScript.", - "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090": "Неотносительные пути не допускаются, если не задано значение параметра baseUrl. Вы забыли указать начальные символы \"./\"?", "Non_simple_parameter_declared_here_1348": "Здесь объявлен не простой параметр.", "Not_all_code_paths_return_a_value_7030": "Не все пути к коду возвращают значение.", "Not_all_constituents_of_type_0_are_callable_2756": "Не все составляющие типа \"{0}\" можно вызвать.", @@ -830,7 +811,6 @@ "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "Параметр \"{0}\" можно указать только в файле \"tsconfig.json\" либо задать значение \"false\" или \"null\" для этого параметра в командной строке.", "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "Параметр \"{0}\" можно указать только в файле \"tsconfig.json\" либо задать значение \"null\" для этого параметра в командной строке.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "Параметр \"{0}\" можно использовать только при указании \"--inlineSourceMap\" или \"--sourceMap\".", - "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": "Параметр \"{0}\" не может быть указан, если параметр jsx имеет значение \"{1}\".", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "Параметр \"{0}\" не может быть указан, если параметр \"target\" имеет значение \"ES3\".", "Option_0_cannot_be_specified_with_option_1_5053": "Параметр \"{0}\" невозможно указать с помощью параметра \"{1}\".", "Option_0_cannot_be_specified_without_specifying_option_1_5052": "Параметр \"{0}\" невозможно указать без указания параметра \"{1}\".", @@ -839,6 +819,7 @@ "Option_build_must_be_the_first_command_line_argument_6369": "Параметр \"--build\" должен быть первым аргументом командной строки.", "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": "Параметр \"--incremental\" можно указать только с помощью tsconfig, выполнив вывод в отдельный файл, либо когда параметр \"--tsBuildInfoFile\".", "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "Параметр isolatedModules можно использовать, только если указан параметр --module или если параметр target — ES2015 или выше.", + "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "Параметр paths невозможно использовать без указания параметра \"--baseUrl\".", "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "Параметр project не может быть указан вместе с исходными файлами в командной строке.", "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071": "Параметр \"--resolveJsonModule\" можно указывать, только когда для создания кода модуля указано значение \"commonjs\", \"amd\", \"es2015\" или \"esNext\".", "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "Параметр \"--resolveJsonModule\" нельзя указать без стратегии разрешения модуля node.", @@ -891,7 +872,6 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Тип параметра открытого статического метода задания \"{0}\" из экспортированного класса имеет или использует закрытое имя \"{1}\".", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Анализ в строгом режиме и создание директивы \"use strict\" для каждого исходного файла.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "Шаблон \"{0}\" может содержать не больше одного символа \"*\".", - "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": "Временные показатели производительности для параметров \"--diagnostics\" и \"--extendedDiagnostics\" недоступны в этом сеансе. Не удалось найти стандартную реализацию API веб-производительности.", "Prefix_0_with_an_underscore_90025": "Добавьте к \"{0}\" префикс — символ подчеркивания", "Prefix_all_incorrect_property_declarations_with_declare_95095": "Добавить ко всем неправильным объявлениям свойств префикс \"declare\"", "Prefix_all_unused_declarations_with_where_possible_95025": "Добавить префикс \"_\" ко всем неиспользуемым объявлениям, где это возможно", @@ -905,7 +885,7 @@ "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "Закрытые идентификаторы запрещено использовать в объявлениях переменных.", "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "Закрытые идентификаторы запрещено использовать вне тела классов.", "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "Закрытые идентификаторы доступны только при разработке для ECMAScript 2015 или более поздних версий.", - "Private_identifiers_cannot_be_used_as_parameters_18009": "Закрытые идентификаторы не могут использоваться в качестве параметров.", + "Private_identifiers_cannot_be_used_as_parameters_18009": "Закрытые идентификаторы запрещено использовать в качестве параметров", "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "Не удается обратиться к закрытому или защищенному члену \"{0}\" в параметре типа.", "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "Не удается собрать проект \"{0}\", так как его зависимость \"{1}\" содержит ошибки", "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383": "Не удается собрать проект \"{0}\", так как его зависимость \"{1}\" не была собрана", @@ -923,7 +903,6 @@ "Property_0_does_not_exist_on_const_enum_1_2479": "Свойство \"{0}\" не существует в перечислении const \"{1}\".", "Property_0_does_not_exist_on_type_1_2339": "Свойство \"{0}\" не существует в типе \"{1}\".", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "Свойство \"{0}\" не существует в типе \"{1}\". Вы имели в виду \"{2}\"?", - "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": "Свойство \"{0}\" не существует в типе \"{1}\". Вы хотите изменить целевую библиотеку? Попробуйте изменить параметр компилятора \"lib\" на \"{2}\" или более поздней версии.", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "Свойство \"{0}\" не имеет инициализатора, и ему не гарантировано присваивание в конструкторе.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "Свойство \"{0}\" неявно имеет тип \"все\", так как для его метода доступа get не задана заметка с типом возвращаемого значения.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "Свойство \"{0}\" неявно имеет тип \"все\", так как для его метода доступа set не задана заметка с типом параметра.", @@ -932,7 +911,7 @@ "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "Свойство \"{0}\" в типе \"{1}\" невозможно присвоить тому же свойству в базовом типе \"{2}\".", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "Свойство \"{0}\" в типе \"{1}\" не может быть присвоено типу \"{2}\".", "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015": "Свойство \"{0}\" в типе \"{1}\" ссылается на другой член, к которому невозможно обратиться из типа \"{2}\".", - "Property_0_is_a_static_member_of_type_1_2576": "Свойство \"{0}\" является статическим элементом типа \"{1}\".", + "Property_0_is_a_static_member_of_type_1_2576": "Свойство \"{0}\" является членом типа \"{1}\"", "Property_0_is_declared_but_its_value_is_never_read_6138": "Свойство \"{0}\" объявлено, но его значение не было прочитано.", "Property_0_is_incompatible_with_index_signature_2530": "Свойство \"{0}\" несовместимо с сигнатурой индекса.", "Property_0_is_incompatible_with_rest_element_type_2573": "Свойство \"{0}\" несовместимо с типом элементов rest.", @@ -961,7 +940,6 @@ "Property_or_signature_expected_1131": "Ожидалось свойство или сигнатура.", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "Значение свойства может быть только строковым или числовым литералом, True, False, Null, объектным литералом либо литералом массива.", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "Предоставление полной поддержки для итерируемых элементов в for-of, расширение и деструктуризация при выборе целевой платформы ES5 или ES3.", - "Provides_a_root_package_name_when_using_outFile_with_declarations_1390": "Предоставляет имя корневого пакета при использовании outFile с объявлениями.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "Открытый метод \"{0}\" экспортированного класса имеет или использует имя \"{1}\" из внешнего модуля {2}, но не может быть именован.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "Открытый метод \"{0}\" экспортированного класса имеет или использует имя \"{1}\" из закрытого модуля \"{2}\".", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "Открытый метод \"{0}\" экспортированного класса имеет или использует закрытое имя \"{1}\".", @@ -994,8 +972,8 @@ "Remove_unnecessary_await_95086": "Удалить ненужный оператор \"await\"", "Remove_unreachable_code_95050": "Удалить недостижимый код", "Remove_unused_declaration_for_Colon_0_90004": "Удаление неиспользуемого объявления для: \"{0}\"", - "Remove_unused_declarations_for_Colon_0_90041": "Удалить неиспользуемые объявления для: \"{0}\"", - "Remove_unused_destructuring_declaration_90039": "Удалить неиспользуемое объявление деструктурирования", + "Remove_unused_declarations_for_Colon_0_90041": "Удалите неиспользуемые объявления для: \"{0}\"", + "Remove_unused_destructuring_declaration_90039": "Удалите неиспользуемое объявление деструктурирования", "Remove_unused_label_95053": "Удалить неиспользуемую метку", "Remove_variable_statement_90010": "Удалить оператор с переменной", "Replace_0_with_Promise_1_90036": "Замените \"{0}\" на \"Promise<{1}>\"", @@ -1088,7 +1066,6 @@ "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "Укажите окончание последовательности строки для использования при порождении файлов: CRLF (DOS) или LF (UNIX).", "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": "Укажите расположение, в котором отладчик должен найти файлы TypeScript вместо исходных расположений.", "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "Укажите расположение, в котором отладчик должен найти файлы карты, вместо созданных расположений.", - "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": "Укажите спецификатор модуля, который будет использоваться для импорта функций фабрики jsx и jsxs, например react", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Укажите корневой каталог входных файлов. Используйте его для управления структурой выходных каталогов с --outDir.", "Split_all_invalid_type_only_imports_1367": "Разделение всех недопустимых импортов, затрагивающих только тип", "Split_into_two_separate_import_declarations_1366": "Разделение на два отдельных объявления импорта", @@ -1113,7 +1090,7 @@ "Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337": "Вызовы super не разрешены вне конструкторов или во вложенных функциях внутри конструкторов.", "Suppress_excess_property_checks_for_object_literals_6072": "Подавлять избыточные проверки свойств для объектных литералов.", "Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055": "Подавлять ошибки noImplicitAny для объектов индексирования, у которых отсутствуют сигнатуры индекса.", - "Switch_each_misused_0_to_1_95138": "Изменить все неверно используемые \"{0}\" на \"{1}\"", + "Switch_each_misused_0_to_1_95138": "Измените все неверно используемые \"{0}\" на \"{1}\"", "Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "Ссылка Symbol не ссылается на глобальный объект конструктора Symbol.", "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "Синхронно вызывайте обратные вызовы и обновляйте состояние наблюдателей каталогов на платформах, не имеющих собственной поддержки рекурсивного наблюдения.", "Syntax_Colon_0_6023": "Синтаксис: {0}", @@ -1130,8 +1107,6 @@ "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496": "Нельзя ссылаться на объект типа arguments в стрелочной функции ES3 и ES5. Используйте стандартное выражение функции.", "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "На объект arguments невозможно указать ссылку в асинхронной функции или методе в ES3 и ES5. Попробуйте использовать стандартную функцию или метод.", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "Текст оператора if не может быть пустым.", - "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391": "Параметр bundledPackageName должен быть указан при использовании outFile и разрешения модуля узла с порождением объявления.", - "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": "Вызов для этой реализации был выполнен успешно, но сигнатуры реализации перегрузок не видны извне.", "The_character_set_of_the_input_files_6163": "Кодировка входных файлов.", "The_containing_arrow_function_captures_the_global_value_of_this_7041": "Содержащая стрелочная функция фиксирует глобальное значение \"this\".", "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "Содержащая функция или текст модуля слишком велики для анализа потока управления.", @@ -1150,10 +1125,8 @@ "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "Выводимому типу \"{0}\" невозможно присвоить имя без ссылки на \"{1}\". Вероятно, оно не является переносимым. Требуется заметка с типом.", "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "Выводимый тип \"{0}\" ссылается на тип с циклической структурой, которая не может быть элементарно сериализована. Требуется заметка с типом.", "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "Выведенный тип \"{0}\" ссылается на недоступный тип \"{1}\". Требуется аннотация типа.", - "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": "Выведенный тип этого узла превышает максимальную длину, которую будет сериализовывать компилятор. Требуется указать заметку явного типа.", "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": "Пересечение \"{0}\" было сокращено до \"never\", так как свойство \"{1}\" существует в нескольких составляющих и является частным в некоторых из них.", "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": "Пересечение \"{0}\" было сокращено до \"never\", так как свойство \"{1}\" имеет конфликтующие типы в некоторых составляющих.", - "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": "Ключевое слово intrinsic можно использовать только для объявления внутренних типов, предоставляемых компилятором.", "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": "Чтобы использовать фрагменты JSX с параметром компилятора \"jsxFactory\", необходимо указать параметр компилятора \"jsxFragmentFactory\".", "The_last_overload_gave_the_following_error_2770": "Последняя перегрузка возвратила следующую ошибку.", "The_last_overload_is_declared_here_2771": "Здесь объявлена последняя перегрузка.", @@ -1230,7 +1203,7 @@ "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Объявления верхнего уровня в файлах .d.ts должны начинаться с модификатора \"declare\" или \"export\".", "Trailing_comma_not_allowed_1009": "Завершающая запятая запрещена.", "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "Транскомпиляция каждого файла как отдельного модуля (аналогично ts.transpileModule).", - "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "Попробуйте использовать команду \"npm i --save-dev @types/{1}\", если он существует, или добавьте новый файл объявления (.d.ts), содержащий \"declare module '{0}';\".", + "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035": "Попробуйте использовать \"npm install @types/{1}\", если он существует, или добавьте новый файл объявления (.d.ts), содержащий \"declare module '{0}';\".", "Trying_other_entries_in_rootDirs_6110": "Попытка использовать другие записи в \"rootDirs\".", "Trying_substitution_0_candidate_module_location_Colon_1_6093": "Выполняется попытка замены \"{0}\", расположение модуля кандидата: \"{1}\".", "Tuple_members_must_all_have_names_or_all_not_have_names_5084": "Имена должны быть заданы для всех членов кортежа или не должны быть заданы ни для одного из членов кортежа.", @@ -1305,7 +1278,6 @@ "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": "======== Директива ссылки на тип \"{0}\" успешно разрешена в \"{1}\", первичный объект: {2}. ========", "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": "======== Директива ссылки на тип \"{0}\" успешно разрешена в \"{1}\" с идентификатором пакета \"{2}\", первичный объект: {3}. ========", "Types_have_separate_declarations_of_a_private_property_0_2442": "Типы имеют раздельные объявления закрытого свойства \"{0}\".", - "Types_of_construct_signatures_are_incompatible_2419": "Типы сигнатур конструкций несовместимы.", "Types_of_parameters_0_and_1_are_incompatible_2328": "Типы параметров \"{0}\" и \"{1}\" несовместимы.", "Types_of_property_0_are_incompatible_2326": "Типы свойства \"{0}\" несовместимы.", "Unable_to_open_file_0_6050": "Не удается открыть файл \"{0}\".", @@ -1378,7 +1350,6 @@ "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": "Для импорта \"{0}\" необходимо использовать вызов \"require\" или импорт по умолчанию.", "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": "Для импорта \"{0}\" необходимо использовать \"import {1} = require({2})\" или импорт по умолчанию.", "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": "Для импорта \"{0}\" необходимо использовать \"import {1} = require({2})\" или установить флаг \"esModuleInterop\" и использовать импорт по умолчанию.", - "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208": "\"{0}\" не может быть скомпилирован с параметром \"--isolatedModules\", так как он считается глобальным файлом сценария. Добавьте оператор для импорта, экспорта или пустой оператор \"export {}\", чтобы сделать его модулем.", "_0_cannot_be_used_as_a_JSX_component_2786": "\"{0}\" невозможно использовать как компонент JSX.", "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": "\"{0}\" невозможно использовать как значение, так как он был экспортирован с помощью \"export type\".", "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": "\"{0}\" невозможно использовать как значение, так как он был импортирован с помощью \"import type\".", @@ -1386,7 +1357,6 @@ "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": "Возможно создание экземпляра \"{0}\" с произвольным типом, который может быть не связан с \"{1}\".", "_0_declarations_can_only_be_used_in_TypeScript_files_8006": "Объявления \"{0}\" можно использовать только в файлах TypeScript.", "_0_expected_1005": "Ожидалось \"{0}\".", - "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": "В \"{0}\" нет экспортированного элемента \"{1}\". Вы имели в виду \"{2}\"?", "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": "\"{0}\" неявно имеет тип возвращаемого значения \"{1}\", но из использования можно определить более подходящий тип.", "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": "\"{0}\" неявно имеет тип возвращаемого значения any, так как у него нет заметки с типом возвращаемого значения, а также на него прямо или косвенно указана ссылка в одном из его выражений return.", "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": "\"{0}\" неявно имеет тип any, так как отсутствует аннотация типа и на \"{0}\" есть прямые или непрямые ссылки в его собственном инициализаторе.", @@ -1399,29 +1369,27 @@ "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "\"{0}\" определен как метод доступа в классе \"{1}\", но переопределяется здесь в \"{2}\" как свойство экземпляра.", "_0_is_deprecated_6385": "\"{0}\" устарел.", "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "\"{0}\" не является допустимым метасвойством для ключевого слова \"{1}\". Вы имели в виду \"{2}\"?", - "_0_is_not_allowed_as_a_variable_declaration_name_1389": "Использование \"{0}\" в качестве имени объявления переменной не допускается.", "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "На \"{0}\" есть прямые или непрямые ссылки в его собственном базовом выражении.", "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "На \"{0}\" есть прямые или непрямые ссылки в его собственной аннотации типа.", "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": "\"{0}\" указан несколько раз, поэтому такое использование будет перезаписано.", "_0_list_cannot_be_empty_1097": "Список \"{0}\" не может быть пустым.", "_0_modifier_already_seen_1030": "Модификатор \"{0}\" уже встречался.", + "_0_modifier_cannot_appear_on_a_class_element_1031": "Модификатор \"{0}\" не может использоваться в элементе класса.", "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": "Модификатор \"{0}\" не может содержаться в объявлении конструктора.", "_0_modifier_cannot_appear_on_a_data_property_1043": "Модификатор \"{0}\" не может содержаться в свойстве данных.", "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": "Модификатор \"{0}\" не может отображаться в модуле или элементе пространства имен.", "_0_modifier_cannot_appear_on_a_parameter_1090": "Модификатор \"{0}\" не может содержаться в параметре.", "_0_modifier_cannot_appear_on_a_type_member_1070": "Модификатор \"{0}\" не может отображаться в элементе типа.", "_0_modifier_cannot_appear_on_an_index_signature_1071": "Модификатор \"{0}\" не может отображаться в сигнатуре индекса.", - "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": "Модификатор \"{0}\" не может использоваться для элементов класса этого типа.", "_0_modifier_cannot_be_used_here_1042": "Модификатор \"{0}\" не может использоваться здесь.", "_0_modifier_cannot_be_used_in_an_ambient_context_1040": "Модификатор \"{0}\" не может использоваться в окружающем контексте.", "_0_modifier_cannot_be_used_with_1_modifier_1243": "Модификатор \"{0}\" не может использоваться с модификатором \"{1}\".", "_0_modifier_cannot_be_used_with_a_class_declaration_1041": "Модификатор \"{0}\" не может использоваться с объявлением класса.", - "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "Модификатор \"{0}\" не может использоваться с закрытым идентификатором.", + "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "Модификатор \"{0}\" запрещено использовать с закрытым идентификатором.", "_0_modifier_must_precede_1_modifier_1029": "Модификатор \"{0}\" должен предшествовать модификатору \"{1}\".", "_0_needs_an_explicit_type_annotation_2782": "Для \"{0}\" требуется явная заметка с типом.", "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": "\"{0}\" относится только к типу, а здесь используется как пространство имен.", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "\"{0}\" относится только к типу, но используется здесь как значение.", - "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": "\"{0}\" относится только к типу, но используется здесь как значение. Вы хотели использовать \"{1} в {0}\"?", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "\"{0}\" относится только к типу, но здесь используется как значение. Вы хотите изменить целевую библиотеку? Попробуйте изменить параметр компилятора \"lib\" на es2015 или более поздней версии.", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "\"{0}\" ссылается на глобальную переменную UMD, но текущий файл является модулем. Рекомендуется добавить импорт.", "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "\"{0}\" относится к значению, но здесь используется как тип. Возможно, вы имели в виду \"typeof {0}\"?", @@ -1458,7 +1426,6 @@ "extends_clause_already_seen_1172": "Предложение extends уже существует.", "extends_clause_must_precede_implements_clause_1173": "Предложение extends должно предшествовать предложению implements.", "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "Предложение extends экспортированного класса \"{0}\" имеет или использует закрытое имя \"{1}\".", - "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "Предложение extends экспортированного класса имеет или использует закрытое имя \"{0}\".", "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "Предложение extends экспортированного интерфейса \"{0}\" имеет или использует закрытое имя \"{1}\".", "file_6025": "файл", "get_and_set_accessor_must_have_the_same_this_type_2682": "Методы доступа \"get\" и \"set\" должны иметь одинаковый тип \"this\".", diff --git a/node_modules/typescript/lib/tr/diagnosticMessages.generated.json b/node_modules/typescript/lib/tr/diagnosticMessages.generated.json index 5d5c6a8..9eeeb4d 100644 --- a/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +++ b/node_modules/typescript/lib/tr/diagnosticMessages.generated.json @@ -151,8 +151,6 @@ "Add_undefined_type_to_property_0_95018": "'{0}' özelliğine 'undefined' türünü ekle", "Add_unknown_conversion_for_non_overlapping_types_95069": "Çakışmayan türler için 'unknown' dönüştürmesi ekleyin", "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": "Çakışmayan türlerin tüm dönüştürmelerine 'unknown' ekleyin", - "Add_void_to_Promise_resolved_without_a_value_95143": "Değer olmadan çözümlenen Promise'e 'void' ekle", - "Add_void_to_all_Promises_resolved_without_a_value_95144": "Değer olmadan çözümlenen tüm Promise'lere 'void' ekle", "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Bir tsconfig.json dosyası eklemek, hem TypeScript hem de JavaScript dosyaları içeren projeleri düzenlemenize yardımcı olur. Daha fazla bilgi edinmek için bkz. https://aka.ms/tsconfig.", "Additional_Checks_6176": "Ek Denetimler", "Advanced_Options_6178": "Gelişmiş Seçenekler", @@ -160,8 +158,9 @@ "All_declarations_of_0_must_have_identical_type_parameters_2428": "Tüm '{0}' bildirimleri özdeş tür parametrelerine sahip olmalıdır.", "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Soyut metoda ait tüm bildirimler ardışık olmalıdır.", "All_destructured_elements_are_unused_6198": "Yapısı bozulan öğelerin hiçbiri kullanılmıyor.", + "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208": "'--isolatedModules' bayrağı sağlandığında tüm dosyalar modül olmalıdır.", "All_imports_in_import_declaration_are_unused_6192": "İçeri aktarma bildirimindeki hiçbir içeri aktarma kullanılmadı.", - "All_type_parameters_are_unused_6205": "Tüm tür parametreleri kullanılmıyor.", + "All_type_parameters_are_unused_6205": "Tüm tür parametreleri kullanılmıyor", "All_variables_are_unused_6199": "Hiçbir değişken kullanılmıyor.", "Allow_accessing_UMD_globals_from_modules_95076": "Modüllerden UMD genel değişkenlerine erişmeye izin verin.", "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Varsayılan dışarı aktarmaya sahip olmayan modüllerde varsayılan içeri aktarmalara izin verin. Bu işlem kod üretimini etkilemez, yalnızca tür denetimini etkiler.", @@ -193,7 +192,7 @@ "An_export_assignment_cannot_have_modifiers_1120": "Dışarı aktarma ataması, değiştiricilere sahip olamaz.", "An_export_declaration_can_only_be_used_in_a_module_1233": "Dışarı aktarma bildirimi yalnızca bir modülde kullanılabilir.", "An_export_declaration_cannot_have_modifiers_1193": "Dışarı aktarma bildirimi, değiştiricilere sahip olamaz.", - "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "'void' türünde bir ifade doğruluk bakımından test edilemiyor.", + "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "'void' türünde bir ifade doğruluk için test edilemiyor", "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198": "Genişletilmiş Unicode kaçış değeri, 0x0 ve 0x10FFFF dahil olmak üzere bu değerler arasında olmalıdır.", "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351": "Tanımlayıcı veya anahtar sözcük, sayısal bir sabit değerden hemen sonra gelemez.", "An_implementation_cannot_be_declared_in_ambient_contexts_1183": "Uygulama, çevresel bağlamda bildirilemez.", @@ -235,7 +234,6 @@ "Argument_expression_expected_1135": "Bağımsız değişken ifadesi bekleniyor.", "Argument_for_0_option_must_be_Colon_1_6046": "'{0}' seçeneğinin bağımsız değişkeni {1} olmalıdır.", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "'{0}' türündeki bağımsız değişken '{1}' türündeki parametreye atanamaz.", - "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "'{0}' rest parametresinin bağımsız değişkenleri sağlanmadı.", "Array_element_destructuring_pattern_expected_1181": "Dizi öğesi yok etme deseni bekleniyor.", "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": "Onaylamalar, çağrı hedefindeki her adın açık bir tür ek açıklaması ile bildirilmesini gerektirir.", "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": "Onaylamalar, çağrı hedefinin bir tanımlayıcı veya tam ad olmasını gerektirir.", @@ -261,7 +259,6 @@ "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Dönüş türü ek açıklaması bulunmayan çağrı imzası, örtük olarak 'any' dönüş türüne sahip.", "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204": "Bağımsız değişken içermeyen çağrı imzaları uyumsuz '{0}' ve '{1}' dönüş türlerine sahip.", "Call_target_does_not_contain_any_signatures_2346": "Çağrı hedefi imza içermiyor.", - "Can_only_convert_logical_AND_access_chains_95142": "Yalnızca mantıksal zincirler VE erişim zincirleri dönüştürülebilir", "Can_only_convert_property_with_modifier_95137": "Yalnızca değiştirici içeren özellik dönüştürülebilir", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "'{0}' bir ad alanı değil tür olduğundan '{0}.{1}' erişimi sağlanamıyor. '{0}[\"{1}\"]' değerini belirterek '{0}' içindeki '{1}' özelliğinin türünü almak mı istediniz?", "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748": "'--isolatedModules' bayrağı sağlandığında çevresel const sabit listelerine erişilemiyor.", @@ -284,21 +281,20 @@ "Cannot_find_global_value_0_2468": "'{0}' genel değeri bulunamıyor.", "Cannot_find_lib_definition_for_0_2726": "'{0}' için kitaplık tanımı bulunamıyor.", "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "'{0}' için kitaplık tanımı bulunamıyor. Şunu mu demek istediniz: '{1}'?", - "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "'{0}' modülü bulunamıyor. Modülü '.json' uzantısıyla içeri aktarmak için '--resolveJsonModule' kullanmayı deneyin.", - "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "'{0}' modülü bulunamıyor. 'moduleResolution' seçeneğini 'node' olarak ayarlamak veya 'paths' seçeneğine diğer adlar eklemek mi istediniz?", + "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "'{0}' modülü bulunamıyor. Modülü '.json' uzantısıyla içeri aktarmak için '--resolveJsonModule' kullanmayı deneyin", "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "'{0}' modülü veya karşılık gelen tür bildirimleri bulunamıyor.", "Cannot_find_name_0_2304": "'{0}' adı bulunamıyor.", "Cannot_find_name_0_Did_you_mean_1_2552": "'{0}' adı bulunamıyor. Bunu mu demek istediniz: '{1}'?", "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "'{0}' adı bulunamıyor. 'this.{0}' örnek üyesini mi aradınız?", "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": "'{0}' adı bulunamıyor. '{1}.{0}' statik üyesini mi aradınız?", - "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "'{0}' adı bulunamıyor. Hedef kitaplığınızı değiştirmeniz mi gerekiyor? `lib` derleyici seçeneğini '{1}' veya üzeri olarak değiştirmeyi deneyin.", + "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "'{0}' adı bulunamıyor. Hedef kitaplığınızı değiştirmeniz gerekiyor mu? `lib` derleyici seçeneğini es2015 veya üzeri olarak değiştirmeyi deneyin.", "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": "'{0}' adı bulunamıyor. Hedef kitaplığınızı değiştirmeniz gerekiyor mu? `lib` derleyici seçeneğini 'dom' içerecek şekilde değiştirmeyi deneyin.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": "'{0}' adı bulunamıyor. Test Runner için tür tanımlarını yüklemeniz mi gerekiyor? Şunları deneyin: `npm i --save-dev @types/jest` veya `npm i --save-dev @types/mocha`.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": "'{0}' adı bulunamıyor. Test Runner için tür tanımlarını yüklemeniz mi gerekiyor? Şunları deneyin: `npm i --save-dev @types/jest` veya `npm i --save-dev @types/mocha`. Ardından tsconfig dosyanızdaki types alanına `jest` veya `mocha` ekleyin.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": "'{0}' adı bulunamıyor. jQuery için tür tanımlarını yüklemeniz mi gerekiyor? Şunu deneyin: `npm i --save-dev @types/jquery`.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": "'{0}' adı bulunamıyor. jQuery için tür tanımlarını yüklemeniz mi gerekiyor? Şunu deneyin: `npm i --save-dev @types/jquery`. Ardından tsconfig dosyanızdaki types alanına `jquery` ekleyin.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": "'{0}' adı bulunamıyor. Düğüm için tür tanımlarını yüklemeniz mi gerekiyor? Şunu deneyin: `npm i --save-dev @types/node`.", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": "'{0}' adı bulunamıyor. Düğüm için tür tanımlarını yüklemeniz mi gerekiyor? Şunu deneyin: `npm i --save-dev @types/node`. Ardından tsconfig dosyanızdaki types alanına `node` ekleyin.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582": "'{0}' adı bulunamıyor. Test Runner için tür tanımlarını yüklemeniz gerekiyor mu? Şunları deneyin: `npm i @types/jest` veya `npm i @types/mocha`.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593": "'{0}' adı bulunamıyor. Test Runner için tür tanımlarını yüklemeniz gerekiyor mu? Şunları deneyin: `npm i @types/jest` veya `npm i @types/mocha`. Ardından tsconfig dosyanızdaki türler alanına `jest` veya `mocha` ekleyin.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581": "'{0}' adı bulunamıyor. JQuery için tür tanımlarını yüklemeniz gerekiyor mu? Şunu deneyin: `npm i @types/jquery`.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592": "'{0}' adı bulunamıyor. JQuery için tür tanımlarını yüklemeniz gerekiyor mu? Şunu deneyin: `npm i @types/jquery`. Ardından tsconfig dosyanızdaki türler alanına `jquery` öğesini ekleyin.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580": "'{0}' adı bulunamıyor. Düğüm için tür tanımlarını yüklemeniz gerekiyor mu? Şunu deneyin: `npm i @types/node`.", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591": "'{0}' adı bulunamıyor. Düğüm için tür tanımlarını yüklemeniz gerekiyor mu? Şunu deneyin: `npm i @types/node`. Ardından tsconfig dosyanızdaki türler alanına `node` ekleyin.", "Cannot_find_namespace_0_2503": "'{0}' ad alanı bulunamıyor.", "Cannot_find_parameter_0_1225": "'{0}' parametresi bulunamıyor.", "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": "Giriş dosyalarına ait ortak alt dizin yolu bulunamıyor.", @@ -369,13 +365,10 @@ "Constructor_implementation_is_missing_2390": "Oluşturucu uygulaması yok.", "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673": "'{0}' sınıfının oluşturucusu özel olduğundan, oluşturucuya yalnızca sınıf bildiriminden erişilebilir.", "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "'{0}' sınıfının oluşturucusu korumalı olduğundan, oluşturucuya yalnızca sınıf bildiriminden erişilebilir.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386": "Oluşturucu türü gösterimi bir birleşim türünde kullanıldığında parantez içine alınmalıdır.", - "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388": "Oluşturucu türü gösterimi bir kesişim türünde kullanıldığında parantez içine alınmalıdır.", "Constructors_for_derived_classes_must_contain_a_super_call_2377": "Türetilmiş sınıflara ilişkin oluşturucular bir 'super' çağrısı içermelidir.", "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Kapsayıcı dosya belirtilmedi ve kök dizini belirlenemiyor; 'node_modules' klasöründe arama atlanıyor.", "Containing_function_is_not_an_arrow_function_95128": "İçeren işlev bir ok işlevi değil", "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": "Türler birbiriyle yeterince örtüşmediğinden '{0}' türünün '{1}' türüne dönüştürülmesi bir hata olabilir. Bu bilerek yapıldıysa, ifadeyi önce 'unknown' değerine dönüştürün.", - "Convert_0_to_1_in_0_95003": "'{0}' öğesini '{0} içinde {1}' öğesine dönüştür", "Convert_0_to_mapped_object_type_95055": "'{0}' öğesini eşlenen nesne türüne dönüştür", "Convert_all_constructor_functions_to_classes_95045": "Tüm oluşturucu işlevleri sınıflara dönüştür", "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374": "Bir değer olarak kullanılmayan tüm içeri aktarmaları yalnızca tür içeri aktarmalarına dönüştürün", @@ -385,7 +378,6 @@ "Convert_all_to_async_functions_95066": "Tümünü asenkron işlevlere dönüştürün", "Convert_all_to_bigint_numeric_literals_95092": "Tümünü büyük tamsayı sayısal sabit değerlerine dönüştürün", "Convert_all_to_default_imports_95035": "Tümünü varsayılan içeri aktarmalara dönüştür", - "Convert_all_type_literals_to_mapped_type_95021": "Tüm tür sabit değerlerini eşlenmiş türe dönüştür", "Convert_arrow_function_or_function_expression_95122": "Ok işlevini veya işlev ifadesini dönüştür", "Convert_const_to_let_95093": "'const' ifadesini 'let' ifadesine dönüştürün", "Convert_default_export_to_named_export_95061": "Varsayılan dışarı aktarmayı adlandırılmış dışarı aktarmaya dönüştürün", @@ -407,17 +399,14 @@ "Convert_to_async_function_95065": "Asenkron işleve dönüştürün", "Convert_to_default_import_95013": "Varsayılan içeri aktarmaya dönüştür", "Convert_to_named_function_95124": "Adlandırılmış işleve dönüştür", - "Convert_to_optional_chain_expression_95139": "İsteğe bağlı zincir ifadesine dönüştür", "Convert_to_template_string_95096": "Şablon dizesine dönüştürün", "Convert_to_type_only_export_1364": "Yalnızca tür dışarı aktarmaya dönüştürün", "Convert_to_type_only_import_1373": "Yalnızca tür içeri aktarmaya dönüştürün", "Corrupted_locale_file_0_6051": "{0} yerel ayar dosyası bozuk.", "Could_not_find_a_containing_arrow_function_95127": "İçeren bir ok işlevi bulunamadı", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "'{0}' modülü için bildirim dosyası bulunamadı. '{1}' örtülü olarak 'any' türüne sahip.", - "Could_not_find_convertible_access_expression_95140": "Dönüştürülebilir erişim ifadesi bulunamadı", "Could_not_find_export_statement_95129": "Dışarı aktarma ifadesi bulunamadı", "Could_not_find_import_clause_95131": "İçeri aktarma yan tümcesi bulunamadı", - "Could_not_find_matching_access_expressions_95141": "Eşleşen erişim ifadeleri bulunamadı", "Could_not_find_namespace_import_or_named_imports_95132": "Ad alanı içeri aktarması veya adlandırılmış içeri aktarmalar bulunamadı", "Could_not_find_property_for_which_to_generate_accessor_95135": "Erişimcinin oluşturulacağı özellik bulunamadı", "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231": "Uzantılara sahip '{0}' yolu çözümlenemedi: {1}.", @@ -429,8 +418,6 @@ "Declaration_expected_1146": "Bildirim bekleniyor.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Bildirim adı, yerleşik genel tanımlayıcı '{0}' ile çakışıyor.", "Declaration_or_statement_expected_1128": "Bildirim veya deyim bekleniyor.", - "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": "Kesin atama onaylamaları olan bildirimlerde tür ek açıklamaları da olmalıdır.", - "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": "Başlatıcılara sahip bildirimlerde kesin atama onaylamaları olamaz.", "Declare_a_private_field_named_0_90053": "'{0}' adlı bir özel alan bildirin.", "Declare_method_0_90023": "'{0}' metodunu bildir", "Declare_private_method_0_90038": "'{0}' özel metodunu bildirin.", @@ -441,6 +428,7 @@ "Decorators_are_not_valid_here_1206": "Buradaki dekoratörler geçerli değil.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Dekoratörler aynı ada sahip birden fazla get/set erişimcisine uygulanamaz.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Modülün varsayılan dışarı aktarımı '{0}' özel adına sahip veya bu adı kullanıyor.", + "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258": "Belirli atama onaylamaları yalnızca bir tür ek açıklaması ile birlikte kullanılabilir.", "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": "Şu tanımlayıcıların tanımları başka bir dosyadaki tanımlarla çakışıyor: {0}", "Delete_all_unused_declarations_95024": "Kullanılmayan tüm bildirimleri sil", "Delete_the_outputs_of_all_projects_6365": "Tüm projelerin çıkışlarını sil", @@ -458,7 +446,6 @@ "Digit_expected_1124": "Rakam bekleniyor.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "'{0}' dizini yok, içindeki tüm aramalar atlanıyor.", "Disable_checking_for_this_file_90018": "Bu dosya için denetimi devre dışı bırak", - "Disable_loading_referenced_projects_6235": "Başvurulan projelerin yüklenmesini devre dışı bırakın.", "Disable_size_limitations_on_JavaScript_projects_6162": "JavaScript projelerinde boyut sınırlamalarını devre dışı bırakın.", "Disable_solution_searching_for_this_project_6224": "Bu proje için çözüm aramayı devre dışı bırakın.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "İşlev türlerinde genel imzalar için katı denetimi devre dışı bırakın.", @@ -490,7 +477,7 @@ "Duplicate_number_index_signature_2375": "Dizin imzasında yinelenen numara.", "Duplicate_property_0_2718": "'{0}' özelliğini yineleyin.", "Duplicate_string_index_signature_2374": "Dizin imzasında yinelenen dize.", - "Dynamic_import_cannot_have_type_arguments_1326": "Dinamik içeri aktarma, tür bağımsız değişkenleri içeremez.", + "Dynamic_import_cannot_have_type_arguments_1326": "Dinamik içeri aktarma, tür bağımsız değişkenleri içeremez", "Dynamic_import_must_have_one_specifier_as_an_argument_1324": "Dinamik içeri aktarma, bağımsız değişken olarak bir tanımlayıcı içermelidir.", "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "Dinamik içeri aktarmanın tanımlayıcısı 'string' türünde olmalıdır, ancak buradaki tür: '{0}'.", "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323": "Dinamik içeri aktarmalar yalnızca '--module' bayrağı 'es2020', 'esnext', 'commonjs', 'amd', 'system' veya 'umd' olarak ayarlandığında desteklenir.", @@ -532,7 +519,6 @@ "Excessive_stack_depth_comparing_types_0_and_1_2321": "Aşırı yığın derinliği, '{0}' ve '{1}' türlerini karşılaştırıyor.", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "{0}-{1} tür bağımsız değişkeni bekleniyordu; bunları bir '@extends' etiketiyle sağlayın.", "Expected_0_arguments_but_got_1_2554": "{0} bağımsız değişken bekleniyordu ancak {1} alındı.", - "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "{0} bağımsız değişken bekleniyordu ancak {1} bağımsız değişken alındı. Tür bağımsız değişkeninizdeki 'void' operatörünü 'Promise'e eklemeyi mi unuttunuz?", "Expected_0_arguments_but_got_1_or_more_2556": "{0} bağımsız değişken bekleniyordu ancak {1} veya daha fazla bağımsız değişken alındı.", "Expected_0_type_arguments_but_got_1_2558": "{0} tür bağımsız değişkeni bekleniyordu ancak {1} alındı.", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "{0} tür bağımsız değişkeni bekleniyordu; bunları bir '@extends' etiketiyle sağlayın.", @@ -610,14 +596,11 @@ "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366": "İşlevin sonunda return deyimi eksik ve dönüş türü 'undefined' içermiyor.", "Function_overload_must_be_static_2387": "İşlev aşırı yüklemesi statik olmalıdır.", "Function_overload_must_not_be_static_2388": "İşlev aşırı yüklemesi statik olmamalıdır.", - "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385": "İşlev türü gösterimi bir birleşim türünde kullanıldığında parantez içine alınmalıdır.", - "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387": "İşlev türü gösterimi bir kesişim türünde kullanıldığında parantez içine alınmalıdır.", "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014": "Dönüş türü ek açıklaması bulunmayan işlev türü, örtük olarak '{0}' dönüş türüne sahip.", "Generate_get_and_set_accessors_95046": "'get' ve 'set' erişimcilerini oluşturun", "Generate_get_and_set_accessors_for_all_overriding_properties_95119": "Tüm geçersiz kılma özellikleri için 'get' ve 'set' erişimcileri oluşturun", "Generates_a_CPU_profile_6223": "Bir CPU profili oluşturur.", "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": "Karşılık gelen her '.d.ts' dosyası için bir kaynak eşlemesi oluşturur.", - "Generates_an_event_trace_and_a_list_of_types_6237": "Olay izleme ve tür listesi oluşturur.", "Generates_corresponding_d_ts_file_6002": "İlgili '.d.ts' dosyasını oluşturur.", "Generates_corresponding_map_file_6043": "İlgili '.map' dosyasını oluşturur.", "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025": "Oluşturucu herhangi bir değer sağlamadığından örtük olarak '{0}' türüne sahip. Bir dönüş türü ek açıklaması sağlamayı deneyin.", @@ -662,7 +645,6 @@ "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "Çevresel sabit listesi bildirimlerinde, üye başlatıcısı sabit ifade olmalıdır.", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "Birden fazla bildirime sahip sabit listesinde yalnızca bir bildirim ilk sabit listesi öğesine ait başlatıcıyı atlayabilir.", "Include_modules_imported_with_json_extension_6197": "'.json' uzantısıyla içeri aktarılan modülleri dahil et", - "Include_undefined_in_index_signature_results_6800": "Dizin imzası sonuçlarına 'undefined' öğesini ekle", "Index_signature_in_type_0_only_permits_reading_2542": "'{0}' türündeki dizin imzası yalnızca okumaya izin veriyor.", "Index_signature_is_missing_in_type_0_2329": "'{0}' türündeki dizin imzası yok.", "Index_signatures_are_incompatible_2330": "Dizin imzaları uyumsuz.", @@ -694,7 +676,6 @@ "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "'jsxFactory' değeri geçersiz. '{0}' geçerli bir tanımlayıcı veya tam ad değil.", "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": "'jsxFragmentFactory' değeri geçersiz. '{0}' geçerli bir tanımlayıcı veya tam ad değil.", "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "'--reactNamespace' için geçersiz değer. '{0}' geçerli bir tanımlayıcı değil.", - "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": "Bu iki şablon ifadesini ayırmak için virgül koymamış olabilirsiniz. Bu ifadeler, çağrılamayacak etiketli bir şablon ifadesi oluşturur.", "Its_element_type_0_is_not_a_valid_JSX_element_2789": "'{0}' öğe türü geçerli bir JSX öğesi değil.", "Its_instance_type_0_is_not_a_valid_JSX_element_2788": "'{0}' örnek türü geçerli bir JSX öğesi değil.", "Its_return_type_0_is_not_a_valid_JSX_element_2787": "'{0}' dönüş türü geçerli bir JSX öğesi değil.", @@ -759,6 +740,7 @@ "Module_0_has_no_default_export_1192": "'{0}' modülü için varsayılan dışarı aktarma yok.", "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": "'{0}' modülünün varsayılan dışarı aktarması yok. Bunun yerine 'import { {1} } from {0}' kullanmak mı istediniz?", "Module_0_has_no_exported_member_1_2305": "'{0}' modülü, dışarı aktarılan '{1}' üyesine sahip değil.", + "Module_0_has_no_exported_member_1_Did_you_mean_2_2724": "{0}' modülünün dışarı aktarılan '{1}' adlı bir üyesi yok. Şunu mu demek istediniz: '{2}'?", "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": "'{0}' modülünün dışarı aktarılmış '{1}' üyesi yok. Bunun yerine 'import {1} from {0}' kullanmak mı istediniz?", "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": "'{0}' modülü, aynı ada sahip bir yerel bildirim tarafından gizleniyor.", "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "'{0}' modülü 'export =' kullanıyor ve 'export *' ile birlikte kullanılamaz.", @@ -794,7 +776,6 @@ "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": "Soyut olmayan '{0}' sınıfı, '{2}' sınıfından devralınan '{1}' soyut üyesini uygulamıyor.", "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "Soyut olmayan sınıf ifadesi, '{1}' sınıfından devralınan '{0}' soyut üyesini uygulamıyor.", "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": "Null olmayan onaylamalar yalnızca TypeScript dosyalarında kullanılabilir.", - "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090": "'baseUrl' ayarlanmadığında göreli olmayan yollara izin verilmez. Başına './' koymayı deneyin", "Non_simple_parameter_declared_here_1348": "Basit olmayan parametre burada bildirildi.", "Not_all_code_paths_return_a_value_7030": "Tüm kod yolları bir değer döndürmez.", "Not_all_constituents_of_type_0_are_callable_2756": "'{0}' türündeki tüm bileşenler çağrılabilir değil.", @@ -830,7 +811,6 @@ "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "'{0}' seçeneği, yalnızca 'tsconfig.json' dosyasında belirtilebilir veya komut satırında 'false' veya 'null' olarak ayarlanabilir.", "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "'{0}' seçeneği, yalnızca 'tsconfig.json' dosyasında belirtilebilir veya komut satırında 'null' olarak ayarlanabilir.", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "'{0} seçeneği yalnızca '--inlineSourceMap' veya '--sourceMap' seçeneği sağlandığında kullanılabilir.", - "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": "'jsx' seçeneği '{1}' olduğunda '{0}' seçeneği belirtilemez.", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "'target' seçeneği 'ES3' olduğunda '{0}' seçeneği belirtilemiyor.", "Option_0_cannot_be_specified_with_option_1_5053": "'{0}' seçeneği, '{1}' seçeneği ile belirtilemez.", "Option_0_cannot_be_specified_without_specifying_option_1_5052": "'{0}' seçeneği, '{1}' seçeneği belirtilmeden belirtilemez.", @@ -839,6 +819,7 @@ "Option_build_must_be_the_first_command_line_argument_6369": "'--build' seçeneği ilk komut satırı bağımsız değişkeni olmalıdır.", "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": "'--incremental' seçeneği yalnızca tsconfig kullanılarak, tek dosyada gösterilerek veya `--tsBuildInfoFile` seçeneği sağlandığında belirtilebilir.", "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "'isolatedModules' seçeneği, yalnızca '--module' sağlandığında veya 'target' seçeneği 'ES2015' veya daha yüksek bir sürüm değerine sahip olduğunda kullanılabilir.", + "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "'Paths' seçeneği, '--baseUrl' seçeneği belirtilmeden kullanılamaz.", "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "'project' seçeneği, komut satırındaki kaynak dosyalarıyla karıştırılamaz.", "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071": "'--resolveJsonModule' seçeneği yalnızca modül kodu oluşturma 'commonjs', 'amd', 'es2015' veya 'esNext' olduğunda belirtilebilir.", "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "'node' modül çözümleme stratejisi olmadan '--resolveJsonModule' seçeneği belirtilemez.", @@ -891,7 +872,6 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Dışarı aktarılan sınıftaki genel statik ayarlayıcı '{0}' için parametre türü, '{1}' özel adına sahip veya bu adı kullanıyor.", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Katı modda ayrıştırın ve her kaynak dosya için \"use strict\" kullanın.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "'{0}' deseni en fazla bir adet '*' karakteri içerebilir.", - "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": "'--diagnostics' veya '--extendedDiagnostics' için performans zamanlamaları bu oturumda kullanılamaz. Web performans API'sinin yerel bir uygulaması bulunamadı.", "Prefix_0_with_an_underscore_90025": "'{0}' için ön ek olarak alt çizgi kullan", "Prefix_all_incorrect_property_declarations_with_declare_95095": "Hatalı tüm özellik bildirimlerinin başına 'declare' ekleyin", "Prefix_all_unused_declarations_with_where_possible_95025": "Mümkün olduğunda tüm kullanılmayan bildirimlerin başına '_' ekle", @@ -905,7 +885,7 @@ "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "Değişken bildirimlerinde özel tanımlayıcılara izin verilmiyor.", "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "Sınıf gövdelerinin dışında özel tanımlayıcılara izin verilmiyor.", "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "Özel tanımlayıcılar yalnızca ECMAScript 2015 veya üzeri hedeflenirken kullanılabilir.", - "Private_identifiers_cannot_be_used_as_parameters_18009": "Özel tanımlayıcılar parametre olarak kullanılamaz.", + "Private_identifiers_cannot_be_used_as_parameters_18009": "Özel tanımlayıcılar parametre olarak kullanılamaz", "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "Özel veya korumalı '{0}' üyesine bir tür parametresinde erişilemiyor.", "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "'{0}' projesinin '{1}' bağımlılığında hatalar olduğundan proje derlenemiyor", "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383": "'{0}' projesinin '{1}' bağımlılığı derlenmediğinden proje derlenemiyor", @@ -923,7 +903,6 @@ "Property_0_does_not_exist_on_const_enum_1_2479": "'{0}' özelliği, '{1}' 'const' sabit listesi üzerinde değil.", "Property_0_does_not_exist_on_type_1_2339": "'{0}' özelliği, '{1}' türünde değil.", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "'{0}' özelliği '{1}' türünde yok. Bunu mu demek istediniz: '{2}'?", - "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": "'{0}' özelliği '{1}' türünde yok. Hedef kitaplığınızı değiştirmeniz mi gerekiyor? `lib` derleyici seçeneğini '{2}' veya üzeri olarak değiştirmeyi deneyin.", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "'{0}' özelliği başlatıcı içermiyor ve oluşturucuda kesin olarak atanmamış.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "'{0}' özelliği, get erişimcisinin dönüş türü ek açıklaması olmadığı için örtük olarak 'any' türü içeriyor.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "'{0}' özelliği, set erişimcisinin parametre türü ek açıklaması olmadığı için örtük olarak 'any' türü içeriyor.", @@ -932,7 +911,7 @@ "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "'{1}' türündeki '{0}' özelliği, '{2}' temel türündeki aynı özelliğe atanamaz.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "'{1}' türündeki '{0}' özelliği, '{2}' türüne atanamaz.", "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015": "'{1}' türündeki '{0}' özelliği, '{2}' türünün içinden erişilemeyen farklı bir üyeye başvuruyor.", - "Property_0_is_a_static_member_of_type_1_2576": "'{0}' özelliği, '{1}' türünde statik bir üye.", + "Property_0_is_a_static_member_of_type_1_2576": "'{0}' özelliği, '{1}' türünde statik bir üye", "Property_0_is_declared_but_its_value_is_never_read_6138": "'{0}' özelliği bildirildi ancak değeri hiç okunmadı.", "Property_0_is_incompatible_with_index_signature_2530": "'{0}' özelliği, dizin imzasıyla uyumsuz.", "Property_0_is_incompatible_with_rest_element_type_2573": "'{0}' özelliği REST öğesi türüyle uyumsuz.", @@ -961,7 +940,6 @@ "Property_or_signature_expected_1131": "Özellik veya imza bekleniyor.", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "Özellik değeri yalnızca, dize sabit değeri, sayısal sabit değer, 'true', 'false', 'null', nesne sabit değeri veya dizi sabit değeri olabilir.", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "'ES5' veya 'ES3' hedefleniyorsa, 'for-of' içindeki yinelenebilir öğeler için yayılma ve yok etmeye yönelik tam destek sağlayın.", - "Provides_a_root_package_name_when_using_outFile_with_declarations_1390": "Bildirimler ile outFile kullanılırken bir kök paketi adı sağlar.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "Dışarı aktarılan sınıfın '{0}' genel metodu, {2} dış modülündeki '{1}' adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "Dışarı aktarılan sınıfın '{0}' genel metodu, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "Dışarı aktarılan sınıfın '{0}' genel metodu, '{1}' özel adına sahip veya bu adı kullanıyor.", @@ -1088,7 +1066,6 @@ "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "Dosyalar gösterilirken kullanılacak satır sonu dizisini belirtin: 'CRLF' (dos) veya 'LF' (unix).", "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": "Hata ayıklayıcının TypeScript dosyalarını kaynak konumlar yerine nerede bulması gerektiğini belirtin.", "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "Hata ayıklayıcının, eşlem dosyalarını üretilen konumlar yerine nerede bulması gerektiğini belirtin.", - "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": "`jsx` ve `jsxs` fabrika işlevlerini içeri aktarmak için kullanılacak modül tanımlayıcısını (ör. react) belirtin.", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Giriş dosyalarının kök dizinini belirtin. Çıkış dizininin yapısını --outDir ile denetlemek için kullanın.", "Split_all_invalid_type_only_imports_1367": "Geçersiz tüm yalnızca tür içeri aktarmalarını bölün", "Split_into_two_separate_import_declarations_1366": "İki ayrı içeri aktarma bildirimine bölün", @@ -1130,8 +1107,6 @@ "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496": "ES3 ve ES5'te bulunan bir ok işlevinde 'arguments' nesnesine başvuru yapılamaz. Standart bir işlev ifadesi kullanmayı göz önünde bulundurun.", "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "ES3 ve ES5'te 'arguments' nesnesine zaman uyumsuz bir işlev veya metot içinde başvurulamaz. Standart bir işlev veya metot kullanmayı düşünün.", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "'if' deyiminin gövdesi boş deyim olamaz.", - "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391": "Bildirim gösterimi ile outFile ve düğüm modülü çözümlemesi kullanılırken `bundledPackageName` seçeneği belirtilmelidir.", - "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": "Çağrı, bu uygulamada başarılı olabilirdi, ancak aşırı yüklemelerin uygulama imzaları dışarıdan görünmüyor.", "The_character_set_of_the_input_files_6163": "Giriş dosyalarının karakter kümesi.", "The_containing_arrow_function_captures_the_global_value_of_this_7041": "Kapsayıcı ok işlevi, 'this' öğesinin genel değerini yakalar.", "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "İçeren işlev veya modül gövdesi, denetim akışı analizi için çok büyük.", @@ -1150,10 +1125,8 @@ "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "'{0}' öğesinin çıkarsanan türü, '{1}' başvurusu olmadan adlandırılamaz. Bu büyük olasılıkla taşınabilir değildir. Tür ek açıklaması gereklidir.", "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "Çıkarsanan '{0}' türü, önemsiz olarak seri hale getirilemeyen döngüsel yapıya sahip bir türe başvurur. Tür ek açıklaması gerekir.", "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "Çıkarsanan '{0}' türü, erişilemeyen bir '{1}' türüne başvuruyor. Tür ek açıklaması gereklidir.", - "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": "Bu düğümün çıkarsanan türü, derleyicinin seri hale getireceği maksimum uzunluğu aşıyor. Açık tür ek açıklaması gerekiyor.", "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": "'{1}' özelliği birden çok destekçide bulunduğundan ve bazılarında özel olduğundan, '{0}' kesişimi 'never' değerine düşürüldü.", "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": "'{1}' özelliği bazı bileşenlerde çakışan türlere sahip olduğundan '{0}' kesişimi 'never' değerine düşürüldü.", - "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": "'intrinsic' anahtar sözcüğü, yalnızca derleyicinin sağladığı iç türleri bildirmek için kullanılabilir.", "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": "JSX parçalarının 'jsxFactory' derleyici seçeneği ile kullanılabilmesi için 'jsxFragmentFactory' derleme seçeneği belirtilmelidir.", "The_last_overload_gave_the_following_error_2770": "Son aşırı yükleme aşağıdaki hatayı verdi.", "The_last_overload_is_declared_here_2771": "Son aşırı yükleme burada bildirilir.", @@ -1230,7 +1203,7 @@ "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts dosyalarındaki üst düzey bildirimler bir 'declare' veya 'export' değiştiricisi ile başlamalıdır.", "Trailing_comma_not_allowed_1009": "Sona eklenen virgüle izin verilmez.", "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "Her dosyayı ayrı bir modül olarak derleyin ('ts.transpileModule' gibi).", - "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "Varsa `npm i --save-dev @types/{1}` deneyin veya `declare module '{0}';` deyimini içeren yeni bir bildirim (.d.ts) dosyası ekleyin", + "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035": "Varsa `npm install @types/{1}` deneyin veya `declare module '{0}';` öğesini içeren yeni bir bildirim (.d.ts) dosyası ekleyin", "Trying_other_entries_in_rootDirs_6110": "'rootDirs' içindeki diğer girişler deneniyor.", "Trying_substitution_0_candidate_module_location_Colon_1_6093": "'{0}' alternatifi deneniyor, aday modül konumu: '{1}'.", "Tuple_members_must_all_have_names_or_all_not_have_names_5084": "Tüm demet üyelerinin adı olmalı veya hiçbirinin adı olmamalıdır.", @@ -1305,7 +1278,6 @@ "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": "======== '{0}' tür başvuru yönergesi '{1}' olarak başarıyla çözümlendi, birincil: {2}. ========", "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": "======== '{0}' tür başvuru yönergesi '{2}' Paket Kimliğine sahip '{1}' olarak başarıyla çözümlendi, birincil: {3}. ========", "Types_have_separate_declarations_of_a_private_property_0_2442": "Türler, '{0}' özel özelliğinin ayrı bildirimlerine sahip.", - "Types_of_construct_signatures_are_incompatible_2419": "Yapı imzalarının türleri uyumsuz.", "Types_of_parameters_0_and_1_are_incompatible_2328": "'{0}' ve '{1}' parametre türleri uyumsuz.", "Types_of_property_0_are_incompatible_2326": "'{0}' özellik türleri uyumsuz.", "Unable_to_open_file_0_6050": "'{0}' dosyası açılamıyor.", @@ -1378,7 +1350,6 @@ "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": "'{0}' yalnızca 'require' çağrısı veya varsayılan içeri aktarma kullanılarak içeri aktarılabilir.", "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": "'{0}' yalnızca 'import {1} = require({2})' veya varsayılan içeri aktarma kullanılarak içeri aktarılabilir.", "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": "'{0}' yalnızca 'import {1} = require({2})' kullanılarak veya 'esModuleInterop' bayrağı etkinleştirilip varsayılan içeri aktarma kullanılarak içeri aktarılabilir.", - "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208": "'{0}', genel betik dosyası olarak kabul edildiğinden '--isolatedModules' altında derlenemiyor. Bunu bir modül haline getirmek için içeri aktarma, dışarı aktarma veya boş 'export {}' deyimi ekleyin.", "_0_cannot_be_used_as_a_JSX_component_2786": "'{0}', JSX bileşeni olarak kullanılamaz.", "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": "'{0}', 'export type' kullanılarak dışarı aktarıldığından değer olarak kullanılamaz.", "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": "'{0}', 'import type' kullanılarak içeri aktarıldığından değer olarak kullanılamaz.", @@ -1386,7 +1357,6 @@ "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": "'{0}' örneği, '{1}' ile ilişkili olmayan rastgele bir türle oluşturulabilir.", "_0_declarations_can_only_be_used_in_TypeScript_files_8006": "'{0}' bildirimleri yalnızca TypeScript dosyalarında kullanılabilir.", "_0_expected_1005": "'{0}' bekleniyor.", - "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": "'{0}' öğesinin dışarı aktarılan '{1}' adlı bir üyesi yok. '{2}' demek mi istediniz?", "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": "'{0}' örtük olarak bir '{1}' dönüş türüne sahip ancak kullanımdan daha iyi bir tür çıkarsanabilir.", "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": "Dönüş türü ek açıklamasına sahip olmadığından ve doğrudan veya dolaylı olarak dönüş ifadelerinden birinde kendine başvurulduğundan, '{0}' öğesi örtük olarak 'any' türüne sahip.", "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": "Bir tür ek açıklamasına sahip olmadığından ve kendi başlatıcısında doğrudan veya dolaylı olarak başvurulduğundan, '{0}' öğesi örtük olarak 'any' türüne sahip.", @@ -1399,29 +1369,27 @@ "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "'{0}', '{1}' sınıfında bir erişimci olarak tanımlandı ancak burada, '{2}' içinde örnek özelliği olarak geçersiz kılındı.", "_0_is_deprecated_6385": "'{0}' kullanım dışı bırakıldı", "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "'{0}', '{1}' anahtar sözcüğü için geçerli bir meta özellik değil. Bunu mu demek istediniz: '{2}'?", - "_0_is_not_allowed_as_a_variable_declaration_name_1389": "'{0}' öğesinin değişken bildirim adı olarak kullanılmasına izin verilmiyor.", "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "'{0}' öğesine kendi temel ifadesinde doğrudan veya dolaylı olarak başvuruluyor.", "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "'{0}' öğesine kendi tür ek açıklamasında doğrudan veya dolaylı olarak başvuruluyor.", "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": "'{0}' birden çok kez belirtildiğinden bu kullanımın üzerine yazılacak.", "_0_list_cannot_be_empty_1097": "'{0}' listesi boş olamaz.", "_0_modifier_already_seen_1030": "'{0}' değiştiricisi zaten görüldü.", + "_0_modifier_cannot_appear_on_a_class_element_1031": "'{0}' değiştiricisi bir sınıf öğesinde görüntülenemez.", "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": "'{0}' değiştiricisi bir oluşturucu bildiriminde görüntülenemez.", "_0_modifier_cannot_appear_on_a_data_property_1043": "'{0}' değiştiricisi bir veri özelliğinde görüntülenemez.", "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": "'{0}' değiştiricisi, bir modülde veya ad alanı öğesinde görünemez.", "_0_modifier_cannot_appear_on_a_parameter_1090": "'{0}' değiştiricisi bir parametrede görüntülenemez.", "_0_modifier_cannot_appear_on_a_type_member_1070": "'{0}' değiştiricisi, bir tür üyesinde görünemez.", "_0_modifier_cannot_appear_on_an_index_signature_1071": "'{0}' değiştiricisi, bir dizin imzasında görünemez.", - "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": "'{0}' değiştiricisi bu tip sınıf öğelerinde görünemez.", "_0_modifier_cannot_be_used_here_1042": "'{0}' değiştiricisi burada kullanılamaz.", "_0_modifier_cannot_be_used_in_an_ambient_context_1040": "'{0}' değiştiricisi bir çevresel bağlamda kullanılamaz.", "_0_modifier_cannot_be_used_with_1_modifier_1243": "'{0}' değiştiricisi, '{1}' değiştiricisi ile birlikte kullanılamaz.", "_0_modifier_cannot_be_used_with_a_class_declaration_1041": "'{0}' değiştiricisi bir sınıf bildirimiyle birlikte kullanılamaz.", - "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "'{0}' değiştiricisi özel bir tanımlayıcıyla birlikte kullanılamaz.", + "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "'{0}' değiştiricisi özel bir tanımlayıcıyla birlikte kullanılamaz", "_0_modifier_must_precede_1_modifier_1029": "'{0}' değiştiricisi, '{1}' değiştiricisinden önce gelmelidir.", "_0_needs_an_explicit_type_annotation_2782": "'{0}' açık bir tür ek açıklamasına ihtiyaç duyuyor.", "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": "'{0}' yalnızca bir türe başvuruyor, ancak burada bir ad alanı olarak kullanılıyor.", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "'{0}' yalnızca bir türe başvuruyor, ancak burada bir değer olarak kullanılıyor.", - "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": "'{0}' yalnızca bir türe başvuruyor, ancak burada bir değer olarak kullanılıyor. '{0}' içinde '{1}' kullanmak mı istediniz?", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "'{0}' yalnızca bir türe başvuruyor ancak burada bir değer olarak kullanılıyor. Hedef kitaplığınızı değiştirmeniz gerekiyor mu? `lib` derleyici seçeneğini es2015 veya üzeri olarak değiştirmeyi deneyin.", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "'{0}' bir UMD genel öğesine başvuruyor, ancak geçerli dosya bir modül. Bunun yerine bir içeri aktarma eklemeyi deneyin.", "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "'{0}' bir değere başvuruyor ancak burada tür olarak kullanılıyor. 'typeof {0}' kullanmak mı istediniz?", @@ -1458,7 +1426,6 @@ "extends_clause_already_seen_1172": "'extends' yan tümcesi zaten görüldü.", "extends_clause_must_precede_implements_clause_1173": "'extends' yan tümcesi, 'implements' yan tümcesinden önce gelmelidir.", "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "Dışarı aktarılan '{0}' sınıfının 'extends' yan tümcesi, '{1}' özel adına sahip veya bu adı kullanıyor.", - "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "Dışarı aktarılan sınıfın 'extends' yan tümcesi, '{0}' özel adına sahip veya bu adı kullanıyor.", "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "Dışarı aktarılan '{0}' arabiriminin 'extends' yan tümcesi, '{1}' özel adına sahip veya bu adı kullanıyor.", "file_6025": "dosya", "get_and_set_accessor_must_have_the_same_this_type_2682": "'get' ve 'set' erişimcisi aynı 'this' türüne sahip olmalıdır.", diff --git a/node_modules/typescript/lib/tsc.js b/node_modules/typescript/lib/tsc.js index aa044c8..25cb130 100644 --- a/node_modules/typescript/lib/tsc.js +++ b/node_modules/typescript/lib/tsc.js @@ -66,8 +66,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }; var ts; (function (ts) { - ts.versionMajorMinor = "4.1"; - ts.version = "4.1.3"; + ts.versionMajorMinor = "4.0"; + ts.version = "4.0.2"; var NativeCollections; (function (NativeCollections) { function tryGetNativeMap() { @@ -1016,7 +1016,7 @@ var ts; var high = array.length - 1; while (low <= high) { var middle = low + ((high - low) >> 1); - var midKey = keySelector(array[middle], middle); + var midKey = keySelector(array[middle]); switch (keyComparer(midKey, key)) { case -1: low = middle + 1; @@ -1096,14 +1096,15 @@ var ts; return values; } ts.getOwnValues = getOwnValues; - var _entries = Object.entries || (function (obj) { + var _entries = Object.entries ? Object.entries : function (obj) { var keys = getOwnKeys(obj); var result = Array(keys.length); - for (var i = 0; i < keys.length; i++) { - result[i] = [keys[i], obj[keys[i]]]; + for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { + var key = keys_1[_i]; + result.push([key, obj[key]]); } return result; - }); + }; function getEntries(obj) { return obj ? _entries(obj) : []; } @@ -1801,25 +1802,20 @@ var ts; } } } - function padLeft(s, length, padString) { - if (padString === void 0) { padString = " "; } - return length <= s.length ? s : padString.repeat(length - s.length) + s; + function padLeft(s, length) { + while (s.length < length) { + s = " " + s; + } + return s; } ts.padLeft = padLeft; - function padRight(s, length, padString) { - if (padString === void 0) { padString = " "; } - return length <= s.length ? s : s + padString.repeat(length - s.length); + function padRight(s, length) { + while (s.length < length) { + s = s + " "; + } + return s; } ts.padRight = padRight; - function takeWhile(array, predicate) { - var len = array.length; - var index = 0; - while (index < len && predicate(array[index])) { - index++; - } - return array.slice(0, index); - } - ts.takeWhile = takeWhile; })(ts || (ts = {})); var ts; (function (ts) { @@ -2113,10 +2109,6 @@ var ts; return formatEnum(flags, ts.ObjectFlags, true); } Debug.formatObjectFlags = formatObjectFlags; - function formatFlowFlags(flags) { - return formatEnum(flags, ts.FlowFlags, true); - } - Debug.formatFlowFlags = formatFlowFlags; var isDebugInfoEnabled = false; var extendedDebugModule; function extendedDebug() { @@ -2134,149 +2126,27 @@ var ts; return extendedDebug().formatControlFlowGraph(flowNode); } Debug.formatControlFlowGraph = formatControlFlowGraph; - var flowNodeProto; - function attachFlowNodeDebugInfoWorker(flowNode) { - if (!("__debugFlowFlags" in flowNode)) { - Object.defineProperties(flowNode, { - __tsDebuggerDisplay: { - value: function () { - var flowHeader = this.flags & 2 ? "FlowStart" : - this.flags & 4 ? "FlowBranchLabel" : - this.flags & 8 ? "FlowLoopLabel" : - this.flags & 16 ? "FlowAssignment" : - this.flags & 32 ? "FlowTrueCondition" : - this.flags & 64 ? "FlowFalseCondition" : - this.flags & 128 ? "FlowSwitchClause" : - this.flags & 256 ? "FlowArrayMutation" : - this.flags & 512 ? "FlowCall" : - this.flags & 1024 ? "FlowReduceLabel" : - this.flags & 1 ? "FlowUnreachable" : - "UnknownFlow"; - var remainingFlags = this.flags & ~(2048 - 1); - return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : ""); - } - }, - __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, true); } }, - __debugToString: { value: function () { return formatControlFlowGraph(this); } } - }); - } - } function attachFlowNodeDebugInfo(flowNode) { if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - if (!flowNodeProto) { - flowNodeProto = Object.create(Object.prototype); - attachFlowNodeDebugInfoWorker(flowNodeProto); - } - Object.setPrototypeOf(flowNode, flowNodeProto); - } - else { - attachFlowNodeDebugInfoWorker(flowNode); + if (!("__debugFlowFlags" in flowNode)) { + Object.defineProperties(flowNode, { + __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, true); } }, + __debugToString: { value: function () { return formatControlFlowGraph(this); } } + }); } } } Debug.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo; - var nodeArrayProto; - function attachNodeArrayDebugInfoWorker(array) { - if (!("__tsDebuggerDisplay" in array)) { - Object.defineProperties(array, { - __tsDebuggerDisplay: { - value: function (defaultValue) { - defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]"); - return "NodeArray " + defaultValue; - } - } - }); - } - } - function attachNodeArrayDebugInfo(array) { - if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - if (!nodeArrayProto) { - nodeArrayProto = Object.create(Array.prototype); - attachNodeArrayDebugInfoWorker(nodeArrayProto); - } - Object.setPrototypeOf(array, nodeArrayProto); - } - else { - attachNodeArrayDebugInfoWorker(array); - } - } - } - Debug.attachNodeArrayDebugInfo = attachNodeArrayDebugInfo; function enableDebugInfo() { if (isDebugInfoEnabled) return; - var weakTypeTextMap; - var weakNodeTextMap; - function getWeakTypeTextMap() { - if (weakTypeTextMap === undefined) { - if (typeof WeakMap === "function") - weakTypeTextMap = new WeakMap(); - } - return weakTypeTextMap; - } - function getWeakNodeTextMap() { - if (weakNodeTextMap === undefined) { - if (typeof WeakMap === "function") - weakNodeTextMap = new WeakMap(); - } - return weakNodeTextMap; - } Object.defineProperties(ts.objectAllocator.getSymbolConstructor().prototype, { - __tsDebuggerDisplay: { - value: function () { - var symbolHeader = this.flags & 33554432 ? "TransientSymbol" : - "Symbol"; - var remainingSymbolFlags = this.flags & ~33554432; - return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : ""); - } - }, __debugFlags: { get: function () { return formatSymbolFlags(this.flags); } } }); Object.defineProperties(ts.objectAllocator.getTypeConstructor().prototype, { - __tsDebuggerDisplay: { - value: function () { - var typeHeader = this.flags & 98304 ? "NullableType" : - this.flags & 384 ? "LiteralType " + JSON.stringify(this.value) : - this.flags & 2048 ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" : - this.flags & 8192 ? "UniqueESSymbolType" : - this.flags & 32 ? "EnumType" : - this.flags & 67359327 ? "IntrinsicType " + this.intrinsicName : - this.flags & 1048576 ? "UnionType" : - this.flags & 2097152 ? "IntersectionType" : - this.flags & 4194304 ? "IndexType" : - this.flags & 8388608 ? "IndexedAccessType" : - this.flags & 16777216 ? "ConditionalType" : - this.flags & 33554432 ? "SubstitutionType" : - this.flags & 262144 ? "TypeParameter" : - this.flags & 524288 ? - this.objectFlags & 3 ? "InterfaceType" : - this.objectFlags & 4 ? "TypeReference" : - this.objectFlags & 8 ? "TupleType" : - this.objectFlags & 16 ? "AnonymousType" : - this.objectFlags & 32 ? "MappedType" : - this.objectFlags & 2048 ? "ReverseMappedType" : - this.objectFlags & 256 ? "EvolvingArrayType" : - "ObjectType" : - "Type"; - var remainingObjectFlags = this.flags & 524288 ? this.objectFlags & ~2367 : 0; - return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : ""); - } - }, __debugFlags: { get: function () { return formatTypeFlags(this.flags); } }, __debugObjectFlags: { get: function () { return this.flags & 524288 ? formatObjectFlags(this.objectFlags) : ""; } }, - __debugTypeToString: { - value: function () { - var map = getWeakTypeTextMap(); - var text = map === null || map === void 0 ? void 0 : map.get(this); - if (text === undefined) { - text = this.checker.typeToString(this); - map === null || map === void 0 ? void 0 : map.set(this, text); - } - return text; - } - }, + __debugTypeToString: { value: function () { return this.checker.typeToString(this); } }, }); var nodeConstructors = [ ts.objectAllocator.getNodeConstructor(), @@ -2288,48 +2158,6 @@ var ts; var ctor = nodeConstructors_1[_i]; if (!ctor.prototype.hasOwnProperty("__debugKind")) { Object.defineProperties(ctor.prototype, { - __tsDebuggerDisplay: { - value: function () { - var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" : - ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" : - ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" : - ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") : - ts.isNumericLiteral(this) ? "NumericLiteral " + this.text : - ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" : - ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" : - ts.isParameter(this) ? "ParameterDeclaration" : - ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" : - ts.isGetAccessorDeclaration(this) ? "GetAccessorDeclaration" : - ts.isSetAccessorDeclaration(this) ? "SetAccessorDeclaration" : - ts.isCallSignatureDeclaration(this) ? "CallSignatureDeclaration" : - ts.isConstructSignatureDeclaration(this) ? "ConstructSignatureDeclaration" : - ts.isIndexSignatureDeclaration(this) ? "IndexSignatureDeclaration" : - ts.isTypePredicateNode(this) ? "TypePredicateNode" : - ts.isTypeReferenceNode(this) ? "TypeReferenceNode" : - ts.isFunctionTypeNode(this) ? "FunctionTypeNode" : - ts.isConstructorTypeNode(this) ? "ConstructorTypeNode" : - ts.isTypeQueryNode(this) ? "TypeQueryNode" : - ts.isTypeLiteralNode(this) ? "TypeLiteralNode" : - ts.isArrayTypeNode(this) ? "ArrayTypeNode" : - ts.isTupleTypeNode(this) ? "TupleTypeNode" : - ts.isOptionalTypeNode(this) ? "OptionalTypeNode" : - ts.isRestTypeNode(this) ? "RestTypeNode" : - ts.isUnionTypeNode(this) ? "UnionTypeNode" : - ts.isIntersectionTypeNode(this) ? "IntersectionTypeNode" : - ts.isConditionalTypeNode(this) ? "ConditionalTypeNode" : - ts.isInferTypeNode(this) ? "InferTypeNode" : - ts.isParenthesizedTypeNode(this) ? "ParenthesizedTypeNode" : - ts.isThisTypeNode(this) ? "ThisTypeNode" : - ts.isTypeOperatorNode(this) ? "TypeOperatorNode" : - ts.isIndexedAccessTypeNode(this) ? "IndexedAccessTypeNode" : - ts.isMappedTypeNode(this) ? "MappedTypeNode" : - ts.isLiteralTypeNode(this) ? "LiteralTypeNode" : - ts.isNamedTupleMember(this) ? "NamedTupleMember" : - ts.isImportTypeNode(this) ? "ImportTypeNode" : - formatSyntaxKind(this.kind); - return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : ""); - } - }, __debugKind: { get: function () { return formatSyntaxKind(this.kind); } }, __debugNodeFlags: { get: function () { return formatNodeFlags(this.flags); } }, __debugModifierFlags: { get: function () { return formatModifierFlags(ts.getEffectiveModifierFlagsNoCache(this)); } }, @@ -2340,15 +2168,9 @@ var ts; value: function (includeTrivia) { if (ts.nodeIsSynthesized(this)) return ""; - var map = getWeakNodeTextMap(); - var text = map === null || map === void 0 ? void 0 : map.get(this); - if (text === undefined) { - var parseNode = ts.getParseTreeNode(this); - var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); - text = sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; - map === null || map === void 0 ? void 0 : map.set(this, text); - } - return text; + var parseNode = ts.getParseTreeNode(this); + var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); + return sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; } } }); @@ -2419,6 +2241,126 @@ var ts; })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); var ts; +(function (ts) { + ts.timestamp = typeof performance !== "undefined" && performance.now ? function () { return performance.now(); } : Date.now ? Date.now : function () { return +(new Date()); }; +})(ts || (ts = {})); +var ts; +(function (ts) { + var performance; + (function (performance) { + var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : function () { }; + var enabled = false; + var profilerStart = 0; + var counts; + var marks; + var measures; + function createTimerIf(condition, measureName, startMarkName, endMarkName) { + return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer; + } + performance.createTimerIf = createTimerIf; + function createTimer(measureName, startMarkName, endMarkName) { + var enterCount = 0; + return { + enter: enter, + exit: exit + }; + function enter() { + if (++enterCount === 1) { + mark(startMarkName); + } + } + function exit() { + if (--enterCount === 0) { + mark(endMarkName); + measure(measureName, startMarkName, endMarkName); + } + else if (enterCount < 0) { + ts.Debug.fail("enter/exit count does not match."); + } + } + } + performance.createTimer = createTimer; + performance.nullTimer = { enter: ts.noop, exit: ts.noop }; + function mark(markName) { + if (enabled) { + marks.set(markName, ts.timestamp()); + counts.set(markName, (counts.get(markName) || 0) + 1); + profilerEvent(markName); + } + } + performance.mark = mark; + function measure(measureName, startMarkName, endMarkName) { + if (enabled) { + var end = endMarkName && marks.get(endMarkName) || ts.timestamp(); + var start = startMarkName && marks.get(startMarkName) || profilerStart; + measures.set(measureName, (measures.get(measureName) || 0) + (end - start)); + } + } + performance.measure = measure; + function getCount(markName) { + return counts && counts.get(markName) || 0; + } + performance.getCount = getCount; + function getDuration(measureName) { + return measures && measures.get(measureName) || 0; + } + performance.getDuration = getDuration; + function forEachMeasure(cb) { + measures.forEach(function (measure, key) { + cb(key, measure); + }); + } + performance.forEachMeasure = forEachMeasure; + function enable() { + counts = new ts.Map(); + marks = new ts.Map(); + measures = new ts.Map(); + enabled = true; + profilerStart = ts.timestamp(); + } + performance.enable = enable; + function disable() { + enabled = false; + } + performance.disable = disable; + })(performance = ts.performance || (ts.performance = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var _a; + var nullLogger = { + logEvent: ts.noop, + logErrEvent: ts.noop, + logPerfEvent: ts.noop, + logInfoEvent: ts.noop, + logStartCommand: ts.noop, + logStopCommand: ts.noop, + logStartUpdateProgram: ts.noop, + logStopUpdateProgram: ts.noop, + logStartUpdateGraph: ts.noop, + logStopUpdateGraph: ts.noop, + logStartResolveModule: ts.noop, + logStopResolveModule: ts.noop, + logStartParseSourceFile: ts.noop, + logStopParseSourceFile: ts.noop, + logStartReadFile: ts.noop, + logStopReadFile: ts.noop, + logStartBindFile: ts.noop, + logStopBindFile: ts.noop, + logStartScheduledOperation: ts.noop, + logStopScheduledOperation: ts.noop, + }; + var etwModule; + try { + var etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) !== null && _a !== void 0 ? _a : "./node_modules/@microsoft/typescript-etw"; + etwModule = require(etwModulePath); + } + catch (e) { + etwModule = undefined; + } + ts.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; +})(ts || (ts = {})); +var ts; (function (ts) { var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i; var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i; @@ -2460,7 +2402,7 @@ var ts; return ts.compareValues(this.major, other.major) || ts.compareValues(this.minor, other.minor) || ts.compareValues(this.patch, other.patch) - || comparePrereleaseIdentifiers(this.prerelease, other.prerelease); + || comparePrerelaseIdentifiers(this.prerelease, other.prerelease); }; Version.prototype.increment = function (field) { switch (field) { @@ -2499,7 +2441,7 @@ var ts; build: build }; } - function comparePrereleaseIdentifiers(left, right) { + function comparePrerelaseIdentifiers(left, right) { if (left === right) return 0; if (left.length === 0) @@ -2700,402 +2642,6 @@ var ts; } })(ts || (ts = {})); var ts; -(function (ts) { - function hasRequiredAPI(performance, PerformanceObserver) { - return typeof performance === "object" && - typeof performance.timeOrigin === "number" && - typeof performance.mark === "function" && - typeof performance.measure === "function" && - typeof performance.now === "function" && - typeof PerformanceObserver === "function"; - } - function tryGetWebPerformanceHooks() { - if (typeof performance === "object" && - typeof PerformanceObserver === "function" && - hasRequiredAPI(performance, PerformanceObserver)) { - return { - performance: performance, - PerformanceObserver: PerformanceObserver - }; - } - } - function tryGetNodePerformanceHooks() { - if (typeof module === "object" && typeof require === "function") { - try { - var _a = require("perf_hooks"), performance_1 = _a.performance, PerformanceObserver_1 = _a.PerformanceObserver; - if (hasRequiredAPI(performance_1, PerformanceObserver_1)) { - var version_1 = new ts.Version(process.versions.node); - var range = new ts.VersionRange("<12.16.3 || 13 <13.13"); - if (range.test(version_1)) { - return { - performance: { - get timeOrigin() { return performance_1.timeOrigin; }, - now: function () { return performance_1.now(); }, - mark: function (name) { return performance_1.mark(name); }, - measure: function (name, start, end) { - if (start === void 0) { start = "nodeStart"; } - if (end === undefined) { - end = "__performance.measure-fix__"; - performance_1.mark(end); - } - performance_1.measure(name, start, end); - if (end === "__performance.measure-fix__") { - performance_1.clearMarks("__performance.measure-fix__"); - } - } - }, - PerformanceObserver: PerformanceObserver_1 - }; - } - return { - performance: performance_1, - PerformanceObserver: PerformanceObserver_1 - }; - } - } - catch (_b) { - } - } - } - var nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks(); - var nativePerformance = nativePerformanceHooks === null || nativePerformanceHooks === void 0 ? void 0 : nativePerformanceHooks.performance; - function tryGetNativePerformanceHooks() { - return nativePerformanceHooks; - } - ts.tryGetNativePerformanceHooks = tryGetNativePerformanceHooks; - ts.timestamp = nativePerformance ? function () { return nativePerformance.now(); } : - Date.now ? Date.now : - function () { return +(new Date()); }; -})(ts || (ts = {})); -var ts; -(function (ts) { - var performance; - (function (performance) { - var perfHooks; - var perfObserver; - var performanceImpl; - function createTimerIf(condition, measureName, startMarkName, endMarkName) { - return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer; - } - performance.createTimerIf = createTimerIf; - function createTimer(measureName, startMarkName, endMarkName) { - var enterCount = 0; - return { - enter: enter, - exit: exit - }; - function enter() { - if (++enterCount === 1) { - mark(startMarkName); - } - } - function exit() { - if (--enterCount === 0) { - mark(endMarkName); - measure(measureName, startMarkName, endMarkName); - } - else if (enterCount < 0) { - ts.Debug.fail("enter/exit count does not match."); - } - } - } - performance.createTimer = createTimer; - performance.nullTimer = { enter: ts.noop, exit: ts.noop }; - var counts = new ts.Map(); - var durations = new ts.Map(); - function mark(markName) { - performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.mark(markName); - } - performance.mark = mark; - function measure(measureName, startMarkName, endMarkName) { - performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName); - } - performance.measure = measure; - function getCount(markName) { - return counts.get(markName) || 0; - } - performance.getCount = getCount; - function getDuration(measureName) { - return durations.get(measureName) || 0; - } - performance.getDuration = getDuration; - function forEachMeasure(cb) { - durations.forEach(function (duration, measureName) { return cb(measureName, duration); }); - } - performance.forEachMeasure = forEachMeasure; - function isEnabled() { - return !!performanceImpl; - } - performance.isEnabled = isEnabled; - function enable() { - if (!performanceImpl) { - perfHooks || (perfHooks = ts.tryGetNativePerformanceHooks()); - if (!perfHooks) - return false; - perfObserver || (perfObserver = new perfHooks.PerformanceObserver(updateStatisticsFromList)); - perfObserver.observe({ entryTypes: ["mark", "measure"] }); - performanceImpl = perfHooks.performance; - } - return true; - } - performance.enable = enable; - function disable() { - perfObserver === null || perfObserver === void 0 ? void 0 : perfObserver.disconnect(); - performanceImpl = undefined; - counts.clear(); - durations.clear(); - } - performance.disable = disable; - function updateStatisticsFromList(list) { - for (var _i = 0, _a = list.getEntriesByType("mark"); _i < _a.length; _i++) { - var mark_1 = _a[_i]; - counts.set(mark_1.name, (counts.get(mark_1.name) || 0) + 1); - } - for (var _b = 0, _c = list.getEntriesByType("measure"); _b < _c.length; _b++) { - var measure_1 = _c[_b]; - durations.set(measure_1.name, (durations.get(measure_1.name) || 0) + measure_1.duration); - } - } - })(performance = ts.performance || (ts.performance = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var _a; - var nullLogger = { - logEvent: ts.noop, - logErrEvent: ts.noop, - logPerfEvent: ts.noop, - logInfoEvent: ts.noop, - logStartCommand: ts.noop, - logStopCommand: ts.noop, - logStartUpdateProgram: ts.noop, - logStopUpdateProgram: ts.noop, - logStartUpdateGraph: ts.noop, - logStopUpdateGraph: ts.noop, - logStartResolveModule: ts.noop, - logStopResolveModule: ts.noop, - logStartParseSourceFile: ts.noop, - logStopParseSourceFile: ts.noop, - logStartReadFile: ts.noop, - logStopReadFile: ts.noop, - logStartBindFile: ts.noop, - logStopBindFile: ts.noop, - logStartScheduledOperation: ts.noop, - logStopScheduledOperation: ts.noop, - }; - var etwModule; - try { - var etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) !== null && _a !== void 0 ? _a : "./node_modules/@microsoft/typescript-etw"; - etwModule = require(etwModulePath); - } - catch (e) { - etwModule = undefined; - } - ts.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; -})(ts || (ts = {})); -var ts; -(function (ts) { - var tracing; - (function (tracing) { - var fs; - var traceCount = 0; - var traceFd; - var legendPath; - var legend = []; - function startTracing(configFilePath, traceDir, isBuildMode) { - ts.Debug.assert(!traceFd, "Tracing already started"); - if (fs === undefined) { - try { - fs = require("fs"); - } - catch (_a) { - fs = false; - } - } - if (!fs) { - return; - } - if (legendPath === undefined) { - legendPath = ts.combinePaths(traceDir, "legend.json"); - } - if (!fs.existsSync(traceDir)) { - fs.mkdirSync(traceDir, { recursive: true }); - } - var countPart = isBuildMode ? "." + ++traceCount : ""; - var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json"); - var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json"); - legend.push({ - configFilePath: configFilePath, - tracePath: tracePath, - typesPath: typesPath, - }); - traceFd = fs.openSync(tracePath, "w"); - var meta = { cat: "__metadata", ph: "M", ts: 1000 * ts.timestamp(), pid: 1, tid: 1 }; - fs.writeSync(traceFd, "[\n" - + [__assign({ name: "process_name", args: { name: "tsc" } }, meta), __assign({ name: "thread_name", args: { name: "Main" } }, meta), __assign(__assign({ name: "TracingStartedInBrowser" }, meta), { cat: "disabled-by-default-devtools.timeline" })] - .map(function (v) { return JSON.stringify(v); }).join(",\n")); - } - tracing.startTracing = startTracing; - function stopTracing(typeCatalog) { - if (!traceFd) { - ts.Debug.assert(!fs, "Tracing is not in progress"); - return; - } - ts.Debug.assert(fs); - fs.writeSync(traceFd, "\n]\n"); - fs.closeSync(traceFd); - traceFd = undefined; - if (typeCatalog) { - dumpTypes(typeCatalog); - } - else { - legend[legend.length - 1].typesPath = undefined; - } - } - tracing.stopTracing = stopTracing; - function isTracing() { - return !!traceFd; - } - tracing.isTracing = isTracing; - function begin(phase, name, args) { - if (!traceFd) - return; - writeEvent("B", phase, name, args); - } - tracing.begin = begin; - function end(phase, name, args) { - if (!traceFd) - return; - writeEvent("E", phase, name, args); - } - tracing.end = end; - function instant(phase, name, args) { - if (!traceFd) - return; - writeEvent("I", phase, name, args, "\"s\":\"g\""); - } - tracing.instant = instant; - var completeEvents = []; - function push(phase, name, args) { - if (!traceFd) - return; - completeEvents.push({ phase: phase, name: name, args: args, time: 1000 * ts.timestamp() }); - } - tracing.push = push; - function pop() { - if (!traceFd) - return; - ts.Debug.assert(completeEvents.length > 0); - var _a = completeEvents.pop(), phase = _a.phase, name = _a.name, args = _a.args, time = _a.time; - var dur = 1000 * ts.timestamp() - time; - writeEvent("X", phase, name, args, "\"dur\":" + dur, time); - } - tracing.pop = pop; - function writeEvent(eventType, phase, name, args, extras, time) { - if (time === void 0) { time = 1000 * ts.timestamp(); } - ts.Debug.assert(traceFd); - ts.Debug.assert(fs); - ts.performance.mark("beginTracing"); - fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\""); - if (extras) - fs.writeSync(traceFd, "," + extras); - if (args) - fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args)); - fs.writeSync(traceFd, "}"); - ts.performance.mark("endTracing"); - ts.performance.measure("Tracing", "beginTracing", "endTracing"); - } - function indexFromOne(lc) { - return { - line: lc.line + 1, - character: lc.character + 1, - }; - } - function dumpTypes(types) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r; - ts.Debug.assert(fs); - ts.performance.mark("beginDumpTypes"); - var typesPath = legend[legend.length - 1].typesPath; - var typesFd = fs.openSync(typesPath, "w"); - var recursionIdentityMap = new ts.Map(); - fs.writeSync(typesFd, "["); - var numTypes = types.length; - for (var i = 0; i < numTypes; i++) { - var type = types[i]; - var objectFlags = type.objectFlags; - var symbol = (_a = type.aliasSymbol) !== null && _a !== void 0 ? _a : type.symbol; - var firstDeclaration = (_b = symbol === null || symbol === void 0 ? void 0 : symbol.declarations) === null || _b === void 0 ? void 0 : _b[0]; - var firstFile = firstDeclaration && ts.getSourceFileOfNode(firstDeclaration); - var display = void 0; - if ((objectFlags & 16) | (type.flags & 2944)) { - try { - display = (_c = type.checker) === null || _c === void 0 ? void 0 : _c.typeToString(type); - } - catch (_s) { - display = undefined; - } - } - var indexedAccessProperties = {}; - if (type.flags & 8388608) { - var indexedAccessType = type; - indexedAccessProperties = { - indexedAccessObjectType: (_d = indexedAccessType.objectType) === null || _d === void 0 ? void 0 : _d.id, - indexedAccessIndexType: (_e = indexedAccessType.indexType) === null || _e === void 0 ? void 0 : _e.id, - }; - } - var referenceProperties = {}; - if (objectFlags & 4) { - var referenceType = type; - referenceProperties = { - instantiatedType: (_f = referenceType.target) === null || _f === void 0 ? void 0 : _f.id, - typeArguments: (_g = referenceType.resolvedTypeArguments) === null || _g === void 0 ? void 0 : _g.map(function (t) { return t.id; }), - }; - } - var conditionalProperties = {}; - if (type.flags & 16777216) { - var conditionalType = type; - conditionalProperties = { - conditionalCheckType: (_h = conditionalType.checkType) === null || _h === void 0 ? void 0 : _h.id, - conditionalExtendsType: (_j = conditionalType.extendsType) === null || _j === void 0 ? void 0 : _j.id, - conditionalTrueType: (_l = (_k = conditionalType.resolvedTrueType) === null || _k === void 0 ? void 0 : _k.id) !== null && _l !== void 0 ? _l : -1, - conditionalFalseType: (_o = (_m = conditionalType.resolvedFalseType) === null || _m === void 0 ? void 0 : _m.id) !== null && _o !== void 0 ? _o : -1, - }; - } - var recursionToken = void 0; - var recursionIdentity = type.checker.getRecursionIdentity(type); - if (recursionIdentity) { - recursionToken = recursionIdentityMap.get(recursionIdentity); - if (!recursionToken) { - recursionToken = recursionIdentityMap.size; - recursionIdentityMap.set(recursionIdentity, recursionToken); - } - } - var descriptor = __assign(__assign(__assign(__assign({ id: type.id, intrinsicName: type.intrinsicName, symbolName: (symbol === null || symbol === void 0 ? void 0 : symbol.escapedName) && ts.unescapeLeadingUnderscores(symbol.escapedName), recursionId: recursionToken, unionTypes: (type.flags & 1048576) ? (_p = type.types) === null || _p === void 0 ? void 0 : _p.map(function (t) { return t.id; }) : undefined, intersectionTypes: (type.flags & 2097152) ? type.types.map(function (t) { return t.id; }) : undefined, aliasTypeArguments: (_q = type.aliasTypeArguments) === null || _q === void 0 ? void 0 : _q.map(function (t) { return t.id; }), keyofType: (type.flags & 4194304) ? (_r = type.type) === null || _r === void 0 ? void 0 : _r.id : undefined }, indexedAccessProperties), referenceProperties), conditionalProperties), { firstDeclaration: firstDeclaration && { - path: firstFile.path, - start: indexFromOne(ts.getLineAndCharacterOfPosition(firstFile, firstDeclaration.pos)), - end: indexFromOne(ts.getLineAndCharacterOfPosition(ts.getSourceFileOfNode(firstDeclaration), firstDeclaration.end)), - }, flags: ts.Debug.formatTypeFlags(type.flags).split("|"), display: display }); - fs.writeSync(typesFd, JSON.stringify(descriptor)); - if (i < numTypes - 1) { - fs.writeSync(typesFd, ",\n"); - } - } - fs.writeSync(typesFd, "]\n"); - fs.closeSync(typesFd); - ts.performance.mark("endDumpTypes"); - ts.performance.measure("Dump types", "beginDumpTypes", "endDumpTypes"); - } - function dumpLegend() { - if (!legendPath) { - return; - } - ts.Debug.assert(fs); - fs.writeFileSync(legendPath, JSON.stringify(legend)); - } - tracing.dumpLegend = dumpLegend; - })(tracing = ts.tracing || (ts.tracing = {})); -})(ts || (ts = {})); -var ts; (function (ts) { var OperationCanceledException = (function () { function OperationCanceledException() { @@ -3214,487 +2760,9 @@ var ts; args: [{ name: "factory" }], kind: 4 }, - "jsximportsource": { - args: [{ name: "factory" }], - kind: 4 - }, - "jsxruntime": { - args: [{ name: "factory" }], - kind: 4 - }, }; })(ts || (ts = {})); var ts; -(function (ts) { - ts.directorySeparator = "/"; - var altDirectorySeparator = "\\"; - var urlSchemeSeparator = "://"; - var backslashRegExp = /\\/g; - function isAnyDirectorySeparator(charCode) { - return charCode === 47 || charCode === 92; - } - ts.isAnyDirectorySeparator = isAnyDirectorySeparator; - function isUrl(path) { - return getEncodedRootLength(path) < 0; - } - ts.isUrl = isUrl; - function isRootedDiskPath(path) { - return getEncodedRootLength(path) > 0; - } - ts.isRootedDiskPath = isRootedDiskPath; - function isDiskPathRoot(path) { - var rootLength = getEncodedRootLength(path); - return rootLength > 0 && rootLength === path.length; - } - ts.isDiskPathRoot = isDiskPathRoot; - function pathIsAbsolute(path) { - return getEncodedRootLength(path) !== 0; - } - ts.pathIsAbsolute = pathIsAbsolute; - function pathIsRelative(path) { - return /^\.\.?($|[\\/])/.test(path); - } - ts.pathIsRelative = pathIsRelative; - function pathIsBareSpecifier(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path); - } - ts.pathIsBareSpecifier = pathIsBareSpecifier; - function hasExtension(fileName) { - return ts.stringContains(getBaseFileName(fileName), "."); - } - ts.hasExtension = hasExtension; - function fileExtensionIs(path, extension) { - return path.length > extension.length && ts.endsWith(path, extension); - } - ts.fileExtensionIs = fileExtensionIs; - function fileExtensionIsOneOf(path, extensions) { - for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { - var extension = extensions_1[_i]; - if (fileExtensionIs(path, extension)) { - return true; - } - } - return false; - } - ts.fileExtensionIsOneOf = fileExtensionIsOneOf; - function hasTrailingDirectorySeparator(path) { - return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); - } - ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator; - function isVolumeCharacter(charCode) { - return (charCode >= 97 && charCode <= 122) || - (charCode >= 65 && charCode <= 90); - } - function getFileUrlVolumeSeparatorEnd(url, start) { - var ch0 = url.charCodeAt(start); - if (ch0 === 58) - return start + 1; - if (ch0 === 37 && url.charCodeAt(start + 1) === 51) { - var ch2 = url.charCodeAt(start + 2); - if (ch2 === 97 || ch2 === 65) - return start + 3; - } - return -1; - } - function getEncodedRootLength(path) { - if (!path) - return 0; - var ch0 = path.charCodeAt(0); - if (ch0 === 47 || ch0 === 92) { - if (path.charCodeAt(1) !== ch0) - return 1; - var p1 = path.indexOf(ch0 === 47 ? ts.directorySeparator : altDirectorySeparator, 2); - if (p1 < 0) - return path.length; - return p1 + 1; - } - if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58) { - var ch2 = path.charCodeAt(2); - if (ch2 === 47 || ch2 === 92) - return 3; - if (path.length === 2) - return 2; - } - var schemeEnd = path.indexOf(urlSchemeSeparator); - if (schemeEnd !== -1) { - var authorityStart = schemeEnd + urlSchemeSeparator.length; - var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart); - if (authorityEnd !== -1) { - var scheme = path.slice(0, schemeEnd); - var authority = path.slice(authorityStart, authorityEnd); - if (scheme === "file" && (authority === "" || authority === "localhost") && - isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { - var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); - if (volumeSeparatorEnd !== -1) { - if (path.charCodeAt(volumeSeparatorEnd) === 47) { - return ~(volumeSeparatorEnd + 1); - } - if (volumeSeparatorEnd === path.length) { - return ~volumeSeparatorEnd; - } - } - } - return ~(authorityEnd + 1); - } - return ~path.length; - } - return 0; - } - function getRootLength(path) { - var rootLength = getEncodedRootLength(path); - return rootLength < 0 ? ~rootLength : rootLength; - } - ts.getRootLength = getRootLength; - function getDirectoryPath(path) { - path = normalizeSlashes(path); - var rootLength = getRootLength(path); - if (rootLength === path.length) - return path; - path = removeTrailingDirectorySeparator(path); - return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator))); - } - ts.getDirectoryPath = getDirectoryPath; - function getBaseFileName(path, extensions, ignoreCase) { - path = normalizeSlashes(path); - var rootLength = getRootLength(path); - if (rootLength === path.length) - return ""; - path = removeTrailingDirectorySeparator(path); - var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1)); - var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined; - return extension ? name.slice(0, name.length - extension.length) : name; - } - ts.getBaseFileName = getBaseFileName; - function tryGetExtensionFromPath(path, extension, stringEqualityComparer) { - if (!ts.startsWith(extension, ".")) - extension = "." + extension; - if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46) { - var pathExtension = path.slice(path.length - extension.length); - if (stringEqualityComparer(pathExtension, extension)) { - return pathExtension; - } - } - } - function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) { - if (typeof extensions === "string") { - return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || ""; - } - for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) { - var extension = extensions_2[_i]; - var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer); - if (result) - return result; - } - return ""; - } - function getAnyExtensionFromPath(path, extensions, ignoreCase) { - if (extensions) { - return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive); - } - var baseFileName = getBaseFileName(path); - var extensionIndex = baseFileName.lastIndexOf("."); - if (extensionIndex >= 0) { - return baseFileName.substring(extensionIndex); - } - return ""; - } - ts.getAnyExtensionFromPath = getAnyExtensionFromPath; - function pathComponents(path, rootLength) { - var root = path.substring(0, rootLength); - var rest = path.substring(rootLength).split(ts.directorySeparator); - if (rest.length && !ts.lastOrUndefined(rest)) - rest.pop(); - return __spreadArrays([root], rest); - } - function getPathComponents(path, currentDirectory) { - if (currentDirectory === void 0) { currentDirectory = ""; } - path = combinePaths(currentDirectory, path); - return pathComponents(path, getRootLength(path)); - } - ts.getPathComponents = getPathComponents; - function getPathFromPathComponents(pathComponents) { - if (pathComponents.length === 0) - return ""; - var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]); - return root + pathComponents.slice(1).join(ts.directorySeparator); - } - ts.getPathFromPathComponents = getPathFromPathComponents; - function normalizeSlashes(path) { - return path.replace(backslashRegExp, ts.directorySeparator); - } - ts.normalizeSlashes = normalizeSlashes; - function reducePathComponents(components) { - if (!ts.some(components)) - return []; - var reduced = [components[0]]; - for (var i = 1; i < components.length; i++) { - var component = components[i]; - if (!component) - continue; - if (component === ".") - continue; - if (component === "..") { - if (reduced.length > 1) { - if (reduced[reduced.length - 1] !== "..") { - reduced.pop(); - continue; - } - } - else if (reduced[0]) - continue; - } - reduced.push(component); - } - return reduced; - } - ts.reducePathComponents = reducePathComponents; - function combinePaths(path) { - var paths = []; - for (var _i = 1; _i < arguments.length; _i++) { - paths[_i - 1] = arguments[_i]; - } - if (path) - path = normalizeSlashes(path); - for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { - var relativePath = paths_1[_a]; - if (!relativePath) - continue; - relativePath = normalizeSlashes(relativePath); - if (!path || getRootLength(relativePath) !== 0) { - path = relativePath; - } - else { - path = ensureTrailingDirectorySeparator(path) + relativePath; - } - } - return path; - } - ts.combinePaths = combinePaths; - function resolvePath(path) { - var paths = []; - for (var _i = 1; _i < arguments.length; _i++) { - paths[_i - 1] = arguments[_i]; - } - return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : normalizeSlashes(path)); - } - ts.resolvePath = resolvePath; - function getNormalizedPathComponents(path, currentDirectory) { - return reducePathComponents(getPathComponents(path, currentDirectory)); - } - ts.getNormalizedPathComponents = getNormalizedPathComponents; - function getNormalizedAbsolutePath(fileName, currentDirectory) { - return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); - } - ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; - function normalizePath(path) { - path = normalizeSlashes(path); - var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); - return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; - } - ts.normalizePath = normalizePath; - function getPathWithoutRoot(pathComponents) { - if (pathComponents.length === 0) - return ""; - return pathComponents.slice(1).join(ts.directorySeparator); - } - function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { - return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); - } - ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; - function toPath(fileName, basePath, getCanonicalFileName) { - var nonCanonicalizedPath = isRootedDiskPath(fileName) - ? normalizePath(fileName) - : getNormalizedAbsolutePath(fileName, basePath); - return getCanonicalFileName(nonCanonicalizedPath); - } - ts.toPath = toPath; - function normalizePathAndParts(path) { - path = normalizeSlashes(path); - var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1); - if (parts.length) { - var joinedParts = root + parts.join(ts.directorySeparator); - return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts }; - } - else { - return { path: root, parts: parts }; - } - } - ts.normalizePathAndParts = normalizePathAndParts; - function removeTrailingDirectorySeparator(path) { - if (hasTrailingDirectorySeparator(path)) { - return path.substr(0, path.length - 1); - } - return path; - } - ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator; - function ensureTrailingDirectorySeparator(path) { - if (!hasTrailingDirectorySeparator(path)) { - return path + ts.directorySeparator; - } - return path; - } - ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; - function ensurePathIsNonModuleName(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; - } - ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName; - function changeAnyExtension(path, ext, extensions, ignoreCase) { - var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path); - return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path; - } - ts.changeAnyExtension = changeAnyExtension; - var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; - function comparePathsWorker(a, b, componentComparer) { - if (a === b) - return 0; - if (a === undefined) - return -1; - if (b === undefined) - return 1; - var aRoot = a.substring(0, getRootLength(a)); - var bRoot = b.substring(0, getRootLength(b)); - var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); - if (result !== 0) { - return result; - } - var aRest = a.substring(aRoot.length); - var bRest = b.substring(bRoot.length); - if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { - return componentComparer(aRest, bRest); - } - var aComponents = reducePathComponents(getPathComponents(a)); - var bComponents = reducePathComponents(getPathComponents(b)); - var sharedLength = Math.min(aComponents.length, bComponents.length); - for (var i = 1; i < sharedLength; i++) { - var result_2 = componentComparer(aComponents[i], bComponents[i]); - if (result_2 !== 0) { - return result_2; - } - } - return ts.compareValues(aComponents.length, bComponents.length); - } - function comparePathsCaseSensitive(a, b) { - return comparePathsWorker(a, b, ts.compareStringsCaseSensitive); - } - ts.comparePathsCaseSensitive = comparePathsCaseSensitive; - function comparePathsCaseInsensitive(a, b) { - return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive); - } - ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive; - function comparePaths(a, b, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - a = combinePaths(currentDirectory, a); - b = combinePaths(currentDirectory, b); - } - else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase)); - } - ts.comparePaths = comparePaths; - function containsPath(parent, child, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - parent = combinePaths(currentDirectory, parent); - child = combinePaths(currentDirectory, child); - } - else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - if (parent === undefined || child === undefined) - return false; - if (parent === child) - return true; - var parentComponents = reducePathComponents(getPathComponents(parent)); - var childComponents = reducePathComponents(getPathComponents(child)); - if (childComponents.length < parentComponents.length) { - return false; - } - var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive; - for (var i = 0; i < parentComponents.length; i++) { - var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer; - if (!equalityComparer(parentComponents[i], childComponents[i])) { - return false; - } - } - return true; - } - ts.containsPath = containsPath; - function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { - var canonicalFileName = getCanonicalFileName(fileName); - var canonicalDirectoryName = getCanonicalFileName(directoryName); - return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\"); - } - ts.startsWithDirectory = startsWithDirectory; - function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { - var fromComponents = reducePathComponents(getPathComponents(from)); - var toComponents = reducePathComponents(getPathComponents(to)); - var start; - for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { - var fromComponent = getCanonicalFileName(fromComponents[start]); - var toComponent = getCanonicalFileName(toComponents[start]); - var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer; - if (!comparer(fromComponent, toComponent)) - break; - } - if (start === 0) { - return toComponents; - } - var components = toComponents.slice(start); - var relative = []; - for (; start < fromComponents.length; start++) { - relative.push(".."); - } - return __spreadArrays([""], relative, components); - } - ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo; - function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { - ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative"); - var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity; - var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; - var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName); - return getPathFromPathComponents(pathComponents); - } - ts.getRelativePathFromDirectory = getRelativePathFromDirectory; - function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { - return !isRootedDiskPath(absoluteOrRelativePath) - ? absoluteOrRelativePath - : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, false); - } - ts.convertToRelativePath = convertToRelativePath; - function getRelativePathFromFile(from, to, getCanonicalFileName) { - return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); - } - ts.getRelativePathFromFile = getRelativePathFromFile; - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { - var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName); - var firstComponent = pathComponents[0]; - if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { - var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///"; - pathComponents[0] = prefix + firstComponent; - } - return getPathFromPathComponents(pathComponents); - } - ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; - function forEachAncestorDirectory(directory, callback) { - while (true) { - var result = callback(directory); - if (result !== undefined) { - return result; - } - var parentPath = getDirectoryPath(directory); - if (parentPath === directory) { - return undefined; - } - directory = parentPath; - } - } - ts.forEachAncestorDirectory = forEachAncestorDirectory; - function isNodeModulesDirectory(dirPath) { - return ts.endsWith(dirPath, "/node_modules"); - } - ts.isNodeModulesDirectory = isNodeModulesDirectory; -})(ts || (ts = {})); -var ts; (function (ts) { function generateDjb2Hash(data) { var acc = 5381; @@ -4768,8 +3836,6 @@ var ts; return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath); } function fileSystemEntryExists(path, entryKind) { - var originalStackTraceLimit = Error.stackTraceLimit; - Error.stackTraceLimit = 0; try { var stat = _fs.statSync(path); switch (entryKind) { @@ -4781,9 +3847,6 @@ var ts; catch (e) { return false; } - finally { - Error.stackTraceLimit = originalStackTraceLimit; - } } function fileExists(path) { return fileSystemEntryExists(path, 0); @@ -4852,6 +3915,472 @@ var ts; } })(ts || (ts = {})); var ts; +(function (ts) { + ts.directorySeparator = "/"; + var altDirectorySeparator = "\\"; + var urlSchemeSeparator = "://"; + var backslashRegExp = /\\/g; + function isAnyDirectorySeparator(charCode) { + return charCode === 47 || charCode === 92; + } + ts.isAnyDirectorySeparator = isAnyDirectorySeparator; + function isUrl(path) { + return getEncodedRootLength(path) < 0; + } + ts.isUrl = isUrl; + function isRootedDiskPath(path) { + return getEncodedRootLength(path) > 0; + } + ts.isRootedDiskPath = isRootedDiskPath; + function isDiskPathRoot(path) { + var rootLength = getEncodedRootLength(path); + return rootLength > 0 && rootLength === path.length; + } + ts.isDiskPathRoot = isDiskPathRoot; + function pathIsAbsolute(path) { + return getEncodedRootLength(path) !== 0; + } + ts.pathIsAbsolute = pathIsAbsolute; + function pathIsRelative(path) { + return /^\.\.?($|[\\/])/.test(path); + } + ts.pathIsRelative = pathIsRelative; + function hasExtension(fileName) { + return ts.stringContains(getBaseFileName(fileName), "."); + } + ts.hasExtension = hasExtension; + function fileExtensionIs(path, extension) { + return path.length > extension.length && ts.endsWith(path, extension); + } + ts.fileExtensionIs = fileExtensionIs; + function fileExtensionIsOneOf(path, extensions) { + for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { + var extension = extensions_1[_i]; + if (fileExtensionIs(path, extension)) { + return true; + } + } + return false; + } + ts.fileExtensionIsOneOf = fileExtensionIsOneOf; + function hasTrailingDirectorySeparator(path) { + return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); + } + ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator; + function isVolumeCharacter(charCode) { + return (charCode >= 97 && charCode <= 122) || + (charCode >= 65 && charCode <= 90); + } + function getFileUrlVolumeSeparatorEnd(url, start) { + var ch0 = url.charCodeAt(start); + if (ch0 === 58) + return start + 1; + if (ch0 === 37 && url.charCodeAt(start + 1) === 51) { + var ch2 = url.charCodeAt(start + 2); + if (ch2 === 97 || ch2 === 65) + return start + 3; + } + return -1; + } + function getEncodedRootLength(path) { + if (!path) + return 0; + var ch0 = path.charCodeAt(0); + if (ch0 === 47 || ch0 === 92) { + if (path.charCodeAt(1) !== ch0) + return 1; + var p1 = path.indexOf(ch0 === 47 ? ts.directorySeparator : altDirectorySeparator, 2); + if (p1 < 0) + return path.length; + return p1 + 1; + } + if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58) { + var ch2 = path.charCodeAt(2); + if (ch2 === 47 || ch2 === 92) + return 3; + if (path.length === 2) + return 2; + } + var schemeEnd = path.indexOf(urlSchemeSeparator); + if (schemeEnd !== -1) { + var authorityStart = schemeEnd + urlSchemeSeparator.length; + var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart); + if (authorityEnd !== -1) { + var scheme = path.slice(0, schemeEnd); + var authority = path.slice(authorityStart, authorityEnd); + if (scheme === "file" && (authority === "" || authority === "localhost") && + isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { + var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); + if (volumeSeparatorEnd !== -1) { + if (path.charCodeAt(volumeSeparatorEnd) === 47) { + return ~(volumeSeparatorEnd + 1); + } + if (volumeSeparatorEnd === path.length) { + return ~volumeSeparatorEnd; + } + } + } + return ~(authorityEnd + 1); + } + return ~path.length; + } + return 0; + } + function getRootLength(path) { + var rootLength = getEncodedRootLength(path); + return rootLength < 0 ? ~rootLength : rootLength; + } + ts.getRootLength = getRootLength; + function getDirectoryPath(path) { + path = normalizeSlashes(path); + var rootLength = getRootLength(path); + if (rootLength === path.length) + return path; + path = removeTrailingDirectorySeparator(path); + return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator))); + } + ts.getDirectoryPath = getDirectoryPath; + function getBaseFileName(path, extensions, ignoreCase) { + path = normalizeSlashes(path); + var rootLength = getRootLength(path); + if (rootLength === path.length) + return ""; + path = removeTrailingDirectorySeparator(path); + var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1)); + var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined; + return extension ? name.slice(0, name.length - extension.length) : name; + } + ts.getBaseFileName = getBaseFileName; + function tryGetExtensionFromPath(path, extension, stringEqualityComparer) { + if (!ts.startsWith(extension, ".")) + extension = "." + extension; + if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46) { + var pathExtension = path.slice(path.length - extension.length); + if (stringEqualityComparer(pathExtension, extension)) { + return pathExtension; + } + } + } + function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) { + if (typeof extensions === "string") { + return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || ""; + } + for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) { + var extension = extensions_2[_i]; + var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer); + if (result) + return result; + } + return ""; + } + function getAnyExtensionFromPath(path, extensions, ignoreCase) { + if (extensions) { + return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive); + } + var baseFileName = getBaseFileName(path); + var extensionIndex = baseFileName.lastIndexOf("."); + if (extensionIndex >= 0) { + return baseFileName.substring(extensionIndex); + } + return ""; + } + ts.getAnyExtensionFromPath = getAnyExtensionFromPath; + function pathComponents(path, rootLength) { + var root = path.substring(0, rootLength); + var rest = path.substring(rootLength).split(ts.directorySeparator); + if (rest.length && !ts.lastOrUndefined(rest)) + rest.pop(); + return __spreadArrays([root], rest); + } + function getPathComponents(path, currentDirectory) { + if (currentDirectory === void 0) { currentDirectory = ""; } + path = combinePaths(currentDirectory, path); + return pathComponents(path, getRootLength(path)); + } + ts.getPathComponents = getPathComponents; + function getPathFromPathComponents(pathComponents) { + if (pathComponents.length === 0) + return ""; + var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]); + return root + pathComponents.slice(1).join(ts.directorySeparator); + } + ts.getPathFromPathComponents = getPathFromPathComponents; + function normalizeSlashes(path) { + return path.replace(backslashRegExp, ts.directorySeparator); + } + ts.normalizeSlashes = normalizeSlashes; + function reducePathComponents(components) { + if (!ts.some(components)) + return []; + var reduced = [components[0]]; + for (var i = 1; i < components.length; i++) { + var component = components[i]; + if (!component) + continue; + if (component === ".") + continue; + if (component === "..") { + if (reduced.length > 1) { + if (reduced[reduced.length - 1] !== "..") { + reduced.pop(); + continue; + } + } + else if (reduced[0]) + continue; + } + reduced.push(component); + } + return reduced; + } + ts.reducePathComponents = reducePathComponents; + function combinePaths(path) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + if (path) + path = normalizeSlashes(path); + for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { + var relativePath = paths_1[_a]; + if (!relativePath) + continue; + relativePath = normalizeSlashes(relativePath); + if (!path || getRootLength(relativePath) !== 0) { + path = relativePath; + } + else { + path = ensureTrailingDirectorySeparator(path) + relativePath; + } + } + return path; + } + ts.combinePaths = combinePaths; + function resolvePath(path) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : normalizeSlashes(path)); + } + ts.resolvePath = resolvePath; + function getNormalizedPathComponents(path, currentDirectory) { + return reducePathComponents(getPathComponents(path, currentDirectory)); + } + ts.getNormalizedPathComponents = getNormalizedPathComponents; + function getNormalizedAbsolutePath(fileName, currentDirectory) { + return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; + function normalizePath(path) { + path = normalizeSlashes(path); + var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); + return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; + } + ts.normalizePath = normalizePath; + function getPathWithoutRoot(pathComponents) { + if (pathComponents.length === 0) + return ""; + return pathComponents.slice(1).join(ts.directorySeparator); + } + function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { + return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; + function toPath(fileName, basePath, getCanonicalFileName) { + var nonCanonicalizedPath = isRootedDiskPath(fileName) + ? normalizePath(fileName) + : getNormalizedAbsolutePath(fileName, basePath); + return getCanonicalFileName(nonCanonicalizedPath); + } + ts.toPath = toPath; + function normalizePathAndParts(path) { + path = normalizeSlashes(path); + var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1); + if (parts.length) { + var joinedParts = root + parts.join(ts.directorySeparator); + return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts }; + } + else { + return { path: root, parts: parts }; + } + } + ts.normalizePathAndParts = normalizePathAndParts; + function removeTrailingDirectorySeparator(path) { + if (hasTrailingDirectorySeparator(path)) { + return path.substr(0, path.length - 1); + } + return path; + } + ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator; + function ensureTrailingDirectorySeparator(path) { + if (!hasTrailingDirectorySeparator(path)) { + return path + ts.directorySeparator; + } + return path; + } + ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; + function ensurePathIsNonModuleName(path) { + return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; + } + ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName; + function changeAnyExtension(path, ext, extensions, ignoreCase) { + var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path); + return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path; + } + ts.changeAnyExtension = changeAnyExtension; + var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; + function comparePathsWorker(a, b, componentComparer) { + if (a === b) + return 0; + if (a === undefined) + return -1; + if (b === undefined) + return 1; + var aRoot = a.substring(0, getRootLength(a)); + var bRoot = b.substring(0, getRootLength(b)); + var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); + if (result !== 0) { + return result; + } + var aRest = a.substring(aRoot.length); + var bRest = b.substring(bRoot.length); + if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { + return componentComparer(aRest, bRest); + } + var aComponents = reducePathComponents(getPathComponents(a)); + var bComponents = reducePathComponents(getPathComponents(b)); + var sharedLength = Math.min(aComponents.length, bComponents.length); + for (var i = 1; i < sharedLength; i++) { + var result_2 = componentComparer(aComponents[i], bComponents[i]); + if (result_2 !== 0) { + return result_2; + } + } + return ts.compareValues(aComponents.length, bComponents.length); + } + function comparePathsCaseSensitive(a, b) { + return comparePathsWorker(a, b, ts.compareStringsCaseSensitive); + } + ts.comparePathsCaseSensitive = comparePathsCaseSensitive; + function comparePathsCaseInsensitive(a, b) { + return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive); + } + ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive; + function comparePaths(a, b, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + a = combinePaths(currentDirectory, a); + b = combinePaths(currentDirectory, b); + } + else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase)); + } + ts.comparePaths = comparePaths; + function containsPath(parent, child, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + parent = combinePaths(currentDirectory, parent); + child = combinePaths(currentDirectory, child); + } + else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + if (parent === undefined || child === undefined) + return false; + if (parent === child) + return true; + var parentComponents = reducePathComponents(getPathComponents(parent)); + var childComponents = reducePathComponents(getPathComponents(child)); + if (childComponents.length < parentComponents.length) { + return false; + } + var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive; + for (var i = 0; i < parentComponents.length; i++) { + var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer; + if (!equalityComparer(parentComponents[i], childComponents[i])) { + return false; + } + } + return true; + } + ts.containsPath = containsPath; + function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { + var canonicalFileName = getCanonicalFileName(fileName); + var canonicalDirectoryName = getCanonicalFileName(directoryName); + return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\"); + } + ts.startsWithDirectory = startsWithDirectory; + function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { + var fromComponents = reducePathComponents(getPathComponents(from)); + var toComponents = reducePathComponents(getPathComponents(to)); + var start; + for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { + var fromComponent = getCanonicalFileName(fromComponents[start]); + var toComponent = getCanonicalFileName(toComponents[start]); + var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer; + if (!comparer(fromComponent, toComponent)) + break; + } + if (start === 0) { + return toComponents; + } + var components = toComponents.slice(start); + var relative = []; + for (; start < fromComponents.length; start++) { + relative.push(".."); + } + return __spreadArrays([""], relative, components); + } + ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo; + function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { + ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative"); + var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity; + var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; + var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName); + return getPathFromPathComponents(pathComponents); + } + ts.getRelativePathFromDirectory = getRelativePathFromDirectory; + function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { + return !isRootedDiskPath(absoluteOrRelativePath) + ? absoluteOrRelativePath + : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, false); + } + ts.convertToRelativePath = convertToRelativePath; + function getRelativePathFromFile(from, to, getCanonicalFileName) { + return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); + } + ts.getRelativePathFromFile = getRelativePathFromFile; + function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { + var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName); + var firstComponent = pathComponents[0]; + if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { + var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///"; + pathComponents[0] = prefix + firstComponent; + } + return getPathFromPathComponents(pathComponents); + } + ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; + function forEachAncestorDirectory(directory, callback) { + while (true) { + var result = callback(directory); + if (result !== undefined) { + return result; + } + var parentPath = getDirectoryPath(directory); + if (parentPath === directory) { + return undefined; + } + directory = parentPath; + } + } + ts.forEachAncestorDirectory = forEachAncestorDirectory; + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + ts.isNodeModulesDirectory = isNodeModulesDirectory; +})(ts || (ts = {})); +var ts; (function (ts) { function diag(code, category, key, message, reportsUnnecessary, elidedInCompatabilityPyramid, reportsDeprecated) { return { code: code, category: category, key: key, message: message, reportsUnnecessary: reportsUnnecessary, elidedInCompatabilityPyramid: elidedInCompatabilityPyramid, reportsDeprecated: reportsDeprecated }; @@ -4882,7 +4411,7 @@ var ts; Accessibility_modifier_already_seen: diag(1028, ts.DiagnosticCategory.Error, "Accessibility_modifier_already_seen_1028", "Accessibility modifier already seen."), _0_modifier_must_precede_1_modifier: diag(1029, ts.DiagnosticCategory.Error, "_0_modifier_must_precede_1_modifier_1029", "'{0}' modifier must precede '{1}' modifier."), _0_modifier_already_seen: diag(1030, ts.DiagnosticCategory.Error, "_0_modifier_already_seen_1030", "'{0}' modifier already seen."), - _0_modifier_cannot_appear_on_class_elements_of_this_kind: diag(1031, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031", "'{0}' modifier cannot appear on class elements of this kind."), + _0_modifier_cannot_appear_on_a_class_element: diag(1031, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_class_element_1031", "'{0}' modifier cannot appear on a class element."), super_must_be_followed_by_an_argument_list_or_member_access: diag(1034, ts.DiagnosticCategory.Error, "super_must_be_followed_by_an_argument_list_or_member_access_1034", "'super' must be followed by an argument list or member access."), Only_ambient_modules_can_use_quoted_names: diag(1035, ts.DiagnosticCategory.Error, "Only_ambient_modules_can_use_quoted_names_1035", "Only ambient modules can use quoted names."), Statements_are_not_allowed_in_ambient_contexts: diag(1036, ts.DiagnosticCategory.Error, "Statements_are_not_allowed_in_ambient_contexts_1036", "Statements are not allowed in ambient contexts."), @@ -5022,7 +4551,7 @@ var ts; Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, ts.DiagnosticCategory.Error, "Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205", "Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."), Decorators_are_not_valid_here: diag(1206, ts.DiagnosticCategory.Error, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, ts.DiagnosticCategory.Error, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), - _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, ts.DiagnosticCategory.Error, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."), + All_files_must_be_modules_when_the_isolatedModules_flag_is_provided: diag(1208, ts.DiagnosticCategory.Error, "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208", "All files must be modules when the '--isolatedModules' flag is provided."), Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: diag(1210, ts.DiagnosticCategory.Error, "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", "Invalid use of '{0}'. Class definitions are automatically in strict mode."), A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, ts.DiagnosticCategory.Error, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), Identifier_expected_0_is_a_reserved_word_in_strict_mode: diag(1212, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", "Identifier expected. '{0}' is a reserved word in strict mode."), @@ -5070,12 +4599,11 @@ var ts; A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, ts.DiagnosticCategory.Error, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."), A_rest_element_must_be_last_in_a_tuple_type: diag(1256, ts.DiagnosticCategory.Error, "A_rest_element_must_be_last_in_a_tuple_type_1256", "A rest element must be last in a tuple type."), A_required_element_cannot_follow_an_optional_element: diag(1257, ts.DiagnosticCategory.Error, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."), + Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation: diag(1258, ts.DiagnosticCategory.Error, "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258", "Definite assignment assertions can only be used along with a type annotation."), Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, ts.DiagnosticCategory.Error, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"), Keywords_cannot_contain_escape_characters: diag(1260, ts.DiagnosticCategory.Error, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."), Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, ts.DiagnosticCategory.Error, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."), Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."), - Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, ts.DiagnosticCategory.Error, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."), - Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, ts.DiagnosticCategory.Error, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."), with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."), @@ -5092,7 +4620,7 @@ var ts; Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_or_umd: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'esnext', 'commonjs', 'amd', 'system', or 'umd'."), Dynamic_import_must_have_one_specifier_as_an_argument: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_import_must_have_one_specifier_as_an_argument_1324", "Dynamic import must have one specifier as an argument."), Specifier_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Specifier_of_dynamic_import_cannot_be_spread_element_1325", "Specifier of dynamic import cannot be spread element."), - Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments."), + Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments"), String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."), Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: diag(1328, ts.DiagnosticCategory.Error, "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328", "Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."), _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: diag(1329, ts.DiagnosticCategory.Error, "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329", "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"), @@ -5108,9 +4636,9 @@ var ts; Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."), - The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system_1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'."), + The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system_1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'esnext' or 'system'."), A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), - An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), + An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness"), This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."), use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, ts.DiagnosticCategory.Error, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."), Non_simple_parameter_declared_here: diag(1348, ts.DiagnosticCategory.Error, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."), @@ -5153,7 +4681,6 @@ var ts; Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."), - _0_is_not_allowed_as_a_variable_declaration_name: diag(1389, ts.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."), The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", undefined, true), @@ -5279,7 +4806,6 @@ var ts; Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts.DiagnosticCategory.Error, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), - Types_of_construct_signatures_are_incompatible: diag(2419, ts.DiagnosticCategory.Error, "Types_of_construct_signatures_are_incompatible_2419", "Types of construct signatures are incompatible."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), @@ -5403,7 +4929,6 @@ var ts; The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: diag(2547, ts.DiagnosticCategory.Error, "The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547", "The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."), Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2548, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."), Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2549, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."), - Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later: diag(2550, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550", "Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later."), Property_0_does_not_exist_on_type_1_Did_you_mean_2: diag(2551, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", "Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"), Cannot_find_name_0_Did_you_mean_1: diag(2552, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Did_you_mean_1_2552", "Cannot find name '{0}'. Did you mean '{1}'?"), Computed_values_are_not_permitted_in_an_enum_with_string_valued_members: diag(2553, ts.DiagnosticCategory.Error, "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553", "Computed values are not permitted in an enum with string valued members."), @@ -5427,13 +4952,13 @@ var ts; Property_0_is_incompatible_with_rest_element_type: diag(2573, ts.DiagnosticCategory.Error, "Property_0_is_incompatible_with_rest_element_type_2573", "Property '{0}' is incompatible with rest element type."), A_rest_element_type_must_be_an_array_type: diag(2574, ts.DiagnosticCategory.Error, "A_rest_element_type_must_be_an_array_type_2574", "A rest element type must be an array type."), No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), - Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'."), + Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"), Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), Unused_ts_expect_error_directive: diag(2578, ts.DiagnosticCategory.Error, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."), - Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."), + Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."), @@ -5441,9 +4966,9 @@ var ts; Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), Type_instantiation_is_excessively_deep_and_possibly_infinite: diag(2589, ts.DiagnosticCategory.Error, "Type_instantiation_is_excessively_deep_and_possibly_infinite_2589", "Type instantiation is excessively deep and possibly infinite."), Expression_produces_a_union_type_that_is_too_complex_to_represent: diag(2590, ts.DiagnosticCategory.Error, "Expression_produces_a_union_type_that_is_too_complex_to_represent_2590", "Expression produces a union type that is too complex to represent."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."), This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, ts.DiagnosticCategory.Error, "This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594", "This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag."), _0_can_only_be_imported_by_using_a_default_import: diag(2595, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."), _0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."), @@ -5511,7 +5036,6 @@ var ts; All_declarations_of_0_must_have_identical_modifiers: diag(2687, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_modifiers_2687", "All declarations of '{0}' must have identical modifiers."), Cannot_find_type_definition_file_for_0: diag(2688, ts.DiagnosticCategory.Error, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, ts.DiagnosticCategory.Error, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), - _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, ts.DiagnosticCategory.Error, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."), _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, ts.DiagnosticCategory.Error, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), @@ -5545,7 +5069,7 @@ var ts; Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), - _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"), + Module_0_has_no_exported_member_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_2_2724", "Module '{0}' has no exported member '{1}'. Did you mean '{2}'?"), Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, ts.DiagnosticCategory.Error, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."), Cannot_find_lib_definition_for_0: diag(2726, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."), Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"), @@ -5553,7 +5077,7 @@ var ts; Property_0_is_used_before_its_initialization: diag(2729, ts.DiagnosticCategory.Error, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."), An_arrow_function_cannot_have_a_this_parameter: diag(2730, ts.DiagnosticCategory.Error, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."), Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."), - Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."), + Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension"), Property_0_was_also_declared_here: diag(2733, ts.DiagnosticCategory.Error, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."), Are_you_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"), Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"), @@ -5614,10 +5138,6 @@ var ts; The_operand_of_a_delete_operator_must_be_optional: diag(2790, ts.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_must_be_optional_2790", "The operand of a 'delete' operator must be optional."), Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: diag(2791, ts.DiagnosticCategory.Error, "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791", "Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."), Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option: diag(2792, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792", "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"), - The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: diag(2793, ts.DiagnosticCategory.Error, "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793", "The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."), - Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: diag(2794, ts.DiagnosticCategory.Error, "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794", "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"), - The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, ts.DiagnosticCategory.Error, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."), - It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked: diag(2796, ts.DiagnosticCategory.Error, "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796", "It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -5731,6 +5251,7 @@ var ts; Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: diag(5057, ts.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", "Cannot find a tsconfig.json file at the specified directory: '{0}'."), The_specified_path_does_not_exist_Colon_0: diag(5058, ts.DiagnosticCategory.Error, "The_specified_path_does_not_exist_Colon_0_5058", "The specified path does not exist: '{0}'."), Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, ts.DiagnosticCategory.Error, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."), + Option_paths_cannot_be_used_without_specifying_baseUrl_option: diag(5060, ts.DiagnosticCategory.Error, "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", "Option 'paths' cannot be used without specifying '--baseUrl' option."), Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, ts.DiagnosticCategory.Error, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."), Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: diag(5062, ts.DiagnosticCategory.Error, "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' can have at most one '*' character."), Substitutions_for_pattern_0_should_be_an_array: diag(5063, ts.DiagnosticCategory.Error, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."), @@ -5759,8 +5280,6 @@ var ts; A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: diag(5086, ts.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086", "A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."), A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, ts.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087", "A labeled tuple element is declared as rest with a `...` before the name, rather than before the type."), The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), - Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, ts.DiagnosticCategory.Error, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), - Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, ts.DiagnosticCategory.Error, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -5951,7 +5470,7 @@ var ts; Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"), _0_was_also_declared_here: diag(6203, ts.DiagnosticCategory.Message, "_0_was_also_declared_here_6203", "'{0}' was also declared here."), and_here: diag(6204, ts.DiagnosticCategory.Message, "and_here_6204", "and here."), - All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused."), + All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused"), package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."), package_json_does_not_have_a_typesVersions_entry_that_matches_version_0: diag(6207, ts.DiagnosticCategory.Message, "package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207", "'package.json' does not have a 'typesVersions' entry that matches version '{0}'."), package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2: diag(6208, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208", "'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."), @@ -5983,8 +5502,6 @@ var ts; This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without: diag(6234, ts.DiagnosticCategory.Error, "This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234", "This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"), Disable_loading_referenced_projects: diag(6235, ts.DiagnosticCategory.Message, "Disable_loading_referenced_projects_6235", "Disable loading referenced projects."), Arguments_for_the_rest_parameter_0_were_not_provided: diag(6236, ts.DiagnosticCategory.Error, "Arguments_for_the_rest_parameter_0_were_not_provided_6236", "Arguments for the rest parameter '{0}' were not provided."), - Generates_an_event_trace_and_a_list_of_types: diag(6237, ts.DiagnosticCategory.Message, "Generates_an_event_trace_and_a_list_of_types_6237", "Generates an event trace and a list of types."), - Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react: diag(6238, ts.DiagnosticCategory.Error, "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238", "Specify the module specifier to be used to import the `jsx` and `jsxs` factory functions from. eg, react"), Projects_to_reference: diag(6300, ts.DiagnosticCategory.Message, "Projects_to_reference_6300", "Projects to reference"), Enable_project_compilation: diag(6302, ts.DiagnosticCategory.Message, "Enable_project_compilation_6302", "Enable project compilation"), Composite_projects_may_not_disable_declaration_emit: diag(6304, ts.DiagnosticCategory.Error, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), @@ -6030,13 +5547,11 @@ var ts; Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, ts.DiagnosticCategory.Message, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"), Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, ts.DiagnosticCategory.Message, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."), _0_is_deprecated: diag(6385, ts.DiagnosticCategory.Suggestion, "_0_is_deprecated_6385", "'{0}' is deprecated", undefined, undefined, true), - Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, ts.DiagnosticCategory.Message, "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386", "Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing: diag(6503, ts.DiagnosticCategory.Message, "Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503", "Print names of files that are part of the compilation and then stop processing."), File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, ts.DiagnosticCategory.Error, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"), - Include_undefined_in_index_signature_results: diag(6800, ts.DiagnosticCategory.Message, "Include_undefined_in_index_signature_results_6800", "Include 'undefined' in index signature results"), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -6064,7 +5579,7 @@ var ts; Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: diag(7032, ts.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."), Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: diag(7033, ts.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."), Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), - Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035", "Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), + Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035", "Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts.DiagnosticCategory.Error, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead: diag(7038, ts.DiagnosticCategory.Message, "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038", "Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."), @@ -6085,7 +5600,6 @@ var ts; Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: diag(7053, ts.DiagnosticCategory.Error, "Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053", "Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."), No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1: diag(7054, ts.DiagnosticCategory.Error, "No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054", "No index signature with a parameter of type '{0}' was found on type '{1}'."), _0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type: diag(7055, ts.DiagnosticCategory.Error, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055", "'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."), - The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed: diag(7056, ts.DiagnosticCategory.Error, "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056", "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."), @@ -6196,7 +5710,6 @@ var ts; Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), - Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), Extract_function: diag(95005, ts.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"), Extract_constant: diag(95006, ts.DiagnosticCategory.Message, "Extract_constant_95006", "Extract constant"), @@ -6214,7 +5727,6 @@ var ts; Add_undefined_type_to_property_0: diag(95018, ts.DiagnosticCategory.Message, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"), Add_initializer_to_property_0: diag(95019, ts.DiagnosticCategory.Message, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"), Add_definite_assignment_assertion_to_property_0: diag(95020, ts.DiagnosticCategory.Message, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"), - Convert_all_type_literals_to_mapped_type: diag(95021, ts.DiagnosticCategory.Message, "Convert_all_type_literals_to_mapped_type_95021", "Convert all type literals to mapped type"), Add_all_missing_members: diag(95022, ts.DiagnosticCategory.Message, "Add_all_missing_members_95022", "Add all missing members"), Infer_all_types_from_usage: diag(95023, ts.DiagnosticCategory.Message, "Infer_all_types_from_usage_95023", "Infer all types from usage"), Delete_all_unused_declarations: diag(95024, ts.DiagnosticCategory.Message, "Delete_all_unused_declarations_95024", "Delete all unused declarations"), @@ -6336,12 +5848,10 @@ var ts; Could_not_find_convertible_access_expression: diag(95140, ts.DiagnosticCategory.Message, "Could_not_find_convertible_access_expression_95140", "Could not find convertible access expression"), Could_not_find_matching_access_expressions: diag(95141, ts.DiagnosticCategory.Message, "Could_not_find_matching_access_expressions_95141", "Could not find matching access expressions"), Can_only_convert_logical_AND_access_chains: diag(95142, ts.DiagnosticCategory.Message, "Can_only_convert_logical_AND_access_chains_95142", "Can only convert logical AND access chains"), - Add_void_to_Promise_resolved_without_a_value: diag(95143, ts.DiagnosticCategory.Message, "Add_void_to_Promise_resolved_without_a_value_95143", "Add 'void' to Promise resolved without a value"), - Add_void_to_all_Promises_resolved_without_a_value: diag(95144, ts.DiagnosticCategory.Message, "Add_void_to_all_Promises_resolved_without_a_value_95144", "Add 'void' to all Promises resolved without a value"), No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."), Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."), JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"), - Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts.DiagnosticCategory.Error, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters."), + Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts.DiagnosticCategory.Error, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters"), An_accessibility_modifier_cannot_be_used_with_a_private_identifier: diag(18010, ts.DiagnosticCategory.Error, "An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010", "An accessibility modifier cannot be used with a private identifier."), The_operand_of_a_delete_operator_cannot_be_a_private_identifier: diag(18011, ts.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011", "The operand of a 'delete' operator cannot be a private identifier."), constructor_is_a_reserved_word: diag(18012, ts.DiagnosticCategory.Error, "constructor_is_a_reserved_word_18012", "'#constructor' is a reserved word."), @@ -6351,7 +5861,7 @@ var ts; Private_identifiers_are_not_allowed_outside_class_bodies: diag(18016, ts.DiagnosticCategory.Error, "Private_identifiers_are_not_allowed_outside_class_bodies_18016", "Private identifiers are not allowed outside class bodies."), The_shadowing_declaration_of_0_is_defined_here: diag(18017, ts.DiagnosticCategory.Error, "The_shadowing_declaration_of_0_is_defined_here_18017", "The shadowing declaration of '{0}' is defined here"), The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here: diag(18018, ts.DiagnosticCategory.Error, "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018", "The declaration of '{0}' that you probably intended to use is defined here"), - _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier."), + _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier"), A_method_cannot_be_named_with_a_private_identifier: diag(18022, ts.DiagnosticCategory.Error, "A_method_cannot_be_named_with_a_private_identifier_18022", "A method cannot be named with a private identifier."), An_accessor_cannot_be_named_with_a_private_identifier: diag(18023, ts.DiagnosticCategory.Error, "An_accessor_cannot_be_named_with_a_private_identifier_18023", "An accessor cannot be named with a private identifier."), An_enum_member_cannot_be_named_with_a_private_identifier: diag(18024, ts.DiagnosticCategory.Error, "An_enum_member_cannot_be_named_with_a_private_identifier_18024", "An enum member cannot be named with a private identifier."), @@ -6383,7 +5893,7 @@ var ts; any: 128, as: 126, asserts: 127, - bigint: 155, + bigint: 154, boolean: 131, break: 80, case: 81, @@ -6405,7 +5915,7 @@ var ts; _a.false = 94, _a.finally = 95, _a.for = 96, - _a.from = 153, + _a.from = 152, _a.function = 97, _a.get = 134, _a.if = 98, @@ -6415,40 +5925,39 @@ var ts; _a.infer = 135, _a.instanceof = 101, _a.interface = 117, - _a.intrinsic = 136, - _a.is = 137, - _a.keyof = 138, + _a.is = 136, + _a.keyof = 137, _a.let = 118, - _a.module = 139, - _a.namespace = 140, - _a.never = 141, + _a.module = 138, + _a.namespace = 139, + _a.never = 140, _a.new = 102, _a.null = 103, - _a.number = 144, - _a.object = 145, + _a.number = 143, + _a.object = 144, _a.package = 119, _a.private = 120, _a.protected = 121, _a.public = 122, - _a.readonly = 142, - _a.require = 143, - _a.global = 154, + _a.readonly = 141, + _a.require = 142, + _a.global = 153, _a.return = 104, - _a.set = 146, + _a.set = 145, _a.static = 123, - _a.string = 147, + _a.string = 146, _a.super = 105, _a.switch = 106, - _a.symbol = 148, + _a.symbol = 147, _a.this = 107, _a.throw = 108, _a.true = 109, _a.try = 110, - _a.type = 149, + _a.type = 148, _a.typeof = 111, - _a.undefined = 150, - _a.unique = 151, - _a.unknown = 152, + _a.undefined = 149, + _a.unique = 150, + _a.unknown = 151, _a.var = 112, _a.void = 113, _a.while = 114, @@ -6456,7 +5965,7 @@ var ts; _a.yield = 124, _a.async = 129, _a.await = 130, - _a.of = 156, + _a.of = 155, _a); var textToKeyword = new ts.Map(ts.getEntries(textToKeywordObj)); var textToToken = new ts.Map(ts.getEntries(__assign(__assign({}, textToKeywordObj), { "{": 18, "}": 19, "(": 20, ")": 21, "[": 22, "]": 23, ".": 24, "...": 25, ";": 26, ",": 27, "<": 29, ">": 31, "<=": 32, ">=": 33, "==": 34, "!=": 35, "===": 36, "!==": 37, "=>": 38, "+": 39, "-": 40, "**": 42, "*": 41, "/": 43, "%": 44, "++": 45, "--": 46, "<<": 47, ">": 48, ">>>": 49, "&": 50, "|": 51, "^": 52, "!": 53, "~": 54, "&&": 55, "||": 56, "?": 57, "??": 60, "?.": 28, ":": 58, "=": 62, "+=": 63, "-=": 64, "*=": 65, "**=": 66, "/=": 67, "%=": 68, "<<=": 69, ">>=": 70, ">>>=": 71, "&=": 72, "|=": 73, "^=": 77, "||=": 74, "&&=": 75, "??=": 76, "@": 59, "`": 61 }))); @@ -7467,7 +6976,7 @@ var ts; } function getIdentifierToken() { var len = tokenValue.length; - if (len >= 2 && len <= 12) { + if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 && ch <= 122) { var keyword = textToKeyword.get(tokenValue); @@ -8522,9 +8031,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 159) { + if (d && d.kind === 158) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 253) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 250) { return current; } } @@ -8532,7 +8041,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasSyntacticModifier(node, 92) && parent.kind === 166; + return ts.hasSyntacticModifier(node, 92) && parent.kind === 165; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -8562,14 +8071,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 249) { + if (node.kind === 246) { node = node.parent; } - if (node && node.kind === 250) { + if (node && node.kind === 247) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 232) { + if (node && node.kind === 229) { flags |= getFlags(node); } return flags; @@ -8643,20 +8152,6 @@ var ts; return !nodeTest || nodeTest(node) ? node : undefined; } ts.getOriginalNode = getOriginalNode; - function findAncestor(node, callback) { - while (node) { - var result = callback(node); - if (result === "quit") { - return undefined; - } - else if (result) { - return node; - } - node = node.parent; - } - return undefined; - } - ts.findAncestor = findAncestor; function isParseTreeNode(node) { return (node.flags & 8) === 0; } @@ -8703,30 +8198,30 @@ var ts; return getDeclarationIdentifier(hostNode); } switch (hostNode.kind) { - case 232: + case 229: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 233: + case 230: var expr = hostNode.expression; - if (expr.kind === 216 && expr.operatorToken.kind === 62) { + if (expr.kind === 213 && expr.operatorToken.kind === 62) { expr = expr.left; } switch (expr.kind) { - case 201: + case 198: return expr.name; - case 202: + case 199: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; } } break; - case 207: { + case 204: { return getDeclarationIdentifier(hostNode.expression); } - case 245: { + case 242: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -8760,16 +8255,16 @@ var ts; switch (declaration.kind) { case 78: return declaration; - case 333: - case 326: { + case 328: + case 322: { var name = declaration.name; - if (name.kind === 157) { + if (name.kind === 156) { return name.right; } break; } - case 203: - case 216: { + case 200: + case 213: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1: @@ -8785,15 +8280,15 @@ var ts; return undefined; } } - case 331: + case 327: return getNameOfJSDocTypedef(declaration); - case 325: + case 321: return nameForNamelessJSDocTypedef(declaration); - case 266: { + case 263: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } - case 202: + case 199: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -9010,7 +8505,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 311); + ts.Debug.assert(node.parent.kind === 307); return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -9040,7 +8535,7 @@ var ts; } ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; function isGetOrSetAccessorDeclaration(node) { - return node.kind === 168 || node.kind === 167; + return node.kind === 167 || node.kind === 166; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; function isPropertyAccessChain(node) { @@ -9058,10 +8553,10 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32) && - (kind === 201 - || kind === 202 - || kind === 203 - || kind === 225); + (kind === 198 + || kind === 199 + || kind === 200 + || kind === 222); } ts.isOptionalChain = isOptionalChain; function isOptionalChainRoot(node) { @@ -9079,7 +8574,7 @@ var ts; } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 216 && node.operatorToken.kind === 60; + return node.kind === 213 && node.operatorToken.kind === 60; } ts.isNullishCoalesce = isNullishCoalesce; function isConstTypeReference(node) { @@ -9096,17 +8591,17 @@ var ts; } ts.isNonNullChain = isNonNullChain; function isBreakOrContinueStatement(node) { - return node.kind === 241 || node.kind === 240; + return node.kind === 238 || node.kind === 237; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isNamedExportBindings(node) { - return node.kind === 269 || node.kind === 268; + return node.kind === 266 || node.kind === 265; } ts.isNamedExportBindings = isNamedExportBindings; function isUnparsedTextLike(node) { switch (node.kind) { - case 294: - case 295: + case 291: + case 292: return true; default: return false; @@ -9115,12 +8610,12 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 292 || - node.kind === 296; + node.kind === 289 || + node.kind === 293; } ts.isUnparsedNode = isUnparsedNode; function isJSDocPropertyLikeTag(node) { - return node.kind === 333 || node.kind === 326; + return node.kind === 328 || node.kind === 322; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isNode(node) { @@ -9128,11 +8623,11 @@ var ts; } ts.isNode = isNode; function isNodeKind(kind) { - return kind >= 157; + return kind >= 156; } ts.isNodeKind = isNodeKind; function isToken(n) { - return n.kind >= 0 && n.kind <= 156; + return n.kind >= 0 && n.kind <= 155; } ts.isToken = isToken; function isNodeArray(array) { @@ -9167,12 +8662,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 265: - case 270: - return node.parent.parent.isTypeOnly; - case 263: - return node.parent.isTypeOnly; case 262: + case 267: + return node.parent.parent.isTypeOnly; + case 260: + return node.parent.isTypeOnly; + case 259: return node.isTypeOnly; default: return false; @@ -9206,7 +8701,7 @@ var ts; case 122: case 120: case 121: - case 142: + case 141: case 123: return true; } @@ -9227,7 +8722,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 157 + return kind === 156 || kind === 78; } ts.isEntityName = isEntityName; @@ -9237,14 +8732,14 @@ var ts; || kind === 79 || kind === 10 || kind === 8 - || kind === 158; + || kind === 157; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 78 - || kind === 196 - || kind === 197; + || kind === 193 + || kind === 194; } ts.isBindingName = isBindingName; function isFunctionLike(node) { @@ -9257,13 +8752,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 251: + case 248: + case 164: case 165: case 166: case 167: - case 168: - case 208: - case 209: + case 205: + case 206: return true; default: return false; @@ -9271,14 +8766,14 @@ var ts; } function isFunctionLikeKind(kind) { switch (kind) { - case 164: + case 163: + case 168: + case 309: case 169: - case 313: case 170: - case 171: + case 173: + case 304: case 174: - case 308: - case 175: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -9291,28 +8786,28 @@ var ts; ts.isFunctionOrModuleBlock = isFunctionOrModuleBlock; function isClassElement(node) { var kind = node.kind; - return kind === 166 - || kind === 163 - || kind === 165 + return kind === 165 + || kind === 162 + || kind === 164 + || kind === 166 || kind === 167 - || kind === 168 - || kind === 171 - || kind === 229; + || kind === 170 + || kind === 226; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 252 || node.kind === 221); + return node && (node.kind === 249 || node.kind === 218); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 167 || node.kind === 168); + return node && (node.kind === 166 || node.kind === 167); } ts.isAccessor = isAccessor; function isMethodOrAccessor(node) { switch (node.kind) { - case 165: + case 164: + case 166: case 167: - case 168: return true; default: return false; @@ -9321,11 +8816,11 @@ var ts; ts.isMethodOrAccessor = isMethodOrAccessor; function isTypeElement(node) { var kind = node.kind; - return kind === 170 - || kind === 169 - || kind === 162 - || kind === 164 - || kind === 171; + return kind === 169 + || kind === 168 + || kind === 161 + || kind === 163 + || kind === 170; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -9334,12 +8829,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 288 - || kind === 289 - || kind === 290 - || kind === 165 - || kind === 167 - || kind === 168; + return kind === 285 + || kind === 286 + || kind === 287 + || kind === 164 + || kind === 166 + || kind === 167; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; function isTypeNode(node) { @@ -9348,8 +8843,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { + case 173: case 174: - case 175: return true; } return false; @@ -9358,29 +8853,29 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 197 - || kind === 196; + return kind === 194 + || kind === 193; } return false; } ts.isBindingPattern = isBindingPattern; function isAssignmentPattern(node) { var kind = node.kind; - return kind === 199 - || kind === 200; + return kind === 196 + || kind === 197; } ts.isAssignmentPattern = isAssignmentPattern; function isArrayBindingElement(node) { var kind = node.kind; - return kind === 198 - || kind === 222; + return kind === 195 + || kind === 219; } ts.isArrayBindingElement = isArrayBindingElement; function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 249: - case 160: - case 198: + case 246: + case 159: + case 195: return true; } return false; @@ -9393,8 +8888,8 @@ var ts; ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern; function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 196: - case 200: + case 193: + case 197: return true; } return false; @@ -9402,8 +8897,8 @@ var ts; ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern; function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 197: - case 199: + case 194: + case 196: return true; } return false; @@ -9411,25 +8906,25 @@ var ts; ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 201 - || kind === 157 - || kind === 195; + return kind === 198 + || kind === 156 + || kind === 192; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 201 - || kind === 157; + return kind === 198 + || kind === 156; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 275: - case 274: - case 203: - case 204: - case 205: - case 161: + case 272: + case 271: + case 200: + case 201: + case 202: + case 160: return true; default: return false; @@ -9437,12 +8932,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 203 || node.kind === 204; + return node.kind === 200 || node.kind === 201; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 218 + return kind === 215 || kind === 14; } ts.isTemplateLiteral = isTemplateLiteral; @@ -9452,33 +8947,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 201: - case 202: - case 204: - case 203: - case 273: - case 274: - case 277: - case 205: + case 198: case 199: - case 207: + case 201: case 200: - case 221: - case 208: + case 270: + case 271: + case 274: + case 202: + case 196: + case 204: + case 197: + case 218: + case 205: case 78: case 13: case 8: case 9: case 10: case 14: - case 218: + case 215: case 94: case 103: case 107: case 109: case 105: - case 225: - case 226: + case 222: + case 223: case 99: return true; default: @@ -9491,13 +8986,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 214: - case 215: - case 210: case 211: case 212: - case 213: - case 206: + case 207: + case 208: + case 209: + case 210: + case 203: return true; default: return isLeftHandSideExpressionKind(kind); @@ -9505,9 +9000,9 @@ var ts; } function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 215: + case 212: return true; - case 214: + case 211: return expr.operator === 45 || expr.operator === 46; default: @@ -9521,15 +9016,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 217: - case 219: - case 209: + case 214: case 216: - case 220: - case 224: - case 222: - case 337: - case 336: + case 206: + case 213: + case 217: + case 221: + case 219: + case 332: + case 331: return true; default: return isUnaryExpressionKind(kind); @@ -9537,8 +9032,8 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 206 - || kind === 224; + return kind === 203 + || kind === 221; } ts.isAssertionExpression = isAssertionExpression; function isNotEmittedOrPartiallyEmittedNode(node) { @@ -9548,13 +9043,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 237: - case 238: - case 239: + case 234: case 235: case 236: + case 232: + case 233: return true; - case 245: + case 242: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -9577,7 +9072,7 @@ var ts; } ts.isExternalModuleIndicator = isExternalModuleIndicator; function isForInOrOfStatement(node) { - return node.kind === 238 || node.kind === 239; + return node.kind === 235 || node.kind === 236; } ts.isForInOrOfStatement = isForInOrOfStatement; function isConciseBody(node) { @@ -9596,109 +9091,109 @@ var ts; ts.isForInitializer = isForInitializer; function isModuleBody(node) { var kind = node.kind; - return kind === 257 - || kind === 256 + return kind === 254 + || kind === 253 || kind === 78; } ts.isModuleBody = isModuleBody; function isNamespaceBody(node) { var kind = node.kind; - return kind === 257 - || kind === 256; + return kind === 254 + || kind === 253; } ts.isNamespaceBody = isNamespaceBody; function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 78 - || kind === 256; + || kind === 253; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; function isNamedImportBindings(node) { var kind = node.kind; - return kind === 264 - || kind === 263; + return kind === 261 + || kind === 260; } ts.isNamedImportBindings = isNamedImportBindings; function isModuleOrEnumDeclaration(node) { - return node.kind === 256 || node.kind === 255; + return node.kind === 253 || node.kind === 252; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 209 - || kind === 198 - || kind === 252 - || kind === 221 - || kind === 166 - || kind === 255 - || kind === 291 - || kind === 270 - || kind === 251 - || kind === 208 - || kind === 167 - || kind === 262 - || kind === 260 - || kind === 265 - || kind === 253 - || kind === 280 - || kind === 165 - || kind === 164 - || kind === 256 - || kind === 259 - || kind === 263 - || kind === 269 - || kind === 160 - || kind === 288 - || kind === 163 - || kind === 162 - || kind === 168 - || kind === 289 - || kind === 254 - || kind === 159 + return kind === 206 + || kind === 195 || kind === 249 - || kind === 331 - || kind === 324 - || kind === 333; + || kind === 218 + || kind === 165 + || kind === 252 + || kind === 288 + || kind === 267 + || kind === 248 + || kind === 205 + || kind === 166 + || kind === 259 + || kind === 257 + || kind === 262 + || kind === 250 + || kind === 277 + || kind === 164 + || kind === 163 + || kind === 253 + || kind === 256 + || kind === 260 + || kind === 266 + || kind === 159 + || kind === 285 + || kind === 162 + || kind === 161 + || kind === 167 + || kind === 286 + || kind === 251 + || kind === 158 + || kind === 246 + || kind === 327 + || kind === 320 + || kind === 328; } function isDeclarationStatementKind(kind) { - return kind === 251 - || kind === 271 + return kind === 248 + || kind === 268 + || kind === 249 + || kind === 250 + || kind === 251 || kind === 252 || kind === 253 - || kind === 254 - || kind === 255 - || kind === 256 - || kind === 261 - || kind === 260 - || kind === 267 - || kind === 266 - || kind === 259; + || kind === 258 + || kind === 257 + || kind === 264 + || kind === 263 + || kind === 256; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 241 - || kind === 240 - || kind === 248 - || kind === 235 - || kind === 233 - || kind === 231 - || kind === 238 - || kind === 239 + return kind === 238 || kind === 237 - || kind === 234 || kind === 245 - || kind === 242 - || kind === 244 - || kind === 246 - || kind === 247 || kind === 232 + || kind === 230 + || kind === 228 + || kind === 235 || kind === 236 + || kind === 234 + || kind === 231 + || kind === 242 + || kind === 239 + || kind === 241 || kind === 243 - || kind === 335 - || kind === 339 - || kind === 338; + || kind === 244 + || kind === 229 + || kind === 233 + || kind === 240 + || kind === 330 + || kind === 334 + || kind === 333; } function isDeclaration(node) { - if (node.kind === 159) { - return (node.parent && node.parent.kind !== 330) || ts.isInJSFile(node); + if (node.kind === 158) { + return (node.parent && node.parent.kind !== 326) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -9719,10 +9214,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 230) + if (node.kind !== 227) return false; if (node.parent !== undefined) { - if (node.parent.kind === 247 || node.parent.kind === 287) { + if (node.parent.kind === 244 || node.parent.kind === 284) { return false; } } @@ -9732,13 +9227,13 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 230; + || kind === 227; } ts.isStatementOrBlock = isStatementOrBlock; function isModuleReference(node) { var kind = node.kind; - return kind === 272 - || kind === 157 + return kind === 269 + || kind === 156 || kind === 78; } ts.isModuleReference = isModuleReference; @@ -9746,60 +9241,60 @@ var ts; var kind = node.kind; return kind === 107 || kind === 78 - || kind === 201; + || kind === 198; } ts.isJsxTagNameExpression = isJsxTagNameExpression; function isJsxChild(node) { var kind = node.kind; - return kind === 273 - || kind === 283 - || kind === 274 + return kind === 270 + || kind === 280 + || kind === 271 || kind === 11 - || kind === 277; + || kind === 274; } ts.isJsxChild = isJsxChild; function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 280 - || kind === 282; + return kind === 277 + || kind === 279; } ts.isJsxAttributeLike = isJsxAttributeLike; function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 - || kind === 283; + || kind === 280; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 275 - || kind === 274; + return kind === 272 + || kind === 271; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 284 - || kind === 285; + return kind === 281 + || kind === 282; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; function isJSDocNode(node) { - return node.kind >= 301 && node.kind <= 333; + return node.kind >= 298 && node.kind <= 328; } ts.isJSDocNode = isJSDocNode; function isJSDocCommentContainingNode(node) { - return node.kind === 311 || node.kind === 310 || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node); + return node.kind === 307 || node.kind === 306 || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; function isJSDocTag(node) { - return node.kind >= 314 && node.kind <= 333; + return node.kind >= 310 && node.kind <= 328; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 168; + return node.kind === 167; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 167; + return node.kind === 166; } ts.isGetAccessor = isGetAccessor; function hasJSDocNodes(node) { @@ -9817,13 +9312,13 @@ var ts; ts.hasInitializer = hasInitializer; function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 249: - case 160: - case 198: + case 246: + case 159: + case 195: + case 161: case 162: - case 163: + case 285: case 288: - case 291: return true; default: return false; @@ -9831,11 +9326,11 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 280 || node.kind === 282 || isObjectLiteralElementLike(node); + return node.kind === 277 || node.kind === 279 || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; function isTypeReferenceType(node) { - return node.kind === 173 || node.kind === 223; + return node.kind === 172 || node.kind === 220; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -9956,6 +9451,20 @@ var ts; }); } ts.optionsHaveModuleResolutionChanges = optionsHaveModuleResolutionChanges; + function findAncestor(node, callback) { + while (node) { + var result = callback(node); + if (result === "quit") { + return undefined; + } + else if (result) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.findAncestor = findAncestor; function forEachAncestor(node, callback) { while (true) { var res = callback(node); @@ -10090,7 +9599,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 297) { + while (node && node.kind !== 294) { node = node.parent; } return node; @@ -10098,11 +9607,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 230: - case 258: - case 237: - case 238: - case 239: + case 227: + case 255: + case 234: + case 235: + case 236: return true; } return false; @@ -10252,7 +9761,7 @@ var ts; if (includeJsDoc && ts.hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0], sourceFile); } - if (node.kind === 334 && node._children.length > 0) { + if (node.kind === 329 && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -10271,12 +9780,8 @@ var ts; } ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile; function isJSDocTypeExpressionOrChild(node) { - return !!ts.findAncestor(node, ts.isJSDocTypeExpression); + return !!findAncestor(node, ts.isJSDocTypeExpression); } - function isExportNamespaceAsDefaultDeclaration(node) { - return !!(ts.isExportDeclaration(node) && node.exportClause && ts.isNamespaceExport(node.exportClause) && node.exportClause.name.escapedText === "default"); - } - ts.isExportNamespaceAsDefaultDeclaration = isExportNamespaceAsDefaultDeclaration; function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) { if (includeTrivia === void 0) { includeTrivia = false; } if (nodeIsMissing(node)) { @@ -10306,83 +9811,15 @@ var ts; return emitNode && emitNode.flags || 0; } ts.getEmitFlags = getEmitFlags; - ; - function getScriptTargetFeatures() { - return { - es2015: { - Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"], - RegExp: ["flags", "sticky", "unicode"], - Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"], - ArrayConstructor: ["from", "of"], - ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"], - NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"], - Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"], - Map: ["entries", "keys", "values"], - Set: ["entries", "keys", "values"], - Promise: ts.emptyArray, - PromiseConstructor: ["all", "race", "reject", "resolve"], - Symbol: ["for", "keyFor"], - WeakMap: ["entries", "keys", "values"], - WeakSet: ["entries", "keys", "values"], - Iterator: ts.emptyArray, - AsyncIterator: ts.emptyArray, - String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"], - StringConstructor: ["fromCodePoint", "raw"] - }, - es2016: { - Array: ["includes"] - }, - es2017: { - Atomics: ts.emptyArray, - SharedArrayBuffer: ts.emptyArray, - String: ["padStart", "padEnd"], - ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"], - DateTimeFormat: ["formatToParts"] - }, - es2018: { - Promise: ["finally"], - RegExpMatchArray: ["groups"], - RegExpExecArray: ["groups"], - RegExp: ["dotAll"], - Intl: ["PluralRules"], - AsyncIterable: ts.emptyArray, - AsyncIterableIterator: ts.emptyArray, - AsyncGenerator: ts.emptyArray, - AsyncGeneratorFunction: ts.emptyArray, - }, - es2019: { - Array: ["flat", "flatMap"], - ObjectConstructor: ["fromEntries"], - String: ["trimStart", "trimEnd", "trimLeft", "trimRight"], - Symbol: ["description"] - }, - es2020: { - BigInt: ts.emptyArray, - BigInt64Array: ts.emptyArray, - BigUint64Array: ts.emptyArray, - PromiseConstructor: ["allSettled"], - SymbolConstructor: ["matchAll"], - String: ["matchAll"], - DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"], - RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"] - }, - esnext: { - PromiseConstructor: ["any"], - String: ["replaceAll"], - NumberFormat: ["formatToParts"] - } - }; - } - ts.getScriptTargetFeatures = getScriptTargetFeatures; - function getLiteralText(node, sourceFile, flags) { - if (!nodeIsSynthesized(node) && node.parent && !(flags & 4 && node.isUnterminated) && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512) || + function getLiteralText(node, sourceFile, neverAsciiEscape, jsxAttributeEscape) { + if (!nodeIsSynthesized(node) && node.parent && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512) || ts.isBigIntLiteral(node))) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); } switch (node.kind) { case 10: { - var escapeText = flags & 2 ? escapeJsxAttributeString : - flags & 1 || (getEmitFlags(node) & 16777216) ? escapeString : + var escapeText = jsxAttributeEscape ? escapeJsxAttributeString : + neverAsciiEscape || (getEmitFlags(node) & 16777216) ? escapeString : escapeNonAsciiString; if (node.singleQuote) { return "'" + escapeText(node.text, 39) + "'"; @@ -10395,7 +9832,7 @@ var ts; case 15: case 16: case 17: { - var escapeText = flags & 1 || (getEmitFlags(node) & 16777216) ? escapeString : + var escapeText = neverAsciiEscape || (getEmitFlags(node) & 16777216) ? escapeString : escapeNonAsciiString; var rawText = node.rawText || escapeTemplateSubstitution(escapeText(node.text, 96)); switch (node.kind) { @@ -10412,11 +9849,7 @@ var ts; } case 8: case 9: - return node.text; case 13: - if (flags & 4 && node.isUnterminated) { - return node.text + (node.text.charCodeAt(node.text.length - 1) === 92 ? " /" : "/"); - } return node.text; } return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); @@ -10437,7 +9870,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 249 && node.parent.kind === 287; + return node.kind === 246 && node.parent.kind === 284; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -10461,11 +9894,11 @@ var ts; } ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { - return node && node.kind === 256 && (!node.body); + return node && node.kind === 253 && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 297 || - node.kind === 256 || + return node.kind === 294 || + node.kind === 253 || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -10479,9 +9912,9 @@ var ts; ts.isExternalModuleAugmentation = isExternalModuleAugmentation; function isModuleAugmentationExternal(node) { switch (node.parent.kind) { - case 297: + case 294: return ts.isExternalModule(node.parent); - case 257: + case 254: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -10525,22 +9958,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 297: - case 258: - case 287: - case 256: - case 237: - case 238: - case 239: - case 166: + case 294: + case 255: + case 284: + case 253: + case 234: + case 235: + case 236: case 165: + case 164: + case 166: case 167: - case 168: - case 251: - case 208: - case 209: + case 248: + case 205: + case 206: return true; - case 230: + case 227: return !ts.isFunctionLike(parentNode); } return false; @@ -10548,9 +9981,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 324: - case 331: - case 313: + case 320: + case 327: + case 309: return true; default: ts.assertType(node); @@ -10560,25 +9993,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { + case 168: case 169: + case 163: case 170: - case 164: - case 171: + case 173: case 174: - case 175: - case 308: - case 252: - case 221: - case 253: - case 254: - case 330: + case 304: + case 249: + case 218: + case 250: case 251: + case 326: + case 248: + case 164: case 165: case 166: case 167: - case 168: - case 208: - case 209: + case 205: + case 206: return true; default: ts.assertType(node); @@ -10588,8 +10021,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 261: - case 260: + case 258: + case 257: return true; default: return false; @@ -10598,15 +10031,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 261: - case 260: - case 232: - case 252: - case 251: - case 256: - case 254: + case 258: + case 257: + case 229: + case 249: + case 248: case 253: - case 255: + case 251: + case 250: + case 252: return true; default: return false; @@ -10618,7 +10051,7 @@ var ts; } ts.isAnyImportOrReExport = isAnyImportOrReExport; function getEnclosingBlockScopeContainer(node) { - return ts.findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); }); + return findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); }); } ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; function declarationNameToString(name) { @@ -10630,7 +10063,7 @@ var ts; } ts.getNameFromIndexInfo = getNameFromIndexInfo; function isComputedNonLiteralName(name) { - return name.kind === 158 && !isStringOrNumericLiteralLike(name.expression); + return name.kind === 157 && !isStringOrNumericLiteralLike(name.expression); } ts.isComputedNonLiteralName = isComputedNonLiteralName; function getTextOfPropertyName(name) { @@ -10642,7 +10075,7 @@ var ts; case 8: case 14: return ts.escapeLeadingUnderscores(name.text); - case 158: + case 157: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -10658,9 +10091,9 @@ var ts; case 79: case 78: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 157: + case 156: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 201: + case 198: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -10701,18 +10134,6 @@ var ts; }; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; - function createDiagnosticForFileFromMessageChain(sourceFile, messageChain, relatedInformation) { - return { - file: sourceFile, - start: 0, - length: 0, - code: messageChain.code, - category: messageChain.category, - messageText: messageChain.next ? messageChain : messageChain.messageText, - relatedInformation: relatedInformation - }; - } - ts.createDiagnosticForFileFromMessageChain = createDiagnosticForFileFromMessageChain; function createDiagnosticForRange(sourceFile, range, message) { return { file: sourceFile, @@ -10733,7 +10154,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 230) { + if (node.body && node.body.kind === 227) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -10745,34 +10166,34 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 297: + case 294: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); + case 246: + case 195: case 249: - case 198: - case 252: - case 221: + case 218: + case 250: case 253: - case 256: - case 255: - case 291: - case 251: - case 208: - case 165: + case 252: + case 288: + case 248: + case 205: + case 164: + case 166: case 167: - case 168: - case 254: - case 163: + case 251: case 162: + case 161: errorNode = node.name; break; - case 209: + case 206: return getErrorSpanForArrowFunction(sourceFile, node); - case 284: - case 285: + case 281: + case 282: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -10821,11 +10242,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 203 && n.expression.kind === 105; + return n.kind === 200 && n.expression.kind === 105; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 203 && n.expression.kind === 99; + return n.kind === 200 && n.expression.kind === 99; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -10839,7 +10260,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 233 + return node.kind === 230 && node.expression.kind === 10; } ts.isPrologueDirective = isPrologueDirective; @@ -10867,11 +10288,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 160 || - node.kind === 159 || - node.kind === 208 || - node.kind === 209 || - node.kind === 207) ? + var commentRanges = (node.kind === 159 || + node.kind === 158 || + node.kind === 205 || + node.kind === 206 || + node.kind === 204) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); return ts.filter(commentRanges, function (comment) { @@ -10886,79 +10307,79 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (172 <= node.kind && node.kind <= 195) { + if (171 <= node.kind && node.kind <= 192) { return true; } switch (node.kind) { case 128: - case 152: - case 144: - case 155: - case 147: + case 151: + case 143: + case 154: + case 146: case 131: - case 148: - case 145: - case 150: - case 141: + case 147: + case 144: + case 149: + case 140: return true; case 113: - return node.parent.kind !== 212; - case 223: + return node.parent.kind !== 209; + case 220: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 159: - return node.parent.kind === 190 || node.parent.kind === 185; + case 158: + return node.parent.kind === 189 || node.parent.kind === 184; case 78: - if (node.parent.kind === 157 && node.parent.right === node) { + if (node.parent.kind === 156 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 201 && node.parent.name === node) { + else if (node.parent.kind === 198 && node.parent.name === node) { node = node.parent; } - ts.Debug.assert(node.kind === 78 || node.kind === 157 || node.kind === 201, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - case 157: - case 201: + ts.Debug.assert(node.kind === 78 || node.kind === 156 || node.kind === 198, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + case 156: + case 198: case 107: { var parent = node.parent; - if (parent.kind === 176) { + if (parent.kind === 175) { return false; } - if (parent.kind === 195) { + if (parent.kind === 192) { return !parent.isTypeOf; } - if (172 <= parent.kind && parent.kind <= 195) { + if (171 <= parent.kind && parent.kind <= 192) { return true; } switch (parent.kind) { - case 223: + case 220: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 159: + case 158: return node === parent.constraint; - case 330: + case 326: return node === parent.constraint; - case 163: case 162: - case 160: - case 249: + case 161: + case 159: + case 246: return node === parent.type; - case 251: - case 208: - case 209: - case 166: + case 248: + case 205: + case 206: case 165: case 164: + case 163: + case 166: case 167: - case 168: return node === parent.type; + case 168: case 169: case 170: - case 171: - return node === parent.type; - case 206: return node === parent.type; case 203: - case 204: + return node === parent.type; + case 200: + case 201: return ts.contains(parent.typeArguments, node); - case 205: + case 202: return false; } } @@ -10980,23 +10401,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 242: + case 239: return visitor(node); - case 258: - case 230: + case 255: + case 227: + case 231: + case 232: + case 233: case 234: case 235: case 236: - case 237: - case 238: - case 239: - case 243: + case 240: + case 241: + case 281: + case 282: + case 242: case 244: case 284: - case 285: - case 245: - case 247: - case 287: return ts.forEachChild(node, traverse); } } @@ -11006,21 +10427,21 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 219: + case 216: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 255: + case 252: + case 250: case 253: - case 256: - case 254: + case 251: return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 158) { + if (node.name && node.name.kind === 157) { traverse(node.name.expression); return; } @@ -11033,10 +10454,10 @@ var ts; } ts.forEachYieldExpression = forEachYieldExpression; function getRestParameterElementType(node) { - if (node && node.kind === 178) { + if (node && node.kind === 177) { return node.elementType; } - else if (node && node.kind === 173) { + else if (node && node.kind === 172) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -11046,12 +10467,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 253: - case 252: - case 221: - case 177: + case 250: + case 249: + case 218: + case 176: return node.members; - case 200: + case 197: return node.properties; } } @@ -11059,14 +10480,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 198: - case 291: - case 160: + case 195: case 288: - case 163: + case 159: + case 285: case 162: - case 289: - case 249: + case 161: + case 286: + case 246: return true; } } @@ -11078,8 +10499,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 250 - && node.parent.parent.kind === 232; + return node.parent.kind === 247 + && node.parent.parent.kind === 229; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -11090,13 +10511,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 165: case 164: + case 163: + case 165: case 166: case 167: - case 168: - case 251: - case 208: + case 248: + case 205: return true; } return false; @@ -11107,7 +10528,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 245) { + if (node.statement.kind !== 242) { return node.statement; } node = node.statement; @@ -11115,17 +10536,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 230 && ts.isFunctionLike(node.parent); + return node && node.kind === 227 && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 165 && node.parent.kind === 200; + return node && node.kind === 164 && node.parent.kind === 197; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 165 && - (node.parent.kind === 200 || - node.parent.kind === 221); + return node.kind === 164 && + (node.parent.kind === 197 || + node.parent.kind === 218); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -11138,7 +10559,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 288) { + if (property.kind === 285) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -11167,58 +10588,58 @@ var ts; } ts.getTsConfigPropArray = getTsConfigPropArray; function getContainingFunction(node) { - return ts.findAncestor(node.parent, ts.isFunctionLike); + return findAncestor(node.parent, ts.isFunctionLike); } ts.getContainingFunction = getContainingFunction; function getContainingFunctionDeclaration(node) { - return ts.findAncestor(node.parent, ts.isFunctionLikeDeclaration); + return findAncestor(node.parent, ts.isFunctionLikeDeclaration); } ts.getContainingFunctionDeclaration = getContainingFunctionDeclaration; function getContainingClass(node) { - return ts.findAncestor(node.parent, ts.isClassLike); + return findAncestor(node.parent, ts.isClassLike); } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 297); + ts.Debug.assert(node.kind !== 294); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); } switch (node.kind) { - case 158: + case 157: if (ts.isClassLike(node.parent.parent)) { return node; } node = node.parent; break; - case 161: - if (node.parent.kind === 160 && ts.isClassElement(node.parent.parent)) { + case 160: + if (node.parent.kind === 159 && ts.isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (ts.isClassElement(node.parent)) { node = node.parent; } break; - case 209: + case 206: if (!includeArrowFunctions) { continue; } - case 251: - case 208: - case 256: - case 163: + case 248: + case 205: + case 253: case 162: - case 165: + case 161: case 164: + case 163: + case 165: case 166: case 167: case 168: case 169: case 170: - case 171: - case 255: - case 297: + case 252: + case 294: return node; } } @@ -11236,9 +10657,9 @@ var ts; var container = getThisContainer(node, false); if (container) { switch (container.kind) { - case 166: - case 251: - case 208: + case 165: + case 248: + case 205: return container; } } @@ -11252,25 +10673,25 @@ var ts; return node; } switch (node.kind) { - case 158: + case 157: node = node.parent; break; - case 251: - case 208: - case 209: + case 248: + case 205: + case 206: if (!stopOnFunctions) { continue; } - case 163: case 162: - case 165: + case 161: case 164: + case 163: + case 165: case 166: case 167: - case 168: return node; - case 161: - if (node.parent.kind === 160 && ts.isClassElement(node.parent.parent)) { + case 160: + if (node.parent.kind === 159 && ts.isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (ts.isClassElement(node.parent)) { @@ -11282,14 +10703,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 208 || func.kind === 209) { + if (func.kind === 205 || func.kind === 206) { var prev = func; var parent = func.parent; - while (parent.kind === 207) { + while (parent.kind === 204) { prev = parent; parent = parent.parent; } - if (parent.kind === 203 && parent.expression === prev) { + if (parent.kind === 200 && parent.expression === prev) { return parent; } } @@ -11302,31 +10723,26 @@ var ts; ts.isSuperOrSuperProperty = isSuperOrSuperProperty; function isSuperProperty(node) { var kind = node.kind; - return (kind === 201 || kind === 202) + return (kind === 198 || kind === 199) && node.expression.kind === 105; } ts.isSuperProperty = isSuperProperty; function isThisProperty(node) { var kind = node.kind; - return (kind === 201 || kind === 202) + return (kind === 198 || kind === 199) && node.expression.kind === 107; } ts.isThisProperty = isThisProperty; - function isThisInitializedDeclaration(node) { - var _a; - return !!node && ts.isVariableDeclaration(node) && ((_a = node.initializer) === null || _a === void 0 ? void 0 : _a.kind) === 107; - } - ts.isThisInitializedDeclaration = isThisInitializedDeclaration; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 173: + case 172: return node.typeName; - case 223: + case 220: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 78: - case 157: + case 156: return node; } return undefined; @@ -11334,10 +10750,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 205: + case 202: return node.tag; - case 275: - case 274: + case 272: + case 271: return node.tagName; default: return node.expression; @@ -11349,21 +10765,21 @@ var ts; return false; } switch (node.kind) { - case 252: + case 249: return true; - case 163: - return parent.kind === 252; + case 162: + return parent.kind === 249; + case 166: case 167: - case 168: - case 165: + case 164: return node.body !== undefined - && parent.kind === 252; - case 160: + && parent.kind === 249; + case 159: return parent.body !== undefined - && (parent.kind === 166 - || parent.kind === 165 - || parent.kind === 168) - && grandparent.kind === 252; + && (parent.kind === 165 + || parent.kind === 164 + || parent.kind === 167) + && grandparent.kind === 249; } return false; } @@ -11379,10 +10795,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 252: + case 249: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); - case 165: - case 168: + case 164: + case 167: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); default: return false; @@ -11391,9 +10807,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 275 || - parent.kind === 274 || - parent.kind === 276) { + if (parent.kind === 272 || + parent.kind === 271 || + parent.kind === 273) { return parent.tagName === node; } return false; @@ -11406,44 +10822,44 @@ var ts; case 109: case 94: case 13: + case 196: + case 197: + case 198: case 199: case 200: case 201: case 202: + case 221: case 203: + case 222: case 204: case 205: - case 224: + case 218: case 206: - case 225: + case 209: case 207: case 208: - case 221: - case 209: - case 212: - case 210: case 211: - case 214: - case 215: - case 216: - case 217: - case 220: - case 218: - case 222: - case 273: - case 274: - case 277: - case 219: + case 212: case 213: - case 226: + case 214: + case 217: + case 215: + case 219: + case 270: + case 271: + case 274: + case 216: + case 210: + case 223: return true; - case 157: - while (node.parent.kind === 157) { + case 156: + while (node.parent.kind === 156) { node = node.parent; } - return node.parent.kind === 176 || isJSXTagName(node); + return node.parent.kind === 175 || isJSXTagName(node); case 78: - if (node.parent.kind === 176 || isJSXTagName(node)) { + if (node.parent.kind === 175 || isJSXTagName(node)) { return true; } case 8: @@ -11460,49 +10876,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 249: - case 160: - case 163: - case 162: - case 291: - case 288: - case 198: - return parent.initializer === node; - case 233: - case 234: - case 235: - case 236: - case 242: - case 243: - case 244: - case 284: case 246: + case 159: + case 162: + case 161: + case 288: + case 285: + case 195: + return parent.initializer === node; + case 230: + case 231: + case 232: + case 233: + case 239: + case 240: + case 241: + case 281: + case 243: return parent.expression === node; - case 237: + case 234: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 250) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 247) || forStatement.condition === node || forStatement.incrementor === node; - case 238: - case 239: + case 235: + case 236: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 250) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 247) || forInStatement.expression === node; - case 206: - case 224: + case 203: + case 221: return node === parent.expression; - case 228: + case 225: return node === parent.expression; - case 158: + case 157: return node === parent.expression; - case 161: - case 283: - case 282: - case 290: + case 160: + case 280: + case 279: + case 287: return true; - case 223: + case 220: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 289: + case 286: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -11510,14 +10926,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 157 || node.kind === 78) { + while (node.kind === 156 || node.kind === 78) { node = node.parent; } - return node.kind === 176; + return node.kind === 175; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 260 && node.moduleReference.kind === 272; + return node.kind === 257 && node.moduleReference.kind === 269; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -11525,13 +10941,8 @@ var ts; return node.moduleReference.expression; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; - function getExternalModuleRequireArgument(node) { - return isRequireVariableDeclaration(node, true) - && getLeftmostAccessExpression(node.initializer).arguments[0]; - } - ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 260 && node.moduleReference.kind !== 272; + return node.kind === 257 && node.moduleReference.kind !== 269; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -11563,11 +10974,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 147 || node.typeArguments[0].kind === 144); + (node.typeArguments[0].kind === 146 || node.typeArguments[0].kind === 143); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 203) { + if (callExpression.kind !== 200) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -11582,10 +10993,7 @@ var ts; } ts.isRequireCall = isRequireCall; function isRequireVariableDeclaration(node, requireStringLiteralLikeArgument) { - if (node.kind === 198) { - node = node.parent.parent; - } - return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(getLeftmostAccessExpression(node.initializer), requireStringLiteralLikeArgument); + return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(node.initializer, requireStringLiteralLikeArgument); } ts.isRequireVariableDeclaration = isRequireVariableDeclaration; function isRequireVariableStatement(node, requireStringLiteralLikeArgument) { @@ -11603,6 +11011,46 @@ var ts; return getSourceTextOfNodeFromSourceFile(sourceFile, str).charCodeAt(0) === 34; } ts.isStringDoubleQuoted = isStringDoubleQuoted; + function getDeclarationOfExpando(node) { + if (!node.parent) { + return undefined; + } + var name; + var decl; + if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) { + if (!isInJSFile(node) && !isVarConst(node.parent)) { + return undefined; + } + name = node.parent.name; + decl = node.parent; + } + else if (ts.isBinaryExpression(node.parent)) { + var parentNode = node.parent; + var parentNodeOperator = node.parent.operatorToken.kind; + if (parentNodeOperator === 62 && parentNode.right === node) { + name = parentNode.left; + decl = name; + } + else if (parentNodeOperator === 56 || parentNodeOperator === 60) { + if (ts.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { + name = parentNode.parent.name; + decl = parentNode.parent; + } + else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 && parentNode.parent.right === parentNode) { + name = parentNode.parent.left; + decl = name; + } + if (!name || !isBindableStaticNameExpression(name) || !isSameEntityName(name, parentNode.left)) { + return undefined; + } + } + } + if (!name || !getExpandoInitializer(node, isPrototypeAccess(name))) { + return undefined; + } + return decl; + } + ts.getDeclarationOfExpando = getDeclarationOfExpando; function isAssignmentDeclaration(decl) { return ts.isBinaryExpression(decl) || isAccessExpression(decl) || ts.isIdentifier(decl) || ts.isCallExpression(decl); } @@ -11648,11 +11096,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 208 || e.kind === 209 ? initializer : undefined; + return e.kind === 205 || e.kind === 206 ? initializer : undefined; } - if (initializer.kind === 208 || - initializer.kind === 221 || - initializer.kind === 209) { + if (initializer.kind === 205 || + initializer.kind === 218 || + initializer.kind === 206) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -11709,7 +11157,6 @@ var ts; } return false; } - ts.isSameEntityName = isSameEntityName; function getRightMostAssignedExpression(node) { while (isAssignmentExpression(node, true)) { node = node.right; @@ -11871,7 +11318,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 233 && + expr.parent && expr.parent.kind === 230 && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -11891,7 +11338,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 251 || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 248 || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -11900,14 +11347,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 261: - case 267: + case 258: + case 264: return node.parent; - case 272: + case 269: return node.parent.parent; - case 203: + case 200: return isImportCall(node.parent) || isRequireCall(node.parent, false) ? node.parent : undefined; - case 191: + case 190: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -11917,12 +11364,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 261: - case 267: + case 258: + case 264: return node.moduleSpecifier; - case 260: - return node.moduleReference.kind === 272 ? node.moduleReference.expression : undefined; - case 195: + case 257: + return node.moduleReference.kind === 269 ? node.moduleReference.expression : undefined; + case 192: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -11931,11 +11378,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 261: + case 258: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 260: + case 257: return node; - case 267: + case 264: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -11943,7 +11390,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 261 && !!node.importClause && !!node.importClause.name; + return node.kind === 258 && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -11964,13 +11411,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 160: - case 165: + case 159: case 164: - case 289: - case 288: case 163: + case 286: + case 285: case 162: + case 161: return node.questionToken !== undefined; } } @@ -11984,7 +11431,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 331 || node.kind === 324 || node.kind === 325; + return node.kind === 327 || node.kind === 320 || node.kind === 321; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -12009,12 +11456,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 232: + case 229: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 163: + case 162: return node.initializer; - case 288: + case 285: return node.initializer; } } @@ -12026,7 +11473,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 256 + node.body.kind === 253 ? node.body : undefined; } @@ -12040,11 +11487,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 160) { + if (node.kind === 159) { result = ts.addRange(result, (noCache ? ts.getJSDocParameterTagsNoCache : ts.getJSDocParameterTags)(node)); break; } - if (node.kind === 159) { + if (node.kind === 158) { result = ts.addRange(result, (noCache ? ts.getJSDocTypeParameterTagsNoCache : ts.getJSDocTypeParameterTags)(node)); break; } @@ -12055,10 +11502,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 288 || - parent.kind === 266 || - parent.kind === 163 || - parent.kind === 233 && node.kind === 201 || + if (parent.kind === 285 || + parent.kind === 263 || + parent.kind === 162 || + parent.kind === 230 && node.kind === 198 || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62) { return parent; @@ -12108,7 +11555,7 @@ var ts; } ts.getEffectiveJSDocHost = getEffectiveJSDocHost; function getJSDocHost(node) { - return ts.Debug.checkDefined(ts.findAncestor(node.parent, ts.isJSDoc)).parent; + return ts.Debug.checkDefined(findAncestor(node.parent, ts.isJSDoc)).parent; } ts.getJSDocHost = getJSDocHost; function getTypeParameterFromJsDoc(node) { @@ -12124,7 +11571,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 309; + return node.dotDotDotToken !== undefined || !!type && type.kind === 305; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -12135,31 +11582,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 216: + case 213: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 : 2 : 0; - case 214: - case 215: + case 211: + case 212: var unaryOperator = parent.operator; return unaryOperator === 45 || unaryOperator === 46 ? 2 : 0; - case 238: - case 239: + case 235: + case 236: return parent.initializer === node ? 1 : 0; - case 207: - case 199: - case 220: - case 225: + case 204: + case 196: + case 217: + case 222: node = parent; break; - case 289: + case 286: if (parent.name !== node) { return 0; } node = parent.parent; break; - case 288: + case 285: if (parent.name === node) { return 0; } @@ -12178,22 +11625,22 @@ var ts; ts.isAssignmentTarget = isAssignmentTarget; function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 230: - case 232: - case 243: + case 227: + case 229: + case 240: + case 231: + case 241: + case 255: + case 281: + case 282: + case 242: case 234: - case 244: - case 258: - case 284: - case 285: - case 245: - case 237: - case 238: - case 239: case 235: case 236: - case 247: - case 287: + case 232: + case 233: + case 244: + case 284: return true; } return false; @@ -12210,38 +11657,29 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 186); + return walkUp(node, 185); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 207); + return walkUp(node, 204); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; - function walkUpParenthesizedTypesAndGetParentAndChild(node) { - var child; - while (node && node.kind === 186) { - child = node; - node = node.parent; - } - return [child, node]; - } - ts.walkUpParenthesizedTypesAndGetParentAndChild = walkUpParenthesizedTypesAndGetParentAndChild; function skipParentheses(node) { return ts.skipOuterExpressions(node, 1); } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 207) { + while (node.kind === 204) { node = node.parent; } return node; } function isDeleteTarget(node) { - if (node.kind !== 201 && node.kind !== 202) { + if (node.kind !== 198 && node.kind !== 199) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 210; + return node && node.kind === 207; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -12291,63 +11729,63 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 158 && + node.parent.kind === 157 && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 163: case 162: - case 165: + case 161: case 164: + case 163: + case 166: case 167: - case 168: - case 291: case 288: - case 201: - return parent.name === node; - case 157: - return parent.right === node; + case 285: case 198: - case 265: + return parent.name === node; + case 156: + return parent.right === node; + case 195: + case 262: return parent.propertyName === node; - case 270: - case 280: + case 267: + case 277: return true; } return false; } ts.isIdentifierName = isIdentifierName; function isAliasSymbolDeclaration(node) { - return node.kind === 260 || - node.kind === 259 || - node.kind === 262 && !!node.name || - node.kind === 263 || - node.kind === 269 || - node.kind === 265 || - node.kind === 270 || - node.kind === 266 && exportAssignmentIsAlias(node) || + return node.kind === 257 || + node.kind === 256 || + node.kind === 259 && !!node.name || + node.kind === 260 || + node.kind === 266 || + node.kind === 262 || + node.kind === 267 || + node.kind === 263 && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 && isAliasableExpression(node.parent.right) || - node.kind === 289 || - node.kind === 288 && isAliasableExpression(node.initializer); + node.kind === 286 || + node.kind === 285 && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { + case 259: case 262: - case 265: - case 263: - case 270: - case 266: case 260: + case 267: + case 263: + case 257: return node.parent; - case 157: + case 156: do { node = node.parent; - } while (node.parent.kind === 157); + } while (node.parent.kind === 156); return getAliasDeclarationFromName(node); } } @@ -12366,7 +11804,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 289 ? node.name : node.kind === 288 ? node.initializer : + return node.kind === 286 ? node.name : node.kind === 285 ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -12430,11 +11868,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 80 <= token && token <= 156; + return 80 <= token && token <= 155; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 125 <= token && token <= 156; + return 125 <= token && token <= 155; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -12470,13 +11908,13 @@ var ts; } var flags = 0; switch (node.kind) { - case 251: - case 208: - case 165: + case 248: + case 205: + case 164: if (node.asteriskToken) { flags |= 1; } - case 209: + case 206: if (hasSyntacticModifier(node, 256)) { flags |= 2; } @@ -12490,10 +11928,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 251: - case 208: - case 209: - case 165: + case 248: + case 205: + case 206: + case 164: return node.body !== undefined && node.asteriskToken === undefined && hasSyntacticModifier(node, 256); @@ -12515,7 +11953,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 158 || name.kind === 202)) { + if (!(name.kind === 157 || name.kind === 199)) { return false; } var expr = ts.isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression; @@ -12536,7 +11974,7 @@ var ts; case 10: case 8: return ts.escapeLeadingUnderscores(name.text); - case 158: + case 157: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -12602,11 +12040,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 160; + return root.kind === 159; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 198) { + while (node.kind === 195) { node = node.parent.parent; } return node; @@ -12614,15 +12052,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 166 - || kind === 208 - || kind === 251 - || kind === 209 - || kind === 165 + return kind === 165 + || kind === 205 + || kind === 248 + || kind === 206 + || kind === 164 + || kind === 166 || kind === 167 - || kind === 168 - || kind === 256 - || kind === 297; + || kind === 253 + || kind === 294; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -12636,23 +12074,23 @@ var ts; ts.getOriginalSourceFile = getOriginalSourceFile; function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 204 && expression.arguments !== undefined; + var hasArguments = expression.kind === 201 && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 204: + case 201: return hasArguments ? 0 : 1; - case 214: case 211: - case 212: + case 208: + case 209: + case 207: case 210: - case 213: - case 217: - case 219: - return 1; + case 214: case 216: + return 1; + case 213: switch (operator) { case 42: case 62: @@ -12679,15 +12117,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 204 && expression.arguments !== undefined; + var hasArguments = expression.kind === 201 && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 216) { + if (expression.kind === 213) { return expression.operatorToken.kind; } - else if (expression.kind === 214 || expression.kind === 215) { + else if (expression.kind === 211 || expression.kind === 212) { return expression.operator; } else { @@ -12697,15 +12135,15 @@ var ts; ts.getOperator = getOperator; function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 337: + case 332: return 0; - case 220: - return 1; - case 219: - return 2; case 217: - return 4; + return 1; case 216: + return 2; + case 214: + return 4; + case 213: switch (operatorKind) { case 27: return 0; @@ -12729,21 +12167,21 @@ var ts; default: return getBinaryOperatorPrecedence(operatorKind); } - case 214: case 211: - case 212: + case 208: + case 209: + case 207: case 210: - case 213: return 16; - case 215: + case 212: return 17; - case 203: + case 200: return 18; - case 204: - return hasArguments ? 19 : 18; - case 205: case 201: + return hasArguments ? 19 : 18; case 202: + case 198: + case 199: return 19; case 107: case 105: @@ -12754,19 +12192,19 @@ var ts; case 8: case 9: case 10: - case 199: - case 200: - case 208: - case 209: - case 221: + case 196: + case 197: + case 205: + case 206: + case 218: case 13: case 14: - case 218: - case 207: - case 222: - case 273: + case 215: + case 204: + case 219: + case 270: + case 271: case 274: - case 277: return 20; default: return -1; @@ -12817,19 +12255,6 @@ var ts; return -1; } ts.getBinaryOperatorPrecedence = getBinaryOperatorPrecedence; - function getSemanticJsxChildren(children) { - return ts.filter(children, function (i) { - switch (i.kind) { - case 283: - return !!i.expression; - case 11: - return !i.containsOnlyTriviaWhiteSpaces; - default: - return true; - } - }); - } - ts.getSemanticJsxChildren = getSemanticJsxChildren; function createDiagnosticCollection() { var nonFileDiagnostics = []; var filesWithDiagnostics = []; @@ -12998,9 +12423,8 @@ var ts; ts.isIntrinsicJsxName = isIntrinsicJsxName; var indentStrings = ["", " "]; function getIndentString(level) { - var singleLevel = indentStrings[1]; - for (var current = indentStrings.length; current <= level; current++) { - indentStrings.push(indentStrings[current - 1] + singleLevel); + if (indentStrings[level] === undefined) { + indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; } return indentStrings[level]; } @@ -13236,13 +12660,6 @@ var ts; return options.outFile || options.out; } ts.outFile = outFile; - function getPathsBasePath(options, host) { - var _a, _b; - if (!options.paths) - return undefined; - return (_a = options.baseUrl) !== null && _a !== void 0 ? _a : ts.Debug.checkDefined(options.pathsBasePath || ((_b = host.getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(host)), "Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'."); - } - ts.getPathsBasePath = getPathsBasePath; function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) { var options = host.getCompilerOptions(); if (outFile(options)) { @@ -13355,10 +12772,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 167) { + if (accessor.kind === 166) { getAccessor = accessor; } - else if (accessor.kind === 168) { + else if (accessor.kind === 167) { setAccessor = accessor; } else { @@ -13378,10 +12795,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 167 && !getAccessor) { + if (member.kind === 166 && !getAccessor) { getAccessor = member; } - if (member.kind === 168 && !setAccessor) { + if (member.kind === 167 && !setAccessor) { setAccessor = member; } } @@ -13420,7 +12837,7 @@ var ts; } ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 311 && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 307 && tag.parent.tags.some(isJSDocTypeAlias)); } function getEffectiveSetAccessorTypeAnnotationNode(node) { var parameter = getSetAccessorValueParameter(node); @@ -13608,7 +13025,7 @@ var ts; } ts.getSelectedSyntacticModifierFlags = getSelectedSyntacticModifierFlags; function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) { - if (node.kind >= 0 && node.kind <= 156) { + if (node.kind >= 0 && node.kind <= 155) { return 0; } if (!(node.modifierFlagsCache & 536870912)) { @@ -13684,7 +13101,7 @@ var ts; case 84: return 2048; case 87: return 512; case 129: return 256; - case 142: return 64; + case 141: return 64; } return 0; } @@ -13733,8 +13150,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, true)) { var kind = node.left.kind; - return kind === 200 - || kind === 199; + return kind === 197 + || kind === 196; } return false; } @@ -13751,12 +13168,12 @@ var ts; switch (node.kind) { case 78: return node; - case 157: + case 156: do { node = node.left; } while (node.kind !== 78); return node; - case 201: + case 198: do { node = node.expression; } while (node.kind !== 78); @@ -13766,8 +13183,8 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 78 || node.kind === 107 || node.kind === 105 || - node.kind === 201 && isDottedName(node.expression) || - node.kind === 207 && isDottedName(node.expression); + node.kind === 198 && isDottedName(node.expression) || + node.kind === 204 && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { @@ -13792,17 +13209,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 157 && node.parent.right === node) || - (node.parent.kind === 201 && node.parent.name === node); + return (node.parent.kind === 156 && node.parent.right === node) || + (node.parent.kind === 198 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 200 && + return expression.kind === 197 && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 199 && + return expression.kind === 196 && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -14074,8 +13491,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 255: - case 256: + case 252: + case 253: return parseNode === parseNode.parent.name; } } @@ -14141,32 +13558,32 @@ var ts; if (!parent) return 0; switch (parent.kind) { - case 207: + case 204: return accessKind(parent); - case 215: - case 214: + case 212: + case 211: var operator = parent.operator; return operator === 45 || operator === 46 ? writeOrReadWrite() : 0; - case 216: + case 213: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 ? 1 : writeOrReadWrite() : 0; - case 201: + case 198: return parent.name !== node ? 0 : accessKind(parent); - case 288: { + case 285: { var parentAccess = accessKind(parent.parent); return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 289: + case 286: return node === parent.objectAssignmentInitializer ? 0 : accessKind(parent.parent); - case 199: + case 196: return accessKind(parent); default: return 0; } function writeOrReadWrite() { - return parent.parent && skipParenthesesUp(parent.parent).kind === 233 ? 1 : 2; + return parent.parent && skipParenthesesUp(parent.parent).kind === 230 ? 1 : 2; } } function reverseAccessKind(a) { @@ -14297,37 +13714,37 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 172 && kind <= 195) + return (kind >= 171 && kind <= 192) || kind === 128 - || kind === 152 + || kind === 151 + || kind === 143 + || kind === 154 || kind === 144 - || kind === 155 - || kind === 145 || kind === 131 + || kind === 146 || kind === 147 - || kind === 148 || kind === 113 - || kind === 150 - || kind === 141 - || kind === 223 + || kind === 149 + || kind === 140 + || kind === 220 + || kind === 299 + || kind === 300 + || kind === 301 + || kind === 302 || kind === 303 || kind === 304 - || kind === 305 - || kind === 306 - || kind === 307 - || kind === 308 - || kind === 309; + || kind === 305; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 201 || node.kind === 202; + return node.kind === 198 || node.kind === 199; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 201) { + if (node.kind === 198) { return node.name; } - ts.Debug.assert(node.kind === 202); + ts.Debug.assert(node.kind === 199); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -14342,40 +13759,33 @@ var ts; } ts.isBundleFileTextLike = isBundleFileTextLike; function isNamedImportsOrExports(node) { - return node.kind === 264 || node.kind === 268; + return node.kind === 261 || node.kind === 265; } ts.isNamedImportsOrExports = isNamedImportsOrExports; - function getLeftmostAccessExpression(expr) { - while (isAccessExpression(expr)) { - expr = expr.expression; - } - return expr; - } - ts.getLeftmostAccessExpression = getLeftmostAccessExpression; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 215: + case 212: node = node.operand; continue; - case 216: + case 213: node = node.left; continue; - case 217: + case 214: node = node.condition; continue; - case 205: + case 202: node = node.tag; continue; - case 203: + case 200: if (stopAtCallExpressions) { return node; } - case 224: - case 202: - case 201: - case 225: - case 336: + case 221: + case 199: + case 198: + case 222: + case 331: node = node.expression; continue; } @@ -14394,7 +13804,7 @@ var ts; } function Type(checker, flags) { this.flags = flags; - if (ts.Debug.isDebugging || ts.tracing.isTracing()) { + if (ts.Debug.isDebugging) { this.checker = checker; } } @@ -14748,10 +14158,6 @@ var ts; return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag]; } ts.getStrictOptionValue = getStrictOptionValue; - function getAllowJSCompilerOption(compilerOptions) { - return compilerOptions.allowJs === undefined ? !!compilerOptions.checkJs : compilerOptions.allowJs; - } - ts.getAllowJSCompilerOption = getAllowJSCompilerOption; function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) { return oldOptions !== newOptions && ts.semanticDiagnosticsOptionDeclarations.some(function (option) { return !isJsonEqual(getCompilerOptionValue(oldOptions, option), getCompilerOptionValue(newOptions, option)); }); @@ -14766,26 +14172,6 @@ var ts; return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name]; } ts.getCompilerOptionValue = getCompilerOptionValue; - function getJSXTransformEnabled(options) { - var jsx = options.jsx; - return jsx === 2 || jsx === 4 || jsx === 5; - } - ts.getJSXTransformEnabled = getJSXTransformEnabled; - function getJSXImplicitImportBase(compilerOptions, file) { - var jsxImportSourcePragmas = file === null || file === void 0 ? void 0 : file.pragmas.get("jsximportsource"); - var jsxImportSourcePragma = ts.isArray(jsxImportSourcePragmas) ? jsxImportSourcePragmas[0] : jsxImportSourcePragmas; - return compilerOptions.jsx === 4 || - compilerOptions.jsx === 5 || - compilerOptions.jsxImportSource || - jsxImportSourcePragma ? - (jsxImportSourcePragma === null || jsxImportSourcePragma === void 0 ? void 0 : jsxImportSourcePragma.arguments.factory) || compilerOptions.jsxImportSource || "react" : - undefined; - } - ts.getJSXImplicitImportBase = getJSXImplicitImportBase; - function getJSXRuntimeImport(base, options) { - return base ? base + "/" + (options.jsx === 5 ? "jsx-dev-runtime" : "jsx-runtime") : undefined; - } - ts.getJSXRuntimeImport = getJSXRuntimeImport; function hasZeroOrOneAsteriskCharacter(str) { var seenAsterisk = false; for (var i = 0; i < str.length; i++) { @@ -15103,7 +14489,7 @@ var ts; var allSupportedExtensions = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions); var allSupportedExtensionsWithJson = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions, [".json"]); function getSupportedExtensions(options, extraFileExtensions) { - var needJsExtensions = options && getAllowJSCompilerOption(options); + var needJsExtensions = options && options.allowJs; if (!extraFileExtensions || extraFileExtensions.length === 0) { return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions; } @@ -15280,7 +14666,6 @@ var ts; if (!diagnostic.relatedInformation) { diagnostic.relatedInformation = []; } - ts.Debug.assert(diagnostic.relatedInformation !== ts.emptyArray, "Diagnostic had empty array singleton for related info, but is still being constructed!"); (_a = diagnostic.relatedInformation).push.apply(_a, relatedInformation); return diagnostic; } @@ -15393,37 +14778,37 @@ var ts; } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 270; + return typeOnlyDeclaration.kind === 267; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 78 || node.kind === 201) { + while (node.kind === 78 || node.kind === 198) { node = node.parent; } - if (node.kind !== 158) { + if (node.kind !== 157) { return false; } if (hasSyntacticModifier(node.parent, 128)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 253 || containerKind === 177; + return containerKind === 250 || containerKind === 176; } function isIdentifierInNonEmittingHeritageClause(node) { if (node.kind !== 78) return false; - var heritageClause = ts.findAncestor(node.parent, function (parent) { + var heritageClause = findAncestor(node.parent, function (parent) { switch (parent.kind) { - case 286: + case 283: return true; - case 201: - case 223: + case 198: + case 220: return false; default: return "quit"; } }); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 253; + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 250; } function isIdentifierTypeReference(node) { return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName); @@ -15568,10 +14953,10 @@ var ts; parenthesizeTypeArguments: parenthesizeTypeArguments, }; function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - var binaryOperatorPrecedence = ts.getOperatorPrecedence(216, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(216, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(213, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(213, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 209 && binaryOperatorPrecedence > 3) { + if (!isLeftSideOfBinary && operand.kind === 206 && binaryOperatorPrecedence > 3) { return true; } var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); @@ -15579,7 +14964,7 @@ var ts; case -1: if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 - && operand.kind === 219) { + && operand.kind === 216) { return false; } return true; @@ -15618,7 +15003,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 216 && node.operatorToken.kind === 39) { + if (node.kind === 213 && node.operatorToken.kind === 39) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -15634,7 +15019,7 @@ var ts; } function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); - if (skipped.kind === 207) { + if (skipped.kind === 204) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -15651,7 +15036,7 @@ var ts; return ts.isCommaSequence(expression) ? factory.createParenthesizedExpression(expression) : expression; } function parenthesizeConditionOfConditionalExpression(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(217, 57); + var conditionalPrecedence = ts.getOperatorPrecedence(214, 57); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1) { @@ -15670,8 +15055,8 @@ var ts; var needsParens = ts.isCommaSequence(check); if (!needsParens) { switch (ts.getLeftmostExpression(check, false).kind) { - case 221: - case 208: + case 218: + case 205: needsParens = true; } } @@ -15680,9 +15065,9 @@ var ts; function parenthesizeExpressionOfNew(expression) { var leftmostExpr = ts.getLeftmostExpression(expression, true); switch (leftmostExpr.kind) { - case 203: + case 200: return factory.createParenthesizedExpression(expression); - case 204: + case 201: return !leftmostExpr.arguments ? factory.createParenthesizedExpression(expression) : expression; @@ -15692,7 +15077,7 @@ var ts; function parenthesizeLeftSideOfAccess(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 204 || emittedExpression.arguments)) { + && (emittedExpression.kind !== 201 || emittedExpression.arguments)) { return expression; } return ts.setTextRange(factory.createParenthesizedExpression(expression), expression); @@ -15710,7 +15095,7 @@ var ts; function parenthesizeExpressionForDisallowedComma(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(216, 27); + var commaPrecedence = ts.getOperatorPrecedence(213, 27); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(factory.createParenthesizedExpression(expression), expression); } function parenthesizeExpressionOfExpressionStatement(expression) { @@ -15718,41 +15103,41 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 208 || kind === 209) { + if (kind === 205 || kind === 206) { var updated = factory.updateCallExpression(emittedExpression, ts.setTextRange(factory.createParenthesizedExpression(callee), callee), emittedExpression.typeArguments, emittedExpression.arguments); return factory.restoreOuterExpressions(expression, updated, 8); } } var leftmostExpressionKind = ts.getLeftmostExpression(emittedExpression, false).kind; - if (leftmostExpressionKind === 200 || leftmostExpressionKind === 208) { + if (leftmostExpressionKind === 197 || leftmostExpressionKind === 205) { return ts.setTextRange(factory.createParenthesizedExpression(expression), expression); } return expression; } function parenthesizeConciseBodyOfArrowFunction(body) { - if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, false).kind === 200)) { + if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, false).kind === 197)) { return ts.setTextRange(factory.createParenthesizedExpression(body), body); } return body; } function parenthesizeMemberOfConditionalType(member) { - return member.kind === 184 ? factory.createParenthesizedType(member) : member; + return member.kind === 183 ? factory.createParenthesizedType(member) : member; } function parenthesizeMemberOfElementType(member) { switch (member.kind) { + case 181: case 182: - case 183: + case 173: case 174: - case 175: return factory.createParenthesizedType(member); } return parenthesizeMemberOfConditionalType(member); } function parenthesizeElementTypeOfArrayType(member) { switch (member.kind) { - case 176: - case 188: - case 185: + case 175: + case 187: + case 184: return factory.createParenthesizedType(member); } return parenthesizeMemberOfElementType(member); @@ -15855,11 +15240,11 @@ var ts; } function convertToAssignmentPattern(node) { switch (node.kind) { - case 197: - case 199: - return convertToArrayAssignmentPattern(node); + case 194: case 196: - case 200: + return convertToArrayAssignmentPattern(node); + case 193: + case 197: return convertToObjectAssignmentPattern(node); } } @@ -15966,8 +15351,6 @@ var ts; updateConstructSignature: updateConstructSignature, createIndexSignature: createIndexSignature, updateIndexSignature: updateIndexSignature, - createTemplateLiteralTypeSpan: createTemplateLiteralTypeSpan, - updateTemplateLiteralTypeSpan: updateTemplateLiteralTypeSpan, createKeywordTypeNode: createKeywordTypeNode, createTypePredicateNode: createTypePredicateNode, updateTypePredicateNode: updateTypePredicateNode, @@ -16012,8 +15395,6 @@ var ts; updateMappedTypeNode: updateMappedTypeNode, createLiteralTypeNode: createLiteralTypeNode, updateLiteralTypeNode: updateLiteralTypeNode, - createTemplateLiteralType: createTemplateLiteralType, - updateTemplateLiteralType: updateTemplateLiteralType, createObjectBindingPattern: createObjectBindingPattern, updateObjectBindingPattern: updateObjectBindingPattern, createArrayBindingPattern: createArrayBindingPattern, @@ -16178,18 +15559,18 @@ var ts; createMissingDeclaration: createMissingDeclaration, createExternalModuleReference: createExternalModuleReference, updateExternalModuleReference: updateExternalModuleReference, - get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(303); }, - get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(304); }, - get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(306); }, - get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(306); }, - get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(305); }, - get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(305); }, - get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(307); }, - get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(307); }, - get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(309); }, - get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(309); }, - get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(310); }, - get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(310); }, + get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(299); }, + get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(300); }, + get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(302); }, + get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(302); }, + get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(301); }, + get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(301); }, + get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(303); }, + get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(303); }, + get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(305); }, + get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(305); }, + get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(306); }, + get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(306); }, createJSDocFunctionType: createJSDocFunctionType, updateJSDocFunctionType: updateJSDocFunctionType, createJSDocTypeLiteral: createJSDocTypeLiteral, @@ -16212,32 +15593,28 @@ var ts; updateJSDocAugmentsTag: updateJSDocAugmentsTag, createJSDocImplementsTag: createJSDocImplementsTag, updateJSDocImplementsTag: updateJSDocImplementsTag, - createJSDocSeeTag: createJSDocSeeTag, - updateJSDocSeeTag: updateJSDocSeeTag, - createJSDocNameReference: createJSDocNameReference, - updateJSDocNameReference: updateJSDocNameReference, - get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(329); }, - get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(329); }, - get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(327); }, - get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(327); }, - get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(328); }, - get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(328); }, - get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(325); }, - get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(325); }, - get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(317); }, - get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(317); }, - get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(319); }, - get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(319); }, - get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(320); }, - get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(320); }, - get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(321); }, - get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(321); }, - get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(322); }, - get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(322); }, - get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(323); }, - get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(323); }, - get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(318); }, - get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(318); }, + get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(325); }, + get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(325); }, + get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(323); }, + get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(323); }, + get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(324); }, + get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(324); }, + get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(321); }, + get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(321); }, + get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(313); }, + get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(313); }, + get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(315); }, + get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(315); }, + get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(316); }, + get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(316); }, + get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(317); }, + get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(317); }, + get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(318); }, + get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(318); }, + get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(319); }, + get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(319); }, + get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(314); }, + get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(314); }, createJSDocUnknownTag: createJSDocUnknownTag, updateJSDocUnknownTag: updateJSDocUnknownTag, createJSDocComment: createJSDocComment, @@ -16377,7 +15754,6 @@ var ts; if (elements.transformFlags === undefined) { aggregateChildrenFlags(elements); } - ts.Debug.attachNodeArrayDebugInfo(elements); return elements; } var length = elements.length; @@ -16385,7 +15761,6 @@ var ts; ts.setTextRangePosEnd(array, -1, -1); array.hasTrailingComma = !!hasTrailingComma; aggregateChildrenFlags(array); - ts.Debug.attachNodeArrayDebugInfo(array); return array; } function createBaseNode(kind) { @@ -16410,11 +15785,11 @@ var ts; node.name = name; if (name) { switch (node.kind) { - case 165: + case 164: + case 166: case 167: - case 168: - case 163: - case 288: + case 162: + case 285: if (ts.isIdentifier(name)) { node.transformFlags |= propagateIdentifierNameFlags(name); break; @@ -16613,7 +15988,7 @@ var ts; return baseFactory.createBaseTokenNode(kind); } function createToken(token) { - ts.Debug.assert(token >= 0 && token <= 156, "Invalid token"); + ts.Debug.assert(token >= 0 && token <= 155, "Invalid token"); ts.Debug.assert(token <= 14 || token >= 17, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); ts.Debug.assert(token <= 8 || token >= 14, "Invalid token. Use 'createLiteralLikeNode' to create literals."); ts.Debug.assert(token !== 78, "Invalid token. Use 'createIdentifier' to create identifiers"); @@ -16628,21 +16003,21 @@ var ts; case 122: case 120: case 121: - case 142: + case 141: case 125: case 133: case 84: case 128: + case 143: + case 154: + case 140: case 144: - case 155: - case 141: - case 145: - case 147: + case 146: case 131: - case 148: + case 147: case 113: - case 152: - case 150: + case 151: + case 149: transformFlags = 1; break; case 123: @@ -16706,7 +16081,7 @@ var ts; result.push(createModifier(123)); } if (flags & 64) { - result.push(createModifier(142)); + result.push(createModifier(141)); } if (flags & 256) { result.push(createModifier(129)); @@ -16714,7 +16089,7 @@ var ts; return result; } function createQualifiedName(left, right) { - var node = createBaseNode(157); + var node = createBaseNode(156); node.left = left; node.right = asName(right); node.transformFlags |= @@ -16729,7 +16104,7 @@ var ts; : node; } function createComputedPropertyName(expression) { - var node = createBaseNode(158); + var node = createBaseNode(157); node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -16743,7 +16118,7 @@ var ts; : node; } function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createBaseNamedDeclaration(159, undefined, undefined, name); + var node = createBaseNamedDeclaration(158, undefined, undefined, name); node.constraint = constraint; node.default = defaultType; node.transformFlags = 1; @@ -16757,7 +16132,7 @@ var ts; : node; } function createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(160, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); + var node = createBaseVariableLikeDeclaration(159, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); node.dotDotDotToken = dotDotDotToken; node.questionToken = questionToken; if (ts.isThisIdentifier(node.name)) { @@ -16788,7 +16163,7 @@ var ts; : node; } function createDecorator(expression) { - var node = createBaseNode(161); + var node = createBaseNode(160); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -16802,7 +16177,7 @@ var ts; : node; } function createPropertySignature(modifiers, name, questionToken, type) { - var node = createBaseNamedDeclaration(162, undefined, modifiers, name); + var node = createBaseNamedDeclaration(161, undefined, modifiers, name); node.type = type; node.questionToken = questionToken; node.transformFlags = 1; @@ -16817,7 +16192,7 @@ var ts; : node; } function createPropertyDeclaration(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(163, decorators, modifiers, name, type, initializer); + var node = createBaseVariableLikeDeclaration(162, decorators, modifiers, name, type, initializer); node.questionToken = questionOrExclamationToken && ts.isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined; node.exclamationToken = questionOrExclamationToken && ts.isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined; node.transformFlags |= @@ -16844,7 +16219,7 @@ var ts; : node; } function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(164, undefined, modifiers, name, typeParameters, parameters, type); + var node = createBaseSignatureDeclaration(163, undefined, modifiers, name, typeParameters, parameters, type); node.questionToken = questionToken; node.transformFlags = 1; return node; @@ -16860,7 +16235,7 @@ var ts; : node; } function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(165, decorators, modifiers, name, typeParameters, parameters, type, body); + var node = createBaseFunctionLikeDeclaration(164, decorators, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; node.questionToken = questionToken; node.transformFlags |= @@ -16897,7 +16272,7 @@ var ts; : node; } function createConstructorDeclaration(decorators, modifiers, parameters, body) { - var node = createBaseFunctionLikeDeclaration(166, decorators, modifiers, undefined, undefined, parameters, undefined, body); + var node = createBaseFunctionLikeDeclaration(165, decorators, modifiers, undefined, undefined, parameters, undefined, body); node.transformFlags |= 256; return node; } @@ -16910,7 +16285,7 @@ var ts; : node; } function createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) { - return createBaseFunctionLikeDeclaration(167, decorators, modifiers, name, undefined, parameters, type, body); + return createBaseFunctionLikeDeclaration(166, decorators, modifiers, name, undefined, parameters, type, body); } function updateGetAccessorDeclaration(node, decorators, modifiers, name, parameters, type, body) { return node.decorators !== decorators @@ -16923,7 +16298,7 @@ var ts; : node; } function createSetAccessorDeclaration(decorators, modifiers, name, parameters, body) { - return createBaseFunctionLikeDeclaration(168, decorators, modifiers, name, undefined, parameters, undefined, body); + return createBaseFunctionLikeDeclaration(167, decorators, modifiers, name, undefined, parameters, undefined, body); } function updateSetAccessorDeclaration(node, decorators, modifiers, name, parameters, body) { return node.decorators !== decorators @@ -16935,7 +16310,7 @@ var ts; : node; } function createCallSignature(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(169, undefined, undefined, undefined, typeParameters, parameters, type); + var node = createBaseSignatureDeclaration(168, undefined, undefined, undefined, typeParameters, parameters, type); node.transformFlags = 1; return node; } @@ -16947,7 +16322,7 @@ var ts; : node; } function createConstructSignature(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(170, undefined, undefined, undefined, typeParameters, parameters, type); + var node = createBaseSignatureDeclaration(169, undefined, undefined, undefined, typeParameters, parameters, type); node.transformFlags = 1; return node; } @@ -16959,7 +16334,7 @@ var ts; : node; } function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createBaseSignatureDeclaration(171, decorators, modifiers, undefined, undefined, parameters, type); + var node = createBaseSignatureDeclaration(170, decorators, modifiers, undefined, undefined, parameters, type); node.transformFlags = 1; return node; } @@ -16971,24 +16346,11 @@ var ts; ? updateBaseSignatureDeclaration(createIndexSignature(decorators, modifiers, parameters, type), node) : node; } - function createTemplateLiteralTypeSpan(type, literal) { - var node = createBaseNode(194); - node.type = type; - node.literal = literal; - node.transformFlags = 1; - return node; - } - function updateTemplateLiteralTypeSpan(node, type, literal) { - return node.type !== type - || node.literal !== literal - ? update(createTemplateLiteralTypeSpan(type, literal), node) - : node; - } function createKeywordTypeNode(kind) { return createToken(kind); } function createTypePredicateNode(assertsModifier, parameterName, type) { - var node = createBaseNode(172); + var node = createBaseNode(171); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -17003,7 +16365,7 @@ var ts; : node; } function createTypeReferenceNode(typeName, typeArguments) { - var node = createBaseNode(173); + var node = createBaseNode(172); node.typeName = asName(typeName); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); node.transformFlags = 1; @@ -17016,7 +16378,7 @@ var ts; : node; } function createFunctionTypeNode(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(174, undefined, undefined, undefined, typeParameters, parameters, type); + var node = createBaseSignatureDeclaration(173, undefined, undefined, undefined, typeParameters, parameters, type); node.transformFlags = 1; return node; } @@ -17028,7 +16390,7 @@ var ts; : node; } function createConstructorTypeNode(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(175, undefined, undefined, undefined, typeParameters, parameters, type); + var node = createBaseSignatureDeclaration(174, undefined, undefined, undefined, typeParameters, parameters, type); node.transformFlags = 1; return node; } @@ -17040,7 +16402,7 @@ var ts; : node; } function createTypeQueryNode(exprName) { - var node = createBaseNode(176); + var node = createBaseNode(175); node.exprName = exprName; node.transformFlags = 1; return node; @@ -17051,7 +16413,7 @@ var ts; : node; } function createTypeLiteralNode(members) { - var node = createBaseNode(177); + var node = createBaseNode(176); node.members = createNodeArray(members); node.transformFlags = 1; return node; @@ -17062,7 +16424,7 @@ var ts; : node; } function createArrayTypeNode(elementType) { - var node = createBaseNode(178); + var node = createBaseNode(177); node.elementType = parenthesizerRules().parenthesizeElementTypeOfArrayType(elementType); node.transformFlags = 1; return node; @@ -17073,7 +16435,7 @@ var ts; : node; } function createTupleTypeNode(elements) { - var node = createBaseNode(179); + var node = createBaseNode(178); node.elements = createNodeArray(elements); node.transformFlags = 1; return node; @@ -17084,7 +16446,7 @@ var ts; : node; } function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { - var node = createBaseNode(192); + var node = createBaseNode(191); node.dotDotDotToken = dotDotDotToken; node.name = name; node.questionToken = questionToken; @@ -17101,7 +16463,7 @@ var ts; : node; } function createOptionalTypeNode(type) { - var node = createBaseNode(180); + var node = createBaseNode(179); node.type = parenthesizerRules().parenthesizeElementTypeOfArrayType(type); node.transformFlags = 1; return node; @@ -17112,7 +16474,7 @@ var ts; : node; } function createRestTypeNode(type) { - var node = createBaseNode(181); + var node = createBaseNode(180); node.type = type; node.transformFlags = 1; return node; @@ -17134,19 +16496,19 @@ var ts; : node; } function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(182, types); + return createUnionOrIntersectionTypeNode(181, types); } function updateUnionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types); } function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(183, types); + return createUnionOrIntersectionTypeNode(182, types); } function updateIntersectionTypeNode(node, types) { return updateUnionOrIntersectionTypeNode(node, types); } function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createBaseNode(184); + var node = createBaseNode(183); node.checkType = parenthesizerRules().parenthesizeMemberOfConditionalType(checkType); node.extendsType = parenthesizerRules().parenthesizeMemberOfConditionalType(extendsType); node.trueType = trueType; @@ -17163,7 +16525,7 @@ var ts; : node; } function createInferTypeNode(typeParameter) { - var node = createBaseNode(185); + var node = createBaseNode(184); node.typeParameter = typeParameter; node.transformFlags = 1; return node; @@ -17173,22 +16535,9 @@ var ts; ? update(createInferTypeNode(typeParameter), node) : node; } - function createTemplateLiteralType(head, templateSpans) { - var node = createBaseNode(193); - node.head = head; - node.templateSpans = createNodeArray(templateSpans); - node.transformFlags = 1; - return node; - } - function updateTemplateLiteralType(node, head, templateSpans) { - return node.head !== head - || node.templateSpans !== templateSpans - ? update(createTemplateLiteralType(head, templateSpans), node) - : node; - } function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { if (isTypeOf === void 0) { isTypeOf = false; } - var node = createBaseNode(195); + var node = createBaseNode(192); node.argument = argument; node.qualifier = qualifier; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); @@ -17206,7 +16555,7 @@ var ts; : node; } function createParenthesizedType(type) { - var node = createBaseNode(186); + var node = createBaseNode(185); node.type = type; node.transformFlags = 1; return node; @@ -17217,12 +16566,12 @@ var ts; : node; } function createThisTypeNode() { - var node = createBaseNode(187); + var node = createBaseNode(186); node.transformFlags = 1; return node; } function createTypeOperatorNode(operator, type) { - var node = createBaseNode(188); + var node = createBaseNode(187); node.operator = operator; node.type = parenthesizerRules().parenthesizeMemberOfElementType(type); node.transformFlags = 1; @@ -17234,7 +16583,7 @@ var ts; : node; } function createIndexedAccessTypeNode(objectType, indexType) { - var node = createBaseNode(189); + var node = createBaseNode(188); node.objectType = parenthesizerRules().parenthesizeMemberOfElementType(objectType); node.indexType = indexType; node.transformFlags = 1; @@ -17246,27 +16595,25 @@ var ts; ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node; } - function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type) { - var node = createBaseNode(190); + function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { + var node = createBaseNode(189); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; - node.nameType = nameType; node.questionToken = questionToken; node.type = type; node.transformFlags = 1; return node; } - function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type) { + function updateMappedTypeNode(node, readonlyToken, typeParameter, questionToken, type) { return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter - || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type - ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), node) + ? update(createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), node) : node; } function createLiteralTypeNode(literal) { - var node = createBaseNode(191); + var node = createBaseNode(190); node.literal = literal; node.transformFlags = 1; return node; @@ -17277,7 +16624,7 @@ var ts; : node; } function createObjectBindingPattern(elements) { - var node = createBaseNode(196); + var node = createBaseNode(193); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | @@ -17296,7 +16643,7 @@ var ts; : node; } function createArrayBindingPattern(elements) { - var node = createBaseNode(197); + var node = createBaseNode(194); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | @@ -17310,7 +16657,7 @@ var ts; : node; } function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createBaseBindingLikeDeclaration(198, undefined, undefined, name, initializer); + var node = createBaseBindingLikeDeclaration(195, undefined, undefined, name, initializer); node.propertyName = asName(propertyName); node.dotDotDotToken = dotDotDotToken; node.transformFlags |= @@ -17338,7 +16685,7 @@ var ts; return node; } function createArrayLiteralExpression(elements, multiLine) { - var node = createBaseExpression(199); + var node = createBaseExpression(196); node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(elements)); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.elements); @@ -17350,7 +16697,7 @@ var ts; : node; } function createObjectLiteralExpression(properties, multiLine) { - var node = createBaseExpression(200); + var node = createBaseExpression(197); node.properties = createNodeArray(properties); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); @@ -17362,7 +16709,7 @@ var ts; : node; } function createPropertyAccessExpression(expression, name) { - var node = createBaseExpression(201); + var node = createBaseExpression(198); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.name = asName(name); node.transformFlags = @@ -17387,7 +16734,7 @@ var ts; : node; } function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createBaseExpression(201); + var node = createBaseExpression(198); node.flags |= 32; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -17410,7 +16757,7 @@ var ts; : node; } function createElementAccessExpression(expression, index) { - var node = createBaseExpression(202); + var node = createBaseExpression(199); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.argumentExpression = asExpression(index); node.transformFlags |= @@ -17433,7 +16780,7 @@ var ts; : node; } function createElementAccessChain(expression, questionDotToken, index) { - var node = createBaseExpression(202); + var node = createBaseExpression(199); node.flags |= 32; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -17454,7 +16801,7 @@ var ts; : node; } function createCallExpression(expression, typeArguments, argumentsArray) { - var node = createBaseExpression(203); + var node = createBaseExpression(200); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)); @@ -17484,7 +16831,7 @@ var ts; : node; } function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createBaseExpression(203); + var node = createBaseExpression(200); node.flags |= 32; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -17514,7 +16861,7 @@ var ts; : node; } function createNewExpression(expression, typeArguments, argumentsArray) { - var node = createBaseExpression(204); + var node = createBaseExpression(201); node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : undefined; @@ -17536,7 +16883,7 @@ var ts; : node; } function createTaggedTemplateExpression(tag, typeArguments, template) { - var node = createBaseExpression(205); + var node = createBaseExpression(202); node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag); node.typeArguments = asNodeArray(typeArguments); node.template = template; @@ -17561,7 +16908,7 @@ var ts; : node; } function createTypeAssertion(type, expression) { - var node = createBaseExpression(206); + var node = createBaseExpression(203); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.type = type; node.transformFlags |= @@ -17577,7 +16924,7 @@ var ts; : node; } function createParenthesizedExpression(expression) { - var node = createBaseExpression(207); + var node = createBaseExpression(204); node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); return node; @@ -17588,7 +16935,7 @@ var ts; : node; } function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(208, undefined, modifiers, name, typeParameters, parameters, type, body); + var node = createBaseFunctionLikeDeclaration(205, undefined, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; node.transformFlags |= propagateChildFlags(node.asteriskToken); if (node.typeParameters) { @@ -17619,7 +16966,7 @@ var ts; : node; } function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createBaseFunctionLikeDeclaration(209, undefined, modifiers, undefined, typeParameters, parameters, type, parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body)); + var node = createBaseFunctionLikeDeclaration(206, undefined, modifiers, undefined, typeParameters, parameters, type, parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body)); node.equalsGreaterThanToken = equalsGreaterThanToken !== null && equalsGreaterThanToken !== void 0 ? equalsGreaterThanToken : createToken(38); node.transformFlags |= propagateChildFlags(node.equalsGreaterThanToken) | @@ -17640,7 +16987,7 @@ var ts; : node; } function createDeleteExpression(expression) { - var node = createBaseExpression(210); + var node = createBaseExpression(207); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -17651,7 +16998,7 @@ var ts; : node; } function createTypeOfExpression(expression) { - var node = createBaseExpression(211); + var node = createBaseExpression(208); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -17662,7 +17009,7 @@ var ts; : node; } function createVoidExpression(expression) { - var node = createBaseExpression(212); + var node = createBaseExpression(209); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -17673,7 +17020,7 @@ var ts; : node; } function createAwaitExpression(expression) { - var node = createBaseExpression(213); + var node = createBaseExpression(210); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -17688,7 +17035,7 @@ var ts; : node; } function createPrefixUnaryExpression(operator, operand) { - var node = createBaseExpression(214); + var node = createBaseExpression(211); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand); node.transformFlags |= propagateChildFlags(node.operand); @@ -17700,7 +17047,7 @@ var ts; : node; } function createPostfixUnaryExpression(operand, operator) { - var node = createBaseExpression(215); + var node = createBaseExpression(212); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand); node.transformFlags = propagateChildFlags(node.operand); @@ -17712,7 +17059,7 @@ var ts; : node; } function createBinaryExpression(left, operator, right) { - var node = createBaseExpression(216); + var node = createBaseExpression(213); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left); @@ -17730,14 +17077,12 @@ var ts; node.transformFlags |= 256 | 32 | - 1024 | - propagateAssignmentPatternFlags(node.left); + 1024; } else if (ts.isArrayLiteralExpression(node.left)) { node.transformFlags |= 256 | - 1024 | - propagateAssignmentPatternFlags(node.left); + 1024; } } else if (operatorKind === 42 || operatorKind === 66) { @@ -17748,27 +17093,6 @@ var ts; } return node; } - function propagateAssignmentPatternFlags(node) { - if (node.transformFlags & 16384) - return 16384; - if (node.transformFlags & 32) { - for (var _i = 0, _a = ts.getElementsOfBindingOrAssignmentPattern(node); _i < _a.length; _i++) { - var element = _a[_i]; - var target = ts.getTargetOfBindingOrAssignmentElement(element); - if (target && ts.isAssignmentPattern(target)) { - if (target.transformFlags & 16384) { - return 16384; - } - if (target.transformFlags & 32) { - var flags_1 = propagateAssignmentPatternFlags(target); - if (flags_1) - return flags_1; - } - } - } - } - return 0; - } function updateBinaryExpression(node, left, operator, right) { return node.left !== left || node.operatorToken !== operator @@ -17777,7 +17101,7 @@ var ts; : node; } function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { - var node = createBaseExpression(217); + var node = createBaseExpression(214); node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); node.questionToken = questionToken !== null && questionToken !== void 0 ? questionToken : createToken(57); node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); @@ -17801,7 +17125,7 @@ var ts; : node; } function createTemplateExpression(head, templateSpans) { - var node = createBaseExpression(218); + var node = createBaseExpression(215); node.head = head; node.templateSpans = createNodeArray(templateSpans); node.transformFlags |= @@ -17862,7 +17186,7 @@ var ts; } function createYieldExpression(asteriskToken, expression) { ts.Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression."); - var node = createBaseExpression(219); + var node = createBaseExpression(216); node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.asteriskToken = asteriskToken; node.transformFlags |= @@ -17880,7 +17204,7 @@ var ts; : node; } function createSpreadElement(expression) { - var node = createBaseExpression(220); + var node = createBaseExpression(217); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -17894,7 +17218,7 @@ var ts; : node; } function createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseClassLikeDeclaration(221, decorators, modifiers, name, typeParameters, heritageClauses, members); + var node = createBaseClassLikeDeclaration(218, decorators, modifiers, name, typeParameters, heritageClauses, members); node.transformFlags |= 256; return node; } @@ -17909,10 +17233,10 @@ var ts; : node; } function createOmittedExpression() { - return createBaseExpression(222); + return createBaseExpression(219); } function createExpressionWithTypeArguments(expression, typeArguments) { - var node = createBaseNode(223); + var node = createBaseNode(220); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.transformFlags |= @@ -17928,7 +17252,7 @@ var ts; : node; } function createAsExpression(expression, type) { - var node = createBaseExpression(224); + var node = createBaseExpression(221); node.expression = expression; node.type = type; node.transformFlags |= @@ -17944,7 +17268,7 @@ var ts; : node; } function createNonNullExpression(expression) { - var node = createBaseExpression(225); + var node = createBaseExpression(222); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -17960,7 +17284,7 @@ var ts; : node; } function createNonNullChain(expression) { - var node = createBaseExpression(225); + var node = createBaseExpression(222); node.flags |= 32; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= @@ -17975,7 +17299,7 @@ var ts; : node; } function createMetaProperty(keywordToken, name) { - var node = createBaseExpression(226); + var node = createBaseExpression(223); node.keywordToken = keywordToken; node.name = name; node.transformFlags |= propagateChildFlags(node.name); @@ -17997,7 +17321,7 @@ var ts; : node; } function createTemplateSpan(expression, literal) { - var node = createBaseNode(228); + var node = createBaseNode(225); node.expression = expression; node.literal = literal; node.transformFlags |= @@ -18013,12 +17337,12 @@ var ts; : node; } function createSemicolonClassElement() { - var node = createBaseNode(229); + var node = createBaseNode(226); node.transformFlags |= 256; return node; } function createBlock(statements, multiLine) { - var node = createBaseNode(230); + var node = createBaseNode(227); node.statements = createNodeArray(statements); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); @@ -18030,7 +17354,7 @@ var ts; : node; } function createVariableStatement(modifiers, declarationList) { - var node = createBaseDeclaration(232, undefined, modifiers); + var node = createBaseDeclaration(229, undefined, modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; node.transformFlags |= propagateChildFlags(node.declarationList); @@ -18046,10 +17370,10 @@ var ts; : node; } function createEmptyStatement() { - return createBaseNode(231); + return createBaseNode(228); } function createExpressionStatement(expression) { - var node = createBaseNode(233); + var node = createBaseNode(230); node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -18060,7 +17384,7 @@ var ts; : node; } function createIfStatement(expression, thenStatement, elseStatement) { - var node = createBaseNode(234); + var node = createBaseNode(231); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -18078,7 +17402,7 @@ var ts; : node; } function createDoStatement(statement, expression) { - var node = createBaseNode(235); + var node = createBaseNode(232); node.statement = asEmbeddedStatement(statement); node.expression = expression; node.transformFlags |= @@ -18093,7 +17417,7 @@ var ts; : node; } function createWhileStatement(expression, statement) { - var node = createBaseNode(236); + var node = createBaseNode(233); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -18108,7 +17432,7 @@ var ts; : node; } function createForStatement(initializer, condition, incrementor, statement) { - var node = createBaseNode(237); + var node = createBaseNode(234); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -18129,7 +17453,7 @@ var ts; : node; } function createForInStatement(initializer, expression, statement) { - var node = createBaseNode(238); + var node = createBaseNode(235); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -18147,7 +17471,7 @@ var ts; : node; } function createForOfStatement(awaitModifier, initializer, expression, statement) { - var node = createBaseNode(239); + var node = createBaseNode(236); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); @@ -18171,7 +17495,7 @@ var ts; : node; } function createContinueStatement(label) { - var node = createBaseNode(240); + var node = createBaseNode(237); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | @@ -18184,7 +17508,7 @@ var ts; : node; } function createBreakStatement(label) { - var node = createBaseNode(241); + var node = createBaseNode(238); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | @@ -18197,7 +17521,7 @@ var ts; : node; } function createReturnStatement(expression) { - var node = createBaseNode(242); + var node = createBaseNode(239); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | @@ -18211,7 +17535,7 @@ var ts; : node; } function createWithStatement(expression, statement) { - var node = createBaseNode(243); + var node = createBaseNode(240); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -18226,7 +17550,7 @@ var ts; : node; } function createSwitchStatement(expression, caseBlock) { - var node = createBaseNode(244); + var node = createBaseNode(241); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.caseBlock = caseBlock; node.transformFlags |= @@ -18241,7 +17565,7 @@ var ts; : node; } function createLabeledStatement(label, statement) { - var node = createBaseNode(245); + var node = createBaseNode(242); node.label = asName(label); node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -18256,7 +17580,7 @@ var ts; : node; } function createThrowStatement(expression) { - var node = createBaseNode(246); + var node = createBaseNode(243); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -18267,7 +17591,7 @@ var ts; : node; } function createTryStatement(tryBlock, catchClause, finallyBlock) { - var node = createBaseNode(247); + var node = createBaseNode(244); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -18285,10 +17609,10 @@ var ts; : node; } function createDebuggerStatement() { - return createBaseNode(248); + return createBaseNode(245); } function createVariableDeclaration(name, exclamationToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(249, undefined, undefined, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); + var node = createBaseVariableLikeDeclaration(246, undefined, undefined, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); node.exclamationToken = exclamationToken; node.transformFlags |= propagateChildFlags(node.exclamationToken); if (exclamationToken) { @@ -18306,7 +17630,7 @@ var ts; } function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0; } - var node = createBaseNode(250); + var node = createBaseNode(247); node.flags |= flags & 3; node.declarations = createNodeArray(declarations); node.transformFlags |= @@ -18325,7 +17649,7 @@ var ts; : node; } function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(251, decorators, modifiers, name, typeParameters, parameters, type, body); + var node = createBaseFunctionLikeDeclaration(248, decorators, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; if (!node.body || ts.modifiersToFlags(node.modifiers) & 2) { node.transformFlags = 1; @@ -18361,7 +17685,7 @@ var ts; : node; } function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseClassLikeDeclaration(252, decorators, modifiers, name, typeParameters, heritageClauses, members); + var node = createBaseClassLikeDeclaration(249, decorators, modifiers, name, typeParameters, heritageClauses, members); if (ts.modifiersToFlags(node.modifiers) & 2) { node.transformFlags = 1; } @@ -18384,7 +17708,7 @@ var ts; : node; } function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseInterfaceOrClassLikeDeclaration(253, decorators, modifiers, name, typeParameters, heritageClauses); + var node = createBaseInterfaceOrClassLikeDeclaration(250, decorators, modifiers, name, typeParameters, heritageClauses); node.members = createNodeArray(members); node.transformFlags = 1; return node; @@ -18400,7 +17724,7 @@ var ts; : node; } function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createBaseGenericNamedDeclaration(254, decorators, modifiers, name, typeParameters); + var node = createBaseGenericNamedDeclaration(251, decorators, modifiers, name, typeParameters); node.type = type; node.transformFlags = 1; return node; @@ -18415,7 +17739,7 @@ var ts; : node; } function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createBaseNamedDeclaration(255, decorators, modifiers, name); + var node = createBaseNamedDeclaration(252, decorators, modifiers, name); node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.members) | @@ -18433,7 +17757,7 @@ var ts; } function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0; } - var node = createBaseDeclaration(256, decorators, modifiers); + var node = createBaseDeclaration(253, decorators, modifiers); node.flags |= flags & (16 | 4 | 1024); node.name = name; node.body = body; @@ -18458,7 +17782,7 @@ var ts; : node; } function createModuleBlock(statements) { - var node = createBaseNode(257); + var node = createBaseNode(254); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); return node; @@ -18469,7 +17793,7 @@ var ts; : node; } function createCaseBlock(clauses) { - var node = createBaseNode(258); + var node = createBaseNode(255); node.clauses = createNodeArray(clauses); node.transformFlags |= propagateChildrenFlags(node.clauses); return node; @@ -18480,7 +17804,7 @@ var ts; : node; } function createNamespaceExportDeclaration(name) { - var node = createBaseNamedDeclaration(259, undefined, undefined, name); + var node = createBaseNamedDeclaration(256, undefined, undefined, name); node.transformFlags = 1; return node; } @@ -18490,7 +17814,7 @@ var ts; : node; } function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createBaseNamedDeclaration(260, decorators, modifiers, name); + var node = createBaseNamedDeclaration(257, decorators, modifiers, name); node.moduleReference = moduleReference; node.transformFlags |= propagateChildFlags(node.moduleReference); if (!ts.isExternalModuleReference(node.moduleReference)) @@ -18507,7 +17831,7 @@ var ts; : node; } function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createBaseDeclaration(261, decorators, modifiers); + var node = createBaseDeclaration(258, decorators, modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; node.transformFlags |= @@ -18525,7 +17849,7 @@ var ts; : node; } function createImportClause(isTypeOnly, name, namedBindings) { - var node = createBaseNode(262); + var node = createBaseNode(259); node.isTypeOnly = isTypeOnly; node.name = name; node.namedBindings = namedBindings; @@ -18546,7 +17870,7 @@ var ts; : node; } function createNamespaceImport(name) { - var node = createBaseNode(263); + var node = createBaseNode(260); node.name = name; node.transformFlags |= propagateChildFlags(node.name); node.transformFlags &= ~8388608; @@ -18558,7 +17882,7 @@ var ts; : node; } function createNamespaceExport(name) { - var node = createBaseNode(269); + var node = createBaseNode(266); node.name = name; node.transformFlags |= propagateChildFlags(node.name) | @@ -18572,7 +17896,7 @@ var ts; : node; } function createNamedImports(elements) { - var node = createBaseNode(264); + var node = createBaseNode(261); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~8388608; @@ -18584,7 +17908,7 @@ var ts; : node; } function createImportSpecifier(propertyName, name) { - var node = createBaseNode(265); + var node = createBaseNode(262); node.propertyName = propertyName; node.name = name; node.transformFlags |= @@ -18600,7 +17924,7 @@ var ts; : node; } function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createBaseDeclaration(266, decorators, modifiers); + var node = createBaseDeclaration(263, decorators, modifiers); node.isExportEquals = isExportEquals; node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary(62, undefined, expression) @@ -18617,7 +17941,7 @@ var ts; : node; } function createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier) { - var node = createBaseDeclaration(267, decorators, modifiers); + var node = createBaseDeclaration(264, decorators, modifiers); node.isTypeOnly = isTypeOnly; node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; @@ -18637,7 +17961,7 @@ var ts; : node; } function createNamedExports(elements) { - var node = createBaseNode(268); + var node = createBaseNode(265); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~8388608; @@ -18649,7 +17973,7 @@ var ts; : node; } function createExportSpecifier(propertyName, name) { - var node = createBaseNode(270); + var node = createBaseNode(267); node.propertyName = asName(propertyName); node.name = asName(name); node.transformFlags |= @@ -18665,11 +17989,11 @@ var ts; : node; } function createMissingDeclaration() { - var node = createBaseDeclaration(271, undefined, undefined); + var node = createBaseDeclaration(268, undefined, undefined); return node; } function createExternalModuleReference(expression) { - var node = createBaseNode(272); + var node = createBaseNode(269); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.transformFlags &= ~8388608; @@ -18694,7 +18018,7 @@ var ts; : node; } function createJSDocFunctionType(parameters, type) { - var node = createBaseSignatureDeclaration(308, undefined, undefined, undefined, undefined, parameters, type); + var node = createBaseSignatureDeclaration(304, undefined, undefined, undefined, undefined, parameters, type); return node; } function updateJSDocFunctionType(node, parameters, type) { @@ -18705,7 +18029,7 @@ var ts; } function createJSDocTypeLiteral(propertyTags, isArrayType) { if (isArrayType === void 0) { isArrayType = false; } - var node = createBaseNode(312); + var node = createBaseNode(308); node.jsDocPropertyTags = asNodeArray(propertyTags); node.isArrayType = isArrayType; return node; @@ -18717,7 +18041,7 @@ var ts; : node; } function createJSDocTypeExpression(type) { - var node = createBaseNode(301); + var node = createBaseNode(298); node.type = type; return node; } @@ -18727,7 +18051,7 @@ var ts; : node; } function createJSDocSignature(typeParameters, parameters, type) { - var node = createBaseNode(313); + var node = createBaseNode(309); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; @@ -18753,7 +18077,7 @@ var ts; return node; } function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { - var node = createBaseJSDocTag(330, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment); + var node = createBaseJSDocTag(326, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment); node.constraint = constraint; node.typeParameters = createNodeArray(typeParameters); return node; @@ -18768,7 +18092,7 @@ var ts; : node; } function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { - var node = createBaseJSDocTag(331, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment); + var node = createBaseJSDocTag(327, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = ts.getJSDocTypeAliasName(fullName); @@ -18784,7 +18108,7 @@ var ts; : node; } function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - var node = createBaseJSDocTag(326, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment); + var node = createBaseJSDocTag(322, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -18803,7 +18127,7 @@ var ts; : node; } function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - var node = createBaseJSDocTag(333, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment); + var node = createBaseJSDocTag(328, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -18822,7 +18146,7 @@ var ts; : node; } function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { - var node = createBaseJSDocTag(324, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment); + var node = createBaseJSDocTag(320, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = ts.getJSDocTypeAliasName(fullName); @@ -18838,7 +18162,7 @@ var ts; : node; } function createJSDocAugmentsTag(tagName, className, comment) { - var node = createBaseJSDocTag(315, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment); + var node = createBaseJSDocTag(311, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment); node.class = className; return node; } @@ -18851,32 +18175,10 @@ var ts; : node; } function createJSDocImplementsTag(tagName, className, comment) { - var node = createBaseJSDocTag(316, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment); + var node = createBaseJSDocTag(312, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment); node.class = className; return node; } - function createJSDocSeeTag(tagName, name, comment) { - var node = createBaseJSDocTag(332, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("see"), comment); - node.name = name; - return node; - } - function updateJSDocSeeTag(node, tagName, name, comment) { - return node.tagName !== tagName - || node.name !== name - || node.comment !== comment - ? update(createJSDocSeeTag(tagName, name, comment), node) - : node; - } - function createJSDocNameReference(name) { - var node = createBaseNode(302); - node.name = name; - return node; - } - function updateJSDocNameReference(node, name) { - return node.name !== name - ? update(createJSDocNameReference(name), node) - : node; - } function updateJSDocImplementsTag(node, tagName, className, comment) { if (tagName === void 0) { tagName = getDefaultTagName(node); } return node.tagName !== tagName @@ -18910,7 +18212,7 @@ var ts; : node; } function createJSDocUnknownTag(tagName, comment) { - var node = createBaseJSDocTag(314, tagName, comment); + var node = createBaseJSDocTag(310, tagName, comment); return node; } function updateJSDocUnknownTag(node, tagName, comment) { @@ -18920,7 +18222,7 @@ var ts; : node; } function createJSDocComment(comment, tags) { - var node = createBaseNode(311); + var node = createBaseNode(307); node.comment = comment; node.tags = asNodeArray(tags); return node; @@ -18932,7 +18234,7 @@ var ts; : node; } function createJsxElement(openingElement, children, closingElement) { - var node = createBaseNode(273); + var node = createBaseNode(270); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -18951,7 +18253,7 @@ var ts; : node; } function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createBaseNode(274); + var node = createBaseNode(271); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -18973,7 +18275,7 @@ var ts; : node; } function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createBaseNode(275); + var node = createBaseNode(272); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -18995,7 +18297,7 @@ var ts; : node; } function createJsxClosingElement(tagName) { - var node = createBaseNode(276); + var node = createBaseNode(273); node.tagName = tagName; node.transformFlags |= propagateChildFlags(node.tagName) | @@ -19008,7 +18310,7 @@ var ts; : node; } function createJsxFragment(openingFragment, children, closingFragment) { - var node = createBaseNode(277); + var node = createBaseNode(274); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -19040,17 +18342,17 @@ var ts; : node; } function createJsxOpeningFragment() { - var node = createBaseNode(278); + var node = createBaseNode(275); node.transformFlags |= 2; return node; } function createJsxJsxClosingFragment() { - var node = createBaseNode(279); + var node = createBaseNode(276); node.transformFlags |= 2; return node; } function createJsxAttribute(name, initializer) { - var node = createBaseNode(280); + var node = createBaseNode(277); node.name = name; node.initializer = initializer; node.transformFlags |= @@ -19066,7 +18368,7 @@ var ts; : node; } function createJsxAttributes(properties) { - var node = createBaseNode(281); + var node = createBaseNode(278); node.properties = createNodeArray(properties); node.transformFlags |= propagateChildrenFlags(node.properties) | @@ -19079,7 +18381,7 @@ var ts; : node; } function createJsxSpreadAttribute(expression) { - var node = createBaseNode(282); + var node = createBaseNode(279); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | @@ -19092,7 +18394,7 @@ var ts; : node; } function createJsxExpression(dotDotDotToken, expression) { - var node = createBaseNode(283); + var node = createBaseNode(280); node.dotDotDotToken = dotDotDotToken; node.expression = expression; node.transformFlags |= @@ -19107,7 +18409,7 @@ var ts; : node; } function createCaseClause(expression, statements) { - var node = createBaseNode(284); + var node = createBaseNode(281); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.statements = createNodeArray(statements); node.transformFlags |= @@ -19122,7 +18424,7 @@ var ts; : node; } function createDefaultClause(statements) { - var node = createBaseNode(285); + var node = createBaseNode(282); node.statements = createNodeArray(statements); node.transformFlags = propagateChildrenFlags(node.statements); return node; @@ -19133,7 +18435,7 @@ var ts; : node; } function createHeritageClause(token, types) { - var node = createBaseNode(286); + var node = createBaseNode(283); node.token = token; node.types = createNodeArray(types); node.transformFlags |= propagateChildrenFlags(node.types); @@ -19155,7 +18457,7 @@ var ts; : node; } function createCatchClause(variableDeclaration, block) { - var node = createBaseNode(287); + var node = createBaseNode(284); variableDeclaration = !ts.isString(variableDeclaration) ? variableDeclaration : createVariableDeclaration(variableDeclaration, undefined, undefined, undefined); node.variableDeclaration = variableDeclaration; node.block = block; @@ -19173,7 +18475,7 @@ var ts; : node; } function createPropertyAssignment(name, initializer) { - var node = createBaseNamedDeclaration(288, undefined, undefined, name); + var node = createBaseNamedDeclaration(285, undefined, undefined, name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= propagateChildFlags(node.name) | @@ -19198,7 +18500,7 @@ var ts; : node; } function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createBaseNamedDeclaration(289, undefined, undefined, name); + var node = createBaseNamedDeclaration(286, undefined, undefined, name); node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); node.transformFlags |= propagateChildFlags(node.objectAssignmentInitializer) | @@ -19225,7 +18527,7 @@ var ts; : node; } function createSpreadAssignment(expression) { - var node = createBaseNode(290); + var node = createBaseNode(287); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -19239,7 +18541,7 @@ var ts; : node; } function createEnumMember(name, initializer) { - var node = createBaseNode(291); + var node = createBaseNode(288); node.name = asName(name); node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= @@ -19255,7 +18557,7 @@ var ts; : node; } function createSourceFile(statements, endOfFileToken, flags) { - var node = baseFactory.createBaseSourceFileNode(297); + var node = baseFactory.createBaseSourceFileNode(294); node.statements = createNodeArray(statements); node.endOfFileToken = endOfFileToken; node.flags |= flags; @@ -19272,7 +18574,7 @@ var ts; return node; } function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) { - var node = baseFactory.createBaseSourceFileNode(297); + var node = baseFactory.createBaseSourceFileNode(294); for (var p in source) { if (p === "emitNode" || ts.hasProperty(node, p) || !ts.hasProperty(source, p)) continue; @@ -19308,7 +18610,7 @@ var ts; } function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = createBaseNode(298); + var node = createBaseNode(295); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -19321,7 +18623,7 @@ var ts; : node; } function createUnparsedSource(prologues, syntheticReferences, texts) { - var node = createBaseNode(299); + var node = createBaseNode(296); node.prologues = prologues; node.syntheticReferences = syntheticReferences; node.texts = texts; @@ -19338,49 +18640,49 @@ var ts; return node; } function createUnparsedPrologue(data) { - return createBaseUnparsedNode(292, data); + return createBaseUnparsedNode(289, data); } function createUnparsedPrepend(data, texts) { - var node = createBaseUnparsedNode(293, data); + var node = createBaseUnparsedNode(290, data); node.texts = texts; return node; } function createUnparsedTextLike(data, internal) { - return createBaseUnparsedNode(internal ? 295 : 294, data); + return createBaseUnparsedNode(internal ? 292 : 291, data); } function createUnparsedSyntheticReference(section) { - var node = createBaseNode(296); + var node = createBaseNode(293); node.data = section.data; node.section = section; return node; } function createInputFiles() { - var node = createBaseNode(300); + var node = createBaseNode(297); node.javascriptText = ""; node.declarationText = ""; return node; } function createSyntheticExpression(type, isSpread, tupleNameSource) { if (isSpread === void 0) { isSpread = false; } - var node = createBaseNode(227); + var node = createBaseNode(224); node.type = type; node.isSpread = isSpread; node.tupleNameSource = tupleNameSource; return node; } function createSyntaxList(children) { - var node = createBaseNode(334); + var node = createBaseNode(329); node._children = children; return node; } function createNotEmittedStatement(original) { - var node = createBaseNode(335); + var node = createBaseNode(330); node.original = original; ts.setTextRange(node, original); return node; } function createPartiallyEmittedExpression(expression, original) { - var node = createBaseNode(336); + var node = createBaseNode(331); node.expression = expression; node.original = original; node.transformFlags |= @@ -19406,7 +18708,7 @@ var ts; return node; } function createCommaListExpression(elements) { - var node = createBaseNode(337); + var node = createBaseNode(332); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; @@ -19417,19 +18719,19 @@ var ts; : node; } function createEndOfDeclarationMarker(original) { - var node = createBaseNode(339); + var node = createBaseNode(334); node.emitNode = {}; node.original = original; return node; } function createMergeDeclarationMarker(original) { - var node = createBaseNode(338); + var node = createBaseNode(333); node.emitNode = {}; node.original = original; return node; } function createSyntheticReferenceExpression(expression, thisArg) { - var node = createBaseNode(340); + var node = createBaseNode(335); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= @@ -19447,7 +18749,7 @@ var ts; if (node === undefined) { return node; } - var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(297) : + var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(294) : ts.isIdentifier(node) ? baseFactory.createBaseIdentifierNode(78) : ts.isPrivateIdentifier(node) ? baseFactory.createBasePrivateIdentifierNode(79) : !ts.isNodeKind(node.kind) ? baseFactory.createBaseTokenNode(node.kind) : @@ -19529,11 +18831,11 @@ var ts; } function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 207: return updateParenthesizedExpression(outerExpression, expression); - case 206: return updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 224: return updateAsExpression(outerExpression, expression, outerExpression.type); - case 225: return updateNonNullExpression(outerExpression, expression); - case 336: return updatePartiallyEmittedExpression(outerExpression, expression); + case 204: return updateParenthesizedExpression(outerExpression, expression); + case 203: return updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 221: return updateAsExpression(outerExpression, expression, outerExpression.type); + case 222: return updateNonNullExpression(outerExpression, expression); + case 331: return updatePartiallyEmittedExpression(outerExpression, expression); } } function isIgnorableParen(node) { @@ -19573,13 +18875,13 @@ var ts; case 9: case 10: return false; - case 199: + case 196: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 200: + case 197: return target.properties.length > 0; default: return true; @@ -19860,23 +19162,23 @@ var ts; } function getDefaultTagNameForKind(kind) { switch (kind) { - case 329: return "type"; - case 327: return "returns"; - case 328: return "this"; - case 325: return "enum"; - case 317: return "author"; - case 319: return "class"; - case 320: return "public"; - case 321: return "private"; - case 322: return "protected"; - case 323: return "readonly"; - case 330: return "template"; - case 331: return "typedef"; - case 326: return "param"; - case 333: return "prop"; - case 324: return "callback"; - case 315: return "augments"; - case 316: return "implements"; + case 325: return "type"; + case 323: return "returns"; + case 324: return "this"; + case 321: return "enum"; + case 313: return "author"; + case 315: return "class"; + case 316: return "public"; + case 317: return "private"; + case 318: return "protected"; + case 319: return "readonly"; + case 326: return "template"; + case 327: return "typedef"; + case 322: return "param"; + case 328: return "prop"; + case 320: return "callback"; + case 311: return "augments"; + case 312: return "implements"; default: return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind)); } @@ -19949,69 +19251,69 @@ var ts; children.transformFlags = subtreeFlags; } function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 172 && kind <= 195) { + if (kind >= 171 && kind <= 192) { return -2; } switch (kind) { - case 203: - case 204: - case 199: + case 200: + case 201: + case 196: return 536879104; - case 256: + case 253: return 546379776; - case 160: + case 159: return 536870912; - case 209: + case 206: return 547309568; - case 208: - case 251: + case 205: + case 248: return 547313664; - case 250: + case 247: return 537018368; - case 252: - case 221: + case 249: + case 218: return 536905728; - case 166: - return 547311616; - case 163: - return 536875008; case 165: + return 547311616; + case 162: + return 536875008; + case 164: + case 166: case 167: - case 168: return 538923008; case 128: + case 143: + case 154: + case 140: + case 146: case 144: - case 155: - case 141: - case 147: - case 145: case 131: - case 148: + case 147: case 113: - case 159: - case 162: - case 164: + case 158: + case 161: + case 163: + case 168: case 169: case 170: - case 171: - case 253: - case 254: + case 250: + case 251: return -2; - case 200: - return 536922112; - case 287: - return 536887296; - case 196: case 197: + return 536922112; + case 284: + return 536887296; + case 193: + case 194: return 536879104; - case 206: - case 224: - case 336: - case 207: + case 203: + case 221: + case 331: + case 204: case 105: return 536870912; - case 201: - case 202: + case 198: + case 199: return 536870912; default: return 536870912; @@ -20294,7 +19596,7 @@ var ts; var _a; if (!node.emitNode) { if (ts.isParseTreeNode(node)) { - if (node.kind === 297) { + if (node.kind === 294) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = (_a = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node)))) !== null && _a !== void 0 ? _a : ts.Debug.fail("Could not determine parsed source file."); @@ -20946,11 +20248,11 @@ var ts; } ts.isIdentifier = isIdentifier; function isQualifiedName(node) { - return node.kind === 157; + return node.kind === 156; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 158; + return node.kind === 157; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -20978,707 +20280,695 @@ var ts; } ts.isExclamationToken = isExclamationToken; function isTypeParameterDeclaration(node) { - return node.kind === 159; + return node.kind === 158; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 160; + return node.kind === 159; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 161; + return node.kind === 160; } ts.isDecorator = isDecorator; function isPropertySignature(node) { - return node.kind === 162; + return node.kind === 161; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 163; + return node.kind === 162; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 164; + return node.kind === 163; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 165; + return node.kind === 164; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 166; + return node.kind === 165; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 167; + return node.kind === 166; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 168; + return node.kind === 167; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 169; + return node.kind === 168; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 170; + return node.kind === 169; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 171; + return node.kind === 170; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; function isTypePredicateNode(node) { - return node.kind === 172; + return node.kind === 171; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 173; + return node.kind === 172; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 174; + return node.kind === 173; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 175; + return node.kind === 174; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 176; + return node.kind === 175; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 177; + return node.kind === 176; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 178; + return node.kind === 177; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 179; + return node.kind === 178; } ts.isTupleTypeNode = isTupleTypeNode; function isNamedTupleMember(node) { - return node.kind === 192; + return node.kind === 191; } ts.isNamedTupleMember = isNamedTupleMember; function isOptionalTypeNode(node) { - return node.kind === 180; + return node.kind === 179; } ts.isOptionalTypeNode = isOptionalTypeNode; function isRestTypeNode(node) { - return node.kind === 181; + return node.kind === 180; } ts.isRestTypeNode = isRestTypeNode; function isUnionTypeNode(node) { - return node.kind === 182; + return node.kind === 181; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 183; + return node.kind === 182; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 184; + return node.kind === 183; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 185; + return node.kind === 184; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 186; + return node.kind === 185; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 187; + return node.kind === 186; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 188; + return node.kind === 187; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 189; + return node.kind === 188; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 190; + return node.kind === 189; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 191; + return node.kind === 190; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 195; + return node.kind === 192; } ts.isImportTypeNode = isImportTypeNode; - function isTemplateLiteralTypeSpan(node) { - return node.kind === 194; - } - ts.isTemplateLiteralTypeSpan = isTemplateLiteralTypeSpan; - function isTemplateLiteralTypeNode(node) { - return node.kind === 193; - } - ts.isTemplateLiteralTypeNode = isTemplateLiteralTypeNode; function isObjectBindingPattern(node) { - return node.kind === 196; + return node.kind === 193; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 197; + return node.kind === 194; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 198; + return node.kind === 195; } ts.isBindingElement = isBindingElement; function isArrayLiteralExpression(node) { - return node.kind === 199; + return node.kind === 196; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 200; + return node.kind === 197; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 201; + return node.kind === 198; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 202; + return node.kind === 199; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 203; + return node.kind === 200; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 204; + return node.kind === 201; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 205; + return node.kind === 202; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertionExpression(node) { - return node.kind === 206; + return node.kind === 203; } ts.isTypeAssertionExpression = isTypeAssertionExpression; function isParenthesizedExpression(node) { - return node.kind === 207; + return node.kind === 204; } ts.isParenthesizedExpression = isParenthesizedExpression; function isFunctionExpression(node) { - return node.kind === 208; + return node.kind === 205; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 209; + return node.kind === 206; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 210; + return node.kind === 207; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 211; + return node.kind === 208; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 212; + return node.kind === 209; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 213; + return node.kind === 210; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 214; + return node.kind === 211; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 215; + return node.kind === 212; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 216; + return node.kind === 213; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 217; + return node.kind === 214; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 218; + return node.kind === 215; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 219; + return node.kind === 216; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 220; + return node.kind === 217; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 221; + return node.kind === 218; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 222; + return node.kind === 219; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 223; + return node.kind === 220; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 224; + return node.kind === 221; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 225; + return node.kind === 222; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 226; + return node.kind === 223; } ts.isMetaProperty = isMetaProperty; function isSyntheticExpression(node) { - return node.kind === 227; + return node.kind === 224; } ts.isSyntheticExpression = isSyntheticExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 336; + return node.kind === 331; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isCommaListExpression(node) { - return node.kind === 337; + return node.kind === 332; } ts.isCommaListExpression = isCommaListExpression; function isTemplateSpan(node) { - return node.kind === 228; + return node.kind === 225; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 229; + return node.kind === 226; } ts.isSemicolonClassElement = isSemicolonClassElement; function isBlock(node) { - return node.kind === 230; + return node.kind === 227; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 232; + return node.kind === 229; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 231; + return node.kind === 228; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 233; + return node.kind === 230; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 234; + return node.kind === 231; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 235; + return node.kind === 232; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 236; + return node.kind === 233; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 237; + return node.kind === 234; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 238; + return node.kind === 235; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 239; + return node.kind === 236; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 240; + return node.kind === 237; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 241; + return node.kind === 238; } ts.isBreakStatement = isBreakStatement; function isReturnStatement(node) { - return node.kind === 242; + return node.kind === 239; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 243; + return node.kind === 240; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 244; + return node.kind === 241; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 245; + return node.kind === 242; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 246; + return node.kind === 243; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 247; + return node.kind === 244; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 248; + return node.kind === 245; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 249; + return node.kind === 246; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 250; + return node.kind === 247; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 251; + return node.kind === 248; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 252; + return node.kind === 249; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 253; + return node.kind === 250; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 254; + return node.kind === 251; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 255; + return node.kind === 252; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 256; + return node.kind === 253; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 257; + return node.kind === 254; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 258; + return node.kind === 255; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 259; + return node.kind === 256; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 260; + return node.kind === 257; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 261; + return node.kind === 258; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 262; + return node.kind === 259; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 263; + return node.kind === 260; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 269; + return node.kind === 266; } ts.isNamespaceExport = isNamespaceExport; function isNamedImports(node) { - return node.kind === 264; + return node.kind === 261; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 265; + return node.kind === 262; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 266; + return node.kind === 263; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 267; + return node.kind === 264; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 268; + return node.kind === 265; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 270; + return node.kind === 267; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 271; + return node.kind === 268; } ts.isMissingDeclaration = isMissingDeclaration; function isNotEmittedStatement(node) { - return node.kind === 335; + return node.kind === 330; } ts.isNotEmittedStatement = isNotEmittedStatement; function isSyntheticReference(node) { - return node.kind === 340; + return node.kind === 335; } ts.isSyntheticReference = isSyntheticReference; function isMergeDeclarationMarker(node) { - return node.kind === 338; + return node.kind === 333; } ts.isMergeDeclarationMarker = isMergeDeclarationMarker; function isEndOfDeclarationMarker(node) { - return node.kind === 339; + return node.kind === 334; } ts.isEndOfDeclarationMarker = isEndOfDeclarationMarker; function isExternalModuleReference(node) { - return node.kind === 272; + return node.kind === 269; } ts.isExternalModuleReference = isExternalModuleReference; function isJsxElement(node) { - return node.kind === 273; + return node.kind === 270; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 274; + return node.kind === 271; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 275; + return node.kind === 272; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 276; + return node.kind === 273; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 277; + return node.kind === 274; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 278; + return node.kind === 275; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 279; + return node.kind === 276; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 280; + return node.kind === 277; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 281; + return node.kind === 278; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 282; + return node.kind === 279; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 283; + return node.kind === 280; } ts.isJsxExpression = isJsxExpression; function isCaseClause(node) { - return node.kind === 284; + return node.kind === 281; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 285; + return node.kind === 282; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 286; + return node.kind === 283; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 287; + return node.kind === 284; } ts.isCatchClause = isCatchClause; function isPropertyAssignment(node) { - return node.kind === 288; + return node.kind === 285; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 289; + return node.kind === 286; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 290; + return node.kind === 287; } ts.isSpreadAssignment = isSpreadAssignment; function isEnumMember(node) { - return node.kind === 291; + return node.kind === 288; } ts.isEnumMember = isEnumMember; function isUnparsedPrepend(node) { - return node.kind === 293; + return node.kind === 290; } ts.isUnparsedPrepend = isUnparsedPrepend; function isSourceFile(node) { - return node.kind === 297; + return node.kind === 294; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 298; + return node.kind === 295; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 299; + return node.kind === 296; } ts.isUnparsedSource = isUnparsedSource; function isJSDocTypeExpression(node) { - return node.kind === 301; + return node.kind === 298; } ts.isJSDocTypeExpression = isJSDocTypeExpression; - function isJSDocNameReference(node) { - return node.kind === 302; - } - ts.isJSDocNameReference = isJSDocNameReference; function isJSDocAllType(node) { - return node.kind === 303; + return node.kind === 299; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 304; + return node.kind === 300; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 305; + return node.kind === 301; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 306; + return node.kind === 302; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 307; + return node.kind === 303; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 308; + return node.kind === 304; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 309; + return node.kind === 305; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDocNamepathType(node) { - return node.kind === 310; + return node.kind === 306; } ts.isJSDocNamepathType = isJSDocNamepathType; function isJSDoc(node) { - return node.kind === 311; + return node.kind === 307; } ts.isJSDoc = isJSDoc; function isJSDocTypeLiteral(node) { - return node.kind === 312; + return node.kind === 308; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocSignature(node) { - return node.kind === 313; + return node.kind === 309; } ts.isJSDocSignature = isJSDocSignature; function isJSDocAugmentsTag(node) { - return node.kind === 315; + return node.kind === 311; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocAuthorTag(node) { - return node.kind === 317; + return node.kind === 313; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocClassTag(node) { - return node.kind === 319; + return node.kind === 315; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocCallbackTag(node) { - return node.kind === 324; + return node.kind === 320; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocPublicTag(node) { - return node.kind === 320; + return node.kind === 316; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 321; + return node.kind === 317; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 322; + return node.kind === 318; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 323; + return node.kind === 319; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocDeprecatedTag(node) { - return node.kind === 318; + return node.kind === 314; } ts.isJSDocDeprecatedTag = isJSDocDeprecatedTag; function isJSDocEnumTag(node) { - return node.kind === 325; + return node.kind === 321; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocParameterTag(node) { - return node.kind === 326; + return node.kind === 322; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 327; + return node.kind === 323; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocThisTag(node) { - return node.kind === 328; + return node.kind === 324; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocTypeTag(node) { - return node.kind === 329; + return node.kind === 325; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 330; + return node.kind === 326; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 331; + return node.kind === 327; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocUnknownTag(node) { - return node.kind === 314; + return node.kind === 310; } ts.isJSDocUnknownTag = isJSDocUnknownTag; function isJSDocPropertyTag(node) { - return node.kind === 333; + return node.kind === 328; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocImplementsTag(node) { - return node.kind === 316; + return node.kind === 312; } ts.isJSDocImplementsTag = isJSDocImplementsTag; function isSyntaxList(n) { - return n.kind === 334; + return n.kind === 329; } ts.isSyntaxList = isSyntaxList; })(ts || (ts = {})); @@ -21722,13 +21012,12 @@ var ts; createJsxFactoryExpressionFromEntityName(factory, jsxFactoryEntity, parent) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), "createElement"); } - ts.createJsxFactoryExpression = createJsxFactoryExpression; function createJsxFragmentFactoryExpression(factory, jsxFragmentFactoryEntity, reactNamespace, parent) { return jsxFragmentFactoryEntity ? createJsxFactoryExpressionFromEntityName(factory, jsxFragmentFactoryEntity, parent) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), "Fragment"); } - function createExpressionForJsxElement(factory, callee, tagName, props, children, location) { + function createExpressionForJsxElement(factory, jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { var argumentsList = [tagName]; if (props) { argumentsList.push(props); @@ -21748,7 +21037,7 @@ var ts; argumentsList.push(children[0]); } } - return ts.setTextRange(factory.createCallExpression(callee, undefined, argumentsList), location); + return ts.setTextRange(factory.createCallExpression(createJsxFactoryExpression(factory, jsxFactoryEntity, reactNamespace, parentElement), undefined, argumentsList), location); } ts.createExpressionForJsxElement = createExpressionForJsxElement; function createExpressionForJsxFragment(factory, jsxFactoryEntity, jsxFragmentFactoryEntity, reactNamespace, children, parentElement, location) { @@ -21839,14 +21128,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { + case 166: case 167: - case 168: return createExpressionForAccessorDeclaration(factory, node.properties, property, receiver, !!node.multiLine); - case 288: + case 285: return createExpressionForPropertyAssignment(factory, property, receiver); - case 289: + case 286: return createExpressionForShorthandPropertyAssignment(factory, property, receiver); - case 165: + case 164: return createExpressionForMethodDeclaration(factory, property, receiver); } } @@ -21889,21 +21178,21 @@ var ts; } ts.startsWithUseStrict = startsWithUseStrict; function isCommaSequence(node) { - return node.kind === 216 && node.operatorToken.kind === 27 || - node.kind === 337; + return node.kind === 213 && node.operatorToken.kind === 27 || + node.kind === 332; } ts.isCommaSequence = isCommaSequence; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 15; } switch (node.kind) { - case 207: + case 204: return (kinds & 1) !== 0; - case 206: - case 224: + case 203: + case 221: return (kinds & 2) !== 0; - case 225: + case 222: return (kinds & 4) !== 0; - case 336: + case 331: return (kinds & 8) !== 0; } return false; @@ -22011,14 +21300,14 @@ var ts; ts.getOrCreateExternalHelpersModuleNameIfNeeded = getOrCreateExternalHelpersModuleNameIfNeeded; function getLocalNameForExternalImport(factory, node, sourceFile) { var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); - if (namespaceDeclaration && !ts.isDefaultImport(node) && !ts.isExportNamespaceAsDefaultDeclaration(node)) { + if (namespaceDeclaration && !ts.isDefaultImport(node)) { var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : factory.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 261 && node.importClause) { + if (node.kind === 258 && node.importClause) { return factory.getGeneratedNameForNode(node); } - if (node.kind === 267 && node.moduleSpecifier) { + if (node.kind === 264 && node.moduleSpecifier) { return factory.getGeneratedNameForNode(node); } return undefined; @@ -22081,11 +21370,11 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 288: + case 285: return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 289: + case 286: return bindingElement.name; - case 290: + case 287: return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } return undefined; @@ -22101,11 +21390,11 @@ var ts; ts.getTargetOfBindingOrAssignmentElement = getTargetOfBindingOrAssignmentElement; function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 160: - case 198: + case 159: + case 195: return bindingElement.dotDotDotToken; - case 220: - case 290: + case 217: + case 287: return bindingElement; } return undefined; @@ -22119,7 +21408,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 198: + case 195: if (bindingElement.propertyName) { var propertyName = bindingElement.propertyName; if (ts.isPrivateIdentifier(propertyName)) { @@ -22130,7 +21419,7 @@ var ts; : propertyName; } break; - case 288: + case 285: if (bindingElement.name) { var propertyName = bindingElement.name; if (ts.isPrivateIdentifier(propertyName)) { @@ -22141,7 +21430,7 @@ var ts; : propertyName; } break; - case 290: + case 287: if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); } @@ -22160,11 +21449,11 @@ var ts; } function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { + case 193: + case 194: case 196: - case 197: - case 199: return name.elements; - case 200: + case 197: return name.properties; } } @@ -22183,29 +21472,29 @@ var ts; ts.getJSDocTypeAliasName = getJSDocTypeAliasName; function canHaveModifiers(node) { var kind = node.kind; - return kind === 160 + return kind === 159 + || kind === 161 || kind === 162 || kind === 163 || kind === 164 || kind === 165 || kind === 166 || kind === 167 - || kind === 168 - || kind === 171 - || kind === 208 - || kind === 209 - || kind === 221 - || kind === 232 + || kind === 170 + || kind === 205 + || kind === 206 + || kind === 218 + || kind === 229 + || kind === 248 + || kind === 249 + || kind === 250 || kind === 251 || kind === 252 || kind === 253 - || kind === 254 - || kind === 255 - || kind === 256 - || kind === 260 - || kind === 261 - || kind === 266 - || kind === 267; + || kind === 257 + || kind === 258 + || kind === 263 + || kind === 264; } ts.canHaveModifiers = canHaveModifiers; function isExportModifier(node) { @@ -22267,19 +21556,19 @@ var ts; } ts.isJSDocLikeText = isJSDocLikeText; function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 156) { + if (!node || node.kind <= 155) { return; } switch (node.kind) { - case 157: + case 156: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 159: + case 158: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 289: + case 286: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -22287,9 +21576,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 290: + case 287: return visitNode(cbNode, node.expression); - case 160: + case 159: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -22297,59 +21586,59 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 163: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.questionToken) || - visitNode(cbNode, node.exclamationToken) || - visitNode(cbNode, node.type) || - visitNode(cbNode, node.initializer); case 162: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 288: + case 161: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 285: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 249: + case 246: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 198: + case 195: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); + case 173: case 174: - case 175: + case 168: case 169: case 170: - case 171: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 165: case 164: + case 163: + case 165: case 166: case 167: - case 168: - case 208: - case 251: - case 209: + case 205: + case 248: + case 206: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -22361,374 +21650,364 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 173: + case 172: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 172: + case 171: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 176: + case 175: return visitNode(cbNode, node.exprName); - case 177: + case 176: return visitNodes(cbNode, cbNodes, node.members); - case 178: + case 177: return visitNode(cbNode, node.elementType); - case 179: + case 178: return visitNodes(cbNode, cbNodes, node.elements); + case 181: case 182: - case 183: return visitNodes(cbNode, cbNodes, node.types); - case 184: + case 183: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 185: + case 184: return visitNode(cbNode, node.typeParameter); - case 195: + case 192: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 186: - case 188: + case 185: + case 187: return visitNode(cbNode, node.type); - case 189: + case 188: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 190: + case 189: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || - visitNode(cbNode, node.nameType) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 191: + case 190: return visitNode(cbNode, node.literal); - case 192: + case 191: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); + case 193: + case 194: + return visitNodes(cbNode, cbNodes, node.elements); case 196: + return visitNodes(cbNode, cbNodes, node.elements); case 197: - return visitNodes(cbNode, cbNodes, node.elements); - case 199: - return visitNodes(cbNode, cbNodes, node.elements); - case 200: return visitNodes(cbNode, cbNodes, node.properties); - case 201: + case 198: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 202: + case 199: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 203: - case 204: + case 200: + case 201: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 205: + case 202: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 206: + case 203: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); + case 204: + return visitNode(cbNode, node.expression); case 207: return visitNode(cbNode, node.expression); - case 210: + case 208: + return visitNode(cbNode, node.expression); + case 209: return visitNode(cbNode, node.expression); case 211: - return visitNode(cbNode, node.expression); - case 212: - return visitNode(cbNode, node.expression); - case 214: - return visitNode(cbNode, node.operand); - case 219: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); - case 213: - return visitNode(cbNode, node.expression); - case 215: return visitNode(cbNode, node.operand); case 216: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); + case 210: + return visitNode(cbNode, node.expression); + case 212: + return visitNode(cbNode, node.operand); + case 213: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 224: + case 221: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 225: + case 222: return visitNode(cbNode, node.expression); - case 226: + case 223: return visitNode(cbNode, node.name); - case 217: + case 214: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 220: + case 217: return visitNode(cbNode, node.expression); - case 230: - case 257: + case 227: + case 254: return visitNodes(cbNode, cbNodes, node.statements); - case 297: + case 294: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 232: + case 229: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 250: + case 247: return visitNodes(cbNode, cbNodes, node.declarations); - case 233: + case 230: return visitNode(cbNode, node.expression); - case 234: + case 231: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 235: + case 232: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 236: + case 233: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 237: + case 234: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 238: + case 235: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 239: + case 236: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 240: - case 241: + case 237: + case 238: return visitNode(cbNode, node.label); - case 242: + case 239: return visitNode(cbNode, node.expression); - case 243: + case 240: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 244: + case 241: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 258: + case 255: return visitNodes(cbNode, cbNodes, node.clauses); - case 284: + case 281: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 285: + case 282: return visitNodes(cbNode, cbNodes, node.statements); - case 245: + case 242: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 246: + case 243: return visitNode(cbNode, node.expression); - case 247: + case 244: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 287: + case 284: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 161: + case 160: return visitNode(cbNode, node.expression); - case 252: - case 221: + case 249: + case 218: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); + case 250: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.typeParameters) || + visitNodes(cbNode, cbNodes, node.heritageClauses) || + visitNodes(cbNode, cbNodes, node.members); + case 251: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.typeParameters) || + visitNode(cbNode, node.type); + case 252: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.members); + case 288: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); case 253: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.typeParameters) || - visitNodes(cbNode, cbNodes, node.heritageClauses) || - visitNodes(cbNode, cbNodes, node.members); - case 254: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.typeParameters) || - visitNode(cbNode, node.type); - case 255: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.members); - case 291: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); - case 256: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 260: + case 257: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 261: + case 258: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 262: + case 259: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 259: + case 256: return visitNode(cbNode, node.name); - case 263: + case 260: return visitNode(cbNode, node.name); - case 269: + case 266: return visitNode(cbNode, node.name); - case 264: - case 268: + case 261: + case 265: return visitNodes(cbNode, cbNodes, node.elements); - case 267: + case 264: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 265: - case 270: + case 262: + case 267: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 266: + case 263: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 218: + case 215: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 228: + case 225: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 193: - return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 194: - return visitNode(cbNode, node.type) || visitNode(cbNode, node.literal); - case 158: + case 157: return visitNode(cbNode, node.expression); - case 286: + case 283: return visitNodes(cbNode, cbNodes, node.types); - case 223: + case 220: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 272: + case 269: return visitNode(cbNode, node.expression); - case 271: + case 268: return visitNodes(cbNode, cbNodes, node.decorators); - case 337: + case 332: return visitNodes(cbNode, cbNodes, node.elements); - case 273: + case 270: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 277: + case 274: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 274: - case 275: + case 271: + case 272: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 281: + case 278: return visitNodes(cbNode, cbNodes, node.properties); - case 280: + case 277: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 282: + case 279: return visitNode(cbNode, node.expression); - case 283: + case 280: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 276: + case 273: return visitNode(cbNode, node.tagName); + case 179: case 180: - case 181: + case 298: + case 302: case 301: - case 306: + case 303: case 305: - case 307: - case 309: return visitNode(cbNode, node.type); - case 308: + case 304: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 311: + case 307: return visitNodes(cbNode, cbNodes, node.tags); - case 332: - return visitNode(cbNode, node.tagName) || - visitNode(cbNode, node.name); - case 302: - return visitNode(cbNode, node.name); - case 326: - case 333: + case 322: + case 328: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 317: + case 313: return visitNode(cbNode, node.tagName); - case 316: + case 312: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 315: + case 311: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 330: + case 326: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 331: + case 327: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 301 + node.typeExpression.kind === 298 ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 324: + case 320: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 327: - case 329: - case 328: + case 323: case 325: + case 324: + case 321: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 313: + case 309: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 312: + case 308: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 314: + case 310: + case 315: + case 316: + case 317: + case 318: case 319: - case 320: - case 321: - case 322: - case 323: return visitNode(cbNode, node.tagName); - case 336: + case 331: return visitNode(cbNode, node.expression); } } @@ -22789,8 +22068,6 @@ var ts; ts.forEachChildRecursively = forEachChildRecursively; function createSourceFile(fileName, sourceText, languageVersion, setParentNodes, scriptKind) { if (setParentNodes === void 0) { setParentNodes = false; } - var tracingData = ["parse", "createSourceFile", { path: fileName }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeParse"); var result; ts.perfLogger.logStartParseSourceFile(fileName); @@ -22803,7 +22080,6 @@ var ts; ts.perfLogger.logStopParseSourceFile(); ts.performance.mark("afterParse"); ts.performance.measure("Parse", "beforeParse", "afterParse"); - ts.tracing.end.apply(ts.tracing, tracingData); return result; } ts.createSourceFile = createSourceFile; @@ -23472,7 +22748,7 @@ var ts; ts.isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode(kind, "", "", undefined) : kind === 8 ? factory.createNumericLiteral("", undefined) : kind === 10 ? factory.createStringLiteral("", undefined) : - kind === 271 ? factory.createMissingDeclaration() : + kind === 268 ? factory.createMissingDeclaration() : factory.createToken(kind); return finishNode(result, pos); } @@ -23574,7 +22850,7 @@ var ts; if (token() === 87) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 149) { + if (token() === 148) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); @@ -23582,7 +22858,7 @@ var ts; return nextTokenCanFollowDefaultKeyword(); case 123: case 134: - case 146: + case 145: nextToken(); return canFollowModifier(); default: @@ -23882,14 +23158,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 166: - case 171: - case 167: - case 168: - case 163: - case 229: - return true; case 165: + case 170: + case 166: + case 167: + case 162: + case 226: + return true; + case 164: var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 78 && methodDeclaration.name.originalKeywordKind === 132; @@ -23901,8 +23177,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 284: - case 285: + case 281: + case 282: return true; } } @@ -23911,72 +23187,72 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 251: - case 232: + case 248: + case 229: + case 227: + case 231: case 230: + case 243: + case 239: + case 241: + case 238: + case 237: + case 235: + case 236: case 234: case 233: - case 246: - case 242: - case 244: - case 241: case 240: - case 238: - case 239: - case 237: - case 236: - case 243: - case 231: - case 247: + case 228: + case 244: + case 242: + case 232: case 245: - case 235: - case 248: - case 261: - case 260: - case 267: - case 266: - case 256: - case 252: + case 258: + case 257: + case 264: + case 263: case 253: - case 255: - case 254: + case 249: + case 250: + case 252: + case 251: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 291; + return node.kind === 288; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 170: - case 164: - case 171: - case 162: case 169: + case 163: + case 170: + case 161: + case 168: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 249) { + if (node.kind !== 246) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 160) { + if (node.kind !== 159) { return false; } var parameter = node; return parameter.initializer === undefined; } function abortParsingListOrMoveToNextToken(kind) { - parsingContextErrors(kind); + parseErrorAtCurrentToken(parsingContextErrors(kind)); if (isInSomeParsingContext()) { return true; } @@ -23985,34 +23261,31 @@ var ts; } function parsingContextErrors(context) { switch (context) { - case 0: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); - case 1: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); - case 2: return parseErrorAtCurrentToken(ts.Diagnostics.case_or_default_expected); - case 3: return parseErrorAtCurrentToken(ts.Diagnostics.Statement_expected); + case 0: return ts.Diagnostics.Declaration_or_statement_expected; + case 1: return ts.Diagnostics.Declaration_or_statement_expected; + case 2: return ts.Diagnostics.case_or_default_expected; + case 3: return ts.Diagnostics.Statement_expected; case 18: - case 4: return parseErrorAtCurrentToken(ts.Diagnostics.Property_or_signature_expected); - case 5: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); - case 6: return parseErrorAtCurrentToken(ts.Diagnostics.Enum_member_expected); - case 7: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_expected); - case 8: - return ts.isKeyword(token()) - ? parseErrorAtCurrentToken(ts.Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, ts.tokenToString(token())) - : parseErrorAtCurrentToken(ts.Diagnostics.Variable_declaration_expected); - case 9: return parseErrorAtCurrentToken(ts.Diagnostics.Property_destructuring_pattern_expected); - case 10: return parseErrorAtCurrentToken(ts.Diagnostics.Array_element_destructuring_pattern_expected); - case 11: return parseErrorAtCurrentToken(ts.Diagnostics.Argument_expression_expected); - case 12: return parseErrorAtCurrentToken(ts.Diagnostics.Property_assignment_expected); - case 15: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_or_comma_expected); - case 17: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); - case 16: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); - case 19: return parseErrorAtCurrentToken(ts.Diagnostics.Type_parameter_declaration_expected); - case 20: return parseErrorAtCurrentToken(ts.Diagnostics.Type_argument_expected); - case 21: return parseErrorAtCurrentToken(ts.Diagnostics.Type_expected); - case 22: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_expected); - case 23: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - case 13: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - case 14: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - default: return [undefined]; + case 4: return ts.Diagnostics.Property_or_signature_expected; + case 5: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 6: return ts.Diagnostics.Enum_member_expected; + case 7: return ts.Diagnostics.Expression_expected; + case 8: return ts.Diagnostics.Variable_declaration_expected; + case 9: return ts.Diagnostics.Property_destructuring_pattern_expected; + case 10: return ts.Diagnostics.Array_element_destructuring_pattern_expected; + case 11: return ts.Diagnostics.Argument_expression_expected; + case 12: return ts.Diagnostics.Property_assignment_expected; + case 15: return ts.Diagnostics.Expression_or_comma_expected; + case 17: return ts.Diagnostics.Parameter_declaration_expected; + case 16: return ts.Diagnostics.Parameter_declaration_expected; + case 19: return ts.Diagnostics.Type_parameter_declaration_expected; + case 20: return ts.Diagnostics.Type_argument_expected; + case 21: return ts.Diagnostics.Type_expected; + case 22: return ts.Diagnostics.Unexpected_token_expected; + case 23: return ts.Diagnostics.Identifier_expected; + case 13: return ts.Diagnostics.Identifier_expected; + case 14: return ts.Diagnostics.Identifier_expected; + default: return undefined; } } function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) { @@ -24115,24 +23388,6 @@ var ts; var pos = getNodePos(); return finishNode(factory.createTemplateExpression(parseTemplateHead(isTaggedTemplate), parseTemplateSpans(isTaggedTemplate)), pos); } - function parseTemplateType() { - var pos = getNodePos(); - return finishNode(factory.createTemplateLiteralType(parseTemplateHead(false), parseTemplateTypeSpans()), pos); - } - function parseTemplateTypeSpans() { - var pos = getNodePos(); - var list = []; - var node; - do { - node = parseTemplateTypeSpan(); - list.push(node); - } while (node.literal.kind === 16); - return createNodeArray(list, pos); - } - function parseTemplateTypeSpan() { - var pos = getNodePos(); - return finishNode(factory.createTemplateLiteralTypeSpan(parseType(), parseLiteralOfTemplateSpan(false)), pos); - } function parseLiteralOfTemplateSpan(isTaggedTemplate) { if (token() === 19) { reScanTemplateToken(isTaggedTemplate); @@ -24197,14 +23452,14 @@ var ts; } function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 173: + case 172: return ts.nodeIsMissing(node.typeName); - case 174: - case 175: { + case 173: + case 174: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 186: + case 185: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -24267,7 +23522,7 @@ var ts; function parseJSDocType() { scanner.setInJSDocType(true); var pos = getNodePos(); - if (parseOptional(139)) { + if (parseOptional(138)) { var moduleTag = factory.createJSDocNamepathType(undefined); terminate: while (true) { switch (token()) { @@ -24407,14 +23662,14 @@ var ts; function parseSignatureMember(kind) { var pos = getNodePos(); var hasJSDoc = hasPrecedingJSDocComment(); - if (kind === 170) { + if (kind === 169) { parseExpected(102); } var typeParameters = parseTypeParameters(); var parameters = parseParameters(4); var type = parseReturnType(58, true); parseTypeMemberSemicolon(); - var node = kind === 169 + var node = kind === 168 ? factory.createCallSignature(typeParameters, parameters, type) : factory.createConstructSignature(typeParameters, parameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -24502,10 +23757,10 @@ var ts; } function parseTypeMember() { if (token() === 20 || token() === 29) { - return parseSignatureMember(169); + return parseSignatureMember(168); } if (token() === 102 && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(170); + return parseSignatureMember(169); } var pos = getNodePos(); var hasJSDoc = hasPrecedingJSDocComment(); @@ -24549,9 +23804,9 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 || token() === 40) { - return nextToken() === 142; + return nextToken() === 141; } - if (token() === 142) { + if (token() === 141) { nextToken(); } return token() === 22 && nextTokenIsIdentifier() && nextToken() === 100; @@ -24567,15 +23822,14 @@ var ts; var pos = getNodePos(); parseExpected(18); var readonlyToken; - if (token() === 142 || token() === 39 || token() === 40) { + if (token() === 141 || token() === 39 || token() === 40) { readonlyToken = parseTokenNode(); - if (readonlyToken.kind !== 142) { - parseExpected(142); + if (readonlyToken.kind !== 141) { + parseExpected(141); } } parseExpected(22); var typeParameter = parseMappedTypeParameter(); - var nameType = parseOptional(126) ? parseType() : undefined; parseExpected(23); var questionToken; if (token() === 57 || token() === 39 || token() === 40) { @@ -24587,7 +23841,7 @@ var ts; var type = parseTypeAnnotation(); parseSemicolon(); parseExpected(19); - return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), pos); + return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), pos); } function parseTupleElementType() { var pos = getNodePos(); @@ -24689,15 +23943,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 128: - case 152: + case 151: + case 146: + case 143: + case 154: case 147: - case 144: - case 155: - case 148: case 131: - case 150: - case 141: - case 145: + case 149: + case 140: + case 144: return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 65: scanner.reScanAsteriskEqualsToken(); @@ -24725,7 +23979,7 @@ var ts; return parseTokenNode(); case 107: { var thisKeyword = parseThisTypeNode(); - if (token() === 137 && !scanner.hasPrecedingLineBreak()) { + if (token() === 136 && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -24744,8 +23998,6 @@ var ts; return parseImportType(); case 127: return lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine) ? parseAssertsTypePredicate() : parseTypeReference(); - case 15: - return parseTemplateType(); default: return parseTypeReference(); } @@ -24753,20 +24005,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 128: - case 152: - case 147: - case 144: - case 155: - case 131: - case 142: - case 148: case 151: - case 113: + case 146: + case 143: + case 154: + case 131: + case 141: + case 147: case 150: + case 113: + case 149: case 103: case 107: case 111: - case 141: + case 140: case 18: case 22: case 29: @@ -24778,7 +24030,7 @@ var ts; case 9: case 109: case 94: - case 145: + case 144: case 41: case 57: case 53: @@ -24786,8 +24038,6 @@ var ts; case 135: case 99: case 127: - case 14: - case 15: return true; case 97: return !inStartOfParameter; @@ -24854,9 +24104,9 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 138: - case 151: - case 142: + case 137: + case 150: + case 141: return parseTypeOperator(operator); case 135: return parseInferType(); @@ -24959,7 +24209,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 137 && !scanner.hasPrecedingLineBreak()) { + if (token() === 136 && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -24968,7 +24218,7 @@ var ts; var pos = getNodePos(); var assertsModifier = parseExpectedToken(127); var parameterName = token() === 107 ? parseThisTypeNode() : parseIdentifier(); - var type = parseOptional(137) ? parseType() : undefined; + var type = parseOptional(136) ? parseType() : undefined; return finishNode(factory.createTypePredicateNode(assertsModifier, parameterName, type), pos); } function parseType() { @@ -25331,7 +24581,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand, pos); } function isInOrOfKeyword(t) { - return t === 100 || t === 156; + return t === 100 || t === 155; } function parseBinaryExpressionRest(precedence, leftOperand, pos) { while (true) { @@ -25415,7 +24665,7 @@ var ts; if (token() === 42) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 206) { + if (simpleUnaryExpression.kind === 203) { parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -25531,7 +24781,7 @@ var ts; var pos = getNodePos(); var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 275) { + if (opening.kind === 272) { var children = parseJsxChildren(opening); var closingElement = parseJsxClosingElement(inExpressionContext); if (!tagNamesAreEquivalent(opening.tagName, closingElement.tagName)) { @@ -25539,11 +24789,11 @@ var ts; } result = finishNode(factory.createJsxElement(opening, children, closingElement), pos); } - else if (opening.kind === 278) { + else if (opening.kind === 275) { result = finishNode(factory.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos); } else { - ts.Debug.assert(opening.kind === 274); + ts.Debug.assert(opening.kind === 271); result = opening; } if (inExpressionContext && token() === 29) { @@ -25988,10 +25238,10 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(); if (parseContextualModifier(134)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167); + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 166); } - if (parseContextualModifier(146)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168); + if (parseContextualModifier(145)) { + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167); } var asteriskToken = parseOptionalToken(41); var tokenIsIdentifier = isIdentifier(); @@ -26181,7 +25431,7 @@ var ts; } } var node; - if (awaitToken ? parseExpected(156) : parseOptional(156)) { + if (awaitToken ? parseExpected(155) : parseOptional(155)) { var expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(21); node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement()); @@ -26207,10 +25457,10 @@ var ts; } function parseBreakOrContinueStatement(kind) { var pos = getNodePos(); - parseExpected(kind === 241 ? 80 : 85); + parseExpected(kind === 238 ? 80 : 85); var label = canParseSemicolon() ? undefined : parseIdentifier(); parseSemicolon(); - var node = kind === 241 + var node = kind === 238 ? factory.createBreakStatement(label) : factory.createContinueStatement(label); return finishNode(node, pos); @@ -26353,10 +25603,10 @@ var ts; case 91: return true; case 117: - case 149: + case 148: return nextTokenIsIdentifierOnSameLine(); + case 138: case 139: - case 140: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 125: case 129: @@ -26364,13 +25614,13 @@ var ts; case 120: case 121: case 122: - case 142: + case 141: nextToken(); if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 154: + case 153: nextToken(); return token() === 18 || token() === 78 || token() === 92; case 99: @@ -26379,7 +25629,7 @@ var ts; token() === 18 || ts.tokenIsIdentifierOrKeyword(token()); case 92: var currentToken_1 = nextToken(); - if (currentToken_1 === 149) { + if (currentToken_1 === 148) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 || currentToken_1 === 41 || @@ -26432,16 +25682,16 @@ var ts; case 129: case 133: case 117: + case 138: case 139: - case 140: - case 149: - case 154: + case 148: + case 153: return true; case 122: case 120: case 121: case 123: - case 142: + case 141: return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); default: return isStartOfExpression(); @@ -26480,9 +25730,9 @@ var ts; case 96: return parseForOrForInOrForOfStatement(); case 85: - return parseBreakOrContinueStatement(240); + return parseBreakOrContinueStatement(237); case 80: - return parseBreakOrContinueStatement(241); + return parseBreakOrContinueStatement(238); case 104: return parseReturnStatement(); case 115: @@ -26501,9 +25751,9 @@ var ts; return parseDeclaration(); case 129: case 117: - case 149: + case 148: + case 138: case 139: - case 140: case 133: case 84: case 91: @@ -26514,8 +25764,8 @@ var ts; case 122: case 125: case 123: - case 142: - case 154: + case 141: + case 153: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -26569,13 +25819,13 @@ var ts; return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers); case 117: return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers); - case 149: + case 148: return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers); case 91: return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers); - case 154: + case 153: + case 138: case 139: - case 140: return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers); case 99: return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers); @@ -26592,7 +25842,7 @@ var ts; } default: if (decorators || modifiers) { - var missing = createMissingNode(271, true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(268, true, ts.Diagnostics.Declaration_expected); ts.setTextRangePos(missing, pos); missing.decorators = decorators; missing.modifiers = modifiers; @@ -26701,7 +25951,7 @@ var ts; } nextToken(); var declarations; - if (token() === 156 && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 155 && lookAhead(canFollowContextualOfKeyword)) { declarations = createMissingList(); } else { @@ -26799,11 +26049,11 @@ var ts; var parameters = parseParameters(0); var type = parseReturnType(58, false); var body = parseFunctionBlockOrSemicolon(0); - var node = kind === 167 + var node = kind === 166 ? factory.createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) : factory.createSetAccessorDeclaration(decorators, modifiers, name, parameters, body); node.typeParameters = typeParameters; - if (type && node.kind === 168) + if (type && node.kind === 167) node.type = type; return withJSDoc(finishNode(node, pos), hasJSDoc); } @@ -26830,7 +26080,7 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 146 || idToken === 134) { + if (!ts.isKeyword(idToken) || idToken === 145 || idToken === 134) { return true; } switch (token()) { @@ -26916,10 +26166,10 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(true); if (parseContextualModifier(134)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167); + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 166); } - if (parseContextualModifier(146)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168); + if (parseContextualModifier(145)) { + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167); } if (token() === 132 || token() === 10) { var constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers); @@ -26954,10 +26204,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), undefined, undefined, 221); + return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), undefined, undefined, 218); } function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 252); + return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 249); } function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) { var savedAwaitContext = inAwaitContext(); @@ -26976,7 +26226,7 @@ var ts; members = createMissingList(); } setAwaitContext(savedAwaitContext); - var node = kind === 252 + var node = kind === 249 ? factory.createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) : factory.createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -27029,11 +26279,11 @@ var ts; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) { - parseExpected(149); + parseExpected(148); var name = parseIdentifier(); var typeParameters = parseTypeParameters(); parseExpected(62); - var type = token() === 136 && tryParse(parseKeywordAndNoDot) || parseType(); + var type = parseType(); parseSemicolon(); var node = factory.createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -27083,7 +26333,7 @@ var ts; function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { var flags = 0; var name; - if (token() === 154) { + if (token() === 153) { name = parseIdentifier(); flags |= 1024; } @@ -27103,14 +26353,14 @@ var ts; } function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { var flags = 0; - if (token() === 154) { + if (token() === 153) { return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); } - else if (parseOptional(140)) { + else if (parseOptional(139)) { flags |= 16; } else { - parseExpected(139); + parseExpected(138); if (token() === 10) { return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); } @@ -27118,7 +26368,7 @@ var ts; return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags); } function isExternalModuleReference() { - return token() === 143 && + return token() === 142 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -27129,7 +26379,7 @@ var ts; } function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) { parseExpected(126); - parseExpected(140); + parseExpected(139); var name = parseIdentifier(); parseSemicolon(); var node = factory.createNamespaceExportDeclaration(name); @@ -27145,7 +26395,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 153 && + if (token() !== 152 && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -27159,7 +26409,7 @@ var ts; token() === 41 || token() === 18) { importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(153); + parseExpected(152); } var moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -27170,7 +26420,7 @@ var ts; return token() === 41 || token() === 18; } function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { - return token() === 27 || token() === 153; + return token() === 27 || token() === 152; } function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) { parseExpected(62); @@ -27187,7 +26437,7 @@ var ts; var namedBindings; if (!identifier || parseOptional(27)) { - namedBindings = token() === 41 ? parseNamespaceImport() : parseNamedImportsOrExports(264); + namedBindings = token() === 41 ? parseNamespaceImport() : parseNamedImportsOrExports(261); } return finishNode(factory.createImportClause(isTypeOnly, identifier, namedBindings), pos); } @@ -27198,7 +26448,7 @@ var ts; } function parseExternalModuleReference() { var pos = getNodePos(); - parseExpected(143); + parseExpected(142); parseExpected(20); var expression = parseModuleSpecifier(); parseExpected(21); @@ -27223,16 +26473,16 @@ var ts; } function parseNamedImportsOrExports(kind) { var pos = getNodePos(); - var node = kind === 264 + var node = kind === 261 ? factory.createNamedImports(parseBracketedList(23, parseImportSpecifier, 18, 19)) : factory.createNamedExports(parseBracketedList(23, parseExportSpecifier, 18, 19)); return finishNode(node, pos); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(270); + return parseImportOrExportSpecifier(267); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(265); + return parseImportOrExportSpecifier(262); } function parseImportOrExportSpecifier(kind) { var pos = getNodePos(); @@ -27253,35 +26503,35 @@ var ts; else { name = identifierName; } - if (kind === 265 && checkIdentifierIsKeyword) { + if (kind === 262 && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } - var node = kind === 265 + var node = kind === 262 ? factory.createImportSpecifier(propertyName, name) : factory.createExportSpecifier(propertyName, name); return finishNode(node, pos); } function parseNamespaceExport(pos) { - return finishNode(factory.createNamespaceExport(parseIdentifierName()), pos); + return finishNode(factory.createNamespaceExport(parseIdentifier()), pos); } function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) { var savedAwaitContext = inAwaitContext(); setAwaitContext(true); var exportClause; var moduleSpecifier; - var isTypeOnly = parseOptional(149); + var isTypeOnly = parseOptional(148); var namespaceExportPos = getNodePos(); if (parseOptional(41)) { if (parseOptional(126)) { exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(153); + parseExpected(152); moduleSpecifier = parseModuleSpecifier(); } else { - exportClause = parseNamedImportsOrExports(268); - if (token() === 153 || (token() === 10 && !scanner.hasPrecedingLineBreak())) { - parseExpected(153); + exportClause = parseNamedImportsOrExports(265); + if (token() === 152 || (token() === 10 && !scanner.hasPrecedingLineBreak())) { + parseExpected(152); moduleSpecifier = parseModuleSpecifier(); } } @@ -27360,18 +26610,6 @@ var ts; return finishNode(result, pos); } JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression; - function parseJSDocNameReference() { - var pos = getNodePos(); - var hasBrace = parseOptional(18); - var entityName = parseEntityName(false); - if (hasBrace) { - parseExpectedJSDoc(19); - } - var result = factory.createJSDocNameReference(entityName); - fixupParentReferences(result); - return finishNode(result, pos); - } - JSDocParser.parseJSDocNameReference = parseJSDocNameReference; function parseIsolatedJSDocComment(content, start, length) { initializeState("", content, 99, undefined, 1); var jsDoc = doInsideOfContext(4194304, function () { return parseJSDocCommentWorker(start, length); }); @@ -27417,7 +26655,7 @@ var ts; return scanner.scanRange(start + 3, length - 5, function () { var state = 1; var margin; - var indent = start - (content.lastIndexOf("\n", start) + 1) + 4; + var indent = start - Math.max(content.lastIndexOf("\n", start), 0) + 4; function pushComment(text) { if (!margin) { margin = indent; @@ -27467,7 +26705,7 @@ var ts; comments.push(whitespace); } else if (margin !== undefined && indent + whitespace.length > margin) { - comments.push(whitespace.slice(margin - indent)); + comments.push(whitespace.slice(margin - indent - 1)); } indent += whitespace.length; break; @@ -27607,9 +26845,6 @@ var ts; case "callback": tag = parseCallbackTag(start, tagName, margin, indentText); break; - case "see": - tag = parseSeeTag(start, tagName, margin, indentText); - break; default: tag = parseUnknownTag(start, tagName, margin, indentText); break; @@ -27747,9 +26982,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 145: + case 144: return true; - case 178: + case 177: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -27781,12 +27016,12 @@ var ts; var child = void 0; var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 326 || child.kind === 333) { + if (child.kind === 322 || child.kind === 328) { children = ts.append(children, child); } } if (children) { - var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 178), pos); + var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 177), pos); return finishNode(factory.createJSDocTypeExpression(literal), pos); } } @@ -27808,12 +27043,6 @@ var ts; var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined; return finishNode(factory.createJSDocTypeTag(tagName, typeExpression, comments), start, end); } - function parseSeeTag(start, tagName, indent, indentText) { - var nameExpression = parseJSDocNameReference(); - var end = getNodePos(); - var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined; - return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start, end); - } function parseAuthorTag(start, tagName, indent, indentText) { var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -27929,7 +27158,7 @@ var ts; var hasChildren = false; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { hasChildren = true; - if (child.kind === 329) { + if (child.kind === 325) { if (childTypeTag) { parseErrorAtCurrentToken(ts.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); var lastError = ts.lastOrUndefined(parseDiagnostics); @@ -27947,7 +27176,7 @@ var ts; } } if (hasChildren) { - var isArrayType = typeExpression && typeExpression.type.kind === 178; + var isArrayType = typeExpression && typeExpression.type.kind === 177; var jsdocTypeLiteral = factory.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType); typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : @@ -27997,7 +27226,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59)) { var tag = parseTag(indent); - if (tag && tag.kind === 327) { + if (tag && tag.kind === 323) { return tag; } } @@ -28032,7 +27261,7 @@ var ts; case 59: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 326 || child.kind === 333) && + if (child && (child.kind === 322 || child.kind === 328) && target !== 4 && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -28563,8 +27792,6 @@ var ts; } case "jsx": case "jsxfrag": - case "jsximportsource": - case "jsxruntime": return; default: ts.Debug.fail("Unhandled pragma kind"); } @@ -28684,17 +27911,6 @@ var ts; var ts; (function (ts) { ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; - var jsxOptionMap = new ts.Map(ts.getEntries({ - "preserve": 1, - "react-native": 3, - "react": 2, - "react-jsx": 4, - "react-jsxdev": 5, - })); - ts.inverseJsxOptionMap = new ts.Map(ts.arrayFrom(ts.mapIterator(jsxOptionMap.entries(), function (_a) { - var key = _a[0], value = _a[1]; - return ["" + value, key]; - }))); var libEntries = [ ["es5", "lib.es5.d.ts"], ["es6", "lib.es2015.d.ts"], @@ -28710,7 +27926,6 @@ var ts; ["dom.iterable", "lib.dom.iterable.d.ts"], ["webworker", "lib.webworker.d.ts"], ["webworker.importscripts", "lib.webworker.importscripts.d.ts"], - ["webworker.iterable", "lib.webworker.iterable.d.ts"], ["scripthost", "lib.scripthost.d.ts"], ["es2015.core", "lib.es2015.core.d.ts"], ["es2015.collection", "lib.es2015.collection.d.ts"], @@ -28738,7 +27953,6 @@ var ts; ["es2019.symbol", "lib.es2019.symbol.d.ts"], ["es2020.bigint", "lib.es2020.bigint.d.ts"], ["es2020.promise", "lib.es2020.promise.d.ts"], - ["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"], ["es2020.string", "lib.es2020.string.d.ts"], ["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"], ["es2020.intl", "lib.es2020.intl.d.ts"], @@ -28748,8 +27962,7 @@ var ts; ["esnext.intl", "lib.esnext.intl.d.ts"], ["esnext.bigint", "lib.es2020.bigint.d.ts"], ["esnext.string", "lib.esnext.string.d.ts"], - ["esnext.promise", "lib.esnext.promise.d.ts"], - ["esnext.weakref", "lib.esnext.weakref.d.ts"] + ["esnext.promise", "lib.esnext.promise.d.ts"] ]; ts.libs = libEntries.map(function (entry) { return entry[0]; }); ts.libMap = new ts.Map(libEntries); @@ -28867,15 +28080,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Generates_a_CPU_profile }, - { - name: "generateTrace", - type: "string", - isFilePath: true, - isCommandLineOnly: true, - paramType: ts.Diagnostics.DIRECTORY, - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Generates_an_event_trace_and_a_list_of_types - }, { name: "incremental", shortName: "i", @@ -29029,10 +28233,12 @@ var ts; }, { name: "jsx", - type: jsxOptionMap, + type: new ts.Map(ts.getEntries({ + "preserve": 1, + "react-native": 3, + "react": 2 + })), affectsSourceFile: true, - affectsEmit: true, - affectsModuleResolution: true, paramType: ts.Diagnostics.KIND, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, @@ -29273,14 +28479,6 @@ var ts; category: ts.Diagnostics.Additional_Checks, description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement }, - { - name: "noUncheckedIndexedAccess", - type: "boolean", - affectsSemanticDiagnostics: true, - showInSimplifiedHelpView: false, - category: ts.Diagnostics.Additional_Checks, - description: ts.Diagnostics.Include_undefined_in_index_signature_results - }, { name: "moduleResolution", type: new ts.Map(ts.getEntries({ @@ -29434,15 +28632,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment }, - { - name: "jsxImportSource", - type: "string", - affectsSemanticDiagnostics: true, - affectsEmit: true, - affectsModuleResolution: true, - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react - }, { name: "resolveJsonModule", type: "boolean", @@ -29738,11 +28927,7 @@ var ts; name: "exclude", type: "string" } - }, - { - name: "disableFilenameBasedTypeAcquisition", - type: "boolean", - }, + } ]; function createOptionNameMap(optionDeclarations) { var optionsNameMap = new ts.Map(); @@ -30060,7 +29245,7 @@ var ts; ts.parseConfigFileTextToJson = parseConfigFileTextToJson; function readJsonConfigFile(fileName, readFile) { var textOrDiagnostic = tryReadFile(fileName, readFile); - return ts.isString(textOrDiagnostic) ? ts.parseJsonText(fileName, textOrDiagnostic) : { fileName: fileName, parseDiagnostics: [textOrDiagnostic] }; + return ts.isString(textOrDiagnostic) ? ts.parseJsonText(fileName, textOrDiagnostic) : { parseDiagnostics: [textOrDiagnostic] }; } ts.readJsonConfigFile = readJsonConfigFile; function tryReadFile(fileName, readFile) { @@ -30193,7 +29378,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_4 = function (element) { - if (element.kind !== 288) { + if (element.kind !== 285) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -30277,13 +29462,13 @@ var ts; case 8: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 214: + case 211: if (valueExpression.operator !== 40 || valueExpression.operand.kind !== 8) { break; } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 200: + case 197: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; if (option) { @@ -30293,7 +29478,7 @@ var ts; else { return convertObjectLiteralExpressionToJson(objectLiteralExpression, undefined, undefined, undefined); } - case 199: + case 196: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -30718,7 +29903,6 @@ var ts; return !!value.options; } function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache) { - var _a; basePath = ts.normalizeSlashes(basePath); var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { @@ -30728,9 +29912,6 @@ var ts; var ownConfig = json ? parseOwnConfigOfJson(json, host, basePath, configFileName, errors) : parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); - if ((_a = ownConfig.options) === null || _a === void 0 ? void 0 : _a.paths) { - ownConfig.options.pathsBasePath = basePath; - } if (ownConfig.extendedConfigPath) { resolutionStack = resolutionStack.concat([resolvedPath]); var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, resolutionStack, errors, extendedConfigCache); @@ -31766,15 +30947,12 @@ var ts; } function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) { var _a = state.compilerOptions, baseUrl = _a.baseUrl, paths = _a.paths; - if (paths && !ts.pathIsRelative(moduleName)) { + if (baseUrl && paths && !ts.pathIsRelative(moduleName)) { if (state.traceEnabled) { - if (baseUrl) { - trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); - } + trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName); } - var baseDirectory = ts.getPathsBasePath(state.compilerOptions, state.host); - return tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, loader, false, state); + return tryLoadModuleUsingPaths(extensions, moduleName, baseUrl, paths, loader, false, state); } } function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state) { @@ -32361,23 +31539,23 @@ var ts; } function getModuleInstanceStateWorker(node, visited) { switch (node.kind) { - case 253: - case 254: + case 250: + case 251: return 0; - case 255: + case 252: if (ts.isEnumConst(node)) { return 2; } break; - case 261: - case 260: + case 258: + case 257: if (!(ts.hasSyntacticModifier(node, 1))) { return 0; } break; - case 267: + case 264: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 268) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 265) { var state = 0; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -32392,7 +31570,7 @@ var ts; return state; } break; - case 257: { + case 254: { var state_1 = 0; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -32411,7 +31589,7 @@ var ts; }); return state_1; } - case 256: + case 253: return getModuleInstanceState(node, visited); case 78: if (node.isInJSDocNamespace) { @@ -32457,15 +31635,12 @@ var ts; } var binder = createBinder(); function bindSourceFile(file, options) { - var tracingData = ["bind", "bindSourceFile", { path: file.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeBind"); ts.perfLogger.logStartBindFile("" + file.fileName); binder(file, options); ts.perfLogger.logStopBindFile(); ts.performance.mark("afterBind"); ts.performance.measure("Bind", "beforeBind", "afterBind"); - ts.tracing.end.apply(ts.tracing, tracingData); } ts.bindSourceFile = bindSourceFile; function createBinder() { @@ -32491,7 +31666,6 @@ var ts; var hasExplicitReturn; var emitFlags; var inStrictMode; - var inAssignmentPattern = false; var symbolCount = 0; var Symbol; var classifiableNames; @@ -32535,7 +31709,6 @@ var ts; currentExceptionTarget = undefined; activeLabelList = undefined; hasExplicitReturn = false; - inAssignmentPattern = false; emitFlags = 0; } return bindSourceFile; @@ -32569,7 +31742,7 @@ var ts; } } function getDeclarationName(node) { - if (node.kind === 266) { + if (node.kind === 263) { return node.isExportEquals ? "export=" : "default"; } var name = ts.getNameOfDeclaration(node); @@ -32578,7 +31751,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 158) { + if (name.kind === 157) { var nameExpression = name.expression; if (ts.isStringOrNumericLiteralLike(nameExpression)) { return ts.escapeLeadingUnderscores(nameExpression.text); @@ -32603,31 +31776,31 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 166: + case 165: return "__constructor"; + case 173: + case 168: + case 309: + return "__call"; case 174: case 169: - case 313: - return "__call"; - case 175: - case 170: return "__new"; - case 171: + case 170: return "__index"; - case 267: + case 264: return "__export"; - case 297: + case 294: return "export="; - case 216: + case 213: if (ts.getAssignmentDeclarationKind(node) === 2) { return "export="; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 308: + case 304: return (ts.isJSDocConstructSignature(node) ? "__new" : "__call"); - case 160: - ts.Debug.assert(node.parent.kind === 308, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + case 159: + ts.Debug.assert(node.parent.kind === 304, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -32682,7 +31855,7 @@ var ts; } else { if (symbol.declarations && symbol.declarations.length && - (node.kind === 266 && !node.isExportEquals)) { + (node.kind === 263 && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -32718,9 +31891,9 @@ var ts; return symbol; } function declareModuleMember(node, symbolFlags, symbolExcludes) { - var hasExportModifier = !!(ts.getCombinedModifierFlags(node) & 1) || jsdocTreatAsExported(node); + var hasExportModifier = ts.getCombinedModifierFlags(node) & 1; if (symbolFlags & 2097152) { - if (node.kind === 270 || (node.kind === 260 && hasExportModifier)) { + if (node.kind === 267 || (node.kind === 257 && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -32730,7 +31903,7 @@ var ts; else { if (ts.isJSDocTypeAlias(node)) ts.Debug.assert(ts.isInJSFile(node)); - if (!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 64)) { + if ((!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 64)) || ts.isJSDocTypeAlias(node)) { if (!container.locals || (ts.hasSyntacticModifier(node, 512) && !getDeclarationName(node))) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } @@ -32745,29 +31918,12 @@ var ts; } } } - function jsdocTreatAsExported(node) { - if (node.parent && ts.isModuleDeclaration(node)) { - node = node.parent; - } - if (!ts.isJSDocTypeAlias(node)) - return false; - if (!ts.isJSDocEnumTag(node) && !!node.fullName) - return true; - var declName = ts.getNameOfDeclaration(node); - if (!declName) - return false; - if (ts.isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent)) - return true; - if (ts.isDeclaration(declName.parent) && ts.getCombinedModifierFlags(declName.parent) & 1) - return true; - return false; - } function bindContainer(node, containerFlags) { var saveContainer = container; var saveThisParentContainer = thisParentContainer; var savedBlockScopeContainer = blockScopeContainer; if (containerFlags & 1) { - if (node.kind !== 209) { + if (node.kind !== 206) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -32796,7 +31952,7 @@ var ts; currentFlow.node = node; } } - currentReturnTarget = isIIFE || node.kind === 166 || (ts.isInJSFile && (node.kind === 251 || node.kind === 208)) ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 165 || (ts.isInJSFile && (node.kind === 248 || node.kind === 205)) ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -32810,13 +31966,13 @@ var ts; node.flags |= 512; node.endFlowNode = currentFlow; } - if (node.kind === 297) { + if (node.kind === 294) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 166 || (ts.isInJSFile && (node.kind === 251 || node.kind === 208))) { + if (node.kind === 165 || (ts.isInJSFile && (node.kind === 248 || node.kind === 205))) { node.returnFlowNode = currentFlow; } } @@ -32843,8 +31999,8 @@ var ts; blockScopeContainer = savedBlockScopeContainer; } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 251 ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 251 ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 248 ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 248 ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -32857,148 +32013,128 @@ var ts; ts.forEachChild(node, bind, bindEach); } function bindChildren(node) { - var saveInAssignmentPattern = inAssignmentPattern; - inAssignmentPattern = false; if (checkUnreachable(node)) { bindEachChild(node); bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; return; } - if (node.kind >= 232 && node.kind <= 248 && !options.allowUnreachableCode) { + if (node.kind >= 229 && node.kind <= 245 && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 236: + case 233: bindWhileStatement(node); break; - case 235: + case 232: bindDoStatement(node); break; - case 237: + case 234: bindForStatement(node); break; - case 238: - case 239: + case 235: + case 236: bindForInOrForOfStatement(node); break; - case 234: + case 231: bindIfStatement(node); break; - case 242: - case 246: + case 239: + case 243: bindReturnOrThrow(node); break; - case 241: - case 240: + case 238: + case 237: bindBreakOrContinueStatement(node); break; - case 247: + case 244: bindTryStatement(node); break; - case 244: + case 241: bindSwitchStatement(node); break; - case 258: + case 255: bindCaseBlock(node); break; - case 284: + case 281: bindCaseClause(node); break; - case 233: + case 230: bindExpressionStatement(node); break; - case 245: + case 242: bindLabeledStatement(node); break; - case 214: + case 211: bindPrefixUnaryExpressionFlow(node); break; - case 215: + case 212: bindPostfixUnaryExpressionFlow(node); break; - case 216: - if (ts.isDestructuringAssignment(node)) { - inAssignmentPattern = saveInAssignmentPattern; - bindDestructuringAssignmentFlow(node); - return; - } + case 213: bindBinaryExpressionFlow(node); break; - case 210: + case 207: bindDeleteExpressionFlow(node); break; - case 217: + case 214: bindConditionalExpressionFlow(node); break; - case 249: + case 246: bindVariableDeclarationFlow(node); break; - case 201: - case 202: + case 198: + case 199: bindAccessExpressionFlow(node); break; - case 203: + case 200: bindCallExpressionFlow(node); break; - case 225: + case 222: bindNonNullExpressionFlow(node); break; - case 331: - case 324: - case 325: + case 327: + case 320: + case 321: bindJSDocTypeAlias(node); break; - case 297: { + case 294: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 230: - case 257: + case 227: + case 254: bindEachFunctionsFirst(node.statements); break; - case 198: - bindBindingElementFlow(node); - break; - case 200: - case 199: - case 288: - case 220: - inAssignmentPattern = saveInAssignmentPattern; default: bindEachChild(node); break; } bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; } function isNarrowingExpression(expr) { switch (expr.kind) { case 78: - case 79: case 107: - case 201: - case 202: + case 198: + case 199: return containsNarrowableReference(expr); - case 203: + case 200: return hasNarrowableArgument(expr); - case 207: - case 225: + case 204: return isNarrowingExpression(expr.expression); - case 216: + case 213: return isNarrowingBinaryExpression(expr); - case 214: - return expr.operator === 53 && isNarrowingExpression(expr.operand); case 211: + return expr.operator === 53 && isNarrowingExpression(expr.operand); + case 208: return isNarrowingExpression(expr.expression); } return false; } function isNarrowableReference(expr) { - return expr.kind === 78 || expr.kind === 79 || expr.kind === 107 || expr.kind === 105 || + return expr.kind === 78 || expr.kind === 107 || expr.kind === 105 || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) || - ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 && isNarrowableReference(expr.right) || ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression) || ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left); } @@ -33014,7 +32150,7 @@ var ts; } } } - if (expr.expression.kind === 201 && + if (expr.expression.kind === 198 && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -33050,9 +32186,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 207: + case 204: return isNarrowableOperand(expr.expression); - case 216: + case 213: switch (expr.operatorToken.kind) { case 62: return isNarrowableOperand(expr.left); @@ -33127,26 +32263,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 234: - case 236: - case 235: + case 231: + case 233: + case 232: return parent.expression === node; - case 237: - case 217: + case 234: + case 214: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 207) { + if (node.kind === 204) { node = node.expression; } - else if (node.kind === 214 && node.operator === 53) { + else if (node.kind === 211 && node.operator === 53) { node = node.operand; } else { - return node.kind === 216 && (node.operatorToken.kind === 55 || + return node.kind === 213 && (node.operatorToken.kind === 55 || node.operatorToken.kind === 56 || node.operatorToken.kind === 60); } @@ -33193,7 +32329,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 245) { + while (label && node.parent.kind === 242) { label.continueTarget = target; label = label.next; node = node.parent; @@ -33244,12 +32380,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 239) { + if (node.kind === 236) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 250) { + if (node.initializer.kind !== 247) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -33271,7 +32407,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 242) { + if (node.kind === 239) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -33288,7 +32424,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 241 ? breakTarget : continueTarget; + var flowLabel = node.kind === 238 ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -33361,7 +32497,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 285; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 282; }); node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; if (!hasDefault) { addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); @@ -33401,11 +32537,8 @@ var ts; } function bindExpressionStatement(node) { bind(node.expression); - maybeBindExpressionFlowIfCall(node.expression); - } - function maybeBindExpressionFlowIfCall(node) { - if (node.kind === 203) { - var call = node; + if (node.expression.kind === 200) { + var call = node.expression; if (ts.isDottedName(call.expression) && call.expression.kind !== 105) { currentFlow = createFlowCall(currentFlow, call); } @@ -33430,7 +32563,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 216 && node.operatorToken.kind === 62) { + if (node.kind === 213 && node.operatorToken.kind === 62) { bindAssignmentTargetFlow(node.left); } else { @@ -33441,10 +32574,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16, currentFlow, node); } - else if (node.kind === 199) { + else if (node.kind === 196) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 220) { + if (e.kind === 217) { bindAssignmentTargetFlow(e.expression); } else { @@ -33452,16 +32585,16 @@ var ts; } } } - else if (node.kind === 200) { + else if (node.kind === 197) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 288) { + if (p.kind === 285) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 289) { + else if (p.kind === 286) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 290) { + else if (p.kind === 287) { bindAssignmentTargetFlow(p.expression); } } @@ -33509,23 +32642,6 @@ var ts; bindAssignmentTargetFlow(node.operand); } } - function bindDestructuringAssignmentFlow(node) { - if (inAssignmentPattern) { - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - inAssignmentPattern = true; - bind(node.left); - } - else { - inAssignmentPattern = true; - bind(node.left); - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - } - bindAssignmentTargetFlow(node.left); - } function bindBinaryExpressionFlow(node) { var workStacks = { expr: [node], @@ -33567,9 +32683,6 @@ var ts; break; } case 2: { - if (node.operatorToken.kind === 27) { - maybeBindExpressionFlowIfCall(node.left); - } advanceState(3); maybeBind(node.operatorToken); break; @@ -33583,7 +32696,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 && node.left.kind === 202) { + if (operator === 62 && node.left.kind === 199) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256, currentFlow, node); @@ -33613,7 +32726,7 @@ var ts; stackIndex--; } function maybeBind(node) { - if (node && ts.isBinaryExpression(node) && !ts.isDestructuringAssignment(node)) { + if (node && ts.isBinaryExpression(node)) { stackIndex++; workStacks.expr[stackIndex] = node; workStacks.state[stackIndex] = 0; @@ -33627,7 +32740,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 201) { + if (node.expression.kind === 198) { bindAssignmentTargetFlow(node.expression); } } @@ -33664,22 +32777,9 @@ var ts; bindInitializedVariableFlow(node); } } - function bindBindingElementFlow(node) { - if (ts.isBindingPattern(node.name)) { - bindEach(node.decorators); - bindEach(node.modifiers); - bind(node.dotDotDotToken); - bind(node.propertyName); - bind(node.initializer); - bind(node.name); - } - else { - bindEachChild(node); - } - } function bindJSDocTypeAlias(node) { ts.setParent(node.tagName, node); - if (node.kind !== 325 && node.fullName) { + if (node.kind !== 321 && node.fullName) { ts.setParent(node.fullName, node); ts.setParentRecursive(node.fullName, false); } @@ -33687,7 +32787,7 @@ var ts; function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 165) { + if (host && host.kind !== 164) { addDeclarationToSymbol(host.symbol, host, 32); } } @@ -33700,15 +32800,15 @@ var ts; } function bindOptionalChainRest(node) { switch (node.kind) { - case 201: + case 198: bind(node.questionDotToken); bind(node.name); break; - case 202: + case 199: bind(node.questionDotToken); bind(node.argumentExpression); break; - case 203: + case 200: bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); @@ -33759,7 +32859,7 @@ var ts; } else { var expr = ts.skipParentheses(node.expression); - if (expr.kind === 208 || expr.kind === 209) { + if (expr.kind === 205 || expr.kind === 206) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -33771,7 +32871,7 @@ var ts; } } } - if (node.expression.kind === 201) { + if (node.expression.kind === 198) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256, currentFlow, node); @@ -33780,53 +32880,53 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 221: + case 218: + case 249: case 252: - case 255: - case 200: - case 177: - case 312: - case 281: + case 197: + case 176: + case 308: + case 278: return 1; - case 253: + case 250: return 1 | 64; - case 256: - case 254: - case 190: + case 253: + case 251: + case 189: return 1 | 32; - case 297: + case 294: return 1 | 4 | 32; - case 165: + case 164: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 | 4 | 32 | 8 | 128; } + case 165: + case 248: + case 163: case 166: - case 251: - case 164: case 167: case 168: + case 309: + case 304: + case 173: case 169: - case 313: - case 308: - case 174: case 170: - case 171: - case 175: + case 174: return 1 | 4 | 32 | 8; - case 208: - case 209: + case 205: + case 206: return 1 | 4 | 32 | 8 | 16; - case 257: + case 254: return 4; - case 163: + case 162: return node.initializer ? 4 : 0; - case 287: - case 237: - case 238: - case 239: - case 258: + case 284: + case 234: + case 235: + case 236: + case 255: return 2; - case 230: + case 227: return ts.isFunctionLike(node.parent) ? 0 : 2; } return 0; @@ -33839,40 +32939,40 @@ var ts; } function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { switch (container.kind) { - case 256: - return declareModuleMember(node, symbolFlags, symbolExcludes); - case 297: - return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 221: - case 252: - return declareClassMember(node, symbolFlags, symbolExcludes); - case 255: - return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 177: - case 312: - case 200: case 253: - case 281: + return declareModuleMember(node, symbolFlags, symbolExcludes); + case 294: + return declareSourceFileMember(node, symbolFlags, symbolExcludes); + case 218: + case 249: + return declareClassMember(node, symbolFlags, symbolExcludes); + case 252: + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + case 176: + case 308: + case 197: + case 250: + case 278: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); + case 173: case 174: - case 175: + case 168: case 169: + case 309: case 170: - case 313: - case 171: - case 165: case 164: + case 163: + case 165: case 166: case 167: - case 168: + case 248: + case 205: + case 206: + case 304: + case 327: + case 320: case 251: - case 208: - case 209: - case 308: - case 331: - case 324: - case 254: - case 190: + case 189: return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); } } @@ -33951,11 +33051,11 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 290 || prop.name.kind !== 78) { + if (prop.kind === 287 || prop.name.kind !== 78) { continue; } var identifier = prop.name; - var currentKind = prop.kind === 288 || prop.kind === 289 || prop.kind === 165 + var currentKind = prop.kind === 285 || prop.kind === 286 || prop.kind === 164 ? 1 : 2; var existingKind = seen.get(identifier.escapedText); @@ -33987,10 +33087,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 256: + case 253: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 297: + case 294: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -34162,8 +33262,8 @@ var ts; } function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2) { - if (blockScopeContainer.kind !== 297 && - blockScopeContainer.kind !== 256 && + if (blockScopeContainer.kind !== 294 && + blockScopeContainer.kind !== 253 && !ts.isFunctionLike(blockScopeContainer)) { var errorSpan = ts.getErrorSpanForNode(file, node); file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); @@ -34225,7 +33325,7 @@ var ts; ts.setParent(node, parent); var saveInStrictMode = inStrictMode; bindWorker(node); - if (node.kind > 156) { + if (node.kind > 155) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -34293,7 +33393,7 @@ var ts; break; } case 107: - if (currentFlow && (ts.isExpression(node) || parent.kind === 289)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 286)) { node.flowNode = currentFlow; } return checkContextualIdentifier(node); @@ -34302,8 +33402,8 @@ var ts; break; case 79: return checkPrivateIdentifier(node); - case 201: - case 202: + case 198: + case 199: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -34314,11 +33414,11 @@ var ts; if (ts.isInJSFile(expr) && file.commonJsModuleIndicator && ts.isModuleExportsAccessExpression(expr) && - !lookupSymbolForName(blockScopeContainer, "module")) { + !lookupSymbolForNameWorker(blockScopeContainer, "module")) { declareSymbol(file.locals, undefined, expr.expression, 1 | 134217728, 111550); } break; - case 216: + case 213: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1: @@ -34337,14 +33437,6 @@ var ts; bindThisPropertyAssignment(node); break; case 5: - var expression = node.left.expression; - if (ts.isInJSFile(node) && ts.isIdentifier(expression)) { - var symbol = lookupSymbolForName(blockScopeContainer, expression.escapedText); - if (ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration)) { - bindThisPropertyAssignment(node); - break; - } - } bindSpecialPropertyAssignment(node); break; case 0: @@ -34353,74 +33445,74 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 287: + case 284: return checkStrictModeCatchClause(node); - case 210: + case 207: return checkStrictModeDeleteExpression(node); case 8: return checkStrictModeNumericLiteral(node); - case 215: + case 212: return checkStrictModePostfixUnaryExpression(node); - case 214: + case 211: return checkStrictModePrefixUnaryExpression(node); - case 243: + case 240: return checkStrictModeWithStatement(node); - case 245: + case 242: return checkStrictModeLabeledStatement(node); - case 187: + case 186: seenThisKeyword = true; return; - case 172: + case 171: break; - case 159: + case 158: return bindTypeParameter(node); - case 160: + case 159: return bindParameter(node); - case 249: + case 246: return bindVariableDeclarationOrBindingElement(node); - case 198: + case 195: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 163: case 162: + case 161: return bindPropertyWorker(node); - case 288: - case 289: + case 285: + case 286: return bindPropertyOrMethodOrAccessor(node, 4, 0); - case 291: + case 288: return bindPropertyOrMethodOrAccessor(node, 8, 900095); + case 168: case 169: case 170: - case 171: return declareSymbolAndAddToSymbolTable(node, 131072, 0); - case 165: case 164: + case 163: return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 16777216 : 0), ts.isObjectLiteralMethod(node) ? 0 : 103359); - case 251: + case 248: return bindFunctionDeclaration(node); - case 166: + case 165: return declareSymbolAndAddToSymbolTable(node, 16384, 0); - case 167: + case 166: return bindPropertyOrMethodOrAccessor(node, 32768, 46015); - case 168: + case 167: return bindPropertyOrMethodOrAccessor(node, 65536, 78783); + case 173: + case 304: + case 309: case 174: - case 308: - case 313: - case 175: return bindFunctionOrConstructorType(node); - case 177: - case 312: - case 190: + case 176: + case 308: + case 189: return bindAnonymousTypeWorker(node); - case 319: + case 315: return bindJSDocClassTag(node); - case 200: + case 197: return bindObjectLiteralExpression(node); - case 208: - case 209: + case 205: + case 206: return bindFunctionExpression(node); - case 203: + case 200: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7: @@ -34438,60 +33530,60 @@ var ts; bindCallExpression(node); } break; - case 221: - case 252: + case 218: + case 249: inStrictMode = true; return bindClassLikeDeclaration(node); - case 253: + case 250: return bindBlockScopedDeclaration(node, 64, 788872); - case 254: + case 251: return bindBlockScopedDeclaration(node, 524288, 788968); - case 255: + case 252: return bindEnumDeclaration(node); - case 256: + case 253: return bindModuleDeclaration(node); - case 281: + case 278: return bindJsxAttributes(node); - case 280: + case 277: return bindJsxAttribute(node, 4, 0); + case 257: case 260: - case 263: - case 265: - case 270: - return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152); - case 259: - return bindNamespaceExportDeclaration(node); case 262: - return bindImportClause(node); case 267: + return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152); + case 256: + return bindNamespaceExportDeclaration(node); + case 259: + return bindImportClause(node); + case 264: return bindExportDeclaration(node); - case 266: + case 263: return bindExportAssignment(node); - case 297: + case 294: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 230: + case 227: if (!ts.isFunctionLike(node.parent)) { return; } - case 257: + case 254: return updateStrictModeStatementList(node.statements); - case 326: - if (node.parent.kind === 313) { + case 322: + if (node.parent.kind === 309) { return bindParameter(node); } - if (node.parent.kind !== 312) { + if (node.parent.kind !== 308) { break; } - case 333: + case 328: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 307 ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 303 ? 4 | 16777216 : 4; return declareSymbolAndAddToSymbolTable(propTag, flags, 0); - case 331: - case 324: - case 325: + case 327: + case 320: + case 321: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -34599,9 +33691,9 @@ var ts; return symbol; }); if (symbol) { - var isAlias = ts.isAliasableExpression(node.right) && (ts.isExportsIdentifier(node.left.expression) || ts.isModuleExportsAccessExpression(node.left.expression)); - var flags = isAlias ? 2097152 : 4 | 1048576; - ts.setParent(node.left, node); + var flags = ts.isClassExpression(node.right) ? + 4 | 1048576 | 32 : + 4 | 1048576; declareSymbol(symbol.exports, symbol, node.left, flags, 0); } } @@ -34613,19 +33705,12 @@ var ts; if (ts.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { return; } - if (ts.isObjectLiteralExpression(assignedExpression) && ts.every(assignedExpression.properties, ts.isShorthandPropertyAssignment)) { - ts.forEach(assignedExpression.properties, bindExportAssignedObjectMemberAlias); - return; - } var flags = ts.exportAssignmentIsAlias(node) ? 2097152 : 4 | 1048576 | 512; var symbol = declareSymbol(file.symbol.exports, file.symbol, node, flags | 67108864, 0); ts.setValueDeclaration(symbol, node); } - function bindExportAssignedObjectMemberAlias(node) { - declareSymbol(file.symbol.exports, file.symbol, node, 2097152 | 67108864, 0); - } function bindThisPropertyAssignment(node) { ts.Debug.assert(ts.isInJSFile(node)); var hasPrivateIdentifier = (ts.isBinaryExpression(node) && ts.isPropertyAccessExpression(node.left) && ts.isPrivateIdentifier(node.left.name)) @@ -34635,8 +33720,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, false); switch (thisContainer.kind) { - case 251: - case 208: + case 248: + case 205: var constructorSymbol = thisContainer.symbol; if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62) { var l = thisContainer.parent.left; @@ -34655,11 +33740,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32); } break; - case 166: - case 163: case 165: + case 162: + case 164: + case 166: case 167: - case 168: var containingClass = thisContainer.parent; var symbolTable = ts.hasSyntacticModifier(thisContainer, 32) ? containingClass.symbol.exports : containingClass.symbol.members; if (ts.hasDynamicName(node)) { @@ -34669,7 +33754,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 | 67108864, 0, true); } break; - case 297: + case 294: if (ts.hasDynamicName(node)) { break; } @@ -34697,7 +33782,7 @@ var ts; if (node.expression.kind === 107) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 297) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 294) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -34728,20 +33813,15 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 297; + var isToplevel = node.parent.parent.kind === 294; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, false, false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, false); } function bindSpecialPropertyAssignment(node) { - var _a; var parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, container) || lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer); if (!ts.isInJSFile(node) && !ts.isFunctionSymbol(parentSymbol)) { return; } - var rootExpr = ts.getLeftmostAccessExpression(node.left); - if (ts.isIdentifier(rootExpr) && ((_a = lookupSymbolForName(container, rootExpr.escapedText)) === null || _a === void 0 ? void 0 : _a.flags) & 2097152) { - return; - } ts.setParent(node.left, node); ts.setParent(node.right, node); if (ts.isIdentifier(node.left.expression) && container === file && isExportsOrModuleExportsOrAlias(file, node.left.expression)) { @@ -34766,17 +33846,17 @@ var ts; return namespaceSymbol; } if (isToplevel && !isPrototypeProperty) { - var flags_2 = 1536 | 67108864; + var flags_1 = 1536 | 67108864; var excludeFlags_1 = 110735 & ~67108864; namespaceSymbol = forEachIdentifierInEntityName(entityName, namespaceSymbol, function (id, symbol, parent) { if (symbol) { - addDeclarationToSymbol(symbol, id, flags_2); + addDeclarationToSymbol(symbol, id, flags_1); return symbol; } else { var table = parent ? parent.exports : file.jsGlobalAugmentations || (file.jsGlobalAugmentations = ts.createSymbolTable()); - return declareSymbol(table, parent, id, flags_2, excludeFlags_1); + return declareSymbol(table, parent, id, flags_1, excludeFlags_1); } }); } @@ -34822,8 +33902,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 297 - : propertyAccess.parent.parent.kind === 297; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 294 + : propertyAccess.parent.parent.kind === 294; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer); @@ -34860,7 +33940,7 @@ var ts; function lookupSymbolForPropertyAccess(node, lookupContainer) { if (lookupContainer === void 0) { lookupContainer = container; } if (ts.isIdentifier(node)) { - return lookupSymbolForName(lookupContainer, node.escapedText); + return lookupSymbolForNameWorker(lookupContainer, node.escapedText); } else { var symbol = lookupSymbolForPropertyAccess(node.expression); @@ -34889,7 +33969,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 252) { + if (node.kind === 249) { bindBlockScopedDeclaration(node, 32, 899503); } else { @@ -34921,10 +34001,7 @@ var ts; checkStrictModeEvalOrArguments(node, node.name); } if (!ts.isBindingPattern(node.name)) { - if (ts.isInJSFile(node) && ts.isRequireVariableDeclaration(node, true) && !ts.getJSDocTypeTag(node)) { - declareSymbolAndAddToSymbolTable(node, 2097152, 2097152); - } - else if (ts.isBlockOrCatchScoped(node)) { + if (ts.isBlockOrCatchScoped(node)) { bindBlockScopedDeclaration(node, 2, 111551); } else if (ts.isParameterDeclaration(node)) { @@ -34936,7 +34013,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 326 && container.kind !== 313) { + if (node.kind === 322 && container.kind !== 309) { return; } if (inStrictMode && !(node.flags & 8388608)) { @@ -35009,7 +34086,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144, 526824); } } - else if (node.parent.kind === 185) { + else if (node.parent.kind === 184) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -35034,9 +34111,9 @@ var ts; return false; } if (currentFlow === unreachableFlow) { - var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 231) || - node.kind === 252 || - (node.kind === 256 && shouldReportErrorOnModuleDeclaration(node)); + var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 228) || + node.kind === 249 || + (node.kind === 253 && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -35068,12 +34145,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 253: - case 254: + case 250: + case 251: return true; - case 256: + case 253: return getModuleInstanceState(s) !== 1; - case 255: + case 252: return ts.hasSyntacticModifier(s, 2048); default: return false; @@ -35089,7 +34166,7 @@ var ts; return true; } else if (ts.isIdentifier(node)) { - var symbol = lookupSymbolForName(sourceFile, node.escapedText); + var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText); if (!!symbol && !!symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) { var init = symbol.valueDeclaration.initializer; q.push(init); @@ -35103,7 +34180,7 @@ var ts; return false; } ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias; - function lookupSymbolForName(container, name) { + function lookupSymbolForNameWorker(container, name) { var local = container.locals && container.locals.get(name); if (local) { return local.exportSymbol || local; @@ -35264,7 +34341,7 @@ var ts; symbol.exports.forEach(visitSymbol); } ts.forEach(symbol.declarations, function (d) { - if (d.type && d.type.kind === 176) { + if (d.type && d.type.kind === 175) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -35305,12 +34382,6 @@ var ts; function: 16384 })); var isNotOverloadAndNotAccessor = ts.and(isNotOverload, isNotAccessor); - var intrinsicTypeKinds = new ts.Map(ts.getEntries({ - Uppercase: 0, - Lowercase: 1, - Capitalize: 2, - Uncapitalize: 3 - })); function SymbolLinks() { } function NodeLinks() { @@ -35365,7 +34436,6 @@ var ts; var instantiationDepth = 0; var constraintDepth = 0; var currentNode; - var typeCatalog = []; var emptySymbols = ts.createSymbolTable(); var arrayVariances = [1]; var compilerOptions = host.getCompilerOptions(); @@ -35396,7 +34466,6 @@ var ts; getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount") + symbolCount; }, - getTypeCatalog: function () { return typeCatalog; }, getTypeCount: function () { return typeCount; }, getInstantiationCount: function () { return totalInstantiationCount; }, getRelationCacheSizes: function () { return ({ @@ -35411,7 +34480,6 @@ var ts; getMergedSymbol: getMergedSymbol, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getRecursionIdentity: getRecursionIdentity, getTypeOfSymbolAtLocation: function (symbol, locationIn) { var location = ts.getParseTreeNode(locationIn); return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType; @@ -35519,7 +34587,6 @@ var ts; }, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getSymbolOfExpando: getSymbolOfExpando, getContextualType: function (nodeIn, contextFlags) { var node = ts.getParseTreeNode(nodeIn, ts.isExpression); if (!node) { @@ -35707,8 +34774,6 @@ var ts; var intersectionTypes = new ts.Map(); var literalTypes = new ts.Map(); var indexedAccessTypes = new ts.Map(); - var templateLiteralTypes = new ts.Map(); - var stringMappingTypes = new ts.Map(); var substitutionTypes = new ts.Map(); var evolvingArrayTypes = []; var undefinedProperties = new ts.Map(); @@ -35719,7 +34784,6 @@ var ts; var wildcardType = createIntrinsicType(1, "any"); var errorType = createIntrinsicType(1, "error"); var nonInferrableAnyType = createIntrinsicType(1, "any", 524288); - var intrinsicMarkerType = createIntrinsicType(1, "intrinsic"); var unknownType = createIntrinsicType(2, "unknown"); var undefinedType = createIntrinsicType(32768, "undefined"); var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768, "undefined", 524288); @@ -35756,7 +34820,6 @@ var ts; var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; var numberOrBigIntType = getUnionType([numberType, bigintType]); - var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 ? getRestrictiveTypeParameter(t) : t; }); var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 ? wildcardType : t; }); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -36015,14 +35078,6 @@ var ts; } } function errorOrSuggestion(isError, location, message, arg0, arg1, arg2, arg3) { - if (location.pos < 0 || location.end < 0) { - if (!isError) { - return; - } - var file = ts.getSourceFileOfNode(location); - addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message)); - return; - } addErrorOrSuggestion(isError, "message" in message ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForNodeFromMessageChain(location, message)); } function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) { @@ -36285,7 +35340,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 297 && !ts.isExternalOrCommonJsModule(node); + return node.kind === 294 && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -36332,15 +35387,15 @@ var ts; return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile); } if (declaration.pos <= usage.pos && !(ts.isPropertyDeclaration(declaration) && ts.isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) { - if (declaration.kind === 198) { - var errorBindingElement = ts.getAncestor(usage, 198); + if (declaration.kind === 195) { + var errorBindingElement = ts.getAncestor(usage, 195); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 249), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 246), usage); } - else if (declaration.kind === 249) { + else if (declaration.kind === 246) { return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } else if (ts.isClassDeclaration(declaration)) { @@ -36356,10 +35411,10 @@ var ts; } return true; } - if (usage.parent.kind === 270 || (usage.parent.kind === 266 && usage.parent.isExportEquals)) { + if (usage.parent.kind === 267 || (usage.parent.kind === 263 && usage.parent.isExportEquals)) { return true; } - if (usage.kind === 266 && usage.isExportEquals) { + if (usage.kind === 263 && usage.isExportEquals) { return true; } if (!!(usage.flags & 4194304) || isInTypeQuery(usage) || usageInTypeDeclaration()) { @@ -36381,9 +35436,9 @@ var ts; } function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { switch (declaration.parent.parent.kind) { - case 232: - case 237: - case 239: + case 229: + case 234: + case 236: if (isSameScopeDescendentOf(usage, declaration, declContainer)) { return true; } @@ -36401,16 +35456,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 163 && + current.parent.kind === 162 && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasSyntacticModifier(current.parent, 32)) { - if (declaration.kind === 165) { + if (declaration.kind === 164) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 163 && !ts.hasSyntacticModifier(declaration, 32); + var isDeclarationInstanceProperty = declaration.kind === 162 && !ts.hasSyntacticModifier(declaration, 32); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -36428,18 +35483,18 @@ var ts; return "quit"; } switch (node.kind) { - case 209: + case 206: return true; - case 163: + case 162: return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 230: + case 227: switch (node.parent.kind) { + case 166: + case 164: case 167: - case 165: - case 168: return true; default: return false; @@ -36470,17 +35525,17 @@ var ts; } function requiresScopeChangeWorker(node) { switch (node.kind) { - case 209: - case 208: - case 251: - case 166: - return false; + case 206: + case 205: + case 248: case 165: + return false; + case 164: + case 166: case 167: - case 168: - case 288: + case 285: return requiresScopeChangeWorker(node.name); - case 163: + case 162: if (ts.hasStaticModifier(node)) { return target < 99 || !compilerOptions.useDefineForClassFields; } @@ -36518,11 +35573,11 @@ var ts; if (result = lookup(location.locals, name, meaning)) { var useResult = true; if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) { - if (meaning & result.flags & 788968 && lastLocation.kind !== 311) { + if (meaning & result.flags & 788968 && lastLocation.kind !== 307) { useResult = result.flags & 262144 ? lastLocation === location.type || - lastLocation.kind === 160 || - lastLocation.kind === 159 + lastLocation.kind === 159 || + lastLocation.kind === 158 : false; } if (meaning & result.flags & 3) { @@ -36531,13 +35586,13 @@ var ts; } else if (result.flags & 1) { useResult = - lastLocation.kind === 160 || + lastLocation.kind === 159 || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 184) { + else if (location.kind === 183) { useResult = lastLocation === location.trueType; } if (useResult) { @@ -36550,13 +35605,13 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 297: + case 294: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; - case 256: + case 253: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 297 || (ts.isModuleDeclaration(location) && location.flags & 8388608 && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 294 || (ts.isModuleDeclaration(location) && location.flags & 8388608 && !ts.isGlobalScopeAugmentation(location))) { if (result = moduleExports.get("default")) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) { @@ -36567,7 +35622,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 && - (ts.getDeclarationOfKind(moduleExport, 270) || ts.getDeclarationOfKind(moduleExport, 269))) { + (ts.getDeclarationOfKind(moduleExport, 267) || ts.getDeclarationOfKind(moduleExport, 266))) { break; } } @@ -36580,12 +35635,12 @@ var ts; } } break; - case 255: + case 252: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; - case 163: + case 162: if (!ts.hasSyntacticModifier(location, 32)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { @@ -36595,9 +35650,9 @@ var ts; } } break; - case 252: - case 221: - case 253: + case 249: + case 218: + case 250: if (result = lookup(getSymbolOfNode(location).members || emptySymbols, name, meaning & 788968)) { if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { result = undefined; @@ -36609,7 +35664,7 @@ var ts; } break loop; } - if (location.kind === 221 && meaning & 32) { + if (location.kind === 218 && meaning & 32) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -36617,7 +35672,7 @@ var ts; } } break; - case 223: + case 220: if (lastLocation === location.expression && location.parent.token === 93) { var container = location.parent.parent; if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 788968))) { @@ -36628,30 +35683,30 @@ var ts; } } break; - case 158: + case 157: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 253) { + if (ts.isClassLike(grandparent) || grandparent.kind === 250) { if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 209: + case 206: if (compilerOptions.target >= 2) { break; } + case 164: case 165: case 166: case 167: - case 168: - case 251: + case 248: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 208: + case 205: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; @@ -36664,20 +35719,20 @@ var ts; } } break; - case 161: - if (location.parent && location.parent.kind === 160) { + case 160: + if (location.parent && location.parent.kind === 159) { location = location.parent; } - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 252)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 249)) { location = location.parent; } break; - case 331: - case 324: - case 325: + case 327: + case 320: + case 321: location = ts.getJSDocHost(location); break; - case 160: + case 159: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && ts.isBindingPattern(lastLocation))) { if (!associatedDeclarationForContainingInitializerOrBindingName) { @@ -36685,20 +35740,14 @@ var ts; } } break; - case 198: + case 195: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && ts.isBindingPattern(lastLocation))) { - if (ts.isParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) { - associatedDeclarationForContainingInitializerOrBindingName = location; - } - } - break; - case 185: - if (meaning & 262144) { - var parameterName = location.typeParameter.name; - if (parameterName && name === parameterName.escapedText) { - result = location.typeParameter.symbol; - break loop; + var root = ts.getRootDeclaration(location); + if (root.kind === 159) { + if (!associatedDeclarationForContainingInitializerOrBindingName) { + associatedDeclarationForContainingInitializerOrBindingName = location; + } } } break; @@ -36714,7 +35763,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 297); + ts.Debug.assert(lastLocation.kind === 294); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -36752,15 +35801,7 @@ var ts; } } if (!suggestion) { - if (nameArg) { - var lib = getSuggestedLibForNonExistentName(nameArg); - if (lib) { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg), lib); - } - else { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); - } - } + error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); } suggestionCount++; } @@ -36820,9 +35861,9 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 209 && location.kind !== 208) { + if (location.kind !== 206 && location.kind !== 205) { return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 163 && !ts.hasSyntacticModifier(location, 32))) && (!lastLocation || lastLocation !== location.name)); + (location.kind === 162 && !ts.hasSyntacticModifier(location, 32))) && (!lastLocation || lastLocation !== location.name)); } if (lastLocation && lastLocation === location.name) { return false; @@ -36834,12 +35875,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 251: + case 248: + case 249: + case 250: case 252: + case 251: case 253: - case 255: - case 254: - case 256: return true; default: return false; @@ -36851,7 +35892,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 159) { + if (decl.kind === 158) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); @@ -36900,9 +35941,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 78: - case 201: + case 198: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 223: + case 220: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -36945,7 +35986,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 270) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 267) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -36959,31 +36000,15 @@ var ts; } var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 & ~111551, undefined, undefined, false)); if (symbol && !(symbol.flags & 1024)) { - var rawName = ts.unescapeLeadingUnderscores(name); - if (isES2015OrLaterConstructorName(name)) { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName); - } - else if (maybeMappedType(errorLocation, symbol)) { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0, rawName, rawName === "K" ? "P" : "K"); - } - else { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, rawName); - } + var message = isES2015OrLaterConstructorName(name) + ? ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later + : ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here; + error(errorLocation, message, ts.unescapeLeadingUnderscores(name)); return true; } } return false; } - function maybeMappedType(node, symbol) { - var container = ts.findAncestor(node.parent, function (n) { - return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit"; - }); - if (container && container.members.length === 1) { - var type = getDeclaredTypeOfSymbol(symbol); - return !!(type.flags & 1048576) && allTypesAssignableToKind(type, 384, true); - } - return false; - } function isES2015OrLaterConstructorName(n) { switch (n) { case "Promise": @@ -37018,7 +36043,7 @@ var ts; if (result.flags & (16 | 1 | 67108864) && result.flags & 32) { return; } - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 255); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 252); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -37049,13 +36074,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 260: + case 257: return node; - case 262: + case 259: return node.parent; - case 263: + case 260: return node.parent.parent; - case 265: + case 262: return node.parent.parent.parent; default: return undefined; @@ -37065,37 +36090,29 @@ var ts; return ts.find(symbol.declarations, isAliasSymbolDeclaration); } function isAliasSymbolDeclaration(node) { - return node.kind === 260 - || node.kind === 259 - || node.kind === 262 && !!node.name - || node.kind === 263 - || node.kind === 269 - || node.kind === 265 - || node.kind === 270 - || node.kind === 266 && ts.exportAssignmentIsAlias(node) - || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 && ts.exportAssignmentIsAlias(node) - || ts.isAccessExpression(node) + return node.kind === 257 || + node.kind === 256 || + node.kind === 259 && !!node.name || + node.kind === 260 || + node.kind === 266 || + node.kind === 262 || + node.kind === 267 || + node.kind === 263 && ts.exportAssignmentIsAlias(node) || + ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 && ts.exportAssignmentIsAlias(node) || + ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 - && isAliasableOrJsExpression(node.parent.right) - || node.kind === 289 - || node.kind === 288 && isAliasableOrJsExpression(node.initializer) - || ts.isRequireVariableDeclaration(node, true); + && isAliasableOrJsExpression(node.parent.right) || + node.kind === 286 || + node.kind === 285 && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - var commonJSPropertyAccess = getCommonJSPropertyAccess(node); - if (commonJSPropertyAccess) { - var name = ts.getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0]; - return ts.isIdentifier(commonJSPropertyAccess.name) - ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText)) - : undefined; - } - if (ts.isVariableDeclaration(node) || node.moduleReference.kind === 272) { - var immediate = resolveExternalModuleName(node, ts.getExternalModuleRequireArgument(node) || ts.getExternalModuleImportEqualsDeclarationExpression(node)); + if (node.moduleReference.kind === 269) { + var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, false); return resolved_4; @@ -37120,7 +36137,10 @@ var ts; } function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) { var exportValue = moduleSymbol.exports.get("export="); - var exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports.get(name); + if (exportValue) { + return getPropertyOfType(getTypeOfSymbol(exportValue), name); + } + var exportSymbol = moduleSymbol.exports.get(name); var resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(sourceNode, exportSymbol, resolved, false); return resolved; @@ -37231,9 +36251,11 @@ var ts; result.exports = new ts.Map(valueSymbol.exports); return result; } - function getExportOfModule(symbol, name, specifier, dontResolveAlias) { + function getExportOfModule(symbol, specifier, dontResolveAlias) { + var _a; if (symbol.flags & 1536) { - var exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText); + var name = ((_a = specifier.propertyName) !== null && _a !== void 0 ? _a : specifier.name).escapedText; + var exportSymbol = getExportsOfSymbol(symbol).get(name); var resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(specifier, exportSymbol, resolved, false); return resolved; @@ -37250,14 +36272,10 @@ var ts; function getExternalModuleMember(node, specifier, dontResolveAlias) { var _a; if (dontResolveAlias === void 0) { dontResolveAlias = false; } - var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier; - var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); - var name = !ts.isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name; - if (!ts.isIdentifier(name)) { - return undefined; - } + var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); + var name = specifier.propertyName || specifier.name; var suppressInteropError = name.escapedText === "default" && !!(compilerOptions.allowSyntheticDefaultImports || compilerOptions.esModuleInterop); - var targetSymbol = resolveESModuleSymbol(moduleSymbol, moduleSpecifier, dontResolveAlias, suppressInteropError); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias, suppressInteropError); if (targetSymbol) { if (name.escapedText) { if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { @@ -37271,7 +36289,7 @@ var ts; symbolFromVariable = getPropertyOfVariable(targetSymbol, name.escapedText); } symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); - var symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias); + var symbolFromModule = getExportOfModule(targetSymbol, specifier, dontResolveAlias); if (symbolFromModule === undefined && name.escapedText === "default") { var file = ts.find(moduleSymbol.declarations, ts.isSourceFile); if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias)) { @@ -37287,7 +36305,7 @@ var ts; var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol); if (suggestion !== undefined) { var suggestionName = symbolToString(suggestion); - var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName); + var diagnostic = error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2, moduleName, declarationName, suggestionName); if (suggestion.valueDeclaration) { ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName)); } @@ -37348,21 +36366,10 @@ var ts; } } function getTargetOfImportSpecifier(node, dontResolveAlias) { - var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent; - var commonJSPropertyAccess = getCommonJSPropertyAccess(root); - var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias); - var name = node.propertyName || node.name; - if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) { - return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias); - } + var resolved = getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(node, undefined, resolved, false); return resolved; } - function getCommonJSPropertyAccess(node) { - if (ts.isVariableDeclaration(node) && node.initializer && ts.isPropertyAccessExpression(node.initializer)) { - return node.initializer; - } - } function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { var resolved = resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(node, undefined, resolved, false); @@ -37399,7 +36406,7 @@ var ts; var expression = node.initializer; return getTargetOfAliasLikeExpression(expression, dontRecursivelyResolve); } - function getTargetOfAccessExpression(node, dontRecursivelyResolve) { + function getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve) { if (!(ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62)) { return undefined; } @@ -37408,32 +36415,29 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 260: - case 249: + case 257: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 262: - return getTargetOfImportClause(node, dontRecursivelyResolve); - case 263: - return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 269: - return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 265: - case 198: - return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 270: - return getTargetOfExportSpecifier(node, 111551 | 788968 | 1920, dontRecursivelyResolve); - case 266: - case 216: - return getTargetOfExportAssignment(node, dontRecursivelyResolve); case 259: + return getTargetOfImportClause(node, dontRecursivelyResolve); + case 260: + return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + case 266: + return getTargetOfNamespaceExport(node, dontRecursivelyResolve); + case 262: + return getTargetOfImportSpecifier(node, dontRecursivelyResolve); + case 267: + return getTargetOfExportSpecifier(node, 111551 | 788968 | 1920, dontRecursivelyResolve); + case 263: + case 213: + return getTargetOfExportAssignment(node, dontRecursivelyResolve); + case 256: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 289: + case 286: return resolveEntityName(node.name, 111551 | 788968 | 1920, true, dontRecursivelyResolve); - case 288: + case 285: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 202: - case 201: - return getTargetOfAccessExpression(node, dontRecursivelyResolve); + case 198: + return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); } @@ -37476,7 +36480,7 @@ var ts; return undefined; } function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) { - if (!aliasDeclaration || ts.isPropertyAccessExpression(aliasDeclaration)) + if (!aliasDeclaration) return false; var sourceSymbol = getSymbolOfNode(aliasDeclaration); if (ts.isTypeOnlyImportOrExportDeclaration(aliasDeclaration)) { @@ -37540,11 +36544,11 @@ var ts; if (entityName.kind === 78 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 78 || entityName.parent.kind === 157) { + if (entityName.kind === 78 || entityName.parent.kind === 156) { return resolveEntityName(entityName, 1920, false, dontResolveAlias); } else { - ts.Debug.assert(entityName.parent.kind === 260); + ts.Debug.assert(entityName.parent.kind === 257); return resolveEntityName(entityName, 111551 | 788968 | 1920, false, dontResolveAlias); } } @@ -37565,9 +36569,9 @@ var ts; return getMergedSymbol(symbolFromJSPrototype); } } - else if (name.kind === 157 || name.kind === 201) { - var left = name.kind === 157 ? name.left : name.expression; - var right = name.kind === 157 ? name.right : name.name; + else if (name.kind === 156 || name.kind === 198) { + var left = name.kind === 156 ? name.left : name.expression; + var right = name.kind === 156 ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -37593,12 +36597,7 @@ var ts; symbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, meaning)); if (!symbol) { if (!ignoreErrors) { - var namespaceName = getFullyQualifiedName(namespace); - var declarationName = ts.declarationNameToString(right); - var suggestion = getSuggestedSymbolForNonexistentModule(right, namespace); - suggestion ? - error(right, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestion)) : - error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName); + error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); } return undefined; } @@ -37607,7 +36606,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 || name.parent.kind === 266)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 || name.parent.kind === 263)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, undefined, true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -37766,7 +36765,7 @@ var ts; var errorInfo = !ts.isExternalModuleNameRelative(moduleReference) && packageId ? typesPackageExists(packageId.name) ? ts.chainDiagnosticMessages(undefined, ts.Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, packageId.name, ts.mangleScopedPackageName(packageId.name)) - : ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name)) + : ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name)) : undefined; errorOrSuggestion(isError, errorNode, ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedFileName)); } @@ -37805,7 +36804,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 | 3)) && !ts.getDeclarationOfKind(symbol, 297)) { + if (!suppressInteropError && !(symbol.flags & (1536 | 3)) && !ts.getDeclarationOfKind(symbol, 294)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -38081,7 +37080,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 166 && ts.nodeIsPresent(member.body)) { + if (member.kind === 165 && ts.nodeIsPresent(member.body)) { return member; } } @@ -38090,7 +37089,6 @@ var ts; var result = new Type(checker, flags); typeCount++; result.id = typeCount; - typeCatalog.push(result); return result; } function createIntrinsicType(kind, intrinsicName, objectFlags) { @@ -38164,19 +37162,19 @@ var ts; } } switch (location.kind) { - case 297: + case 294: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 256: + case 253: var sym = getSymbolOfNode(location); if (result = callback((sym === null || sym === void 0 ? void 0 : sym.exports) || emptySymbols)) { return { value: result }; } break; - case 252: - case 221: - case 253: + case 249: + case 218: + case 250: var table_1; (getSymbolOfNode(location).members || emptySymbols).forEach(function (memberSymbol, key) { if (memberSymbol.flags & (788968 & ~67108864)) { @@ -38237,7 +37235,7 @@ var ts; && symbolFromSymbolTable.escapedName !== "default" && !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 270))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 267))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -38273,7 +37271,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 270)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 267)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -38287,10 +37285,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 163: - case 165: + case 162: + case 164: + case 166: case 167: - case 168: continue; default: return false; @@ -38389,10 +37387,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 297 && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 294 && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 297 && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 294 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -38401,7 +37399,6 @@ var ts; } return { accessibility: 0, aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { - var _a, _b; if (!isDeclarationVisible(declaration)) { var anyImportSyntax = getAnyImportSyntax(declaration); if (anyImportSyntax && @@ -38419,14 +37416,6 @@ var ts; && isDeclarationVisible(declaration.parent)) { return addVisibleAlias(declaration, declaration); } - else if (symbol.flags & 2097152 && ts.isBindingElement(declaration) && ts.isInJSFile(declaration) && ((_a = declaration.parent) === null || _a === void 0 ? void 0 : _a.parent) - && ts.isVariableDeclaration(declaration.parent.parent) - && ((_b = declaration.parent.parent.parent) === null || _b === void 0 ? void 0 : _b.parent) && ts.isVariableStatement(declaration.parent.parent.parent.parent) - && !ts.hasSyntacticModifier(declaration.parent.parent.parent.parent, 1) - && declaration.parent.parent.parent.parent.parent - && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) { - return addVisibleAlias(declaration, declaration.parent.parent.parent.parent); - } return false; } return true; @@ -38441,13 +37430,13 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 176 || + if (entityName.parent.kind === 175 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 158) { + entityName.parent.kind === 157) { meaning = 111551 | 1048576; } - else if (entityName.kind === 157 || entityName.kind === 201 || - entityName.parent.kind === 260) { + else if (entityName.kind === 156 || entityName.kind === 198 || + entityName.parent.kind === 257) { meaning = 1920; } else { @@ -38483,7 +37472,7 @@ var ts; return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker); function symbolToStringWorker(writer) { var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); - var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 297 ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true }); + var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 294 ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4, entity, sourceFile, writer); return writer; @@ -38495,10 +37484,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144) { - sigOutput = kind === 1 ? 175 : 174; + sigOutput = kind === 1 ? 174 : 173; } else { - sigOutput = kind === 1 ? 170 : 169; + sigOutput = kind === 1 ? 169 : 168; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 | 512); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -38544,9 +37533,6 @@ var ts; if (flags === void 0) { flags = 0; } return flags & 814775659; } - function isClassInstanceSide(type) { - return !!type.symbol && !!(type.symbol.flags & 32) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(ts.getObjectFlags(type) & 1073741824)); - } function createNodeBuilder() { return { typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) { @@ -38578,7 +37564,6 @@ var ts; }, }; function withContext(enclosingDeclaration, flags, tracker, cb) { - var _a, _b; ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); var context = { enclosingDeclaration: enclosingDeclaration, @@ -38601,9 +37586,6 @@ var ts; approximateLength: 0 }; var resultingNode = cb(context); - if (context.truncating && context.flags & 1) { - (_b = (_a = context.tracker) === null || _a === void 0 ? void 0 : _a.reportTruncationError) === null || _b === void 0 ? void 0 : _b.call(_a); - } return context.encounteredError ? undefined : resultingNode; } function checkTruncationLength(context) { @@ -38630,22 +37612,22 @@ var ts; } if (type.flags & 1) { context.approximateLength += 3; - return ts.factory.createKeywordTypeNode(type === intrinsicMarkerType ? 136 : 128); + return ts.factory.createKeywordTypeNode(128); } if (type.flags & 2) { - return ts.factory.createKeywordTypeNode(152); + return ts.factory.createKeywordTypeNode(151); } if (type.flags & 4) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(147); + return ts.factory.createKeywordTypeNode(146); } if (type.flags & 8) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(144); + return ts.factory.createKeywordTypeNode(143); } if (type.flags & 64) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(155); + return ts.factory.createKeywordTypeNode(154); } if (type.flags & 16) { context.approximateLength += 7; @@ -38654,23 +37636,10 @@ var ts; if (type.flags & 1024 && !(type.flags & 1048576)) { var parentSymbol = getParentOfSymbol(type.symbol); var parentName = symbolToTypeNode(parentSymbol, context, 788968); - if (getDeclaredTypeOfSymbol(parentSymbol) === type) { - return parentName; - } - var memberName = ts.symbolName(type.symbol); - if (ts.isIdentifierText(memberName, 0)) { - return appendReferenceToType(parentName, ts.factory.createTypeReferenceNode(memberName, undefined)); - } - if (ts.isImportTypeNode(parentName)) { - parentName.isTypeOf = true; - return ts.factory.createIndexedAccessTypeNode(parentName, ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName))); - } - else if (ts.isTypeReferenceNode(parentName)) { - return ts.factory.createIndexedAccessTypeNode(ts.factory.createTypeQueryNode(parentName.typeName), ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName))); - } - else { - return ts.Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`."); - } + var enumLiteralName = getDeclaredTypeOfSymbol(parentSymbol) === type + ? parentName + : appendReferenceToType(parentName, ts.factory.createTypeReferenceNode(ts.symbolName(type.symbol), undefined)); + return enumLiteralName; } if (type.flags & 1056) { return symbolToTypeNode(type.symbol, context, 788968); @@ -38703,7 +37672,7 @@ var ts; } } context.approximateLength += 13; - return ts.factory.createTypeOperatorNode(151, ts.factory.createKeywordTypeNode(148)); + return ts.factory.createTypeOperatorNode(150, ts.factory.createKeywordTypeNode(147)); } if (type.flags & 16384) { context.approximateLength += 4; @@ -38711,7 +37680,7 @@ var ts; } if (type.flags & 32768) { context.approximateLength += 9; - return ts.factory.createKeywordTypeNode(150); + return ts.factory.createKeywordTypeNode(149); } if (type.flags & 65536) { context.approximateLength += 4; @@ -38719,15 +37688,15 @@ var ts; } if (type.flags & 131072) { context.approximateLength += 5; - return ts.factory.createKeywordTypeNode(141); + return ts.factory.createKeywordTypeNode(140); } if (type.flags & 4096) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(148); + return ts.factory.createKeywordTypeNode(147); } if (type.flags & 67108864) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(145); + return ts.factory.createKeywordTypeNode(144); } if (isThisTypeParameter(type)) { if (context.flags & 4194304) { @@ -38793,19 +37762,7 @@ var ts; var indexedType = type.type; context.approximateLength += 6; var indexTypeNode = typeToTypeNodeHelper(indexedType, context); - return ts.factory.createTypeOperatorNode(138, indexTypeNode); - } - if (type.flags & 134217728) { - var texts_1 = type.texts; - var types_1 = type.types; - var templateHead = ts.factory.createTemplateHead(texts_1[0]); - var templateSpans = ts.factory.createNodeArray(ts.map(types_1, function (t, i) { return ts.factory.createTemplateLiteralTypeSpan(typeToTypeNodeHelper(t, context), (i < types_1.length - 1 ? ts.factory.createTemplateMiddle : ts.factory.createTemplateTail)(texts_1[i + 1])); })); - context.approximateLength += 2; - return ts.factory.createTemplateLiteralType(templateHead, templateSpans); - } - if (type.flags & 268435456) { - var typeNode = typeToTypeNodeHelper(type.type, context); - return symbolToTypeNode(type.symbol, context, 788968, [typeNode]); + return ts.factory.createTypeOperatorNode(137, indexTypeNode); } if (type.flags & 8388608) { var objectTypeNode = typeToTypeNodeHelper(type.objectType, context); @@ -38848,15 +37805,14 @@ var ts; var questionToken = type.declaration.questionToken ? ts.factory.createToken(type.declaration.questionToken.kind) : undefined; var appropriateConstraintTypeNode; if (isMappedTypeWithKeyofConstraintDeclaration(type)) { - appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(138, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context)); + appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(137, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context)); } else { appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type), context); } var typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type), context, appropriateConstraintTypeNode); - var nameTypeNode = type.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type), context) : undefined; var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); - var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode); + var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); context.approximateLength += 10; return ts.setEmitFlags(mappedTypeNode, 1); } @@ -38865,14 +37821,14 @@ var ts; var typeId = type.id; var symbol = type.symbol; if (symbol) { - var isInstanceType = isClassInstanceSide(type) ? 788968 : 111551; if (isJSConstructor(symbol.valueDeclaration)) { + var isInstanceType = type === getDeclaredTypeOfClassOrInterface(symbol) ? 788968 : 111551; return symbolToTypeNode(symbol, context, isInstanceType); } - else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 221 && context.flags & 2048) || + else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 218 && context.flags & 2048) || symbol.flags & (384 | 512) || shouldWriteTypeOfFunctionSymbol()) { - return symbolToTypeNode(symbol, context, isInstanceType); + return symbolToTypeNode(symbol, context, 111551); } else if ((_a = context.visitedTypes) === null || _a === void 0 ? void 0 : _a.has(typeId)) { var typeAlias = getTypeAliasForTypeLiteral(type); @@ -38897,7 +37853,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 297 || declaration.parent.kind === 257; + return declaration.parent.kind === 294 || declaration.parent.kind === 254; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { return (!!(context.flags & 4096) || ((_a = context.visitedTypes) === null || _a === void 0 ? void 0 : _a.has(typeId))) && @@ -38945,12 +37901,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 174, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 173, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 175, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 174, context); return signatureNode; } } @@ -38971,7 +37927,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.factory.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(142, arrayType); + return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(141, arrayType); } else if (type.target.objectFlags & 8) { if (typeArguments.length > 0) { @@ -38995,12 +37951,12 @@ var ts; } } var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode(tupleConstituentNodes), 1); - return type.target.readonly ? ts.factory.createTypeOperatorNode(142, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.factory.createTypeOperatorNode(141, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288)) { var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode([]), 1); - return type.target.readonly ? ts.factory.createTypeOperatorNode(142, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.factory.createTypeOperatorNode(141, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; @@ -39025,10 +37981,10 @@ var ts; } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { var typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start, i), context); - var flags_3 = context.flags; + var flags_2 = context.flags; context.flags |= 16; var ref = symbolToTypeNode(parent, context, 788968, typeArgumentSlice); - context.flags = flags_3; + context.flags = flags_2; resultType = !resultType ? ref : appendReferenceToType(resultType, ref); } } @@ -39100,11 +38056,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 169, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 168, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 170, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 169, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -39180,7 +38136,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768); }), 0); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 164, context, { name: propertyName, questionToken: optionalToken }); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 163, context, { name: propertyName, questionToken: optionalToken }); typeElements.push(preserveCommentsOn(methodDeclaration)); } } @@ -39195,7 +38151,7 @@ var ts; propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : ts.factory.createKeywordTypeNode(128); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(142)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(141)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -39203,8 +38159,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 333; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 333; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 328; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 328; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -39234,8 +38190,8 @@ var ts; var seenNames = mayHaveNameCollisions ? ts.createUnderscoreEscapedMultiMap() : undefined; var result_4 = []; var i = 0; - for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { - var type = types_2[_i]; + for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { + var type = types_1[_i]; i++; if (checkTruncationLength(context) && (i + 2 < types.length - 1)) { result_4.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", undefined)); @@ -39263,8 +38219,8 @@ var ts; var b = _b[0]; return typesAreSameReference(a, b); })) { - for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { - var _a = types_3[_i], type = _a[0], resultIndex = _a[1]; + for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { + var _a = types_2[_i], type = _a[0], resultIndex = _a[1]; result_4[resultIndex] = typeToTypeNodeHelper(type, context); } } @@ -39281,7 +38237,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context, typeNode) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 ? 147 : 144); + var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 ? 146 : 143); var indexingParameter = ts.factory.createParameterDeclaration(undefined, undefined, undefined, name, undefined, indexerTypeNode, undefined); if (!typeNode) { typeNode = typeToTypeNodeHelper(indexInfo.type || anyType, context); @@ -39290,7 +38246,7 @@ var ts; context.encounteredError = true; } context.approximateLength += (name.length + 4); - return ts.factory.createIndexSignature(undefined, indexInfo.isReadonly ? [ts.factory.createToken(142)] : undefined, [indexingParameter], typeNode); + return ts.factory.createIndexSignature(undefined, indexInfo.isReadonly ? [ts.factory.createToken(141)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context, options) { var _a, _b, _c, _d; @@ -39305,8 +38261,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var expandedParams = getExpandedParameters(signature, true)[0]; - var parameters = (ts.some(expandedParams, function (p) { return p !== expandedParams[expandedParams.length - 1] && !!(ts.getCheckFlags(p) & 32768); }) ? signature.parameters : expandedParams).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 166, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); }); + var parameters = getExpandedParameters(signature, true)[0].map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 165, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -39333,20 +38288,20 @@ var ts; } } context.approximateLength += 3; - var node = kind === 169 ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) : - kind === 170 ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : - kind === 164 ? ts.factory.createMethodSignature(options === null || options === void 0 ? void 0 : options.modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : - kind === 165 ? ts.factory.createMethodDeclaration(undefined, options === null || options === void 0 ? void 0 : options.modifiers, undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), undefined, typeParameters, parameters, returnTypeNode, undefined) : - kind === 166 ? ts.factory.createConstructorDeclaration(undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, undefined) : - kind === 167 ? ts.factory.createGetAccessorDeclaration(undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, undefined) : - kind === 168 ? ts.factory.createSetAccessorDeclaration(undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, undefined) : - kind === 171 ? ts.factory.createIndexSignature(undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, returnTypeNode) : - kind === 308 ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) : - kind === 174 ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : - kind === 175 ? ts.factory.createConstructorTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : - kind === 251 ? ts.factory.createFunctionDeclaration(undefined, options === null || options === void 0 ? void 0 : options.modifiers, undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, undefined) : - kind === 208 ? ts.factory.createFunctionExpression(options === null || options === void 0 ? void 0 : options.modifiers, undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) : - kind === 209 ? ts.factory.createArrowFunction(options === null || options === void 0 ? void 0 : options.modifiers, typeParameters, parameters, returnTypeNode, undefined, ts.factory.createBlock([])) : + var node = kind === 168 ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) : + kind === 169 ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : + kind === 163 ? ts.factory.createMethodSignature(options === null || options === void 0 ? void 0 : options.modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : + kind === 164 ? ts.factory.createMethodDeclaration(undefined, options === null || options === void 0 ? void 0 : options.modifiers, undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), undefined, typeParameters, parameters, returnTypeNode, undefined) : + kind === 165 ? ts.factory.createConstructorDeclaration(undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, undefined) : + kind === 166 ? ts.factory.createGetAccessorDeclaration(undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, undefined) : + kind === 167 ? ts.factory.createSetAccessorDeclaration(undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, undefined) : + kind === 170 ? ts.factory.createIndexSignature(undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, returnTypeNode) : + kind === 304 ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) : + kind === 173 ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : + kind === 174 ? ts.factory.createConstructorTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : + kind === 248 ? ts.factory.createFunctionDeclaration(undefined, options === null || options === void 0 ? void 0 : options.modifiers, undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, undefined) : + kind === 205 ? ts.factory.createFunctionExpression(options === null || options === void 0 ? void 0 : options.modifiers, undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) : + kind === 206 ? ts.factory.createArrowFunction(options === null || options === void 0 ? void 0 : options.modifiers, typeParameters, parameters, returnTypeNode, undefined, ts.factory.createBlock([])) : ts.Debug.assertNever(kind); if (typeArguments) { node.typeArguments = ts.factory.createNodeArray(typeArguments); @@ -39368,9 +38323,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 160); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 159); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 326); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 322); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -39385,7 +38340,7 @@ var ts; var dotDotDotToken = isRest ? ts.factory.createToken(25) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 78 ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name), 16777216) : - parameterDeclaration.name.kind === 157 ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216) : + parameterDeclaration.name.kind === 156 ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -39531,11 +38486,11 @@ var ts; } function getSpecifierForModuleSymbol(symbol, context) { var _a; - var file = ts.getDeclarationOfKind(symbol, 297); + var file = ts.getDeclarationOfKind(symbol, 294); if (!file) { var equivalentFileSymbol = ts.firstDefined(symbol.declarations, function (d) { return getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol); }); if (equivalentFileSymbol) { - file = ts.getDeclarationOfKind(equivalentFileSymbol, 297); + file = ts.getDeclarationOfKind(equivalentFileSymbol, 294); } } if (file && file.moduleName !== undefined) { @@ -39568,7 +38523,7 @@ var ts; var isBundle_1 = !!ts.outFile(compilerOptions); var moduleResolverHost = context.tracker.moduleResolverHost; var specifierCompilerOptions = isBundle_1 ? __assign(__assign({}, compilerOptions), { baseUrl: moduleResolverHost.getCommonSourceDirectory() }) : compilerOptions; - specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative", importModuleSpecifierEnding: isBundle_1 ? "minimal" : undefined })); + specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative" })); (_a = links.specifierCache) !== null && _a !== void 0 ? _a : (links.specifierCache = new ts.Map()); links.specifierCache.set(contextFile.path, specifier); } @@ -39852,7 +38807,7 @@ var ts; } var oldFlags = context.flags; if (type.flags & 8192 && - type.symbol === symbol && (!context.enclosingDeclaration || ts.some(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === ts.getSourceFileOfNode(context.enclosingDeclaration); }))) { + type.symbol === symbol) { context.flags |= 1048576; } var result = typeToTypeNodeHelper(type, context); @@ -39884,17 +38839,17 @@ var ts; return transformed === existing ? ts.setTextRange(ts.factory.cloneNode(existing), existing) : transformed; function visitExistingNodeTreeSymbols(node) { var _a, _b; - if (ts.isJSDocAllType(node) || node.kind === 310) { + if (ts.isJSDocAllType(node) || node.kind === 306) { return ts.factory.createKeywordTypeNode(128); } if (ts.isJSDocUnknownType(node)) { - return ts.factory.createKeywordTypeNode(152); + return ts.factory.createKeywordTypeNode(151); } if (ts.isJSDocNullableType(node)) { return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createLiteralTypeNode(ts.factory.createNull())]); } if (ts.isJSDocOptionalType(node)) { - return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(150)]); + return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(149)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -39994,8 +38949,8 @@ var ts; } } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 165, true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 164, false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 164, true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 163, false); var enclosingDeclaration = context.enclosingDeclaration; var results = []; var visitedSymbols = new ts.Set(); @@ -40219,23 +39174,14 @@ var ts; if (textRange && ts.isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) { textRange = textRange.parent.parent; } - var propertyAccessRequire = ts.find(symbol.declarations, ts.isPropertyAccessExpression); - if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right) - && type.symbol && ts.isSourceFile(type.symbol.valueDeclaration)) { - var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right; - addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(alias, localName)])), 0); - context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551); - } - else { - var statement = ts.setTextRange(ts.factory.createVariableStatement(undefined, ts.factory.createVariableDeclarationList([ - ts.factory.createVariableDeclaration(name, undefined, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) - ], flags)), textRange); - addResult(statement, name !== localName ? modifierFlags & ~1 : modifierFlags); - if (name !== localName && !isPrivate) { - addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0); - needsExportDeclaration = false; - needsPostExportDefault = false; - } + var statement = ts.setTextRange(ts.factory.createVariableStatement(undefined, ts.factory.createVariableDeclarationList([ + ts.factory.createVariableDeclaration(name, undefined, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) + ], flags)), textRange); + addResult(statement, name !== localName ? modifierFlags & ~1 : modifierFlags); + if (name !== localName && !isPrivate) { + addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0); + needsExportDeclaration = false; + needsPostExportDefault = false; } } } @@ -40254,7 +39200,7 @@ var ts; if ((symbol.flags & (512 | 1024) && (!isConstMergedWithNS || isTypeOnlyNamespace(symbol))) || isConstMergedWithNSPrintableAsSignatureMerge) { serializeModule(symbol, symbolName, modifierFlags); } - if (symbol.flags & 64 && !(symbol.flags & 32)) { + if (symbol.flags & 64) { serializeInterface(symbol, symbolName, modifierFlags); } if (symbol.flags & 2097152) { @@ -40336,8 +39282,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0, interfaceType, baseType, 169); - var constructSignatures = serializeSignatures(1, interfaceType, baseType, 170); + var callSignatures = serializeSignatures(0, interfaceType, baseType, 168); + var constructSignatures = serializeSignatures(1, interfaceType, baseType, 169); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.factory.createHeritageClause(93, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b, 111551); }))]; addResult(ts.factory.createInterfaceDeclaration(undefined, undefined, getInternalSymbolName(symbol, symbolName), typeParamDecls, heritageClauses, __spreadArrays(indexSignatures, constructSignatures, callSignatures, members)), modifierFlags); @@ -40389,7 +39335,7 @@ var ts; var signatures = getSignaturesOfType(type, 0); for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; - var decl = signatureToSignatureDeclarationHelper(sig, 251, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); + var decl = signatureToSignatureDeclarationHelper(sig, 248, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); addResult(ts.setTextRange(decl, sig.declaration && ts.isVariableDeclaration(sig.declaration.parent) && sig.declaration.parent.parent || sig.declaration), modifierFlags); } if (!(symbol.flags & (512 | 1024) && !!symbol.exports && !!symbol.exports.size)) { @@ -40429,7 +39375,7 @@ var ts; } function isNamespaceMember(p) { return !!(p.flags & (788968 | 1920 | 2097152)) || - !(p.flags & 4194304 || p.escapedName === "prototype" || p.valueDeclaration && ts.getEffectiveModifierFlags(p.valueDeclaration) & 32 && ts.isClassLike(p.valueDeclaration.parent)); + !(p.flags & 4194304 || p.escapedName === "prototype" || p.valueDeclaration && ts.isClassLike(p.valueDeclaration.parent)); } function serializeAsClass(symbol, localName, modifierFlags) { var _a; @@ -40464,12 +39410,11 @@ var ts; !ts.some(getSignaturesOfType(staticType, 1)); var constructors = isNonConstructableClassLikeInJsFile ? [ts.factory.createConstructorDeclaration(undefined, ts.factory.createModifiersFromModifierFlags(8), [], undefined)] : - serializeSignatures(1, staticType, baseTypes[0], 166); + serializeSignatures(1, staticType, baseTypes[0], 165); var indexSignatures = serializeIndexSignatures(classType, baseTypes[0]); addResult(ts.setTextRange(ts.factory.createClassDeclaration(undefined, undefined, localName, typeParamDecls, heritageClauses, __spreadArrays(indexSignatures, staticMembers, constructors, publicProperties, privateProperties)), symbol.declarations && ts.filter(symbol.declarations, function (d) { return ts.isClassDeclaration(d) || ts.isClassExpression(d); })[0]), modifierFlags); } function serializeAsAlias(symbol, localName, modifierFlags) { - var _a, _b, _c, _d, _e; var node = getDeclarationOfAliasSymbol(symbol); if (!node) return ts.Debug.fail(); @@ -40484,66 +39429,38 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); switch (node.kind) { - case 198: - if (((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.kind) === 249) { - var specifier_1 = getSpecifierForModuleSymbol(target.parent || target, context); - var propertyName = node.propertyName; - addResult(ts.factory.createImportDeclaration(undefined, undefined, ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1)), 0); - break; - } - ts.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization"); - break; - case 289: - if (((_e = (_d = node.parent) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.kind) === 216) { - serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), targetName); - } - break; - case 249: - if (ts.isPropertyAccessExpression(node.initializer)) { - var initializer = node.initializer; - var uniqueName = ts.factory.createUniqueName(localName); - var specifier_2 = getSpecifierForModuleSymbol(target.parent || target, context); - addResult(ts.factory.createImportEqualsDeclaration(undefined, undefined, uniqueName, ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(specifier_2))), 0); - addResult(ts.factory.createImportEqualsDeclaration(undefined, undefined, ts.factory.createIdentifier(localName), ts.factory.createQualifiedName(uniqueName, initializer.name)), modifierFlags); - break; - } - case 260: - if (target.escapedName === "export=" && ts.some(target.declarations, ts.isJsonSourceFile)) { - serializeMaybeAliasAssignment(symbol); - break; - } - var isLocalImport = !(target.flags & 512) && !ts.isVariableDeclaration(node); + case 257: + var isLocalImport = !(target.flags & 512); addResult(ts.factory.createImportEqualsDeclaration(undefined, undefined, ts.factory.createIdentifier(localName), isLocalImport ? symbolToName(target, context, 67108863, false) - : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))), isLocalImport ? modifierFlags : 0); + : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0); break; - case 259: + case 256: addResult(ts.factory.createNamespaceExportDeclaration(ts.idText(node.name)), 0); break; - case 262: + case 259: addResult(ts.factory.createImportDeclaration(undefined, undefined, ts.factory.createImportClause(false, ts.factory.createIdentifier(localName), undefined), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0); break; - case 263: + case 260: addResult(ts.factory.createImportDeclaration(undefined, undefined, ts.factory.createImportClause(false, undefined, ts.factory.createNamespaceImport(ts.factory.createIdentifier(localName))), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0); break; - case 269: + case 266: addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamespaceExport(ts.factory.createIdentifier(localName)), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0); break; - case 265: + case 262: addResult(ts.factory.createImportDeclaration(undefined, undefined, ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([ ts.factory.createImportSpecifier(localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName)) ])), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0); break; - case 270: + case 267: var specifier = node.parent.parent.moduleSpecifier; serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.factory.createStringLiteral(specifier.text) : undefined); break; - case 266: + case 263: serializeMaybeAliasAssignment(symbol); break; - case 216: - case 201: - case 202: + case 213: + case 198: if (symbol.escapedName === "default" || symbol.escapedName === "export=") { serializeMaybeAliasAssignment(symbol); } @@ -40565,26 +39482,26 @@ var ts; var name = ts.unescapeLeadingUnderscores(symbol.escapedName); var isExportEquals = name === "export="; var isDefault = name === "default"; - var isExportAssignmentCompatibleSymbolName = isExportEquals || isDefault; + var isExportAssignment = isExportEquals || isDefault; var aliasDecl = symbol.declarations && getDeclarationOfAliasSymbol(symbol); var target = aliasDecl && getTargetOfAliasDeclaration(aliasDecl, true); if (target && ts.length(target.declarations) && ts.some(target.declarations, function (d) { return ts.getSourceFileOfNode(d) === ts.getSourceFileOfNode(enclosingDeclaration); })) { - var expr = aliasDecl && ((ts.isExportAssignment(aliasDecl) || ts.isBinaryExpression(aliasDecl)) ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl)); - var first_1 = expr && ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; + var expr = isExportAssignment ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl); + var first_1 = ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; var referenced = first_1 && resolveEntityName(first_1, 67108863, true, true, enclosingDeclaration); if (referenced || target) { includePrivateSymbol(referenced || target); } var oldTrack = context.tracker.trackSymbol; context.tracker.trackSymbol = ts.noop; - if (isExportAssignmentCompatibleSymbolName) { + if (isExportAssignment) { results.push(ts.factory.createExportAssignment(undefined, undefined, isExportEquals, symbolToExpression(target, context, 67108863))); } else { - if (first_1 === expr && first_1) { + if (first_1 === expr) { serializeExportSpecifier(name, ts.idText(first_1)); } - else if (expr && ts.isClassExpression(expr)) { + else if (ts.isClassExpression(expr)) { serializeExportSpecifier(name, getInternalSymbolName(target, ts.symbolName(target))); } else { @@ -40600,17 +39517,15 @@ var ts; var varName = getUnusedName(name, symbol); var typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol))); if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) { - serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 : 1); + serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignment ? 0 : 1); } else { var statement = ts.factory.createVariableStatement(undefined, ts.factory.createVariableDeclarationList([ ts.factory.createVariableDeclaration(varName, undefined, serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) ], 2)); - addResult(statement, target && target.flags & 4 && target.escapedName === "export=" ? 2 - : name === varName ? 1 - : 0); + addResult(statement, name === varName ? 1 : 0); } - if (isExportAssignmentCompatibleSymbolName) { + if (isExportAssignment) { results.push(ts.factory.createExportAssignment(undefined, undefined, isExportEquals, ts.factory.createIdentifier(varName))); return true; } @@ -40626,8 +39541,7 @@ var ts; return ts.getObjectFlags(typeToSerialize) & (16 | 32) && !getIndexInfoOfType(typeToSerialize, 0) && !getIndexInfoOfType(typeToSerialize, 1) && - !isClassInstanceSide(typeToSerialize) && - !!(ts.length(ts.filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || ts.length(getSignaturesOfType(typeToSerialize, 0))) && + !!(ts.length(getPropertiesOfType(typeToSerialize)) || ts.length(getSignaturesOfType(typeToSerialize, 0))) && !ts.length(getSignaturesOfType(typeToSerialize, 1)) && !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && ts.some(typeToSerialize.symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== ctxSrc; })) && @@ -40663,7 +39577,7 @@ var ts; } return result; } - else if (p.flags & (4 | 3 | 98304)) { + else if (p.flags & (4 | 3)) { return ts.setTextRange(createProperty(undefined, ts.factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 : 0) | flag), name, p.flags & 16777216 ? ts.factory.createToken(57) : undefined, isPrivate ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), undefined), ts.find(p.declarations, ts.or(ts.isPropertyDeclaration, ts.isVariableDeclaration)) || firstPropertyLikeDecl); } if (p.flags & (8192 | 16)) { @@ -40888,7 +39802,7 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { var node = ts.walkUpParenthesizedTypes(type.symbol.declarations[0].parent); - if (node.kind === 254) { + if (node.kind === 251) { return getSymbolOfNode(node); } } @@ -40896,11 +39810,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 257 && + node.parent.kind === 254 && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 297 || ts.isAmbientModule(location); + return location.kind === 294 || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -40948,17 +39862,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; } - if (declaration.parent && declaration.parent.kind === 249) { + if (declaration.parent && declaration.parent.kind === 246) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 221: - case 208: - case 209: + case 218: + case 205: + case 206: if (context && !context.encounteredError && !(context.flags & 131072)) { context.encounteredError = true; } - return declaration.kind === 221 ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 218 ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -40975,68 +39889,68 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 324: - case 331: - case 325: + case 320: + case 327: + case 321: return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 198: + case 195: return isDeclarationVisible(node.parent.parent); - case 249: + case 246: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 256: - case 252: case 253: - case 254: + case 249: + case 250: case 251: - case 255: - case 260: + case 248: + case 252: + case 257: if (ts.isExternalModuleAugmentation(node)) { return true; } var parent = getDeclarationContainer(node); if (!(ts.getCombinedModifierFlags(node) & 1) && - !(node.kind !== 260 && parent.kind !== 297 && parent.flags & 8388608)) { + !(node.kind !== 257 && parent.kind !== 294 && parent.flags & 8388608)) { return isGlobalSourceFile(parent); } return isDeclarationVisible(parent); - case 163: case 162: + case 161: + case 166: case 167: - case 168: - case 165: case 164: + case 163: if (ts.hasEffectiveModifier(node, 8 | 16)) { return false; } - case 166: - case 170: + case 165: case 169: - case 171: - case 160: - case 257: - case 174: - case 175: - case 177: - case 173: - case 178: - case 179: - case 182: - case 183: - case 186: - case 192: - return isDeclarationVisible(node.parent); - case 262: - case 263: - case 265: - return false; + case 168: + case 170: case 159: - case 297: + case 254: + case 173: + case 174: + case 176: + case 172: + case 177: + case 178: + case 181: + case 182: + case 185: + case 191: + return isDeclarationVisible(node.parent); case 259: + case 260: + case 262: + return false; + case 158: + case 294: + case 256: return true; - case 266: + case 263: return false; default: return false; @@ -41045,10 +39959,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 266) { + if (node.parent && node.parent.kind === 263) { exportSymbol = resolveName(node, node.escapedText, 111551 | 788968 | 1920 | 2097152, undefined, node, false); } - else if (node.parent.kind === 270) { + else if (node.parent.kind === 267) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 | 788968 | 1920 | 2097152); } var result; @@ -41136,12 +40050,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 249: - case 250: - case 265: - case 264: - case 263: + case 246: + case 247: case 262: + case 261: + case 260: + case 259: return false; default: return true; @@ -41210,13 +40124,9 @@ var ts; var propName = getDestructuringPropertyName(node); if (propName) { var literal = ts.setTextRange(ts.parseNodeFactory.createStringLiteral(propName), node); - var lhsExpr = ts.isLeftHandSideExpression(parentAccess) ? parentAccess : ts.parseNodeFactory.createParenthesizedExpression(parentAccess); - var result = ts.setTextRange(ts.parseNodeFactory.createElementAccessExpression(lhsExpr, literal), node); + var result = ts.setTextRange(ts.parseNodeFactory.createElementAccessExpression(parentAccess, literal), node); ts.setParent(literal, result); ts.setParent(result, node); - if (lhsExpr !== parentAccess) { - ts.setParent(lhsExpr, result); - } result.flowNode = parentAccess.flowNode; return result; } @@ -41225,23 +40135,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 198: - case 288: + case 195: + case 285: return getSyntheticElementAccess(ancestor); - case 199: + case 196: return getSyntheticElementAccess(node.parent); - case 249: + case 246: return ancestor.initializer; - case 216: + case 213: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 198 && parent.kind === 196) { + if (node.kind === 195 && parent.kind === 193) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 288 || node.kind === 289) { + if (node.kind === 285 || node.kind === 286) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -41263,7 +40173,7 @@ var ts; parentType = getTypeWithFacts(parentType, 524288); } var type; - if (pattern.kind === 196) { + if (pattern.kind === 193) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 || !isValidSpreadType(parentType)) { @@ -41282,12 +40192,12 @@ var ts; else { var name = declaration.propertyName || declaration.name; var indexType = getLiteralTypeFromPropertyName(name); - var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, undefined, name, undefined, undefined, 16), declaration.name); + var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, name), declaration.name); type = getFlowTypeOfDestructuring(declaration, declaredType); } } else { - var elementType = checkIteratedTypeOrElementType(65 | (declaration.dotDotDotToken ? 0 : 128), parentType, undefinedType, pattern); + var elementType = checkIteratedTypeOrElementType(65, parentType, undefinedType, pattern); var index_2 = pattern.elements.indexOf(declaration); if (declaration.dotDotDotToken) { type = everyType(parentType, isTupleType) ? @@ -41297,7 +40207,7 @@ var ts; else if (isArrayLikeType(parentType)) { var indexType = getLiteralType(index_2); var accessFlags = hasDefaultValue(declaration) ? 8 : 0; - var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, undefined, declaration.name, accessFlags | 16) || errorType, declaration.name); + var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, declaration.name, accessFlags) || errorType, declaration.name); type = getFlowTypeOfDestructuring(declaration, declaredType); } else { @@ -41327,18 +40237,18 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 199 && expr.elements.length === 0; + return expr.kind === 196 && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } return strictNullChecks && optional ? getOptionalType(type) : type; } function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 238) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 235) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 | 4194304) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 236) { var forOfStatement = declaration.parent.parent; return checkRightHandSideOfForOf(forOfStatement) || anyType; } @@ -41364,8 +40274,8 @@ var ts; } if (ts.isParameter(declaration)) { var func = declaration.parent; - if (func.kind === 168 && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 167); + if (func.kind === 167 && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 166); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -41418,11 +40328,10 @@ var ts; if (symbol.valueDeclaration && ts.isBinaryExpression(symbol.valueDeclaration)) { var links = getSymbolLinks(symbol); if (links.isConstructorDeclaredProperty === undefined) { - links.isConstructorDeclaredProperty = false; links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && ts.every(symbol.declarations, function (declaration) { return ts.isBinaryExpression(declaration) && - isPossiblyAliasedThisProperty(declaration) && - (declaration.left.kind !== 202 || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && + ts.getAssignmentDeclarationKind(declaration) === 4 && + (declaration.left.kind !== 199 || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(undefined, declaration, symbol, declaration); }); } @@ -41439,16 +40348,13 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; var container = ts.getThisContainer(declaration, false); - if (container && (container.kind === 166 || isJSConstructor(container))) { + if (container && (container.kind === 165 || isJSConstructor(container))) { return container; } } } function getFlowTypeInConstructor(symbol, constructor) { - var accessName = ts.startsWith(symbol.escapedName, "__#") - ? ts.factory.createPrivateIdentifier(symbol.escapedName.split("@")[1]) - : ts.unescapeLeadingUnderscores(symbol.escapedName); - var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), accessName); + var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), ts.unescapeLeadingUnderscores(symbol.escapedName)); ts.setParent(reference.expression, reference); ts.setParent(reference, constructor); reference.flowNode = constructor.returnFlowNode; @@ -41492,7 +40398,7 @@ var ts; var kind = ts.isAccessExpression(expression) ? ts.getAssignmentDeclarationPropertyAccessKind(expression) : ts.getAssignmentDeclarationKind(expression); - if (kind === 4 || ts.isBinaryExpression(expression) && isPossiblyAliasedThisProperty(expression, kind)) { + if (kind === 4) { if (isDeclarationInConstructor(expression)) { definedInConstructor = true; } @@ -41607,7 +40513,6 @@ var ts; var exportedType = resolveStructuredTypeMembers(type); var members_4 = ts.createSymbolTable(); ts.copyEntries(exportedType.members, members_4); - var initialSize = members_4.size; if (resolvedSymbol && !resolvedSymbol.exports) { resolvedSymbol.exports = ts.createSymbolTable(); } @@ -41636,11 +40541,8 @@ var ts; members_4.set(name, s); } }); - var result = createAnonymousType(initialSize !== members_4.size ? undefined : exportedType.symbol, members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo); + var result = createAnonymousType(exportedType.symbol, members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo); result.objectFlags |= (ts.getObjectFlags(type) & 16384); - if (result.symbol && result.symbol.flags & 32 && type === getDeclaredTypeOfClassOrInterface(result.symbol)) { - result.objectFlags |= 1073741824; - } return result; } if (isEmptyArrayLiteralType(type)) { @@ -41656,9 +40558,9 @@ var ts; } function isDeclarationInConstructor(expression) { var thisContainer = ts.getThisContainer(expression, false); - return thisContainer.kind === 166 || - thisContainer.kind === 251 || - (thisContainer.kind === 208 && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 165 || + thisContainer.kind === 248 || + (thisContainer.kind === 205 && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -41715,7 +40617,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var restElement = lastElement && lastElement.kind === 198 && lastElement.dotDotDotToken ? lastElement : undefined; + var restElement = lastElement && lastElement.kind === 195 && lastElement.dotDotDotToken ? lastElement : undefined; if (elements.length === 0 || elements.length === 1 && restElement) { return languageVersion >= 2 ? createIterableType(anyType) : anyArrayType; } @@ -41733,7 +40635,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 196 + return pattern.kind === 193 ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -41760,7 +40662,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 160 ? root.parent : root; + var memberDeclaration = root.kind === 159 ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -41813,7 +40715,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 266) { + if (declaration.kind === 263) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -41880,7 +40782,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 167) { + if (accessor.kind === 166) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -41914,15 +40816,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 167); + var getter = ts.getDeclarationOfKind(symbol, 166); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 167); - var setter = ts.getDeclarationOfKind(symbol, 168); + var getter = ts.getDeclarationOfKind(symbol, 166); + var setter = ts.getDeclarationOfKind(symbol, 167); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -41969,9 +40871,9 @@ var ts; var links = getSymbolLinks(symbol); var originalLinks = links; if (!links.type) { - var expando = symbol.valueDeclaration && getSymbolOfExpando(symbol.valueDeclaration, false); - if (expando) { - var merged = mergeJSSymbols(symbol, expando); + var jsDeclaration = symbol.valueDeclaration && ts.getDeclarationOfExpando(symbol.valueDeclaration); + if (jsDeclaration) { + var merged = mergeJSSymbols(symbol, getSymbolOfNode(jsDeclaration)); if (merged) { symbol = links = merged; } @@ -41985,9 +40887,9 @@ var ts; if (symbol.flags & 1536 && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration && (declaration.kind === 216 || + else if (declaration && (declaration.kind === 213 || ts.isAccessExpression(declaration) && - declaration.parent.kind === 216)) { + declaration.parent.kind === 213)) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -42047,7 +40949,7 @@ var ts; error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); return errorType; } - if (noImplicitAny && (declaration.kind !== 160 || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 159 || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } return anyType; @@ -42137,43 +41039,43 @@ var ts; return undefined; } switch (node.kind) { - case 232: - case 252: - case 221: - case 253: + case 229: + case 249: + case 218: + case 250: + case 168: case 169: - case 170: - case 164: + case 163: + case 173: case 174: - case 175: - case 308: + case 304: + case 248: + case 164: + case 205: + case 206: case 251: - case 165: - case 208: - case 209: - case 254: - case 330: - case 331: - case 325: - case 324: - case 190: - case 184: + case 326: + case 327: + case 321: + case 320: + case 189: + case 183: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 190) { + if (node.kind === 189) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 184) { + else if (node.kind === 183) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } - else if (node.kind === 232 && !ts.isInJSFile(node)) { + else if (node.kind === 229 && !ts.isInJSFile(node)) { break; } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 252 || node.kind === 221 || node.kind === 253 || isJSConstructor(node)) && + (node.kind === 249 || node.kind === 218 || node.kind === 250 || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; - case 326: + case 322: var paramSymbol = ts.getParameterSymbolFromJSDoc(node); if (paramSymbol) { node = paramSymbol.valueDeclaration; @@ -42183,7 +41085,7 @@ var ts; } } function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 253); + var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 250); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -42191,9 +41093,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 253 || - node.kind === 252 || - node.kind === 221 || + if (node.kind === 250 || + node.kind === 249 || + node.kind === 218 || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -42323,7 +41225,7 @@ var ts; if (!popTypeResolution()) { for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 252 || declaration.kind === 253) { + if (declaration.kind === 249 || declaration.kind === 250) { reportCircularBaseType(declaration, type); } } @@ -42403,7 +41305,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 253 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 250 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -42432,7 +41334,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 253) { + if (declaration.kind === 250) { if (declaration.flags & 128) { return false; } @@ -42509,7 +41411,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 216) { + else if (expr.kind === 213) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -42524,12 +41426,12 @@ var ts; case 8: case 14: return true; - case 214: + case 211: return expr.operator === 40 && expr.operand.kind === 8; case 78: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 216: + case 213: return isStringConcatExpression(expr); default: return false; @@ -42543,7 +41445,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 255) { + if (declaration.kind === 252) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -42570,7 +41472,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 255) { + if (declaration.kind === 252) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -42638,21 +41540,21 @@ var ts; function isThislessType(node) { switch (node.kind) { case 128: - case 152: + case 151: + case 146: + case 143: + case 154: + case 131: case 147: case 144: - case 155: - case 131: - case 148: - case 145: case 113: - case 150: - case 141: - case 191: + case 149: + case 140: + case 190: return true; - case 178: + case 177: return isThislessType(node.elementType); - case 173: + case 172: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -42668,7 +41570,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 166 || (!!returnType && isThislessType(returnType))) && + return (node.kind === 165 || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -42677,14 +41579,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 163: case 162: + case 161: return isThislessVariableLikeDeclaration(declaration); - case 165: case 164: + case 163: + case 165: case 166: case 167: - case 168: return isThislessFunctionLikeDeclaration(declaration); } } @@ -42818,7 +41720,7 @@ var ts; symbol.exports; links[resolutionKind] = earlySymbols || emptySymbols; var lateSymbols = ts.createSymbolTable(); - for (var _i = 0, _a = symbol.declarations || ts.emptyArray; _i < _a.length; _i++) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var members = ts.getMembersOfDeclaration(decl); if (members) { @@ -42837,7 +41739,7 @@ var ts; var member = decls_1[_c]; var assignmentKind = ts.getAssignmentDeclarationKind(member); var isInstanceMember = assignmentKind === 3 - || ts.isBinaryExpression(member) && isPossiblyAliasedThisProperty(member, assignmentKind) + || assignmentKind === 4 || assignmentKind === 9 || assignmentKind === 6; if (isStatic === !isInstanceMember && hasLateBindableName(member)) { @@ -42948,7 +41850,6 @@ var ts; sig.resolvedReturnType = resolvedReturnType; sig.resolvedTypePredicate = resolvedTypePredicate; sig.minArgumentCount = minArgumentCount; - sig.resolvedMinArgumentCount = undefined; sig.target = undefined; sig.mapper = undefined; sig.unionSignatures = undefined; @@ -43171,8 +42072,8 @@ var ts; function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; - for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { - var type = types_4[_i]; + for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { + var type = types_3[_i]; var indexInfo = getIndexInfoOfType(getApparentType(type), kind); if (!indexInfo) { return undefined; @@ -43350,6 +42251,9 @@ var ts; setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined); } function getLowerBoundOfKeyType(type) { + if (type.flags & (1 | 131068)) { + return type; + } if (type.flags & 4194304) { var t = getApparentType(type.type); return isGenericTupleType(t) ? getKnownKeysOfTupleType(t) : getIndexType(t); @@ -43370,7 +42274,7 @@ var ts; if (type.flags & 2097152) { return getIntersectionType(ts.sameMap(type.types, getLowerBoundOfKeyType)); } - return type; + return neverType; } function resolveMappedTypeMembers(type) { var members = ts.createSymbolTable(); @@ -43379,7 +42283,6 @@ var ts; setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); - var nameType = getNameTypeFromMappedType(type.target || type); var templateType = getTemplateTypeFromMappedType(type.target || type); var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); var templateModifiers = getMappedTypeModifiers(type); @@ -43400,20 +42303,17 @@ var ts; forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType); } setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); - function addMemberForKeyType(keyType) { - var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType; - forEachType(propNameType, function (t) { return addMemberForKeyTypeWorker(keyType, t); }); - } - function addMemberForKeyTypeWorker(keyType, propNameType) { - if (isTypeUsableAsPropertyName(propNameType)) { - var propName = getPropertyNameFromType(propNameType); + function addMemberForKeyType(t) { + var templateMapper = appendTypeMapping(type.mapper, typeParameter, t); + if (isTypeUsableAsPropertyName(t)) { + var propName = getPropertyNameFromType(t); var existingProp = members.get(propName); if (existingProp) { - existingProp.nameType = getUnionType([existingProp.nameType, propNameType]); - existingProp.keyType = getUnionType([existingProp.keyType, keyType]); + existingProp.nameType = getUnionType([existingProp.nameType, t]); + existingProp.mapper = appendTypeMapping(type.mapper, typeParameter, existingProp.nameType); } else { - var modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : undefined; + var modifiersProp = getPropertyOfType(modifiersType, propName); var isOptional = !!(templateModifiers & 4 || !(templateModifiers & 8) && modifiersProp && modifiersProp.flags & 16777216); var isReadonly = !!(templateModifiers & 1 || @@ -43421,19 +42321,19 @@ var ts; var stripOptional = strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216; var prop = createSymbol(4 | (isOptional ? 16777216 : 0), propName, 262144 | (isReadonly ? 8 : 0) | (stripOptional ? 524288 : 0)); prop.mappedType = type; - prop.nameType = propNameType; - prop.keyType = keyType; if (modifiersProp) { prop.syntheticOrigin = modifiersProp; prop.declarations = modifiersProp.declarations; } + prop.nameType = t; + prop.mapper = templateMapper; members.set(propName, prop); } } - else if (propNameType.flags & (1 | 4 | 8 | 32)) { - var propType = instantiateType(templateType, appendTypeMapping(type.mapper, typeParameter, keyType)); - if (propNameType.flags & (1 | 4)) { - stringIndexInfo = createIndexInfo(stringIndexInfo ? getUnionType([stringIndexInfo.type, propType]) : propType, !!(templateModifiers & 1)); + else if (t.flags & (1 | 4 | 8 | 32)) { + var propType = instantiateType(templateType, templateMapper); + if (t.flags & (1 | 4)) { + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1)); } else { numberIndexInfo = createIndexInfo(numberIndexInfo ? getUnionType([numberIndexInfo.type, propType]) : propType, !!(templateModifiers & 1)); @@ -43443,22 +42343,21 @@ var ts; } function getTypeOfMappedSymbol(symbol) { if (!symbol.type) { - var mappedType = symbol.mappedType; if (!pushTypeResolution(symbol, 0)) { - mappedType.containsError = true; + symbol.mappedType.containsError = true; return errorType; } - var templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType); - var mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.keyType); - var propType = instantiateType(templateType, mapper); + var templateType = getTemplateTypeFromMappedType(symbol.mappedType.target || symbol.mappedType); + var propType = instantiateType(templateType, symbol.mapper); var type = strictNullChecks && symbol.flags & 16777216 && !maybeTypeOfKind(propType, 32768 | 16384) ? getOptionalType(propType) : symbol.checkFlags & 524288 ? getTypeWithFacts(propType, 524288) : propType; if (!popTypeResolution()) { - error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType)); + error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(symbol.mappedType)); type = errorType; } symbol.type = type; + symbol.mapper = undefined; } return symbol.type; } @@ -43470,11 +42369,6 @@ var ts; return type.constraintType || (type.constraintType = getConstraintOfTypeParameter(getTypeParameterFromMappedType(type)) || errorType); } - function getNameTypeFromMappedType(type) { - return type.declaration.nameType ? - type.nameType || (type.nameType = instantiateType(getTypeFromTypeNode(type.declaration.nameType), type.mapper)) : - undefined; - } function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? @@ -43486,8 +42380,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); - return constraintDeclaration.kind === 188 && - constraintDeclaration.operator === 138; + return constraintDeclaration.kind === 187 && + constraintDeclaration.operator === 137; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -43609,8 +42503,8 @@ var ts; return getAugmentedPropertiesOfType(unionType); } var props = ts.createSymbolTable(); - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var memberType = types_5[_i]; + for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { + var memberType = types_4[_i]; for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) { var escapedName = _b[_a].escapedName; if (!props.has(escapedName)) { @@ -43641,14 +42535,14 @@ var ts; function getConstraintFromIndexedAccess(type) { var indexConstraint = getSimplifiedTypeOrConstraint(type.indexType); if (indexConstraint && indexConstraint !== type.indexType) { - var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.noUncheckedIndexedAccessCandidate); + var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint); if (indexedAccess) { return indexedAccess; } } var objectConstraint = getSimplifiedTypeOrConstraint(type.objectType); if (objectConstraint && objectConstraint !== type.objectType) { - return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType, type.noUncheckedIndexedAccessCandidate); + return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType); } return undefined; } @@ -43682,9 +42576,9 @@ var ts; function getEffectiveConstraintOfIntersection(types, targetIsUnion) { var constraints; var hasDisjointDomainType = false; - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var t = types_6[_i]; - if (t.flags & 465829888) { + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var t = types_5[_i]; + if (t.flags & 63176704) { var constraint = getConstraintOfType(t); while (constraint && constraint.flags & (262144 | 4194304 | 16777216)) { constraint = getConstraintOfType(constraint); @@ -43696,15 +42590,15 @@ var ts; } } } - else if (t.flags & 469892092) { + else if (t.flags & 67238908) { hasDisjointDomainType = true; } } if (constraints && (targetIsUnion || hasDisjointDomainType)) { if (hasDisjointDomainType) { - for (var _a = 0, types_7 = types; _a < types_7.length; _a++) { - var t = types_7[_a]; - if (t.flags & 469892092) { + for (var _a = 0, types_6 = types; _a < types_6.length; _a++) { + var t = types_6[_a]; + if (t.flags & 67238908) { constraints = ts.append(constraints, t); } } @@ -43714,7 +42608,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (58982400 | 3145728 | 134217728 | 268435456)) { + if (type.flags & (58982400 | 3145728)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -43727,31 +42621,22 @@ var ts; return getResolvedBaseConstraint(type) !== circularConstraintType; } function getResolvedBaseConstraint(type) { - if (type.resolvedBaseConstraint) { - return type.resolvedBaseConstraint; - } var nonTerminating = false; - var stack = []; - return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type); + return type.resolvedBaseConstraint || + (type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type)); function getImmediateBaseConstraint(t) { if (!t.immediateBaseConstraint) { if (!pushTypeResolution(t, 4)) { return circularConstraintType; } if (constraintDepth >= 50) { - ts.tracing.instant("check", "getImmediateBaseConstraint_DepthLimit", { typeId: t.id, originalTypeId: type.id, depth: constraintDepth }); error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); nonTerminating = true; return t.immediateBaseConstraint = noConstraintType; } - var result = void 0; - if (!isDeeplyNestedType(t, stack, stack.length)) { - stack.push(t); - constraintDepth++; - result = computeBaseConstraint(getSimplifiedType(t, false)); - constraintDepth--; - stack.pop(); - } + constraintDepth++; + var result = computeBaseConstraint(getSimplifiedType(t, false)); + constraintDepth--; if (!popTypeResolution()) { if (t.flags & 262144) { var errorNode = getConstraintDeclaration(t); @@ -43785,8 +42670,8 @@ var ts; if (t.flags & 3145728) { var types = t.types; var baseTypes = []; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var type_3 = types_8[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var type_3 = types_7[_i]; var baseType = getBaseConstraint(type_3); if (baseType) { baseTypes.push(baseType); @@ -43799,19 +42684,10 @@ var ts; if (t.flags & 4194304) { return keyofConstraintType; } - if (t.flags & 134217728) { - var types = t.types; - var constraints = ts.mapDefined(types, getBaseConstraint); - return constraints.length === types.length ? getTemplateLiteralType(t.texts, constraints) : stringType; - } - if (t.flags & 268435456) { - var constraint = getBaseConstraint(t.type); - return constraint ? getStringMappingType(t.symbol, constraint) : stringType; - } if (t.flags & 8388608) { var baseObjectType = getBaseConstraint(t.objectType); var baseIndexType = getBaseConstraint(t.indexType); - var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t.noUncheckedIndexedAccessCandidate); + var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType); return baseIndexedAccess && getBaseConstraint(baseIndexedAccess); } if (t.flags & 16777216) { @@ -43865,7 +42741,7 @@ var ts; } function getResolvedApparentTypeOfMappedType(type) { var typeVariable = getHomomorphicTypeVariable(type); - if (typeVariable && !type.declaration.nameType) { + if (typeVariable) { var constraint = getConstraintOfTypeParameter(typeVariable); if (constraint && (isArrayType(constraint) || isTupleType(constraint))) { return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper)); @@ -43874,10 +42750,10 @@ var ts; return type; } function getApparentType(type) { - var t = type.flags & 465829888 ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 63176704 ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 ? getApparentTypeOfMappedType(t) : t.flags & 2097152 ? getApparentTypeOfIntersectionType(t) : - t.flags & 402653316 ? globalStringType : + t.flags & 132 ? globalStringType : t.flags & 296 ? globalNumberType : t.flags & 2112 ? getGlobalBigIntType(languageVersion >= 7) : t.flags & 528 ? globalBooleanType : @@ -44158,10 +43034,10 @@ var ts; return result; } function isJSDocOptionalParameter(node) { - return ts.isInJSFile(node) && (node.type && node.type.kind === 307 + return ts.isInJSFile(node) && (node.type && node.type.kind === 303 || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 307; + return isBracketed || !!typeExpression && typeExpression.type.kind === 303; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -44179,7 +43055,7 @@ var ts; var signature = getSignatureFromDeclaration(node.parent); var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); - return parameterIndex >= getMinArgumentCount(signature, 1 | 2); + return parameterIndex >= getMinArgumentCount(signature, true); } var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); if (iife) { @@ -44194,7 +43070,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 307; + return isBracketed || !!typeExpression && typeExpression.type.kind === 303; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -44267,7 +43143,7 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 191) { + if (type && type.kind === 190) { flags |= 2; } var isOptionalParameter_1 = isOptionalJSDocPropertyLikeTag(param) || @@ -44278,16 +43154,16 @@ var ts; minArgumentCount = parameters.length; } } - if ((declaration.kind === 167 || declaration.kind === 168) && + if ((declaration.kind === 166 || declaration.kind === 167) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 167 ? 168 : 167; + var otherKind = declaration.kind === 166 ? 167 : 166; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 166 ? + var classType = declaration.kind === 165 ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -44343,11 +43219,11 @@ var ts; switch (node.kind) { case 78: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 163: - case 165: + case 162: + case 164: + case 166: case 167: - case 168: - return node.name.kind === 158 + return node.name.kind === 157 && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -44416,7 +43292,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 187 ? + return parameterName.kind === 186 ? createTypePredicate(node.assertsModifier ? 2 : 0, undefined, undefined, type) : createTypePredicate(node.assertsModifier ? 3 : 1, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -44459,7 +43335,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 166) { + if (declaration.kind === 165) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -44469,12 +43345,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 167 && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 166 && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 168); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 167); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -44553,7 +43429,7 @@ var ts; function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0; - var isConstructor = kind === 166 || kind === 170 || kind === 175; + var isConstructor = kind === 165 || kind === 169 || kind === 174; var type = createObjectType(16); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -44567,7 +43443,7 @@ var ts; return symbol.members.get("__index"); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 144 : 147; + var syntaxKind = kind === 1 ? 143 : 146; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -44601,13 +43477,13 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 185) { - var _b = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _c = _b[0], childTypeParameter = _c === void 0 ? declaration.parent : _c, grandParent = _b[1]; - if (grandParent.kind === 173) { + if (declaration.parent.kind === 184) { + var grandParent = declaration.parent.parent; + if (grandParent.kind === 172) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { - var index = typeReference.typeArguments.indexOf(childTypeParameter); + var index = typeReference.typeArguments.indexOf(declaration.parent); if (index < typeParameters.length) { var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); if (declaredConstraint) { @@ -44620,14 +43496,11 @@ var ts; } } } - else if (grandParent.kind === 160 && grandParent.dotDotDotToken || - grandParent.kind === 181 || - grandParent.kind === 192 && grandParent.dotDotDotToken) { + else if (grandParent.kind === 159 && grandParent.dotDotDotToken || + grandParent.kind === 180 || + grandParent.kind === 191 && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } - else if (grandParent.kind === 194) { - inferences = ts.append(inferences, stringType); - } } } } @@ -44647,7 +43520,7 @@ var ts; else { var type = getTypeFromTypeNode(constraintDeclaration); if (type.flags & 1 && type !== errorType) { - type = constraintDeclaration.parent.parent.kind === 190 ? keyofConstraintType : unknownType; + type = constraintDeclaration.parent.parent.kind === 189 ? keyofConstraintType : unknownType; } typeParameter.constraint = type; } @@ -44656,7 +43529,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 159); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 158); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -44685,8 +43558,8 @@ var ts; } function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var type = types_9[_i]; + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; if (!(type.flags & excludeKinds)) { result |= ts.getObjectFlags(type); } @@ -44732,8 +43605,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 173 ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 178 ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 172 ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 177 ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -44771,7 +43644,7 @@ var ts; return errorType; } } - if (node.kind === 173 && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 172 && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, undefined); } var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgumentsFromTypeReferenceNode(node), typeParameters, minTypeArgumentCount, isJs)); @@ -44781,9 +43654,6 @@ var ts; } function getTypeAliasInstantiation(symbol, typeArguments) { var type = getDeclaredTypeOfSymbol(symbol); - if (type === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName) && typeArguments && typeArguments.length === 1) { - return getStringMappingType(symbol, typeArguments[0]); - } var links = getSymbolLinks(symbol); var typeParameters = links.typeParameters; var id = getTypeListId(typeArguments); @@ -44811,9 +43681,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 173: + case 172: return node.typeName; - case 223: + case 220: var expr = node.expression; if (ts.isEntityNameExpression(expr)) { return expr; @@ -44860,8 +43730,17 @@ var ts; var valueType = getTypeOfSymbol(symbol); var typeType = valueType; if (symbol.valueDeclaration) { - var isImportTypeWithQualifier = node.kind === 195 && node.qualifier; - if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) { + var decl = ts.getRootDeclaration(symbol.valueDeclaration); + var isRequireAlias = false; + if (ts.isVariableDeclaration(decl) && decl.initializer) { + var expr = decl.initializer; + while (ts.isPropertyAccessExpression(expr)) { + expr = expr.expression; + } + isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, true) && !!valueType.symbol; + } + var isImportTypeWithQualifier = node.kind === 192 && node.qualifier; + if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); } } @@ -44885,7 +43764,7 @@ var ts; return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 179 && node.elements.length === 1; + return node.kind === 178 && node.elements.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) : @@ -44894,9 +43773,9 @@ var ts; } function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 311) { + while (node && !ts.isStatement(node) && node.kind !== 307) { var parent = node.parent; - if (parent.kind === 184 && node === parent.trueType) { + if (parent.kind === 183 && node === parent.trueType) { var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); @@ -44907,7 +43786,7 @@ var ts; return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304) && (node.kind === 173 || node.kind === 195); + return !!(node.flags & 4194304) && (node.kind === 172 || node.kind === 192); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -45013,9 +43892,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { + case 249: + case 250: case 252: - case 253: - case 255: return declaration; } } @@ -45132,11 +44011,11 @@ var ts; } function getTupleElementFlags(node) { switch (node.kind) { - case 180: + case 179: return 2; - case 181: + case 180: return getRestTypeElementFlags(node); - case 192: + case 191: return node.questionToken ? 2 : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1; @@ -45154,57 +44033,57 @@ var ts; return readonly ? globalReadonlyArrayType : globalArrayType; } var elementFlags = ts.map(node.elements, getTupleElementFlags); - var missingName = ts.some(node.elements, function (e) { return e.kind !== 192; }); + var missingName = ts.some(node.elements, function (e) { return e.kind !== 191; }); return getTupleTargetType(elementFlags, readonly, missingName ? undefined : node.elements); } function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 178 ? mayResolveTypeAlias(node.elementType) : - node.kind === 179 ? ts.some(node.elements, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 177 ? mayResolveTypeAlias(node.elementType) : + node.kind === 178 ? ts.some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 186: - case 192: - case 173: + case 185: + case 191: + case 172: + case 181: case 182: - case 183: - case 189: - case 184: case 188: + case 183: + case 187: + case 177: case 178: - case 179: return isResolvedByTypeAlias(parent); - case 254: + case 251: return true; } return false; } function mayResolveTypeAlias(node) { switch (node.kind) { - case 173: + case 172: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968).flags & 524288); - case 176: + case 175: return true; - case 188: - return node.operator !== 151 && mayResolveTypeAlias(node.type); - case 186: - case 180: - case 192: - case 307: - case 305: - case 306: + case 187: + return node.operator !== 150 && mayResolveTypeAlias(node.type); + case 185: + case 179: + case 191: + case 303: case 301: + case 302: + case 298: return mayResolveTypeAlias(node.type); + case 180: + return node.type.kind !== 177 || mayResolveTypeAlias(node.type.elementType); case 181: - return node.type.kind !== 178 || mayResolveTypeAlias(node.type.elementType); case 182: - case 183: return ts.some(node.types, mayResolveTypeAlias); - case 189: + case 188: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 184: + case 183: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -45217,19 +44096,19 @@ var ts; if (target === emptyGenericType) { links.resolvedType = emptyObjectType; } - else if (!(node.kind === 179 && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8); })) && isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 179 && node.elements.length === 0 ? target : + else if (!(node.kind === 178 && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8); })) && isDeferredTypeReferenceNode(node)) { + links.resolvedType = node.kind === 178 && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, undefined); } else { - var elementTypes = node.kind === 178 ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); + var elementTypes = node.kind === 177 ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); links.resolvedType = createNormalizedTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 142; + return ts.isTypeOperatorNode(node) && node.operator === 141; } function createTupleType(elementTypes, elementFlags, readonly, namedMemberDeclarations) { if (readonly === void 0) { readonly = false; } @@ -45317,9 +44196,7 @@ var ts; var _a, _b, _c; var unionIndex = ts.findIndex(elementTypes, function (t, i) { return !!(target.elementFlags[i] & 8 && t.flags & (131072 | 1048576)); }); if (unionIndex >= 0) { - return checkCrossProductUnion(ts.map(elementTypes, function (t, i) { return target.elementFlags[i] & 8 ? t : unknownType; })) ? - mapType(elementTypes[unionIndex], function (t) { return createNormalizedTupleType(target, ts.replaceElement(elementTypes, unionIndex, t)); }) : - errorType; + return mapType(elementTypes[unionIndex], function (t) { return createNormalizedTupleType(target, ts.replaceElement(elementTypes, unionIndex, t)); }); } var spreadIndex = ts.findIndex(elementTypes, function (t, i) { return !!(target.elementFlags[i] & 8) && !(t.flags & 58982400) && !isGenericMappedType(t); }); if (spreadIndex < 0) { @@ -45421,8 +44298,8 @@ var ts; return addTypesToUnion(typeSet, includes, type.types); } if (!(flags & 131072)) { - includes |= flags & 205258751; - if (flags & 469499904) + includes |= flags & 71041023; + if (flags & 66846720) includes |= 262144; if (type === wildcardType) includes |= 8388608; @@ -45441,8 +44318,8 @@ var ts; return includes; } function addTypesToUnion(typeSet, includes, types) { - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var type = types_10[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var type = types_9[_i]; includes = addTypeToUnion(typeSet, includes, type); } return includes; @@ -45471,13 +44348,12 @@ var ts; while (i > 0) { i--; var source = types[i]; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var target = types_11[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var target = types_10[_i]; if (source !== target) { if (count === 100000) { var estimatedCount = (count / (len - i)) * len; if (estimatedCount > (primitivesOnly ? 25000000 : 1000000)) { - ts.tracing.instant("check", "removeSubtypes_DepthLimit", { typeIds: types.map(function (t) { return t.id; }) }); error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return false; } @@ -45509,22 +44385,6 @@ var ts; } } } - function removeStringLiteralsMatchedByTemplateLiterals(types) { - var templates = ts.filter(types, isPatternLiteralType); - if (templates.length) { - var i = types.length; - var _loop_14 = function () { - i--; - var t = types[i]; - if (t.flags & 128 && ts.some(templates, function (template) { return isTypeSubtypeOf(t, template); })) { - ts.orderedRemoveItemAt(types, i); - } - }; - while (i > 0) { - _loop_14(); - } - } - } function getUnionType(types, unionReduction, aliasSymbol, aliasTypeArguments) { if (unionReduction === void 0) { unionReduction = 1; } if (types.length === 0) { @@ -45544,9 +44404,6 @@ var ts; if (includes & (2944 | 8192)) { removeRedundantLiteralTypes(typeSet, includes); } - if (includes & 128 && includes & 134217728) { - removeStringLiteralsMatchedByTemplateLiterals(typeSet); - } break; case 2: if (!removeSubtypes(typeSet, !(includes & 262144))) { @@ -45560,7 +44417,7 @@ var ts; neverType; } } - var objectFlags = (includes & 469647395 ? 0 : 262144) | + var objectFlags = (includes & 66994211 ? 0 : 262144) | (includes & 2097152 ? 268435456 : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -45641,13 +44498,13 @@ var ts; } typeSet.set(type.id.toString(), type); } - includes |= flags & 205258751; + includes |= flags & 71041023; } return includes; } function addTypesToIntersection(typeSet, includes, types) { - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var type = types_12[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var type = types_11[_i]; includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); } return includes; @@ -45682,27 +44539,6 @@ var ts; } return true; } - function extractRedundantTemplateLiterals(types) { - var i = types.length; - var literals = ts.filter(types, function (t) { return !!(t.flags & 128); }); - while (i > 0) { - i--; - var t = types[i]; - if (!(t.flags & 134217728)) - continue; - for (var _i = 0, literals_1 = literals; _i < literals_1.length; _i++) { - var t2 = literals_1[_i]; - if (isTypeSubtypeOf(t2, t)) { - ts.orderedRemoveItemAt(types, i); - break; - } - else if (isPatternLiteralType(t)) { - return true; - } - } - } - return false; - } function extractIrreducible(types, flag) { if (ts.every(types, function (t) { return !!(t.flags & 1048576) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) { for (var i = 0; i < types.length; i++) { @@ -45762,15 +44598,12 @@ var ts; var typeSet = ts.arrayFrom(typeMembershipMap.values()); if (includes & 131072 || strictNullChecks && includes & 98304 && includes & (524288 | 67108864 | 16777216) || - includes & 67108864 && includes & (469892092 & ~67108864) || - includes & 402653316 && includes & (469892092 & ~402653316) || - includes & 296 && includes & (469892092 & ~296) || - includes & 2112 && includes & (469892092 & ~2112) || - includes & 12288 && includes & (469892092 & ~12288) || - includes & 49152 && includes & (469892092 & ~49152)) { - return neverType; - } - if (includes & 134217728 && includes & 128 && extractRedundantTemplateLiterals(typeSet)) { + includes & 67108864 && includes & (67238908 & ~67108864) || + includes & 132 && includes & (67238908 & ~132) || + includes & 296 && includes & (67238908 & ~296) || + includes & 2112 && includes & (67238908 & ~2112) || + includes & 12288 && includes & (67238908 & ~12288) || + includes & 49152 && includes & (67238908 & ~49152)) { return neverType; } if (includes & 1) { @@ -45808,7 +44641,9 @@ var ts; result = getUnionType([getIntersectionType(typeSet), nullType], 1, aliasSymbol, aliasTypeArguments); } else { - if (!checkCrossProductUnion(typeSet)) { + var size = ts.reduceLeft(typeSet, function (n, t) { return n * (t.flags & 1048576 ? t.types.length : 1); }, 1); + if (size >= 100000) { + error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return errorType; } var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 1048576) !== 0; }); @@ -45823,15 +44658,6 @@ var ts; } return result; } - function checkCrossProductUnion(types) { - var size = ts.reduceLeft(types, function (n, t) { return n * (t.flags & 1048576 ? t.types.length : t.flags & 131072 ? 0 : 1); }, 1); - if (size >= 100000) { - ts.tracing.instant("check", "checkCrossProductUnion_DepthLimit", { typeIds: types.map(function (t) { return t.id; }), size: size }); - error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); - return false; - } - return true; - } function getTypeFromIntersectionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -45851,20 +44677,6 @@ var ts; type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, true)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, false)); } - function getIndexTypeForMappedType(type, noIndexSignatures) { - var constraint = filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 | 4)); }); - var nameType = type.declaration.nameType && getTypeFromTypeNode(type.declaration.nameType); - return nameType ? - mapType(constraint, function (t) { return instantiateType(nameType, appendTypeMapping(type.mapper, getTypeParameterFromMappedType(type), t)); }) : - constraint; - } - function isNonDistributiveNameType(type) { - return !!(type && (type.flags & 16777216 && !type.root.isDistributive || - type.flags & (3145728 | 134217728) && ts.some(type.types, isNonDistributiveNameType) || - type.flags & (4194304 | 268435456) && isNonDistributiveNameType(type.type) || - type.flags & 8388608 && isNonDistributiveNameType(type.indexType) || - type.flags & 33554432 && isNonDistributiveNameType(type.substitute))); - } function getLiteralTypeFromPropertyName(name) { if (ts.isPrivateIdentifier(name)) { return neverType; @@ -45908,8 +44720,8 @@ var ts; type = getReducedType(type); return type.flags & 1048576 ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - type.flags & 58982400 || isGenericTupleType(type) || isGenericMappedType(type) && isNonDistributiveNameType(getNameTypeFromMappedType(type)) ? getIndexTypeForGenericType(type, stringsOnly) : - ts.getObjectFlags(type) & 32 ? getIndexTypeForMappedType(type, noIndexSignatures) : + type.flags & 58982400 || isGenericTupleType(type) ? getIndexTypeForGenericType(type, stringsOnly) : + ts.getObjectFlags(type) & 32 ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 | 4)); }) : type === wildcardType ? wildcardType : type.flags & 2 ? neverType : type.flags & (1 | 131072) ? keyofConstraintType : @@ -45933,15 +44745,15 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 138: + case 137: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 151: - links.resolvedType = node.type.kind === 148 + case 150: + links.resolvedType = node.type.kind === 147 ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 142: + case 141: links.resolvedType = getTypeFromTypeNode(node.type); break; default: @@ -45950,115 +44762,12 @@ var ts; } return links.resolvedType; } - function getTypeFromTemplateTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getTemplateLiteralType(__spreadArrays([node.head.text], ts.map(node.templateSpans, function (span) { return span.literal.text; })), ts.map(node.templateSpans, function (span) { return getTypeFromTypeNode(span.type); })); - } - return links.resolvedType; - } - function getTemplateLiteralType(texts, types) { - var unionIndex = ts.findIndex(types, function (t) { return !!(t.flags & (131072 | 1048576)); }); - if (unionIndex >= 0) { - return checkCrossProductUnion(types) ? - mapType(types[unionIndex], function (t) { return getTemplateLiteralType(texts, ts.replaceElement(types, unionIndex, t)); }) : - errorType; - } - if (ts.contains(types, wildcardType)) { - return wildcardType; - } - var newTypes = []; - var newTexts = []; - var text = texts[0]; - if (!addSpans(texts, types)) { - return stringType; - } - if (newTypes.length === 0) { - return getLiteralType(text); - } - newTexts.push(text); - var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join(""); - var type = templateLiteralTypes.get(id); - if (!type) { - templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes)); - } - return type; - function addSpans(texts, types) { - for (var i = 0; i < types.length; i++) { - var t = types[i]; - if (t.flags & (2944 | 65536 | 32768)) { - text += getTemplateStringForType(t) || ""; - text += texts[i + 1]; - } - else if (t.flags & 134217728) { - text += t.texts[0]; - if (!addSpans(t.texts, t.types)) - return false; - text += texts[i + 1]; - } - else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) { - newTypes.push(t); - newTexts.push(text); - text = texts[i + 1]; - } - else { - return false; - } - } - return true; - } - } - function getTemplateStringForType(type) { - return type.flags & 128 ? type.value : - type.flags & 256 ? "" + type.value : - type.flags & 2048 ? ts.pseudoBigIntToString(type.value) : - type.flags & 512 ? type.intrinsicName : - type.flags & 65536 ? "null" : - type.flags & 32768 ? "undefined" : - undefined; - } - function createTemplateLiteralType(texts, types) { - var type = createType(134217728); - type.texts = texts; - type.types = types; - return type; - } - function getStringMappingType(symbol, type) { - return type.flags & (1048576 | 131072) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) : - isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) : - type.flags & 128 ? getLiteralType(applyStringMapping(symbol, type.value)) : - type; - } - function applyStringMapping(symbol, str) { - switch (intrinsicTypeKinds.get(symbol.escapedName)) { - case 0: return str.toUpperCase(); - case 1: return str.toLowerCase(); - case 2: return str.charAt(0).toUpperCase() + str.slice(1); - case 3: return str.charAt(0).toLowerCase() + str.slice(1); - } - return str; - } - function getStringMappingTypeForGenericType(symbol, type) { - var id = getSymbolId(symbol) + "," + getTypeId(type); - var result = stringMappingTypes.get(id); - if (!result) { - stringMappingTypes.set(id, result = createStringMappingType(symbol, type)); - } - return result; - } - function createStringMappingType(symbol, type) { - var result = createType(268435456); - result.symbol = symbol; - result.type = type; - return result; - } - function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined) { + function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments) { var type = createType(8388608); type.objectType = objectType; type.indexType = indexType; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; - type.noUncheckedIndexedAccessCandidate = shouldIncludeUndefined; return type; } function isJSLiteralType(type) { @@ -46074,13 +44783,13 @@ var ts; if (type.flags & 2097152) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 465829888) { + if (type.flags & 63176704) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 202 ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 199 ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, false) ? @@ -46094,15 +44803,15 @@ var ts; || !ts.isCallLikeExpression(ts.findAncestor(node, function (n) { return !ts.isAccessExpression(n); }) || node.parent) && ts.every(symbol.declarations, function (d) { return !ts.isFunctionLike(d) || !!(ts.getCombinedNodeFlags(d) & 134217728); }); } - function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, noUncheckedIndexedAccessCandidate, reportDeprecated) { - var _a; - var accessExpression = accessNode && accessNode.kind === 202 ? accessNode : undefined; + function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, reportDeprecated) { + var _a, _b; + var accessExpression = accessNode && accessNode.kind === 199 ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); if (prop) { - if (reportDeprecated && accessNode && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 && isUncalledFunctionReference(accessNode, prop)) { - var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); + if (reportDeprecated && accessNode && ((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.flags) & 134217728 && isUncalledFunctionReference(accessNode, prop)) { + var deprecatedNode = (_b = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _b !== void 0 ? _b : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); errorOrSuggestion(false, deprecatedNode, ts.Diagnostics._0_is_deprecated, propName); } if (accessExpression) { @@ -46134,13 +44843,10 @@ var ts; } } errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, 1)); - return mapType(objectType, function (t) { - var restType = getRestTypeOfTupleType(t) || undefinedType; - return noUncheckedIndexedAccessCandidate ? getUnionType([restType, undefinedType]) : restType; - }); + return mapType(objectType, function (t) { return getRestTypeOfTupleType(t) || undefinedType; }); } } - if (!(indexType.flags & 98304) && isTypeAssignableToKind(indexType, 402653316 | 296 | 12288)) { + if (!(indexType.flags & 98304) && isTypeAssignableToKind(indexType, 132 | 296 | 12288)) { if (objectType.flags & (1 | 131072)) { return objectType; } @@ -46156,10 +44862,10 @@ var ts; if (accessNode && !isTypeAssignableToKind(indexType, 4 | 8)) { var indexNode = getIndexNodeForAccessExpression(accessNode); error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); - return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + return indexInfo.type; } errorIfWritingToReadonlyIndex(indexInfo); - return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + return indexInfo.type; } if (indexType.flags & 131072) { return neverType; @@ -46243,17 +44949,11 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 202 ? accessNode.argumentExpression : - accessNode.kind === 189 ? accessNode.indexType : - accessNode.kind === 158 ? accessNode.expression : + return accessNode.kind === 199 ? accessNode.argumentExpression : + accessNode.kind === 188 ? accessNode.indexType : + accessNode.kind === 157 ? accessNode.expression : accessNode; } - function isPatternLiteralPlaceholderType(type) { - return templateConstraintType.types.indexOf(type) !== -1 || !!(type.flags & 1); - } - function isPatternLiteralType(type) { - return !!(type.flags & 134217728) && ts.every(type.types, isPatternLiteralPlaceholderType); - } function isGenericObjectType(type) { if (type.flags & 3145728) { if (!(type.objectFlags & 4194304)) { @@ -46272,7 +44972,7 @@ var ts; } return !!(type.objectFlags & 33554432); } - return !!(type.flags & (58982400 | 4194304 | 134217728 | 268435456)) && !isPatternLiteralType(type); + return !!(type.flags & (58982400 | 4194304)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 && type.isThisType); @@ -46312,7 +45012,7 @@ var ts; if (distributedOverIndex) { return type[cache] = distributedOverIndex; } - if (!(indexType.flags & 465829888)) { + if (!(indexType.flags & 63176704)) { var distributedOverObject = distributeIndexOverObjectType(objectType, indexType, writing); if (distributedOverObject) { return type[cache] = distributedOverObject; @@ -46360,9 +45060,8 @@ var ts; var templateMapper = combineTypeMappers(objectType.mapper, mapper); return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); } - function getIndexedAccessType(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, aliasSymbol, aliasTypeArguments, accessFlags) { - if (accessFlags === void 0) { accessFlags = 0; } - return getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType); + function getIndexedAccessType(objectType, indexType, accessNode, aliasSymbol, aliasTypeArguments) { + return getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, 0, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType); } function indexTypeLessThan(indexType, limit) { return everyType(indexType, function (t) { @@ -46376,27 +45075,24 @@ var ts; return false; }); } - function getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) { + function getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) { if (accessFlags === void 0) { accessFlags = 0; } if (objectType === wildcardType || indexType === wildcardType) { return wildcardType; } - var shouldIncludeUndefined = noUncheckedIndexedAccessCandidate || - (!!compilerOptions.noUncheckedIndexedAccess && - (accessFlags & (2 | 16)) === 16); if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304) && isTypeAssignableToKind(indexType, 4 | 8)) { indexType = stringType; } - if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 189 ? + if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 188 ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) { if (objectType.flags & 3) { return objectType; } - var id = objectType.id + "," + indexType.id + (shouldIncludeUndefined ? "?" : ""); + var id = objectType.id + "," + indexType.id; var type = indexedAccessTypes.get(id); if (!type) { - indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined)); + indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments)); } return type; } @@ -46406,7 +45102,7 @@ var ts; var wasMissingProp = false; for (var _i = 0, _a = indexType.types; _i < _a.length; _i++) { var t = _a[_i]; - var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags, shouldIncludeUndefined); + var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags); if (propType) { propTypes.push(propType); } @@ -46420,11 +45116,9 @@ var ts; if (wasMissingProp) { return undefined; } - return accessFlags & 2 - ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) - : getUnionType(propTypes, 1, aliasSymbol, aliasTypeArguments); + return accessFlags & 2 ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1, aliasSymbol, aliasTypeArguments); } - return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, false, accessNode, accessFlags | 4, shouldIncludeUndefined, true); + return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, false, accessNode, accessFlags | 4, true); } function getTypeFromIndexedAccessTypeNode(node) { var links = getNodeLinks(node); @@ -46432,7 +45126,7 @@ var ts; var objectType = getTypeFromTypeNode(node.objectType); var indexType = getTypeFromTypeNode(node.indexType); var potentialAlias = getAliasSymbolForTypeNode(node); - var resolved = getIndexedAccessType(objectType, indexType, undefined, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); + var resolved = getIndexedAccessType(objectType, indexType, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); links.resolvedType = resolved.flags & 8388608 && resolved.objectType === objectType && resolved.indexType === indexType ? @@ -46465,7 +45159,7 @@ var ts; function getConditionalType(root, mapper) { var result; var extraTypes; - var _loop_15 = function () { + var _loop_14 = function () { var checkType = instantiateType(root.checkType, mapper); var checkTypeInstantiable = isGenericObjectType(checkType) || isGenericIndexType(checkType); var extendsType = instantiateType(root.extendsType, mapper); @@ -46484,9 +45178,9 @@ var ts; if (!checkTypeInstantiable && !isGenericObjectType(inferredExtendsType) && !isGenericIndexType(inferredExtendsType)) { if (!(inferredExtendsType.flags & 3) && (checkType.flags & 1 || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) { if (checkType.flags & 1) { - (extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper)); + (extraTypes || (extraTypes = [])).push(instantiateTypeWithoutDepthIncrease(root.trueType, combinedMapper || mapper)); } - var falseType_1 = getTypeFromTypeNode(root.node.falseType); + var falseType_1 = root.falseType; if (falseType_1.flags & 16777216) { var newRoot = falseType_1.root; if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) { @@ -46494,11 +45188,11 @@ var ts; return "continue"; } } - result = instantiateType(falseType_1, mapper); + result = instantiateTypeWithoutDepthIncrease(falseType_1, mapper); return "break"; } if (inferredExtendsType.flags & 3 || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) { - result = instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper); + result = instantiateTypeWithoutDepthIncrease(root.trueType, combinedMapper || mapper); return "break"; } } @@ -46514,7 +45208,7 @@ var ts; return "break"; }; while (true) { - var state_4 = _loop_15(); + var state_4 = _loop_14(); if (typeof state_4 === "object") return state_4.value; if (state_4 === "break") @@ -46523,13 +45217,13 @@ var ts; return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result; } function getTrueTypeFromConditionalType(type) { - return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.mapper)); + return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(type.root.trueType, type.mapper)); } function getFalseTypeFromConditionalType(type) { - return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(getTypeFromTypeNode(type.root.node.falseType), type.mapper)); + return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(type.root.falseType, type.mapper)); } function getInferredTrueTypeFromConditionalType(type) { - return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.combinedMapper) : getTrueTypeFromConditionalType(type)); + return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(type.root.trueType, type.combinedMapper) : getTrueTypeFromConditionalType(type)); } function getInferTypeParameters(node) { var result; @@ -46554,6 +45248,8 @@ var ts; node: node, checkType: checkType, extendsType: getTypeFromTypeNode(node.extendsType), + trueType: getTypeFromTypeNode(node.trueType), + falseType: getTypeFromTypeNode(node.falseType), isDistributive: !!(checkType.flags & 262144), inferTypeParameters: getInferTypeParameters(node), outerTypeParameters: outerTypeParameters, @@ -46610,10 +45306,7 @@ var ts; var current = void 0; while (current = nameStack.shift()) { var meaning = nameStack.length ? 1920 : targetMeaning; - var mergedResolvedSymbol = getMergedSymbol(resolveSymbol(currentNamespace)); - var next = node.isTypeOf - ? getPropertyOfType(getTypeOfSymbol(mergedResolvedSymbol), current.escapedText) - : getSymbol(getExportsOfSymbol(mergedResolvedSymbol), current.escapedText, meaning); + var next = getSymbol(getExportsOfSymbol(getMergedSymbol(resolveSymbol(currentNamespace))), current.escapedText, meaning); if (!next) { error(current, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), ts.declarationNameToString(current)); return links.resolvedType = errorType; @@ -46671,7 +45364,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isJSDocTypeExpression(host) || ts.isTypeOperatorNode(host) && host.operator === 142) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 141) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -46683,7 +45376,12 @@ var ts; return !!(type.flags & 524288) && !isGenericMappedType(type); } function isEmptyObjectTypeOrSpreadsIntoEmptyObject(type) { - return isEmptyObjectType(type) || !!(type.flags & (65536 | 32768 | 528 | 296 | 2112 | 402653316 | 1056 | 67108864 | 4194304)); + return isEmptyObjectType(type) || !!(type.flags & (65536 | 32768 | 528 | 296 | 2112 | 132 | 1056 | 67108864 | 4194304)); + } + function isSinglePropertyAnonymousObjectType(type) { + return !!(type.flags & 524288) && + !!(ts.getObjectFlags(type) & 16) && + (ts.length(getPropertiesOfType(type)) === 1 || ts.every(getPropertiesOfType(type), function (p) { return !!(p.flags & 16777216); })); } function tryMergeUnionOfObjectTypeAndEmptyObject(type, readonly) { if (type.types.length === 2) { @@ -46692,10 +45390,10 @@ var ts; if (ts.every(type.types, isEmptyObjectTypeOrSpreadsIntoEmptyObject)) { return isEmptyObjectType(firstType) ? firstType : isEmptyObjectType(secondType) ? secondType : emptyObjectType; } - if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(firstType)) { + if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(firstType) && isSinglePropertyAnonymousObjectType(secondType)) { return getAnonymousPartialType(secondType); } - if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(secondType)) { + if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(secondType) && isSinglePropertyAnonymousObjectType(firstType)) { return getAnonymousPartialType(firstType); } } @@ -46739,20 +45437,16 @@ var ts; if (merged) { return getSpreadType(merged, right, symbol, objectFlags, readonly); } - return checkCrossProductUnion([left, right]) - ? mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }) - : errorType; + return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }); } if (right.flags & 1048576) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); if (merged) { return getSpreadType(left, merged, symbol, objectFlags, readonly); } - return checkCrossProductUnion([left, right]) - ? mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }) - : errorType; + return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }); } - if (right.flags & (528 | 296 | 2112 | 402653316 | 1056 | 67108864 | 4194304)) { + if (right.flags & (528 | 296 | 2112 | 132 | 1056 | 67108864 | 4194304)) { return left; } if (isGenericObjectType(left) || isGenericObjectType(right)) { @@ -46904,7 +45598,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 253)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 250)) { if (!ts.hasSyntacticModifier(container, 32) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -46935,17 +45629,17 @@ var ts; } function getArrayElementTypeNode(node) { switch (node.kind) { - case 186: + case 185: return getArrayElementTypeNode(node.type); - case 179: + case 178: if (node.elements.length === 1) { node = node.elements[0]; - if (node.kind === 181 || node.kind === 192 && node.dotDotDotToken) { + if (node.kind === 180 || node.kind === 191 && node.dotDotDotToken) { return getArrayElementTypeNode(node.type); } } break; - case 178: + case 177: return node.elementType; } return undefined; @@ -46963,93 +45657,89 @@ var ts; function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 128: - case 303: - case 304: + case 299: + case 300: return anyType; - case 152: + case 151: return unknownType; - case 147: + case 146: return stringType; - case 144: + case 143: return numberType; - case 155: + case 154: return bigintType; case 131: return booleanType; - case 148: + case 147: return esSymbolType; case 113: return voidType; - case 150: + case 149: return undefinedType; case 103: return nullType; - case 141: + case 140: return neverType; - case 145: + case 144: return node.flags & 131072 && !noImplicitAny ? anyType : nonPrimitiveType; - case 136: - return intrinsicMarkerType; - case 187: + case 186: case 107: return getTypeFromThisTypeNode(node); - case 191: - return getTypeFromLiteralTypeNode(node); - case 173: - return getTypeFromTypeReference(node); - case 172: - return node.assertsModifier ? voidType : booleanType; - case 223: - return getTypeFromTypeReference(node); - case 176: - return getTypeFromTypeQueryNode(node); - case 178: - case 179: - return getTypeFromArrayOrTupleTypeNode(node); - case 180: - return getTypeFromOptionalTypeNode(node); - case 182: - return getTypeFromUnionTypeNode(node); - case 183: - return getTypeFromIntersectionTypeNode(node); - case 305: - return getTypeFromJSDocNullableTypeNode(node); - case 307: - return addOptionality(getTypeFromTypeNode(node.type)); - case 192: - return getTypeFromNamedTupleTypeNode(node); - case 186: - case 306: - case 301: - return getTypeFromTypeNode(node.type); - case 181: - return getTypeFromRestTypeNode(node); - case 309: - return getTypeFromJSDocVariadicType(node); - case 174: - case 175: - case 177: - case 312: - case 308: - case 313: - return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 188: - return getTypeFromTypeOperatorNode(node); - case 189: - return getTypeFromIndexedAccessTypeNode(node); case 190: - return getTypeFromMappedTypeNode(node); - case 184: - return getTypeFromConditionalTypeNode(node); + return getTypeFromLiteralTypeNode(node); + case 172: + return getTypeFromTypeReference(node); + case 171: + return node.assertsModifier ? voidType : booleanType; + case 220: + return getTypeFromTypeReference(node); + case 175: + return getTypeFromTypeQueryNode(node); + case 177: + case 178: + return getTypeFromArrayOrTupleTypeNode(node); + case 179: + return getTypeFromOptionalTypeNode(node); + case 181: + return getTypeFromUnionTypeNode(node); + case 182: + return getTypeFromIntersectionTypeNode(node); + case 301: + return getTypeFromJSDocNullableTypeNode(node); + case 303: + return addOptionality(getTypeFromTypeNode(node.type)); + case 191: + return getTypeFromNamedTupleTypeNode(node); case 185: + case 302: + case 298: + return getTypeFromTypeNode(node.type); + case 180: + return getTypeFromRestTypeNode(node); + case 305: + return getTypeFromJSDocVariadicType(node); + case 173: + case 174: + case 176: + case 308: + case 304: + case 309: + return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); + case 187: + return getTypeFromTypeOperatorNode(node); + case 188: + return getTypeFromIndexedAccessTypeNode(node); + case 189: + return getTypeFromMappedTypeNode(node); + case 183: + return getTypeFromConditionalTypeNode(node); + case 184: return getTypeFromInferTypeNode(node); - case 193: - return getTypeFromTemplateTypeNode(node); - case 195: + case 192: return getTypeFromImportTypeNode(node); case 78: - case 157: - case 201: + case 156: + case 198: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -47184,10 +45874,9 @@ var ts; return result; } function getObjectTypeInstantiation(type, mapper) { + var target = type.objectFlags & 64 ? type.target : type; var declaration = type.objectFlags & 4 ? type.node : type.symbol.declarations[0]; var links = getNodeLinks(declaration); - var target = type.objectFlags & 4 ? links.resolvedType : - type.objectFlags & 64 ? type.target : type; var typeParameters = links.outerTypeParameters; if (!typeParameters) { var outerTypeParameters = getOuterTypeParameters(declaration, true); @@ -47200,37 +45889,37 @@ var ts; ts.filter(typeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration); }) : typeParameters; links.outerTypeParameters = typeParameters; + if (typeParameters.length) { + links.instantiations = new ts.Map(); + links.instantiations.set(getTypeListId(typeParameters), target); + } } if (typeParameters.length) { var combinedMapper_1 = combineTypeMappers(type.mapper, mapper); var typeArguments = ts.map(typeParameters, function (t) { return getMappedType(t, combinedMapper_1); }); var id = getTypeListId(typeArguments); - if (!target.instantiations) { - target.instantiations = new ts.Map(); - target.instantiations.set(getTypeListId(typeParameters), target); - } - var result = target.instantiations.get(id); + var result = links.instantiations.get(id); if (!result) { var newMapper = createTypeMapper(typeParameters, typeArguments); result = target.objectFlags & 4 ? createDeferredTypeReference(type.target, type.node, newMapper) : target.objectFlags & 32 ? instantiateMappedType(target, newMapper) : instantiateAnonymousType(target, newMapper); - target.instantiations.set(id, result); + links.instantiations.set(id, result); } return result; } return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 157 || - node.parent.kind === 173 && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 195 && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 156 || + node.parent.kind === 172 && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 192 && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 230 || n.kind === 184 && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 227 || n.kind === 183 && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -47239,12 +45928,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 187: + case 186: return !!tp.isThisType; case 78: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && getTypeFromTypeNodeWorker(node) === tp; - case 176: + case 175: return true; } return !!ts.forEachChild(node, containsReference); @@ -47267,18 +45956,13 @@ var ts; if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { if (t.flags & (3 | 58982400 | 524288 | 2097152) && t !== wildcardType && t !== errorType) { - if (!type.declaration.nameType) { - if (isArrayType(t)) { - return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper)); - } - if (isGenericTupleType(t)) { - return instantiateMappedGenericTupleType(t, type, typeVariable, mapper); - } - if (isTupleType(t)) { - return instantiateMappedTupleType(t, type, prependTypeMapping(typeVariable, t, mapper)); - } + if (isGenericTupleType(t)) { + return instantiateMappedGenericTupleType(t, type, typeVariable, mapper); } - return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper)); + var replacementMapper = prependTypeMapping(typeVariable, t, mapper); + return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : + isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : + instantiateAnonymousType(type, replacementMapper); } return t; }); @@ -47372,7 +46056,6 @@ var ts; return type; } if (instantiationDepth === 50 || instantiationCount >= 5000000) { - ts.tracing.instant("check", "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth: instantiationDepth, instantiationCount: instantiationCount }); error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); return errorType; } @@ -47383,6 +46066,12 @@ var ts; instantiationDepth--; return result; } + function instantiateTypeWithoutDepthIncrease(type, mapper) { + instantiationDepth--; + var result = instantiateType(type, mapper); + instantiationDepth++; + return result; + } function instantiateTypeWorker(type, mapper) { var flags = type.flags; if (flags & 262144) { @@ -47411,14 +46100,8 @@ var ts; if (flags & 4194304) { return getIndexType(instantiateType(type.type, mapper)); } - if (flags & 134217728) { - return getTemplateLiteralType(type.texts, instantiateTypes(type.types, mapper)); - } - if (flags & 268435456) { - return getStringMappingType(type.symbol, instantiateType(type.type, mapper)); - } if (flags & 8388608) { - return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), type.noUncheckedIndexedAccessCandidate, undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); } if (flags & 16777216) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); @@ -47457,34 +46140,34 @@ var ts; return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 165 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 208: - case 209: - case 165: - case 251: + case 205: + case 206: + case 164: + case 248: return isContextSensitiveFunctionLikeDeclaration(node); - case 200: + case 197: return ts.some(node.properties, isContextSensitive); - case 199: + case 196: return ts.some(node.elements, isContextSensitive); - case 217: + case 214: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 216: + case 213: return (node.operatorToken.kind === 56 || node.operatorToken.kind === 60) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 288: + case 285: return isContextSensitive(node.initializer); - case 207: + case 204: return isContextSensitive(node.expression); - case 281: + case 278: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 280: { + case 277: { var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 283: { + case 280: { var expression = node.expression; return !!expression && isContextSensitive(expression); } @@ -47500,7 +46183,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 209) { + if (node.kind !== 206) { var parameter = ts.firstOrUndefined(node.parameters); if (!(parameter && ts.parameterIsThisKeyword(parameter))) { return true; @@ -47510,7 +46193,7 @@ var ts; return false; } function hasContextSensitiveReturnExpression(node) { - return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 230 && isContextSensitive(node.body); + return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 227 && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -47557,7 +46240,7 @@ var ts; source.flags & 58982400 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 | 67108864)) : target === globalFunctionType ? !!(source.flags & 524288) && isFunctionObjectType(source) : - hasBaseType(source, getTargetType(target)) || (isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType)); + hasBaseType(source, getTargetType(target)); } function isTypeComparableTo(source, target) { return isTypeRelatedTo(source, target, comparableRelation); @@ -47590,23 +46273,23 @@ var ts; return true; } switch (node.kind) { - case 283: - case 207: + case 280: + case 204: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 216: + case 213: switch (node.operatorToken.kind) { case 62: case 27: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 200: + case 197: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 199: + case 196: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 281: + case 278: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 209: + case 206: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -47793,21 +46476,24 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 283: + case 280: return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11: if (child.containsOnlyTriviaWhiteSpaces) { break; } return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 273: + case 270: + case 271: case 274: - case 277: return { errorNode: child, innerExpression: child, nameType: nameType }; default: return ts.Debug.assertNever(child, "Found invalid jsx child"); } } + function getSemanticJsxChildren(children) { + return ts.filter(children, function (i) { return !ts.isJsxText(i) || !i.containsOnlyTriviaWhiteSpaces; }); + } function elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer) { var result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer); var invalidTextDiagnostic; @@ -47817,7 +46503,7 @@ var ts; var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName); var childrenNameType = getLiteralType(childrenPropName); var childrenTargetType = getIndexedAccessType(target, childrenNameType); - var validChildren = ts.getSemanticJsxChildren(containingElement.children); + var validChildren = getSemanticJsxChildren(containingElement.children); if (!ts.length(validChildren)) { return result; } @@ -47944,11 +46630,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 168: return [3, 2]; case 167: return [3, 2]; - case 165: return [3, 2]; - case 289: return [3, 2]; - case 288: return [3, 4]; + case 166: return [3, 2]; + case 164: return [3, 2]; + case 286: return [3, 2]; + case 285: return [3, 4]; } return [3, 6]; case 2: return [4, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -48012,8 +46698,8 @@ var ts; return 0; } var kind = target.declaration ? target.declaration.kind : 0; - var strictVariance = !(checkMode & 3) && strictFunctionTypes && kind !== 165 && - kind !== 164 && kind !== 166; + var strictVariance = !(checkMode & 3) && strictFunctionTypes && kind !== 164 && + kind !== 163 && kind !== 165; var result = -1; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -48033,27 +46719,25 @@ var ts; var paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount); var restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1; for (var i = 0; i < paramCount; i++) { - var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i); - var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i); - if (sourceType && targetType) { - var sourceSig = checkMode & 3 ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); - var targetSig = checkMode & 3 ? undefined : getSingleCallSignature(getNonNullableType(targetType)); - var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && - (getFalsyFlags(sourceType) & 98304) === (getFalsyFlags(targetType) & 98304); - var related = callbacks ? - compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8) | (strictVariance ? 2 : 1), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : - !(checkMode & 3) && !strictVariance && compareTypes(sourceType, targetType, false) || compareTypes(targetType, sourceType, reportErrors); - if (related && checkMode & 8 && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, false)) { - related = 0; - } - if (!related) { - if (reportErrors) { - errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), ts.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); - } - return 0; - } - result &= related; + var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : getTypeAtPosition(source, i); + var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : getTypeAtPosition(target, i); + var sourceSig = checkMode & 3 ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); + var targetSig = checkMode & 3 ? undefined : getSingleCallSignature(getNonNullableType(targetType)); + var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && + (getFalsyFlags(sourceType) & 98304) === (getFalsyFlags(targetType) & 98304); + var related = callbacks ? + compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8) | (strictVariance ? 2 : 1), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : + !(checkMode & 3) && !strictVariance && compareTypes(sourceType, targetType, false) || compareTypes(targetType, sourceType, reportErrors); + if (related && checkMode & 8 && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, false)) { + related = 0; } + if (!related) { + if (reportErrors) { + errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), ts.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); + } + return 0; + } + result &= related; } if (!(checkMode & 4)) { var targetReturnType = isResolvingReturnTypeOfSignature(target) ? anyType @@ -48189,7 +46873,7 @@ var ts; return true; if (t & 131072) return false; - if (s & 402653316 && t & 4) + if (s & 132 && t & 4) return true; if (s & 128 && s & 1024 && t & 128 && !(t & 1024) && @@ -48248,7 +46932,7 @@ var ts; } else { if (!(source.flags & 3145728) && !(target.flags & 3145728) && - source.flags !== target.flags && !(source.flags & 469237760)) + source.flags !== target.flags && !(source.flags & 66584576)) return false; } if (source.flags & 524288 && target.flags & 524288) { @@ -48257,7 +46941,7 @@ var ts; return !!(related & 1); } } - if (source.flags & 469499904 || target.flags & 469499904) { + if (source.flags & 66846720 || target.flags & 66846720) { return checkTypeRelatedTo(source, target, relation, undefined); } return false; @@ -48299,7 +46983,6 @@ var ts; reportIncompatibleStack(); } if (overflow) { - ts.tracing.instant("check", "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: depth }); var diag = error(errorNode || currentNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); if (errorOutputContainer) { (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); @@ -48605,7 +47288,7 @@ var ts; else if (source.flags & 2097152) { result = someTypeRelatedToType(source, target, false, 1); } - if (!result && (source.flags & 469499904 || target.flags & 469499904)) { + if (!result && (source.flags & 66846720 || target.flags & 66846720)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -48672,7 +47355,7 @@ var ts; } function isIdenticalTo(source, target) { var flags = source.flags & target.flags; - if (!(flags & 469237760)) { + if (!(flags & 66584576)) { return 0; } if (flags & 3145728) { @@ -48708,7 +47391,7 @@ var ts; reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target); checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget]; } - var _loop_16 = function (prop) { + var _loop_15 = function (prop) { if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) { if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) { if (reportErrors) { @@ -48761,7 +47444,7 @@ var ts; }; for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; - var state_5 = _loop_16(prop); + var state_5 = _loop_15(prop); if (typeof state_5 === "object") return state_5.value; } @@ -48923,7 +47606,7 @@ var ts; else { for (var i = 0; i < maybeCount; i++) { if (id === maybeKeys[i]) { - return 3; + return 1; } } if (depth === 100) { @@ -48951,16 +47634,7 @@ var ts; return originalHandler(onlyUnreliable); }; } - if (expandingFlags === 3) { - ts.tracing.instant("check", "recursiveTypeRelatedTo_DepthLimit", { - sourceId: source.id, - sourceIdStack: sourceStack.map(function (t) { return t.id; }), - targetId: target.id, - targetIdStack: targetStack.map(function (t) { return t.id; }), - depth: depth, - }); - } - var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3; + var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 1; if (outofbandVarianceMarkerHandler) { outofbandVarianceMarkerHandler = originalHandler; } @@ -48968,10 +47642,8 @@ var ts; depth--; if (result) { if (result === -1 || depth === 0) { - if (result === -1 || result === 3) { - for (var i = maybeStart; i < maybeCount; i++) { - relation.set(maybeKeys[i], 1 | propagatingVarianceFlags); - } + for (var i = maybeStart; i < maybeCount; i++) { + relation.set(maybeKeys[i], 1 | propagatingVarianceFlags); } maybeCount = maybeStart; } @@ -48983,12 +47655,6 @@ var ts; return result; } function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) { - ts.tracing.push("check", "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id }); - var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState); - ts.tracing.pop(); - return result; - } - function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) { if (intersectionState & 4) { return propertiesRelatedTo(source, target, reportErrors, undefined, 0); } @@ -49044,7 +47710,7 @@ var ts; return result; } if (target.flags & 262144) { - if (ts.getObjectFlags(source) & 32 && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) { + if (ts.getObjectFlags(source) & 32 && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) { if (!(getMappedTypeModifiers(source) & 4)) { var templateType = getTemplateTypeFromMappedType(source); var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); @@ -49083,14 +47749,14 @@ var ts; var baseIndexType = getBaseConstraintOfType(indexType) || indexType; if (!isGenericObjectType(baseObjectType) && !isGenericIndexType(baseIndexType)) { var accessFlags = 2 | (baseObjectType !== objectType ? 1 : 0); - var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, target.noUncheckedIndexedAccessCandidate, undefined, accessFlags); + var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, undefined, accessFlags); if (constraint && (result = isRelatedTo(source, constraint, reportErrors))) { return result; } } } } - else if (isGenericMappedType(target) && !target.declaration.nameType) { + else if (isGenericMappedType(target)) { var template = getTemplateTypeFromMappedType(target); var modifiers = getMappedTypeModifiers(target); if (!(modifiers & 8)) { @@ -49127,14 +47793,6 @@ var ts; } } } - else if (target.flags & 134217728 && source.flags & 128) { - if (isPatternLiteralType(target)) { - var result_8 = inferLiteralsFromTemplateLiteralType(source, target); - if (result_8 && ts.every(result_8, function (r, i) { return isStringLiteralTypeValueParsableAsType(r, target.types[i]); })) { - return -1; - } - } - } if (source.flags & 8650752) { if (source.flags & 8388608 && target.flags & 8388608) { if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { @@ -49169,35 +47827,6 @@ var ts; return result; } } - else if (source.flags & 134217728) { - if (target.flags & 134217728 && - source.texts.length === target.texts.length && - source.types.length === target.types.length && - ts.every(source.texts, function (t, i) { return t === target.texts[i]; }) && - ts.every(instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)).types, function (t, i) { return !!(target.types[i].flags & (1 | 4)) || !!isRelatedTo(t, target.types[i], false); })) { - return -1; - } - var constraint = getBaseConstraintOfType(source); - if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, reportErrors))) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - else if (source.flags & 268435456) { - if (target.flags & 268435456 && source.symbol === target.symbol) { - if (result = isRelatedTo(source.type, target.type, reportErrors)) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - else { - var constraint = getBaseConstraintOfType(source); - if (constraint && (result = isRelatedTo(constraint, target, reportErrors))) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - } else if (source.flags & 16777216) { if (target.flags & 16777216) { var sourceParams = source.root.inferTypeParameters; @@ -49304,9 +47933,9 @@ var ts; if (source.flags & (524288 | 2097152) && target.flags & 1048576) { var objectOnlyTarget = extractTypesOfKind(target, 524288 | 2097152 | 33554432); if (objectOnlyTarget.flags & 1048576) { - var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget); - if (result_9) { - return result_9; + var result_8 = typeRelatedToDiscriminatedType(source, objectOnlyTarget); + if (result_8) { + return result_8; } } } @@ -49348,14 +47977,12 @@ var ts; var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { - var result_10; + var result_9; var targetConstraint = getConstraintTypeFromMappedType(target); var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers)); - if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { + if (result_9 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); - if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) { - return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); - } + return result_9 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); } } return 0; @@ -49370,7 +47997,6 @@ var ts; var sourceProperty = sourcePropertiesFiltered_1[_i]; numCombinations *= countTypes(getTypeOfSymbol(sourceProperty)); if (numCombinations > 25) { - ts.tracing.instant("check", "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source.id, targetId: target.id, numCombinations: numCombinations }); return 0; } } @@ -49386,11 +48012,11 @@ var ts; } var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes); var matchingTypes = []; - var _loop_17 = function (combination) { + var _loop_16 = function (combination) { var hasMatch = false; outer: for (var _i = 0, _a = target.types; _i < _a.length; _i++) { var type = _a[_i]; - var _loop_18 = function (i) { + var _loop_17 = function (i) { var sourceProperty = sourcePropertiesFiltered[i]; var targetProperty = getPropertyOfType(type, sourceProperty.escapedName); if (!targetProperty) @@ -49403,7 +48029,7 @@ var ts; } }; for (var i = 0; i < sourcePropertiesFiltered.length; i++) { - var state_7 = _loop_18(i); + var state_7 = _loop_17(i); switch (state_7) { case "continue-outer": continue outer; } @@ -49417,7 +48043,7 @@ var ts; }; for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) { var combination = discriminantCombinations_1[_a]; - var state_6 = _loop_17(combination); + var state_6 = _loop_16(combination); if (typeof state_6 === "object") return state_6.value; } @@ -49467,7 +48093,7 @@ var ts; ts.Debug.assertIsDefined(links.deferralParent); ts.Debug.assertIsDefined(links.deferralConstituents); var unionParent = !!(links.deferralParent.flags & 1048576); - var result_11 = unionParent ? 0 : -1; + var result_10 = unionParent ? 0 : -1; var targetTypes = links.deferralConstituents; for (var _i = 0, targetTypes_3 = targetTypes; _i < targetTypes_3.length; _i++) { var targetType = targetTypes_3[_i]; @@ -49476,7 +48102,7 @@ var ts; if (!related) { return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors); } - result_11 &= related; + result_10 &= related; } else { if (related) { @@ -49484,13 +48110,13 @@ var ts; } } } - if (unionParent && !result_11 && targetIsOptional) { - result_11 = isRelatedTo(source, undefinedType); + if (unionParent && !result_10 && targetIsOptional) { + result_10 = isRelatedTo(source, undefinedType); } - if (unionParent && !result_11 && reportErrors) { + if (unionParent && !result_10 && reportErrors) { return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors); } - return result_11; + return result_10; } else { return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors, undefined, intersectionState); @@ -49736,7 +48362,6 @@ var ts; return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { - var _a, _b; if (relation === identityRelation) { return signaturesIdenticalTo(source, target, kind); } @@ -49763,9 +48388,7 @@ var ts; var result = -1; var saveErrorInfo = captureErrorCalculationState(); var incompatibleReporter = kind === 1 ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn; - var sourceObjectFlags = ts.getObjectFlags(source); - var targetObjectFlags = ts.getObjectFlags(target); - if (sourceObjectFlags & 64 && targetObjectFlags & 64 && source.symbol === target.symbol) { + if (ts.getObjectFlags(source) & 64 && ts.getObjectFlags(target) & 64 && source.symbol === target.symbol) { for (var i = 0; i < targetSignatures.length; i++) { var related = signatureRelatedTo(sourceSignatures[i], targetSignatures[i], true, reportErrors, incompatibleReporter(sourceSignatures[i], targetSignatures[i])); if (!related) { @@ -49776,25 +48399,14 @@ var ts; } else if (sourceSignatures.length === 1 && targetSignatures.length === 1) { var eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; - var sourceSignature = ts.first(sourceSignatures); - var targetSignature = ts.first(targetSignatures); - result = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors, incompatibleReporter(sourceSignature, targetSignature)); - if (!result && reportErrors && kind === 1 && (sourceObjectFlags & targetObjectFlags) && - (((_a = targetSignature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 166 || ((_b = sourceSignature.declaration) === null || _b === void 0 ? void 0 : _b.kind) === 166)) { - var constructSignatureToString = function (signature) { - return signatureToString(signature, undefined, 262144, kind); - }; - reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature)); - reportError(ts.Diagnostics.Types_of_construct_signatures_are_incompatible); - return result; - } + result = signatureRelatedTo(sourceSignatures[0], targetSignatures[0], eraseGenerics, reportErrors, incompatibleReporter(sourceSignatures[0], targetSignatures[0])); } else { outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) { var t = targetSignatures_1[_i]; var shouldElaborateErrors = reportErrors; - for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) { - var s = sourceSignatures_1[_c]; + for (var _a = 0, sourceSignatures_1 = sourceSignatures; _a < sourceSignatures_1.length; _a++) { + var s = sourceSignatures_1[_a]; var related = signatureRelatedTo(s, t, true, shouldElaborateErrors, incompatibleReporter(s, t)); if (related) { result &= related; @@ -49943,13 +48555,13 @@ var ts; if (type.flags & 3145728) { return !!ts.forEach(type.types, typeCouldHaveTopLevelSingletonTypes); } - if (type.flags & 465829888) { + if (type.flags & 63176704) { var constraint = getConstraintOfType(type); - if (constraint && constraint !== type) { + if (constraint) { return typeCouldHaveTopLevelSingletonTypes(constraint); } } - return isUnitType(type) || !!(type.flags & 134217728); + return isUnitType(type); } function getBestMatchingType(source, target, isRelatedTo) { if (isRelatedTo === void 0) { isRelatedTo = compareTypesAssignable; } @@ -49981,17 +48593,7 @@ var ts; } } var match = discriminable.indexOf(true); - if (match === -1) { - return defaultValue; - } - var nextMatch = discriminable.indexOf(true, match + 1); - while (nextMatch !== -1) { - if (!isTypeIdenticalTo(target.types[match], target.types[nextMatch])) { - return defaultValue; - } - nextMatch = discriminable.indexOf(true, nextMatch + 1); - } - return target.types[match]; + return match === -1 || discriminable.indexOf(true, match + 1) !== -1 ? defaultValue : target.types[match]; } function isWeakType(type) { if (type.flags & 524288) { @@ -50029,14 +48631,12 @@ var ts; }); } function getVariancesWorker(typeParameters, cache, createMarkerType) { - var _a, _b, _c; if (typeParameters === void 0) { typeParameters = ts.emptyArray; } var variances = cache.variances; if (!variances) { - ts.tracing.push("check", "getVariancesWorker", { arity: typeParameters.length, id: (_c = (_a = cache.id) !== null && _a !== void 0 ? _a : (_b = cache.declaredType) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : -1 }); cache.variances = ts.emptyArray; variances = []; - var _loop_19 = function (tp) { + var _loop_18 = function (tp) { var unmeasurable = false; var unreliable = false; var oldHandler = outofbandVarianceMarkerHandler; @@ -50061,10 +48661,9 @@ var ts; }; for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) { var tp = typeParameters_1[_i]; - _loop_19(tp); + _loop_18(tp); } cache.variances = variances; - ts.tracing.pop(); } return variances; } @@ -50163,44 +48762,54 @@ var ts; !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass; } function isDeeplyNestedType(type, stack, depth) { - if (depth >= 5) { - var identity_1 = getRecursionIdentity(type); - if (identity_1) { - var count = 0; - for (var i = 0; i < depth; i++) { - if (getRecursionIdentity(stack[i]) === identity_1) { - count++; - if (count >= 5) { - return true; + if (depth >= 5 && type.flags & 524288) { + if (!isObjectOrArrayLiteralType(type)) { + var symbol = type.symbol; + if (symbol) { + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 524288 && t.symbol === symbol) { + count++; + if (count >= 5) + return true; } } } } + if (ts.getObjectFlags(type) && 4 && !!type.node) { + var root = type.target; + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (ts.getObjectFlags(t) && 4 && !!t.node && t.target === root) { + count++; + if (count >= 5) + return true; + } + } + } + } + if (depth >= 5 && type.flags & 8388608) { + var root = getRootObjectTypeFromIndexedAccessChain(type); + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (getRootObjectTypeFromIndexedAccessChain(t) === root) { + count++; + if (count >= 5) + return true; + } + } } return false; } - function getRecursionIdentity(type) { - if (type.flags & 524288 && !isObjectOrArrayLiteralType(type)) { - if (ts.getObjectFlags(type) && 4 && type.node) { - return type.node; - } - if (type.symbol && !(ts.getObjectFlags(type) & 16 && type.symbol.flags & 32)) { - return type.symbol; - } - if (isTupleType(type)) { - return type.target; - } + function getRootObjectTypeFromIndexedAccessChain(type) { + var t = type; + while (t.flags & 8388608) { + t = t.objectType; } - if (type.flags & 8388608) { - do { - type = type.objectType; - } while (type.flags & 8388608); - return type; - } - if (type.flags & 16777216) { - return type.root; - } - return undefined; + return t; } function isPropertyIdenticalTo(sourceProp, targetProp) { return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0; @@ -50309,8 +48918,8 @@ var ts; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var t = types_13[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -50474,8 +49083,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var t = types_14[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var t = types_13[_i]; result |= getFalsyFlags(t); } return result; @@ -50502,7 +49111,7 @@ var ts; type.flags & 64 ? zeroBigIntType : type === regularFalseType || type === falseType || - type.flags & (16384 | 32768 | 65536 | 3) || + type.flags & (16384 | 32768 | 65536) || type.flags & 128 && type.value === "" || type.flags & 256 && type.value === 0 || type.flags & 2048 && isZeroBigInt(type) ? type : @@ -50753,12 +49362,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 216: - case 163: + case 213: case 162: + case 161: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 160: + case 159: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -50773,22 +49382,22 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 198: + case 195: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { return; } break; - case 308: + case 304: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 251: - case 165: + case 248: case 164: + case 163: + case 166: case 167: - case 168: - case 208: - case 209: + case 205: + case 206: if (noImplicitAny && !declaration.name) { if (wideningKind === 3) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -50802,7 +49411,7 @@ var ts; wideningKind === 3 ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 190: + case 189: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -50928,7 +49537,7 @@ var ts; if (objectFlags & 67108864) { return !!(objectFlags & 134217728); } - var result = !!(type.flags & 465829888 || + var result = !!(type.flags & 63176704 || type.flags & 524288 && !isNonGenericTopLevelType(type) && (objectFlags & 4 && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192 | 32 | 2048 | 4096) && type.symbol.declarations || objectFlags & (32 | 131072)) || @@ -50940,15 +49549,16 @@ var ts; } function isNonGenericTopLevelType(type) { if (type.aliasSymbol && !type.aliasTypeArguments) { - var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 254); - return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 297 ? true : n.kind === 256 ? false : "quit"; })); + var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 251); + return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 294 ? true : n.kind === 253 ? false : "quit"; })); } return false; } function isTypeParameterAtTopLevel(type, typeParameter) { return !!(type === typeParameter || type.flags & 3145728 && ts.some(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }) || - type.flags & 16777216 && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); + type.flags & 16777216 && (isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type), typeParameter) || + isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type), typeParameter))); } function createEmptyObjectTypeFromStringLiteral(type) { var members = ts.createSymbolTable(); @@ -50984,8 +49594,7 @@ var ts; } function isPartiallyInferableType(type) { return !(ts.getObjectFlags(type) & 2097152) || - isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }) || - isTupleType(type) && ts.some(getTypeArguments(type), isPartiallyInferableType); + isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }); } function createReverseMappedType(source, target, constraint) { if (!(getIndexInfoOfType(source, 0) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) { @@ -51080,66 +49689,17 @@ var ts; function isFromInferenceBlockedSource(type) { return !!(type.symbol && ts.some(type.symbol.declarations, hasSkipDirectInferenceFlag)); } - function isValidBigIntString(s) { - var scanner = ts.createScanner(99, false); - var success = true; - scanner.setOnError(function () { return success = false; }); - scanner.setText(s + "n"); - var result = scanner.scan(); - if (result === 40) { - result = scanner.scan(); - } - var flags = scanner.getTokenFlags(); - return success && result === 9 && scanner.getTextPos() === (s.length + 1) && !(flags & 512); - } - function isStringLiteralTypeValueParsableAsType(s, target) { - if (target.flags & 1048576) { - return !!forEachType(target, function (t) { return isStringLiteralTypeValueParsableAsType(s, t); }); - } - switch (target) { - case stringType: return true; - case numberType: return s.value !== "" && isFinite(+(s.value)); - case bigintType: return s.value !== "" && isValidBigIntString(s.value); - case trueType: return s.value === "true"; - case falseType: return s.value === "false"; - case undefinedType: return s.value === "undefined"; - case nullType: return s.value === "null"; - default: return !!(target.flags & 1); - } - } - function inferLiteralsFromTemplateLiteralType(source, target) { - var value = source.value; - var texts = target.texts; - var lastIndex = texts.length - 1; - var startText = texts[0]; - var endText = texts[lastIndex]; - if (!(value.startsWith(startText) && value.slice(startText.length).endsWith(endText))) - return undefined; - var matches = []; - var str = value.slice(startText.length, value.length - endText.length); - var pos = 0; - for (var i = 1; i < lastIndex; i++) { - var delim = texts[i]; - var delimPos = delim.length > 0 ? str.indexOf(delim, pos) : pos < str.length ? pos + 1 : -1; - if (delimPos < 0) - return undefined; - matches.push(getLiteralType(str.slice(pos, delimPos))); - pos = delimPos + delim.length; - } - matches.push(getLiteralType(str.slice(pos))); - return matches; - } function inferTypes(inferences, originalSource, originalTarget, priority, contravariant) { if (priority === void 0) { priority = 0; } if (contravariant === void 0) { contravariant = false; } + var symbolOrTypeStack; + var visited; var bivariant = false; var propagationType; var inferencePriority = 1024; var allowComplexConstraintInference = true; - var visited; - var sourceStack; - var targetStack; - var expandingFlags = 0; + var objectTypeComparisonDepth = 0; + var targetStack = []; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { if (!couldContainTypeVariables(target)) { @@ -51231,7 +49791,7 @@ var ts; } else if (target.flags & 8388608) { var indexType = getSimplifiedType(target.indexType, false); - if (indexType.flags & 465829888) { + if (indexType.flags & 63176704) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, false), indexType, false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -51259,13 +49819,18 @@ var ts; inferFromTypes(source.objectType, target.objectType); inferFromTypes(source.indexType, target.indexType); } - else if (source.flags & 268435456 && target.flags & 268435456) { - if (source.symbol === target.symbol) { - inferFromTypes(source.type, target.type); - } + else if (source.flags & 16777216 && target.flags & 16777216) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); + inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } else if (target.flags & 16777216) { - invokeOnce(source, target, inferToConditionalType); + var savePriority = priority; + priority |= contravariant ? 32 : 0; + var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; + inferToMultipleTypes(source, targetTypes, target.flags); + priority = savePriority; } else if (target.flags & 3145728) { inferToMultipleTypes(source, target.types, target.flags); @@ -51277,12 +49842,9 @@ var ts; inferFromTypes(sourceType, target); } } - else if (target.flags & 134217728) { - inferToTemplateLiteralType(source, target); - } else { source = getReducedType(source); - if (!(priority & 256 && source.flags & (2097152 | 465829888))) { + if (!(priority & 256 && source.flags & (2097152 | 63176704))) { var apparentSource = getApparentType(source); if (apparentSource !== source && allowComplexConstraintInference && !(apparentSource.flags & (524288 | 2097152))) { allowComplexConstraintInference = false; @@ -51317,28 +49879,7 @@ var ts; (visited || (visited = new ts.Map())).set(key, -1); var saveInferencePriority = inferencePriority; inferencePriority = 1024; - var saveExpandingFlags = expandingFlags; - var sourceIdentity = getRecursionIdentity(source) || source; - var targetIdentity = getRecursionIdentity(target) || target; - if (sourceIdentity && ts.contains(sourceStack, sourceIdentity)) - expandingFlags |= 1; - if (targetIdentity && ts.contains(targetStack, targetIdentity)) - expandingFlags |= 2; - if (expandingFlags !== 3) { - if (sourceIdentity) - (sourceStack || (sourceStack = [])).push(sourceIdentity); - if (targetIdentity) - (targetStack || (targetStack = [])).push(targetIdentity); - action(source, target); - if (targetIdentity) - targetStack.pop(); - if (sourceIdentity) - sourceStack.pop(); - } - else { - inferencePriority = -1; - } - expandingFlags = saveExpandingFlags; + action(source, target); visited.set(key, inferencePriority); inferencePriority = Math.min(inferencePriority, saveInferencePriority); } @@ -51395,8 +49936,8 @@ var ts; } function getSingleTypeVariableFromIntersectionTypes(types) { var typeVariable; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var type = types_15[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var type = types_14[_i]; var t = type.flags & 2097152 && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); }); if (!t || typeVariable && t !== typeVariable) { return undefined; @@ -51501,31 +50042,35 @@ var ts; } return false; } - function inferToConditionalType(source, target) { - if (source.flags & 16777216) { - inferFromTypes(source.checkType, target.checkType); - inferFromTypes(source.extendsType, target.extendsType); - inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); - inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); + function inferFromObjectTypes(source, target) { + var isNonConstructorObject = target.flags & 524288 && + !(ts.getObjectFlags(target) & 16 && target.symbol && target.symbol.flags & 32); + var symbolOrType = ts.getObjectFlags(target) & 4 && target.node ? getNormalizedType(target, false) : isNonConstructorObject ? isTupleType(target) ? target.target : target.symbol : undefined; + if (symbolOrType) { + if (ts.contains(symbolOrTypeStack, symbolOrType)) { + if (ts.getObjectFlags(target) & 4 && target.node) { + return; + } + inferencePriority = -1; + return; + } + targetStack[objectTypeComparisonDepth] = target; + objectTypeComparisonDepth++; + if (isDeeplyNestedType(target, targetStack, objectTypeComparisonDepth)) { + inferencePriority = -1; + objectTypeComparisonDepth--; + return; + } + (symbolOrTypeStack || (symbolOrTypeStack = [])).push(symbolOrType); + inferFromObjectTypesWorker(source, target); + symbolOrTypeStack.pop(); + objectTypeComparisonDepth--; } else { - var savePriority = priority; - priority |= contravariant ? 32 : 0; - var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; - inferToMultipleTypes(source, targetTypes, target.flags); - priority = savePriority; + inferFromObjectTypesWorker(source, target); } } - function inferToTemplateLiteralType(source, target) { - var matches = source.flags & 128 ? inferLiteralsFromTemplateLiteralType(source, target) : - source.flags & 134217728 && ts.arraysEqual(source.texts, target.texts) ? source.types : - undefined; - var types = target.types; - for (var i = 0; i < types.length; i++) { - inferFromTypes(matches ? matches[i] : neverType, types[i]); - } - } - function inferFromObjectTypes(source, target) { + function inferFromObjectTypesWorker(source, target) { if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && (source.target === target.target || isArrayType(source) && isArrayType(target))) { inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target)); return; @@ -51533,12 +50078,8 @@ var ts; if (isGenericMappedType(source) && isGenericMappedType(target)) { inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target)); inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); - var sourceNameType = getNameTypeFromMappedType(source); - var targetNameType = getNameTypeFromMappedType(target); - if (sourceNameType && targetNameType) - inferFromTypes(sourceNameType, targetNameType); } - if (ts.getObjectFlags(target) & 32 && !target.declaration.nameType) { + if (ts.getObjectFlags(target) & 32) { var constraintType = getConstraintTypeFromMappedType(target); if (inferToMappedType(source, target, constraintType)) { return; @@ -51634,7 +50175,7 @@ var ts; if (!skipParameters) { var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0; - bivariant = bivariant || kind === 165 || kind === 164 || kind === 166; + bivariant = bivariant || kind === 164 || kind === 163 || kind === 165; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -51669,7 +50210,7 @@ var ts; } function hasPrimitiveConstraint(type) { var constraint = getConstraintOfTypeParameter(type); - return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 | 4194304 | 134217728 | 268435456); + return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 | 4194304); } function isObjectLiteralType(type) { return !!(ts.getObjectFlags(type) & 128); @@ -51760,22 +50301,22 @@ var ts; return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom; case "$": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery; case "describe": case "suite": case "it": case "test": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha; case "process": case "require": case "Buffer": case "module": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode; case "Map": case "Set": case "Promise": @@ -51784,19 +50325,9 @@ var ts; case "WeakSet": case "Iterator": case "AsyncIterator": - case "SharedArrayBuffer": - case "Atomics": - case "AsyncIterable": - case "AsyncIterableIterator": - case "AsyncGenerator": - case "AsyncGeneratorFunction": - case "BigInt": - case "Reflect": - case "BigInt64Array": - case "BigUint64Array": - return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later; + return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 289) { + if (node.parent.kind === 286) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -51813,7 +50344,7 @@ var ts; return links.resolvedSymbol; } function isInTypeQuery(node) { - return !!ts.findAncestor(node, function (n) { return n.kind === 176 ? true : n.kind === 78 || n.kind === 157 ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 175 ? true : n.kind === 78 || n.kind === 156 ? false : "quit"; }); } function getFlowCacheKey(node, declaredType, initialType, flowContainer) { switch (node.kind) { @@ -51822,11 +50353,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 107: return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType); - case 225: - case 207: + case 222: + case 204: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 201: - case 202: + case 198: + case 199: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -51837,28 +50368,26 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 207: - case 225: + case 204: + case 222: return isMatchingReference(source, target.expression); - case 216: - return (ts.isAssignmentExpression(target) && isMatchingReference(source, target.left)) || - (ts.isBinaryExpression(target) && target.operatorToken.kind === 27 && isMatchingReference(source, target.right)); + case 213: + return ts.isAssignmentExpression(target) && isMatchingReference(source, target.left); } switch (source.kind) { case 78: - case 79: return target.kind === 78 && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 249 || target.kind === 198) && + (target.kind === 246 || target.kind === 195) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 107: return target.kind === 107; case 105: return target.kind === 105; - case 225: - case 207: + case 222: + case 204: return isMatchingReference(source.expression, target); - case 201: - case 202: + case 198: + case 199: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -51867,11 +50396,11 @@ var ts; } function containsTruthyCheck(source, target) { return isMatchingReference(source, target) || - (target.kind === 216 && target.operatorToken.kind === 55 && + (target.kind === 213 && target.operatorToken.kind === 55 && (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right))); } function getAccessedPropertyName(access) { - return access.kind === 201 ? access.name.escapedText : + return access.kind === 198 ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -51900,7 +50429,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192) === 192 && - !maybeTypeOfKind(getTypeOfSymbol(prop), 465829888); + !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704); } return !!prop.isDiscriminantProperty; } @@ -51933,7 +50462,7 @@ var ts; } } } - if (callExpression.expression.kind === 201 && + if (callExpression.expression.kind === 198 && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -51975,8 +50504,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var t = types_16[_i]; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var t = types_15[_i]; result |= getTypeFacts(t); } return result; @@ -52045,7 +50574,7 @@ var ts; if (flags & 131072) { return 0; } - if (flags & 465829888) { + if (flags & 63176704) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728) { @@ -52069,35 +50598,28 @@ var ts; return errorType; var text = getPropertyNameFromType(nameType); return getConstraintForLocation(getTypeOfPropertyOfType(type, text), name) || - isNumericLiteralName(text) && includeUndefinedInIndexSignature(getIndexTypeOfType(type, 1)) || - includeUndefinedInIndexSignature(getIndexTypeOfType(type, 0)) || + isNumericLiteralName(text) && getIndexTypeOfType(type, 1) || + getIndexTypeOfType(type, 0) || errorType; } function getTypeOfDestructuredArrayElement(type, index) { return everyType(type, isTupleLikeType) && getTupleElementType(type, index) || - includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(65, type, undefinedType, undefined)) || + checkIteratedTypeOrElementType(65, type, undefinedType, undefined) || errorType; } - function includeUndefinedInIndexSignature(type) { - if (!type) - return type; - return compilerOptions.noUncheckedIndexedAccess ? - getUnionType([type, undefinedType]) : - type; - } function getTypeOfDestructuredSpreadExpression(type) { return createArrayType(checkIteratedTypeOrElementType(65, type, undefinedType, undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 199 && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 288 && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 196 && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 285 && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 216 && parent.parent.left === parent || - parent.parent.kind === 239 && parent.parent.initializer === parent; + return parent.parent.kind === 213 && parent.parent.left === parent || + parent.parent.kind === 236 && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -52114,21 +50636,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 238: + case 235: return stringType; - case 239: + case 236: return checkRightHandSideOfForOf(parent) || errorType; - case 216: + case 213: return getAssignedTypeOfBinaryExpression(parent); - case 210: + case 207: return undefinedType; - case 199: + case 196: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 220: + case 217: return getAssignedTypeOfSpreadExpression(parent); - case 288: + case 285: return getAssignedTypeOfPropertyAssignment(parent); - case 289: + case 286: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -52136,7 +50658,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 196 ? + var type = pattern.kind === 193 ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -52151,30 +50673,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 238) { + if (node.parent.parent.kind === 235) { return stringType; } - if (node.parent.parent.kind === 239) { + if (node.parent.parent.kind === 236) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 249 ? + return node.kind === 246 ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 249 && node.initializer && + return node.kind === 246 && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 198 && node.parent.kind === 216 && + node.kind !== 195 && node.parent.kind === 213 && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 207: + case 204: return getReferenceCandidate(node.expression); - case 216: + case 213: switch (node.operatorToken.kind) { case 62: case 74: @@ -52189,13 +50711,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 207 || - parent.kind === 216 && parent.operatorToken.kind === 62 && parent.left === node || - parent.kind === 216 && parent.operatorToken.kind === 27 && parent.right === node ? + return parent.kind === 204 || + parent.kind === 213 && parent.operatorToken.kind === 62 && parent.left === node || + parent.kind === 213 && parent.operatorToken.kind === 27 && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 284) { + if (clause.kind === 281) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -52215,7 +50737,7 @@ var ts; var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 284) { + if (clause.kind === 281) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; @@ -52341,8 +50863,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { - var t = types_17[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var t = types_16[_i]; if (!(t.flags & 131072)) { if (!(ts.getObjectFlags(t) & 256)) { return false; @@ -52361,12 +50883,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 203 + parent.parent.kind === 200 && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 202 && + var isElementAssignment = parent.kind === 199 && parent.expression === root && - parent.parent.kind === 216 && + parent.parent.kind === 213 && parent.parent.operatorToken.kind === 62 && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -52374,8 +50896,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return (declaration.kind === 249 || declaration.kind === 160 || - declaration.kind === 163 || declaration.kind === 162) && + return (declaration.kind === 246 || declaration.kind === 159 || + declaration.kind === 162 || declaration.kind === 161) && !!ts.getEffectiveTypeAnnotationNode(declaration); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -52383,18 +50905,12 @@ var ts; return getTypeOfSymbol(symbol); } if (symbol.flags & (3 | 4)) { - if (ts.getCheckFlags(symbol) & 262144) { - var origin = symbol.syntheticOrigin; - if (origin && getExplicitTypeOfSymbol(origin)) { - return getTypeOfSymbol(symbol); - } - } var declaration = symbol.valueDeclaration; if (declaration) { if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 236) { var statement = declaration.parent.parent; var expressionType = getTypeOfDottedName(statement.expression, undefined); if (expressionType) { @@ -52418,11 +50934,11 @@ var ts; return getExplicitThisType(node); case 105: return checkSuperExpression(node); - case 201: + case 198: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 207: + case 204: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -52432,7 +50948,7 @@ var ts; var signature = links.effectsSignature; if (signature === undefined) { var funcType = void 0; - if (node.parent.kind === 233) { + if (node.parent.kind === 230) { funcType = getTypeOfDottedName(node.expression, undefined); } else if (node.expression.kind !== 105) { @@ -52476,7 +50992,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 94 || node.kind === 216 && (node.operatorToken.kind === 55 && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 94 || node.kind === 213 && (node.operatorToken.kind === 55 && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -52585,7 +51101,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 536624127)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943)) { return declaredType; } flowInvocationCount++; @@ -52593,7 +51109,7 @@ var ts; var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode)); sharedFlowCount = sharedFlowStart; var resultType = ts.getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 225 && getTypeWithFacts(resultType, 2097152).flags & 131072) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 222 && getTypeWithFacts(resultType, 2097152).flags & 131072) { return declaredType; } return resultType; @@ -52606,13 +51122,11 @@ var ts; } function getTypeAtFlowNode(flow) { if (flowDepth === 2000) { - ts.tracing.instant("check", "getTypeAtFlowNode_DepthLimit", { flowId: flow.id }); flowAnalysisDisabled = true; reportFlowControlError(reference); return errorType; } flowDepth++; - var sharedFlow; while (true) { var flags = flow.flags; if (flags & 4096) { @@ -52622,7 +51136,6 @@ var ts; return sharedFlowTypes[i]; } } - sharedFlow = flow; } var type = void 0; if (flags & 16) { @@ -52671,8 +51184,8 @@ var ts; else if (flags & 2) { var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 201 && - reference.kind !== 202 && + reference.kind !== 198 && + reference.kind !== 199 && reference.kind !== 107) { flow = container.flowNode; continue; @@ -52682,8 +51195,8 @@ var ts; else { type = convertAutoToAny(declaredType); } - if (sharedFlow) { - sharedFlowNodes[sharedFlowCount] = sharedFlow; + if (flags & 4096) { + sharedFlowNodes[sharedFlowCount] = flow; sharedFlowTypes[sharedFlowCount] = type; sharedFlowCount++; } @@ -52693,7 +51206,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 249 || node.kind === 198 ? + return getConstraintForLocation(node.kind === 246 || node.kind === 195 ? getInitialType(node) : getAssignedType(node), reference); } @@ -52725,13 +51238,13 @@ var ts; } if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 208 || init.kind === 209)) { + if (init && (init.kind === 205 || init.kind === 206)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 238 && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 235 && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } return undefined; @@ -52741,7 +51254,7 @@ var ts; if (node.kind === 94) { return unreachableNeverType; } - if (node.kind === 216) { + if (node.kind === 213) { if (node.operatorToken.kind === 55) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -52772,7 +51285,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 203 ? + var expr = node.kind === 200 ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -52780,7 +51293,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256) { var evolvedType_1 = type; - if (node.kind === 203) { + if (node.kind === 200) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -52820,7 +51333,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 211 && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 208 && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -52828,7 +51341,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 | 131072)); }); } - else if (expr.kind === 211 && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 208 && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 || t.flags & 128 && t.value === "undefined"); }); } } @@ -53007,10 +51520,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 211 && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 208 && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 211 && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 208 && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -53117,7 +51630,7 @@ var ts; return type; } if (assumeTrue && type.flags & 2 && literal.text === "object") { - if (typeOfExpr.parent.parent.kind === 216) { + if (typeOfExpr.parent.parent.kind === 213) { var expr = typeOfExpr.parent.parent; if (expr.operatorToken.kind === 55 && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) { return nonPrimitiveType; @@ -53190,7 +51703,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 465829888) { + if (type.flags & 63176704) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -53305,7 +51818,10 @@ var ts; return assignableType; } } - return isTypeSubtypeOf(candidate, type) ? candidate : isTypeSubtypeOf(type, candidate) ? type : getIntersectionType([type, candidate]); + return isTypeSubtypeOf(candidate, type) ? candidate : + isTypeAssignableTo(type, candidate) ? type : + isTypeAssignableTo(candidate, type) ? candidate : + getIntersectionType([type, candidate]); } function narrowTypeByCallExpression(type, callExpression, assumeTrue) { if (hasMatchingArgument(callExpression, reference)) { @@ -53344,17 +51860,16 @@ var ts; case 78: case 107: case 105: - case 201: - case 202: + case 198: + case 199: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 203: + case 200: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 207: - case 225: + case 204: return narrowType(type, expr.expression, assumeTrue); - case 216: + case 213: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 214: + case 211: if (expr.operator === 53) { return narrowType(type, expr.operand, !assumeTrue); } @@ -53390,9 +51905,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 257 || - node.kind === 297 || - node.kind === 163; + node.kind === 254 || + node.kind === 294 || + node.kind === 162; }); } function isParameterAssigned(symbol) { @@ -53413,7 +51928,7 @@ var ts; if (node.kind === 78) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 160) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 159) { symbol.isAssigned = true; } } @@ -53428,7 +51943,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 160 && + declaration.kind === 159 && declaration.initializer && getFalsyFlags(declaredType) & 32768 && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768); @@ -53442,10 +51957,10 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 201 || - parent.kind === 203 && parent.expression === node || - parent.kind === 202 && parent.expression === node || - parent.kind === 198 && parent.name === node && !!parent.initializer; + return parent.kind === 198 || + parent.kind === 200 && parent.expression === node || + parent.kind === 199 && parent.expression === node || + parent.kind === 195 && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { return type.flags & 58982400 && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304); @@ -53477,7 +51992,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2) { - if (container.kind === 209) { + if (container.kind === 206) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasSyntacticModifier(container, 256)) { @@ -53491,13 +52006,13 @@ var ts; markAliasReferenced(symbol, node); } var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - var sourceSymbol = localOrExportSymbol.flags & 2097152 ? resolveAlias(localOrExportSymbol) : localOrExportSymbol; - if (getDeclarationNodeFlagsFromSymbol(sourceSymbol) & 134217728 && isUncalledFunctionReference(node.parent, sourceSymbol)) { - errorOrSuggestion(false, node, ts.Diagnostics._0_is_deprecated, node.escapedText); - } var declaration = localOrExportSymbol.valueDeclaration; + if (declaration && ts.getCombinedNodeFlags(declaration) & 134217728 && isUncalledFunctionReference(node.parent, localOrExportSymbol)) { + errorOrSuggestion(false, node, ts.Diagnostics._0_is_deprecated, node.escapedText); + ; + } if (localOrExportSymbol.flags & 32) { - if (declaration.kind === 252 + if (declaration.kind === 249 && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -53509,11 +52024,11 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 221) { + else if (declaration.kind === 218) { var container = ts.getThisContainer(node, false); - while (container.kind !== 297) { + while (container.kind !== 294) { if (container.parent === declaration) { - if (container.kind === 163 && ts.hasSyntacticModifier(container, 32)) { + if (container.kind === 162 && ts.hasSyntacticModifier(container, 32)) { getNodeLinks(declaration).flags |= 16777216; getNodeLinks(node).flags |= 33554432; } @@ -53557,22 +52072,22 @@ var ts; if (!declaration) { return type; } - var isParameter = ts.getRootDeclaration(declaration).kind === 160; + var isParameter = ts.getRootDeclaration(declaration).kind === 159; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; var isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && ts.isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); var isModuleExports = symbol.flags & 134217728; - while (flowContainer !== declarationContainer && (flowContainer.kind === 208 || - flowContainer.kind === 209 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 205 || + flowContainer.kind === 206 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 | 16384)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 270) || - node.parent.kind === 225 || - declaration.kind === 249 && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 267) || + node.parent.kind === 222 || + declaration.kind === 246 && declaration.exclamationToken || declaration.flags & 8388608; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -53603,7 +52118,7 @@ var ts; if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 287) { + symbol.valueDeclaration.parent.kind === 284) { return; } var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); @@ -53621,7 +52136,7 @@ var ts; if (usedInFunction) { var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 247); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -53640,7 +52155,7 @@ var ts; } } if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 247); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304; } @@ -53657,14 +52172,14 @@ var ts; } function isAssignedInBodyOfForStatement(node, container) { var current = node; - while (current.parent.kind === 207) { + while (current.parent.kind === 204) { current = current.parent; } var isAssigned = false; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 214 || current.parent.kind === 215)) { + else if ((current.parent.kind === 211 || current.parent.kind === 212)) { var expr = current.parent; isAssigned = expr.operator === 45 || expr.operator === 46; } @@ -53675,7 +52190,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2; - if (container.kind === 163 || container.kind === 166) { + if (container.kind === 162 || container.kind === 165) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4; } @@ -53706,32 +52221,32 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var capturedByArrowFunction = false; - if (container.kind === 166) { + if (container.kind === 165) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } - if (container.kind === 209) { + if (container.kind === 206) { container = ts.getThisContainer(container, false); capturedByArrowFunction = true; } switch (container.kind) { - case 256: + case 253: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 255: + case 252: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 166: + case 165: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; - case 163: case 162: + case 161: if (ts.hasSyntacticModifier(container, 32) && !(compilerOptions.target === 99 && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 158: + case 157: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -53812,7 +52327,7 @@ var ts; } } function getClassNameFromPrototypeMethod(container) { - if (container.kind === 208 && + if (container.kind === 205 && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3) { return container.parent @@ -53820,20 +52335,20 @@ var ts; .expression .expression; } - else if (container.kind === 165 && - container.parent.kind === 200 && + else if (container.kind === 164 && + container.parent.kind === 197 && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6) { return container.parent.parent.left.expression; } - else if (container.kind === 208 && - container.parent.kind === 288 && - container.parent.parent.kind === 200 && + else if (container.kind === 205 && + container.parent.kind === 285 && + container.parent.parent.kind === 197 && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6) { return container.parent.parent.parent.left.expression; } - else if (container.kind === 208 && + else if (container.kind === 205 && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -53855,7 +52370,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 308) { + if (jsdocType && jsdocType.kind === 304) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -53869,15 +52384,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 160 && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 159 && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 203 && node.parent.expression === node; + var isCallExpression = node.parent.kind === 200 && node.parent.expression === node; var immediateContainer = ts.getSuperContainer(node, true); var container = immediateContainer; var needToCaptureLexicalThis = false; if (!isCallExpression) { - while (container && container.kind === 209) { + while (container && container.kind === 206) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } @@ -53885,14 +52400,14 @@ var ts; var canUseSuperExpression = isLegalUsageOfSuperExpression(container); var nodeCheckFlag = 0; if (!canUseSuperExpression) { - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 158; }); - if (current && current.kind === 158) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 157; }); + if (current && current.kind === 157) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 200)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 197)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -53900,7 +52415,7 @@ var ts; } return errorType; } - if (!isCallExpression && immediateContainer.kind === 166) { + if (!isCallExpression && immediateContainer.kind === 165) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasSyntacticModifier(container, 32) || isCallExpression) { @@ -53910,7 +52425,7 @@ var ts; nodeCheckFlag = 256; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 165 && ts.hasSyntacticModifier(container, 256)) { + if (container.kind === 164 && ts.hasSyntacticModifier(container, 256)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096; } @@ -53921,7 +52436,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node.parent, container); } - if (container.parent.kind === 200) { + if (container.parent.kind === 197) { if (languageVersion < 2) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -53940,7 +52455,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 166 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 165 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; } @@ -53952,24 +52467,24 @@ var ts; return false; } if (isCallExpression) { - return container.kind === 166; + return container.kind === 165; } else { - if (ts.isClassLike(container.parent) || container.parent.kind === 200) { + if (ts.isClassLike(container.parent) || container.parent.kind === 197) { if (ts.hasSyntacticModifier(container, 32)) { - return container.kind === 165 || - container.kind === 164 || - container.kind === 167 || - container.kind === 168; + return container.kind === 164 || + container.kind === 163 || + container.kind === 166 || + container.kind === 167; } else { - return container.kind === 165 || - container.kind === 164 || - container.kind === 167 || - container.kind === 168 || + return container.kind === 164 || container.kind === 163 || + container.kind === 166 || + container.kind === 167 || container.kind === 162 || - container.kind === 166; + container.kind === 161 || + container.kind === 165; } } } @@ -53977,10 +52492,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 165 || - func.kind === 167 || - func.kind === 168) && func.parent.kind === 200 ? func.parent : - func.kind === 208 && func.parent.kind === 288 ? func.parent.parent : + return (func.kind === 164 || + func.kind === 166 || + func.kind === 167) && func.parent.kind === 197 ? func.parent : + func.kind === 205 && func.parent.kind === 285 ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -53992,7 +52507,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 209) { + if (func.kind === 206) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -54016,7 +52531,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 288) { + if (literal.parent.kind !== 285) { break; } literal = literal.parent.parent; @@ -54025,7 +52540,7 @@ var ts; return getWidenedType(contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral)); } var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 216 && parent.operatorToken.kind === 62) { + if (parent.kind === 213 && parent.operatorToken.kind === 62) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -54076,40 +52591,24 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 160: + case 159: return getContextuallyTypedParameterType(declaration); - case 198: + case 195: return getContextualTypeForBindingElement(declaration); - case 163: - if (ts.hasSyntacticModifier(declaration, 32)) { - return getContextualTypeForStaticPropertyDeclaration(declaration); - } } } function getContextualTypeForBindingElement(declaration) { var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 198 && parent.initializer && checkDeclarationInitializer(parent); - if (!parentType || ts.isBindingPattern(name) || ts.isComputedNonLiteralName(name)) - return undefined; - if (parent.name.kind === 197) { - var index = ts.indexOfNode(declaration.parent.elements, declaration); - if (index < 0) - return undefined; - return getContextualTypeForElementExpression(parentType, index); + parent.kind !== 195 && parent.initializer && checkDeclarationInitializer(parent); + if (parentType && !ts.isBindingPattern(name) && !ts.isComputedNonLiteralName(name)) { + var nameType = getLiteralTypeFromPropertyName(name); + if (isTypeUsableAsPropertyName(nameType)) { + var text = getPropertyNameFromType(nameType); + return getTypeOfPropertyOfType(parentType, text); + } } - var nameType = getLiteralTypeFromPropertyName(name); - if (isTypeUsableAsPropertyName(nameType)) { - var text = getPropertyNameFromType(nameType); - return getTypeOfPropertyOfType(parentType, text); - } - } - function getContextualTypeForStaticPropertyDeclaration(declaration) { - var parentType = ts.isExpression(declaration.parent) && getContextualType(declaration.parent); - if (!parentType) - return undefined; - return getTypeOfPropertyOfContextualType(parentType, getSymbolOfNode(declaration).escapedName); } function getContextualTypeForInitializerExpression(node, contextFlags) { var declaration = node.parent; @@ -54214,7 +52713,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 205) { + if (template.parent.kind === 202) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -54227,7 +52726,14 @@ var ts; case 75: case 74: case 76: - return node === right ? getContextualTypeForAssignmentDeclaration(binaryExpression) : undefined; + if (node !== right) { + return undefined; + } + var contextSensitive = getIsContextSensitiveAssignmentOrContextType(binaryExpression); + if (!contextSensitive) { + return undefined; + } + return contextSensitive === true ? getTypeOfExpression(left) : contextSensitive; case 56: case 60: var type = getContextualType(binaryExpression, contextFlags); @@ -54240,25 +52746,22 @@ var ts; return undefined; } } - function getContextualTypeForAssignmentDeclaration(binaryExpression) { + function getIsContextSensitiveAssignmentOrContextType(binaryExpression) { var kind = ts.getAssignmentDeclarationKind(binaryExpression); switch (kind) { case 0: - return getTypeOfExpression(binaryExpression.left); + return true; case 5: case 1: case 6: case 3: - if (isPossiblyAliasedThisProperty(binaryExpression, kind)) { - return getContextualTypeForThisPropertyAssignment(binaryExpression, kind); - } - else if (!binaryExpression.left.symbol) { - return getTypeOfExpression(binaryExpression.left); + if (!binaryExpression.left.symbol) { + return true; } else { var decl = binaryExpression.left.symbol.valueDeclaration; if (!decl) { - return undefined; + return false; } var lhs = ts.cast(binaryExpression.left, ts.isAccessExpression); var overallAnnotation = ts.getEffectiveTypeAnnotationNode(decl); @@ -54271,19 +52774,39 @@ var ts; if (parentSymbol) { var annotated = parentSymbol.valueDeclaration && ts.getEffectiveTypeAnnotationNode(parentSymbol.valueDeclaration); if (annotated) { - var nameStr = ts.getElementOrPropertyAccessName(lhs); - if (nameStr !== undefined) { - return getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr); + var nameStr_1 = ts.getElementOrPropertyAccessName(lhs); + if (nameStr_1 !== undefined) { + var type = getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr_1); + return type || false; } } - return undefined; + return false; } } - return ts.isInJSFile(decl) ? undefined : getTypeOfExpression(binaryExpression.left); + return !ts.isInJSFile(decl); } case 2: case 4: - return getContextualTypeForThisPropertyAssignment(binaryExpression, kind); + if (!binaryExpression.symbol) + return true; + if (binaryExpression.symbol.valueDeclaration) { + var annotated = ts.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); + if (annotated) { + var type = getTypeFromTypeNode(annotated); + if (type) { + return type; + } + } + } + if (kind === 2) + return false; + var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression); + if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, false))) { + return false; + } + var thisType = checkThisExpression(thisAccess.expression); + var nameStr = ts.getElementOrPropertyAccessName(thisAccess); + return nameStr !== undefined && thisType && getTypeOfPropertyOfContextualType(thisType, nameStr) || false; case 7: case 8: case 9: @@ -54292,40 +52815,6 @@ var ts; return ts.Debug.assertNever(kind); } } - function isPossiblyAliasedThisProperty(declaration, kind) { - if (kind === void 0) { kind = ts.getAssignmentDeclarationKind(declaration); } - if (kind === 4) { - return true; - } - if (!ts.isInJSFile(declaration) || kind !== 5 || !ts.isIdentifier(declaration.left.expression)) { - return false; - } - var name = declaration.left.expression.escapedText; - var symbol = resolveName(declaration.left, name, 111551, undefined, undefined, true, true); - return ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration); - } - function getContextualTypeForThisPropertyAssignment(binaryExpression, kind) { - if (!binaryExpression.symbol) - return getTypeOfExpression(binaryExpression.left); - if (binaryExpression.symbol.valueDeclaration) { - var annotated = ts.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); - if (annotated) { - var type = getTypeFromTypeNode(annotated); - if (type) { - return type; - } - } - } - if (kind === 2) - return undefined; - var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression); - if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, false))) { - return undefined; - } - var thisType = checkThisExpression(thisAccess.expression); - var nameStr = ts.getElementOrPropertyAccessName(thisAccess); - return nameStr !== undefined && getTypeOfPropertyOfContextualType(thisType, nameStr) || undefined; - } function isCircularMappedProperty(symbol) { return !!(ts.getCheckFlags(symbol) & 262144 && !symbol.type && findResolutionCycleStartIndex(symbol, 0) >= 0); } @@ -54384,7 +52873,7 @@ var ts; } function getContextualTypeForElementExpression(arrayContextualType, index) { return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) - || mapType(arrayContextualType, function (t) { return getIteratedTypeOrElementType(1, t, undefinedType, undefined, false); }, true)); + || getIteratedTypeOrElementType(1, arrayContextualType, undefinedType, undefined, false)); } function getContextualTypeForConditionalOperand(node, contextFlags) { var conditional = node.parent; @@ -54396,7 +52885,7 @@ var ts; if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) { return undefined; } - var realChildren = ts.getSemanticJsxChildren(node.children); + var realChildren = getSemanticJsxChildren(node.children); var childIndex = realChildren.indexOf(child); var childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName); return childFieldType && (realChildren.length === 1 ? childFieldType : mapType(childFieldType, function (t) { @@ -54438,21 +52927,21 @@ var ts; case 94: case 103: case 78: - case 150: + case 149: return true; - case 201: - case 207: + case 198: + case 204: return isPossiblyDiscriminantValue(node.expression); - case 283: + case 280: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 288 && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 285 && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 280 && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 277 && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function getApparentTypeOfContextualType(node, contextFlags) { var contextualType = ts.isObjectLiteralMethod(node) ? @@ -54473,7 +52962,7 @@ var ts; } } function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 465829888)) { + if (contextualType && maybeTypeOfKind(contextualType, 63176704)) { var inferenceContext = getInferenceContext(node); if (inferenceContext && ts.some(inferenceContext.inferences, hasInferenceCandidates)) { if (contextFlags && contextFlags & 1) { @@ -54487,7 +52976,7 @@ var ts; return contextualType; } function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 465829888) { + if (type.flags & 63176704) { return instantiateType(type, mapper); } if (type.flags & 1048576) { @@ -54507,56 +52996,56 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 249: - case 160: - case 163: + case 246: + case 159: case 162: - case 198: + case 161: + case 195: return getContextualTypeForInitializerExpression(node, contextFlags); - case 209: - case 242: + case 206: + case 239: return getContextualTypeForReturnExpression(node); - case 219: + case 216: return getContextualTypeForYieldOperand(parent); - case 213: + case 210: return getContextualTypeForAwaitOperand(parent, contextFlags); - case 203: + case 200: if (parent.expression.kind === 99) { return stringType; } - case 204: + case 201: return getContextualTypeForArgument(parent, node); - case 206: - case 224: + case 203: + case 221: return ts.isConstTypeReference(parent.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(parent.type); - case 216: + case 213: return getContextualTypeForBinaryOperand(node, contextFlags); - case 288: - case 289: + case 285: + case 286: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 290: + case 287: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 199: { + case 196: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 217: + case 214: return getContextualTypeForConditionalOperand(node, contextFlags); - case 228: - ts.Debug.assert(parent.parent.kind === 218); + case 225: + ts.Debug.assert(parent.parent.kind === 215); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 207: { + case 204: { var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 283: - return getContextualTypeForJsxExpression(parent); case 280: - case 282: + return getContextualTypeForJsxExpression(parent); + case 277: + case 279: return getContextualTypeForJsxAttribute(parent); - case 275: - case 274: + case 272: + case 271: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -54702,7 +53191,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 208 || node.kind === 209; + return node.kind === 205 || node.kind === 206; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) @@ -54710,7 +53199,7 @@ var ts; : undefined; } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 165 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -54724,8 +53213,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var current = types_18[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var current = types_17[_i]; var signature = getContextualCallSignature(current, node); if (signature) { if (!signatureList) { @@ -54754,8 +53243,8 @@ var ts; return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type; } function hasDefaultValue(node) { - return (node.kind === 198 && !!node.initializer) || - (node.kind === 216 && node.operatorToken.kind === 62); + return (node.kind === 195 && !!node.initializer) || + (node.kind === 213 && node.operatorToken.kind === 62); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -54767,7 +53256,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - if (e.kind === 220) { + if (e.kind === 217) { if (languageVersion < 2) { checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 : 2048); } @@ -54818,7 +53307,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 158: + case 157: return isNumericComputedName(name); case 78: return isNumericLiteralName(name.escapedText); @@ -54843,7 +53332,7 @@ var ts; if (!links.resolvedType) { links.resolvedType = checkExpression(node.expression); if (links.resolvedType.flags & 98304 || - !isTypeAssignableToKind(links.resolvedType, 402653316 | 296 | 12288) && + !isTypeAssignableToKind(links.resolvedType, 132 | 296 | 12288) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) { error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } @@ -54888,7 +53377,7 @@ var ts; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 196 || contextualType.pattern.kind === 200); + (contextualType.pattern.kind === 193 || contextualType.pattern.kind === 197); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -54908,13 +53397,13 @@ var ts; for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var memberDecl = _c[_b]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 158 && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 157 && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 288 || - memberDecl.kind === 289 || + if (memberDecl.kind === 285 || + memberDecl.kind === 286 || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 288 ? checkPropertyAssignment(memberDecl, checkMode) : - memberDecl.kind === 289 ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : + var type = memberDecl.kind === 285 ? checkPropertyAssignment(memberDecl, checkMode) : + memberDecl.kind === 286 ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -54935,8 +53424,8 @@ var ts; prop.nameType = nameType; } if (inDestructuringPattern) { - var isOptional = (memberDecl.kind === 288 && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 289 && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 285 && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 286 && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216; } @@ -54960,7 +53449,7 @@ var ts; member = prop; allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 290) { + else if (memberDecl.kind === 287) { if (languageVersion < 2) { checkExternalEmitHelpers(memberDecl, 2); } @@ -54984,7 +53473,7 @@ var ts; continue; } else { - ts.Debug.assert(memberDecl.kind === 167 || memberDecl.kind === 168); + ts.Debug.assert(memberDecl.kind === 166 || memberDecl.kind === 167); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576)) { @@ -55005,7 +53494,7 @@ var ts; } propertiesArray.push(member); } - if (contextualTypeHasPattern && node.parent.kind !== 290) { + if (contextualTypeHasPattern && node.parent.kind !== 287) { for (var _d = 0, _e = getPropertiesOfType(contextualType); _d < _e.length; _d++) { var prop = _e[_d]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { @@ -55046,7 +53535,7 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 465829888) { + if (type.flags & 63176704) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); @@ -55058,6 +53547,7 @@ var ts; } function checkJsxSelfClosingElementDeferred(node) { checkJsxOpeningLikeElementOrOpeningFragment(node); + resolveUntypedCall(node); } function checkJsxSelfClosingElement(node, _checkMode) { checkNodeDeferred(node); @@ -55080,7 +53570,7 @@ var ts; function checkJsxFragment(node) { checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment); var nodeSourceFile = ts.getSourceFileOfNode(node); - if (ts.getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) + if (compilerOptions.jsx === 2 && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) && !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) { error(node, compilerOptions.jsxFactory ? ts.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option @@ -55116,7 +53606,7 @@ var ts; if (ts.isJsxAttribute(attributeDecl)) { var exprType = checkJsxAttribute(attributeDecl, checkMode); objectFlags |= ts.getObjectFlags(exprType) & 3670016; - var attributeSymbol = createSymbol(4 | member.flags, member.escapedName); + var attributeSymbol = createSymbol(4 | 33554432 | member.flags, member.escapedName); attributeSymbol.declarations = member.declarations; attributeSymbol.parent = member.parent; if (member.valueDeclaration) { @@ -55131,7 +53621,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 282); + ts.Debug.assert(attributeDecl.kind === 279); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false); attributesTable = ts.createSymbolTable(); @@ -55156,7 +53646,7 @@ var ts; spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, false); } } - var parent = openingLikeElement.parent.kind === 273 ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 270 ? openingLikeElement.parent : undefined; if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") { @@ -55165,7 +53655,7 @@ var ts; } var contextualType = getApparentTypeOfContextualType(openingLikeElement.attributes); var childrenContextualType = contextualType && getTypeOfPropertyOfContextualType(contextualType, jsxChildrenPropertyName); - var childrenPropSymbol = createSymbol(4, jsxChildrenPropertyName); + var childrenPropSymbol = createSymbol(4 | 33554432, jsxChildrenPropertyName); childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && forEachType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes)); @@ -55200,9 +53690,6 @@ var ts; childrenTypes.push(stringType); } } - else if (child.kind === 283 && !child.expression) { - continue; - } else { childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); } @@ -55258,59 +53745,28 @@ var ts; } return links.resolvedSymbol; } - function getJsxNamespaceContainerForImplicitImport(location) { - var file = location && ts.getSourceFileOfNode(location); - var links = file && getNodeLinks(file); - if (links && links.jsxImplicitImportContainer === false) { - return undefined; - } - if (links && links.jsxImplicitImportContainer) { - return links.jsxImplicitImportContainer; - } - var runtimeImportSpecifier = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(compilerOptions, file), compilerOptions); - if (!runtimeImportSpecifier) { - return undefined; - } - var isClassic = ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Classic; - var errorMessage = isClassic - ? ts.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option - : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations; - var mod = resolveExternalModule(location, runtimeImportSpecifier, errorMessage, location); - var result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : undefined; - if (links) { - links.jsxImplicitImportContainer = result || false; - } - return result; - } function getJsxNamespaceAt(location) { var links = location && getNodeLinks(location); if (links && links.jsxNamespace) { return links.jsxNamespace; } if (!links || links.jsxNamespace !== false) { - var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); - if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { - var namespaceName = getJsxNamespace(location); - resolvedNamespace = resolveName(location, namespaceName, 1920, undefined, namespaceName, false); - } + var namespaceName = getJsxNamespace(location); + var resolvedNamespace = resolveName(location, namespaceName, 1920, undefined, namespaceName, false); if (resolvedNamespace) { var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920)); - if (candidate && candidate !== unknownSymbol) { + if (candidate) { if (links) { links.jsxNamespace = candidate; } return candidate; } - } - if (links) { - links.jsxNamespace = false; + if (links) { + links.jsxNamespace = false; + } } } - var s = resolveSymbol(getGlobalSymbol(JsxNames.JSX, 1920, undefined)); - if (s === unknownSymbol) { - return undefined; - } - return s; + return getGlobalSymbol(JsxNames.JSX, 1920, undefined); } function getNameFromJsxElementAttributesContainer(nameOfAttribPropContainer, jsxNamespace) { var jsxElementAttribPropInterfaceSym = jsxNamespace && getSymbol(jsxNamespace.exports, nameOfAttribPropContainer, 788968); @@ -55459,19 +53915,17 @@ var ts; checkGrammarJsxElement(node); } checkJsxPreconditions(node); - if (!getJsxNamespaceContainerForImplicitImport(node)) { - var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var jsxFactoryNamespace = getJsxNamespace(node); - var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; - var jsxFactorySym = void 0; - if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551, jsxFactoryRefErr, jsxFactoryNamespace, true); - } - if (jsxFactorySym) { - jsxFactorySym.isReferenced = 67108863; - if (jsxFactorySym.flags & 2097152 && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { - markAliasSymbolAsReferenced(jsxFactorySym); - } + var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var jsxFactoryNamespace = getJsxNamespace(node); + var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + var jsxFactorySym; + if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551, jsxFactoryRefErr, jsxFactoryNamespace, true); + } + if (jsxFactorySym) { + jsxFactorySym.isReferenced = 67108863; + if (jsxFactorySym.flags & 2097152 && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); } } if (isNodeOpeningLikeElement) { @@ -55535,7 +53989,7 @@ var ts; } function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 157 ? node.right : node.kind === 195 ? node : node.name; + var errorNode = node.kind === 156 ? node.right : node.kind === 192 ? node : node.name; if (isSuper) { if (languageVersion < 2) { if (symbolHasNonMethodDeclaration(prop)) { @@ -55665,7 +54119,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 207) { + while (node.parent.kind === 204) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -55716,10 +54170,10 @@ var ts; return false; } function isThisPropertyAccessInConstructor(node, prop) { - return (isConstructorDeclaredProperty(prop) || ts.isThisProperty(node) && isAutoTypedProperty(prop)) - && ts.getThisContainer(node, true) === getDeclaringConstructor(prop); + return ts.isThisProperty(node) && (isAutoTypedProperty(prop) || isConstructorDeclaredProperty(prop)) && ts.getThisContainer(node, true) === getDeclaringConstructor(prop); } function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right) { + var _a; var parentSymbol = getNodeLinks(left).resolvedSymbol; var assignmentKind = ts.getAssignmentTargetKind(node); var apparentType = getApparentType(assignmentKind !== 0 || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType); @@ -55780,10 +54234,10 @@ var ts; if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) { error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); } - propType = (compilerOptions.noUncheckedIndexedAccess && !ts.isAssignmentTarget(node)) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + propType = indexInfo.type; } else { - if (getDeclarationNodeFlagsFromSymbol(prop) & 134217728 && isUncalledFunctionReference(node, prop)) { + if (((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.flags) & 134217728 && isUncalledFunctionReference(node, prop)) { errorOrSuggestion(false, right, ts.Diagnostics._0_is_deprecated, right.escapedText); } checkPropertyNotUsedBeforeDeclaration(prop, node, right); @@ -55813,7 +54267,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 166 && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608)) { + if (flowContainer.kind === 165 && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608)) { assumeUninitialized = true; } } @@ -55844,8 +54298,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 252 && - node.parent.kind !== 173 && + else if (valueDeclaration.kind === 249 && + node.parent.kind !== 172 && !(valueDeclaration.flags & 8388608) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -55857,22 +54311,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 163: + case 162: return true; - case 288: - case 165: + case 285: + case 164: + case 166: case 167: - case 168: - case 290: - case 158: - case 228: - case 283: + case 287: + case 157: + case 225: case 280: - case 281: - case 282: - case 275: - case 223: - case 286: + case 277: + case 278: + case 279: + case 272: + case 220: + case 283: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -55924,22 +54378,14 @@ var ts; relatedInfo = ts.createDiagnosticForNode(propNode, ts.Diagnostics.Did_you_forget_to_use_await); } else { - var missingProperty = ts.declarationNameToString(propNode); - var container = typeToString(containingType); - var libSuggestion = getSuggestedLibForNonExistentProperty(missingProperty, containingType); - if (libSuggestion !== undefined) { - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later, missingProperty, container, libSuggestion); + var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); + if (suggestion !== undefined) { + var suggestedName = ts.symbolName(suggestion); + errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, ts.declarationNameToString(propNode), typeToString(containingType), suggestedName); + relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName); } else { - var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); - if (suggestion !== undefined) { - var suggestedName = ts.symbolName(suggestion); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, missingProperty, container, suggestedName); - relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName); - } - else { - errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, missingProperty, container); - } + errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(propNode), typeToString(containingType)); } } } @@ -55953,34 +54399,6 @@ var ts; var prop = containingType.symbol && getPropertyOfType(getTypeOfSymbol(containingType.symbol), propName); return prop !== undefined && prop.valueDeclaration && ts.hasSyntacticModifier(prop.valueDeclaration, 32); } - function getSuggestedLibForNonExistentName(name) { - var missingName = diagnosticName(name); - var allFeatures = ts.getScriptTargetFeatures(); - var libTargets = ts.getOwnKeys(allFeatures); - for (var _i = 0, libTargets_1 = libTargets; _i < libTargets_1.length; _i++) { - var libTarget = libTargets_1[_i]; - var containingTypes = ts.getOwnKeys(allFeatures[libTarget]); - if (containingTypes !== undefined && ts.contains(containingTypes, missingName)) { - return libTarget; - } - } - } - function getSuggestedLibForNonExistentProperty(missingProperty, containingType) { - var container = getApparentType(containingType).symbol; - if (!container) { - return undefined; - } - var allFeatures = ts.getScriptTargetFeatures(); - var libTargets = ts.getOwnKeys(allFeatures); - for (var _i = 0, libTargets_2 = libTargets; _i < libTargets_2.length; _i++) { - var libTarget = libTargets_2[_i]; - var featuresOfLib = allFeatures[libTarget]; - var featuresOfContainingType = featuresOfLib[ts.symbolName(container)]; - if (featuresOfContainingType !== undefined && ts.contains(featuresOfContainingType, missingProperty)) { - return libTarget; - } - } - } function getSuggestedSymbolForNonexistentProperty(name, containingType) { return getSpellingSuggestionForName(ts.isString(name) ? name : ts.idText(name), getPropertiesOfType(containingType), 111551); } @@ -56081,16 +54499,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 201: + case 198: return isValidPropertyAccessWithType(node, node.expression.kind === 105, propertyName, getWidenedType(checkExpression(node.expression))); - case 157: + case 156: return isValidPropertyAccessWithType(node, false, propertyName, getWidenedType(checkExpression(node.left))); - case 195: + case 192: return isValidPropertyAccessWithType(node, false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 201 && node.expression.kind === 105, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 198 && node.expression.kind === 105, property.escapedName, type); } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { if (type === errorType || isTypeAny(type)) { @@ -56108,7 +54526,7 @@ var ts; } function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 250) { + if (initializer.kind === 247) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -56130,7 +54548,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 238 && + if (node.kind === 235 && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -56167,7 +54585,7 @@ var ts; var accessFlags = ts.isAssignmentTarget(node) ? 2 | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 : 0) : 0; - var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, undefined, node, accessFlags | 16) || errorType; + var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType; return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node); } function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { @@ -56207,13 +54625,13 @@ var ts; if (callLikeExpressionMayHaveTypeArguments(node)) { ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 205) { + if (node.kind === 202) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 161) { + else if (node.kind !== 160) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -56262,7 +54680,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 220 || arg.kind === 227 && arg.isSpread); + return !!arg && (arg.kind === 217 || arg.kind === 224 && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -56270,18 +54688,15 @@ var ts; function acceptsVoid(t) { return !!(t.flags & 16384); } - function acceptsVoidUndefinedUnknownOrAny(t) { - return !!(t.flags & (16384 | 32768 | 2 | 1)); - } function hasCorrectArity(node, args, signature, signatureHelpTrailingComma) { if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } var argCount; var callIsIncomplete = false; var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 205) { + if (node.kind === 202) { argCount = args.length; - if (node.template.kind === 218) { + if (node.template.kind === 215) { var lastSpan = ts.last(node.template.templateSpans); callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } @@ -56291,7 +54706,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 161) { + else if (node.kind === 160) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -56304,7 +54719,7 @@ var ts; effectiveMinimumArguments = Math.min(effectiveMinimumArguments, 1); } else if (!node.arguments) { - ts.Debug.assert(node.kind === 204); + ts.Debug.assert(node.kind === 201); return getMinArgumentCount(signature) === 0; } else { @@ -56323,7 +54738,7 @@ var ts; } for (var i = argCount; i < effectiveMinimumArguments; i++) { var type = getTypeAtPosition(signature, i); - if (filterType(type, ts.isInJSFile(node) && !strictNullChecks ? acceptsVoidUndefinedUnknownOrAny : acceptsVoid).flags & 131072) { + if (filterType(type, acceptsVoid).flags & 131072) { return false; } } @@ -56381,7 +54796,7 @@ var ts; if (ts.isJsxOpeningLikeElement(node)) { return inferJsxTypeArguments(node, signature, checkMode, context); } - if (node.kind !== 161) { + if (node.kind !== 160) { var contextualType = getContextualType(node, ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); }) ? 8 : 0); if (contextualType) { var outerContext = getInferenceContext(node); @@ -56415,7 +54830,7 @@ var ts; } for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 222) { + if (arg.kind !== 219) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -56437,7 +54852,7 @@ var ts; if (index >= argCount - 1) { var arg = args[argCount - 1]; if (isSpreadArgument(arg)) { - return getMutableArrayOrTupleType(arg.kind === 227 ? arg.type : + return getMutableArrayOrTupleType(arg.kind === 224 ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode)); } } @@ -56447,24 +54862,24 @@ var ts; for (var i = index; i < argCount; i++) { var arg = args[i]; if (isSpreadArgument(arg)) { - var spreadType = arg.kind === 227 ? arg.type : checkExpression(arg.expression); + var spreadType = arg.kind === 224 ? arg.type : checkExpression(arg.expression); if (isArrayLikeType(spreadType)) { types.push(spreadType); flags.push(8); } else { - types.push(checkIteratedTypeOrElementType(33, spreadType, undefinedType, arg.kind === 220 ? arg.expression : arg)); + types.push(checkIteratedTypeOrElementType(33, spreadType, undefinedType, arg.kind === 217 ? arg.expression : arg)); flags.push(4); } } else { var contextualType = getIndexedAccessType(restType, getLiteralType(i - index)); var argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode); - var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 | 4194304 | 134217728 | 268435456); + var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 | 4194304); types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(1); } - if (arg.kind === 227 && arg.tupleNameSource) { + if (arg.kind === 224 && arg.tupleNameSource) { names.push(arg.tupleNameSource); } } @@ -56592,7 +55007,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 204) { + if (thisType && thisType !== voidType && node.kind !== 201) { var thisArgumentNode = getThisArgumentOfCall(node); var thisArgumentType = void 0; if (thisArgumentNode) { @@ -56619,7 +55034,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 222) { + if (arg.kind !== 219) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, undefined, checkMode); var checkArgType = checkMode & 4 ? getRegularTypeOfObjectLiteral(argType) : argType; @@ -56653,7 +55068,7 @@ var ts; } } function getThisArgumentOfCall(node) { - if (node.kind === 203) { + if (node.kind === 200) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -56667,17 +55082,17 @@ var ts; return result; } function getEffectiveCallArguments(node) { - if (node.kind === 205) { + if (node.kind === 202) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 218) { + if (template.kind === 215) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 161) { + if (node.kind === 160) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -56687,9 +55102,9 @@ var ts; var spreadIndex = getSpreadArgumentIndex(args); if (spreadIndex >= 0) { var effectiveArgs_1 = args.slice(0, spreadIndex); - var _loop_20 = function (i) { + var _loop_19 = function (i) { var arg = args[i]; - var spreadType = arg.kind === 220 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); + var spreadType = arg.kind === 217 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); if (spreadType && isTupleType(spreadType)) { ts.forEach(getTypeArguments(spreadType), function (t, i) { var _a; @@ -56703,7 +55118,7 @@ var ts; } }; for (var i = spreadIndex; i < args.length; i++) { - _loop_20(i); + _loop_19(i); } return effectiveArgs_1; } @@ -56713,23 +55128,23 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 252: - case 221: + case 249: + case 218: return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 160: + case 159: var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 166 ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 165 ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 163: - case 165: + case 162: + case 164: + case 166: case 167: - case 168: - var hasPropDesc = parent.kind !== 163 && languageVersion !== 0; + var hasPropDesc = parent.kind !== 162 && languageVersion !== 0; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -56740,16 +55155,16 @@ var ts; } function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 252: - case 221: + case 249: + case 218: return 1; - case 163: + case 162: return 2; - case 165: + case 164: + case 166: case 167: - case 168: return languageVersion === 0 || signature.parameters.length <= 2 ? 2 : 3; - case 160: + case 159: return 3; default: return ts.Debug.fail(); @@ -56780,20 +55195,6 @@ var ts; return ts.createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); } } - function isPromiseResolveArityError(node) { - if (!ts.isCallExpression(node) || !ts.isIdentifier(node.expression)) - return false; - var symbol = resolveName(node.expression, node.expression.escapedText, 111551, undefined, undefined, false); - var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration; - if (!decl || !ts.isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !ts.isNewExpression(decl.parent.parent) || !ts.isIdentifier(decl.parent.parent.expression)) { - return false; - } - var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(false); - if (!globalPromiseSymbol) - return false; - var constructorSymbol = getSymbolAtLocation(decl.parent.parent.expression, true); - return constructorSymbol === globalPromiseSymbol; - } function getArgumentArityError(node, signatures, args) { var min = Number.POSITIVE_INFINITY; var max = Number.NEGATIVE_INFINITY; @@ -56825,15 +55226,9 @@ var ts; } var spanArray; var related; - var error = hasRestParameter || hasSpreadArgument ? - hasRestParameter && hasSpreadArgument ? - ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more : - hasRestParameter ? - ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 : - ts.Diagnostics.Expected_0_arguments_but_got_1_or_more : - paramRange === 1 && argCount === 0 && isPromiseResolveArityError(node) ? - ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : - ts.Diagnostics.Expected_0_arguments_but_got_1; + var error = hasRestParameter || hasSpreadArgument ? hasRestParameter && hasSpreadArgument ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more : + hasRestParameter ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 : + ts.Diagnostics.Expected_0_arguments_but_got_1_or_more : ts.Diagnostics.Expected_0_arguments_but_got_1; if (closestSignature && getMinArgumentCount(closestSignature) > argCount && closestSignature.declaration) { var paramDecl = closestSignature.declaration.parameters[closestSignature.thisParameter ? argCount + 1 : argCount]; if (paramDecl) { @@ -56894,8 +55289,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 205; - var isDecorator = node.kind === 161; + var isTaggedTemplate = node.kind === 202; + var isDecorator = node.kind === 160; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray && produceDiagnostics; var typeArguments; @@ -56920,12 +55315,12 @@ var ts; var candidateForArgumentArityError; var candidateForTypeArgumentError; var result; - var signatureHelpTrailingComma = !!(checkMode & 16) && node.kind === 203 && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16) && node.kind === 200 && node.arguments.hasTrailingComma; if (candidates.length > 1) { - result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma); } if (!result) { - result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + result = chooseOverload(candidates, assignableRelation, signatureHelpTrailingComma); } if (result) { return result; @@ -56946,7 +55341,6 @@ var ts; if (last_2.declaration && candidatesForArgumentError.length > 3) { ts.addRelatedInfo(d, ts.createDiagnosticForNode(last_2.declaration, ts.Diagnostics.The_last_overload_is_declared_here)); } - addImplementationSuccessElaboration(last_2, d); diagnostics.add(d); } } @@ -56960,7 +55354,7 @@ var ts; var min_3 = Number.MAX_VALUE; var minIndex = 0; var i_1 = 0; - var _loop_21 = function (c) { + var _loop_20 = function (c) { var chain_2 = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); }; var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2); if (diags_2) { @@ -56978,22 +55372,19 @@ var ts; }; for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) { var c = candidatesForArgumentError_1[_a]; - _loop_21(c); + _loop_20(c); } var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics); ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures"); var chain = ts.chainDiagnosticMessages(ts.map(diags_3, function (d) { return typeof d.messageText === "string" ? d : d.messageText; }), ts.Diagnostics.No_overload_matches_this_call); - var related = __spreadArrays(ts.flatMap(diags_3, function (d) { return d.relatedInformation; })); - var diag = void 0; + var related = ts.flatMap(diags_3, function (d) { return d.relatedInformation; }); if (ts.every(diags_3, function (d) { return d.start === diags_3[0].start && d.length === diags_3[0].length && d.file === diags_3[0].file; })) { var _b = diags_3[0], file = _b.file, start = _b.start, length_6 = _b.length; - diag = { file: file, start: start, length: length_6, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }; + diagnostics.add({ file: file, start: start, length: length_6, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }); } else { - diag = ts.createDiagnosticForNodeFromMessageChain(node, chain, related); + diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(node, chain, related)); } - addImplementationSuccessElaboration(candidatesForArgumentError[0], diag); - diagnostics.add(diag); } } else if (candidateForArgumentArityError) { @@ -57016,26 +55407,7 @@ var ts; } } return getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray); - function addImplementationSuccessElaboration(failed, diagnostic) { - var _a, _b; - var oldCandidatesForArgumentError = candidatesForArgumentError; - var oldCandidateForArgumentArityError = candidateForArgumentArityError; - var oldCandidateForTypeArgumentError = candidateForTypeArgumentError; - var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray; - var isOverload = failedSignatureDeclarations.length > 1; - var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined; - if (implDecl) { - var candidate = getSignatureFromDeclaration(implDecl); - var isSingleNonGenericCandidate_1 = !candidate.typeParameters; - if (chooseOverload([candidate], assignableRelation, isSingleNonGenericCandidate_1)) { - ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(implDecl, ts.Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible)); - } - } - candidatesForArgumentError = oldCandidatesForArgumentError; - candidateForArgumentArityError = oldCandidateForArgumentArityError; - candidateForTypeArgumentError = oldCandidateForTypeArgumentError; - } - function chooseOverload(candidates, relation, isSingleNonGenericCandidate, signatureHelpTrailingComma) { + function chooseOverload(candidates, relation, signatureHelpTrailingComma) { if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } candidatesForArgumentError = undefined; candidateForArgumentArityError = undefined; @@ -57121,7 +55493,7 @@ var ts; } var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max; var parameters = []; - var _loop_22 = function (i) { + var _loop_21 = function (i) { var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ? i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) : i < s.parameters.length ? s.parameters[i] : undefined; }); @@ -57129,7 +55501,7 @@ var ts; parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); }))); }; for (var i = 0; i < maxNonRestParam; i++) { - _loop_22(i); + _loop_21(i); } var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; }); var flags = 0; @@ -57364,7 +55736,7 @@ var ts; } var declaration = signature.declaration; var modifiers = ts.getSelectedEffectiveModifierFlags(declaration, 24); - if (!modifiers || declaration.kind !== 166) { + if (!modifiers || declaration.kind !== 165) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -57395,8 +55767,8 @@ var ts; if (apparentType.flags & 1048576) { var types = apparentType.types; var hasSignatures = false; - for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { - var constituent = types_19[_i]; + for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { + var constituent = types_18[_i]; var signatures = getSignaturesOfType(constituent, kind); if (signatures.length !== 0) { hasSignatures = true; @@ -57484,11 +55856,6 @@ var ts; return resolveUntypedCall(node); } if (!callSignatures.length) { - if (ts.isArrayLiteralExpression(node.parent)) { - var diagnostic = ts.createDiagnosticForNode(node.tag, ts.Diagnostics.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked); - diagnostics.add(diagnostic); - return resolveErrorCall(node); - } invocationError(node.tag, apparentType, 0); return resolveErrorCall(node); } @@ -57496,16 +55863,16 @@ var ts; } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 252: - case 221: + case 249: + case 218: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 160: + case 159: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 163: + case 162: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 165: + case 164: + case 166: case 167: - case 168: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -57556,10 +55923,6 @@ var ts; var result = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); var fakeSignature = createSignatureForJSXIntrinsic(node, result); checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), undefined, 0), result, node.tagName, node.attributes); - if (ts.length(node.typeArguments)) { - ts.forEach(node.typeArguments, checkSourceElement); - diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), node.typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, 0, ts.length(node.typeArguments))); - } return fakeSignature; } var exprTypes = checkExpression(node.tagName); @@ -57586,16 +55949,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 203: + case 200: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 204: + case 201: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 205: + case 202: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 161: + case 160: return resolveDecorator(node, candidatesOutArray, checkMode); - case 275: - case 274: + case 272: + case 271: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -57651,61 +56014,20 @@ var ts; } } function getAssignedClassSymbol(decl) { - var _a; - var assignmentSymbol = decl && getSymbolOfExpando(decl, true); - var prototype = (_a = assignmentSymbol === null || assignmentSymbol === void 0 ? void 0 : assignmentSymbol.exports) === null || _a === void 0 ? void 0 : _a.get("prototype"); - var init = (prototype === null || prototype === void 0 ? void 0 : prototype.valueDeclaration) && getAssignedJSPrototype(prototype.valueDeclaration); + var assignmentSymbol = decl && decl.parent && + (ts.isFunctionDeclaration(decl) && getSymbolOfNode(decl) || + ts.isBinaryExpression(decl.parent) && getSymbolOfNode(decl.parent.left) || + ts.isVariableDeclaration(decl.parent) && getSymbolOfNode(decl.parent)); + var prototype = assignmentSymbol && assignmentSymbol.exports && assignmentSymbol.exports.get("prototype"); + var init = prototype && prototype.valueDeclaration && getAssignedJSPrototype(prototype.valueDeclaration); return init ? getSymbolOfNode(init) : undefined; } - function getSymbolOfExpando(node, allowDeclaration) { - if (!node.parent) { - return undefined; - } - var name; - var decl; - if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) { - if (!ts.isInJSFile(node) && !(ts.isVarConst(node.parent) && ts.isFunctionLikeDeclaration(node))) { - return undefined; - } - name = node.parent.name; - decl = node.parent; - } - else if (ts.isBinaryExpression(node.parent)) { - var parentNode = node.parent; - var parentNodeOperator = node.parent.operatorToken.kind; - if (parentNodeOperator === 62 && (allowDeclaration || parentNode.right === node)) { - name = parentNode.left; - decl = name; - } - else if (parentNodeOperator === 56 || parentNodeOperator === 60) { - if (ts.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { - name = parentNode.parent.name; - decl = parentNode.parent; - } - else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 && (allowDeclaration || parentNode.parent.right === parentNode)) { - name = parentNode.parent.left; - decl = name; - } - if (!name || !ts.isBindableStaticNameExpression(name) || !ts.isSameEntityName(name, parentNode.left)) { - return undefined; - } - } - } - else if (allowDeclaration && ts.isFunctionDeclaration(node)) { - name = node.name; - decl = node; - } - if (!decl || !name || (!allowDeclaration && !ts.getExpandoInitializer(node, ts.isPrototypeAccess(name)))) { - return undefined; - } - return getSymbolOfNode(decl); - } function getAssignedJSPrototype(node) { if (!node.parent) { return false; } var parent = node.parent; - while (parent && parent.kind === 201) { + while (parent && parent.kind === 198) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62) { @@ -57725,12 +56047,12 @@ var ts; if (node.expression.kind === 105) { return voidType; } - if (node.kind === 204) { + if (node.kind === 201) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 166 && - declaration.kind !== 170 && - declaration.kind !== 175 && + declaration.kind !== 165 && + declaration.kind !== 169 && + declaration.kind !== 174 && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { if (noImplicitAny) { @@ -57746,7 +56068,7 @@ var ts; if (returnType.flags & 12288 && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 203 && node.parent.kind === 233 && + if (node.kind === 200 && node.parent.kind === 230 && returnType.flags & 16384 && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -57757,11 +56079,14 @@ var ts; } } if (ts.isInJSFile(node)) { - var jsSymbol = getSymbolOfExpando(node, false); - if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) { - var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined); - jsAssignmentType.objectFlags |= 16384; - return getIntersectionType([returnType, jsAssignmentType]); + var decl = ts.getDeclarationOfExpando(node); + if (decl) { + var jsSymbol = getSymbolOfNode(decl); + if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) { + var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined); + jsAssignmentType.objectFlags |= 16384; + return getIntersectionType([returnType, jsAssignmentType]); + } } } return returnType; @@ -57775,20 +56100,20 @@ var ts; function getDeprecatedSuggestionNode(node) { node = ts.skipParentheses(node); switch (node.kind) { - case 203: - case 161: - case 204: - return getDeprecatedSuggestionNode(node.expression); - case 205: - return getDeprecatedSuggestionNode(node.tag); - case 275: - case 274: - return getDeprecatedSuggestionNode(node.tagName); - case 202: - return node.argumentExpression; + case 200: + case 160: case 201: + return getDeprecatedSuggestionNode(node.expression); + case 202: + return getDeprecatedSuggestionNode(node.tag); + case 272: + case 271: + return getDeprecatedSuggestionNode(node.tagName); + case 199: + return node.argumentExpression; + case 198: return node.name; - case 173: + case 172: var typeReference = node; return ts.isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference; default: @@ -57843,7 +56168,6 @@ var ts; if (hasSyntheticDefault) { var memberTable = ts.createSymbolTable(); var newSymbol = createSymbol(2097152, "default"); - newSymbol.parent = originalSymbol; newSymbol.nameType = getLiteralType("default"); newSymbol.target = resolveSymbol(symbol); memberTable.set("default", newSymbol); @@ -57874,9 +56198,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 - ? 251 + ? 248 : resolvedRequire.flags & 3 - ? 249 + ? 246 : 0; if (targetDeclarationKind !== 0) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -57905,19 +56229,18 @@ var ts; case 9: case 109: case 94: - case 199: - case 200: - case 218: + case 196: + case 197: return true; - case 207: + case 204: return isValidConstAssertionArgument(node.expression); - case 214: + case 211: var op = node.operator; var arg = node.operand; return op === 40 && (arg.kind === 8 || arg.kind === 9) || op === 39 && arg.kind === 8; - case 201: - case 202: + case 198: + case 199: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -57973,7 +56296,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 166) { + else if (container.kind === 165) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -57983,8 +56306,8 @@ var ts; } } function checkImportMetaProperty(node) { - if (moduleKind !== ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) { - error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system); + if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) { + error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system); } var file = ts.getSourceFileOfNode(node); ts.Debug.assert(!!(file.flags & 2097152), "Containing file is missing import meta node flag."); @@ -58020,7 +56343,7 @@ var ts; return restParameter.escapedName; } function isValidDeclarationForTupleLabel(d) { - return d.kind === 192 || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name)); + return d.kind === 191 || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name)); } function getNameableDeclarationAtPosition(signature, pos) { var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); @@ -58090,40 +56413,21 @@ var ts; } return length; } - function getMinArgumentCount(signature, flags) { - var strongArityForUntypedJS = flags & 1; - var voidIsNonOptional = flags & 2; - if (voidIsNonOptional || signature.resolvedMinArgumentCount === undefined) { - var minArgumentCount = void 0; - if (signatureHasRestParameter(signature)) { - var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - if (isTupleType(restType)) { - var firstOptionalIndex = ts.findIndex(restType.target.elementFlags, function (f) { return !(f & 1); }); - var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; - if (requiredCount > 0) { - minArgumentCount = signature.parameters.length - 1 + requiredCount; - } + function getMinArgumentCount(signature, strongArityForUntypedJS) { + if (signatureHasRestParameter(signature)) { + var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + if (isTupleType(restType)) { + var firstOptionalIndex = ts.findIndex(restType.target.elementFlags, function (f) { return !(f & 1); }); + var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; + if (requiredCount > 0) { + return signature.parameters.length - 1 + requiredCount; } } - if (minArgumentCount === undefined) { - if (!strongArityForUntypedJS && signature.flags & 16) { - return 0; - } - minArgumentCount = signature.minArgumentCount; - } - if (voidIsNonOptional) { - return minArgumentCount; - } - for (var i = minArgumentCount - 1; i >= 0; i--) { - var type = getTypeAtPosition(signature, i); - if (filterType(type, acceptsVoid).flags & 131072) { - break; - } - minArgumentCount = i; - } - signature.resolvedMinArgumentCount = minArgumentCount; } - return signature.resolvedMinArgumentCount; + if (!strongArityForUntypedJS && signature.flags & 16) { + return 0; + } + return signature.minArgumentCount; } function hasEffectiveRestParameter(signature) { if (signatureHasRestParameter(signature)) { @@ -58277,7 +56581,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 230) { + if (func.body.kind !== 227) { returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8); if (isAsync) { returnType = checkAwaitedType(returnType, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); @@ -58427,7 +56731,7 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 211) { + if (node.expression.kind === 208) { var operandType = getTypeOfExpression(node.expression.expression); var witnesses = getSwitchClauseTypeOfWitnesses(node, false); var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, true); @@ -58482,11 +56786,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 208: - case 209: + case 205: + case 206: return true; - case 165: - return func.parent.kind === 200; + case 164: + return func.parent.kind === 197; default: return false; } @@ -58500,7 +56804,7 @@ var ts; if (type && maybeTypeOfKind(type, 1 | 16384)) { return; } - if (func.kind === 164 || ts.nodeIsMissing(func.body) || func.body.kind !== 230 || !functionHasImplicitReturn(func)) { + if (func.kind === 163 || ts.nodeIsMissing(func.body) || func.body.kind !== 227 || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512; @@ -58527,7 +56831,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 165 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); if (checkMode && checkMode & 4 && isContextSensitive(node)) { if (!ts.getEffectiveReturnTypeNode(node) && !hasContextSensitiveParameters(node)) { @@ -58547,7 +56851,7 @@ var ts; return anyFunctionType; } var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 208) { + if (!hasGrammarError && node.kind === 205) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -58588,7 +56892,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 165 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -58596,7 +56900,7 @@ var ts; if (!ts.getEffectiveReturnTypeNode(node)) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 230) { + if (node.body.kind === 227) { checkSourceElement(node.body); } else { @@ -58668,7 +56972,7 @@ var ts; ts.isAccessExpression(expr) && expr.expression.kind === 107) { var ctor = ts.getContainingFunction(expr); - if (!(ctor && (ctor.kind === 166 || isJSConstructor(ctor)))) { + if (!(ctor && (ctor.kind === 165 || isJSConstructor(ctor)))) { return true; } if (symbol.valueDeclaration) { @@ -58692,7 +56996,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 263; + return !!declaration && declaration.kind === 260; } } } @@ -58770,7 +57074,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 166 && (ts.getFunctionFlags(func) & 2) === 0) { + if (func && func.kind !== 165 && (ts.getFunctionFlags(func) & 2) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -58867,8 +57171,8 @@ var ts; } if (type.flags & 3145728) { var types = type.types; - for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { - var t = types_20[_i]; + for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { + var t = types_19[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -58885,7 +57189,7 @@ var ts; } return !!(kind & 296) && isTypeAssignableTo(source, numberType) || !!(kind & 2112) && isTypeAssignableTo(source, bigintType) || - !!(kind & 402653316) && isTypeAssignableTo(source, stringType) || + !!(kind & 132) && isTypeAssignableTo(source, stringType) || !!(kind & 528) && isTypeAssignableTo(source, booleanType) || !!(kind & 16384) && isTypeAssignableTo(source, voidType) || !!(kind & 131072) && isTypeAssignableTo(source, neverType) || @@ -58924,8 +57228,8 @@ var ts; } leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); - if (!(allTypesAssignableToKind(leftType, 402653316 | 296 | 12288) || - isTypeAssignableToKind(leftType, 4194304 | 134217728 | 268435456 | 262144))) { + if (!(allTypesAssignableToKind(leftType, 132 | 296 | 12288) || + isTypeAssignableToKind(leftType, 4194304 | 262144))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } if (!allTypesAssignableToKind(rightType, 67108864 | 58982400)) { @@ -58947,7 +57251,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 288 || property.kind === 289) { + if (property.kind === 285 || property.kind === 286) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -58958,11 +57262,11 @@ var ts; checkPropertyAccessibility(property, false, objectLiteralType, prop); } } - var elementType = getIndexedAccessType(objectLiteralType, exprType, undefined, name, undefined, undefined, 16); + var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 289 ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 286 ? property : property.initializer, type); } - else if (property.kind === 290) { + else if (property.kind === 287) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -58993,26 +57297,21 @@ var ts; if (languageVersion < 2 && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512); } - var possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 | 128, sourceType, undefinedType, node) || errorType; - var inBoundsType = compilerOptions.noUncheckedIndexedAccess ? undefined : possiblyOutOfBoundsType; + var elementType = checkIteratedTypeOrElementType(65, sourceType, undefinedType, node) || errorType; for (var i = 0; i < elements.length; i++) { - var type = possiblyOutOfBoundsType; - if (node.elements[i].kind === 220) { - type = inBoundsType = inBoundsType !== null && inBoundsType !== void 0 ? inBoundsType : (checkIteratedTypeOrElementType(65, sourceType, undefinedType, node) || errorType); - } - checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode); + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode); } return sourceType; } function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 222) { - if (element.kind !== 220) { + if (element.kind !== 219) { + if (element.kind !== 217) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { - var accessFlags = 16 | (hasDefaultValue(element) ? 8 : 0); - var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, undefined, createSyntheticExpression(element, indexType), accessFlags) || errorType; + var accessFlags = hasDefaultValue(element) ? 8 : 0; + var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, createSyntheticExpression(element, indexType), accessFlags) || errorType; var assignedType = hasDefaultValue(element) ? getTypeWithFacts(elementType_2, 524288) : elementType_2; var type = getFlowTypeOfDestructuring(element, assignedType); return checkDestructuringAssignment(element, type, checkMode); @@ -59024,7 +57323,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 216 && restExpression.operatorToken.kind === 62) { + if (restExpression.kind === 213 && restExpression.operatorToken.kind === 62) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -59040,7 +57339,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 289) { + if (exprOrAssignment.kind === 286) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { if (strictNullChecks && @@ -59054,24 +57353,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 216 && target.operatorToken.kind === 62) { + if (target.kind === 213 && target.operatorToken.kind === 62) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 200) { + if (target.kind === 197) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 199) { + if (target.kind === 196) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 290 ? + var error = target.parent.kind === 287 ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 290 ? + var optionalError = target.parent.kind === 287 ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -59088,36 +57387,36 @@ var ts; case 78: case 10: case 13: - case 205: - case 218: + case 202: + case 215: case 14: case 8: case 9: case 109: case 94: case 103: - case 150: + case 149: + case 205: + case 218: + case 206: + case 196: + case 197: case 208: - case 221: - case 209: - case 199: - case 200: - case 211: - case 225: - case 274: - case 273: + case 222: + case 271: + case 270: return true; - case 217: + case 214: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 216: + case 213: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 214: - case 215: + case 211: + case 212: switch (node.operator) { case 53: case 39: @@ -59126,9 +57425,9 @@ var ts; return true; } return false; - case 212: - case 206: - case 224: + case 209: + case 203: + case 221: default: return false; } @@ -59154,7 +57453,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 && (node.left.kind === 200 || node.left.kind === 199)) { + if (operator === 62 && (node.left.kind === 197 || node.left.kind === 196)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 107)); break; } @@ -59215,7 +57514,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 && (left.kind === 200 || left.kind === 199)) { + if (operator === 62 && (left.kind === 197 || left.kind === 196)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 107); } var leftType; @@ -59301,7 +57600,7 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeAssignableToKind(leftType, 402653316) && !isTypeAssignableToKind(rightType, 402653316)) { + if (!isTypeAssignableToKind(leftType, 132) && !isTypeAssignableToKind(rightType, 132)) { leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); } @@ -59312,7 +57611,7 @@ var ts; else if (isTypeAssignableToKind(leftType, 2112, true) && isTypeAssignableToKind(rightType, 2112, true)) { resultType = bigintType; } - else if (isTypeAssignableToKind(leftType, 402653316, true) || isTypeAssignableToKind(rightType, 402653316, true)) { + else if (isTypeAssignableToKind(leftType, 132, true) || isTypeAssignableToKind(rightType, 132, true)) { resultType = stringType; } else if (isTypeAny(leftType) || isTypeAny(rightType)) { @@ -59322,7 +57621,7 @@ var ts; return resultType; } if (!resultType) { - var closeEnoughKind_1 = 296 | 2112 | 402653316 | 3; + var closeEnoughKind_1 = 296 | 2112 | 132 | 3; reportOperatorError(function (left, right) { return isTypeAssignableToKind(left, closeEnoughKind_1) && isTypeAssignableToKind(right, closeEnoughKind_1); @@ -59603,21 +57902,15 @@ var ts; return getUnionType([type1, type2], 2); } function checkTemplateExpression(node) { - var texts = [node.head.text]; - var types = []; - for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) { - var span = _a[_i]; - var type = checkExpression(span.expression); - if (maybeTypeOfKind(type, 12288)) { - error(span.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); + ts.forEach(node.templateSpans, function (templateSpan) { + if (maybeTypeOfKind(checkExpression(templateSpan.expression), 12288)) { + error(templateSpan.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); } - texts.push(span.literal.text); - types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType); - } - return isConstContext(node) ? getTemplateLiteralType(texts, types) : stringType; + }); + return stringType; } function getContextNode(node) { - if (node.kind === 281 && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 278 && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; } return node; @@ -59657,13 +57950,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 206 || node.kind === 224; + return node.kind === 203 || node.kind === 221; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, undefined, 0) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 197 && + return ts.isParameter(declaration) && declaration.name.kind === 194 && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -59673,7 +57966,7 @@ var ts; var elementFlags = type.target.elementFlags.slice(); for (var i = getTypeReferenceArity(type); i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 198 && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 195 && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, false, false) : anyType); elementFlags.push(2); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { @@ -59711,7 +58004,7 @@ var ts; maybeTypeOfKind(constraint, 4096) && maybeTypeOfKind(candidateType, 8192) || isLiteralOfContextualType(candidateType, constraint); } - return !!(contextualType.flags & (128 | 4194304 | 134217728 | 268435456) && maybeTypeOfKind(candidateType, 128) || + return !!(contextualType.flags & (128 | 4194304) && maybeTypeOfKind(candidateType, 128) || contextualType.flags & 256 && maybeTypeOfKind(candidateType, 256) || contextualType.flags & 2048 && maybeTypeOfKind(candidateType, 2048) || contextualType.flags & 512 && maybeTypeOfKind(candidateType, 512) || @@ -59723,7 +58016,7 @@ var ts; var parent = node.parent; return ts.isAssertionExpression(parent) && ts.isConstTypeReference(parent.type) || (ts.isParenthesizedExpression(parent) || ts.isArrayLiteralExpression(parent) || ts.isSpreadElement(parent)) && isConstContext(parent) || - (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent) || ts.isTemplateSpan(parent)) && isConstContext(parent.parent); + (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent)) && isConstContext(parent.parent); } function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) { var type = checkExpression(node, checkMode, forceTuple); @@ -59732,14 +58025,14 @@ var ts; getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType(node) : contextualType, node)); } function checkPropertyAssignment(node, checkMode) { - if (node.name.kind === 158) { + if (node.name.kind === 157) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); } function checkObjectLiteralMethod(node, checkMode) { checkGrammarMethod(node); - if (node.name.kind === 158) { + if (node.name.kind === 157) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -59921,7 +58214,6 @@ var ts; } } function checkExpression(node, checkMode, forceTuple) { - ts.tracing.push("check", "checkExpression", { kind: node.kind, pos: node.pos, end: node.end }); var saveCurrentNode = currentNode; currentNode = node; instantiationCount = 0; @@ -59931,15 +58223,14 @@ var ts; checkConstEnumAccess(node, type); } currentNode = saveCurrentNode; - ts.tracing.pop(); return type; } function checkConstEnumAccess(node, type) { - var ok = (node.parent.kind === 201 && node.parent.expression === node) || - (node.parent.kind === 202 && node.parent.expression === node) || - ((node.kind === 78 || node.kind === 157) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 176 && node.parent.exprName === node)) || - (node.parent.kind === 270); + var ok = (node.parent.kind === 198 && node.parent.expression === node) || + (node.parent.kind === 199 && node.parent.expression === node) || + ((node.kind === 78 || node.kind === 156) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 175 && node.parent.exprName === node)) || + (node.parent.kind === 267); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -59962,9 +58253,9 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { - case 221: - case 208: - case 209: + case 218: + case 205: + case 206: cancellationToken.throwIfCancellationRequested(); } } @@ -59990,77 +58281,77 @@ var ts; return trueType; case 94: return falseType; - case 218: + case 215: return checkTemplateExpression(node); case 13: return globalRegExpType; - case 199: + case 196: return checkArrayLiteral(node, checkMode, forceTuple); - case 200: + case 197: return checkObjectLiteral(node, checkMode); - case 201: + case 198: return checkPropertyAccessExpression(node); - case 157: + case 156: return checkQualifiedName(node); - case 202: + case 199: return checkIndexedAccess(node); - case 203: + case 200: if (node.expression.kind === 99) { return checkImportCallExpression(node); } - case 204: + case 201: return checkCallExpression(node, checkMode); - case 205: + case 202: return checkTaggedTemplateExpression(node); - case 207: + case 204: return checkParenthesizedExpression(node, checkMode); - case 221: + case 218: return checkClassExpression(node); - case 208: - case 209: - return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 211: - return checkTypeOfExpression(node); + case 205: case 206: - case 224: + return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + case 208: + return checkTypeOfExpression(node); + case 203: + case 221: return checkAssertion(node); - case 225: - return checkNonNullAssertion(node); - case 226: - return checkMetaProperty(node); - case 210: - return checkDeleteExpression(node); - case 212: - return checkVoidExpression(node); - case 213: - return checkAwaitExpression(node); - case 214: - return checkPrefixUnaryExpression(node); - case 215: - return checkPostfixUnaryExpression(node); - case 216: - return checkBinaryExpression(node, checkMode); - case 217: - return checkConditionalExpression(node, checkMode); - case 220: - return checkSpreadExpression(node, checkMode); case 222: - return undefinedWideningType; + return checkNonNullAssertion(node); + case 223: + return checkMetaProperty(node); + case 207: + return checkDeleteExpression(node); + case 209: + return checkVoidExpression(node); + case 210: + return checkAwaitExpression(node); + case 211: + return checkPrefixUnaryExpression(node); + case 212: + return checkPostfixUnaryExpression(node); + case 213: + return checkBinaryExpression(node, checkMode); + case 214: + return checkConditionalExpression(node, checkMode); + case 217: + return checkSpreadExpression(node, checkMode); case 219: + return undefinedWideningType; + case 216: return checkYieldExpression(node); - case 227: + case 224: return checkSyntheticExpression(node); - case 283: + case 280: return checkJsxExpression(node, checkMode); - case 273: + case 270: return checkJsxElement(node, checkMode); - case 274: + case 271: return checkJsxSelfClosingElement(node, checkMode); - case 277: + case 274: return checkJsxFragment(node); - case 281: + case 278: return checkJsxAttributes(node, checkMode); - case 275: + case 272: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -60090,10 +58381,10 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasSyntacticModifier(node, 92)) { - if (!(func.kind === 166 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 165 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 166 && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 165 && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -60104,13 +58395,13 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 166 || func.kind === 170 || func.kind === 175) { + if (func.kind === 165 || func.kind === 169 || func.kind === 174) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 209) { + if (func.kind === 206) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 167 || func.kind === 168) { + if (func.kind === 166 || func.kind === 167) { error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -60164,13 +58455,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 209: - case 169: - case 251: - case 208: - case 174: - case 165: + case 206: + case 168: + case 248: + case 205: + case 173: case 164: + case 163: var parent = node.parent; if (node === parent.type) { return parent; @@ -60188,7 +58479,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 197 || name.kind === 196) { + else if (name.kind === 194 || name.kind === 193) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -60196,12 +58487,12 @@ var ts; } } function checkSignatureDeclaration(node) { - if (node.kind === 171) { + if (node.kind === 170) { checkGrammarIndexSignature(node); } - else if (node.kind === 174 || node.kind === 251 || node.kind === 175 || - node.kind === 169 || node.kind === 166 || - node.kind === 170) { + else if (node.kind === 173 || node.kind === 248 || node.kind === 174 || + node.kind === 168 || node.kind === 165 || + node.kind === 169) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -60226,10 +58517,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 170: + case 169: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 169: + case 168: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -60253,7 +58544,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 171 && node.kind !== 308) { + if (node.kind !== 170 && node.kind !== 304) { registerForUnusedIdentifiersCheck(node); } } @@ -60264,7 +58555,7 @@ var ts; var privateIdentifiers = new ts.Map(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 166) { + if (member.kind === 165) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -60284,16 +58575,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 167: + case 166: addName(names, name, memberName, 1); break; - case 168: + case 167: addName(names, name, memberName, 2); break; - case 163: + case 162: addName(names, name, memberName, 3); break; - case 165: + case 164: addName(names, name, memberName, 8); break; } @@ -60345,7 +58636,7 @@ var ts; var names = new ts.Map(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 162) { + if (member.kind === 161) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -60370,7 +58661,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 253) { + if (node.kind === 250) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -60385,7 +58676,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 147: + case 146: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -60393,7 +58684,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 144: + case 143: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -60429,7 +58720,7 @@ var ts; error(node, ts.Diagnostics.A_method_cannot_be_named_with_a_private_identifier); } checkFunctionOrMethodDeclaration(node); - if (ts.hasSyntacticModifier(node, 128) && node.kind === 165 && node.body) { + if (ts.hasSyntacticModifier(node, 128) && node.kind === 164 && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -60453,7 +58744,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 163 && + return n.kind === 162 && !ts.hasSyntacticModifier(n, 32) && !!n.initializer; } @@ -60474,7 +58765,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_4 = statements; _i < statements_4.length; _i++) { var statement = statements_4[_i]; - if (statement.kind === 233 && ts.isSuperCall(statement.expression)) { + if (statement.kind === 230 && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -60498,21 +58789,21 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 167) { + if (node.kind === 166) { if (!(node.flags & 8388608) && ts.nodeIsPresent(node.body) && (node.flags & 256)) { if (!(node.flags & 512)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); } } } - if (node.name.kind === 158) { + if (node.name.kind === 157) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { error(node.name, ts.Diagnostics.An_accessor_cannot_be_named_with_a_private_identifier); } if (!hasNonBindableDynamicName(node)) { - var otherKind = node.kind === 167 ? 168 : 167; + var otherKind = node.kind === 166 ? 167 : 166; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getEffectiveModifierFlags(node); @@ -60528,7 +58819,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 167) { + if (node.kind === 166) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -60576,7 +58867,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 173 && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 172 && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -60625,27 +58916,28 @@ var ts; function checkTupleType(node) { var elementTypes = node.elements; var seenOptionalElement = false; - var seenRestElement = false; - var hasNamedElement = ts.some(elementTypes, ts.isNamedTupleMember); + var seenNamedElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind !== 192 && hasNamedElement) { + if (e.kind === 191) { + seenNamedElement = true; + } + else if (seenNamedElement) { grammarErrorOnNode(e, ts.Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names); break; } var flags = getTupleElementFlags(e); if (flags & 8) { - var type = getTypeFromTypeNode(e.type); - if (!isArrayLikeType(type)) { + if (!isArrayLikeType(getTypeFromTypeNode(e.type))) { error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); break; } - if (isArrayType(type) || isTupleType(type) && type.target.combinedFlags & 4) { - seenRestElement = true; - } } else if (flags & 4) { - seenRestElement = true; + if (i !== elementTypes.length - 1) { + grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); + break; + } } else if (flags & 2) { seenOptionalElement = true; @@ -60654,17 +58946,11 @@ var ts; grammarErrorOnNode(e, ts.Diagnostics.A_required_element_cannot_follow_an_optional_element); break; } - if (seenRestElement && i !== elementTypes.length - 1) { - grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); - break; - } } ts.forEach(node.elements, checkSourceElement); - getTypeFromTypeNode(node); } function checkUnionOrIntersectionType(node) { ts.forEach(node.types, checkSourceElement); - getTypeFromTypeNode(node); } function checkIndexedAccessIndexType(type, accessNode) { if (!(type.flags & 8388608)) { @@ -60673,7 +58959,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, false))) { - if (accessNode.kind === 202 && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 199 && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 && getMappedTypeModifiers(objectType) & 1) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -60703,20 +58989,13 @@ var ts; } function checkMappedType(node) { checkSourceElement(node.typeParameter); - checkSourceElement(node.nameType); checkSourceElement(node.type); if (!node.type) { reportImplicitAny(node, anyType); } var type = getTypeFromMappedTypeNode(node); - var nameType = getNameTypeFromMappedType(type); - if (nameType) { - checkTypeAssignableTo(nameType, keyofConstraintType, node.nameType); - } - else { - var constraintType = getConstraintTypeFromMappedType(type); - checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter)); - } + var constraintType = getConstraintTypeFromMappedType(type); + checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter)); } function checkThisType(node) { getTypeFromThisTypeNode(node); @@ -60729,21 +59008,12 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 184 && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 183 && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); registerForUnusedIdentifiersCheck(node); } - function checkTemplateLiteralType(node) { - for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) { - var span = _a[_i]; - checkSourceElement(span.type); - var type = getTypeFromTypeNode(span.type); - checkTypeAssignableTo(type, templateConstraintType, span.type); - } - getTypeFromTypeNode(node); - } function checkImportType(node) { checkSourceElement(node.argument); getTypeFromTypeNode(node); @@ -60752,10 +59022,10 @@ var ts; if (node.dotDotDotToken && node.questionToken) { grammarErrorOnNode(node, ts.Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest); } - if (node.type.kind === 180) { + if (node.type.kind === 179) { grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type); } - if (node.type.kind === 181) { + if (node.type.kind === 180) { grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type); } checkSourceElement(node.type); @@ -60766,9 +59036,9 @@ var ts; } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedModifierFlags(n); - if (n.parent.kind !== 253 && - n.parent.kind !== 252 && - n.parent.kind !== 221 && + if (n.parent.kind !== 250 && + n.parent.kind !== 249 && + n.parent.kind !== 218 && n.flags & 8388608) { if (!(flags & 2) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { flags |= 1; @@ -60849,7 +59119,7 @@ var ts; ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 165 || node.kind === 164) && + var reportError = (node.kind === 164 || node.kind === 163) && ts.hasSyntacticModifier(node, 32) !== ts.hasSyntacticModifier(subsequentNode, 32); if (reportError) { var diagnostic = ts.hasSyntacticModifier(node, 32) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; @@ -60884,14 +59154,14 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608; - var inAmbientContextOrInterface = node.parent && (node.parent.kind === 253 || node.parent.kind === 177) || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 250 || node.parent.kind === 176 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if ((node.kind === 252 || node.kind === 221) && !inAmbientContext) { + if ((node.kind === 249 || node.kind === 218) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 251 || node.kind === 165 || node.kind === 164 || node.kind === 166) { + if (node.kind === 248 || node.kind === 164 || node.kind === 163 || node.kind === 165) { functionDeclarations.push(node); var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; @@ -61011,38 +59281,38 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 253: - case 254: - case 331: - case 324: - case 325: + case 250: + case 251: + case 327: + case 320: + case 321: return 2; - case 256: + case 253: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 ? 4 | 1 : 4; + case 249: case 252: - case 255: - case 291: + case 288: return 2 | 1; - case 297: + case 294: return 2 | 1 | 4; - case 266: + case 263: if (!ts.isEntityNameExpression(d.expression)) { return 1; } d = d.expression; + case 257: case 260: - case 263: - case 262: - var result_12 = 0; + case 259: + var result_11 = 0; var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result_12 |= getDeclarationSpaces(d); }); - return result_12; - case 249: - case 198: - case 251: - case 265: + ts.forEach(target.declarations, function (d) { result_11 |= getDeclarationSpaces(d); }); + return result_11; + case 246: + case 195: + case 248: + case 262: case 78: return 1; default: @@ -61200,22 +59470,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 252: + case 249: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 160: + case 159: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 163: + case 162: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 165: + case 164: + case 166: case 167: - case 168: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -61251,30 +59521,30 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 183: case 182: + case 181: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 184: + case 183: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 186: - case 192: + case 185: + case 191: return getEntityNameForDecoratorMetadata(node.type); - case 173: + case 172: return node.typeName; } } } function getEntityNameForDecoratorMetadataFromTypeList(types) { var commonEntityName; - for (var _i = 0, types_21 = types; _i < types_21.length; _i++) { - var typeNode = types_21[_i]; - while (typeNode.kind === 186 || typeNode.kind === 192) { + for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { + var typeNode = types_20[_i]; + while (typeNode.kind === 185 || typeNode.kind === 191) { typeNode = typeNode.type; } - if (typeNode.kind === 141) { + if (typeNode.kind === 140) { continue; } - if (!strictNullChecks && (typeNode.kind === 191 && typeNode.literal.kind === 103 || typeNode.kind === 150)) { + if (!strictNullChecks && (typeNode.kind === 190 && typeNode.literal.kind === 103 || typeNode.kind === 149)) { continue; } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -61310,13 +59580,13 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8); - if (node.kind === 160) { + if (node.kind === 159) { checkExternalEmitHelpers(firstDecorator, 32); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16); switch (node.kind) { - case 252: + case 249: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -61325,23 +59595,23 @@ var ts; } } break; + case 166: case 167: - case 168: - var otherKind = node.kind === 167 ? 168 : 167; + var otherKind = node.kind === 166 ? 167 : 166; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 165: + case 164: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 163: + case 162: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 160: + case 159: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -61400,7 +59670,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 157 ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 156 ? node.name.right : node.name)); } } } @@ -61444,7 +59714,7 @@ var ts; switch (node.kind) { case 78: return node; - case 201: + case 198: return node.name; default: return undefined; @@ -61454,7 +59724,7 @@ var ts; checkDecorators(node); checkSignatureDeclaration(node); var functionFlags = ts.getFunctionFlags(node); - if (node.name && node.name.kind === 158) { + if (node.name && node.name.kind === 157) { checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { @@ -61465,10 +59735,12 @@ var ts; checkFunctionOrConstructorSymbol(localSymbol); } if (symbol.parent) { - checkFunctionOrConstructorSymbol(symbol); + if (ts.getDeclarationOfKind(symbol, node.kind) === node) { + checkFunctionOrConstructorSymbol(symbol); + } } } - var body = node.kind === 164 ? undefined : node.body; + var body = node.kind === 163 ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -61501,42 +59773,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 252: - case 221: + case 249: + case 218: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 297: - case 256: - case 230: - case 258: - case 237: - case 238: - case 239: + case 294: + case 253: + case 227: + case 255: + case 234: + case 235: + case 236: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 166: - case 208: - case 251: - case 209: case 165: + case 205: + case 248: + case 206: + case 164: + case 166: case 167: - case 168: if (node.body) { checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 164: + case 163: + case 168: case 169: - case 170: + case 173: case 174: - case 175: - case 254: - case 253: + case 251: + case 250: checkUnusedTypeParameters(node, addDiagnostic); break; - case 185: + case 184: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -61556,11 +59828,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 165: - case 163: + case 164: + case 162: + case 166: case 167: - case 168: - if (member.kind === 168 && member.symbol.flags & 32768) { + if (member.kind === 167 && member.symbol.flags & 32768) { break; } var symbol = getSymbolOfNode(member); @@ -61570,7 +59842,7 @@ var ts; addDiagnostic(member, 0, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 166: + case 165: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasSyntacticModifier(parameter, 8)) { @@ -61578,8 +59850,8 @@ var ts; } } break; - case 171: - case 229: + case 170: + case 226: break; default: ts.Debug.fail(); @@ -61603,7 +59875,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 185 && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 184 && parent.typeParameters.every(isTypeParameterUnused)) { if (ts.tryAddToSet(seenParentsWithEveryUnused, parent)) { var range = ts.isJSDocTemplateTag(parent) ? ts.rangeOfNode(parent) @@ -61689,7 +59961,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 263 ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 260 ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0, unuseds.length === 1 @@ -61707,7 +59979,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 : 0; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 249 && bindingPattern.parent.parent.kind === 250) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 246 && bindingPattern.parent.parent.kind === 247) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -61728,7 +60000,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 232 ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 229 ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -61742,21 +60014,21 @@ var ts; switch (name.kind) { case 78: return ts.idText(name); - case 197: - case 196: + case 194: + case 193: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 262 || node.kind === 265 || node.kind === 263; + return node.kind === 259 || node.kind === 262 || node.kind === 260; } function importClauseFromImported(decl) { - return decl.kind === 262 ? decl : decl.kind === 263 ? decl.parent : decl.parent.parent; + return decl.kind === 259 ? decl : decl.kind === 260 ? decl.parent : decl.parent.parent; } function checkBlock(node) { - if (node.kind === 230) { + if (node.kind === 227) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -61785,19 +60057,19 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 163 || - node.kind === 162 || - node.kind === 165 || + if (node.kind === 162 || + node.kind === 161 || node.kind === 164 || - node.kind === 167 || - node.kind === 168) { + node.kind === 163 || + node.kind === 166 || + node.kind === 167) { return false; } if (node.flags & 8388608) { return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 160 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 159 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -61849,7 +60121,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 297 && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 294 && ts.isExternalOrCommonJsModule(parent)) { errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -61861,7 +60133,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 297 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048) { + if (parent.kind === 294 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048) { errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -61869,7 +60141,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) { return; } - if (node.kind === 249 && !node.initializer) { + if (node.kind === 246 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -61881,15 +60153,15 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 250); - var container = varDeclList.parent.kind === 232 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 247); + var container = varDeclList.parent.kind === 229 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 230 && ts.isFunctionLike(container.parent) || - container.kind === 257 || - container.kind === 256 || - container.kind === 297); + (container.kind === 227 && ts.isFunctionLike(container.parent) || + container.kind === 254 || + container.kind === 253 || + container.kind === 294); if (!namesShareScope) { var name = symbolToString(localDeclarationSymbol); error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); @@ -61910,17 +60182,17 @@ var ts; if (!node.name) { return; } - if (node.name.kind === 158) { + if (node.name.kind === 157) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 198) { - if (node.parent.kind === 196 && languageVersion < 99) { + if (node.kind === 195) { + if (node.parent.kind === 193 && languageVersion < 99) { checkExternalEmitHelpers(node, 4); } - if (node.propertyName && node.propertyName.kind === 158) { + if (node.propertyName && node.propertyName.kind === 157) { checkComputedPropertyName(node.propertyName); } var parent = node.parent.parent; @@ -61939,17 +60211,17 @@ var ts; } } if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 197 && languageVersion < 2 && compilerOptions.downlevelIteration) { + if (node.name.kind === 194 && languageVersion < 2 && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512); } ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && ts.isParameterDeclaration(node) && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 159 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 238; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 235; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { var widenedType = getWidenedTypeForVariableLikeDeclaration(node); @@ -61974,10 +60246,6 @@ var ts; return; } var symbol = getSymbolOfNode(node); - if (symbol.flags & 2097152 && ts.isRequireVariableDeclaration(node, true)) { - checkAliasSymbol(node); - return; - } var type = convertAutoToAny(getTypeOfSymbol(symbol)); if (node === symbol.valueDeclaration) { var initializer = ts.getEffectiveInitializer(node); @@ -61986,7 +60254,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && !!((_a = symbol.exports) === null || _a === void 0 ? void 0 : _a.size); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 238) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 235) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, undefined); } } @@ -62010,9 +60278,9 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 163 && node.kind !== 162) { + if (node.kind !== 162 && node.kind !== 161) { checkExportsOnMergedDeclarations(node); - if (node.kind === 249 || node.kind === 198) { + if (node.kind === 246 || node.kind === 195) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -62024,7 +60292,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 163 || nextDeclaration.kind === 162 + var message = nextDeclaration.kind === 162 || nextDeclaration.kind === 161 ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -62034,8 +60302,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 160 && right.kind === 249) || - (left.kind === 249 && right.kind === 160)) { + if ((left.kind === 159 && right.kind === 246) || + (left.kind === 246 && right.kind === 159)) { return true; } if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) { @@ -62050,10 +60318,8 @@ var ts; return ts.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts.getSelectedEffectiveModifierFlags(right, interestingFlags); } function checkVariableDeclaration(node) { - ts.tracing.push("check", "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end }); checkGrammarVariableDeclaration(node); - checkVariableLikeDeclaration(node); - ts.tracing.pop(); + return checkVariableLikeDeclaration(node); } function checkBindingElement(node) { checkGrammarBindingElement(node); @@ -62073,7 +60339,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 231) { + if (node.thenStatement.kind === 228) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -62156,12 +60422,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 250) { + if (node.initializer && node.initializer.kind === 247) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 250) { + if (node.initializer.kind === 247) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -62188,13 +60454,13 @@ var ts; else if (compilerOptions.downlevelIteration && languageVersion < 2) { checkExternalEmitHelpers(node, 256); } - if (node.initializer.kind === 250) { + if (node.initializer.kind === 247) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node); - if (varExpr.kind === 199 || varExpr.kind === 200) { + if (varExpr.kind === 196 || varExpr.kind === 197) { checkDestructuringAssignment(varExpr, iteratedType || errorType); } else { @@ -62213,7 +60479,7 @@ var ts; function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); var rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression)); - if (node.initializer.kind === 250) { + if (node.initializer.kind === 247) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -62223,7 +60489,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 199 || varExpr.kind === 200) { + if (varExpr.kind === 196 || varExpr.kind === 197) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -62266,7 +60532,6 @@ var ts; } var uplevelIteration = languageVersion >= 2; var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; - var possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & 128); if (uplevelIteration || downlevelIteration || allowAsyncIterables) { var iterationTypes = getIterationTypesOfIterable(inputType, use, uplevelIteration ? errorNode : undefined); if (checkAssignability) { @@ -62282,7 +60547,7 @@ var ts; } } if (iterationTypes || uplevelIteration) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType) : (iterationTypes && iterationTypes.yieldType); + return iterationTypes && iterationTypes.yieldType; } } var arrayType = inputType; @@ -62291,12 +60556,12 @@ var ts; if (use & 4) { if (arrayType.flags & 1048576) { var arrayTypes = inputType.types; - var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 402653316); }); + var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 132); }); if (filteredTypes !== arrayTypes) { arrayType = getUnionType(filteredTypes, 2); } } - else if (arrayType.flags & 402653316) { + else if (arrayType.flags & 132) { arrayType = neverType; } hasStringConstituent = arrayType !== inputType; @@ -62308,7 +60573,7 @@ var ts; } } if (arrayType.flags & 131072) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType; + return stringType; } } } @@ -62328,16 +60593,16 @@ var ts; : [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true], defaultDiagnostic = _a[0], maybeMissingAwait = _a[1]; errorAndMaybeSuggestAwait(errorNode, maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType), defaultDiagnostic, typeToString(arrayType)); } - return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType : undefined; + return hasStringConstituent ? stringType : undefined; } var arrayElementType = getIndexTypeOfType(arrayType, 1); if (hasStringConstituent && arrayElementType) { - if (arrayElementType.flags & 402653316 && !compilerOptions.noUncheckedIndexedAccess) { + if (arrayElementType.flags & 132) { return stringType; } - return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2); + return getUnionType([arrayElementType, stringType], 2); } - return (use & 128) ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType; + return arrayElementType; } function getIterationTypeOfIterable(use, typeKind, inputType, errorNode) { if (isTypeAny(inputType)) { @@ -62415,9 +60680,8 @@ var ts; if (iterationTypes_2 === noIterationTypes) { if (errorNode) { reportTypeNotIterableError(errorNode, type, !!(use & 2)); + errorNode = undefined; } - setCachedIterationTypes(type, cacheKey, noIterationTypes); - return undefined; } else { allIterationTypes = ts.append(allIterationTypes, iterationTypes_2); @@ -62586,7 +60850,6 @@ var ts; return setCachedIterationTypes(type, "iterationTypesOfIteratorResult", createIterationTypes(yieldType, returnType || voidType, undefined)); } function getIterationTypesOfMethod(type, resolver, methodName, errorNode) { - var _a, _b, _c, _d; var method = getPropertyOfType(type, methodName); if (!method && methodName !== "next") { return undefined; @@ -62607,17 +60870,6 @@ var ts; } return methodName === "next" ? anyIterationTypes : undefined; } - if ((methodType === null || methodType === void 0 ? void 0 : methodType.symbol) && methodSignatures.length === 1) { - var globalGeneratorType = resolver.getGlobalGeneratorType(false); - var globalIteratorType = resolver.getGlobalIteratorType(false); - var isGeneratorMethod = ((_b = (_a = globalGeneratorType.symbol) === null || _a === void 0 ? void 0 : _a.members) === null || _b === void 0 ? void 0 : _b.get(methodName)) === methodType.symbol; - var isIteratorMethod = !isGeneratorMethod && ((_d = (_c = globalIteratorType.symbol) === null || _c === void 0 ? void 0 : _c.members) === null || _d === void 0 ? void 0 : _d.get(methodName)) === methodType.symbol; - if (isGeneratorMethod || isIteratorMethod) { - var globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType; - var mapper = methodType.mapper; - return createIterationTypes(getMappedType(globalType.typeParameters[0], mapper), getMappedType(globalType.typeParameters[1], mapper), methodName === "next" ? getMappedType(globalType.typeParameters[2], mapper) : undefined); - } - } var methodParameterTypes; var methodReturnTypes; for (var _i = 0, methodSignatures_1 = methodSignatures; _i < methodSignatures_1.length; _i++) { @@ -62711,12 +60963,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 168) { + if (func.kind === 167) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 166) { + else if (func.kind === 165) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -62731,7 +60983,7 @@ var ts; } } } - else if (func.kind !== 166 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 165 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } } @@ -62756,7 +61008,7 @@ var ts; var expressionType = checkExpression(node.expression); var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 285 && !hasDuplicateDefaultClause) { + if (clause.kind === 282 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -62765,7 +61017,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 284) { + if (produceDiagnostics && clause.kind === 281) { var caseType = checkExpression(clause.expression); var caseIsLiteral = isLiteralType(caseType); var comparedExpressionType = expressionType; @@ -62792,7 +61044,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 245 && current.label.escapedText === node.label.escapedText) { + if (current.kind === 242 && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -62817,15 +61069,11 @@ var ts; var catchClause = node.catchClause; if (catchClause) { if (catchClause.variableDeclaration) { - var declaration = catchClause.variableDeclaration; - if (declaration.type) { - var type = getTypeForVariableLikeDeclaration(declaration, false); - if (type && !(type.flags & 3)) { - grammarErrorOnFirstToken(declaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); - } + if (catchClause.variableDeclaration.type && getTypeOfNode(catchClause.variableDeclaration) === errorType) { + grammarErrorOnFirstToken(catchClause.variableDeclaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); } - else if (declaration.initializer) { - grammarErrorOnFirstToken(declaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); + else if (catchClause.variableDeclaration.initializer) { + grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); } else { var blockLocals_1 = catchClause.block.locals; @@ -62894,8 +61142,8 @@ var ts; } var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 216 || - name.kind === 158 || + (propDeclaration.kind === 213 || + name.kind === 157 || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -62960,7 +61208,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 173) { + if (node.kind === 172) { var type = getTypeFromTypeReference(node); if (type.flags & 262144) { for (var i = index; i < typeParameters.length; i++) { @@ -63060,7 +61308,6 @@ var ts; var typeWithThis = getTypeWithThisArgument(type); var staticType = getTypeOfSymbol(symbol); checkTypeParameterListsIdentical(symbol); - checkFunctionOrConstructorSymbol(symbol); checkClassForDuplicateDeclarations(node); if (!(node.flags & 8388608)) { checkClassForStaticPropertyNameConflicts(node); @@ -63145,7 +61392,7 @@ var ts; } function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { var issuedMemberError = false; - var _loop_23 = function (member) { + var _loop_22 = function (member) { if (ts.hasStaticModifier(member)) { return "continue"; } @@ -63163,7 +61410,7 @@ var ts; }; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - _loop_23(member); + _loop_22(member); } if (!issuedMemberError) { checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag); @@ -63186,7 +61433,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 252 || d.kind === 253; + return d.kind === 249 || d.kind === 250; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -63217,7 +61464,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 221) { + if (derivedClassDecl.kind === 218) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -63235,7 +61482,7 @@ var ts; var derivedPropertyFlags = derived.flags & 98308; if (basePropertyFlags && derivedPropertyFlags) { if (baseDeclarationFlags & 128 && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 253 + || base.valueDeclaration && base.valueDeclaration.parent.kind === 250 || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { continue; } @@ -63248,7 +61495,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else if (compilerOptions.useDefineForClassFields) { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 163 && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 162 && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432) && !(baseDeclarationFlags & 128) @@ -63362,7 +61609,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 163 && + return node.kind === 162 && !ts.hasSyntacticModifier(node, 32 | 128) && !node.exclamationToken && !node.initializer; @@ -63384,7 +61631,7 @@ var ts; checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 253); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 250); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -63415,15 +61662,8 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); checkExportsOnMergedDeclarations(node); checkTypeParameters(node.typeParameters); - if (node.type.kind === 136) { - if (!intrinsicTypeKinds.has(node.name.escapedText) || ts.length(node.typeParameters) !== 1) { - error(node.type, ts.Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types); - } - } - else { - checkSourceElement(node.type); - registerForUnusedIdentifiersCheck(node); - } + checkSourceElement(node.type); + registerForUnusedIdentifiersCheck(node); } function computeEnumMemberValues(node) { var nodeLinks = getNodeLinks(node); @@ -63494,7 +61734,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 214: + case 211: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -63504,7 +61744,7 @@ var ts; } } break; - case 216: + case 213: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -63533,7 +61773,7 @@ var ts; case 8: checkGrammarNumericLiteral(expr); return +expr.text; - case 207: + case 204: return evaluate(expr.expression); case 78: var identifier = expr; @@ -63541,14 +61781,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 202: - case 201: + case 199: + case 198: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384) { var name = void 0; - if (ex.kind === 201) { + if (ex.kind === 198) { name = ex.name.escapedText; } else { @@ -63581,8 +61821,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 78 || - node.kind === 201 && isConstantMemberAccess(node.expression) || - node.kind === 202 && isConstantMemberAccess(node.expression) && + node.kind === 198 && isConstantMemberAccess(node.expression) || + node.kind === 199 && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -63609,7 +61849,7 @@ var ts; } var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 255) { + if (declaration.kind !== 252) { return false; } var enumDeclaration = declaration; @@ -63637,8 +61877,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 252 || - (declaration.kind === 251 && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 249 || + (declaration.kind === 248 && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608)) { return declaration; } @@ -63696,7 +61936,7 @@ var ts; error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - var mergedClass = ts.getDeclarationOfKind(symbol, 252); + var mergedClass = ts.getDeclarationOfKind(symbol, 249); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768; @@ -63739,22 +61979,22 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 232: + case 229: for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 266: - case 267: + case 263: + case 264: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 260: - case 261: + case 257: + case 258: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 198: - case 249: + case 195: + case 246: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -63763,12 +62003,12 @@ var ts; } break; } + case 249: case 252: - case 255: - case 251: + case 248: + case 250: case 253: - case 256: - case 254: + case 251: if (isGlobalAugmentation) { return; } @@ -63786,12 +62026,12 @@ var ts; switch (node.kind) { case 78: return node; - case 157: + case 156: do { node = node.left; } while (node.kind !== 78); return node; - case 201: + case 198: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -63810,9 +62050,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 257 && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 297 && !inAmbientExternalModule) { - error(moduleName, node.kind === 267 ? + var inAmbientExternalModule = node.parent.kind === 254 && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 294 && !inAmbientExternalModule) { + error(moduleName, node.kind === 264 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -63834,13 +62074,13 @@ var ts; (symbol.flags & 788968 ? 788968 : 0) | (symbol.flags & 1920 ? 1920 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 270 ? + var message = node.kind === 267 ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } if (compilerOptions.isolatedModules - && node.kind === 270 + && node.kind === 267 && !node.parent.parent.isTypeOnly && !(target.flags & 111551) && !(node.flags & 8388608)) { @@ -63855,7 +62095,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); checkAliasSymbol(node); - if (node.kind === 265 && + if (node.kind === 262 && ts.idText(node.propertyName || node.name) === "default" && compilerOptions.esModuleInterop && moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015) { @@ -63876,7 +62116,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 263) { + if (importClause.namedBindings.kind === 260) { checkImportBinding(importClause.namedBindings); if (moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015 && compilerOptions.esModuleInterop) { checkExternalEmitHelpers(node, 131072); @@ -63902,7 +62142,7 @@ var ts; if (ts.hasSyntacticModifier(node, 1)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 272) { + if (node.moduleReference.kind !== 269) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551) { @@ -63937,10 +62177,10 @@ var ts; if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause && !ts.isNamespaceExport(node.exportClause)) { ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 257 && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 257 && + var inAmbientExternalModule = node.parent.kind === 254 && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 254 && !node.moduleSpecifier && node.flags & 8388608; - if (node.parent.kind !== 297 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 294 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -63967,14 +62207,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 268; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 265; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 297 || node.parent.kind === 257 || node.parent.kind === 256; + var isInAppropriateContext = node.parent.kind === 294 || node.parent.kind === 254 || node.parent.kind === 253; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -64035,8 +62275,8 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) { return; } - var container = node.parent.kind === 297 ? node.parent : node.parent.parent; - if (container.kind === 256 && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 294 ? node.parent : node.parent.parent; + if (container.kind === 253 && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -64058,9 +62298,6 @@ var ts; checkExpressionCached(node.expression); } } - else { - checkExpressionCached(node.expression); - } if (ts.getEmitDeclarations(compilerOptions)) { collectLinkedAliases(node.expression, true); } @@ -64141,170 +62378,168 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { - case 256: - case 252: case 253: - case 251: + case 249: + case 250: + case 248: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 232 && kind <= 248 && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 229 && kind <= 245 && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 159: + case 158: return checkTypeParameter(node); - case 160: + case 159: return checkParameter(node); - case 163: - return checkPropertyDeclaration(node); case 162: + return checkPropertyDeclaration(node); + case 161: return checkPropertySignature(node); + case 173: case 174: - case 175: + case 168: case 169: case 170: - case 171: return checkSignatureDeclaration(node); - case 165: case 164: + case 163: return checkMethodDeclaration(node); - case 166: + case 165: return checkConstructorDeclaration(node); + case 166: case 167: - case 168: return checkAccessorDeclaration(node); - case 173: - return checkTypeReferenceNode(node); case 172: + return checkTypeReferenceNode(node); + case 171: return checkTypePredicate(node); - case 176: + case 175: return checkTypeQuery(node); - case 177: + case 176: return checkTypeLiteral(node); - case 178: + case 177: return checkArrayType(node); - case 179: + case 178: return checkTupleType(node); - case 182: - case 183: - return checkUnionOrIntersectionType(node); - case 186: - case 180: case 181: - return checkSourceElement(node.type); - case 187: - return checkThisType(node); - case 188: - return checkTypeOperator(node); - case 184: - return checkConditionalType(node); + case 182: + return checkUnionOrIntersectionType(node); case 185: + case 179: + case 180: + return checkSourceElement(node.type); + case 186: + return checkThisType(node); + case 187: + return checkTypeOperator(node); + case 183: + return checkConditionalType(node); + case 184: return checkInferType(node); - case 193: - return checkTemplateLiteralType(node); - case 195: - return checkImportType(node); case 192: + return checkImportType(node); + case 191: return checkNamedTupleMember(node); - case 315: + case 311: return checkJSDocAugmentsTag(node); - case 316: - return checkJSDocImplementsTag(node); - case 331: - case 324: - case 325: - return checkJSDocTypeAliasTag(node); - case 330: - return checkJSDocTemplateTag(node); - case 329: - return checkJSDocTypeTag(node); - case 326: - return checkJSDocParameterTag(node); - case 333: - return checkJSDocPropertyTag(node); - case 308: - checkJSDocFunctionType(node); - case 306: - case 305: - case 303: - case 304: case 312: + return checkJSDocImplementsTag(node); + case 327: + case 320: + case 321: + return checkJSDocTypeAliasTag(node); + case 326: + return checkJSDocTemplateTag(node); + case 325: + return checkJSDocTypeTag(node); + case 322: + return checkJSDocParameterTag(node); + case 328: + return checkJSDocPropertyTag(node); + case 304: + checkJSDocFunctionType(node); + case 302: + case 301: + case 299: + case 300: + case 308: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 309: + case 305: checkJSDocVariadicType(node); return; - case 301: + case 298: return checkSourceElement(node.type); - case 189: + case 188: return checkIndexedAccessType(node); - case 190: + case 189: return checkMappedType(node); - case 251: - return checkFunctionDeclaration(node); - case 230: - case 257: - return checkBlock(node); - case 232: - return checkVariableStatement(node); - case 233: - return checkExpressionStatement(node); - case 234: - return checkIfStatement(node); - case 235: - return checkDoStatement(node); - case 236: - return checkWhileStatement(node); - case 237: - return checkForStatement(node); - case 238: - return checkForInStatement(node); - case 239: - return checkForOfStatement(node); - case 240: - case 241: - return checkBreakOrContinueStatement(node); - case 242: - return checkReturnStatement(node); - case 243: - return checkWithStatement(node); - case 244: - return checkSwitchStatement(node); - case 245: - return checkLabeledStatement(node); - case 246: - return checkThrowStatement(node); - case 247: - return checkTryStatement(node); - case 249: - return checkVariableDeclaration(node); - case 198: - return checkBindingElement(node); - case 252: - return checkClassDeclaration(node); - case 253: - return checkInterfaceDeclaration(node); - case 254: - return checkTypeAliasDeclaration(node); - case 255: - return checkEnumDeclaration(node); - case 256: - return checkModuleDeclaration(node); - case 261: - return checkImportDeclaration(node); - case 260: - return checkImportEqualsDeclaration(node); - case 267: - return checkExportDeclaration(node); - case 266: - return checkExportAssignment(node); - case 231: case 248: + return checkFunctionDeclaration(node); + case 227: + case 254: + return checkBlock(node); + case 229: + return checkVariableStatement(node); + case 230: + return checkExpressionStatement(node); + case 231: + return checkIfStatement(node); + case 232: + return checkDoStatement(node); + case 233: + return checkWhileStatement(node); + case 234: + return checkForStatement(node); + case 235: + return checkForInStatement(node); + case 236: + return checkForOfStatement(node); + case 237: + case 238: + return checkBreakOrContinueStatement(node); + case 239: + return checkReturnStatement(node); + case 240: + return checkWithStatement(node); + case 241: + return checkSwitchStatement(node); + case 242: + return checkLabeledStatement(node); + case 243: + return checkThrowStatement(node); + case 244: + return checkTryStatement(node); + case 246: + return checkVariableDeclaration(node); + case 195: + return checkBindingElement(node); + case 249: + return checkClassDeclaration(node); + case 250: + return checkInterfaceDeclaration(node); + case 251: + return checkTypeAliasDeclaration(node); + case 252: + return checkEnumDeclaration(node); + case 253: + return checkModuleDeclaration(node); + case 258: + return checkImportDeclaration(node); + case 257: + return checkImportEqualsDeclaration(node); + case 264: + return checkExportDeclaration(node); + case 263: + return checkExportAssignment(node); + case 228: + case 245: checkGrammarStatementInAmbientContext(node); return; - case 271: + case 268: return checkMissingDeclaration(node); } } @@ -64380,43 +62615,40 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 203: - case 204: - case 205: - case 161: - case 275: + case 200: + case 201: + case 202: + case 160: + case 272: resolveUntypedCall(node); break; - case 208: - case 209: - case 165: + case 205: + case 206: case 164: + case 163: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; + case 166: case 167: - case 168: checkAccessorDeclaration(node); break; - case 221: + case 218: checkClassExpressionDeferred(node); break; - case 274: + case 271: checkJsxSelfClosingElementDeferred(node); break; - case 273: + case 270: checkJsxElementDeferred(node); break; } currentNode = saveCurrentNode; } function checkSourceFile(node) { - var tracingData = ["check", "checkSourceFile", { path: node.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeCheck"); checkSourceFileWorker(node); ts.performance.mark("afterCheck"); ts.performance.measure("Check", "beforeCheck", "afterCheck"); - ts.tracing.end.apply(ts.tracing, tracingData); } function unusedIsError(kind, isAmbient) { if (isAmbient) { @@ -64533,27 +62765,27 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 297: + case 294: if (!ts.isExternalOrCommonJsModule(location)) break; - case 256: + case 253: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475); break; - case 255: + case 252: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 221: + case 218: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - case 252: - case 253: + case 249: + case 250: if (!isStatic) { copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968); } break; - case 208: + case 205: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -64591,44 +62823,35 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 159: + case 158: + case 249: + case 250: + case 251: case 252: - case 253: - case 254: - case 255: - case 331: - case 324: - case 325: + case 327: + case 320: + case 321: return true; - case 262: + case 259: return node.isTypeOnly; - case 265: - case 270: + case 262: + case 267: return node.parent.parent.isTypeOnly; default: return false; } } function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 157) { + while (node.parent.kind === 156) { node = node.parent; } - return node.parent.kind === 173; + return node.parent.kind === 172; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 201) { + while (node.parent.kind === 198) { node = node.parent; } - return node.parent.kind === 223; - } - function isJSDocEntryNameReference(node) { - while (node.parent.kind === 157) { - node = node.parent; - } - while (node.parent.kind === 201) { - node = node.parent; - } - return node.parent.kind === 302; + return node.parent.kind === 220; } function forEachEnclosingClass(node, callback) { var result; @@ -64656,13 +62879,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 157) { + while (nodeOnRightSide.parent.kind === 156) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 260) { + if (nodeOnRightSide.parent.kind === 257) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 266) { + if (nodeOnRightSide.parent.kind === 263) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -64688,7 +62911,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 195 && parent.qualifier === node) { + if (parent && parent.kind === 192 && parent.qualifier === node) { return parent; } return undefined; @@ -64698,7 +62921,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 201 && + name.parent.kind === 198 && name.parent === name.parent.parent.left) { if (!ts.isPrivateIdentifier(name)) { var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name); @@ -64707,14 +62930,14 @@ var ts; } } } - if (name.parent.kind === 266 && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 263 && ts.isEntityNameExpression(name)) { var success = resolveEntityName(name, 111551 | 788968 | 1920 | 2097152, true); if (success && success !== unknownSymbol) { return success; } } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { - var importEqualsDeclaration = ts.getAncestor(name, 260); + var importEqualsDeclaration = ts.getAncestor(name, 257); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, true); } @@ -64731,7 +62954,7 @@ var ts; } if (isHeritageClauseElementIdentifier(name)) { var meaning = 0; - if (name.parent.kind === 223) { + if (name.parent.kind === 220) { meaning = 788968; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { meaning |= 111551; @@ -64746,10 +62969,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 326) { + if (name.parent.kind === 322) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 159 && name.parent.parent.kind === 330) { + if (name.parent.kind === 158 && name.parent.parent.kind === 326) { ts.Debug.assert(!ts.isInJSFile(name)); var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -64765,12 +62988,12 @@ var ts; } return resolveEntityName(name, 111551, false, true); } - else if (name.kind === 201 || name.kind === 157) { + else if (name.kind === 198 || name.kind === 156) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 201) { + if (name.kind === 198) { checkPropertyAccessExpression(name); } else { @@ -64780,20 +63003,16 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 173 ? 788968 : 1920; + var meaning = name.parent.kind === 172 ? 788968 : 1920; return resolveEntityName(name, meaning, false, true); } - else if (isJSDocEntryNameReference(name)) { - var meaning = 788968 | 1920 | 111551; - return resolveEntityName(name, meaning, false, true, ts.getHostSignatureFromJSDoc(name)); - } - if (name.parent.kind === 172) { + if (name.parent.kind === 171) { return resolveEntityName(name, 1); } return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 297) { + if (node.kind === 294) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -64814,8 +63033,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 198 && - grandParent.kind === 196 && + else if (parent.kind === 195 && + grandParent.kind === 193 && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -64827,8 +63046,8 @@ var ts; switch (node.kind) { case 78: case 79: - case 201: - case 157: + case 198: + case 156: return getSymbolOfNameOrPropertyAccessExpression(node); case 107: var container = ts.getThisContainer(node, false); @@ -64841,20 +63060,20 @@ var ts; if (ts.isInExpressionContext(node)) { return checkExpression(node).symbol; } - case 187: + case 186: return getTypeFromThisTypeNode(node).symbol; case 105: return checkExpression(node).symbol; case 132: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 166) { + if (constructorDeclaration && constructorDeclaration.kind === 165) { return constructorDeclaration.parent.symbol; } return undefined; case 10: case 14: if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 261 || node.parent.kind === 267) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 258 || node.parent.kind === 264) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -64874,7 +63093,7 @@ var ts; case 38: case 83: return getSymbolOfNode(node.parent); - case 195: + case 192: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 92: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -64883,25 +63102,17 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 289) { + if (location && location.kind === 286) { return resolveEntityName(location.name, 111551 | 2097152); } return undefined; } function getExportSpecifierLocalTargetSymbol(node) { - if (ts.isExportSpecifier(node)) { - return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 111551 | 788968 | 1920 | 2097152); - } - else { - return resolveEntityName(node, 111551 | 788968 | 1920 | 2097152); - } + return node.parent.parent.moduleSpecifier ? + getExternalModuleMember(node.parent.parent, node) : + resolveEntityName(node.propertyName || node.name, 111551 | 788968 | 1920 | 2097152); } function getTypeOfNode(node) { - if (ts.isSourceFile(node) && !ts.isExternalModule(node)) { - return errorType; - } if (node.flags & 16777216) { return errorType; } @@ -64950,16 +63161,16 @@ var ts; return errorType; } function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 200 || expr.kind === 199); - if (expr.parent.kind === 239) { + ts.Debug.assert(expr.kind === 197 || expr.kind === 196); + if (expr.parent.kind === 236) { var iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } - if (expr.parent.kind === 216) { + if (expr.parent.kind === 213) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } - if (expr.parent.kind === 288) { + if (expr.parent.kind === 285) { var node_2 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_2) || errorType; var propertyIndex = ts.indexOfNode(node_2.properties, expr.parent); @@ -64994,7 +63205,7 @@ var ts; case 8: case 10: return getLiteralType(name.text); - case 158: + case 157: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288) ? nameType : stringType; default: @@ -65093,7 +63304,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 297) { + if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 294) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); var symbolIsUmdExport = symbolFile !== referenceFile; @@ -65105,9 +63316,6 @@ var ts; } } function getReferencedImportDeclaration(nodeIn) { - if (nodeIn.generatedImportReference) { - return nodeIn.generatedImportReference; - } var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { var symbol = getReferencedValueSymbol(node); @@ -65119,7 +63327,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 287; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 284; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -65134,7 +63342,7 @@ var ts; else if (nodeLinks_1.flags & 262144) { var isDeclaredInLoop = nodeLinks_1.flags & 524288; var inLoopInitializer = ts.isIterationStatement(container, false); - var inLoopBodyBlock = container.kind === 230 && ts.isIterationStatement(container.parent, false); + var inLoopBodyBlock = container.kind === 227 && ts.isIterationStatement(container.parent, false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -65170,19 +63378,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 260: + case 257: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); + case 259: + case 260: case 262: - case 263: - case 265: - case 270: + case 267: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 267: + case 264: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 266: + case 263: return node.expression && node.expression.kind === 78 ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -65191,7 +63399,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 297 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 294 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -65283,15 +63491,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 291: - case 201: - case 202: + case 288: + case 198: + case 199: return true; } return false; } function getConstantValue(node) { - if (node.kind === 291) { + if (node.kind === 288) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -65352,7 +63560,7 @@ var ts; else if (isTypeAssignableToKind(type, 2112)) { return ts.TypeReferenceSerializationKind.BigIntLikeType; } - else if (isTypeAssignableToKind(type, 402653316)) { + else if (isTypeAssignableToKind(type, 132)) { return ts.TypeReferenceSerializationKind.StringLikeType; } else if (isTupleType(type)) { @@ -65545,12 +63753,12 @@ var ts; getJsxFragmentFactoryEntity: getJsxFragmentFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); - var otherKind = accessor.kind === 168 ? 167 : 168; + var otherKind = accessor.kind === 167 ? 166 : 167; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 168 ? accessor : otherAccessor; - var getAccessor = accessor.kind === 167 ? accessor : otherAccessor; + var setAccessor = accessor.kind === 167 ? accessor : otherAccessor; + var getAccessor = accessor.kind === 166 ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -65566,7 +63774,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 297, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 294, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -65601,14 +63809,14 @@ var ts; return false; } function isInHeritageClause(node) { - return node.parent && node.parent.kind === 223 && node.parent.parent && node.parent.parent.kind === 286; + return node.parent && node.parent.kind === 220 && node.parent.parent && node.parent.parent.kind === 283; } function getTypeReferenceDirectivesForEntityName(node) { if (!fileToDirective) { return undefined; } var meaning = 788968 | 1920; - if ((node.kind === 78 && isInTypeQuery(node)) || (node.kind === 201 && !isInHeritageClause(node))) { + if ((node.kind === 78 && isInTypeQuery(node)) || (node.kind === 198 && !isInHeritageClause(node))) { meaning = 111551 | 1048576; } var symbol = resolveEntityName(node, meaning, true); @@ -65651,7 +63859,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 297 && current.flags & 512) { + if (current.valueDeclaration && current.valueDeclaration.kind === 294 && current.flags & 512) { return false; } for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { @@ -65678,12 +63886,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 256 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 253 ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, undefined); if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 297); + return ts.getDeclarationOfKind(moduleSymbol, 294); } function initializeTypeChecker() { for (var _i = 0, _a = host.getSourceFiles(); _i < _a.length; _i++) { @@ -65856,14 +64064,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 165 && !ts.nodeIsPresent(node.body)) { + if (node.kind === 164 && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 167 || node.kind === 168) { + else if (node.kind === 166 || node.kind === 167) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -65880,17 +64088,17 @@ var ts; var flags = 0; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 142) { - if (node.kind === 162 || node.kind === 164) { + if (modifier.kind !== 141) { + if (node.kind === 161 || node.kind === 163) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 171) { + if (node.kind === 170) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 84: - if (node.kind !== 255) { + if (node.kind !== 252) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(84)); } break; @@ -65910,7 +64118,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 257 || node.parent.kind === 297) { + else if (node.parent.kind === 254 || node.parent.kind === 294) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128) { @@ -65936,10 +64144,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 257 || node.parent.kind === 297) { + else if (node.parent.kind === 254 || node.parent.kind === 294) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 160) { + else if (node.kind === 159) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128) { @@ -65951,11 +64159,11 @@ var ts; flags |= 32; lastStatic = modifier; break; - case 142: + case 141: if (flags & 64) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 163 && node.kind !== 162 && node.kind !== 171 && node.kind !== 160) { + else if (node.kind !== 162 && node.kind !== 161 && node.kind !== 170 && node.kind !== 159) { return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } flags |= 64; @@ -65975,16 +64183,16 @@ var ts; return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } else if (ts.isClassLike(node.parent)) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 160) { + else if (node.kind === 159) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; break; case 87: - var container = node.parent.kind === 297 ? node.parent : node.parent.parent; - if (container.kind === 256 && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 294 ? node.parent : node.parent.parent; + if (container.kind === 253 && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512; @@ -65997,12 +64205,12 @@ var ts; return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 160) { + else if (node.kind === 159) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608) && node.parent.kind === 257) { + else if ((node.parent.flags & 8388608) && node.parent.kind === 254) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -66015,14 +64223,14 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 252) { - if (node.kind !== 165 && - node.kind !== 163 && - node.kind !== 167 && - node.kind !== 168) { + if (node.kind !== 249) { + if (node.kind !== 164 && + node.kind !== 162 && + node.kind !== 166 && + node.kind !== 167) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 252 && ts.hasSyntacticModifier(node.parent, 128))) { + if (!(node.parent.kind === 249 && ts.hasSyntacticModifier(node.parent, 128))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32) { @@ -66031,9 +64239,6 @@ var ts; if (flags & 8) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); } - if (flags & 256 && lastAsync) { - return grammarErrorOnNode(lastAsync, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } } if (ts.isNamedDeclaration(node) && node.name.kind === 79) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); @@ -66047,18 +64252,15 @@ var ts; else if (flags & 2 || node.parent.flags & 8388608) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 160) { + else if (node.kind === 159) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } - if (flags & 128) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } flags |= 256; lastAsync = modifier; break; } } - if (node.kind === 166) { + if (node.kind === 165) { if (flags & 32) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -66073,13 +64275,13 @@ var ts; } return false; } - else if ((node.kind === 261 || node.kind === 260) && flags & 2) { + else if ((node.kind === 258 || node.kind === 257) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 160 && (flags & 92) && ts.isBindingPattern(node.name)) { + else if (node.kind === 159 && (flags & 92) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 160 && (flags & 92) && node.dotDotDotToken) { + else if (node.kind === 159 && (flags & 92) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256) { @@ -66096,37 +64298,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 167: - case 168: case 166: - case 163: - case 162: + case 167: case 165: + case 162: + case 161: case 164: - case 171: - case 256: - case 261: - case 260: - case 267: - case 266: - case 208: - case 209: - case 160: + case 163: + case 170: + case 253: + case 258: + case 257: + case 264: + case 263: + case 205: + case 206: + case 159: return false; default: - if (node.parent.kind === 257 || node.parent.kind === 297) { + if (node.parent.kind === 254 || node.parent.kind === 294) { return false; } switch (node.kind) { - case 251: + case 248: return nodeHasAnyModifiersExcept(node, 129); - case 252: + case 249: return nodeHasAnyModifiersExcept(node, 125); - case 253: - case 232: - case 254: + case 250: + case 229: + case 251: return true; - case 255: + case 252: return nodeHasAnyModifiersExcept(node, 84); default: ts.Debug.fail(); @@ -66139,10 +64341,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 165: - case 251: - case 208: - case 209: + case 164: + case 248: + case 205: + case 206: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -66260,7 +64462,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 147 && parameter.type.kind !== 144) { + if (parameter.type.kind !== 146 && parameter.type.kind !== 143) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 || type.flags & 8) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -66301,7 +64503,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 222) { + if (arg.kind === 219) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -66375,20 +64577,20 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 158) { + if (node.kind !== 157) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 216 && computedPropertyName.expression.operatorToken.kind === 27) { + if (computedPropertyName.expression.kind === 213 && computedPropertyName.expression.operatorToken.kind === 27) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 251 || - node.kind === 208 || - node.kind === 165); + ts.Debug.assert(node.kind === 248 || + node.kind === 205 || + node.kind === 164); if (node.flags & 8388608) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -66407,7 +64609,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 290) { + if (prop.kind === 287) { if (inDestructuring) { var expression = ts.skipParentheses(prop.expression); if (ts.isArrayLiteralExpression(expression) || ts.isObjectLiteralExpression(expression)) { @@ -66417,10 +64619,10 @@ var ts; continue; } var name = prop.name; - if (name.kind === 158) { + if (name.kind === 157) { checkGrammarComputedPropertyName(name); } - if (prop.kind === 289 && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 286 && !inDestructuring && prop.objectAssignmentInitializer) { return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern); } if (name.kind === 79) { @@ -66429,29 +64631,29 @@ var ts; if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 129 || prop.kind !== 165) { + if (mod.kind !== 129 || prop.kind !== 164) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } } var currentKind = void 0; switch (prop.kind) { - case 289: + case 286: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); - case 288: + case 285: checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8) { checkGrammarNumericLiteral(name); } currentKind = 4; break; - case 165: + case 164: currentKind = 8; break; - case 167: + case 166: currentKind = 1; break; - case 168: + case 167: currentKind = 2; break; default: @@ -66490,7 +64692,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 282) { + if (attr.kind === 279) { continue; } var name = attr.name, initializer = attr.initializer; @@ -66500,7 +64702,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 283 && !initializer.expression) { + if (initializer && initializer.kind === 280 && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -66514,13 +64716,13 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 239 && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 236 && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768) === 0) { var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 166) { + if (func && func.kind !== 165) { ts.Debug.assert((ts.getFunctionFlags(func) & 2) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -66531,7 +64733,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 250) { + if (forInOrOfStatement.initializer.kind === 247) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -66539,20 +64741,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 238 + var diagnostic = forInOrOfStatement.kind === 235 ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 238 + var diagnostic = forInOrOfStatement.kind === 235 ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 238 + var diagnostic = forInOrOfStatement.kind === 235 ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -66577,11 +64779,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 167 ? + return grammarErrorOnNode(accessor.name, accessor.kind === 166 ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 168) { + if (accessor.kind === 167) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -66599,17 +64801,17 @@ var ts; return false; } function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 167 ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 166 ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 167 ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 166 ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 151) { - if (node.type.kind !== 148) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(148)); + if (node.operator === 150) { + if (node.type.kind !== 147) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(147)); } var parent = ts.walkUpParenthesizedTypes(node.parent); if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) { @@ -66619,7 +64821,7 @@ var ts; } } switch (parent.kind) { - case 249: + case 246: var decl = parent; if (decl.name.kind !== 78) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -66631,13 +64833,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 163: + case 162: if (!ts.hasSyntacticModifier(parent, 32) || !ts.hasEffectiveModifier(parent, 64)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 162: + case 161: if (!ts.hasSyntacticModifier(parent, 64)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -66646,9 +64848,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 142) { - if (node.type.kind !== 178 && node.type.kind !== 179) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(148)); + else if (node.operator === 141) { + if (node.type.kind !== 177 && node.type.kind !== 178) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(147)); } } } @@ -66661,8 +64863,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 165) { - if (node.parent.kind === 200) { + if (node.kind === 164) { + if (node.parent.kind === 197) { if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 129)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); } @@ -66684,14 +64886,14 @@ var ts; if (node.flags & 8388608) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 165 && !node.body) { + else if (node.kind === 164 && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 253) { + else if (node.parent.kind === 250) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 177) { + else if (node.parent.kind === 176) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -66702,9 +64904,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 245: + case 242: if (node.label && current.label.escapedText === node.label.escapedText) { - var isMisplacedContinueLabel = node.kind === 240 + var isMisplacedContinueLabel = node.kind === 237 && !ts.isIterationStatement(current.statement, true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -66712,8 +64914,8 @@ var ts; return false; } break; - case 244: - if (node.kind === 241 && !node.label) { + case 241: + if (node.kind === 238 && !node.label) { return false; } break; @@ -66726,13 +64928,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 241 + var message = node.kind === 238 ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 241 + var message = node.kind === 238 ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -66755,12 +64957,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 214 && expr.operator === 40 && + expr.kind === 211 && expr.operator === 40 && expr.operand.kind === 8; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 || - expr.kind === 214 && expr.operator === 40 && + expr.kind === 211 && expr.operator === 40 && expr.operand.kind === 9; } function isSimpleLiteralEnumReference(expr) { @@ -66791,7 +64993,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 238 && node.parent.parent.kind !== 239) { + if (node.parent.parent.kind !== 235 && node.parent.parent.kind !== 236) { if (node.flags & 8388608) { checkAmbientInitializer(node); } @@ -66804,11 +65006,8 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 232 || !node.type || node.initializer || node.flags & 8388608)) { - var message = node.initializer - ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions - : ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations; - return grammarErrorOnNode(node.exclamationToken, message); + if (node.exclamationToken && (node.parent.parent.kind !== 229 || !node.type || node.initializer || node.flags & 8388608)) { + return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); if (moduleKind < ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.System && @@ -66864,15 +65063,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { + case 231: + case 232: + case 233: + case 240: case 234: case 235: case 236: - case 243: - case 237: - case 238: - case 239: return false; - case 245: + case 242: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -66964,7 +65163,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 253) { + else if (node.parent.kind === 250) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -66972,7 +65171,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 177) { + else if (node.parent.kind === 176) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -66985,22 +65184,17 @@ var ts; } if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || node.flags & 8388608 || ts.hasSyntacticModifier(node, 32 | 128))) { - var message = node.initializer - ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions - : !node.type - ? ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations - : ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; - return grammarErrorOnNode(node.exclamationToken, message); + return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 253 || - node.kind === 254 || - node.kind === 261 || - node.kind === 260 || - node.kind === 267 || - node.kind === 266 || - node.kind === 259 || + if (node.kind === 250 || + node.kind === 251 || + node.kind === 258 || + node.kind === 257 || + node.kind === 264 || + node.kind === 263 || + node.kind === 256 || ts.hasSyntacticModifier(node, 2 | 1 | 512)) { return false; } @@ -67009,7 +65203,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 232) { + if (ts.isDeclaration(decl) || decl.kind === 229) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -67026,7 +65220,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && (ts.isFunctionLike(node.parent) || ts.isAccessor(node.parent))) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 230 || node.parent.kind === 257 || node.parent.kind === 297) { + if (node.parent.kind === 227 || node.parent.kind === 254 || node.parent.kind === 294) { var links_2 = getNodeLinks(node.parent); if (!links_2.hasReportedStatementInAmbientContext) { return links_2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -67043,10 +65237,10 @@ var ts; if (languageVersion >= 1) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 191)) { + else if (ts.isChildOfNodeWithKind(node, 190)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 291)) { + else if (ts.isChildOfNodeWithKind(node, 288)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -67204,13 +65398,13 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 251 && declaration.kind !== 165) || + return (declaration.kind !== 248 && declaration.kind !== 164) || !!declaration.body; } function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 265: - case 270: + case 262: + case 267: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -67218,13 +65412,13 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 262: + case 259: + case 257: case 260: - case 263: - case 265: + case 262: return true; case 78: - return decl.parent.kind === 265; + return decl.parent.kind === 262; default: return false; } @@ -67421,282 +65615,278 @@ var ts; return undefined; } var kind = node.kind; - if ((kind > 0 && kind <= 156) || kind === 187) { + if ((kind > 0 && kind <= 155) || kind === 186) { return node; } var factory = context.factory; switch (kind) { case 78: return factory.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 157: + case 156: return factory.updateQualifiedName(node, nodeVisitor(node.left, visitor, ts.isEntityName), nodeVisitor(node.right, visitor, ts.isIdentifier)); - case 158: + case 157: return factory.updateComputedPropertyName(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 159: + case 158: return factory.updateTypeParameterDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.constraint, visitor, ts.isTypeNode), nodeVisitor(node.default, visitor, ts.isTypeNode)); - case 160: + case 159: return factory.updateParameterDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 161: + case 160: return factory.updateDecorator(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 162: + case 161: return factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 163: + case 162: return factory.updatePropertyDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 164: + case 163: return factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 165: + case 164: return factory.updateMethodDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 166: + case 165: return factory.updateConstructorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 167: + case 166: return factory.updateGetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 168: + case 167: return factory.updateSetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 169: + case 168: return factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 170: + case 169: return factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 171: + case 170: return factory.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 172: + case 171: return factory.updateTypePredicateNode(node, nodeVisitor(node.assertsModifier, visitor), nodeVisitor(node.parameterName, visitor), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 173: + case 172: return factory.updateTypeReferenceNode(node, nodeVisitor(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 174: + case 173: return factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 175: + case 174: return factory.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 176: + case 175: return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName)); - case 177: + case 176: return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 178: + case 177: return factory.updateArrayTypeNode(node, nodeVisitor(node.elementType, visitor, ts.isTypeNode)); - case 179: + case 178: return factory.updateTupleTypeNode(node, nodesVisitor(node.elements, visitor, ts.isTypeNode)); - case 180: + case 179: return factory.updateOptionalTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 181: + case 180: return factory.updateRestTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 182: + case 181: return factory.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 183: + case 182: return factory.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 184: + case 183: return factory.updateConditionalTypeNode(node, nodeVisitor(node.checkType, visitor, ts.isTypeNode), nodeVisitor(node.extendsType, visitor, ts.isTypeNode), nodeVisitor(node.trueType, visitor, ts.isTypeNode), nodeVisitor(node.falseType, visitor, ts.isTypeNode)); - case 185: + case 184: return factory.updateInferTypeNode(node, nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 195: - return factory.updateImportTypeNode(node, nodeVisitor(node.argument, visitor, ts.isTypeNode), nodeVisitor(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); case 192: - return factory.updateNamedTupleMember(node, visitNode(node.dotDotDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 186: - return factory.updateParenthesizedType(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 188: - return factory.updateTypeOperatorNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 189: - return factory.updateIndexedAccessTypeNode(node, nodeVisitor(node.objectType, visitor, ts.isTypeNode), nodeVisitor(node.indexType, visitor, ts.isTypeNode)); - case 190: - return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.nameType, visitor, ts.isTypeNode), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); + return factory.updateImportTypeNode(node, nodeVisitor(node.argument, visitor, ts.isTypeNode), nodeVisitor(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); case 191: + return factory.updateNamedTupleMember(node, visitNode(node.dotDotDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); + case 185: + return factory.updateParenthesizedType(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); + case 187: + return factory.updateTypeOperatorNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); + case 188: + return factory.updateIndexedAccessTypeNode(node, nodeVisitor(node.objectType, visitor, ts.isTypeNode), nodeVisitor(node.indexType, visitor, ts.isTypeNode)); + case 189: + return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); + case 190: return factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.isExpression)); case 193: - return factory.updateTemplateLiteralType(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateLiteralTypeSpan)); - case 194: - return factory.updateTemplateLiteralTypeSpan(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); - case 196: return factory.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 197: + case 194: return factory.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 198: + case 195: return factory.updateBindingElement(node, nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.propertyName, visitor, ts.isPropertyName), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 199: + case 196: return factory.updateArrayLiteralExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 200: + case 197: return factory.updateObjectLiteralExpression(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 201: + case 198: if (node.flags & 32) { return factory.updatePropertyAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier)); } return factory.updatePropertyAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 202: + case 199: if (node.flags & 32) { return factory.updateElementAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.argumentExpression, visitor, ts.isExpression)); } return factory.updateElementAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.argumentExpression, visitor, ts.isExpression)); - case 203: + case 200: if (node.flags & 32) { return factory.updateCallChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return factory.updateCallExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 204: + case 201: return factory.updateNewExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 205: + case 202: return factory.updateTaggedTemplateExpression(node, nodeVisitor(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), nodeVisitor(node.template, visitor, ts.isTemplateLiteral)); - case 206: + case 203: return factory.updateTypeAssertion(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 207: + case 204: return factory.updateParenthesizedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 208: + case 205: return factory.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 209: + case 206: return factory.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 210: + case 207: return factory.updateDeleteExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 211: + case 208: return factory.updateTypeOfExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 212: + case 209: return factory.updateVoidExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 213: + case 210: return factory.updateAwaitExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 214: + case 211: return factory.updatePrefixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression)); - case 215: + case 212: return factory.updatePostfixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression)); - case 216: + case 213: return factory.updateBinaryExpression(node, nodeVisitor(node.left, visitor, ts.isExpression), nodeVisitor(node.operatorToken, tokenVisitor, ts.isToken), nodeVisitor(node.right, visitor, ts.isExpression)); - case 217: + case 214: return factory.updateConditionalExpression(node, nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenTrue, visitor, ts.isExpression), nodeVisitor(node.colonToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenFalse, visitor, ts.isExpression)); - case 218: + case 215: return factory.updateTemplateExpression(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 219: + case 216: return factory.updateYieldExpression(node, nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 220: + case 217: return factory.updateSpreadElement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 221: + case 218: return factory.updateClassExpression(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 223: + case 220: return factory.updateExpressionWithTypeArguments(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 224: + case 221: return factory.updateAsExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 225: + case 222: if (node.flags & 32) { return factory.updateNonNullChain(node, nodeVisitor(node.expression, visitor, ts.isExpression)); } return factory.updateNonNullExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 226: + case 223: return factory.updateMetaProperty(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 228: + case 225: return factory.updateTemplateSpan(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); - case 230: + case 227: return factory.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 232: + case 229: return factory.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 233: + case 230: return factory.updateExpressionStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 234: + case 231: return factory.updateIfStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.thenStatement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.elseStatement, visitor, ts.isStatement, factory.liftToBlock)); - case 235: + case 232: return factory.updateDoStatement(node, nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 236: + case 233: return factory.updateWhileStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 237: + case 234: return factory.updateForStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.incrementor, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 238: + case 235: return factory.updateForInStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 239: + case 236: return factory.updateForOfStatement(node, nodeVisitor(node.awaitModifier, tokenVisitor, ts.isToken), nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 240: + case 237: return factory.updateContinueStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier)); - case 241: + case 238: return factory.updateBreakStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier)); - case 242: + case 239: return factory.updateReturnStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 243: + case 240: return factory.updateWithStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 244: + case 241: return factory.updateSwitchStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.caseBlock, visitor, ts.isCaseBlock)); - case 245: + case 242: return factory.updateLabeledStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 246: + case 243: return factory.updateThrowStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 247: + case 244: return factory.updateTryStatement(node, nodeVisitor(node.tryBlock, visitor, ts.isBlock), nodeVisitor(node.catchClause, visitor, ts.isCatchClause), nodeVisitor(node.finallyBlock, visitor, ts.isBlock)); - case 249: + case 246: return factory.updateVariableDeclaration(node, nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 250: + case 247: return factory.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 251: + case 248: return factory.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 252: + case 249: return factory.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 253: + case 250: return factory.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 254: + case 251: return factory.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 255: + case 252: return factory.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 256: + case 253: return factory.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.body, visitor, ts.isModuleBody)); - case 257: + case 254: return factory.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 258: + case 255: return factory.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 259: + case 256: return factory.updateNamespaceExportDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 260: + case 257: return factory.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.moduleReference, visitor, ts.isModuleReference)); - case 261: + case 258: return factory.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.importClause, visitor, ts.isImportClause), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression)); - case 262: + case 259: return factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts.isNamedImportBindings)); - case 263: + case 260: return factory.updateNamespaceImport(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 269: - return factory.updateNamespaceExport(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 264: - return factory.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 265: - return factory.updateImportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier)); case 266: + return factory.updateNamespaceExport(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); + case 261: + return factory.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); + case 262: + return factory.updateImportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier)); + case 263: return factory.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 267: + case 264: return factory.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, ts.isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression)); - case 268: + case 265: return factory.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 270: + case 267: return factory.updateExportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 272: + case 269: return factory.updateExternalModuleReference(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 273: + case 270: return factory.updateJsxElement(node, nodeVisitor(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingElement, visitor, ts.isJsxClosingElement)); - case 274: + case 271: return factory.updateJsxSelfClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes)); - case 275: + case 272: return factory.updateJsxOpeningElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes)); - case 276: + case 273: return factory.updateJsxClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 277: + case 274: return factory.updateJsxFragment(node, nodeVisitor(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 280: + case 277: return factory.updateJsxAttribute(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 281: + case 278: return factory.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 282: + case 279: return factory.updateJsxSpreadAttribute(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 283: + case 280: return factory.updateJsxExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 284: + case 281: return factory.updateCaseClause(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 285: + case 282: return factory.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 286: + case 283: return factory.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 287: + case 284: return factory.updateCatchClause(node, nodeVisitor(node.variableDeclaration, visitor, ts.isVariableDeclaration), nodeVisitor(node.block, visitor, ts.isBlock)); - case 288: + case 285: return factory.updatePropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 289: + case 286: return factory.updateShorthandPropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 290: + case 287: return factory.updateSpreadAssignment(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 291: + case 288: return factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 297: + case 294: return factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context)); - case 336: + case 331: return factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 337: + case 332: return factory.updateCommaListExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: return node; @@ -68319,7 +66509,7 @@ var ts; function chainBundle(context, transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 297 ? transformSourceFile(node) : transformBundle(node); + return node.kind === 294 ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -68368,7 +66558,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 261: + case 258: externalImports.push(node); if (!hasImportStar && getImportNeedsImportStarHelper(node)) { hasImportStar = true; @@ -68377,12 +66567,12 @@ var ts; hasImportDefault = true; } break; - case 260: - if (node.moduleReference.kind === 272) { + case 257: + if (node.moduleReference.kind === 269) { externalImports.push(node); } break; - case 267: + case 264: if (node.moduleSpecifier) { if (!node.exportClause) { externalImports.push(node); @@ -68408,12 +66598,12 @@ var ts; addExportedNamesForExportDeclaration(node); } break; - case 266: + case 263: if (node.isExportEquals && !exportEquals) { exportEquals = node; } break; - case 232: + case 229: if (ts.hasSyntacticModifier(node, 1)) { for (var _b = 0, _c = node.declarationList.declarations; _b < _c.length; _b++) { var decl = _c[_b]; @@ -68421,7 +66611,7 @@ var ts; } } break; - case 251: + case 248: if (ts.hasSyntacticModifier(node, 1)) { if (ts.hasSyntacticModifier(node, 512)) { if (!hasExportDefault) { @@ -68439,7 +66629,7 @@ var ts; } } break; - case 252: + case 249: if (ts.hasSyntacticModifier(node, 1)) { if (ts.hasSyntacticModifier(node, 512)) { if (!hasExportDefault) { @@ -68578,7 +66768,7 @@ var ts; && ts.hasStaticModifier(member) === isStatic; } function isInitializedProperty(member) { - return member.kind === 163 + return member.kind === 162 && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -68741,24 +66931,16 @@ var ts; } ts.flattenDestructuringBinding = flattenDestructuringBinding; function flattenBindingOrAssignmentElement(flattenContext, element, value, location, skipInitializer) { - var bindingTarget = ts.getTargetOfBindingOrAssignmentElement(element); if (!skipInitializer) { var initializer = ts.visitNode(ts.getInitializerOfBindingOrAssignmentElement(element), flattenContext.visitor, ts.isExpression); if (initializer) { - if (value) { - value = createDefaultValueCheck(flattenContext, value, initializer, location); - if (!ts.isSimpleInlineableExpression(initializer) && ts.isBindingOrAssignmentPattern(bindingTarget)) { - value = ensureIdentifier(flattenContext, value, true, location); - } - } - else { - value = initializer; - } + value = value ? createDefaultValueCheck(flattenContext, value, initializer, location) : initializer; } else if (!value) { value = flattenContext.context.factory.createVoidZero(); } } + var bindingTarget = ts.getTargetOfBindingOrAssignmentElement(element); if (ts.isObjectBindingOrAssignmentPattern(bindingTarget)) { flattenObjectBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value, location); } @@ -68831,8 +67013,7 @@ var ts; for (var i = 0; i < numElements; i++) { var element = elements[i]; if (flattenContext.level >= 1) { - if (element.transformFlags & 16384 || flattenContext.hasTransformedPriorElement && !isSimpleBindingOrAssignmentElement(element)) { - flattenContext.hasTransformedPriorElement = true; + if (element.transformFlags & 16384) { var temp = flattenContext.context.factory.createTempVariable(undefined); if (flattenContext.hoistTempVariables) { flattenContext.context.hoistVariableDeclaration(temp); @@ -68866,20 +67047,6 @@ var ts; } } } - function isSimpleBindingOrAssignmentElement(element) { - var target = ts.getTargetOfBindingOrAssignmentElement(element); - if (!target || ts.isOmittedExpression(target)) - return true; - var propertyName = ts.tryGetPropertyNameOfBindingOrAssignmentElement(element); - if (propertyName && !ts.isPropertyNameLiteral(propertyName)) - return false; - var initializer = ts.getInitializerOfBindingOrAssignmentElement(element); - if (initializer && !ts.isSimpleInlineableExpression(initializer)) - return false; - if (ts.isBindingOrAssignmentPattern(target)) - return ts.every(ts.getElementsOfBindingOrAssignmentPattern(target), isSimpleBindingOrAssignmentElement); - return ts.isIdentifier(target); - } function createDefaultValueCheck(flattenContext, value, defaultValue, location) { value = ensureIdentifier(flattenContext, value, true, location); return flattenContext.context.factory.createConditionalExpression(flattenContext.context.factory.createTypeCheck(value, "undefined"), undefined, defaultValue, undefined, value); @@ -69005,8 +67172,8 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(201); - context.enableSubstitution(202); + context.enableSubstitution(198); + context.enableSubstitution(199); var currentSourceFile; var currentNamespace; var currentNamespaceContainerName; @@ -69019,14 +67186,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 298) { + if (node.kind === 295) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return factory.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 300) { + if (prepend.kind === 297) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -69059,16 +67226,16 @@ var ts; } function onBeforeVisitNode(node) { switch (node.kind) { - case 297: - case 258: - case 257: - case 230: + case 294: + case 255: + case 254: + case 227: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 252: - case 251: + case 249: + case 248: if (ts.hasSyntacticModifier(node, 2)) { break; } @@ -69076,7 +67243,7 @@ var ts; recordEmittedDeclarationInScope(node); } else { - ts.Debug.assert(node.kind === 252 || ts.hasSyntacticModifier(node, 512)); + ts.Debug.assert(node.kind === 249 || ts.hasSyntacticModifier(node, 512)); } if (ts.isClassDeclaration(node)) { currentNameScope = node; @@ -69098,10 +67265,10 @@ var ts; } function sourceElementVisitorWorker(node) { switch (node.kind) { - case 261: - case 260: - case 266: - case 267: + case 258: + case 257: + case 263: + case 264: return visitElidableStatement(node); default: return visitorWorker(node); @@ -69116,13 +67283,13 @@ var ts; return node; } switch (node.kind) { - case 261: + case 258: return visitImportDeclaration(node); - case 260: + case 257: return visitImportEqualsDeclaration(node); - case 266: + case 263: return visitExportAssignment(node); - case 267: + case 264: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -69132,11 +67299,11 @@ var ts; return saveStateAndInvoke(node, namespaceElementVisitorWorker); } function namespaceElementVisitorWorker(node) { - if (node.kind === 267 || - node.kind === 261 || - node.kind === 262 || - (node.kind === 260 && - node.moduleReference.kind === 272)) { + if (node.kind === 264 || + node.kind === 258 || + node.kind === 259 || + (node.kind === 257 && + node.moduleReference.kind === 269)) { return undefined; } else if (node.transformFlags & 1 || ts.hasSyntacticModifier(node, 1)) { @@ -69149,16 +67316,16 @@ var ts; } function classElementVisitorWorker(node) { switch (node.kind) { - case 166: - return visitConstructor(node); - case 163: - return visitPropertyDeclaration(node); - case 171: - case 167: - case 168: case 165: + return visitConstructor(node); + case 162: + return visitPropertyDeclaration(node); + case 170: + case 166: + case 167: + case 164: return visitorWorker(node); - case 229: + case 226: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -69187,95 +67354,95 @@ var ts; case 125: case 84: case 133: - case 142: + case 141: + case 177: case 178: case 179: case 180: - case 181: - case 177: - case 172: - case 159: - case 128: - case 152: - case 131: - case 147: - case 144: - case 141: - case 113: - case 148: - case 175: - case 174: case 176: + case 171: + case 158: + case 128: + case 151: + case 131: + case 146: + case 143: + case 140: + case 113: + case 147: + case 174: case 173: + case 175: + case 172: + case 181: case 182: case 183: - case 184: + case 185: case 186: case 187: case 188: case 189: case 190: - case 191: - case 171: - case 161: - case 254: - return undefined; - case 163: - return visitPropertyDeclaration(node); - case 259: - return undefined; - case 166: - return visitConstructor(node); - case 253: - return factory.createNotEmittedStatement(node); - case 252: - return visitClassDeclaration(node); - case 221: - return visitClassExpression(node); - case 286: - return visitHeritageClause(node); - case 223: - return visitExpressionWithTypeArguments(node); - case 165: - return visitMethodDeclaration(node); - case 167: - return visitGetAccessor(node); - case 168: - return visitSetAccessor(node); - case 251: - return visitFunctionDeclaration(node); - case 208: - return visitFunctionExpression(node); - case 209: - return visitArrowFunction(node); + case 170: case 160: - return visitParameter(node); - case 207: - return visitParenthesizedExpression(node); - case 206: - case 224: - return visitAssertionExpression(node); - case 203: - return visitCallExpression(node); - case 204: - return visitNewExpression(node); - case 205: - return visitTaggedTemplateExpression(node); - case 225: - return visitNonNullExpression(node); - case 255: - return visitEnumDeclaration(node); - case 232: - return visitVariableStatement(node); - case 249: - return visitVariableDeclaration(node); + case 251: + return undefined; + case 162: + return visitPropertyDeclaration(node); case 256: + return undefined; + case 165: + return visitConstructor(node); + case 250: + return factory.createNotEmittedStatement(node); + case 249: + return visitClassDeclaration(node); + case 218: + return visitClassExpression(node); + case 283: + return visitHeritageClause(node); + case 220: + return visitExpressionWithTypeArguments(node); + case 164: + return visitMethodDeclaration(node); + case 166: + return visitGetAccessor(node); + case 167: + return visitSetAccessor(node); + case 248: + return visitFunctionDeclaration(node); + case 205: + return visitFunctionExpression(node); + case 206: + return visitArrowFunction(node); + case 159: + return visitParameter(node); + case 204: + return visitParenthesizedExpression(node); + case 203: + case 221: + return visitAssertionExpression(node); + case 200: + return visitCallExpression(node); + case 201: + return visitNewExpression(node); + case 202: + return visitTaggedTemplateExpression(node); + case 222: + return visitNonNullExpression(node); + case 252: + return visitEnumDeclaration(node); + case 229: + return visitVariableStatement(node); + case 246: + return visitVariableDeclaration(node); + case 253: return visitModuleDeclaration(node); - case 260: + case 257: return visitImportEqualsDeclaration(node); - case 274: + case 271: return visitJsxSelfClosingElement(node); - case 275: + case 272: return visitJsxJsxOpeningElement(node); default: return ts.visitEachChild(node, visitor, context); @@ -69487,12 +67654,12 @@ var ts; } function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { + case 166: case 167: - case 168: return getAllDecoratorsOfAccessors(node, member); - case 165: + case 164: return getAllDecoratorsOfMethod(member); - case 163: + case 162: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -69571,7 +67738,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, true); var descriptor = languageVersion > 0 - ? member.kind === 163 + ? member.kind === 162 ? factory.createVoidZero() : factory.createNull() : undefined; @@ -69657,22 +67824,22 @@ var ts; } function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 165 + return kind === 164 + || kind === 166 || kind === 167 - || kind === 168 - || kind === 163; + || kind === 162; } function shouldAddReturnTypeMetadata(node) { - return node.kind === 165; + return node.kind === 164; } function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 252: - case 221: + case 249: + case 218: return ts.getFirstConstructorWithBody(node) !== undefined; - case 165: + case 164: + case 166: case 167: - case 168: return true; } return false; @@ -69684,15 +67851,15 @@ var ts; } function serializeTypeOfNode(node) { switch (node.kind) { - case 163: - case 160: + case 162: + case 159: return serializeTypeNode(node.type); - case 168: case 167: + case 166: return serializeTypeNode(getAccessorTypeNode(node)); - case 252: - case 221: - case 165: + case 249: + case 218: + case 164: return factory.createIdentifier("Function"); default: return factory.createVoidZero(); @@ -69724,7 +67891,7 @@ var ts; return factory.createArrayLiteralExpression(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 167) { + if (container && node.kind === 166) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -69747,30 +67914,30 @@ var ts; } switch (node.kind) { case 113: - case 150: - case 141: + case 149: + case 140: return factory.createVoidZero(); - case 186: + case 185: return serializeTypeNode(node.type); + case 173: case 174: - case 175: return factory.createIdentifier("Function"); + case 177: case 178: - case 179: return factory.createIdentifier("Array"); - case 172: + case 171: case 131: return factory.createIdentifier("Boolean"); - case 147: + case 146: return factory.createIdentifier("String"); - case 145: + case 144: return factory.createIdentifier("Object"); - case 191: + case 190: switch (node.literal.kind) { case 10: case 14: return factory.createIdentifier("String"); - case 214: + case 211: case 8: return factory.createIdentifier("Number"); case 9: @@ -69783,44 +67950,44 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 144: + case 143: return factory.createIdentifier("Number"); - case 155: + case 154: return getGlobalBigIntNameWithFallback(); - case 148: + case 147: return languageVersion < 2 ? getGlobalSymbolNameWithFallback() : factory.createIdentifier("Symbol"); - case 173: + case 172: return serializeTypeReferenceNode(node); - case 183: case 182: + case 181: return serializeTypeList(node.types); - case 184: + case 183: return serializeTypeList([node.trueType, node.falseType]); - case 188: - if (node.operator === 142) { + case 187: + if (node.operator === 141) { return serializeTypeNode(node.type); } break; - case 176: + case 175: + case 188: case 189: - case 190: - case 177: + case 176: case 128: - case 152: - case 187: - case 195: + case 151: + case 186: + case 192: break; - case 303: + case 299: + case 300: case 304: - case 308: - case 309: - case 310: - break; case 305: case 306: - case 307: + break; + case 301: + case 302: + case 303: return serializeTypeNode(node.type); default: return ts.Debug.failBadSyntaxKind(node); @@ -69829,15 +67996,15 @@ var ts; } function serializeTypeList(types) { var serializedUnion; - for (var _i = 0, types_22 = types; _i < types_22.length; _i++) { - var typeNode = types_22[_i]; - while (typeNode.kind === 186) { + for (var _i = 0, types_21 = types; _i < types_21.length; _i++) { + var typeNode = types_21[_i]; + while (typeNode.kind === 185) { typeNode = typeNode.type; } - if (typeNode.kind === 141) { + if (typeNode.kind === 140) { continue; } - if (!strictNullChecks && (typeNode.kind === 191 && typeNode.literal.kind === 103 || typeNode.kind === 150)) { + if (!strictNullChecks && (typeNode.kind === 190 && typeNode.literal.kind === 103 || typeNode.kind === 149)) { continue; } var serializedIndividual = serializeTypeNode(typeNode); @@ -69917,7 +68084,7 @@ var ts; name.original = undefined; ts.setParent(name, ts.getParseTreeNode(currentLexicalScope)); return name; - case 157: + case 156: return serializeQualifiedNameAsExpression(node); } } @@ -70262,11 +68429,11 @@ var ts; function addVarForEnumOrModuleDeclaration(statements, node) { var statement = factory.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), factory.createVariableDeclarationList([ factory.createVariableDeclaration(factory.getLocalName(node, false, true)) - ], currentLexicalScope.kind === 297 ? 0 : 1)); + ], currentLexicalScope.kind === 294 ? 0 : 1)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { - if (node.kind === 255) { + if (node.kind === 252) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -70332,7 +68499,7 @@ var ts; var statementsLocation; var blockLocation; if (node.body) { - if (node.body.kind === 257) { + if (node.body.kind === 254) { saveStateAndInvoke(node.body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = node.body.statements; blockLocation = node.body; @@ -70357,13 +68524,13 @@ var ts; currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; var block = factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), statementsLocation), true); ts.setTextRange(block, blockLocation); - if (!node.body || node.body.kind !== 257) { + if (!node.body || node.body.kind !== 254) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 256) { + if (moduleDeclaration.body.kind === 253) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -70391,7 +68558,7 @@ var ts; return (name || namedBindings) ? factory.updateImportClause(node, false, name, namedBindings) : undefined; } function visitNamedImportBindings(node) { - if (node.kind === 263) { + if (node.kind === 260) { return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } else { @@ -70537,15 +68704,15 @@ var ts; if ((enabledSubstitutions & 2) === 0) { enabledSubstitutions |= 2; context.enableSubstitution(78); - context.enableSubstitution(289); - context.enableEmitNotification(256); + context.enableSubstitution(286); + context.enableEmitNotification(253); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 256; + return ts.getOriginalNode(node).kind === 253; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 255; + return ts.getOriginalNode(node).kind === 252; } function onEmitNode(hint, node, emitCallback) { var savedApplicableSubstitutions = applicableSubstitutions; @@ -70591,9 +68758,9 @@ var ts; switch (node.kind) { case 78: return substituteExpressionIdentifier(node); - case 201: + case 198: return substitutePropertyAccessExpression(node); - case 202: + case 199: return substituteElementAccessExpression(node); } return node; @@ -70623,9 +68790,9 @@ var ts; function trySubstituteNamespaceExportedName(node) { if (enabledSubstitutions & applicableSubstitutions && !ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var container = resolver.getReferencedExportContainer(node, false); - if (container && container.kind !== 297) { - var substitute = (applicableSubstitutions & 2 && container.kind === 256) || - (applicableSubstitutions & 8 && container.kind === 255); + if (container && container.kind !== 294) { + var substitute = (applicableSubstitutions & 2 && container.kind === 253) || + (applicableSubstitutions & 8 && container.kind === 252); if (substitute) { return ts.setTextRange(factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(container), node), node); } @@ -70695,40 +68862,40 @@ var ts; if (!(node.transformFlags & 4194304)) return node; switch (node.kind) { - case 221: - case 252: + case 218: + case 249: return visitClassLike(node); - case 163: + case 162: return visitPropertyDeclaration(node); - case 232: + case 229: return visitVariableStatement(node); - case 158: + case 157: return visitComputedPropertyName(node); - case 201: + case 198: return visitPropertyAccessExpression(node); - case 214: + case 211: return visitPrefixUnaryExpression(node); - case 215: + case 212: return visitPostfixUnaryExpression(node, false); - case 203: + case 200: return visitCallExpression(node); - case 216: + case 213: return visitBinaryExpression(node); case 79: return visitPrivateIdentifier(node); - case 233: + case 230: return visitExpressionStatement(node); - case 237: + case 234: return visitForStatement(node); - case 205: + case 202: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 200: - case 199: + case 197: + case 196: return visitAssignmentPattern(node); default: return visitor(node); @@ -70742,17 +68909,17 @@ var ts; } function classElementVisitor(node) { switch (node.kind) { - case 166: - return undefined; - case 167: - case 168: case 165: + return undefined; + case 166: + case 167: + case 164: return ts.visitEachChild(node, classElementVisitor, context); - case 163: + case 162: return visitPropertyDeclaration(node); - case 158: + case 157: return visitComputedPropertyName(node); - case 229: + case 226: return node; default: return visitor(node); @@ -71348,31 +69515,31 @@ var ts; switch (node.kind) { case 129: return undefined; - case 213: + case 210: return visitAwaitExpression(node); - case 165: + case 164: return doWithContext(1 | 2, visitMethodDeclaration, node); - case 251: + case 248: return doWithContext(1 | 2, visitFunctionDeclaration, node); - case 208: + case 205: return doWithContext(1 | 2, visitFunctionExpression, node); - case 209: + case 206: return doWithContext(1, visitArrowFunction, node); - case 201: + case 198: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105) { capturedSuperProperties.add(node.name.escapedText); } return ts.visitEachChild(node, visitor, context); - case 202: + case 199: if (capturedSuperProperties && node.expression.kind === 105) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 167: - case 168: case 166: - case 252: - case 221: + case 167: + case 165: + case 249: + case 218: return doWithContext(1 | 2, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -71381,27 +69548,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 232: + case 229: return visitVariableStatementInAsyncBody(node); - case 237: - return visitForStatementInAsyncBody(node); - case 238: - return visitForInStatementInAsyncBody(node); - case 239: - return visitForOfStatementInAsyncBody(node); - case 287: - return visitCatchClauseInAsyncBody(node); - case 230: - case 244: - case 258: - case 284: - case 285: - case 247: - case 235: - case 236: case 234: - case 243: - case 245: + return visitForStatementInAsyncBody(node); + case 235: + return visitForInStatementInAsyncBody(node); + case 236: + return visitForOfStatementInAsyncBody(node); + case 284: + return visitCatchClauseInAsyncBody(node); + case 227: + case 241: + case 255: + case 281: + case 282: + case 244: + case 232: + case 233: + case 231: + case 240: + case 242: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -71553,7 +69720,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 209; + var isArrowFunction = node.kind === 206; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0; var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; enclosingFunctionParameterNames = new ts.Set(); @@ -71634,15 +69801,15 @@ var ts; function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; - context.enableSubstitution(203); - context.enableSubstitution(201); - context.enableSubstitution(202); - context.enableEmitNotification(252); - context.enableEmitNotification(165); - context.enableEmitNotification(167); - context.enableEmitNotification(168); + context.enableSubstitution(200); + context.enableSubstitution(198); + context.enableSubstitution(199); + context.enableEmitNotification(249); + context.enableEmitNotification(164); context.enableEmitNotification(166); - context.enableEmitNotification(232); + context.enableEmitNotification(167); + context.enableEmitNotification(165); + context.enableEmitNotification(229); } } function onEmitNode(hint, node, emitCallback) { @@ -71674,11 +69841,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 201: + case 198: return substitutePropertyAccessExpression(node); - case 202: + case 199: return substituteElementAccessExpression(node); - case 203: + case 200: return substituteCallExpression(node); } return node; @@ -71709,11 +69876,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 252 - || kind === 166 + return kind === 249 || kind === 165 - || kind === 167 - || kind === 168; + || kind === 164 + || kind === 166 + || kind === 167; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096) { @@ -71798,7 +69965,7 @@ var ts; function visitor(node) { return visitorWorker(node, false); } - function visitorWithUnusedExpressionResult(node) { + function visitorNoDestructuringValue(node) { return visitorWorker(node, true); } function visitorNoAsyncModifier(node) { @@ -71819,75 +69986,73 @@ var ts; function visitDefault(node) { return ts.visitEachChild(node, visitor, context); } - function visitorWorker(node, expressionResultIsUnused) { + function visitorWorker(node, noDestructuringValue) { if ((node.transformFlags & 32) === 0) { return node; } switch (node.kind) { - case 213: + case 210: return visitAwaitExpression(node); - case 219: - return visitYieldExpression(node); - case 242: - return visitReturnStatement(node); - case 245: - return visitLabeledStatement(node); - case 200: - return visitObjectLiteralExpression(node); case 216: - return visitBinaryExpression(node, expressionResultIsUnused); - case 337: - return visitCommaListExpression(node, expressionResultIsUnused); - case 287: - return visitCatchClause(node); - case 232: - return visitVariableStatement(node); - case 249: - return visitVariableDeclaration(node); - case 235: - case 236: - case 238: - return doWithHierarchyFacts(visitDefault, node, 0, 2); + return visitYieldExpression(node); case 239: - return visitForOfStatement(node, undefined); - case 237: - return doWithHierarchyFacts(visitForStatement, node, 0, 2); - case 212: - return visitVoidExpression(node); - case 166: - return doWithHierarchyFacts(visitConstructorDeclaration, node, 2, 1); - case 165: - return doWithHierarchyFacts(visitMethodDeclaration, node, 2, 1); - case 167: - return doWithHierarchyFacts(visitGetAccessorDeclaration, node, 2, 1); - case 168: - return doWithHierarchyFacts(visitSetAccessorDeclaration, node, 2, 1); - case 251: - return doWithHierarchyFacts(visitFunctionDeclaration, node, 2, 1); - case 208: - return doWithHierarchyFacts(visitFunctionExpression, node, 2, 1); - case 209: - return doWithHierarchyFacts(visitArrowFunction, node, 2, 0); - case 160: - return visitParameter(node); + return visitReturnStatement(node); + case 242: + return visitLabeledStatement(node); + case 197: + return visitObjectLiteralExpression(node); + case 213: + return visitBinaryExpression(node, noDestructuringValue); + case 284: + return visitCatchClause(node); + case 229: + return visitVariableStatement(node); + case 246: + return visitVariableDeclaration(node); + case 232: case 233: - return visitExpressionStatement(node); - case 207: - return visitParenthesizedExpression(node, expressionResultIsUnused); + case 235: + return doWithHierarchyFacts(visitDefault, node, 0, 2); + case 236: + return visitForOfStatement(node, undefined); + case 234: + return doWithHierarchyFacts(visitForStatement, node, 0, 2); + case 209: + return visitVoidExpression(node); + case 165: + return doWithHierarchyFacts(visitConstructorDeclaration, node, 2, 1); + case 164: + return doWithHierarchyFacts(visitMethodDeclaration, node, 2, 1); + case 166: + return doWithHierarchyFacts(visitGetAccessorDeclaration, node, 2, 1); + case 167: + return doWithHierarchyFacts(visitSetAccessorDeclaration, node, 2, 1); + case 248: + return doWithHierarchyFacts(visitFunctionDeclaration, node, 2, 1); case 205: + return doWithHierarchyFacts(visitFunctionExpression, node, 2, 1); + case 206: + return doWithHierarchyFacts(visitArrowFunction, node, 2, 0); + case 159: + return visitParameter(node); + case 230: + return visitExpressionStatement(node); + case 204: + return visitParenthesizedExpression(node, noDestructuringValue); + case 202: return visitTaggedTemplateExpression(node); - case 201: + case 198: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105) { capturedSuperProperties.add(node.name.escapedText); } return ts.visitEachChild(node, visitor, context); - case 202: + case 199: if (capturedSuperProperties && node.expression.kind === 105) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 252: - case 221: + case 249: + case 218: return doWithHierarchyFacts(visitDefault, node, 2, 1); default: return ts.visitEachChild(node, visitor, context); @@ -71920,7 +70085,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 239 && statement.awaitModifier) { + if (statement.kind === 236 && statement.awaitModifier) { return visitForOfStatement(statement, node); } return factory.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement, factory.liftToBlock), node); @@ -71932,7 +70097,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 290) { + if (e.kind === 287) { if (chunkObject) { objects.push(factory.createObjectLiteralExpression(chunkObject)); chunkObject = undefined; @@ -71941,7 +70106,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 288 + chunkObject = ts.append(chunkObject, e.kind === 285 ? factory.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -71954,7 +70119,7 @@ var ts; function visitObjectLiteralExpression(node) { if (node.transformFlags & 16384) { var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 200) { + if (objects.length && objects[0].kind !== 197) { objects.unshift(factory.createObjectLiteralExpression()); } var expression = objects[0]; @@ -71971,10 +70136,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitExpressionStatement(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + return ts.visitEachChild(node, visitorNoDestructuringValue, context); } - function visitParenthesizedExpression(node, expressionResultIsUnused) { - return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context); + function visitParenthesizedExpression(node, noDestructuringValue) { + return ts.visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context); } function visitSourceFile(node) { var ancestorFacts = enterSubtree(2, ts.isEffectiveStrictModeSourceFile(node, compilerOptions) ? @@ -71992,31 +70157,15 @@ var ts; function visitTaggedTemplateExpression(node) { return ts.processTaggedTemplateExpression(context, node, visitor, currentSourceFile, recordTaggedTemplateString, ts.ProcessLevel.LiftRestriction); } - function visitBinaryExpression(node, expressionResultIsUnused) { + function visitBinaryExpression(node, noDestructuringValue) { if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 16384) { - return ts.flattenDestructuringAssignment(node, visitor, context, 1, !expressionResultIsUnused); + return ts.flattenDestructuringAssignment(node, visitor, context, 1, !noDestructuringValue); } - if (node.operatorToken.kind === 27) { - return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression)); + else if (node.operatorToken.kind === 27) { + return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorNoDestructuringValue, ts.isExpression), node.operatorToken, ts.visitNode(node.right, noDestructuringValue ? visitorNoDestructuringValue : visitor, ts.isExpression)); } return ts.visitEachChild(node, visitor, context); } - function visitCommaListExpression(node, expressionResultIsUnused) { - if (expressionResultIsUnused) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - var result; - for (var i = 0; i < node.elements.length; i++) { - var element = node.elements[i]; - var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - result.push(visited); - } - } - var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements; - return factory.updateCommaListExpression(node, elements); - } function visitCatchClause(node) { if (node.variableDeclaration && ts.isBindingPattern(node.variableDeclaration.name) && @@ -72061,10 +70210,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitForStatement(node) { - return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement)); + return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorNoDestructuringValue, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement)); } function visitVoidExpression(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + return ts.visitEachChild(node, visitorNoDestructuringValue, context); } function visitForOfStatement(node, outermostLabeledStatement) { var ancestorFacts = enterSubtree(0, 2); @@ -72298,15 +70447,15 @@ var ts; function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; - context.enableSubstitution(203); - context.enableSubstitution(201); - context.enableSubstitution(202); - context.enableEmitNotification(252); - context.enableEmitNotification(165); - context.enableEmitNotification(167); - context.enableEmitNotification(168); + context.enableSubstitution(200); + context.enableSubstitution(198); + context.enableSubstitution(199); + context.enableEmitNotification(249); + context.enableEmitNotification(164); context.enableEmitNotification(166); - context.enableEmitNotification(232); + context.enableEmitNotification(167); + context.enableEmitNotification(165); + context.enableEmitNotification(229); } } function onEmitNode(hint, node, emitCallback) { @@ -72338,11 +70487,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 201: + case 198: return substitutePropertyAccessExpression(node); - case 202: + case 199: return substituteElementAccessExpression(node); - case 203: + case 200: return substituteCallExpression(node); } return node; @@ -72373,11 +70522,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 252 - || kind === 166 + return kind === 249 || kind === 165 - || kind === 167 - || kind === 168; + || kind === 164 + || kind === 166 + || kind === 167; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096) { @@ -72406,7 +70555,7 @@ var ts; return node; } switch (node.kind) { - case 287: + case 284: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -72437,21 +70586,21 @@ var ts; return node; } switch (node.kind) { - case 201: - case 202: - case 203: + case 198: + case 199: + case 200: if (node.flags & 32) { var updated = visitOptionalExpression(node, false, false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 216: + case 213: if (node.operatorToken.kind === 60) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 210: + case 207: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -72490,7 +70639,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 201 + expression = node.kind === 198 ? factory.updatePropertyAccessExpression(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : factory.updateElementAccessExpression(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? factory.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -72503,10 +70652,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 207: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 201: - case 202: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 203: return visitNonOptionalCallExpression(node, captureThisArg); + case 204: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 198: + case 199: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 200: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -72525,8 +70674,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 201: - case 202: + case 198: + case 199: if (i === chain.length - 1 && captureThisArg) { if (!ts.isSimpleCopiableExpression(rightExpression)) { thisArg = factory.createTempVariable(hoistVariableDeclaration); @@ -72536,11 +70685,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 201 + rightExpression = segment.kind === 198 ? factory.createPropertyAccessExpression(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : factory.createElementAccessExpression(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 203: + case 200: if (i === 0 && leftThisArg) { rightExpression = factory.createFunctionCallCall(rightExpression, leftThisArg.kind === 105 ? factory.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -72592,7 +70741,7 @@ var ts; return node; } switch (node.kind) { - case 216: + case 213: var binaryExpression = node; if (ts.isLogicalOrCoalescingAssignmentExpression(binaryExpression)) { return transformLogicalAssignment(binaryExpression); @@ -72635,85 +70784,14 @@ var ts; var factory = context.factory, emitHelpers = context.getEmitHelperFactory; var compilerOptions = context.getCompilerOptions(); var currentSourceFile; - var currentFileState; return ts.chainBundle(context, transformSourceFile); - function getCurrentFileNameExpression() { - if (currentFileState.filenameDeclaration) { - return currentFileState.filenameDeclaration.name; - } - var declaration = factory.createVariableDeclaration(factory.createUniqueName("_jsxFileName", 16 | 32), undefined, undefined, factory.createStringLiteral(currentSourceFile.fileName)); - currentFileState.filenameDeclaration = declaration; - return currentFileState.filenameDeclaration.name; - } - function getJsxFactoryCalleePrimitive(childrenLength) { - return compilerOptions.jsx === 5 ? "jsxDEV" : childrenLength > 1 ? "jsxs" : "jsx"; - } - function getJsxFactoryCallee(childrenLength) { - var type = getJsxFactoryCalleePrimitive(childrenLength); - return getImplicitImportForName(type); - } - function getImplicitJsxFragmentReference() { - return getImplicitImportForName("Fragment"); - } - function getImplicitImportForName(name) { - var _a, _b; - var importSource = name === "createElement" - ? currentFileState.importSpecifier - : ts.getJSXRuntimeImport(currentFileState.importSpecifier, compilerOptions); - var existing = (_b = (_a = currentFileState.utilizedImplicitRuntimeImports) === null || _a === void 0 ? void 0 : _a.get(importSource)) === null || _b === void 0 ? void 0 : _b.get(name); - if (existing) { - return existing.name; - } - if (!currentFileState.utilizedImplicitRuntimeImports) { - currentFileState.utilizedImplicitRuntimeImports = ts.createMap(); - } - var specifierSourceImports = currentFileState.utilizedImplicitRuntimeImports.get(importSource); - if (!specifierSourceImports) { - specifierSourceImports = ts.createMap(); - currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports); - } - var generatedName = factory.createUniqueName("_" + name, 16 | 32 | 64); - var specifier = factory.createImportSpecifier(factory.createIdentifier(name), generatedName); - generatedName.generatedImportReference = specifier; - specifierSourceImports.set(name, specifier); - return generatedName; - } function transformSourceFile(node) { if (node.isDeclarationFile) { return node; } currentSourceFile = node; - currentFileState = {}; - currentFileState.importSpecifier = ts.getJSXImplicitImportBase(compilerOptions, node); var visited = ts.visitEachChild(node, visitor, context); ts.addEmitHelpers(visited, context.readEmitHelpers()); - var statements = visited.statements; - if (currentFileState.filenameDeclaration) { - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), factory.createVariableStatement(undefined, factory.createVariableDeclarationList([currentFileState.filenameDeclaration], 2))); - } - if (currentFileState.utilizedImplicitRuntimeImports) { - for (var _i = 0, _a = ts.arrayFrom(currentFileState.utilizedImplicitRuntimeImports.entries()); _i < _a.length; _i++) { - var _b = _a[_i], importSource = _b[0], importSpecifiersMap = _b[1]; - if (ts.isExternalModule(node)) { - var importStatement = factory.createImportDeclaration(undefined, undefined, factory.createImportClause(false, undefined, factory.createNamedImports(ts.arrayFrom(importSpecifiersMap.values()))), factory.createStringLiteral(importSource)); - ts.setParentRecursive(importStatement, false); - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), importStatement); - } - else if (ts.isExternalOrCommonJsModule(node)) { - var requireStatement = factory.createVariableStatement(undefined, factory.createVariableDeclarationList([ - factory.createVariableDeclaration(factory.createObjectBindingPattern(ts.map(ts.arrayFrom(importSpecifiersMap.values()), function (s) { return factory.createBindingElement(undefined, s.propertyName, s.name); })), undefined, undefined, factory.createCallExpression(factory.createIdentifier("require"), undefined, [factory.createStringLiteral(importSource)])) - ], 2)); - ts.setParentRecursive(requireStatement, false); - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), requireStatement); - } - else { - } - } - } - if (statements !== visited.statements) { - visited = factory.updateSourceFile(visited, statements); - } - currentFileState = undefined; return visited; } function visitor(node) { @@ -72726,13 +70804,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 273: + case 270: return visitJsxElement(node, false); - case 274: + case 271: return visitJsxSelfClosingElement(node, false); - case 277: + case 274: return visitJsxFragment(node, false); - case 283: + case 280: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -72742,109 +70820,28 @@ var ts; switch (node.kind) { case 11: return visitJsxText(node); - case 283: + case 280: return visitJsxExpression(node); - case 273: + case 270: return visitJsxElement(node, true); - case 274: + case 271: return visitJsxSelfClosingElement(node, true); - case 277: + case 274: return visitJsxFragment(node, true); default: return ts.Debug.failBadSyntaxKind(node); } } - function hasKeyAfterPropsSpread(node) { - var spread = false; - for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { - var elem = _a[_i]; - if (ts.isJsxSpreadAttribute(elem)) { - spread = true; - } - else if (spread && ts.isJsxAttribute(elem) && elem.name.escapedText === "key") { - return true; - } - } - return false; - } - function shouldUseCreateElement(node) { - return currentFileState.importSpecifier === undefined || hasKeyAfterPropsSpread(node); - } function visitJsxElement(node, isChild) { - var tagTransform = shouldUseCreateElement(node.openingElement) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform(node.openingElement, node.children, isChild, node); + return visitJsxOpeningLikeElement(node.openingElement, node.children, isChild, node); } function visitJsxSelfClosingElement(node, isChild) { - var tagTransform = shouldUseCreateElement(node) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform(node, undefined, isChild, node); + return visitJsxOpeningLikeElement(node, undefined, isChild, node); } function visitJsxFragment(node, isChild) { - var tagTransform = currentFileState.importSpecifier === undefined ? visitJsxOpeningFragmentCreateElement : visitJsxOpeningFragmentJSX; - return tagTransform(node.openingFragment, node.children, isChild, node); + return visitJsxOpeningFragment(node.openingFragment, node.children, isChild, node); } - function convertJsxChildrenToChildrenPropObject(children) { - var nonWhitespaceChildren = ts.getSemanticJsxChildren(children); - if (ts.length(nonWhitespaceChildren) === 1) { - var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]); - return result_13 && factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("children", result_13) - ]); - } - var result = ts.mapDefined(children, transformJsxChildToExpression); - return !result.length ? undefined : factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) - ]); - } - function visitJsxOpeningLikeElementJSX(node, children, isChild, location) { - var tagName = getTagName(node); - var objectProperties; - var keyAttr = ts.find(node.attributes.properties, function (p) { return !!p.name && ts.isIdentifier(p.name) && p.name.escapedText === "key"; }); - var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties; - var segments = []; - if (attrs.length) { - segments = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread - ? ts.map(attrs, transformJsxSpreadAttributeToExpression) - : factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); })); - if (ts.isJsxSpreadAttribute(attrs[0])) { - segments.unshift(factory.createObjectLiteralExpression()); - } - } - if (children && children.length) { - var result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - segments.push(result); - } - } - if (segments.length === 0) { - objectProperties = factory.createObjectLiteralExpression([]); - } - else { - objectProperties = ts.singleOrUndefined(segments) || emitHelpers().createAssignHelper(segments); - } - return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, ts.length(ts.getSemanticJsxChildren(children || ts.emptyArray)), isChild, location); - } - function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, childrenLength, isChild, location) { - var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)]; - if (compilerOptions.jsx === 5) { - var originalFile = ts.getOriginalNode(currentSourceFile); - if (originalFile && ts.isSourceFile(originalFile)) { - args.push(childrenLength > 1 ? factory.createTrue() : factory.createFalse()); - var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos); - args.push(factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("fileName", getCurrentFileNameExpression()), - factory.createPropertyAssignment("lineNumber", factory.createNumericLiteral(lineCol.line + 1)), - factory.createPropertyAssignment("columnNumber", factory.createNumericLiteral(lineCol.character + 1)) - ])); - args.push(factory.createThis()); - } - } - var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(childrenLength), undefined, args), location); - if (isChild) { - ts.startOnNewLine(element); - } - return element; - } - function visitJsxOpeningLikeElementCreateElement(node, children, isChild, location) { + function visitJsxOpeningLikeElement(node, children, isChild, location) { var tagName = getTagName(node); var objectProperties; var attrs = node.attributes.properties; @@ -72863,26 +70860,13 @@ var ts; objectProperties = emitHelpers().createAssignHelper(segments); } } - var callee = currentFileState.importSpecifier === undefined - ? ts.createJsxFactoryExpression(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, node) - : getImplicitImportForName("createElement"); - var element = ts.createExpressionForJsxElement(factory, callee, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), location); + var element = ts.createExpressionForJsxElement(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } return element; } - function visitJsxOpeningFragmentJSX(_node, children, isChild, location) { - var childrenProps; - if (children && children.length) { - var result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - childrenProps = result; - } - } - return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]), undefined, ts.length(ts.getSemanticJsxChildren(children)), isChild, location); - } - function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) { + function visitJsxOpeningFragment(node, children, isChild, location) { var element = ts.createExpressionForJsxFragment(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); @@ -72906,7 +70890,7 @@ var ts; var literal = factory.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote); return ts.setTextRange(literal, node); } - else if (node.kind === 283) { + else if (node.kind === 280) { if (node.expression === undefined) { return factory.createTrue(); } @@ -72966,7 +70950,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 273) { + if (node.kind === 270) { return getTagName(node.openingElement); } else { @@ -73266,7 +71250,7 @@ var ts; return node; } switch (node.kind) { - case 216: + case 213: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -73356,7 +71340,7 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192) !== 0 - && node.kind === 242 + && node.kind === 239 && !node.expression; } function isOrMayContainReturnCompletion(node) { @@ -73382,10 +71366,12 @@ var ts; || (ts.getEmitFlags(node) & 33554432) !== 0; } function visitor(node) { - return shouldVisitNode(node) ? visitorWorker(node, false) : node; - } - function visitorWithUnusedExpressionResult(node) { - return shouldVisitNode(node) ? visitorWorker(node, true) : node; + if (shouldVisitNode(node)) { + return visitJavaScript(node); + } + else { + return node; + } } function callExpressionVisitor(node) { if (node.kind === 105) { @@ -73393,70 +71379,68 @@ var ts; } return visitor(node); } - function visitorWorker(node, expressionResultIsUnused) { + function visitJavaScript(node) { switch (node.kind) { case 123: return undefined; - case 252: - return visitClassDeclaration(node); - case 221: - return visitClassExpression(node); - case 160: - return visitParameter(node); - case 251: - return visitFunctionDeclaration(node); - case 209: - return visitArrowFunction(node); - case 208: - return visitFunctionExpression(node); case 249: + return visitClassDeclaration(node); + case 218: + return visitClassExpression(node); + case 159: + return visitParameter(node); + case 248: + return visitFunctionDeclaration(node); + case 206: + return visitArrowFunction(node); + case 205: + return visitFunctionExpression(node); + case 246: return visitVariableDeclaration(node); case 78: return visitIdentifier(node); - case 250: + case 247: return visitVariableDeclarationList(node); - case 244: - return visitSwitchStatement(node); - case 258: - return visitCaseBlock(node); - case 230: - return visitBlock(node, false); case 241: - case 240: - return visitBreakOrContinueStatement(node); - case 245: - return visitLabeledStatement(node); - case 235: - case 236: - return visitDoOrWhileStatement(node, undefined); - case 237: - return visitForStatement(node, undefined); + return visitSwitchStatement(node); + case 255: + return visitCaseBlock(node); + case 227: + return visitBlock(node, false); case 238: - return visitForInStatement(node, undefined); - case 239: - return visitForOfStatement(node, undefined); + case 237: + return visitBreakOrContinueStatement(node); + case 242: + return visitLabeledStatement(node); + case 232: case 233: + return visitDoOrWhileStatement(node, undefined); + case 234: + return visitForStatement(node, undefined); + case 235: + return visitForInStatement(node, undefined); + case 236: + return visitForOfStatement(node, undefined); + case 230: return visitExpressionStatement(node); - case 200: + case 197: return visitObjectLiteralExpression(node); - case 287: + case 284: return visitCatchClause(node); - case 289: + case 286: return visitShorthandPropertyAssignment(node); - case 158: + case 157: return visitComputedPropertyName(node); - case 199: + case 196: return visitArrayLiteralExpression(node); - case 203: + case 200: return visitCallExpression(node); - case 204: + case 201: return visitNewExpression(node); - case 207: - return visitParenthesizedExpression(node, expressionResultIsUnused); - case 216: - return visitBinaryExpression(node, expressionResultIsUnused); - case 337: - return visitCommaListExpression(node, expressionResultIsUnused); + case 204: + return visitParenthesizedExpression(node, true); + case 213: + return visitBinaryExpression(node, true); case 14: case 15: case 16: @@ -73466,31 +71450,29 @@ var ts; return visitStringLiteral(node); case 8: return visitNumericLiteral(node); - case 205: + case 202: return visitTaggedTemplateExpression(node); - case 218: + case 215: return visitTemplateExpression(node); - case 219: + case 216: return visitYieldExpression(node); - case 220: + case 217: return visitSpreadElement(node); case 105: return visitSuperKeyword(false); case 107: return visitThisKeyword(node); - case 226: + case 223: return visitMetaProperty(node); - case 165: + case 164: return visitMethodDeclaration(node); + case 166: case 167: - case 168: return visitAccessorDeclaration(node); - case 232: + case 229: return visitVariableStatement(node); - case 242: + case 239: return visitReturnStatement(node); - case 212: - return visitVoidExpression(node); default: return ts.visitEachChild(node, visitor, context); } @@ -73559,9 +71541,6 @@ var ts; } return node; } - function visitVoidExpression(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } function visitIdentifier(node) { if (!convertedLoopState) { return node; @@ -73573,14 +71552,14 @@ var ts; } function visitBreakOrContinueStatement(node) { if (convertedLoopState) { - var jump = node.kind === 241 ? 2 : 4; + var jump = node.kind === 238 ? 2 : 4; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 241) { + if (node.kind === 238) { convertedLoopState.nonLocalJumps |= 2; labelMarker = "break"; } @@ -73590,7 +71569,7 @@ var ts; } } else { - if (node.kind === 241) { + if (node.kind === 238) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, true, ts.idText(label), labelMarker); } @@ -73666,14 +71645,13 @@ var ts; } function transformClassBody(node, extendsClauseElement) { var statements = []; - var name = factory.getInternalName(node); - var constructorLikeName = ts.isIdentifierANonContextualKeyword(name) ? factory.getGeneratedNameForNode(name) : name; startLexicalEnvironment(); addExtendsHelperIfNeeded(statements, node, extendsClauseElement); - addConstructor(statements, node, constructorLikeName, extendsClauseElement); + addConstructor(statements, node, extendsClauseElement); addClassMembers(statements, node); var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 19); - var outer = factory.createPartiallyEmittedExpression(constructorLikeName); + var localName = factory.getInternalName(node); + var outer = factory.createPartiallyEmittedExpression(localName); ts.setTextRangeEnd(outer, closingBraceLocation.end); ts.setEmitFlags(outer, 1536); var statement = factory.createReturnStatement(outer); @@ -73690,13 +71668,13 @@ var ts; statements.push(ts.setTextRange(factory.createExpressionStatement(emitHelpers().createExtendsHelper(factory.getInternalName(node))), extendsClauseElement)); } } - function addConstructor(statements, node, name, extendsClauseElement) { + function addConstructor(statements, node, extendsClauseElement) { var savedConvertedLoopState = convertedLoopState; convertedLoopState = undefined; var ancestorFacts = enterSubtree(16278, 73); var constructor = ts.getFirstConstructorWithBody(node); var hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== undefined); - var constructorFunction = factory.createFunctionDeclaration(undefined, undefined, undefined, name, undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper)); + var constructorFunction = factory.createFunctionDeclaration(undefined, undefined, undefined, factory.getInternalName(node), undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper)); ts.setTextRange(constructorFunction, constructor || node); if (extendsClauseElement) { ts.setEmitFlags(constructorFunction, 8); @@ -73777,17 +71755,17 @@ var ts; return block; } function isSufficientlyCoveredByReturnStatements(statement) { - if (statement.kind === 242) { + if (statement.kind === 239) { return true; } - else if (statement.kind === 234) { + else if (statement.kind === 231) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 230) { + else if (statement.kind === 227) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -73895,7 +71873,7 @@ var ts; return true; } function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 && node.kind !== 209) { + if (hierarchyFacts & 32768 && node.kind !== 206) { insertCaptureThisForNode(statements, node, factory.createThis()); return true; } @@ -73914,18 +71892,18 @@ var ts; if (hierarchyFacts & 16384) { var newTarget = void 0; switch (node.kind) { - case 209: + case 206: return statements; - case 165: + case 164: + case 166: case 167: - case 168: newTarget = factory.createVoidZero(); break; - case 166: + case 165: newTarget = factory.createPropertyAccessExpression(ts.setEmitFlags(factory.createThis(), 4), "constructor"); break; - case 251: - case 208: + case 248: + case 205: newTarget = factory.createConditionalExpression(factory.createLogicalAnd(ts.setEmitFlags(factory.createThis(), 4), factory.createBinaryExpression(ts.setEmitFlags(factory.createThis(), 4), 101, factory.getLocalName(node))), undefined, factory.createPropertyAccessExpression(ts.setEmitFlags(factory.createThis(), 4), "constructor"), undefined, factory.createVoidZero()); break; default: @@ -73946,20 +71924,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 229: + case 226: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 165: + case 164: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; + case 166: case 167: - case 168: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 166: + case 165: break; default: ts.Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName); @@ -74094,7 +72072,7 @@ var ts; : enterSubtree(16286, 65); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 && !name && (node.kind === 251 || node.kind === 208)) { + if (hierarchyFacts & 16384 && !name && (node.kind === 248 || node.kind === 205)) { name = factory.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152, 0); @@ -74127,7 +72105,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 209); + ts.Debug.assert(node.kind === 206); statementsLocation = ts.moveRangeEnd(body, -1); var equalsGreaterThanToken = node.equalsGreaterThanToken; if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) { @@ -74179,35 +72157,30 @@ var ts; return updated; } function visitExpressionStatement(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - function visitParenthesizedExpression(node, expressionResultIsUnused) { - return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context); - } - function visitBinaryExpression(node, expressionResultIsUnused) { - if (ts.isDestructuringAssignment(node)) { - return ts.flattenDestructuringAssignment(node, visitor, context, 0, !expressionResultIsUnused); - } - if (node.operatorToken.kind === 27) { - return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression)); + switch (node.expression.kind) { + case 204: + return factory.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, false)); + case 213: + return factory.updateExpressionStatement(node, visitBinaryExpression(node.expression, false)); } return ts.visitEachChild(node, visitor, context); } - function visitCommaListExpression(node, expressionResultIsUnused) { - if (expressionResultIsUnused) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - var result; - for (var i = 0; i < node.elements.length; i++) { - var element = node.elements[i]; - var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - result.push(visited); + function visitParenthesizedExpression(node, needsDestructuringValue) { + if (!needsDestructuringValue) { + switch (node.expression.kind) { + case 204: + return factory.updateParenthesizedExpression(node, visitParenthesizedExpression(node.expression, false)); + case 213: + return factory.updateParenthesizedExpression(node, visitBinaryExpression(node.expression, false)); } } - var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements; - return factory.updateCommaListExpression(node, elements); + return ts.visitEachChild(node, visitor, context); + } + function visitBinaryExpression(node, needsDestructuringValue) { + if (ts.isDestructuringAssignment(node)) { + return ts.flattenDestructuringAssignment(node, visitor, context, 0, needsDestructuringValue); + } + return ts.visitEachChild(node, visitor, context); } function isVariableStatementOfTypeScriptClassWrapper(node) { return node.declarationList.declarations.length === 1 @@ -74331,14 +72304,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 235: - case 236: + case 232: + case 233: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 237: + case 234: return visitForStatement(node, outermostLabeledStatement); - case 238: + case 235: return visitForInStatement(node, outermostLabeledStatement); - case 239: + case 236: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -74354,9 +72327,6 @@ var ts; function visitForStatement(node, outermostLabeledStatement) { return visitIterationStatementWithFacts(5056, 3328, node, outermostLabeledStatement); } - function visitEachChildOfForStatement(node) { - return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - } function visitForInStatement(node, outermostLabeledStatement) { return visitIterationStatementWithFacts(3008, 5376, node, outermostLabeledStatement); } @@ -74387,7 +72357,7 @@ var ts; else { var assignment = factory.createAssignment(initializer, boundValue); if (ts.isDestructuringAssignment(assignment)) { - statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, true))); + statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, false))); } else { ts.setTextRangeEnd(assignment, initializer.end); @@ -74463,7 +72433,7 @@ var ts; var property = properties[i]; if ((property.transformFlags & 262144 && hierarchyFacts & 4) - || (hasComputed = ts.Debug.checkDefined(property.name).kind === 158)) { + || (hasComputed = ts.Debug.checkDefined(property.name).kind === 157)) { numInitialProperties = i; break; } @@ -74529,7 +72499,7 @@ var ts; } var result = convert ? convert(node, outermostLabeledStatement, undefined, ancestorFacts) - : factory.restoreEnclosingLabel(ts.isForStatement(node) ? visitEachChildOfForStatement(node) : ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); + : factory.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); if (convertedLoopState) { convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; } @@ -74569,18 +72539,18 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 237: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 238: return convertForInStatement(node, convertedLoopBody); - case 239: return convertForOfStatement(node, convertedLoopBody); - case 235: return convertDoStatement(node, convertedLoopBody); - case 236: return convertWhileStatement(node, convertedLoopBody); + case 234: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 235: return convertForInStatement(node, convertedLoopBody); + case 236: return convertForOfStatement(node, convertedLoopBody); + case 232: return convertDoStatement(node, convertedLoopBody); + case 233: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } function convertForStatement(node, initializerFunction, convertedLoopBody) { var shouldConvertCondition = node.condition && shouldConvertPartOfIterationStatement(node.condition); var shouldConvertIncrementor = shouldConvertCondition || node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); - return factory.updateForStatement(node, ts.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(shouldConvertCondition ? undefined : node.condition, visitor, ts.isExpression), ts.visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), convertedLoopBody); + return factory.updateForStatement(node, ts.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitor, ts.isForInitializer), ts.visitNode(shouldConvertCondition ? undefined : node.condition, visitor, ts.isExpression), ts.visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitor, ts.isExpression), convertedLoopBody); } function convertForOfStatement(node, convertedLoopBody) { return factory.updateForOfStatement(node, undefined, ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), convertedLoopBody); @@ -74597,11 +72567,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 237: - case 238: - case 239: + case 234: + case 235: + case 236: var initializer = node.initializer; - if (initializer && initializer.kind === 250) { + if (initializer && initializer.kind === 247) { loopInitializer = initializer; } break; @@ -74865,20 +72835,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { + case 166: case 167: - case 168: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 165: + case 164: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 288: + case 285: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 289: + case 286: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -74949,7 +72919,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 167) { + if (node.kind === 166) { updated = factory.updateGetAccessorDeclaration(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -75197,13 +73167,13 @@ var ts; if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; context.enableSubstitution(107); - context.enableEmitNotification(166); context.enableEmitNotification(165); + context.enableEmitNotification(164); + context.enableEmitNotification(166); context.enableEmitNotification(167); - context.enableEmitNotification(168); - context.enableEmitNotification(209); - context.enableEmitNotification(208); - context.enableEmitNotification(251); + context.enableEmitNotification(206); + context.enableEmitNotification(205); + context.enableEmitNotification(248); } } function onSubstituteNode(hint, node) { @@ -75227,10 +73197,10 @@ var ts; } function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 198: - case 252: - case 255: + case 195: case 249: + case 252: + case 246: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -75291,11 +73261,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 233) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 230) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 203) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 200) { return false; } var callTarget = statementExpression.expression; @@ -75303,7 +73273,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 220) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 217) { return false; } var expression = callArgument.expression; @@ -75322,24 +73292,24 @@ var ts; if (compilerOptions.jsx === 1 || compilerOptions.jsx === 3) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(275); - context.enableEmitNotification(276); - context.enableEmitNotification(274); + context.enableEmitNotification(272); + context.enableEmitNotification(273); + context.enableEmitNotification(271); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(201); - context.enableSubstitution(288); + context.enableSubstitution(198); + context.enableSubstitution(285); return ts.chainBundle(context, transformSourceFile); function transformSourceFile(node) { return node; } function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 275: - case 276: - case 274: + case 272: + case 273: + case 271: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -75459,13 +73429,13 @@ var ts; } function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 235: + case 232: return visitDoStatement(node); - case 236: + case 233: return visitWhileStatement(node); - case 244: + case 241: return visitSwitchStatement(node); - case 245: + case 242: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -75473,24 +73443,24 @@ var ts; } function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 251: + case 248: return visitFunctionDeclaration(node); - case 208: + case 205: return visitFunctionExpression(node); + case 166: case 167: - case 168: return visitAccessorDeclaration(node); - case 232: + case 229: return visitVariableStatement(node); - case 237: + case 234: return visitForStatement(node); - case 238: + case 235: return visitForInStatement(node); - case 241: + case 238: return visitBreakStatement(node); - case 240: + case 237: return visitContinueStatement(node); - case 242: + case 239: return visitReturnStatement(node); default: if (node.transformFlags & 262144) { @@ -75506,23 +73476,21 @@ var ts; } function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 216: + case 213: return visitBinaryExpression(node); - case 337: - return visitCommaListExpression(node); - case 217: + case 214: return visitConditionalExpression(node); - case 219: + case 216: return visitYieldExpression(node); - case 199: + case 196: return visitArrayLiteralExpression(node); - case 200: + case 197: return visitObjectLiteralExpression(node); - case 202: + case 199: return visitElementAccessExpression(node); - case 203: + case 200: return visitCallExpression(node); - case 204: + case 201: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -75530,9 +73498,9 @@ var ts; } function visitGenerator(node) { switch (node.kind) { - case 251: + case 248: return visitFunctionDeclaration(node); - case 208: + case 205: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -75669,10 +73637,10 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 201: + case 198: target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 202: + case 199: target = factory.updateElementAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression))); break; default: @@ -75701,6 +73669,20 @@ var ts; } return ts.visitEachChild(node, visitor, context); } + function visitLogicalBinaryExpression(node) { + var resultLabel = defineLabel(); + var resultLocal = declareLocal(); + emitAssignment(resultLocal, ts.visitNode(node.left, visitor, ts.isExpression), node.left); + if (node.operatorToken.kind === 55) { + emitBreakWhenFalse(resultLabel, resultLocal, node.left); + } + else { + emitBreakWhenTrue(resultLabel, resultLocal, node.left); + } + emitAssignment(resultLocal, ts.visitNode(node.right, visitor, ts.isExpression), node.right); + markLabel(resultLabel); + return resultLocal; + } function visitCommaExpression(node) { var pendingExpressions = []; visit(node.left); @@ -75720,37 +73702,6 @@ var ts; } } } - function visitCommaListExpression(node) { - var pendingExpressions = []; - for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { - var elem = _a[_i]; - if (ts.isBinaryExpression(elem) && elem.operatorToken.kind === 27) { - pendingExpressions.push(visitCommaExpression(elem)); - } - else { - if (containsYield(elem) && pendingExpressions.length > 0) { - emitWorker(1, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); - pendingExpressions = []; - } - pendingExpressions.push(ts.visitNode(elem, visitor, ts.isExpression)); - } - } - return factory.inlineExpressions(pendingExpressions); - } - function visitLogicalBinaryExpression(node) { - var resultLabel = defineLabel(); - var resultLocal = declareLocal(); - emitAssignment(resultLocal, ts.visitNode(node.left, visitor, ts.isExpression), node.left); - if (node.operatorToken.kind === 55) { - emitBreakWhenFalse(resultLabel, resultLocal, node.left); - } - else { - emitBreakWhenTrue(resultLabel, resultLocal, node.left); - } - emitAssignment(resultLocal, ts.visitNode(node.right, visitor, ts.isExpression), node.right); - markLabel(resultLabel); - return resultLocal; - } function visitConditionalExpression(node) { if (containsYield(node.whenTrue) || containsYield(node.whenFalse)) { var whenFalseLabel = defineLabel(); @@ -75884,35 +73835,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 230: + case 227: return transformAndEmitBlock(node); - case 233: + case 230: return transformAndEmitExpressionStatement(node); - case 234: + case 231: return transformAndEmitIfStatement(node); - case 235: + case 232: return transformAndEmitDoStatement(node); - case 236: + case 233: return transformAndEmitWhileStatement(node); - case 237: + case 234: return transformAndEmitForStatement(node); - case 238: + case 235: return transformAndEmitForInStatement(node); - case 240: + case 237: return transformAndEmitContinueStatement(node); - case 241: + case 238: return transformAndEmitBreakStatement(node); - case 242: + case 239: return transformAndEmitReturnStatement(node); - case 243: + case 240: return transformAndEmitWithStatement(node); - case 244: + case 241: return transformAndEmitSwitchStatement(node); - case 245: + case 242: return transformAndEmitLabeledStatement(node); - case 246: + case 243: return transformAndEmitThrowStatement(node); - case 247: + case 244: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -76206,7 +74157,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 285 && defaultClauseIndex === -1) { + if (clause.kind === 282 && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -76216,7 +74167,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 284) { + if (clause.kind === 281) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -77022,11 +74973,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(78); - context.enableSubstitution(216); - context.enableSubstitution(214); - context.enableSubstitution(215); - context.enableSubstitution(289); - context.enableEmitNotification(297); + context.enableSubstitution(213); + context.enableSubstitution(211); + context.enableSubstitution(212); + context.enableSubstitution(286); + context.enableEmitNotification(294); var moduleInfoMap = []; var deferredExports = []; var currentSourceFile; @@ -77066,10 +75017,7 @@ var ts; ts.append(statements, createUnderscoreUnderscoreESModule()); } if (ts.length(currentModuleInfo.exportedNames)) { - var chunkSize = 50; - for (var i = 0; i < currentModuleInfo.exportedNames.length; i += chunkSize) { - ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames.slice(i, i + chunkSize), function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero()))); - } + ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames, function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero()))); } ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); @@ -77220,23 +75168,23 @@ var ts; } function sourceElementVisitor(node) { switch (node.kind) { - case 261: + case 258: return visitImportDeclaration(node); - case 260: + case 257: return visitImportEqualsDeclaration(node); - case 267: + case 264: return visitExportDeclaration(node); - case 266: + case 263: return visitExportAssignment(node); - case 232: + case 229: return visitVariableStatement(node); - case 251: + case 248: return visitFunctionDeclaration(node); - case 252: + case 249: return visitClassDeclaration(node); - case 338: + case 333: return visitMergeDeclarationMarker(node); - case 339: + case 334: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -77261,24 +75209,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 288: + case 285: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 289: + case 286: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 290: + case 287: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 165: + case 164: + case 166: case 167: - case 168: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -77498,8 +75446,7 @@ var ts; var statements = []; statements.push(ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(createExportExpression(factory.cloneNode(node.exportClause.name), getHelperExpressionForExport(node, moduleKind !== ts.ModuleKind.AMD ? createRequireCall(node) : - ts.isExportNamespaceAsDefaultDeclaration(node) ? generatedName : - factory.createIdentifier(ts.idText(node.exportClause.name))))), node), node)); + factory.createIdentifier(ts.idText(node.exportClause.name))))), node), node)); return ts.singleOrMany(statements); } else { @@ -77561,7 +75508,6 @@ var ts; var expressions; if (ts.hasSyntacticModifier(node, 1)) { var modifiers = void 0; - var removeCommentsOnExpressions = false; for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var variable = _a[_i]; if (ts.isIdentifier(variable.name) && ts.isLocalName(variable.name)) { @@ -77571,27 +75517,14 @@ var ts; variables = ts.append(variables, variable); } else if (variable.initializer) { - if (!ts.isBindingPattern(variable.name) && (ts.isArrowFunction(variable.initializer) || ts.isFunctionExpression(variable.initializer) || ts.isClassExpression(variable.initializer))) { - var expression = factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), variable.name), variable.name), factory.createIdentifier(ts.getTextOfIdentifierOrLiteral(variable.name))); - var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, moduleExpressionElementVisitor)); - variables = ts.append(variables, updatedVariable); - expressions = ts.append(expressions, expression); - removeCommentsOnExpressions = true; - } - else { - expressions = ts.append(expressions, transformInitializedVariable(variable)); - } + expressions = ts.append(expressions, transformInitializedVariable(variable)); } } if (variables) { statements = ts.append(statements, factory.updateVariableStatement(node, modifiers, factory.updateVariableDeclarationList(node.declarationList, variables))); } if (expressions) { - var statement = ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node); - if (removeCommentsOnExpressions) { - ts.removeAllComments(statement); - } - statements = ts.append(statements, statement); + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node)); } } else { @@ -77628,7 +75561,7 @@ var ts; } } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 229) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -77660,10 +75593,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263: + case 260: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 264: + case 261: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, true); @@ -77778,7 +75711,7 @@ var ts; return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 297) { + if (node.kind === 294) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -77820,10 +75753,10 @@ var ts; switch (node.kind) { case 78: return substituteExpressionIdentifier(node); - case 216: + case 213: return substituteBinaryExpression(node); - case 215: - case 214: + case 212: + case 211: return substituteUnaryExpression(node); } return node; @@ -77836,9 +75769,9 @@ var ts; } return node; } - if (!(ts.isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64)) && !ts.isLocalName(node)) { + if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 297) { + if (exportContainer && exportContainer.kind === 294) { return ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.cloneNode(node)), node); } var importDeclaration = resolver.getReferencedImportDeclaration(node); @@ -77881,7 +75814,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 215 + var expression = node.kind === 212 ? ts.setTextRange(factory.createBinaryExpression(node.operand, factory.createToken(node.operator === 45 ? 63 : 64), factory.createNumericLiteral(1)), node) : node; for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) { @@ -77924,12 +75857,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(78); - context.enableSubstitution(289); - context.enableSubstitution(216); - context.enableSubstitution(214); - context.enableSubstitution(215); - context.enableSubstitution(226); - context.enableEmitNotification(297); + context.enableSubstitution(286); + context.enableSubstitution(213); + context.enableSubstitution(211); + context.enableSubstitution(212); + context.enableSubstitution(223); + context.enableEmitNotification(294); var moduleInfoMap = []; var deferredExports = []; var exportFunctionsMap = []; @@ -78036,7 +75969,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 267 && externalImport.exportClause) { + if (externalImport.kind === 264 && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -78097,15 +76030,15 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(factory, entry, currentSourceFile); switch (entry.kind) { - case 261: + case 258: if (!entry.importClause) { break; } - case 260: + case 257: ts.Debug.assert(importVariableName !== undefined); statements.push(factory.createExpressionStatement(factory.createAssignment(importVariableName, parameterName))); break; - case 267: + case 264: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -78135,13 +76068,13 @@ var ts; } function sourceElementVisitor(node) { switch (node.kind) { - case 261: + case 258: return visitImportDeclaration(node); - case 260: + case 257: return visitImportEqualsDeclaration(node); - case 267: + case 264: return visitExportDeclaration(node); - case 266: + case 263: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -78266,7 +76199,7 @@ var ts; } function shouldHoistVariableDeclarationList(node) { return (ts.getEmitFlags(node) & 2097152) === 0 - && (enclosingBlockScopedContainer.kind === 297 + && (enclosingBlockScopedContainer.kind === 294 || (ts.getOriginalNode(node).flags & 3) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { @@ -78288,7 +76221,7 @@ var ts; : preventSubstitution(ts.setTextRange(factory.createAssignment(name, value), location)); } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 229) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasSyntacticModifier(node.original, 1); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -78327,10 +76260,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263: + case 260: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 264: + case 261: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -78430,43 +76363,43 @@ var ts; } function nestedElementVisitor(node) { switch (node.kind) { - case 232: + case 229: return visitVariableStatement(node); - case 251: + case 248: return visitFunctionDeclaration(node); - case 252: + case 249: return visitClassDeclaration(node); - case 237: + case 234: return visitForStatement(node); - case 238: - return visitForInStatement(node); - case 239: - return visitForOfStatement(node); case 235: - return visitDoStatement(node); + return visitForInStatement(node); case 236: + return visitForOfStatement(node); + case 232: + return visitDoStatement(node); + case 233: return visitWhileStatement(node); - case 245: + case 242: return visitLabeledStatement(node); - case 243: + case 240: return visitWithStatement(node); - case 244: + case 241: return visitSwitchStatement(node); - case 258: + case 255: return visitCaseBlock(node); - case 284: + case 281: return visitCaseClause(node); - case 285: + case 282: return visitDefaultClause(node); - case 247: + case 244: return visitTryStatement(node); - case 287: + case 284: return visitCatchClause(node); - case 230: + case 227: return visitBlock(node); - case 338: + case 333: return visitMergeDeclarationMarker(node); - case 339: + case 334: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -78602,7 +76535,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 297; + return container !== undefined && container.kind === 294; } else { return false; @@ -78617,7 +76550,7 @@ var ts; return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 297) { + if (node.kind === 294) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -78653,7 +76586,7 @@ var ts; } function substituteUnspecified(node) { switch (node.kind) { - case 289: + case 286: return substituteShorthandPropertyAssignment(node); } return node; @@ -78677,12 +76610,12 @@ var ts; switch (node.kind) { case 78: return substituteExpressionIdentifier(node); - case 216: + case 213: return substituteBinaryExpression(node); - case 214: - case 215: + case 211: + case 212: return substituteUnaryExpression(node); - case 226: + case 223: return substituteMetaProperty(node); } return node; @@ -78734,14 +76667,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 215 + var expression = node.kind === 212 ? ts.setTextRange(factory.createPrefixUnaryExpression(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 215) { + if (node.kind === 212) { expression = node.operator === 45 ? factory.createSubtract(preventSubstitution(expression), factory.createNumericLiteral(1)) : factory.createAdd(preventSubstitution(expression), factory.createNumericLiteral(1)); @@ -78764,7 +76697,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, false); - if (exportContainer && exportContainer.kind === 297) { + if (exportContainer && exportContainer.kind === 294) { exportedNames = ts.append(exportedNames, factory.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -78793,7 +76726,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(297); + context.enableEmitNotification(294); context.enableSubstitution(78); var helperNameSubstitutions; return ts.chainBundle(context, transformSourceFile); @@ -78825,11 +76758,11 @@ var ts; } function visitor(node) { switch (node.kind) { - case 260: + case 257: return undefined; - case 266: + case 263: return visitExportAssignment(node); - case 267: + case 264: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -78849,7 +76782,7 @@ var ts; var synthName = factory.getGeneratedNameForNode(oldIdentifier); var importDecl = factory.createImportDeclaration(undefined, undefined, factory.createImportClause(false, undefined, factory.createNamespaceImport(synthName)), node.moduleSpecifier); ts.setOriginalNode(importDecl, node.exportClause); - var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration(undefined, undefined, false, factory.createNamedExports([factory.createExportSpecifier(synthName, oldIdentifier)])); + var exportDecl = factory.createExportDeclaration(undefined, undefined, false, factory.createNamedExports([factory.createExportSpecifier(synthName, oldIdentifier)])); ts.setOriginalNode(exportDecl, node); return [importDecl, exportDecl]; } @@ -78933,7 +76866,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252) { + else if (node.parent.kind === 249) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -78962,7 +76895,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252) { + else if (node.parent.kind === 249) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -79009,15 +76942,15 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 249 || node.kind === 198) { + if (node.kind === 246 || node.kind === 195) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 163 || node.kind === 201 || node.kind === 162 || - (node.kind === 160 && ts.hasSyntacticModifier(node.parent, 8))) { + else if (node.kind === 162 || node.kind === 198 || node.kind === 161 || + (node.kind === 159 && ts.hasSyntacticModifier(node.parent, 8))) { if (ts.hasSyntacticModifier(node, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -79025,7 +76958,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 || node.kind === 160) { + else if (node.parent.kind === 249 || node.kind === 159) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -79049,7 +76982,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 168) { + if (node.kind === 167) { if (ts.hasSyntacticModifier(node, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : @@ -79086,23 +77019,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 170: + case 169: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 169: + case 168: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 171: + case 170: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 165: case 164: + case 163: if (ts.hasSyntacticModifier(node, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -79110,7 +77043,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 252) { + else if (node.parent.kind === 249) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -79123,7 +77056,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 251: + case 248: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -79148,27 +77081,27 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 166: + case 165: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 170: - case 175: + case 169: + case 174: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 169: + case 168: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 171: + case 170: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 165: case 164: + case 163: if (ts.hasSyntacticModifier(node.parent, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -79176,7 +77109,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 252) { + else if (node.parent.parent.kind === 249) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -79188,15 +77121,15 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 251: - case 174: + case 248: + case 173: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 168: case 167: + case 166: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -79209,39 +77142,39 @@ var ts; function getTypeParameterConstraintVisibilityError() { var diagnosticMessage; switch (node.parent.kind) { - case 252: + case 249: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 253: + case 250: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 190: + case 189: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 175: - case 170: + case 174: + case 169: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 169: + case 168: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 165: case 164: + case 163: if (ts.hasSyntacticModifier(node.parent, 32)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 252) { + else if (node.parent.parent.kind === 249) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174: - case 251: + case 173: + case 248: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 254: + case 251: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -79301,7 +77234,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 160) { + if (parseTreeNode && parseTreeNode.kind === 159) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -79346,7 +77279,6 @@ var ts; reportCyclicStructureError: reportCyclicStructureError, reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression, reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError, - reportTruncationError: reportTruncationError, moduleResolverHost: host, trackReferencedAmbientModule: trackReferencedAmbientModule, trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode, @@ -79441,11 +77373,6 @@ var ts; context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier)); } } - function reportTruncationError() { - if (errorNameNode) { - context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed)); - } - } function reportNonlocalAugmentation(containingFile, parentSymbol, symbol) { var primaryDeclaration = ts.find(parentSymbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === containingFile; }); var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; }); @@ -79467,10 +77394,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 297 && node.isDeclarationFile) { + if (node.kind === 294 && node.isDeclarationFile) { return node; } - if (node.kind === 298) { + if (node.kind === 295) { isBundledEmit = true; refs = new ts.Map(); libs = new ts.Map(); @@ -79500,7 +77427,7 @@ var ts; var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return factory.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated), true, [], [], false, []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 300) { + if (prepend.kind === 297) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -79632,7 +77559,7 @@ var ts; return name; } else { - if (name.kind === 197) { + if (name.kind === 194) { return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -79640,7 +77567,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 222) { + if (elem.kind === 219) { return elem; } return factory.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -79674,7 +77601,7 @@ var ts; if (shouldPrintWithInitializer(node)) { return; } - var shouldUseResolverType = node.kind === 160 && + var shouldUseResolverType = node.kind === 159 && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -79683,7 +77610,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : factory.createKeywordTypeNode(128); } - if (node.kind === 168) { + if (node.kind === 167) { return factory.createKeywordTypeNode(128); } errorNameNode = node.name; @@ -79692,12 +77619,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 249 || node.kind === 198) { + if (node.kind === 246 || node.kind === 195) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 160 - || node.kind === 163 - || node.kind === 162) { + if (node.kind === 159 + || node.kind === 162 + || node.kind === 161) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -79714,19 +77641,19 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 251: - case 256: + case 248: case 253: - case 252: - case 254: - case 255: - return !resolver.isDeclarationVisible(node); + case 250: case 249: + case 251: + case 252: + return !resolver.isDeclarationVisible(node); + case 246: return !getBindingNameVisible(node); - case 260: - case 261: - case 267: - case 266: + case 257: + case 258: + case 264: + case 263: return false; } return false; @@ -79803,7 +77730,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 256 && parent.kind !== 195); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 253 && parent.kind !== 192); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -79823,7 +77750,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 272) { + if (decl.moduleReference.kind === 269) { var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return factory.updateImportEqualsDeclaration(decl, undefined, decl.modifiers, decl.name, factory.updateExternalModuleReference(decl.moduleReference, rewriteModuleSpecifier(decl, specifier))); } @@ -79843,7 +77770,7 @@ var ts; if (!decl.importClause.namedBindings) { return visibleDefaultBinding && factory.updateImportDeclaration(decl, undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 263) { + if (decl.importClause.namedBindings.kind === 260) { var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : undefined; return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; } @@ -79910,7 +77837,7 @@ var ts; var oldDiag = getSymbolAccessibilityDiagnostic; var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 177 || input.kind === 190) && input.parent.kind !== 254); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 176 || input.kind === 189) && input.parent.kind !== 251); if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasEffectiveModifier(input, 8)) { if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input) @@ -79929,67 +77856,67 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 223: { + case 220: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments)); } - case 173: { + case 172: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory.updateTypeReferenceNode(node, node.typeName, node.typeArguments)); } - case 170: + case 169: return cleanup(factory.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 166: { + case 165: { var ctor = factory.createConstructorDeclaration(undefined, ensureModifiers(input), updateParamsList(input, input.parameters, 0), undefined); return cleanup(ctor); } - case 165: { + case 164: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } var sig = factory.createMethodDeclaration(undefined, ensureModifiers(input), undefined, input.name, input.questionToken, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), undefined); return cleanup(sig); } - case 167: { + case 166: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } var accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input)); return cleanup(factory.updateGetAccessorDeclaration(input, undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8)), ensureType(input, accessorType), undefined)); } - case 168: { + case 167: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } return cleanup(factory.updateSetAccessorDeclaration(input, undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8)), undefined)); } - case 163: - if (ts.isPrivateIdentifier(input.name)) { - return cleanup(undefined); - } - return cleanup(factory.updatePropertyDeclaration(input, undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); case 162: + if (ts.isPrivateIdentifier(input.name)) { + return cleanup(undefined); + } + return cleanup(factory.updatePropertyDeclaration(input, undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); + case 161: if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } return cleanup(factory.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type))); - case 164: { + case 163: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(undefined); } return cleanup(factory.updateMethodSignature(input, ensureModifiers(input), input.name, input.questionToken, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 169: { + case 168: { return cleanup(factory.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 171: { + case 170: { return cleanup(factory.updateIndexSignature(input, undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || factory.createKeywordTypeNode(128))); } - case 249: { + case 246: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -79997,13 +77924,13 @@ var ts; suppressNewDiagnosticContexts = true; return cleanup(factory.updateVariableDeclaration(input, input.name, undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 159: { + case 158: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(factory.updateTypeParameterDeclaration(input, input.name, undefined, undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 184: { + case 183: { var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); var extendsType = ts.visitNode(input.extendsType, visitDeclarationSubtree); var oldEnclosingDecl = enclosingDeclaration; @@ -80013,13 +77940,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(factory.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 174: { + case 173: { return cleanup(factory.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 175: { + case 174: { return cleanup(factory.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 195: { + case 192: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -80051,7 +77978,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 165 && ts.hasEffectiveModifier(node.parent, 8); + return node.parent.kind === 164 && ts.hasEffectiveModifier(node.parent, 8); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -80060,14 +77987,14 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 267: { + case 264: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } resultHasScopeMarker = true; return factory.updateExportDeclaration(input, undefined, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier)); } - case 266: { + case 263: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -80102,10 +78029,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 260: { + case 257: { return transformImportEqualsDeclaration(input); } - case 261: { + case 258: { return transformImportDeclaration(input); } } @@ -80125,12 +78052,12 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 254: + case 251: return cleanup(factory.updateTypeAliasDeclaration(input, undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 253: { + case 250: { return cleanup(factory.updateInterfaceDeclaration(input, undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 251: { + case 248: { var clean = cleanup(factory.updateFunctionDeclaration(input, undefined, ensureModifiers(input), undefined, input.name, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type), undefined)); if (clean && resolver.isExpandoFunctionDeclaration(input)) { var props = resolver.getPropertiesOfContainerFunction(input); @@ -80182,10 +78109,10 @@ var ts; return clean; } } - case 256: { + case 253: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 257) { + if (inner && inner.kind === 254) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -80221,7 +78148,7 @@ var ts; return cleanup(factory.updateModuleDeclaration(input, undefined, mods, input.name, body)); } } - case 252: { + case 249: { var modifiers = factory.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -80289,10 +78216,10 @@ var ts; return cleanup(factory.updateClassDeclaration(input, undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 232: { + case 229: { return cleanup(transformVariableStatement(input)); } - case 255: { + case 252: { return cleanup(factory.updateEnumDeclaration(input, undefined, factory.createNodeArray(ensureModifiers(input)), input.name, factory.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -80309,7 +78236,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 256) { + if (input.kind === 253) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -80330,7 +78257,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 222) { + if (e.kind === 219) { return; } if (e.name) { @@ -80380,7 +78307,7 @@ var ts; function ensureModifierFlags(node) { var mask = 11263 ^ (4 | 256); var additions = (needsDeclare && !isAlwaysType(node)) ? 2 : 0; - var parentIsFile = node.parent.kind === 297; + var parentIsFile = node.parent.kind === 294; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2; additions = 0; @@ -80407,7 +78334,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 253) { + if (node.kind === 250) { return true; } return false; @@ -80429,7 +78356,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 167 + return accessor.kind === 166 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -80438,52 +78365,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 163: case 162: + case 161: return !ts.hasEffectiveModifier(node, 8); - case 160: - case 249: + case 159: + case 246: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 251: - case 256: - case 260: + case 248: case 253: + case 257: + case 250: + case 249: + case 251: case 252: - case 254: - case 255: - case 232: - case 261: - case 267: - case 266: + case 229: + case 258: + case 264: + case 263: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 170: - case 166: - case 165: - case 167: - case 168: - case 163: - case 162: - case 164: case 169: - case 171: - case 249: - case 159: - case 223: + case 165: + case 164: + case 166: + case 167: + case 162: + case 161: + case 163: + case 168: + case 170: + case 246: + case 158: + case 220: + case 172: + case 183: case 173: - case 184: case 174: - case 175: - case 195: + case 192: return true; } return false; @@ -80514,13 +78441,14 @@ var ts; function getScriptTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles) { if (emitOnlyDtsFiles) return ts.emptyArray; + var jsx = compilerOptions.jsx; var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var transformers = []; ts.addRange(transformers, customTransformers && ts.map(customTransformers.before, wrapScriptTransformerFactory)); transformers.push(ts.transformTypeScript); transformers.push(ts.transformClassFields); - if (ts.getJSXTransformEnabled(compilerOptions)) { + if (jsx === 2) { transformers.push(ts.transformJsx); } if (languageVersion < 99) { @@ -80584,7 +78512,7 @@ var ts; } ts.noEmitNotification = noEmitNotification; function transformNodes(resolver, host, factory, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(341); + var enabledSyntaxKindFeatures = new Array(336); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentStatements; @@ -80651,13 +78579,7 @@ var ts; return node; }; state = 1; - var transformed = []; - for (var _a = 0, nodes_3 = nodes; _a < nodes_3.length; _a++) { - var node = nodes_3[_a]; - ts.tracing.push("emit", "transformNodes", node.kind === 297 ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); - transformed.push((allowDtsFiles ? transformation : transformRoot)(node)); - ts.tracing.pop(); - } + var transformed = ts.map(nodes, allowDtsFiles ? transformation : transformRoot); state = 2; ts.performance.mark("afterTransform"); ts.performance.measure("transformTime", "beforeTransform", "afterTransform"); @@ -80837,8 +78759,8 @@ var ts; } function dispose() { if (state < 3) { - for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { - var node = nodes_4[_i]; + for (var _i = 0, nodes_3 = nodes; _i < nodes_3.length; _i++) { + var node = nodes_3[_i]; ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); } lexicalEnvironmentVariableDeclarations = undefined; @@ -80955,7 +78877,7 @@ var ts; ts.getOutputPathsForBundle = getOutputPathsForBundle; function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 298) { + if (sourceFile.kind === 295) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -81139,15 +79061,9 @@ var ts; sourceFiles: sourceFileOrBundle.sourceFiles.map(function (file) { return relativeToBuildInfo(ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory())); }) }; } - ts.tracing.push("emit", "emitJsFileOrBundle", { jsFilePath: jsFilePath }); emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo); - ts.tracing.pop(); - ts.tracing.push("emit", "emitDeclarationFileOrBundle", { declarationFilePath: declarationFilePath }); emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo); - ts.tracing.pop(); - ts.tracing.push("emit", "emitBuildInfo", { buildInfoPath: buildInfoPath }); emitBuildInfo(bundleBuildInfo, buildInfoPath); - ts.tracing.pop(); if (!emitSkipped && emittedFilesList) { if (!emitOnlyDtsFiles) { if (jsFilePath) { @@ -81267,7 +79183,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 297) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 294) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -81290,8 +79206,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 298 ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 297 ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 295 ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 294 ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -81329,7 +79245,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 297 || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json")); + && (sourceFileOrBundle.kind !== 294 || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json")); } function getSourceRoot(mapOptions) { var sourceRoot = ts.normalizeSlashes(mapOptions.sourceRoot || ""); @@ -81364,13 +79280,13 @@ var ts; } if (ts.getRootLength(sourceMapDir) === 0) { sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - return encodeURI(ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), ts.combinePaths(sourceMapDir, sourceMapFile), host.getCurrentDirectory(), host.getCanonicalFileName, true)); + return ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), ts.combinePaths(sourceMapDir, sourceMapFile), host.getCurrentDirectory(), host.getCanonicalFileName, true); } else { - return encodeURI(ts.combinePaths(sourceMapDir, sourceMapFile)); + return ts.combinePaths(sourceMapDir, sourceMapFile); } } - return encodeURI(sourceMapFile); + return sourceMapFile; } } ts.emitFiles = emitFiles; @@ -81565,8 +79481,6 @@ var ts; var sourceMapGenerator; var sourceMapSource; var sourceMapSourceIndex = -1; - var mostRecentlyAddedSourceMapSource; - var mostRecentlyAddedSourceMapSourceIndex = -1; var containerPos = -1; var containerEnd = -1; var declarationListContainerEnd = -1; @@ -81602,9 +79516,9 @@ var ts; break; } switch (node.kind) { - case 297: return printFile(node); - case 298: return printBundle(node); - case 299: return printUnparsedSource(node); + case 294: return printFile(node); + case 295: return printBundle(node); + case 296: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -81856,11 +79770,11 @@ var ts; return pipelineEmitWithSubstitution; } case 2: - if (!commentsDisabled && node.kind !== 297) { + if (!commentsDisabled && node.kind !== 294) { return pipelineEmitWithComments; } case 3: - if (!sourceMapsDisabled && node.kind !== 297 && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 294 && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } case 4: @@ -81900,271 +79814,263 @@ var ts; case 16: case 17: return emitLiteral(node, false); - case 299: - case 293: - return emitUnparsedSourceOrPrepend(node); - case 292: - return writeUnparsedNode(node); - case 294: - case 295: - return emitUnparsedTextLike(node); case 296: + case 290: + return emitUnparsedSourceOrPrepend(node); + case 289: + return writeUnparsedNode(node); + case 291: + case 292: + return emitUnparsedTextLike(node); + case 293: return emitUnparsedSyntheticReference(node); case 78: return emitIdentifier(node); case 79: return emitPrivateIdentifier(node); - case 157: + case 156: return emitQualifiedName(node); - case 158: + case 157: return emitComputedPropertyName(node); - case 159: + case 158: return emitTypeParameter(node); - case 160: + case 159: return emitParameter(node); - case 161: + case 160: return emitDecorator(node); - case 162: + case 161: return emitPropertySignature(node); - case 163: + case 162: return emitPropertyDeclaration(node); - case 164: + case 163: return emitMethodSignature(node); - case 165: + case 164: return emitMethodDeclaration(node); - case 166: + case 165: return emitConstructor(node); + case 166: case 167: - case 168: return emitAccessorDeclaration(node); - case 169: + case 168: return emitCallSignature(node); - case 170: + case 169: return emitConstructSignature(node); - case 171: + case 170: return emitIndexSignature(node); - case 194: - return emitTemplateTypeSpan(node); - case 172: + case 171: return emitTypePredicate(node); - case 173: + case 172: return emitTypeReference(node); - case 174: + case 173: return emitFunctionType(node); - case 308: + case 304: return emitJSDocFunctionType(node); - case 175: + case 174: return emitConstructorType(node); - case 176: + case 175: return emitTypeQuery(node); - case 177: + case 176: return emitTypeLiteral(node); - case 178: + case 177: return emitArrayType(node); - case 179: + case 178: return emitTupleType(node); - case 180: + case 179: return emitOptionalType(node); - case 182: + case 181: return emitUnionType(node); - case 183: + case 182: return emitIntersectionType(node); - case 184: + case 183: return emitConditionalType(node); - case 185: + case 184: return emitInferType(node); - case 186: + case 185: return emitParenthesizedType(node); - case 223: + case 220: return emitExpressionWithTypeArguments(node); - case 187: + case 186: return emitThisType(); - case 188: + case 187: return emitTypeOperator(node); - case 189: + case 188: return emitIndexedAccessType(node); - case 190: + case 189: return emitMappedType(node); - case 191: + case 190: return emitLiteralType(node); - case 193: - return emitTemplateType(node); - case 195: + case 192: return emitImportTypeNode(node); - case 303: + case 299: writePunctuation("*"); return; - case 304: + case 300: writePunctuation("?"); return; - case 305: + case 301: return emitJSDocNullableType(node); - case 306: + case 302: return emitJSDocNonNullableType(node); - case 307: + case 303: return emitJSDocOptionalType(node); - case 181: - case 309: + case 180: + case 305: return emitRestOrJSDocVariadicType(node); - case 192: + case 191: return emitNamedTupleMember(node); - case 196: + case 193: return emitObjectBindingPattern(node); - case 197: + case 194: return emitArrayBindingPattern(node); - case 198: + case 195: return emitBindingElement(node); - case 228: + case 225: return emitTemplateSpan(node); - case 229: + case 226: return emitSemicolonClassElement(); - case 230: + case 227: return emitBlock(node); - case 232: + case 229: return emitVariableStatement(node); - case 231: + case 228: return emitEmptyStatement(false); - case 233: + case 230: return emitExpressionStatement(node); - case 234: + case 231: return emitIfStatement(node); - case 235: + case 232: return emitDoStatement(node); - case 236: + case 233: return emitWhileStatement(node); - case 237: + case 234: return emitForStatement(node); - case 238: + case 235: return emitForInStatement(node); - case 239: + case 236: return emitForOfStatement(node); - case 240: + case 237: return emitContinueStatement(node); - case 241: + case 238: return emitBreakStatement(node); - case 242: + case 239: return emitReturnStatement(node); - case 243: + case 240: return emitWithStatement(node); - case 244: + case 241: return emitSwitchStatement(node); - case 245: + case 242: return emitLabeledStatement(node); - case 246: + case 243: return emitThrowStatement(node); - case 247: + case 244: return emitTryStatement(node); - case 248: + case 245: return emitDebuggerStatement(node); - case 249: + case 246: return emitVariableDeclaration(node); - case 250: + case 247: return emitVariableDeclarationList(node); - case 251: + case 248: return emitFunctionDeclaration(node); - case 252: + case 249: return emitClassDeclaration(node); - case 253: + case 250: return emitInterfaceDeclaration(node); - case 254: + case 251: return emitTypeAliasDeclaration(node); - case 255: + case 252: return emitEnumDeclaration(node); - case 256: + case 253: return emitModuleDeclaration(node); - case 257: + case 254: return emitModuleBlock(node); - case 258: + case 255: return emitCaseBlock(node); - case 259: + case 256: return emitNamespaceExportDeclaration(node); - case 260: + case 257: return emitImportEqualsDeclaration(node); - case 261: + case 258: return emitImportDeclaration(node); - case 262: + case 259: return emitImportClause(node); - case 263: + case 260: return emitNamespaceImport(node); - case 269: - return emitNamespaceExport(node); - case 264: - return emitNamedImports(node); - case 265: - return emitImportSpecifier(node); case 266: + return emitNamespaceExport(node); + case 261: + return emitNamedImports(node); + case 262: + return emitImportSpecifier(node); + case 263: return emitExportAssignment(node); - case 267: + case 264: return emitExportDeclaration(node); - case 268: + case 265: return emitNamedExports(node); - case 270: + case 267: return emitExportSpecifier(node); - case 271: + case 268: return; - case 272: + case 269: return emitExternalModuleReference(node); case 11: return emitJsxText(node); + case 272: case 275: - case 278: return emitJsxOpeningElementOrFragment(node); + case 273: case 276: - case 279: return emitJsxClosingElementOrFragment(node); - case 280: + case 277: return emitJsxAttribute(node); - case 281: + case 278: return emitJsxAttributes(node); - case 282: + case 279: return emitJsxSpreadAttribute(node); - case 283: + case 280: return emitJsxExpression(node); - case 284: + case 281: return emitCaseClause(node); - case 285: + case 282: return emitDefaultClause(node); - case 286: + case 283: return emitHeritageClause(node); - case 287: + case 284: return emitCatchClause(node); - case 288: + case 285: return emitPropertyAssignment(node); - case 289: + case 286: return emitShorthandPropertyAssignment(node); - case 290: + case 287: return emitSpreadAssignment(node); - case 291: + case 288: return emitEnumMember(node); - case 326: - case 333: - return emitJSDocPropertyLikeTag(node); - case 327: - case 329: + case 322: case 328: + return emitJSDocPropertyLikeTag(node); + case 323: case 325: - return emitJSDocSimpleTypedTag(node); - case 316: - case 315: - return emitJSDocHeritageTag(node); - case 330: - return emitJSDocTemplateTag(node); - case 331: - return emitJSDocTypedefTag(node); case 324: - return emitJSDocCallbackTag(node); - case 313: - return emitJSDocSignature(node); + case 321: + return emitJSDocSimpleTypedTag(node); case 312: - return emitJSDocTypeLiteral(node); - case 319: - case 314: - return emitJSDocSimpleTag(node); - case 332: - return emitJSDocSeeTag(node); - case 302: - return emitJSDocNameReference(node); case 311: + return emitJSDocHeritageTag(node); + case 326: + return emitJSDocTemplateTag(node); + case 327: + return emitJSDocTypedefTag(node); + case 320: + return emitJSDocCallbackTag(node); + case 309: + return emitJSDocSignature(node); + case 308: + return emitJSDocTypeLiteral(node); + case 315: + case 310: + return emitJSDocSimpleTag(node); + case 307: return emitJSDoc(node); } if (ts.isExpression(node)) { @@ -82196,69 +80102,69 @@ var ts; case 99: writeTokenNode(node, writeKeyword); return; - case 199: + case 196: return emitArrayLiteralExpression(node); - case 200: + case 197: return emitObjectLiteralExpression(node); - case 201: + case 198: return emitPropertyAccessExpression(node); - case 202: + case 199: return emitElementAccessExpression(node); - case 203: + case 200: return emitCallExpression(node); - case 204: + case 201: return emitNewExpression(node); - case 205: + case 202: return emitTaggedTemplateExpression(node); - case 206: + case 203: return emitTypeAssertionExpression(node); - case 207: + case 204: return emitParenthesizedExpression(node); - case 208: + case 205: return emitFunctionExpression(node); - case 209: + case 206: return emitArrowFunction(node); - case 210: + case 207: return emitDeleteExpression(node); - case 211: + case 208: return emitTypeOfExpression(node); - case 212: + case 209: return emitVoidExpression(node); - case 213: + case 210: return emitAwaitExpression(node); - case 214: + case 211: return emitPrefixUnaryExpression(node); - case 215: + case 212: return emitPostfixUnaryExpression(node); - case 216: + case 213: return emitBinaryExpression(node); - case 217: + case 214: return emitConditionalExpression(node); - case 218: + case 215: return emitTemplateExpression(node); - case 219: + case 216: return emitYieldExpression(node); - case 220: + case 217: return emitSpreadExpression(node); - case 221: + case 218: return emitClassExpression(node); - case 222: + case 219: return; - case 224: + case 221: return emitAsExpression(node); - case 225: + case 222: return emitNonNullExpression(node); - case 226: + case 223: return emitMetaProperty(node); - case 273: + case 270: return emitJsxElement(node); - case 274: + case 271: return emitJsxSelfClosingElement(node); - case 277: + case 274: return emitJsxFragment(node); - case 336: + case 331: return emitPartiallyEmittedExpression(node); - case 337: + case 332: return emitCommaList(node); } } @@ -82300,7 +80206,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 298 ? node : undefined; + var bundle = node.kind === 295 ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -82374,7 +80280,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 294 ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 291 ? "text" : "internal"); } @@ -82437,7 +80343,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 308 && !node.name) { + if (node.parent && node.parent.kind === 304 && !node.name) { emit(node.type); } else { @@ -82495,7 +80401,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 167 ? "get" : "set"); + writeKeyword(node.kind === 166 ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -82529,10 +80435,6 @@ var ts; emitTypeAnnotation(node.type); writeTrailingSemicolon(); } - function emitTemplateTypeSpan(node) { - emit(node.type); - emit(node.literal); - } function emitSemicolonClassElement() { writeTrailingSemicolon(); } @@ -82688,19 +80590,13 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 142) { + if (node.readonlyToken.kind !== 141) { writeKeyword("readonly"); } writeSpace(); } writePunctuation("["); pipelineEmit(3, node.typeParameter); - if (node.nameType) { - writeSpace(); - writeKeyword("as"); - writeSpace(); - emit(node.nameType); - } writePunctuation("]"); if (node.questionToken) { emit(node.questionToken); @@ -82724,10 +80620,6 @@ var ts; function emitLiteralType(node) { emitExpression(node.literal); } - function emitTemplateType(node) { - emit(node.head); - emitList(node, node.templateSpans, 262144); - } function emitImportTypeNode(node) { if (node.isTypeOf) { writeKeyword("typeof"); @@ -82901,7 +80793,7 @@ var ts; } function shouldEmitWhitespaceBeforeOperand(node) { var operand = node.operand; - return operand.kind === 214 + return operand.kind === 211 && ((node.operator === 39 && (operand.operator === 39 || operand.operator === 45)) || (node.operator === 40 && (operand.operator === 40 || operand.operator === 46))); } @@ -83060,7 +80952,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node, node.thenStatement, node.elseStatement); emitTokenWithComment(90, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 234) { + if (node.elseStatement.kind === 231) { writeSpace(); emit(node.elseStatement); } @@ -83123,7 +81015,7 @@ var ts; emitTokenWithComment(20, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(156, node.initializer.end, writeKeyword, node); + emitTokenWithComment(155, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21, node.expression.end, writePunctuation, node); @@ -83131,7 +81023,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 250) { + if (node.kind === 247) { emit(node); } else { @@ -83417,7 +81309,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 256) { + while (body.kind === 253) { writePunctuation("."); emit(body.name); body = body.body; @@ -83462,7 +81354,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(153, node.importClause.end, writeKeyword, node); + emitTokenWithComment(152, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -83470,7 +81362,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(149, node.pos, writeKeyword, node); + emitTokenWithComment(148, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -83510,7 +81402,7 @@ var ts; var nextPos = emitTokenWithComment(92, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(149, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(148, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -83522,7 +81414,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(153, fromPos, writeKeyword, node); + emitTokenWithComment(152, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -83533,7 +81425,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(126, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(140, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(139, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -83729,7 +81621,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 329 && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 325 && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -83745,17 +81637,6 @@ var ts; emitJSDocTypeExpression(tag.typeExpression); emitJSDocComment(tag.comment); } - function emitJSDocSeeTag(tag) { - emitJSDocTagName(tag.tagName); - emit(tag.name); - emitJSDocComment(tag.comment); - } - function emitJSDocNameReference(node) { - writeSpace(); - writePunctuation("{"); - emit(node.name); - writePunctuation("}"); - } function emitJSDocHeritageTag(tag) { emitJSDocTagName(tag.tagName); writeSpace(); @@ -83774,7 +81655,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 301) { + if (tag.typeExpression.kind === 298) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -83793,7 +81674,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 312) { + if (tag.typeExpression && tag.typeExpression.kind === 308) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -83922,8 +81803,8 @@ var ts; bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference", data: directive.fileName }); writeLine(); } - for (var _d = 0, types_23 = types; _d < types_23.length; _d++) { - var directive = types_23[_d]; + for (var _d = 0, types_22 = types; _d < types_22.length; _d++) { + var directive = types_22[_d]; var pos = writer.getTextPos(); writeComment("/// "); if (bundleFileInfo) @@ -84577,7 +82458,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 207 && ts.nodeIsSynthesized(node)) { + while (node.kind === 204 && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -84610,10 +82491,7 @@ var ts; return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape); } } - var flags = (neverAsciiEscape ? 1 : 0) - | (jsxAttributeEscape ? 2 : 0) - | (printerOptions.terminateUnterminatedLiterals ? 4 : 0); - return ts.getLiteralText(node, currentSourceFile, flags); + return ts.getLiteralText(node, currentSourceFile, neverAsciiEscape, jsxAttributeEscape); } function pushNameGenerationScope(node) { if (node && ts.getEmitFlags(node) & 524288) { @@ -84640,84 +82518,84 @@ var ts; if (!node) return; switch (node.kind) { - case 230: + case 227: ts.forEach(node.statements, generateNames); break; - case 245: - case 243: - case 235: - case 236: + case 242: + case 240: + case 232: + case 233: generateNames(node.statement); break; - case 234: + case 231: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 237: - case 239: - case 238: + case 234: + case 236: + case 235: generateNames(node.initializer); generateNames(node.statement); break; - case 244: + case 241: generateNames(node.caseBlock); break; - case 258: + case 255: ts.forEach(node.clauses, generateNames); break; - case 284: - case 285: + case 281: + case 282: ts.forEach(node.statements, generateNames); break; - case 247: + case 244: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 287: + case 284: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 232: + case 229: generateNames(node.declarationList); break; - case 250: + case 247: ts.forEach(node.declarations, generateNames); break; + case 246: + case 159: + case 195: case 249: - case 160: - case 198: - case 252: generateNameIfNeeded(node.name); break; - case 251: + case 248: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 196: - case 197: + case 193: + case 194: ts.forEach(node.elements, generateNames); break; - case 261: + case 258: generateNames(node.importClause); break; - case 262: + case 259: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 263: + case 260: generateNameIfNeeded(node.name); break; - case 269: + case 266: generateNameIfNeeded(node.name); break; - case 264: + case 261: ts.forEach(node.elements, generateNames); break; - case 265: + case 262: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -84726,12 +82604,12 @@ var ts; if (!node) return; switch (node.kind) { - case 288: - case 289: - case 163: - case 165: + case 285: + case 286: + case 162: + case 164: + case 166: case 167: - case 168: generateNameIfNeeded(node.name); break; } @@ -84865,23 +82743,23 @@ var ts; switch (node.kind) { case 78: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16), !!(flags & 8)); - case 256: - case 255: - return generateNameForModuleOrEnum(node); - case 261: - case 267: - return generateNameForImportOrExportDeclaration(node); - case 251: + case 253: case 252: - case 266: + return generateNameForModuleOrEnum(node); + case 258: + case 264: + return generateNameForImportOrExportDeclaration(node); + case 248: + case 249: + case 263: return generateNameForExportDefault(); - case 221: + case 218: return generateNameForClassExpression(); - case 165: + case 164: + case 166: case 167: - case 168: return generateNameForMethodOrAccessor(node); - case 158: + case 157: return makeTempVariableName(0, true); default: return makeTempVariableName(0); @@ -84919,7 +82797,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 335; + var isEmittedNode = node.kind !== 330; var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0 || node.kind === 11; var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0 || node.kind === 11; var savedContainerPos = containerPos; @@ -84934,7 +82812,7 @@ var ts; } if (!skipTrailingComments || (end >= 0 && (emitFlags & 1024) !== 0)) { containerEnd = end; - if (node.kind === 250) { + if (node.kind === 247) { declarationListContainerEnd = end; } } @@ -85024,12 +82902,7 @@ var ts; function emitLeadingComments(pos, isEmittedNode) { hasWrittenComment = false; if (isEmittedNode) { - if (pos === 0 && (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.isDeclarationFile)) { - forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment); - } - else { - forEachLeadingCommentToEmit(pos, emitLeadingComment); - } + forEachLeadingCommentToEmit(pos, emitLeadingComment); } else if (pos === 0) { forEachLeadingCommentToEmit(pos, emitTripleSlashLeadingComment); @@ -85040,11 +82913,6 @@ var ts; emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); } } - function emitNonTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { - if (!isTripleSlashComment(commentPos, commentEnd)) { - emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); - } - } function shouldWriteComment(text, pos) { if (printerOptions.onlyPrintJsDocStyle) { return (ts.isJSDocLikeText(text, pos) || ts.isPinnedComment(text, pos)); @@ -85180,7 +83048,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 335 + if (node.kind !== 330 && (emitFlags & 16) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -85193,7 +83061,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 335 + if (node.kind !== 330 && (emitFlags & 32) === 0 && end >= 0) { emitSourcePos(source, end); @@ -85214,10 +83082,9 @@ var ts; function emitSourcePos(source, pos) { if (source !== sourceMapSource) { var savedSourceMapSource = sourceMapSource; - var savedSourceMapSourceIndex = sourceMapSourceIndex; setSourceMapSource(source); emitPos(pos); - resetSourceMapSource(savedSourceMapSource, savedSourceMapSourceIndex); + setSourceMapSource(savedSourceMapSource); } else { emitPos(pos); @@ -85248,10 +83115,6 @@ var ts; return; } sourceMapSource = source; - if (source === mostRecentlyAddedSourceMapSource) { - sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex; - return; - } if (isJsonSourceMapSource(source)) { return; } @@ -85259,12 +83122,6 @@ var ts; if (printerOptions.inlineSources) { sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text); } - mostRecentlyAddedSourceMapSource = source; - mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex; - } - function resetSourceMapSource(source, sourceIndex) { - sourceMapSource = source; - sourceMapSourceIndex = sourceIndex; } function isJsonSourceMapSource(sourceFile) { return ts.fileExtensionIs(sourceFile.fileName, ".json"); @@ -85704,7 +83561,6 @@ var ts; if (system === void 0) { system = ts.sys; } var existingDirectories = new ts.Map(); var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames); - var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash; function getSourceFile(fileName, languageVersion, onError) { var text; try { @@ -85746,14 +83602,14 @@ var ts; } var outputFingerprints; function writeFileWorker(fileName, data, writeByteOrderMark) { - if (!ts.isWatchSet(options) || !system.getModifiedTime) { + if (!ts.isWatchSet(options) || !system.createHash || !system.getModifiedTime) { system.writeFile(fileName, data, writeByteOrderMark); return; } if (!outputFingerprints) { outputFingerprints = new ts.Map(); } - var hash = computeHash(data); + var hash = system.createHash(data); var mtimeBefore = system.getModifiedTime(fileName); if (mtimeBefore) { var fingerprint = outputFingerprints.get(fileName); @@ -86089,32 +83945,6 @@ var ts; return resolutions; } ts.loadWithLocalCache = loadWithLocalCache; - function forEachResolvedProjectReference(resolvedProjectReferences, cb) { - return forEachProjectReference(undefined, resolvedProjectReferences, function (resolvedRef, parent) { return resolvedRef && cb(resolvedRef, parent); }); - } - ts.forEachResolvedProjectReference = forEachResolvedProjectReference; - function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { - var seenResolvedRefs; - return worker(projectReferences, resolvedProjectReferences, undefined); - function worker(projectReferences, resolvedProjectReferences, parent) { - if (cbRef) { - var result = cbRef(projectReferences, parent); - if (result) { - return result; - } - } - return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) { - if (resolvedRef && (seenResolvedRefs === null || seenResolvedRefs === void 0 ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) { - return undefined; - } - var result = cbResolvedRef(resolvedRef, parent, index); - if (result || !resolvedRef) - return result; - (seenResolvedRefs || (seenResolvedRefs = new ts.Set())).add(resolvedRef.sourceFile.path); - return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef); - }); - } - } ts.inferredTypesContainingFile = "__inferred type names__.ts"; function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, projectReferences) { if (!program || (hasChangedAutomaticTypeDirectiveNames === null || hasChangedAutomaticTypeDirectiveNames === void 0 ? void 0 : hasChangedAutomaticTypeDirectiveNames())) { @@ -86216,8 +84046,6 @@ var ts; var currentNodeModulesDepth = 0; var modulesWithElidedImports = new ts.Map(); var sourceFilesFoundSearchingNodeModules = new ts.Map(); - var tracingData = ["program", "createProgram"]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeProgram"); var host = createProgramOptions.host || createCompilerHost(options); var configParsingHost = parseConfigHostFromCompilerHostLike(host); @@ -86277,14 +84105,10 @@ var ts; getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, forEachResolvedProjectReference: forEachResolvedProjectReference }), onProgramCreateComplete = _c.onProgramCreateComplete, fileExists = _c.fileExists, directoryExists = _c.directoryExists; - ts.tracing.push("program", "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram }); var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); - ts.tracing.pop(); - var structureIsReused; - ts.tracing.push("program", "tryReuseStructureFromOldProgram", {}); - structureIsReused = tryReuseStructureFromOldProgram(); - ts.tracing.pop(); - if (structureIsReused !== 2) { + var structuralIsReused; + structuralIsReused = tryReuseStructureFromOldProgram(); + if (structuralIsReused !== 2) { processingDefaultLibFiles = []; processingOtherFiles = []; if (projectReferences) { @@ -86321,19 +84145,15 @@ var ts; } } } - ts.tracing.push("program", "processRootFiles", { count: rootNames.length }); ts.forEach(rootNames, function (name) { return processRootFile(name, false, false); }); - ts.tracing.pop(); var typeReferences = rootNames.length ? ts.getAutomaticTypeDirectiveNames(options, host) : ts.emptyArray; if (typeReferences.length) { - ts.tracing.push("program", "processTypeReferences", { count: typeReferences.length }); var containingDirectory = options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : host.getCurrentDirectory(); var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile); var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename); for (var i = 0; i < typeReferences.length; i++) { processTypeReferenceDirective(typeReferences[i], resolutions[i]); } - ts.tracing.pop(); } if (rootNames.length && !skipDefaultLib) { var defaultLibraryFileName = getDefaultLibraryFileName(); @@ -86365,8 +84185,8 @@ var ts; host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path)); } } - oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference) { - if (!getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) { + oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference, resolvedProjectReferencePath) { + if (resolvedProjectReference && !getResolvedProjectReferenceByPath(resolvedProjectReferencePath)) { host.onReleaseOldSourceFile(resolvedProjectReference.sourceFile, oldProgram.getCompilerOptions(), false); } }); @@ -86385,7 +84205,6 @@ var ts; getOptionsDiagnostics: getOptionsDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getSemanticDiagnostics: getSemanticDiagnostics, - getCachedSemanticDiagnostics: getCachedSemanticDiagnostics, getSuggestionDiagnostics: getSuggestionDiagnostics, getDeclarationDiagnostics: getDeclarationDiagnostics, getBindAndCheckDiagnostics: getBindAndCheckDiagnostics, @@ -86399,7 +84218,6 @@ var ts; getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, - getTypeCatalog: function () { return getDiagnosticsProducingTypeChecker().getTypeCatalog(); }, getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); }, getInstantiationCount: function () { return getDiagnosticsProducingTypeChecker().getInstantiationCount(); }, getRelationCacheSizes: function () { return getDiagnosticsProducingTypeChecker().getRelationCacheSizes(); }, @@ -86428,66 +84246,26 @@ var ts; getSymlinkCache: getSymlinkCache, realpath: (_b = host.realpath) === null || _b === void 0 ? void 0 : _b.bind(host), useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, - structureIsReused: structureIsReused, }; onProgramCreateComplete(); verifyCompilerOptions(); ts.performance.mark("afterProgram"); ts.performance.measure("Program", "beforeProgram", "afterProgram"); - ts.tracing.end.apply(ts.tracing, tracingData); return program; - function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames) { - if (!moduleNames.length) - return ts.emptyArray; - var containingFileName = ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); - var redirectedReference = getRedirectReferenceForResolution(containingFile); - ts.tracing.push("program", "resolveModuleNamesWorker", { containingFileName: containingFileName }); + function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames, redirectedReference) { ts.performance.mark("beforeResolveModule"); - var result = actualResolveModuleNamesWorker(moduleNames, containingFileName, reusedNames, redirectedReference); + var result = actualResolveModuleNamesWorker(moduleNames, containingFile, reusedNames, redirectedReference); ts.performance.mark("afterResolveModule"); ts.performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule"); - ts.tracing.pop(); return result; } - function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile) { - if (!typeDirectiveNames.length) - return []; - var containingFileName = !ts.isString(containingFile) ? ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile; - var redirectedReference = !ts.isString(containingFile) ? getRedirectReferenceForResolution(containingFile) : undefined; - ts.tracing.push("program", "resolveTypeReferenceDirectiveNamesWorker", { containingFileName: containingFileName }); + function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, redirectedReference) { ts.performance.mark("beforeResolveTypeReference"); - var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference); + var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, redirectedReference); ts.performance.mark("afterResolveTypeReference"); ts.performance.measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference"); - ts.tracing.pop(); return result; } - function getRedirectReferenceForResolution(file) { - var redirect = getResolvedProjectReferenceToRedirect(file.originalFileName); - if (redirect || !ts.fileExtensionIs(file.originalFileName, ".d.ts")) - return redirect; - var resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.originalFileName, file.path); - if (resultFromDts) - return resultFromDts; - if (!host.realpath || !options.preserveSymlinks || !ts.stringContains(file.originalFileName, ts.nodeModulesPathPart)) - return undefined; - var realDeclarationFileName = host.realpath(file.originalFileName); - var realDeclarationPath = toPath(realDeclarationFileName); - return realDeclarationPath === file.path ? undefined : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationFileName, realDeclarationPath); - } - function getRedirectReferenceForResolutionFromSourceOfProject(fileName, filePath) { - var source = getSourceOfProjectReferenceRedirect(fileName); - if (ts.isString(source)) - return getResolvedProjectReferenceToRedirect(source); - if (!source) - return undefined; - return forEachResolvedProjectReference(function (resolvedRef) { - var out = ts.outFile(resolvedRef.commandLine.options); - if (!out) - return undefined; - return toPath(out) === filePath ? resolvedRef : undefined; - }); - } function compareDefaultLibFiles(a, b) { return ts.compareValues(getDefaultLibFilePriority(a), getDefaultLibFilePriority(b)); } @@ -86540,19 +84318,19 @@ var ts; } return classifiableNames; } - function resolveModuleNamesReusingOldState(moduleNames, file) { - if (structureIsReused === 0 && !file.ambientModuleNames.length) { - return resolveModuleNamesWorker(moduleNames, file, undefined); + function resolveModuleNamesReusingOldState(moduleNames, containingFile, file) { + if (structuralIsReused === 0 && !file.ambientModuleNames.length) { + return resolveModuleNamesWorker(moduleNames, containingFile, undefined, getResolvedProjectReferenceToRedirect(file.originalFileName)); } - var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName); + var oldSourceFile = oldProgram && oldProgram.getSourceFile(containingFile); if (oldSourceFile !== file && file.resolvedModules) { - var result_14 = []; + var result_12 = []; for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { var moduleName = moduleNames_1[_i]; var resolvedModule = file.resolvedModules.get(moduleName); - result_14.push(resolvedModule); + result_12.push(resolvedModule); } - return result_14; + return result_12; } var unknownModuleNames; var result; @@ -86564,7 +84342,7 @@ var ts; var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName); if (oldResolvedModule) { if (ts.isTraceEnabled(options, host)) { - ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, containingFile); } (result || (result = new Array(moduleNames.length)))[i] = oldResolvedModule; (reusedNames || (reusedNames = [])).push(moduleName); @@ -86575,7 +84353,7 @@ var ts; if (ts.contains(file.ambientModuleNames, moduleName)) { resolvesToAmbientModuleInNonModifiedFile = true; if (ts.isTraceEnabled(options, host)) { - ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, containingFile); } } else { @@ -86589,7 +84367,7 @@ var ts; } } var resolutions = unknownModuleNames && unknownModuleNames.length - ? resolveModuleNamesWorker(unknownModuleNames, file, reusedNames) + ? resolveModuleNamesWorker(unknownModuleNames, containingFile, reusedNames, getResolvedProjectReferenceToRedirect(file.originalFileName)) : ts.emptyArray; if (!result) { ts.Debug.assert(resolutions.length === moduleNames.length); @@ -86626,7 +84404,7 @@ var ts; } } function canReuseProjectReferences() { - return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, parent, index) { + return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, index, parent) { var newRef = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; var newResolvedRef = parseProjectReferenceConfigFile(newRef); if (oldResolvedRef) { @@ -86647,26 +84425,26 @@ var ts; } var oldOptions = oldProgram.getCompilerOptions(); if (ts.changesAffectModuleResolution(oldOptions, options)) { - return 0; + return oldProgram.structureIsReused = 0; } var oldRootNames = oldProgram.getRootFileNames(); if (!ts.arrayIsEqualTo(oldRootNames, rootNames)) { - return 0; + return oldProgram.structureIsReused = 0; } if (!ts.arrayIsEqualTo(options.types, oldOptions.types)) { - return 0; + return oldProgram.structureIsReused = 0; } if (!canReuseProjectReferences()) { - return 0; + return oldProgram.structureIsReused = 0; } if (projectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); } var newSourceFiles = []; var modifiedSourceFiles = []; - structureIsReused = 2; + oldProgram.structureIsReused = 2; if (oldProgram.getMissingFilePaths().some(function (missingFilePath) { return host.fileExists(missingFilePath); })) { - return 0; + return oldProgram.structureIsReused = 0; } var oldSourceFiles = oldProgram.getSourceFiles(); var seenPackageNames = new ts.Map(); @@ -86676,20 +84454,20 @@ var ts; ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, options.target, undefined, shouldCreateNewSourceFile) : host.getSourceFile(oldSourceFile.fileName, options.target, undefined, shouldCreateNewSourceFile); if (!newSourceFile) { - return 0; + return oldProgram.structureIsReused = 0; } ts.Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); var fileChanged = void 0; if (oldSourceFile.redirectInfo) { if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { - return 0; + return oldProgram.structureIsReused = 0; } fileChanged = false; newSourceFile = oldSourceFile; } else if (oldProgram.redirectTargetsMap.has(oldSourceFile.path)) { if (newSourceFile !== oldSourceFile) { - return 0; + return oldProgram.structureIsReused = 0; } fileChanged = false; } @@ -86705,43 +84483,43 @@ var ts; var prevKind = seenPackageNames.get(packageName); var newKind = fileChanged ? 1 : 0; if ((prevKind !== undefined && newKind === 1) || prevKind === 1) { - return 0; + return oldProgram.structureIsReused = 0; } seenPackageNames.set(packageName, newKind); } if (fileChanged) { if (!ts.arrayIsEqualTo(oldSourceFile.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) { - return 0; + return oldProgram.structureIsReused = 0; } if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { - structureIsReused = 1; + oldProgram.structureIsReused = 1; } if (!ts.arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) { - structureIsReused = 1; + oldProgram.structureIsReused = 1; } collectExternalModuleReferences(newSourceFile); if (!ts.arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) { - structureIsReused = 1; + oldProgram.structureIsReused = 1; } if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { - structureIsReused = 1; + oldProgram.structureIsReused = 1; } if ((oldSourceFile.flags & 3145728) !== (newSourceFile.flags & 3145728)) { - structureIsReused = 1; + oldProgram.structureIsReused = 1; } if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { - structureIsReused = 1; + oldProgram.structureIsReused = 1; } modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); } else if (hasInvalidatedResolution(oldSourceFile.path)) { - structureIsReused = 1; + oldProgram.structureIsReused = 1; modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); } newSourceFiles.push(newSourceFile); } - if (structureIsReused !== 2) { - return structureIsReused; + if (oldProgram.structureIsReused !== 2) { + return oldProgram.structureIsReused; } var modifiedFiles = modifiedSourceFiles.map(function (f) { return f.oldFile; }); for (var _b = 0, oldSourceFiles_3 = oldSourceFiles; _b < oldSourceFiles_3.length; _b++) { @@ -86755,32 +84533,35 @@ var ts; } for (var _e = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _e < modifiedSourceFiles_1.length; _e++) { var _f = modifiedSourceFiles_1[_e], oldSourceFile = _f.oldFile, newSourceFile = _f.newFile; + var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.originalFileName, currentDirectory); var moduleNames = getModuleNames(newSourceFile); - var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile); + var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile); var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo); if (resolutionsChanged) { - structureIsReused = 1; + oldProgram.structureIsReused = 1; newSourceFile.resolvedModules = ts.zipToMap(moduleNames, resolutions); } else { newSourceFile.resolvedModules = oldSourceFile.resolvedModules; } - var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); }); - var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile); - var typeReferenceEesolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo); - if (typeReferenceEesolutionsChanged) { - structureIsReused = 1; - newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, typeReferenceResolutions); - } - else { - newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; + if (resolveTypeReferenceDirectiveNamesWorker) { + var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); }); + var resolutions_1 = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFilePath, getResolvedProjectReferenceToRedirect(newSourceFile.originalFileName)); + var resolutionsChanged_1 = ts.hasChangesInResolutions(typesReferenceDirectives, resolutions_1, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo); + if (resolutionsChanged_1) { + oldProgram.structureIsReused = 1; + newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, resolutions_1); + } + else { + newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; + } } } - if (structureIsReused !== 2) { - return structureIsReused; + if (oldProgram.structureIsReused !== 2) { + return oldProgram.structureIsReused; } if ((_a = host.hasChangedAutomaticTypeDirectiveNames) === null || _a === void 0 ? void 0 : _a.call(host)) { - return 1; + return oldProgram.structureIsReused = 1; } missingFilePaths = oldProgram.getMissingFilePaths(); refFileMap = oldProgram.getRefFileMap(); @@ -86812,7 +84593,7 @@ var ts; resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); sourceFileToPackageName = oldProgram.sourceFileToPackageName; redirectTargetsMap = oldProgram.redirectTargetsMap; - return 2; + return oldProgram.structureIsReused = 2; } function getEmitHost(writeFileCallback) { return { @@ -86850,13 +84631,10 @@ var ts; } function emitBuildInfo(writeFileCallback) { ts.Debug.assert(!ts.outFile(options)); - var tracingData = ["emit", "emitBuildInfo"]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeEmit"); var emitResult = ts.emitFiles(ts.notImplementedResolver, getEmitHost(writeFileCallback), undefined, ts.noTransformers, false, true); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); - ts.tracing.end.apply(ts.tracing, tracingData); return emitResult; } function getResolvedProjectReferences() { @@ -86900,11 +84678,7 @@ var ts; return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, false)); } function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit) { - var tracingData = ["emit", "emit", { path: sourceFile === null || sourceFile === void 0 ? void 0 : sourceFile.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); - var result = runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); }); - ts.tracing.end.apply(ts.tracing, tracingData); - return result; + return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); }); } function isEmitBlocked(emitFileName) { return hasEmitBlockingDiagnostics.has(toPath(emitFileName)); @@ -86945,11 +84719,6 @@ var ts; function getSemanticDiagnostics(sourceFile, cancellationToken) { return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken); } - function getCachedSemanticDiagnostics(sourceFile) { - var _a; - return sourceFile - ? (_a = cachedBindAndCheckDiagnosticsForFile.perFile) === null || _a === void 0 ? void 0 : _a.get(sourceFile.path) : cachedBindAndCheckDiagnosticsForFile.allDiagnostics; - } function getBindAndCheckDiagnostics(sourceFile, cancellationToken) { return getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken); } @@ -87022,17 +84791,17 @@ var ts; sourceFile.scriptKind === 5 || isCheckJs || sourceFile.scriptKind === 7); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; - return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); + return getMergedBindAndCheckDiagnostics(sourceFile, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); }); } - function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics) { + function getMergedBindAndCheckDiagnostics(sourceFile) { var _a; var allDiagnostics = []; - for (var _i = 2; _i < arguments.length; _i++) { - allDiagnostics[_i - 2] = arguments[_i]; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; } var flatDiagnostics = ts.flatten(allDiagnostics); - if (!includeBindAndCheckDiagnostics || !((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { return flatDiagnostics; } var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives; @@ -87079,79 +84848,79 @@ var ts; return diagnostics; function walk(node, parent) { switch (parent.kind) { - case 160: - case 163: - case 165: + case 159: + case 162: + case 164: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } - case 164: + case 163: + case 165: case 166: case 167: - case 168: - case 208: - case 251: - case 209: - case 249: + case 205: + case 248: + case 206: + case 246: if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); return "skip"; } } switch (node.kind) { - case 262: + case 259: if (node.isTypeOnly) { - diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); + diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 267: + case 264: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 260: + case 257: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 266: + case 263: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 286: + case 283: var heritageClause = node; if (heritageClause.token === 116) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 253: + case 250: var interfaceKeyword = ts.tokenToString(117); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 256: - var moduleKeyword = node.flags & 16 ? ts.tokenToString(140) : ts.tokenToString(139); + case 253: + var moduleKeyword = node.flags & 16 ? ts.tokenToString(139) : ts.tokenToString(138); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 254: + case 251: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 255: + case 252: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(91)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 225: + case 222: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 224: + case 221: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 206: + case 203: ts.Debug.fail(); } } @@ -87160,26 +84929,26 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 252: - case 221: + case 249: + case 218: + case 164: case 165: case 166: case 167: - case 168: - case 208: - case 251: - case 209: + case 205: + case 248: + case 206: if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } - case 232: + case 229: if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 232); + checkModifiers(parent.modifiers, parent.kind === 229); return "skip"; } break; - case 163: + case 162: if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { var modifier = _a[_i]; @@ -87190,18 +84959,18 @@ var ts; return "skip"; } break; - case 160: + case 159: if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 203: - case 204: - case 223: - case 274: - case 275: - case 205: + case 200: + case 201: + case 220: + case 271: + case 272: + case 202: if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); return "skip"; @@ -87220,7 +84989,7 @@ var ts; case 122: case 120: case 121: - case 142: + case 141: case 133: case 125: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); @@ -87277,7 +85046,9 @@ var ts; } var diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName); forEachResolvedProjectReference(function (resolvedRef) { - diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + if (resolvedRef) { + diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + } }); return diagnostics; } @@ -87298,16 +85069,6 @@ var ts; ? b.kind === 78 && a.escapedText === b.escapedText : b.kind === 10 && a.text === b.text; } - function createSyntheticImport(text, file) { - var externalHelpersModuleReference = ts.factory.createStringLiteral(text); - var importDecl = ts.factory.createImportDeclaration(undefined, undefined, undefined, externalHelpersModuleReference); - ts.addEmitFlags(importDecl, 67108864); - ts.setParent(externalHelpersModuleReference, importDecl); - ts.setParent(importDecl, file); - externalHelpersModuleReference.flags &= ~8; - importDecl.flags &= ~8; - return externalHelpersModuleReference; - } function collectExternalModuleReferences(file) { if (file.imports) { return; @@ -87317,15 +85078,15 @@ var ts; var imports; var moduleAugmentations; var ambientModules; - if ((options.isolatedModules || isExternalModuleFile) + if (options.importHelpers + && (options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { - if (options.importHelpers) { - imports = [createSyntheticImport(ts.externalHelpersModuleNameText, file)]; - } - var jsxImport = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(options, file), options); - if (jsxImport) { - (imports || (imports = [])).push(createSyntheticImport(jsxImport, file)); - } + var externalHelpersModuleReference = ts.factory.createStringLiteral(ts.externalHelpersModuleNameText); + var importDecl = ts.factory.createImportDeclaration(undefined, undefined, undefined, externalHelpersModuleReference); + ts.addEmitFlags(importDecl, 67108864); + ts.setParent(externalHelpersModuleReference, importDecl); + ts.setParent(importDecl, file); + imports = [externalHelpersModuleReference]; } for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; @@ -87489,16 +85250,6 @@ var ts; return redirect; } function findSourceFile(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) { - ts.tracing.push("program", "findSourceFile", { - fileName: fileName, - isDefaultLib: isDefaultLib || undefined, - refKind: refFile ? ts.RefFileKind[refFile.kind] : undefined, - }); - var result = findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId); - ts.tracing.pop(); - return result; - } - function findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) { if (useSourceOfProjectReferenceRedirect) { var source = getSourceOfProjectReferenceRedirect(fileName); if (!source && @@ -87658,10 +85409,11 @@ var ts; function getResolvedProjectReferenceToRedirect(fileName) { if (mapFromFileToProjectReferenceRedirects === undefined) { mapFromFileToProjectReferenceRedirects = new ts.Map(); - forEachResolvedProjectReference(function (referencedProject) { - if (toPath(options.configFilePath) !== referencedProject.sourceFile.path) { + forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { + if (referencedProject && + toPath(options.configFilePath) !== referenceProjectPath) { referencedProject.commandLine.fileNames.forEach(function (f) { - return mapFromFileToProjectReferenceRedirects.set(toPath(f), referencedProject.sourceFile.path); + return mapFromFileToProjectReferenceRedirects.set(toPath(f), referenceProjectPath); }); } }); @@ -87670,7 +85422,11 @@ var ts; return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); } function forEachResolvedProjectReference(cb) { - return ts.forEachResolvedProjectReference(resolvedProjectReferences, cb); + return forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { + var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; + var resolvedRefPath = toPath(resolveProjectReferencePath(ref)); + return cb(resolvedRef, resolvedRefPath); + }); } function getSourceOfProjectReferenceRedirect(file) { if (!ts.isDeclarationFileName(file)) @@ -87678,18 +85434,20 @@ var ts; if (mapFromToProjectReferenceRedirectSource === undefined) { mapFromToProjectReferenceRedirectSource = new ts.Map(); forEachResolvedProjectReference(function (resolvedRef) { - var out = ts.outFile(resolvedRef.commandLine.options); - if (out) { - var outputDts = ts.changeExtension(out, ".d.ts"); - mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), true); - } - else { - ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) { - if (!ts.fileExtensionIs(fileName, ".d.ts") && !ts.fileExtensionIs(fileName, ".json")) { - var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames()); - mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName); - } - }); + if (resolvedRef) { + var out = ts.outFile(resolvedRef.commandLine.options); + if (out) { + var outputDts = ts.changeExtension(out, ".d.ts"); + mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), true); + } + else { + ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) { + if (!ts.fileExtensionIs(fileName, ".d.ts") && !ts.fileExtensionIs(fileName, ".json")) { + var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames()); + mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName); + } + }); + } } }); } @@ -87698,6 +85456,31 @@ var ts; function isSourceOfProjectReferenceRedirect(fileName) { return useSourceOfProjectReferenceRedirect && !!getResolvedProjectReferenceToRedirect(fileName); } + function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { + var seenResolvedRefs; + return worker(projectReferences, resolvedProjectReferences, undefined, cbResolvedRef, cbRef); + function worker(projectReferences, resolvedProjectReferences, parent, cbResolvedRef, cbRef) { + if (cbRef) { + var result = cbRef(projectReferences, parent); + if (result) { + return result; + } + } + return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) { + if (ts.contains(seenResolvedRefs, resolvedRef)) { + return undefined; + } + var result = cbResolvedRef(resolvedRef, index, parent); + if (result) { + return result; + } + if (!resolvedRef) + return undefined; + (seenResolvedRefs || (seenResolvedRefs = [])).push(resolvedRef); + return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef, cbResolvedRef, cbRef); + }); + } + } function getResolvedProjectReferenceByPath(projectReferencePath) { if (!projectReferenceRedirects) { return undefined; @@ -87721,7 +85504,7 @@ var ts; if (!typeDirectives) { return; } - var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file); + var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file.originalFileName, getResolvedProjectReferenceToRedirect(file.originalFileName)); for (var i = 0; i < typeDirectives.length; i++) { var ref = file.typeReferenceDirectives[i]; var resolvedTypeReferenceDirective = resolutions[i]; @@ -87737,11 +85520,6 @@ var ts; } } function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, refFile) { - ts.tracing.push("program", "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolveModuleNamesReusingOldState, refKind: refFile === null || refFile === void 0 ? void 0 : refFile.kind, refPath: refFile === null || refFile === void 0 ? void 0 : refFile.file.path }); - processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, refFile); - ts.tracing.pop(); - } - function processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, refFile) { var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective); if (previousResolution && previousResolution.primary) { return; @@ -87816,7 +85594,7 @@ var ts; collectExternalModuleReferences(file); if (file.imports.length || file.moduleAugmentations.length) { var moduleNames = getModuleNames(file); - var resolutions = resolveModuleNamesReusingOldState(moduleNames, file); + var resolutions = resolveModuleNamesReusingOldState(moduleNames, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory), file); ts.Debug.assert(resolutions.length === moduleNames.length); for (var i = 0; i < moduleNames.length; i++) { var resolution = resolutions[i]; @@ -87837,7 +85615,7 @@ var ts; && !options.noResolve && i < file.imports.length && !elideImport - && !(isJsFile && !ts.getAllowJSCompilerOption(options)) + && !(isJsFile && !options.allowJs) && (ts.isInJSFile(file.imports[i]) || !(file.imports[i].flags & 4194304)); if (elideImport) { modulesWithElidedImports.set(file.path, true); @@ -87948,6 +85726,9 @@ var ts; createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap"); } } + if (options.paths && options.baseUrl === undefined) { + createDiagnosticForOptionName(ts.Diagnostics.Option_paths_cannot_be_used_without_specifying_baseUrl_option, "paths"); + } if (options.composite) { if (options.declaration === false) { createDiagnosticForOptionName(ts.Diagnostics.Composite_projects_may_not_disable_declaration_emit, "declaration"); @@ -87995,9 +85776,6 @@ var ts; if (!ts.hasZeroOrOneAsteriskCharacter(subst)) { createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character, subst, key); } - if (!options.baseUrl && !ts.pathIsRelative(subst) && !ts.pathIsAbsolute(subst)) { - createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash); - } } else { createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2, subst, key, typeOfSubst); @@ -88049,7 +85827,7 @@ var ts; var firstNonExternalModuleSourceFile = ts.find(files, function (f) { return !ts.isExternalModule(f) && !ts.isSourceFileJS(f) && !f.isDeclarationFile && f.scriptKind !== 6; }); if (firstNonExternalModuleSourceFile) { var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); - programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts.getBaseFileName(firstNonExternalModuleSourceFile.fileName))); + programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.All_files_must_be_modules_when_the_isolatedModules_flag_is_provided)); } } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 && options.module === ts.ModuleKind.None) { @@ -88084,7 +85862,7 @@ var ts; if (options.useDefineForClassFields && languageVersion === 0) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, "useDefineForClassFields"); } - if (options.checkJs && !ts.getAllowJSCompilerOption(options)) { + if (options.checkJs && !options.allowJs) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); } if (options.emitDeclarationOnly) { @@ -88103,9 +85881,6 @@ var ts; if (options.reactNamespace) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "reactNamespace", "jsxFactory"); } - if (options.jsx === 4 || options.jsx === 5) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFactory", ts.inverseJsxOptionMap.get("" + options.jsx)); - } if (!ts.parseIsolatedEntityName(options.jsxFactory, languageVersion)) { createOptionValueDiagnostic("jsxFactory", ts.Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFactory); } @@ -88117,23 +85892,10 @@ var ts; if (!options.jsxFactory) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "jsxFragmentFactory", "jsxFactory"); } - if (options.jsx === 4 || options.jsx === 5) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFragmentFactory", ts.inverseJsxOptionMap.get("" + options.jsx)); - } if (!ts.parseIsolatedEntityName(options.jsxFragmentFactory, languageVersion)) { createOptionValueDiagnostic("jsxFragmentFactory", ts.Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFragmentFactory); } } - if (options.reactNamespace) { - if (options.jsx === 4 || options.jsx === 5) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "reactNamespace", ts.inverseJsxOptionMap.get("" + options.jsx)); - } - } - if (options.jsxImportSource) { - if (options.jsx === 2) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxImportSource", ts.inverseJsxOptionMap.get("" + options.jsx)); - } - } if (!options.noEmit && !options.suppressOutputPathCheck) { var emitHost = getEmitHost(); var emitFilesSeen_1 = new ts.Set(); @@ -88202,7 +85964,7 @@ var ts; } function verifyProjectReferences() { var buildInfoPath = !options.suppressOutputPathCheck ? ts.getTsBuildInfoEmitOutputFilePath(options) : undefined; - forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, parent, index) { + forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; var parentFile = parent && parent.sourceFile; if (!resolvedRef) { @@ -88388,6 +86150,8 @@ var ts; if (!setOfDeclarationDirectories) { setOfDeclarationDirectories = new ts.Set(); host.forEachResolvedProjectReference(function (ref) { + if (!ref) + return; var out = ts.outFile(ref.commandLine.options); if (out) { setOfDeclarationDirectories.add(ts.getDirectoryPath(host.toPath(out))); @@ -88587,7 +86351,7 @@ var ts; return options.jsx ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set; } function needAllowJs() { - return ts.getAllowJSCompilerOption(options) || !ts.getStrictOptionValue(options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; + return options.allowJs || !ts.getStrictOptionValue(options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; } function needResolveJsonModule() { return options.resolveJsonModule ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used; @@ -88710,7 +86474,7 @@ var ts; newProgram.getTypeChecker(); for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; - var version_2 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); + var version_1 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined; if (referencedMap) { var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName); @@ -88724,7 +86488,7 @@ var ts; } } } - fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) }); + fileInfos.set(sourceFile.resolvedPath, { version: version_1, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) }); } return { fileInfos: fileInfos, @@ -88799,7 +86563,7 @@ var ts; emitOutput_1.outputFiles.length > 0 ? emitOutput_1.outputFiles[0] : undefined; if (firstDts_1) { ts.Debug.assert(ts.fileExtensionIs(firstDts_1.name, ".d.ts"), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); }); - latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text); + latestSignature = computeHash(firstDts_1.text); if (exportedModulesMapCache && latestSignature !== prevSignature) { updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache); } @@ -89046,7 +86810,7 @@ var ts; result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function (r) { return convertToDiagnosticRelatedInformation(r, newProgram, toPath); }) : - [] : + ts.emptyArray : undefined; return result; }); @@ -89193,16 +86957,16 @@ var ts; state.semanticDiagnosticsPerFile.delete(path); return !state.semanticDiagnosticsFromOldState.size; } - function isChangedSignature(state, path) { + function isChangedSignagure(state, path) { var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path); - var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature; - return newSignature !== oldSignature; + var oldSignagure = ts.Debug.checkDefined(state.fileInfos.get(path)).signature; + return newSignature !== oldSignagure; } function forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, fn) { if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) { return; } - if (!isChangedSignature(state, affectedFile.resolvedPath)) + if (!isChangedSignagure(state, affectedFile.resolvedPath)) return; if (state.compilerOptions.isolatedModules) { var seenFileNamesMap = new ts.Map(); @@ -89213,7 +86977,7 @@ var ts; if (!seenFileNamesMap.has(currentPath)) { seenFileNamesMap.set(currentPath, true); var result = fn(state, currentPath); - if (result && isChangedSignature(state, currentPath)) { + if (result && isChangedSignagure(state, currentPath)) { var currentSourceFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(currentPath); queue.push.apply(queue, ts.BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath)); } @@ -89423,7 +87187,7 @@ var ts; result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function (r) { return convertToReusableDiagnosticRelatedInformation(r, relativeToBuildInfo); }) : - [] : + ts.emptyArray : undefined; return result; }); @@ -89478,7 +87242,7 @@ var ts; return oldProgram; } var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); - var computeHash = ts.maybeBind(host, host.createHash); + var computeHash = host.createHash || ts.generateDjb2Hash; var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState); var backupState; newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); }; @@ -89549,49 +87313,30 @@ var ts; return toAffectedFileEmitResult(state, ts.Debug.checkDefined(state.program).emit(affected === state.program ? undefined : affected, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === 0, customTransformers), affected, emitKind, isPendingEmitFile); } function emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { - var restorePendingEmitOnHandlingNoEmitSuccess = false; - var savedAffectedFilesPendingEmit; - var savedAffectedFilesPendingEmitKind; - var savedAffectedFilesPendingEmitIndex; - if (kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram && - !targetSourceFile && - !ts.outFile(state.compilerOptions) && - !state.compilerOptions.noEmit && - state.compilerOptions.noEmitOnError) { - restorePendingEmitOnHandlingNoEmitSuccess = true; - savedAffectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice(); - savedAffectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind); - savedAffectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex; - } if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile); - } - var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken); - if (result) - return result; - if (restorePendingEmitOnHandlingNoEmitSuccess) { - state.affectedFilesPendingEmit = savedAffectedFilesPendingEmit; - state.affectedFilesPendingEmitKind = savedAffectedFilesPendingEmitKind; - state.affectedFilesPendingEmitIndex = savedAffectedFilesPendingEmitIndex; - } - if (!targetSourceFile && kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { - var sourceMaps = []; - var emitSkipped = false; - var diagnostics = void 0; - var emittedFiles = []; - var affectedEmitResult = void 0; - while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { - emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; - diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); - emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); - sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken); + if (result) + return result; + if (!targetSourceFile) { + var sourceMaps = []; + var emitSkipped = false; + var diagnostics = void 0; + var emittedFiles = []; + var affectedEmitResult = void 0; + while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { + emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; + diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); + emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); + sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + } + return { + emitSkipped: emitSkipped, + diagnostics: diagnostics || ts.emptyArray, + emittedFiles: emittedFiles, + sourceMaps: sourceMaps + }; } - return { - emitSkipped: emitSkipped, - diagnostics: diagnostics || ts.emptyArray, - emittedFiles: emittedFiles, - sourceMaps: sourceMaps - }; } return ts.Debug.checkDefined(state.program).emit(targetSourceFile, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers); } @@ -89604,7 +87349,7 @@ var ts; else if (affected === state.program) { return toAffectedFileResult(state, state.program.getSemanticDiagnostics(undefined, cancellationToken), affected); } - if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram || state.compilerOptions.noEmit || state.compilerOptions.noEmitOnError) { + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { addToAffectedFilesPendingEmit(state, affected.resolvedPath, 1); } if (ignoreSourceFile && ignoreSourceFile(affected)) { @@ -90242,8 +87987,8 @@ var ts; if (!resolutions) return false; var invalidated = false; - for (var _i = 0, resolutions_1 = resolutions; _i < resolutions_1.length; _i++) { - var resolution = resolutions_1[_i]; + for (var _i = 0, resolutions_2 = resolutions; _i < resolutions_2.length; _i++) { + var resolution = resolutions_2[_i]; if (resolution.isInvalidated || !canInvalidate(resolution)) continue; resolution.isInvalidated = invalidated = true; @@ -90408,14 +88153,14 @@ var ts; function getNodeModulesPackageName(compilerOptions, importingSourceFileName, nodeModulesFileName, host) { var info = getInfo(importingSourceFileName, host); var modulePaths = getAllModulePaths(importingSourceFileName, nodeModulesFileName, host); - return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions, true); }); + return ts.firstDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions, true); }); } moduleSpecifiers.getNodeModulesPackageName = getNodeModulesPackageName; function getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, preferences) { var info = getInfo(importingSourceFileName, host); var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host); - return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); }) || - getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences); + return ts.firstDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions); }) || + getLocalModuleSpecifier(toFileName, info, compilerOptions, preferences); } function getModuleSpecifiers(moduleSymbol, compilerOptions, importingSourceFile, host, userPreferences) { var ambient = tryGetModuleNameFromAmbientModule(moduleSymbol); @@ -90425,30 +88170,8 @@ var ts; var moduleSourceFile = ts.getSourceFileOfNode(moduleSymbol.valueDeclaration || ts.getNonAugmentationDeclaration(moduleSymbol)); var modulePaths = getAllModulePaths(importingSourceFile.path, moduleSourceFile.originalFileName, host); var preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile); - var importedFileIsInNodeModules = ts.some(modulePaths, function (p) { return p.isInNodeModules; }); - var nodeModulesSpecifiers; - var pathsSpecifiers; - var relativeSpecifiers; - for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) { - var modulePath = modulePaths_1[_i]; - var specifier = tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); - nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier); - if (specifier && modulePath.isRedirect) { - return nodeModulesSpecifiers; - } - if (!specifier && !modulePath.isRedirect) { - var local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, preferences); - if (ts.pathIsBareSpecifier(local)) { - pathsSpecifiers = ts.append(pathsSpecifiers, local); - } - else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) { - relativeSpecifiers = ts.append(relativeSpecifiers, local); - } - } - } - return (pathsSpecifiers === null || pathsSpecifiers === void 0 ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : - (nodeModulesSpecifiers === null || nodeModulesSpecifiers === void 0 ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : - ts.Debug.checkDefined(relativeSpecifiers); + var global = ts.mapDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions); }); + return global.length ? global : modulePaths.map(function (moduleFileName) { return getLocalModuleSpecifier(moduleFileName, info, compilerOptions, preferences); }); } moduleSpecifiers.getModuleSpecifiers = getModuleSpecifiers; function getInfo(importingSourceFileName, host) { @@ -90456,26 +88179,22 @@ var ts; var sourceDirectory = ts.getDirectoryPath(importingSourceFileName); return { getCanonicalFileName: getCanonicalFileName, sourceDirectory: sourceDirectory }; } - function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, host, _b) { + function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, _b) { var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory; var ending = _b.ending, relativePreference = _b.relativePreference; var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs; var relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) || removeExtensionAndIndexPostFix(ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions); - if (!baseUrl && !paths || relativePreference === 0) { + if (!baseUrl || relativePreference === 0) { return relativePath; } - var baseDirectory = ts.getPathsBasePath(compilerOptions, host) || baseUrl; - var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseDirectory, getCanonicalFileName); + var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); if (!relativeToBaseUrl) { return relativePath; } var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions); var fromPaths = paths && tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); - var nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths; - if (!nonRelative) { - return relativePath; - } + var nonRelative = fromPaths === undefined ? importRelativeToBaseUrl : fromPaths; if (relativePreference === 1) { return nonRelative; } @@ -90503,8 +88222,8 @@ var ts; var match = str.match(/\//g); return match ? match.length : 0; } - function comparePathsByRedirectAndNumberOfDirectorySeparators(a, b) { - return ts.compareBooleans(b.isRedirect, a.isRedirect) || ts.compareValues(numberOfDirectorySeparators(a.path), numberOfDirectorySeparators(b.path)); + function comparePathsByNumberOfDirectorySeparators(a, b) { + return ts.compareValues(numberOfDirectorySeparators(a), numberOfDirectorySeparators(b)); } function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) { var getCanonicalFileName = ts.hostGetCanonicalFileName(host); @@ -90514,36 +88233,34 @@ var ts; var importedFileNames = __spreadArrays((referenceRedirect ? [referenceRedirect] : ts.emptyArray), [importedFileName], redirects); var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); }); if (!preferSymlinks) { - var result_15 = ts.forEach(targets, function (p) { return cb(p, referenceRedirect === p); }); - if (result_15) - return result_15; + var result_13 = ts.forEach(targets, cb); + if (result_13) + return result_13; } var links = host.getSymlinkCache ? host.getSymlinkCache() : ts.discoverProbableSymlinks(host.getSourceFiles(), getCanonicalFileName, cwd); var symlinkedDirectories = links.getSymlinkedDirectories(); - var useCaseSensitiveFileNames = !host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames(); + var compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive; var result = symlinkedDirectories && ts.forEachEntry(symlinkedDirectories, function (resolved, path) { if (resolved === false) return undefined; if (ts.startsWithDirectory(importingFileName, resolved.realPath, getCanonicalFileName)) { return undefined; } - return ts.forEach(targets, function (target) { - if (!ts.containsPath(resolved.real, target, !useCaseSensitiveFileNames)) { - return; - } - var relative = ts.getRelativePathFromDirectory(resolved.real, target, getCanonicalFileName); - var option = ts.resolvePath(path, relative); - if (!host.fileExists || host.fileExists(option)) { - var result_16 = cb(option, target === referenceRedirect); - if (result_16) - return result_16; - } - }); + var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.real.length), resolved.real) === 0; }); + if (target === undefined) + return undefined; + var relative = ts.getRelativePathFromDirectory(resolved.real, target, getCanonicalFileName); + var option = ts.resolvePath(path, relative); + if (!host.fileExists || host.fileExists(option)) { + var result_14 = cb(option); + if (result_14) + return result_14; + } }); return result || - (preferSymlinks ? ts.forEach(targets, function (p) { return cb(p, p === referenceRedirect); }) : undefined); + (preferSymlinks ? ts.forEach(targets, cb) : undefined); } moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule; function getAllModulePaths(importingFileName, importedFileName, host) { @@ -90551,25 +88268,25 @@ var ts; var getCanonicalFileName = ts.hostGetCanonicalFileName(host); var allFileNames = new ts.Map(); var importedFileFromNodeModules = false; - forEachFileNameOfModule(importingFileName, importedFileName, host, true, function (path, isRedirect) { - var isInNodeModules = ts.pathContainsNodeModules(path); - allFileNames.set(path, { path: getCanonicalFileName(path), isRedirect: isRedirect, isInNodeModules: isInNodeModules }); - importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules; + forEachFileNameOfModule(importingFileName, importedFileName, host, true, function (path) { + allFileNames.set(path, getCanonicalFileName(path)); + importedFileFromNodeModules = importedFileFromNodeModules || ts.pathContainsNodeModules(path); }); var sortedPaths = []; - var _loop_24 = function (directory) { + var _loop_23 = function (directory) { var directoryStart = ts.ensureTrailingDirectorySeparator(directory); var pathsInDirectory; - allFileNames.forEach(function (_a, fileName) { - var path = _a.path, isRedirect = _a.isRedirect, isInNodeModules = _a.isInNodeModules; - if (ts.startsWith(path, directoryStart)) { - (pathsInDirectory || (pathsInDirectory = [])).push({ path: fileName, isRedirect: isRedirect, isInNodeModules: isInNodeModules }); + allFileNames.forEach(function (canonicalFileName, fileName) { + if (ts.startsWith(canonicalFileName, directoryStart)) { + if (!importedFileFromNodeModules || ts.pathContainsNodeModules(fileName)) { + (pathsInDirectory || (pathsInDirectory = [])).push(fileName); + } allFileNames.delete(fileName); } }); if (pathsInDirectory) { if (pathsInDirectory.length > 1) { - pathsInDirectory.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + pathsInDirectory.sort(comparePathsByNumberOfDirectorySeparators); } sortedPaths.push.apply(sortedPaths, pathsInDirectory); } @@ -90581,7 +88298,7 @@ var ts; }; var out_directory_1; for (var directory = ts.getDirectoryPath(ts.toPath(importingFileName, cwd, getCanonicalFileName)); allFileNames.size !== 0;) { - var state_8 = _loop_24(directory); + var state_8 = _loop_23(directory); directory = out_directory_1; if (state_8 === "break") break; @@ -90589,7 +88306,7 @@ var ts; if (allFileNames.size) { var remainingPaths = ts.arrayFrom(allFileNames.values()); if (remainingPaths.length > 1) - remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + remainingPaths.sort(comparePathsByNumberOfDirectorySeparators); sortedPaths.push.apply(sortedPaths, remainingPaths); } return sortedPaths; @@ -90634,40 +88351,34 @@ var ts; ? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions) : ts.removeFileExtension(relativePath); } - function tryGetModuleNameAsNodeModule(_a, _b, host, options, packageNameOnly) { - var path = _a.path, isRedirect = _a.isRedirect; - var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory; + function tryGetModuleNameAsNodeModule(moduleFileName, _a, host, options, packageNameOnly) { + var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory; if (!host.fileExists || !host.readFile) { return undefined; } - var parts = getNodeModulePathParts(path); + var parts = getNodeModulePathParts(moduleFileName); if (!parts) { return undefined; } - var moduleSpecifier = path; - var isPackageRootPath = false; + var moduleSpecifier = moduleFileName; if (!packageNameOnly) { var packageRootIndex = parts.packageRootIndex; var moduleFileNameForExtensionless = void 0; while (true) { - var _c = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _c.moduleFileToTry, packageRootPath = _c.packageRootPath; + var _b = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _b.moduleFileToTry, packageRootPath = _b.packageRootPath; if (packageRootPath) { moduleSpecifier = packageRootPath; - isPackageRootPath = true; break; } if (!moduleFileNameForExtensionless) moduleFileNameForExtensionless = moduleFileToTry; - packageRootIndex = path.indexOf(ts.directorySeparator, packageRootIndex + 1); + packageRootIndex = moduleFileName.indexOf(ts.directorySeparator, packageRootIndex + 1); if (packageRootIndex === -1) { moduleSpecifier = getExtensionlessFileName(moduleFileNameForExtensionless); break; } } } - if (isRedirect && !isPackageRootPath) { - return undefined; - } var globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); var pathToTopLevelNodeModules = getCanonicalFileName(moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex)); if (!(ts.startsWith(sourceDirectory, pathToTopLevelNodeModules) || globalTypingsCacheLocation && ts.startsWith(getCanonicalFileName(globalTypingsCacheLocation), pathToTopLevelNodeModules))) { @@ -90677,16 +88388,16 @@ var ts; var packageName = ts.getPackageNameFromTypesPackageName(nodeModulesDirectoryName); return ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs && packageName === nodeModulesDirectoryName ? undefined : packageName; function tryDirectoryWithPackageJson(packageRootIndex) { - var packageRootPath = path.substring(0, packageRootIndex); + var packageRootPath = moduleFileName.substring(0, packageRootIndex); var packageJsonPath = ts.combinePaths(packageRootPath, "package.json"); - var moduleFileToTry = path; + var moduleFileToTry = moduleFileName; if (host.fileExists(packageJsonPath)) { var packageJsonContent = JSON.parse(host.readFile(packageJsonPath)); var versionPaths = packageJsonContent.typesVersions ? ts.getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions) : undefined; if (versionPaths) { - var subModuleName = path.slice(packageRootPath.length + 1); + var subModuleName = moduleFileName.slice(packageRootPath.length + 1); var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(subModuleName), removeExtensionAndIndexPostFix(subModuleName, 0, options), versionPaths.paths); if (fromPaths !== undefined) { moduleFileToTry = ts.combinePaths(packageRootPath, fromPaths); @@ -91048,7 +88759,7 @@ var ts; ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost; function setGetSourceFileAsHashVersioned(compilerHost, host) { var originalGetSourceFile = compilerHost.getSourceFile; - var computeHash = ts.maybeBind(host, host.createHash) || ts.generateDjb2Hash; + var computeHash = host.createHash || ts.generateDjb2Hash; compilerHost.getSourceFile = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -91056,7 +88767,7 @@ var ts; } var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args)); if (result) { - result.version = computeHash(result.text); + result.version = computeHash.call(host, result.text); } return result; }; @@ -91530,7 +89241,7 @@ var ts; } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); - var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions); + var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost); if (ts.updateErrorForNoInputFiles(result, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) { hasChangedConfigFileParsingErrors = true; } @@ -91609,7 +89320,6 @@ var ts; fileOrDirectoryPath: fileOrDirectoryPath, configFileName: configFileName, configFileSpecs: configFileSpecs, - extraFileExtensions: extraFileExtensions, options: compilerOptions, program: getCurrentBuilderProgram(), currentDirectory: currentDirectory, @@ -93325,7 +91035,6 @@ var ts; updateSolutionBuilderHost(sys, cb, buildHost); var builder = ts.createSolutionBuilder(buildHost, projects, buildOptions); var exitStatus = buildOptions.clean ? builder.clean() : builder.build(); - ts.tracing.dumpLegend(); return sys.exit(exitStatus); } function createReportErrorSummary(sys, options) { @@ -93339,7 +91048,7 @@ var ts; var currentDirectory = host.getCurrentDirectory(); var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, currentDirectory, getCanonicalFileName); }); - enableStatisticsAndTracing(sys, options, false); + enableStatistics(sys, options); var programOptions = { rootNames: fileNames, options: options, @@ -93355,7 +91064,7 @@ var ts; } function performIncrementalCompilation(sys, cb, reportDiagnostic, config) { var options = config.options, fileNames = config.fileNames, projectReferences = config.projectReferences; - enableStatisticsAndTracing(sys, options, false); + enableStatistics(sys, options); var host = ts.createIncrementalCompilerHost(options, sys); var exitStatus = ts.performIncrementalCompilation({ host: host, @@ -93386,7 +91095,7 @@ var ts; host.createProgram = function (rootNames, options, host, oldProgram, configFileParsingDiagnostics, projectReferences) { ts.Debug.assert(rootNames !== undefined || (options === undefined && !!oldProgram)); if (options !== undefined) { - enableStatisticsAndTracing(sys, options, true); + enableStatistics(sys, options); } return compileUsingBuilder(rootNames, options, host, oldProgram, configFileParsingDiagnostics, projectReferences); }; @@ -93431,23 +91140,14 @@ var ts; function canReportDiagnostics(system, compilerOptions) { return system === ts.sys && (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics); } - function canTrace(system, compilerOptions) { - return system === ts.sys && compilerOptions.generateTrace; - } - function enableStatisticsAndTracing(system, compilerOptions, isBuildMode) { - if (canReportDiagnostics(system, compilerOptions)) { + function enableStatistics(sys, compilerOptions) { + if (canReportDiagnostics(sys, compilerOptions)) { ts.performance.enable(); } - if (canTrace(system, compilerOptions)) { - ts.tracing.startTracing(compilerOptions.configFilePath, compilerOptions.generateTrace, isBuildMode); - } } function reportStatistics(sys, program) { - var compilerOptions = program.getCompilerOptions(); - if (canTrace(sys, compilerOptions)) { - ts.tracing.stopTracing(program.getTypeCatalog()); - } var statistics; + var compilerOptions = program.getCompilerOptions(); if (canReportDiagnostics(sys, compilerOptions)) { statistics = []; var memoryUsed = sys.getMemoryUsage ? sys.getMemoryUsage() : -1; @@ -93461,22 +91161,19 @@ var ts; if (memoryUsed >= 0) { reportStatisticalValue("Memory used", Math.round(memoryUsed / 1000) + "K"); } - var isPerformanceEnabled = ts.performance.isEnabled(); - var programTime = isPerformanceEnabled ? ts.performance.getDuration("Program") : 0; - var bindTime = isPerformanceEnabled ? ts.performance.getDuration("Bind") : 0; - var checkTime = isPerformanceEnabled ? ts.performance.getDuration("Check") : 0; - var emitTime = isPerformanceEnabled ? ts.performance.getDuration("Emit") : 0; + var programTime = ts.performance.getDuration("Program"); + var bindTime = ts.performance.getDuration("Bind"); + var checkTime = ts.performance.getDuration("Check"); + var emitTime = ts.performance.getDuration("Emit"); if (compilerOptions.extendedDiagnostics) { var caches = program.getRelationCacheSizes(); reportCountStatistic("Assignability cache size", caches.assignable); reportCountStatistic("Identity cache size", caches.identity); reportCountStatistic("Subtype cache size", caches.subtype); reportCountStatistic("Strict subtype cache size", caches.strictSubtype); - if (isPerformanceEnabled) { - ts.performance.forEachMeasure(function (name, duration) { return reportTimeStatistic(name + " time", duration); }); - } + ts.performance.forEachMeasure(function (name, duration) { return reportTimeStatistic(name + " time", duration); }); } - else if (isPerformanceEnabled) { + else { reportTimeStatistic("I/O read", ts.performance.getDuration("I/O Read")); reportTimeStatistic("I/O write", ts.performance.getDuration("I/O Write")); reportTimeStatistic("Parse time", programTime); @@ -93484,16 +91181,9 @@ var ts; reportTimeStatistic("Check time", checkTime); reportTimeStatistic("Emit time", emitTime); } - if (isPerformanceEnabled) { - reportTimeStatistic("Total time", programTime + bindTime + checkTime + emitTime); - } + reportTimeStatistic("Total time", programTime + bindTime + checkTime + emitTime); reportStatistics(); - if (!isPerformanceEnabled) { - sys.write(ts.Diagnostics.Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found.message + "\n"); - } - else { - ts.performance.disable(); - } + ts.performance.disable(); } function reportStatistics() { var nameSize = 0; diff --git a/node_modules/typescript/lib/tsserver.js b/node_modules/typescript/lib/tsserver.js index d9208c6..2d18544 100644 --- a/node_modules/typescript/lib/tsserver.js +++ b/node_modules/typescript/lib/tsserver.js @@ -92,9 +92,9 @@ var ts; (function (ts) { // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configurePrerelease` too. - ts.versionMajorMinor = "4.1"; + ts.versionMajorMinor = "4.0"; /** The version of the TypeScript compiler release */ - ts.version = "4.1.3"; + ts.version = "4.0.2"; /* @internal */ var Comparison; (function (Comparison) { @@ -1187,7 +1187,7 @@ var ts; var high = array.length - 1; while (low <= high) { var middle = low + ((high - low) >> 1); - var midKey = keySelector(array[middle], middle); + var midKey = keySelector(array[middle]); switch (keyComparer(midKey, key)) { case -1 /* LessThan */: low = middle + 1; @@ -1282,14 +1282,15 @@ var ts; return values; } ts.getOwnValues = getOwnValues; - var _entries = Object.entries || (function (obj) { + var _entries = Object.entries ? Object.entries : function (obj) { var keys = getOwnKeys(obj); var result = Array(keys.length); - for (var i = 0; i < keys.length; i++) { - result[i] = [keys[i], obj[keys[i]]]; + for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { + var key = keys_1[_i]; + result.push([key, obj[key]]); } return result; - }); + }; function getEntries(obj) { return obj ? _entries(obj) : []; } @@ -2161,39 +2162,20 @@ var ts; } } } - /** - * Returns string left-padded with spaces or zeros until it reaches the given length. - * - * @param s String to pad. - * @param length Final padded length. If less than or equal to 's.length', returns 's' unchanged. - * @param padString Character to use as padding (default " "). - */ - function padLeft(s, length, padString) { - if (padString === void 0) { padString = " "; } - return length <= s.length ? s : padString.repeat(length - s.length) + s; + function padLeft(s, length) { + while (s.length < length) { + s = " " + s; + } + return s; } ts.padLeft = padLeft; - /** - * Returns string right-padded with spaces until it reaches the given length. - * - * @param s String to pad. - * @param length Final padded length. If less than or equal to 's.length', returns 's' unchanged. - * @param padString Character to use as padding (default " "). - */ - function padRight(s, length, padString) { - if (padString === void 0) { padString = " "; } - return length <= s.length ? s : s + padString.repeat(length - s.length); + function padRight(s, length) { + while (s.length < length) { + s = s + " "; + } + return s; } ts.padRight = padRight; - function takeWhile(array, predicate) { - var len = array.length; - var index = 0; - while (index < len && predicate(array[index])) { - index++; - } - return array.slice(0, index); - } - ts.takeWhile = takeWhile; })(ts || (ts = {})); /* @internal */ var ts; @@ -2508,10 +2490,6 @@ var ts; return formatEnum(flags, ts.ObjectFlags, /*isFlags*/ true); } Debug.formatObjectFlags = formatObjectFlags; - function formatFlowFlags(flags) { - return formatEnum(flags, ts.FlowFlags, /*isFlags*/ true); - } - Debug.formatFlowFlags = formatFlowFlags; var isDebugInfoEnabled = false; var extendedDebugModule; function extendedDebug() { @@ -2529,167 +2507,31 @@ var ts; return extendedDebug().formatControlFlowGraph(flowNode); } Debug.formatControlFlowGraph = formatControlFlowGraph; - var flowNodeProto; - function attachFlowNodeDebugInfoWorker(flowNode) { - if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line no-in-operator - Object.defineProperties(flowNode, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var flowHeader = this.flags & 2 /* Start */ ? "FlowStart" : - this.flags & 4 /* BranchLabel */ ? "FlowBranchLabel" : - this.flags & 8 /* LoopLabel */ ? "FlowLoopLabel" : - this.flags & 16 /* Assignment */ ? "FlowAssignment" : - this.flags & 32 /* TrueCondition */ ? "FlowTrueCondition" : - this.flags & 64 /* FalseCondition */ ? "FlowFalseCondition" : - this.flags & 128 /* SwitchClause */ ? "FlowSwitchClause" : - this.flags & 256 /* ArrayMutation */ ? "FlowArrayMutation" : - this.flags & 512 /* Call */ ? "FlowCall" : - this.flags & 1024 /* ReduceLabel */ ? "FlowReduceLabel" : - this.flags & 1 /* Unreachable */ ? "FlowUnreachable" : - "UnknownFlow"; - var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1); - return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : ""); - } - }, - __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } }, - __debugToString: { value: function () { return formatControlFlowGraph(this); } } - }); - } - } function attachFlowNodeDebugInfo(flowNode) { if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - // if we're in es2015, attach the method to a shared prototype for `FlowNode` - // so the method doesn't show up in the watch window. - if (!flowNodeProto) { - flowNodeProto = Object.create(Object.prototype); - attachFlowNodeDebugInfoWorker(flowNodeProto); - } - Object.setPrototypeOf(flowNode, flowNodeProto); - } - else { - // not running in an es2015 environment, attach the method directly. - attachFlowNodeDebugInfoWorker(flowNode); + if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line no-in-operator + Object.defineProperties(flowNode, { + __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } }, + __debugToString: { value: function () { return formatControlFlowGraph(this); } } + }); } } } Debug.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo; - var nodeArrayProto; - function attachNodeArrayDebugInfoWorker(array) { - if (!("__tsDebuggerDisplay" in array)) { // eslint-disable-line no-in-operator - Object.defineProperties(array, { - __tsDebuggerDisplay: { - value: function (defaultValue) { - // An `Array` with extra properties is rendered as `[A, B, prop1: 1, prop2: 2]`. Most of - // these aren't immediately useful so we trim off the `prop1: ..., prop2: ...` part from the - // formatted string. - defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]"); - return "NodeArray " + defaultValue; - } - } - }); - } - } - function attachNodeArrayDebugInfo(array) { - if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - // if we're in es2015, attach the method to a shared prototype for `NodeArray` - // so the method doesn't show up in the watch window. - if (!nodeArrayProto) { - nodeArrayProto = Object.create(Array.prototype); - attachNodeArrayDebugInfoWorker(nodeArrayProto); - } - Object.setPrototypeOf(array, nodeArrayProto); - } - else { - // not running in an es2015 environment, attach the method directly. - attachNodeArrayDebugInfoWorker(array); - } - } - } - Debug.attachNodeArrayDebugInfo = attachNodeArrayDebugInfo; /** * Injects debug information into frequently used types. */ function enableDebugInfo() { if (isDebugInfoEnabled) return; - // avoid recomputing - var weakTypeTextMap; - var weakNodeTextMap; - function getWeakTypeTextMap() { - if (weakTypeTextMap === undefined) { - if (typeof WeakMap === "function") - weakTypeTextMap = new WeakMap(); - } - return weakTypeTextMap; - } - function getWeakNodeTextMap() { - if (weakNodeTextMap === undefined) { - if (typeof WeakMap === "function") - weakNodeTextMap = new WeakMap(); - } - return weakNodeTextMap; - } // Add additional properties in debug mode to assist with debugging. Object.defineProperties(ts.objectAllocator.getSymbolConstructor().prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" : - "Symbol"; - var remainingSymbolFlags = this.flags & ~33554432 /* Transient */; - return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : ""); - } - }, __debugFlags: { get: function () { return formatSymbolFlags(this.flags); } } }); Object.defineProperties(ts.objectAllocator.getTypeConstructor().prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" : - this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType " + JSON.stringify(this.value) : - this.flags & 2048 /* BigIntLiteral */ ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" : - this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : - this.flags & 32 /* Enum */ ? "EnumType" : - this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType " + this.intrinsicName : - this.flags & 1048576 /* Union */ ? "UnionType" : - this.flags & 2097152 /* Intersection */ ? "IntersectionType" : - this.flags & 4194304 /* Index */ ? "IndexType" : - this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : - this.flags & 16777216 /* Conditional */ ? "ConditionalType" : - this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : - this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : - this.flags & 524288 /* Object */ ? - this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : - this.objectFlags & 4 /* Reference */ ? "TypeReference" : - this.objectFlags & 8 /* Tuple */ ? "TupleType" : - this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : - this.objectFlags & 32 /* Mapped */ ? "MappedType" : - this.objectFlags & 2048 /* ReverseMapped */ ? "ReverseMappedType" : - this.objectFlags & 256 /* EvolvingArray */ ? "EvolvingArrayType" : - "ObjectType" : - "Type"; - var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~2367 /* ObjectTypeKindMask */ : 0; - return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : ""); - } - }, __debugFlags: { get: function () { return formatTypeFlags(this.flags); } }, __debugObjectFlags: { get: function () { return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : ""; } }, - __debugTypeToString: { - value: function () { - // avoid recomputing - var map = getWeakTypeTextMap(); - var text = map === null || map === void 0 ? void 0 : map.get(this); - if (text === undefined) { - text = this.checker.typeToString(this); - map === null || map === void 0 ? void 0 : map.set(this, text); - } - return text; - } - }, + __debugTypeToString: { value: function () { return this.checker.typeToString(this); } }, }); var nodeConstructors = [ ts.objectAllocator.getNodeConstructor(), @@ -2701,49 +2543,6 @@ var ts; var ctor = nodeConstructors_1[_i]; if (!ctor.prototype.hasOwnProperty("__debugKind")) { Object.defineProperties(ctor.prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" : - ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" : - ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" : - ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") : - ts.isNumericLiteral(this) ? "NumericLiteral " + this.text : - ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" : - ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" : - ts.isParameter(this) ? "ParameterDeclaration" : - ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" : - ts.isGetAccessorDeclaration(this) ? "GetAccessorDeclaration" : - ts.isSetAccessorDeclaration(this) ? "SetAccessorDeclaration" : - ts.isCallSignatureDeclaration(this) ? "CallSignatureDeclaration" : - ts.isConstructSignatureDeclaration(this) ? "ConstructSignatureDeclaration" : - ts.isIndexSignatureDeclaration(this) ? "IndexSignatureDeclaration" : - ts.isTypePredicateNode(this) ? "TypePredicateNode" : - ts.isTypeReferenceNode(this) ? "TypeReferenceNode" : - ts.isFunctionTypeNode(this) ? "FunctionTypeNode" : - ts.isConstructorTypeNode(this) ? "ConstructorTypeNode" : - ts.isTypeQueryNode(this) ? "TypeQueryNode" : - ts.isTypeLiteralNode(this) ? "TypeLiteralNode" : - ts.isArrayTypeNode(this) ? "ArrayTypeNode" : - ts.isTupleTypeNode(this) ? "TupleTypeNode" : - ts.isOptionalTypeNode(this) ? "OptionalTypeNode" : - ts.isRestTypeNode(this) ? "RestTypeNode" : - ts.isUnionTypeNode(this) ? "UnionTypeNode" : - ts.isIntersectionTypeNode(this) ? "IntersectionTypeNode" : - ts.isConditionalTypeNode(this) ? "ConditionalTypeNode" : - ts.isInferTypeNode(this) ? "InferTypeNode" : - ts.isParenthesizedTypeNode(this) ? "ParenthesizedTypeNode" : - ts.isThisTypeNode(this) ? "ThisTypeNode" : - ts.isTypeOperatorNode(this) ? "TypeOperatorNode" : - ts.isIndexedAccessTypeNode(this) ? "IndexedAccessTypeNode" : - ts.isMappedTypeNode(this) ? "MappedTypeNode" : - ts.isLiteralTypeNode(this) ? "LiteralTypeNode" : - ts.isNamedTupleMember(this) ? "NamedTupleMember" : - ts.isImportTypeNode(this) ? "ImportTypeNode" : - formatSyntaxKind(this.kind); - return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : ""); - } - }, __debugKind: { get: function () { return formatSyntaxKind(this.kind); } }, __debugNodeFlags: { get: function () { return formatNodeFlags(this.flags); } }, __debugModifierFlags: { get: function () { return formatModifierFlags(ts.getEffectiveModifierFlagsNoCache(this)); } }, @@ -2754,16 +2553,9 @@ var ts; value: function (includeTrivia) { if (ts.nodeIsSynthesized(this)) return ""; - // avoid recomputing - var map = getWeakNodeTextMap(); - var text = map === null || map === void 0 ? void 0 : map.get(this); - if (text === undefined) { - var parseNode = ts.getParseTreeNode(this); - var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); - text = sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; - map === null || map === void 0 ? void 0 : map.set(this, text); - } - return text; + var parseNode = ts.getParseTreeNode(this); + var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); + return sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; } } }); @@ -2835,6 +2627,168 @@ var ts; Debug.deprecate = deprecate; })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); +/*@internal*/ +var ts; +(function (ts) { + /** Gets a timestamp with (at least) ms resolution */ + ts.timestamp = typeof performance !== "undefined" && performance.now ? function () { return performance.now(); } : Date.now ? Date.now : function () { return +(new Date()); }; +})(ts || (ts = {})); +/*@internal*/ +/** Performance measurements for the compiler. */ +var ts; +(function (ts) { + var performance; + (function (performance) { + // NOTE: cannot use ts.noop as core.ts loads after this + var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : function () { }; + var enabled = false; + var profilerStart = 0; + var counts; + var marks; + var measures; + function createTimerIf(condition, measureName, startMarkName, endMarkName) { + return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer; + } + performance.createTimerIf = createTimerIf; + function createTimer(measureName, startMarkName, endMarkName) { + var enterCount = 0; + return { + enter: enter, + exit: exit + }; + function enter() { + if (++enterCount === 1) { + mark(startMarkName); + } + } + function exit() { + if (--enterCount === 0) { + mark(endMarkName); + measure(measureName, startMarkName, endMarkName); + } + else if (enterCount < 0) { + ts.Debug.fail("enter/exit count does not match."); + } + } + } + performance.createTimer = createTimer; + performance.nullTimer = { enter: ts.noop, exit: ts.noop }; + /** + * Marks a performance event. + * + * @param markName The name of the mark. + */ + function mark(markName) { + if (enabled) { + marks.set(markName, ts.timestamp()); + counts.set(markName, (counts.get(markName) || 0) + 1); + profilerEvent(markName); + } + } + performance.mark = mark; + /** + * Adds a performance measurement with the specified name. + * + * @param measureName The name of the performance measurement. + * @param startMarkName The name of the starting mark. If not supplied, the point at which the + * profiler was enabled is used. + * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is + * used. + */ + function measure(measureName, startMarkName, endMarkName) { + if (enabled) { + var end = endMarkName && marks.get(endMarkName) || ts.timestamp(); + var start = startMarkName && marks.get(startMarkName) || profilerStart; + measures.set(measureName, (measures.get(measureName) || 0) + (end - start)); + } + } + performance.measure = measure; + /** + * Gets the number of times a marker was encountered. + * + * @param markName The name of the mark. + */ + function getCount(markName) { + return counts && counts.get(markName) || 0; + } + performance.getCount = getCount; + /** + * Gets the total duration of all measurements with the supplied name. + * + * @param measureName The name of the measure whose durations should be accumulated. + */ + function getDuration(measureName) { + return measures && measures.get(measureName) || 0; + } + performance.getDuration = getDuration; + /** + * Iterate over each measure, performing some action + * + * @param cb The action to perform for each measure + */ + function forEachMeasure(cb) { + measures.forEach(function (measure, key) { + cb(key, measure); + }); + } + performance.forEachMeasure = forEachMeasure; + /** Enables (and resets) performance measurements for the compiler. */ + function enable() { + counts = new ts.Map(); + marks = new ts.Map(); + measures = new ts.Map(); + enabled = true; + profilerStart = ts.timestamp(); + } + performance.enable = enable; + /** Disables performance measurements for the compiler. */ + function disable() { + enabled = false; + } + performance.disable = disable; + })(performance = ts.performance || (ts.performance = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var _a; + var nullLogger = { + logEvent: ts.noop, + logErrEvent: ts.noop, + logPerfEvent: ts.noop, + logInfoEvent: ts.noop, + logStartCommand: ts.noop, + logStopCommand: ts.noop, + logStartUpdateProgram: ts.noop, + logStopUpdateProgram: ts.noop, + logStartUpdateGraph: ts.noop, + logStopUpdateGraph: ts.noop, + logStartResolveModule: ts.noop, + logStopResolveModule: ts.noop, + logStartParseSourceFile: ts.noop, + logStopParseSourceFile: ts.noop, + logStartReadFile: ts.noop, + logStopReadFile: ts.noop, + logStartBindFile: ts.noop, + logStopBindFile: ts.noop, + logStartScheduledOperation: ts.noop, + logStopScheduledOperation: ts.noop, + }; + // Load optional module to enable Event Tracing for Windows + // See https://github.com/microsoft/typescript-etw for more information + var etwModule; + try { + var etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) !== null && _a !== void 0 ? _a : "./node_modules/@microsoft/typescript-etw"; + // require() will throw an exception if the module is not found + // It may also return undefined if not installed properly + etwModule = require(etwModulePath); + } + catch (e) { + etwModule = undefined; + } + /** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */ + ts.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; +})(ts || (ts = {})); /* @internal */ var ts; (function (ts) { @@ -2911,7 +2865,7 @@ var ts; return ts.compareValues(this.major, other.major) || ts.compareValues(this.minor, other.minor) || ts.compareValues(this.patch, other.patch) - || comparePrereleaseIdentifiers(this.prerelease, other.prerelease); + || comparePrerelaseIdentifiers(this.prerelease, other.prerelease); }; Version.prototype.increment = function (field) { switch (field) { @@ -2950,7 +2904,7 @@ var ts; build: build }; } - function comparePrereleaseIdentifiers(left, right) { + function comparePrerelaseIdentifiers(left, right) { // https://semver.org/#spec-item-11 // > When major, minor, and patch are equal, a pre-release version has lower precedence // > than a normal version. @@ -3195,485 +3149,6 @@ var ts; return "" + comparator.operator + comparator.operand; } })(ts || (ts = {})); -/*@internal*/ -var ts; -(function (ts) { - // The following definitions provide the minimum compatible support for the Web Performance User Timings API - // between browsers and NodeJS: - // eslint-disable-next-line @typescript-eslint/naming-convention - function hasRequiredAPI(performance, PerformanceObserver) { - return typeof performance === "object" && - typeof performance.timeOrigin === "number" && - typeof performance.mark === "function" && - typeof performance.measure === "function" && - typeof performance.now === "function" && - typeof PerformanceObserver === "function"; - } - function tryGetWebPerformanceHooks() { - if (typeof performance === "object" && - typeof PerformanceObserver === "function" && - hasRequiredAPI(performance, PerformanceObserver)) { - return { - performance: performance, - PerformanceObserver: PerformanceObserver - }; - } - } - function tryGetNodePerformanceHooks() { - if (typeof module === "object" && typeof require === "function") { - try { - var _a = require("perf_hooks"), performance_1 = _a.performance, PerformanceObserver_1 = _a.PerformanceObserver; - if (hasRequiredAPI(performance_1, PerformanceObserver_1)) { - // There is a bug in Node's performance.measure prior to 12.16.3/13.13.0 that does not - // match the Web Performance API specification. Node's implementation did not allow - // optional `start` and `end` arguments for `performance.measure`. - // See https://github.com/nodejs/node/pull/32651 for more information. - var version_1 = new ts.Version(process.versions.node); - var range = new ts.VersionRange("<12.16.3 || 13 <13.13"); - if (range.test(version_1)) { - return { - performance: { - get timeOrigin() { return performance_1.timeOrigin; }, - now: function () { return performance_1.now(); }, - mark: function (name) { return performance_1.mark(name); }, - measure: function (name, start, end) { - if (start === void 0) { start = "nodeStart"; } - if (end === undefined) { - end = "__performance.measure-fix__"; - performance_1.mark(end); - } - performance_1.measure(name, start, end); - if (end === "__performance.measure-fix__") { - performance_1.clearMarks("__performance.measure-fix__"); - } - } - }, - PerformanceObserver: PerformanceObserver_1 - }; - } - return { - performance: performance_1, - PerformanceObserver: PerformanceObserver_1 - }; - } - } - catch (_b) { - // ignore errors - } - } - } - // Unlike with the native Map/Set 'tryGet' functions in corePublic.ts, we eagerly evaluate these - // since we will need them for `timestamp`, below. - var nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks(); - var nativePerformance = nativePerformanceHooks === null || nativePerformanceHooks === void 0 ? void 0 : nativePerformanceHooks.performance; - function tryGetNativePerformanceHooks() { - return nativePerformanceHooks; - } - ts.tryGetNativePerformanceHooks = tryGetNativePerformanceHooks; - /** Gets a timestamp with (at least) ms resolution */ - ts.timestamp = nativePerformance ? function () { return nativePerformance.now(); } : - Date.now ? Date.now : - function () { return +(new Date()); }; -})(ts || (ts = {})); -/*@internal*/ -/** Performance measurements for the compiler. */ -var ts; -(function (ts) { - var performance; - (function (performance) { - var perfHooks; - var perfObserver; - // when set, indicates the implementation of `Performance` to use for user timing. - // when unset, indicates user timing is unavailable or disabled. - var performanceImpl; - function createTimerIf(condition, measureName, startMarkName, endMarkName) { - return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer; - } - performance.createTimerIf = createTimerIf; - function createTimer(measureName, startMarkName, endMarkName) { - var enterCount = 0; - return { - enter: enter, - exit: exit - }; - function enter() { - if (++enterCount === 1) { - mark(startMarkName); - } - } - function exit() { - if (--enterCount === 0) { - mark(endMarkName); - measure(measureName, startMarkName, endMarkName); - } - else if (enterCount < 0) { - ts.Debug.fail("enter/exit count does not match."); - } - } - } - performance.createTimer = createTimer; - performance.nullTimer = { enter: ts.noop, exit: ts.noop }; - var counts = new ts.Map(); - var durations = new ts.Map(); - /** - * Marks a performance event. - * - * @param markName The name of the mark. - */ - function mark(markName) { - performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.mark(markName); - } - performance.mark = mark; - /** - * Adds a performance measurement with the specified name. - * - * @param measureName The name of the performance measurement. - * @param startMarkName The name of the starting mark. If not supplied, the point at which the - * profiler was enabled is used. - * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is - * used. - */ - function measure(measureName, startMarkName, endMarkName) { - performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName); - } - performance.measure = measure; - /** - * Gets the number of times a marker was encountered. - * - * @param markName The name of the mark. - */ - function getCount(markName) { - return counts.get(markName) || 0; - } - performance.getCount = getCount; - /** - * Gets the total duration of all measurements with the supplied name. - * - * @param measureName The name of the measure whose durations should be accumulated. - */ - function getDuration(measureName) { - return durations.get(measureName) || 0; - } - performance.getDuration = getDuration; - /** - * Iterate over each measure, performing some action - * - * @param cb The action to perform for each measure - */ - function forEachMeasure(cb) { - durations.forEach(function (duration, measureName) { return cb(measureName, duration); }); - } - performance.forEachMeasure = forEachMeasure; - /** - * Indicates whether the performance API is enabled. - */ - function isEnabled() { - return !!performanceImpl; - } - performance.isEnabled = isEnabled; - /** Enables (and resets) performance measurements for the compiler. */ - function enable() { - if (!performanceImpl) { - perfHooks || (perfHooks = ts.tryGetNativePerformanceHooks()); - if (!perfHooks) - return false; - perfObserver || (perfObserver = new perfHooks.PerformanceObserver(updateStatisticsFromList)); - perfObserver.observe({ entryTypes: ["mark", "measure"] }); - performanceImpl = perfHooks.performance; - } - return true; - } - performance.enable = enable; - /** Disables performance measurements for the compiler. */ - function disable() { - perfObserver === null || perfObserver === void 0 ? void 0 : perfObserver.disconnect(); - performanceImpl = undefined; - counts.clear(); - durations.clear(); - } - performance.disable = disable; - function updateStatisticsFromList(list) { - for (var _i = 0, _a = list.getEntriesByType("mark"); _i < _a.length; _i++) { - var mark_1 = _a[_i]; - counts.set(mark_1.name, (counts.get(mark_1.name) || 0) + 1); - } - for (var _b = 0, _c = list.getEntriesByType("measure"); _b < _c.length; _b++) { - var measure_1 = _c[_b]; - durations.set(measure_1.name, (durations.get(measure_1.name) || 0) + measure_1.duration); - } - } - })(performance = ts.performance || (ts.performance = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var _a; - var nullLogger = { - logEvent: ts.noop, - logErrEvent: ts.noop, - logPerfEvent: ts.noop, - logInfoEvent: ts.noop, - logStartCommand: ts.noop, - logStopCommand: ts.noop, - logStartUpdateProgram: ts.noop, - logStopUpdateProgram: ts.noop, - logStartUpdateGraph: ts.noop, - logStopUpdateGraph: ts.noop, - logStartResolveModule: ts.noop, - logStopResolveModule: ts.noop, - logStartParseSourceFile: ts.noop, - logStopParseSourceFile: ts.noop, - logStartReadFile: ts.noop, - logStopReadFile: ts.noop, - logStartBindFile: ts.noop, - logStopBindFile: ts.noop, - logStartScheduledOperation: ts.noop, - logStopScheduledOperation: ts.noop, - }; - // Load optional module to enable Event Tracing for Windows - // See https://github.com/microsoft/typescript-etw for more information - var etwModule; - try { - var etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) !== null && _a !== void 0 ? _a : "./node_modules/@microsoft/typescript-etw"; - // require() will throw an exception if the module is not found - // It may also return undefined if not installed properly - etwModule = require(etwModulePath); - } - catch (e) { - etwModule = undefined; - } - /** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */ - ts.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; -})(ts || (ts = {})); -/*@internal*/ -/** Tracing events for the compiler. */ -var ts; -(function (ts) { - var tracing; - (function (tracing) { - var fs; - var traceCount = 0; - var traceFd; - var legendPath; - var legend = []; - /** Starts tracing for the given project (unless the `fs` module is unavailable). */ - function startTracing(configFilePath, traceDir, isBuildMode) { - ts.Debug.assert(!traceFd, "Tracing already started"); - if (fs === undefined) { - try { - fs = require("fs"); - } - catch (_a) { - fs = false; - } - } - if (!fs) { - return; - } - if (legendPath === undefined) { - legendPath = ts.combinePaths(traceDir, "legend.json"); - } - // Note that writing will fail later on if it exists and is not a directory - if (!fs.existsSync(traceDir)) { - fs.mkdirSync(traceDir, { recursive: true }); - } - var countPart = isBuildMode ? "." + ++traceCount : ""; - var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json"); - var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json"); - legend.push({ - configFilePath: configFilePath, - tracePath: tracePath, - typesPath: typesPath, - }); - traceFd = fs.openSync(tracePath, "w"); - // Start with a prefix that contains some metadata that the devtools profiler expects (also avoids a warning on import) - var meta = { cat: "__metadata", ph: "M", ts: 1000 * ts.timestamp(), pid: 1, tid: 1 }; - fs.writeSync(traceFd, "[\n" - + [__assign({ name: "process_name", args: { name: "tsc" } }, meta), __assign({ name: "thread_name", args: { name: "Main" } }, meta), __assign(__assign({ name: "TracingStartedInBrowser" }, meta), { cat: "disabled-by-default-devtools.timeline" })] - .map(function (v) { return JSON.stringify(v); }).join(",\n")); - } - tracing.startTracing = startTracing; - /** Stops tracing for the in-progress project and dumps the type catalog (unless the `fs` module is unavailable). */ - function stopTracing(typeCatalog) { - if (!traceFd) { - ts.Debug.assert(!fs, "Tracing is not in progress"); - return; - } - ts.Debug.assert(fs); - fs.writeSync(traceFd, "\n]\n"); - fs.closeSync(traceFd); - traceFd = undefined; - if (typeCatalog) { - dumpTypes(typeCatalog); - } - else { - // We pre-computed this path for convenience, but clear it - // now that the file won't be created. - legend[legend.length - 1].typesPath = undefined; - } - } - tracing.stopTracing = stopTracing; - function isTracing() { - return !!traceFd; - } - tracing.isTracing = isTracing; - var Phase; - (function (Phase) { - Phase["Parse"] = "parse"; - Phase["Program"] = "program"; - Phase["Bind"] = "bind"; - Phase["Check"] = "check"; - Phase["Emit"] = "emit"; - })(Phase = tracing.Phase || (tracing.Phase = {})); - /** Note: `push`/`pop` should be used by default. - * `begin`/`end` are for special cases where we need the data point even if the event never - * terminates (typically for reducing a scenario too big to trace to one that can be completed). - * In the future we might implement an exit handler to dump unfinished events which would - * deprecate these operations. - */ - function begin(phase, name, args) { - if (!traceFd) - return; - writeEvent("B", phase, name, args); - } - tracing.begin = begin; - function end(phase, name, args) { - if (!traceFd) - return; - writeEvent("E", phase, name, args); - } - tracing.end = end; - function instant(phase, name, args) { - if (!traceFd) - return; - writeEvent("I", phase, name, args, "\"s\":\"g\""); - } - tracing.instant = instant; - // Used for "Complete" (ph:"X") events - var completeEvents = []; - function push(phase, name, args) { - if (!traceFd) - return; - completeEvents.push({ phase: phase, name: name, args: args, time: 1000 * ts.timestamp() }); - } - tracing.push = push; - function pop() { - if (!traceFd) - return; - ts.Debug.assert(completeEvents.length > 0); - var _a = completeEvents.pop(), phase = _a.phase, name = _a.name, args = _a.args, time = _a.time; - var dur = 1000 * ts.timestamp() - time; - writeEvent("X", phase, name, args, "\"dur\":" + dur, time); - } - tracing.pop = pop; - function writeEvent(eventType, phase, name, args, extras, time) { - if (time === void 0) { time = 1000 * ts.timestamp(); } - ts.Debug.assert(traceFd); - ts.Debug.assert(fs); - ts.performance.mark("beginTracing"); - fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\""); - if (extras) - fs.writeSync(traceFd, "," + extras); - if (args) - fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args)); - fs.writeSync(traceFd, "}"); - ts.performance.mark("endTracing"); - ts.performance.measure("Tracing", "beginTracing", "endTracing"); - } - function indexFromOne(lc) { - return { - line: lc.line + 1, - character: lc.character + 1, - }; - } - function dumpTypes(types) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r; - ts.Debug.assert(fs); - ts.performance.mark("beginDumpTypes"); - var typesPath = legend[legend.length - 1].typesPath; - var typesFd = fs.openSync(typesPath, "w"); - var recursionIdentityMap = new ts.Map(); - // Cleverness: no line break here so that the type ID will match the line number - fs.writeSync(typesFd, "["); - var numTypes = types.length; - for (var i = 0; i < numTypes; i++) { - var type = types[i]; - var objectFlags = type.objectFlags; - var symbol = (_a = type.aliasSymbol) !== null && _a !== void 0 ? _a : type.symbol; - var firstDeclaration = (_b = symbol === null || symbol === void 0 ? void 0 : symbol.declarations) === null || _b === void 0 ? void 0 : _b[0]; - var firstFile = firstDeclaration && ts.getSourceFileOfNode(firstDeclaration); - // It's slow to compute the display text, so skip it unless it's really valuable (or cheap) - var display = void 0; - if ((objectFlags & 16 /* Anonymous */) | (type.flags & 2944 /* Literal */)) { - try { - display = (_c = type.checker) === null || _c === void 0 ? void 0 : _c.typeToString(type); - } - catch (_s) { - display = undefined; - } - } - var indexedAccessProperties = {}; - if (type.flags & 8388608 /* IndexedAccess */) { - var indexedAccessType = type; - indexedAccessProperties = { - indexedAccessObjectType: (_d = indexedAccessType.objectType) === null || _d === void 0 ? void 0 : _d.id, - indexedAccessIndexType: (_e = indexedAccessType.indexType) === null || _e === void 0 ? void 0 : _e.id, - }; - } - var referenceProperties = {}; - if (objectFlags & 4 /* Reference */) { - var referenceType = type; - referenceProperties = { - instantiatedType: (_f = referenceType.target) === null || _f === void 0 ? void 0 : _f.id, - typeArguments: (_g = referenceType.resolvedTypeArguments) === null || _g === void 0 ? void 0 : _g.map(function (t) { return t.id; }), - }; - } - var conditionalProperties = {}; - if (type.flags & 16777216 /* Conditional */) { - var conditionalType = type; - conditionalProperties = { - conditionalCheckType: (_h = conditionalType.checkType) === null || _h === void 0 ? void 0 : _h.id, - conditionalExtendsType: (_j = conditionalType.extendsType) === null || _j === void 0 ? void 0 : _j.id, - conditionalTrueType: (_l = (_k = conditionalType.resolvedTrueType) === null || _k === void 0 ? void 0 : _k.id) !== null && _l !== void 0 ? _l : -1, - conditionalFalseType: (_o = (_m = conditionalType.resolvedFalseType) === null || _m === void 0 ? void 0 : _m.id) !== null && _o !== void 0 ? _o : -1, - }; - } - // We can't print out an arbitrary object, so just assign each one a unique number. - // Don't call it an "id" so people don't treat it as a type id. - var recursionToken = void 0; - var recursionIdentity = type.checker.getRecursionIdentity(type); - if (recursionIdentity) { - recursionToken = recursionIdentityMap.get(recursionIdentity); - if (!recursionToken) { - recursionToken = recursionIdentityMap.size; - recursionIdentityMap.set(recursionIdentity, recursionToken); - } - } - var descriptor = __assign(__assign(__assign(__assign({ id: type.id, intrinsicName: type.intrinsicName, symbolName: (symbol === null || symbol === void 0 ? void 0 : symbol.escapedName) && ts.unescapeLeadingUnderscores(symbol.escapedName), recursionId: recursionToken, unionTypes: (type.flags & 1048576 /* Union */) ? (_p = type.types) === null || _p === void 0 ? void 0 : _p.map(function (t) { return t.id; }) : undefined, intersectionTypes: (type.flags & 2097152 /* Intersection */) ? type.types.map(function (t) { return t.id; }) : undefined, aliasTypeArguments: (_q = type.aliasTypeArguments) === null || _q === void 0 ? void 0 : _q.map(function (t) { return t.id; }), keyofType: (type.flags & 4194304 /* Index */) ? (_r = type.type) === null || _r === void 0 ? void 0 : _r.id : undefined }, indexedAccessProperties), referenceProperties), conditionalProperties), { firstDeclaration: firstDeclaration && { - path: firstFile.path, - start: indexFromOne(ts.getLineAndCharacterOfPosition(firstFile, firstDeclaration.pos)), - end: indexFromOne(ts.getLineAndCharacterOfPosition(ts.getSourceFileOfNode(firstDeclaration), firstDeclaration.end)), - }, flags: ts.Debug.formatTypeFlags(type.flags).split("|"), display: display }); - fs.writeSync(typesFd, JSON.stringify(descriptor)); - if (i < numTypes - 1) { - fs.writeSync(typesFd, ",\n"); - } - } - fs.writeSync(typesFd, "]\n"); - fs.closeSync(typesFd); - ts.performance.mark("endDumpTypes"); - ts.performance.measure("Dump types", "beginDumpTypes", "endDumpTypes"); - } - function dumpLegend() { - if (!legendPath) { - return; - } - ts.Debug.assert(fs); - fs.writeFileSync(legendPath, JSON.stringify(legend)); - } - tracing.dumpLegend = dumpLegend; - })(tracing = ts.tracing || (ts.tracing = {})); -})(ts || (ts = {})); var ts; (function (ts) { // token > SyntaxKind.Identifier => token is a keyword @@ -3828,235 +3303,230 @@ var ts; SyntaxKind[SyntaxKind["DeclareKeyword"] = 133] = "DeclareKeyword"; SyntaxKind[SyntaxKind["GetKeyword"] = 134] = "GetKeyword"; SyntaxKind[SyntaxKind["InferKeyword"] = 135] = "InferKeyword"; - SyntaxKind[SyntaxKind["IntrinsicKeyword"] = 136] = "IntrinsicKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 137] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 138] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 139] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 140] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 141] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 142] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 143] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 144] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 145] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 146] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 147] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 148] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 149] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 150] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 151] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 152] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 153] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 154] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 155] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 156] = "OfKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 136] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 137] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 138] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 139] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 140] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 141] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 142] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 143] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 144] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 145] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 146] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 147] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 148] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 149] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 150] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 151] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 152] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 153] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 154] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 155] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 157] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 158] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 156] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 157] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 159] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 160] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 161] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 158] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 159] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 160] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 162] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 163] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 164] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 165] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 166] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 167] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 168] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 169] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 170] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 171] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 161] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 162] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 163] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 164] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 165] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 166] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 167] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 168] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 169] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 170] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 172] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 173] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 174] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 175] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 176] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 177] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 178] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 179] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 180] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 181] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 182] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 183] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 184] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 185] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 186] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 187] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 188] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 189] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 190] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 191] = "LiteralType"; - SyntaxKind[SyntaxKind["NamedTupleMember"] = 192] = "NamedTupleMember"; - SyntaxKind[SyntaxKind["TemplateLiteralType"] = 193] = "TemplateLiteralType"; - SyntaxKind[SyntaxKind["TemplateLiteralTypeSpan"] = 194] = "TemplateLiteralTypeSpan"; - SyntaxKind[SyntaxKind["ImportType"] = 195] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 171] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 172] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 173] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 174] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 175] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 176] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 177] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 178] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 179] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 180] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 181] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 182] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 183] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 184] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 185] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 186] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 187] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 188] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 189] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 190] = "LiteralType"; + SyntaxKind[SyntaxKind["NamedTupleMember"] = 191] = "NamedTupleMember"; + SyntaxKind[SyntaxKind["ImportType"] = 192] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 196] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 197] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 198] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 193] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 194] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 195] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 199] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 200] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 201] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 202] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 203] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 204] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 205] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 206] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 207] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 208] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 209] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 210] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 211] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 212] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 213] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 214] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 215] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 216] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 217] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 218] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 219] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 220] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 221] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 222] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 223] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 224] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 225] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 226] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 227] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 196] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 197] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 198] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 199] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 200] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 201] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 202] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 203] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 204] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 205] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 206] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 207] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 208] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 209] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 210] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 211] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 212] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 213] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 214] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 215] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 216] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 217] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 218] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 219] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 220] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 221] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 222] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 223] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 224] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 228] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 229] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 225] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 226] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 230] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 231] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 232] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 233] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 234] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 235] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 236] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 237] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 238] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 239] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 240] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 241] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 242] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 243] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 244] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 245] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 246] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 247] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 248] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 249] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 250] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 251] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 252] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 253] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 254] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 255] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 256] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 257] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 258] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 259] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 260] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 261] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 262] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 263] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 264] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 265] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 266] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 267] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 268] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 269] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 270] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 271] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 227] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 228] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 229] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 230] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 231] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 232] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 233] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 234] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 235] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 236] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 237] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 238] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 239] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 240] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 241] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 242] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 243] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 244] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 245] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 246] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 247] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 248] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 249] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 250] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 251] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 252] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 253] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 254] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 255] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 256] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 257] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 258] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 259] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 260] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 261] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 262] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 263] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 264] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 265] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 266] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 267] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 268] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 272] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 269] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 273] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 274] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 275] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 276] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 277] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 278] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 279] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 280] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 281] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 282] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 283] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 270] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 271] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 272] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 273] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 274] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 275] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 276] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 277] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 278] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 279] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 280] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 284] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 285] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 286] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 287] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 281] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 282] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 283] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 284] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 288] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 289] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 290] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 285] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 286] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 287] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 291] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 288] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 292] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 293] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 294] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 295] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 296] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 289] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 290] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 291] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 292] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 293] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 297] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 298] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 299] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 300] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 294] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 295] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 296] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 297] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 301] = "JSDocTypeExpression"; - SyntaxKind[SyntaxKind["JSDocNameReference"] = 302] = "JSDocNameReference"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 298] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 303] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 299] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 304] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 305] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 306] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 307] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 308] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 309] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 300] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 301] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 302] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 303] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 304] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 305] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 310] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 311] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 312] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 313] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 314] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 315] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 316] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 317] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 318] = "JSDocDeprecatedTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 319] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 320] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 321] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 322] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 323] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 324] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 325] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 326] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 327] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 328] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 329] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 330] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 331] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocSeeTag"] = 332] = "JSDocSeeTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 333] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 306] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 307] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 308] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 309] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 310] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 311] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 312] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 313] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 314] = "JSDocDeprecatedTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 315] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 316] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 317] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 318] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 319] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 320] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 321] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 322] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 323] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 324] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 325] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 326] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 327] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 328] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 334] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 329] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 335] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 336] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 337] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 338] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 339] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 340] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 330] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 331] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 332] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 333] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 334] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 335] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 341] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 336] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 77] = "LastAssignment"; @@ -4065,15 +3535,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 80] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 115] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 80] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 156] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 155] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 116] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 124] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 172] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 195] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 171] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 192] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 77] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 156] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 155] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -4082,15 +3552,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 77] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 232] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 248] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 157] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 301] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 333] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 314] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 333] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 229] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 245] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 156] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 298] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 328] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 310] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 328] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 125] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 156] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 155] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -4201,7 +3671,6 @@ var ts; GeneratedIdentifierFlags[GeneratedIdentifierFlags["ReservedInNestedScopes"] = 8] = "ReservedInNestedScopes"; GeneratedIdentifierFlags[GeneratedIdentifierFlags["Optimistic"] = 16] = "Optimistic"; GeneratedIdentifierFlags[GeneratedIdentifierFlags["FileLevel"] = 32] = "FileLevel"; - GeneratedIdentifierFlags[GeneratedIdentifierFlags["AllowNameSubstitution"] = 64] = "AllowNameSubstitution"; })(GeneratedIdentifierFlags = ts.GeneratedIdentifierFlags || (ts.GeneratedIdentifierFlags = {})); var TokenFlags; (function (TokenFlags) { @@ -4645,8 +4114,6 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; - TypeFlags[TypeFlags["TemplateLiteral"] = 134217728] = "TemplateLiteral"; - TypeFlags[TypeFlags["StringMapping"] = 268435456] = "StringMapping"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -4663,7 +4130,7 @@ var ts; TypeFlags[TypeFlags["Intrinsic"] = 67359327] = "Intrinsic"; /* @internal */ TypeFlags[TypeFlags["Primitive"] = 131068] = "Primitive"; - TypeFlags[TypeFlags["StringLike"] = 402653316] = "StringLike"; + TypeFlags[TypeFlags["StringLike"] = 132] = "StringLike"; TypeFlags[TypeFlags["NumberLike"] = 296] = "NumberLike"; TypeFlags[TypeFlags["BigIntLike"] = 2112] = "BigIntLike"; TypeFlags[TypeFlags["BooleanLike"] = 528] = "BooleanLike"; @@ -4671,28 +4138,28 @@ var ts; TypeFlags[TypeFlags["ESSymbolLike"] = 12288] = "ESSymbolLike"; TypeFlags[TypeFlags["VoidLike"] = 49152] = "VoidLike"; /* @internal */ - TypeFlags[TypeFlags["DisjointDomains"] = 469892092] = "DisjointDomains"; + TypeFlags[TypeFlags["DisjointDomains"] = 67238908] = "DisjointDomains"; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; - TypeFlags[TypeFlags["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 465829888] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; + TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ TypeFlags[TypeFlags["Simplifiable"] = 25165824] = "Simplifiable"; /* @internal */ - TypeFlags[TypeFlags["Substructure"] = 469237760] = "Substructure"; + TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 536624127] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 469647395] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ - TypeFlags[TypeFlags["IncludesMask"] = 205258751] = "IncludesMask"; + TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; // The following flags are used for different purposes during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesStructuredOrInstantiable"] = 262144] = "IncludesStructuredOrInstantiable"; @@ -4749,16 +4216,11 @@ var ts; ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] = 268435456] = "IsNeverIntersectionComputed"; /* @internal */ ObjectFlags[ObjectFlags["IsNeverIntersection"] = 536870912] = "IsNeverIntersection"; - /* @internal */ - ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 1073741824] = "IsClassInstanceClone"; ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; /* @internal */ ObjectFlags[ObjectFlags["RequiresWidening"] = 1572864] = "RequiresWidening"; /* @internal */ ObjectFlags[ObjectFlags["PropagatingFlags"] = 3670016] = "PropagatingFlags"; - // Object flags that uniquely identify the kind of ObjectType - /* @internal */ - ObjectFlags[ObjectFlags["ObjectTypeKindMask"] = 2367] = "ObjectTypeKindMask"; })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); /* @internal */ var VarianceFlags; @@ -4848,18 +4310,18 @@ var ts; })(InferenceFlags = ts.InferenceFlags || (ts.InferenceFlags = {})); /** * Ternary values are defined such that - * x & y picks the lesser in the order False < Unknown < Maybe < True, and - * x | y picks the greater in the order False < Unknown < Maybe < True. - * Generally, Ternary.Maybe is used as the result of a relation that depends on itself, and - * Ternary.Unknown is used as the result of a variance check that depends on itself. We make - * a distinction because we don't want to cache circular variance check results. + * x & y is False if either x or y is False. + * x & y is Maybe if either x or y is Maybe, but neither x or y is False. + * x & y is True if both x and y are True. + * x | y is False if both x and y are False. + * x | y is Maybe if either x or y is Maybe, but neither x or y is True. + * x | y is True if either x or y is True. */ /* @internal */ var Ternary; (function (Ternary) { Ternary[Ternary["False"] = 0] = "False"; - Ternary[Ternary["Unknown"] = 1] = "Unknown"; - Ternary[Ternary["Maybe"] = 3] = "Maybe"; + Ternary[Ternary["Maybe"] = 1] = "Maybe"; Ternary[Ternary["True"] = -1] = "True"; })(Ternary = ts.Ternary || (ts.Ternary = {})); /* @internal */ @@ -4867,7 +4329,6 @@ var ts; (function (AssignmentDeclarationKind) { AssignmentDeclarationKind[AssignmentDeclarationKind["None"] = 0] = "None"; /// exports.name = expr - /// module.exports.name = expr AssignmentDeclarationKind[AssignmentDeclarationKind["ExportsProperty"] = 1] = "ExportsProperty"; /// module.exports = expr AssignmentDeclarationKind[AssignmentDeclarationKind["ModuleExports"] = 2] = "ModuleExports"; @@ -4948,8 +4409,6 @@ var ts; JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve"; JsxEmit[JsxEmit["React"] = 2] = "React"; JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative"; - JsxEmit[JsxEmit["ReactJSX"] = 4] = "ReactJSX"; - JsxEmit[JsxEmit["ReactJSXDev"] = 5] = "ReactJSXDev"; })(JsxEmit = ts.JsxEmit || (ts.JsxEmit = {})); var ImportsNotUsedAsValues; (function (ImportsNotUsedAsValues) { @@ -5468,696 +4927,8 @@ var ts; args: [{ name: "factory" }], kind: 4 /* MultiLine */ }, - "jsximportsource": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - }, - "jsxruntime": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - }, }; })(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - /** - * Internally, we represent paths as strings with '/' as the directory separator. - * When we make system calls (eg: LanguageServiceHost.getDirectory()), - * we expect the host to correctly handle paths in our specified format. - */ - ts.directorySeparator = "/"; - var altDirectorySeparator = "\\"; - var urlSchemeSeparator = "://"; - var backslashRegExp = /\\/g; - //// Path Tests - /** - * Determines whether a charCode corresponds to `/` or `\`. - */ - function isAnyDirectorySeparator(charCode) { - return charCode === 47 /* slash */ || charCode === 92 /* backslash */; - } - ts.isAnyDirectorySeparator = isAnyDirectorySeparator; - /** - * Determines whether a path starts with a URL scheme (e.g. starts with `http://`, `ftp://`, `file://`, etc.). - */ - function isUrl(path) { - return getEncodedRootLength(path) < 0; - } - ts.isUrl = isUrl; - /** - * Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path - * like `c:`, `c:\` or `c:/`). - */ - function isRootedDiskPath(path) { - return getEncodedRootLength(path) > 0; - } - ts.isRootedDiskPath = isRootedDiskPath; - /** - * Determines whether a path consists only of a path root. - */ - function isDiskPathRoot(path) { - var rootLength = getEncodedRootLength(path); - return rootLength > 0 && rootLength === path.length; - } - ts.isDiskPathRoot = isDiskPathRoot; - /** - * Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.). - * - * ```ts - * // POSIX - * pathIsAbsolute("/path/to/file.ext") === true - * // DOS - * pathIsAbsolute("c:/path/to/file.ext") === true - * // URL - * pathIsAbsolute("file:///path/to/file.ext") === true - * // Non-absolute - * pathIsAbsolute("path/to/file.ext") === false - * pathIsAbsolute("./path/to/file.ext") === false - * ``` - */ - function pathIsAbsolute(path) { - return getEncodedRootLength(path) !== 0; - } - ts.pathIsAbsolute = pathIsAbsolute; - /** - * Determines whether a path starts with a relative path component (i.e. `.` or `..`). - */ - function pathIsRelative(path) { - return /^\.\.?($|[\\/])/.test(path); - } - ts.pathIsRelative = pathIsRelative; - /** - * Determines whether a path is neither relative nor absolute, e.g. "path/to/file". - * Also known misleadingly as "non-relative". - */ - function pathIsBareSpecifier(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path); - } - ts.pathIsBareSpecifier = pathIsBareSpecifier; - function hasExtension(fileName) { - return ts.stringContains(getBaseFileName(fileName), "."); - } - ts.hasExtension = hasExtension; - function fileExtensionIs(path, extension) { - return path.length > extension.length && ts.endsWith(path, extension); - } - ts.fileExtensionIs = fileExtensionIs; - function fileExtensionIsOneOf(path, extensions) { - for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { - var extension = extensions_1[_i]; - if (fileExtensionIs(path, extension)) { - return true; - } - } - return false; - } - ts.fileExtensionIsOneOf = fileExtensionIsOneOf; - /** - * Determines whether a path has a trailing separator (`/` or `\\`). - */ - function hasTrailingDirectorySeparator(path) { - return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); - } - ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator; - //// Path Parsing - function isVolumeCharacter(charCode) { - return (charCode >= 97 /* a */ && charCode <= 122 /* z */) || - (charCode >= 65 /* A */ && charCode <= 90 /* Z */); - } - function getFileUrlVolumeSeparatorEnd(url, start) { - var ch0 = url.charCodeAt(start); - if (ch0 === 58 /* colon */) - return start + 1; - if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { - var ch2 = url.charCodeAt(start + 2); - if (ch2 === 97 /* a */ || ch2 === 65 /* A */) - return start + 3; - } - return -1; - } - /** - * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). - * If the root is part of a URL, the twos-complement of the root length is returned. - */ - function getEncodedRootLength(path) { - if (!path) - return 0; - var ch0 = path.charCodeAt(0); - // POSIX or UNC - if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { - if (path.charCodeAt(1) !== ch0) - return 1; // POSIX: "/" (or non-normalized "\") - var p1 = path.indexOf(ch0 === 47 /* slash */ ? ts.directorySeparator : altDirectorySeparator, 2); - if (p1 < 0) - return path.length; // UNC: "//server" or "\\server" - return p1 + 1; // UNC: "//server/" or "\\server\" - } - // DOS - if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) { - var ch2 = path.charCodeAt(2); - if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) - return 3; // DOS: "c:/" or "c:\" - if (path.length === 2) - return 2; // DOS: "c:" (but not "c:d") - } - // URL - var schemeEnd = path.indexOf(urlSchemeSeparator); - if (schemeEnd !== -1) { - var authorityStart = schemeEnd + urlSchemeSeparator.length; - var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart); - if (authorityEnd !== -1) { // URL: "file:///", "file://server/", "file://server/path" - // For local "file" URLs, include the leading DOS volume (if present). - // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a - // special case interpreted as "the machine from which the URL is being interpreted". - var scheme = path.slice(0, schemeEnd); - var authority = path.slice(authorityStart, authorityEnd); - if (scheme === "file" && (authority === "" || authority === "localhost") && - isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { - var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); - if (volumeSeparatorEnd !== -1) { - if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { - // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/" - return ~(volumeSeparatorEnd + 1); - } - if (volumeSeparatorEnd === path.length) { - // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a" - // but not "file:///c:d" or "file:///c%3ad" - return ~volumeSeparatorEnd; - } - } - } - return ~(authorityEnd + 1); // URL: "file://server/", "http://server/" - } - return ~path.length; // URL: "file://server", "http://server" - } - // relative - return 0; - } - /** - * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). - * - * For example: - * ```ts - * getRootLength("a") === 0 // "" - * getRootLength("/") === 1 // "/" - * getRootLength("c:") === 2 // "c:" - * getRootLength("c:d") === 0 // "" - * getRootLength("c:/") === 3 // "c:/" - * getRootLength("c:\\") === 3 // "c:\\" - * getRootLength("//server") === 7 // "//server" - * getRootLength("//server/share") === 8 // "//server/" - * getRootLength("\\\\server") === 7 // "\\\\server" - * getRootLength("\\\\server\\share") === 8 // "\\\\server\\" - * getRootLength("file:///path") === 8 // "file:///" - * getRootLength("file:///c:") === 10 // "file:///c:" - * getRootLength("file:///c:d") === 8 // "file:///" - * getRootLength("file:///c:/path") === 11 // "file:///c:/" - * getRootLength("file://server") === 13 // "file://server" - * getRootLength("file://server/path") === 14 // "file://server/" - * getRootLength("http://server") === 13 // "http://server" - * getRootLength("http://server/path") === 14 // "http://server/" - * ``` - */ - function getRootLength(path) { - var rootLength = getEncodedRootLength(path); - return rootLength < 0 ? ~rootLength : rootLength; - } - ts.getRootLength = getRootLength; - function getDirectoryPath(path) { - path = normalizeSlashes(path); - // If the path provided is itself the root, then return it. - var rootLength = getRootLength(path); - if (rootLength === path.length) - return path; - // return the leading portion of the path up to the last (non-terminal) directory separator - // but not including any trailing directory separator. - path = removeTrailingDirectorySeparator(path); - return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator))); - } - ts.getDirectoryPath = getDirectoryPath; - function getBaseFileName(path, extensions, ignoreCase) { - path = normalizeSlashes(path); - // if the path provided is itself the root, then it has not file name. - var rootLength = getRootLength(path); - if (rootLength === path.length) - return ""; - // return the trailing portion of the path starting after the last (non-terminal) directory - // separator but not including any trailing directory separator. - path = removeTrailingDirectorySeparator(path); - var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1)); - var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined; - return extension ? name.slice(0, name.length - extension.length) : name; - } - ts.getBaseFileName = getBaseFileName; - function tryGetExtensionFromPath(path, extension, stringEqualityComparer) { - if (!ts.startsWith(extension, ".")) - extension = "." + extension; - if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46 /* dot */) { - var pathExtension = path.slice(path.length - extension.length); - if (stringEqualityComparer(pathExtension, extension)) { - return pathExtension; - } - } - } - function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) { - if (typeof extensions === "string") { - return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || ""; - } - for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) { - var extension = extensions_2[_i]; - var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer); - if (result) - return result; - } - return ""; - } - function getAnyExtensionFromPath(path, extensions, ignoreCase) { - // Retrieves any string from the final "." onwards from a base file name. - // Unlike extensionFromPath, which throws an exception on unrecognized extensions. - if (extensions) { - return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive); - } - var baseFileName = getBaseFileName(path); - var extensionIndex = baseFileName.lastIndexOf("."); - if (extensionIndex >= 0) { - return baseFileName.substring(extensionIndex); - } - return ""; - } - ts.getAnyExtensionFromPath = getAnyExtensionFromPath; - function pathComponents(path, rootLength) { - var root = path.substring(0, rootLength); - var rest = path.substring(rootLength).split(ts.directorySeparator); - if (rest.length && !ts.lastOrUndefined(rest)) - rest.pop(); - return __spreadArrays([root], rest); - } - /** - * Parse a path into an array containing a root component (at index 0) and zero or more path - * components (at indices > 0). The result is not normalized. - * If the path is relative, the root component is `""`. - * If the path is absolute, the root component includes the first path separator (`/`). - * - * ```ts - * // POSIX - * getPathComponents("/path/to/file.ext") === ["/", "path", "to", "file.ext"] - * getPathComponents("/path/to/") === ["/", "path", "to"] - * getPathComponents("/") === ["/"] - * // DOS - * getPathComponents("c:/path/to/file.ext") === ["c:/", "path", "to", "file.ext"] - * getPathComponents("c:/path/to/") === ["c:/", "path", "to"] - * getPathComponents("c:/") === ["c:/"] - * getPathComponents("c:") === ["c:"] - * // URL - * getPathComponents("http://typescriptlang.org/path/to/file.ext") === ["http://typescriptlang.org/", "path", "to", "file.ext"] - * getPathComponents("http://typescriptlang.org/path/to/") === ["http://typescriptlang.org/", "path", "to"] - * getPathComponents("http://typescriptlang.org/") === ["http://typescriptlang.org/"] - * getPathComponents("http://typescriptlang.org") === ["http://typescriptlang.org"] - * getPathComponents("file://server/path/to/file.ext") === ["file://server/", "path", "to", "file.ext"] - * getPathComponents("file://server/path/to/") === ["file://server/", "path", "to"] - * getPathComponents("file://server/") === ["file://server/"] - * getPathComponents("file://server") === ["file://server"] - * getPathComponents("file:///path/to/file.ext") === ["file:///", "path", "to", "file.ext"] - * getPathComponents("file:///path/to/") === ["file:///", "path", "to"] - * getPathComponents("file:///") === ["file:///"] - * getPathComponents("file://") === ["file://"] - */ - function getPathComponents(path, currentDirectory) { - if (currentDirectory === void 0) { currentDirectory = ""; } - path = combinePaths(currentDirectory, path); - return pathComponents(path, getRootLength(path)); - } - ts.getPathComponents = getPathComponents; - //// Path Formatting - /** - * Formats a parsed path consisting of a root component (at index 0) and zero or more path - * segments (at indices > 0). - * - * ```ts - * getPathFromPathComponents(["/", "path", "to", "file.ext"]) === "/path/to/file.ext" - * ``` - */ - function getPathFromPathComponents(pathComponents) { - if (pathComponents.length === 0) - return ""; - var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]); - return root + pathComponents.slice(1).join(ts.directorySeparator); - } - ts.getPathFromPathComponents = getPathFromPathComponents; - //// Path Normalization - /** - * Normalize path separators, converting `\` into `/`. - */ - function normalizeSlashes(path) { - return path.replace(backslashRegExp, ts.directorySeparator); - } - ts.normalizeSlashes = normalizeSlashes; - /** - * Reduce an array of path components to a more simplified path by navigating any - * `"."` or `".."` entries in the path. - */ - function reducePathComponents(components) { - if (!ts.some(components)) - return []; - var reduced = [components[0]]; - for (var i = 1; i < components.length; i++) { - var component = components[i]; - if (!component) - continue; - if (component === ".") - continue; - if (component === "..") { - if (reduced.length > 1) { - if (reduced[reduced.length - 1] !== "..") { - reduced.pop(); - continue; - } - } - else if (reduced[0]) - continue; - } - reduced.push(component); - } - return reduced; - } - ts.reducePathComponents = reducePathComponents; - /** - * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. - * - * ```ts - * // Non-rooted - * combinePaths("path", "to", "file.ext") === "path/to/file.ext" - * combinePaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file.ext" - * // POSIX - * combinePaths("/path", "to", "file.ext") === "/path/to/file.ext" - * combinePaths("/path", "/to", "file.ext") === "/to/file.ext" - * // DOS - * combinePaths("c:/path", "to", "file.ext") === "c:/path/to/file.ext" - * combinePaths("c:/path", "c:/to", "file.ext") === "c:/to/file.ext" - * // URL - * combinePaths("file:///path", "to", "file.ext") === "file:///path/to/file.ext" - * combinePaths("file:///path", "file:///to", "file.ext") === "file:///to/file.ext" - * ``` - */ - function combinePaths(path) { - var paths = []; - for (var _i = 1; _i < arguments.length; _i++) { - paths[_i - 1] = arguments[_i]; - } - if (path) - path = normalizeSlashes(path); - for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { - var relativePath = paths_1[_a]; - if (!relativePath) - continue; - relativePath = normalizeSlashes(relativePath); - if (!path || getRootLength(relativePath) !== 0) { - path = relativePath; - } - else { - path = ensureTrailingDirectorySeparator(path) + relativePath; - } - } - return path; - } - ts.combinePaths = combinePaths; - /** - * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any - * `.` and `..` path components are resolved. Trailing directory separators are preserved. - * - * ```ts - * resolvePath("/path", "to", "file.ext") === "path/to/file.ext" - * resolvePath("/path", "to", "file.ext/") === "path/to/file.ext/" - * resolvePath("/path", "dir", "..", "to", "file.ext") === "path/to/file.ext" - * ``` - */ - function resolvePath(path) { - var paths = []; - for (var _i = 1; _i < arguments.length; _i++) { - paths[_i - 1] = arguments[_i]; - } - return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : normalizeSlashes(path)); - } - ts.resolvePath = resolvePath; - /** - * Parse a path into an array containing a root component (at index 0) and zero or more path - * components (at indices > 0). The result is normalized. - * If the path is relative, the root component is `""`. - * If the path is absolute, the root component includes the first path separator (`/`). - * - * ```ts - * getNormalizedPathComponents("to/dir/../file.ext", "/path/") === ["/", "path", "to", "file.ext"] - * ``` - */ - function getNormalizedPathComponents(path, currentDirectory) { - return reducePathComponents(getPathComponents(path, currentDirectory)); - } - ts.getNormalizedPathComponents = getNormalizedPathComponents; - function getNormalizedAbsolutePath(fileName, currentDirectory) { - return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); - } - ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; - function normalizePath(path) { - path = normalizeSlashes(path); - var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); - return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; - } - ts.normalizePath = normalizePath; - function getPathWithoutRoot(pathComponents) { - if (pathComponents.length === 0) - return ""; - return pathComponents.slice(1).join(ts.directorySeparator); - } - function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { - return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); - } - ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; - function toPath(fileName, basePath, getCanonicalFileName) { - var nonCanonicalizedPath = isRootedDiskPath(fileName) - ? normalizePath(fileName) - : getNormalizedAbsolutePath(fileName, basePath); - return getCanonicalFileName(nonCanonicalizedPath); - } - ts.toPath = toPath; - function normalizePathAndParts(path) { - path = normalizeSlashes(path); - var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1); - if (parts.length) { - var joinedParts = root + parts.join(ts.directorySeparator); - return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts }; - } - else { - return { path: root, parts: parts }; - } - } - ts.normalizePathAndParts = normalizePathAndParts; - function removeTrailingDirectorySeparator(path) { - if (hasTrailingDirectorySeparator(path)) { - return path.substr(0, path.length - 1); - } - return path; - } - ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator; - function ensureTrailingDirectorySeparator(path) { - if (!hasTrailingDirectorySeparator(path)) { - return path + ts.directorySeparator; - } - return path; - } - ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; - /** - * Ensures a path is either absolute (prefixed with `/` or `c:`) or dot-relative (prefixed - * with `./` or `../`) so as not to be confused with an unprefixed module name. - * - * ```ts - * ensurePathIsNonModuleName("/path/to/file.ext") === "/path/to/file.ext" - * ensurePathIsNonModuleName("./path/to/file.ext") === "./path/to/file.ext" - * ensurePathIsNonModuleName("../path/to/file.ext") === "../path/to/file.ext" - * ensurePathIsNonModuleName("path/to/file.ext") === "./path/to/file.ext" - * ``` - */ - function ensurePathIsNonModuleName(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; - } - ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName; - function changeAnyExtension(path, ext, extensions, ignoreCase) { - var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path); - return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path; - } - ts.changeAnyExtension = changeAnyExtension; - //// Path Comparisons - // check path for these segments: '', '.'. '..' - var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; - function comparePathsWorker(a, b, componentComparer) { - if (a === b) - return 0 /* EqualTo */; - if (a === undefined) - return -1 /* LessThan */; - if (b === undefined) - return 1 /* GreaterThan */; - // NOTE: Performance optimization - shortcut if the root segments differ as there would be no - // need to perform path reduction. - var aRoot = a.substring(0, getRootLength(a)); - var bRoot = b.substring(0, getRootLength(b)); - var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); - if (result !== 0 /* EqualTo */) { - return result; - } - // NOTE: Performance optimization - shortcut if there are no relative path segments in - // the non-root portion of the path - var aRest = a.substring(aRoot.length); - var bRest = b.substring(bRoot.length); - if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { - return componentComparer(aRest, bRest); - } - // The path contains a relative path segment. Normalize the paths and perform a slower component - // by component comparison. - var aComponents = reducePathComponents(getPathComponents(a)); - var bComponents = reducePathComponents(getPathComponents(b)); - var sharedLength = Math.min(aComponents.length, bComponents.length); - for (var i = 1; i < sharedLength; i++) { - var result_2 = componentComparer(aComponents[i], bComponents[i]); - if (result_2 !== 0 /* EqualTo */) { - return result_2; - } - } - return ts.compareValues(aComponents.length, bComponents.length); - } - /** - * Performs a case-sensitive comparison of two paths. Path roots are always compared case-insensitively. - */ - function comparePathsCaseSensitive(a, b) { - return comparePathsWorker(a, b, ts.compareStringsCaseSensitive); - } - ts.comparePathsCaseSensitive = comparePathsCaseSensitive; - /** - * Performs a case-insensitive comparison of two paths. - */ - function comparePathsCaseInsensitive(a, b) { - return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive); - } - ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive; - function comparePaths(a, b, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - a = combinePaths(currentDirectory, a); - b = combinePaths(currentDirectory, b); - } - else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase)); - } - ts.comparePaths = comparePaths; - function containsPath(parent, child, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - parent = combinePaths(currentDirectory, parent); - child = combinePaths(currentDirectory, child); - } - else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - if (parent === undefined || child === undefined) - return false; - if (parent === child) - return true; - var parentComponents = reducePathComponents(getPathComponents(parent)); - var childComponents = reducePathComponents(getPathComponents(child)); - if (childComponents.length < parentComponents.length) { - return false; - } - var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive; - for (var i = 0; i < parentComponents.length; i++) { - var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer; - if (!equalityComparer(parentComponents[i], childComponents[i])) { - return false; - } - } - return true; - } - ts.containsPath = containsPath; - /** - * Determines whether `fileName` starts with the specified `directoryName` using the provided path canonicalization callback. - * Comparison is case-sensitive between the canonical paths. - * - * @deprecated Use `containsPath` if possible. - */ - function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { - var canonicalFileName = getCanonicalFileName(fileName); - var canonicalDirectoryName = getCanonicalFileName(directoryName); - return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\"); - } - ts.startsWithDirectory = startsWithDirectory; - //// Relative Paths - function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { - var fromComponents = reducePathComponents(getPathComponents(from)); - var toComponents = reducePathComponents(getPathComponents(to)); - var start; - for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { - var fromComponent = getCanonicalFileName(fromComponents[start]); - var toComponent = getCanonicalFileName(toComponents[start]); - var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer; - if (!comparer(fromComponent, toComponent)) - break; - } - if (start === 0) { - return toComponents; - } - var components = toComponents.slice(start); - var relative = []; - for (; start < fromComponents.length; start++) { - relative.push(".."); - } - return __spreadArrays([""], relative, components); - } - ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo; - function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { - ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative"); - var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity; - var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; - var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName); - return getPathFromPathComponents(pathComponents); - } - ts.getRelativePathFromDirectory = getRelativePathFromDirectory; - function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { - return !isRootedDiskPath(absoluteOrRelativePath) - ? absoluteOrRelativePath - : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); - } - ts.convertToRelativePath = convertToRelativePath; - function getRelativePathFromFile(from, to, getCanonicalFileName) { - return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); - } - ts.getRelativePathFromFile = getRelativePathFromFile; - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { - var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName); - var firstComponent = pathComponents[0]; - if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { - var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///"; - pathComponents[0] = prefix + firstComponent; - } - return getPathFromPathComponents(pathComponents); - } - ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; - function forEachAncestorDirectory(directory, callback) { - while (true) { - var result = callback(directory); - if (result !== undefined) { - return result; - } - var parentPath = getDirectoryPath(directory); - if (parentPath === directory) { - return undefined; - } - directory = parentPath; - } - } - ts.forEachAncestorDirectory = forEachAncestorDirectory; - function isNodeModulesDirectory(dirPath) { - return ts.endsWith(dirPath, "/node_modules"); - } - ts.isNodeModulesDirectory = isNodeModulesDirectory; -})(ts || (ts = {})); var ts; (function (ts) { /** @@ -7403,10 +6174,6 @@ var ts; return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath); } function fileSystemEntryExists(path, entryKind) { - // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve - // the CPU time performance. - var originalStackTraceLimit = Error.stackTraceLimit; - Error.stackTraceLimit = 0; try { var stat = _fs.statSync(path); switch (entryKind) { @@ -7418,9 +6185,6 @@ var ts; catch (e) { return false; } - finally { - Error.stackTraceLimit = originalStackTraceLimit; - } } function fileExists(path) { return fileSystemEntryExists(path, 0 /* File */); @@ -7491,6 +6255,678 @@ var ts; ts.Debug.isDebugging = true; } })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + /** + * Internally, we represent paths as strings with '/' as the directory separator. + * When we make system calls (eg: LanguageServiceHost.getDirectory()), + * we expect the host to correctly handle paths in our specified format. + */ + ts.directorySeparator = "/"; + var altDirectorySeparator = "\\"; + var urlSchemeSeparator = "://"; + var backslashRegExp = /\\/g; + //// Path Tests + /** + * Determines whether a charCode corresponds to `/` or `\`. + */ + function isAnyDirectorySeparator(charCode) { + return charCode === 47 /* slash */ || charCode === 92 /* backslash */; + } + ts.isAnyDirectorySeparator = isAnyDirectorySeparator; + /** + * Determines whether a path starts with a URL scheme (e.g. starts with `http://`, `ftp://`, `file://`, etc.). + */ + function isUrl(path) { + return getEncodedRootLength(path) < 0; + } + ts.isUrl = isUrl; + /** + * Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path + * like `c:`, `c:\` or `c:/`). + */ + function isRootedDiskPath(path) { + return getEncodedRootLength(path) > 0; + } + ts.isRootedDiskPath = isRootedDiskPath; + /** + * Determines whether a path consists only of a path root. + */ + function isDiskPathRoot(path) { + var rootLength = getEncodedRootLength(path); + return rootLength > 0 && rootLength === path.length; + } + ts.isDiskPathRoot = isDiskPathRoot; + /** + * Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.). + * + * ```ts + * // POSIX + * pathIsAbsolute("/path/to/file.ext") === true + * // DOS + * pathIsAbsolute("c:/path/to/file.ext") === true + * // URL + * pathIsAbsolute("file:///path/to/file.ext") === true + * // Non-absolute + * pathIsAbsolute("path/to/file.ext") === false + * pathIsAbsolute("./path/to/file.ext") === false + * ``` + */ + function pathIsAbsolute(path) { + return getEncodedRootLength(path) !== 0; + } + ts.pathIsAbsolute = pathIsAbsolute; + /** + * Determines whether a path starts with a relative path component (i.e. `.` or `..`). + */ + function pathIsRelative(path) { + return /^\.\.?($|[\\/])/.test(path); + } + ts.pathIsRelative = pathIsRelative; + function hasExtension(fileName) { + return ts.stringContains(getBaseFileName(fileName), "."); + } + ts.hasExtension = hasExtension; + function fileExtensionIs(path, extension) { + return path.length > extension.length && ts.endsWith(path, extension); + } + ts.fileExtensionIs = fileExtensionIs; + function fileExtensionIsOneOf(path, extensions) { + for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { + var extension = extensions_1[_i]; + if (fileExtensionIs(path, extension)) { + return true; + } + } + return false; + } + ts.fileExtensionIsOneOf = fileExtensionIsOneOf; + /** + * Determines whether a path has a trailing separator (`/` or `\\`). + */ + function hasTrailingDirectorySeparator(path) { + return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); + } + ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator; + //// Path Parsing + function isVolumeCharacter(charCode) { + return (charCode >= 97 /* a */ && charCode <= 122 /* z */) || + (charCode >= 65 /* A */ && charCode <= 90 /* Z */); + } + function getFileUrlVolumeSeparatorEnd(url, start) { + var ch0 = url.charCodeAt(start); + if (ch0 === 58 /* colon */) + return start + 1; + if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { + var ch2 = url.charCodeAt(start + 2); + if (ch2 === 97 /* a */ || ch2 === 65 /* A */) + return start + 3; + } + return -1; + } + /** + * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). + * If the root is part of a URL, the twos-complement of the root length is returned. + */ + function getEncodedRootLength(path) { + if (!path) + return 0; + var ch0 = path.charCodeAt(0); + // POSIX or UNC + if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { + if (path.charCodeAt(1) !== ch0) + return 1; // POSIX: "/" (or non-normalized "\") + var p1 = path.indexOf(ch0 === 47 /* slash */ ? ts.directorySeparator : altDirectorySeparator, 2); + if (p1 < 0) + return path.length; // UNC: "//server" or "\\server" + return p1 + 1; // UNC: "//server/" or "\\server\" + } + // DOS + if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) { + var ch2 = path.charCodeAt(2); + if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) + return 3; // DOS: "c:/" or "c:\" + if (path.length === 2) + return 2; // DOS: "c:" (but not "c:d") + } + // URL + var schemeEnd = path.indexOf(urlSchemeSeparator); + if (schemeEnd !== -1) { + var authorityStart = schemeEnd + urlSchemeSeparator.length; + var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart); + if (authorityEnd !== -1) { // URL: "file:///", "file://server/", "file://server/path" + // For local "file" URLs, include the leading DOS volume (if present). + // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a + // special case interpreted as "the machine from which the URL is being interpreted". + var scheme = path.slice(0, schemeEnd); + var authority = path.slice(authorityStart, authorityEnd); + if (scheme === "file" && (authority === "" || authority === "localhost") && + isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { + var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); + if (volumeSeparatorEnd !== -1) { + if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { + // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/" + return ~(volumeSeparatorEnd + 1); + } + if (volumeSeparatorEnd === path.length) { + // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a" + // but not "file:///c:d" or "file:///c%3ad" + return ~volumeSeparatorEnd; + } + } + } + return ~(authorityEnd + 1); // URL: "file://server/", "http://server/" + } + return ~path.length; // URL: "file://server", "http://server" + } + // relative + return 0; + } + /** + * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). + * + * For example: + * ```ts + * getRootLength("a") === 0 // "" + * getRootLength("/") === 1 // "/" + * getRootLength("c:") === 2 // "c:" + * getRootLength("c:d") === 0 // "" + * getRootLength("c:/") === 3 // "c:/" + * getRootLength("c:\\") === 3 // "c:\\" + * getRootLength("//server") === 7 // "//server" + * getRootLength("//server/share") === 8 // "//server/" + * getRootLength("\\\\server") === 7 // "\\\\server" + * getRootLength("\\\\server\\share") === 8 // "\\\\server\\" + * getRootLength("file:///path") === 8 // "file:///" + * getRootLength("file:///c:") === 10 // "file:///c:" + * getRootLength("file:///c:d") === 8 // "file:///" + * getRootLength("file:///c:/path") === 11 // "file:///c:/" + * getRootLength("file://server") === 13 // "file://server" + * getRootLength("file://server/path") === 14 // "file://server/" + * getRootLength("http://server") === 13 // "http://server" + * getRootLength("http://server/path") === 14 // "http://server/" + * ``` + */ + function getRootLength(path) { + var rootLength = getEncodedRootLength(path); + return rootLength < 0 ? ~rootLength : rootLength; + } + ts.getRootLength = getRootLength; + function getDirectoryPath(path) { + path = normalizeSlashes(path); + // If the path provided is itself the root, then return it. + var rootLength = getRootLength(path); + if (rootLength === path.length) + return path; + // return the leading portion of the path up to the last (non-terminal) directory separator + // but not including any trailing directory separator. + path = removeTrailingDirectorySeparator(path); + return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator))); + } + ts.getDirectoryPath = getDirectoryPath; + function getBaseFileName(path, extensions, ignoreCase) { + path = normalizeSlashes(path); + // if the path provided is itself the root, then it has not file name. + var rootLength = getRootLength(path); + if (rootLength === path.length) + return ""; + // return the trailing portion of the path starting after the last (non-terminal) directory + // separator but not including any trailing directory separator. + path = removeTrailingDirectorySeparator(path); + var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1)); + var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined; + return extension ? name.slice(0, name.length - extension.length) : name; + } + ts.getBaseFileName = getBaseFileName; + function tryGetExtensionFromPath(path, extension, stringEqualityComparer) { + if (!ts.startsWith(extension, ".")) + extension = "." + extension; + if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46 /* dot */) { + var pathExtension = path.slice(path.length - extension.length); + if (stringEqualityComparer(pathExtension, extension)) { + return pathExtension; + } + } + } + function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) { + if (typeof extensions === "string") { + return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || ""; + } + for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) { + var extension = extensions_2[_i]; + var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer); + if (result) + return result; + } + return ""; + } + function getAnyExtensionFromPath(path, extensions, ignoreCase) { + // Retrieves any string from the final "." onwards from a base file name. + // Unlike extensionFromPath, which throws an exception on unrecognized extensions. + if (extensions) { + return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive); + } + var baseFileName = getBaseFileName(path); + var extensionIndex = baseFileName.lastIndexOf("."); + if (extensionIndex >= 0) { + return baseFileName.substring(extensionIndex); + } + return ""; + } + ts.getAnyExtensionFromPath = getAnyExtensionFromPath; + function pathComponents(path, rootLength) { + var root = path.substring(0, rootLength); + var rest = path.substring(rootLength).split(ts.directorySeparator); + if (rest.length && !ts.lastOrUndefined(rest)) + rest.pop(); + return __spreadArrays([root], rest); + } + /** + * Parse a path into an array containing a root component (at index 0) and zero or more path + * components (at indices > 0). The result is not normalized. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + * + * ```ts + * // POSIX + * getPathComponents("/path/to/file.ext") === ["/", "path", "to", "file.ext"] + * getPathComponents("/path/to/") === ["/", "path", "to"] + * getPathComponents("/") === ["/"] + * // DOS + * getPathComponents("c:/path/to/file.ext") === ["c:/", "path", "to", "file.ext"] + * getPathComponents("c:/path/to/") === ["c:/", "path", "to"] + * getPathComponents("c:/") === ["c:/"] + * getPathComponents("c:") === ["c:"] + * // URL + * getPathComponents("http://typescriptlang.org/path/to/file.ext") === ["http://typescriptlang.org/", "path", "to", "file.ext"] + * getPathComponents("http://typescriptlang.org/path/to/") === ["http://typescriptlang.org/", "path", "to"] + * getPathComponents("http://typescriptlang.org/") === ["http://typescriptlang.org/"] + * getPathComponents("http://typescriptlang.org") === ["http://typescriptlang.org"] + * getPathComponents("file://server/path/to/file.ext") === ["file://server/", "path", "to", "file.ext"] + * getPathComponents("file://server/path/to/") === ["file://server/", "path", "to"] + * getPathComponents("file://server/") === ["file://server/"] + * getPathComponents("file://server") === ["file://server"] + * getPathComponents("file:///path/to/file.ext") === ["file:///", "path", "to", "file.ext"] + * getPathComponents("file:///path/to/") === ["file:///", "path", "to"] + * getPathComponents("file:///") === ["file:///"] + * getPathComponents("file://") === ["file://"] + */ + function getPathComponents(path, currentDirectory) { + if (currentDirectory === void 0) { currentDirectory = ""; } + path = combinePaths(currentDirectory, path); + return pathComponents(path, getRootLength(path)); + } + ts.getPathComponents = getPathComponents; + //// Path Formatting + /** + * Formats a parsed path consisting of a root component (at index 0) and zero or more path + * segments (at indices > 0). + * + * ```ts + * getPathFromPathComponents(["/", "path", "to", "file.ext"]) === "/path/to/file.ext" + * ``` + */ + function getPathFromPathComponents(pathComponents) { + if (pathComponents.length === 0) + return ""; + var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]); + return root + pathComponents.slice(1).join(ts.directorySeparator); + } + ts.getPathFromPathComponents = getPathFromPathComponents; + //// Path Normalization + /** + * Normalize path separators, converting `\` into `/`. + */ + function normalizeSlashes(path) { + return path.replace(backslashRegExp, ts.directorySeparator); + } + ts.normalizeSlashes = normalizeSlashes; + /** + * Reduce an array of path components to a more simplified path by navigating any + * `"."` or `".."` entries in the path. + */ + function reducePathComponents(components) { + if (!ts.some(components)) + return []; + var reduced = [components[0]]; + for (var i = 1; i < components.length; i++) { + var component = components[i]; + if (!component) + continue; + if (component === ".") + continue; + if (component === "..") { + if (reduced.length > 1) { + if (reduced[reduced.length - 1] !== "..") { + reduced.pop(); + continue; + } + } + else if (reduced[0]) + continue; + } + reduced.push(component); + } + return reduced; + } + ts.reducePathComponents = reducePathComponents; + /** + * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. + * + * ```ts + * // Non-rooted + * combinePaths("path", "to", "file.ext") === "path/to/file.ext" + * combinePaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file.ext" + * // POSIX + * combinePaths("/path", "to", "file.ext") === "/path/to/file.ext" + * combinePaths("/path", "/to", "file.ext") === "/to/file.ext" + * // DOS + * combinePaths("c:/path", "to", "file.ext") === "c:/path/to/file.ext" + * combinePaths("c:/path", "c:/to", "file.ext") === "c:/to/file.ext" + * // URL + * combinePaths("file:///path", "to", "file.ext") === "file:///path/to/file.ext" + * combinePaths("file:///path", "file:///to", "file.ext") === "file:///to/file.ext" + * ``` + */ + function combinePaths(path) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + if (path) + path = normalizeSlashes(path); + for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { + var relativePath = paths_1[_a]; + if (!relativePath) + continue; + relativePath = normalizeSlashes(relativePath); + if (!path || getRootLength(relativePath) !== 0) { + path = relativePath; + } + else { + path = ensureTrailingDirectorySeparator(path) + relativePath; + } + } + return path; + } + ts.combinePaths = combinePaths; + /** + * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any + * `.` and `..` path components are resolved. Trailing directory separators are preserved. + * + * ```ts + * resolvePath("/path", "to", "file.ext") === "path/to/file.ext" + * resolvePath("/path", "to", "file.ext/") === "path/to/file.ext/" + * resolvePath("/path", "dir", "..", "to", "file.ext") === "path/to/file.ext" + * ``` + */ + function resolvePath(path) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : normalizeSlashes(path)); + } + ts.resolvePath = resolvePath; + /** + * Parse a path into an array containing a root component (at index 0) and zero or more path + * components (at indices > 0). The result is normalized. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + * + * ```ts + * getNormalizedPathComponents("to/dir/../file.ext", "/path/") === ["/", "path", "to", "file.ext"] + * ``` + */ + function getNormalizedPathComponents(path, currentDirectory) { + return reducePathComponents(getPathComponents(path, currentDirectory)); + } + ts.getNormalizedPathComponents = getNormalizedPathComponents; + function getNormalizedAbsolutePath(fileName, currentDirectory) { + return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; + function normalizePath(path) { + path = normalizeSlashes(path); + var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); + return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; + } + ts.normalizePath = normalizePath; + function getPathWithoutRoot(pathComponents) { + if (pathComponents.length === 0) + return ""; + return pathComponents.slice(1).join(ts.directorySeparator); + } + function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { + return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; + function toPath(fileName, basePath, getCanonicalFileName) { + var nonCanonicalizedPath = isRootedDiskPath(fileName) + ? normalizePath(fileName) + : getNormalizedAbsolutePath(fileName, basePath); + return getCanonicalFileName(nonCanonicalizedPath); + } + ts.toPath = toPath; + function normalizePathAndParts(path) { + path = normalizeSlashes(path); + var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1); + if (parts.length) { + var joinedParts = root + parts.join(ts.directorySeparator); + return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts }; + } + else { + return { path: root, parts: parts }; + } + } + ts.normalizePathAndParts = normalizePathAndParts; + function removeTrailingDirectorySeparator(path) { + if (hasTrailingDirectorySeparator(path)) { + return path.substr(0, path.length - 1); + } + return path; + } + ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator; + function ensureTrailingDirectorySeparator(path) { + if (!hasTrailingDirectorySeparator(path)) { + return path + ts.directorySeparator; + } + return path; + } + ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; + /** + * Ensures a path is either absolute (prefixed with `/` or `c:`) or dot-relative (prefixed + * with `./` or `../`) so as not to be confused with an unprefixed module name. + * + * ```ts + * ensurePathIsNonModuleName("/path/to/file.ext") === "/path/to/file.ext" + * ensurePathIsNonModuleName("./path/to/file.ext") === "./path/to/file.ext" + * ensurePathIsNonModuleName("../path/to/file.ext") === "../path/to/file.ext" + * ensurePathIsNonModuleName("path/to/file.ext") === "./path/to/file.ext" + * ``` + */ + function ensurePathIsNonModuleName(path) { + return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; + } + ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName; + function changeAnyExtension(path, ext, extensions, ignoreCase) { + var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path); + return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path; + } + ts.changeAnyExtension = changeAnyExtension; + //// Path Comparisons + // check path for these segments: '', '.'. '..' + var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; + function comparePathsWorker(a, b, componentComparer) { + if (a === b) + return 0 /* EqualTo */; + if (a === undefined) + return -1 /* LessThan */; + if (b === undefined) + return 1 /* GreaterThan */; + // NOTE: Performance optimization - shortcut if the root segments differ as there would be no + // need to perform path reduction. + var aRoot = a.substring(0, getRootLength(a)); + var bRoot = b.substring(0, getRootLength(b)); + var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); + if (result !== 0 /* EqualTo */) { + return result; + } + // NOTE: Performance optimization - shortcut if there are no relative path segments in + // the non-root portion of the path + var aRest = a.substring(aRoot.length); + var bRest = b.substring(bRoot.length); + if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { + return componentComparer(aRest, bRest); + } + // The path contains a relative path segment. Normalize the paths and perform a slower component + // by component comparison. + var aComponents = reducePathComponents(getPathComponents(a)); + var bComponents = reducePathComponents(getPathComponents(b)); + var sharedLength = Math.min(aComponents.length, bComponents.length); + for (var i = 1; i < sharedLength; i++) { + var result_2 = componentComparer(aComponents[i], bComponents[i]); + if (result_2 !== 0 /* EqualTo */) { + return result_2; + } + } + return ts.compareValues(aComponents.length, bComponents.length); + } + /** + * Performs a case-sensitive comparison of two paths. Path roots are always compared case-insensitively. + */ + function comparePathsCaseSensitive(a, b) { + return comparePathsWorker(a, b, ts.compareStringsCaseSensitive); + } + ts.comparePathsCaseSensitive = comparePathsCaseSensitive; + /** + * Performs a case-insensitive comparison of two paths. + */ + function comparePathsCaseInsensitive(a, b) { + return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive); + } + ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive; + function comparePaths(a, b, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + a = combinePaths(currentDirectory, a); + b = combinePaths(currentDirectory, b); + } + else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase)); + } + ts.comparePaths = comparePaths; + function containsPath(parent, child, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + parent = combinePaths(currentDirectory, parent); + child = combinePaths(currentDirectory, child); + } + else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + if (parent === undefined || child === undefined) + return false; + if (parent === child) + return true; + var parentComponents = reducePathComponents(getPathComponents(parent)); + var childComponents = reducePathComponents(getPathComponents(child)); + if (childComponents.length < parentComponents.length) { + return false; + } + var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive; + for (var i = 0; i < parentComponents.length; i++) { + var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer; + if (!equalityComparer(parentComponents[i], childComponents[i])) { + return false; + } + } + return true; + } + ts.containsPath = containsPath; + /** + * Determines whether `fileName` starts with the specified `directoryName` using the provided path canonicalization callback. + * Comparison is case-sensitive between the canonical paths. + * + * @deprecated Use `containsPath` if possible. + */ + function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { + var canonicalFileName = getCanonicalFileName(fileName); + var canonicalDirectoryName = getCanonicalFileName(directoryName); + return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\"); + } + ts.startsWithDirectory = startsWithDirectory; + //// Relative Paths + function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { + var fromComponents = reducePathComponents(getPathComponents(from)); + var toComponents = reducePathComponents(getPathComponents(to)); + var start; + for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { + var fromComponent = getCanonicalFileName(fromComponents[start]); + var toComponent = getCanonicalFileName(toComponents[start]); + var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer; + if (!comparer(fromComponent, toComponent)) + break; + } + if (start === 0) { + return toComponents; + } + var components = toComponents.slice(start); + var relative = []; + for (; start < fromComponents.length; start++) { + relative.push(".."); + } + return __spreadArrays([""], relative, components); + } + ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo; + function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { + ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative"); + var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity; + var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; + var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName); + return getPathFromPathComponents(pathComponents); + } + ts.getRelativePathFromDirectory = getRelativePathFromDirectory; + function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { + return !isRootedDiskPath(absoluteOrRelativePath) + ? absoluteOrRelativePath + : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); + } + ts.convertToRelativePath = convertToRelativePath; + function getRelativePathFromFile(from, to, getCanonicalFileName) { + return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); + } + ts.getRelativePathFromFile = getRelativePathFromFile; + function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { + var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName); + var firstComponent = pathComponents[0]; + if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { + var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///"; + pathComponents[0] = prefix + firstComponent; + } + return getPathFromPathComponents(pathComponents); + } + ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; + function forEachAncestorDirectory(directory, callback) { + while (true) { + var result = callback(directory); + if (result !== undefined) { + return result; + } + var parentPath = getDirectoryPath(directory); + if (parentPath === directory) { + return undefined; + } + directory = parentPath; + } + } + ts.forEachAncestorDirectory = forEachAncestorDirectory; + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + ts.isNodeModulesDirectory = isNodeModulesDirectory; +})(ts || (ts = {})); // // generated from './diagnosticInformationMap.generated.ts' by 'src/compiler' /* @internal */ @@ -7525,7 +6961,7 @@ var ts; Accessibility_modifier_already_seen: diag(1028, ts.DiagnosticCategory.Error, "Accessibility_modifier_already_seen_1028", "Accessibility modifier already seen."), _0_modifier_must_precede_1_modifier: diag(1029, ts.DiagnosticCategory.Error, "_0_modifier_must_precede_1_modifier_1029", "'{0}' modifier must precede '{1}' modifier."), _0_modifier_already_seen: diag(1030, ts.DiagnosticCategory.Error, "_0_modifier_already_seen_1030", "'{0}' modifier already seen."), - _0_modifier_cannot_appear_on_class_elements_of_this_kind: diag(1031, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031", "'{0}' modifier cannot appear on class elements of this kind."), + _0_modifier_cannot_appear_on_a_class_element: diag(1031, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_class_element_1031", "'{0}' modifier cannot appear on a class element."), super_must_be_followed_by_an_argument_list_or_member_access: diag(1034, ts.DiagnosticCategory.Error, "super_must_be_followed_by_an_argument_list_or_member_access_1034", "'super' must be followed by an argument list or member access."), Only_ambient_modules_can_use_quoted_names: diag(1035, ts.DiagnosticCategory.Error, "Only_ambient_modules_can_use_quoted_names_1035", "Only ambient modules can use quoted names."), Statements_are_not_allowed_in_ambient_contexts: diag(1036, ts.DiagnosticCategory.Error, "Statements_are_not_allowed_in_ambient_contexts_1036", "Statements are not allowed in ambient contexts."), @@ -7665,7 +7101,7 @@ var ts; Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, ts.DiagnosticCategory.Error, "Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205", "Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."), Decorators_are_not_valid_here: diag(1206, ts.DiagnosticCategory.Error, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, ts.DiagnosticCategory.Error, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), - _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, ts.DiagnosticCategory.Error, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."), + All_files_must_be_modules_when_the_isolatedModules_flag_is_provided: diag(1208, ts.DiagnosticCategory.Error, "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208", "All files must be modules when the '--isolatedModules' flag is provided."), Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: diag(1210, ts.DiagnosticCategory.Error, "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", "Invalid use of '{0}'. Class definitions are automatically in strict mode."), A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, ts.DiagnosticCategory.Error, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), Identifier_expected_0_is_a_reserved_word_in_strict_mode: diag(1212, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", "Identifier expected. '{0}' is a reserved word in strict mode."), @@ -7713,12 +7149,11 @@ var ts; A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, ts.DiagnosticCategory.Error, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."), A_rest_element_must_be_last_in_a_tuple_type: diag(1256, ts.DiagnosticCategory.Error, "A_rest_element_must_be_last_in_a_tuple_type_1256", "A rest element must be last in a tuple type."), A_required_element_cannot_follow_an_optional_element: diag(1257, ts.DiagnosticCategory.Error, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."), + Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation: diag(1258, ts.DiagnosticCategory.Error, "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258", "Definite assignment assertions can only be used along with a type annotation."), Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, ts.DiagnosticCategory.Error, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"), Keywords_cannot_contain_escape_characters: diag(1260, ts.DiagnosticCategory.Error, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."), Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, ts.DiagnosticCategory.Error, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."), Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."), - Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, ts.DiagnosticCategory.Error, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."), - Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, ts.DiagnosticCategory.Error, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."), with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."), @@ -7735,7 +7170,7 @@ var ts; Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_or_umd: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'esnext', 'commonjs', 'amd', 'system', or 'umd'."), Dynamic_import_must_have_one_specifier_as_an_argument: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_import_must_have_one_specifier_as_an_argument_1324", "Dynamic import must have one specifier as an argument."), Specifier_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Specifier_of_dynamic_import_cannot_be_spread_element_1325", "Specifier of dynamic import cannot be spread element."), - Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments."), + Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments"), String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."), Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: diag(1328, ts.DiagnosticCategory.Error, "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328", "Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."), _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: diag(1329, ts.DiagnosticCategory.Error, "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329", "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"), @@ -7751,9 +7186,9 @@ var ts; Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."), - The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system_1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'."), + The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system_1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'esnext' or 'system'."), A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), - An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), + An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness"), This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."), use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, ts.DiagnosticCategory.Error, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."), Non_simple_parameter_declared_here: diag(1348, ts.DiagnosticCategory.Error, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."), @@ -7796,7 +7231,6 @@ var ts; Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."), - _0_is_not_allowed_as_a_variable_declaration_name: diag(1389, ts.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."), The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true), @@ -7922,7 +7356,6 @@ var ts; Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts.DiagnosticCategory.Error, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), - Types_of_construct_signatures_are_incompatible: diag(2419, ts.DiagnosticCategory.Error, "Types_of_construct_signatures_are_incompatible_2419", "Types of construct signatures are incompatible."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), @@ -8046,7 +7479,6 @@ var ts; The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: diag(2547, ts.DiagnosticCategory.Error, "The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547", "The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."), Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2548, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."), Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2549, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."), - Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later: diag(2550, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550", "Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later."), Property_0_does_not_exist_on_type_1_Did_you_mean_2: diag(2551, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", "Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"), Cannot_find_name_0_Did_you_mean_1: diag(2552, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Did_you_mean_1_2552", "Cannot find name '{0}'. Did you mean '{1}'?"), Computed_values_are_not_permitted_in_an_enum_with_string_valued_members: diag(2553, ts.DiagnosticCategory.Error, "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553", "Computed values are not permitted in an enum with string valued members."), @@ -8070,13 +7502,13 @@ var ts; Property_0_is_incompatible_with_rest_element_type: diag(2573, ts.DiagnosticCategory.Error, "Property_0_is_incompatible_with_rest_element_type_2573", "Property '{0}' is incompatible with rest element type."), A_rest_element_type_must_be_an_array_type: diag(2574, ts.DiagnosticCategory.Error, "A_rest_element_type_must_be_an_array_type_2574", "A rest element type must be an array type."), No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), - Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'."), + Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"), Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), Unused_ts_expect_error_directive: diag(2578, ts.DiagnosticCategory.Error, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."), - Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."), + Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."), @@ -8084,9 +7516,9 @@ var ts; Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), Type_instantiation_is_excessively_deep_and_possibly_infinite: diag(2589, ts.DiagnosticCategory.Error, "Type_instantiation_is_excessively_deep_and_possibly_infinite_2589", "Type instantiation is excessively deep and possibly infinite."), Expression_produces_a_union_type_that_is_too_complex_to_represent: diag(2590, ts.DiagnosticCategory.Error, "Expression_produces_a_union_type_that_is_too_complex_to_represent_2590", "Expression produces a union type that is too complex to represent."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."), This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, ts.DiagnosticCategory.Error, "This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594", "This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag."), _0_can_only_be_imported_by_using_a_default_import: diag(2595, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."), _0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."), @@ -8154,7 +7586,6 @@ var ts; All_declarations_of_0_must_have_identical_modifiers: diag(2687, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_modifiers_2687", "All declarations of '{0}' must have identical modifiers."), Cannot_find_type_definition_file_for_0: diag(2688, ts.DiagnosticCategory.Error, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, ts.DiagnosticCategory.Error, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), - _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, ts.DiagnosticCategory.Error, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."), _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, ts.DiagnosticCategory.Error, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), @@ -8188,7 +7619,7 @@ var ts; Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), - _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"), + Module_0_has_no_exported_member_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_2_2724", "Module '{0}' has no exported member '{1}'. Did you mean '{2}'?"), Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, ts.DiagnosticCategory.Error, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."), Cannot_find_lib_definition_for_0: diag(2726, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."), Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"), @@ -8196,7 +7627,7 @@ var ts; Property_0_is_used_before_its_initialization: diag(2729, ts.DiagnosticCategory.Error, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."), An_arrow_function_cannot_have_a_this_parameter: diag(2730, ts.DiagnosticCategory.Error, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."), Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."), - Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."), + Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension"), Property_0_was_also_declared_here: diag(2733, ts.DiagnosticCategory.Error, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."), Are_you_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"), Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"), @@ -8257,10 +7688,6 @@ var ts; The_operand_of_a_delete_operator_must_be_optional: diag(2790, ts.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_must_be_optional_2790", "The operand of a 'delete' operator must be optional."), Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: diag(2791, ts.DiagnosticCategory.Error, "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791", "Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."), Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option: diag(2792, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792", "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"), - The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: diag(2793, ts.DiagnosticCategory.Error, "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793", "The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."), - Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: diag(2794, ts.DiagnosticCategory.Error, "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794", "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"), - The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, ts.DiagnosticCategory.Error, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."), - It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked: diag(2796, ts.DiagnosticCategory.Error, "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796", "It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -8374,6 +7801,7 @@ var ts; Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: diag(5057, ts.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", "Cannot find a tsconfig.json file at the specified directory: '{0}'."), The_specified_path_does_not_exist_Colon_0: diag(5058, ts.DiagnosticCategory.Error, "The_specified_path_does_not_exist_Colon_0_5058", "The specified path does not exist: '{0}'."), Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, ts.DiagnosticCategory.Error, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."), + Option_paths_cannot_be_used_without_specifying_baseUrl_option: diag(5060, ts.DiagnosticCategory.Error, "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", "Option 'paths' cannot be used without specifying '--baseUrl' option."), Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, ts.DiagnosticCategory.Error, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."), Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: diag(5062, ts.DiagnosticCategory.Error, "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' can have at most one '*' character."), Substitutions_for_pattern_0_should_be_an_array: diag(5063, ts.DiagnosticCategory.Error, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."), @@ -8402,8 +7830,6 @@ var ts; A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: diag(5086, ts.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086", "A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."), A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, ts.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087", "A labeled tuple element is declared as rest with a `...` before the name, rather than before the type."), The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), - Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, ts.DiagnosticCategory.Error, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), - Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, ts.DiagnosticCategory.Error, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -8594,7 +8020,7 @@ var ts; Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"), _0_was_also_declared_here: diag(6203, ts.DiagnosticCategory.Message, "_0_was_also_declared_here_6203", "'{0}' was also declared here."), and_here: diag(6204, ts.DiagnosticCategory.Message, "and_here_6204", "and here."), - All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused."), + All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused"), package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."), package_json_does_not_have_a_typesVersions_entry_that_matches_version_0: diag(6207, ts.DiagnosticCategory.Message, "package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207", "'package.json' does not have a 'typesVersions' entry that matches version '{0}'."), package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2: diag(6208, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208", "'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."), @@ -8626,8 +8052,6 @@ var ts; This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without: diag(6234, ts.DiagnosticCategory.Error, "This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234", "This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"), Disable_loading_referenced_projects: diag(6235, ts.DiagnosticCategory.Message, "Disable_loading_referenced_projects_6235", "Disable loading referenced projects."), Arguments_for_the_rest_parameter_0_were_not_provided: diag(6236, ts.DiagnosticCategory.Error, "Arguments_for_the_rest_parameter_0_were_not_provided_6236", "Arguments for the rest parameter '{0}' were not provided."), - Generates_an_event_trace_and_a_list_of_types: diag(6237, ts.DiagnosticCategory.Message, "Generates_an_event_trace_and_a_list_of_types_6237", "Generates an event trace and a list of types."), - Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react: diag(6238, ts.DiagnosticCategory.Error, "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238", "Specify the module specifier to be used to import the `jsx` and `jsxs` factory functions from. eg, react"), Projects_to_reference: diag(6300, ts.DiagnosticCategory.Message, "Projects_to_reference_6300", "Projects to reference"), Enable_project_compilation: diag(6302, ts.DiagnosticCategory.Message, "Enable_project_compilation_6302", "Enable project compilation"), Composite_projects_may_not_disable_declaration_emit: diag(6304, ts.DiagnosticCategory.Error, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), @@ -8673,13 +8097,11 @@ var ts; Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, ts.DiagnosticCategory.Message, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"), Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, ts.DiagnosticCategory.Message, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."), _0_is_deprecated: diag(6385, ts.DiagnosticCategory.Suggestion, "_0_is_deprecated_6385", "'{0}' is deprecated", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ undefined, /*reportsDeprecated*/ true), - Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, ts.DiagnosticCategory.Message, "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386", "Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing: diag(6503, ts.DiagnosticCategory.Message, "Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503", "Print names of files that are part of the compilation and then stop processing."), File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, ts.DiagnosticCategory.Error, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"), - Include_undefined_in_index_signature_results: diag(6800, ts.DiagnosticCategory.Message, "Include_undefined_in_index_signature_results_6800", "Include 'undefined' in index signature results"), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -8707,7 +8129,7 @@ var ts; Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: diag(7032, ts.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."), Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: diag(7033, ts.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."), Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), - Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035", "Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), + Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035", "Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts.DiagnosticCategory.Error, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead: diag(7038, ts.DiagnosticCategory.Message, "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038", "Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."), @@ -8728,7 +8150,6 @@ var ts; Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: diag(7053, ts.DiagnosticCategory.Error, "Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053", "Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."), No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1: diag(7054, ts.DiagnosticCategory.Error, "No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054", "No index signature with a parameter of type '{0}' was found on type '{1}'."), _0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type: diag(7055, ts.DiagnosticCategory.Error, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055", "'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."), - The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed: diag(7056, ts.DiagnosticCategory.Error, "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056", "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."), @@ -8839,7 +8260,6 @@ var ts; Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), - Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), Extract_function: diag(95005, ts.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"), Extract_constant: diag(95006, ts.DiagnosticCategory.Message, "Extract_constant_95006", "Extract constant"), @@ -8857,7 +8277,6 @@ var ts; Add_undefined_type_to_property_0: diag(95018, ts.DiagnosticCategory.Message, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"), Add_initializer_to_property_0: diag(95019, ts.DiagnosticCategory.Message, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"), Add_definite_assignment_assertion_to_property_0: diag(95020, ts.DiagnosticCategory.Message, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"), - Convert_all_type_literals_to_mapped_type: diag(95021, ts.DiagnosticCategory.Message, "Convert_all_type_literals_to_mapped_type_95021", "Convert all type literals to mapped type"), Add_all_missing_members: diag(95022, ts.DiagnosticCategory.Message, "Add_all_missing_members_95022", "Add all missing members"), Infer_all_types_from_usage: diag(95023, ts.DiagnosticCategory.Message, "Infer_all_types_from_usage_95023", "Infer all types from usage"), Delete_all_unused_declarations: diag(95024, ts.DiagnosticCategory.Message, "Delete_all_unused_declarations_95024", "Delete all unused declarations"), @@ -8979,12 +8398,10 @@ var ts; Could_not_find_convertible_access_expression: diag(95140, ts.DiagnosticCategory.Message, "Could_not_find_convertible_access_expression_95140", "Could not find convertible access expression"), Could_not_find_matching_access_expressions: diag(95141, ts.DiagnosticCategory.Message, "Could_not_find_matching_access_expressions_95141", "Could not find matching access expressions"), Can_only_convert_logical_AND_access_chains: diag(95142, ts.DiagnosticCategory.Message, "Can_only_convert_logical_AND_access_chains_95142", "Can only convert logical AND access chains"), - Add_void_to_Promise_resolved_without_a_value: diag(95143, ts.DiagnosticCategory.Message, "Add_void_to_Promise_resolved_without_a_value_95143", "Add 'void' to Promise resolved without a value"), - Add_void_to_all_Promises_resolved_without_a_value: diag(95144, ts.DiagnosticCategory.Message, "Add_void_to_all_Promises_resolved_without_a_value_95144", "Add 'void' to all Promises resolved without a value"), No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."), Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."), JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"), - Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts.DiagnosticCategory.Error, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters."), + Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts.DiagnosticCategory.Error, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters"), An_accessibility_modifier_cannot_be_used_with_a_private_identifier: diag(18010, ts.DiagnosticCategory.Error, "An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010", "An accessibility modifier cannot be used with a private identifier."), The_operand_of_a_delete_operator_cannot_be_a_private_identifier: diag(18011, ts.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011", "The operand of a 'delete' operator cannot be a private identifier."), constructor_is_a_reserved_word: diag(18012, ts.DiagnosticCategory.Error, "constructor_is_a_reserved_word_18012", "'#constructor' is a reserved word."), @@ -8994,7 +8411,7 @@ var ts; Private_identifiers_are_not_allowed_outside_class_bodies: diag(18016, ts.DiagnosticCategory.Error, "Private_identifiers_are_not_allowed_outside_class_bodies_18016", "Private identifiers are not allowed outside class bodies."), The_shadowing_declaration_of_0_is_defined_here: diag(18017, ts.DiagnosticCategory.Error, "The_shadowing_declaration_of_0_is_defined_here_18017", "The shadowing declaration of '{0}' is defined here"), The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here: diag(18018, ts.DiagnosticCategory.Error, "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018", "The declaration of '{0}' that you probably intended to use is defined here"), - _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier."), + _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier"), A_method_cannot_be_named_with_a_private_identifier: diag(18022, ts.DiagnosticCategory.Error, "A_method_cannot_be_named_with_a_private_identifier_18022", "A method cannot be named with a private identifier."), An_accessor_cannot_be_named_with_a_private_identifier: diag(18023, ts.DiagnosticCategory.Error, "An_accessor_cannot_be_named_with_a_private_identifier_18023", "An accessor cannot be named with a private identifier."), An_enum_member_cannot_be_named_with_a_private_identifier: diag(18024, ts.DiagnosticCategory.Error, "An_enum_member_cannot_be_named_with_a_private_identifier_18024", "An enum member cannot be named with a private identifier."), @@ -9028,7 +8445,7 @@ var ts; any: 128 /* AnyKeyword */, as: 126 /* AsKeyword */, asserts: 127 /* AssertsKeyword */, - bigint: 155 /* BigIntKeyword */, + bigint: 154 /* BigIntKeyword */, boolean: 131 /* BooleanKeyword */, break: 80 /* BreakKeyword */, case: 81 /* CaseKeyword */, @@ -9050,7 +8467,7 @@ var ts; _a.false = 94 /* FalseKeyword */, _a.finally = 95 /* FinallyKeyword */, _a.for = 96 /* ForKeyword */, - _a.from = 153 /* FromKeyword */, + _a.from = 152 /* FromKeyword */, _a.function = 97 /* FunctionKeyword */, _a.get = 134 /* GetKeyword */, _a.if = 98 /* IfKeyword */, @@ -9060,40 +8477,39 @@ var ts; _a.infer = 135 /* InferKeyword */, _a.instanceof = 101 /* InstanceOfKeyword */, _a.interface = 117 /* InterfaceKeyword */, - _a.intrinsic = 136 /* IntrinsicKeyword */, - _a.is = 137 /* IsKeyword */, - _a.keyof = 138 /* KeyOfKeyword */, + _a.is = 136 /* IsKeyword */, + _a.keyof = 137 /* KeyOfKeyword */, _a.let = 118 /* LetKeyword */, - _a.module = 139 /* ModuleKeyword */, - _a.namespace = 140 /* NamespaceKeyword */, - _a.never = 141 /* NeverKeyword */, + _a.module = 138 /* ModuleKeyword */, + _a.namespace = 139 /* NamespaceKeyword */, + _a.never = 140 /* NeverKeyword */, _a.new = 102 /* NewKeyword */, _a.null = 103 /* NullKeyword */, - _a.number = 144 /* NumberKeyword */, - _a.object = 145 /* ObjectKeyword */, + _a.number = 143 /* NumberKeyword */, + _a.object = 144 /* ObjectKeyword */, _a.package = 119 /* PackageKeyword */, _a.private = 120 /* PrivateKeyword */, _a.protected = 121 /* ProtectedKeyword */, _a.public = 122 /* PublicKeyword */, - _a.readonly = 142 /* ReadonlyKeyword */, - _a.require = 143 /* RequireKeyword */, - _a.global = 154 /* GlobalKeyword */, + _a.readonly = 141 /* ReadonlyKeyword */, + _a.require = 142 /* RequireKeyword */, + _a.global = 153 /* GlobalKeyword */, _a.return = 104 /* ReturnKeyword */, - _a.set = 146 /* SetKeyword */, + _a.set = 145 /* SetKeyword */, _a.static = 123 /* StaticKeyword */, - _a.string = 147 /* StringKeyword */, + _a.string = 146 /* StringKeyword */, _a.super = 105 /* SuperKeyword */, _a.switch = 106 /* SwitchKeyword */, - _a.symbol = 148 /* SymbolKeyword */, + _a.symbol = 147 /* SymbolKeyword */, _a.this = 107 /* ThisKeyword */, _a.throw = 108 /* ThrowKeyword */, _a.true = 109 /* TrueKeyword */, _a.try = 110 /* TryKeyword */, - _a.type = 149 /* TypeKeyword */, + _a.type = 148 /* TypeKeyword */, _a.typeof = 111 /* TypeOfKeyword */, - _a.undefined = 150 /* UndefinedKeyword */, - _a.unique = 151 /* UniqueKeyword */, - _a.unknown = 152 /* UnknownKeyword */, + _a.undefined = 149 /* UndefinedKeyword */, + _a.unique = 150 /* UniqueKeyword */, + _a.unknown = 151 /* UnknownKeyword */, _a.var = 112 /* VarKeyword */, _a.void = 113 /* VoidKeyword */, _a.while = 114 /* WhileKeyword */, @@ -9101,7 +8517,7 @@ var ts; _a.yield = 124 /* YieldKeyword */, _a.async = 129 /* AsyncKeyword */, _a.await = 130 /* AwaitKeyword */, - _a.of = 156 /* OfKeyword */, + _a.of = 155 /* OfKeyword */, _a); var textToKeyword = new ts.Map(ts.getEntries(textToKeywordObj)); var textToToken = new ts.Map(ts.getEntries(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 77 /* CaretEqualsToken */, "||=": 74 /* BarBarEqualsToken */, "&&=": 75 /* AmpersandAmpersandEqualsToken */, "??=": 76 /* QuestionQuestionEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ }))); @@ -10282,9 +9698,9 @@ var ts; return result; } function getIdentifierToken() { - // Reserved words are between 2 and 12 characters long and start with a lowercase letter + // Reserved words are between 2 and 11 characters long and start with a lowercase letter var len = tokenValue.length; - if (len >= 2 && len <= 12) { + if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 /* a */ && ch <= 122 /* z */) { var keyword = textToKeyword.get(tokenValue); @@ -11487,9 +10903,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 159 /* TypeParameter */) { + if (d && d.kind === 158 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 253 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 250 /* InterfaceDeclaration */) { return current; } } @@ -11497,7 +10913,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 166 /* Constructor */; + return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 165 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -11527,14 +10943,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 249 /* VariableDeclaration */) { + if (node.kind === 246 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 250 /* VariableDeclarationList */) { + if (node && node.kind === 247 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 232 /* VariableStatement */) { + if (node && node.kind === 229 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -11625,20 +11041,6 @@ var ts; return !nodeTest || nodeTest(node) ? node : undefined; } ts.getOriginalNode = getOriginalNode; - function findAncestor(node, callback) { - while (node) { - var result = callback(node); - if (result === "quit") { - return undefined; - } - else if (result) { - return node; - } - node = node.parent; - } - return undefined; - } - ts.findAncestor = findAncestor; /** * Gets a value indicating whether a node originated in the parse tree. * @@ -11704,30 +11106,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 216 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 213 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return expr.name; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; } } break; - case 207 /* ParenthesizedExpression */: { + case 204 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 245 /* LabeledStatement */: { + case 242 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -11764,16 +11166,16 @@ var ts; switch (declaration.kind) { case 78 /* Identifier */: return declaration; - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: { + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 157 /* QualifiedName */) { + if (name.kind === 156 /* QualifiedName */) { return name.right; } break; } - case 203 /* CallExpression */: - case 216 /* BinaryExpression */: { + case 200 /* CallExpression */: + case 213 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -11789,15 +11191,15 @@ var ts; return undefined; } } - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 325 /* JSDocEnumTag */: + case 321 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -12092,7 +11494,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 311 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 307 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -12124,7 +11526,7 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 168 /* SetAccessor */ || node.kind === 167 /* GetAccessor */; + return node.kind === 167 /* SetAccessor */ || node.kind === 166 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; function isPropertyAccessChain(node) { @@ -12142,10 +11544,10 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 201 /* PropertyAccessExpression */ - || kind === 202 /* ElementAccessExpression */ - || kind === 203 /* CallExpression */ - || kind === 225 /* NonNullExpression */); + (kind === 198 /* PropertyAccessExpression */ + || kind === 199 /* ElementAccessExpression */ + || kind === 200 /* CallExpression */ + || kind === 222 /* NonNullExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ @@ -12180,7 +11582,7 @@ var ts; } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isConstTypeReference(node) { @@ -12197,17 +11599,17 @@ var ts; } ts.isNonNullChain = isNonNullChain; function isBreakOrContinueStatement(node) { - return node.kind === 241 /* BreakStatement */ || node.kind === 240 /* ContinueStatement */; + return node.kind === 238 /* BreakStatement */ || node.kind === 237 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isNamedExportBindings(node) { - return node.kind === 269 /* NamespaceExport */ || node.kind === 268 /* NamedExports */; + return node.kind === 266 /* NamespaceExport */ || node.kind === 265 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isUnparsedTextLike(node) { switch (node.kind) { - case 294 /* UnparsedText */: - case 295 /* UnparsedInternalText */: + case 291 /* UnparsedText */: + case 292 /* UnparsedInternalText */: return true; default: return false; @@ -12216,12 +11618,12 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 292 /* UnparsedPrologue */ || - node.kind === 296 /* UnparsedSyntheticReference */; + node.kind === 289 /* UnparsedPrologue */ || + node.kind === 293 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; function isJSDocPropertyLikeTag(node) { - return node.kind === 333 /* JSDocPropertyTag */ || node.kind === 326 /* JSDocParameterTag */; + return node.kind === 328 /* JSDocPropertyTag */ || node.kind === 322 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; // #endregion @@ -12237,7 +11639,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 157 /* FirstNode */; + return kind >= 156 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -12246,7 +11648,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 156 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 155 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -12287,12 +11689,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return node.parent.isTypeOnly; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -12333,7 +11735,7 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 123 /* StaticKeyword */: return true; } @@ -12356,7 +11758,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 157 /* QualifiedName */ + return kind === 156 /* QualifiedName */ || kind === 78 /* Identifier */; } ts.isEntityName = isEntityName; @@ -12366,14 +11768,14 @@ var ts; || kind === 79 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 158 /* ComputedPropertyName */; + || kind === 157 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 78 /* Identifier */ - || kind === 196 /* ObjectBindingPattern */ - || kind === 197 /* ArrayBindingPattern */; + || kind === 193 /* ObjectBindingPattern */ + || kind === 194 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12388,13 +11790,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; default: return false; @@ -12403,14 +11805,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 174 /* FunctionType */: - case 308 /* JSDocFunctionType */: - case 175 /* ConstructorType */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 173 /* FunctionType */: + case 304 /* JSDocFunctionType */: + case 174 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12425,29 +11827,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 166 /* Constructor */ - || kind === 163 /* PropertyDeclaration */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 171 /* IndexSignature */ - || kind === 229 /* SemicolonClassElement */; + return kind === 165 /* Constructor */ + || kind === 162 /* PropertyDeclaration */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 170 /* IndexSignature */ + || kind === 226 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */); + return node && (node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */); + return node && (node.kind === 166 /* GetAccessor */ || node.kind === 167 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return true; default: return false; @@ -12457,11 +11859,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 170 /* ConstructSignature */ - || kind === 169 /* CallSignature */ - || kind === 162 /* PropertySignature */ - || kind === 164 /* MethodSignature */ - || kind === 171 /* IndexSignature */; + return kind === 169 /* ConstructSignature */ + || kind === 168 /* CallSignature */ + || kind === 161 /* PropertySignature */ + || kind === 163 /* MethodSignature */ + || kind === 170 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12470,12 +11872,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 288 /* PropertyAssignment */ - || kind === 289 /* ShorthandPropertyAssignment */ - || kind === 290 /* SpreadAssignment */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 285 /* PropertyAssignment */ + || kind === 286 /* ShorthandPropertyAssignment */ + || kind === 287 /* SpreadAssignment */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12490,8 +11892,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return true; } return false; @@ -12502,8 +11904,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 197 /* ArrayBindingPattern */ - || kind === 196 /* ObjectBindingPattern */; + return kind === 194 /* ArrayBindingPattern */ + || kind === 193 /* ObjectBindingPattern */; } return false; } @@ -12511,15 +11913,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 199 /* ArrayLiteralExpression */ - || kind === 200 /* ObjectLiteralExpression */; + return kind === 196 /* ArrayLiteralExpression */ + || kind === 197 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 198 /* BindingElement */ - || kind === 222 /* OmittedExpression */; + return kind === 195 /* BindingElement */ + || kind === 219 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12528,9 +11930,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: return true; } return false; @@ -12551,8 +11953,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 196 /* ObjectBindingPattern */: - case 200 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 197 /* ObjectLiteralExpression */: return true; } return false; @@ -12564,8 +11966,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: return true; } return false; @@ -12574,26 +11976,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 201 /* PropertyAccessExpression */ - || kind === 157 /* QualifiedName */ - || kind === 195 /* ImportType */; + return kind === 198 /* PropertyAccessExpression */ + || kind === 156 /* QualifiedName */ + || kind === 192 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 201 /* PropertyAccessExpression */ - || kind === 157 /* QualifiedName */; + return kind === 198 /* PropertyAccessExpression */ + || kind === 156 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 161 /* Decorator */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 160 /* Decorator */: return true; default: return false; @@ -12601,12 +12003,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 203 /* CallExpression */ || node.kind === 204 /* NewExpression */; + return node.kind === 200 /* CallExpression */ || node.kind === 201 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 218 /* TemplateExpression */ + return kind === 215 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12617,33 +12019,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 204 /* NewExpression */: - case 203 /* CallExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: - case 205 /* TaggedTemplateExpression */: - case 199 /* ArrayLiteralExpression */: - case 207 /* ParenthesizedExpression */: - case 200 /* ObjectLiteralExpression */: - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 201 /* NewExpression */: + case 200 /* CallExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: + case 202 /* TaggedTemplateExpression */: + case 196 /* ArrayLiteralExpression */: + case 204 /* ParenthesizedExpression */: + case 197 /* ObjectLiteralExpression */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: case 78 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: case 94 /* FalseKeyword */: case 103 /* NullKeyword */: case 107 /* ThisKeyword */: case 109 /* TrueKeyword */: case 105 /* SuperKeyword */: - case 225 /* NonNullExpression */: - case 226 /* MetaProperty */: + case 222 /* NonNullExpression */: + case 223 /* MetaProperty */: case 99 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12657,13 +12059,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: - case 210 /* DeleteExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 213 /* AwaitExpression */: - case 206 /* TypeAssertionExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 207 /* DeleteExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 210 /* AwaitExpression */: + case 203 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12672,9 +12074,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return true; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12693,15 +12095,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 217 /* ConditionalExpression */: - case 219 /* YieldExpression */: - case 209 /* ArrowFunction */: - case 216 /* BinaryExpression */: - case 220 /* SpreadElement */: - case 224 /* AsExpression */: - case 222 /* OmittedExpression */: - case 337 /* CommaListExpression */: - case 336 /* PartiallyEmittedExpression */: + case 214 /* ConditionalExpression */: + case 216 /* YieldExpression */: + case 206 /* ArrowFunction */: + case 213 /* BinaryExpression */: + case 217 /* SpreadElement */: + case 221 /* AsExpression */: + case 219 /* OmittedExpression */: + case 332 /* CommaListExpression */: + case 331 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12709,8 +12111,8 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 206 /* TypeAssertionExpression */ - || kind === 224 /* AsExpression */; + return kind === 203 /* TypeAssertionExpression */ + || kind === 221 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ @@ -12721,13 +12123,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return true; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12756,7 +12158,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 238 /* ForInStatement */ || node.kind === 239 /* ForOfStatement */; + return node.kind === 235 /* ForInStatement */ || node.kind === 236 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12780,114 +12182,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 257 /* ModuleBlock */ - || kind === 256 /* ModuleDeclaration */ + return kind === 254 /* ModuleBlock */ + || kind === 253 /* ModuleDeclaration */ || kind === 78 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 257 /* ModuleBlock */ - || kind === 256 /* ModuleDeclaration */; + return kind === 254 /* ModuleBlock */ + || kind === 253 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 78 /* Identifier */ - || kind === 256 /* ModuleDeclaration */; + || kind === 253 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 264 /* NamedImports */ - || kind === 263 /* NamespaceImport */; + return kind === 261 /* NamedImports */ + || kind === 260 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */ || node.kind === 255 /* EnumDeclaration */; + return node.kind === 253 /* ModuleDeclaration */ || node.kind === 252 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 209 /* ArrowFunction */ - || kind === 198 /* BindingElement */ - || kind === 252 /* ClassDeclaration */ - || kind === 221 /* ClassExpression */ - || kind === 166 /* Constructor */ - || kind === 255 /* EnumDeclaration */ - || kind === 291 /* EnumMember */ - || kind === 270 /* ExportSpecifier */ - || kind === 251 /* FunctionDeclaration */ - || kind === 208 /* FunctionExpression */ - || kind === 167 /* GetAccessor */ - || kind === 262 /* ImportClause */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 265 /* ImportSpecifier */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 280 /* JsxAttribute */ - || kind === 165 /* MethodDeclaration */ - || kind === 164 /* MethodSignature */ - || kind === 256 /* ModuleDeclaration */ - || kind === 259 /* NamespaceExportDeclaration */ - || kind === 263 /* NamespaceImport */ - || kind === 269 /* NamespaceExport */ - || kind === 160 /* Parameter */ - || kind === 288 /* PropertyAssignment */ - || kind === 163 /* PropertyDeclaration */ - || kind === 162 /* PropertySignature */ - || kind === 168 /* SetAccessor */ - || kind === 289 /* ShorthandPropertyAssignment */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 159 /* TypeParameter */ - || kind === 249 /* VariableDeclaration */ - || kind === 331 /* JSDocTypedefTag */ - || kind === 324 /* JSDocCallbackTag */ - || kind === 333 /* JSDocPropertyTag */; + return kind === 206 /* ArrowFunction */ + || kind === 195 /* BindingElement */ + || kind === 249 /* ClassDeclaration */ + || kind === 218 /* ClassExpression */ + || kind === 165 /* Constructor */ + || kind === 252 /* EnumDeclaration */ + || kind === 288 /* EnumMember */ + || kind === 267 /* ExportSpecifier */ + || kind === 248 /* FunctionDeclaration */ + || kind === 205 /* FunctionExpression */ + || kind === 166 /* GetAccessor */ + || kind === 259 /* ImportClause */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 262 /* ImportSpecifier */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 277 /* JsxAttribute */ + || kind === 164 /* MethodDeclaration */ + || kind === 163 /* MethodSignature */ + || kind === 253 /* ModuleDeclaration */ + || kind === 256 /* NamespaceExportDeclaration */ + || kind === 260 /* NamespaceImport */ + || kind === 266 /* NamespaceExport */ + || kind === 159 /* Parameter */ + || kind === 285 /* PropertyAssignment */ + || kind === 162 /* PropertyDeclaration */ + || kind === 161 /* PropertySignature */ + || kind === 167 /* SetAccessor */ + || kind === 286 /* ShorthandPropertyAssignment */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 158 /* TypeParameter */ + || kind === 246 /* VariableDeclaration */ + || kind === 327 /* JSDocTypedefTag */ + || kind === 320 /* JSDocCallbackTag */ + || kind === 328 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 251 /* FunctionDeclaration */ - || kind === 271 /* MissingDeclaration */ - || kind === 252 /* ClassDeclaration */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 255 /* EnumDeclaration */ - || kind === 256 /* ModuleDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 267 /* ExportDeclaration */ - || kind === 266 /* ExportAssignment */ - || kind === 259 /* NamespaceExportDeclaration */; + return kind === 248 /* FunctionDeclaration */ + || kind === 268 /* MissingDeclaration */ + || kind === 249 /* ClassDeclaration */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 252 /* EnumDeclaration */ + || kind === 253 /* ModuleDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 264 /* ExportDeclaration */ + || kind === 263 /* ExportAssignment */ + || kind === 256 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 241 /* BreakStatement */ - || kind === 240 /* ContinueStatement */ - || kind === 248 /* DebuggerStatement */ - || kind === 235 /* DoStatement */ - || kind === 233 /* ExpressionStatement */ - || kind === 231 /* EmptyStatement */ - || kind === 238 /* ForInStatement */ - || kind === 239 /* ForOfStatement */ - || kind === 237 /* ForStatement */ - || kind === 234 /* IfStatement */ - || kind === 245 /* LabeledStatement */ - || kind === 242 /* ReturnStatement */ - || kind === 244 /* SwitchStatement */ - || kind === 246 /* ThrowStatement */ - || kind === 247 /* TryStatement */ - || kind === 232 /* VariableStatement */ - || kind === 236 /* WhileStatement */ - || kind === 243 /* WithStatement */ - || kind === 335 /* NotEmittedStatement */ - || kind === 339 /* EndOfDeclarationMarker */ - || kind === 338 /* MergeDeclarationMarker */; + return kind === 238 /* BreakStatement */ + || kind === 237 /* ContinueStatement */ + || kind === 245 /* DebuggerStatement */ + || kind === 232 /* DoStatement */ + || kind === 230 /* ExpressionStatement */ + || kind === 228 /* EmptyStatement */ + || kind === 235 /* ForInStatement */ + || kind === 236 /* ForOfStatement */ + || kind === 234 /* ForStatement */ + || kind === 231 /* IfStatement */ + || kind === 242 /* LabeledStatement */ + || kind === 239 /* ReturnStatement */ + || kind === 241 /* SwitchStatement */ + || kind === 243 /* ThrowStatement */ + || kind === 244 /* TryStatement */ + || kind === 229 /* VariableStatement */ + || kind === 233 /* WhileStatement */ + || kind === 240 /* WithStatement */ + || kind === 330 /* NotEmittedStatement */ + || kind === 334 /* EndOfDeclarationMarker */ + || kind === 333 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 159 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 330 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 158 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 326 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -12914,10 +12316,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 230 /* Block */) + if (node.kind !== 227 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 247 /* TryStatement */ || node.parent.kind === 287 /* CatchClause */) { + if (node.parent.kind === 244 /* TryStatement */ || node.parent.kind === 284 /* CatchClause */) { return false; } } @@ -12931,15 +12333,15 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 230 /* Block */; + || kind === 227 /* Block */; } ts.isStatementOrBlock = isStatementOrBlock; // Module references /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 272 /* ExternalModuleReference */ - || kind === 157 /* QualifiedName */ + return kind === 269 /* ExternalModuleReference */ + || kind === 156 /* QualifiedName */ || kind === 78 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12949,70 +12351,70 @@ var ts; var kind = node.kind; return kind === 107 /* ThisKeyword */ || kind === 78 /* Identifier */ - || kind === 201 /* PropertyAccessExpression */; + || kind === 198 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 273 /* JsxElement */ - || kind === 283 /* JsxExpression */ - || kind === 274 /* JsxSelfClosingElement */ + return kind === 270 /* JsxElement */ + || kind === 280 /* JsxExpression */ + || kind === 271 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 277 /* JsxFragment */; + || kind === 274 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 280 /* JsxAttribute */ - || kind === 282 /* JsxSpreadAttribute */; + return kind === 277 /* JsxAttribute */ + || kind === 279 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 283 /* JsxExpression */; + || kind === 280 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 275 /* JsxOpeningElement */ - || kind === 274 /* JsxSelfClosingElement */; + return kind === 272 /* JsxOpeningElement */ + || kind === 271 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 284 /* CaseClause */ - || kind === 285 /* DefaultClause */; + return kind === 281 /* CaseClause */ + || kind === 282 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 301 /* FirstJSDocNode */ && node.kind <= 333 /* LastJSDocNode */; + return node.kind >= 298 /* FirstJSDocNode */ && node.kind <= 328 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 311 /* JSDocComment */ || node.kind === 310 /* JSDocNamepathType */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node); + return node.kind === 307 /* JSDocComment */ || node.kind === 306 /* JSDocNamepathType */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 314 /* FirstJSDocTagNode */ && node.kind <= 333 /* LastJSDocTagNode */; + return node.kind >= 310 /* FirstJSDocTagNode */ && node.kind <= 328 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 168 /* SetAccessor */; + return node.kind === 167 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 167 /* GetAccessor */; + return node.kind === 166 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -13038,13 +12440,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 162 /* PropertySignature */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: - case 291 /* EnumMember */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 161 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: + case 288 /* EnumMember */: return true; default: return false; @@ -13052,12 +12454,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 280 /* JsxAttribute */ || node.kind === 282 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 277 /* JsxAttribute */ || node.kind === 279 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 173 /* TypeReference */ || node.kind === 223 /* ExpressionWithTypeArguments */; + return node.kind === 172 /* TypeReference */ || node.kind === 220 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -13190,6 +12592,20 @@ var ts; }); } ts.optionsHaveModuleResolutionChanges = optionsHaveModuleResolutionChanges; + function findAncestor(node, callback) { + while (node) { + var result = callback(node); + if (result === "quit") { + return undefined; + } + else if (result) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.findAncestor = findAncestor; function forEachAncestor(node, callback) { while (true) { var res = callback(node); @@ -13338,7 +12754,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 297 /* SourceFile */) { + while (node && node.kind !== 294 /* SourceFile */) { node = node.parent; } return node; @@ -13346,11 +12762,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 230 /* Block */: - case 258 /* CaseBlock */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return true; } return false; @@ -13546,7 +12962,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 334 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 329 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13565,12 +12981,8 @@ var ts; } ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile; function isJSDocTypeExpressionOrChild(node) { - return !!ts.findAncestor(node, ts.isJSDocTypeExpression); + return !!findAncestor(node, ts.isJSDocTypeExpression); } - function isExportNamespaceAsDefaultDeclaration(node) { - return !!(ts.isExportDeclaration(node) && node.exportClause && ts.isNamespaceExport(node.exportClause) && node.exportClause.name.escapedText === "default"); - } - ts.isExportNamespaceAsDefaultDeclaration = isExportNamespaceAsDefaultDeclaration; function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) { if (includeTrivia === void 0) { includeTrivia = false; } if (nodeIsMissing(node)) { @@ -13608,85 +13020,10 @@ var ts; return emitNode && emitNode.flags || 0; } ts.getEmitFlags = getEmitFlags; - ; - function getScriptTargetFeatures() { - return { - es2015: { - Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"], - RegExp: ["flags", "sticky", "unicode"], - Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"], - ArrayConstructor: ["from", "of"], - ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"], - NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"], - Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"], - Map: ["entries", "keys", "values"], - Set: ["entries", "keys", "values"], - Promise: ts.emptyArray, - PromiseConstructor: ["all", "race", "reject", "resolve"], - Symbol: ["for", "keyFor"], - WeakMap: ["entries", "keys", "values"], - WeakSet: ["entries", "keys", "values"], - Iterator: ts.emptyArray, - AsyncIterator: ts.emptyArray, - String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"], - StringConstructor: ["fromCodePoint", "raw"] - }, - es2016: { - Array: ["includes"] - }, - es2017: { - Atomics: ts.emptyArray, - SharedArrayBuffer: ts.emptyArray, - String: ["padStart", "padEnd"], - ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"], - DateTimeFormat: ["formatToParts"] - }, - es2018: { - Promise: ["finally"], - RegExpMatchArray: ["groups"], - RegExpExecArray: ["groups"], - RegExp: ["dotAll"], - Intl: ["PluralRules"], - AsyncIterable: ts.emptyArray, - AsyncIterableIterator: ts.emptyArray, - AsyncGenerator: ts.emptyArray, - AsyncGeneratorFunction: ts.emptyArray, - }, - es2019: { - Array: ["flat", "flatMap"], - ObjectConstructor: ["fromEntries"], - String: ["trimStart", "trimEnd", "trimLeft", "trimRight"], - Symbol: ["description"] - }, - es2020: { - BigInt: ts.emptyArray, - BigInt64Array: ts.emptyArray, - BigUint64Array: ts.emptyArray, - PromiseConstructor: ["allSettled"], - SymbolConstructor: ["matchAll"], - String: ["matchAll"], - DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"], - RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"] - }, - esnext: { - PromiseConstructor: ["any"], - String: ["replaceAll"], - NumberFormat: ["formatToParts"] - } - }; - } - ts.getScriptTargetFeatures = getScriptTargetFeatures; - var GetLiteralTextFlags; - (function (GetLiteralTextFlags) { - GetLiteralTextFlags[GetLiteralTextFlags["None"] = 0] = "None"; - GetLiteralTextFlags[GetLiteralTextFlags["NeverAsciiEscape"] = 1] = "NeverAsciiEscape"; - GetLiteralTextFlags[GetLiteralTextFlags["JsxAttributeEscape"] = 2] = "JsxAttributeEscape"; - GetLiteralTextFlags[GetLiteralTextFlags["TerminateUnterminatedLiterals"] = 4] = "TerminateUnterminatedLiterals"; - })(GetLiteralTextFlags = ts.GetLiteralTextFlags || (ts.GetLiteralTextFlags = {})); - function getLiteralText(node, sourceFile, flags) { + function getLiteralText(node, sourceFile, neverAsciiEscape, jsxAttributeEscape) { // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. - if (!nodeIsSynthesized(node) && node.parent && !(flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) || + if (!nodeIsSynthesized(node) && node.parent && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) || ts.isBigIntLiteral(node))) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); } @@ -13694,8 +13031,8 @@ var ts; // or a (possibly escaped) quoted form of the original text if it's string-like. switch (node.kind) { case 10 /* StringLiteral */: { - var escapeText = flags & 2 /* JsxAttributeEscape */ ? escapeJsxAttributeString : - flags & 1 /* NeverAsciiEscape */ || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : + var escapeText = jsxAttributeEscape ? escapeJsxAttributeString : + neverAsciiEscape || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : escapeNonAsciiString; if (node.singleQuote) { return "'" + escapeText(node.text, 39 /* singleQuote */) + "'"; @@ -13710,7 +13047,7 @@ var ts; case 17 /* TemplateTail */: { // If a NoSubstitutionTemplateLiteral appears to have a substitution in it, the original text // had to include a backslash: `not \${a} substitution`. - var escapeText = flags & 1 /* NeverAsciiEscape */ || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : + var escapeText = neverAsciiEscape || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : escapeNonAsciiString; var rawText = node.rawText || escapeTemplateSubstitution(escapeText(node.text, 96 /* backtick */)); switch (node.kind) { @@ -13727,11 +13064,7 @@ var ts; } case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: - return node.text; case 13 /* RegularExpressionLiteral */: - if (flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) { - return node.text + (node.text.charCodeAt(node.text.length - 1) === 92 /* backslash */ ? " /" : "/"); - } return node.text; } return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); @@ -13754,7 +13087,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 249 /* VariableDeclaration */ && node.parent.kind === 287 /* CatchClause */; + return node.kind === 246 /* VariableDeclaration */ && node.parent.kind === 284 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13786,11 +13119,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 256 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 253 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 297 /* SourceFile */ || - node.kind === 256 /* ModuleDeclaration */ || + return node.kind === 294 /* SourceFile */ || + node.kind === 253 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -13807,9 +13140,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: return ts.isExternalModule(node.parent); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -13862,22 +13195,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 297 /* SourceFile */: - case 258 /* CaseBlock */: - case 287 /* CatchClause */: - case 256 /* ModuleDeclaration */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 294 /* SourceFile */: + case 255 /* CaseBlock */: + case 284 /* CatchClause */: + case 253 /* ModuleDeclaration */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; - case 230 /* Block */: + case 227 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -13887,9 +13220,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 313 /* JSDocSignature */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 309 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -13899,25 +13232,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 308 /* JSDocFunctionType */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 304 /* JSDocFunctionType */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -13927,8 +13260,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: return true; default: return false; @@ -13937,15 +13270,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 232 /* VariableStatement */: - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 229 /* VariableStatement */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: return true; default: return false; @@ -13959,7 +13292,7 @@ var ts; // Gets the nearest enclosing block scope container that has the provided node // as a descendant, that is not the provided node. function getEnclosingBlockScopeContainer(node) { - return ts.findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); }); + return findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); }); } ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; // Return display name of an identifier @@ -13974,7 +13307,7 @@ var ts; } ts.getNameFromIndexInfo = getNameFromIndexInfo; function isComputedNonLiteralName(name) { - return name.kind === 158 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); + return name.kind === 157 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); } ts.isComputedNonLiteralName = isComputedNonLiteralName; function getTextOfPropertyName(name) { @@ -13986,7 +13319,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -14002,9 +13335,9 @@ var ts; case 79 /* PrivateIdentifier */: case 78 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -14045,18 +13378,6 @@ var ts; }; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; - function createDiagnosticForFileFromMessageChain(sourceFile, messageChain, relatedInformation) { - return { - file: sourceFile, - start: 0, - length: 0, - code: messageChain.code, - category: messageChain.category, - messageText: messageChain.next ? messageChain : messageChain.messageText, - relatedInformation: relatedInformation - }; - } - ts.createDiagnosticForFileFromMessageChain = createDiagnosticForFileFromMessageChain; function createDiagnosticForRange(sourceFile, range, message) { return { file: sourceFile, @@ -14077,7 +13398,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 230 /* Block */) { + if (node.body && node.body.kind === 227 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -14091,7 +13412,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -14100,28 +13421,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 254 /* TypeAliasDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 251 /* TypeAliasDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: errorNode = node.name; break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -14173,11 +13494,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 203 /* CallExpression */ && n.expression.kind === 105 /* SuperKeyword */; + return n.kind === 200 /* CallExpression */ && n.expression.kind === 105 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 203 /* CallExpression */ && n.expression.kind === 99 /* ImportKeyword */; + return n.kind === 200 /* CallExpression */ && n.expression.kind === 99 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -14191,7 +13512,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 233 /* ExpressionStatement */ + return node.kind === 230 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -14219,11 +13540,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 160 /* Parameter */ || - node.kind === 159 /* TypeParameter */ || - node.kind === 208 /* FunctionExpression */ || - node.kind === 209 /* ArrowFunction */ || - node.kind === 207 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 159 /* Parameter */ || + node.kind === 158 /* TypeParameter */ || + node.kind === 205 /* FunctionExpression */ || + node.kind === 206 /* ArrowFunction */ || + node.kind === 204 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -14239,48 +13560,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (172 /* FirstTypeNode */ <= node.kind && node.kind <= 195 /* LastTypeNode */) { + if (171 /* FirstTypeNode */ <= node.kind && node.kind <= 192 /* LastTypeNode */) { return true; } switch (node.kind) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 147 /* StringKeyword */: + case 151 /* UnknownKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 146 /* StringKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: - case 145 /* ObjectKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: + case 147 /* SymbolKeyword */: + case 144 /* ObjectKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: return true; case 113 /* VoidKeyword */: - return node.parent.kind !== 212 /* VoidExpression */; - case 223 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 209 /* VoidExpression */; + case 220 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 159 /* TypeParameter */: - return node.parent.kind === 190 /* MappedType */ || node.parent.kind === 185 /* InferType */; + case 158 /* TypeParameter */: + return node.parent.kind === 189 /* MappedType */ || node.parent.kind === 184 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 78 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 156 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */ || node.kind === 201 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 78 /* Identifier */ || node.kind === 156 /* QualifiedName */ || node.kind === 198 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 157 /* QualifiedName */: - case 201 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: case 107 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 176 /* TypeQuery */) { + if (parent.kind === 175 /* TypeQuery */) { return false; } - if (parent.kind === 195 /* ImportType */) { + if (parent.kind === 192 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -14289,40 +13610,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (172 /* FirstTypeNode */ <= parent.kind && parent.kind <= 195 /* LastTypeNode */) { + if (171 /* FirstTypeNode */ <= parent.kind && parent.kind <= 192 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return node === parent.constraint; - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return node === parent.constraint; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 160 /* Parameter */: - case 249 /* VariableDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 159 /* Parameter */: + case 246 /* VariableDeclaration */: return node === parent.type; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return node === parent.type; - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return node === parent.type; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return node === parent.type; - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -14347,23 +13668,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitor(node); - case 258 /* CaseBlock */: - case 230 /* Block */: - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 243 /* WithStatement */: - case 244 /* SwitchStatement */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 245 /* LabeledStatement */: - case 247 /* TryStatement */: - case 287 /* CatchClause */: + case 255 /* CaseBlock */: + case 227 /* Block */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 240 /* WithStatement */: + case 241 /* SwitchStatement */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 242 /* LabeledStatement */: + case 244 /* TryStatement */: + case 284 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -14373,23 +13694,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 255 /* EnumDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 157 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. traverse(node.name.expression); @@ -14412,10 +13733,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 178 /* ArrayType */) { + if (node && node.kind === 177 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 173 /* TypeReference */) { + else if (node && node.kind === 172 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -14425,12 +13746,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 177 /* TypeLiteral */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 176 /* TypeLiteral */: return node.members; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return node.properties; } } @@ -14438,14 +13759,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 198 /* BindingElement */: - case 291 /* EnumMember */: - case 160 /* Parameter */: - case 288 /* PropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 289 /* ShorthandPropertyAssignment */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 288 /* EnumMember */: + case 159 /* Parameter */: + case 285 /* PropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 286 /* ShorthandPropertyAssignment */: + case 246 /* VariableDeclaration */: return true; } } @@ -14457,8 +13778,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 250 /* VariableDeclarationList */ - && node.parent.parent.kind === 232 /* VariableStatement */; + return node.parent.kind === 247 /* VariableDeclarationList */ + && node.parent.parent.kind === 229 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -14469,13 +13790,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return true; } return false; @@ -14486,7 +13807,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 245 /* LabeledStatement */) { + if (node.statement.kind !== 242 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -14494,17 +13815,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 230 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 227 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 165 /* MethodDeclaration */ && node.parent.kind === 200 /* ObjectLiteralExpression */; + return node && node.kind === 164 /* MethodDeclaration */ && node.parent.kind === 197 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 165 /* MethodDeclaration */ && - (node.parent.kind === 200 /* ObjectLiteralExpression */ || - node.parent.kind === 221 /* ClassExpression */); + return node.kind === 164 /* MethodDeclaration */ && + (node.parent.kind === 197 /* ObjectLiteralExpression */ || + node.parent.kind === 218 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -14517,7 +13838,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 288 /* PropertyAssignment */) { + if (property.kind === 285 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -14546,26 +13867,26 @@ var ts; } ts.getTsConfigPropArray = getTsConfigPropArray; function getContainingFunction(node) { - return ts.findAncestor(node.parent, ts.isFunctionLike); + return findAncestor(node.parent, ts.isFunctionLike); } ts.getContainingFunction = getContainingFunction; function getContainingFunctionDeclaration(node) { - return ts.findAncestor(node.parent, ts.isFunctionLikeDeclaration); + return findAncestor(node.parent, ts.isFunctionLikeDeclaration); } ts.getContainingFunctionDeclaration = getContainingFunctionDeclaration; function getContainingClass(node) { - return ts.findAncestor(node.parent, ts.isClassLike); + return findAncestor(node.parent, ts.isClassLike); } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 297 /* SourceFile */); + ts.Debug.assert(node.kind !== 294 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -14580,9 +13901,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 159 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14593,26 +13914,26 @@ var ts; node = node.parent; } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 256 /* ModuleDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 255 /* EnumDeclaration */: - case 297 /* SourceFile */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 253 /* ModuleDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 252 /* EnumDeclaration */: + case 294 /* SourceFile */: return node; } } @@ -14631,9 +13952,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return container; } } @@ -14655,27 +13976,27 @@ var ts; return node; } switch (node.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: node = node.parent; break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return node; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 159 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14691,14 +14012,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 208 /* FunctionExpression */ || func.kind === 209 /* ArrowFunction */) { + if (func.kind === 205 /* FunctionExpression */ || func.kind === 206 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 207 /* ParenthesizedExpression */) { + while (parent.kind === 204 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 203 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 200 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14714,7 +14035,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */) + return (kind === 198 /* PropertyAccessExpression */ || kind === 199 /* ElementAccessExpression */) && node.expression.kind === 105 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14723,26 +14044,21 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */) + return (kind === 198 /* PropertyAccessExpression */ || kind === 199 /* ElementAccessExpression */) && node.expression.kind === 107 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; - function isThisInitializedDeclaration(node) { - var _a; - return !!node && ts.isVariableDeclaration(node) && ((_a = node.initializer) === null || _a === void 0 ? void 0 : _a.kind) === 107 /* ThisKeyword */; - } - ts.isThisInitializedDeclaration = isThisInitializedDeclaration; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 78 /* Identifier */: - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return node; } return undefined; @@ -14750,10 +14066,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return node.tag; - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14766,25 +14082,25 @@ var ts; return false; } switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: // classes are valid targets return true; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 252 /* ClassDeclaration */; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + return parent.kind === 249 /* ClassDeclaration */; + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 252 /* ClassDeclaration */; - case 160 /* Parameter */: + && parent.kind === 249 /* ClassDeclaration */; + case 159 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 166 /* Constructor */ - || parent.kind === 165 /* MethodDeclaration */ - || parent.kind === 168 /* SetAccessor */) - && grandparent.kind === 252 /* ClassDeclaration */; + && (parent.kind === 165 /* Constructor */ + || parent.kind === 164 /* MethodDeclaration */ + || parent.kind === 167 /* SetAccessor */) + && grandparent.kind === 249 /* ClassDeclaration */; } return false; } @@ -14800,10 +14116,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 165 /* MethodDeclaration */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 167 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -14812,9 +14128,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 275 /* JsxOpeningElement */ || - parent.kind === 274 /* JsxSelfClosingElement */ || - parent.kind === 276 /* JsxClosingElement */) { + if (parent.kind === 272 /* JsxOpeningElement */ || + parent.kind === 271 /* JsxSelfClosingElement */ || + parent.kind === 273 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -14827,44 +14143,44 @@ var ts; case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 224 /* AsExpression */: - case 206 /* TypeAssertionExpression */: - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: - case 209 /* ArrowFunction */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 211 /* TypeOfExpression */: - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: - case 216 /* BinaryExpression */: - case 217 /* ConditionalExpression */: - case 220 /* SpreadElement */: - case 218 /* TemplateExpression */: - case 222 /* OmittedExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: - case 219 /* YieldExpression */: - case 213 /* AwaitExpression */: - case 226 /* MetaProperty */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 221 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 208 /* TypeOfExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 213 /* BinaryExpression */: + case 214 /* ConditionalExpression */: + case 217 /* SpreadElement */: + case 215 /* TemplateExpression */: + case 219 /* OmittedExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: + case 216 /* YieldExpression */: + case 210 /* AwaitExpression */: + case 223 /* MetaProperty */: return true; - case 157 /* QualifiedName */: - while (node.parent.kind === 157 /* QualifiedName */) { + case 156 /* QualifiedName */: + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 175 /* TypeQuery */ || isJSXTagName(node); case 78 /* Identifier */: - if (node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 175 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -14882,49 +14198,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 291 /* EnumMember */: - case 288 /* PropertyAssignment */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 288 /* EnumMember */: + case 285 /* PropertyAssignment */: + case 195 /* BindingElement */: return parent.initializer === node; - case 233 /* ExpressionStatement */: - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 242 /* ReturnStatement */: - case 243 /* WithStatement */: - case 244 /* SwitchStatement */: - case 284 /* CaseClause */: - case 246 /* ThrowStatement */: + case 230 /* ExpressionStatement */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 239 /* ReturnStatement */: + case 240 /* WithStatement */: + case 241 /* SwitchStatement */: + case 281 /* CaseClause */: + case 243 /* ThrowStatement */: return parent.expression === node; - case 237 /* ForStatement */: + case 234 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 250 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 247 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 250 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 247 /* VariableDeclarationList */) || forInStatement.expression === node; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return node === parent.expression; - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return node === parent.expression; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return node === parent.expression; - case 161 /* Decorator */: - case 283 /* JsxExpression */: - case 282 /* JsxSpreadAttribute */: - case 290 /* SpreadAssignment */: + case 160 /* Decorator */: + case 280 /* JsxExpression */: + case 279 /* JsxSpreadAttribute */: + case 287 /* SpreadAssignment */: return true; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -14932,14 +14248,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 157 /* QualifiedName */ || node.kind === 78 /* Identifier */) { + while (node.kind === 156 /* QualifiedName */ || node.kind === 78 /* Identifier */) { node = node.parent; } - return node.kind === 176 /* TypeQuery */; + return node.kind === 175 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 272 /* ExternalModuleReference */; + return node.kind === 257 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 269 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -14947,13 +14263,8 @@ var ts; return node.moduleReference.expression; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; - function getExternalModuleRequireArgument(node) { - return isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true) - && getLeftmostAccessExpression(node.initializer).arguments[0]; - } - ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 272 /* ExternalModuleReference */; + return node.kind === 257 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 269 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -14985,11 +14296,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 147 /* StringKeyword */ || node.typeArguments[0].kind === 144 /* NumberKeyword */); + (node.typeArguments[0].kind === 146 /* StringKeyword */ || node.typeArguments[0].kind === 143 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 203 /* CallExpression */) { + if (callExpression.kind !== 200 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -15004,10 +14315,7 @@ var ts; } ts.isRequireCall = isRequireCall; function isRequireVariableDeclaration(node, requireStringLiteralLikeArgument) { - if (node.kind === 198 /* BindingElement */) { - node = node.parent.parent; - } - return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(getLeftmostAccessExpression(node.initializer), requireStringLiteralLikeArgument); + return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(node.initializer, requireStringLiteralLikeArgument); } ts.isRequireVariableDeclaration = isRequireVariableDeclaration; function isRequireVariableStatement(node, requireStringLiteralLikeArgument) { @@ -15025,6 +14333,46 @@ var ts; return getSourceTextOfNodeFromSourceFile(sourceFile, str).charCodeAt(0) === 34 /* doubleQuote */; } ts.isStringDoubleQuoted = isStringDoubleQuoted; + function getDeclarationOfExpando(node) { + if (!node.parent) { + return undefined; + } + var name; + var decl; + if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) { + if (!isInJSFile(node) && !isVarConst(node.parent)) { + return undefined; + } + name = node.parent.name; + decl = node.parent; + } + else if (ts.isBinaryExpression(node.parent)) { + var parentNode = node.parent; + var parentNodeOperator = node.parent.operatorToken.kind; + if (parentNodeOperator === 62 /* EqualsToken */ && parentNode.right === node) { + name = parentNode.left; + decl = name; + } + else if (parentNodeOperator === 56 /* BarBarToken */ || parentNodeOperator === 60 /* QuestionQuestionToken */) { + if (ts.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { + name = parentNode.parent.name; + decl = parentNode.parent; + } + else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 /* EqualsToken */ && parentNode.parent.right === parentNode) { + name = parentNode.parent.left; + decl = name; + } + if (!name || !isBindableStaticNameExpression(name) || !isSameEntityName(name, parentNode.left)) { + return undefined; + } + } + } + if (!name || !getExpandoInitializer(node, isPrototypeAccess(name))) { + return undefined; + } + return decl; + } + ts.getDeclarationOfExpando = getDeclarationOfExpando; function isAssignmentDeclaration(decl) { return ts.isBinaryExpression(decl) || isAccessExpression(decl) || ts.isIdentifier(decl) || ts.isCallExpression(decl); } @@ -15086,11 +14434,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 208 /* FunctionExpression */ || e.kind === 209 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 205 /* FunctionExpression */ || e.kind === 206 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 208 /* FunctionExpression */ || - initializer.kind === 221 /* ClassExpression */ || - initializer.kind === 209 /* ArrowFunction */) { + if (initializer.kind === 205 /* FunctionExpression */ || + initializer.kind === 218 /* ClassExpression */ || + initializer.kind === 206 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -15165,7 +14513,6 @@ var ts; } return false; } - ts.isSameEntityName = isSameEntityName; function getRightMostAssignedExpression(node) { while (isAssignmentExpression(node, /*excludeCompoundAssignments*/ true)) { node = node.right; @@ -15344,7 +14691,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 233 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 230 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -15365,7 +14712,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 251 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 248 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -15374,14 +14721,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return node.parent; - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return node.parent.parent; - case 203 /* CallExpression */: + case 200 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 191 /* LiteralType */: + case 190 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -15391,12 +14738,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return node.moduleSpecifier; - case 260 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 272 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 195 /* ImportType */: + case 257 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 269 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 192 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -15405,11 +14752,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -15417,7 +14764,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 261 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 258 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -15438,13 +14785,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 160 /* Parameter */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 289 /* ShorthandPropertyAssignment */: - case 288 /* PropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 159 /* Parameter */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 286 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -15458,7 +14805,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 331 /* JSDocTypedefTag */ || node.kind === 324 /* JSDocCallbackTag */ || node.kind === 325 /* JSDocEnumTag */; + return node.kind === 327 /* JSDocTypedefTag */ || node.kind === 320 /* JSDocCallbackTag */ || node.kind === 321 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -15483,12 +14830,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return node.initializer; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return node.initializer; } } @@ -15500,7 +14847,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 256 /* ModuleDeclaration */ + node.body.kind === 253 /* ModuleDeclaration */ ? node.body : undefined; } @@ -15515,11 +14862,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 160 /* Parameter */) { + if (node.kind === 159 /* Parameter */) { result = ts.addRange(result, (noCache ? ts.getJSDocParameterTagsNoCache : ts.getJSDocParameterTags)(node)); break; } - if (node.kind === 159 /* TypeParameter */) { + if (node.kind === 158 /* TypeParameter */) { result = ts.addRange(result, (noCache ? ts.getJSDocTypeParameterTagsNoCache : ts.getJSDocTypeParameterTags)(node)); break; } @@ -15530,10 +14877,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 288 /* PropertyAssignment */ || - parent.kind === 266 /* ExportAssignment */ || - parent.kind === 163 /* PropertyDeclaration */ || - parent.kind === 233 /* ExpressionStatement */ && node.kind === 201 /* PropertyAccessExpression */ || + if (parent.kind === 285 /* PropertyAssignment */ || + parent.kind === 263 /* ExportAssignment */ || + parent.kind === 162 /* PropertyDeclaration */ || + parent.kind === 230 /* ExpressionStatement */ && node.kind === 198 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -15591,7 +14938,7 @@ var ts; ts.getEffectiveJSDocHost = getEffectiveJSDocHost; /** Use getEffectiveJSDocHost if you additionally need to look for jsdoc on parent nodes, like assignments. */ function getJSDocHost(node) { - return ts.Debug.checkDefined(ts.findAncestor(node.parent, ts.isJSDoc)).parent; + return ts.Debug.checkDefined(findAncestor(node.parent, ts.isJSDoc)).parent; } ts.getJSDocHost = getJSDocHost; function getTypeParameterFromJsDoc(node) { @@ -15607,7 +14954,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 309 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 305 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15624,31 +14971,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 207 /* ParenthesizedExpression */: - case 199 /* ArrayLiteralExpression */: - case 220 /* SpreadElement */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 196 /* ArrayLiteralExpression */: + case 217 /* SpreadElement */: + case 222 /* NonNullExpression */: node = parent; break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15675,22 +15022,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 230 /* Block */: - case 232 /* VariableStatement */: - case 243 /* WithStatement */: - case 234 /* IfStatement */: - case 244 /* SwitchStatement */: - case 258 /* CaseBlock */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 245 /* LabeledStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 247 /* TryStatement */: - case 287 /* CatchClause */: + case 227 /* Block */: + case 229 /* VariableStatement */: + case 240 /* WithStatement */: + case 231 /* IfStatement */: + case 241 /* SwitchStatement */: + case 255 /* CaseBlock */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 242 /* LabeledStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 244 /* TryStatement */: + case 284 /* CatchClause */: return true; } return false; @@ -15707,44 +15054,30 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 186 /* ParenthesizedType */); + return walkUp(node, 185 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 207 /* ParenthesizedExpression */); + return walkUp(node, 204 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; - /** - * Walks up parenthesized types. - * It returns both the outermost parenthesized type and its parent. - * If given node is not a parenthesiezd type, undefined is return as the former. - */ - function walkUpParenthesizedTypesAndGetParentAndChild(node) { - var child; - while (node && node.kind === 186 /* ParenthesizedType */) { - child = node; - node = node.parent; - } - return [child, node]; - } - ts.walkUpParenthesizedTypesAndGetParentAndChild = walkUpParenthesizedTypesAndGetParentAndChild; function skipParentheses(node) { return ts.skipOuterExpressions(node, 1 /* Parentheses */); } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 207 /* ParenthesizedExpression */) { + while (node.kind === 204 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 201 /* PropertyAccessExpression */ && node.kind !== 202 /* ElementAccessExpression */) { + if (node.kind !== 198 /* PropertyAccessExpression */ && node.kind !== 199 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 210 /* DeleteExpression */; + return node && node.kind === 207 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15797,7 +15130,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 158 /* ComputedPropertyName */ && + node.parent.kind === 157 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15805,26 +15138,26 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 291 /* EnumMember */: - case 288 /* PropertyAssignment */: - case 201 /* PropertyAccessExpression */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 288 /* EnumMember */: + case 285 /* PropertyAssignment */: + case 198 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference return parent.right === node; - case 198 /* BindingElement */: - case 265 /* ImportSpecifier */: + case 195 /* BindingElement */: + case 262 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 270 /* ExportSpecifier */: - case 280 /* JsxAttribute */: + case 267 /* ExportSpecifier */: + case 277 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -15844,33 +15177,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ || - node.kind === 259 /* NamespaceExportDeclaration */ || - node.kind === 262 /* ImportClause */ && !!node.name || - node.kind === 263 /* NamespaceImport */ || - node.kind === 269 /* NamespaceExport */ || - node.kind === 265 /* ImportSpecifier */ || - node.kind === 270 /* ExportSpecifier */ || - node.kind === 266 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 256 /* NamespaceExportDeclaration */ || + node.kind === 259 /* ImportClause */ && !!node.name || + node.kind === 260 /* NamespaceImport */ || + node.kind === 266 /* NamespaceExport */ || + node.kind === 262 /* ImportSpecifier */ || + node.kind === 267 /* ExportSpecifier */ || + node.kind === 263 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 289 /* ShorthandPropertyAssignment */ || - node.kind === 288 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 286 /* ShorthandPropertyAssignment */ || + node.kind === 285 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 262 /* ImportClause */: - case 265 /* ImportSpecifier */: - case 263 /* NamespaceImport */: - case 270 /* ExportSpecifier */: - case 266 /* ExportAssignment */: - case 260 /* ImportEqualsDeclaration */: + case 259 /* ImportClause */: + case 262 /* ImportSpecifier */: + case 260 /* NamespaceImport */: + case 267 /* ExportSpecifier */: + case 263 /* ExportAssignment */: + case 257 /* ImportEqualsDeclaration */: return node.parent; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 157 /* QualifiedName */); + } while (node.parent.kind === 156 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -15889,7 +15222,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 289 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 288 /* PropertyAssignment */ ? node.initializer : + return node.kind === 286 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 285 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -15955,11 +15288,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 80 /* FirstKeyword */ <= token && token <= 156 /* LastKeyword */; + return 80 /* FirstKeyword */ <= token && token <= 155 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 125 /* FirstContextualKeyword */ <= token && token <= 156 /* LastContextualKeyword */; + return 125 /* FirstContextualKeyword */ <= token && token <= 155 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -16003,14 +15336,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (hasSyntacticModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -16024,10 +15357,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasSyntacticModifier(node, 256 /* Async */); @@ -16060,7 +15393,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 158 /* ComputedPropertyName */ || name.kind === 202 /* ElementAccessExpression */)) { + if (!(name.kind === 157 /* ComputedPropertyName */ || name.kind === 199 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression; @@ -16086,7 +15419,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -16155,11 +15488,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 160 /* Parameter */; + return root.kind === 159 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 198 /* BindingElement */) { + while (node.kind === 195 /* BindingElement */) { node = node.parent.parent; } return node; @@ -16167,15 +15500,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 166 /* Constructor */ - || kind === 208 /* FunctionExpression */ - || kind === 251 /* FunctionDeclaration */ - || kind === 209 /* ArrowFunction */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 256 /* ModuleDeclaration */ - || kind === 297 /* SourceFile */; + return kind === 165 /* Constructor */ + || kind === 205 /* FunctionExpression */ + || kind === 248 /* FunctionDeclaration */ + || kind === 206 /* ArrowFunction */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 253 /* ModuleDeclaration */ + || kind === 294 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -16194,23 +15527,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 201 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 204 /* NewExpression */: + case 201 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 214 /* PrefixUnaryExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 213 /* AwaitExpression */: - case 217 /* ConditionalExpression */: - case 219 /* YieldExpression */: + case 211 /* PrefixUnaryExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 210 /* AwaitExpression */: + case 214 /* ConditionalExpression */: + case 216 /* YieldExpression */: return 1 /* Right */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -16237,15 +15570,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 201 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 216 /* BinaryExpression */) { + if (expression.kind === 213 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 214 /* PrefixUnaryExpression */ || expression.kind === 215 /* PostfixUnaryExpression */) { + else if (expression.kind === 211 /* PrefixUnaryExpression */ || expression.kind === 212 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -16424,15 +15757,15 @@ var ts; })(OperatorPrecedence = ts.OperatorPrecedence || (ts.OperatorPrecedence = {})); function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return 0 /* Comma */; - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return 1 /* Spread */; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return 2 /* Yield */; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return 4 /* Conditional */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0 /* Comma */; @@ -16458,21 +15791,21 @@ var ts; } // TODO: Should prefix `++` and `--` be moved to the `Update` precedence? // TODO: We are missing `TypeAssertionExpression` - case 214 /* PrefixUnaryExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 213 /* AwaitExpression */: + case 211 /* PrefixUnaryExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 210 /* AwaitExpression */: return 16 /* Unary */; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return 17 /* Update */; - case 203 /* CallExpression */: + case 200 /* CallExpression */: return 18 /* LeftHandSide */; - case 204 /* NewExpression */: + case 201 /* NewExpression */: return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */; - case 205 /* TaggedTemplateExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 202 /* TaggedTemplateExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return 19 /* Member */; case 107 /* ThisKeyword */: case 105 /* SuperKeyword */: @@ -16483,19 +15816,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 221 /* ClassExpression */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 218 /* ClassExpression */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: - case 207 /* ParenthesizedExpression */: - case 222 /* OmittedExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: + case 215 /* TemplateExpression */: + case 204 /* ParenthesizedExpression */: + case 219 /* OmittedExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: return 20 /* Primary */; default: return -1 /* Invalid */; @@ -16548,19 +15881,6 @@ var ts; return -1; } ts.getBinaryOperatorPrecedence = getBinaryOperatorPrecedence; - function getSemanticJsxChildren(children) { - return ts.filter(children, function (i) { - switch (i.kind) { - case 283 /* JsxExpression */: - return !!i.expression; - case 11 /* JsxText */: - return !i.containsOnlyTriviaWhiteSpaces; - default: - return true; - } - }); - } - ts.getSemanticJsxChildren = getSemanticJsxChildren; function createDiagnosticCollection() { var nonFileDiagnostics = []; // See GH#19873 var filesWithDiagnostics = []; @@ -16755,10 +16075,8 @@ var ts; ts.isIntrinsicJsxName = isIntrinsicJsxName; var indentStrings = ["", " "]; function getIndentString(level) { - // prepopulate cache - var singleLevel = indentStrings[1]; - for (var current = indentStrings.length; current <= level; current++) { - indentStrings.push(indentStrings[current - 1] + singleLevel); + if (indentStrings[level] === undefined) { + indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; } return indentStrings[level]; } @@ -16997,14 +16315,6 @@ var ts; return options.outFile || options.out; } ts.outFile = outFile; - /** Returns 'undefined' if and only if 'options.paths' is undefined. */ - function getPathsBasePath(options, host) { - var _a, _b; - if (!options.paths) - return undefined; - return (_a = options.baseUrl) !== null && _a !== void 0 ? _a : ts.Debug.checkDefined(options.pathsBasePath || ((_b = host.getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(host)), "Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'."); - } - ts.getPathsBasePath = getPathsBasePath; /** * Gets the source files that are expected to have an emit output. * @@ -17133,10 +16443,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 167 /* GetAccessor */) { + if (accessor.kind === 166 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 168 /* SetAccessor */) { + else if (accessor.kind === 167 /* SetAccessor */) { setAccessor = accessor; } else { @@ -17156,10 +16466,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 167 /* GetAccessor */ && !getAccessor) { + if (member.kind === 166 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 168 /* SetAccessor */ && !setAccessor) { + if (member.kind === 167 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -17208,7 +16518,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 311 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 307 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -17444,7 +16754,7 @@ var ts; } ts.getSelectedSyntacticModifierFlags = getSelectedSyntacticModifierFlags; function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 156 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 155 /* LastToken */) { return 0 /* None */; } if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) { @@ -17540,7 +16850,7 @@ var ts; case 84 /* ConstKeyword */: return 2048 /* Const */; case 87 /* DefaultKeyword */: return 512 /* Default */; case 129 /* AsyncKeyword */: return 256 /* Async */; - case 142 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 141 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -17590,8 +16900,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 200 /* ObjectLiteralExpression */ - || kind === 199 /* ArrayLiteralExpression */; + return kind === 197 /* ObjectLiteralExpression */ + || kind === 196 /* ArrayLiteralExpression */; } return false; } @@ -17608,12 +16918,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.left; } while (node.kind !== 78 /* Identifier */); return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 78 /* Identifier */); @@ -17623,8 +16933,8 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 78 /* Identifier */ || node.kind === 107 /* ThisKeyword */ || node.kind === 105 /* SuperKeyword */ || - node.kind === 201 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 207 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 198 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 204 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { @@ -17649,17 +16959,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 156 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 200 /* ObjectLiteralExpression */ && + return expression.kind === 197 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 199 /* ArrayLiteralExpression */ && + return expression.kind === 196 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -17991,8 +17301,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 255 /* EnumDeclaration */: - case 256 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -18069,35 +17379,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return accessKind(parent); - case 215 /* PostfixUnaryExpression */: - case 214 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 288 /* PropertyAssignment */: { + case 285 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 233 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 230 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -18246,37 +17556,37 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */) + return (kind >= 171 /* FirstTypeNode */ && kind <= 192 /* LastTypeNode */) || kind === 128 /* AnyKeyword */ - || kind === 152 /* UnknownKeyword */ - || kind === 144 /* NumberKeyword */ - || kind === 155 /* BigIntKeyword */ - || kind === 145 /* ObjectKeyword */ + || kind === 151 /* UnknownKeyword */ + || kind === 143 /* NumberKeyword */ + || kind === 154 /* BigIntKeyword */ + || kind === 144 /* ObjectKeyword */ || kind === 131 /* BooleanKeyword */ - || kind === 147 /* StringKeyword */ - || kind === 148 /* SymbolKeyword */ + || kind === 146 /* StringKeyword */ + || kind === 147 /* SymbolKeyword */ || kind === 113 /* VoidKeyword */ - || kind === 150 /* UndefinedKeyword */ - || kind === 141 /* NeverKeyword */ - || kind === 223 /* ExpressionWithTypeArguments */ - || kind === 303 /* JSDocAllType */ - || kind === 304 /* JSDocUnknownType */ - || kind === 305 /* JSDocNullableType */ - || kind === 306 /* JSDocNonNullableType */ - || kind === 307 /* JSDocOptionalType */ - || kind === 308 /* JSDocFunctionType */ - || kind === 309 /* JSDocVariadicType */; + || kind === 149 /* UndefinedKeyword */ + || kind === 140 /* NeverKeyword */ + || kind === 220 /* ExpressionWithTypeArguments */ + || kind === 299 /* JSDocAllType */ + || kind === 300 /* JSDocUnknownType */ + || kind === 301 /* JSDocNullableType */ + || kind === 302 /* JSDocNonNullableType */ + || kind === 303 /* JSDocOptionalType */ + || kind === 304 /* JSDocFunctionType */ + || kind === 305 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 201 /* PropertyAccessExpression */ || node.kind === 202 /* ElementAccessExpression */; + return node.kind === 198 /* PropertyAccessExpression */ || node.kind === 199 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 201 /* PropertyAccessExpression */) { + if (node.kind === 198 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 202 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 199 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -18291,41 +17601,34 @@ var ts; } ts.isBundleFileTextLike = isBundleFileTextLike; function isNamedImportsOrExports(node) { - return node.kind === 264 /* NamedImports */ || node.kind === 268 /* NamedExports */; + return node.kind === 261 /* NamedImports */ || node.kind === 265 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; - function getLeftmostAccessExpression(expr) { - while (isAccessExpression(expr)) { - expr = expr.expression; - } - return expr; - } - ts.getLeftmostAccessExpression = getLeftmostAccessExpression; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: node = node.operand; continue; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: node = node.left; continue; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: node = node.condition; continue; - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: node = node.tag; continue; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 224 /* AsExpression */: - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: - case 225 /* NonNullExpression */: - case 336 /* PartiallyEmittedExpression */: + case 221 /* AsExpression */: + case 199 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 222 /* NonNullExpression */: + case 331 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -18344,7 +17647,7 @@ var ts; } function Type(checker, flags) { this.flags = flags; - if (ts.Debug.isDebugging || ts.tracing.isTracing()) { + if (ts.Debug.isDebugging) { this.checker = checker; } } @@ -18701,10 +18004,6 @@ var ts; return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag]; } ts.getStrictOptionValue = getStrictOptionValue; - function getAllowJSCompilerOption(compilerOptions) { - return compilerOptions.allowJs === undefined ? !!compilerOptions.checkJs : compilerOptions.allowJs; - } - ts.getAllowJSCompilerOption = getAllowJSCompilerOption; function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) { return oldOptions !== newOptions && ts.semanticDiagnosticsOptionDeclarations.some(function (option) { return !isJsonEqual(getCompilerOptionValue(oldOptions, option), getCompilerOptionValue(newOptions, option)); }); @@ -18719,26 +18018,6 @@ var ts; return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name]; } ts.getCompilerOptionValue = getCompilerOptionValue; - function getJSXTransformEnabled(options) { - var jsx = options.jsx; - return jsx === 2 /* React */ || jsx === 4 /* ReactJSX */ || jsx === 5 /* ReactJSXDev */; - } - ts.getJSXTransformEnabled = getJSXTransformEnabled; - function getJSXImplicitImportBase(compilerOptions, file) { - var jsxImportSourcePragmas = file === null || file === void 0 ? void 0 : file.pragmas.get("jsximportsource"); - var jsxImportSourcePragma = ts.isArray(jsxImportSourcePragmas) ? jsxImportSourcePragmas[0] : jsxImportSourcePragmas; - return compilerOptions.jsx === 4 /* ReactJSX */ || - compilerOptions.jsx === 5 /* ReactJSXDev */ || - compilerOptions.jsxImportSource || - jsxImportSourcePragma ? - (jsxImportSourcePragma === null || jsxImportSourcePragma === void 0 ? void 0 : jsxImportSourcePragma.arguments.factory) || compilerOptions.jsxImportSource || "react" : - undefined; - } - ts.getJSXImplicitImportBase = getJSXImplicitImportBase; - function getJSXRuntimeImport(base, options) { - return base ? base + "/" + (options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined; - } - ts.getJSXRuntimeImport = getJSXRuntimeImport; function hasZeroOrOneAsteriskCharacter(str) { var seenAsterisk = false; for (var i = 0; i < str.length; i++) { @@ -19118,7 +18397,7 @@ var ts; var allSupportedExtensions = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions); var allSupportedExtensionsWithJson = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions, [".json" /* Json */]); function getSupportedExtensions(options, extraFileExtensions) { - var needJsExtensions = options && getAllowJSCompilerOption(options); + var needJsExtensions = options && options.allowJs; if (!extraFileExtensions || extraFileExtensions.length === 0) { return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions; } @@ -19329,7 +18608,6 @@ var ts; if (!diagnostic.relatedInformation) { diagnostic.relatedInformation = []; } - ts.Debug.assert(diagnostic.relatedInformation !== ts.emptyArray, "Diagnostic had empty array singleton for related info, but is still being constructed!"); (_a = diagnostic.relatedInformation).push.apply(_a, relatedInformation); return diagnostic; } @@ -19458,38 +18736,38 @@ var ts; } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 270 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 267 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 78 /* Identifier */ || node.kind === 201 /* PropertyAccessExpression */) { + while (node.kind === 78 /* Identifier */ || node.kind === 198 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 158 /* ComputedPropertyName */) { + if (node.kind !== 157 /* ComputedPropertyName */) { return false; } if (hasSyntacticModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 253 /* InterfaceDeclaration */ || containerKind === 177 /* TypeLiteral */; + return containerKind === 250 /* InterfaceDeclaration */ || containerKind === 176 /* TypeLiteral */; } /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ function isIdentifierInNonEmittingHeritageClause(node) { if (node.kind !== 78 /* Identifier */) return false; - var heritageClause = ts.findAncestor(node.parent, function (parent) { + var heritageClause = findAncestor(node.parent, function (parent) { switch (parent.kind) { - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return true; - case 201 /* PropertyAccessExpression */: - case 223 /* ExpressionWithTypeArguments */: + case 198 /* PropertyAccessExpression */: + case 220 /* ExpressionWithTypeArguments */: return false; default: return "quit"; } }); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 253 /* InterfaceDeclaration */; + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 250 /* InterfaceDeclaration */; } function isIdentifierTypeReference(node) { return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName); @@ -19683,10 +18961,10 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(216 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(213 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(213 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 209 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { + if (!isLeftSideOfBinary && operand.kind === 206 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -19698,7 +18976,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 219 /* YieldExpression */) { + && operand.kind === 216 /* YieldExpression */) { return false; } return true; @@ -19786,7 +19064,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -19812,7 +19090,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 207 /* ParenthesizedExpression */) { + if (skipped.kind === 204 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -19829,7 +19107,7 @@ var ts; return ts.isCommaSequence(expression) ? factory.createParenthesizedExpression(expression) : expression; } function parenthesizeConditionOfConditionalExpression(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(217 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(214 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -19862,8 +19140,8 @@ var ts; var needsParens = ts.isCommaSequence(check); if (!needsParens) { switch (ts.getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: needsParens = true; } } @@ -19876,9 +19154,9 @@ var ts; function parenthesizeExpressionOfNew(expression) { var leftmostExpr = ts.getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: return factory.createParenthesizedExpression(expression); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return !leftmostExpr.arguments ? factory.createParenthesizedExpression(expression) : expression; // TODO(rbuckton): Verify this assertion holds @@ -19898,7 +19176,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 204 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 201 /* NewExpression */ || emittedExpression.arguments)) { // TODO(rbuckton): Verify whether this assertion holds. return expression; } @@ -19920,7 +19198,7 @@ var ts; function parenthesizeExpressionForDisallowedComma(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(213 /* BinaryExpression */, 27 /* CommaToken */); // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(factory.createParenthesizedExpression(expression), expression); } @@ -19929,44 +19207,44 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 208 /* FunctionExpression */ || kind === 209 /* ArrowFunction */) { + if (kind === 205 /* FunctionExpression */ || kind === 206 /* ArrowFunction */) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. var updated = factory.updateCallExpression(emittedExpression, ts.setTextRange(factory.createParenthesizedExpression(callee), callee), emittedExpression.typeArguments, emittedExpression.arguments); return factory.restoreOuterExpressions(expression, updated, 8 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = ts.getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 200 /* ObjectLiteralExpression */ || leftmostExpressionKind === 208 /* FunctionExpression */) { + if (leftmostExpressionKind === 197 /* ObjectLiteralExpression */ || leftmostExpressionKind === 205 /* FunctionExpression */) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return ts.setTextRange(factory.createParenthesizedExpression(expression), expression); } return expression; } function parenthesizeConciseBodyOfArrowFunction(body) { - if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 200 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 197 /* ObjectLiteralExpression */)) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return ts.setTextRange(factory.createParenthesizedExpression(body), body); } return body; } function parenthesizeMemberOfConditionalType(member) { - return member.kind === 184 /* ConditionalType */ ? factory.createParenthesizedType(member) : member; + return member.kind === 183 /* ConditionalType */ ? factory.createParenthesizedType(member) : member; } function parenthesizeMemberOfElementType(member) { switch (member.kind) { - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return factory.createParenthesizedType(member); } return parenthesizeMemberOfConditionalType(member); } function parenthesizeElementTypeOfArrayType(member) { switch (member.kind) { - case 176 /* TypeQuery */: - case 188 /* TypeOperator */: - case 185 /* InferType */: + case 175 /* TypeQuery */: + case 187 /* TypeOperator */: + case 184 /* InferType */: return factory.createParenthesizedType(member); } return parenthesizeMemberOfElementType(member); @@ -20070,11 +19348,11 @@ var ts; } function convertToAssignmentPattern(node) { switch (node.kind) { - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 196 /* ObjectBindingPattern */: - case 200 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 197 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -20202,8 +19480,6 @@ var ts; updateConstructSignature: updateConstructSignature, createIndexSignature: createIndexSignature, updateIndexSignature: updateIndexSignature, - createTemplateLiteralTypeSpan: createTemplateLiteralTypeSpan, - updateTemplateLiteralTypeSpan: updateTemplateLiteralTypeSpan, createKeywordTypeNode: createKeywordTypeNode, createTypePredicateNode: createTypePredicateNode, updateTypePredicateNode: updateTypePredicateNode, @@ -20248,8 +19524,6 @@ var ts; updateMappedTypeNode: updateMappedTypeNode, createLiteralTypeNode: createLiteralTypeNode, updateLiteralTypeNode: updateLiteralTypeNode, - createTemplateLiteralType: createTemplateLiteralType, - updateTemplateLiteralType: updateTemplateLiteralType, createObjectBindingPattern: createObjectBindingPattern, updateObjectBindingPattern: updateObjectBindingPattern, createArrayBindingPattern: createArrayBindingPattern, @@ -20415,18 +19689,18 @@ var ts; createExternalModuleReference: createExternalModuleReference, updateExternalModuleReference: updateExternalModuleReference, // lazily load factory members for JSDoc types with similar structure - get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(303 /* JSDocAllType */); }, - get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(304 /* JSDocUnknownType */); }, - get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(306 /* JSDocNonNullableType */); }, - get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(306 /* JSDocNonNullableType */); }, - get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(305 /* JSDocNullableType */); }, - get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(305 /* JSDocNullableType */); }, - get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(307 /* JSDocOptionalType */); }, - get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(307 /* JSDocOptionalType */); }, - get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(309 /* JSDocVariadicType */); }, - get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(309 /* JSDocVariadicType */); }, - get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(310 /* JSDocNamepathType */); }, - get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(310 /* JSDocNamepathType */); }, + get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(299 /* JSDocAllType */); }, + get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(300 /* JSDocUnknownType */); }, + get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(302 /* JSDocNonNullableType */); }, + get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(302 /* JSDocNonNullableType */); }, + get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(301 /* JSDocNullableType */); }, + get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(301 /* JSDocNullableType */); }, + get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(303 /* JSDocOptionalType */); }, + get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(303 /* JSDocOptionalType */); }, + get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(305 /* JSDocVariadicType */); }, + get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(305 /* JSDocVariadicType */); }, + get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(306 /* JSDocNamepathType */); }, + get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(306 /* JSDocNamepathType */); }, createJSDocFunctionType: createJSDocFunctionType, updateJSDocFunctionType: updateJSDocFunctionType, createJSDocTypeLiteral: createJSDocTypeLiteral, @@ -20449,33 +19723,29 @@ var ts; updateJSDocAugmentsTag: updateJSDocAugmentsTag, createJSDocImplementsTag: createJSDocImplementsTag, updateJSDocImplementsTag: updateJSDocImplementsTag, - createJSDocSeeTag: createJSDocSeeTag, - updateJSDocSeeTag: updateJSDocSeeTag, - createJSDocNameReference: createJSDocNameReference, - updateJSDocNameReference: updateJSDocNameReference, // lazily load factory members for JSDoc tags with similar structure - get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(329 /* JSDocTypeTag */); }, - get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(329 /* JSDocTypeTag */); }, - get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(327 /* JSDocReturnTag */); }, - get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(327 /* JSDocReturnTag */); }, - get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(328 /* JSDocThisTag */); }, - get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(328 /* JSDocThisTag */); }, - get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(325 /* JSDocEnumTag */); }, - get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(325 /* JSDocEnumTag */); }, - get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(317 /* JSDocAuthorTag */); }, - get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(317 /* JSDocAuthorTag */); }, - get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(319 /* JSDocClassTag */); }, - get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(319 /* JSDocClassTag */); }, - get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(320 /* JSDocPublicTag */); }, - get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(320 /* JSDocPublicTag */); }, - get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(321 /* JSDocPrivateTag */); }, - get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(321 /* JSDocPrivateTag */); }, - get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(322 /* JSDocProtectedTag */); }, - get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(322 /* JSDocProtectedTag */); }, - get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(323 /* JSDocReadonlyTag */); }, - get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(323 /* JSDocReadonlyTag */); }, - get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(318 /* JSDocDeprecatedTag */); }, - get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(318 /* JSDocDeprecatedTag */); }, + get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(325 /* JSDocTypeTag */); }, + get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(325 /* JSDocTypeTag */); }, + get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(323 /* JSDocReturnTag */); }, + get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(323 /* JSDocReturnTag */); }, + get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(324 /* JSDocThisTag */); }, + get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(324 /* JSDocThisTag */); }, + get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(321 /* JSDocEnumTag */); }, + get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(321 /* JSDocEnumTag */); }, + get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(313 /* JSDocAuthorTag */); }, + get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(313 /* JSDocAuthorTag */); }, + get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(315 /* JSDocClassTag */); }, + get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(315 /* JSDocClassTag */); }, + get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(316 /* JSDocPublicTag */); }, + get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(316 /* JSDocPublicTag */); }, + get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(317 /* JSDocPrivateTag */); }, + get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(317 /* JSDocPrivateTag */); }, + get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(318 /* JSDocProtectedTag */); }, + get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(318 /* JSDocProtectedTag */); }, + get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(319 /* JSDocReadonlyTag */); }, + get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(319 /* JSDocReadonlyTag */); }, + get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(314 /* JSDocDeprecatedTag */); }, + get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(314 /* JSDocDeprecatedTag */); }, createJSDocUnknownTag: createJSDocUnknownTag, updateJSDocUnknownTag: updateJSDocUnknownTag, createJSDocComment: createJSDocComment, @@ -20620,7 +19890,6 @@ var ts; if (elements.transformFlags === undefined) { aggregateChildrenFlags(elements); } - ts.Debug.attachNodeArrayDebugInfo(elements); return elements; } // Since the element list of a node array is typically created by starting with an empty array and @@ -20631,7 +19900,6 @@ var ts; ts.setTextRangePosEnd(array, -1, -1); array.hasTrailingComma = !!hasTrailingComma; aggregateChildrenFlags(array); - ts.Debug.attachNodeArrayDebugInfo(array); return array; } function createBaseNode(kind) { @@ -20661,11 +19929,11 @@ var ts; // don't propagate child flags. if (name) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: if (ts.isIdentifier(name)) { node.transformFlags |= propagateIdentifierNameFlags(name); break; @@ -20893,7 +20161,7 @@ var ts; return baseFactory.createBaseTokenNode(kind); } function createToken(token) { - ts.Debug.assert(token >= 0 /* FirstToken */ && token <= 156 /* LastToken */, "Invalid token"); + ts.Debug.assert(token >= 0 /* FirstToken */ && token <= 155 /* LastToken */, "Invalid token"); ts.Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); ts.Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals."); ts.Debug.assert(token !== 78 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers"); @@ -20909,21 +20177,21 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 125 /* AbstractKeyword */: case 133 /* DeclareKeyword */: case 84 /* ConstKeyword */: case 128 /* AnyKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 141 /* NeverKeyword */: - case 145 /* ObjectKeyword */: - case 147 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 140 /* NeverKeyword */: + case 144 /* ObjectKeyword */: + case 146 /* StringKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: case 113 /* VoidKeyword */: - case 152 /* UnknownKeyword */: - case 150 /* UndefinedKeyword */: // `undefined` is an Identifier in the expression case. + case 151 /* UnknownKeyword */: + case 149 /* UndefinedKeyword */: // `undefined` is an Identifier in the expression case. transformFlags = 1 /* ContainsTypeScript */; break; case 123 /* StaticKeyword */: @@ -21001,7 +20269,7 @@ var ts; result.push(createModifier(123 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(142 /* ReadonlyKeyword */)); + result.push(createModifier(141 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(129 /* AsyncKeyword */)); @@ -21013,7 +20281,7 @@ var ts; // // @api function createQualifiedName(left, right) { - var node = createBaseNode(157 /* QualifiedName */); + var node = createBaseNode(156 /* QualifiedName */); node.left = left; node.right = asName(right); node.transformFlags |= @@ -21030,7 +20298,7 @@ var ts; } // @api function createComputedPropertyName(expression) { - var node = createBaseNode(158 /* ComputedPropertyName */); + var node = createBaseNode(157 /* ComputedPropertyName */); node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -21049,7 +20317,7 @@ var ts; // // @api function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createBaseNamedDeclaration(159 /* TypeParameter */, + var node = createBaseNamedDeclaration(158 /* TypeParameter */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.constraint = constraint; @@ -21067,7 +20335,7 @@ var ts; } // @api function createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(160 /* Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); + var node = createBaseVariableLikeDeclaration(159 /* Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); node.dotDotDotToken = dotDotDotToken; node.questionToken = questionToken; if (ts.isThisIdentifier(node.name)) { @@ -21100,7 +20368,7 @@ var ts; } // @api function createDecorator(expression) { - var node = createBaseNode(161 /* Decorator */); + var node = createBaseNode(160 /* Decorator */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -21119,7 +20387,7 @@ var ts; // // @api function createPropertySignature(modifiers, name, questionToken, type) { - var node = createBaseNamedDeclaration(162 /* PropertySignature */, + var node = createBaseNamedDeclaration(161 /* PropertySignature */, /*decorators*/ undefined, modifiers, name); node.type = type; node.questionToken = questionToken; @@ -21137,7 +20405,7 @@ var ts; } // @api function createPropertyDeclaration(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(163 /* PropertyDeclaration */, decorators, modifiers, name, type, initializer); + var node = createBaseVariableLikeDeclaration(162 /* PropertyDeclaration */, decorators, modifiers, name, type, initializer); node.questionToken = questionOrExclamationToken && ts.isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined; node.exclamationToken = questionOrExclamationToken && ts.isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined; node.transformFlags |= @@ -21166,7 +20434,7 @@ var ts; } // @api function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(164 /* MethodSignature */, + var node = createBaseSignatureDeclaration(163 /* MethodSignature */, /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type); node.questionToken = questionToken; node.transformFlags = 1 /* ContainsTypeScript */; @@ -21185,7 +20453,7 @@ var ts; } // @api function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(165 /* MethodDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); + var node = createBaseFunctionLikeDeclaration(164 /* MethodDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; node.questionToken = questionToken; node.transformFlags |= @@ -21224,7 +20492,7 @@ var ts; } // @api function createConstructorDeclaration(decorators, modifiers, parameters, body) { - var node = createBaseFunctionLikeDeclaration(166 /* Constructor */, decorators, modifiers, + var node = createBaseFunctionLikeDeclaration(165 /* Constructor */, decorators, modifiers, /*name*/ undefined, /*typeParameters*/ undefined, parameters, /*type*/ undefined, body); @@ -21242,7 +20510,7 @@ var ts; } // @api function createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) { - return createBaseFunctionLikeDeclaration(167 /* GetAccessor */, decorators, modifiers, name, + return createBaseFunctionLikeDeclaration(166 /* GetAccessor */, decorators, modifiers, name, /*typeParameters*/ undefined, parameters, type, body); } // @api @@ -21258,7 +20526,7 @@ var ts; } // @api function createSetAccessorDeclaration(decorators, modifiers, name, parameters, body) { - return createBaseFunctionLikeDeclaration(168 /* SetAccessor */, decorators, modifiers, name, + return createBaseFunctionLikeDeclaration(167 /* SetAccessor */, decorators, modifiers, name, /*typeParameters*/ undefined, parameters, /*type*/ undefined, body); } @@ -21274,7 +20542,7 @@ var ts; } // @api function createCallSignature(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(169 /* CallSignature */, + var node = createBaseSignatureDeclaration(168 /* CallSignature */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21291,7 +20559,7 @@ var ts; } // @api function createConstructSignature(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(170 /* ConstructSignature */, + var node = createBaseSignatureDeclaration(169 /* ConstructSignature */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21308,7 +20576,7 @@ var ts; } // @api function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createBaseSignatureDeclaration(171 /* IndexSignature */, decorators, modifiers, + var node = createBaseSignatureDeclaration(170 /* IndexSignature */, decorators, modifiers, /*name*/ undefined, /*typeParameters*/ undefined, parameters, type); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21323,21 +20591,6 @@ var ts; ? updateBaseSignatureDeclaration(createIndexSignature(decorators, modifiers, parameters, type), node) : node; } - // @api - function createTemplateLiteralTypeSpan(type, literal) { - var node = createBaseNode(194 /* TemplateLiteralTypeSpan */); - node.type = type; - node.literal = literal; - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - // @api - function updateTemplateLiteralTypeSpan(node, type, literal) { - return node.type !== type - || node.literal !== literal - ? update(createTemplateLiteralTypeSpan(type, literal), node) - : node; - } // // Types // @@ -21347,7 +20600,7 @@ var ts; } // @api function createTypePredicateNode(assertsModifier, parameterName, type) { - var node = createBaseNode(172 /* TypePredicate */); + var node = createBaseNode(171 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -21364,7 +20617,7 @@ var ts; } // @api function createTypeReferenceNode(typeName, typeArguments) { - var node = createBaseNode(173 /* TypeReference */); + var node = createBaseNode(172 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21379,7 +20632,7 @@ var ts; } // @api function createFunctionTypeNode(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(174 /* FunctionType */, + var node = createBaseSignatureDeclaration(173 /* FunctionType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21396,7 +20649,7 @@ var ts; } // @api function createConstructorTypeNode(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(175 /* ConstructorType */, + var node = createBaseSignatureDeclaration(174 /* ConstructorType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21413,7 +20666,7 @@ var ts; } // @api function createTypeQueryNode(exprName) { - var node = createBaseNode(176 /* TypeQuery */); + var node = createBaseNode(175 /* TypeQuery */); node.exprName = exprName; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21426,7 +20679,7 @@ var ts; } // @api function createTypeLiteralNode(members) { - var node = createBaseNode(177 /* TypeLiteral */); + var node = createBaseNode(176 /* TypeLiteral */); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21439,7 +20692,7 @@ var ts; } // @api function createArrayTypeNode(elementType) { - var node = createBaseNode(178 /* ArrayType */); + var node = createBaseNode(177 /* ArrayType */); node.elementType = parenthesizerRules().parenthesizeElementTypeOfArrayType(elementType); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21452,7 +20705,7 @@ var ts; } // @api function createTupleTypeNode(elements) { - var node = createBaseNode(179 /* TupleType */); + var node = createBaseNode(178 /* TupleType */); node.elements = createNodeArray(elements); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21465,7 +20718,7 @@ var ts; } // @api function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { - var node = createBaseNode(192 /* NamedTupleMember */); + var node = createBaseNode(191 /* NamedTupleMember */); node.dotDotDotToken = dotDotDotToken; node.name = name; node.questionToken = questionToken; @@ -21484,7 +20737,7 @@ var ts; } // @api function createOptionalTypeNode(type) { - var node = createBaseNode(180 /* OptionalType */); + var node = createBaseNode(179 /* OptionalType */); node.type = parenthesizerRules().parenthesizeElementTypeOfArrayType(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21497,7 +20750,7 @@ var ts; } // @api function createRestTypeNode(type) { - var node = createBaseNode(181 /* RestType */); + var node = createBaseNode(180 /* RestType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21521,7 +20774,7 @@ var ts; } // @api function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(182 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(181 /* UnionType */, types); } // @api function updateUnionTypeNode(node, types) { @@ -21529,7 +20782,7 @@ var ts; } // @api function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(183 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(182 /* IntersectionType */, types); } // @api function updateIntersectionTypeNode(node, types) { @@ -21537,7 +20790,7 @@ var ts; } // @api function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createBaseNode(184 /* ConditionalType */); + var node = createBaseNode(183 /* ConditionalType */); node.checkType = parenthesizerRules().parenthesizeMemberOfConditionalType(checkType); node.extendsType = parenthesizerRules().parenthesizeMemberOfConditionalType(extendsType); node.trueType = trueType; @@ -21556,7 +20809,7 @@ var ts; } // @api function createInferTypeNode(typeParameter) { - var node = createBaseNode(185 /* InferType */); + var node = createBaseNode(184 /* InferType */); node.typeParameter = typeParameter; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21568,24 +20821,9 @@ var ts; : node; } // @api - function createTemplateLiteralType(head, templateSpans) { - var node = createBaseNode(193 /* TemplateLiteralType */); - node.head = head; - node.templateSpans = createNodeArray(templateSpans); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - // @api - function updateTemplateLiteralType(node, head, templateSpans) { - return node.head !== head - || node.templateSpans !== templateSpans - ? update(createTemplateLiteralType(head, templateSpans), node) - : node; - } - // @api function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { if (isTypeOf === void 0) { isTypeOf = false; } - var node = createBaseNode(195 /* ImportType */); + var node = createBaseNode(192 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); @@ -21605,7 +20843,7 @@ var ts; } // @api function createParenthesizedType(type) { - var node = createBaseNode(186 /* ParenthesizedType */); + var node = createBaseNode(185 /* ParenthesizedType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21618,13 +20856,13 @@ var ts; } // @api function createThisTypeNode() { - var node = createBaseNode(187 /* ThisType */); + var node = createBaseNode(186 /* ThisType */); node.transformFlags = 1 /* ContainsTypeScript */; return node; } // @api function createTypeOperatorNode(operator, type) { - var node = createBaseNode(188 /* TypeOperator */); + var node = createBaseNode(187 /* TypeOperator */); node.operator = operator; node.type = parenthesizerRules().parenthesizeMemberOfElementType(type); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21638,7 +20876,7 @@ var ts; } // @api function createIndexedAccessTypeNode(objectType, indexType) { - var node = createBaseNode(189 /* IndexedAccessType */); + var node = createBaseNode(188 /* IndexedAccessType */); node.objectType = parenthesizerRules().parenthesizeMemberOfElementType(objectType); node.indexType = indexType; node.transformFlags = 1 /* ContainsTypeScript */; @@ -21652,29 +20890,27 @@ var ts; : node; } // @api - function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type) { - var node = createBaseNode(190 /* MappedType */); + function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { + var node = createBaseNode(189 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; - node.nameType = nameType; node.questionToken = questionToken; node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; } // @api - function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type) { + function updateMappedTypeNode(node, readonlyToken, typeParameter, questionToken, type) { return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter - || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type - ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), node) + ? update(createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), node) : node; } // @api function createLiteralTypeNode(literal) { - var node = createBaseNode(191 /* LiteralType */); + var node = createBaseNode(190 /* LiteralType */); node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21690,7 +20926,7 @@ var ts; // // @api function createObjectBindingPattern(elements) { - var node = createBaseNode(196 /* ObjectBindingPattern */); + var node = createBaseNode(193 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | @@ -21711,7 +20947,7 @@ var ts; } // @api function createArrayBindingPattern(elements) { - var node = createBaseNode(197 /* ArrayBindingPattern */); + var node = createBaseNode(194 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | @@ -21727,7 +20963,7 @@ var ts; } // @api function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createBaseBindingLikeDeclaration(198 /* BindingElement */, + var node = createBaseBindingLikeDeclaration(195 /* BindingElement */, /*decorators*/ undefined, /*modifiers*/ undefined, name, initializer); node.propertyName = asName(propertyName); @@ -21763,7 +20999,7 @@ var ts; } // @api function createArrayLiteralExpression(elements, multiLine) { - var node = createBaseExpression(199 /* ArrayLiteralExpression */); + var node = createBaseExpression(196 /* ArrayLiteralExpression */); node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(elements)); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.elements); @@ -21777,7 +21013,7 @@ var ts; } // @api function createObjectLiteralExpression(properties, multiLine) { - var node = createBaseExpression(200 /* ObjectLiteralExpression */); + var node = createBaseExpression(197 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); @@ -21791,7 +21027,7 @@ var ts; } // @api function createPropertyAccessExpression(expression, name) { - var node = createBaseExpression(201 /* PropertyAccessExpression */); + var node = createBaseExpression(198 /* PropertyAccessExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.name = asName(name); node.transformFlags = @@ -21820,7 +21056,7 @@ var ts; } // @api function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createBaseExpression(201 /* PropertyAccessExpression */); + var node = createBaseExpression(198 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -21847,7 +21083,7 @@ var ts; } // @api function createElementAccessExpression(expression, index) { - var node = createBaseExpression(202 /* ElementAccessExpression */); + var node = createBaseExpression(199 /* ElementAccessExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.argumentExpression = asExpression(index); node.transformFlags |= @@ -21874,7 +21110,7 @@ var ts; } // @api function createElementAccessChain(expression, questionDotToken, index) { - var node = createBaseExpression(202 /* ElementAccessExpression */); + var node = createBaseExpression(199 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -21899,7 +21135,7 @@ var ts; } // @api function createCallExpression(expression, typeArguments, argumentsArray) { - var node = createBaseExpression(203 /* CallExpression */); + var node = createBaseExpression(200 /* CallExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)); @@ -21931,7 +21167,7 @@ var ts; } // @api function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createBaseExpression(203 /* CallExpression */); + var node = createBaseExpression(200 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -21963,7 +21199,7 @@ var ts; } // @api function createNewExpression(expression, typeArguments, argumentsArray) { - var node = createBaseExpression(204 /* NewExpression */); + var node = createBaseExpression(201 /* NewExpression */); node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : undefined; @@ -21987,7 +21223,7 @@ var ts; } // @api function createTaggedTemplateExpression(tag, typeArguments, template) { - var node = createBaseExpression(205 /* TaggedTemplateExpression */); + var node = createBaseExpression(202 /* TaggedTemplateExpression */); node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag); node.typeArguments = asNodeArray(typeArguments); node.template = template; @@ -22014,7 +21250,7 @@ var ts; } // @api function createTypeAssertion(type, expression) { - var node = createBaseExpression(206 /* TypeAssertionExpression */); + var node = createBaseExpression(203 /* TypeAssertionExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.type = type; node.transformFlags |= @@ -22032,7 +21268,7 @@ var ts; } // @api function createParenthesizedExpression(expression) { - var node = createBaseExpression(207 /* ParenthesizedExpression */); + var node = createBaseExpression(204 /* ParenthesizedExpression */); node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); return node; @@ -22045,7 +21281,7 @@ var ts; } // @api function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(208 /* FunctionExpression */, + var node = createBaseFunctionLikeDeclaration(205 /* FunctionExpression */, /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; node.transformFlags |= propagateChildFlags(node.asteriskToken); @@ -22079,7 +21315,7 @@ var ts; } // @api function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createBaseFunctionLikeDeclaration(209 /* ArrowFunction */, + var node = createBaseFunctionLikeDeclaration(206 /* ArrowFunction */, /*decorators*/ undefined, modifiers, /*name*/ undefined, typeParameters, parameters, type, parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body)); node.equalsGreaterThanToken = equalsGreaterThanToken !== null && equalsGreaterThanToken !== void 0 ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */); @@ -22104,7 +21340,7 @@ var ts; } // @api function createDeleteExpression(expression) { - var node = createBaseExpression(210 /* DeleteExpression */); + var node = createBaseExpression(207 /* DeleteExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22117,7 +21353,7 @@ var ts; } // @api function createTypeOfExpression(expression) { - var node = createBaseExpression(211 /* TypeOfExpression */); + var node = createBaseExpression(208 /* TypeOfExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22130,7 +21366,7 @@ var ts; } // @api function createVoidExpression(expression) { - var node = createBaseExpression(212 /* VoidExpression */); + var node = createBaseExpression(209 /* VoidExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22143,7 +21379,7 @@ var ts; } // @api function createAwaitExpression(expression) { - var node = createBaseExpression(213 /* AwaitExpression */); + var node = createBaseExpression(210 /* AwaitExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22160,7 +21396,7 @@ var ts; } // @api function createPrefixUnaryExpression(operator, operand) { - var node = createBaseExpression(214 /* PrefixUnaryExpression */); + var node = createBaseExpression(211 /* PrefixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand); node.transformFlags |= propagateChildFlags(node.operand); @@ -22174,7 +21410,7 @@ var ts; } // @api function createPostfixUnaryExpression(operand, operator) { - var node = createBaseExpression(215 /* PostfixUnaryExpression */); + var node = createBaseExpression(212 /* PostfixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand); node.transformFlags = propagateChildFlags(node.operand); @@ -22188,7 +21424,7 @@ var ts; } // @api function createBinaryExpression(left, operator, right) { - var node = createBaseExpression(216 /* BinaryExpression */); + var node = createBaseExpression(213 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left); @@ -22206,14 +21442,12 @@ var ts; node.transformFlags |= 256 /* ContainsES2015 */ | 32 /* ContainsES2018 */ | - 1024 /* ContainsDestructuringAssignment */ | - propagateAssignmentPatternFlags(node.left); + 1024 /* ContainsDestructuringAssignment */; } else if (ts.isArrayLiteralExpression(node.left)) { node.transformFlags |= 256 /* ContainsES2015 */ | - 1024 /* ContainsDestructuringAssignment */ | - propagateAssignmentPatternFlags(node.left); + 1024 /* ContainsDestructuringAssignment */; } } else if (operatorKind === 42 /* AsteriskAsteriskToken */ || operatorKind === 66 /* AsteriskAsteriskEqualsToken */) { @@ -22224,29 +21458,6 @@ var ts; } return node; } - function propagateAssignmentPatternFlags(node) { - if (node.transformFlags & 16384 /* ContainsObjectRestOrSpread */) - return 16384 /* ContainsObjectRestOrSpread */; - if (node.transformFlags & 32 /* ContainsES2018 */) { - // check for nested spread assignments, otherwise '{ x: { a, ...b } = foo } = c' - // will not be correctly interpreted by the ES2018 transformer - for (var _i = 0, _a = ts.getElementsOfBindingOrAssignmentPattern(node); _i < _a.length; _i++) { - var element = _a[_i]; - var target = ts.getTargetOfBindingOrAssignmentElement(element); - if (target && ts.isAssignmentPattern(target)) { - if (target.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { - return 16384 /* ContainsObjectRestOrSpread */; - } - if (target.transformFlags & 32 /* ContainsES2018 */) { - var flags_1 = propagateAssignmentPatternFlags(target); - if (flags_1) - return flags_1; - } - } - } - } - return 0 /* None */; - } // @api function updateBinaryExpression(node, left, operator, right) { return node.left !== left @@ -22257,7 +21468,7 @@ var ts; } // @api function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { - var node = createBaseExpression(217 /* ConditionalExpression */); + var node = createBaseExpression(214 /* ConditionalExpression */); node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); node.questionToken = questionToken !== null && questionToken !== void 0 ? questionToken : createToken(57 /* QuestionToken */); node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); @@ -22283,7 +21494,7 @@ var ts; } // @api function createTemplateExpression(head, templateSpans) { - var node = createBaseExpression(218 /* TemplateExpression */); + var node = createBaseExpression(215 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); node.transformFlags |= @@ -22353,7 +21564,7 @@ var ts; // @api function createYieldExpression(asteriskToken, expression) { ts.Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression."); - var node = createBaseExpression(219 /* YieldExpression */); + var node = createBaseExpression(216 /* YieldExpression */); node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.asteriskToken = asteriskToken; node.transformFlags |= @@ -22373,7 +21584,7 @@ var ts; } // @api function createSpreadElement(expression) { - var node = createBaseExpression(220 /* SpreadElement */); + var node = createBaseExpression(217 /* SpreadElement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22389,7 +21600,7 @@ var ts; } // @api function createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseClassLikeDeclaration(221 /* ClassExpression */, decorators, modifiers, name, typeParameters, heritageClauses, members); + var node = createBaseClassLikeDeclaration(218 /* ClassExpression */, decorators, modifiers, name, typeParameters, heritageClauses, members); node.transformFlags |= 256 /* ContainsES2015 */; return node; } @@ -22406,11 +21617,11 @@ var ts; } // @api function createOmittedExpression() { - return createBaseExpression(222 /* OmittedExpression */); + return createBaseExpression(219 /* OmittedExpression */); } // @api function createExpressionWithTypeArguments(expression, typeArguments) { - var node = createBaseNode(223 /* ExpressionWithTypeArguments */); + var node = createBaseNode(220 /* ExpressionWithTypeArguments */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.transformFlags |= @@ -22428,7 +21639,7 @@ var ts; } // @api function createAsExpression(expression, type) { - var node = createBaseExpression(224 /* AsExpression */); + var node = createBaseExpression(221 /* AsExpression */); node.expression = expression; node.type = type; node.transformFlags |= @@ -22446,7 +21657,7 @@ var ts; } // @api function createNonNullExpression(expression) { - var node = createBaseExpression(225 /* NonNullExpression */); + var node = createBaseExpression(222 /* NonNullExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22464,7 +21675,7 @@ var ts; } // @api function createNonNullChain(expression) { - var node = createBaseExpression(225 /* NonNullExpression */); + var node = createBaseExpression(222 /* NonNullExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= @@ -22481,7 +21692,7 @@ var ts; } // @api function createMetaProperty(keywordToken, name) { - var node = createBaseExpression(226 /* MetaProperty */); + var node = createBaseExpression(223 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; node.transformFlags |= propagateChildFlags(node.name); @@ -22508,7 +21719,7 @@ var ts; // // @api function createTemplateSpan(expression, literal) { - var node = createBaseNode(228 /* TemplateSpan */); + var node = createBaseNode(225 /* TemplateSpan */); node.expression = expression; node.literal = literal; node.transformFlags |= @@ -22526,7 +21737,7 @@ var ts; } // @api function createSemicolonClassElement() { - var node = createBaseNode(229 /* SemicolonClassElement */); + var node = createBaseNode(226 /* SemicolonClassElement */); node.transformFlags |= 256 /* ContainsES2015 */; return node; } @@ -22535,7 +21746,7 @@ var ts; // // @api function createBlock(statements, multiLine) { - var node = createBaseNode(230 /* Block */); + var node = createBaseNode(227 /* Block */); node.statements = createNodeArray(statements); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); @@ -22549,7 +21760,7 @@ var ts; } // @api function createVariableStatement(modifiers, declarationList) { - var node = createBaseDeclaration(232 /* VariableStatement */, /*decorators*/ undefined, modifiers); + var node = createBaseDeclaration(229 /* VariableStatement */, /*decorators*/ undefined, modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; node.transformFlags |= propagateChildFlags(node.declarationList); @@ -22567,11 +21778,11 @@ var ts; } // @api function createEmptyStatement() { - return createBaseNode(231 /* EmptyStatement */); + return createBaseNode(228 /* EmptyStatement */); } // @api function createExpressionStatement(expression) { - var node = createBaseNode(233 /* ExpressionStatement */); + var node = createBaseNode(230 /* ExpressionStatement */); node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22584,7 +21795,7 @@ var ts; } // @api function createIfStatement(expression, thenStatement, elseStatement) { - var node = createBaseNode(234 /* IfStatement */); + var node = createBaseNode(231 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -22604,7 +21815,7 @@ var ts; } // @api function createDoStatement(statement, expression) { - var node = createBaseNode(235 /* DoStatement */); + var node = createBaseNode(232 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; node.transformFlags |= @@ -22621,7 +21832,7 @@ var ts; } // @api function createWhileStatement(expression, statement) { - var node = createBaseNode(236 /* WhileStatement */); + var node = createBaseNode(233 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22638,7 +21849,7 @@ var ts; } // @api function createForStatement(initializer, condition, incrementor, statement) { - var node = createBaseNode(237 /* ForStatement */); + var node = createBaseNode(234 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -22661,7 +21872,7 @@ var ts; } // @api function createForInStatement(initializer, expression, statement) { - var node = createBaseNode(238 /* ForInStatement */); + var node = createBaseNode(235 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -22681,7 +21892,7 @@ var ts; } // @api function createForOfStatement(awaitModifier, initializer, expression, statement) { - var node = createBaseNode(239 /* ForOfStatement */); + var node = createBaseNode(236 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); @@ -22707,7 +21918,7 @@ var ts; } // @api function createContinueStatement(label) { - var node = createBaseNode(240 /* ContinueStatement */); + var node = createBaseNode(237 /* ContinueStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | @@ -22722,7 +21933,7 @@ var ts; } // @api function createBreakStatement(label) { - var node = createBaseNode(241 /* BreakStatement */); + var node = createBaseNode(238 /* BreakStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | @@ -22737,7 +21948,7 @@ var ts; } // @api function createReturnStatement(expression) { - var node = createBaseNode(242 /* ReturnStatement */); + var node = createBaseNode(239 /* ReturnStatement */); node.expression = expression; // return in an ES2018 async generator must be awaited node.transformFlags |= @@ -22754,7 +21965,7 @@ var ts; } // @api function createWithStatement(expression, statement) { - var node = createBaseNode(243 /* WithStatement */); + var node = createBaseNode(240 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22771,7 +21982,7 @@ var ts; } // @api function createSwitchStatement(expression, caseBlock) { - var node = createBaseNode(244 /* SwitchStatement */); + var node = createBaseNode(241 /* SwitchStatement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.caseBlock = caseBlock; node.transformFlags |= @@ -22788,7 +21999,7 @@ var ts; } // @api function createLabeledStatement(label, statement) { - var node = createBaseNode(245 /* LabeledStatement */); + var node = createBaseNode(242 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22805,7 +22016,7 @@ var ts; } // @api function createThrowStatement(expression) { - var node = createBaseNode(246 /* ThrowStatement */); + var node = createBaseNode(243 /* ThrowStatement */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22818,7 +22029,7 @@ var ts; } // @api function createTryStatement(tryBlock, catchClause, finallyBlock) { - var node = createBaseNode(247 /* TryStatement */); + var node = createBaseNode(244 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -22838,11 +22049,11 @@ var ts; } // @api function createDebuggerStatement() { - return createBaseNode(248 /* DebuggerStatement */); + return createBaseNode(245 /* DebuggerStatement */); } // @api function createVariableDeclaration(name, exclamationToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(249 /* VariableDeclaration */, + var node = createBaseVariableLikeDeclaration(246 /* VariableDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); node.exclamationToken = exclamationToken; @@ -22864,7 +22075,7 @@ var ts; // @api function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createBaseNode(250 /* VariableDeclarationList */); + var node = createBaseNode(247 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); node.transformFlags |= @@ -22885,7 +22096,7 @@ var ts; } // @api function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(251 /* FunctionDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); + var node = createBaseFunctionLikeDeclaration(248 /* FunctionDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; if (!node.body || ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; @@ -22923,7 +22134,7 @@ var ts; } // @api function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseClassLikeDeclaration(252 /* ClassDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses, members); + var node = createBaseClassLikeDeclaration(249 /* ClassDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses, members); if (ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } @@ -22948,7 +22159,7 @@ var ts; } // @api function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseInterfaceOrClassLikeDeclaration(253 /* InterfaceDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses); + var node = createBaseInterfaceOrClassLikeDeclaration(250 /* InterfaceDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -22966,7 +22177,7 @@ var ts; } // @api function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createBaseGenericNamedDeclaration(254 /* TypeAliasDeclaration */, decorators, modifiers, name, typeParameters); + var node = createBaseGenericNamedDeclaration(251 /* TypeAliasDeclaration */, decorators, modifiers, name, typeParameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -22983,7 +22194,7 @@ var ts; } // @api function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createBaseNamedDeclaration(255 /* EnumDeclaration */, decorators, modifiers, name); + var node = createBaseNamedDeclaration(252 /* EnumDeclaration */, decorators, modifiers, name); node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.members) | @@ -23003,7 +22214,7 @@ var ts; // @api function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createBaseDeclaration(256 /* ModuleDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(253 /* ModuleDeclaration */, decorators, modifiers); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.name = name; node.body = body; @@ -23030,7 +22241,7 @@ var ts; } // @api function createModuleBlock(statements) { - var node = createBaseNode(257 /* ModuleBlock */); + var node = createBaseNode(254 /* ModuleBlock */); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); return node; @@ -23043,7 +22254,7 @@ var ts; } // @api function createCaseBlock(clauses) { - var node = createBaseNode(258 /* CaseBlock */); + var node = createBaseNode(255 /* CaseBlock */); node.clauses = createNodeArray(clauses); node.transformFlags |= propagateChildrenFlags(node.clauses); return node; @@ -23056,7 +22267,7 @@ var ts; } // @api function createNamespaceExportDeclaration(name) { - var node = createBaseNamedDeclaration(259 /* NamespaceExportDeclaration */, + var node = createBaseNamedDeclaration(256 /* NamespaceExportDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.transformFlags = 1 /* ContainsTypeScript */; @@ -23070,7 +22281,7 @@ var ts; } // @api function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createBaseNamedDeclaration(260 /* ImportEqualsDeclaration */, decorators, modifiers, name); + var node = createBaseNamedDeclaration(257 /* ImportEqualsDeclaration */, decorators, modifiers, name); node.moduleReference = moduleReference; node.transformFlags |= propagateChildFlags(node.moduleReference); if (!ts.isExternalModuleReference(node.moduleReference)) @@ -23089,7 +22300,7 @@ var ts; } // @api function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createBaseDeclaration(261 /* ImportDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(258 /* ImportDeclaration */, decorators, modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; node.transformFlags |= @@ -23109,7 +22320,7 @@ var ts; } // @api function createImportClause(isTypeOnly, name, namedBindings) { - var node = createBaseNode(262 /* ImportClause */); + var node = createBaseNode(259 /* ImportClause */); node.isTypeOnly = isTypeOnly; node.name = name; node.namedBindings = namedBindings; @@ -23132,7 +22343,7 @@ var ts; } // @api function createNamespaceImport(name) { - var node = createBaseNode(263 /* NamespaceImport */); + var node = createBaseNode(260 /* NamespaceImport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23146,7 +22357,7 @@ var ts; } // @api function createNamespaceExport(name) { - var node = createBaseNode(269 /* NamespaceExport */); + var node = createBaseNode(266 /* NamespaceExport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name) | @@ -23162,7 +22373,7 @@ var ts; } // @api function createNamedImports(elements) { - var node = createBaseNode(264 /* NamedImports */); + var node = createBaseNode(261 /* NamedImports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23176,7 +22387,7 @@ var ts; } // @api function createImportSpecifier(propertyName, name) { - var node = createBaseNode(265 /* ImportSpecifier */); + var node = createBaseNode(262 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; node.transformFlags |= @@ -23194,7 +22405,7 @@ var ts; } // @api function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createBaseDeclaration(266 /* ExportAssignment */, decorators, modifiers); + var node = createBaseDeclaration(263 /* ExportAssignment */, decorators, modifiers); node.isExportEquals = isExportEquals; node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary(62 /* EqualsToken */, /*leftSide*/ undefined, expression) @@ -23213,7 +22424,7 @@ var ts; } // @api function createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier) { - var node = createBaseDeclaration(267 /* ExportDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(264 /* ExportDeclaration */, decorators, modifiers); node.isTypeOnly = isTypeOnly; node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; @@ -23235,7 +22446,7 @@ var ts; } // @api function createNamedExports(elements) { - var node = createBaseNode(268 /* NamedExports */); + var node = createBaseNode(265 /* NamedExports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23249,7 +22460,7 @@ var ts; } // @api function createExportSpecifier(propertyName, name) { - var node = createBaseNode(270 /* ExportSpecifier */); + var node = createBaseNode(267 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); node.transformFlags |= @@ -23267,7 +22478,7 @@ var ts; } // @api function createMissingDeclaration() { - var node = createBaseDeclaration(271 /* MissingDeclaration */, + var node = createBaseDeclaration(268 /* MissingDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined); return node; @@ -23277,7 +22488,7 @@ var ts; // // @api function createExternalModuleReference(expression) { - var node = createBaseNode(272 /* ExternalModuleReference */); + var node = createBaseNode(269 /* ExternalModuleReference */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23322,7 +22533,7 @@ var ts; } // @api function createJSDocFunctionType(parameters, type) { - var node = createBaseSignatureDeclaration(308 /* JSDocFunctionType */, + var node = createBaseSignatureDeclaration(304 /* JSDocFunctionType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, @@ -23339,7 +22550,7 @@ var ts; // @api function createJSDocTypeLiteral(propertyTags, isArrayType) { if (isArrayType === void 0) { isArrayType = false; } - var node = createBaseNode(312 /* JSDocTypeLiteral */); + var node = createBaseNode(308 /* JSDocTypeLiteral */); node.jsDocPropertyTags = asNodeArray(propertyTags); node.isArrayType = isArrayType; return node; @@ -23353,7 +22564,7 @@ var ts; } // @api function createJSDocTypeExpression(type) { - var node = createBaseNode(301 /* JSDocTypeExpression */); + var node = createBaseNode(298 /* JSDocTypeExpression */); node.type = type; return node; } @@ -23365,7 +22576,7 @@ var ts; } // @api function createJSDocSignature(typeParameters, parameters, type) { - var node = createBaseNode(313 /* JSDocSignature */); + var node = createBaseNode(309 /* JSDocSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; @@ -23394,7 +22605,7 @@ var ts; } // @api function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { - var node = createBaseJSDocTag(330 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment); + var node = createBaseJSDocTag(326 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment); node.constraint = constraint; node.typeParameters = createNodeArray(typeParameters); return node; @@ -23411,7 +22622,7 @@ var ts; } // @api function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { - var node = createBaseJSDocTag(331 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment); + var node = createBaseJSDocTag(327 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = ts.getJSDocTypeAliasName(fullName); @@ -23429,7 +22640,7 @@ var ts; } // @api function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - var node = createBaseJSDocTag(326 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment); + var node = createBaseJSDocTag(322 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -23450,7 +22661,7 @@ var ts; } // @api function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - var node = createBaseJSDocTag(333 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment); + var node = createBaseJSDocTag(328 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -23471,7 +22682,7 @@ var ts; } // @api function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { - var node = createBaseJSDocTag(324 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment); + var node = createBaseJSDocTag(320 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = ts.getJSDocTypeAliasName(fullName); @@ -23489,7 +22700,7 @@ var ts; } // @api function createJSDocAugmentsTag(tagName, className, comment) { - var node = createBaseJSDocTag(315 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment); + var node = createBaseJSDocTag(311 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment); node.class = className; return node; } @@ -23504,37 +22715,11 @@ var ts; } // @api function createJSDocImplementsTag(tagName, className, comment) { - var node = createBaseJSDocTag(316 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment); + var node = createBaseJSDocTag(312 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment); node.class = className; return node; } // @api - function createJSDocSeeTag(tagName, name, comment) { - var node = createBaseJSDocTag(332 /* JSDocSeeTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("see"), comment); - node.name = name; - return node; - } - // @api - function updateJSDocSeeTag(node, tagName, name, comment) { - return node.tagName !== tagName - || node.name !== name - || node.comment !== comment - ? update(createJSDocSeeTag(tagName, name, comment), node) - : node; - } - // @api - function createJSDocNameReference(name) { - var node = createBaseNode(302 /* JSDocNameReference */); - node.name = name; - return node; - } - // @api - function updateJSDocNameReference(node, name) { - return node.name !== name - ? update(createJSDocNameReference(name), node) - : node; - } - // @api function updateJSDocImplementsTag(node, tagName, className, comment) { if (tagName === void 0) { tagName = getDefaultTagName(node); } return node.tagName !== tagName @@ -23595,7 +22780,7 @@ var ts; } // @api function createJSDocUnknownTag(tagName, comment) { - var node = createBaseJSDocTag(314 /* JSDocTag */, tagName, comment); + var node = createBaseJSDocTag(310 /* JSDocTag */, tagName, comment); return node; } // @api @@ -23607,7 +22792,7 @@ var ts; } // @api function createJSDocComment(comment, tags) { - var node = createBaseNode(311 /* JSDocComment */); + var node = createBaseNode(307 /* JSDocComment */); node.comment = comment; node.tags = asNodeArray(tags); return node; @@ -23624,7 +22809,7 @@ var ts; // // @api function createJsxElement(openingElement, children, closingElement) { - var node = createBaseNode(273 /* JsxElement */); + var node = createBaseNode(270 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -23645,7 +22830,7 @@ var ts; } // @api function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createBaseNode(274 /* JsxSelfClosingElement */); + var node = createBaseNode(271 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -23669,7 +22854,7 @@ var ts; } // @api function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createBaseNode(275 /* JsxOpeningElement */); + var node = createBaseNode(272 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -23693,7 +22878,7 @@ var ts; } // @api function createJsxClosingElement(tagName) { - var node = createBaseNode(276 /* JsxClosingElement */); + var node = createBaseNode(273 /* JsxClosingElement */); node.tagName = tagName; node.transformFlags |= propagateChildFlags(node.tagName) | @@ -23708,7 +22893,7 @@ var ts; } // @api function createJsxFragment(openingFragment, children, closingFragment) { - var node = createBaseNode(277 /* JsxFragment */); + var node = createBaseNode(274 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -23744,19 +22929,19 @@ var ts; } // @api function createJsxOpeningFragment() { - var node = createBaseNode(278 /* JsxOpeningFragment */); + var node = createBaseNode(275 /* JsxOpeningFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } // @api function createJsxJsxClosingFragment() { - var node = createBaseNode(279 /* JsxClosingFragment */); + var node = createBaseNode(276 /* JsxClosingFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } // @api function createJsxAttribute(name, initializer) { - var node = createBaseNode(280 /* JsxAttribute */); + var node = createBaseNode(277 /* JsxAttribute */); node.name = name; node.initializer = initializer; node.transformFlags |= @@ -23774,7 +22959,7 @@ var ts; } // @api function createJsxAttributes(properties) { - var node = createBaseNode(281 /* JsxAttributes */); + var node = createBaseNode(278 /* JsxAttributes */); node.properties = createNodeArray(properties); node.transformFlags |= propagateChildrenFlags(node.properties) | @@ -23789,7 +22974,7 @@ var ts; } // @api function createJsxSpreadAttribute(expression) { - var node = createBaseNode(282 /* JsxSpreadAttribute */); + var node = createBaseNode(279 /* JsxSpreadAttribute */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | @@ -23804,7 +22989,7 @@ var ts; } // @api function createJsxExpression(dotDotDotToken, expression) { - var node = createBaseNode(283 /* JsxExpression */); + var node = createBaseNode(280 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; node.transformFlags |= @@ -23824,7 +23009,7 @@ var ts; // // @api function createCaseClause(expression, statements) { - var node = createBaseNode(284 /* CaseClause */); + var node = createBaseNode(281 /* CaseClause */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.statements = createNodeArray(statements); node.transformFlags |= @@ -23841,7 +23026,7 @@ var ts; } // @api function createDefaultClause(statements) { - var node = createBaseNode(285 /* DefaultClause */); + var node = createBaseNode(282 /* DefaultClause */); node.statements = createNodeArray(statements); node.transformFlags = propagateChildrenFlags(node.statements); return node; @@ -23854,7 +23039,7 @@ var ts; } // @api function createHeritageClause(token, types) { - var node = createBaseNode(286 /* HeritageClause */); + var node = createBaseNode(283 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); node.transformFlags |= propagateChildrenFlags(node.types); @@ -23878,7 +23063,7 @@ var ts; } // @api function createCatchClause(variableDeclaration, block) { - var node = createBaseNode(287 /* CatchClause */); + var node = createBaseNode(284 /* CatchClause */); variableDeclaration = !ts.isString(variableDeclaration) ? variableDeclaration : createVariableDeclaration(variableDeclaration, /*exclamationToken*/ undefined, /*type*/ undefined, @@ -23904,7 +23089,7 @@ var ts; // // @api function createPropertyAssignment(name, initializer) { - var node = createBaseNamedDeclaration(288 /* PropertyAssignment */, + var node = createBaseNamedDeclaration(285 /* PropertyAssignment */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); @@ -23934,7 +23119,7 @@ var ts; } // @api function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createBaseNamedDeclaration(289 /* ShorthandPropertyAssignment */, + var node = createBaseNamedDeclaration(286 /* ShorthandPropertyAssignment */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); @@ -23966,7 +23151,7 @@ var ts; } // @api function createSpreadAssignment(expression) { - var node = createBaseNode(290 /* SpreadAssignment */); + var node = createBaseNode(287 /* SpreadAssignment */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -23985,7 +23170,7 @@ var ts; // // @api function createEnumMember(name, initializer) { - var node = createBaseNode(291 /* EnumMember */); + var node = createBaseNode(288 /* EnumMember */); node.name = asName(name); node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= @@ -24006,7 +23191,7 @@ var ts; // // @api function createSourceFile(statements, endOfFileToken, flags) { - var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */); + var node = baseFactory.createBaseSourceFileNode(294 /* SourceFile */); node.statements = createNodeArray(statements); node.endOfFileToken = endOfFileToken; node.flags |= flags; @@ -24023,7 +23208,7 @@ var ts; return node; } function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) { - var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */); + var node = baseFactory.createBaseSourceFileNode(294 /* SourceFile */); for (var p in source) { if (p === "emitNode" || ts.hasProperty(node, p) || !ts.hasProperty(source, p)) continue; @@ -24061,7 +23246,7 @@ var ts; // @api function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = createBaseNode(298 /* Bundle */); + var node = createBaseNode(295 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -24076,7 +23261,7 @@ var ts; } // @api function createUnparsedSource(prologues, syntheticReferences, texts) { - var node = createBaseNode(299 /* UnparsedSource */); + var node = createBaseNode(296 /* UnparsedSource */); node.prologues = prologues; node.syntheticReferences = syntheticReferences; node.texts = texts; @@ -24094,28 +23279,28 @@ var ts; } // @api function createUnparsedPrologue(data) { - return createBaseUnparsedNode(292 /* UnparsedPrologue */, data); + return createBaseUnparsedNode(289 /* UnparsedPrologue */, data); } // @api function createUnparsedPrepend(data, texts) { - var node = createBaseUnparsedNode(293 /* UnparsedPrepend */, data); + var node = createBaseUnparsedNode(290 /* UnparsedPrepend */, data); node.texts = texts; return node; } // @api function createUnparsedTextLike(data, internal) { - return createBaseUnparsedNode(internal ? 295 /* UnparsedInternalText */ : 294 /* UnparsedText */, data); + return createBaseUnparsedNode(internal ? 292 /* UnparsedInternalText */ : 291 /* UnparsedText */, data); } // @api function createUnparsedSyntheticReference(section) { - var node = createBaseNode(296 /* UnparsedSyntheticReference */); + var node = createBaseNode(293 /* UnparsedSyntheticReference */); node.data = section.data; node.section = section; return node; } // @api function createInputFiles() { - var node = createBaseNode(300 /* InputFiles */); + var node = createBaseNode(297 /* InputFiles */); node.javascriptText = ""; node.declarationText = ""; return node; @@ -24126,7 +23311,7 @@ var ts; // @api function createSyntheticExpression(type, isSpread, tupleNameSource) { if (isSpread === void 0) { isSpread = false; } - var node = createBaseNode(227 /* SyntheticExpression */); + var node = createBaseNode(224 /* SyntheticExpression */); node.type = type; node.isSpread = isSpread; node.tupleNameSource = tupleNameSource; @@ -24134,7 +23319,7 @@ var ts; } // @api function createSyntaxList(children) { - var node = createBaseNode(334 /* SyntaxList */); + var node = createBaseNode(329 /* SyntaxList */); node._children = children; return node; } @@ -24149,7 +23334,7 @@ var ts; */ // @api function createNotEmittedStatement(original) { - var node = createBaseNode(335 /* NotEmittedStatement */); + var node = createBaseNode(330 /* NotEmittedStatement */); node.original = original; ts.setTextRange(node, original); return node; @@ -24163,7 +23348,7 @@ var ts; */ // @api function createPartiallyEmittedExpression(expression, original) { - var node = createBaseNode(336 /* PartiallyEmittedExpression */); + var node = createBaseNode(331 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; node.transformFlags |= @@ -24191,7 +23376,7 @@ var ts; } // @api function createCommaListExpression(elements) { - var node = createBaseNode(337 /* CommaListExpression */); + var node = createBaseNode(332 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; @@ -24208,7 +23393,7 @@ var ts; */ // @api function createEndOfDeclarationMarker(original) { - var node = createBaseNode(339 /* EndOfDeclarationMarker */); + var node = createBaseNode(334 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -24219,14 +23404,14 @@ var ts; */ // @api function createMergeDeclarationMarker(original) { - var node = createBaseNode(338 /* MergeDeclarationMarker */); + var node = createBaseNode(333 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } // @api function createSyntheticReferenceExpression(expression, thisArg) { - var node = createBaseNode(340 /* SyntheticReferenceExpression */); + var node = createBaseNode(335 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= @@ -24248,7 +23433,7 @@ var ts; if (node === undefined) { return node; } - var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(297 /* SourceFile */) : + var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(294 /* SourceFile */) : ts.isIdentifier(node) ? baseFactory.createBaseIdentifierNode(78 /* Identifier */) : ts.isPrivateIdentifier(node) ? baseFactory.createBasePrivateIdentifierNode(79 /* PrivateIdentifier */) : !ts.isNodeKind(node.kind) ? baseFactory.createBaseTokenNode(node.kind) : @@ -24355,11 +23540,11 @@ var ts; } function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 207 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); - case 206 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 224 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type); - case 225 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); - case 336 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); + case 204 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); + case 203 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 221 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type); + case 222 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); + case 331 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -24413,13 +23598,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -24822,23 +24007,23 @@ var ts; } function getDefaultTagNameForKind(kind) { switch (kind) { - case 329 /* JSDocTypeTag */: return "type"; - case 327 /* JSDocReturnTag */: return "returns"; - case 328 /* JSDocThisTag */: return "this"; - case 325 /* JSDocEnumTag */: return "enum"; - case 317 /* JSDocAuthorTag */: return "author"; - case 319 /* JSDocClassTag */: return "class"; - case 320 /* JSDocPublicTag */: return "public"; - case 321 /* JSDocPrivateTag */: return "private"; - case 322 /* JSDocProtectedTag */: return "protected"; - case 323 /* JSDocReadonlyTag */: return "readonly"; - case 330 /* JSDocTemplateTag */: return "template"; - case 331 /* JSDocTypedefTag */: return "typedef"; - case 326 /* JSDocParameterTag */: return "param"; - case 333 /* JSDocPropertyTag */: return "prop"; - case 324 /* JSDocCallbackTag */: return "callback"; - case 315 /* JSDocAugmentsTag */: return "augments"; - case 316 /* JSDocImplementsTag */: return "implements"; + case 325 /* JSDocTypeTag */: return "type"; + case 323 /* JSDocReturnTag */: return "returns"; + case 324 /* JSDocThisTag */: return "this"; + case 321 /* JSDocEnumTag */: return "enum"; + case 313 /* JSDocAuthorTag */: return "author"; + case 315 /* JSDocClassTag */: return "class"; + case 316 /* JSDocPublicTag */: return "public"; + case 317 /* JSDocPrivateTag */: return "private"; + case 318 /* JSDocProtectedTag */: return "protected"; + case 319 /* JSDocReadonlyTag */: return "readonly"; + case 326 /* JSDocTemplateTag */: return "template"; + case 327 /* JSDocTypedefTag */: return "typedef"; + case 322 /* JSDocParameterTag */: return "param"; + case 328 /* JSDocPropertyTag */: return "prop"; + case 320 /* JSDocCallbackTag */: return "callback"; + case 311 /* JSDocAugmentsTag */: return "augments"; + case 312 /* JSDocImplementsTag */: return "implements"; default: return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind)); } @@ -24918,69 +24103,69 @@ var ts; */ /* @internal */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */) { + if (kind >= 171 /* FirstTypeNode */ && kind <= 192 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 199 /* ArrayLiteralExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 196 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return 546379776 /* ModuleExcludes */; - case 160 /* Parameter */: + case 159 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return 547309568 /* ArrowFunctionExcludes */; - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: return 547313664 /* FunctionExcludes */; - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 166 /* Constructor */: + case 165 /* Constructor */: return 547311616 /* ConstructorExcludes */; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return 536875008 /* PropertyExcludes */; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 128 /* AnyKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 141 /* NeverKeyword */: - case 147 /* StringKeyword */: - case 145 /* ObjectKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 140 /* NeverKeyword */: + case 146 /* StringKeyword */: + case 144 /* ObjectKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: case 113 /* VoidKeyword */: - case 159 /* TypeParameter */: - case 162 /* PropertySignature */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 158 /* TypeParameter */: + case 161 /* PropertySignature */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 287 /* CatchClause */: + case 284 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: - case 336 /* PartiallyEmittedExpression */: - case 207 /* ParenthesizedExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: + case 331 /* PartiallyEmittedExpression */: + case 204 /* ParenthesizedExpression */: case 105 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -25279,7 +24464,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = (_a = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node)))) !== null && _a !== void 0 ? _a : ts.Debug.fail("Could not determine parsed source file."); @@ -26136,11 +25321,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 157 /* QualifiedName */; + return node.kind === 156 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 158 /* ComputedPropertyName */; + return node.kind === 157 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -26175,580 +25360,572 @@ var ts; ts.isExclamationToken = isExclamationToken; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 159 /* TypeParameter */; + return node.kind === 158 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; // TODO(rbuckton): Rename to 'isParameterDeclaration' function isParameter(node) { - return node.kind === 160 /* Parameter */; + return node.kind === 159 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 161 /* Decorator */; + return node.kind === 160 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 162 /* PropertySignature */; + return node.kind === 161 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 163 /* PropertyDeclaration */; + return node.kind === 162 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 164 /* MethodSignature */; + return node.kind === 163 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 165 /* MethodDeclaration */; + return node.kind === 164 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 166 /* Constructor */; + return node.kind === 165 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 167 /* GetAccessor */; + return node.kind === 166 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 168 /* SetAccessor */; + return node.kind === 167 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 169 /* CallSignature */; + return node.kind === 168 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 170 /* ConstructSignature */; + return node.kind === 169 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 171 /* IndexSignature */; + return node.kind === 170 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 172 /* TypePredicate */; + return node.kind === 171 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 173 /* TypeReference */; + return node.kind === 172 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 174 /* FunctionType */; + return node.kind === 173 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 175 /* ConstructorType */; + return node.kind === 174 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 176 /* TypeQuery */; + return node.kind === 175 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 177 /* TypeLiteral */; + return node.kind === 176 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 178 /* ArrayType */; + return node.kind === 177 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 179 /* TupleType */; + return node.kind === 178 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isNamedTupleMember(node) { - return node.kind === 192 /* NamedTupleMember */; + return node.kind === 191 /* NamedTupleMember */; } ts.isNamedTupleMember = isNamedTupleMember; function isOptionalTypeNode(node) { - return node.kind === 180 /* OptionalType */; + return node.kind === 179 /* OptionalType */; } ts.isOptionalTypeNode = isOptionalTypeNode; function isRestTypeNode(node) { - return node.kind === 181 /* RestType */; + return node.kind === 180 /* RestType */; } ts.isRestTypeNode = isRestTypeNode; function isUnionTypeNode(node) { - return node.kind === 182 /* UnionType */; + return node.kind === 181 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 183 /* IntersectionType */; + return node.kind === 182 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 184 /* ConditionalType */; + return node.kind === 183 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 185 /* InferType */; + return node.kind === 184 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 186 /* ParenthesizedType */; + return node.kind === 185 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 187 /* ThisType */; + return node.kind === 186 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 188 /* TypeOperator */; + return node.kind === 187 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 189 /* IndexedAccessType */; + return node.kind === 188 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 190 /* MappedType */; + return node.kind === 189 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 191 /* LiteralType */; + return node.kind === 190 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 195 /* ImportType */; + return node.kind === 192 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; - function isTemplateLiteralTypeSpan(node) { - return node.kind === 194 /* TemplateLiteralTypeSpan */; - } - ts.isTemplateLiteralTypeSpan = isTemplateLiteralTypeSpan; - function isTemplateLiteralTypeNode(node) { - return node.kind === 193 /* TemplateLiteralType */; - } - ts.isTemplateLiteralTypeNode = isTemplateLiteralTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 196 /* ObjectBindingPattern */; + return node.kind === 193 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 197 /* ArrayBindingPattern */; + return node.kind === 194 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 198 /* BindingElement */; + return node.kind === 195 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 199 /* ArrayLiteralExpression */; + return node.kind === 196 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 200 /* ObjectLiteralExpression */; + return node.kind === 197 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 201 /* PropertyAccessExpression */; + return node.kind === 198 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 202 /* ElementAccessExpression */; + return node.kind === 199 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 203 /* CallExpression */; + return node.kind === 200 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 204 /* NewExpression */; + return node.kind === 201 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 205 /* TaggedTemplateExpression */; + return node.kind === 202 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertionExpression(node) { - return node.kind === 206 /* TypeAssertionExpression */; + return node.kind === 203 /* TypeAssertionExpression */; } ts.isTypeAssertionExpression = isTypeAssertionExpression; function isParenthesizedExpression(node) { - return node.kind === 207 /* ParenthesizedExpression */; + return node.kind === 204 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function isFunctionExpression(node) { - return node.kind === 208 /* FunctionExpression */; + return node.kind === 205 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 209 /* ArrowFunction */; + return node.kind === 206 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 210 /* DeleteExpression */; + return node.kind === 207 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 211 /* TypeOfExpression */; + return node.kind === 208 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 212 /* VoidExpression */; + return node.kind === 209 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 213 /* AwaitExpression */; + return node.kind === 210 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 214 /* PrefixUnaryExpression */; + return node.kind === 211 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 215 /* PostfixUnaryExpression */; + return node.kind === 212 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 216 /* BinaryExpression */; + return node.kind === 213 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 217 /* ConditionalExpression */; + return node.kind === 214 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 218 /* TemplateExpression */; + return node.kind === 215 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 219 /* YieldExpression */; + return node.kind === 216 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 220 /* SpreadElement */; + return node.kind === 217 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 221 /* ClassExpression */; + return node.kind === 218 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 222 /* OmittedExpression */; + return node.kind === 219 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 223 /* ExpressionWithTypeArguments */; + return node.kind === 220 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 224 /* AsExpression */; + return node.kind === 221 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 225 /* NonNullExpression */; + return node.kind === 222 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 226 /* MetaProperty */; + return node.kind === 223 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; function isSyntheticExpression(node) { - return node.kind === 227 /* SyntheticExpression */; + return node.kind === 224 /* SyntheticExpression */; } ts.isSyntheticExpression = isSyntheticExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 336 /* PartiallyEmittedExpression */; + return node.kind === 331 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isCommaListExpression(node) { - return node.kind === 337 /* CommaListExpression */; + return node.kind === 332 /* CommaListExpression */; } ts.isCommaListExpression = isCommaListExpression; // Misc function isTemplateSpan(node) { - return node.kind === 228 /* TemplateSpan */; + return node.kind === 225 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 229 /* SemicolonClassElement */; + return node.kind === 226 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Elements function isBlock(node) { - return node.kind === 230 /* Block */; + return node.kind === 227 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 232 /* VariableStatement */; + return node.kind === 229 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 231 /* EmptyStatement */; + return node.kind === 228 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 233 /* ExpressionStatement */; + return node.kind === 230 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 234 /* IfStatement */; + return node.kind === 231 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 235 /* DoStatement */; + return node.kind === 232 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 236 /* WhileStatement */; + return node.kind === 233 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 237 /* ForStatement */; + return node.kind === 234 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 238 /* ForInStatement */; + return node.kind === 235 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 239 /* ForOfStatement */; + return node.kind === 236 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 240 /* ContinueStatement */; + return node.kind === 237 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 241 /* BreakStatement */; + return node.kind === 238 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isReturnStatement(node) { - return node.kind === 242 /* ReturnStatement */; + return node.kind === 239 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 243 /* WithStatement */; + return node.kind === 240 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 244 /* SwitchStatement */; + return node.kind === 241 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 245 /* LabeledStatement */; + return node.kind === 242 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 246 /* ThrowStatement */; + return node.kind === 243 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 247 /* TryStatement */; + return node.kind === 244 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 248 /* DebuggerStatement */; + return node.kind === 245 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 249 /* VariableDeclaration */; + return node.kind === 246 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 250 /* VariableDeclarationList */; + return node.kind === 247 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 251 /* FunctionDeclaration */; + return node.kind === 248 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 252 /* ClassDeclaration */; + return node.kind === 249 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 253 /* InterfaceDeclaration */; + return node.kind === 250 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 254 /* TypeAliasDeclaration */; + return node.kind === 251 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 255 /* EnumDeclaration */; + return node.kind === 252 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */; + return node.kind === 253 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 257 /* ModuleBlock */; + return node.kind === 254 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 258 /* CaseBlock */; + return node.kind === 255 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 259 /* NamespaceExportDeclaration */; + return node.kind === 256 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */; + return node.kind === 257 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 261 /* ImportDeclaration */; + return node.kind === 258 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 262 /* ImportClause */; + return node.kind === 259 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 263 /* NamespaceImport */; + return node.kind === 260 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 269 /* NamespaceExport */; + return node.kind === 266 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedImports(node) { - return node.kind === 264 /* NamedImports */; + return node.kind === 261 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 265 /* ImportSpecifier */; + return node.kind === 262 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 266 /* ExportAssignment */; + return node.kind === 263 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 267 /* ExportDeclaration */; + return node.kind === 264 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 268 /* NamedExports */; + return node.kind === 265 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 270 /* ExportSpecifier */; + return node.kind === 267 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 271 /* MissingDeclaration */; + return node.kind === 268 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; function isNotEmittedStatement(node) { - return node.kind === 335 /* NotEmittedStatement */; + return node.kind === 330 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 340 /* SyntheticReferenceExpression */; + return node.kind === 335 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ function isMergeDeclarationMarker(node) { - return node.kind === 338 /* MergeDeclarationMarker */; + return node.kind === 333 /* MergeDeclarationMarker */; } ts.isMergeDeclarationMarker = isMergeDeclarationMarker; /* @internal */ function isEndOfDeclarationMarker(node) { - return node.kind === 339 /* EndOfDeclarationMarker */; + return node.kind === 334 /* EndOfDeclarationMarker */; } ts.isEndOfDeclarationMarker = isEndOfDeclarationMarker; // Module References function isExternalModuleReference(node) { - return node.kind === 272 /* ExternalModuleReference */; + return node.kind === 269 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 273 /* JsxElement */; + return node.kind === 270 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 274 /* JsxSelfClosingElement */; + return node.kind === 271 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 275 /* JsxOpeningElement */; + return node.kind === 272 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 276 /* JsxClosingElement */; + return node.kind === 273 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 277 /* JsxFragment */; + return node.kind === 274 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 278 /* JsxOpeningFragment */; + return node.kind === 275 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 279 /* JsxClosingFragment */; + return node.kind === 276 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 280 /* JsxAttribute */; + return node.kind === 277 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 281 /* JsxAttributes */; + return node.kind === 278 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 282 /* JsxSpreadAttribute */; + return node.kind === 279 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 283 /* JsxExpression */; + return node.kind === 280 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 284 /* CaseClause */; + return node.kind === 281 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 285 /* DefaultClause */; + return node.kind === 282 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 286 /* HeritageClause */; + return node.kind === 283 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 287 /* CatchClause */; + return node.kind === 284 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 288 /* PropertyAssignment */; + return node.kind === 285 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 289 /* ShorthandPropertyAssignment */; + return node.kind === 286 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 290 /* SpreadAssignment */; + return node.kind === 287 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 291 /* EnumMember */; + return node.kind === 288 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Unparsed // TODO(rbuckton): isUnparsedPrologue function isUnparsedPrepend(node) { - return node.kind === 293 /* UnparsedPrepend */; + return node.kind === 290 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; // TODO(rbuckton): isUnparsedText @@ -26756,152 +25933,148 @@ var ts; // TODO(rbuckton): isUnparsedSyntheticReference // Top-level nodes function isSourceFile(node) { - return node.kind === 297 /* SourceFile */; + return node.kind === 294 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 298 /* Bundle */; + return node.kind === 295 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 299 /* UnparsedSource */; + return node.kind === 296 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; // TODO(rbuckton): isInputFiles // JSDoc Elements function isJSDocTypeExpression(node) { - return node.kind === 301 /* JSDocTypeExpression */; + return node.kind === 298 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; - function isJSDocNameReference(node) { - return node.kind === 302 /* JSDocNameReference */; - } - ts.isJSDocNameReference = isJSDocNameReference; function isJSDocAllType(node) { - return node.kind === 303 /* JSDocAllType */; + return node.kind === 299 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 304 /* JSDocUnknownType */; + return node.kind === 300 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 305 /* JSDocNullableType */; + return node.kind === 301 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 306 /* JSDocNonNullableType */; + return node.kind === 302 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 307 /* JSDocOptionalType */; + return node.kind === 303 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 308 /* JSDocFunctionType */; + return node.kind === 304 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 309 /* JSDocVariadicType */; + return node.kind === 305 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDocNamepathType(node) { - return node.kind === 310 /* JSDocNamepathType */; + return node.kind === 306 /* JSDocNamepathType */; } ts.isJSDocNamepathType = isJSDocNamepathType; function isJSDoc(node) { - return node.kind === 311 /* JSDocComment */; + return node.kind === 307 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocTypeLiteral(node) { - return node.kind === 312 /* JSDocTypeLiteral */; + return node.kind === 308 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocSignature(node) { - return node.kind === 313 /* JSDocSignature */; + return node.kind === 309 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // JSDoc Tags function isJSDocAugmentsTag(node) { - return node.kind === 315 /* JSDocAugmentsTag */; + return node.kind === 311 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocAuthorTag(node) { - return node.kind === 317 /* JSDocAuthorTag */; + return node.kind === 313 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocClassTag(node) { - return node.kind === 319 /* JSDocClassTag */; + return node.kind === 315 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocCallbackTag(node) { - return node.kind === 324 /* JSDocCallbackTag */; + return node.kind === 320 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocPublicTag(node) { - return node.kind === 320 /* JSDocPublicTag */; + return node.kind === 316 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 321 /* JSDocPrivateTag */; + return node.kind === 317 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 322 /* JSDocProtectedTag */; + return node.kind === 318 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 323 /* JSDocReadonlyTag */; + return node.kind === 319 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocDeprecatedTag(node) { - return node.kind === 318 /* JSDocDeprecatedTag */; + return node.kind === 314 /* JSDocDeprecatedTag */; } ts.isJSDocDeprecatedTag = isJSDocDeprecatedTag; function isJSDocEnumTag(node) { - return node.kind === 325 /* JSDocEnumTag */; + return node.kind === 321 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocParameterTag(node) { - return node.kind === 326 /* JSDocParameterTag */; + return node.kind === 322 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 327 /* JSDocReturnTag */; + return node.kind === 323 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocThisTag(node) { - return node.kind === 328 /* JSDocThisTag */; + return node.kind === 324 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocTypeTag(node) { - return node.kind === 329 /* JSDocTypeTag */; + return node.kind === 325 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 330 /* JSDocTemplateTag */; + return node.kind === 326 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 331 /* JSDocTypedefTag */; + return node.kind === 327 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocUnknownTag(node) { - return node.kind === 314 /* JSDocTag */; + return node.kind === 310 /* JSDocTag */; } ts.isJSDocUnknownTag = isJSDocUnknownTag; function isJSDocPropertyTag(node) { - return node.kind === 333 /* JSDocPropertyTag */; + return node.kind === 328 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocImplementsTag(node) { - return node.kind === 316 /* JSDocImplementsTag */; + return node.kind === 312 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; // Synthesized list /* @internal */ function isSyntaxList(n) { - return n.kind === 334 /* SyntaxList */; + return n.kind === 329 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; })(ts || (ts = {})); @@ -26952,13 +26125,12 @@ var ts; createJsxFactoryExpressionFromEntityName(factory, jsxFactoryEntity, parent) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), "createElement"); } - ts.createJsxFactoryExpression = createJsxFactoryExpression; function createJsxFragmentFactoryExpression(factory, jsxFragmentFactoryEntity, reactNamespace, parent) { return jsxFragmentFactoryEntity ? createJsxFactoryExpressionFromEntityName(factory, jsxFragmentFactoryEntity, parent) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), "Fragment"); } - function createExpressionForJsxElement(factory, callee, tagName, props, children, location) { + function createExpressionForJsxElement(factory, jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { var argumentsList = [tagName]; if (props) { argumentsList.push(props); @@ -26978,7 +26150,7 @@ var ts; argumentsList.push(children[0]); } } - return ts.setTextRange(factory.createCallExpression(callee, + return ts.setTextRange(factory.createCallExpression(createJsxFactoryExpression(factory, jsxFactoryEntity, reactNamespace, parentElement), /*typeArguments*/ undefined, argumentsList), location); } ts.createExpressionForJsxElement = createExpressionForJsxElement; @@ -27100,14 +26272,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return createExpressionForAccessorDeclaration(factory, node.properties, property, receiver, !!node.multiLine); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return createExpressionForPropertyAssignment(factory, property, receiver); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(factory, property, receiver); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return createExpressionForMethodDeclaration(factory, property, receiver); } } @@ -27160,21 +26332,21 @@ var ts; } ts.startsWithUseStrict = startsWithUseStrict; function isCommaSequence(node) { - return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 337 /* CommaListExpression */; + return node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 332 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 15 /* All */; } switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return (kinds & 2 /* TypeAssertions */) !== 0; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return (kinds & 4 /* NonNullAssertions */) !== 0; - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -27291,14 +26463,14 @@ var ts; */ function getLocalNameForExternalImport(factory, node, sourceFile) { var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); - if (namespaceDeclaration && !ts.isDefaultImport(node) && !ts.isExportNamespaceAsDefaultDeclaration(node)) { + if (namespaceDeclaration && !ts.isDefaultImport(node)) { var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : factory.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 261 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 258 /* ImportDeclaration */ && node.importClause) { return factory.getGeneratedNameForNode(node); } - if (node.kind === 267 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 264 /* ExportDeclaration */ && node.moduleSpecifier) { return factory.getGeneratedNameForNode(node); } return undefined; @@ -27417,7 +26589,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -27429,11 +26601,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -27465,12 +26637,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 160 /* Parameter */: - case 198 /* BindingElement */: + case 159 /* Parameter */: + case 195 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 220 /* SpreadElement */: - case 290 /* SpreadAssignment */: + case 217 /* SpreadElement */: + case 287 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -27488,7 +26660,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 198 /* BindingElement */: + case 195 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -27503,7 +26675,7 @@ var ts; : propertyName; } break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -27518,7 +26690,7 @@ var ts; : propertyName; } break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -27541,13 +26713,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -27568,29 +26740,29 @@ var ts; ts.getJSDocTypeAliasName = getJSDocTypeAliasName; function canHaveModifiers(node) { var kind = node.kind; - return kind === 160 /* Parameter */ - || kind === 162 /* PropertySignature */ - || kind === 163 /* PropertyDeclaration */ - || kind === 164 /* MethodSignature */ - || kind === 165 /* MethodDeclaration */ - || kind === 166 /* Constructor */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 171 /* IndexSignature */ - || kind === 208 /* FunctionExpression */ - || kind === 209 /* ArrowFunction */ - || kind === 221 /* ClassExpression */ - || kind === 232 /* VariableStatement */ - || kind === 251 /* FunctionDeclaration */ - || kind === 252 /* ClassDeclaration */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 255 /* EnumDeclaration */ - || kind === 256 /* ModuleDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 266 /* ExportAssignment */ - || kind === 267 /* ExportDeclaration */; + return kind === 159 /* Parameter */ + || kind === 161 /* PropertySignature */ + || kind === 162 /* PropertyDeclaration */ + || kind === 163 /* MethodSignature */ + || kind === 164 /* MethodDeclaration */ + || kind === 165 /* Constructor */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 170 /* IndexSignature */ + || kind === 205 /* FunctionExpression */ + || kind === 206 /* ArrowFunction */ + || kind === 218 /* ClassExpression */ + || kind === 229 /* VariableStatement */ + || kind === 248 /* FunctionDeclaration */ + || kind === 249 /* ClassDeclaration */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 252 /* EnumDeclaration */ + || kind === 253 /* ModuleDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 263 /* ExportAssignment */ + || kind === 264 /* ExportDeclaration */; } ts.canHaveModifiers = canHaveModifiers; /* @internal */ @@ -27689,19 +26861,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 156 /* LastToken */) { + if (!node || node.kind <= 155 /* LastToken */) { return; } switch (node.kind) { - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -27709,9 +26881,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -27719,7 +26891,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -27727,51 +26899,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -27783,374 +26955,364 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 179 /* TupleType */: + case 178 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elements); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 185 /* InferType */: + case 184 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 195 /* ImportType */: + case 192 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 186 /* ParenthesizedType */: - case 188 /* TypeOperator */: + case 185 /* ParenthesizedType */: + case 187 /* TypeOperator */: return visitNode(cbNode, node.type); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 190 /* MappedType */: + case 189 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || - visitNode(cbNode, node.nameType) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return visitNode(cbNode, node.literal); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 224 /* AsExpression */: + case 221 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return visitNode(cbNode, node.name); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 297 /* SourceFile */: + case 294 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: return visitNode(cbNode, node.label); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 284 /* CaseClause */: + case 281 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 161 /* Decorator */: + case 160 /* Decorator */: return visitNode(cbNode, node.expression); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 291 /* EnumMember */: + case 288 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 264 /* NamedImports */: - case 268 /* NamedExports */: + case 261 /* NamedImports */: + case 265 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 193 /* TemplateLiteralType */: - return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 194 /* TemplateLiteralTypeSpan */: - return visitNode(cbNode, node.type) || visitNode(cbNode, node.literal); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 180 /* OptionalType */: - case 181 /* RestType */: - case 301 /* JSDocTypeExpression */: - case 306 /* JSDocNonNullableType */: - case 305 /* JSDocNullableType */: - case 307 /* JSDocOptionalType */: - case 309 /* JSDocVariadicType */: + case 179 /* OptionalType */: + case 180 /* RestType */: + case 298 /* JSDocTypeExpression */: + case 302 /* JSDocNonNullableType */: + case 301 /* JSDocNullableType */: + case 303 /* JSDocOptionalType */: + case 305 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 311 /* JSDocComment */: + case 307 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 332 /* JSDocSeeTag */: - return visitNode(cbNode, node.tagName) || - visitNode(cbNode, node.name); - case 302 /* JSDocNameReference */: - return visitNode(cbNode, node.name); - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 317 /* JSDocAuthorTag */: + case 313 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 301 /* JSDocTypeExpression */ + node.typeExpression.kind === 298 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 324 /* JSDocCallbackTag */: + case 320 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 328 /* JSDocThisTag */: - case 325 /* JSDocEnumTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 324 /* JSDocThisTag */: + case 321 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 313 /* JSDocSignature */: + case 309 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 312 /* JSDocTypeLiteral */: + case 308 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 314 /* JSDocTag */: - case 319 /* JSDocClassTag */: - case 320 /* JSDocPublicTag */: - case 321 /* JSDocPrivateTag */: - case 322 /* JSDocProtectedTag */: - case 323 /* JSDocReadonlyTag */: + case 310 /* JSDocTag */: + case 315 /* JSDocClassTag */: + case 316 /* JSDocPublicTag */: + case 317 /* JSDocPrivateTag */: + case 318 /* JSDocProtectedTag */: + case 319 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -28225,8 +27387,6 @@ var ts; ts.forEachChildRecursively = forEachChildRecursively; function createSourceFile(fileName, sourceText, languageVersion, setParentNodes, scriptKind) { if (setParentNodes === void 0) { setParentNodes = false; } - var tracingData = ["parse" /* Parse */, "createSourceFile", { path: fileName }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeParse"); var result; ts.perfLogger.logStartParseSourceFile(fileName); @@ -28239,7 +27399,6 @@ var ts; ts.perfLogger.logStopParseSourceFile(); ts.performance.mark("afterParse"); ts.performance.measure("Parse", "beforeParse", "afterParse"); - ts.tracing.end.apply(ts.tracing, tracingData); return result; } ts.createSourceFile = createSourceFile; @@ -29100,7 +28259,7 @@ var ts; ts.isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode(kind, "", "", /*templateFlags*/ undefined) : kind === 8 /* NumericLiteral */ ? factory.createNumericLiteral("", /*numericLiteralFlags*/ undefined) : kind === 10 /* StringLiteral */ ? factory.createStringLiteral("", /*isSingleQuote*/ undefined) : - kind === 271 /* MissingDeclaration */ ? factory.createMissingDeclaration() : + kind === 268 /* MissingDeclaration */ ? factory.createMissingDeclaration() : factory.createToken(kind); return finishNode(result, pos); } @@ -29214,7 +28373,7 @@ var ts; if (token() === 87 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 149 /* TypeKeyword */) { + if (token() === 148 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); @@ -29222,7 +28381,7 @@ var ts; return nextTokenCanFollowDefaultKeyword(); case 123 /* StaticKeyword */: case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -29632,14 +28791,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 166 /* Constructor */: - case 171 /* IndexSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 229 /* SemicolonClassElement */: + case 165 /* Constructor */: + case 170 /* IndexSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 226 /* SemicolonClassElement */: return true; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -29654,8 +28813,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: return true; } } @@ -29664,58 +28823,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 232 /* VariableStatement */: - case 230 /* Block */: - case 234 /* IfStatement */: - case 233 /* ExpressionStatement */: - case 246 /* ThrowStatement */: - case 242 /* ReturnStatement */: - case 244 /* SwitchStatement */: - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 237 /* ForStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 231 /* EmptyStatement */: - case 247 /* TryStatement */: - case 245 /* LabeledStatement */: - case 235 /* DoStatement */: - case 248 /* DebuggerStatement */: - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 248 /* FunctionDeclaration */: + case 229 /* VariableStatement */: + case 227 /* Block */: + case 231 /* IfStatement */: + case 230 /* ExpressionStatement */: + case 243 /* ThrowStatement */: + case 239 /* ReturnStatement */: + case 241 /* SwitchStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 234 /* ForStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 228 /* EmptyStatement */: + case 244 /* TryStatement */: + case 242 /* LabeledStatement */: + case 232 /* DoStatement */: + case 245 /* DebuggerStatement */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 291 /* EnumMember */; + return node.kind === 288 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 162 /* PropertySignature */: - case 169 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 161 /* PropertySignature */: + case 168 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 249 /* VariableDeclaration */) { + if (node.kind !== 246 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -29736,7 +28895,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 160 /* Parameter */) { + if (node.kind !== 159 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -29745,7 +28904,7 @@ var ts; } // Returns true if we should abort parsing. function abortParsingListOrMoveToNextToken(kind) { - parsingContextErrors(kind); + parseErrorAtCurrentToken(parsingContextErrors(kind)); if (isInSomeParsingContext()) { return true; } @@ -29754,34 +28913,31 @@ var ts; } function parsingContextErrors(context) { switch (context) { - case 0 /* SourceElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); - case 1 /* BlockStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); - case 2 /* SwitchClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.case_or_default_expected); - case 3 /* SwitchClauseStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Statement_expected); + case 0 /* SourceElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 1 /* BlockStatements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 2 /* SwitchClauses */: return ts.Diagnostics.case_or_default_expected; + case 3 /* SwitchClauseStatements */: return ts.Diagnostics.Statement_expected; case 18 /* RestProperties */: // fallthrough - case 4 /* TypeMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_or_signature_expected); - case 5 /* ClassMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); - case 6 /* EnumMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Enum_member_expected); - case 7 /* HeritageClauseElement */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_expected); - case 8 /* VariableDeclarations */: - return ts.isKeyword(token()) - ? parseErrorAtCurrentToken(ts.Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, ts.tokenToString(token())) - : parseErrorAtCurrentToken(ts.Diagnostics.Variable_declaration_expected); - case 9 /* ObjectBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_destructuring_pattern_expected); - case 10 /* ArrayBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Array_element_destructuring_pattern_expected); - case 11 /* ArgumentExpressions */: return parseErrorAtCurrentToken(ts.Diagnostics.Argument_expression_expected); - case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_assignment_expected); - case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_or_comma_expected); - case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); - case 16 /* Parameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); - case 19 /* TypeParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_parameter_declaration_expected); - case 20 /* TypeArguments */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_argument_expected); - case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_expected); - case 22 /* HeritageClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_expected); - case 23 /* ImportOrExportSpecifiers */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - case 13 /* JsxAttributes */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - case 14 /* JsxChildren */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - default: return [undefined]; // TODO: GH#18217 `default: Debug.assertNever(context);` + case 4 /* TypeMembers */: return ts.Diagnostics.Property_or_signature_expected; + case 5 /* ClassMembers */: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 6 /* EnumMembers */: return ts.Diagnostics.Enum_member_expected; + case 7 /* HeritageClauseElement */: return ts.Diagnostics.Expression_expected; + case 8 /* VariableDeclarations */: return ts.Diagnostics.Variable_declaration_expected; + case 9 /* ObjectBindingElements */: return ts.Diagnostics.Property_destructuring_pattern_expected; + case 10 /* ArrayBindingElements */: return ts.Diagnostics.Array_element_destructuring_pattern_expected; + case 11 /* ArgumentExpressions */: return ts.Diagnostics.Argument_expression_expected; + case 12 /* ObjectLiteralMembers */: return ts.Diagnostics.Property_assignment_expected; + case 15 /* ArrayLiteralMembers */: return ts.Diagnostics.Expression_or_comma_expected; + case 17 /* JSDocParameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 16 /* Parameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 19 /* TypeParameters */: return ts.Diagnostics.Type_parameter_declaration_expected; + case 20 /* TypeArguments */: return ts.Diagnostics.Type_argument_expected; + case 21 /* TupleElementTypes */: return ts.Diagnostics.Type_expected; + case 22 /* HeritageClauses */: return ts.Diagnostics.Unexpected_token_expected; + case 23 /* ImportOrExportSpecifiers */: return ts.Diagnostics.Identifier_expected; + case 13 /* JsxAttributes */: return ts.Diagnostics.Identifier_expected; + case 14 /* JsxChildren */: return ts.Diagnostics.Identifier_expected; + default: return undefined; // TODO: GH#18217 `default: Debug.assertNever(context);` } } // Parses a comma-delimited list of elements @@ -29926,24 +29082,6 @@ var ts; var pos = getNodePos(); return finishNode(factory.createTemplateExpression(parseTemplateHead(isTaggedTemplate), parseTemplateSpans(isTaggedTemplate)), pos); } - function parseTemplateType() { - var pos = getNodePos(); - return finishNode(factory.createTemplateLiteralType(parseTemplateHead(/*isTaggedTemplate*/ false), parseTemplateTypeSpans()), pos); - } - function parseTemplateTypeSpans() { - var pos = getNodePos(); - var list = []; - var node; - do { - node = parseTemplateTypeSpan(); - list.push(node); - } while (node.literal.kind === 16 /* TemplateMiddle */); - return createNodeArray(list, pos); - } - function parseTemplateTypeSpan() { - var pos = getNodePos(); - return finishNode(factory.createTemplateLiteralTypeSpan(parseType(), parseLiteralOfTemplateSpan(/*isTaggedTemplate*/ false)), pos); - } function parseLiteralOfTemplateSpan(isTaggedTemplate) { if (token() === 19 /* CloseBraceToken */) { reScanTemplateToken(isTaggedTemplate); @@ -30017,14 +29155,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: { + case 173 /* FunctionType */: + case 174 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -30104,7 +29242,7 @@ var ts; function parseJSDocType() { scanner.setInJSDocType(true); var pos = getNodePos(); - if (parseOptional(139 /* ModuleKeyword */)) { + if (parseOptional(138 /* ModuleKeyword */)) { // TODO(rbuckton): We never set the type for a JSDocNamepathType. What should we put here? var moduleTag = factory.createJSDocNamepathType(/*type*/ undefined); terminate: while (true) { @@ -30304,14 +29442,14 @@ var ts; function parseSignatureMember(kind) { var pos = getNodePos(); var hasJSDoc = hasPrecedingJSDocComment(); - if (kind === 170 /* ConstructSignature */) { + if (kind === 169 /* ConstructSignature */) { parseExpected(102 /* NewKeyword */); } var typeParameters = parseTypeParameters(); var parameters = parseParameters(4 /* Type */); var type = parseReturnType(58 /* ColonToken */, /*isType*/ true); parseTypeMemberSemicolon(); - var node = kind === 169 /* CallSignature */ + var node = kind === 168 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, type) : factory.createConstructSignature(typeParameters, parameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -30434,10 +29572,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(169 /* CallSignature */); + return parseSignatureMember(168 /* CallSignature */); } if (token() === 102 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(170 /* ConstructSignature */); + return parseSignatureMember(169 /* ConstructSignature */); } var pos = getNodePos(); var hasJSDoc = hasPrecedingJSDocComment(); @@ -30481,9 +29619,9 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 142 /* ReadonlyKeyword */; + return nextToken() === 141 /* ReadonlyKeyword */; } - if (token() === 142 /* ReadonlyKeyword */) { + if (token() === 141 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 100 /* InKeyword */; @@ -30499,15 +29637,14 @@ var ts; var pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); var readonlyToken; - if (token() === 142 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 141 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { readonlyToken = parseTokenNode(); - if (readonlyToken.kind !== 142 /* ReadonlyKeyword */) { - parseExpected(142 /* ReadonlyKeyword */); + if (readonlyToken.kind !== 141 /* ReadonlyKeyword */) { + parseExpected(141 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); var typeParameter = parseMappedTypeParameter(); - var nameType = parseOptional(126 /* AsKeyword */) ? parseType() : undefined; parseExpected(23 /* CloseBracketToken */); var questionToken; if (token() === 57 /* QuestionToken */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { @@ -30519,7 +29656,7 @@ var ts; var type = parseTypeAnnotation(); parseSemicolon(); parseExpected(19 /* CloseBraceToken */); - return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), pos); + return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), pos); } function parseTupleElementType() { var pos = getNodePos(); @@ -30621,15 +29758,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 148 /* SymbolKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 147 /* SymbolKeyword */: case 131 /* BooleanKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: - case 145 /* ObjectKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: + case 144 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 65 /* AsteriskEqualsToken */: @@ -30662,7 +29799,7 @@ var ts; return parseTokenNode(); case 107 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 136 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -30681,8 +29818,6 @@ var ts; return parseImportType(); case 127 /* AssertsKeyword */: return lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine) ? parseAssertsTypePredicate() : parseTypeReference(); - case 15 /* TemplateHead */: - return parseTemplateType(); default: return parseTypeReference(); } @@ -30690,20 +29825,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: - case 142 /* ReadonlyKeyword */: - case 148 /* SymbolKeyword */: - case 151 /* UniqueKeyword */: + case 141 /* ReadonlyKeyword */: + case 147 /* SymbolKeyword */: + case 150 /* UniqueKeyword */: case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: case 103 /* NullKeyword */: case 107 /* ThisKeyword */: case 111 /* TypeOfKeyword */: - case 141 /* NeverKeyword */: + case 140 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -30715,7 +29850,7 @@ var ts; case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: @@ -30723,8 +29858,6 @@ var ts; case 135 /* InferKeyword */: case 99 /* ImportKeyword */: case 127 /* AssertsKeyword */: - case 14 /* NoSubstitutionTemplateLiteral */: - case 15 /* TemplateHead */: return true; case 97 /* FunctionKeyword */: return !inStartOfParameter; @@ -30796,9 +29929,9 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 138 /* KeyOfKeyword */: - case 151 /* UniqueKeyword */: - case 142 /* ReadonlyKeyword */: + case 137 /* KeyOfKeyword */: + case 150 /* UniqueKeyword */: + case 141 /* ReadonlyKeyword */: return parseTypeOperator(operator); case 135 /* InferKeyword */: return parseInferType(); @@ -30915,7 +30048,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 136 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -30924,7 +30057,7 @@ var ts; var pos = getNodePos(); var assertsModifier = parseExpectedToken(127 /* AssertsKeyword */); var parameterName = token() === 107 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - var type = parseOptional(137 /* IsKeyword */) ? parseType() : undefined; + var type = parseOptional(136 /* IsKeyword */) ? parseType() : undefined; return finishNode(factory.createTypePredicateNode(assertsModifier, parameterName, type), pos); } function parseType() { @@ -31456,7 +30589,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand, pos); } function isInOrOfKeyword(t) { - return t === 100 /* InKeyword */ || t === 156 /* OfKeyword */; + return t === 100 /* InKeyword */ || t === 155 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand, pos) { while (true) { @@ -31596,7 +30729,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 206 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 203 /* TypeAssertionExpression */) { parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -31847,7 +30980,7 @@ var ts; var pos = getNodePos(); var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 275 /* JsxOpeningElement */) { + if (opening.kind === 272 /* JsxOpeningElement */) { var children = parseJsxChildren(opening); var closingElement = parseJsxClosingElement(inExpressionContext); if (!tagNamesAreEquivalent(opening.tagName, closingElement.tagName)) { @@ -31855,11 +30988,11 @@ var ts; } result = finishNode(factory.createJsxElement(opening, children, closingElement), pos); } - else if (opening.kind === 278 /* JsxOpeningFragment */) { + else if (opening.kind === 275 /* JsxOpeningFragment */) { result = finishNode(factory.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos); } else { - ts.Debug.assert(opening.kind === 274 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 271 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -32354,10 +31487,10 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(); if (parseContextualModifier(134 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */); + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 166 /* GetAccessor */); } - if (parseContextualModifier(146 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */); + if (parseContextualModifier(145 /* SetKeyword */)) { + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -32568,7 +31701,7 @@ var ts; } } var node; - if (awaitToken ? parseExpected(156 /* OfKeyword */) : parseOptional(156 /* OfKeyword */)) { + if (awaitToken ? parseExpected(155 /* OfKeyword */) : parseOptional(155 /* OfKeyword */)) { var expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(21 /* CloseParenToken */); node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement()); @@ -32594,10 +31727,10 @@ var ts; } function parseBreakOrContinueStatement(kind) { var pos = getNodePos(); - parseExpected(kind === 241 /* BreakStatement */ ? 80 /* BreakKeyword */ : 85 /* ContinueKeyword */); + parseExpected(kind === 238 /* BreakStatement */ ? 80 /* BreakKeyword */ : 85 /* ContinueKeyword */); var label = canParseSemicolon() ? undefined : parseIdentifier(); parseSemicolon(); - var node = kind === 241 /* BreakStatement */ + var node = kind === 238 /* BreakStatement */ ? factory.createBreakStatement(label) : factory.createContinueStatement(label); return finishNode(node, pos); @@ -32776,10 +31909,10 @@ var ts; // // could be legal, it would add complexity for very little gain. case 117 /* InterfaceKeyword */: - case 149 /* TypeKeyword */: + case 148 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 125 /* AbstractKeyword */: case 129 /* AsyncKeyword */: @@ -32787,14 +31920,14 @@ var ts; case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 122 /* PublicKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 154 /* GlobalKeyword */: + case 153 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 78 /* Identifier */ || token() === 92 /* ExportKeyword */; case 99 /* ImportKeyword */: @@ -32803,7 +31936,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 92 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 149 /* TypeKeyword */) { + if (currentToken_1 === 148 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -32859,17 +31992,17 @@ var ts; case 129 /* AsyncKeyword */: case 133 /* DeclareKeyword */: case 117 /* InterfaceKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: - case 149 /* TypeKeyword */: - case 154 /* GlobalKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: + case 148 /* TypeKeyword */: + case 153 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 123 /* StaticKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -32912,9 +32045,9 @@ var ts; case 96 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 85 /* ContinueKeyword */: - return parseBreakOrContinueStatement(240 /* ContinueStatement */); + return parseBreakOrContinueStatement(237 /* ContinueStatement */); case 80 /* BreakKeyword */: - return parseBreakOrContinueStatement(241 /* BreakStatement */); + return parseBreakOrContinueStatement(238 /* BreakStatement */); case 104 /* ReturnKeyword */: return parseReturnStatement(); case 115 /* WithKeyword */: @@ -32935,9 +32068,9 @@ var ts; return parseDeclaration(); case 129 /* AsyncKeyword */: case 117 /* InterfaceKeyword */: - case 149 /* TypeKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 148 /* TypeKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: case 133 /* DeclareKeyword */: case 84 /* ConstKeyword */: case 91 /* EnumKeyword */: @@ -32948,8 +32081,8 @@ var ts; case 122 /* PublicKeyword */: case 125 /* AbstractKeyword */: case 123 /* StaticKeyword */: - case 142 /* ReadonlyKeyword */: - case 154 /* GlobalKeyword */: + case 141 /* ReadonlyKeyword */: + case 153 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -33009,13 +32142,13 @@ var ts; return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers); case 117 /* InterfaceKeyword */: return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers); - case 149 /* TypeKeyword */: + case 148 /* TypeKeyword */: return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers); case 91 /* EnumKeyword */: return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers); - case 154 /* GlobalKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 153 /* GlobalKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers); case 99 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers); @@ -33034,7 +32167,7 @@ var ts; if (decorators || modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(271 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(268 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); ts.setTextRangePos(missing, pos); missing.decorators = decorators; missing.modifiers = modifiers; @@ -33153,7 +32286,7 @@ var ts; // this context. // The checker will then give an error that there is an empty declaration list. var declarations; - if (token() === 156 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 155 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { declarations = createMissingList(); } else { @@ -33257,12 +32390,12 @@ var ts; var parameters = parseParameters(0 /* None */); var type = parseReturnType(58 /* ColonToken */, /*isType*/ false); var body = parseFunctionBlockOrSemicolon(0 /* None */); - var node = kind === 167 /* GetAccessor */ + var node = kind === 166 /* GetAccessor */ ? factory.createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) : factory.createSetAccessorDeclaration(decorators, modifiers, name, parameters, body); // Keep track of `typeParameters` (for both) and `type` (for setters) if they were parsed those indicate grammar errors node.typeParameters = typeParameters; - if (type && node.kind === 168 /* SetAccessor */) + if (type && node.kind === 167 /* SetAccessor */) node.type = type; return withJSDoc(finishNode(node, pos), hasJSDoc); } @@ -33301,7 +32434,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 146 /* SetKeyword */ || idToken === 134 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 145 /* SetKeyword */ || idToken === 134 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -33405,10 +32538,10 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); if (parseContextualModifier(134 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */); + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 166 /* GetAccessor */); } - if (parseContextualModifier(146 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */); + if (parseContextualModifier(145 /* SetKeyword */)) { + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* SetAccessor */); } if (token() === 132 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers); @@ -33447,10 +32580,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, 221 /* ClassExpression */); + return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, 218 /* ClassExpression */); } function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 252 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 249 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) { var savedAwaitContext = inAwaitContext(); @@ -33472,7 +32605,7 @@ var ts; members = createMissingList(); } setAwaitContext(savedAwaitContext); - var node = kind === 252 /* ClassDeclaration */ + var node = kind === 249 /* ClassDeclaration */ ? factory.createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) : factory.createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -33532,11 +32665,11 @@ var ts; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) { - parseExpected(149 /* TypeKeyword */); + parseExpected(148 /* TypeKeyword */); var name = parseIdentifier(); var typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); - var type = token() === 136 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType(); + var type = parseType(); parseSemicolon(); var node = factory.createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -33592,7 +32725,7 @@ var ts; function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { var flags = 0; var name; - if (token() === 154 /* GlobalKeyword */) { + if (token() === 153 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation name = parseIdentifier(); flags |= 1024 /* GlobalAugmentation */; @@ -33613,15 +32746,15 @@ var ts; } function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { var flags = 0; - if (token() === 154 /* GlobalKeyword */) { + if (token() === 153 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); } - else if (parseOptional(140 /* NamespaceKeyword */)) { + else if (parseOptional(139 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(139 /* ModuleKeyword */); + parseExpected(138 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); } @@ -33629,7 +32762,7 @@ var ts; return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags); } function isExternalModuleReference() { - return token() === 143 /* RequireKeyword */ && + return token() === 142 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -33640,7 +32773,7 @@ var ts; } function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) { parseExpected(126 /* AsKeyword */); - parseExpected(140 /* NamespaceKeyword */); + parseExpected(139 /* NamespaceKeyword */); var name = parseIdentifier(); parseSemicolon(); var node = factory.createNamespaceExportDeclaration(name); @@ -33658,7 +32791,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 153 /* FromKeyword */ && + if (token() !== 152 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -33676,7 +32809,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(153 /* FromKeyword */); + parseExpected(152 /* FromKeyword */); } var moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -33689,7 +32822,7 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 153 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 152 /* FromKeyword */; } function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) { parseExpected(62 /* EqualsToken */); @@ -33714,7 +32847,7 @@ var ts; var namedBindings; if (!identifier || parseOptional(27 /* CommaToken */)) { - namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(264 /* NamedImports */); + namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(261 /* NamedImports */); } return finishNode(factory.createImportClause(isTypeOnly, identifier, namedBindings), pos); } @@ -33725,7 +32858,7 @@ var ts; } function parseExternalModuleReference() { var pos = getNodePos(); - parseExpected(143 /* RequireKeyword */); + parseExpected(142 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); var expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -33762,16 +32895,16 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - var node = kind === 264 /* NamedImports */ + var node = kind === 261 /* NamedImports */ ? factory.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); return finishNode(node, pos); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(270 /* ExportSpecifier */); + return parseImportOrExportSpecifier(267 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(265 /* ImportSpecifier */); + return parseImportOrExportSpecifier(262 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var pos = getNodePos(); @@ -33798,38 +32931,38 @@ var ts; else { name = identifierName; } - if (kind === 265 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 262 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } - var node = kind === 265 /* ImportSpecifier */ + var node = kind === 262 /* ImportSpecifier */ ? factory.createImportSpecifier(propertyName, name) : factory.createExportSpecifier(propertyName, name); return finishNode(node, pos); } function parseNamespaceExport(pos) { - return finishNode(factory.createNamespaceExport(parseIdentifierName()), pos); + return finishNode(factory.createNamespaceExport(parseIdentifier()), pos); } function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) { var savedAwaitContext = inAwaitContext(); setAwaitContext(/*value*/ true); var exportClause; var moduleSpecifier; - var isTypeOnly = parseOptional(149 /* TypeKeyword */); + var isTypeOnly = parseOptional(148 /* TypeKeyword */); var namespaceExportPos = getNodePos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(126 /* AsKeyword */)) { exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(153 /* FromKeyword */); + parseExpected(152 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } else { - exportClause = parseNamedImportsOrExports(268 /* NamedExports */); + exportClause = parseNamedImportsOrExports(265 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 153 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(153 /* FromKeyword */); + if (token() === 152 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(152 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } } @@ -33946,18 +33079,6 @@ var ts; return finishNode(result, pos); } JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression; - function parseJSDocNameReference() { - var pos = getNodePos(); - var hasBrace = parseOptional(18 /* OpenBraceToken */); - var entityName = parseEntityName(/* allowReservedWords*/ false); - if (hasBrace) { - parseExpectedJSDoc(19 /* CloseBraceToken */); - } - var result = factory.createJSDocNameReference(entityName); - fixupParentReferences(result); - return finishNode(result, pos); - } - JSDocParser.parseJSDocNameReference = parseJSDocNameReference; function parseIsolatedJSDocComment(content, start, length) { initializeState("", content, 99 /* Latest */, /*_syntaxCursor:*/ undefined, 1 /* JS */); var jsDoc = doInsideOfContext(4194304 /* JSDoc */, function () { return parseJSDocCommentWorker(start, length); }); @@ -34021,8 +33142,7 @@ var ts; var state = 1 /* SawAsterisk */; var margin; // + 4 for leading '/** ' - // + 1 because the last index of \n is always one index before the first character in the line and coincidentally, if there is no \n before start, it is -1, which is also one index before the first character - var indent = start - (content.lastIndexOf("\n", start) + 1) + 4; + var indent = start - Math.max(content.lastIndexOf("\n", start), 0) + 4; function pushComment(text) { if (!margin) { margin = indent; @@ -34078,7 +33198,7 @@ var ts; comments.push(whitespace); } else if (margin !== undefined && indent + whitespace.length > margin) { - comments.push(whitespace.slice(margin - indent)); + comments.push(whitespace.slice(margin - indent - 1)); } indent += whitespace.length; break; @@ -34222,9 +33342,6 @@ var ts; case "callback": tag = parseCallbackTag(start, tagName, margin, indentText); break; - case "see": - tag = parseSeeTag(start, tagName, margin, indentText); - break; default: tag = parseUnknownTag(start, tagName, margin, indentText); break; @@ -34374,9 +33491,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return true; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -34408,12 +33525,12 @@ var ts; var child = void 0; var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) { + if (child.kind === 322 /* JSDocParameterTag */ || child.kind === 328 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 178 /* ArrayType */), pos); + var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 177 /* ArrayType */), pos); return finishNode(factory.createJSDocTypeExpression(literal), pos); } } @@ -34435,12 +33552,6 @@ var ts; var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined; return finishNode(factory.createJSDocTypeTag(tagName, typeExpression, comments), start, end); } - function parseSeeTag(start, tagName, indent, indentText) { - var nameExpression = parseJSDocNameReference(); - var end = getNodePos(); - var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined; - return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start, end); - } function parseAuthorTag(start, tagName, indent, indentText) { var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -34556,7 +33667,7 @@ var ts; var hasChildren = false; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { hasChildren = true; - if (child.kind === 329 /* JSDocTypeTag */) { + if (child.kind === 325 /* JSDocTypeTag */) { if (childTypeTag) { parseErrorAtCurrentToken(ts.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); var lastError = ts.lastOrUndefined(parseDiagnostics); @@ -34574,7 +33685,7 @@ var ts; } } if (hasChildren) { - var isArrayType = typeExpression && typeExpression.type.kind === 178 /* ArrayType */; + var isArrayType = typeExpression && typeExpression.type.kind === 177 /* ArrayType */; var jsdocTypeLiteral = factory.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType); typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : @@ -34627,7 +33738,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 327 /* JSDocReturnTag */) { + if (tag && tag.kind === 323 /* JSDocReturnTag */) { return tag; } } @@ -34662,7 +33773,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) && + if (child && (child.kind === 322 /* JSDocParameterTag */ || child.kind === 328 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -35408,8 +34519,6 @@ var ts; } case "jsx": case "jsxfrag": - case "jsximportsource": - case "jsxruntime": return; // Accessed directly default: ts.Debug.fail("Unhandled pragma kind"); // Can this be made into an assertNever in the future? } @@ -35534,18 +34643,6 @@ var ts; (function (ts) { /* @internal */ ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; - var jsxOptionMap = new ts.Map(ts.getEntries({ - "preserve": 1 /* Preserve */, - "react-native": 3 /* ReactNative */, - "react": 2 /* React */, - "react-jsx": 4 /* ReactJSX */, - "react-jsxdev": 5 /* ReactJSXDev */, - })); - /* @internal */ - ts.inverseJsxOptionMap = new ts.Map(ts.arrayFrom(ts.mapIterator(jsxOptionMap.entries(), function (_a) { - var key = _a[0], value = _a[1]; - return ["" + value, key]; - }))); // NOTE: The order here is important to default lib ordering as entries will have the same // order in the generated program (see `getDefaultLibPriority` in program.ts). This // order also affects overload resolution when a type declared in one lib is @@ -35567,7 +34664,6 @@ var ts; ["dom.iterable", "lib.dom.iterable.d.ts"], ["webworker", "lib.webworker.d.ts"], ["webworker.importscripts", "lib.webworker.importscripts.d.ts"], - ["webworker.iterable", "lib.webworker.iterable.d.ts"], ["scripthost", "lib.scripthost.d.ts"], // ES2015 Or ESNext By-feature options ["es2015.core", "lib.es2015.core.d.ts"], @@ -35596,7 +34692,6 @@ var ts; ["es2019.symbol", "lib.es2019.symbol.d.ts"], ["es2020.bigint", "lib.es2020.bigint.d.ts"], ["es2020.promise", "lib.es2020.promise.d.ts"], - ["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"], ["es2020.string", "lib.es2020.string.d.ts"], ["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"], ["es2020.intl", "lib.es2020.intl.d.ts"], @@ -35606,8 +34701,7 @@ var ts; ["esnext.intl", "lib.esnext.intl.d.ts"], ["esnext.bigint", "lib.es2020.bigint.d.ts"], ["esnext.string", "lib.esnext.string.d.ts"], - ["esnext.promise", "lib.esnext.promise.d.ts"], - ["esnext.weakref", "lib.esnext.weakref.d.ts"] + ["esnext.promise", "lib.esnext.promise.d.ts"] ]; /** * An array of supported "lib" reference file names used to determine the order for inclusion @@ -35739,15 +34833,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Generates_a_CPU_profile }, - { - name: "generateTrace", - type: "string", - isFilePath: true, - isCommandLineOnly: true, - paramType: ts.Diagnostics.DIRECTORY, - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Generates_an_event_trace_and_a_list_of_types - }, { name: "incremental", shortName: "i", @@ -35903,10 +34988,12 @@ var ts; }, { name: "jsx", - type: jsxOptionMap, + type: new ts.Map(ts.getEntries({ + "preserve": 1 /* Preserve */, + "react-native": 3 /* ReactNative */, + "react": 2 /* React */ + })), affectsSourceFile: true, - affectsEmit: true, - affectsModuleResolution: true, paramType: ts.Diagnostics.KIND, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, @@ -36149,14 +35236,6 @@ var ts; category: ts.Diagnostics.Additional_Checks, description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement }, - { - name: "noUncheckedIndexedAccess", - type: "boolean", - affectsSemanticDiagnostics: true, - showInSimplifiedHelpView: false, - category: ts.Diagnostics.Additional_Checks, - description: ts.Diagnostics.Include_undefined_in_index_signature_results - }, // Module Resolution { name: "moduleResolution", @@ -36318,15 +35397,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment }, - { - name: "jsxImportSource", - type: "string", - affectsSemanticDiagnostics: true, - affectsEmit: true, - affectsModuleResolution: true, - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react - }, { name: "resolveJsonModule", type: "boolean", @@ -36638,11 +35708,7 @@ var ts; name: "exclude", type: "string" } - }, - { - name: "disableFilenameBasedTypeAcquisition", - type: "boolean", - }, + } ]; /*@internal*/ function createOptionNameMap(optionDeclarations) { @@ -36997,7 +36063,7 @@ var ts; */ function readJsonConfigFile(fileName, readFile) { var textOrDiagnostic = tryReadFile(fileName, readFile); - return ts.isString(textOrDiagnostic) ? ts.parseJsonText(fileName, textOrDiagnostic) : { fileName: fileName, parseDiagnostics: [textOrDiagnostic] }; + return ts.isString(textOrDiagnostic) ? ts.parseJsonText(fileName, textOrDiagnostic) : { parseDiagnostics: [textOrDiagnostic] }; } ts.readJsonConfigFile = readJsonConfigFile; /*@internal*/ @@ -37140,7 +36206,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_4 = function (element) { - if (element.kind !== 288 /* PropertyAssignment */) { + if (element.kind !== 285 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -37231,13 +36297,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -37254,7 +36320,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -37739,7 +36805,6 @@ var ts; * It does *not* resolve the included files. */ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache) { - var _a; basePath = ts.normalizeSlashes(basePath); var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { @@ -37749,13 +36814,6 @@ var ts; var ownConfig = json ? parseOwnConfigOfJson(json, host, basePath, configFileName, errors) : parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); - if ((_a = ownConfig.options) === null || _a === void 0 ? void 0 : _a.paths) { - // If we end up needing to resolve relative paths from 'paths' relative to - // the config file location, we'll need to know where that config file was. - // Since 'paths' can be inherited from an extended config in another directory, - // we wouldn't know which directory to use unless we store it here. - ownConfig.options.pathsBasePath = basePath; - } if (ownConfig.extendedConfigPath) { // copy the resolution stack so it is never reused between branches in potential diamond-problem scenarios. resolutionStack = resolutionStack.concat([resolvedPath]); @@ -39055,15 +38113,12 @@ var ts; } function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) { var _a = state.compilerOptions, baseUrl = _a.baseUrl, paths = _a.paths; - if (paths && !ts.pathIsRelative(moduleName)) { + if (baseUrl && paths && !ts.pathIsRelative(moduleName)) { if (state.traceEnabled) { - if (baseUrl) { - trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); - } + trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName); } - var baseDirectory = ts.getPathsBasePath(state.compilerOptions, state.host); // Always defined when 'paths' is defined - return tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, loader, /*onlyRecordFailures*/ false, state); + return tryLoadModuleUsingPaths(extensions, moduleName, baseUrl, paths, loader, /*onlyRecordFailures*/ false, state); } } function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state) { @@ -39562,7 +38617,6 @@ var ts; } var resolved = ts.forEach(paths[matchedPatternText], function (subst) { var path = matchedStar_1 ? subst.replace("*", matchedStar_1) : subst; - // When baseUrl is not specified, the command line parser resolves relative paths to the config file location. var candidate = ts.normalizePath(ts.combinePaths(baseDirectory, path)); if (state.traceEnabled) { trace(state.host, ts.Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path); @@ -39728,26 +38782,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: if (!(ts.hasSyntacticModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 268 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 265 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -39763,7 +38817,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 257 /* ModuleBlock */: { + case 254 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -39785,7 +38839,7 @@ var ts; }); return state_1; } - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 78 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -39857,15 +38911,12 @@ var ts; } var binder = createBinder(); function bindSourceFile(file, options) { - var tracingData = ["bind" /* Bind */, "bindSourceFile", { path: file.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeBind"); ts.perfLogger.logStartBindFile("" + file.fileName); binder(file, options); ts.perfLogger.logStopBindFile(); ts.performance.mark("afterBind"); ts.performance.measure("Bind", "beforeBind", "afterBind"); - ts.tracing.end.apply(ts.tracing, tracingData); } ts.bindSourceFile = bindSourceFile; function createBinder() { @@ -39897,8 +38948,6 @@ var ts; // not depending on if we see "use strict" in certain places or if we hit a class/namespace // or if compiler options contain alwaysStrict. var inStrictMode; - // If we are binding an assignment pattern, we will bind certain expressions differently. - var inAssignmentPattern = false; var symbolCount = 0; var Symbol; var classifiableNames; @@ -39948,7 +38997,6 @@ var ts; currentExceptionTarget = undefined; activeLabelList = undefined; hasExplicitReturn = false; - inAssignmentPattern = false; emitFlags = 0 /* None */; } return bindSourceFile; @@ -39986,7 +39034,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 266 /* ExportAssignment */) { + if (node.kind === 263 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -39995,7 +39043,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 158 /* ComputedPropertyName */) { + if (name.kind === 157 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -40023,36 +39071,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return "__constructor" /* Constructor */; - case 174 /* FunctionType */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: + case 173 /* FunctionType */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: return "__call" /* Call */; - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: return "__new" /* New */; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return "__index" /* Index */; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 160 /* Parameter */: + case 159 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 308 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 304 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -40152,7 +39200,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 266 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 263 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -40189,9 +39237,9 @@ var ts; return symbol; } function declareModuleMember(node, symbolFlags, symbolExcludes) { - var hasExportModifier = !!(ts.getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node); + var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 270 /* ExportSpecifier */ || (node.kind === 260 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 267 /* ExportSpecifier */ || (node.kind === 257 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -40215,7 +39263,7 @@ var ts; // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. if (ts.isJSDocTypeAlias(node)) ts.Debug.assert(ts.isInJSFile(node)); // We shouldn't add symbols for JSDoc nodes if not in a JS file. - if (!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) { + if ((!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) || ts.isJSDocTypeAlias(node)) { if (!container.locals || (ts.hasSyntacticModifier(node, 512 /* Default */) && !getDeclarationName(node))) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); // No local symbol for an unnamed default! } @@ -40230,28 +39278,6 @@ var ts; } } } - function jsdocTreatAsExported(node) { - if (node.parent && ts.isModuleDeclaration(node)) { - node = node.parent; - } - if (!ts.isJSDocTypeAlias(node)) - return false; - // jsdoc typedef handling is a bit of a doozy, but to summarize, treat the typedef as exported if: - // 1. It has an explicit name (since by default typedefs are always directly exported, either at the top level or in a container), or - if (!ts.isJSDocEnumTag(node) && !!node.fullName) - return true; - // 2. The thing a nameless typedef pulls its name from is implicitly a direct export (either by assignment or actual export flag). - var declName = ts.getNameOfDeclaration(node); - if (!declName) - return false; - if (ts.isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent)) - return true; - if (ts.isDeclaration(declName.parent) && ts.getCombinedModifierFlags(declName.parent) & 1 /* Export */) - return true; - // This could potentially be simplified by having `delayedBindJSDocTypedefTag` pass in an override for `hasExportModifier`, since it should - // already have calculated and branched on most of this. - return false; - } // All container nodes are kept on a linked list in declaration order. This list is used by // the getLocalNameOfContainer function in the type checker to validate that the local name // used for a container is unique. @@ -40280,7 +39306,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 209 /* ArrowFunction */) { + if (node.kind !== 206 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -40313,7 +39339,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 166 /* Constructor */ || (ts.isInJSFile && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 165 /* Constructor */ || (ts.isInJSFile && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */)) ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -40328,13 +39354,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 166 /* Constructor */ || (ts.isInJSFile && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */))) { + if (node.kind === 165 /* Constructor */ || (ts.isInJSFile && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */))) { node.returnFlowNode = currentFlow; } } @@ -40361,8 +39387,8 @@ var ts; blockScopeContainer = savedBlockScopeContainer; } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 251 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 251 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 248 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 248 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -40375,156 +39401,129 @@ var ts; ts.forEachChild(node, bind, bindEach); } function bindChildren(node) { - var saveInAssignmentPattern = inAssignmentPattern; - // Most nodes aren't valid in an assignment pattern, so we clear the value here - // and set it before we descend into nodes that could actually be part of an assignment pattern. - inAssignmentPattern = false; if (checkUnreachable(node)) { bindEachChild(node); bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; return; } - if (node.kind >= 232 /* FirstStatement */ && node.kind <= 248 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 229 /* FirstStatement */ && node.kind <= 245 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: bindWhileStatement(node); break; - case 235 /* DoStatement */: + case 232 /* DoStatement */: bindDoStatement(node); break; - case 237 /* ForStatement */: + case 234 /* ForStatement */: bindForStatement(node); break; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 234 /* IfStatement */: + case 231 /* IfStatement */: bindIfStatement(node); break; - case 242 /* ReturnStatement */: - case 246 /* ThrowStatement */: + case 239 /* ReturnStatement */: + case 243 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: bindTryStatement(node); break; - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: bindSwitchStatement(node); break; - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: bindCaseBlock(node); break; - case 284 /* CaseClause */: + case 281 /* CaseClause */: bindCaseClause(node); break; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: bindLabeledStatement(node); break; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 216 /* BinaryExpression */: - if (ts.isDestructuringAssignment(node)) { - // Carry over whether we are in an assignment pattern to - // binary expressions that could actually be an initializer - inAssignmentPattern = saveInAssignmentPattern; - bindDestructuringAssignmentFlow(node); - return; - } + case 213 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: bindCallExpressionFlow(node); break; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: bindNonNullExpressionFlow(node); break; - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 297 /* SourceFile */: { + case 294 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; - case 198 /* BindingElement */: - bindBindingElementFlow(node); - break; - case 200 /* ObjectLiteralExpression */: - case 199 /* ArrayLiteralExpression */: - case 288 /* PropertyAssignment */: - case 220 /* SpreadElement */: - // Carry over whether we are in an assignment pattern of Object and Array literals - // as well as their children that are valid assignment targets. - inAssignmentPattern = saveInAssignmentPattern; - // falls through default: bindEachChild(node); break; } bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; } function isNarrowingExpression(expr) { switch (expr.kind) { case 78 /* Identifier */: - case 79 /* PrivateIdentifier */: case 107 /* ThisKeyword */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return hasNarrowableArgument(expr); - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; } function isNarrowableReference(expr) { - return expr.kind === 78 /* Identifier */ || expr.kind === 79 /* PrivateIdentifier */ || expr.kind === 107 /* ThisKeyword */ || expr.kind === 105 /* SuperKeyword */ || + return expr.kind === 78 /* Identifier */ || expr.kind === 107 /* ThisKeyword */ || expr.kind === 105 /* SuperKeyword */ || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) || - ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right) || ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression) || ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left); } @@ -40540,7 +39539,7 @@ var ts; } } } - if (expr.expression.kind === 201 /* PropertyAccessExpression */ && + if (expr.expression.kind === 198 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -40576,9 +39575,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -40654,26 +39653,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 234 /* IfStatement */: - case 236 /* WhileStatement */: - case 235 /* DoStatement */: + case 231 /* IfStatement */: + case 233 /* WhileStatement */: + case 232 /* DoStatement */: return parent.expression === node; - case 237 /* ForStatement */: - case 217 /* ConditionalExpression */: + case 234 /* ForStatement */: + case 214 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 207 /* ParenthesizedExpression */) { + if (node.kind === 204 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 214 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 211 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 213 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -40720,7 +39719,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 245 /* LabeledStatement */) { + while (label && node.parent.kind === 242 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -40771,12 +39770,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 239 /* ForOfStatement */) { + if (node.kind === 236 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 250 /* VariableDeclarationList */) { + if (node.initializer.kind !== 247 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -40798,7 +39797,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 242 /* ReturnStatement */) { + if (node.kind === 239 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -40815,7 +39814,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 241 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 238 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -40920,7 +39919,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 285 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 282 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -40963,13 +39962,10 @@ var ts; } function bindExpressionStatement(node) { bind(node.expression); - maybeBindExpressionFlowIfCall(node.expression); - } - function maybeBindExpressionFlowIfCall(node) { - // A top level or LHS of comma expression call expression with a dotted function name and at least one argument + // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.kind === 203 /* CallExpression */) { - var call = node; + if (node.expression.kind === 200 /* CallExpression */) { + var call = node.expression; if (ts.isDottedName(call.expression) && call.expression.kind !== 105 /* SuperKeyword */) { currentFlow = createFlowCall(currentFlow, call); } @@ -40994,7 +39990,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -41005,10 +40001,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 199 /* ArrayLiteralExpression */) { + else if (node.kind === 196 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 220 /* SpreadElement */) { + if (e.kind === 217 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -41016,16 +40012,16 @@ var ts; } } } - else if (node.kind === 200 /* ObjectLiteralExpression */) { + else if (node.kind === 197 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 288 /* PropertyAssignment */) { + if (p.kind === 285 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 289 /* ShorthandPropertyAssignment */) { + else if (p.kind === 286 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 290 /* SpreadAssignment */) { + else if (p.kind === 287 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -41073,23 +40069,6 @@ var ts; bindAssignmentTargetFlow(node.operand); } } - function bindDestructuringAssignmentFlow(node) { - if (inAssignmentPattern) { - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - inAssignmentPattern = true; - bind(node.left); - } - else { - inAssignmentPattern = true; - bind(node.left); - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - } - bindAssignmentTargetFlow(node.left); - } var BindBinaryExpressionFlowState; (function (BindBinaryExpressionFlowState) { BindBinaryExpressionFlowState[BindBinaryExpressionFlowState["BindThenBindChildren"] = 0] = "BindThenBindChildren"; @@ -41144,9 +40123,6 @@ var ts; break; } case 2 /* BindToken */: { - if (node.operatorToken.kind === 27 /* CommaToken */) { - maybeBindExpressionFlowIfCall(node.left); - } advanceState(3 /* BindRight */); maybeBind(node.operatorToken); break; @@ -41160,7 +40136,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 202 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 199 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -41197,7 +40173,7 @@ var ts; * If `node` is a BinaryExpression, adds it to the local work stack, otherwise recursively binds it */ function maybeBind(node) { - if (node && ts.isBinaryExpression(node) && !ts.isDestructuringAssignment(node)) { + if (node && ts.isBinaryExpression(node)) { stackIndex++; workStacks.expr[stackIndex] = node; workStacks.state[stackIndex] = 0 /* BindThenBindChildren */; @@ -41211,7 +40187,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 201 /* PropertyAccessExpression */) { + if (node.expression.kind === 198 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -41248,27 +40224,9 @@ var ts; bindInitializedVariableFlow(node); } } - function bindBindingElementFlow(node) { - if (ts.isBindingPattern(node.name)) { - // When evaluating a binding pattern, the initializer is evaluated before the binding pattern, per: - // - https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-iteratorbindinginitialization - // - `BindingElement: BindingPattern Initializer?` - // - https://tc39.es/ecma262/#sec-runtime-semantics-keyedbindinginitialization - // - `BindingElement: BindingPattern Initializer?` - bindEach(node.decorators); - bindEach(node.modifiers); - bind(node.dotDotDotToken); - bind(node.propertyName); - bind(node.initializer); - bind(node.name); - } - else { - bindEachChild(node); - } - } function bindJSDocTypeAlias(node) { ts.setParent(node.tagName, node); - if (node.kind !== 325 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 321 /* JSDocEnumTag */ && node.fullName) { ts.setParent(node.fullName, node); ts.setParentRecursive(node.fullName, /*incremental*/ false); } @@ -41276,7 +40234,7 @@ var ts; function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 165 /* MethodDeclaration */) { + if (host && host.kind !== 164 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -41289,15 +40247,15 @@ var ts; } function bindOptionalChainRest(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: bind(node.questionDotToken); bind(node.name); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: bind(node.questionDotToken); bind(node.argumentExpression); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); @@ -41362,7 +40320,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 208 /* FunctionExpression */ || expr.kind === 209 /* ArrowFunction */) { + if (expr.kind === 205 /* FunctionExpression */ || expr.kind === 206 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -41374,7 +40332,7 @@ var ts; } } } - if (node.expression.kind === 201 /* PropertyAccessExpression */) { + if (node.expression.kind === 198 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -41383,54 +40341,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 200 /* ObjectLiteralExpression */: - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 281 /* JsxAttributes */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 197 /* ObjectLiteralExpression */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 278 /* JsxAttributes */: return 1 /* IsContainer */; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 190 /* MappedType */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 189 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: - case 308 /* JSDocFunctionType */: - case 174 /* FunctionType */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 175 /* ConstructorType */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: + case 304 /* JSDocFunctionType */: + case 173 /* FunctionType */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 174 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 287 /* CatchClause */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 258 /* CaseBlock */: + case 284 /* CatchClause */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 255 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 230 /* Block */: + case 227 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -41463,45 +40421,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 297 /* SourceFile */: + case 294 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 200 /* ObjectLiteralExpression */: - case 253 /* InterfaceDeclaration */: - case 281 /* JsxAttributes */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 197 /* ObjectLiteralExpression */: + case 250 /* InterfaceDeclaration */: + case 278 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 313 /* JSDocSignature */: - case 171 /* IndexSignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 308 /* JSDocFunctionType */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 254 /* TypeAliasDeclaration */: - case 190 /* MappedType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 309 /* JSDocSignature */: + case 170 /* IndexSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 304 /* JSDocFunctionType */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 251 /* TypeAliasDeclaration */: + case 189 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -41602,7 +40560,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 290 /* SpreadAssignment */ || prop.name.kind !== 78 /* Identifier */) { + if (prop.kind === 287 /* SpreadAssignment */ || prop.name.kind !== 78 /* Identifier */) { continue; } var identifier = prop.name; @@ -41614,7 +40572,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 288 /* PropertyAssignment */ || prop.kind === 289 /* ShorthandPropertyAssignment */ || prop.kind === 165 /* MethodDeclaration */ + var currentKind = prop.kind === 285 /* PropertyAssignment */ || prop.kind === 286 /* ShorthandPropertyAssignment */ || prop.kind === 164 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -41646,10 +40604,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -41848,8 +40806,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 297 /* SourceFile */ && - blockScopeContainer.kind !== 256 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 294 /* SourceFile */ && + blockScopeContainer.kind !== 253 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -41944,7 +40902,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 156 /* LastToken */) { + if (node.kind > 155 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -42020,7 +40978,7 @@ var ts; } // falls through case 107 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 289 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 286 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkContextualIdentifier(node); @@ -42029,8 +40987,8 @@ var ts; break; case 79 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -42041,11 +40999,11 @@ var ts; if (ts.isInJSFile(expr) && file.commonJsModuleIndicator && ts.isModuleExportsAccessExpression(expr) && - !lookupSymbolForName(blockScopeContainer, "module")) { + !lookupSymbolForNameWorker(blockScopeContainer, "module")) { declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -42064,14 +41022,6 @@ var ts; bindThisPropertyAssignment(node); break; case 5 /* Property */: - var expression = node.left.expression; - if (ts.isInJSFile(node) && ts.isIdentifier(expression)) { - var symbol = lookupSymbolForName(blockScopeContainer, expression.escapedText); - if (ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration)) { - bindThisPropertyAssignment(node); - break; - } - } bindSpecialPropertyAssignment(node); break; case 0 /* None */: @@ -42081,78 +41031,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return checkStrictModeCatchClause(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return checkStrictModeWithStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 187 /* ThisType */: + case 186 /* ThisType */: seenThisKeyword = true; return; - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: break; // Binding the children will handle everything - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return bindTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return bindParameter(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return bindPropertyWorker(node); - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 291 /* EnumMember */: + case 288 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 174 /* FunctionType */: - case 308 /* JSDocFunctionType */: - case 313 /* JSDocSignature */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 304 /* JSDocFunctionType */: + case 309 /* JSDocSignature */: + case 174 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 190 /* MappedType */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 189 /* MappedType */: return bindAnonymousTypeWorker(node); - case 319 /* JSDocClassTag */: + case 315 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return bindFunctionExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -42171,65 +41121,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return bindJsxAttributes(node); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return bindImportClause(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return bindExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return bindExportAssignment(node); - case 297 /* SourceFile */: + case 294 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 230 /* Block */: + case 227 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 326 /* JSDocParameterTag */: - if (node.parent.kind === 313 /* JSDocSignature */) { + case 322 /* JSDocParameterTag */: + if (node.parent.kind === 309 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 312 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 308 /* JSDocTypeLiteral */) { break; } // falls through - case 333 /* JSDocPropertyTag */: + case 328 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 307 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 303 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -42350,9 +41300,9 @@ var ts; return symbol; }); if (symbol) { - var isAlias = ts.isAliasableExpression(node.right) && (ts.isExportsIdentifier(node.left.expression) || ts.isModuleExportsAccessExpression(node.left.expression)); - var flags = isAlias ? 2097152 /* Alias */ : 4 /* Property */ | 1048576 /* ExportValue */; - ts.setParent(node.left, node); + var flags = ts.isClassExpression(node.right) ? + 4 /* Property */ | 1048576 /* ExportValue */ | 32 /* Class */ : + 4 /* Property */ | 1048576 /* ExportValue */; declareSymbol(symbol.exports, symbol, node.left, flags, 0 /* None */); } } @@ -42368,10 +41318,6 @@ var ts; if (ts.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { return; } - if (ts.isObjectLiteralExpression(assignedExpression) && ts.every(assignedExpression.properties, ts.isShorthandPropertyAssignment)) { - ts.forEach(assignedExpression.properties, bindExportAssignedObjectMemberAlias); - return; - } // 'module.exports = expr' assignment var flags = ts.exportAssignmentIsAlias(node) ? 2097152 /* Alias */ @@ -42379,9 +41325,6 @@ var ts; var symbol = declareSymbol(file.symbol.exports, file.symbol, node, flags | 67108864 /* Assignment */, 0 /* None */); ts.setValueDeclaration(symbol, node); } - function bindExportAssignedObjectMemberAlias(node) { - declareSymbol(file.symbol.exports, file.symbol, node, 2097152 /* Alias */ | 67108864 /* Assignment */, 0 /* None */); - } function bindThisPropertyAssignment(node) { ts.Debug.assert(ts.isInJSFile(node)); // private identifiers *must* be declared (even in JS files) @@ -42392,8 +41335,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -42415,11 +41358,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 166 /* Constructor */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 165 /* Constructor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -42431,7 +41374,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -42460,7 +41403,7 @@ var ts; if (node.expression.kind === 107 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 297 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 294 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -42500,21 +41443,16 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 297 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 294 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } function bindSpecialPropertyAssignment(node) { - var _a; // Class declarations in Typescript do not allow property declarations var parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, container) || lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer); if (!ts.isInJSFile(node) && !ts.isFunctionSymbol(parentSymbol)) { return; } - var rootExpr = ts.getLeftmostAccessExpression(node.left); - if (ts.isIdentifier(rootExpr) && ((_a = lookupSymbolForName(container, rootExpr.escapedText)) === null || _a === void 0 ? void 0 : _a.flags) & 2097152 /* Alias */) { - return; - } // Fix up parent pointers since we're going to use these nodes before we bind into them ts.setParent(node.left, node); ts.setParent(node.right, node); @@ -42548,17 +41486,17 @@ var ts; } if (isToplevel && !isPrototypeProperty) { // make symbols or add declarations for intermediate containers - var flags_2 = 1536 /* Module */ | 67108864 /* Assignment */; + var flags_1 = 1536 /* Module */ | 67108864 /* Assignment */; var excludeFlags_1 = 110735 /* ValueModuleExcludes */ & ~67108864 /* Assignment */; namespaceSymbol = forEachIdentifierInEntityName(entityName, namespaceSymbol, function (id, symbol, parent) { if (symbol) { - addDeclarationToSymbol(symbol, id, flags_2); + addDeclarationToSymbol(symbol, id, flags_1); return symbol; } else { var table = parent ? parent.exports : file.jsGlobalAugmentations || (file.jsGlobalAugmentations = ts.createSymbolTable()); - return declareSymbol(table, parent, id, flags_2, excludeFlags_1); + return declareSymbol(table, parent, id, flags_1, excludeFlags_1); } }); } @@ -42609,8 +41547,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 297 /* SourceFile */ - : propertyAccess.parent.parent.kind === 297 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 294 /* SourceFile */ + : propertyAccess.parent.parent.kind === 294 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer); @@ -42657,7 +41595,7 @@ var ts; function lookupSymbolForPropertyAccess(node, lookupContainer) { if (lookupContainer === void 0) { lookupContainer = container; } if (ts.isIdentifier(node)) { - return lookupSymbolForName(lookupContainer, node.escapedText); + return lookupSymbolForNameWorker(lookupContainer, node.escapedText); } else { var symbol = lookupSymbolForPropertyAccess(node.expression); @@ -42689,7 +41627,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 252 /* ClassDeclaration */) { + if (node.kind === 249 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -42731,10 +41669,7 @@ var ts; checkStrictModeEvalOrArguments(node, node.name); } if (!ts.isBindingPattern(node.name)) { - if (ts.isInJSFile(node) && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true) && !ts.getJSDocTypeTag(node)) { - declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - } - else if (ts.isBlockOrCatchScoped(node)) { + if (ts.isBlockOrCatchScoped(node)) { bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */); } else if (ts.isParameterDeclaration(node)) { @@ -42755,7 +41690,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 326 /* JSDocParameterTag */ && container.kind !== 313 /* JSDocSignature */) { + if (node.kind === 322 /* JSDocParameterTag */ && container.kind !== 309 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -42832,7 +41767,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 185 /* InferType */) { + else if (node.parent.kind === 184 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -42860,11 +41795,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 231 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 228 /* EmptyStatement */) || // report error on class declarations - node.kind === 252 /* ClassDeclaration */ || + node.kind === 249 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 256 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 253 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -42908,12 +41843,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return ts.hasSyntacticModifier(s, 2048 /* Const */); default: return false; @@ -42929,7 +41864,7 @@ var ts; return true; } else if (ts.isIdentifier(node)) { - var symbol = lookupSymbolForName(sourceFile, node.escapedText); + var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText); if (!!symbol && !!symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) { var init = symbol.valueDeclaration.initializer; q.push(init); @@ -42943,7 +41878,7 @@ var ts; return false; } ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias; - function lookupSymbolForName(container, name) { + function lookupSymbolForNameWorker(container, name) { var local = container.locals && container.locals.get(name); if (local) { return local.exportSymbol || local; @@ -43113,7 +42048,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 176 /* TypeQuery */) { + if (d.type && d.type.kind === 175 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -43143,7 +42078,6 @@ var ts; IterationUse[IterationUse["YieldStarFlag"] = 16] = "YieldStarFlag"; IterationUse[IterationUse["SpreadFlag"] = 32] = "SpreadFlag"; IterationUse[IterationUse["DestructuringFlag"] = 64] = "DestructuringFlag"; - IterationUse[IterationUse["PossiblyOutOfBounds"] = 128] = "PossiblyOutOfBounds"; // Spread, Destructuring, Array element assignment IterationUse[IterationUse["Element"] = 1] = "Element"; IterationUse[IterationUse["Spread"] = 33] = "Spread"; @@ -43290,7 +42224,6 @@ var ts; AccessFlags[AccessFlags["Writing"] = 2] = "Writing"; AccessFlags[AccessFlags["CacheSymbol"] = 4] = "CacheSymbol"; AccessFlags[AccessFlags["NoTupleBoundsCheck"] = 8] = "NoTupleBoundsCheck"; - AccessFlags[AccessFlags["ExpressionPosition"] = 16] = "ExpressionPosition"; })(AccessFlags || (AccessFlags = {})); var SignatureCheckMode; (function (SignatureCheckMode) { @@ -43349,25 +42282,6 @@ var ts; DeclarationSpaces[DeclarationSpaces["ExportType"] = 2] = "ExportType"; DeclarationSpaces[DeclarationSpaces["ExportNamespace"] = 4] = "ExportNamespace"; })(DeclarationSpaces || (DeclarationSpaces = {})); - var MinArgumentCountFlags; - (function (MinArgumentCountFlags) { - MinArgumentCountFlags[MinArgumentCountFlags["None"] = 0] = "None"; - MinArgumentCountFlags[MinArgumentCountFlags["StrongArityForUntypedJS"] = 1] = "StrongArityForUntypedJS"; - MinArgumentCountFlags[MinArgumentCountFlags["VoidIsNonOptional"] = 2] = "VoidIsNonOptional"; - })(MinArgumentCountFlags || (MinArgumentCountFlags = {})); - var IntrinsicTypeKind; - (function (IntrinsicTypeKind) { - IntrinsicTypeKind[IntrinsicTypeKind["Uppercase"] = 0] = "Uppercase"; - IntrinsicTypeKind[IntrinsicTypeKind["Lowercase"] = 1] = "Lowercase"; - IntrinsicTypeKind[IntrinsicTypeKind["Capitalize"] = 2] = "Capitalize"; - IntrinsicTypeKind[IntrinsicTypeKind["Uncapitalize"] = 3] = "Uncapitalize"; - })(IntrinsicTypeKind || (IntrinsicTypeKind = {})); - var intrinsicTypeKinds = new ts.Map(ts.getEntries({ - Uppercase: 0 /* Uppercase */, - Lowercase: 1 /* Lowercase */, - Capitalize: 2 /* Capitalize */, - Uncapitalize: 3 /* Uncapitalize */ - })); function SymbolLinks() { } function NodeLinks() { @@ -43431,7 +42345,6 @@ var ts; var instantiationDepth = 0; var constraintDepth = 0; var currentNode; - var typeCatalog = []; // NB: id is index + 1 var emptySymbols = ts.createSymbolTable(); var arrayVariances = [1 /* Covariant */]; var compilerOptions = host.getCompilerOptions(); @@ -43468,7 +42381,6 @@ var ts; getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount") + symbolCount; }, - getTypeCatalog: function () { return typeCatalog; }, getTypeCount: function () { return typeCount; }, getInstantiationCount: function () { return totalInstantiationCount; }, getRelationCacheSizes: function () { return ({ @@ -43483,7 +42395,6 @@ var ts; getMergedSymbol: getMergedSymbol, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getRecursionIdentity: getRecursionIdentity, getTypeOfSymbolAtLocation: function (symbol, locationIn) { var location = ts.getParseTreeNode(locationIn); return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType; @@ -43592,7 +42503,6 @@ var ts; }, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getSymbolOfExpando: getSymbolOfExpando, getContextualType: function (nodeIn, contextFlags) { var node = ts.getParseTreeNode(nodeIn, ts.isExpression); if (!node) { @@ -43786,8 +42696,6 @@ var ts; var intersectionTypes = new ts.Map(); var literalTypes = new ts.Map(); var indexedAccessTypes = new ts.Map(); - var templateLiteralTypes = new ts.Map(); - var stringMappingTypes = new ts.Map(); var substitutionTypes = new ts.Map(); var evolvingArrayTypes = []; var undefinedProperties = new ts.Map(); @@ -43798,7 +42706,6 @@ var ts; var wildcardType = createIntrinsicType(1 /* Any */, "any"); var errorType = createIntrinsicType(1 /* Any */, "error"); var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 524288 /* ContainsWideningType */); - var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); var unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 524288 /* ContainsWideningType */); @@ -43837,7 +42744,6 @@ var ts; var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; var numberOrBigIntType = getUnionType([numberType, bigintType]); - var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; }); var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; }); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -44109,16 +43015,6 @@ var ts; } } function errorOrSuggestion(isError, location, message, arg0, arg1, arg2, arg3) { - // Pseudo-synthesized input node - if (location.pos < 0 || location.end < 0) { - if (!isError) { - return; // Drop suggestions (we have no span to suggest on) - } - // Issue errors globally - var file = ts.getSourceFileOfNode(location); - addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message)); // eslint-disable-line no-in-operator - return; - } addErrorOrSuggestion(isError, "message" in message ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForNodeFromMessageChain(location, message)); // eslint-disable-line no-in-operator } function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) { @@ -44408,7 +43304,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 297 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 294 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -44467,17 +43363,17 @@ var ts; } if (declaration.pos <= usage.pos && !(ts.isPropertyDeclaration(declaration) && ts.isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) { // declaration is before usage - if (declaration.kind === 198 /* BindingElement */) { + if (declaration.kind === 195 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 198 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 195 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 249 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 246 /* VariableDeclaration */), usage); } - else if (declaration.kind === 249 /* VariableDeclaration */) { + else if (declaration.kind === 246 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -44507,12 +43403,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 270 /* ExportSpecifier */ || (usage.parent.kind === 266 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 267 /* ExportSpecifier */ || (usage.parent.kind === 263 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 266 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 263 /* ExportAssignment */ && usage.isExportEquals) { return true; } if (!!(usage.flags & 4194304 /* JSDoc */) || isInTypeQuery(usage) || usageInTypeDeclaration()) { @@ -44534,9 +43430,9 @@ var ts; } function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { switch (declaration.parent.parent.kind) { - case 232 /* VariableStatement */: - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: + case 229 /* VariableStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, declContainer)) { @@ -44557,16 +43453,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 163 /* PropertyDeclaration */ && + current.parent.kind === 162 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasSyntacticModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 165 /* MethodDeclaration */) { + if (declaration.kind === 164 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -44588,19 +43484,19 @@ var ts; return "quit"; } switch (node.kind) { - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return true; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 230 /* Block */: + case 227 /* Block */: switch (node.parent.kind) { - case 167 /* GetAccessor */: - case 165 /* MethodDeclaration */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 164 /* MethodDeclaration */: + case 167 /* SetAccessor */: return true; default: return false; @@ -44636,18 +43532,18 @@ var ts; } function requiresScopeChangeWorker(node) { switch (node.kind) { - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 166 /* Constructor */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 165 /* Constructor */: // do not descend into these return false; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 288 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 285 /* PropertyAssignment */: return requiresScopeChangeWorker(node.name); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // static properties in classes introduce temporary variables if (ts.hasStaticModifier(node)) { return target < 99 /* ESNext */ || !compilerOptions.useDefineForClassFields; @@ -44701,12 +43597,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 311 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 307 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 160 /* Parameter */ || - lastLocation.kind === 159 /* TypeParameter */ + lastLocation.kind === 159 /* Parameter */ || + lastLocation.kind === 158 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -44721,13 +43617,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 160 /* Parameter */ || + lastLocation.kind === 159 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 184 /* ConditionalType */) { + else if (location.kind === 183 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -44742,14 +43638,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 297 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 294 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -44773,7 +43669,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 270 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 269 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 267 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 266 /* NamespaceExport */))) { break; } } @@ -44787,12 +43683,12 @@ var ts; } } break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -44809,9 +43705,9 @@ var ts; } } break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -44830,7 +43726,7 @@ var ts; } break loop; } - if (location.kind === 221 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 218 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -44838,7 +43734,7 @@ var ts; } } break; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 93 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -44858,9 +43754,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 253 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 250 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -44868,24 +43764,24 @@ var ts; } } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -44898,7 +43794,7 @@ var ts; } } break; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -44907,7 +43803,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 160 /* Parameter */) { + if (location.parent && location.parent.kind === 159 /* Parameter */) { location = location.parent; } // @@ -44922,17 +43818,17 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 252 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 249 /* ClassDeclaration */)) { location = location.parent; } break; - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 160 /* Parameter */: + case 159 /* Parameter */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && ts.isBindingPattern(lastLocation))) { if (!associatedDeclarationForContainingInitializerOrBindingName) { @@ -44940,20 +43836,14 @@ var ts; } } break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && ts.isBindingPattern(lastLocation))) { - if (ts.isParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) { - associatedDeclarationForContainingInitializerOrBindingName = location; - } - } - break; - case 185 /* InferType */: - if (meaning & 262144 /* TypeParameter */) { - var parameterName = location.typeParameter.name; - if (parameterName && name === parameterName.escapedText) { - result = location.typeParameter.symbol; - break loop; + var root = ts.getRootDeclaration(location); + if (root.kind === 159 /* Parameter */) { + if (!associatedDeclarationForContainingInitializerOrBindingName) { + associatedDeclarationForContainingInitializerOrBindingName = location; + } } } break; @@ -44972,7 +43862,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 297 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 294 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -45010,15 +43900,7 @@ var ts; } } if (!suggestion) { - if (nameArg) { - var lib = getSuggestedLibForNonExistentName(nameArg); - if (lib) { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg), lib); - } - else { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); - } - } + error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); } suggestionCount++; } @@ -45097,10 +43979,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 209 /* ArrowFunction */ && location.kind !== 208 /* FunctionExpression */) { + if (location.kind !== 206 /* ArrowFunction */ && location.kind !== 205 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -45113,12 +43995,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 256 /* ModuleDeclaration */: // For `namespace N { N; }` + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 253 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -45130,7 +44012,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 159 /* TypeParameter */) { + if (decl.kind === 158 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -45186,9 +44068,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 78 /* Identifier */: - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -45232,7 +44114,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 270 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 267 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -45246,31 +44128,15 @@ var ts; } var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* Type */ & ~111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol && !(symbol.flags & 1024 /* NamespaceModule */)) { - var rawName = ts.unescapeLeadingUnderscores(name); - if (isES2015OrLaterConstructorName(name)) { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName); - } - else if (maybeMappedType(errorLocation, symbol)) { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0, rawName, rawName === "K" ? "P" : "K"); - } - else { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, rawName); - } + var message = isES2015OrLaterConstructorName(name) + ? ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later + : ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here; + error(errorLocation, message, ts.unescapeLeadingUnderscores(name)); return true; } } return false; } - function maybeMappedType(node, symbol) { - var container = ts.findAncestor(node.parent, function (n) { - return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit"; - }); - if (container && container.members.length === 1) { - var type = getDeclaredTypeOfSymbol(symbol); - return !!(type.flags & 1048576 /* Union */) && allTypesAssignableToKind(type, 384 /* StringOrNumberLiteral */, /*strict*/ true); - } - return false; - } function isES2015OrLaterConstructorName(n) { switch (n) { case "Promise": @@ -45307,7 +44173,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 255 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 252 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -45342,13 +44208,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.parent; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return node.parent.parent; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -45372,37 +44238,29 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ - || node.kind === 259 /* NamespaceExportDeclaration */ - || node.kind === 262 /* ImportClause */ && !!node.name - || node.kind === 263 /* NamespaceImport */ - || node.kind === 269 /* NamespaceExport */ - || node.kind === 265 /* ImportSpecifier */ - || node.kind === 270 /* ExportSpecifier */ - || node.kind === 266 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) - || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) - || ts.isAccessExpression(node) + return node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 256 /* NamespaceExportDeclaration */ || + node.kind === 259 /* ImportClause */ && !!node.name || + node.kind === 260 /* NamespaceImport */ || + node.kind === 266 /* NamespaceExport */ || + node.kind === 262 /* ImportSpecifier */ || + node.kind === 267 /* ExportSpecifier */ || + node.kind === 263 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || + ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ - && isAliasableOrJsExpression(node.parent.right) - || node.kind === 289 /* ShorthandPropertyAssignment */ - || node.kind === 288 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) - || ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true); + && isAliasableOrJsExpression(node.parent.right) || + node.kind === 286 /* ShorthandPropertyAssignment */ || + node.kind === 285 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - var commonJSPropertyAccess = getCommonJSPropertyAccess(node); - if (commonJSPropertyAccess) { - var name = ts.getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0]; - return ts.isIdentifier(commonJSPropertyAccess.name) - ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText)) - : undefined; - } - if (ts.isVariableDeclaration(node) || node.moduleReference.kind === 272 /* ExternalModuleReference */) { - var immediate = resolveExternalModuleName(node, ts.getExternalModuleRequireArgument(node) || ts.getExternalModuleImportEqualsDeclarationExpression(node)); + if (node.moduleReference.kind === 269 /* ExternalModuleReference */) { + var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); return resolved_4; @@ -45429,7 +44287,10 @@ var ts; } function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) { var exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */); - var exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports.get(name); + if (exportValue) { + return getPropertyOfType(getTypeOfSymbol(exportValue), name); + } + var exportSymbol = moduleSymbol.exports.get(name); var resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(sourceNode, exportSymbol, resolved, /*overwriteEmpty*/ false); return resolved; @@ -45570,9 +44431,11 @@ var ts; result.exports = new ts.Map(valueSymbol.exports); return result; } - function getExportOfModule(symbol, name, specifier, dontResolveAlias) { + function getExportOfModule(symbol, specifier, dontResolveAlias) { + var _a; if (symbol.flags & 1536 /* Module */) { - var exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText); + var name = ((_a = specifier.propertyName) !== null && _a !== void 0 ? _a : specifier.name).escapedText; + var exportSymbol = getExportsOfSymbol(symbol).get(name); var resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(specifier, exportSymbol, resolved, /*overwriteEmpty*/ false); return resolved; @@ -45589,14 +44452,10 @@ var ts; function getExternalModuleMember(node, specifier, dontResolveAlias) { var _a; if (dontResolveAlias === void 0) { dontResolveAlias = false; } - var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier; - var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); // TODO: GH#18217 - var name = !ts.isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name; - if (!ts.isIdentifier(name)) { - return undefined; - } + var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); + var name = specifier.propertyName || specifier.name; var suppressInteropError = name.escapedText === "default" /* Default */ && !!(compilerOptions.allowSyntheticDefaultImports || compilerOptions.esModuleInterop); - var targetSymbol = resolveESModuleSymbol(moduleSymbol, moduleSpecifier, dontResolveAlias, suppressInteropError); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias, suppressInteropError); if (targetSymbol) { if (name.escapedText) { if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { @@ -45612,7 +44471,7 @@ var ts; } // if symbolFromVariable is export - get its final target symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); - var symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias); + var symbolFromModule = getExportOfModule(targetSymbol, specifier, dontResolveAlias); if (symbolFromModule === undefined && name.escapedText === "default" /* Default */) { var file = ts.find(moduleSymbol.declarations, ts.isSourceFile); if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias)) { @@ -45628,7 +44487,7 @@ var ts; var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol); if (suggestion !== undefined) { var suggestionName = symbolToString(suggestion); - var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName); + var diagnostic = error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2, moduleName, declarationName, suggestionName); if (suggestion.valueDeclaration) { ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName)); } @@ -45689,21 +44548,10 @@ var ts; } } function getTargetOfImportSpecifier(node, dontResolveAlias) { - var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent; - var commonJSPropertyAccess = getCommonJSPropertyAccess(root); - var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias); - var name = node.propertyName || node.name; - if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) { - return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias); - } + var resolved = getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false); return resolved; } - function getCommonJSPropertyAccess(node) { - if (ts.isVariableDeclaration(node) && node.initializer && ts.isPropertyAccessExpression(node.initializer)) { - return node.initializer; - } - } function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { var resolved = resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false); @@ -45740,7 +44588,7 @@ var ts; var expression = node.initializer; return getTargetOfAliasLikeExpression(expression, dontRecursivelyResolve); } - function getTargetOfAccessExpression(node, dontRecursivelyResolve) { + function getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve) { if (!(ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */)) { return undefined; } @@ -45749,32 +44597,29 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: - case 249 /* VariableDeclaration */: + case 257 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 265 /* ImportSpecifier */: - case 198 /* BindingElement */: + case 262 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 266 /* ExportAssignment */: - case 216 /* BinaryExpression */: + case 263 /* ExportAssignment */: + case 213 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: - return getTargetOfAccessExpression(node, dontRecursivelyResolve); + case 198 /* PropertyAccessExpression */: + return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); } @@ -45841,7 +44686,7 @@ var ts; * @param overwriteEmpty Checks `resolvesToSymbol` for type-only declarations even if `aliasDeclaration` */ function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) { - if (!aliasDeclaration || ts.isPropertyAccessExpression(aliasDeclaration)) + if (!aliasDeclaration) return false; // If the declaration itself is type-only, mark it and return. // No need to check what it resolves to. @@ -45925,13 +44770,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 78 /* Identifier */ || entityName.parent.kind === 157 /* QualifiedName */) { + if (entityName.kind === 78 /* Identifier */ || entityName.parent.kind === 156 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 260 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 257 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -45955,9 +44800,9 @@ var ts; return getMergedSymbol(symbolFromJSPrototype); } } - else if (name.kind === 157 /* QualifiedName */ || name.kind === 201 /* PropertyAccessExpression */) { - var left = name.kind === 157 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 157 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 156 /* QualifiedName */ || name.kind === 198 /* PropertyAccessExpression */) { + var left = name.kind === 156 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 156 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -45983,12 +44828,7 @@ var ts; symbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, meaning)); if (!symbol) { if (!ignoreErrors) { - var namespaceName = getFullyQualifiedName(namespace); - var declarationName = ts.declarationNameToString(right); - var suggestion = getSuggestedSymbolForNonexistentModule(right, namespace); - suggestion ? - error(right, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestion)) : - error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName); + error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); } return undefined; } @@ -45997,7 +44837,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 266 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 263 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -46181,7 +45021,7 @@ var ts; ? ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, packageId.name, ts.mangleScopedPackageName(packageId.name)) : ts.chainDiagnosticMessages( - /*details*/ undefined, ts.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name)) + /*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name)) : undefined; errorOrSuggestion(isError, errorNode, ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedFileName)); } @@ -46223,7 +45063,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 297 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 294 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -46525,7 +45365,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 166 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 165 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -46534,7 +45374,6 @@ var ts; var result = new Type(checker, flags); typeCount++; result.id = typeCount; - typeCatalog.push(result); return result; } function createIntrinsicType(kind, intrinsicName, objectFlags) { @@ -46613,12 +45452,12 @@ var ts; } } switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -46627,9 +45466,9 @@ var ts; return { value: result }; } break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -46712,7 +45551,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 267 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -46756,7 +45595,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 267 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -46771,10 +45610,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: continue; default: return false; @@ -46903,10 +45742,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -46915,7 +45754,6 @@ var ts; } return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { - var _a, _b; if (!isDeclarationVisible(declaration)) { // Mark the unexported alias as visible if its parent is visible // because these kind of aliases can be used to name types in declaration file @@ -46935,14 +45773,6 @@ var ts; && isDeclarationVisible(declaration.parent)) { return addVisibleAlias(declaration, declaration); } - else if (symbol.flags & 2097152 /* Alias */ && ts.isBindingElement(declaration) && ts.isInJSFile(declaration) && ((_a = declaration.parent) === null || _a === void 0 ? void 0 : _a.parent) // exported import-like top-level JS require statement - && ts.isVariableDeclaration(declaration.parent.parent) - && ((_b = declaration.parent.parent.parent) === null || _b === void 0 ? void 0 : _b.parent) && ts.isVariableStatement(declaration.parent.parent.parent.parent) - && !ts.hasSyntacticModifier(declaration.parent.parent.parent.parent, 1 /* Export */) - && declaration.parent.parent.parent.parent.parent // check if the thing containing the variable statement is visible (ie, the file) - && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) { - return addVisibleAlias(declaration, declaration.parent.parent.parent.parent); - } // Declaration is not visible return false; } @@ -46962,14 +45792,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 176 /* TypeQuery */ || + if (entityName.parent.kind === 175 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 158 /* ComputedPropertyName */) { + entityName.parent.kind === 157 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 157 /* QualifiedName */ || entityName.kind === 201 /* PropertyAccessExpression */ || - entityName.parent.kind === 260 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 156 /* QualifiedName */ || entityName.kind === 198 /* PropertyAccessExpression */ || + entityName.parent.kind === 257 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -47010,7 +45840,7 @@ var ts; function symbolToStringWorker(writer) { var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217 // add neverAsciiEscape for GH#39027 - var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 297 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true }); + var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 294 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, entity, /*sourceFile*/ sourceFile, writer); return writer; @@ -47022,10 +45852,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 175 /* ConstructorType */ : 174 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 174 /* ConstructorType */ : 173 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 170 /* ConstructSignature */ : 169 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 169 /* ConstructSignature */ : 168 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -47071,9 +45901,6 @@ var ts; if (flags === void 0) { flags = 0 /* None */; } return flags & 814775659 /* NodeBuilderFlagsMask */; } - function isClassInstanceSide(type) { - return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(ts.getObjectFlags(type) & 1073741824 /* IsClassInstanceClone */)); - } function createNodeBuilder() { return { typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) { @@ -47105,7 +45932,6 @@ var ts; }, }; function withContext(enclosingDeclaration, flags, tracker, cb) { - var _a, _b; ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); var context = { enclosingDeclaration: enclosingDeclaration, @@ -47129,9 +45955,6 @@ var ts; approximateLength: 0 }; var resultingNode = cb(context); - if (context.truncating && context.flags & 1 /* NoTruncation */) { - (_b = (_a = context.tracker) === null || _a === void 0 ? void 0 : _a.reportTruncationError) === null || _b === void 0 ? void 0 : _b.call(_a); - } return context.encounteredError ? undefined : resultingNode; } function checkTruncationLength(context) { @@ -47158,22 +45981,22 @@ var ts; } if (type.flags & 1 /* Any */) { context.approximateLength += 3; - return ts.factory.createKeywordTypeNode(type === intrinsicMarkerType ? 136 /* IntrinsicKeyword */ : 128 /* AnyKeyword */); + return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */); + return ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(147 /* StringKeyword */); + return ts.factory.createKeywordTypeNode(146 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(144 /* NumberKeyword */); + return ts.factory.createKeywordTypeNode(143 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(155 /* BigIntKeyword */); + return ts.factory.createKeywordTypeNode(154 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; @@ -47182,23 +46005,10 @@ var ts; if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); var parentName = symbolToTypeNode(parentSymbol, context, 788968 /* Type */); - if (getDeclaredTypeOfSymbol(parentSymbol) === type) { - return parentName; - } - var memberName = ts.symbolName(type.symbol); - if (ts.isIdentifierText(memberName, 0 /* ES3 */)) { - return appendReferenceToType(parentName, ts.factory.createTypeReferenceNode(memberName, /*typeArguments*/ undefined)); - } - if (ts.isImportTypeNode(parentName)) { - parentName.isTypeOf = true; // mutably update, node is freshly manufactured anyhow - return ts.factory.createIndexedAccessTypeNode(parentName, ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName))); - } - else if (ts.isTypeReferenceNode(parentName)) { - return ts.factory.createIndexedAccessTypeNode(ts.factory.createTypeQueryNode(parentName.typeName), ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName))); - } - else { - return ts.Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`."); - } + var enumLiteralName = getDeclaredTypeOfSymbol(parentSymbol) === type + ? parentName + : appendReferenceToType(parentName, ts.factory.createTypeReferenceNode(ts.symbolName(type.symbol), /*typeArguments*/ undefined)); + return enumLiteralName; } if (type.flags & 1056 /* EnumLike */) { return symbolToTypeNode(type.symbol, context, 788968 /* Type */); @@ -47231,7 +46041,7 @@ var ts; } } context.approximateLength += 13; - return ts.factory.createTypeOperatorNode(151 /* UniqueKeyword */, ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */)); + return ts.factory.createTypeOperatorNode(150 /* UniqueKeyword */, ts.factory.createKeywordTypeNode(147 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -47239,7 +46049,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */); + return ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -47247,15 +46057,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.factory.createKeywordTypeNode(141 /* NeverKeyword */); + return ts.factory.createKeywordTypeNode(140 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */); + return ts.factory.createKeywordTypeNode(147 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(145 /* ObjectKeyword */); + return ts.factory.createKeywordTypeNode(144 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -47323,19 +46133,7 @@ var ts; var indexedType = type.type; context.approximateLength += 6; var indexTypeNode = typeToTypeNodeHelper(indexedType, context); - return ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, indexTypeNode); - } - if (type.flags & 134217728 /* TemplateLiteral */) { - var texts_1 = type.texts; - var types_1 = type.types; - var templateHead = ts.factory.createTemplateHead(texts_1[0]); - var templateSpans = ts.factory.createNodeArray(ts.map(types_1, function (t, i) { return ts.factory.createTemplateLiteralTypeSpan(typeToTypeNodeHelper(t, context), (i < types_1.length - 1 ? ts.factory.createTemplateMiddle : ts.factory.createTemplateTail)(texts_1[i + 1])); })); - context.approximateLength += 2; - return ts.factory.createTemplateLiteralType(templateHead, templateSpans); - } - if (type.flags & 268435456 /* StringMapping */) { - var typeNode = typeToTypeNodeHelper(type.type, context); - return symbolToTypeNode(type.symbol, context, 788968 /* Type */, [typeNode]); + return ts.factory.createTypeOperatorNode(137 /* KeyOfKeyword */, indexTypeNode); } if (type.flags & 8388608 /* IndexedAccess */) { var objectTypeNode = typeToTypeNodeHelper(type.objectType, context); @@ -47380,15 +46178,14 @@ var ts; if (isMappedTypeWithKeyofConstraintDeclaration(type)) { // We have a { [P in keyof T]: X } // We do this to ensure we retain the toplevel keyof-ness of the type which may be lost due to keyof distribution during `getConstraintTypeFromMappedType` - appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context)); + appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(137 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context)); } else { appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type), context); } var typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type), context, appropriateConstraintTypeNode); - var nameTypeNode = type.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type), context) : undefined; var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); - var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode); + var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); context.approximateLength += 10; return ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */); } @@ -47397,16 +46194,16 @@ var ts; var typeId = type.id; var symbol = type.symbol; if (symbol) { - var isInstanceType = isClassInstanceSide(type) ? 788968 /* Type */ : 111551 /* Value */; if (isJSConstructor(symbol.valueDeclaration)) { // Instance and static types share the same symbol; only add 'typeof' for the static side. + var isInstanceType = type === getDeclaredTypeOfClassOrInterface(symbol) ? 788968 /* Type */ : 111551 /* Value */; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 221 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 218 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { - return symbolToTypeNode(symbol, context, isInstanceType); + return symbolToTypeNode(symbol, context, 111551 /* Value */); } else if ((_a = context.visitedTypes) === null || _a === void 0 ? void 0 : _a.has(typeId)) { // If type is an anonymous type literal in a type alias declaration, use type alias name @@ -47434,7 +46231,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 297 /* SourceFile */ || declaration.parent.kind === 257 /* ModuleBlock */; + return declaration.parent.kind === 294 /* SourceFile */ || declaration.parent.kind === 254 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -47485,12 +46282,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 174 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 173 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 175 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 174 /* ConstructorType */, context); return signatureNode; } } @@ -47511,7 +46308,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.factory.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -47535,12 +46332,12 @@ var ts; } } var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode(tupleConstituentNodes), 1 /* SingleLine */); - return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode([]), 1 /* SingleLine */); - return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -47568,10 +46365,10 @@ var ts; // the default outer type arguments), we don't show the group. if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { var typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start, i), context); - var flags_3 = context.flags; + var flags_2 = context.flags; context.flags |= 16 /* ForbidIndexedAccessSymbolReferences */; var ref = symbolToTypeNode(parent, context, 788968 /* Type */, typeArgumentSlice); - context.flags = flags_3; + context.flags = flags_2; resultType = !resultType ? ref : appendReferenceToType(resultType, ref); } } @@ -47647,11 +46444,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 169 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 168 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 170 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 169 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -47727,7 +46524,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 164 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 163 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); typeElements.push(preserveCommentsOn(methodDeclaration)); } } @@ -47742,7 +46539,7 @@ var ts; propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(141 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -47750,8 +46547,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 328 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 328 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -47783,8 +46580,8 @@ var ts; var seenNames = mayHaveNameCollisions ? ts.createUnderscoreEscapedMultiMap() : undefined; var result_4 = []; var i = 0; - for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { - var type = types_2[_i]; + for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { + var type = types_1[_i]; i++; if (checkTruncationLength(context) && (i + 2 < types.length - 1)) { result_4.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", /*typeArguments*/ undefined)); @@ -47819,8 +46616,8 @@ var ts; var b = _b[0]; return typesAreSameReference(a, b); })) { - for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { - var _a = types_3[_i], type = _a[0], resultIndex = _a[1]; + for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { + var _a = types_2[_i], type = _a[0], resultIndex = _a[1]; result_4[resultIndex] = typeToTypeNodeHelper(type, context); } } @@ -47837,7 +46634,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context, typeNode) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 /* String */ ? 147 /* StringKeyword */ : 144 /* NumberKeyword */); + var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 /* String */ ? 146 /* StringKeyword */ : 143 /* NumberKeyword */); var indexingParameter = ts.factory.createParameterDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -47852,7 +46649,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.factory.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.factory.createToken(141 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context, options) { var _a, _b, _c, _d; @@ -47867,9 +46664,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var expandedParams = getExpandedParameters(signature, /*skipUnionExpanding*/ true)[0]; - // If the expanded parameter list had a variadic in a non-trailing position, don't expand it - var parameters = (ts.some(expandedParams, function (p) { return p !== expandedParams[expandedParams.length - 1] && !!(ts.getCheckFlags(p) & 32768 /* RestParameter */); }) ? signature.parameters : expandedParams).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 166 /* Constructor */, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); }); + var parameters = getExpandedParameters(signature, /*skipUnionExpanding*/ true)[0].map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 165 /* Constructor */, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -47896,20 +46691,20 @@ var ts; } } context.approximateLength += 3; // Usually a signature contributes a few more characters than this, but 3 is the minimum - var node = kind === 169 /* CallSignature */ ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) : - kind === 170 /* ConstructSignature */ ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : - kind === 164 /* MethodSignature */ ? ts.factory.createMethodSignature(options === null || options === void 0 ? void 0 : options.modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : - kind === 165 /* MethodDeclaration */ ? ts.factory.createMethodDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) : - kind === 166 /* Constructor */ ? ts.factory.createConstructorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, /*body*/ undefined) : - kind === 167 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) : - kind === 168 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, /*body*/ undefined) : - kind === 171 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, returnTypeNode) : - kind === 308 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) : - kind === 174 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : - kind === 175 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : - kind === 251 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) : - kind === 208 /* FunctionExpression */ ? ts.factory.createFunctionExpression(options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) : - kind === 209 /* ArrowFunction */ ? ts.factory.createArrowFunction(options === null || options === void 0 ? void 0 : options.modifiers, typeParameters, parameters, returnTypeNode, /*equalsGreaterThanToken*/ undefined, ts.factory.createBlock([])) : + var node = kind === 168 /* CallSignature */ ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) : + kind === 169 /* ConstructSignature */ ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : + kind === 163 /* MethodSignature */ ? ts.factory.createMethodSignature(options === null || options === void 0 ? void 0 : options.modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : + kind === 164 /* MethodDeclaration */ ? ts.factory.createMethodDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) : + kind === 165 /* Constructor */ ? ts.factory.createConstructorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, /*body*/ undefined) : + kind === 166 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) : + kind === 167 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, /*body*/ undefined) : + kind === 170 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, returnTypeNode) : + kind === 304 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) : + kind === 173 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : + kind === 174 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : + kind === 248 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) : + kind === 205 /* FunctionExpression */ ? ts.factory.createFunctionExpression(options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) : + kind === 206 /* ArrowFunction */ ? ts.factory.createArrowFunction(options === null || options === void 0 ? void 0 : options.modifiers, typeParameters, parameters, returnTypeNode, /*equalsGreaterThanToken*/ undefined, ts.factory.createBlock([])) : ts.Debug.assertNever(kind); if (typeArguments) { node.typeArguments = ts.factory.createNodeArray(typeArguments); @@ -47931,9 +46726,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 160 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 159 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 326 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 322 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -47948,7 +46743,7 @@ var ts; var dotDotDotToken = isRest ? ts.factory.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 78 /* Identifier */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 157 /* QualifiedName */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 156 /* QualifiedName */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -48113,11 +46908,11 @@ var ts; } function getSpecifierForModuleSymbol(symbol, context) { var _a; - var file = ts.getDeclarationOfKind(symbol, 297 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 294 /* SourceFile */); if (!file) { var equivalentFileSymbol = ts.firstDefined(symbol.declarations, function (d) { return getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol); }); if (equivalentFileSymbol) { - file = ts.getDeclarationOfKind(equivalentFileSymbol, 297 /* SourceFile */); + file = ts.getDeclarationOfKind(equivalentFileSymbol, 294 /* SourceFile */); } } if (file && file.moduleName !== undefined) { @@ -48156,7 +46951,7 @@ var ts; // specifier preference var moduleResolverHost = context.tracker.moduleResolverHost; var specifierCompilerOptions = isBundle_1 ? __assign(__assign({}, compilerOptions), { baseUrl: moduleResolverHost.getCommonSourceDirectory() }) : compilerOptions; - specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative", importModuleSpecifierEnding: isBundle_1 ? "minimal" : undefined })); + specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative" })); (_a = links.specifierCache) !== null && _a !== void 0 ? _a : (links.specifierCache = new ts.Map()); links.specifierCache.set(contextFile.path, specifier); } @@ -48462,7 +47257,7 @@ var ts; } var oldFlags = context.flags; if (type.flags & 8192 /* UniqueESSymbol */ && - type.symbol === symbol && (!context.enclosingDeclaration || ts.some(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === ts.getSourceFileOfNode(context.enclosingDeclaration); }))) { + type.symbol === symbol) { context.flags |= 1048576 /* AllowUniqueESSymbolType */; } var result = typeToTypeNodeHelper(type, context); @@ -48495,17 +47290,17 @@ var ts; function visitExistingNodeTreeSymbols(node) { var _a, _b; // We don't _actually_ support jsdoc namepath types, emit `any` instead - if (ts.isJSDocAllType(node) || node.kind === 310 /* JSDocNamepathType */) { + if (ts.isJSDocAllType(node) || node.kind === 306 /* JSDocNamepathType */) { return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */); + return ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createLiteralTypeNode(ts.factory.createNull())]); } if (ts.isJSDocOptionalType(node)) { - return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)]); + return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -48619,8 +47414,8 @@ var ts; } } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 165 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 164 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 164 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 163 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -48899,50 +47694,38 @@ var ts; if (textRange && ts.isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) { textRange = textRange.parent.parent; } - var propertyAccessRequire = ts.find(symbol.declarations, ts.isPropertyAccessExpression); - if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right) - && type.symbol && ts.isSourceFile(type.symbol.valueDeclaration)) { - var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right; + var statement = ts.setTextRange(ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ + ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) + ], flags)), textRange); + addResult(statement, name !== localName ? modifierFlags & ~1 /* Export */ : modifierFlags); + if (name !== localName && !isPrivate) { + // We rename the variable declaration we generate for Property symbols since they may have a name which + // conflicts with a local declaration. For example, given input: + // ``` + // function g() {} + // module.exports.g = g + // ``` + // In such a situation, we have a local variable named `g`, and a separate exported variable named `g`. + // Naively, we would emit + // ``` + // function g() {} + // export const g: typeof g; + // ``` + // That's obviously incorrect - the `g` in the type annotation needs to refer to the local `g`, but + // the export declaration shadows it. + // To work around that, we instead write + // ``` + // function g() {} + // const g_1: typeof g; + // export { g_1 as g }; + // ``` + // To create an export named `g` that does _not_ shadow the local `g` addResult(ts.factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(alias, localName)])), 0 /* None */); - context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551 /* Value */); - } - else { - var statement = ts.setTextRange(ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ - ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) - ], flags)), textRange); - addResult(statement, name !== localName ? modifierFlags & ~1 /* Export */ : modifierFlags); - if (name !== localName && !isPrivate) { - // We rename the variable declaration we generate for Property symbols since they may have a name which - // conflicts with a local declaration. For example, given input: - // ``` - // function g() {} - // module.exports.g = g - // ``` - // In such a situation, we have a local variable named `g`, and a separate exported variable named `g`. - // Naively, we would emit - // ``` - // function g() {} - // export const g: typeof g; - // ``` - // That's obviously incorrect - the `g` in the type annotation needs to refer to the local `g`, but - // the export declaration shadows it. - // To work around that, we instead write - // ``` - // function g() {} - // const g_1: typeof g; - // export { g_1 as g }; - // ``` - // To create an export named `g` that does _not_ shadow the local `g` - addResult(ts.factory.createExportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, - /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0 /* None */); - needsExportDeclaration = false; - needsPostExportDefault = false; - } + /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0 /* None */); + needsExportDeclaration = false; + needsPostExportDefault = false; } } } @@ -48964,8 +47747,7 @@ var ts; if ((symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && (!isConstMergedWithNS || isTypeOnlyNamespace(symbol))) || isConstMergedWithNSPrintableAsSignatureMerge) { serializeModule(symbol, symbolName, modifierFlags); } - // The class meaning serialization should handle serializing all interface members - if (symbol.flags & 64 /* Interface */ && !(symbol.flags & 32 /* Class */)) { + if (symbol.flags & 64 /* Interface */) { serializeInterface(symbol, symbolName, modifierFlags); } if (symbol.flags & 2097152 /* Alias */) { @@ -49060,8 +47842,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 169 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 170 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 168 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 169 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.factory.createHeritageClause(93 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b, 111551 /* Value */); }))]; addResult(ts.factory.createInterfaceDeclaration( @@ -49130,7 +47912,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 251 /* FunctionDeclaration */, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); + var decl = signatureToSignatureDeclarationHelper(sig, 248 /* FunctionDeclaration */, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); // for expressions assigned to `var`s, use the `var` as the text range addResult(ts.setTextRange(decl, sig.declaration && ts.isVariableDeclaration(sig.declaration.parent) && sig.declaration.parent.parent || sig.declaration), modifierFlags); } @@ -49193,7 +47975,7 @@ var ts; } function isNamespaceMember(p) { return !!(p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) || - !(p.flags & 4194304 /* Prototype */ || p.escapedName === "prototype" || p.valueDeclaration && ts.getEffectiveModifierFlags(p.valueDeclaration) & 32 /* Static */ && ts.isClassLike(p.valueDeclaration.parent)); + !(p.flags & 4194304 /* Prototype */ || p.escapedName === "prototype" || p.valueDeclaration && ts.isClassLike(p.valueDeclaration.parent)); } function serializeAsClass(symbol, localName, modifierFlags) { var _a; @@ -49244,14 +48026,13 @@ var ts; !ts.some(getSignaturesOfType(staticType, 1 /* Construct */)); var constructors = isNonConstructableClassLikeInJsFile ? [ts.factory.createConstructorDeclaration(/*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags(8 /* Private */), [], /*body*/ undefined)] : - serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 166 /* Constructor */); + serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 165 /* Constructor */); var indexSignatures = serializeIndexSignatures(classType, baseTypes[0]); addResult(ts.setTextRange(ts.factory.createClassDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, localName, typeParamDecls, heritageClauses, __spreadArrays(indexSignatures, staticMembers, constructors, publicProperties, privateProperties)), symbol.declarations && ts.filter(symbol.declarations, function (d) { return ts.isClassDeclaration(d) || ts.isClassExpression(d); })[0]), modifierFlags); } function serializeAsAlias(symbol, localName, modifierFlags) { - var _a, _b, _c, _d, _e; // synthesize an alias, eg `export { symbolName as Name }` // need to mark the alias `symbol` points at // as something we need to serialize as a private declaration as well @@ -49270,66 +48051,23 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 198 /* BindingElement */: - if (((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.kind) === 249 /* VariableDeclaration */) { - // const { SomeClass } = require('./lib'); - var specifier_1 = getSpecifierForModuleSymbol(target.parent || target, context); // './lib' - var propertyName = node.propertyName; - addResult(ts.factory.createImportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1)), 0 /* None */); - break; - } - // We don't know how to serialize this (nested?) binding element - ts.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization"); - break; - case 289 /* ShorthandPropertyAssignment */: - if (((_e = (_d = node.parent) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.kind) === 216 /* BinaryExpression */) { - // module.exports = { SomeClass } - serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), targetName); - } - break; - case 249 /* VariableDeclaration */: - // commonjs require: const x = require('y') - if (ts.isPropertyAccessExpression(node.initializer)) { - // const x = require('y').z - var initializer = node.initializer; // require('y').z - var uniqueName = ts.factory.createUniqueName(localName); // _x - var specifier_2 = getSpecifierForModuleSymbol(target.parent || target, context); // 'y' - // import _x = require('y'); - addResult(ts.factory.createImportEqualsDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, uniqueName, ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(specifier_2))), 0 /* None */); - // import x = _x.z - addResult(ts.factory.createImportEqualsDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.factory.createIdentifier(localName), ts.factory.createQualifiedName(uniqueName, initializer.name)), modifierFlags); - break; - } - // else fall through and treat commonjs require just like import= - case 260 /* ImportEqualsDeclaration */: - // This _specifically_ only exists to handle json declarations - where we make aliases, but since - // we emit no declarations for the json document, must not refer to it in the declarations - if (target.escapedName === "export=" /* ExportEquals */ && ts.some(target.declarations, ts.isJsonSourceFile)) { - serializeMaybeAliasAssignment(symbol); - break; - } + case 257 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` - var isLocalImport = !(target.flags & 512 /* ValueModule */) && !ts.isVariableDeclaration(node); + var isLocalImport = !(target.flags & 512 /* ValueModule */); addResult(ts.factory.createImportEqualsDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createIdentifier(localName), isLocalImport ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) - : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))), isLocalImport ? modifierFlags : 0 /* None */); + : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.factory.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, ts.factory.createIdentifier(localName), /*namedBindings*/ undefined), @@ -49338,18 +48076,18 @@ var ts; // In such cases, the `target` refers to the module itself already ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*importClause*/ undefined, ts.factory.createNamespaceImport(ts.factory.createIdentifier(localName))), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: addResult(ts.factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, ts.factory.createNamespaceExport(ts.factory.createIdentifier(localName)), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause( @@ -49358,7 +48096,7 @@ var ts; ts.factory.createImportSpecifier(localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName)) ])), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -49366,12 +48104,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.factory.createStringLiteral(specifier.text) : undefined); break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 216 /* BinaryExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 213 /* BinaryExpression */: + case 198 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -49402,7 +48139,7 @@ var ts; var name = ts.unescapeLeadingUnderscores(symbol.escapedName); var isExportEquals = name === "export=" /* ExportEquals */; var isDefault = name === "default" /* Default */; - var isExportAssignmentCompatibleSymbolName = isExportEquals || isDefault; + var isExportAssignment = isExportEquals || isDefault; // synthesize export = ref // ref should refer to either be a locally scoped symbol which we need to emit, or // a reference to another namespace/module which we may need to emit an `import` statement for @@ -49414,8 +48151,8 @@ var ts; // In case `target` refers to a namespace member, look at the declaration and serialize the leftmost symbol in it // eg, `namespace A { export class B {} }; exports = A.B;` // Technically, this is all that's required in the case where the assignment is an entity name expression - var expr = aliasDecl && ((ts.isExportAssignment(aliasDecl) || ts.isBinaryExpression(aliasDecl)) ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl)); - var first_1 = expr && ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; + var expr = isExportAssignment ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl); + var first_1 = ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; var referenced = first_1 && resolveEntityName(first_1, 67108863 /* All */, /*ignoreErrors*/ true, /*dontResolveAlias*/ true, enclosingDeclaration); if (referenced || target) { includePrivateSymbol(referenced || target); @@ -49427,17 +48164,17 @@ var ts; // into the containing scope anyway, so we want to skip the visibility checks. var oldTrack = context.tracker.trackSymbol; context.tracker.trackSymbol = ts.noop; - if (isExportAssignmentCompatibleSymbolName) { + if (isExportAssignment) { results.push(ts.factory.createExportAssignment( /*decorators*/ undefined, /*modifiers*/ undefined, isExportEquals, symbolToExpression(target, context, 67108863 /* All */))); } else { - if (first_1 === expr && first_1) { + if (first_1 === expr) { // serialize as `export {target as name}` serializeExportSpecifier(name, ts.idText(first_1)); } - else if (expr && ts.isClassExpression(expr)) { + else if (ts.isClassExpression(expr)) { serializeExportSpecifier(name, getInternalSymbolName(target, ts.symbolName(target))); } else { @@ -49460,19 +48197,15 @@ var ts; var typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol))); if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) { // If there are no index signatures and `typeToSerialize` is an object type, emit as a namespace instead of a const - serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 1 /* Export */); + serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignment ? 0 /* None */ : 1 /* Export */); } else { var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ ts.factory.createVariableDeclaration(varName, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) ], 2 /* Const */)); - // Inlined JSON types exported with [module.]exports= will already emit an export=, so should use `declare`. - // Otherwise, the type itself should be exported. - addResult(statement, target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ? 2 /* Ambient */ - : name === varName ? 1 /* Export */ - : 0 /* None */); + addResult(statement, name === varName ? 1 /* Export */ : 0 /* None */); } - if (isExportAssignmentCompatibleSymbolName) { + if (isExportAssignment) { results.push(ts.factory.createExportAssignment( /*decorators*/ undefined, /*modifiers*/ undefined, isExportEquals, ts.factory.createIdentifier(varName))); @@ -49493,8 +48226,7 @@ var ts; return ts.getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !getIndexInfoOfType(typeToSerialize, 0 /* String */) && !getIndexInfoOfType(typeToSerialize, 1 /* Number */) && - !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class - !!(ts.length(ts.filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || ts.length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && + !!(ts.length(getPropertiesOfType(typeToSerialize)) || ts.length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !ts.length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && ts.some(typeToSerialize.symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== ctxSrc; })) && @@ -49542,7 +48274,7 @@ var ts; } // This is an else/if as accessors and properties can't merge in TS, but might in JS // If this happens, we assume the accessor takes priority, as it imposes more constraints - else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) { + else if (p.flags & (4 /* Property */ | 3 /* Variable */)) { return ts.setTextRange(createProperty( /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined, isPrivate ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357 @@ -49785,7 +48517,7 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = ts.walkUpParenthesizedTypes(type.symbol.declarations[0].parent); - if (node.kind === 254 /* TypeAliasDeclaration */) { + if (node.kind === 251 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -49793,11 +48525,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 257 /* ModuleBlock */ && + node.parent.kind === 254 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 297 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 294 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -49856,17 +48588,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 249 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 246 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 221 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 218 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -49883,28 +48615,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 325 /* JSDocEnumTag */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 321 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 251 /* FunctionDeclaration */: - case 255 /* EnumDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 248 /* FunctionDeclaration */: + case 252 /* EnumDeclaration */: + case 257 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -49912,55 +48644,55 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 260 /* ImportEqualsDeclaration */ && parent.kind !== 297 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 257 /* ImportEqualsDeclaration */ && parent.kind !== 294 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasEffectiveModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 166 /* Constructor */: - case 170 /* ConstructSignature */: - case 169 /* CallSignature */: - case 171 /* IndexSignature */: - case 160 /* Parameter */: - case 257 /* ModuleBlock */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 177 /* TypeLiteral */: - case 173 /* TypeReference */: - case 178 /* ArrayType */: - case 179 /* TupleType */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: + case 165 /* Constructor */: + case 169 /* ConstructSignature */: + case 168 /* CallSignature */: + case 170 /* IndexSignature */: + case 159 /* Parameter */: + case 254 /* ModuleBlock */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 176 /* TypeLiteral */: + case 172 /* TypeReference */: + case 177 /* ArrayType */: + case 178 /* TupleType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: return false; // Type parameters are always visible - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 297 /* SourceFile */: - case 259 /* NamespaceExportDeclaration */: + case 294 /* SourceFile */: + case 256 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return false; default: return false; @@ -49969,10 +48701,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 266 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 263 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 270 /* ExportSpecifier */) { + else if (node.parent.kind === 267 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -50077,12 +48809,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 249 /* VariableDeclaration */: - case 250 /* VariableDeclarationList */: - case 265 /* ImportSpecifier */: - case 264 /* NamedImports */: - case 263 /* NamespaceImport */: - case 262 /* ImportClause */: + case 246 /* VariableDeclaration */: + case 247 /* VariableDeclarationList */: + case 262 /* ImportSpecifier */: + case 261 /* NamedImports */: + case 260 /* NamespaceImport */: + case 259 /* ImportClause */: return false; default: return true; @@ -50167,13 +48899,9 @@ var ts; var propName = getDestructuringPropertyName(node); if (propName) { var literal = ts.setTextRange(ts.parseNodeFactory.createStringLiteral(propName), node); - var lhsExpr = ts.isLeftHandSideExpression(parentAccess) ? parentAccess : ts.parseNodeFactory.createParenthesizedExpression(parentAccess); - var result = ts.setTextRange(ts.parseNodeFactory.createElementAccessExpression(lhsExpr, literal), node); + var result = ts.setTextRange(ts.parseNodeFactory.createElementAccessExpression(parentAccess, literal), node); ts.setParent(literal, result); ts.setParent(result, node); - if (lhsExpr !== parentAccess) { - ts.setParent(lhsExpr, result); - } result.flowNode = parentAccess.flowNode; return result; } @@ -50182,23 +48910,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 198 /* BindingElement */: - case 288 /* PropertyAssignment */: + case 195 /* BindingElement */: + case 285 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ancestor.initializer; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 198 /* BindingElement */ && parent.kind === 196 /* ObjectBindingPattern */) { + if (node.kind === 195 /* BindingElement */ && parent.kind === 193 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 288 /* PropertyAssignment */ || node.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.kind === 285 /* PropertyAssignment */ || node.kind === 286 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -50224,7 +48952,7 @@ var ts; parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); } var type; - if (pattern.kind === 196 /* ObjectBindingPattern */) { + if (pattern.kind === 193 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -50244,7 +48972,7 @@ var ts; // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name = declaration.propertyName || declaration.name; var indexType = getLiteralTypeFromPropertyName(name); - var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */), declaration.name); + var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, name), declaration.name); type = getFlowTypeOfDestructuring(declaration, declaredType); } } @@ -50252,7 +48980,7 @@ var ts; // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern); + var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */, parentType, undefinedType, pattern); var index_2 = pattern.elements.indexOf(declaration); if (declaration.dotDotDotToken) { // If the parent is a tuple type, the rest element has a tuple type of the @@ -50265,7 +48993,7 @@ var ts; else if (isArrayLikeType(parentType)) { var indexType = getLiteralType(index_2); var accessFlags = hasDefaultValue(declaration) ? 8 /* NoTupleBoundsCheck */ : 0; - var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, declaration.name, accessFlags | 16 /* ExpressionPosition */) || errorType, declaration.name); + var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, declaration.name, accessFlags) || errorType, declaration.name); type = getFlowTypeOfDestructuring(declaration, declaredType); } else { @@ -50297,7 +49025,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 199 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 196 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -50307,11 +49035,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 238 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 235 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 236 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -50348,8 +49076,8 @@ var ts; if (ts.isParameter(declaration)) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 168 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 167 /* GetAccessor */); + if (func.kind === 167 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 166 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -50416,11 +49144,10 @@ var ts; if (symbol.valueDeclaration && ts.isBinaryExpression(symbol.valueDeclaration)) { var links = getSymbolLinks(symbol); if (links.isConstructorDeclaredProperty === undefined) { - links.isConstructorDeclaredProperty = false; links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && ts.every(symbol.declarations, function (declaration) { return ts.isBinaryExpression(declaration) && - isPossiblyAliasedThisProperty(declaration) && - (declaration.left.kind !== 202 /* ElementAccessExpression */ || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && + ts.getAssignmentDeclarationKind(declaration) === 4 /* ThisProperty */ && + (declaration.left.kind !== 199 /* ElementAccessExpression */ || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(/*declaredType*/ undefined, declaration, symbol, declaration); }); } @@ -50439,16 +49166,13 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; var container = ts.getThisContainer(declaration, /*includeArrowFunctions*/ false); - if (container && (container.kind === 166 /* Constructor */ || isJSConstructor(container))) { + if (container && (container.kind === 165 /* Constructor */ || isJSConstructor(container))) { return container; } } } function getFlowTypeInConstructor(symbol, constructor) { - var accessName = ts.startsWith(symbol.escapedName, "__#") - ? ts.factory.createPrivateIdentifier(symbol.escapedName.split("@")[1]) - : ts.unescapeLeadingUnderscores(symbol.escapedName); - var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), accessName); + var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), ts.unescapeLeadingUnderscores(symbol.escapedName)); ts.setParent(reference.expression, reference); ts.setParent(reference, constructor); reference.flowNode = constructor.returnFlowNode; @@ -50496,7 +49220,7 @@ var ts; var kind = ts.isAccessExpression(expression) ? ts.getAssignmentDeclarationPropertyAccessKind(expression) : ts.getAssignmentDeclarationKind(expression); - if (kind === 4 /* ThisProperty */ || ts.isBinaryExpression(expression) && isPossiblyAliasedThisProperty(expression, kind)) { + if (kind === 4 /* ThisProperty */) { if (isDeclarationInConstructor(expression)) { definedInConstructor = true; } @@ -50613,7 +49337,6 @@ var ts; var exportedType = resolveStructuredTypeMembers(type); var members_4 = ts.createSymbolTable(); ts.copyEntries(exportedType.members, members_4); - var initialSize = members_4.size; if (resolvedSymbol && !resolvedSymbol.exports) { resolvedSymbol.exports = ts.createSymbolTable(); } @@ -50652,12 +49375,8 @@ var ts; members_4.set(name, s); } }); - var result = createAnonymousType(initialSize !== members_4.size ? undefined : exportedType.symbol, // Only set the type's symbol if it looks to be the same as the original type - members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo); + var result = createAnonymousType(exportedType.symbol, members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo); result.objectFlags |= (ts.getObjectFlags(type) & 16384 /* JSLiteral */); // Propagate JSLiteral flag - if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) { - result.objectFlags |= 1073741824 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type - } return result; } if (isEmptyArrayLiteralType(type)) { @@ -50675,9 +49394,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 166 /* Constructor */ || - thisContainer.kind === 251 /* FunctionDeclaration */ || - (thisContainer.kind === 208 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 165 /* Constructor */ || + thisContainer.kind === 248 /* FunctionDeclaration */ || + (thisContainer.kind === 205 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -50747,7 +49466,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var restElement = lastElement && lastElement.kind === 198 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : undefined; + var restElement = lastElement && lastElement.kind === 195 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : undefined; if (elements.length === 0 || elements.length === 1 && restElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -50772,7 +49491,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 196 /* ObjectBindingPattern */ + return pattern.kind === 193 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -50811,7 +49530,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 160 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 159 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -50874,7 +49593,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 266 /* ExportAssignment */) { + if (declaration.kind === 263 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -50945,7 +49664,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 167 /* GetAccessor */) { + if (accessor.kind === 166 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -50979,15 +49698,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 166 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 168 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 166 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 167 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -51038,9 +49757,9 @@ var ts; var links = getSymbolLinks(symbol); var originalLinks = links; if (!links.type) { - var expando = symbol.valueDeclaration && getSymbolOfExpando(symbol.valueDeclaration, /*allowDeclaration*/ false); - if (expando) { - var merged = mergeJSSymbols(symbol, expando); + var jsDeclaration = symbol.valueDeclaration && ts.getDeclarationOfExpando(symbol.valueDeclaration); + if (jsDeclaration) { + var merged = mergeJSSymbols(symbol, getSymbolOfNode(jsDeclaration)); if (merged) { // note:we overwrite links because we just cloned the symbol symbol = links = merged; @@ -51055,9 +49774,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration && (declaration.kind === 216 /* BinaryExpression */ || + else if (declaration && (declaration.kind === 213 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 216 /* BinaryExpression */)) { + declaration.parent.kind === 213 /* BinaryExpression */)) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -51124,7 +49843,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 160 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 159 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -51223,43 +49942,43 @@ var ts; return undefined; } switch (node.kind) { - case 232 /* VariableStatement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 308 /* JSDocFunctionType */: - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: - case 331 /* JSDocTypedefTag */: - case 325 /* JSDocEnumTag */: - case 324 /* JSDocCallbackTag */: - case 190 /* MappedType */: - case 184 /* ConditionalType */: + case 229 /* VariableStatement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 304 /* JSDocFunctionType */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: + case 327 /* JSDocTypedefTag */: + case 321 /* JSDocEnumTag */: + case 320 /* JSDocCallbackTag */: + case 189 /* MappedType */: + case 183 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 190 /* MappedType */) { + if (node.kind === 189 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 184 /* ConditionalType */) { + else if (node.kind === 183 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } - else if (node.kind === 232 /* VariableStatement */ && !ts.isInJSFile(node)) { + else if (node.kind === 229 /* VariableStatement */ && !ts.isInJSFile(node)) { break; } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */ || node.kind === 253 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */ || node.kind === 250 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: var paramSymbol = ts.getParameterSymbolFromJSDoc(node); if (paramSymbol) { node = paramSymbol.valueDeclaration; @@ -51270,7 +49989,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 250 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -51280,9 +49999,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 253 /* InterfaceDeclaration */ || - node.kind === 252 /* ClassDeclaration */ || - node.kind === 221 /* ClassExpression */ || + if (node.kind === 250 /* InterfaceDeclaration */ || + node.kind === 249 /* ClassDeclaration */ || + node.kind === 218 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -51426,7 +50145,7 @@ var ts; if (!popTypeResolution()) { for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 252 /* ClassDeclaration */ || declaration.kind === 253 /* InterfaceDeclaration */) { + if (declaration.kind === 249 /* ClassDeclaration */ || declaration.kind === 250 /* InterfaceDeclaration */) { reportCircularBaseType(declaration, type); } } @@ -51521,7 +50240,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 253 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 250 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -51557,7 +50276,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 253 /* InterfaceDeclaration */) { + if (declaration.kind === 250 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -51645,7 +50364,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 216 /* BinaryExpression */) { + else if (expr.kind === 213 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -51660,12 +50379,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 78 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -51679,7 +50398,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 255 /* EnumDeclaration */) { + if (declaration.kind === 252 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -51706,7 +50425,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 255 /* EnumDeclaration */) { + if (declaration.kind === 252 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -51779,21 +50498,21 @@ var ts; function isThislessType(node) { switch (node.kind) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: - case 145 /* ObjectKeyword */: + case 147 /* SymbolKeyword */: + case 144 /* ObjectKeyword */: case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: - case 191 /* LiteralType */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: + case 190 /* LiteralType */: return true; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return isThislessType(node.elementType); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -51819,7 +50538,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 166 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 165 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -51835,14 +50554,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -52047,7 +50766,7 @@ var ts; links[resolutionKind] = earlySymbols || emptySymbols; // fill in any as-yet-unresolved late-bound members. var lateSymbols = ts.createSymbolTable(); - for (var _i = 0, _a = symbol.declarations || ts.emptyArray; _i < _a.length; _i++) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var members = ts.getMembersOfDeclaration(decl); if (members) { @@ -52066,7 +50785,7 @@ var ts; var member = decls_1[_c]; var assignmentKind = ts.getAssignmentDeclarationKind(member); var isInstanceMember = assignmentKind === 3 /* PrototypeProperty */ - || ts.isBinaryExpression(member) && isPossiblyAliasedThisProperty(member, assignmentKind) + || assignmentKind === 4 /* ThisProperty */ || assignmentKind === 9 /* ObjectDefinePrototypeProperty */ || assignmentKind === 6 /* Prototype */; // A straight `Prototype` assignment probably can never have a computed name if (isStatic === !isInstanceMember && hasLateBindableName(member)) { @@ -52189,7 +50908,6 @@ var ts; sig.resolvedReturnType = resolvedReturnType; sig.resolvedTypePredicate = resolvedTypePredicate; sig.minArgumentCount = minArgumentCount; - sig.resolvedMinArgumentCount = undefined; sig.target = undefined; sig.mapper = undefined; sig.unionSignatures = undefined; @@ -52433,8 +51151,8 @@ var ts; function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; - for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { - var type = types_4[_i]; + for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { + var type = types_3[_i]; var indexInfo = getIndexInfoOfType(getApparentType(type), kind); if (!indexInfo) { return undefined; @@ -52633,6 +51351,9 @@ var ts; // bound includes those keys that are known to always be present, for example because // because of constraints on type parameters (e.g. 'keyof T' for a constrained T). function getLowerBoundOfKeyType(type) { + if (type.flags & (1 /* Any */ | 131068 /* Primitive */)) { + return type; + } if (type.flags & 4194304 /* Index */) { var t = getApparentType(type.type); return isGenericTupleType(t) ? getKnownKeysOfTupleType(t) : getIndexType(t); @@ -52653,7 +51374,7 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return getIntersectionType(ts.sameMap(type.types, getLowerBoundOfKeyType)); } - return type; + return neverType; } /** Resolve the members of a mapped type { [P in K]: T } */ function resolveMappedTypeMembers(type) { @@ -52666,7 +51387,6 @@ var ts; // and T as the template type. var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); - var nameType = getNameTypeFromMappedType(type.target || type); var templateType = getTemplateTypeFromMappedType(type.target || type); var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' var templateModifiers = getMappedTypeModifiers(type); @@ -52688,25 +51408,25 @@ var ts; forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType); } setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); - function addMemberForKeyType(keyType) { - var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType; - forEachType(propNameType, function (t) { return addMemberForKeyTypeWorker(keyType, t); }); - } - function addMemberForKeyTypeWorker(keyType, propNameType) { + function addMemberForKeyType(t) { + // Create a mapper from T to the current iteration type constituent. Then, if the + // mapped type is itself an instantiated type, combine the iteration mapper with the + // instantiation mapper. + var templateMapper = appendTypeMapping(type.mapper, typeParameter, t); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. - if (isTypeUsableAsPropertyName(propNameType)) { - var propName = getPropertyNameFromType(propNameType); + if (isTypeUsableAsPropertyName(t)) { + var propName = getPropertyNameFromType(t); // String enum members from separate enums with identical values // are distinct types with the same property name. Make the resulting // property symbol's name type be the union of those enum member types. var existingProp = members.get(propName); if (existingProp) { - existingProp.nameType = getUnionType([existingProp.nameType, propNameType]); - existingProp.keyType = getUnionType([existingProp.keyType, keyType]); + existingProp.nameType = getUnionType([existingProp.nameType, t]); + existingProp.mapper = appendTypeMapping(type.mapper, typeParameter, existingProp.nameType); } else { - var modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : undefined; + var modifiersProp = getPropertyOfType(modifiersType, propName); var isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */); var isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || @@ -52714,19 +51434,19 @@ var ts; var stripOptional = strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */; var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0)); prop.mappedType = type; - prop.nameType = propNameType; - prop.keyType = keyType; if (modifiersProp) { prop.syntheticOrigin = modifiersProp; prop.declarations = modifiersProp.declarations; } + prop.nameType = t; + prop.mapper = templateMapper; members.set(propName, prop); } } - else if (propNameType.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 32 /* Enum */)) { - var propType = instantiateType(templateType, appendTypeMapping(type.mapper, typeParameter, keyType)); - if (propNameType.flags & (1 /* Any */ | 4 /* String */)) { - stringIndexInfo = createIndexInfo(stringIndexInfo ? getUnionType([stringIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */)); + else if (t.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 32 /* Enum */)) { + var propType = instantiateType(templateType, templateMapper); + if (t.flags & (1 /* Any */ | 4 /* String */)) { + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1 /* IncludeReadonly */)); } else { numberIndexInfo = createIndexInfo(numberIndexInfo ? getUnionType([numberIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */)); @@ -52736,14 +51456,12 @@ var ts; } function getTypeOfMappedSymbol(symbol) { if (!symbol.type) { - var mappedType = symbol.mappedType; if (!pushTypeResolution(symbol, 0 /* Type */)) { - mappedType.containsError = true; + symbol.mappedType.containsError = true; return errorType; } - var templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType); - var mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.keyType); - var propType = instantiateType(templateType, mapper); + var templateType = getTemplateTypeFromMappedType(symbol.mappedType.target || symbol.mappedType); + var propType = instantiateType(templateType, symbol.mapper); // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks // mode, if the underlying property is optional we remove 'undefined' from the type. @@ -52751,10 +51469,11 @@ var ts; symbol.checkFlags & 524288 /* StripOptional */ ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType; if (!popTypeResolution()) { - error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType)); + error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(symbol.mappedType)); type = errorType; } symbol.type = type; + symbol.mapper = undefined; } return symbol.type; } @@ -52766,11 +51485,6 @@ var ts; return type.constraintType || (type.constraintType = getConstraintOfTypeParameter(getTypeParameterFromMappedType(type)) || errorType); } - function getNameTypeFromMappedType(type) { - return type.declaration.nameType ? - type.nameType || (type.nameType = instantiateType(getTypeFromTypeNode(type.declaration.nameType), type.mapper)) : - undefined; - } function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? @@ -52782,8 +51496,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 188 /* TypeOperator */ && - constraintDeclaration.operator === 138 /* KeyOfKeyword */; + return constraintDeclaration.kind === 187 /* TypeOperator */ && + constraintDeclaration.operator === 137 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -52917,8 +51631,8 @@ var ts; return getAugmentedPropertiesOfType(unionType); } var props = ts.createSymbolTable(); - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var memberType = types_5[_i]; + for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { + var memberType = types_4[_i]; for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) { var escapedName = _b[_a].escapedName; if (!props.has(escapedName)) { @@ -52950,14 +51664,14 @@ var ts; function getConstraintFromIndexedAccess(type) { var indexConstraint = getSimplifiedTypeOrConstraint(type.indexType); if (indexConstraint && indexConstraint !== type.indexType) { - var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.noUncheckedIndexedAccessCandidate); + var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint); if (indexedAccess) { return indexedAccess; } } var objectConstraint = getSimplifiedTypeOrConstraint(type.objectType); if (objectConstraint && objectConstraint !== type.objectType) { - return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType, type.noUncheckedIndexedAccessCandidate); + return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType); } return undefined; } @@ -53006,9 +51720,9 @@ var ts; function getEffectiveConstraintOfIntersection(types, targetIsUnion) { var constraints; var hasDisjointDomainType = false; - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var t = types_6[_i]; - if (t.flags & 465829888 /* Instantiable */) { + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var t = types_5[_i]; + if (t.flags & 63176704 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -53022,7 +51736,7 @@ var ts; } } } - else if (t.flags & 469892092 /* DisjointDomains */) { + else if (t.flags & 67238908 /* DisjointDomains */) { hasDisjointDomainType = true; } } @@ -53032,9 +51746,9 @@ var ts; if (hasDisjointDomainType) { // We add any types belong to one of the disjoint domains because they might cause the final // intersection operation to reduce the union constraints. - for (var _a = 0, types_7 = types; _a < types_7.length; _a++) { - var t = types_7[_a]; - if (t.flags & 469892092 /* DisjointDomains */) { + for (var _a = 0, types_6 = types; _a < types_6.length; _a++) { + var t = types_6[_a]; + if (t.flags & 67238908 /* DisjointDomains */) { constraints = ts.append(constraints, t); } } @@ -53044,7 +51758,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) { + if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -53066,12 +51780,9 @@ var ts; * circularly references the type variable. */ function getResolvedBaseConstraint(type) { - if (type.resolvedBaseConstraint) { - return type.resolvedBaseConstraint; - } var nonTerminating = false; - var stack = []; - return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type); + return type.resolvedBaseConstraint || + (type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type)); function getImmediateBaseConstraint(t) { if (!t.immediateBaseConstraint) { if (!pushTypeResolution(t, 4 /* ImmediateBaseConstraint */)) { @@ -53082,19 +51793,13 @@ var ts; // very high likelihood we're dealing with an infinite generic type that perpetually generates // new type identities as we descend into it. We stop the recursion here and mark this type // and the outer types as having circular constraints. - ts.tracing.instant("check" /* Check */, "getImmediateBaseConstraint_DepthLimit", { typeId: t.id, originalTypeId: type.id, depth: constraintDepth }); error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); nonTerminating = true; return t.immediateBaseConstraint = noConstraintType; } - var result = void 0; - if (!isDeeplyNestedType(t, stack, stack.length)) { - stack.push(t); - constraintDepth++; - result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false)); - constraintDepth--; - stack.pop(); - } + constraintDepth++; + var result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false)); + constraintDepth--; if (!popTypeResolution()) { if (t.flags & 262144 /* TypeParameter */) { var errorNode = getConstraintDeclaration(t); @@ -53128,8 +51833,8 @@ var ts; if (t.flags & 3145728 /* UnionOrIntersection */) { var types = t.types; var baseTypes = []; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var type_3 = types_8[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var type_3 = types_7[_i]; var baseType = getBaseConstraint(type_3); if (baseType) { baseTypes.push(baseType); @@ -53142,19 +51847,10 @@ var ts; if (t.flags & 4194304 /* Index */) { return keyofConstraintType; } - if (t.flags & 134217728 /* TemplateLiteral */) { - var types = t.types; - var constraints = ts.mapDefined(types, getBaseConstraint); - return constraints.length === types.length ? getTemplateLiteralType(t.texts, constraints) : stringType; - } - if (t.flags & 268435456 /* StringMapping */) { - var constraint = getBaseConstraint(t.type); - return constraint ? getStringMappingType(t.symbol, constraint) : stringType; - } if (t.flags & 8388608 /* IndexedAccess */) { var baseObjectType = getBaseConstraint(t.objectType); var baseIndexType = getBaseConstraint(t.indexType); - var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t.noUncheckedIndexedAccessCandidate); + var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType); return baseIndexedAccess && getBaseConstraint(baseIndexedAccess); } if (t.flags & 16777216 /* Conditional */) { @@ -53221,7 +51917,7 @@ var ts; } function getResolvedApparentTypeOfMappedType(type) { var typeVariable = getHomomorphicTypeVariable(type); - if (typeVariable && !type.declaration.nameType) { + if (typeVariable) { var constraint = getConstraintOfTypeParameter(typeVariable); if (constraint && (isArrayType(constraint) || isTupleType(constraint))) { return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper)); @@ -53235,10 +51931,10 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : - t.flags & 402653316 /* StringLike */ ? globalStringType : + t.flags & 132 /* StringLike */ ? globalStringType : t.flags & 296 /* NumberLike */ ? globalNumberType : t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType(/*reportErrors*/ languageVersion >= 7 /* ES2020 */) : t.flags & 528 /* BooleanLike */ ? globalBooleanType : @@ -53563,10 +52259,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 307 /* JSDocOptionalType */ + node.type && node.type.kind === 303 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 303 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -53585,10 +52281,7 @@ var ts; var signature = getSignatureFromDeclaration(node.parent); var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); - // Only consider syntactic or instantiated parameters as optional, not `void` parameters as this function is used - // in grammar checks and checking for `void` too early results in parameter types widening too early - // and causes some noImplicitAny errors to be lost. - return parameterIndex >= getMinArgumentCount(signature, 1 /* StrongArityForUntypedJS */ | 2 /* VoidIsNonOptional */); + return parameterIndex >= getMinArgumentCount(signature, /*strongArityForUntypedJS*/ true); } var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); if (iife) { @@ -53603,7 +52296,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 303 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -53685,7 +52378,7 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 191 /* LiteralType */) { + if (type && type.kind === 190 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter @@ -53698,16 +52391,16 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 167 /* GetAccessor */ || declaration.kind === 168 /* SetAccessor */) && + if ((declaration.kind === 166 /* GetAccessor */ || declaration.kind === 167 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + var otherKind = declaration.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 166 /* Constructor */ ? + var classType = declaration.kind === 165 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -53772,11 +52465,11 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - return node.name.kind === 158 /* ComputedPropertyName */ + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + return node.name.kind === 157 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -53848,7 +52541,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 187 /* ThisType */ ? + return parameterName.kind === 186 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -53891,7 +52584,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 166 /* Constructor */) { + if (declaration.kind === 165 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -53901,12 +52594,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 167 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 166 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 168 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 167 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -53996,7 +52689,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 166 /* Constructor */ || kind === 170 /* ConstructSignature */ || kind === 175 /* ConstructorType */; + var isConstructor = kind === 165 /* Constructor */ || kind === 169 /* ConstructSignature */ || kind === 174 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -54010,7 +52703,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 144 /* NumberKeyword */ : 147 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 143 /* NumberKeyword */ : 146 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -54044,17 +52737,17 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 185 /* InferType */) { + if (declaration.parent.kind === 184 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. - var _b = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _c = _b[0], childTypeParameter = _c === void 0 ? declaration.parent : _c, grandParent = _b[1]; - if (grandParent.kind === 173 /* TypeReference */) { + var grandParent = declaration.parent.parent; + if (grandParent.kind === 172 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { - var index = typeReference.typeArguments.indexOf(childTypeParameter); + var index = typeReference.typeArguments.indexOf(declaration.parent); if (index < typeParameters.length) { var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); if (declaredConstraint) { @@ -54075,16 +52768,11 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter declaration, a rest type // or a named rest tuple element, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 160 /* Parameter */ && grandParent.dotDotDotToken || - grandParent.kind === 181 /* RestType */ || - grandParent.kind === 192 /* NamedTupleMember */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 159 /* Parameter */ && grandParent.dotDotDotToken || + grandParent.kind === 180 /* RestType */ || + grandParent.kind === 191 /* NamedTupleMember */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } - // When an 'infer T' declaration is immediately contained in a string template type, we infer a 'string' - // constraint. - else if (grandParent.kind === 194 /* TemplateLiteralTypeSpan */) { - inferences = ts.append(inferences, stringType); - } } } } @@ -54107,7 +52795,7 @@ var ts; if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), // use unknown otherwise - type = constraintDeclaration.parent.parent.kind === 190 /* MappedType */ ? keyofConstraintType : unknownType; + type = constraintDeclaration.parent.parent.kind === 189 /* MappedType */ ? keyofConstraintType : unknownType; } typeParameter.constraint = type; } @@ -54116,7 +52804,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 159 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 158 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -54149,8 +52837,8 @@ var ts; // that care about the presence of such types at arbitrary depth in a containing type. function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var type = types_9[_i]; + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; if (!(type.flags & excludeKinds)) { result |= ts.getObjectFlags(type); } @@ -54196,8 +52884,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 173 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 172 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 177 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -54239,7 +52927,7 @@ var ts; return errorType; } } - if (node.kind === 173 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 172 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -54252,9 +52940,6 @@ var ts; } function getTypeAliasInstantiation(symbol, typeArguments) { var type = getDeclaredTypeOfSymbol(symbol); - if (type === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName) && typeArguments && typeArguments.length === 1) { - return getStringMappingType(symbol, typeArguments[0]); - } var links = getSymbolLinks(symbol); var typeParameters = links.typeParameters; var id = getTypeListId(typeArguments); @@ -54287,9 +52972,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -54337,7 +53022,8 @@ var ts; } /** * A JSdoc TypeReference may be to a value, but resolve it as a type anyway. - * Example: import('./b').ConstructorFunction + * Note: If the value is imported from commonjs, it should really be an alias, + * but this function's special-case code fakes alias resolution as well. */ function getTypeFromJSDocValueReference(node, symbol) { var links = getNodeLinks(node); @@ -54345,9 +53031,19 @@ var ts; var valueType = getTypeOfSymbol(symbol); var typeType = valueType; if (symbol.valueDeclaration) { - var isImportTypeWithQualifier = node.kind === 195 /* ImportType */ && node.qualifier; + var decl = ts.getRootDeclaration(symbol.valueDeclaration); + var isRequireAlias = false; + if (ts.isVariableDeclaration(decl) && decl.initializer) { + var expr = decl.initializer; + // skip past entity names, eg `require("x").a.b.c` + while (ts.isPropertyAccessExpression(expr)) { + expr = expr.expression; + } + isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; + } + var isImportTypeWithQualifier = node.kind === 192 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} - if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) { + if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); } } @@ -54371,7 +53067,7 @@ var ts; return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 179 /* TupleType */ && node.elements.length === 1; + return node.kind === 178 /* TupleType */ && node.elements.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) : @@ -54380,9 +53076,9 @@ var ts; } function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 311 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 307 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 184 /* ConditionalType */ && node === parent.trueType) { + if (parent.kind === 183 /* ConditionalType */ && node === parent.trueType) { var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); @@ -54393,7 +53089,7 @@ var ts; return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 173 /* TypeReference */ || node.kind === 195 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 172 /* TypeReference */ || node.kind === 192 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -54506,9 +53202,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: return declaration; } } @@ -54629,11 +53325,11 @@ var ts; } function getTupleElementFlags(node) { switch (node.kind) { - case 180 /* OptionalType */: + case 179 /* OptionalType */: return 2 /* Optional */; - case 181 /* RestType */: + case 180 /* RestType */: return getRestTypeElementFlags(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return node.questionToken ? 2 /* Optional */ : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1 /* Required */; @@ -54651,14 +53347,14 @@ var ts; return readonly ? globalReadonlyArrayType : globalArrayType; } var elementFlags = ts.map(node.elements, getTupleElementFlags); - var missingName = ts.some(node.elements, function (e) { return e.kind !== 192 /* NamedTupleMember */; }); + var missingName = ts.some(node.elements, function (e) { return e.kind !== 191 /* NamedTupleMember */; }); return getTupleTargetType(elementFlags, readonly, /*associatedNames*/ missingName ? undefined : node.elements); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 178 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 179 /* TupleType */ ? ts.some(node.elements, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 177 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 178 /* TupleType */ ? ts.some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -54667,18 +53363,18 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: - case 173 /* TypeReference */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 189 /* IndexedAccessType */: - case 184 /* ConditionalType */: - case 188 /* TypeOperator */: - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: + case 172 /* TypeReference */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 188 /* IndexedAccessType */: + case 183 /* ConditionalType */: + case 187 /* TypeOperator */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return isResolvedByTypeAlias(parent); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; } return false; @@ -54687,28 +53383,28 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return true; - case 188 /* TypeOperator */: - return node.operator !== 151 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 186 /* ParenthesizedType */: - case 180 /* OptionalType */: - case 192 /* NamedTupleMember */: - case 307 /* JSDocOptionalType */: - case 305 /* JSDocNullableType */: - case 306 /* JSDocNonNullableType */: - case 301 /* JSDocTypeExpression */: + case 187 /* TypeOperator */: + return node.operator !== 150 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 185 /* ParenthesizedType */: + case 179 /* OptionalType */: + case 191 /* NamedTupleMember */: + case 303 /* JSDocOptionalType */: + case 301 /* JSDocNullableType */: + case 302 /* JSDocNonNullableType */: + case 298 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 181 /* RestType */: - return node.type.kind !== 178 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 180 /* RestType */: + return node.type.kind !== 177 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 181 /* UnionType */: + case 182 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -54721,19 +53417,19 @@ var ts; if (target === emptyGenericType) { links.resolvedType = emptyObjectType; } - else if (!(node.kind === 179 /* TupleType */ && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8 /* Variadic */); })) && isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 179 /* TupleType */ && node.elements.length === 0 ? target : + else if (!(node.kind === 178 /* TupleType */ && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8 /* Variadic */); })) && isDeferredTypeReferenceNode(node)) { + links.resolvedType = node.kind === 178 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); + var elementTypes = node.kind === 177 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); links.resolvedType = createNormalizedTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 142 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 141 /* ReadonlyKeyword */; } function createTupleType(elementTypes, elementFlags, readonly, namedMemberDeclarations) { if (readonly === void 0) { readonly = false; } @@ -54830,9 +53526,7 @@ var ts; // Transform [A, ...(X | Y | Z)] into [A, ...X] | [A, ...Y] | [A, ...Z] var unionIndex = ts.findIndex(elementTypes, function (t, i) { return !!(target.elementFlags[i] & 8 /* Variadic */ && t.flags & (131072 /* Never */ | 1048576 /* Union */)); }); if (unionIndex >= 0) { - return checkCrossProductUnion(ts.map(elementTypes, function (t, i) { return target.elementFlags[i] & 8 /* Variadic */ ? t : unknownType; })) ? - mapType(elementTypes[unionIndex], function (t) { return createNormalizedTupleType(target, ts.replaceElement(elementTypes, unionIndex, t)); }) : - errorType; + return mapType(elementTypes[unionIndex], function (t) { return createNormalizedTupleType(target, ts.replaceElement(elementTypes, unionIndex, t)); }); } // If there are no variadic elements with non-generic types, just create a type reference with the same target type. var spreadIndex = ts.findIndex(elementTypes, function (t, i) { return !!(target.elementFlags[i] & 8 /* Variadic */) && !(t.flags & 58982400 /* InstantiableNonPrimitive */) && !isGenericMappedType(t); }); @@ -54946,8 +53640,8 @@ var ts; } // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { - includes |= flags & 205258751 /* IncludesMask */; - if (flags & 469499904 /* StructuredOrInstantiable */) + includes |= flags & 71041023 /* IncludesMask */; + if (flags & 66846720 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -54968,8 +53662,8 @@ var ts; // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. function addTypesToUnion(typeSet, includes, types) { - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var type = types_10[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var type = types_9[_i]; includes = addTypeToUnion(typeSet, includes, type); } return includes; @@ -54998,8 +53692,8 @@ var ts; while (i > 0) { i--; var source = types[i]; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var target = types_11[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var target = types_10[_i]; if (source !== target) { if (count === 100000) { // After 100000 subtype checks we estimate the remaining amount of work by assuming the @@ -55009,7 +53703,6 @@ var ts; // caps union types at 5000 unique literal types and 1000 unique object types. var estimatedCount = (count / (len - i)) * len; if (estimatedCount > (primitivesOnly ? 25000000 : 1000000)) { - ts.tracing.instant("check" /* Check */, "removeSubtypes_DepthLimit", { typeIds: types.map(function (t) { return t.id; }) }); error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return false; } @@ -55041,22 +53734,6 @@ var ts; } } } - function removeStringLiteralsMatchedByTemplateLiterals(types) { - var templates = ts.filter(types, isPatternLiteralType); - if (templates.length) { - var i = types.length; - var _loop_14 = function () { - i--; - var t = types[i]; - if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeSubtypeOf(t, template); })) { - ts.orderedRemoveItemAt(types, i); - } - }; - while (i > 0) { - _loop_14(); - } - } - } // We sort and deduplicate the constituent types based on object identity. If the subtypeReduction // flag is specified we also reduce the constituent type set to only include types that aren't subtypes // of other types. Subtype reduction is expensive for large union types and is possible only when union @@ -55083,9 +53760,6 @@ var ts; if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */)) { removeRedundantLiteralTypes(typeSet, includes); } - if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) { - removeStringLiteralsMatchedByTemplateLiterals(typeSet); - } break; case 2 /* Subtype */: if (!removeSubtypes(typeSet, !(includes & 262144 /* IncludesStructuredOrInstantiable */))) { @@ -55099,7 +53773,7 @@ var ts; neverType; } } - var objectFlags = (includes & 469647395 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -55191,15 +53865,15 @@ var ts; } typeSet.set(type.id.toString(), type); } - includes |= flags & 205258751 /* IncludesMask */; + includes |= flags & 71041023 /* IncludesMask */; } return includes; } // Add the given types to the given type set. Order is preserved, freshness is removed from literal // types, duplicates are removed, and nested types of the given kind are flattened into the set. function addTypesToIntersection(typeSet, includes, types) { - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var type = types_12[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var type = types_11[_i]; includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); } return includes; @@ -55237,31 +53911,6 @@ var ts; } return true; } - /** - * Returns `true` if the intersection of the template literals and string literals is the empty set, eg `get${string}` & "setX", and should reduce to `never` - */ - function extractRedundantTemplateLiterals(types) { - var i = types.length; - var literals = ts.filter(types, function (t) { return !!(t.flags & 128 /* StringLiteral */); }); - while (i > 0) { - i--; - var t = types[i]; - if (!(t.flags & 134217728 /* TemplateLiteral */)) - continue; - for (var _i = 0, literals_1 = literals; _i < literals_1.length; _i++) { - var t2 = literals_1[_i]; - if (isTypeSubtypeOf(t2, t)) { - // eg, ``get${T}` & "getX"` is just `"getX"` - ts.orderedRemoveItemAt(types, i); - break; - } - else if (isPatternLiteralType(t)) { - return true; - } - } - } - return false; - } function extractIrreducible(types, flag) { if (ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) { for (var i = 0; i < types.length; i++) { @@ -55350,15 +53999,12 @@ var ts; // a non-primitive type and a type known to be primitive. if (includes & 131072 /* Never */ || strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) || - includes & 67108864 /* NonPrimitive */ && includes & (469892092 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || - includes & 402653316 /* StringLike */ && includes & (469892092 /* DisjointDomains */ & ~402653316 /* StringLike */) || - includes & 296 /* NumberLike */ && includes & (469892092 /* DisjointDomains */ & ~296 /* NumberLike */) || - includes & 2112 /* BigIntLike */ && includes & (469892092 /* DisjointDomains */ & ~2112 /* BigIntLike */) || - includes & 12288 /* ESSymbolLike */ && includes & (469892092 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || - includes & 49152 /* VoidLike */ && includes & (469892092 /* DisjointDomains */ & ~49152 /* VoidLike */)) { - return neverType; - } - if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) { + includes & 67108864 /* NonPrimitive */ && includes & (67238908 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || + includes & 132 /* StringLike */ && includes & (67238908 /* DisjointDomains */ & ~132 /* StringLike */) || + includes & 296 /* NumberLike */ && includes & (67238908 /* DisjointDomains */ & ~296 /* NumberLike */) || + includes & 2112 /* BigIntLike */ && includes & (67238908 /* DisjointDomains */ & ~2112 /* BigIntLike */) || + includes & 12288 /* ESSymbolLike */ && includes & (67238908 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || + includes & 49152 /* VoidLike */ && includes & (67238908 /* DisjointDomains */ & ~49152 /* VoidLike */)) { return neverType; } if (includes & 1 /* Any */) { @@ -55402,7 +54048,9 @@ var ts; // We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of // the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain. // If the estimated size of the resulting union type exceeds 100000 constituents, report an error. - if (!checkCrossProductUnion(typeSet)) { + var size = ts.reduceLeft(typeSet, function (n, t) { return n * (t.flags & 1048576 /* Union */ ? t.types.length : 1); }, 1); + if (size >= 100000) { + error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return errorType; } var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 1048576 /* Union */) !== 0; }); @@ -55417,15 +54065,6 @@ var ts; } return result; } - function checkCrossProductUnion(types) { - var size = ts.reduceLeft(types, function (n, t) { return n * (t.flags & 1048576 /* Union */ ? t.types.length : t.flags & 131072 /* Never */ ? 0 : 1); }, 1); - if (size >= 100000) { - ts.tracing.instant("check" /* Check */, "checkCrossProductUnion_DepthLimit", { typeIds: types.map(function (t) { return t.id; }), size: size }); - error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); - return false; - } - return true; - } function getTypeFromIntersectionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -55445,24 +54084,6 @@ var ts; type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, /*stringsOnly*/ true)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, /*stringsOnly*/ false)); } - function getIndexTypeForMappedType(type, noIndexSignatures) { - var constraint = filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }); - var nameType = type.declaration.nameType && getTypeFromTypeNode(type.declaration.nameType); - return nameType ? - mapType(constraint, function (t) { return instantiateType(nameType, appendTypeMapping(type.mapper, getTypeParameterFromMappedType(type), t)); }) : - constraint; - } - // Ordinarily we reduce a keyof M where M is a mapped type { [P in K as N

]: X } to simply N. This however presumes - // that N distributes over union types, i.e. that N is equivalent to N | N | N. That presumption is - // generally true, except when N is a non-distributive conditional type or an instantiable type with non-distributive - // conditional type as a constituent. In those cases, we cannot reduce keyof M and need to preserve it as is. - function isNonDistributiveNameType(type) { - return !!(type && (type.flags & 16777216 /* Conditional */ && !type.root.isDistributive || - type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && ts.some(type.types, isNonDistributiveNameType) || - type.flags & (4194304 /* Index */ | 268435456 /* StringMapping */) && isNonDistributiveNameType(type.type) || - type.flags & 8388608 /* IndexedAccess */ && isNonDistributiveNameType(type.indexType) || - type.flags & 33554432 /* Substitution */ && isNonDistributiveNameType(type.substitute))); - } function getLiteralTypeFromPropertyName(name) { if (ts.isPrivateIdentifier(name)) { return neverType; @@ -55506,8 +54127,8 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && isNonDistributiveNameType(getNameTypeFromMappedType(type)) ? getIndexTypeForGenericType(type, stringsOnly) : - ts.getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, noIndexSignatures) : + type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) ? getIndexTypeForGenericType(type, stringsOnly) : + ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : @@ -55531,15 +54152,15 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 138 /* KeyOfKeyword */: + case 137 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 151 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 148 /* SymbolKeyword */ + case 150 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 147 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; default: @@ -55548,115 +54169,12 @@ var ts; } return links.resolvedType; } - function getTypeFromTemplateTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getTemplateLiteralType(__spreadArrays([node.head.text], ts.map(node.templateSpans, function (span) { return span.literal.text; })), ts.map(node.templateSpans, function (span) { return getTypeFromTypeNode(span.type); })); - } - return links.resolvedType; - } - function getTemplateLiteralType(texts, types) { - var unionIndex = ts.findIndex(types, function (t) { return !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)); }); - if (unionIndex >= 0) { - return checkCrossProductUnion(types) ? - mapType(types[unionIndex], function (t) { return getTemplateLiteralType(texts, ts.replaceElement(types, unionIndex, t)); }) : - errorType; - } - if (ts.contains(types, wildcardType)) { - return wildcardType; - } - var newTypes = []; - var newTexts = []; - var text = texts[0]; - if (!addSpans(texts, types)) { - return stringType; - } - if (newTypes.length === 0) { - return getLiteralType(text); - } - newTexts.push(text); - var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join(""); - var type = templateLiteralTypes.get(id); - if (!type) { - templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes)); - } - return type; - function addSpans(texts, types) { - for (var i = 0; i < types.length; i++) { - var t = types[i]; - if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) { - text += getTemplateStringForType(t) || ""; - text += texts[i + 1]; - } - else if (t.flags & 134217728 /* TemplateLiteral */) { - text += t.texts[0]; - if (!addSpans(t.texts, t.types)) - return false; - text += texts[i + 1]; - } - else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) { - newTypes.push(t); - newTexts.push(text); - text = texts[i + 1]; - } - else { - return false; - } - } - return true; - } - } - function getTemplateStringForType(type) { - return type.flags & 128 /* StringLiteral */ ? type.value : - type.flags & 256 /* NumberLiteral */ ? "" + type.value : - type.flags & 2048 /* BigIntLiteral */ ? ts.pseudoBigIntToString(type.value) : - type.flags & 512 /* BooleanLiteral */ ? type.intrinsicName : - type.flags & 65536 /* Null */ ? "null" : - type.flags & 32768 /* Undefined */ ? "undefined" : - undefined; - } - function createTemplateLiteralType(texts, types) { - var type = createType(134217728 /* TemplateLiteral */); - type.texts = texts; - type.types = types; - return type; - } - function getStringMappingType(symbol, type) { - return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) : - isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) : - type.flags & 128 /* StringLiteral */ ? getLiteralType(applyStringMapping(symbol, type.value)) : - type; - } - function applyStringMapping(symbol, str) { - switch (intrinsicTypeKinds.get(symbol.escapedName)) { - case 0 /* Uppercase */: return str.toUpperCase(); - case 1 /* Lowercase */: return str.toLowerCase(); - case 2 /* Capitalize */: return str.charAt(0).toUpperCase() + str.slice(1); - case 3 /* Uncapitalize */: return str.charAt(0).toLowerCase() + str.slice(1); - } - return str; - } - function getStringMappingTypeForGenericType(symbol, type) { - var id = getSymbolId(symbol) + "," + getTypeId(type); - var result = stringMappingTypes.get(id); - if (!result) { - stringMappingTypes.set(id, result = createStringMappingType(symbol, type)); - } - return result; - } - function createStringMappingType(symbol, type) { - var result = createType(268435456 /* StringMapping */); - result.symbol = symbol; - result.type = type; - return result; - } - function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined) { + function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments) { var type = createType(8388608 /* IndexedAccess */); type.objectType = objectType; type.indexType = indexType; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; - type.noUncheckedIndexedAccessCandidate = shouldIncludeUndefined; return type; } /** @@ -55681,13 +54199,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -55702,15 +54220,15 @@ var ts; || !ts.isCallLikeExpression(ts.findAncestor(node, function (n) { return !ts.isAccessExpression(n); }) || node.parent) && ts.every(symbol.declarations, function (d) { return !ts.isFunctionLike(d) || !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }); } - function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, noUncheckedIndexedAccessCandidate, reportDeprecated) { - var _a; - var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined; + function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, reportDeprecated) { + var _a, _b; + var accessExpression = accessNode && accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); if (prop) { - if (reportDeprecated && accessNode && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) { - var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); + if (reportDeprecated && accessNode && ((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.flags) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) { + var deprecatedNode = (_b = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _b !== void 0 ? _b : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); errorOrSuggestion(/* isError */ false, deprecatedNode, ts.Diagnostics._0_is_deprecated, propName); } if (accessExpression) { @@ -55742,13 +54260,10 @@ var ts; } } errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, 1 /* Number */)); - return mapType(objectType, function (t) { - var restType = getRestTypeOfTupleType(t) || undefinedType; - return noUncheckedIndexedAccessCandidate ? getUnionType([restType, undefinedType]) : restType; - }); + return mapType(objectType, function (t) { return getRestTypeOfTupleType(t) || undefinedType; }); } } - if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) { + if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) { if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) { return objectType; } @@ -55764,10 +54279,10 @@ var ts; if (accessNode && !isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) { var indexNode = getIndexNodeForAccessExpression(accessNode); error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); - return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + return indexInfo.type; } errorIfWritingToReadonlyIndex(indexInfo); - return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + return indexInfo.type; } if (indexType.flags & 131072 /* Never */) { return neverType; @@ -55851,17 +54366,11 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 189 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 158 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 188 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 157 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } - function isPatternLiteralPlaceholderType(type) { - return templateConstraintType.types.indexOf(type) !== -1 || !!(type.flags & 1 /* Any */); - } - function isPatternLiteralType(type) { - return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType); - } function isGenericObjectType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { if (!(type.objectFlags & 4194304 /* IsGenericObjectTypeComputed */)) { @@ -55880,7 +54389,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) && !isPatternLiteralType(type); + return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -55933,7 +54442,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 465829888 /* Instantiable */)) { + if (!(indexType.flags & 63176704 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -55996,9 +54505,8 @@ var ts; var templateMapper = combineTypeMappers(objectType.mapper, mapper); return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); } - function getIndexedAccessType(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, aliasSymbol, aliasTypeArguments, accessFlags) { - if (accessFlags === void 0) { accessFlags = 0 /* None */; } - return getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType); + function getIndexedAccessType(objectType, indexType, accessNode, aliasSymbol, aliasTypeArguments) { + return getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, 0 /* None */, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType); } function indexTypeLessThan(indexType, limit) { return everyType(indexType, function (t) { @@ -56012,14 +54520,11 @@ var ts; return false; }); } - function getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) { + function getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) { if (accessFlags === void 0) { accessFlags = 0 /* None */; } if (objectType === wildcardType || indexType === wildcardType) { return wildcardType; } - var shouldIncludeUndefined = noUncheckedIndexedAccessCandidate || - (!!compilerOptions.noUncheckedIndexedAccess && - (accessFlags & (2 /* Writing */ | 16 /* ExpressionPosition */)) === 16 /* ExpressionPosition */); // If the object type has a string index signature and no other members we know that the result will // always be the type of that index signature and we can simplify accordingly. if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) { @@ -56031,17 +54536,17 @@ var ts; // for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in an expression. This is to // preserve backwards compatibility. For example, an element access 'this["foo"]' has always been resolved // eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 189 /* IndexedAccessType */ ? + if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 188 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } // Defer the operation by creating an indexed access type. - var id = objectType.id + "," + indexType.id + (shouldIncludeUndefined ? "?" : ""); + var id = objectType.id + "," + indexType.id; var type = indexedAccessTypes.get(id); if (!type) { - indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined)); + indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments)); } return type; } @@ -56054,7 +54559,7 @@ var ts; var wasMissingProp = false; for (var _i = 0, _a = indexType.types; _i < _a.length; _i++) { var t = _a[_i]; - var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags, shouldIncludeUndefined); + var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags); if (propType) { propTypes.push(propType); } @@ -56070,11 +54575,9 @@ var ts; if (wasMissingProp) { return undefined; } - return accessFlags & 2 /* Writing */ - ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) - : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments); + return accessFlags & 2 /* Writing */ ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments); } - return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, /* supressNoImplicitAnyError */ false, accessNode, accessFlags | 4 /* CacheSymbol */, shouldIncludeUndefined, /* reportDeprecated */ true); + return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, /* supressNoImplicitAnyError */ false, accessNode, accessFlags | 4 /* CacheSymbol */, /* reportDeprecated */ true); } function getTypeFromIndexedAccessTypeNode(node) { var links = getNodeLinks(node); @@ -56082,7 +54585,7 @@ var ts; var objectType = getTypeFromTypeNode(node.objectType); var indexType = getTypeFromTypeNode(node.indexType); var potentialAlias = getAliasSymbolForTypeNode(node); - var resolved = getIndexedAccessType(objectType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); + var resolved = getIndexedAccessType(objectType, indexType, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); links.resolvedType = resolved.flags & 8388608 /* IndexedAccess */ && resolved.objectType === objectType && resolved.indexType === indexType ? @@ -56117,7 +54620,7 @@ var ts; function getConditionalType(root, mapper) { var result; var extraTypes; - var _loop_15 = function () { + var _loop_14 = function () { var checkType = instantiateType(root.checkType, mapper); var checkTypeInstantiable = isGenericObjectType(checkType) || isGenericIndexType(checkType); var extendsType = instantiateType(root.extendsType, mapper); @@ -56150,11 +54653,11 @@ var ts; if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) { // Return union of trueType and falseType for 'any' since it matches anything if (checkType.flags & 1 /* Any */) { - (extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper)); + (extraTypes || (extraTypes = [])).push(instantiateTypeWithoutDepthIncrease(root.trueType, combinedMapper || mapper)); } // If falseType is an immediately nested conditional type that isn't distributive or has an // identical checkType, switch to that type and loop. - var falseType_1 = getTypeFromTypeNode(root.node.falseType); + var falseType_1 = root.falseType; if (falseType_1.flags & 16777216 /* Conditional */) { var newRoot = falseType_1.root; if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) { @@ -56162,7 +54665,7 @@ var ts; return "continue"; } } - result = instantiateType(falseType_1, mapper); + result = instantiateTypeWithoutDepthIncrease(falseType_1, mapper); return "break"; } // Return trueType for a definitely true extends check. We check instantiations of the two @@ -56171,7 +54674,7 @@ var ts; // type Foo = T extends { x: string } ? string : number // doesn't immediately resolve to 'string' instead of being deferred. if (inferredExtendsType.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) { - result = instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper); + result = instantiateTypeWithoutDepthIncrease(root.trueType, combinedMapper || mapper); return "break"; } } @@ -56191,7 +54694,7 @@ var ts; // types of the form 'A extends B ? X : C extends D ? Y : E extends F ? Z : ...' as a single construct for // purposes of resolution. This means such types aren't subject to the instatiation depth limiter. while (true) { - var state_4 = _loop_15(); + var state_4 = _loop_14(); if (typeof state_4 === "object") return state_4.value; if (state_4 === "break") @@ -56200,13 +54703,13 @@ var ts; return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result; } function getTrueTypeFromConditionalType(type) { - return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.mapper)); + return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(type.root.trueType, type.mapper)); } function getFalseTypeFromConditionalType(type) { - return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(getTypeFromTypeNode(type.root.node.falseType), type.mapper)); + return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(type.root.falseType, type.mapper)); } function getInferredTrueTypeFromConditionalType(type) { - return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.combinedMapper) : getTrueTypeFromConditionalType(type)); + return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(type.root.trueType, type.combinedMapper) : getTrueTypeFromConditionalType(type)); } function getInferTypeParameters(node) { var result; @@ -56231,6 +54734,8 @@ var ts; node: node, checkType: checkType, extendsType: getTypeFromTypeNode(node.extendsType), + trueType: getTypeFromTypeNode(node.trueType), + falseType: getTypeFromTypeNode(node.falseType), isDistributive: !!(checkType.flags & 262144 /* TypeParameter */), inferTypeParameters: getInferTypeParameters(node), outerTypeParameters: outerTypeParameters, @@ -56288,13 +54793,7 @@ var ts; var current = void 0; while (current = nameStack.shift()) { var meaning = nameStack.length ? 1920 /* Namespace */ : targetMeaning; - // typeof a.b.c is normally resolved using `checkExpression` which in turn defers to `checkQualifiedName` - // That, in turn, ultimately uses `getPropertyOfType` on the type of the symbol, which differs slightly from - // the `exports` lookup process that only looks up namespace members which is used for most type references - var mergedResolvedSymbol = getMergedSymbol(resolveSymbol(currentNamespace)); - var next = node.isTypeOf - ? getPropertyOfType(getTypeOfSymbol(mergedResolvedSymbol), current.escapedText) - : getSymbol(getExportsOfSymbol(mergedResolvedSymbol), current.escapedText, meaning); + var next = getSymbol(getExportsOfSymbol(getMergedSymbol(resolveSymbol(currentNamespace))), current.escapedText, meaning); if (!next) { error(current, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), ts.declarationNameToString(current)); return links.resolvedType = errorType; @@ -56353,7 +54852,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isJSDocTypeExpression(host) || ts.isTypeOperatorNode(host) && host.operator === 142 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 141 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -56365,7 +54864,12 @@ var ts; return !!(type.flags & 524288 /* Object */) && !isGenericMappedType(type); } function isEmptyObjectTypeOrSpreadsIntoEmptyObject(type) { - return isEmptyObjectType(type) || !!(type.flags & (65536 /* Null */ | 32768 /* Undefined */ | 528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)); + return isEmptyObjectType(type) || !!(type.flags & (65536 /* Null */ | 32768 /* Undefined */ | 528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)); + } + function isSinglePropertyAnonymousObjectType(type) { + return !!(type.flags & 524288 /* Object */) && + !!(ts.getObjectFlags(type) & 16 /* Anonymous */) && + (ts.length(getPropertiesOfType(type)) === 1 || ts.every(getPropertiesOfType(type), function (p) { return !!(p.flags & 16777216 /* Optional */); })); } function tryMergeUnionOfObjectTypeAndEmptyObject(type, readonly) { if (type.types.length === 2) { @@ -56374,10 +54878,10 @@ var ts; if (ts.every(type.types, isEmptyObjectTypeOrSpreadsIntoEmptyObject)) { return isEmptyObjectType(firstType) ? firstType : isEmptyObjectType(secondType) ? secondType : emptyObjectType; } - if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(firstType)) { + if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(firstType) && isSinglePropertyAnonymousObjectType(secondType)) { return getAnonymousPartialType(secondType); } - if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(secondType)) { + if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(secondType) && isSinglePropertyAnonymousObjectType(firstType)) { return getAnonymousPartialType(firstType); } } @@ -56428,20 +54932,16 @@ var ts; if (merged) { return getSpreadType(merged, right, symbol, objectFlags, readonly); } - return checkCrossProductUnion([left, right]) - ? mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }) - : errorType; + return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }); } if (right.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); if (merged) { return getSpreadType(left, merged, symbol, objectFlags, readonly); } - return checkCrossProductUnion([left, right]) - ? mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }) - : errorType; + return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }); } - if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { + if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { return left; } if (isGenericObjectType(left) || isGenericObjectType(right)) { @@ -56602,7 +55102,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 253 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 250 /* InterfaceDeclaration */)) { if (!ts.hasSyntacticModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -56637,17 +55137,17 @@ var ts; } function getArrayElementTypeNode(node) { switch (node.kind) { - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return getArrayElementTypeNode(node.type); - case 179 /* TupleType */: + case 178 /* TupleType */: if (node.elements.length === 1) { node = node.elements[0]; - if (node.kind === 181 /* RestType */ || node.kind === 192 /* NamedTupleMember */ && node.dotDotDotToken) { + if (node.kind === 180 /* RestType */ || node.kind === 191 /* NamedTupleMember */ && node.dotDotDotToken) { return getArrayElementTypeNode(node.type); } } break; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return node.elementType; } return undefined; @@ -56665,98 +55165,94 @@ var ts; function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 128 /* AnyKeyword */: - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: return anyType; - case 152 /* UnknownKeyword */: + case 151 /* UnknownKeyword */: return unknownType; - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: return stringType; - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: return numberType; - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: return bigintType; case 131 /* BooleanKeyword */: return booleanType; - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: return esSymbolType; case 113 /* VoidKeyword */: return voidType; - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: return undefinedType; case 103 /* NullKeyword */: // TODO(rbuckton): `NullKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service. return nullType; - case 141 /* NeverKeyword */: + case 140 /* NeverKeyword */: return neverType; - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 136 /* IntrinsicKeyword */: - return intrinsicMarkerType; - case 187 /* ThisType */: + case 186 /* ThisType */: case 107 /* ThisKeyword */: // TODO(rbuckton): `ThisKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service and because of `isPartOfTypeNode`. return getTypeFromThisTypeNode(node); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return getTypeFromTypeReference(node); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 182 /* UnionType */: + case 181 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return getTypeFromNamedTupleTypeNode(node); - case 186 /* ParenthesizedType */: - case 306 /* JSDocNonNullableType */: - case 301 /* JSDocTypeExpression */: + case 185 /* ParenthesizedType */: + case 302 /* JSDocNonNullableType */: + case 298 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 181 /* RestType */: + case 180 /* RestType */: return getTypeFromRestTypeNode(node); - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 308 /* JSDocFunctionType */: - case 313 /* JSDocSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 304 /* JSDocFunctionType */: + case 309 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 185 /* InferType */: + case 184 /* InferType */: return getTypeFromInferTypeNode(node); - case 193 /* TemplateLiteralType */: - return getTypeFromTemplateTypeNode(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier, qualified name, or property access expression is a type expression // Callers should first ensure this by calling `isPartOfTypeNode` // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 78 /* Identifier */: - case 157 /* QualifiedName */: - case 201 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -56910,10 +55406,9 @@ var ts; return result; } function getObjectTypeInstantiation(type, mapper) { + var target = type.objectFlags & 64 /* Instantiated */ ? type.target : type; var declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.symbol.declarations[0]; var links = getNodeLinks(declaration); - var target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : - type.objectFlags & 64 /* Instantiated */ ? type.target : type; var typeParameters = links.outerTypeParameters; if (!typeParameters) { // The first time an anonymous type is instantiated we compute and store a list of the type @@ -56930,6 +55425,10 @@ var ts; ts.filter(typeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration); }) : typeParameters; links.outerTypeParameters = typeParameters; + if (typeParameters.length) { + links.instantiations = new ts.Map(); + links.instantiations.set(getTypeListId(typeParameters), target); + } } if (typeParameters.length) { // We are instantiating an anonymous type that has one or more type parameters in scope. Apply the @@ -56938,26 +55437,22 @@ var ts; var combinedMapper_1 = combineTypeMappers(type.mapper, mapper); var typeArguments = ts.map(typeParameters, function (t) { return getMappedType(t, combinedMapper_1); }); var id = getTypeListId(typeArguments); - if (!target.instantiations) { - target.instantiations = new ts.Map(); - target.instantiations.set(getTypeListId(typeParameters), target); - } - var result = target.instantiations.get(id); + var result = links.instantiations.get(id); if (!result) { var newMapper = createTypeMapper(typeParameters, typeArguments); result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper) : instantiateAnonymousType(target, newMapper); - target.instantiations.set(id, result); + links.instantiations.set(id, result); } return result; } return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 157 /* QualifiedName */ || - node.parent.kind === 173 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 195 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 156 /* QualifiedName */ || + node.parent.kind === 172 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 192 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -56966,7 +55461,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 230 /* Block */ || n.kind === 184 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 227 /* Block */ || n.kind === 183 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -56975,12 +55470,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 187 /* ThisType */: + case 186 /* ThisType */: return !!tp.isThisType; case 78 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -57013,18 +55508,13 @@ var ts; if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { - if (!type.declaration.nameType) { - if (isArrayType(t)) { - return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper)); - } - if (isGenericTupleType(t)) { - return instantiateMappedGenericTupleType(t, type, typeVariable, mapper); - } - if (isTupleType(t)) { - return instantiateMappedTupleType(t, type, prependTypeMapping(typeVariable, t, mapper)); - } + if (isGenericTupleType(t)) { + return instantiateMappedGenericTupleType(t, type, typeVariable, mapper); } - return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper)); + var replacementMapper = prependTypeMapping(typeVariable, t, mapper); + return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : + isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : + instantiateAnonymousType(type, replacementMapper); } return t; }); @@ -57133,7 +55623,6 @@ var ts; // We have reached 50 recursive type instantiations and there is a very high likelyhood we're dealing // with a combination of infinite generic types that perpetually generate new type identities. We stop // the recursion here by yielding the error type. - ts.tracing.instant("check" /* Check */, "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth: instantiationDepth, instantiationCount: instantiationCount }); error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); return errorType; } @@ -57144,6 +55633,16 @@ var ts; instantiationDepth--; return result; } + /** + * This can be used to avoid the penalty on instantiation depth for types which result from immediate + * simplification. It essentially removes the depth increase done in `instantiateType`. + */ + function instantiateTypeWithoutDepthIncrease(type, mapper) { + instantiationDepth--; + var result = instantiateType(type, mapper); + instantiationDepth++; + return result; + } function instantiateTypeWorker(type, mapper) { var flags = type.flags; if (flags & 262144 /* TypeParameter */) { @@ -57172,14 +55671,8 @@ var ts; if (flags & 4194304 /* Index */) { return getIndexType(instantiateType(type.type, mapper)); } - if (flags & 134217728 /* TemplateLiteral */) { - return getTemplateLiteralType(type.texts, instantiateTypes(type.types, mapper)); - } - if (flags & 268435456 /* StringMapping */) { - return getStringMappingType(type.symbol, instantiateType(type.type, mapper)); - } if (flags & 8388608 /* IndexedAccess */) { - return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), type.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), /*accessNode*/ undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); } if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); @@ -57225,35 +55718,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 280 /* JsxAttribute */: { + case 277 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 283 /* JsxExpression */: { + case 280 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g

) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -57272,7 +55765,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 209 /* ArrowFunction */) { + if (node.kind !== 206 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -57285,7 +55778,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 230 /* Block */ && isContextSensitive(node.body); + return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 227 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -57341,7 +55834,7 @@ var ts; source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : - hasBaseType(source, getTargetType(target)) || (isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType)); + hasBaseType(source, getTargetType(target)); } /** * This is *not* a bi-directional relationship. @@ -57388,23 +55881,23 @@ var ts; return true; } switch (node.kind) { - case 283 /* JsxExpression */: - case 207 /* ParenthesizedExpression */: + case 280 /* JsxExpression */: + case 204 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -57604,7 +56097,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -57613,15 +56106,18 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: return ts.Debug.assertNever(child, "Found invalid jsx child"); } } + function getSemanticJsxChildren(children) { + return ts.filter(children, function (i) { return !ts.isJsxText(i) || !i.containsOnlyTriviaWhiteSpaces; }); + } function elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer) { var result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer); var invalidTextDiagnostic; @@ -57631,7 +56127,7 @@ var ts; var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName); var childrenNameType = getLiteralType(childrenPropName); var childrenTargetType = getIndexedAccessType(target, childrenNameType); - var validChildren = ts.getSemanticJsxChildren(containingElement.children); + var validChildren = getSemanticJsxChildren(containingElement.children); if (!ts.length(validChildren)) { return result; } @@ -57763,11 +56259,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 168 /* SetAccessor */: return [3 /*break*/, 2]; - case 167 /* GetAccessor */: return [3 /*break*/, 2]; - case 165 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 289 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 288 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 167 /* SetAccessor */: return [3 /*break*/, 2]; + case 166 /* GetAccessor */: return [3 /*break*/, 2]; + case 164 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 286 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 285 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -57844,8 +56340,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 165 /* MethodDeclaration */ && - kind !== 164 /* MethodSignature */ && kind !== 166 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 164 /* MethodDeclaration */ && + kind !== 163 /* MethodSignature */ && kind !== 165 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -57866,36 +56362,34 @@ var ts; var paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount); var restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1; for (var i = 0; i < paramCount; i++) { - var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i); - var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i); - if (sourceType && targetType) { - // In order to ensure that any generic type Foo is at least co-variant with respect to T no matter - // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions, - // they naturally relate only contra-variantly). However, if the source and target parameters both have - // function types with a single call signature, we know we are relating two callback parameters. In - // that case it is sufficient to only relate the parameters of the signatures co-variantly because, - // similar to return values, callback parameters are output positions. This means that a Promise, - // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) - // with respect to T. - var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); - var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType)); - var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && - (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */); - var related = callbacks ? - compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : - !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); - // With strict arity, (x: number | undefined) => void is a subtype of (x?: number | undefined) => void - if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, /*reportErrors*/ false)) { - related = 0 /* False */; - } - if (!related) { - if (reportErrors) { - errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), ts.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); - } - return 0 /* False */; - } - result &= related; + var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : getTypeAtPosition(source, i); + var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : getTypeAtPosition(target, i); + // In order to ensure that any generic type Foo is at least co-variant with respect to T no matter + // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions, + // they naturally relate only contra-variantly). However, if the source and target parameters both have + // function types with a single call signature, we know we are relating two callback parameters. In + // that case it is sufficient to only relate the parameters of the signatures co-variantly because, + // similar to return values, callback parameters are output positions. This means that a Promise, + // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) + // with respect to T. + var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); + var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType)); + var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && + (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */); + var related = callbacks ? + compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : + !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); + // With strict arity, (x: number | undefined) => void is a subtype of (x?: number | undefined) => void + if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, /*reportErrors*/ false)) { + related = 0 /* False */; } + if (!related) { + if (reportErrors) { + errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), ts.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); + } + return 0 /* False */; + } + result &= related; } if (!(checkMode & 4 /* IgnoreReturnTypes */)) { // If a signature resolution is already in-flight, skip issuing a circularity error @@ -58038,7 +56532,7 @@ var ts; return true; if (t & 131072 /* Never */) return false; - if (s & 402653316 /* StringLike */ && t & 4 /* String */) + if (s & 132 /* StringLike */ && t & 4 /* String */) return true; if (s & 128 /* StringLiteral */ && s & 1024 /* EnumLiteral */ && t & 128 /* StringLiteral */ && !(t & 1024 /* EnumLiteral */) && @@ -58100,7 +56594,7 @@ var ts; } else { if (!(source.flags & 3145728 /* UnionOrIntersection */) && !(target.flags & 3145728 /* UnionOrIntersection */) && - source.flags !== target.flags && !(source.flags & 469237760 /* Substructure */)) + source.flags !== target.flags && !(source.flags & 66584576 /* Substructure */)) return false; } if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) { @@ -58109,7 +56603,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) { + if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -58162,7 +56656,6 @@ var ts; reportIncompatibleStack(); } if (overflow) { - ts.tracing.instant("check" /* Check */, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: depth }); var diag = error(errorNode || currentNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); if (errorOutputContainer) { (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); @@ -58537,7 +57030,7 @@ var ts; // breaking the intersection apart. result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); } - if (!result && (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -58635,7 +57128,7 @@ var ts; } function isIdenticalTo(source, target) { var flags = source.flags & target.flags; - if (!(flags & 469237760 /* Substructure */)) { + if (!(flags & 66584576 /* Substructure */)) { return 0 /* False */; } if (flags & 3145728 /* UnionOrIntersection */) { @@ -58671,7 +57164,7 @@ var ts; reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target); checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget]; } - var _loop_16 = function (prop) { + var _loop_15 = function (prop) { if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) { if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) { if (reportErrors) { @@ -58734,7 +57227,7 @@ var ts; }; for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; - var state_5 = _loop_16(prop); + var state_5 = _loop_15(prop); if (typeof state_5 === "object") return state_5.value; } @@ -58920,7 +57413,7 @@ var ts; for (var i = 0; i < maybeCount; i++) { // If source and target are already being compared, consider them related with assumptions if (id === maybeKeys[i]) { - return 3 /* Maybe */; + return 1 /* Maybe */; } } if (depth === 100) { @@ -58948,16 +57441,7 @@ var ts; return originalHandler(onlyUnreliable); }; } - if (expandingFlags === 3 /* Both */) { - ts.tracing.instant("check" /* Check */, "recursiveTypeRelatedTo_DepthLimit", { - sourceId: source.id, - sourceIdStack: sourceStack.map(function (t) { return t.id; }), - targetId: target.id, - targetIdStack: targetStack.map(function (t) { return t.id; }), - depth: depth, - }); - } - var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3 /* Maybe */; + var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 1 /* Maybe */; if (outofbandVarianceMarkerHandler) { outofbandVarianceMarkerHandler = originalHandler; } @@ -58965,12 +57449,9 @@ var ts; depth--; if (result) { if (result === -1 /* True */ || depth === 0) { - if (result === -1 /* True */ || result === 3 /* Maybe */) { - // If result is definitely true, record all maybe keys as having succeeded. Also, record Ternary.Maybe - // results as having succeeded once we reach depth 0, but never record Ternary.Unknown results. - for (var i = maybeStart; i < maybeCount; i++) { - relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags); - } + // If result is definitely true, record all maybe keys as having succeeded + for (var i = maybeStart; i < maybeCount; i++) { + relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags); } maybeCount = maybeStart; } @@ -58984,12 +57465,6 @@ var ts; return result; } function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) { - ts.tracing.push("check" /* Check */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id }); - var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState); - ts.tracing.pop(); - return result; - } - function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) { if (intersectionState & 4 /* PropertyCheck */) { return propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */); } @@ -59036,7 +57511,7 @@ var ts; !(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) { var variances = getAliasVariances(source.aliasSymbol); if (variances === ts.emptyArray) { - return 1 /* Unknown */; + return 1 /* Maybe */; } var varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances, intersectionState); if (varianceResult !== undefined) { @@ -59051,7 +57526,7 @@ var ts; } if (target.flags & 262144 /* TypeParameter */) { // A source type { [P in Q]: X } is related to a target type T if keyof T is related to Q and X is related to T[Q]. - if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) { + if (ts.getObjectFlags(source) & 32 /* Mapped */ && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) { if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) { var templateType = getTemplateTypeFromMappedType(source); var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); @@ -59101,14 +57576,14 @@ var ts; var baseIndexType = getBaseConstraintOfType(indexType) || indexType; if (!isGenericObjectType(baseObjectType) && !isGenericIndexType(baseIndexType)) { var accessFlags = 2 /* Writing */ | (baseObjectType !== objectType ? 1 /* NoIndexSignatures */ : 0); - var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, target.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, accessFlags); + var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, /*accessNode*/ undefined, accessFlags); if (constraint && (result = isRelatedTo(source, constraint, reportErrors))) { return result; } } } } - else if (isGenericMappedType(target) && !target.declaration.nameType) { + else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); var modifiers = getMappedTypeModifiers(target); @@ -59150,15 +57625,6 @@ var ts; } } } - else if (target.flags & 134217728 /* TemplateLiteral */ && source.flags & 128 /* StringLiteral */) { - if (isPatternLiteralType(target)) { - // match all non-`string` segments - var result_8 = inferLiteralsFromTemplateLiteralType(source, target); - if (result_8 && ts.every(result_8, function (r, i) { return isStringLiteralTypeValueParsableAsType(r, target.types[i]); })) { - return -1 /* True */; - } - } - } if (source.flags & 8650752 /* TypeVariable */) { if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) { // A type S[K] is related to a type T[J] if S is related to T and K is related to J. @@ -59197,35 +57663,6 @@ var ts; return result; } } - else if (source.flags & 134217728 /* TemplateLiteral */) { - if (target.flags & 134217728 /* TemplateLiteral */ && - source.texts.length === target.texts.length && - source.types.length === target.types.length && - ts.every(source.texts, function (t, i) { return t === target.texts[i]; }) && - ts.every(instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)).types, function (t, i) { return !!(target.types[i].flags & (1 /* Any */ | 4 /* String */)) || !!isRelatedTo(t, target.types[i], /*reportErrors*/ false); })) { - return -1 /* True */; - } - var constraint = getBaseConstraintOfType(source); - if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, reportErrors))) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - else if (source.flags & 268435456 /* StringMapping */) { - if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) { - if (result = isRelatedTo(source.type, target.type, reportErrors)) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - else { - var constraint = getBaseConstraintOfType(source); - if (constraint && (result = isRelatedTo(constraint, target, reportErrors))) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - } else if (source.flags & 16777216 /* Conditional */) { if (target.flags & 16777216 /* Conditional */) { // Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if @@ -59304,7 +57741,7 @@ var ts; // effectively means we measure variance only from type parameter occurrences that aren't nested in // recursive instantiations of the generic type. if (variances === ts.emptyArray) { - return 1 /* Unknown */; + return 1 /* Maybe */; } var varianceResult = relateVariances(getTypeArguments(source), getTypeArguments(target), variances, intersectionState); if (varianceResult !== undefined) { @@ -59361,9 +57798,9 @@ var ts; if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) { var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */); if (objectOnlyTarget.flags & 1048576 /* Union */) { - var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget); - if (result_9) { - return result_9; + var result_8 = typeRelatedToDiscriminatedType(source, objectOnlyTarget); + if (result_8) { + return result_8; } } } @@ -59430,14 +57867,12 @@ var ts; var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { - var result_10; + var result_9; var targetConstraint = getConstraintTypeFromMappedType(target); var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers)); - if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { + if (result_9 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); - if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) { - return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); - } + return result_9 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); } } return 0 /* False */; @@ -59467,7 +57902,6 @@ var ts; numCombinations *= countTypes(getTypeOfSymbol(sourceProperty)); if (numCombinations > 25) { // We've reached the complexity limit. - ts.tracing.instant("check" /* Check */, "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source.id, targetId: target.id, numCombinations: numCombinations }); return 0 /* False */; } } @@ -59486,11 +57920,11 @@ var ts; // constituents of 'target'. If any combination does not have a match then 'source' is not relatable. var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes); var matchingTypes = []; - var _loop_17 = function (combination) { + var _loop_16 = function (combination) { var hasMatch = false; outer: for (var _i = 0, _a = target.types; _i < _a.length; _i++) { var type = _a[_i]; - var _loop_18 = function (i) { + var _loop_17 = function (i) { var sourceProperty = sourcePropertiesFiltered[i]; var targetProperty = getPropertyOfType(type, sourceProperty.escapedName); if (!targetProperty) @@ -59506,7 +57940,7 @@ var ts; } }; for (var i = 0; i < sourcePropertiesFiltered.length; i++) { - var state_7 = _loop_18(i); + var state_7 = _loop_17(i); switch (state_7) { case "continue-outer": continue outer; } @@ -59520,7 +57954,7 @@ var ts; }; for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) { var combination = discriminantCombinations_1[_a]; - var state_6 = _loop_17(combination); + var state_6 = _loop_16(combination); if (typeof state_6 === "object") return state_6.value; } @@ -59576,7 +58010,7 @@ var ts; ts.Debug.assertIsDefined(links.deferralParent); ts.Debug.assertIsDefined(links.deferralConstituents); var unionParent = !!(links.deferralParent.flags & 1048576 /* Union */); - var result_11 = unionParent ? 0 /* False */ : -1 /* True */; + var result_10 = unionParent ? 0 /* False */ : -1 /* True */; var targetTypes = links.deferralConstituents; for (var _i = 0, targetTypes_3 = targetTypes; _i < targetTypes_3.length; _i++) { var targetType = targetTypes_3[_i]; @@ -59586,7 +58020,7 @@ var ts; // Can't assign to a target individually - have to fallback to assigning to the _whole_ intersection (which forces normalization) return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors); } - result_11 &= related; + result_10 &= related; } else { if (related) { @@ -59594,17 +58028,17 @@ var ts; } } } - if (unionParent && !result_11 && targetIsOptional) { - result_11 = isRelatedTo(source, undefinedType); + if (unionParent && !result_10 && targetIsOptional) { + result_10 = isRelatedTo(source, undefinedType); } - if (unionParent && !result_11 && reportErrors) { + if (unionParent && !result_10 && reportErrors) { // The easiest way to get the right errors here is to un-defer (which may be costly) // If it turns out this is too costly too often, we can replicate the error handling logic within // typeRelatedToSomeType without the discriminatable type branch (as that requires a manifest union // type on which to hand discriminable properties, which we are expressly trying to avoid here) return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors); } - return result_11; + return result_10; } else { return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors, /*headMessage*/ undefined, intersectionState); @@ -59864,7 +58298,6 @@ var ts; return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { - var _a, _b; if (relation === identityRelation) { return signaturesIdenticalTo(source, target, kind); } @@ -59895,9 +58328,7 @@ var ts; var result = -1 /* True */; var saveErrorInfo = captureErrorCalculationState(); var incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn; - var sourceObjectFlags = ts.getObjectFlags(source); - var targetObjectFlags = ts.getObjectFlags(target); - if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source.symbol === target.symbol) { + if (ts.getObjectFlags(source) & 64 /* Instantiated */ && ts.getObjectFlags(target) & 64 /* Instantiated */ && source.symbol === target.symbol) { // We have instantiations of the same anonymous type (which typically will be the type of a // method). Simply do a pairwise comparison of the signatures in the two signature lists instead // of the much more expensive N * M comparison matrix we explore below. We erase type parameters @@ -59917,26 +58348,15 @@ var ts; // this regardless of the number of signatures, but the potential costs are prohibitive due // to the quadratic nature of the logic below. var eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; - var sourceSignature = ts.first(sourceSignatures); - var targetSignature = ts.first(targetSignatures); - result = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors, incompatibleReporter(sourceSignature, targetSignature)); - if (!result && reportErrors && kind === 1 /* Construct */ && (sourceObjectFlags & targetObjectFlags) && - (((_a = targetSignature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 166 /* Constructor */ || ((_b = sourceSignature.declaration) === null || _b === void 0 ? void 0 : _b.kind) === 166 /* Constructor */)) { - var constructSignatureToString = function (signature) { - return signatureToString(signature, /*enclosingDeclaration*/ undefined, 262144 /* WriteArrowStyleSignature */, kind); - }; - reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature)); - reportError(ts.Diagnostics.Types_of_construct_signatures_are_incompatible); - return result; - } + result = signatureRelatedTo(sourceSignatures[0], targetSignatures[0], eraseGenerics, reportErrors, incompatibleReporter(sourceSignatures[0], targetSignatures[0])); } else { outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) { var t = targetSignatures_1[_i]; // Only elaborate errors from the first failure var shouldElaborateErrors = reportErrors; - for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) { - var s = sourceSignatures_1[_c]; + for (var _a = 0, sourceSignatures_1 = sourceSignatures; _a < sourceSignatures_1.length; _a++) { + var s = sourceSignatures_1[_a]; var related = signatureRelatedTo(s, t, /*erase*/ true, shouldElaborateErrors, incompatibleReporter(s, t)); if (related) { result &= related; @@ -60100,13 +58520,13 @@ var ts; if (type.flags & 3145728 /* UnionOrIntersection */) { return !!ts.forEach(type.types, typeCouldHaveTopLevelSingletonTypes); } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getConstraintOfType(type); - if (constraint && constraint !== type) { + if (constraint) { return typeCouldHaveTopLevelSingletonTypes(constraint); } } - return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */); + return isUnitType(type); } function getBestMatchingType(source, target, isRelatedTo) { if (isRelatedTo === void 0) { isRelatedTo = compareTypesAssignable; } @@ -60140,18 +58560,8 @@ var ts; } } var match = discriminable.indexOf(/*searchElement*/ true); - if (match === -1) { - return defaultValue; - } // make sure exactly 1 matches before returning it - var nextMatch = discriminable.indexOf(/*searchElement*/ true, match + 1); - while (nextMatch !== -1) { - if (!isTypeIdenticalTo(target.types[match], target.types[nextMatch])) { - return defaultValue; - } - nextMatch = discriminable.indexOf(/*searchElement*/ true, nextMatch + 1); - } - return target.types[match]; + return match === -1 || discriminable.indexOf(/*searchElement*/ true, match + 1) !== -1 ? defaultValue : target.types[match]; } /** * A type is 'weak' if it is an object type with at least one optional property @@ -60200,15 +58610,13 @@ var ts; // instantiations of the generic type for type arguments with known relations. The function // returns the emptyArray singleton when invoked recursively for the given generic type. function getVariancesWorker(typeParameters, cache, createMarkerType) { - var _a, _b, _c; if (typeParameters === void 0) { typeParameters = ts.emptyArray; } var variances = cache.variances; if (!variances) { - ts.tracing.push("check" /* Check */, "getVariancesWorker", { arity: typeParameters.length, id: (_c = (_a = cache.id) !== null && _a !== void 0 ? _a : (_b = cache.declaredType) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : -1 }); // The emptyArray singleton is used to signal a recursive invocation. cache.variances = ts.emptyArray; variances = []; - var _loop_19 = function (tp) { + var _loop_18 = function (tp) { var unmeasurable = false; var unreliable = false; var oldHandler = outofbandVarianceMarkerHandler; @@ -60240,10 +58648,9 @@ var ts; }; for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) { var tp = typeParameters_1[_i]; - _loop_19(tp); + _loop_18(tp); } cache.variances = variances; - ts.tracing.pop(); } return variances; } @@ -60374,54 +58781,58 @@ var ts; // has expanded into `[A>>>>>]` // in such cases we need to terminate the expansion, and we do so here. function isDeeplyNestedType(type, stack, depth) { - if (depth >= 5) { - var identity_1 = getRecursionIdentity(type); - if (identity_1) { - var count = 0; - for (var i = 0; i < depth; i++) { - if (getRecursionIdentity(stack[i]) === identity_1) { - count++; - if (count >= 5) { - return true; + // We track all object types that have an associated symbol (representing the origin of the type) + if (depth >= 5 && type.flags & 524288 /* Object */) { + if (!isObjectOrArrayLiteralType(type)) { + var symbol = type.symbol; + if (symbol) { + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 524288 /* Object */ && t.symbol === symbol) { + count++; + if (count >= 5) + return true; } } } } + if (ts.getObjectFlags(type) && 4 /* Reference */ && !!type.node) { + var root = type.target; + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (ts.getObjectFlags(t) && 4 /* Reference */ && !!t.node && t.target === root) { + count++; + if (count >= 5) + return true; + } + } + } + } + if (depth >= 5 && type.flags & 8388608 /* IndexedAccess */) { + var root = getRootObjectTypeFromIndexedAccessChain(type); + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (getRootObjectTypeFromIndexedAccessChain(t) === root) { + count++; + if (count >= 5) + return true; + } + } } return false; } - // Types with constituents that could circularly reference the type have a recursion identity. The recursion - // identity is some object that is common to instantiations of the type with the same origin. - function getRecursionIdentity(type) { - if (type.flags & 524288 /* Object */ && !isObjectOrArrayLiteralType(type)) { - if (ts.getObjectFlags(type) && 4 /* Reference */ && type.node) { - // Deferred type references are tracked through their associated AST node. This gives us finer - // granularity than using their associated target because each manifest type reference has a - // unique AST node. - return type.node; - } - if (type.symbol && !(ts.getObjectFlags(type) & 16 /* Anonymous */ && type.symbol.flags & 32 /* Class */)) { - // We track all object types that have an associated symbol (representing the origin of the type), but - // exclude the static side of classes from this check since it shares its symbol with the instance side. - return type.symbol; - } - if (isTupleType(type)) { - // Tuple types are tracked through their target type - return type.target; - } + /** + * Gets the leftmost object type in a chain of indexed accesses, eg, in A[P][Q], returns A + */ + function getRootObjectTypeFromIndexedAccessChain(type) { + var t = type; + while (t.flags & 8388608 /* IndexedAccess */) { + t = t.objectType; } - if (type.flags & 8388608 /* IndexedAccess */) { - // Identity is the leftmost object type in a chain of indexed accesses, eg, in A[P][Q] it is A - do { - type = type.objectType; - } while (type.flags & 8388608 /* IndexedAccess */); - return type; - } - if (type.flags & 16777216 /* Conditional */) { - // The root object represents the origin of the conditional type - return type.root; - } - return undefined; + return t; } function isPropertyIdenticalTo(sourceProp, targetProp) { return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0 /* False */; @@ -60544,8 +58955,8 @@ var ts; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var t = types_13[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -60719,8 +59130,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var t = types_14[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var t = types_13[_i]; result |= getFalsyFlags(t); } return result; @@ -60750,7 +59161,7 @@ var ts; type.flags & 64 /* BigInt */ ? zeroBigIntType : type === regularFalseType || type === falseType || - type.flags & (16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */ | 3 /* AnyOrUnknown */) || + type.flags & (16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */) || type.flags & 128 /* StringLiteral */ && type.value === "" || type.flags & 256 /* NumberLiteral */ && type.value === 0 || type.flags & 2048 /* BigIntLiteral */ && isZeroBigInt(type) ? type : @@ -61053,12 +59464,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 216 /* BinaryExpression */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 213 /* BinaryExpression */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 160 /* Parameter */: + case 159 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -61073,23 +59484,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 3 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -61103,7 +59514,7 @@ var ts; wideningKind === 3 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 190 /* MappedType */: + case 189 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -61233,7 +59644,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 465829888 /* Instantiable */ || + var result = !!(type.flags & 63176704 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */)) || @@ -61245,15 +59656,16 @@ var ts; } function isNonGenericTopLevelType(type) { if (type.aliasSymbol && !type.aliasTypeArguments) { - var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 254 /* TypeAliasDeclaration */); - return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 297 /* SourceFile */ ? true : n.kind === 256 /* ModuleDeclaration */ ? false : "quit"; })); + var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 251 /* TypeAliasDeclaration */); + return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 294 /* SourceFile */ ? true : n.kind === 253 /* ModuleDeclaration */ ? false : "quit"; })); } return false; } function isTypeParameterAtTopLevel(type, typeParameter) { return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && ts.some(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }) || - type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); + type.flags & 16777216 /* Conditional */ && (isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type), typeParameter) || + isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type), typeParameter))); } /** Create an object with properties named in the string literal type. Every property has type `any` */ function createEmptyObjectTypeFromStringLiteral(type) { @@ -61300,8 +59712,7 @@ var ts; // arrow function, but is considered partially inferable because property 'a' has an inferable type. function isPartiallyInferableType(type) { return !(ts.getObjectFlags(type) & 2097152 /* NonInferrableType */) || - isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }) || - isTupleType(type) && ts.some(getTypeArguments(type), isPartiallyInferableType); + isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }); } function createReverseMappedType(source, target, constraint) { // We consider a source type reverse mappable if it has a string index signature or if @@ -61405,73 +59816,17 @@ var ts; function isFromInferenceBlockedSource(type) { return !!(type.symbol && ts.some(type.symbol.declarations, hasSkipDirectInferenceFlag)); } - function isValidBigIntString(s) { - var scanner = ts.createScanner(99 /* ESNext */, /*skipTrivia*/ false); - var success = true; - scanner.setOnError(function () { return success = false; }); - scanner.setText(s + "n"); - var result = scanner.scan(); - if (result === 40 /* MinusToken */) { - result = scanner.scan(); - } - var flags = scanner.getTokenFlags(); - // validate that - // * scanning proceeded without error - // * a bigint can be scanned, and that when it is scanned, it is - // * the full length of the input string (so the scanner is one character beyond the augmented input length) - // * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input) - return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === (s.length + 1) && !(flags & 512 /* ContainsSeparator */); - } - function isStringLiteralTypeValueParsableAsType(s, target) { - if (target.flags & 1048576 /* Union */) { - return !!forEachType(target, function (t) { return isStringLiteralTypeValueParsableAsType(s, t); }); - } - switch (target) { - case stringType: return true; - case numberType: return s.value !== "" && isFinite(+(s.value)); - case bigintType: return s.value !== "" && isValidBigIntString(s.value); - // the next 4 should be handled in `getTemplateLiteralType`, as they are all exactly one value, but are here for completeness, just in case - // this function is ever used on types which don't come from template literal holes - case trueType: return s.value === "true"; - case falseType: return s.value === "false"; - case undefinedType: return s.value === "undefined"; - case nullType: return s.value === "null"; - default: return !!(target.flags & 1 /* Any */); - } - } - function inferLiteralsFromTemplateLiteralType(source, target) { - var value = source.value; - var texts = target.texts; - var lastIndex = texts.length - 1; - var startText = texts[0]; - var endText = texts[lastIndex]; - if (!(value.startsWith(startText) && value.slice(startText.length).endsWith(endText))) - return undefined; - var matches = []; - var str = value.slice(startText.length, value.length - endText.length); - var pos = 0; - for (var i = 1; i < lastIndex; i++) { - var delim = texts[i]; - var delimPos = delim.length > 0 ? str.indexOf(delim, pos) : pos < str.length ? pos + 1 : -1; - if (delimPos < 0) - return undefined; - matches.push(getLiteralType(str.slice(pos, delimPos))); - pos = delimPos + delim.length; - } - matches.push(getLiteralType(str.slice(pos))); - return matches; - } function inferTypes(inferences, originalSource, originalTarget, priority, contravariant) { if (priority === void 0) { priority = 0; } if (contravariant === void 0) { contravariant = false; } + var symbolOrTypeStack; + var visited; var bivariant = false; var propagationType; var inferencePriority = 1024 /* MaxValue */; var allowComplexConstraintInference = true; - var visited; - var sourceStack; - var targetStack; - var expandingFlags = 0 /* None */; + var objectTypeComparisonDepth = 0; + var targetStack = []; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { if (!couldContainTypeVariables(target)) { @@ -61599,7 +59954,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 465829888 /* Instantiable */) { + if (indexType.flags & 63176704 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -61628,13 +59983,18 @@ var ts; inferFromTypes(source.objectType, target.objectType); inferFromTypes(source.indexType, target.indexType); } - else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) { - if (source.symbol === target.symbol) { - inferFromTypes(source.type, target.type); - } + else if (source.flags & 16777216 /* Conditional */ && target.flags & 16777216 /* Conditional */) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); + inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } else if (target.flags & 16777216 /* Conditional */) { - invokeOnce(source, target, inferToConditionalType); + var savePriority = priority; + priority |= contravariant ? 32 /* ContravariantConditional */ : 0; + var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; + inferToMultipleTypes(source, targetTypes, target.flags); + priority = savePriority; } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); @@ -61647,12 +60007,9 @@ var ts; inferFromTypes(sourceType, target); } } - else if (target.flags & 134217728 /* TemplateLiteral */) { - inferToTemplateLiteralType(source, target); - } else { source = getReducedType(source); - if (!(priority & 256 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) { + if (!(priority & 256 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -61697,30 +60054,7 @@ var ts; (visited || (visited = new ts.Map())).set(key, -1 /* Circularity */); var saveInferencePriority = inferencePriority; inferencePriority = 1024 /* MaxValue */; - // We stop inferring and report a circularity if we encounter duplicate recursion identities on both - // the source side and the target side. - var saveExpandingFlags = expandingFlags; - var sourceIdentity = getRecursionIdentity(source) || source; - var targetIdentity = getRecursionIdentity(target) || target; - if (sourceIdentity && ts.contains(sourceStack, sourceIdentity)) - expandingFlags |= 1 /* Source */; - if (targetIdentity && ts.contains(targetStack, targetIdentity)) - expandingFlags |= 2 /* Target */; - if (expandingFlags !== 3 /* Both */) { - if (sourceIdentity) - (sourceStack || (sourceStack = [])).push(sourceIdentity); - if (targetIdentity) - (targetStack || (targetStack = [])).push(targetIdentity); - action(source, target); - if (targetIdentity) - targetStack.pop(); - if (sourceIdentity) - sourceStack.pop(); - } - else { - inferencePriority = -1 /* Circularity */; - } - expandingFlags = saveExpandingFlags; + action(source, target); visited.set(key, inferencePriority); inferencePriority = Math.min(inferencePriority, saveInferencePriority); } @@ -61777,8 +60111,8 @@ var ts; } function getSingleTypeVariableFromIntersectionTypes(types) { var typeVariable; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var type = types_15[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var type = types_14[_i]; var t = type.flags & 2097152 /* Intersection */ && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); }); if (!t || typeVariable && t !== typeVariable) { return undefined; @@ -61916,31 +60250,40 @@ var ts; } return false; } - function inferToConditionalType(source, target) { - if (source.flags & 16777216 /* Conditional */) { - inferFromTypes(source.checkType, target.checkType); - inferFromTypes(source.extendsType, target.extendsType); - inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); - inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); + function inferFromObjectTypes(source, target) { + // If we are already processing another target type with the same associated symbol (such as + // an instantiation of the same generic type), we do not explore this target as it would yield + // no further inferences. We exclude the static side of classes from this check since it shares + // its symbol with the instance side which would lead to false positives. + var isNonConstructorObject = target.flags & 524288 /* Object */ && + !(ts.getObjectFlags(target) & 16 /* Anonymous */ && target.symbol && target.symbol.flags & 32 /* Class */); + var symbolOrType = ts.getObjectFlags(target) & 4 /* Reference */ && target.node ? getNormalizedType(target, /*writing*/ false) : isNonConstructorObject ? isTupleType(target) ? target.target : target.symbol : undefined; + if (symbolOrType) { + if (ts.contains(symbolOrTypeStack, symbolOrType)) { + if (ts.getObjectFlags(target) & 4 /* Reference */ && target.node) { + // Don't set the circularity flag for re-encountered recursive type references just because we're already exploring them + return; + } + inferencePriority = -1 /* Circularity */; + return; + } + targetStack[objectTypeComparisonDepth] = target; + objectTypeComparisonDepth++; + if (isDeeplyNestedType(target, targetStack, objectTypeComparisonDepth)) { + inferencePriority = -1 /* Circularity */; + objectTypeComparisonDepth--; + return; + } + (symbolOrTypeStack || (symbolOrTypeStack = [])).push(symbolOrType); + inferFromObjectTypesWorker(source, target); + symbolOrTypeStack.pop(); + objectTypeComparisonDepth--; } else { - var savePriority = priority; - priority |= contravariant ? 32 /* ContravariantConditional */ : 0; - var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; - inferToMultipleTypes(source, targetTypes, target.flags); - priority = savePriority; + inferFromObjectTypesWorker(source, target); } } - function inferToTemplateLiteralType(source, target) { - var matches = source.flags & 128 /* StringLiteral */ ? inferLiteralsFromTemplateLiteralType(source, target) : - source.flags & 134217728 /* TemplateLiteral */ && ts.arraysEqual(source.texts, target.texts) ? source.types : - undefined; - var types = target.types; - for (var i = 0; i < types.length; i++) { - inferFromTypes(matches ? matches[i] : neverType, types[i]); - } - } - function inferFromObjectTypes(source, target) { + function inferFromObjectTypesWorker(source, target) { if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) { // If source and target are references to the same generic type, infer from type arguments inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target)); @@ -61951,12 +60294,8 @@ var ts; // from S to T and from X to Y. inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target)); inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); - var sourceNameType = getNameTypeFromMappedType(source); - var targetNameType = getNameTypeFromMappedType(target); - if (sourceNameType && targetNameType) - inferFromTypes(sourceNameType, targetNameType); } - if (ts.getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) { + if (ts.getObjectFlags(target) & 32 /* Mapped */) { var constraintType = getConstraintTypeFromMappedType(target); if (inferToMappedType(source, target, constraintType)) { return; @@ -62064,7 +60403,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 165 /* MethodDeclaration */ || kind === 164 /* MethodSignature */ || kind === 166 /* Constructor */; + bivariant = bivariant || kind === 164 /* MethodDeclaration */ || kind === 163 /* MethodSignature */ || kind === 165 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -62099,7 +60438,7 @@ var ts; } function hasPrimitiveConstraint(type) { var constraint = getConstraintOfTypeParameter(type); - return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */); } function isObjectLiteralType(type) { return !!(ts.getObjectFlags(type) & 128 /* ObjectLiteral */); @@ -62208,22 +60547,22 @@ var ts; return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom; case "$": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery; case "describe": case "suite": case "it": case "test": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha; case "process": case "require": case "Buffer": case "module": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode; case "Map": case "Set": case "Promise": @@ -62232,19 +60571,9 @@ var ts; case "WeakSet": case "Iterator": case "AsyncIterator": - case "SharedArrayBuffer": - case "Atomics": - case "AsyncIterable": - case "AsyncIterableIterator": - case "AsyncGenerator": - case "AsyncGeneratorFunction": - case "BigInt": - case "Reflect": - case "BigInt64Array": - case "BigUint64Array": - return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later; + return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 286 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -62265,7 +60594,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 176 /* TypeQuery */ ? true : n.kind === 78 /* Identifier */ || n.kind === 157 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 175 /* TypeQuery */ ? true : n.kind === 78 /* Identifier */ || n.kind === 156 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -62280,11 +60609,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 107 /* ThisKeyword */: return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType); - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -62295,28 +60624,26 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: return isMatchingReference(source, target.expression); - case 216 /* BinaryExpression */: - return (ts.isAssignmentExpression(target) && isMatchingReference(source, target.left)) || - (ts.isBinaryExpression(target) && target.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source, target.right)); + case 213 /* BinaryExpression */: + return ts.isAssignmentExpression(target) && isMatchingReference(source, target.left); } switch (source.kind) { case 78 /* Identifier */: - case 79 /* PrivateIdentifier */: return target.kind === 78 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 249 /* VariableDeclaration */ || target.kind === 198 /* BindingElement */) && + (target.kind === 246 /* VariableDeclaration */ || target.kind === 195 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 107 /* ThisKeyword */: return target.kind === 107 /* ThisKeyword */; case 105 /* SuperKeyword */: return target.kind === 105 /* SuperKeyword */; - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -62326,11 +60653,11 @@ var ts; // Given a source x, check if target matches x or is an && operation with an operand that matches x. function containsTruthyCheck(source, target) { return isMatchingReference(source, target) || - (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && + (target.kind === 213 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right))); } function getAccessedPropertyName(access) { - return access.kind === 201 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 198 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -62359,7 +60686,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 465829888 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -62392,7 +60719,7 @@ var ts; } } } - if (callExpression.expression.kind === 201 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 198 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -62441,8 +60768,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0 /* None */; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var t = types_16[_i]; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var t = types_15[_i]; result |= getTypeFacts(t); } return result; @@ -62513,7 +60840,7 @@ var ts; if (flags & 131072 /* Never */) { return 0 /* None */; } - if (flags & 465829888 /* Instantiable */) { + if (flags & 63176704 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -62537,35 +60864,28 @@ var ts; return errorType; var text = getPropertyNameFromType(nameType); return getConstraintForLocation(getTypeOfPropertyOfType(type, text), name) || - isNumericLiteralName(text) && includeUndefinedInIndexSignature(getIndexTypeOfType(type, 1 /* Number */)) || - includeUndefinedInIndexSignature(getIndexTypeOfType(type, 0 /* String */)) || + isNumericLiteralName(text) && getIndexTypeOfType(type, 1 /* Number */) || + getIndexTypeOfType(type, 0 /* String */) || errorType; } function getTypeOfDestructuredArrayElement(type, index) { return everyType(type, isTupleLikeType) && getTupleElementType(type, index) || - includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined)) || + checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType; } - function includeUndefinedInIndexSignature(type) { - if (!type) - return type; - return compilerOptions.noUncheckedIndexedAccess ? - getUnionType([type, undefinedType]) : - type; - } function getTypeOfDestructuredSpreadExpression(type) { return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 199 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 288 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 196 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 285 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 216 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 239 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 213 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 236 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -62582,21 +60902,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return stringType; - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return checkRightHandSideOfForOf(parent) || errorType; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return undefinedType; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -62604,7 +60924,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 196 /* ObjectBindingPattern */ ? + var type = pattern.kind === 193 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -62622,30 +60942,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 238 /* ForInStatement */) { + if (node.parent.parent.kind === 235 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 239 /* ForOfStatement */) { + if (node.parent.parent.kind === 236 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 249 /* VariableDeclaration */ ? + return node.kind === 246 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 249 /* VariableDeclaration */ && node.initializer && + return node.kind === 246 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 198 /* BindingElement */ && node.parent.kind === 216 /* BinaryExpression */ && + node.kind !== 195 /* BindingElement */ && node.parent.kind === 213 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 74 /* BarBarEqualsToken */: @@ -62660,13 +60980,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 207 /* ParenthesizedExpression */ || - parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 204 /* ParenthesizedExpression */ || + parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -62686,7 +61006,7 @@ var ts; var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; @@ -62823,8 +61143,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { - var t = types_17[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var t = types_16[_i]; if (!(t.flags & 131072 /* Never */)) { if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) { return false; @@ -62848,12 +61168,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 203 /* CallExpression */ + parent.parent.kind === 200 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 202 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 199 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 216 /* BinaryExpression */ && + parent.parent.kind === 213 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -62861,8 +61181,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return (declaration.kind === 249 /* VariableDeclaration */ || declaration.kind === 160 /* Parameter */ || - declaration.kind === 163 /* PropertyDeclaration */ || declaration.kind === 162 /* PropertySignature */) && + return (declaration.kind === 246 /* VariableDeclaration */ || declaration.kind === 159 /* Parameter */ || + declaration.kind === 162 /* PropertyDeclaration */ || declaration.kind === 161 /* PropertySignature */) && !!ts.getEffectiveTypeAnnotationNode(declaration); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -62870,18 +61190,12 @@ var ts; return getTypeOfSymbol(symbol); } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { - if (ts.getCheckFlags(symbol) & 262144 /* Mapped */) { - var origin = symbol.syntheticOrigin; - if (origin && getExplicitTypeOfSymbol(origin)) { - return getTypeOfSymbol(symbol); - } - } var declaration = symbol.valueDeclaration; if (declaration) { if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 236 /* ForOfStatement */) { var statement = declaration.parent.parent; var expressionType = getTypeOfDottedName(statement.expression, /*diagnostic*/ undefined); if (expressionType) { @@ -62909,11 +61223,11 @@ var ts; return getExplicitThisType(node); case 105 /* SuperKeyword */: return checkSuperExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -62927,7 +61241,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 233 /* ExpressionStatement */) { + if (node.parent.kind === 230 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 105 /* SuperKeyword */) { @@ -62971,7 +61285,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 94 /* FalseKeyword */ || node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 94 /* FalseKeyword */ || node.kind === 213 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -63090,7 +61404,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 536624127 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -63102,7 +61416,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 225 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 222 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -63117,13 +61431,11 @@ var ts; if (flowDepth === 2000) { // We have made 2000 recursive invocations. To avoid overflowing the call stack we report an error // and disable further control flow analysis in the containing function or module body. - ts.tracing.instant("check" /* Check */, "getTypeAtFlowNode_DepthLimit", { flowId: flow.id }); flowAnalysisDisabled = true; reportFlowControlError(reference); return errorType; } flowDepth++; - var sharedFlow; while (true) { var flags = flow.flags; if (flags & 4096 /* Shared */) { @@ -63136,7 +61448,6 @@ var ts; return sharedFlowTypes[i]; } } - sharedFlow = flow; } var type = void 0; if (flags & 16 /* Assignment */) { @@ -63186,8 +61497,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 201 /* PropertyAccessExpression */ && - reference.kind !== 202 /* ElementAccessExpression */ && + reference.kind !== 198 /* PropertyAccessExpression */ && + reference.kind !== 199 /* ElementAccessExpression */ && reference.kind !== 107 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -63200,9 +61511,9 @@ var ts; // simply return the non-auto declared type to reduce follow-on errors. type = convertAutoToAny(declaredType); } - if (sharedFlow) { + if (flags & 4096 /* Shared */) { // Record visited node and the associated type in the cache. - sharedFlowNodes[sharedFlowCount] = sharedFlow; + sharedFlowNodes[sharedFlowCount] = flow; sharedFlowTypes[sharedFlowCount] = type; sharedFlowCount++; } @@ -63212,7 +61523,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -63252,14 +61563,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 208 /* FunctionExpression */ || init.kind === 209 /* ArrowFunction */)) { + if (init && (init.kind === 205 /* FunctionExpression */ || init.kind === 206 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 238 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 235 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -63270,7 +61581,7 @@ var ts; if (node.kind === 94 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 216 /* BinaryExpression */) { + if (node.kind === 213 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -63301,7 +61612,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 203 /* CallExpression */ ? + var expr = node.kind === 200 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -63309,7 +61620,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -63357,7 +61668,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 211 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 208 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -63365,7 +61676,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 211 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 208 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -63583,10 +61894,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 208 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 208 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -63706,7 +62017,7 @@ var ts; if (assumeTrue && type.flags & 2 /* Unknown */ && literal.text === "object") { // The pattern x && typeof x === 'object', where x is of type unknown, narrows x to type object. We don't // need to check for the reverse typeof x === 'object' && x since that already narrows correctly. - if (typeOfExpr.parent.parent.kind === 216 /* BinaryExpression */) { + if (typeOfExpr.parent.parent.kind === 213 /* BinaryExpression */) { var expr = typeOfExpr.parent.parent; if (expr.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) { return nonPrimitiveType; @@ -63789,7 +62100,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -63954,10 +62265,15 @@ var ts; return assignableType; } } - // If the candidate type is a subtype of the target type, narrow to the candidate type, - // if the target type is a subtype of the candidate type, narrow to the target type, - // otherwise, narrow to an intersection of the two types. - return isTypeSubtypeOf(candidate, type) ? candidate : isTypeSubtypeOf(type, candidate) ? type : getIntersectionType([type, candidate]); + // If the candidate type is a subtype of the target type, narrow to the candidate type. + // Otherwise, if the target type is assignable to the candidate type, keep the target type. + // Otherwise, if the candidate type is assignable to the target type, narrow to the candidate + // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the + // two types. + return isTypeSubtypeOf(candidate, type) ? candidate : + isTypeAssignableTo(type, candidate) ? type : + isTypeAssignableTo(candidate, type) ? candidate : + getIntersectionType([type, candidate]); } function narrowTypeByCallExpression(type, callExpression, assumeTrue) { if (hasMatchingArgument(callExpression, reference)) { @@ -64000,17 +62316,16 @@ var ts; case 78 /* Identifier */: case 107 /* ThisKeyword */: case 105 /* SuperKeyword */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -64055,9 +62370,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 257 /* ModuleBlock */ || - node.kind === 297 /* SourceFile */ || - node.kind === 163 /* PropertyDeclaration */; + node.kind === 254 /* ModuleBlock */ || + node.kind === 294 /* SourceFile */ || + node.kind === 162 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -64079,7 +62394,7 @@ var ts; if (node.kind === 78 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 160 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 159 /* Parameter */) { symbol.isAssigned = true; } } @@ -64095,7 +62410,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 160 /* Parameter */ && + declaration.kind === 159 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -64109,10 +62424,10 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 201 /* PropertyAccessExpression */ || - parent.kind === 203 /* CallExpression */ && parent.expression === node || - parent.kind === 202 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 198 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 198 /* PropertyAccessExpression */ || + parent.kind === 200 /* CallExpression */ && parent.expression === node || + parent.kind === 199 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 195 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); @@ -64154,7 +62469,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 209 /* ArrowFunction */) { + if (container.kind === 206 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasSyntacticModifier(container, 256 /* Async */)) { @@ -64170,16 +62485,16 @@ var ts; markAliasReferenced(symbol, node); } var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - var sourceSymbol = localOrExportSymbol.flags & 2097152 /* Alias */ ? resolveAlias(localOrExportSymbol) : localOrExportSymbol; - if (getDeclarationNodeFlagsFromSymbol(sourceSymbol) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node.parent, sourceSymbol)) { - errorOrSuggestion(/* isError */ false, node, ts.Diagnostics._0_is_deprecated, node.escapedText); - } var declaration = localOrExportSymbol.valueDeclaration; + if (declaration && ts.getCombinedNodeFlags(declaration) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node.parent, localOrExportSymbol)) { + errorOrSuggestion(/* isError */ false, node, ts.Diagnostics._0_is_deprecated, node.escapedText); + ; + } if (localOrExportSymbol.flags & 32 /* Class */) { // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 252 /* ClassDeclaration */ + if (declaration.kind === 249 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -64191,14 +62506,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 221 /* ClassExpression */) { + else if (declaration.kind === 218 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 297 /* SourceFile */) { + while (container.kind !== 294 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 163 /* PropertyDeclaration */ && ts.hasSyntacticModifier(container, 32 /* Static */)) { + if (container.kind === 162 /* PropertyDeclaration */ && ts.hasSyntacticModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -64247,7 +62562,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 160 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 159 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -64256,8 +62571,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 208 /* FunctionExpression */ || - flowContainer.kind === 209 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 205 /* FunctionExpression */ || + flowContainer.kind === 206 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -64266,9 +62581,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 270 /* ExportSpecifier */) || - node.parent.kind === 225 /* NonNullExpression */ || - declaration.kind === 249 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 267 /* ExportSpecifier */) || + node.parent.kind === 222 /* NonNullExpression */ || + declaration.kind === 246 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -64303,7 +62618,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 287 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 284 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -64326,7 +62641,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 247 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -64347,7 +62662,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 247 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -64366,7 +62681,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 207 /* ParenthesizedExpression */) { + while (current.parent.kind === 204 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -64374,7 +62689,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 214 /* PrefixUnaryExpression */ || current.parent.kind === 215 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 211 /* PrefixUnaryExpression */ || current.parent.kind === 212 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -64387,7 +62702,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 163 /* PropertyDeclaration */ || container.kind === 166 /* Constructor */) { + if (container.kind === 162 /* PropertyDeclaration */ || container.kind === 165 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -64427,37 +62742,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 166 /* Constructor */) { + if (container.kind === 165 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 209 /* ArrowFunction */) { + if (container.kind === 206 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 166 /* Constructor */: + case 165 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: if (ts.hasSyntacticModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -64545,7 +62860,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 208 /* FunctionExpression */ && + if (container.kind === 205 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -64555,16 +62870,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 165 /* MethodDeclaration */ && - container.parent.kind === 200 /* ObjectLiteralExpression */ && + else if (container.kind === 164 /* MethodDeclaration */ && + container.parent.kind === 197 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 208 /* FunctionExpression */ && - container.parent.kind === 288 /* PropertyAssignment */ && - container.parent.parent.kind === 200 /* ObjectLiteralExpression */ && + else if (container.kind === 205 /* FunctionExpression */ && + container.parent.kind === 285 /* PropertyAssignment */ && + container.parent.parent.kind === 197 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -64572,7 +62887,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 208 /* FunctionExpression */ && + else if (container.kind === 205 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -64597,7 +62912,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 308 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 304 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -64611,16 +62926,16 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 160 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 159 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 203 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 200 /* CallExpression */ && node.parent.expression === node; var immediateContainer = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var container = immediateContainer; var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 209 /* ArrowFunction */) { + while (container && container.kind === 206 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -64633,14 +62948,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 158 /* ComputedPropertyName */; }); - if (current && current.kind === 158 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 157 /* ComputedPropertyName */; }); + if (current && current.kind === 157 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 197 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -64648,7 +62963,7 @@ var ts; } return errorType; } - if (!isCallExpression && immediateContainer.kind === 166 /* Constructor */) { + if (!isCallExpression && immediateContainer.kind === 165 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasSyntacticModifier(container, 32 /* Static */) || isCallExpression) { @@ -64717,7 +63032,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 165 /* MethodDeclaration */ && ts.hasSyntacticModifier(container, 256 /* Async */)) { + if (container.kind === 164 /* MethodDeclaration */ && ts.hasSyntacticModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -64731,7 +63046,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 200 /* ObjectLiteralExpression */) { + if (container.parent.kind === 197 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -64752,7 +63067,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 166 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 165 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -64767,7 +63082,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 166 /* Constructor */; + return container.kind === 165 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -64775,21 +63090,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 197 /* ObjectLiteralExpression */) { if (ts.hasSyntacticModifier(container, 32 /* Static */)) { - return container.kind === 165 /* MethodDeclaration */ || - container.kind === 164 /* MethodSignature */ || - container.kind === 167 /* GetAccessor */ || - container.kind === 168 /* SetAccessor */; + return container.kind === 164 /* MethodDeclaration */ || + container.kind === 163 /* MethodSignature */ || + container.kind === 166 /* GetAccessor */ || + container.kind === 167 /* SetAccessor */; } else { - return container.kind === 165 /* MethodDeclaration */ || - container.kind === 164 /* MethodSignature */ || - container.kind === 167 /* GetAccessor */ || - container.kind === 168 /* SetAccessor */ || - container.kind === 163 /* PropertyDeclaration */ || - container.kind === 162 /* PropertySignature */ || - container.kind === 166 /* Constructor */; + return container.kind === 164 /* MethodDeclaration */ || + container.kind === 163 /* MethodSignature */ || + container.kind === 166 /* GetAccessor */ || + container.kind === 167 /* SetAccessor */ || + container.kind === 162 /* PropertyDeclaration */ || + container.kind === 161 /* PropertySignature */ || + container.kind === 165 /* Constructor */; } } } @@ -64797,10 +63112,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 165 /* MethodDeclaration */ || - func.kind === 167 /* GetAccessor */ || - func.kind === 168 /* SetAccessor */) && func.parent.kind === 200 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 208 /* FunctionExpression */ && func.parent.kind === 288 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 164 /* MethodDeclaration */ || + func.kind === 166 /* GetAccessor */ || + func.kind === 167 /* SetAccessor */) && func.parent.kind === 197 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 205 /* FunctionExpression */ && func.parent.kind === 285 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -64812,7 +63127,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 209 /* ArrowFunction */) { + if (func.kind === 206 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -64839,7 +63154,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 288 /* PropertyAssignment */) { + if (literal.parent.kind !== 285 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -64853,7 +63168,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -64906,41 +63221,25 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 160 /* Parameter */: + case 159 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getContextualTypeForBindingElement(declaration); - case 163 /* PropertyDeclaration */: - if (ts.hasSyntacticModifier(declaration, 32 /* Static */)) { - return getContextualTypeForStaticPropertyDeclaration(declaration); - } - // By default, do nothing and return undefined - only the above cases have context implied by a parent + // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } } function getContextualTypeForBindingElement(declaration) { var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 198 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); - if (!parentType || ts.isBindingPattern(name) || ts.isComputedNonLiteralName(name)) - return undefined; - if (parent.name.kind === 197 /* ArrayBindingPattern */) { - var index = ts.indexOfNode(declaration.parent.elements, declaration); - if (index < 0) - return undefined; - return getContextualTypeForElementExpression(parentType, index); + parent.kind !== 195 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + if (parentType && !ts.isBindingPattern(name) && !ts.isComputedNonLiteralName(name)) { + var nameType = getLiteralTypeFromPropertyName(name); + if (isTypeUsableAsPropertyName(nameType)) { + var text = getPropertyNameFromType(nameType); + return getTypeOfPropertyOfType(parentType, text); + } } - var nameType = getLiteralTypeFromPropertyName(name); - if (isTypeUsableAsPropertyName(nameType)) { - var text = getPropertyNameFromType(nameType); - return getTypeOfPropertyOfType(parentType, text); - } - } - function getContextualTypeForStaticPropertyDeclaration(declaration) { - var parentType = ts.isExpression(declaration.parent) && getContextualType(declaration.parent); - if (!parentType) - return undefined; - return getTypeOfPropertyOfContextualType(parentType, getSymbolOfNode(declaration).escapedName); } // In a variable, parameter or property declaration with a type annotation, // the contextual type of an initializer expression is the type of the variable, parameter or property. @@ -65061,7 +63360,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 205 /* TaggedTemplateExpression */) { + if (template.parent.kind === 202 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -65074,7 +63373,14 @@ var ts; case 75 /* AmpersandAmpersandEqualsToken */: case 74 /* BarBarEqualsToken */: case 76 /* QuestionQuestionEqualsToken */: - return node === right ? getContextualTypeForAssignmentDeclaration(binaryExpression) : undefined; + if (node !== right) { + return undefined; + } + var contextSensitive = getIsContextSensitiveAssignmentOrContextType(binaryExpression); + if (!contextSensitive) { + return undefined; + } + return contextSensitive === true ? getTypeOfExpression(left) : contextSensitive; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: // When an || expression has a contextual type, the operands are contextually typed by that type, except @@ -65094,27 +63400,24 @@ var ts; } // In an assignment expression, the right operand is contextually typed by the type of the left operand. // Don't do this for assignment declarations unless there is a type tag on the assignment, to avoid circularity from checking the right operand. - function getContextualTypeForAssignmentDeclaration(binaryExpression) { + function getIsContextSensitiveAssignmentOrContextType(binaryExpression) { var kind = ts.getAssignmentDeclarationKind(binaryExpression); switch (kind) { case 0 /* None */: - return getTypeOfExpression(binaryExpression.left); + return true; case 5 /* Property */: case 1 /* ExportsProperty */: case 6 /* Prototype */: case 3 /* PrototypeProperty */: - if (isPossiblyAliasedThisProperty(binaryExpression, kind)) { - return getContextualTypeForThisPropertyAssignment(binaryExpression, kind); - } // If `binaryExpression.left` was assigned a symbol, then this is a new declaration; otherwise it is an assignment to an existing declaration. // See `bindStaticPropertyAssignment` in `binder.ts`. - else if (!binaryExpression.left.symbol) { - return getTypeOfExpression(binaryExpression.left); + if (!binaryExpression.left.symbol) { + return true; } else { var decl = binaryExpression.left.symbol.valueDeclaration; if (!decl) { - return undefined; + return false; } var lhs = ts.cast(binaryExpression.left, ts.isAccessExpression); var overallAnnotation = ts.getEffectiveTypeAnnotationNode(decl); @@ -65127,19 +63430,39 @@ var ts; if (parentSymbol) { var annotated = parentSymbol.valueDeclaration && ts.getEffectiveTypeAnnotationNode(parentSymbol.valueDeclaration); if (annotated) { - var nameStr = ts.getElementOrPropertyAccessName(lhs); - if (nameStr !== undefined) { - return getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr); + var nameStr_1 = ts.getElementOrPropertyAccessName(lhs); + if (nameStr_1 !== undefined) { + var type = getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr_1); + return type || false; } } - return undefined; + return false; } } - return ts.isInJSFile(decl) ? undefined : getTypeOfExpression(binaryExpression.left); + return !ts.isInJSFile(decl); } case 2 /* ModuleExports */: case 4 /* ThisProperty */: - return getContextualTypeForThisPropertyAssignment(binaryExpression, kind); + if (!binaryExpression.symbol) + return true; + if (binaryExpression.symbol.valueDeclaration) { + var annotated = ts.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); + if (annotated) { + var type = getTypeFromTypeNode(annotated); + if (type) { + return type; + } + } + } + if (kind === 2 /* ModuleExports */) + return false; + var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression); + if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, /*includeArrowFunctions*/ false))) { + return false; + } + var thisType = checkThisExpression(thisAccess.expression); + var nameStr = ts.getElementOrPropertyAccessName(thisAccess); + return nameStr !== undefined && thisType && getTypeOfPropertyOfContextualType(thisType, nameStr) || false; case 7 /* ObjectDefinePropertyValue */: case 8 /* ObjectDefinePropertyExports */: case 9 /* ObjectDefinePrototypeProperty */: @@ -65148,40 +63471,6 @@ var ts; return ts.Debug.assertNever(kind); } } - function isPossiblyAliasedThisProperty(declaration, kind) { - if (kind === void 0) { kind = ts.getAssignmentDeclarationKind(declaration); } - if (kind === 4 /* ThisProperty */) { - return true; - } - if (!ts.isInJSFile(declaration) || kind !== 5 /* Property */ || !ts.isIdentifier(declaration.left.expression)) { - return false; - } - var name = declaration.left.expression.escapedText; - var symbol = resolveName(declaration.left, name, 111551 /* Value */, undefined, undefined, /*isUse*/ true, /*excludeGlobals*/ true); - return ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration); - } - function getContextualTypeForThisPropertyAssignment(binaryExpression, kind) { - if (!binaryExpression.symbol) - return getTypeOfExpression(binaryExpression.left); - if (binaryExpression.symbol.valueDeclaration) { - var annotated = ts.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); - if (annotated) { - var type = getTypeFromTypeNode(annotated); - if (type) { - return type; - } - } - } - if (kind === 2 /* ModuleExports */) - return undefined; - var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression); - if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, /*includeArrowFunctions*/ false))) { - return undefined; - } - var thisType = checkThisExpression(thisAccess.expression); - var nameStr = ts.getElementOrPropertyAccessName(thisAccess); - return nameStr !== undefined && getTypeOfPropertyOfContextualType(thisType, nameStr) || undefined; - } function isCircularMappedProperty(symbol) { return !!(ts.getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0); } @@ -65251,8 +63540,7 @@ var ts; // type of T. function getContextualTypeForElementExpression(arrayContextualType, index) { return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) - || mapType(arrayContextualType, function (t) { return getIteratedTypeOrElementType(1 /* Element */, t, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false); }, - /*noReductions*/ true)); + || getIteratedTypeOrElementType(1 /* Element */, arrayContextualType, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false)); } // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type. function getContextualTypeForConditionalOperand(node, contextFlags) { @@ -65266,7 +63554,7 @@ var ts; if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) { return undefined; } - var realChildren = ts.getSemanticJsxChildren(node.children); + var realChildren = getSemanticJsxChildren(node.children); var childIndex = realChildren.indexOf(child); var childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName); return childFieldType && (realChildren.length === 1 ? childFieldType : mapType(childFieldType, function (t) { @@ -65314,21 +63602,21 @@ var ts; case 94 /* FalseKeyword */: case 103 /* NullKeyword */: case 78 /* Identifier */: - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: return true; - case 201 /* PropertyAccessExpression */: - case 207 /* ParenthesizedExpression */: + case 198 /* PropertyAccessExpression */: + case 204 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 288 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 285 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 280 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 277 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -65353,7 +63641,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -65376,7 +63664,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -65414,58 +63702,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 195 /* BindingElement */: return getContextualTypeForInitializerExpression(node, contextFlags); - case 209 /* ArrowFunction */: - case 242 /* ReturnStatement */: + case 206 /* ArrowFunction */: + case 239 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent, contextFlags); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (parent.expression.kind === 99 /* ImportKeyword */) { return stringType; } /* falls through */ - case 204 /* NewExpression */: + case 201 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(parent.type); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 199 /* ArrayLiteralExpression */: { + case 196 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 228 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 218 /* TemplateExpression */); + case 225 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 215 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 207 /* ParenthesizedExpression */: { + case 204 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 280 /* JsxAttribute */: - case 282 /* JsxSpreadAttribute */: + case 277 /* JsxAttribute */: + case 279 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -65628,7 +63916,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 208 /* FunctionExpression */ || node.kind === 209 /* ArrowFunction */; + return node.kind === 205 /* FunctionExpression */ || node.kind === 206 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -65642,7 +63930,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -65656,8 +63944,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var current = types_18[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var current = types_17[_i]; var signature = getContextualCallSignature(current, node); if (signature) { if (!signatureList) { @@ -65690,8 +63978,8 @@ var ts; return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type; } function hasDefaultValue(node) { - return (node.kind === 198 /* BindingElement */ && !!node.initializer) || - (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 195 /* BindingElement */ && !!node.initializer) || + (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -65703,7 +63991,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - if (e.kind === 220 /* SpreadElement */) { + if (e.kind === 217 /* SpreadElement */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 2048 /* SpreadArrays */); } @@ -65766,7 +64054,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return isNumericComputedName(name); case 78 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -65816,7 +64104,7 @@ var ts; // This will allow types number, string, symbol or any. It will also allow enums, the unknown // type, and any union of these types (like string | number). if (links.resolvedType.flags & 98304 /* Nullable */ || - !isTypeAssignableToKind(links.resolvedType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && + !isTypeAssignableToKind(links.resolvedType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) { error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } @@ -65862,7 +64150,7 @@ var ts; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 196 /* ObjectBindingPattern */ || contextualType.pattern.kind === 200 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 193 /* ObjectBindingPattern */ || contextualType.pattern.kind === 197 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -65885,16 +64173,16 @@ var ts; for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var memberDecl = _c[_b]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 158 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 157 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 288 /* PropertyAssignment */ || - memberDecl.kind === 289 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 285 /* PropertyAssignment */ || + memberDecl.kind === 286 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 288 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + var type = memberDecl.kind === 285 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`. // we don't want to say "could not find 'a'". - memberDecl.kind === 289 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : + memberDecl.kind === 286 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -65917,8 +64205,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 288 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 289 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 285 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 286 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -65944,7 +64232,7 @@ var ts; member = prop; allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 290 /* SpreadAssignment */) { + else if (memberDecl.kind === 287 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -65973,7 +64261,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 167 /* GetAccessor */ || memberDecl.kind === 168 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 166 /* GetAccessor */ || memberDecl.kind === 167 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -65998,7 +64286,7 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 290 /* SpreadAssignment */) { + if (contextualTypeHasPattern && node.parent.kind !== 287 /* SpreadAssignment */) { for (var _d = 0, _e = getPropertiesOfType(contextualType); _d < _e.length; _d++) { var prop = _e[_d]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { @@ -66040,7 +64328,7 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); @@ -66052,6 +64340,7 @@ var ts; } function checkJsxSelfClosingElementDeferred(node) { checkJsxOpeningLikeElementOrOpeningFragment(node); + resolveUntypedCall(node); // ensure type arguments and parameters are typechecked, even if there is an arity error } function checkJsxSelfClosingElement(node, _checkMode) { checkNodeDeferred(node); @@ -66078,7 +64367,7 @@ var ts; // by default, jsx:'react' will use jsxFactory = React.createElement and jsxFragmentFactory = React.Fragment // if jsxFactory compiler option is provided, ensure jsxFragmentFactory compiler option or @jsxFrag pragma is provided too var nodeSourceFile = ts.getSourceFileOfNode(node); - if (ts.getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) + if (compilerOptions.jsx === 2 /* React */ && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) && !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) { error(node, compilerOptions.jsxFactory ? ts.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option @@ -66130,7 +64419,7 @@ var ts; if (ts.isJsxAttribute(attributeDecl)) { var exprType = checkJsxAttribute(attributeDecl, checkMode); objectFlags |= ts.getObjectFlags(exprType) & 3670016 /* PropagatingFlags */; - var attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName); + var attributeSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */ | member.flags, member.escapedName); attributeSymbol.declarations = member.declarations; attributeSymbol.parent = member.parent; if (member.valueDeclaration) { @@ -66145,7 +64434,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 282 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 279 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -66171,7 +64460,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 273 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 270 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -66185,7 +64474,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(openingLikeElement.attributes); var childrenContextualType = contextualType && getTypeOfPropertyOfContextualType(contextualType, jsxChildrenPropertyName); // If there are children in the body of JSX element, create dummy attribute "children" with the union of children types so that it will pass the attribute checking process - var childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName); + var childrenPropSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */, jsxChildrenPropertyName); childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && forEachType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes)); @@ -66228,9 +64517,6 @@ var ts; childrenTypes.push(stringType); } } - else if (child.kind === 283 /* JsxExpression */ && !child.expression) { - continue; // empty jsx expressions don't *really* count as present children - } else { childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); } @@ -66300,60 +64586,29 @@ var ts; } return links.resolvedSymbol; } - function getJsxNamespaceContainerForImplicitImport(location) { - var file = location && ts.getSourceFileOfNode(location); - var links = file && getNodeLinks(file); - if (links && links.jsxImplicitImportContainer === false) { - return undefined; - } - if (links && links.jsxImplicitImportContainer) { - return links.jsxImplicitImportContainer; - } - var runtimeImportSpecifier = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(compilerOptions, file), compilerOptions); - if (!runtimeImportSpecifier) { - return undefined; - } - var isClassic = ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Classic; - var errorMessage = isClassic - ? ts.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option - : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations; - var mod = resolveExternalModule(location, runtimeImportSpecifier, errorMessage, location); - var result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : undefined; - if (links) { - links.jsxImplicitImportContainer = result || false; - } - return result; - } function getJsxNamespaceAt(location) { var links = location && getNodeLinks(location); if (links && links.jsxNamespace) { return links.jsxNamespace; } if (!links || links.jsxNamespace !== false) { - var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); - if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { - var namespaceName = getJsxNamespace(location); - resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); - } + var namespaceName = getJsxNamespace(location); + var resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); if (resolvedNamespace) { var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */)); - if (candidate && candidate !== unknownSymbol) { + if (candidate) { if (links) { links.jsxNamespace = candidate; } return candidate; } - } - if (links) { - links.jsxNamespace = false; + if (links) { + links.jsxNamespace = false; + } } } // JSX global fallback - var s = resolveSymbol(getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined)); - if (s === unknownSymbol) { - return undefined; // TODO: GH#18217 - } - return s; // TODO: GH#18217 + return getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined); // TODO: GH#18217 } /** * Look into JSX namespace and then look for container with matching name as nameOfAttribPropContainer. @@ -66540,25 +64795,23 @@ var ts; checkGrammarJsxElement(node); } checkJsxPreconditions(node); - if (!getJsxNamespaceContainerForImplicitImport(node)) { - // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. - // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. - var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var jsxFactoryNamespace = getJsxNamespace(node); - var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; - // allow null as jsxFragmentFactory - var jsxFactorySym = void 0; - if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); - } - if (jsxFactorySym) { - // Mark local symbol as referenced here because it might not have been marked - // if jsx emit was not jsxFactory as there wont be error being emitted - jsxFactorySym.isReferenced = 67108863 /* All */; - // If react/jsxFactory symbol is alias, mark it as refereced - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { - markAliasSymbolAsReferenced(jsxFactorySym); - } + // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. + // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. + var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var jsxFactoryNamespace = getJsxNamespace(node); + var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + // allow null as jsxFragmentFactory + var jsxFactorySym; + if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); + } + if (jsxFactorySym) { + // Mark local symbol as referenced here because it might not have been marked + // if jsx emit was not jsxFactory as there wont be error being emitted + jsxFactorySym.isReferenced = 67108863 /* All */; + // If react/jsxFactory symbol is alias, mark it as refereced + if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); } } if (isNodeOpeningLikeElement) { @@ -66648,7 +64901,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 157 /* QualifiedName */ ? node.right : node.kind === 195 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 156 /* QualifiedName */ ? node.right : node.kind === 192 /* ImportType */ ? node : node.name; if (isSuper) { // TS 1.0 spec (April 2014): 4.8.2 // - In a constructor, instance member function, instance member accessor, or @@ -66802,7 +65055,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 207 /* ParenthesizedExpression */) { + while (node.parent.kind === 204 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -66860,10 +65113,10 @@ var ts; return false; } function isThisPropertyAccessInConstructor(node, prop) { - return (isConstructorDeclaredProperty(prop) || ts.isThisProperty(node) && isAutoTypedProperty(prop)) - && ts.getThisContainer(node, /*includeArrowFunctions*/ true) === getDeclaringConstructor(prop); + return ts.isThisProperty(node) && (isAutoTypedProperty(prop) || isConstructorDeclaredProperty(prop)) && ts.getThisContainer(node, /*includeArrowFunctions*/ true) === getDeclaringConstructor(prop); } function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right) { + var _a; var parentSymbol = getNodeLinks(left).resolvedSymbol; var assignmentKind = ts.getAssignmentTargetKind(node); var apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType); @@ -66925,10 +65178,10 @@ var ts; if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) { error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); } - propType = (compilerOptions.noUncheckedIndexedAccess && !ts.isAssignmentTarget(node)) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + propType = indexInfo.type; } else { - if (getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) { + if (((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.flags) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) { errorOrSuggestion(/* isError */ false, right, ts.Diagnostics._0_is_deprecated, right.escapedText); } checkPropertyNotUsedBeforeDeclaration(prop, node, right); @@ -66965,7 +65218,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 166 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 165 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -66997,8 +65250,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 252 /* ClassDeclaration */ && - node.parent.kind !== 173 /* TypeReference */ && + else if (valueDeclaration.kind === 249 /* ClassDeclaration */ && + node.parent.kind !== 172 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -67010,22 +65263,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return true; - case 288 /* PropertyAssignment */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 290 /* SpreadAssignment */: - case 158 /* ComputedPropertyName */: - case 228 /* TemplateSpan */: - case 283 /* JsxExpression */: - case 280 /* JsxAttribute */: - case 281 /* JsxAttributes */: - case 282 /* JsxSpreadAttribute */: - case 275 /* JsxOpeningElement */: - case 223 /* ExpressionWithTypeArguments */: - case 286 /* HeritageClause */: + case 285 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 287 /* SpreadAssignment */: + case 157 /* ComputedPropertyName */: + case 225 /* TemplateSpan */: + case 280 /* JsxExpression */: + case 277 /* JsxAttribute */: + case 278 /* JsxAttributes */: + case 279 /* JsxSpreadAttribute */: + case 272 /* JsxOpeningElement */: + case 220 /* ExpressionWithTypeArguments */: + case 283 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -67081,22 +65334,14 @@ var ts; relatedInfo = ts.createDiagnosticForNode(propNode, ts.Diagnostics.Did_you_forget_to_use_await); } else { - var missingProperty = ts.declarationNameToString(propNode); - var container = typeToString(containingType); - var libSuggestion = getSuggestedLibForNonExistentProperty(missingProperty, containingType); - if (libSuggestion !== undefined) { - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later, missingProperty, container, libSuggestion); + var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); + if (suggestion !== undefined) { + var suggestedName = ts.symbolName(suggestion); + errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, ts.declarationNameToString(propNode), typeToString(containingType), suggestedName); + relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName); } else { - var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); - if (suggestion !== undefined) { - var suggestedName = ts.symbolName(suggestion); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, missingProperty, container, suggestedName); - relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName); - } - else { - errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, missingProperty, container); - } + errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(propNode), typeToString(containingType)); } } } @@ -67110,34 +65355,6 @@ var ts; var prop = containingType.symbol && getPropertyOfType(getTypeOfSymbol(containingType.symbol), propName); return prop !== undefined && prop.valueDeclaration && ts.hasSyntacticModifier(prop.valueDeclaration, 32 /* Static */); } - function getSuggestedLibForNonExistentName(name) { - var missingName = diagnosticName(name); - var allFeatures = ts.getScriptTargetFeatures(); - var libTargets = ts.getOwnKeys(allFeatures); - for (var _i = 0, libTargets_1 = libTargets; _i < libTargets_1.length; _i++) { - var libTarget = libTargets_1[_i]; - var containingTypes = ts.getOwnKeys(allFeatures[libTarget]); - if (containingTypes !== undefined && ts.contains(containingTypes, missingName)) { - return libTarget; - } - } - } - function getSuggestedLibForNonExistentProperty(missingProperty, containingType) { - var container = getApparentType(containingType).symbol; - if (!container) { - return undefined; - } - var allFeatures = ts.getScriptTargetFeatures(); - var libTargets = ts.getOwnKeys(allFeatures); - for (var _i = 0, libTargets_2 = libTargets; _i < libTargets_2.length; _i++) { - var libTarget = libTargets_2[_i]; - var featuresOfLib = allFeatures[libTarget]; - var featuresOfContainingType = featuresOfLib[ts.symbolName(container)]; - if (featuresOfContainingType !== undefined && ts.contains(featuresOfContainingType, missingProperty)) { - return libTarget; - } - } - } function getSuggestedSymbolForNonexistentProperty(name, containingType) { return getSpellingSuggestionForName(ts.isString(name) ? name : ts.idText(name), getPropertiesOfType(containingType), 111551 /* Value */); } @@ -67258,16 +65475,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 105 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 195 /* ImportType */: + case 192 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 201 /* PropertyAccessExpression */ && node.expression.kind === 105 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 198 /* PropertyAccessExpression */ && node.expression.kind === 105 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -67290,7 +65507,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 250 /* VariableDeclarationList */) { + if (initializer.kind === 247 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -67319,7 +65536,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 238 /* ForInStatement */ && + if (node.kind === 235 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -67356,7 +65573,7 @@ var ts; var accessFlags = ts.isAssignmentTarget(node) ? 2 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 /* NoIndexSignatures */ : 0) : 0 /* None */; - var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, accessFlags | 16 /* ExpressionPosition */) || errorType; + var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType; return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node); } function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { @@ -67403,13 +65620,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 161 /* Decorator */) { + else if (node.kind !== 160 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -67473,7 +65690,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 220 /* SpreadElement */ || arg.kind === 227 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 217 /* SpreadElement */ || arg.kind === 224 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -67481,18 +65698,15 @@ var ts; function acceptsVoid(t) { return !!(t.flags & 16384 /* Void */); } - function acceptsVoidUndefinedUnknownOrAny(t) { - return !!(t.flags & (16384 /* Void */ | 32768 /* Undefined */ | 2 /* Unknown */ | 1 /* Any */)); - } function hasCorrectArity(node, args, signature, signatureHelpTrailingComma) { if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } var argCount; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 218 /* TemplateExpression */) { + if (node.template.kind === 215 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -67507,7 +65721,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 161 /* Decorator */) { + else if (node.kind === 160 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -67521,7 +65735,7 @@ var ts; } else if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 204 /* NewExpression */); + ts.Debug.assert(node.kind === 201 /* NewExpression */); return getMinArgumentCount(signature) === 0; } else { @@ -67545,7 +65759,7 @@ var ts; } for (var i = argCount; i < effectiveMinimumArguments; i++) { var type = getTypeAtPosition(signature, i); - if (filterType(type, ts.isInJSFile(node) && !strictNullChecks ? acceptsVoidUndefinedUnknownOrAny : acceptsVoid).flags & 131072 /* Never */) { + if (filterType(type, acceptsVoid).flags & 131072 /* Never */) { return false; } } @@ -67615,7 +65829,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 161 /* Decorator */) { + if (node.kind !== 160 /* Decorator */) { var contextualType = getContextualType(node, ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); }) ? 8 /* SkipBindingPatterns */ : 0 /* None */); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -67664,7 +65878,7 @@ var ts; } for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 222 /* OmittedExpression */) { + if (arg.kind !== 219 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -67688,7 +65902,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return getMutableArrayOrTupleType(arg.kind === 227 /* SyntheticExpression */ ? arg.type : + return getMutableArrayOrTupleType(arg.kind === 224 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode)); } } @@ -67698,24 +65912,24 @@ var ts; for (var i = index; i < argCount; i++) { var arg = args[i]; if (isSpreadArgument(arg)) { - var spreadType = arg.kind === 227 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); + var spreadType = arg.kind === 224 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); if (isArrayLikeType(spreadType)) { types.push(spreadType); flags.push(8 /* Variadic */); } else { - types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 220 /* SpreadElement */ ? arg.expression : arg)); + types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 217 /* SpreadElement */ ? arg.expression : arg)); flags.push(4 /* Rest */); } } else { var contextualType = getIndexedAccessType(restType, getLiteralType(i - index)); var argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode); - var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */); types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(1 /* Required */); } - if (arg.kind === 227 /* SyntheticExpression */ && arg.tupleNameSource) { + if (arg.kind === 224 /* SyntheticExpression */ && arg.tupleNameSource) { names.push(arg.tupleNameSource); } } @@ -67856,7 +66070,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 204 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 201 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -67886,7 +66100,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 222 /* OmittedExpression */) { + if (arg.kind !== 219 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -67927,7 +66141,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -67944,17 +66158,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 218 /* TemplateExpression */) { + if (template.kind === 215 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 161 /* Decorator */) { + if (node.kind === 160 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -67965,10 +66179,10 @@ var ts; if (spreadIndex >= 0) { // Create synthetic arguments from spreads of tuple types. var effectiveArgs_1 = args.slice(0, spreadIndex); - var _loop_20 = function (i) { + var _loop_19 = function (i) { var arg = args[i]; // We can call checkExpressionCached because spread expressions never have a contextual type. - var spreadType = arg.kind === 220 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); + var spreadType = arg.kind === 217 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); if (spreadType && isTupleType(spreadType)) { ts.forEach(getTypeArguments(spreadType), function (t, i) { var _a; @@ -67982,7 +66196,7 @@ var ts; } }; for (var i = spreadIndex; i < args.length; i++) { - _loop_20(i); + _loop_19(i); } return effectiveArgs_1; } @@ -67995,30 +66209,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 160 /* Parameter */: + case 159 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 166 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 165 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 163 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 162 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -68032,17 +66246,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return 1; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return 2; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 160 /* Parameter */: + case 159 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -68073,20 +66287,6 @@ var ts; return ts.createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); } } - function isPromiseResolveArityError(node) { - if (!ts.isCallExpression(node) || !ts.isIdentifier(node.expression)) - return false; - var symbol = resolveName(node.expression, node.expression.escapedText, 111551 /* Value */, undefined, undefined, false); - var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration; - if (!decl || !ts.isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !ts.isNewExpression(decl.parent.parent) || !ts.isIdentifier(decl.parent.parent.expression)) { - return false; - } - var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(/*reportErrors*/ false); - if (!globalPromiseSymbol) - return false; - var constructorSymbol = getSymbolAtLocation(decl.parent.parent.expression, /*ignoreErrors*/ true); - return constructorSymbol === globalPromiseSymbol; - } function getArgumentArityError(node, signatures, args) { var min = Number.POSITIVE_INFINITY; var max = Number.NEGATIVE_INFINITY; @@ -68118,15 +66318,9 @@ var ts; } var spanArray; var related; - var error = hasRestParameter || hasSpreadArgument ? - hasRestParameter && hasSpreadArgument ? - ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more : - hasRestParameter ? - ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 : - ts.Diagnostics.Expected_0_arguments_but_got_1_or_more : - paramRange === 1 && argCount === 0 && isPromiseResolveArityError(node) ? - ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : - ts.Diagnostics.Expected_0_arguments_but_got_1; + var error = hasRestParameter || hasSpreadArgument ? hasRestParameter && hasSpreadArgument ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more : + hasRestParameter ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 : + ts.Diagnostics.Expected_0_arguments_but_got_1_or_more : ts.Diagnostics.Expected_0_arguments_but_got_1; if (closestSignature && getMinArgumentCount(closestSignature) > argCount && closestSignature.declaration) { var paramDecl = closestSignature.declaration.parameters[closestSignature.thisParameter ? argCount + 1 : argCount]; if (paramDecl) { @@ -68189,8 +66383,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 205 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 161 /* Decorator */; + var isTaggedTemplate = node.kind === 202 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 160 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray && produceDiagnostics; var typeArguments; @@ -68252,7 +66446,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 203 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 200 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -68264,10 +66458,10 @@ var ts; // is just important for choosing the best signature. So in the case where there is only one // signature, the subtype pass is useless. So skipping it is an optimization. if (candidates.length > 1) { - result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma); } if (!result) { - result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + result = chooseOverload(candidates, assignableRelation, signatureHelpTrailingComma); } if (result) { return result; @@ -68292,7 +66486,6 @@ var ts; if (last_2.declaration && candidatesForArgumentError.length > 3) { ts.addRelatedInfo(d, ts.createDiagnosticForNode(last_2.declaration, ts.Diagnostics.The_last_overload_is_declared_here)); } - addImplementationSuccessElaboration(last_2, d); diagnostics.add(d); } } @@ -68306,7 +66499,7 @@ var ts; var min_3 = Number.MAX_VALUE; var minIndex = 0; var i_1 = 0; - var _loop_21 = function (c) { + var _loop_20 = function (c) { var chain_2 = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); }; var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* Normal */, /*reportErrors*/ true, chain_2); if (diags_2) { @@ -68324,24 +66517,19 @@ var ts; }; for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) { var c = candidatesForArgumentError_1[_a]; - _loop_21(c); + _loop_20(c); } var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics); ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures"); var chain = ts.chainDiagnosticMessages(ts.map(diags_3, function (d) { return typeof d.messageText === "string" ? d : d.messageText; }), ts.Diagnostics.No_overload_matches_this_call); - // The below is a spread to guarantee we get a new (mutable) array - our `flatMap` helper tries to do "smart" optimizations where it reuses input - // arrays and the emptyArray singleton where possible, which is decidedly not what we want while we're still constructing this diagnostic - var related = __spreadArrays(ts.flatMap(diags_3, function (d) { return d.relatedInformation; })); - var diag = void 0; + var related = ts.flatMap(diags_3, function (d) { return d.relatedInformation; }); if (ts.every(diags_3, function (d) { return d.start === diags_3[0].start && d.length === diags_3[0].length && d.file === diags_3[0].file; })) { var _b = diags_3[0], file = _b.file, start = _b.start, length_6 = _b.length; - diag = { file: file, start: start, length: length_6, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }; + diagnostics.add({ file: file, start: start, length: length_6, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }); } else { - diag = ts.createDiagnosticForNodeFromMessageChain(node, chain, related); + diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(node, chain, related)); } - addImplementationSuccessElaboration(candidatesForArgumentError[0], diag); - diagnostics.add(diag); } } else if (candidateForArgumentArityError) { @@ -68364,26 +66552,7 @@ var ts; } } return getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray); - function addImplementationSuccessElaboration(failed, diagnostic) { - var _a, _b; - var oldCandidatesForArgumentError = candidatesForArgumentError; - var oldCandidateForArgumentArityError = candidateForArgumentArityError; - var oldCandidateForTypeArgumentError = candidateForTypeArgumentError; - var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray; - var isOverload = failedSignatureDeclarations.length > 1; - var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined; - if (implDecl) { - var candidate = getSignatureFromDeclaration(implDecl); - var isSingleNonGenericCandidate_1 = !candidate.typeParameters; - if (chooseOverload([candidate], assignableRelation, isSingleNonGenericCandidate_1)) { - ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(implDecl, ts.Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible)); - } - } - candidatesForArgumentError = oldCandidatesForArgumentError; - candidateForArgumentArityError = oldCandidateForArgumentArityError; - candidateForTypeArgumentError = oldCandidateForTypeArgumentError; - } - function chooseOverload(candidates, relation, isSingleNonGenericCandidate, signatureHelpTrailingComma) { + function chooseOverload(candidates, relation, signatureHelpTrailingComma) { if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } candidatesForArgumentError = undefined; candidateForArgumentArityError = undefined; @@ -68482,7 +66651,7 @@ var ts; } var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max; var parameters = []; - var _loop_22 = function (i) { + var _loop_21 = function (i) { var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ? i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) : i < s.parameters.length ? s.parameters[i] : undefined; }); @@ -68490,7 +66659,7 @@ var ts; parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); }))); }; for (var i = 0; i < maxNonRestParam; i++) { - _loop_22(i); + _loop_21(i); } var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; }); var flags = 0 /* None */; @@ -68793,7 +66962,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedEffectiveModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 166 /* Constructor */) { + if (!modifiers || declaration.kind !== 165 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -68825,8 +66994,8 @@ var ts; if (apparentType.flags & 1048576 /* Union */) { var types = apparentType.types; var hasSignatures = false; - for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { - var constituent = types_19[_i]; + for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { + var constituent = types_18[_i]; var signatures = getSignaturesOfType(constituent, kind); if (signatures.length !== 0) { hasSignatures = true; @@ -68922,11 +67091,6 @@ var ts; return resolveUntypedCall(node); } if (!callSignatures.length) { - if (ts.isArrayLiteralExpression(node.parent)) { - var diagnostic = ts.createDiagnosticForNode(node.tag, ts.Diagnostics.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked); - diagnostics.add(diagnostic); - return resolveErrorCall(node); - } invocationError(node.tag, apparentType, 0 /* Call */); return resolveErrorCall(node); } @@ -68937,16 +67101,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 160 /* Parameter */: + case 159 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -69005,10 +67169,6 @@ var ts; var result = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); var fakeSignature = createSignatureForJSXIntrinsic(node, result); checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), /*mapper*/ undefined, 0 /* Normal */), result, node.tagName, node.attributes); - if (ts.length(node.typeArguments)) { - ts.forEach(node.typeArguments, checkSourceElement); - diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), node.typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, 0, ts.length(node.typeArguments))); - } return fakeSignature; } var exprTypes = checkExpression(node.tagName); @@ -69041,16 +67201,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 161 /* Decorator */: + case 160 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -69128,61 +67288,20 @@ var ts; } } function getAssignedClassSymbol(decl) { - var _a; - var assignmentSymbol = decl && getSymbolOfExpando(decl, /*allowDeclaration*/ true); - var prototype = (_a = assignmentSymbol === null || assignmentSymbol === void 0 ? void 0 : assignmentSymbol.exports) === null || _a === void 0 ? void 0 : _a.get("prototype"); - var init = (prototype === null || prototype === void 0 ? void 0 : prototype.valueDeclaration) && getAssignedJSPrototype(prototype.valueDeclaration); + var assignmentSymbol = decl && decl.parent && + (ts.isFunctionDeclaration(decl) && getSymbolOfNode(decl) || + ts.isBinaryExpression(decl.parent) && getSymbolOfNode(decl.parent.left) || + ts.isVariableDeclaration(decl.parent) && getSymbolOfNode(decl.parent)); + var prototype = assignmentSymbol && assignmentSymbol.exports && assignmentSymbol.exports.get("prototype"); + var init = prototype && prototype.valueDeclaration && getAssignedJSPrototype(prototype.valueDeclaration); return init ? getSymbolOfNode(init) : undefined; } - function getSymbolOfExpando(node, allowDeclaration) { - if (!node.parent) { - return undefined; - } - var name; - var decl; - if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) { - if (!ts.isInJSFile(node) && !(ts.isVarConst(node.parent) && ts.isFunctionLikeDeclaration(node))) { - return undefined; - } - name = node.parent.name; - decl = node.parent; - } - else if (ts.isBinaryExpression(node.parent)) { - var parentNode = node.parent; - var parentNodeOperator = node.parent.operatorToken.kind; - if (parentNodeOperator === 62 /* EqualsToken */ && (allowDeclaration || parentNode.right === node)) { - name = parentNode.left; - decl = name; - } - else if (parentNodeOperator === 56 /* BarBarToken */ || parentNodeOperator === 60 /* QuestionQuestionToken */) { - if (ts.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { - name = parentNode.parent.name; - decl = parentNode.parent; - } - else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 /* EqualsToken */ && (allowDeclaration || parentNode.parent.right === parentNode)) { - name = parentNode.parent.left; - decl = name; - } - if (!name || !ts.isBindableStaticNameExpression(name) || !ts.isSameEntityName(name, parentNode.left)) { - return undefined; - } - } - } - else if (allowDeclaration && ts.isFunctionDeclaration(node)) { - name = node.name; - decl = node; - } - if (!decl || !name || (!allowDeclaration && !ts.getExpandoInitializer(node, ts.isPrototypeAccess(name)))) { - return undefined; - } - return getSymbolOfNode(decl); - } function getAssignedJSPrototype(node) { if (!node.parent) { return false; } var parent = node.parent; - while (parent && parent.kind === 201 /* PropertyAccessExpression */) { + while (parent && parent.kind === 198 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -69209,12 +67328,12 @@ var ts; if (node.expression.kind === 105 /* SuperKeyword */) { return voidType; } - if (node.kind === 204 /* NewExpression */) { + if (node.kind === 201 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 166 /* Constructor */ && - declaration.kind !== 170 /* ConstructSignature */ && - declaration.kind !== 175 /* ConstructorType */ && + declaration.kind !== 165 /* Constructor */ && + declaration.kind !== 169 /* ConstructSignature */ && + declaration.kind !== 174 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -69234,7 +67353,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 203 /* CallExpression */ && node.parent.kind === 233 /* ExpressionStatement */ && + if (node.kind === 200 /* CallExpression */ && node.parent.kind === 230 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -69245,11 +67364,14 @@ var ts; } } if (ts.isInJSFile(node)) { - var jsSymbol = getSymbolOfExpando(node, /*allowDeclaration*/ false); - if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) { - var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined); - jsAssignmentType.objectFlags |= 16384 /* JSLiteral */; - return getIntersectionType([returnType, jsAssignmentType]); + var decl = ts.getDeclarationOfExpando(node); + if (decl) { + var jsSymbol = getSymbolOfNode(decl); + if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) { + var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined); + jsAssignmentType.objectFlags |= 16384 /* JSLiteral */; + return getIntersectionType([returnType, jsAssignmentType]); + } } } return returnType; @@ -69263,20 +67385,20 @@ var ts; function getDeprecatedSuggestionNode(node) { node = ts.skipParentheses(node); switch (node.kind) { - case 203 /* CallExpression */: - case 161 /* Decorator */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 160 /* Decorator */: + case 201 /* NewExpression */: return getDeprecatedSuggestionNode(node.expression); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return getDeprecatedSuggestionNode(node.tag); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return getDeprecatedSuggestionNode(node.tagName); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return node.argumentExpression; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.name; - case 173 /* TypeReference */: + case 172 /* TypeReference */: var typeReference = node; return ts.isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference; default: @@ -69335,7 +67457,6 @@ var ts; if (hasSyntheticDefault) { var memberTable = ts.createSymbolTable(); var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */); - newSymbol.parent = originalSymbol; newSymbol.nameType = getLiteralType("default"); newSymbol.target = resolveSymbol(symbol); memberTable.set("default" /* Default */, newSymbol); @@ -69368,9 +67489,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 251 /* FunctionDeclaration */ + ? 248 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 249 /* VariableDeclaration */ + ? 246 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -69400,19 +67521,18 @@ var ts; case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 218 /* TemplateExpression */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return true; - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -69468,7 +67588,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 166 /* Constructor */) { + else if (container.kind === 165 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -69478,8 +67598,8 @@ var ts; } } function checkImportMetaProperty(node) { - if (moduleKind !== ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) { - error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system); + if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) { + error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system); } var file = ts.getSourceFileOfNode(node); ts.Debug.assert(!!(file.flags & 2097152 /* PossiblyContainsImportMeta */), "Containing file is missing import meta node flag."); @@ -69515,7 +67635,7 @@ var ts; return restParameter.escapedName; } function isValidDeclarationForTupleLabel(d) { - return d.kind === 192 /* NamedTupleMember */ || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name)); + return d.kind === 191 /* NamedTupleMember */ || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name)); } function getNameableDeclarationAtPosition(signature, pos) { var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); @@ -69588,40 +67708,21 @@ var ts; } return length; } - function getMinArgumentCount(signature, flags) { - var strongArityForUntypedJS = flags & 1 /* StrongArityForUntypedJS */; - var voidIsNonOptional = flags & 2 /* VoidIsNonOptional */; - if (voidIsNonOptional || signature.resolvedMinArgumentCount === undefined) { - var minArgumentCount = void 0; - if (signatureHasRestParameter(signature)) { - var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - if (isTupleType(restType)) { - var firstOptionalIndex = ts.findIndex(restType.target.elementFlags, function (f) { return !(f & 1 /* Required */); }); - var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; - if (requiredCount > 0) { - minArgumentCount = signature.parameters.length - 1 + requiredCount; - } + function getMinArgumentCount(signature, strongArityForUntypedJS) { + if (signatureHasRestParameter(signature)) { + var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + if (isTupleType(restType)) { + var firstOptionalIndex = ts.findIndex(restType.target.elementFlags, function (f) { return !(f & 1 /* Required */); }); + var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; + if (requiredCount > 0) { + return signature.parameters.length - 1 + requiredCount; } } - if (minArgumentCount === undefined) { - if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { - return 0; - } - minArgumentCount = signature.minArgumentCount; - } - if (voidIsNonOptional) { - return minArgumentCount; - } - for (var i = minArgumentCount - 1; i >= 0; i--) { - var type = getTypeAtPosition(signature, i); - if (filterType(type, acceptsVoid).flags & 131072 /* Never */) { - break; - } - minArgumentCount = i; - } - signature.resolvedMinArgumentCount = minArgumentCount; } - return signature.resolvedMinArgumentCount; + if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { + return 0; + } + return signature.minArgumentCount; } function hasEffectiveRestParameter(signature) { if (signatureHasRestParameter(signature)) { @@ -69787,7 +67888,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 230 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 227 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -69972,7 +68073,7 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 211 /* TypeOfExpression */) { + if (node.expression.kind === 208 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. @@ -70035,11 +68136,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; - case 165 /* MethodDeclaration */: - return func.parent.kind === 200 /* ObjectLiteralExpression */; + case 164 /* MethodDeclaration */: + return func.parent.kind === 197 /* ObjectLiteralExpression */; default: return false; } @@ -70065,7 +68166,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 164 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 230 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 163 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 227 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -70098,7 +68199,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -70122,7 +68223,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 208 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 205 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -70168,7 +68269,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -70181,7 +68282,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 230 /* Block */) { + if (node.body.kind === 227 /* Block */) { checkSourceElement(node.body); } else { @@ -70271,7 +68372,7 @@ var ts; expr.expression.kind === 107 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && (ctor.kind === 166 /* Constructor */ || isJSConstructor(ctor)))) { + if (!(ctor && (ctor.kind === 165 /* Constructor */ || isJSConstructor(ctor)))) { return true; } if (symbol.valueDeclaration) { @@ -70296,7 +68397,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 263 /* NamespaceImport */; + return !!declaration && declaration.kind === 260 /* NamespaceImport */; } } } @@ -70377,7 +68478,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 166 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 165 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -70479,8 +68580,8 @@ var ts; } if (type.flags & 3145728 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { - var t = types_20[_i]; + for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { + var t = types_19[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -70497,7 +68598,7 @@ var ts; } return !!(kind & 296 /* NumberLike */) && isTypeAssignableTo(source, numberType) || !!(kind & 2112 /* BigIntLike */) && isTypeAssignableTo(source, bigintType) || - !!(kind & 402653316 /* StringLike */) && isTypeAssignableTo(source, stringType) || + !!(kind & 132 /* StringLike */) && isTypeAssignableTo(source, stringType) || !!(kind & 528 /* BooleanLike */) && isTypeAssignableTo(source, booleanType) || !!(kind & 16384 /* Void */) && isTypeAssignableTo(source, voidType) || !!(kind & 131072 /* Never */) && isTypeAssignableTo(source, neverType) || @@ -70546,8 +68647,8 @@ var ts; // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, // and the right operand to be of type Any, an object type, or a type parameter type. // The result is always of the Boolean primitive type. - if (!(allTypesAssignableToKind(leftType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) || - isTypeAssignableToKind(leftType, 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */ | 262144 /* TypeParameter */))) { + if (!(allTypesAssignableToKind(leftType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) || + isTypeAssignableToKind(leftType, 4194304 /* Index */ | 262144 /* TypeParameter */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { @@ -70570,7 +68671,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 288 /* PropertyAssignment */ || property.kind === 289 /* ShorthandPropertyAssignment */) { + if (property.kind === 285 /* PropertyAssignment */ || property.kind === 286 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -70581,11 +68682,11 @@ var ts; checkPropertyAccessibility(property, /*isSuper*/ false, objectLiteralType, prop); } } - var elementType = getIndexedAccessType(objectLiteralType, exprType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */); + var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 289 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 286 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 290 /* SpreadAssignment */) { + else if (property.kind === 287 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -70619,28 +68720,23 @@ var ts; // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType; - var inBoundsType = compilerOptions.noUncheckedIndexedAccess ? undefined : possiblyOutOfBoundsType; + var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType; for (var i = 0; i < elements.length; i++) { - var type = possiblyOutOfBoundsType; - if (node.elements[i].kind === 220 /* SpreadElement */) { - type = inBoundsType = inBoundsType !== null && inBoundsType !== void 0 ? inBoundsType : (checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType); - } - checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode); + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode); } return sourceType; } function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 222 /* OmittedExpression */) { - if (element.kind !== 220 /* SpreadElement */) { + if (element.kind !== 219 /* OmittedExpression */) { + if (element.kind !== 217 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused // when the element is a SyntaxKind.ElementAccessExpression. - var accessFlags = 16 /* ExpressionPosition */ | (hasDefaultValue(element) ? 8 /* NoTupleBoundsCheck */ : 0); - var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, createSyntheticExpression(element, indexType), accessFlags) || errorType; + var accessFlags = hasDefaultValue(element) ? 8 /* NoTupleBoundsCheck */ : 0; + var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, createSyntheticExpression(element, indexType), accessFlags) || errorType; var assignedType = hasDefaultValue(element) ? getTypeWithFacts(elementType_2, 524288 /* NEUndefined */) : elementType_2; var type = getFlowTypeOfDestructuring(element, assignedType); return checkDestructuringAssignment(element, type, checkMode); @@ -70652,7 +68748,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 216 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 213 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -70668,7 +68764,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 289 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 286 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -70684,24 +68780,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 213 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 200 /* ObjectLiteralExpression */) { + if (target.kind === 197 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 199 /* ArrayLiteralExpression */) { + if (target.kind === 196 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 290 /* SpreadAssignment */ ? + var error = target.parent.kind === 287 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 290 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 287 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -70726,36 +68822,36 @@ var ts; case 78 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 205 /* TaggedTemplateExpression */: - case 218 /* TemplateExpression */: + case 202 /* TaggedTemplateExpression */: + case 215 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: case 103 /* NullKeyword */: - case 150 /* UndefinedKeyword */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: - case 209 /* ArrowFunction */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 211 /* TypeOfExpression */: - case 225 /* NonNullExpression */: - case 274 /* JsxSelfClosingElement */: - case 273 /* JsxElement */: + case 149 /* UndefinedKeyword */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 208 /* TypeOfExpression */: + case 222 /* NonNullExpression */: + case 271 /* JsxSelfClosingElement */: + case 270 /* JsxElement */: return true; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -70767,9 +68863,9 @@ var ts; } return false; // Some forms listed here for clarity - case 212 /* VoidExpression */: // Explicit opt-out - case 206 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 224 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 209 /* VoidExpression */: // Explicit opt-out + case 203 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 221 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -70801,7 +68897,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 200 /* ObjectLiteralExpression */ || node.left.kind === 199 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 197 /* ObjectLiteralExpression */ || node.left.kind === 196 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 107 /* ThisKeyword */)); break; } @@ -70868,7 +68964,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 200 /* ObjectLiteralExpression */ || left.kind === 199 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 197 /* ObjectLiteralExpression */ || left.kind === 196 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 107 /* ThisKeyword */); } var leftType; @@ -70961,7 +69057,7 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeAssignableToKind(leftType, 402653316 /* StringLike */) && !isTypeAssignableToKind(rightType, 402653316 /* StringLike */)) { + if (!isTypeAssignableToKind(leftType, 132 /* StringLike */) && !isTypeAssignableToKind(rightType, 132 /* StringLike */)) { leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); } @@ -70975,7 +69071,7 @@ var ts; // If both operands are of the BigInt primitive type, the result is of the BigInt primitive type. resultType = bigintType; } - else if (isTypeAssignableToKind(leftType, 402653316 /* StringLike */, /*strict*/ true) || isTypeAssignableToKind(rightType, 402653316 /* StringLike */, /*strict*/ true)) { + else if (isTypeAssignableToKind(leftType, 132 /* StringLike */, /*strict*/ true) || isTypeAssignableToKind(rightType, 132 /* StringLike */, /*strict*/ true)) { // If one or both operands are of the String primitive type, the result is of the String primitive type. resultType = stringType; } @@ -70993,7 +69089,7 @@ var ts; // If both types have an awaited type of one of these, we'll assume the user // might be missing an await without doing an exhaustive check that inserting // await(s) will actually be a completely valid binary expression. - var closeEnoughKind_1 = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 3 /* AnyOrUnknown */; + var closeEnoughKind_1 = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 3 /* AnyOrUnknown */; reportOperatorError(function (left, right) { return isTypeAssignableToKind(left, closeEnoughKind_1) && isTypeAssignableToKind(right, closeEnoughKind_1); @@ -71294,21 +69390,20 @@ var ts; return getUnionType([type1, type2], 2 /* Subtype */); } function checkTemplateExpression(node) { - var texts = [node.head.text]; - var types = []; - for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) { - var span = _a[_i]; - var type = checkExpression(span.expression); - if (maybeTypeOfKind(type, 12288 /* ESSymbolLike */)) { - error(span.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); + // We just want to check each expressions, but we are unconcerned with + // the type of each expression, as any value may be coerced into a string. + // It is worth asking whether this is what we really want though. + // A place where we actually *are* concerned with the expressions' types are + // in tagged templates. + ts.forEach(node.templateSpans, function (templateSpan) { + if (maybeTypeOfKind(checkExpression(templateSpan.expression), 12288 /* ESSymbolLike */)) { + error(templateSpan.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); } - texts.push(span.literal.text); - types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType); - } - return isConstContext(node) ? getTemplateLiteralType(texts, types) : stringType; + }); + return stringType; } function getContextNode(node) { - if (node.kind === 281 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 278 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -71357,13 +69452,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 206 /* TypeAssertionExpression */ || node.kind === 224 /* AsExpression */; + return node.kind === 203 /* TypeAssertionExpression */ || node.kind === 221 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 197 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 194 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -71373,7 +69468,7 @@ var ts; var elementFlags = type.target.elementFlags.slice(); for (var i = getTypeReferenceArity(type); i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 198 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 195 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); elementFlags.push(2 /* Optional */); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { @@ -71416,7 +69511,7 @@ var ts; } // If the contextual type is a literal of a particular primitive type, we consider this a // literal context for all literals of that primitive type. - return !!(contextualType.flags & (128 /* StringLiteral */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || + return !!(contextualType.flags & (128 /* StringLiteral */ | 4194304 /* Index */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || contextualType.flags & 256 /* NumberLiteral */ && maybeTypeOfKind(candidateType, 256 /* NumberLiteral */) || contextualType.flags & 2048 /* BigIntLiteral */ && maybeTypeOfKind(candidateType, 2048 /* BigIntLiteral */) || contextualType.flags & 512 /* BooleanLiteral */ && maybeTypeOfKind(candidateType, 512 /* BooleanLiteral */) || @@ -71428,7 +69523,7 @@ var ts; var parent = node.parent; return ts.isAssertionExpression(parent) && ts.isConstTypeReference(parent.type) || (ts.isParenthesizedExpression(parent) || ts.isArrayLiteralExpression(parent) || ts.isSpreadElement(parent)) && isConstContext(parent) || - (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent) || ts.isTemplateSpan(parent)) && isConstContext(parent.parent); + (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent)) && isConstContext(parent.parent); } function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) { var type = checkExpression(node, checkMode, forceTuple); @@ -71440,7 +69535,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -71451,7 +69546,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -71669,7 +69764,6 @@ var ts; } } function checkExpression(node, checkMode, forceTuple) { - ts.tracing.push("check" /* Check */, "checkExpression", { kind: node.kind, pos: node.pos, end: node.end }); var saveCurrentNode = currentNode; currentNode = node; instantiationCount = 0; @@ -71679,7 +69773,6 @@ var ts; checkConstEnumAccess(node, type); } currentNode = saveCurrentNode; - ts.tracing.pop(); return type; } function checkConstEnumAccess(node, type) { @@ -71687,11 +69780,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 202 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 176 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 270 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 199 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 78 /* Identifier */ || node.kind === 156 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 175 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 267 /* ExportSpecifier */); // We allow reexporting const enums if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -71716,9 +69809,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -71744,78 +69837,78 @@ var ts; return trueType; case 94 /* FalseKeyword */: return falseType; - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return checkQualifiedName(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (node.expression.kind === 99 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 204 /* NewExpression */: + case 201 /* NewExpression */: return checkCallExpression(node, checkMode); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return checkClassExpression(node); - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return checkAssertion(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return checkNonNullAssertion(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return checkMetaProperty(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return checkDeleteExpression(node); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return checkVoidExpression(node); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return checkAwaitExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 222 /* OmittedExpression */: + case 219 /* OmittedExpression */: return undefinedWideningType; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return checkYieldExpression(node); - case 227 /* SyntheticExpression */: + case 224 /* SyntheticExpression */: return checkSyntheticExpression(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return checkJsxElement(node, checkMode); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return checkJsxFragment(node); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -71852,10 +69945,10 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 166 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 165 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 166 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 165 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -71866,13 +69959,13 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 166 /* Constructor */ || func.kind === 170 /* ConstructSignature */ || func.kind === 175 /* ConstructorType */) { + if (func.kind === 165 /* Constructor */ || func.kind === 169 /* ConstructSignature */ || func.kind === 174 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 209 /* ArrowFunction */) { + if (func.kind === 206 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 167 /* GetAccessor */ || func.kind === 168 /* SetAccessor */) { + if (func.kind === 166 /* GetAccessor */ || func.kind === 167 /* SetAccessor */) { error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -71930,13 +70023,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 209 /* ArrowFunction */: - case 169 /* CallSignature */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 174 /* FunctionType */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 206 /* ArrowFunction */: + case 168 /* CallSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 173 /* FunctionType */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -71954,7 +70047,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 197 /* ArrayBindingPattern */ || name.kind === 196 /* ObjectBindingPattern */) { + else if (name.kind === 194 /* ArrayBindingPattern */ || name.kind === 193 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -71963,13 +70056,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 171 /* IndexSignature */) { + if (node.kind === 170 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 174 /* FunctionType */ || node.kind === 251 /* FunctionDeclaration */ || node.kind === 175 /* ConstructorType */ || - node.kind === 169 /* CallSignature */ || node.kind === 166 /* Constructor */ || - node.kind === 170 /* ConstructSignature */) { + else if (node.kind === 173 /* FunctionType */ || node.kind === 248 /* FunctionDeclaration */ || node.kind === 174 /* ConstructorType */ || + node.kind === 168 /* CallSignature */ || node.kind === 165 /* Constructor */ || + node.kind === 169 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -71999,10 +70092,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -72032,7 +70125,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 171 /* IndexSignature */ && node.kind !== 308 /* JSDocFunctionType */) { + if (node.kind !== 170 /* IndexSignature */ && node.kind !== 304 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -72044,7 +70137,7 @@ var ts; var privateIdentifiers = new ts.Map(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 166 /* Constructor */) { + if (member.kind === 165 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -72064,16 +70157,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -72136,7 +70229,7 @@ var ts; var names = new ts.Map(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 162 /* PropertySignature */) { + if (member.kind === 161 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -72161,7 +70254,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 253 /* InterfaceDeclaration */) { + if (node.kind === 250 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -72181,7 +70274,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -72189,7 +70282,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -72231,7 +70324,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 165 /* MethodDeclaration */ && node.body) { + if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 164 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -72259,7 +70352,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 163 /* PropertyDeclaration */ && + return n.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(n, 32 /* Static */) && !!n.initializer; } @@ -72290,7 +70383,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_4 = statements; _i < statements_4.length; _i++) { var statement = statements_4[_i]; - if (statement.kind === 233 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 230 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -72315,7 +70408,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -72325,7 +70418,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -72334,7 +70427,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + var otherKind = node.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getEffectiveModifierFlags(node); @@ -72352,7 +70445,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -72400,7 +70493,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 173 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 172 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -72449,27 +70542,28 @@ var ts; function checkTupleType(node) { var elementTypes = node.elements; var seenOptionalElement = false; - var seenRestElement = false; - var hasNamedElement = ts.some(elementTypes, ts.isNamedTupleMember); + var seenNamedElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind !== 192 /* NamedTupleMember */ && hasNamedElement) { + if (e.kind === 191 /* NamedTupleMember */) { + seenNamedElement = true; + } + else if (seenNamedElement) { grammarErrorOnNode(e, ts.Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names); break; } var flags = getTupleElementFlags(e); if (flags & 8 /* Variadic */) { - var type = getTypeFromTypeNode(e.type); - if (!isArrayLikeType(type)) { + if (!isArrayLikeType(getTypeFromTypeNode(e.type))) { error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); break; } - if (isArrayType(type) || isTupleType(type) && type.target.combinedFlags & 4 /* Rest */) { - seenRestElement = true; - } } else if (flags & 4 /* Rest */) { - seenRestElement = true; + if (i !== elementTypes.length - 1) { + grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); + break; + } } else if (flags & 2 /* Optional */) { seenOptionalElement = true; @@ -72478,17 +70572,11 @@ var ts; grammarErrorOnNode(e, ts.Diagnostics.A_required_element_cannot_follow_an_optional_element); break; } - if (seenRestElement && i !== elementTypes.length - 1) { - grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); - break; - } } ts.forEach(node.elements, checkSourceElement); - getTypeFromTypeNode(node); } function checkUnionOrIntersectionType(node) { ts.forEach(node.types, checkSourceElement); - getTypeFromTypeNode(node); } function checkIndexedAccessIndexType(type, accessNode) { if (!(type.flags & 8388608 /* IndexedAccess */)) { @@ -72498,7 +70586,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 202 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 199 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -72530,20 +70618,13 @@ var ts; } function checkMappedType(node) { checkSourceElement(node.typeParameter); - checkSourceElement(node.nameType); checkSourceElement(node.type); if (!node.type) { reportImplicitAny(node, anyType); } var type = getTypeFromMappedTypeNode(node); - var nameType = getNameTypeFromMappedType(type); - if (nameType) { - checkTypeAssignableTo(nameType, keyofConstraintType, node.nameType); - } - else { - var constraintType = getConstraintTypeFromMappedType(type); - checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter)); - } + var constraintType = getConstraintTypeFromMappedType(type); + checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter)); } function checkThisType(node) { getTypeFromThisTypeNode(node); @@ -72556,21 +70637,12 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 184 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 183 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); registerForUnusedIdentifiersCheck(node); } - function checkTemplateLiteralType(node) { - for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) { - var span = _a[_i]; - checkSourceElement(span.type); - var type = getTypeFromTypeNode(span.type); - checkTypeAssignableTo(type, templateConstraintType, span.type); - } - getTypeFromTypeNode(node); - } function checkImportType(node) { checkSourceElement(node.argument); getTypeFromTypeNode(node); @@ -72579,10 +70651,10 @@ var ts; if (node.dotDotDotToken && node.questionToken) { grammarErrorOnNode(node, ts.Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest); } - if (node.type.kind === 180 /* OptionalType */) { + if (node.type.kind === 179 /* OptionalType */) { grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type); } - if (node.type.kind === 181 /* RestType */) { + if (node.type.kind === 180 /* RestType */) { grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type); } checkSourceElement(node.type); @@ -72595,9 +70667,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 253 /* InterfaceDeclaration */ && - n.parent.kind !== 252 /* ClassDeclaration */ && - n.parent.kind !== 221 /* ClassExpression */ && + if (n.parent.kind !== 250 /* InterfaceDeclaration */ && + n.parent.kind !== 249 /* ClassDeclaration */ && + n.parent.kind !== 218 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -72693,7 +70765,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */) && + var reportError = (node.kind === 164 /* MethodDeclaration */ || node.kind === 163 /* MethodSignature */) && ts.hasSyntacticModifier(node, 32 /* Static */) !== ts.hasSyntacticModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -72734,7 +70806,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent && (node.parent.kind === 253 /* InterfaceDeclaration */ || node.parent.kind === 177 /* TypeLiteral */) || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 250 /* InterfaceDeclaration */ || node.parent.kind === 176 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -72745,10 +70817,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 251 /* FunctionDeclaration */ || node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */ || node.kind === 166 /* Constructor */) { + if (node.kind === 248 /* FunctionDeclaration */ || node.kind === 164 /* MethodDeclaration */ || node.kind === 163 /* MethodSignature */ || node.kind === 165 /* Constructor */) { functionDeclarations.push(node); var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; @@ -72881,25 +70953,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return 2 /* ExportType */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -72907,17 +70979,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 262 /* ImportClause */: - var result_12 = 0 /* None */; + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 259 /* ImportClause */: + var result_11 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result_12 |= getDeclarationSpaces(d); }); - return result_12; - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: - case 251 /* FunctionDeclaration */: - case 265 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + ts.forEach(target.declarations, function (d) { result_11 |= getDeclarationSpaces(d); }); + return result_11; + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 248 /* FunctionDeclaration */: + case 262 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 78 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -73210,24 +71282,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 160 /* Parameter */: + case 159 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -73274,30 +71346,30 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 183 /* IntersectionType */: - case 182 /* UnionType */: + case 182 /* IntersectionType */: + case 181 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: return getEntityNameForDecoratorMetadata(node.type); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; } } } function getEntityNameForDecoratorMetadataFromTypeList(types) { var commonEntityName; - for (var _i = 0, types_21 = types; _i < types_21.length; _i++) { - var typeNode = types_21[_i]; - while (typeNode.kind === 186 /* ParenthesizedType */ || typeNode.kind === 192 /* NamedTupleMember */) { + for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { + var typeNode = types_20[_i]; + while (typeNode.kind === 185 /* ParenthesizedType */ || typeNode.kind === 191 /* NamedTupleMember */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 141 /* NeverKeyword */) { + if (typeNode.kind === 140 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 190 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 149 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -73343,14 +71415,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 160 /* Parameter */) { + if (node.kind === 159 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -73359,23 +71431,23 @@ var ts; } } break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + var otherKind = node.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 160 /* Parameter */: + case 159 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -73438,7 +71510,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 157 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 156 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -73482,7 +71554,7 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -73495,7 +71567,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 157 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -73517,11 +71589,14 @@ var ts; checkFunctionOrConstructorSymbol(localSymbol); } if (symbol.parent) { - // run check on export symbol to check that modifiers agree across all exported declarations - checkFunctionOrConstructorSymbol(symbol); + // run check once for the first declaration + if (ts.getDeclarationOfKind(symbol, node.kind) === node) { + // run check on export symbol to check that modifiers agree across all exported declarations + checkFunctionOrConstructorSymbol(symbol); + } } } - var body = node.kind === 164 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 163 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -73563,42 +71638,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 297 /* SourceFile */: - case 256 /* ModuleDeclaration */: - case 230 /* Block */: - case 258 /* CaseBlock */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 294 /* SourceFile */: + case 253 /* ModuleDeclaration */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 166 /* Constructor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 165 /* Constructor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 185 /* InferType */: + case 184 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -73618,11 +71693,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 165 /* MethodDeclaration */: - case 163 /* PropertyDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - if (member.kind === 168 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 164 /* MethodDeclaration */: + case 162 /* PropertyDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + if (member.kind === 167 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -73633,7 +71708,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 166 /* Constructor */: + case 165 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasSyntacticModifier(parameter, 8 /* Private */)) { @@ -73641,8 +71716,8 @@ var ts; } } break; - case 171 /* IndexSignature */: - case 229 /* SemicolonClassElement */: + case 170 /* IndexSignature */: + case 226 /* SemicolonClassElement */: // Can't be private break; default: @@ -73669,7 +71744,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 185 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 184 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (ts.tryAddToSet(seenParentsWithEveryUnused, parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -73761,7 +71836,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 263 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 260 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -73779,7 +71854,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 249 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 250 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 246 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 247 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -73800,7 +71875,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 232 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 229 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -73814,22 +71889,22 @@ var ts; switch (name.kind) { case 78 /* Identifier */: return ts.idText(name); - case 197 /* ArrayBindingPattern */: - case 196 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 262 /* ImportClause */ || node.kind === 265 /* ImportSpecifier */ || node.kind === 263 /* NamespaceImport */; + return node.kind === 259 /* ImportClause */ || node.kind === 262 /* ImportSpecifier */ || node.kind === 260 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 262 /* ImportClause */ ? decl : decl.kind === 263 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 259 /* ImportClause */ ? decl : decl.kind === 260 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 230 /* Block */) { + if (node.kind === 227 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -73859,12 +71934,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 163 /* PropertyDeclaration */ || - node.kind === 162 /* PropertySignature */ || - node.kind === 165 /* MethodDeclaration */ || - node.kind === 164 /* MethodSignature */ || - node.kind === 167 /* GetAccessor */ || - node.kind === 168 /* SetAccessor */) { + if (node.kind === 162 /* PropertyDeclaration */ || + node.kind === 161 /* PropertySignature */ || + node.kind === 164 /* MethodDeclaration */ || + node.kind === 163 /* MethodSignature */ || + node.kind === 166 /* GetAccessor */ || + node.kind === 167 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -73873,7 +71948,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 160 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 159 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -73930,7 +72005,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -73945,7 +72020,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -73980,7 +72055,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 249 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 246 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -73992,17 +72067,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 250 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 232 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 247 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 229 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 230 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 257 /* ModuleBlock */ || - container.kind === 256 /* ModuleDeclaration */ || - container.kind === 297 /* SourceFile */); + (container.kind === 227 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 254 /* ModuleBlock */ || + container.kind === 253 /* ModuleDeclaration */ || + container.kind === 294 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -74033,18 +72108,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 198 /* BindingElement */) { - if (node.parent.kind === 196 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 195 /* BindingElement */) { + if (node.parent.kind === 193 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 158 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -74065,19 +72140,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 197 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 194 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.isParameterDeclaration(node) && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 159 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 238 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 235 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -74103,12 +72178,7 @@ var ts; } return; } - // For a commonjs `const x = require`, validate the alias and exit var symbol = getSymbolOfNode(node); - if (symbol.flags & 2097152 /* Alias */ && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true)) { - checkAliasSymbol(node); - return; - } var type = convertAutoToAny(getTypeOfSymbol(symbol)); if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer @@ -74119,7 +72189,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && !!((_a = symbol.exports) === null || _a === void 0 ? void 0 : _a.size); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 238 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 235 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -74145,10 +72215,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */) { + if (node.kind !== 162 /* PropertyDeclaration */ && node.kind !== 161 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -74160,7 +72230,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 163 /* PropertyDeclaration */ || nextDeclaration.kind === 162 /* PropertySignature */ + var message = nextDeclaration.kind === 162 /* PropertyDeclaration */ || nextDeclaration.kind === 161 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -74170,8 +72240,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 160 /* Parameter */ && right.kind === 249 /* VariableDeclaration */) || - (left.kind === 249 /* VariableDeclaration */ && right.kind === 160 /* Parameter */)) { + if ((left.kind === 159 /* Parameter */ && right.kind === 246 /* VariableDeclaration */) || + (left.kind === 246 /* VariableDeclaration */ && right.kind === 159 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -74187,10 +72257,8 @@ var ts; return ts.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts.getSelectedEffectiveModifierFlags(right, interestingFlags); } function checkVariableDeclaration(node) { - ts.tracing.push("check" /* Check */, "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end }); checkGrammarVariableDeclaration(node); - checkVariableLikeDeclaration(node); - ts.tracing.pop(); + return checkVariableLikeDeclaration(node); } function checkBindingElement(node) { checkGrammarBindingElement(node); @@ -74213,7 +72281,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 231 /* EmptyStatement */) { + if (node.thenStatement.kind === 228 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -74306,12 +72374,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 247 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -74345,14 +72413,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node); // There may be a destructuring assignment on the left side - if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) { + if (varExpr.kind === 196 /* ArrayLiteralExpression */ || varExpr.kind === 197 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -74384,7 +72452,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -74398,7 +72466,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) { + if (varExpr.kind === 196 /* ArrayLiteralExpression */ || varExpr.kind === 197 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -74450,7 +72518,6 @@ var ts; } var uplevelIteration = languageVersion >= 2 /* ES2015 */; var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; - var possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & 128 /* PossiblyOutOfBounds */); // Get the iterated type of an `Iterable` or `IterableIterator` only in ES2015 // or higher, when inside of an async generator or for-await-if, or when // downlevelIteration is requested. @@ -74470,7 +72537,7 @@ var ts; } } if (iterationTypes || uplevelIteration) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType) : (iterationTypes && iterationTypes.yieldType); + return iterationTypes && iterationTypes.yieldType; } } var arrayType = inputType; @@ -74484,12 +72551,12 @@ var ts; // After we remove all types that are StringLike, we will know if there was a string constituent // based on whether the result of filter is a new array. var arrayTypes = inputType.types; - var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 402653316 /* StringLike */); }); + var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 132 /* StringLike */); }); if (filteredTypes !== arrayTypes) { arrayType = getUnionType(filteredTypes, 2 /* Subtype */); } } - else if (arrayType.flags & 402653316 /* StringLike */) { + else if (arrayType.flags & 132 /* StringLike */) { arrayType = neverType; } hasStringConstituent = arrayType !== inputType; @@ -74503,7 +72570,7 @@ var ts; // Now that we've removed all the StringLike types, if no constituents remain, then the entire // arrayOrStringType was a string. if (arrayType.flags & 131072 /* Never */) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType; + return stringType; } } } @@ -74528,17 +72595,17 @@ var ts; : [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true], defaultDiagnostic = _a[0], maybeMissingAwait = _a[1]; errorAndMaybeSuggestAwait(errorNode, maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType), defaultDiagnostic, typeToString(arrayType)); } - return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType : undefined; + return hasStringConstituent ? stringType : undefined; } var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */); if (hasStringConstituent && arrayElementType) { // This is just an optimization for the case where arrayOrStringType is string | string[] - if (arrayElementType.flags & 402653316 /* StringLike */ && !compilerOptions.noUncheckedIndexedAccess) { + if (arrayElementType.flags & 132 /* StringLike */) { return stringType; } - return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2 /* Subtype */); + return getUnionType([arrayElementType, stringType], 2 /* Subtype */); } - return (use & 128 /* PossiblyOutOfBounds */) ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType; + return arrayElementType; } /** * Gets the requested "iteration type" from an `Iterable`-like or `AsyncIterable`-like type. @@ -74654,9 +72721,8 @@ var ts; if (iterationTypes_2 === noIterationTypes) { if (errorNode) { reportTypeNotIterableError(errorNode, type, !!(use & 2 /* AllowsAsyncIterablesFlag */)); + errorNode = undefined; } - setCachedIterationTypes(type, cacheKey, noIterationTypes); - return undefined; } else { allIterationTypes = ts.append(allIterationTypes, iterationTypes_2); @@ -74934,7 +73000,6 @@ var ts; * record is returned. Otherwise, we return `undefined`. */ function getIterationTypesOfMethod(type, resolver, methodName, errorNode) { - var _a, _b, _c, _d; var method = getPropertyOfType(type, methodName); // Ignore 'return' or 'throw' if they are missing. if (!method && methodName !== "next") { @@ -74958,24 +73023,6 @@ var ts; } return methodName === "next" ? anyIterationTypes : undefined; } - // If the method signature comes exclusively from the global iterator or generator type, - // create iteration types from its type arguments like `getIterationTypesOfIteratorFast` - // does (so as to remove `undefined` from the next and return types). We arrive here when - // a contextual type for a generator was not a direct reference to one of those global types, - // but looking up `methodType` referred to one of them (and nothing else). E.g., in - // `interface SpecialIterator extends Iterator {}`, `SpecialIterator` is not a - // reference to `Iterator`, but its `next` member derives exclusively from `Iterator`. - if ((methodType === null || methodType === void 0 ? void 0 : methodType.symbol) && methodSignatures.length === 1) { - var globalGeneratorType = resolver.getGlobalGeneratorType(/*reportErrors*/ false); - var globalIteratorType = resolver.getGlobalIteratorType(/*reportErrors*/ false); - var isGeneratorMethod = ((_b = (_a = globalGeneratorType.symbol) === null || _a === void 0 ? void 0 : _a.members) === null || _b === void 0 ? void 0 : _b.get(methodName)) === methodType.symbol; - var isIteratorMethod = !isGeneratorMethod && ((_d = (_c = globalIteratorType.symbol) === null || _c === void 0 ? void 0 : _c.members) === null || _d === void 0 ? void 0 : _d.get(methodName)) === methodType.symbol; - if (isGeneratorMethod || isIteratorMethod) { - var globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType; - var mapper = methodType.mapper; - return createIterationTypes(getMappedType(globalType.typeParameters[0], mapper), getMappedType(globalType.typeParameters[1], mapper), methodName === "next" ? getMappedType(globalType.typeParameters[2], mapper) : undefined); - } - } // Extract the first parameter and return type of each signature. var methodParameterTypes; var methodReturnTypes; @@ -75093,12 +73140,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 168 /* SetAccessor */) { + if (func.kind === 167 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 166 /* Constructor */) { + else if (func.kind === 165 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -75116,7 +73163,7 @@ var ts; } } } - else if (func.kind !== 166 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 165 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -75145,7 +73192,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 285 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 282 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -75154,7 +73201,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 284 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 281 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -75186,7 +73233,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 245 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 242 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -75215,15 +73262,11 @@ var ts; if (catchClause) { // Grammar checking if (catchClause.variableDeclaration) { - var declaration = catchClause.variableDeclaration; - if (declaration.type) { - var type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ false); - if (type && !(type.flags & 3 /* AnyOrUnknown */)) { - grammarErrorOnFirstToken(declaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); - } + if (catchClause.variableDeclaration.type && getTypeOfNode(catchClause.variableDeclaration) === errorType) { + grammarErrorOnFirstToken(catchClause.variableDeclaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); } - else if (declaration.initializer) { - grammarErrorOnFirstToken(declaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); + else if (catchClause.variableDeclaration.initializer) { + grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); } else { var blockLocals_1 = catchClause.block.locals; @@ -75300,8 +73343,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 216 /* BinaryExpression */ || - name.kind === 158 /* ComputedPropertyName */ || + (propDeclaration.kind === 213 /* BinaryExpression */ || + name.kind === 157 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -75378,7 +73421,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 173 /* TypeReference */) { + if (node.kind === 172 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -75489,7 +73532,6 @@ var ts; var typeWithThis = getTypeWithThisArgument(type); var staticType = getTypeOfSymbol(symbol); checkTypeParameterListsIdentical(symbol); - checkFunctionOrConstructorSymbol(symbol); checkClassForDuplicateDeclarations(node); // Only check for reserved static identifiers on non-ambient context. if (!(node.flags & 8388608 /* Ambient */)) { @@ -75580,7 +73622,7 @@ var ts; function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible var issuedMemberError = false; - var _loop_23 = function (member) { + var _loop_22 = function (member) { if (ts.hasStaticModifier(member)) { return "continue"; } @@ -75599,7 +73641,7 @@ var ts; }; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - _loop_23(member); + _loop_22(member); } if (!issuedMemberError) { // check again with diagnostics to generate a less-specific error @@ -75625,7 +73667,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 252 /* ClassDeclaration */ || d.kind === 253 /* InterfaceDeclaration */; + return d.kind === 249 /* ClassDeclaration */ || d.kind === 250 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -75680,7 +73722,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 221 /* ClassExpression */) { + if (derivedClassDecl.kind === 218 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -75701,7 +73743,7 @@ var ts; if (basePropertyFlags && derivedPropertyFlags) { // property/accessor is overridden with property/accessor if (baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 253 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 250 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -75716,7 +73758,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else if (compilerOptions.useDefineForClassFields) { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 163 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 162 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -75832,7 +73874,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 163 /* PropertyDeclaration */ && + return node.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -75856,7 +73898,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 250 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -75889,15 +73931,8 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); checkExportsOnMergedDeclarations(node); checkTypeParameters(node.typeParameters); - if (node.type.kind === 136 /* IntrinsicKeyword */) { - if (!intrinsicTypeKinds.has(node.name.escapedText) || ts.length(node.typeParameters) !== 1) { - error(node.type, ts.Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types); - } - } - else { - checkSourceElement(node.type); - registerForUnusedIdentifiersCheck(node); - } + checkSourceElement(node.type); + registerForUnusedIdentifiersCheck(node); } function computeEnumMemberValues(node) { var nodeLinks = getNodeLinks(node); @@ -75975,7 +74010,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -75985,7 +74020,7 @@ var ts; } } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -76014,7 +74049,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return evaluate(expr.expression); case 78 /* Identifier */: var identifier = expr; @@ -76022,14 +74057,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 201 /* PropertyAccessExpression */) { + if (ex.kind === 198 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -76062,8 +74097,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 78 /* Identifier */ || - node.kind === 201 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 202 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 198 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 199 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -76099,7 +74134,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 255 /* EnumDeclaration */) { + if (declaration.kind !== 252 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -76127,8 +74162,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 252 /* ClassDeclaration */ || - (declaration.kind === 251 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 249 /* ClassDeclaration */ || + (declaration.kind === 248 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -76191,7 +74226,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 252 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 249 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -76241,23 +74276,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 198 /* BindingElement */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 246 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -76268,12 +74303,12 @@ var ts; break; } // falls through - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 251 /* FunctionDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 248 /* FunctionDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -76296,12 +74331,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.left; } while (node.kind !== 78 /* Identifier */); return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -76321,9 +74356,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 267 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 254 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 294 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 264 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -76357,14 +74392,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 270 /* ExportSpecifier */ ? + var message = node.kind === 267 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 270 /* ExportSpecifier */ + && node.kind === 267 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -76379,7 +74414,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); checkAliasSymbol(node); - if (node.kind === 265 /* ImportSpecifier */ && + if (node.kind === 262 /* ImportSpecifier */ && ts.idText(node.propertyName || node.name) === "default" && compilerOptions.esModuleInterop && moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015) { @@ -76401,7 +74436,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 260 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); if (moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015 && compilerOptions.esModuleInterop) { // import * as ns from "foo"; @@ -76429,7 +74464,7 @@ var ts; if (ts.hasSyntacticModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 272 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 269 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -76469,10 +74504,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 257 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 254 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 254 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 294 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -76505,14 +74540,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 268 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 265 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 297 /* SourceFile */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 256 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 294 /* SourceFile */ || node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 253 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -76576,8 +74611,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 294 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 253 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -76602,9 +74637,6 @@ var ts; checkExpressionCached(node.expression); } } - else { - checkExpressionCached(node.expression); // doesn't resolve, check as expression to mark as error - } if (ts.getEmitDeclarations(compilerOptions)) { collectLinkedAliases(node.expression, /*setVisibility*/ true); } @@ -76694,171 +74726,169 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 232 /* FirstStatement */ && kind <= 248 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 229 /* FirstStatement */ && kind <= 245 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return checkTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return checkParameter(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return checkPropertySignature(node); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return checkSignatureDeclaration(node); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: return checkMethodDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return checkConstructorDeclaration(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return checkAccessorDeclaration(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return checkTypeReferenceNode(node); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return checkTypePredicate(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return checkTypeQuery(node); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return checkTypeLiteral(node); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return checkArrayType(node); - case 179 /* TupleType */: + case 178 /* TupleType */: return checkTupleType(node); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 186 /* ParenthesizedType */: - case 180 /* OptionalType */: - case 181 /* RestType */: + case 185 /* ParenthesizedType */: + case 179 /* OptionalType */: + case 180 /* RestType */: return checkSourceElement(node.type); - case 187 /* ThisType */: + case 186 /* ThisType */: return checkThisType(node); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return checkTypeOperator(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return checkConditionalType(node); - case 185 /* InferType */: + case 184 /* InferType */: return checkInferType(node); - case 193 /* TemplateLiteralType */: - return checkTemplateLiteralType(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return checkImportType(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return checkNamedTupleMember(node); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 329 /* JSDocTypeTag */: + case 325 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 333 /* JSDocPropertyTag */: + case 328 /* JSDocPropertyTag */: return checkJSDocPropertyTag(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 306 /* JSDocNonNullableType */: - case 305 /* JSDocNullableType */: - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: - case 312 /* JSDocTypeLiteral */: + case 302 /* JSDocNonNullableType */: + case 301 /* JSDocNullableType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: + case 308 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 301 /* JSDocTypeExpression */: + case 298 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return checkMappedType(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return checkBlock(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return checkVariableStatement(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return checkExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return checkIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return checkDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return checkWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return checkForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return checkForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return checkForOfStatement(node); - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return checkReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return checkWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return checkSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return checkLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return checkThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return checkTryStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return checkBindingElement(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return checkClassDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return checkImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return checkExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return checkExportAssignment(node); - case 231 /* EmptyStatement */: - case 248 /* DebuggerStatement */: + case 228 /* EmptyStatement */: + case 245 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -76953,46 +74983,43 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 161 /* Decorator */: - case 275 /* JsxOpeningElement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 160 /* Decorator */: + case 272 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 273 /* JsxElement */: + case 270 /* JsxElement */: checkJsxElementDeferred(node); break; } currentNode = saveCurrentNode; } function checkSourceFile(node) { - var tracingData = ["check" /* Check */, "checkSourceFile", { path: node.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeCheck"); checkSourceFileWorker(node); ts.performance.mark("afterCheck"); ts.performance.measure("Check", "beforeCheck", "afterCheck"); - ts.tracing.end.apply(ts.tracing, tracingData); } function unusedIsError(kind, isAmbient) { if (isAmbient) { @@ -77125,17 +75152,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -77143,8 +75170,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -77153,7 +75180,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -77201,19 +75228,19 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 159 /* TypeParameter */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 158 /* TypeParameter */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return true; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.isTypeOnly; - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -77221,25 +75248,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 157 /* QualifiedName */) { + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 173 /* TypeReference */; + return node.parent.kind === 172 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 201 /* PropertyAccessExpression */) { + while (node.parent.kind === 198 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 223 /* ExpressionWithTypeArguments */; - } - function isJSDocEntryNameReference(node) { - while (node.parent.kind === 157 /* QualifiedName */) { - node = node.parent; - } - while (node.parent.kind === 201 /* PropertyAccessExpression */) { - node = node.parent; - } - return node.parent.kind === 302 /* JSDocNameReference */; + return node.parent.kind === 220 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -77267,13 +75285,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 157 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 156 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 260 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 257 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 266 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 263 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -77299,7 +75317,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 195 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 192 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -77309,7 +75327,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 201 /* PropertyAccessExpression */ && + name.parent.kind === 198 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -77319,7 +75337,7 @@ var ts; } } } - if (name.parent.kind === 266 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 263 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -77329,7 +75347,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 260 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 257 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -77347,7 +75365,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 223 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 220 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -77363,10 +75381,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 326 /* JSDocParameterTag */) { + if (name.parent.kind === 322 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 159 /* TypeParameter */ && name.parent.parent.kind === 330 /* JSDocTemplateTag */) { + if (name.parent.kind === 158 /* TypeParameter */ && name.parent.parent.kind === 326 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -77383,12 +75401,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 201 /* PropertyAccessExpression */ || name.kind === 157 /* QualifiedName */) { + else if (name.kind === 198 /* PropertyAccessExpression */ || name.kind === 156 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 201 /* PropertyAccessExpression */) { + if (name.kind === 198 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -77398,21 +75416,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 173 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 172 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (isJSDocEntryNameReference(name)) { - var meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */; - return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true, ts.getHostSignatureFromJSDoc(name)); - } - if (name.parent.kind === 172 /* TypePredicate */) { + if (name.parent.kind === 171 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -77435,8 +75449,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 198 /* BindingElement */ && - grandParent.kind === 196 /* ObjectBindingPattern */ && + else if (parent.kind === 195 /* BindingElement */ && + grandParent.kind === 193 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -77448,8 +75462,8 @@ var ts; switch (node.kind) { case 78 /* Identifier */: case 79 /* PrivateIdentifier */: - case 201 /* PropertyAccessExpression */: - case 157 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 107 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -77463,14 +75477,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 187 /* ThisType */: + case 186 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 105 /* SuperKeyword */: return checkExpression(node).symbol; case 132 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 166 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 165 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -77481,7 +75495,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 261 /* ImportDeclaration */ || node.parent.kind === 267 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 258 /* ImportDeclaration */ || node.parent.kind === 264 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -77503,7 +75517,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 83 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 195 /* ImportType */: + case 192 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 92 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -77512,26 +75526,18 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 289 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 286 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; } /** Returns the target of an export specifier without following aliases */ function getExportSpecifierLocalTargetSymbol(node) { - if (ts.isExportSpecifier(node)) { - return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); - } - else { - return resolveEntityName(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); - } + return node.parent.parent.moduleSpecifier ? + getExternalModuleMember(node.parent.parent, node) : + resolveEntityName(node.propertyName || node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } function getTypeOfNode(node) { - if (ts.isSourceFile(node) && !ts.isExternalModule(node)) { - return errorType; - } if (node.flags & 16777216 /* InWithStatement */) { // We cannot answer semantic questions within a with block, do not proceed any further return errorType; @@ -77591,23 +75597,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 200 /* ObjectLiteralExpression */ || expr.kind === 199 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 197 /* ObjectLiteralExpression */ || expr.kind === 196 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 239 /* ForOfStatement */) { + if (expr.parent.kind === 236 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 216 /* BinaryExpression */) { + if (expr.parent.kind === 213 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 288 /* PropertyAssignment */) { + if (expr.parent.kind === 285 /* PropertyAssignment */) { var node_2 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_2) || errorType; var propertyIndex = ts.indexOfNode(node_2.properties, expr.parent); @@ -77655,7 +75661,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -77772,7 +75778,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 297 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 294 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -77787,9 +75793,6 @@ var ts; // When resolved as an expression identifier, if the given node references an import, return the declaration of // that import. Otherwise, return undefined. function getReferencedImportDeclaration(nodeIn) { - if (nodeIn.generatedImportReference) { - return nodeIn.generatedImportReference; - } var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { var symbol = getReferencedValueSymbol(node); @@ -77803,7 +75806,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 287 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 284 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -77834,7 +75837,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 230 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 227 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -77875,19 +75878,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return node.expression && node.expression.kind === 78 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -77896,7 +75899,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 297 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 294 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -78003,15 +76006,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 291 /* EnumMember */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 288 /* EnumMember */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 291 /* EnumMember */) { + if (node.kind === 288 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -78077,7 +76080,7 @@ var ts; else if (isTypeAssignableToKind(type, 2112 /* BigIntLike */)) { return ts.TypeReferenceSerializationKind.BigIntLikeType; } - else if (isTypeAssignableToKind(type, 402653316 /* StringLike */)) { + else if (isTypeAssignableToKind(type, 132 /* StringLike */)) { return ts.TypeReferenceSerializationKind.StringLikeType; } else if (isTupleType(type)) { @@ -78280,12 +76283,12 @@ var ts; getJsxFragmentFactoryEntity: getJsxFragmentFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 168 /* SetAccessor */ ? 167 /* GetAccessor */ : 168 /* SetAccessor */; + var otherKind = accessor.kind === 167 /* SetAccessor */ ? 166 /* GetAccessor */ : 167 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 168 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 167 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 167 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 166 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -78301,7 +76304,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 297 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 294 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -78336,7 +76339,7 @@ var ts; return false; } function isInHeritageClause(node) { - return node.parent && node.parent.kind === 223 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 286 /* HeritageClause */; + return node.parent && node.parent.kind === 220 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 283 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -78348,7 +76351,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 78 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 201 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 78 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 198 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -78399,7 +76402,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 297 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 294 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -78427,12 +76430,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 256 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 253 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 297 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 294 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -78626,14 +76629,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 165 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 164 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */) { + else if (node.kind === 166 /* GetAccessor */ || node.kind === 167 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -78650,17 +76653,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 142 /* ReadonlyKeyword */) { - if (node.kind === 162 /* PropertySignature */ || node.kind === 164 /* MethodSignature */) { + if (modifier.kind !== 141 /* ReadonlyKeyword */) { + if (node.kind === 161 /* PropertySignature */ || node.kind === 163 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 171 /* IndexSignature */) { + if (node.kind === 170 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 84 /* ConstKeyword */: - if (node.kind !== 255 /* EnumDeclaration */) { + if (node.kind !== 252 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(84 /* ConstKeyword */)); } break; @@ -78680,7 +76683,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + else if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -78706,10 +76709,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + else if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -78721,11 +76724,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */ && node.kind !== 171 /* IndexSignature */ && node.kind !== 160 /* Parameter */) { + else if (node.kind !== 162 /* PropertyDeclaration */ && node.kind !== 161 /* PropertySignature */ && node.kind !== 170 /* IndexSignature */ && node.kind !== 159 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -78746,16 +76749,16 @@ var ts; return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } else if (ts.isClassLike(node.parent)) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 87 /* DefaultKeyword */: - var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 294 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 253 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; @@ -78768,12 +76771,12 @@ var ts; return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 257 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 254 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -78786,14 +76789,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 252 /* ClassDeclaration */) { - if (node.kind !== 165 /* MethodDeclaration */ && - node.kind !== 163 /* PropertyDeclaration */ && - node.kind !== 167 /* GetAccessor */ && - node.kind !== 168 /* SetAccessor */) { + if (node.kind !== 249 /* ClassDeclaration */) { + if (node.kind !== 164 /* MethodDeclaration */ && + node.kind !== 162 /* PropertyDeclaration */ && + node.kind !== 166 /* GetAccessor */ && + node.kind !== 167 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 252 /* ClassDeclaration */ && ts.hasSyntacticModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 249 /* ClassDeclaration */ && ts.hasSyntacticModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -78802,9 +76805,6 @@ var ts; if (flags & 8 /* Private */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); } - if (flags & 256 /* Async */ && lastAsync) { - return grammarErrorOnNode(lastAsync, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } } if (ts.isNamedDeclaration(node) && node.name.kind === 79 /* PrivateIdentifier */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); @@ -78818,18 +76818,15 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } - if (flags & 128 /* Abstract */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } flags |= 256 /* Async */; lastAsync = modifier; break; } } - if (node.kind === 166 /* Constructor */) { + if (node.kind === 165 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -78844,13 +76841,13 @@ var ts; } return false; } - else if ((node.kind === 261 /* ImportDeclaration */ || node.kind === 260 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 258 /* ImportDeclaration */ || node.kind === 257 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 159 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 159 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -78871,37 +76868,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 256 /* ModuleDeclaration */: - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 160 /* Parameter */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 253 /* ModuleDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 159 /* Parameter */: return false; default: - if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return false; } switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 129 /* AsyncKeyword */); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 125 /* AbstractKeyword */); - case 253 /* InterfaceDeclaration */: - case 232 /* VariableStatement */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 229 /* VariableStatement */: + case 251 /* TypeAliasDeclaration */: return true; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 84 /* ConstKeyword */); default: ts.Debug.fail(); @@ -78914,10 +76911,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -79036,7 +77033,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 147 /* StringKeyword */ && parameter.type.kind !== 144 /* NumberKeyword */) { + if (parameter.type.kind !== 146 /* StringKeyword */ && parameter.type.kind !== 143 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -79078,7 +77075,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 222 /* OmittedExpression */) { + if (arg.kind === 219 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -79155,20 +77152,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 158 /* ComputedPropertyName */) { + if (node.kind !== 157 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 216 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 213 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 251 /* FunctionDeclaration */ || - node.kind === 208 /* FunctionExpression */ || - node.kind === 165 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 248 /* FunctionDeclaration */ || + node.kind === 205 /* FunctionExpression */ || + node.kind === 164 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -79187,7 +77184,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 290 /* SpreadAssignment */) { + if (prop.kind === 287 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -79198,11 +77195,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 158 /* ComputedPropertyName */) { + if (name.kind === 157 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 289 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 286 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern); @@ -79215,7 +77212,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 129 /* AsyncKeyword */ || prop.kind !== 165 /* MethodDeclaration */) { + if (mod.kind !== 129 /* AsyncKeyword */ || prop.kind !== 164 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -79230,10 +77227,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -79241,13 +77238,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -79286,7 +77283,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 282 /* JsxSpreadAttribute */) { + if (attr.kind === 279 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -79296,7 +77293,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 283 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 280 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -79310,14 +77307,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 239 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 236 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 166 /* Constructor */) { + if (func && func.kind !== 165 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -79328,7 +77325,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 250 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 247 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -79343,20 +77340,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -79381,11 +77378,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 167 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 166 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 168 /* SetAccessor */) { + if (accessor.kind === 167 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -79407,17 +77404,17 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 166 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 166 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 151 /* UniqueKeyword */) { - if (node.type.kind !== 148 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(148 /* SymbolKeyword */)); + if (node.operator === 150 /* UniqueKeyword */) { + if (node.type.kind !== 147 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(147 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) { @@ -79428,7 +77425,7 @@ var ts; } } switch (parent.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 78 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -79440,13 +77437,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: if (!ts.hasSyntacticModifier(parent, 32 /* Static */) || !ts.hasEffectiveModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: if (!ts.hasSyntacticModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -79455,9 +77452,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 142 /* ReadonlyKeyword */) { - if (node.type.kind !== 178 /* ArrayType */ && node.type.kind !== 179 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(148 /* SymbolKeyword */)); + else if (node.operator === 141 /* ReadonlyKeyword */) { + if (node.type.kind !== 177 /* ArrayType */ && node.type.kind !== 178 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(147 /* SymbolKeyword */)); } } } @@ -79470,8 +77467,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 165 /* MethodDeclaration */) { - if (node.parent.kind === 200 /* ObjectLiteralExpression */) { + if (node.kind === 164 /* MethodDeclaration */) { + if (node.parent.kind === 197 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 129 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -79499,14 +77496,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 165 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 164 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 253 /* InterfaceDeclaration */) { + else if (node.parent.kind === 250 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 177 /* TypeLiteral */) { + else if (node.parent.kind === 176 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -79517,11 +77514,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 240 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 237 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -79529,8 +77526,8 @@ var ts; return false; } break; - case 244 /* SwitchStatement */: - if (node.kind === 241 /* BreakStatement */ && !node.label) { + case 241 /* SwitchStatement */: + if (node.kind === 238 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -79545,13 +77542,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 241 /* BreakStatement */ + var message = node.kind === 238 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 241 /* BreakStatement */ + var message = node.kind === 238 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -79575,12 +77572,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 211 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 211 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -79611,7 +77608,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 238 /* ForInStatement */ && node.parent.parent.kind !== 239 /* ForOfStatement */) { + if (node.parent.parent.kind !== 235 /* ForInStatement */ && node.parent.parent.kind !== 236 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -79624,11 +77621,8 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 232 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { - var message = node.initializer - ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions - : ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations; - return grammarErrorOnNode(node.exclamationToken, message); + if (node.exclamationToken && (node.parent.parent.kind !== 229 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); if (moduleKind < ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.System && @@ -79690,15 +77684,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return false; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -79790,7 +77784,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 253 /* InterfaceDeclaration */) { + else if (node.parent.kind === 250 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -79798,7 +77792,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 177 /* TypeLiteral */) { + else if (node.parent.kind === 176 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -79811,12 +77805,7 @@ var ts; } if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || node.flags & 8388608 /* Ambient */ || ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */))) { - var message = node.initializer - ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions - : !node.type - ? ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations - : ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; - return grammarErrorOnNode(node.exclamationToken, message); + return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { @@ -79832,13 +77821,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 253 /* InterfaceDeclaration */ || - node.kind === 254 /* TypeAliasDeclaration */ || - node.kind === 261 /* ImportDeclaration */ || - node.kind === 260 /* ImportEqualsDeclaration */ || - node.kind === 267 /* ExportDeclaration */ || - node.kind === 266 /* ExportAssignment */ || - node.kind === 259 /* NamespaceExportDeclaration */ || + if (node.kind === 250 /* InterfaceDeclaration */ || + node.kind === 251 /* TypeAliasDeclaration */ || + node.kind === 258 /* ImportDeclaration */ || + node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 264 /* ExportDeclaration */ || + node.kind === 263 /* ExportAssignment */ || + node.kind === 256 /* NamespaceExportDeclaration */ || ts.hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -79847,7 +77836,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 232 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 229 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -79870,7 +77859,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 230 /* Block */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + if (node.parent.kind === 227 /* Block */ || node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -79892,10 +77881,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 191 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 190 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 291 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 288 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -80070,14 +78059,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 251 /* FunctionDeclaration */ && declaration.kind !== 165 /* MethodDeclaration */) || + return (declaration.kind !== 248 /* FunctionDeclaration */ && declaration.kind !== 164 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -80085,14 +78074,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 262 /* ImportClause */: // For default import - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: // For rename import `x as y` + case 259 /* ImportClause */: // For default import + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: // For rename import `x as y` return true; case 78 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 265 /* ImportSpecifier */; + return decl.parent.kind === 262 /* ImportSpecifier */; default: return false; } @@ -80324,7 +78313,7 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 156 /* LastToken */) || kind === 187 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 155 /* LastToken */) || kind === 186 /* ThisType */) { return node; } var factory = context.factory; @@ -80332,291 +78321,287 @@ var ts; // Names case 78 /* Identifier */: return factory.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return factory.updateQualifiedName(node, nodeVisitor(node.left, visitor, ts.isEntityName), nodeVisitor(node.right, visitor, ts.isIdentifier)); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return factory.updateComputedPropertyName(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Signature elements - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return factory.updateTypeParameterDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.constraint, visitor, ts.isTypeNode), nodeVisitor(node.default, visitor, ts.isTypeNode)); - case 160 /* Parameter */: + case 159 /* Parameter */: return factory.updateParameterDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 161 /* Decorator */: + case 160 /* Decorator */: return factory.updateDecorator(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Type elements - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return factory.updatePropertyDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too nodeVisitor(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 164 /* MethodSignature */: + case 163 /* MethodSignature */: return factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return factory.updateMethodDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 166 /* Constructor */: + case 165 /* Constructor */: return factory.updateConstructorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return factory.updateGetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return factory.updateSetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 169 /* CallSignature */: + case 168 /* CallSignature */: return factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return factory.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); // Types - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return factory.updateTypePredicateNode(node, nodeVisitor(node.assertsModifier, visitor), nodeVisitor(node.parameterName, visitor), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return factory.updateTypeReferenceNode(node, nodeVisitor(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 174 /* FunctionType */: + case 173 /* FunctionType */: return factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 175 /* ConstructorType */: + case 174 /* ConstructorType */: return factory.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName)); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return factory.updateArrayTypeNode(node, nodeVisitor(node.elementType, visitor, ts.isTypeNode)); - case 179 /* TupleType */: + case 178 /* TupleType */: return factory.updateTupleTypeNode(node, nodesVisitor(node.elements, visitor, ts.isTypeNode)); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return factory.updateOptionalTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 181 /* RestType */: + case 180 /* RestType */: return factory.updateRestTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 182 /* UnionType */: + case 181 /* UnionType */: return factory.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return factory.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return factory.updateConditionalTypeNode(node, nodeVisitor(node.checkType, visitor, ts.isTypeNode), nodeVisitor(node.extendsType, visitor, ts.isTypeNode), nodeVisitor(node.trueType, visitor, ts.isTypeNode), nodeVisitor(node.falseType, visitor, ts.isTypeNode)); - case 185 /* InferType */: + case 184 /* InferType */: return factory.updateInferTypeNode(node, nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 195 /* ImportType */: + case 192 /* ImportType */: return factory.updateImportTypeNode(node, nodeVisitor(node.argument, visitor, ts.isTypeNode), nodeVisitor(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return factory.updateNamedTupleMember(node, visitNode(node.dotDotDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return factory.updateParenthesizedType(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return factory.updateTypeOperatorNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return factory.updateIndexedAccessTypeNode(node, nodeVisitor(node.objectType, visitor, ts.isTypeNode), nodeVisitor(node.indexType, visitor, ts.isTypeNode)); - case 190 /* MappedType */: - return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.nameType, visitor, ts.isTypeNode), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 191 /* LiteralType */: + case 189 /* MappedType */: + return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); + case 190 /* LiteralType */: return factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.isExpression)); - case 193 /* TemplateLiteralType */: - return factory.updateTemplateLiteralType(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateLiteralTypeSpan)); - case 194 /* TemplateLiteralTypeSpan */: - return factory.updateTemplateLiteralTypeSpan(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Binding patterns - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: return factory.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return factory.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return factory.updateBindingElement(node, nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.propertyName, visitor, ts.isPropertyName), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.initializer, visitor, ts.isExpression)); // Expression - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return factory.updateArrayLiteralExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return factory.updateObjectLiteralExpression(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updatePropertyAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier)); } return factory.updatePropertyAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateElementAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.argumentExpression, visitor, ts.isExpression)); } return factory.updateElementAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.argumentExpression, visitor, ts.isExpression)); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateCallChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return factory.updateCallExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return factory.updateNewExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return factory.updateTaggedTemplateExpression(node, nodeVisitor(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), nodeVisitor(node.template, visitor, ts.isTemplateLiteral)); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return factory.updateTypeAssertion(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return factory.updateParenthesizedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return factory.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return factory.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return factory.updateDeleteExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return factory.updateTypeOfExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return factory.updateVoidExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return factory.updateAwaitExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return factory.updatePrefixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression)); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return factory.updatePostfixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression)); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return factory.updateBinaryExpression(node, nodeVisitor(node.left, visitor, ts.isExpression), nodeVisitor(node.operatorToken, tokenVisitor, ts.isToken), nodeVisitor(node.right, visitor, ts.isExpression)); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return factory.updateConditionalExpression(node, nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenTrue, visitor, ts.isExpression), nodeVisitor(node.colonToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenFalse, visitor, ts.isExpression)); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return factory.updateTemplateExpression(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return factory.updateYieldExpression(node, nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return factory.updateSpreadElement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return factory.updateClassExpression(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return factory.updateExpressionWithTypeArguments(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 224 /* AsExpression */: + case 221 /* AsExpression */: return factory.updateAsExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateNonNullChain(node, nodeVisitor(node.expression, visitor, ts.isExpression)); } return factory.updateNonNullExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return factory.updateMetaProperty(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); // Misc - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return factory.updateTemplateSpan(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 230 /* Block */: + case 227 /* Block */: return factory.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return factory.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return factory.updateExpressionStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return factory.updateIfStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.thenStatement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.elseStatement, visitor, ts.isStatement, factory.liftToBlock)); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return factory.updateDoStatement(node, nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return factory.updateWhileStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return factory.updateForStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.incrementor, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return factory.updateForInStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return factory.updateForOfStatement(node, nodeVisitor(node.awaitModifier, tokenVisitor, ts.isToken), nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return factory.updateContinueStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier)); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return factory.updateBreakStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier)); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return factory.updateReturnStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return factory.updateWithStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return factory.updateSwitchStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.caseBlock, visitor, ts.isCaseBlock)); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return factory.updateLabeledStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return factory.updateThrowStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return factory.updateTryStatement(node, nodeVisitor(node.tryBlock, visitor, ts.isBlock), nodeVisitor(node.catchClause, visitor, ts.isCatchClause), nodeVisitor(node.finallyBlock, visitor, ts.isBlock)); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return factory.updateVariableDeclaration(node, nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return factory.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return factory.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return factory.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return factory.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return factory.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return factory.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return factory.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.body, visitor, ts.isModuleBody)); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return factory.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return factory.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return factory.updateNamespaceExportDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return factory.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.moduleReference, visitor, ts.isModuleReference)); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return factory.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.importClause, visitor, ts.isImportClause), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression)); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts.isNamedImportBindings)); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return factory.updateNamespaceImport(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return factory.updateNamespaceExport(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 264 /* NamedImports */: + case 261 /* NamedImports */: return factory.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return factory.updateImportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return factory.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return factory.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, ts.isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression)); - case 268 /* NamedExports */: + case 265 /* NamedExports */: return factory.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return factory.updateExportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier)); // Module references - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return factory.updateExternalModuleReference(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // JSX - case 273 /* JsxElement */: + case 270 /* JsxElement */: return factory.updateJsxElement(node, nodeVisitor(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingElement, visitor, ts.isJsxClosingElement)); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return factory.updateJsxSelfClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes)); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: return factory.updateJsxOpeningElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes)); - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: return factory.updateJsxClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return factory.updateJsxFragment(node, nodeVisitor(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return factory.updateJsxAttribute(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return factory.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return factory.updateJsxSpreadAttribute(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return factory.updateJsxExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Clauses - case 284 /* CaseClause */: + case 281 /* CaseClause */: return factory.updateCaseClause(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return factory.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return factory.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return factory.updateCatchClause(node, nodeVisitor(node.variableDeclaration, visitor, ts.isVariableDeclaration), nodeVisitor(node.block, visitor, ts.isBlock)); // Property assignments - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return factory.updatePropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return factory.updateShorthandPropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return factory.updateSpreadAssignment(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Enum - case 291 /* EnumMember */: + case 288 /* EnumMember */: return factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 297 /* SourceFile */: + case 294 /* SourceFile */: return factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return factory.updateCommaListExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -81291,7 +79276,7 @@ var ts; function chainBundle(context, transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 297 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 294 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -81342,7 +79327,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -81355,13 +79340,13 @@ var ts; hasImportDefault = true; } break; - case 260 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 272 /* ExternalModuleReference */) { + case 257 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 269 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -81392,13 +79377,13 @@ var ts; addExportedNamesForExportDeclaration(node); } break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { for (var _b = 0, _c = node.declarationList.declarations; _b < _c.length; _b++) { var decl = _c[_b]; @@ -81406,7 +79391,7 @@ var ts; } } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { if (ts.hasSyntacticModifier(node, 512 /* Default */)) { // export default function() { } @@ -81426,7 +79411,7 @@ var ts; } } break; - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { if (ts.hasSyntacticModifier(node, 512 /* Default */)) { // export default class { } @@ -81600,7 +79585,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 163 /* PropertyDeclaration */ + return member.kind === 162 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -81819,27 +79804,18 @@ var ts; * for the element. */ function flattenBindingOrAssignmentElement(flattenContext, element, value, location, skipInitializer) { - var bindingTarget = ts.getTargetOfBindingOrAssignmentElement(element); // TODO: GH#18217 if (!skipInitializer) { var initializer = ts.visitNode(ts.getInitializerOfBindingOrAssignmentElement(element), flattenContext.visitor, ts.isExpression); if (initializer) { // Combine value and initializer - if (value) { - value = createDefaultValueCheck(flattenContext, value, initializer, location); - // If 'value' is not a simple expression, it could contain side-effecting code that should evaluate before an object or array binding pattern. - if (!ts.isSimpleInlineableExpression(initializer) && ts.isBindingOrAssignmentPattern(bindingTarget)) { - value = ensureIdentifier(flattenContext, value, /*reuseIdentifierExpressions*/ true, location); - } - } - else { - value = initializer; - } + value = value ? createDefaultValueCheck(flattenContext, value, initializer, location) : initializer; } else if (!value) { // Use 'void 0' in absence of value and initializer value = flattenContext.context.factory.createVoidZero(); } } + var bindingTarget = ts.getTargetOfBindingOrAssignmentElement(element); // TODO: GH#18217 if (ts.isObjectBindingOrAssignmentPattern(bindingTarget)) { flattenObjectBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value, location); } @@ -81944,8 +79920,7 @@ var ts; if (flattenContext.level >= 1 /* ObjectRest */) { // If an array pattern contains an ObjectRest, we must cache the result so that we // can perform the ObjectRest destructuring in a different declaration - if (element.transformFlags & 16384 /* ContainsObjectRestOrSpread */ || flattenContext.hasTransformedPriorElement && !isSimpleBindingOrAssignmentElement(element)) { - flattenContext.hasTransformedPriorElement = true; + if (element.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { var temp = flattenContext.context.factory.createTempVariable(/*recordTempVariable*/ undefined); if (flattenContext.hoistTempVariables) { flattenContext.context.hoistVariableDeclaration(temp); @@ -81979,20 +79954,6 @@ var ts; } } } - function isSimpleBindingOrAssignmentElement(element) { - var target = ts.getTargetOfBindingOrAssignmentElement(element); - if (!target || ts.isOmittedExpression(target)) - return true; - var propertyName = ts.tryGetPropertyNameOfBindingOrAssignmentElement(element); - if (propertyName && !ts.isPropertyNameLiteral(propertyName)) - return false; - var initializer = ts.getInitializerOfBindingOrAssignmentElement(element); - if (initializer && !ts.isSimpleInlineableExpression(initializer)) - return false; - if (ts.isBindingOrAssignmentPattern(target)) - return ts.every(ts.getElementsOfBindingOrAssignmentPattern(target), isSimpleBindingOrAssignmentElement); - return ts.isIdentifier(target); - } /** * Creates an expression used to provide a default value if a value is `undefined` at runtime. * @@ -82202,8 +80163,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -82229,14 +80190,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 298 /* Bundle */) { + if (node.kind === 295 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return factory.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 300 /* InputFiles */) { + if (prepend.kind === 297 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -82287,16 +80248,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 297 /* SourceFile */: - case 258 /* CaseBlock */: - case 257 /* ModuleBlock */: - case 230 /* Block */: + case 294 /* SourceFile */: + case 255 /* CaseBlock */: + case 254 /* ModuleBlock */: + case 227 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.hasSyntacticModifier(node, 2 /* Ambient */)) { break; } @@ -82308,7 +80269,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 252 /* ClassDeclaration */ || ts.hasSyntacticModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 249 /* ClassDeclaration */ || ts.hasSyntacticModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -82351,10 +80312,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: return visitElidableStatement(node); default: return visitorWorker(node); @@ -82375,13 +80336,13 @@ var ts; return node; } switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -82401,11 +80362,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 267 /* ExportDeclaration */ || - node.kind === 261 /* ImportDeclaration */ || - node.kind === 262 /* ImportClause */ || - (node.kind === 260 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 272 /* ExternalModuleReference */)) { + if (node.kind === 264 /* ExportDeclaration */ || + node.kind === 258 /* ImportDeclaration */ || + node.kind === 259 /* ImportClause */ || + (node.kind === 257 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 269 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -82429,19 +80390,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return visitConstructor(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 171 /* IndexSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + case 170 /* IndexSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -82478,61 +80439,61 @@ var ts; case 125 /* AbstractKeyword */: case 84 /* ConstKeyword */: case 133 /* DeclareKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 178 /* ArrayType */: - case 179 /* TupleType */: - case 180 /* OptionalType */: - case 181 /* RestType */: - case 177 /* TypeLiteral */: - case 172 /* TypePredicate */: - case 159 /* TypeParameter */: + case 177 /* ArrayType */: + case 178 /* TupleType */: + case 179 /* OptionalType */: + case 180 /* RestType */: + case 176 /* TypeLiteral */: + case 171 /* TypePredicate */: + case 158 /* TypeParameter */: case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: + case 151 /* UnknownKeyword */: case 131 /* BooleanKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 141 /* NeverKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 140 /* NeverKeyword */: case 113 /* VoidKeyword */: - case 148 /* SymbolKeyword */: - case 175 /* ConstructorType */: - case 174 /* FunctionType */: - case 176 /* TypeQuery */: - case 173 /* TypeReference */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 184 /* ConditionalType */: - case 186 /* ParenthesizedType */: - case 187 /* ThisType */: - case 188 /* TypeOperator */: - case 189 /* IndexedAccessType */: - case 190 /* MappedType */: - case 191 /* LiteralType */: + case 147 /* SymbolKeyword */: + case 174 /* ConstructorType */: + case 173 /* FunctionType */: + case 175 /* TypeQuery */: + case 172 /* TypeReference */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 183 /* ConditionalType */: + case 185 /* ParenthesizedType */: + case 186 /* ThisType */: + case 187 /* TypeOperator */: + case 188 /* IndexedAccessType */: + case 189 /* MappedType */: + case 190 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 161 /* Decorator */: + case 160 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 166 /* Constructor */: + case 165 /* Constructor */: return visitConstructor(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return factory.createNotEmittedStatement(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -82542,7 +80503,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -82552,35 +80513,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 160 /* Parameter */: + case 159 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -82590,40 +80551,40 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: return visitJsxJsxOpeningElement(node); default: // node contains some other TypeScript syntax @@ -83032,12 +80993,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -83190,7 +81151,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 163 /* PropertyDeclaration */ + ? member.kind === 162 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? factory.createVoidZero() @@ -83314,10 +81275,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 163 /* PropertyDeclaration */; + return kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 162 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -83327,7 +81288,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 165 /* MethodDeclaration */; + return node.kind === 164 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -83338,12 +81299,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return true; } return false; @@ -83360,15 +81321,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: - case 160 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 159 /* Parameter */: return serializeTypeNode(node.type); - case 168 /* SetAccessor */: - case 167 /* GetAccessor */: + case 167 /* SetAccessor */: + case 166 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 165 /* MethodDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 164 /* MethodDeclaration */: return factory.createIdentifier("Function"); default: return factory.createVoidZero(); @@ -83405,7 +81366,7 @@ var ts; return factory.createArrayLiteralExpression(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 167 /* GetAccessor */) { + if (container && node.kind === 166 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -83451,30 +81412,30 @@ var ts; } switch (node.kind) { case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: return factory.createVoidZero(); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return factory.createIdentifier("Function"); - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return factory.createIdentifier("Array"); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: case 131 /* BooleanKeyword */: return factory.createIdentifier("Boolean"); - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: return factory.createIdentifier("String"); - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return factory.createIdentifier("Object"); - case 191 /* LiteralType */: + case 190 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return factory.createIdentifier("String"); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return factory.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -83487,45 +81448,45 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: return factory.createIdentifier("Number"); - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : factory.createIdentifier("Symbol"); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return serializeTypeReferenceNode(node); - case 183 /* IntersectionType */: - case 182 /* UnionType */: + case 182 /* IntersectionType */: + case 181 /* UnionType */: return serializeTypeList(node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 188 /* TypeOperator */: - if (node.operator === 142 /* ReadonlyKeyword */) { + case 187 /* TypeOperator */: + if (node.operator === 141 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 176 /* TypeQuery */: - case 189 /* IndexedAccessType */: - case 190 /* MappedType */: - case 177 /* TypeLiteral */: + case 175 /* TypeQuery */: + case 188 /* IndexedAccessType */: + case 189 /* MappedType */: + case 176 /* TypeLiteral */: case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 187 /* ThisType */: - case 195 /* ImportType */: + case 151 /* UnknownKeyword */: + case 186 /* ThisType */: + case 192 /* ImportType */: break; // handle JSDoc types from an invalid parse - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: - case 308 /* JSDocFunctionType */: - case 309 /* JSDocVariadicType */: - case 310 /* JSDocNamepathType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: + case 304 /* JSDocFunctionType */: + case 305 /* JSDocVariadicType */: + case 306 /* JSDocNamepathType */: break; - case 305 /* JSDocNullableType */: - case 306 /* JSDocNonNullableType */: - case 307 /* JSDocOptionalType */: + case 301 /* JSDocNullableType */: + case 302 /* JSDocNonNullableType */: + case 303 /* JSDocOptionalType */: return serializeTypeNode(node.type); default: return ts.Debug.failBadSyntaxKind(node); @@ -83536,15 +81497,15 @@ var ts; // Note when updating logic here also update getEntityNameForDecoratorMetadata // so that aliases can be marked as referenced var serializedUnion; - for (var _i = 0, types_22 = types; _i < types_22.length; _i++) { - var typeNode = types_22[_i]; - while (typeNode.kind === 186 /* ParenthesizedType */) { + for (var _i = 0, types_21 = types; _i < types_21.length; _i++) { + var typeNode = types_21[_i]; + while (typeNode.kind === 185 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 141 /* NeverKeyword */) { + if (typeNode.kind === 140 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 190 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 149 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -83654,7 +81615,7 @@ var ts; name.original = undefined; ts.setParent(name, ts.getParseTreeNode(currentLexicalScope)); // ensure the parent is set to a parse tree node. return name; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -84228,12 +82189,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = factory.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), factory.createVariableDeclarationList([ factory.createVariableDeclaration(factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 297 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 294 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 255 /* EnumDeclaration */) { + if (node.kind === 252 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -84358,7 +82319,7 @@ var ts; var statementsLocation; var blockLocation; if (node.body) { - if (node.body.kind === 257 /* ModuleBlock */) { + if (node.body.kind === 254 /* ModuleBlock */) { saveStateAndInvoke(node.body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = node.body.statements; blockLocation = node.body; @@ -84405,13 +82366,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (!node.body || node.body.kind !== 257 /* ModuleBlock */) { + if (!node.body || node.body.kind !== 254 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 256 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 253 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -84461,7 +82422,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 263 /* NamespaceImport */) { + if (node.kind === 260 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -84710,16 +82671,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(78 /* Identifier */); - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(256 /* ModuleDeclaration */); + context.enableEmitNotification(253 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 256 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 253 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 255 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 252 /* EnumDeclaration */; } /** * Hook for node emit. @@ -84780,9 +82741,9 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -84820,9 +82781,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 297 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 256 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 255 /* EnumDeclaration */); + if (container && container.kind !== 294 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 253 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 252 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(container), node), /*location*/ node); @@ -84922,40 +82883,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: return visitClassLike(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); case 79 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 200 /* ObjectLiteralExpression */: - case 199 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -84978,20 +82939,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -85743,31 +83704,31 @@ var ts; case 129 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitAwaitExpression(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return ts.visitEachChild(node, visitor, context); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -85776,27 +83737,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 230 /* Block */: - case 244 /* SwitchStatement */: - case 258 /* CaseBlock */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 247 /* TryStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 234 /* IfStatement */: - case 243 /* WithStatement */: - case 245 /* LabeledStatement */: + case 227 /* Block */: + case 241 /* SwitchStatement */: + case 255 /* CaseBlock */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 244 /* TryStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 231 /* IfStatement */: + case 240 /* WithStatement */: + case 242 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -86001,7 +83962,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 209 /* ArrowFunction */; + var isArrowFunction = node.kind === 206 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -86092,17 +84053,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(203 /* CallExpression */); - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(200 /* CallExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(252 /* ClassDeclaration */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(166 /* Constructor */); + context.enableEmitNotification(249 /* ClassDeclaration */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(165 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(232 /* VariableStatement */); + context.enableEmitNotification(229 /* VariableStatement */); } } /** @@ -86150,11 +84111,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -86186,11 +84147,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 252 /* ClassDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 249 /* ClassDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -86341,10 +84302,10 @@ var ts; return visited; } function visitor(node) { - return visitorWorker(node, /*expressionResultIsUnused*/ false); + return visitorWorker(node, /*noDestructuringValue*/ false); } - function visitorWithUnusedExpressionResult(node) { - return visitorWorker(node, /*expressionResultIsUnused*/ true); + function visitorNoDestructuringValue(node) { + return visitorWorker(node, /*noDestructuringValue*/ true); } function visitorNoAsyncModifier(node) { if (node.kind === 129 /* AsyncKeyword */) { @@ -86364,79 +84325,73 @@ var ts; function visitDefault(node) { return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitorWorker(node, expressionResultIsUnused) { + function visitorWorker(node, noDestructuringValue) { if ((node.transformFlags & 32 /* ContainsES2018 */) === 0) { return node; } switch (node.kind) { - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitAwaitExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 216 /* BinaryExpression */: - return visitBinaryExpression(node, expressionResultIsUnused); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node, expressionResultIsUnused); - case 287 /* CatchClause */: + case 213 /* BinaryExpression */: + return visitBinaryExpression(node, noDestructuringValue); + case 284 /* CatchClause */: return visitCatchClause(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 238 /* ForInStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 235 /* ForInStatement */: return doWithHierarchyFacts(visitDefault, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return doWithHierarchyFacts(visitForStatement, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return visitVoidExpression(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return doWithHierarchyFacts(visitConstructorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return doWithHierarchyFacts(visitMethodDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return doWithHierarchyFacts(visitGetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return doWithHierarchyFacts(visitSetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return doWithHierarchyFacts(visitFunctionDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return doWithHierarchyFacts(visitFunctionExpression, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return doWithHierarchyFacts(visitArrowFunction, node, 2 /* ArrowFunctionExcludes */, 0 /* ArrowFunctionIncludes */); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitParameter(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 207 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, expressionResultIsUnused); - case 205 /* TaggedTemplateExpression */: + case 204 /* ParenthesizedExpression */: + return visitParenthesizedExpression(node, noDestructuringValue); + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return ts.visitEachChild(node, visitor, context); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return doWithHierarchyFacts(visitDefault, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); default: return ts.visitEachChild(node, visitor, context); @@ -86472,7 +84427,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 239 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 236 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return factory.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement, factory.liftToBlock), node); @@ -86484,7 +84439,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 290 /* SpreadAssignment */) { + if (e.kind === 287 /* SpreadAssignment */) { if (chunkObject) { objects.push(factory.createObjectLiteralExpression(chunkObject)); chunkObject = undefined; @@ -86493,7 +84448,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 288 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 285 /* PropertyAssignment */ ? factory.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -86527,7 +84482,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 200 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 197 /* ObjectLiteralExpression */) { objects.unshift(factory.createObjectLiteralExpression()); } var expression = objects[0]; @@ -86544,14 +84499,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitExpressionStatement(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + return ts.visitEachChild(node, visitorNoDestructuringValue, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitParenthesizedExpression(node, expressionResultIsUnused) { - return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context); + function visitParenthesizedExpression(node, noDestructuringValue) { + return ts.visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context); } function visitSourceFile(node) { var ancestorFacts = enterSubtree(2 /* SourceFileExcludes */, ts.isEffectiveStrictModeSourceFile(node, compilerOptions) ? @@ -86573,38 +84524,16 @@ var ts; * Visits a BinaryExpression that contains a destructuring assignment. * * @param node A BinaryExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). */ - function visitBinaryExpression(node, expressionResultIsUnused) { + function visitBinaryExpression(node, noDestructuringValue) { if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { - return ts.flattenDestructuringAssignment(node, visitor, context, 1 /* ObjectRest */, !expressionResultIsUnused); + return ts.flattenDestructuringAssignment(node, visitor, context, 1 /* ObjectRest */, !noDestructuringValue); } - if (node.operatorToken.kind === 27 /* CommaToken */) { - return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression)); + else if (node.operatorToken.kind === 27 /* CommaToken */) { + return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorNoDestructuringValue, ts.isExpression), node.operatorToken, ts.visitNode(node.right, noDestructuringValue ? visitorNoDestructuringValue : visitor, ts.isExpression)); } return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitCommaListExpression(node, expressionResultIsUnused) { - if (expressionResultIsUnused) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - var result; - for (var i = 0; i < node.elements.length; i++) { - var element = node.elements[i]; - var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - result.push(visited); - } - } - var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements; - return factory.updateCommaListExpression(node, elements); - } function visitCatchClause(node) { if (node.variableDeclaration && ts.isBindingPattern(node.variableDeclaration.name) && @@ -86656,10 +84585,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitForStatement(node) { - return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement)); + return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorNoDestructuringValue, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement)); } function visitVoidExpression(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + return ts.visitEachChild(node, visitorNoDestructuringValue, context); } /** * Visits a ForOfStatement and converts it into a ES2015-compatible ForOfStatement. @@ -86940,17 +84869,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(203 /* CallExpression */); - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(200 /* CallExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(252 /* ClassDeclaration */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(166 /* Constructor */); + context.enableEmitNotification(249 /* ClassDeclaration */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(165 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(232 /* VariableStatement */); + context.enableEmitNotification(229 /* VariableStatement */); } } /** @@ -86998,11 +84927,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -87034,11 +84963,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 252 /* ClassDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 249 /* ClassDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -87070,7 +84999,7 @@ var ts; return node; } switch (node.kind) { - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -87102,21 +85031,21 @@ var ts; return node; } switch (node.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 203 /* CallExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 200 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -87159,7 +85088,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 201 /* PropertyAccessExpression */ + expression = node.kind === 198 /* PropertyAccessExpression */ ? factory.updatePropertyAccessExpression(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : factory.updateElementAccessExpression(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? factory.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -87173,10 +85102,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 203 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 204 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 200 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -87196,8 +85125,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (!ts.isSimpleCopiableExpression(rightExpression)) { thisArg = factory.createTempVariable(hoistVariableDeclaration); @@ -87208,11 +85137,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 201 /* PropertyAccessExpression */ + rightExpression = segment.kind === 198 /* PropertyAccessExpression */ ? factory.createPropertyAccessExpression(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : factory.createElementAccessExpression(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = factory.createFunctionCallCall(rightExpression, leftThisArg.kind === 105 /* SuperKeyword */ ? factory.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -87269,7 +85198,7 @@ var ts; return node; } switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var binaryExpression = node; if (ts.isLogicalOrCoalescingAssignmentExpression(binaryExpression)) { return transformLogicalAssignment(binaryExpression); @@ -87314,49 +85243,7 @@ var ts; var factory = context.factory, emitHelpers = context.getEmitHelperFactory; var compilerOptions = context.getCompilerOptions(); var currentSourceFile; - var currentFileState; return ts.chainBundle(context, transformSourceFile); - function getCurrentFileNameExpression() { - if (currentFileState.filenameDeclaration) { - return currentFileState.filenameDeclaration.name; - } - var declaration = factory.createVariableDeclaration(factory.createUniqueName("_jsxFileName", 16 /* Optimistic */ | 32 /* FileLevel */), /*exclaimationToken*/ undefined, /*type*/ undefined, factory.createStringLiteral(currentSourceFile.fileName)); - currentFileState.filenameDeclaration = declaration; - return currentFileState.filenameDeclaration.name; - } - function getJsxFactoryCalleePrimitive(childrenLength) { - return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" : childrenLength > 1 ? "jsxs" : "jsx"; - } - function getJsxFactoryCallee(childrenLength) { - var type = getJsxFactoryCalleePrimitive(childrenLength); - return getImplicitImportForName(type); - } - function getImplicitJsxFragmentReference() { - return getImplicitImportForName("Fragment"); - } - function getImplicitImportForName(name) { - var _a, _b; - var importSource = name === "createElement" - ? currentFileState.importSpecifier - : ts.getJSXRuntimeImport(currentFileState.importSpecifier, compilerOptions); - var existing = (_b = (_a = currentFileState.utilizedImplicitRuntimeImports) === null || _a === void 0 ? void 0 : _a.get(importSource)) === null || _b === void 0 ? void 0 : _b.get(name); - if (existing) { - return existing.name; - } - if (!currentFileState.utilizedImplicitRuntimeImports) { - currentFileState.utilizedImplicitRuntimeImports = ts.createMap(); - } - var specifierSourceImports = currentFileState.utilizedImplicitRuntimeImports.get(importSource); - if (!specifierSourceImports) { - specifierSourceImports = ts.createMap(); - currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports); - } - var generatedName = factory.createUniqueName("_" + name, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */); - var specifier = factory.createImportSpecifier(factory.createIdentifier(name), generatedName); - generatedName.generatedImportReference = specifier; - specifierSourceImports.set(name, specifier); - return generatedName; - } /** * Transform JSX-specific syntax in a SourceFile. * @@ -87367,42 +85254,8 @@ var ts; return node; } currentSourceFile = node; - currentFileState = {}; - currentFileState.importSpecifier = ts.getJSXImplicitImportBase(compilerOptions, node); var visited = ts.visitEachChild(node, visitor, context); ts.addEmitHelpers(visited, context.readEmitHelpers()); - var statements = visited.statements; - if (currentFileState.filenameDeclaration) { - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([currentFileState.filenameDeclaration], 2 /* Const */))); - } - if (currentFileState.utilizedImplicitRuntimeImports) { - for (var _i = 0, _a = ts.arrayFrom(currentFileState.utilizedImplicitRuntimeImports.entries()); _i < _a.length; _i++) { - var _b = _a[_i], importSource = _b[0], importSpecifiersMap = _b[1]; - if (ts.isExternalModule(node)) { - // Add `import` statement - var importStatement = factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, factory.createImportClause(/*typeOnly*/ false, /*name*/ undefined, factory.createNamedImports(ts.arrayFrom(importSpecifiersMap.values()))), factory.createStringLiteral(importSource)); - ts.setParentRecursive(importStatement, /*incremental*/ false); - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), importStatement); - } - else if (ts.isExternalOrCommonJsModule(node)) { - // Add `require` statement - var requireStatement = factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([ - factory.createVariableDeclaration(factory.createObjectBindingPattern(ts.map(ts.arrayFrom(importSpecifiersMap.values()), function (s) { return factory.createBindingElement(/*dotdotdot*/ undefined, s.propertyName, s.name); })), - /*exclaimationToken*/ undefined, - /*type*/ undefined, factory.createCallExpression(factory.createIdentifier("require"), /*typeArguments*/ undefined, [factory.createStringLiteral(importSource)])) - ], 2 /* Const */)); - ts.setParentRecursive(requireStatement, /*incremental*/ false); - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), requireStatement); - } - else { - // Do nothing (script file) - consider an error in the checker? - } - } - } - if (statements !== visited.statements) { - visited = factory.updateSourceFile(visited, statements); - } - currentFileState = undefined; return visited; } function visitor(node) { @@ -87415,13 +85268,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -87431,122 +85284,28 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitJsxExpression(node); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); } } - /** - * The react jsx/jsxs transform falls back to `createElement` when an explicit `key` argument comes after a spread - */ - function hasKeyAfterPropsSpread(node) { - var spread = false; - for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { - var elem = _a[_i]; - if (ts.isJsxSpreadAttribute(elem)) { - spread = true; - } - else if (spread && ts.isJsxAttribute(elem) && elem.name.escapedText === "key") { - return true; - } - } - return false; - } - function shouldUseCreateElement(node) { - return currentFileState.importSpecifier === undefined || hasKeyAfterPropsSpread(node); - } function visitJsxElement(node, isChild) { - var tagTransform = shouldUseCreateElement(node.openingElement) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform(node.openingElement, node.children, isChild, /*location*/ node); + return visitJsxOpeningLikeElement(node.openingElement, node.children, isChild, /*location*/ node); } function visitJsxSelfClosingElement(node, isChild) { - var tagTransform = shouldUseCreateElement(node) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform(node, /*children*/ undefined, isChild, /*location*/ node); + return visitJsxOpeningLikeElement(node, /*children*/ undefined, isChild, /*location*/ node); } function visitJsxFragment(node, isChild) { - var tagTransform = currentFileState.importSpecifier === undefined ? visitJsxOpeningFragmentCreateElement : visitJsxOpeningFragmentJSX; - return tagTransform(node.openingFragment, node.children, isChild, /*location*/ node); + return visitJsxOpeningFragment(node.openingFragment, node.children, isChild, /*location*/ node); } - function convertJsxChildrenToChildrenPropObject(children) { - var nonWhitespaceChildren = ts.getSemanticJsxChildren(children); - if (ts.length(nonWhitespaceChildren) === 1) { - var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]); - return result_13 && factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("children", result_13) - ]); - } - var result = ts.mapDefined(children, transformJsxChildToExpression); - return !result.length ? undefined : factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) - ]); - } - function visitJsxOpeningLikeElementJSX(node, children, isChild, location) { - var tagName = getTagName(node); - var objectProperties; - var keyAttr = ts.find(node.attributes.properties, function (p) { return !!p.name && ts.isIdentifier(p.name) && p.name.escapedText === "key"; }); - var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties; - var segments = []; - if (attrs.length) { - // Map spans of JsxAttribute nodes into object literals and spans - // of JsxSpreadAttribute nodes into expressions. - segments = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread - ? ts.map(attrs, transformJsxSpreadAttributeToExpression) - : factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); })); - if (ts.isJsxSpreadAttribute(attrs[0])) { - // We must always emit at least one object literal before a spread - // argument.factory.createObjectLiteral - segments.unshift(factory.createObjectLiteralExpression()); - } - } - if (children && children.length) { - var result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - segments.push(result); - } - } - if (segments.length === 0) { - objectProperties = factory.createObjectLiteralExpression([]); - // When there are no attributes, React wants {} - } - else { - // Either emit one big object literal (no spread attribs), or - // a call to the __assign helper. - objectProperties = ts.singleOrUndefined(segments) || emitHelpers().createAssignHelper(segments); - } - return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, ts.length(ts.getSemanticJsxChildren(children || ts.emptyArray)), isChild, location); - } - function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, childrenLength, isChild, location) { - var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)]; - if (compilerOptions.jsx === 5 /* ReactJSXDev */) { - var originalFile = ts.getOriginalNode(currentSourceFile); - if (originalFile && ts.isSourceFile(originalFile)) { - // isStaticChildren development flag - args.push(childrenLength > 1 ? factory.createTrue() : factory.createFalse()); - // __source development flag - var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos); - args.push(factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("fileName", getCurrentFileNameExpression()), - factory.createPropertyAssignment("lineNumber", factory.createNumericLiteral(lineCol.line + 1)), - factory.createPropertyAssignment("columnNumber", factory.createNumericLiteral(lineCol.character + 1)) - ])); - // __self development flag - args.push(factory.createThis()); - } - } - var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(childrenLength), /*typeArguments*/ undefined, args), location); - if (isChild) { - ts.startOnNewLine(element); - } - return element; - } - function visitJsxOpeningLikeElementCreateElement(node, children, isChild, location) { + function visitJsxOpeningLikeElement(node, children, isChild, location) { var tagName = getTagName(node); var objectProperties; var attrs = node.attributes.properties; @@ -87572,28 +85331,14 @@ var ts; objectProperties = emitHelpers().createAssignHelper(segments); } } - var callee = currentFileState.importSpecifier === undefined - ? ts.createJsxFactoryExpression(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 - node) - : getImplicitImportForName("createElement"); - var element = ts.createExpressionForJsxElement(factory, callee, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), location); + var element = ts.createExpressionForJsxElement(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 + tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } return element; } - function visitJsxOpeningFragmentJSX(_node, children, isChild, location) { - var childrenProps; - if (children && children.length) { - var result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - childrenProps = result; - } - } - return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]), - /*keyAttr*/ undefined, ts.length(ts.getSemanticJsxChildren(children)), isChild, location); - } - function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) { + function visitJsxOpeningFragment(node, children, isChild, location) { var element = ts.createExpressionForJsxFragment(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { @@ -87620,7 +85365,7 @@ var ts; var literal = factory.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote); return ts.setTextRange(literal, node); } - else if (node.kind === 283 /* JsxExpression */) { + else if (node.kind === 280 /* JsxExpression */) { if (node.expression === undefined) { return factory.createTrue(); } @@ -87714,7 +85459,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 273 /* JsxElement */) { + if (node.kind === 270 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -88020,7 +85765,7 @@ var ts; return node; } switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -88233,7 +85978,7 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 242 /* ReturnStatement */ + && node.kind === 239 /* ReturnStatement */ && !node.expression; } function isOrMayContainReturnCompletion(node) { @@ -88259,10 +86004,12 @@ var ts; || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } function visitor(node) { - return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ false) : node; - } - function visitorWithUnusedExpressionResult(node) { - return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ true) : node; + if (shouldVisitNode(node)) { + return visitJavaScript(node); + } + else { + return node; + } } function callExpressionVisitor(node) { if (node.kind === 105 /* SuperKeyword */) { @@ -88270,70 +86017,68 @@ var ts; } return visitor(node); } - function visitorWorker(node, expressionResultIsUnused) { + function visitJavaScript(node) { switch (node.kind) { case 123 /* StaticKeyword */: return undefined; // elide static keyword - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return visitClassExpression(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitParameter(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return visitArrowFunction(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); case 78 /* Identifier */: return visitIdentifier(node); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitCaseBlock(node); - case 230 /* Block */: + case 227 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); - case 207 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, expressionResultIsUnused); - case 216 /* BinaryExpression */: - return visitBinaryExpression(node, expressionResultIsUnused); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node, expressionResultIsUnused); + case 204 /* ParenthesizedExpression */: + return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); + case 213 /* BinaryExpression */: + return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: case 16 /* TemplateMiddle */: @@ -88343,31 +86088,29 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return visitTemplateExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return visitSpreadElement(node); case 105 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 107 /* ThisKeyword */: return visitThisKeyword(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return visitMetaProperty(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return visitAccessorDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); - case 212 /* VoidExpression */: - return visitVoidExpression(node); default: return ts.visitEachChild(node, visitor, context); } @@ -88438,9 +86181,6 @@ var ts; } return node; } - function visitVoidExpression(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } function visitIdentifier(node) { if (!convertedLoopState) { return node; @@ -88456,14 +86196,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 241 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 238 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 241 /* BreakStatement */) { + if (node.kind === 238 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -88474,7 +86214,7 @@ var ts; } } else { - if (node.kind === 241 /* BreakStatement */) { + if (node.kind === 238 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -88626,17 +86366,16 @@ var ts; */ function transformClassBody(node, extendsClauseElement) { var statements = []; - var name = factory.getInternalName(node); - var constructorLikeName = ts.isIdentifierANonContextualKeyword(name) ? factory.getGeneratedNameForNode(name) : name; startLexicalEnvironment(); addExtendsHelperIfNeeded(statements, node, extendsClauseElement); - addConstructor(statements, node, constructorLikeName, extendsClauseElement); + addConstructor(statements, node, extendsClauseElement); addClassMembers(statements, node); // Create a synthetic text range for the return statement. var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 19 /* CloseBraceToken */); + var localName = factory.getInternalName(node); // The following partially-emitted expression exists purely to align our sourcemap // emit with the original emitter. - var outer = factory.createPartiallyEmittedExpression(constructorLikeName); + var outer = factory.createPartiallyEmittedExpression(localName); ts.setTextRangeEnd(outer, closingBraceLocation.end); ts.setEmitFlags(outer, 1536 /* NoComments */); var statement = factory.createReturnStatement(outer); @@ -88668,7 +86407,7 @@ var ts; * @param node The ClassExpression or ClassDeclaration node. * @param extendsClauseElement The expression for the class `extends` clause. */ - function addConstructor(statements, node, name, extendsClauseElement) { + function addConstructor(statements, node, extendsClauseElement) { var savedConvertedLoopState = convertedLoopState; convertedLoopState = undefined; var ancestorFacts = enterSubtree(16278 /* ConstructorExcludes */, 73 /* ConstructorIncludes */); @@ -88677,7 +86416,7 @@ var ts; var constructorFunction = factory.createFunctionDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*asteriskToken*/ undefined, name, + /*asteriskToken*/ undefined, factory.getInternalName(node), /*typeParameters*/ undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper)); ts.setTextRange(constructorFunction, constructor || node); @@ -88872,11 +86611,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 242 /* ReturnStatement */) { + if (statement.kind === 239 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 234 /* IfStatement */) { + else if (statement.kind === 231 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -88884,7 +86623,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 230 /* Block */) { + else if (statement.kind === 227 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -89086,7 +86825,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 209 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 206 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, factory.createThis()); return true; } @@ -89108,22 +86847,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return statements; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = factory.createVoidZero(); break; - case 166 /* Constructor */: + case 165 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = factory.createPropertyAccessExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = factory.createConditionalExpression(factory.createLogicalAnd(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), factory.createBinaryExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), 101 /* InstanceOfKeyword */, factory.getLocalName(node))), @@ -89158,20 +86897,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 166 /* Constructor */: + case 165 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -89374,7 +87113,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */)) { name = factory.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -89420,7 +87159,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 209 /* ArrowFunction */); + ts.Debug.assert(node.kind === 206 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -89486,55 +87225,51 @@ var ts; * @param node An ExpressionStatement node. */ function visitExpressionStatement(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + // If we are here it is most likely because our expression is a destructuring assignment. + switch (node.expression.kind) { + case 204 /* ParenthesizedExpression */: + return factory.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); + case 213 /* BinaryExpression */: + return factory.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); + } + return ts.visitEachChild(node, visitor, context); } /** * Visits a ParenthesizedExpression that may contain a destructuring assignment. * * @param node A ParenthesizedExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). + * @param needsDestructuringValue A value indicating whether we need to hold onto the rhs + * of a destructuring assignment. */ - function visitParenthesizedExpression(node, expressionResultIsUnused) { - return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context); + function visitParenthesizedExpression(node, needsDestructuringValue) { + // If we are here it is most likely because our expression is a destructuring assignment. + if (!needsDestructuringValue) { + // By default we always emit the RHS at the end of a flattened destructuring + // expression. If we are in a state where we do not need the destructuring value, + // we pass that information along to the children that care about it. + switch (node.expression.kind) { + case 204 /* ParenthesizedExpression */: + return factory.updateParenthesizedExpression(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); + case 213 /* BinaryExpression */: + return factory.updateParenthesizedExpression(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); + } + } + return ts.visitEachChild(node, visitor, context); } /** * Visits a BinaryExpression that contains a destructuring assignment. * * @param node A BinaryExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). + * @param needsDestructuringValue A value indicating whether we need to hold onto the rhs + * of a destructuring assignment. */ - function visitBinaryExpression(node, expressionResultIsUnused) { + function visitBinaryExpression(node, needsDestructuringValue) { // If we are here it is because this is a destructuring assignment. if (ts.isDestructuringAssignment(node)) { - return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, !expressionResultIsUnused); - } - if (node.operatorToken.kind === 27 /* CommaToken */) { - return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression)); + return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, needsDestructuringValue); } return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitCommaListExpression(node, expressionResultIsUnused) { - if (expressionResultIsUnused) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - var result; - for (var i = 0; i < node.elements.length; i++) { - var element = node.elements[i]; - var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - result.push(visited); - } - } - var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements; - return factory.updateCommaListExpression(node, elements); - } function isVariableStatementOfTypeScriptClassWrapper(node) { return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer @@ -89727,14 +87462,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -89750,9 +87485,6 @@ var ts; function visitForStatement(node, outermostLabeledStatement) { return visitIterationStatementWithFacts(5056 /* ForStatementExcludes */, 3328 /* ForStatementIncludes */, node, outermostLabeledStatement); } - function visitEachChildOfForStatement(node) { - return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - } function visitForInStatement(node, outermostLabeledStatement) { return visitIterationStatementWithFacts(3008 /* ForInOrForOfStatementExcludes */, 5376 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement); } @@ -89795,7 +87527,7 @@ var ts; // evaluated on every iteration. var assignment = factory.createAssignment(initializer, boundValue); if (ts.isDestructuringAssignment(assignment)) { - statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*expressionResultIsUnused*/ true))); + statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*needsDestructuringValue*/ false))); } else { ts.setTextRangeEnd(assignment, initializer.end); @@ -89920,7 +87652,7 @@ var ts; var property = properties[i]; if ((property.transformFlags & 262144 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */) - || (hasComputed = ts.Debug.checkDefined(property.name).kind === 158 /* ComputedPropertyName */)) { + || (hasComputed = ts.Debug.checkDefined(property.name).kind === 157 /* ComputedPropertyName */)) { numInitialProperties = i; break; } @@ -89996,7 +87728,7 @@ var ts; } var result = convert ? convert(node, outermostLabeledStatement, /*convertedLoopBodyStatements*/ undefined, ancestorFacts) - : factory.restoreEnclosingLabel(ts.isForStatement(node) ? visitEachChildOfForStatement(node) : ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); + : factory.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); if (convertedLoopState) { convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; } @@ -90036,18 +87768,18 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 237 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 238 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 239 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 235 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 236 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 234 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 235 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 236 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 232 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 233 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } function convertForStatement(node, initializerFunction, convertedLoopBody) { var shouldConvertCondition = node.condition && shouldConvertPartOfIterationStatement(node.condition); var shouldConvertIncrementor = shouldConvertCondition || node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); - return factory.updateForStatement(node, ts.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(shouldConvertCondition ? undefined : node.condition, visitor, ts.isExpression), ts.visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), convertedLoopBody); + return factory.updateForStatement(node, ts.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitor, ts.isForInitializer), ts.visitNode(shouldConvertCondition ? undefined : node.condition, visitor, ts.isExpression), ts.visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitor, ts.isExpression), convertedLoopBody); } function convertForOfStatement(node, convertedLoopBody) { return factory.updateForOfStatement(node, @@ -90065,11 +87797,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 250 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 247 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -90477,20 +88209,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -90597,7 +88329,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { updated = factory.updateGetAccessorDeclaration(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -91089,13 +88821,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(107 /* ThisKeyword */); - context.enableEmitNotification(166 /* Constructor */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(209 /* ArrowFunction */); - context.enableEmitNotification(208 /* FunctionExpression */); - context.enableEmitNotification(251 /* FunctionDeclaration */); + context.enableEmitNotification(165 /* Constructor */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(206 /* ArrowFunction */); + context.enableEmitNotification(205 /* FunctionExpression */); + context.enableEmitNotification(248 /* FunctionDeclaration */); } } /** @@ -91136,10 +88868,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 246 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -91221,11 +88953,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 233 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 230 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 203 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 200 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -91233,7 +88965,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 220 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 217 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -91259,15 +88991,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(275 /* JsxOpeningElement */); - context.enableEmitNotification(276 /* JsxClosingElement */); - context.enableEmitNotification(274 /* JsxSelfClosingElement */); + context.enableEmitNotification(272 /* JsxOpeningElement */); + context.enableEmitNotification(273 /* JsxClosingElement */); + context.enableEmitNotification(271 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(288 /* PropertyAssignment */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(285 /* PropertyAssignment */); return ts.chainBundle(context, transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -91286,9 +89018,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 275 /* JsxOpeningElement */: - case 276 /* JsxClosingElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 273 /* JsxClosingElement */: + case 271 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -91623,13 +89355,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitWhileStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -91642,24 +89374,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return visitAccessorDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return visitBreakStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return visitContinueStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -91680,23 +89412,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return visitConditionalExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -91709,9 +89439,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -91919,7 +89649,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -91931,7 +89661,7 @@ var ts; // _a.b = %sent%; target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -91978,61 +89708,6 @@ var ts; } return ts.visitEachChild(node, visitor, context); } - /** - * Visits a comma expression containing `yield`. - * - * @param node The node to visit. - */ - function visitCommaExpression(node) { - // [source] - // x = a(), yield, b(); - // - // [intermediate] - // a(); - // .yield resumeLabel - // .mark resumeLabel - // x = %sent%, b(); - var pendingExpressions = []; - visit(node.left); - visit(node.right); - return factory.inlineExpressions(pendingExpressions); - function visit(node) { - if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { - visit(node.left); - visit(node.right); - } - else { - if (containsYield(node) && pendingExpressions.length > 0) { - emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); - pendingExpressions = []; - } - pendingExpressions.push(ts.visitNode(node, visitor, ts.isExpression)); - } - } - } - /** - * Visits a comma-list expression. - * - * @param node The node to visit. - */ - function visitCommaListExpression(node) { - // flattened version of `visitCommaExpression` - var pendingExpressions = []; - for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { - var elem = _a[_i]; - if (ts.isBinaryExpression(elem) && elem.operatorToken.kind === 27 /* CommaToken */) { - pendingExpressions.push(visitCommaExpression(elem)); - } - else { - if (containsYield(elem) && pendingExpressions.length > 0) { - emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); - pendingExpressions = []; - } - pendingExpressions.push(ts.visitNode(elem, visitor, ts.isExpression)); - } - } - return factory.inlineExpressions(pendingExpressions); - } /** * Visits a logical binary expression containing `yield`. * @@ -92082,6 +89757,38 @@ var ts; markLabel(resultLabel); return resultLocal; } + /** + * Visits a comma expression containing `yield`. + * + * @param node The node to visit. + */ + function visitCommaExpression(node) { + // [source] + // x = a(), yield, b(); + // + // [intermediate] + // a(); + // .yield resumeLabel + // .mark resumeLabel + // x = %sent%, b(); + var pendingExpressions = []; + visit(node.left); + visit(node.right); + return factory.inlineExpressions(pendingExpressions); + function visit(node) { + if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { + visit(node.left); + visit(node.right); + } + else { + if (containsYield(node) && pendingExpressions.length > 0) { + emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); + pendingExpressions = []; + } + pendingExpressions.push(ts.visitNode(node, visitor, ts.isExpression)); + } + } + } /** * Visits a conditional expression containing `yield`. * @@ -92325,35 +90032,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 230 /* Block */: + case 227 /* Block */: return transformAndEmitBlock(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return transformAndEmitIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return transformAndEmitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return transformAndEmitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return transformAndEmitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -92783,7 +90490,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 285 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 282 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -92796,7 +90503,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -93957,11 +91664,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(213 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(211 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(212 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(294 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -94012,10 +91719,7 @@ var ts; ts.append(statements, createUnderscoreUnderscoreESModule()); } if (ts.length(currentModuleInfo.exportedNames)) { - var chunkSize = 50; - for (var i = 0; i < currentModuleInfo.exportedNames.length; i += chunkSize) { - ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames.slice(i, i + chunkSize), function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero()))); - } + ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames, function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero()))); } ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); @@ -94289,23 +91993,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 338 /* MergeDeclarationMarker */: + case 333 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 339 /* EndOfDeclarationMarker */: + case 334 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -94332,24 +92036,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -94684,11 +92388,9 @@ var ts; else if (node.exportClause) { var statements = []; // export * as ns from "mod"; - // export * as default from "mod"; statements.push(ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(createExportExpression(factory.cloneNode(node.exportClause.name), getHelperExpressionForExport(node, moduleKind !== ts.ModuleKind.AMD ? createRequireCall(node) : - ts.isExportNamespaceAsDefaultDeclaration(node) ? generatedName : - factory.createIdentifier(ts.idText(node.exportClause.name))))), node), node)); + factory.createIdentifier(ts.idText(node.exportClause.name))))), node), node)); return ts.singleOrMany(statements); } else { @@ -94781,7 +92483,6 @@ var ts; var expressions; if (ts.hasSyntacticModifier(node, 1 /* Export */)) { var modifiers = void 0; - var removeCommentsOnExpressions = false; // If we're exporting these variables, then these just become assignments to 'exports.x'. for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var variable = _a[_i]; @@ -94792,28 +92493,14 @@ var ts; variables = ts.append(variables, variable); } else if (variable.initializer) { - if (!ts.isBindingPattern(variable.name) && (ts.isArrowFunction(variable.initializer) || ts.isFunctionExpression(variable.initializer) || ts.isClassExpression(variable.initializer))) { - var expression = factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), variable.name), - /*location*/ variable.name), factory.createIdentifier(ts.getTextOfIdentifierOrLiteral(variable.name))); - var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, moduleExpressionElementVisitor)); - variables = ts.append(variables, updatedVariable); - expressions = ts.append(expressions, expression); - removeCommentsOnExpressions = true; - } - else { - expressions = ts.append(expressions, transformInitializedVariable(variable)); - } + expressions = ts.append(expressions, transformInitializedVariable(variable)); } } if (variables) { statements = ts.append(statements, factory.updateVariableStatement(node, modifiers, factory.updateVariableDeclarationList(node.declarationList, variables))); } if (expressions) { - var statement = ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node); - if (removeCommentsOnExpressions) { - ts.removeAllComments(statement); - } - statements = ts.append(statements, statement); + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node)); } } else { @@ -94874,7 +92561,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 229 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -94929,10 +92616,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -95145,7 +92832,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -95209,10 +92896,10 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return substituteBinaryExpression(node); - case 215 /* PostfixUnaryExpression */: - case 214 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -95231,9 +92918,9 @@ var ts; } return node; } - if (!(ts.isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !ts.isLocalName(node)) { + if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 297 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 294 /* SourceFile */) { return ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.cloneNode(node)), /*location*/ node); } @@ -95308,7 +92995,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 215 /* PostfixUnaryExpression */ + var expression = node.kind === 212 /* PostfixUnaryExpression */ ? ts.setTextRange(factory.createBinaryExpression(node.operand, factory.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), factory.createNumericLiteral(1)), /*location*/ node) : node; @@ -95360,12 +93047,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(226 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(213 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(211 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(212 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(223 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(294 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -95589,7 +93276,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 267 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 264 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -95679,19 +93366,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(factory, entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(factory.createExpressionStatement(factory.createAssignment(importVariableName, parameterName))); break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -95750,13 +93437,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -95936,7 +93623,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 297 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 294 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -96000,7 +93687,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 229 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasSyntacticModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -96062,10 +93749,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -96245,43 +93932,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitWhileStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return visitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitCaseBlock(node); - case 284 /* CaseClause */: + case 281 /* CaseClause */: return visitCaseClause(node); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return visitDefaultClause(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return visitTryStatement(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); - case 230 /* Block */: + case 227 /* Block */: return visitBlock(node); - case 338 /* MergeDeclarationMarker */: + case 333 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 339 /* EndOfDeclarationMarker */: + case 334 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -96528,7 +94215,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 297 /* SourceFile */; + return container !== undefined && container.kind === 294 /* SourceFile */; } else { return false; @@ -96561,7 +94248,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -96611,7 +94298,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -96647,12 +94334,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return substituteBinaryExpression(node); - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -96745,14 +94432,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 215 /* PostfixUnaryExpression */ + var expression = node.kind === 212 /* PostfixUnaryExpression */ ? ts.setTextRange(factory.createPrefixUnaryExpression(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 215 /* PostfixUnaryExpression */) { + if (node.kind === 212 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? factory.createSubtract(preventSubstitution(expression), factory.createNumericLiteral(1)) : factory.createAdd(preventSubstitution(expression), factory.createNumericLiteral(1)); @@ -96780,7 +94467,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 297 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 294 /* SourceFile */) { exportedNames = ts.append(exportedNames, factory.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -96820,7 +94507,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(297 /* SourceFile */); + context.enableEmitNotification(294 /* SourceFile */); context.enableSubstitution(78 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(context, transformSourceFile); @@ -96852,12 +94539,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -96884,7 +94571,7 @@ var ts; /*isTypeOnly*/ false, /*name*/ undefined, factory.createNamespaceImport(synthName)), node.moduleSpecifier); ts.setOriginalNode(importDecl, node.exportClause); - var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration( + var exportDecl = factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, factory.createNamedExports([factory.createExportSpecifier(synthName, oldIdentifier)])); @@ -96991,7 +94678,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97020,7 +94707,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97067,7 +94754,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97076,8 +94763,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 163 /* PropertyDeclaration */ || node.kind === 201 /* PropertyAccessExpression */ || node.kind === 162 /* PropertySignature */ || - (node.kind === 160 /* Parameter */ && ts.hasSyntacticModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 162 /* PropertyDeclaration */ || node.kind === 198 /* PropertyAccessExpression */ || node.kind === 161 /* PropertySignature */ || + (node.kind === 159 /* Parameter */ && ts.hasSyntacticModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasSyntacticModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -97086,7 +94773,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */ || node.kind === 160 /* Parameter */) { + else if (node.parent.kind === 249 /* ClassDeclaration */ || node.kind === 159 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97111,7 +94798,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 168 /* SetAccessor */) { + if (node.kind === 167 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasSyntacticModifier(node, 32 /* Static */)) { @@ -97150,26 +94837,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -97177,7 +94864,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -97191,7 +94878,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -97216,30 +94903,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 170 /* ConstructSignature */: - case 175 /* ConstructorType */: + case 169 /* ConstructSignature */: + case 174 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 169 /* CallSignature */: + case 168 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -97247,7 +94934,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97260,15 +94947,15 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 251 /* FunctionDeclaration */: - case 174 /* FunctionType */: + case 248 /* FunctionDeclaration */: + case 173 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 168 /* SetAccessor */: - case 167 /* GetAccessor */: + case 167 /* SetAccessor */: + case 166 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97282,39 +94969,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 190 /* MappedType */: + case 189 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 249 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174 /* FunctionType */: - case 251 /* FunctionDeclaration */: + case 173 /* FunctionType */: + case 248 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -97378,7 +95065,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 160 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 159 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -97433,7 +95120,6 @@ var ts; reportCyclicStructureError: reportCyclicStructureError, reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression, reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError, - reportTruncationError: reportTruncationError, moduleResolverHost: host, trackReferencedAmbientModule: trackReferencedAmbientModule, trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode, @@ -97533,11 +95219,6 @@ var ts; context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier)); } } - function reportTruncationError() { - if (errorNameNode) { - context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed)); - } - } function reportNonlocalAugmentation(containingFile, parentSymbol, symbol) { var primaryDeclaration = ts.find(parentSymbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === containingFile; }); var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; }); @@ -97559,10 +95240,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 297 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 294 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 298 /* Bundle */) { + if (node.kind === 295 /* Bundle */) { isBundledEmit = true; refs = new ts.Map(); libs = new ts.Map(); @@ -97592,7 +95273,7 @@ var ts; var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return factory.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 300 /* InputFiles */) { + if (prepend.kind === 297 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -97733,7 +95414,7 @@ var ts; return name; } else { - if (name.kind === 197 /* ArrayBindingPattern */) { + if (name.kind === 194 /* ArrayBindingPattern */) { return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -97741,7 +95422,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 222 /* OmittedExpression */) { + if (elem.kind === 219 /* OmittedExpression */) { return elem; } return factory.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -97779,7 +95460,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 160 /* Parameter */ && + var shouldUseResolverType = node.kind === 159 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -97788,7 +95469,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : factory.createKeywordTypeNode(128 /* AnyKeyword */); } - if (node.kind === 168 /* SetAccessor */) { + if (node.kind === 167 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return factory.createKeywordTypeNode(128 /* AnyKeyword */); @@ -97799,12 +95480,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 160 /* Parameter */ - || node.kind === 163 /* PropertyDeclaration */ - || node.kind === 162 /* PropertySignature */) { + if (node.kind === 159 /* Parameter */ + || node.kind === 162 /* PropertyDeclaration */ + || node.kind === 161 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -97821,20 +95502,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: return false; } return false; @@ -97915,7 +95596,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 256 /* ModuleDeclaration */ && parent.kind !== 195 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 253 /* ModuleDeclaration */ && parent.kind !== 192 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -97935,7 +95616,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 272 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 269 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return factory.updateImportEqualsDeclaration(decl, @@ -97962,7 +95643,7 @@ var ts; return visibleDefaultBinding && factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, /*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 260 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -98057,7 +95738,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 177 /* TypeLiteral */ || input.kind === 190 /* MappedType */) && input.parent.kind !== 254 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 176 /* TypeLiteral */ || input.kind === 189 /* MappedType */) && input.parent.kind !== 251 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasEffectiveModifier(input, 8 /* Private */)) { @@ -98078,21 +95759,21 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 223 /* ExpressionWithTypeArguments */: { + case 220 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments)); } - case 173 /* TypeReference */: { + case 172 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory.updateTypeReferenceNode(node, node.typeName, node.typeArguments)); } - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return cleanup(factory.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 166 /* Constructor */: { + case 165 /* Constructor */: { // A constructor declaration may not have a type annotation var ctor = factory.createConstructorDeclaration( /*decorators*/ undefined, @@ -98100,7 +95781,7 @@ var ts; /*body*/ undefined); return cleanup(ctor); } - case 165 /* MethodDeclaration */: { + case 164 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98110,7 +95791,7 @@ var ts; /*body*/ undefined); return cleanup(sig); } - case 167 /* GetAccessor */: { + case 166 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98119,7 +95800,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 168 /* SetAccessor */: { + case 167 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98127,31 +95808,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updatePropertyDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type))); - case 164 /* MethodSignature */: { + case 163 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updateMethodSignature(input, ensureModifiers(input), input.name, input.questionToken, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 169 /* CallSignature */: { + case 168 /* CallSignature */: { return cleanup(factory.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 171 /* IndexSignature */: { + case 170 /* IndexSignature */: { return cleanup(factory.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || factory.createKeywordTypeNode(128 /* AnyKeyword */))); } - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -98159,13 +95840,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(factory.updateVariableDeclaration(input, input.name, /*exclamationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 159 /* TypeParameter */: { + case 158 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(factory.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 184 /* ConditionalType */: { + case 183 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -98177,13 +95858,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(factory.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 174 /* FunctionType */: { + case 173 /* FunctionType */: { return cleanup(factory.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 175 /* ConstructorType */: { + case 174 /* ConstructorType */: { return cleanup(factory.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 195 /* ImportType */: { + case 192 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -98215,7 +95896,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 165 /* MethodDeclaration */ && ts.hasEffectiveModifier(node.parent, 8 /* Private */); + return node.parent.kind === 164 /* MethodDeclaration */ && ts.hasEffectiveModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -98225,7 +95906,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 267 /* ExportDeclaration */: { + case 264 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -98235,7 +95916,7 @@ var ts; return factory.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier)); } - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -98274,10 +95955,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 260 /* ImportEqualsDeclaration */: { + case 257 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 261 /* ImportDeclaration */: { + case 258 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -98298,14 +95979,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 254 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 251 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(factory.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 253 /* InterfaceDeclaration */: { + case 250 /* InterfaceDeclaration */: { return cleanup(factory.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 251 /* FunctionDeclaration */: { + case 248 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(factory.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -98372,10 +96053,10 @@ var ts; return clean; } } - case 256 /* ModuleDeclaration */: { + case 253 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 257 /* ModuleBlock */) { + if (inner && inner.kind === 254 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -98418,7 +96099,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 252 /* ClassDeclaration */: { + case 249 /* ClassDeclaration */: { var modifiers = factory.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -98499,10 +96180,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 232 /* VariableStatement */: { + case 229 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 255 /* EnumDeclaration */: { + case 252 /* EnumDeclaration */: { return cleanup(factory.updateEnumDeclaration(input, /*decorators*/ undefined, factory.createNodeArray(ensureModifiers(input)), input.name, factory.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -98521,7 +96202,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 256 /* ModuleDeclaration */) { + if (input.kind === 253 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -98542,7 +96223,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 222 /* OmittedExpression */) { + if (e.kind === 219 /* OmittedExpression */) { return; } if (e.name) { @@ -98592,7 +96273,7 @@ var ts; function ensureModifierFlags(node) { var mask = 11263 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 297 /* SourceFile */; + var parentIsFile = node.parent.kind === 294 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -98621,7 +96302,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 253 /* InterfaceDeclaration */) { + if (node.kind === 250 /* InterfaceDeclaration */) { return true; } return false; @@ -98646,7 +96327,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 167 /* GetAccessor */ + return accessor.kind === 166 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -98655,52 +96336,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return !ts.hasEffectiveModifier(node, 8 /* Private */); - case 160 /* Parameter */: - case 249 /* VariableDeclaration */: + case 159 /* Parameter */: + case 246 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 232 /* VariableStatement */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 229 /* VariableStatement */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 170 /* ConstructSignature */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 171 /* IndexSignature */: - case 249 /* VariableDeclaration */: - case 159 /* TypeParameter */: - case 223 /* ExpressionWithTypeArguments */: - case 173 /* TypeReference */: - case 184 /* ConditionalType */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 195 /* ImportType */: + case 169 /* ConstructSignature */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 170 /* IndexSignature */: + case 246 /* VariableDeclaration */: + case 158 /* TypeParameter */: + case 220 /* ExpressionWithTypeArguments */: + case 172 /* TypeReference */: + case 183 /* ConditionalType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 192 /* ImportType */: return true; } return false; @@ -98744,13 +96425,14 @@ var ts; function getScriptTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles) { if (emitOnlyDtsFiles) return ts.emptyArray; + var jsx = compilerOptions.jsx; var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var transformers = []; ts.addRange(transformers, customTransformers && ts.map(customTransformers.before, wrapScriptTransformerFactory)); transformers.push(ts.transformTypeScript); transformers.push(ts.transformClassFields); - if (ts.getJSXTransformEnabled(compilerOptions)) { + if (jsx === 2 /* React */) { transformers.push(ts.transformJsx); } if (languageVersion < 99 /* ESNext */) { @@ -98832,7 +96514,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, factory, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(341 /* Count */); + var enabledSyntaxKindFeatures = new Array(336 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentStatements; @@ -98905,13 +96587,7 @@ var ts; // prevent modification of transformation hooks. state = 1 /* Initialized */; // Transform each node. - var transformed = []; - for (var _a = 0, nodes_3 = nodes; _a < nodes_3.length; _a++) { - var node = nodes_3[_a]; - ts.tracing.push("emit" /* Emit */, "transformNodes", node.kind === 297 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); - transformed.push((allowDtsFiles ? transformation : transformRoot)(node)); - ts.tracing.pop(); - } + var transformed = ts.map(nodes, allowDtsFiles ? transformation : transformRoot); // prevent modification of the lexical environment. state = 2 /* Completed */; ts.performance.mark("afterTransform"); @@ -99147,8 +96823,8 @@ var ts; function dispose() { if (state < 3 /* Disposed */) { // Clean up emit nodes on parse tree - for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { - var node = nodes_4[_i]; + for (var _i = 0, nodes_3 = nodes; _i < nodes_3.length; _i++) { + var node = nodes_3[_i]; ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); } // Release references to external entries for GC purposes. @@ -99280,7 +96956,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 298 /* Bundle */) { + if (sourceFile.kind === 295 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -99476,15 +97152,9 @@ var ts; sourceFiles: sourceFileOrBundle.sourceFiles.map(function (file) { return relativeToBuildInfo(ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory())); }) }; } - ts.tracing.push("emit" /* Emit */, "emitJsFileOrBundle", { jsFilePath: jsFilePath }); emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo); - ts.tracing.pop(); - ts.tracing.push("emit" /* Emit */, "emitDeclarationFileOrBundle", { declarationFilePath: declarationFilePath }); emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo); - ts.tracing.pop(); - ts.tracing.push("emit" /* Emit */, "emitBuildInfo", { buildInfoPath: buildInfoPath }); emitBuildInfo(bundleBuildInfo, buildInfoPath); - ts.tracing.pop(); if (!emitSkipped && emittedFilesList) { if (!emitOnlyDtsFiles) { if (jsFilePath) { @@ -99616,7 +97286,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 297 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 294 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -99639,8 +97309,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 298 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 297 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 295 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 294 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -99681,7 +97351,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 297 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 294 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -99725,16 +97395,16 @@ var ts; if (ts.getRootLength(sourceMapDir) === 0) { // The relative paths are relative to the common directory sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - return encodeURI(ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath + return ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath ts.combinePaths(sourceMapDir, sourceMapFile), // this is where user expects to see sourceMap host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ true)); + /*isAbsolutePathAnUrl*/ true); } else { - return encodeURI(ts.combinePaths(sourceMapDir, sourceMapFile)); + return ts.combinePaths(sourceMapDir, sourceMapFile); } } - return encodeURI(sourceMapFile); + return sourceMapFile; } } ts.emitFiles = emitFiles; @@ -99949,8 +97619,6 @@ var ts; var sourceMapGenerator; var sourceMapSource; var sourceMapSourceIndex = -1; - var mostRecentlyAddedSourceMapSource; - var mostRecentlyAddedSourceMapSourceIndex = -1; // Comments var containerPos = -1; var containerEnd = -1; @@ -99989,9 +97657,9 @@ var ts; break; } switch (node.kind) { - case 297 /* SourceFile */: return printFile(node); - case 298 /* Bundle */: return printBundle(node); - case 299 /* UnparsedSource */: return printUnparsedSource(node); + case 294 /* SourceFile */: return printFile(node); + case 295 /* Bundle */: return printBundle(node); + case 296 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -100247,12 +97915,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 297 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 294 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 297 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 294 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -100294,15 +97962,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 299 /* UnparsedSource */: - case 293 /* UnparsedPrepend */: + case 296 /* UnparsedSource */: + case 290 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 292 /* UnparsedPrologue */: + case 289 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 294 /* UnparsedText */: - case 295 /* UnparsedInternalText */: + case 291 /* UnparsedText */: + case 292 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 296 /* UnparsedSyntheticReference */: + case 293 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 78 /* Identifier */: @@ -100312,270 +97980,262 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return emitQualifiedName(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return emitTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return emitParameter(node); - case 161 /* Decorator */: + case 160 /* Decorator */: return emitDecorator(node); // Type members - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return emitPropertySignature(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 164 /* MethodSignature */: + case 163 /* MethodSignature */: return emitMethodSignature(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return emitConstructor(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return emitAccessorDeclaration(node); - case 169 /* CallSignature */: + case 168 /* CallSignature */: return emitCallSignature(node); - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return emitConstructSignature(node); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return emitIndexSignature(node); - case 194 /* TemplateLiteralTypeSpan */: - return emitTemplateTypeSpan(node); // Types - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return emitTypePredicate(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return emitTypeReference(node); - case 174 /* FunctionType */: + case 173 /* FunctionType */: return emitFunctionType(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 175 /* ConstructorType */: + case 174 /* ConstructorType */: return emitConstructorType(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return emitTypeQuery(node); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return emitTypeLiteral(node); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return emitArrayType(node); - case 179 /* TupleType */: + case 178 /* TupleType */: return emitTupleType(node); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return emitOptionalType(node); - case 182 /* UnionType */: + case 181 /* UnionType */: return emitUnionType(node); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return emitIntersectionType(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return emitConditionalType(node); - case 185 /* InferType */: + case 184 /* InferType */: return emitInferType(node); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return emitParenthesizedType(node); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 187 /* ThisType */: + case 186 /* ThisType */: return emitThisType(); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return emitTypeOperator(node); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return emitMappedType(node); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return emitLiteralType(node); - case 193 /* TemplateLiteralType */: - return emitTemplateType(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return emitImportTypeNode(node); - case 303 /* JSDocAllType */: + case 299 /* JSDocAllType */: writePunctuation("*"); return; - case 304 /* JSDocUnknownType */: + case 300 /* JSDocUnknownType */: writePunctuation("?"); return; - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 306 /* JSDocNonNullableType */: + case 302 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 181 /* RestType */: - case 309 /* JSDocVariadicType */: + case 180 /* RestType */: + case 305 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return emitNamedTupleMember(node); // Binding patterns - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return emitBindingElement(node); // Misc - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return emitTemplateSpan(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 230 /* Block */: + case 227 /* Block */: return emitBlock(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return emitVariableStatement(node); - case 231 /* EmptyStatement */: + case 228 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return emitExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return emitIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return emitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return emitWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return emitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return emitForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return emitForOfStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return emitContinueStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return emitBreakStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return emitReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return emitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return emitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return emitLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return emitThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return emitTryStatement(node); - case 248 /* DebuggerStatement */: + case 245 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return emitClassDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return emitModuleBlock(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return emitCaseBlock(node); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return emitImportDeclaration(node); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return emitImportClause(node); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return emitNamespaceImport(node); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return emitNamespaceExport(node); - case 264 /* NamedImports */: + case 261 /* NamedImports */: return emitNamedImports(node); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return emitImportSpecifier(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return emitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return emitExportDeclaration(node); - case 268 /* NamedExports */: + case 265 /* NamedExports */: return emitNamedExports(node); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return emitExportSpecifier(node); - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return; // Module references - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 275 /* JsxOpeningElement */: - case 278 /* JsxOpeningFragment */: + case 272 /* JsxOpeningElement */: + case 275 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 276 /* JsxClosingElement */: - case 279 /* JsxClosingFragment */: + case 273 /* JsxClosingElement */: + case 276 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return emitJsxAttribute(node); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return emitJsxAttributes(node); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 284 /* CaseClause */: + case 281 /* CaseClause */: return emitCaseClause(node); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return emitDefaultClause(node); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return emitHeritageClause(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 291 /* EnumMember */: + case 288 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 328 /* JSDocThisTag */: - case 325 /* JSDocEnumTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 324 /* JSDocThisTag */: + case 321 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 316 /* JSDocImplementsTag */: - case 315 /* JSDocAugmentsTag */: + case 312 /* JSDocImplementsTag */: + case 311 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 324 /* JSDocCallbackTag */: + case 320 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 313 /* JSDocSignature */: + case 309 /* JSDocSignature */: return emitJSDocSignature(node); - case 312 /* JSDocTypeLiteral */: + case 308 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 319 /* JSDocClassTag */: - case 314 /* JSDocTag */: + case 315 /* JSDocClassTag */: + case 310 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 332 /* JSDocSeeTag */: - return emitJSDocSeeTag(node); - case 302 /* JSDocNameReference */: - return emitJSDocNameReference(node); - case 311 /* JSDocComment */: + case 307 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -100612,71 +98272,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return emitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return emitNewExpression(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return emitFunctionExpression(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return emitArrowFunction(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return emitDeleteExpression(node); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return emitVoidExpression(node); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return emitAwaitExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return emitBinaryExpression(node); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return emitConditionalExpression(node); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return emitTemplateExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return emitYieldExpression(node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return emitSpreadExpression(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return emitClassExpression(node); - case 222 /* OmittedExpression */: + case 219 /* OmittedExpression */: return; - case 224 /* AsExpression */: + case 221 /* AsExpression */: return emitAsExpression(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return emitNonNullExpression(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 273 /* JsxElement */: + case 270 /* JsxElement */: return emitJsxElement(node); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return emitCommaList(node); } } @@ -100718,7 +98378,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 298 /* Bundle */ ? node : undefined; + var bundle = node.kind === 295 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -100818,7 +98478,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 294 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 291 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -100891,7 +98551,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 308 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 304 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -100953,7 +98613,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 167 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 166 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -100987,10 +98647,6 @@ var ts; emitTypeAnnotation(node.type); writeTrailingSemicolon(); } - function emitTemplateTypeSpan(node) { - emit(node.type); - emit(node.literal); - } function emitSemicolonClassElement() { writeTrailingSemicolon(); } @@ -101149,19 +98805,13 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 142 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 141 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); } writePunctuation("["); pipelineEmit(3 /* MappedTypeParameter */, node.typeParameter); - if (node.nameType) { - writeSpace(); - writeKeyword("as"); - writeSpace(); - emit(node.nameType); - } writePunctuation("]"); if (node.questionToken) { emit(node.questionToken); @@ -101185,10 +98835,6 @@ var ts; function emitLiteralType(node) { emitExpression(node.literal); } - function emitTemplateType(node) { - emit(node.head); - emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); - } function emitImportTypeNode(node) { if (node.isTypeOf) { writeKeyword("typeof"); @@ -101387,7 +99033,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 214 /* PrefixUnaryExpression */ + return operand.kind === 211 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -101575,7 +99221,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node, node.thenStatement, node.elseStatement); emitTokenWithComment(90 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 234 /* IfStatement */) { + if (node.elseStatement.kind === 231 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -101638,7 +99284,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(156 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(155 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -101646,7 +99292,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 250 /* VariableDeclarationList */) { + if (node.kind === 247 /* VariableDeclarationList */) { emit(node); } else { @@ -101942,7 +99588,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 256 /* ModuleDeclaration */) { + while (body.kind === 253 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -101987,7 +99633,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(153 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(152 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -101995,7 +99641,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(149 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(148 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -102035,7 +99681,7 @@ var ts; var nextPos = emitTokenWithComment(92 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(149 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(148 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -102047,7 +99693,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(153 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(152 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -102058,7 +99704,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(126 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(140 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(139 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -102281,7 +99927,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 329 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 325 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -102297,17 +99943,6 @@ var ts; emitJSDocTypeExpression(tag.typeExpression); emitJSDocComment(tag.comment); } - function emitJSDocSeeTag(tag) { - emitJSDocTagName(tag.tagName); - emit(tag.name); - emitJSDocComment(tag.comment); - } - function emitJSDocNameReference(node) { - writeSpace(); - writePunctuation("{"); - emit(node.name); - writePunctuation("}"); - } function emitJSDocHeritageTag(tag) { emitJSDocTagName(tag.tagName); writeSpace(); @@ -102326,7 +99961,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 301 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 298 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -102345,7 +99980,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 312 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 308 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -102479,8 +100114,8 @@ var ts; bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName }); writeLine(); } - for (var _d = 0, types_23 = types; _d < types_23.length; _d++) { - var directive = types_23[_d]; + for (var _d = 0, types_22 = types; _d < types_22.length; _d++) { + var directive = types_22[_d]; var pos = writer.getTextPos(); writeComment("/// "); if (bundleFileInfo) @@ -103209,7 +100844,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 207 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 204 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -103242,10 +100877,7 @@ var ts; return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape); } } - var flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) - | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) - | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0); - return ts.getLiteralText(node, currentSourceFile, flags); + return ts.getLiteralText(node, currentSourceFile, neverAsciiEscape, jsxAttributeEscape); } /** * Push a new name generation scope. @@ -103278,84 +100910,84 @@ var ts; if (!node) return; switch (node.kind) { - case 230 /* Block */: + case 227 /* Block */: ts.forEach(node.statements, generateNames); break; - case 245 /* LabeledStatement */: - case 243 /* WithStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 242 /* LabeledStatement */: + case 240 /* WithStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: generateNames(node.statement); break; - case 234 /* IfStatement */: + case 231 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 287 /* CatchClause */: + case 284 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: generateNames(node.declarationList); break; - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: generateNames(node.importClause); break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -103364,12 +100996,12 @@ var ts; if (!node) return; switch (node.kind) { - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -103551,23 +101183,23 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 266 /* ExportAssignment */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 263 /* ExportAssignment */: return generateNameForExportDefault(); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return generateNameForClassExpression(); - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -103615,7 +101247,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 335 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 330 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -103639,7 +101271,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 250 /* VariableDeclarationList */) { + if (node.kind === 247 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -103732,12 +101364,7 @@ var ts; function emitLeadingComments(pos, isEmittedNode) { hasWrittenComment = false; if (isEmittedNode) { - if (pos === 0 && (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.isDeclarationFile)) { - forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment); - } - else { - forEachLeadingCommentToEmit(pos, emitLeadingComment); - } + forEachLeadingCommentToEmit(pos, emitLeadingComment); } else if (pos === 0) { // If the node will not be emitted in JS, remove all the comments(normal, pinned and ///) associated with the node, @@ -103756,11 +101383,6 @@ var ts; emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); } } - function emitNonTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { - if (!isTripleSlashComment(commentPos, commentEnd)) { - emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); - } - } function shouldWriteComment(text, pos) { if (printerOptions.onlyPrintJsDocStyle) { return (ts.isJSDocLikeText(text, pos) || ts.isPinnedComment(text, pos)); @@ -103908,7 +101530,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 335 /* NotEmittedStatement */ + if (node.kind !== 330 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -103921,7 +101543,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 335 /* NotEmittedStatement */ + if (node.kind !== 330 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -103954,10 +101576,9 @@ var ts; function emitSourcePos(source, pos) { if (source !== sourceMapSource) { var savedSourceMapSource = sourceMapSource; - var savedSourceMapSourceIndex = sourceMapSourceIndex; setSourceMapSource(source); emitPos(pos); - resetSourceMapSource(savedSourceMapSource, savedSourceMapSourceIndex); + setSourceMapSource(savedSourceMapSource); } else { emitPos(pos); @@ -103996,12 +101617,6 @@ var ts; return; } sourceMapSource = source; - if (source === mostRecentlyAddedSourceMapSource) { - // Fast path for when the new source map is the most recently added, in which case - // we use its captured index without going through the source map generator. - sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex; - return; - } if (isJsonSourceMapSource(source)) { return; } @@ -104009,12 +101624,6 @@ var ts; if (printerOptions.inlineSources) { sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text); } - mostRecentlyAddedSourceMapSource = source; - mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex; - } - function resetSourceMapSource(source, sourceIndex) { - sourceMapSource = source; - sourceMapSourceIndex = sourceIndex; } function isJsonSourceMapSource(sourceFile) { return ts.fileExtensionIs(sourceFile.fileName, ".json" /* Json */); @@ -104513,7 +102122,6 @@ var ts; if (system === void 0) { system = ts.sys; } var existingDirectories = new ts.Map(); var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames); - var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash; function getSourceFile(fileName, languageVersion, onError) { var text; try { @@ -104558,14 +102166,14 @@ var ts; } var outputFingerprints; function writeFileWorker(fileName, data, writeByteOrderMark) { - if (!ts.isWatchSet(options) || !system.getModifiedTime) { + if (!ts.isWatchSet(options) || !system.createHash || !system.getModifiedTime) { system.writeFile(fileName, data, writeByteOrderMark); return; } if (!outputFingerprints) { outputFingerprints = new ts.Map(); } - var hash = computeHash(data); + var hash = system.createHash(data); var mtimeBefore = system.getModifiedTime(fileName); if (mtimeBefore) { var fingerprint = outputFingerprints.get(fileName); @@ -104918,35 +102526,6 @@ var ts; } ts.loadWithLocalCache = loadWithLocalCache; /* @internal */ - function forEachResolvedProjectReference(resolvedProjectReferences, cb) { - return forEachProjectReference(/*projectReferences*/ undefined, resolvedProjectReferences, function (resolvedRef, parent) { return resolvedRef && cb(resolvedRef, parent); }); - } - ts.forEachResolvedProjectReference = forEachResolvedProjectReference; - function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { - var seenResolvedRefs; - return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined); - function worker(projectReferences, resolvedProjectReferences, parent) { - // Visit project references first - if (cbRef) { - var result = cbRef(projectReferences, parent); - if (result) { - return result; - } - } - return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) { - if (resolvedRef && (seenResolvedRefs === null || seenResolvedRefs === void 0 ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) { - // ignore recursives - return undefined; - } - var result = cbResolvedRef(resolvedRef, parent, index); - if (result || !resolvedRef) - return result; - (seenResolvedRefs || (seenResolvedRefs = new ts.Set())).add(resolvedRef.sourceFile.path); - return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef); - }); - } - } - /* @internal */ ts.inferredTypesContainingFile = "__inferred type names__.ts"; /** * Determines if program structure is upto date or needs to be recreated @@ -105082,8 +102661,6 @@ var ts; var modulesWithElidedImports = new ts.Map(); // Track source files that are source files found by searching under node_modules, as these shouldn't be compiled. var sourceFilesFoundSearchingNodeModules = new ts.Map(); - var tracingData = ["program" /* Program */, "createProgram"]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeProgram"); var host = createProgramOptions.host || createCompilerHost(options); var configParsingHost = parseConfigHostFromCompilerHostLike(host); @@ -105159,16 +102736,12 @@ var ts; getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, forEachResolvedProjectReference: forEachResolvedProjectReference }), onProgramCreateComplete = _c.onProgramCreateComplete, fileExists = _c.fileExists, directoryExists = _c.directoryExists; - ts.tracing.push("program" /* Program */, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram }); var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); - ts.tracing.pop(); // We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks // `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`. - var structureIsReused; - ts.tracing.push("program" /* Program */, "tryReuseStructureFromOldProgram", {}); - structureIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const - ts.tracing.pop(); - if (structureIsReused !== 2 /* Completely */) { + var structuralIsReused; + structuralIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const + if (structuralIsReused !== 2 /* Completely */) { processingDefaultLibFiles = []; processingOtherFiles = []; if (projectReferences) { @@ -105205,13 +102778,10 @@ var ts; } } } - ts.tracing.push("program" /* Program */, "processRootFiles", { count: rootNames.length }); ts.forEach(rootNames, function (name) { return processRootFile(name, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false); }); - ts.tracing.pop(); // load type declarations specified via 'types' argument or implicitly from types/ and node_modules/@types folders var typeReferences = rootNames.length ? ts.getAutomaticTypeDirectiveNames(options, host) : ts.emptyArray; if (typeReferences.length) { - ts.tracing.push("program" /* Program */, "processTypeReferences", { count: typeReferences.length }); // This containingFilename needs to match with the one used in managed-side var containingDirectory = options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : host.getCurrentDirectory(); var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile); @@ -105219,7 +102789,6 @@ var ts; for (var i = 0; i < typeReferences.length; i++) { processTypeReferenceDirective(typeReferences[i], resolutions[i]); } - ts.tracing.pop(); } // Do not process the default library if: // - The '--noLib' flag is used. @@ -105260,8 +102829,8 @@ var ts; host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path)); } } - oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference) { - if (!getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) { + oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference, resolvedProjectReferencePath) { + if (resolvedProjectReference && !getResolvedProjectReferenceByPath(resolvedProjectReferencePath)) { host.onReleaseOldSourceFile(resolvedProjectReference.sourceFile, oldProgram.getCompilerOptions(), /*hasSourceFileByPath*/ false); } }); @@ -105281,7 +102850,6 @@ var ts; getOptionsDiagnostics: getOptionsDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getSemanticDiagnostics: getSemanticDiagnostics, - getCachedSemanticDiagnostics: getCachedSemanticDiagnostics, getSuggestionDiagnostics: getSuggestionDiagnostics, getDeclarationDiagnostics: getDeclarationDiagnostics, getBindAndCheckDiagnostics: getBindAndCheckDiagnostics, @@ -105295,7 +102863,6 @@ var ts; getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, - getTypeCatalog: function () { return getDiagnosticsProducingTypeChecker().getTypeCatalog(); }, getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); }, getInstantiationCount: function () { return getDiagnosticsProducingTypeChecker().getInstantiationCount(); }, getRelationCacheSizes: function () { return getDiagnosticsProducingTypeChecker().getRelationCacheSizes(); }, @@ -105324,73 +102891,26 @@ var ts; getSymlinkCache: getSymlinkCache, realpath: (_b = host.realpath) === null || _b === void 0 ? void 0 : _b.bind(host), useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, - structureIsReused: structureIsReused, }; onProgramCreateComplete(); verifyCompilerOptions(); ts.performance.mark("afterProgram"); ts.performance.measure("Program", "beforeProgram", "afterProgram"); - ts.tracing.end.apply(ts.tracing, tracingData); return program; - function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames) { - if (!moduleNames.length) - return ts.emptyArray; - var containingFileName = ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); - var redirectedReference = getRedirectReferenceForResolution(containingFile); - ts.tracing.push("program" /* Program */, "resolveModuleNamesWorker", { containingFileName: containingFileName }); + function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames, redirectedReference) { ts.performance.mark("beforeResolveModule"); - var result = actualResolveModuleNamesWorker(moduleNames, containingFileName, reusedNames, redirectedReference); + var result = actualResolveModuleNamesWorker(moduleNames, containingFile, reusedNames, redirectedReference); ts.performance.mark("afterResolveModule"); ts.performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule"); - ts.tracing.pop(); return result; } - function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile) { - if (!typeDirectiveNames.length) - return []; - var containingFileName = !ts.isString(containingFile) ? ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile; - var redirectedReference = !ts.isString(containingFile) ? getRedirectReferenceForResolution(containingFile) : undefined; - ts.tracing.push("program" /* Program */, "resolveTypeReferenceDirectiveNamesWorker", { containingFileName: containingFileName }); + function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, redirectedReference) { ts.performance.mark("beforeResolveTypeReference"); - var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference); + var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, redirectedReference); ts.performance.mark("afterResolveTypeReference"); ts.performance.measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference"); - ts.tracing.pop(); return result; } - function getRedirectReferenceForResolution(file) { - var redirect = getResolvedProjectReferenceToRedirect(file.originalFileName); - if (redirect || !ts.fileExtensionIs(file.originalFileName, ".d.ts" /* Dts */)) - return redirect; - // The originalFileName could not be actual source file name if file found was d.ts from referecned project - // So in this case try to look up if this is output from referenced project, if it is use the redirected project in that case - var resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.originalFileName, file.path); - if (resultFromDts) - return resultFromDts; - // If preserveSymlinks is true, module resolution wont jump the symlink - // but the resolved real path may be the .d.ts from project reference - // Note:: Currently we try the real path only if the - // file is from node_modules to avoid having to run real path on all file paths - if (!host.realpath || !options.preserveSymlinks || !ts.stringContains(file.originalFileName, ts.nodeModulesPathPart)) - return undefined; - var realDeclarationFileName = host.realpath(file.originalFileName); - var realDeclarationPath = toPath(realDeclarationFileName); - return realDeclarationPath === file.path ? undefined : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationFileName, realDeclarationPath); - } - function getRedirectReferenceForResolutionFromSourceOfProject(fileName, filePath) { - var source = getSourceOfProjectReferenceRedirect(fileName); - if (ts.isString(source)) - return getResolvedProjectReferenceToRedirect(source); - if (!source) - return undefined; - // Output of .d.ts file so return resolved ref that matches the out file name - return forEachResolvedProjectReference(function (resolvedRef) { - var out = ts.outFile(resolvedRef.commandLine.options); - if (!out) - return undefined; - return toPath(out) === filePath ? resolvedRef : undefined; - }); - } function compareDefaultLibFiles(a, b) { return ts.compareValues(getDefaultLibFilePriority(a), getDefaultLibFilePriority(b)); } @@ -105449,13 +102969,13 @@ var ts; } return classifiableNames; } - function resolveModuleNamesReusingOldState(moduleNames, file) { - if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) { + function resolveModuleNamesReusingOldState(moduleNames, containingFile, file) { + if (structuralIsReused === 0 /* Not */ && !file.ambientModuleNames.length) { // If the old program state does not permit reusing resolutions and `file` does not contain locally defined ambient modules, // the best we can do is fallback to the default logic. - return resolveModuleNamesWorker(moduleNames, file, /*reusedNames*/ undefined); + return resolveModuleNamesWorker(moduleNames, containingFile, /*reusedNames*/ undefined, getResolvedProjectReferenceToRedirect(file.originalFileName)); } - var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName); + var oldSourceFile = oldProgram && oldProgram.getSourceFile(containingFile); if (oldSourceFile !== file && file.resolvedModules) { // `file` was created for the new program. // @@ -105465,13 +102985,13 @@ var ts; // which per above occurred during the current program creation. // Since we assume the filesystem does not change during program creation, // it is safe to reuse resolutions from the earlier call. - var result_14 = []; + var result_12 = []; for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { var moduleName = moduleNames_1[_i]; var resolvedModule = file.resolvedModules.get(moduleName); - result_14.push(resolvedModule); + result_12.push(resolvedModule); } - return result_14; + return result_12; } // At this point, we know at least one of the following hold: // - file has local declarations for ambient modules @@ -105499,7 +103019,7 @@ var ts; var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName); if (oldResolvedModule) { if (ts.isTraceEnabled(options, host)) { - ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, containingFile); } (result || (result = new Array(moduleNames.length)))[i] = oldResolvedModule; (reusedNames || (reusedNames = [])).push(moduleName); @@ -105514,7 +103034,7 @@ var ts; if (ts.contains(file.ambientModuleNames, moduleName)) { resolvesToAmbientModuleInNonModifiedFile = true; if (ts.isTraceEnabled(options, host)) { - ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, containingFile); } } else { @@ -105529,7 +103049,7 @@ var ts; } } var resolutions = unknownModuleNames && unknownModuleNames.length - ? resolveModuleNamesWorker(unknownModuleNames, file, reusedNames) + ? resolveModuleNamesWorker(unknownModuleNames, containingFile, reusedNames, getResolvedProjectReferenceToRedirect(file.originalFileName)) : ts.emptyArray; // Combine results of resolutions and predicted results if (!result) { @@ -105577,7 +103097,7 @@ var ts; } } function canReuseProjectReferences() { - return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, parent, index) { + return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, index, parent) { var newRef = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; var newResolvedRef = parseProjectReferenceConfigFile(newRef); if (oldResolvedRef) { @@ -105603,19 +103123,19 @@ var ts; // if any of these properties has changed - structure cannot be reused var oldOptions = oldProgram.getCompilerOptions(); if (ts.changesAffectModuleResolution(oldOptions, options)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } // there is an old program, check if we can reuse its structure var oldRootNames = oldProgram.getRootFileNames(); if (!ts.arrayIsEqualTo(oldRootNames, rootNames)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (!ts.arrayIsEqualTo(options.types, oldOptions.types)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } // Check if any referenced project tsconfig files are different if (!canReuseProjectReferences()) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (projectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); @@ -105623,12 +103143,12 @@ var ts; // check if program source files has changed in the way that can affect structure of the program var newSourceFiles = []; var modifiedSourceFiles = []; - structureIsReused = 2 /* Completely */; + oldProgram.structureIsReused = 2 /* Completely */; // If the missing file paths are now present, it can change the progam structure, // and hence cant reuse the structure. // This is same as how we dont reuse the structure if one of the file from old program is now missing if (oldProgram.getMissingFilePaths().some(function (missingFilePath) { return host.fileExists(missingFilePath); })) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } var oldSourceFiles = oldProgram.getSourceFiles(); var SeenPackageName; @@ -105643,7 +103163,7 @@ var ts; ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, options.target, /*onError*/ undefined, shouldCreateNewSourceFile) : host.getSourceFile(oldSourceFile.fileName, options.target, /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217 if (!newSourceFile) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } ts.Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); var fileChanged = void 0; @@ -105652,7 +103172,7 @@ var ts; // This lets us know if the unredirected file has changed. If it has we should break the redirect. if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { // Underlying file has changed. Might not redirect anymore. Must rebuild program. - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } fileChanged = false; newSourceFile = oldSourceFile; // Use the redirect. @@ -105660,7 +103180,7 @@ var ts; else if (oldProgram.redirectTargetsMap.has(oldSourceFile.path)) { // If a redirected-to source file changes, the redirect may be broken. if (newSourceFile !== oldSourceFile) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } fileChanged = false; } @@ -105679,7 +103199,7 @@ var ts; var prevKind = seenPackageNames.get(packageName); var newKind = fileChanged ? 1 /* Modified */ : 0 /* Exists */; if ((prevKind !== undefined && newKind === 1 /* Modified */) || prevKind === 1 /* Modified */) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } seenPackageNames.set(packageName, newKind); } @@ -105687,50 +103207,50 @@ var ts; // The `newSourceFile` object was created for the new program. if (!ts.arrayIsEqualTo(oldSourceFile.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) { // 'lib' references has changed. Matches behavior in changesAffectModuleResolution - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { // value of no-default-lib has changed // this will affect if default library is injected into the list of files - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // check tripleslash references if (!ts.arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) { // tripleslash references has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // check imports and module augmentations collectExternalModuleReferences(newSourceFile); if (!ts.arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) { // imports has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { // moduleAugmentations has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if ((oldSourceFile.flags & 3145728 /* PermanentlySetIncrementalFlags */) !== (newSourceFile.flags & 3145728 /* PermanentlySetIncrementalFlags */)) { // dynamicImport has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { // 'types' references has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // tentatively approve the file modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); } else if (hasInvalidatedResolution(oldSourceFile.path)) { // 'module/types' references could have changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; // add file to the modified list so that we will resolve it later modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); } // if file has passed all checks it should be safe to reuse it newSourceFiles.push(newSourceFile); } - if (structureIsReused !== 2 /* Completely */) { - return structureIsReused; + if (oldProgram.structureIsReused !== 2 /* Completely */) { + return oldProgram.structureIsReused; } var modifiedFiles = modifiedSourceFiles.map(function (f) { return f.oldFile; }); for (var _b = 0, oldSourceFiles_3 = oldSourceFiles; _b < oldSourceFiles_3.length; _b++) { @@ -105745,35 +103265,38 @@ var ts; // try to verify results of module resolution for (var _e = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _e < modifiedSourceFiles_1.length; _e++) { var _f = modifiedSourceFiles_1[_e], oldSourceFile = _f.oldFile, newSourceFile = _f.newFile; + var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.originalFileName, currentDirectory); var moduleNames = getModuleNames(newSourceFile); - var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile); + var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile); // ensure that module resolution results are still correct var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo); if (resolutionsChanged) { - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; newSourceFile.resolvedModules = ts.zipToMap(moduleNames, resolutions); } else { newSourceFile.resolvedModules = oldSourceFile.resolvedModules; } - // We lower-case all type references because npm automatically lowercases all packages. See GH#9824. - var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); }); - var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile); - // ensure that types resolutions are still correct - var typeReferenceEesolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo); - if (typeReferenceEesolutionsChanged) { - structureIsReused = 1 /* SafeModules */; - newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, typeReferenceResolutions); - } - else { - newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; + if (resolveTypeReferenceDirectiveNamesWorker) { + // We lower-case all type references because npm automatically lowercases all packages. See GH#9824. + var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); }); + var resolutions_1 = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFilePath, getResolvedProjectReferenceToRedirect(newSourceFile.originalFileName)); + // ensure that types resolutions are still correct + var resolutionsChanged_1 = ts.hasChangesInResolutions(typesReferenceDirectives, resolutions_1, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo); + if (resolutionsChanged_1) { + oldProgram.structureIsReused = 1 /* SafeModules */; + newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, resolutions_1); + } + else { + newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; + } } } - if (structureIsReused !== 2 /* Completely */) { - return structureIsReused; + if (oldProgram.structureIsReused !== 2 /* Completely */) { + return oldProgram.structureIsReused; } if ((_a = host.hasChangedAutomaticTypeDirectiveNames) === null || _a === void 0 ? void 0 : _a.call(host)) { - return 1 /* SafeModules */; + return oldProgram.structureIsReused = 1 /* SafeModules */; } missingFilePaths = oldProgram.getMissingFilePaths(); refFileMap = oldProgram.getRefFileMap(); @@ -105807,7 +103330,7 @@ var ts; resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); sourceFileToPackageName = oldProgram.sourceFileToPackageName; redirectTargetsMap = oldProgram.redirectTargetsMap; - return 2 /* Completely */; + return oldProgram.structureIsReused = 2 /* Completely */; } function getEmitHost(writeFileCallback) { return { @@ -105847,8 +103370,6 @@ var ts; } function emitBuildInfo(writeFileCallback) { ts.Debug.assert(!ts.outFile(options)); - var tracingData = ["emit" /* Emit */, "emitBuildInfo"]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeEmit"); var emitResult = ts.emitFiles(ts.notImplementedResolver, getEmitHost(writeFileCallback), /*targetSourceFile*/ undefined, @@ -105857,7 +103378,6 @@ var ts; /*onlyBuildInfo*/ true); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); - ts.tracing.end.apply(ts.tracing, tracingData); return emitResult; } function getResolvedProjectReferences() { @@ -105903,11 +103423,7 @@ var ts; return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, /*produceDiagnostics:*/ false)); } function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit) { - var tracingData = ["emit" /* Emit */, "emit", { path: sourceFile === null || sourceFile === void 0 ? void 0 : sourceFile.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); - var result = runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); }); - ts.tracing.end.apply(ts.tracing, tracingData); - return result; + return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); }); } function isEmitBlocked(emitFileName) { return hasEmitBlockingDiagnostics.has(toPath(emitFileName)); @@ -105957,11 +103473,6 @@ var ts; function getSemanticDiagnostics(sourceFile, cancellationToken) { return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken); } - function getCachedSemanticDiagnostics(sourceFile) { - var _a; - return sourceFile - ? (_a = cachedBindAndCheckDiagnosticsForFile.perFile) === null || _a === void 0 ? void 0 : _a.get(sourceFile.path) : cachedBindAndCheckDiagnosticsForFile.allDiagnostics; - } function getBindAndCheckDiagnostics(sourceFile, cancellationToken) { return getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken); } @@ -106047,17 +103558,17 @@ var ts; sourceFile.scriptKind === 5 /* External */ || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; - return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); + return getMergedBindAndCheckDiagnostics(sourceFile, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); }); } - function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics) { + function getMergedBindAndCheckDiagnostics(sourceFile) { var _a; var allDiagnostics = []; - for (var _i = 2; _i < arguments.length; _i++) { - allDiagnostics[_i - 2] = arguments[_i]; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; } var flatDiagnostics = ts.flatten(allDiagnostics); - if (!includeBindAndCheckDiagnostics || !((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { return flatDiagnostics; } var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives; @@ -106118,22 +103629,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 249 /* VariableDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 246 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -106141,58 +103652,58 @@ var ts; } } switch (node.kind) { - case 262 /* ImportClause */: + case 259 /* ImportClause */: if (node.isTypeOnly) { - diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); + diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 116 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(117 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 256 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(140 /* NamespaceKeyword */) : ts.tokenToString(139 /* ModuleKeyword */); + case 253 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(139 /* NamespaceKeyword */) : ts.tokenToString(138 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(91 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 224 /* AsExpression */: + case 221 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -106201,29 +103712,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 232 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 229 /* VariableStatement */); return "skip"; } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -106235,19 +103746,19 @@ var ts; return "skip"; } break; - case 160 /* Parameter */: + case 159 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 223 /* ExpressionWithTypeArguments */: - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: - case 205 /* TaggedTemplateExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 220 /* ExpressionWithTypeArguments */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 202 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -106269,7 +103780,7 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 133 /* DeclareKeyword */: case 125 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); @@ -106330,7 +103841,9 @@ var ts; } var diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName); forEachResolvedProjectReference(function (resolvedRef) { - diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + if (resolvedRef) { + diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + } }); return diagnostics; } @@ -106351,18 +103864,6 @@ var ts; ? b.kind === 78 /* Identifier */ && a.escapedText === b.escapedText : b.kind === 10 /* StringLiteral */ && a.text === b.text; } - function createSyntheticImport(text, file) { - var externalHelpersModuleReference = ts.factory.createStringLiteral(text); - var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference); - ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */); - ts.setParent(externalHelpersModuleReference, importDecl); - ts.setParent(importDecl, file); - // explicitly unset the synthesized flag on these declarations so the checker API will answer questions about them - // (which is required to build the dependency graph for incremental emit) - externalHelpersModuleReference.flags &= ~8 /* Synthesized */; - importDecl.flags &= ~8 /* Synthesized */; - return externalHelpersModuleReference; - } function collectExternalModuleReferences(file) { if (file.imports) { return; @@ -106375,17 +103876,16 @@ var ts; var ambientModules; // If we are importing helpers, we need to add a synthetic reference to resolve the // helpers library. - if ((options.isolatedModules || isExternalModuleFile) + if (options.importHelpers + && (options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { - if (options.importHelpers) { - // synthesize 'import "tslib"' declaration - imports = [createSyntheticImport(ts.externalHelpersModuleNameText, file)]; - } - var jsxImport = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(options, file), options); - if (jsxImport) { - // synthesize `import "base/jsx-runtime"` declaration - (imports || (imports = [])).push(createSyntheticImport(jsxImport, file)); - } + // synthesize 'import "tslib"' declaration + var externalHelpersModuleReference = ts.factory.createStringLiteral(ts.externalHelpersModuleNameText); + var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference); + ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */); + ts.setParent(externalHelpersModuleReference, importDecl); + ts.setParent(importDecl, file); + imports = [externalHelpersModuleReference]; } for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; @@ -106569,16 +104069,6 @@ var ts; } // Get source file from normalized fileName function findSourceFile(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) { - ts.tracing.push("program" /* Program */, "findSourceFile", { - fileName: fileName, - isDefaultLib: isDefaultLib || undefined, - refKind: refFile ? ts.RefFileKind[refFile.kind] : undefined, - }); - var result = findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId); - ts.tracing.pop(); - return result; - } - function findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) { if (useSourceOfProjectReferenceRedirect) { var source = getSourceOfProjectReferenceRedirect(fileName); // If preserveSymlinks is true, module resolution wont jump the symlink @@ -106766,11 +104256,12 @@ var ts; function getResolvedProjectReferenceToRedirect(fileName) { if (mapFromFileToProjectReferenceRedirects === undefined) { mapFromFileToProjectReferenceRedirects = new ts.Map(); - forEachResolvedProjectReference(function (referencedProject) { + forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { // not input file from the referenced project, ignore - if (toPath(options.configFilePath) !== referencedProject.sourceFile.path) { + if (referencedProject && + toPath(options.configFilePath) !== referenceProjectPath) { referencedProject.commandLine.fileNames.forEach(function (f) { - return mapFromFileToProjectReferenceRedirects.set(toPath(f), referencedProject.sourceFile.path); + return mapFromFileToProjectReferenceRedirects.set(toPath(f), referenceProjectPath); }); } }); @@ -106779,7 +104270,11 @@ var ts; return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); } function forEachResolvedProjectReference(cb) { - return ts.forEachResolvedProjectReference(resolvedProjectReferences, cb); + return forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { + var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; + var resolvedRefPath = toPath(resolveProjectReferencePath(ref)); + return cb(resolvedRef, resolvedRefPath); + }); } function getSourceOfProjectReferenceRedirect(file) { if (!ts.isDeclarationFileName(file)) @@ -106787,19 +104282,21 @@ var ts; if (mapFromToProjectReferenceRedirectSource === undefined) { mapFromToProjectReferenceRedirectSource = new ts.Map(); forEachResolvedProjectReference(function (resolvedRef) { - var out = ts.outFile(resolvedRef.commandLine.options); - if (out) { - // Dont know which source file it means so return true? - var outputDts = ts.changeExtension(out, ".d.ts" /* Dts */); - mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), true); - } - else { - ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) { - if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { - var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames()); - mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName); - } - }); + if (resolvedRef) { + var out = ts.outFile(resolvedRef.commandLine.options); + if (out) { + // Dont know which source file it means so return true? + var outputDts = ts.changeExtension(out, ".d.ts" /* Dts */); + mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), true); + } + else { + ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) { + if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { + var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames()); + mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName); + } + }); + } } }); } @@ -106808,6 +104305,33 @@ var ts; function isSourceOfProjectReferenceRedirect(fileName) { return useSourceOfProjectReferenceRedirect && !!getResolvedProjectReferenceToRedirect(fileName); } + function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { + var seenResolvedRefs; + return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined, cbResolvedRef, cbRef); + function worker(projectReferences, resolvedProjectReferences, parent, cbResolvedRef, cbRef) { + // Visit project references first + if (cbRef) { + var result = cbRef(projectReferences, parent); + if (result) { + return result; + } + } + return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) { + if (ts.contains(seenResolvedRefs, resolvedRef)) { + // ignore recursives + return undefined; + } + var result = cbResolvedRef(resolvedRef, index, parent); + if (result) { + return result; + } + if (!resolvedRef) + return undefined; + (seenResolvedRefs || (seenResolvedRefs = [])).push(resolvedRef); + return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef, cbResolvedRef, cbRef); + }); + } + } function getResolvedProjectReferenceByPath(projectReferencePath) { if (!projectReferenceRedirects) { return undefined; @@ -106834,7 +104358,7 @@ var ts; if (!typeDirectives) { return; } - var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file); + var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file.originalFileName, getResolvedProjectReferenceToRedirect(file.originalFileName)); for (var i = 0; i < typeDirectives.length; i++) { var ref = file.typeReferenceDirectives[i]; var resolvedTypeReferenceDirective = resolutions[i]; @@ -106851,11 +104375,6 @@ var ts; } } function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, refFile) { - ts.tracing.push("program" /* Program */, "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolveModuleNamesReusingOldState, refKind: refFile === null || refFile === void 0 ? void 0 : refFile.kind, refPath: refFile === null || refFile === void 0 ? void 0 : refFile.file.path }); - processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, refFile); - ts.tracing.pop(); - } - function processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, refFile) { // If we already found this library as a primary reference - nothing to do var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective); if (previousResolution && previousResolution.primary) { @@ -106940,7 +104459,7 @@ var ts; if (file.imports.length || file.moduleAugmentations.length) { // Because global augmentation doesn't have string literal name, we can check for global augmentation as such. var moduleNames = getModuleNames(file); - var resolutions = resolveModuleNamesReusingOldState(moduleNames, file); + var resolutions = resolveModuleNamesReusingOldState(moduleNames, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory), file); ts.Debug.assert(resolutions.length === moduleNames.length); for (var i = 0; i < moduleNames.length; i++) { var resolution = resolutions[i]; @@ -106968,7 +104487,7 @@ var ts; && !options.noResolve && i < file.imports.length && !elideImport - && !(isJsFile && !ts.getAllowJSCompilerOption(options)) + && !(isJsFile && !options.allowJs) && (ts.isInJSFile(file.imports[i]) || !(file.imports[i].flags & 4194304 /* JSDoc */)); if (elideImport) { modulesWithElidedImports.set(file.path, true); @@ -107084,6 +104603,9 @@ var ts; createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap"); } } + if (options.paths && options.baseUrl === undefined) { + createDiagnosticForOptionName(ts.Diagnostics.Option_paths_cannot_be_used_without_specifying_baseUrl_option, "paths"); + } if (options.composite) { if (options.declaration === false) { createDiagnosticForOptionName(ts.Diagnostics.Composite_projects_may_not_disable_declaration_emit, "declaration"); @@ -107133,9 +104655,6 @@ var ts; if (!ts.hasZeroOrOneAsteriskCharacter(subst)) { createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character, subst, key); } - if (!options.baseUrl && !ts.pathIsRelative(subst) && !ts.pathIsAbsolute(subst)) { - createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash); - } } else { createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2, subst, key, typeOfSubst); @@ -107188,7 +104707,7 @@ var ts; var firstNonExternalModuleSourceFile = ts.find(files, function (f) { return !ts.isExternalModule(f) && !ts.isSourceFileJS(f) && !f.isDeclarationFile && f.scriptKind !== 6 /* JSON */; }); if (firstNonExternalModuleSourceFile) { var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); - programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts.getBaseFileName(firstNonExternalModuleSourceFile.fileName))); + programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.All_files_must_be_modules_when_the_isolatedModules_flag_is_provided)); } } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ES2015 */ && options.module === ts.ModuleKind.None) { @@ -107230,7 +104749,7 @@ var ts; if (options.useDefineForClassFields && languageVersion === 0 /* ES3 */) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, "useDefineForClassFields"); } - if (options.checkJs && !ts.getAllowJSCompilerOption(options)) { + if (options.checkJs && !options.allowJs) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); } if (options.emitDeclarationOnly) { @@ -107249,9 +104768,6 @@ var ts; if (options.reactNamespace) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "reactNamespace", "jsxFactory"); } - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFactory", ts.inverseJsxOptionMap.get("" + options.jsx)); - } if (!ts.parseIsolatedEntityName(options.jsxFactory, languageVersion)) { createOptionValueDiagnostic("jsxFactory", ts.Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFactory); } @@ -107263,23 +104779,10 @@ var ts; if (!options.jsxFactory) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "jsxFragmentFactory", "jsxFactory"); } - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFragmentFactory", ts.inverseJsxOptionMap.get("" + options.jsx)); - } if (!ts.parseIsolatedEntityName(options.jsxFragmentFactory, languageVersion)) { createOptionValueDiagnostic("jsxFragmentFactory", ts.Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFragmentFactory); } } - if (options.reactNamespace) { - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "reactNamespace", ts.inverseJsxOptionMap.get("" + options.jsx)); - } - } - if (options.jsxImportSource) { - if (options.jsx === 2 /* React */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxImportSource", ts.inverseJsxOptionMap.get("" + options.jsx)); - } - } // If the emit is enabled make sure that every output file is unique and not overwriting any of the input files if (!options.noEmit && !options.suppressOutputPathCheck) { var emitHost = getEmitHost(); @@ -107354,7 +104857,7 @@ var ts; } function verifyProjectReferences() { var buildInfoPath = !options.suppressOutputPathCheck ? ts.getTsBuildInfoEmitOutputFilePath(options) : undefined; - forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, parent, index) { + forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; var parentFile = parent && parent.sourceFile; if (!resolvedRef) { @@ -107549,6 +105052,8 @@ var ts; if (!setOfDeclarationDirectories) { setOfDeclarationDirectories = new ts.Set(); host.forEachResolvedProjectReference(function (ref) { + if (!ref) + return; var out = ts.outFile(ref.commandLine.options); if (out) { setOfDeclarationDirectories.add(ts.getDirectoryPath(host.toPath(out))); @@ -107781,7 +105286,7 @@ var ts; return options.jsx ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set; } function needAllowJs() { - return ts.getAllowJSCompilerOption(options) || !ts.getStrictOptionValue(options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; + return options.allowJs || !ts.getStrictOptionValue(options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; } function needResolveJsonModule() { return options.resolveJsonModule ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used; @@ -107935,7 +105440,7 @@ var ts; // Create the reference map, and set the file infos for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; - var version_2 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); + var version_1 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined; if (referencedMap) { var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName); @@ -107950,7 +105455,7 @@ var ts; } } } - fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) }); + fileInfos.set(sourceFile.resolvedPath, { version: version_1, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) }); } return { fileInfos: fileInfos, @@ -108052,7 +105557,7 @@ var ts; emitOutput_1.outputFiles.length > 0 ? emitOutput_1.outputFiles[0] : undefined; if (firstDts_1) { ts.Debug.assert(ts.fileExtensionIs(firstDts_1.name, ".d.ts" /* Dts */), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); }); - latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text); + latestSignature = computeHash(firstDts_1.text); if (exportedModulesMapCache && latestSignature !== prevSignature) { updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache); } @@ -108245,12 +105750,14 @@ var ts; if (!seenFileNamesMap.has(currentPath)) { var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); seenFileNamesMap.set(currentPath, currentSourceFile); - if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) { - queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath)); + if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) { // TODO: GH#18217 + queue.push.apply(// TODO: GH#18217 + queue, getReferencedByPaths(state, currentSourceFile.resolvedPath)); } } } // Return array of values that needs emit + // Return array of values that needs emit return ts.arrayFrom(ts.mapDefinedIterator(seenFileNamesMap.values(), function (value) { return value; })); } })(BuilderState = ts.BuilderState || (ts.BuilderState = {})); @@ -108371,7 +105878,7 @@ var ts; result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function (r) { return convertToDiagnosticRelatedInformation(r, newProgram, toPath); }) : - [] : + ts.emptyArray : undefined; return result; }); @@ -108563,10 +106070,10 @@ var ts; state.semanticDiagnosticsPerFile.delete(path); return !state.semanticDiagnosticsFromOldState.size; } - function isChangedSignature(state, path) { + function isChangedSignagure(state, path) { var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path); - var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature; - return newSignature !== oldSignature; + var oldSignagure = ts.Debug.checkDefined(state.fileInfos.get(path)).signature; + return newSignature !== oldSignagure; } /** * Iterate on referencing modules that export entities from affected file @@ -108577,7 +106084,7 @@ var ts; if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) { return; } - if (!isChangedSignature(state, affectedFile.resolvedPath)) + if (!isChangedSignagure(state, affectedFile.resolvedPath)) return; // Since isolated modules dont change js files, files affected by change in signature is itself // But we need to cleanup semantic diagnostics and queue dts emit for affected files @@ -108590,7 +106097,7 @@ var ts; if (!seenFileNamesMap.has(currentPath)) { seenFileNamesMap.set(currentPath, true); var result = fn(state, currentPath); - if (result && isChangedSignature(state, currentPath)) { + if (result && isChangedSignagure(state, currentPath)) { var currentSourceFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(currentPath); queue.push.apply(queue, ts.BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath)); } @@ -108840,7 +106347,7 @@ var ts; result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function (r) { return convertToReusableDiagnosticRelatedInformation(r, relativeToBuildInfo); }) : - [] : + ts.emptyArray : undefined; return result; }); @@ -108902,7 +106409,7 @@ var ts; /** * Computing hash to for signature verification */ - var computeHash = ts.maybeBind(host, host.createHash); + var computeHash = host.createHash || ts.generateDjb2Hash; var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState); var backupState; newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); }; @@ -108998,54 +106505,31 @@ var ts; * in that order would be used to write the files */ function emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { - var restorePendingEmitOnHandlingNoEmitSuccess = false; - var savedAffectedFilesPendingEmit; - var savedAffectedFilesPendingEmitKind; - var savedAffectedFilesPendingEmitIndex; - // Backup and restore affected pendings emit state for non emit Builder if noEmitOnError is enabled and emitBuildInfo could be written in case there are errors - // This ensures pending files to emit is updated in tsbuildinfo - // Note that when there are no errors, emit proceeds as if everything is emitted as it is callers reponsibility to write the files to disk if at all (because its builder that doesnt track files to emit) - if (kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram && - !targetSourceFile && - !ts.outFile(state.compilerOptions) && - !state.compilerOptions.noEmit && - state.compilerOptions.noEmitOnError) { - restorePendingEmitOnHandlingNoEmitSuccess = true; - savedAffectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice(); - savedAffectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind); - savedAffectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex; - } if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile); - } - var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken); - if (result) - return result; - if (restorePendingEmitOnHandlingNoEmitSuccess) { - state.affectedFilesPendingEmit = savedAffectedFilesPendingEmit; - state.affectedFilesPendingEmitKind = savedAffectedFilesPendingEmitKind; - state.affectedFilesPendingEmitIndex = savedAffectedFilesPendingEmitIndex; - } - // Emit only affected files if using builder for emit - if (!targetSourceFile && kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { - // Emit and report any errors we ran into. - var sourceMaps = []; - var emitSkipped = false; - var diagnostics = void 0; - var emittedFiles = []; - var affectedEmitResult = void 0; - while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { - emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; - diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); - emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); - sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken); + if (result) + return result; + if (!targetSourceFile) { + // Emit and report any errors we ran into. + var sourceMaps = []; + var emitSkipped = false; + var diagnostics = void 0; + var emittedFiles = []; + var affectedEmitResult = void 0; + while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { + emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; + diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); + emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); + sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + } + return { + emitSkipped: emitSkipped, + diagnostics: diagnostics || ts.emptyArray, + emittedFiles: emittedFiles, + sourceMaps: sourceMaps + }; } - return { - emitSkipped: emitSkipped, - diagnostics: diagnostics || ts.emptyArray, - emittedFiles: emittedFiles, - sourceMaps: sourceMaps - }; } return ts.Debug.checkDefined(state.program).emit(targetSourceFile, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers); } @@ -109065,8 +106549,7 @@ var ts; return toAffectedFileResult(state, state.program.getSemanticDiagnostics(/*targetSourceFile*/ undefined, cancellationToken), affected); } // Add file to affected file pending emit to handle for later emit time - // Apart for emit builder do this for tsbuildinfo, do this for non emit builder when noEmit is set as tsbuildinfo is written and reused between emitters - if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram || state.compilerOptions.noEmit || state.compilerOptions.noEmitOnError) { + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { addToAffectedFilesPendingEmit(state, affected.resolvedPath, 1 /* Full */); } // Get diagnostics for the affected file if its not ignored @@ -109780,8 +107263,8 @@ var ts; if (!resolutions) return false; var invalidated = false; - for (var _i = 0, resolutions_1 = resolutions; _i < resolutions_1.length; _i++) { - var resolution = resolutions_1[_i]; + for (var _i = 0, resolutions_2 = resolutions; _i < resolutions_2.length; _i++) { + var resolution = resolutions_2[_i]; if (resolution.isInvalidated || !canInvalidate(resolution)) continue; resolution.isInvalidated = invalidated = true; @@ -109993,14 +107476,14 @@ var ts; function getNodeModulesPackageName(compilerOptions, importingSourceFileName, nodeModulesFileName, host) { var info = getInfo(importingSourceFileName, host); var modulePaths = getAllModulePaths(importingSourceFileName, nodeModulesFileName, host); - return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions, /*packageNameOnly*/ true); }); + return ts.firstDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions, /*packageNameOnly*/ true); }); } moduleSpecifiers.getNodeModulesPackageName = getNodeModulesPackageName; function getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, preferences) { var info = getInfo(importingSourceFileName, host); var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host); - return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); }) || - getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences); + return ts.firstDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions); }) || + getLocalModuleSpecifier(toFileName, info, compilerOptions, preferences); } /** Returns an import for each symlink and for the realpath. */ function getModuleSpecifiers(moduleSymbol, compilerOptions, importingSourceFile, host, userPreferences) { @@ -110011,46 +107494,8 @@ var ts; var moduleSourceFile = ts.getSourceFileOfNode(moduleSymbol.valueDeclaration || ts.getNonAugmentationDeclaration(moduleSymbol)); var modulePaths = getAllModulePaths(importingSourceFile.path, moduleSourceFile.originalFileName, host); var preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile); - var importedFileIsInNodeModules = ts.some(modulePaths, function (p) { return p.isInNodeModules; }); - // Module specifier priority: - // 1. "Bare package specifiers" (e.g. "@foo/bar") resulting from a path through node_modules to a package.json's "types" entry - // 2. Specifiers generated using "paths" from tsconfig - // 3. Non-relative specfiers resulting from a path through node_modules (e.g. "@foo/bar/path/to/file") - // 4. Relative paths - var nodeModulesSpecifiers; - var pathsSpecifiers; - var relativeSpecifiers; - for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) { - var modulePath = modulePaths_1[_i]; - var specifier = tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); - nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier); - if (specifier && modulePath.isRedirect) { - // If we got a specifier for a redirect, it was a bare package specifier (e.g. "@foo/bar", - // not "@foo/bar/path/to/file"). No other specifier will be this good, so stop looking. - return nodeModulesSpecifiers; - } - if (!specifier && !modulePath.isRedirect) { - var local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, preferences); - if (ts.pathIsBareSpecifier(local)) { - pathsSpecifiers = ts.append(pathsSpecifiers, local); - } - else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) { - // Why this extra conditional, not just an `else`? If some path to the file contained - // 'node_modules', but we can't create a non-relative specifier (e.g. "@foo/bar/path/to/file"), - // that means we had to go through a *sibling's* node_modules, not one we can access directly. - // If some path to the file was in node_modules but another was not, this likely indicates that - // we have a monorepo structure with symlinks. In this case, the non-node_modules path is - // probably the realpath, e.g. "../bar/path/to/file", but a relative path to another package - // in a monorepo is probably not portable. So, the module specifier we actually go with will be - // the relative path through node_modules, so that the declaration emitter can produce a - // portability error. (See declarationEmitReexportedSymlinkReference3) - relativeSpecifiers = ts.append(relativeSpecifiers, local); - } - } - } - return (pathsSpecifiers === null || pathsSpecifiers === void 0 ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : - (nodeModulesSpecifiers === null || nodeModulesSpecifiers === void 0 ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : - ts.Debug.checkDefined(relativeSpecifiers); + var global = ts.mapDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions); }); + return global.length ? global : modulePaths.map(function (moduleFileName) { return getLocalModuleSpecifier(moduleFileName, info, compilerOptions, preferences); }); } moduleSpecifiers.getModuleSpecifiers = getModuleSpecifiers; // importingSourceFileName is separate because getEditsForFileRename may need to specify an updated path @@ -110059,26 +107504,22 @@ var ts; var sourceDirectory = ts.getDirectoryPath(importingSourceFileName); return { getCanonicalFileName: getCanonicalFileName, sourceDirectory: sourceDirectory }; } - function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, host, _b) { + function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, _b) { var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory; var ending = _b.ending, relativePreference = _b.relativePreference; var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs; var relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) || removeExtensionAndIndexPostFix(ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions); - if (!baseUrl && !paths || relativePreference === 0 /* Relative */) { + if (!baseUrl || relativePreference === 0 /* Relative */) { return relativePath; } - var baseDirectory = ts.getPathsBasePath(compilerOptions, host) || baseUrl; - var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseDirectory, getCanonicalFileName); + var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); if (!relativeToBaseUrl) { return relativePath; } var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions); var fromPaths = paths && tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); - var nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths; - if (!nonRelative) { - return relativePath; - } + var nonRelative = fromPaths === undefined ? importRelativeToBaseUrl : fromPaths; if (relativePreference === 1 /* NonRelative */) { return nonRelative; } @@ -110107,8 +107548,8 @@ var ts; var match = str.match(/\//g); return match ? match.length : 0; } - function comparePathsByRedirectAndNumberOfDirectorySeparators(a, b) { - return ts.compareBooleans(b.isRedirect, a.isRedirect) || ts.compareValues(numberOfDirectorySeparators(a.path), numberOfDirectorySeparators(b.path)); + function comparePathsByNumberOfDirectorySeparators(a, b) { + return ts.compareValues(numberOfDirectorySeparators(a), numberOfDirectorySeparators(b)); } function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) { var getCanonicalFileName = ts.hostGetCanonicalFileName(host); @@ -110118,36 +107559,34 @@ var ts; var importedFileNames = __spreadArrays((referenceRedirect ? [referenceRedirect] : ts.emptyArray), [importedFileName], redirects); var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); }); if (!preferSymlinks) { - var result_15 = ts.forEach(targets, function (p) { return cb(p, referenceRedirect === p); }); - if (result_15) - return result_15; + var result_13 = ts.forEach(targets, cb); + if (result_13) + return result_13; } var links = host.getSymlinkCache ? host.getSymlinkCache() : ts.discoverProbableSymlinks(host.getSourceFiles(), getCanonicalFileName, cwd); var symlinkedDirectories = links.getSymlinkedDirectories(); - var useCaseSensitiveFileNames = !host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames(); + var compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive; var result = symlinkedDirectories && ts.forEachEntry(symlinkedDirectories, function (resolved, path) { if (resolved === false) return undefined; if (ts.startsWithDirectory(importingFileName, resolved.realPath, getCanonicalFileName)) { return undefined; // Don't want to a package to globally import from itself } - return ts.forEach(targets, function (target) { - if (!ts.containsPath(resolved.real, target, !useCaseSensitiveFileNames)) { - return; - } - var relative = ts.getRelativePathFromDirectory(resolved.real, target, getCanonicalFileName); - var option = ts.resolvePath(path, relative); - if (!host.fileExists || host.fileExists(option)) { - var result_16 = cb(option, target === referenceRedirect); - if (result_16) - return result_16; - } - }); + var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.real.length), resolved.real) === 0 /* EqualTo */; }); + if (target === undefined) + return undefined; + var relative = ts.getRelativePathFromDirectory(resolved.real, target, getCanonicalFileName); + var option = ts.resolvePath(path, relative); + if (!host.fileExists || host.fileExists(option)) { + var result_14 = cb(option); + if (result_14) + return result_14; + } }); return result || - (preferSymlinks ? ts.forEach(targets, function (p) { return cb(p, p === referenceRedirect); }) : undefined); + (preferSymlinks ? ts.forEach(targets, cb) : undefined); } moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule; /** @@ -110160,27 +107599,28 @@ var ts; var allFileNames = new ts.Map(); var importedFileFromNodeModules = false; forEachFileNameOfModule(importingFileName, importedFileName, host, - /*preferSymlinks*/ true, function (path, isRedirect) { - var isInNodeModules = ts.pathContainsNodeModules(path); - allFileNames.set(path, { path: getCanonicalFileName(path), isRedirect: isRedirect, isInNodeModules: isInNodeModules }); - importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules; - // don't return value, so we collect everything + /*preferSymlinks*/ true, function (path) { + // dont return value, so we collect everything + allFileNames.set(path, getCanonicalFileName(path)); + importedFileFromNodeModules = importedFileFromNodeModules || ts.pathContainsNodeModules(path); }); // Sort by paths closest to importing file Name directory var sortedPaths = []; - var _loop_24 = function (directory) { + var _loop_23 = function (directory) { var directoryStart = ts.ensureTrailingDirectorySeparator(directory); var pathsInDirectory; - allFileNames.forEach(function (_a, fileName) { - var path = _a.path, isRedirect = _a.isRedirect, isInNodeModules = _a.isInNodeModules; - if (ts.startsWith(path, directoryStart)) { - (pathsInDirectory || (pathsInDirectory = [])).push({ path: fileName, isRedirect: isRedirect, isInNodeModules: isInNodeModules }); + allFileNames.forEach(function (canonicalFileName, fileName) { + if (ts.startsWith(canonicalFileName, directoryStart)) { + // If the importedFile is from node modules, use only paths in node_modules folder as option + if (!importedFileFromNodeModules || ts.pathContainsNodeModules(fileName)) { + (pathsInDirectory || (pathsInDirectory = [])).push(fileName); + } allFileNames.delete(fileName); } }); if (pathsInDirectory) { if (pathsInDirectory.length > 1) { - pathsInDirectory.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + pathsInDirectory.sort(comparePathsByNumberOfDirectorySeparators); } sortedPaths.push.apply(sortedPaths, pathsInDirectory); } @@ -110192,7 +107632,7 @@ var ts; }; var out_directory_1; for (var directory = ts.getDirectoryPath(ts.toPath(importingFileName, cwd, getCanonicalFileName)); allFileNames.size !== 0;) { - var state_8 = _loop_24(directory); + var state_8 = _loop_23(directory); directory = out_directory_1; if (state_8 === "break") break; @@ -110200,7 +107640,7 @@ var ts; if (allFileNames.size) { var remainingPaths = ts.arrayFrom(allFileNames.values()); if (remainingPaths.length > 1) - remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + remainingPaths.sort(comparePathsByNumberOfDirectorySeparators); sortedPaths.push.apply(sortedPaths, remainingPaths); } return sortedPaths; @@ -110245,43 +107685,37 @@ var ts; ? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions) : ts.removeFileExtension(relativePath); } - function tryGetModuleNameAsNodeModule(_a, _b, host, options, packageNameOnly) { - var path = _a.path, isRedirect = _a.isRedirect; - var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory; + function tryGetModuleNameAsNodeModule(moduleFileName, _a, host, options, packageNameOnly) { + var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory; if (!host.fileExists || !host.readFile) { return undefined; } - var parts = getNodeModulePathParts(path); + var parts = getNodeModulePathParts(moduleFileName); if (!parts) { return undefined; } // Simplify the full file path to something that can be resolved by Node. - var moduleSpecifier = path; - var isPackageRootPath = false; + var moduleSpecifier = moduleFileName; if (!packageNameOnly) { var packageRootIndex = parts.packageRootIndex; var moduleFileNameForExtensionless = void 0; while (true) { // If the module could be imported by a directory name, use that directory's name - var _c = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _c.moduleFileToTry, packageRootPath = _c.packageRootPath; + var _b = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _b.moduleFileToTry, packageRootPath = _b.packageRootPath; if (packageRootPath) { moduleSpecifier = packageRootPath; - isPackageRootPath = true; break; } if (!moduleFileNameForExtensionless) moduleFileNameForExtensionless = moduleFileToTry; // try with next level of directory - packageRootIndex = path.indexOf(ts.directorySeparator, packageRootIndex + 1); + packageRootIndex = moduleFileName.indexOf(ts.directorySeparator, packageRootIndex + 1); if (packageRootIndex === -1) { moduleSpecifier = getExtensionlessFileName(moduleFileNameForExtensionless); break; } } } - if (isRedirect && !isPackageRootPath) { - return undefined; - } var globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); // Get a path that's relative to node_modules or the importing file's path // if node_modules folder is in this folder or any of its parent folders, no need to keep it. @@ -110295,16 +107729,16 @@ var ts; // For classic resolution, only allow importing from node_modules/@types, not other node_modules return ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs && packageName === nodeModulesDirectoryName ? undefined : packageName; function tryDirectoryWithPackageJson(packageRootIndex) { - var packageRootPath = path.substring(0, packageRootIndex); + var packageRootPath = moduleFileName.substring(0, packageRootIndex); var packageJsonPath = ts.combinePaths(packageRootPath, "package.json"); - var moduleFileToTry = path; + var moduleFileToTry = moduleFileName; if (host.fileExists(packageJsonPath)) { var packageJsonContent = JSON.parse(host.readFile(packageJsonPath)); var versionPaths = packageJsonContent.typesVersions ? ts.getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions) : undefined; if (versionPaths) { - var subModuleName = path.slice(packageRootPath.length + 1); + var subModuleName = moduleFileName.slice(packageRootPath.length + 1); var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(subModuleName), removeExtensionAndIndexPostFix(subModuleName, 0 /* Minimal */, options), versionPaths.paths); if (fromPaths !== undefined) { moduleFileToTry = ts.combinePaths(packageRootPath, fromPaths); @@ -110708,7 +108142,7 @@ var ts; ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost; function setGetSourceFileAsHashVersioned(compilerHost, host) { var originalGetSourceFile = compilerHost.getSourceFile; - var computeHash = ts.maybeBind(host, host.createHash) || ts.generateDjb2Hash; + var computeHash = host.createHash || ts.generateDjb2Hash; compilerHost.getSourceFile = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -110716,7 +108150,7 @@ var ts; } var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args)); if (result) { - result.version = computeHash(result.text); + result.version = computeHash.call(host, result.text); } return result; }; @@ -111235,7 +108669,7 @@ var ts; } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); - var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions); + var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost); if (ts.updateErrorForNoInputFiles(result, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) { hasChangedConfigFileParsingErrors = true; } @@ -111321,7 +108755,6 @@ var ts; fileOrDirectoryPath: fileOrDirectoryPath, configFileName: configFileName, configFileSpecs: configFileSpecs, - extraFileExtensions: extraFileExtensions, options: compilerOptions, program: getCurrentBuilderProgram(), currentDirectory: currentDirectory, @@ -112908,11 +110341,6 @@ var ts; })(LanguageServiceMode = ts.LanguageServiceMode || (ts.LanguageServiceMode = {})); /* @internal */ ts.emptyOptions = {}; - var SemanticClassificationFormat; - (function (SemanticClassificationFormat) { - SemanticClassificationFormat["Original"] = "original"; - SemanticClassificationFormat["TwentyTwenty"] = "2020"; - })(SemanticClassificationFormat = ts.SemanticClassificationFormat || (ts.SemanticClassificationFormat = {})); var HighlightSpanKind; (function (HighlightSpanKind) { HighlightSpanKind["none"] = "none"; @@ -113186,37 +110614,37 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 287 /* CatchClause */: - case 280 /* JsxAttribute */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 284 /* CatchClause */: + case 277 /* JsxAttribute */: return 1 /* Value */; - case 159 /* TypeParameter */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 177 /* TypeLiteral */: + case 158 /* TypeParameter */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 176 /* TypeLiteral */: return 2 /* Type */; - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 291 /* EnumMember */: - case 252 /* ClassDeclaration */: + case 288 /* EnumMember */: + case 249 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -113226,16 +110654,16 @@ var ts; else { return 4 /* Namespace */; } - case 255 /* EnumDeclaration */: - case 264 /* NamedImports */: - case 265 /* ImportSpecifier */: - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 252 /* EnumDeclaration */: + case 261 /* NamedImports */: + case 262 /* ImportSpecifier */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -113243,13 +110671,13 @@ var ts; ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 266 /* ExportAssignment */ - || node.parent.kind === 272 /* ExternalModuleReference */ - || node.parent.kind === 265 /* ImportSpecifier */ - || node.parent.kind === 262 /* ImportClause */ + else if (node.parent.kind === 263 /* ExportAssignment */ + || node.parent.kind === 269 /* ExternalModuleReference */ + || node.parent.kind === 262 /* ImportSpecifier */ + || node.parent.kind === 259 /* ImportClause */ || ts.isImportEqualsDeclaration(node.parent) && node === node.parent.name) { return 7 /* All */; } @@ -113259,9 +110687,6 @@ var ts; else if (ts.isDeclarationName(node)) { return getMeaningFromDeclaration(node.parent); } - else if (ts.isEntityName(node) && ts.isJSDocNameReference(node.parent)) { - return 7 /* All */; - } else if (isTypeReference(node)) { return 2 /* Type */; } @@ -113285,11 +110710,11 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - var name = node.kind === 157 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; - return name && name.parent.kind === 260 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + var name = node.kind === 156 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 257 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 157 /* QualifiedName */) { + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -113301,27 +110726,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 157 /* QualifiedName */) { - while (root.parent && root.parent.kind === 157 /* QualifiedName */) { + if (root.parent.kind === 156 /* QualifiedName */) { + while (root.parent && root.parent.kind === 156 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 173 /* TypeReference */ && !isLastClause; + return root.parent.kind === 172 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 201 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 201 /* PropertyAccessExpression */) { + if (root.parent.kind === 198 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 198 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 223 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 286 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 220 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 283 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 252 /* ClassDeclaration */ && root.parent.parent.token === 116 /* ImplementsKeyword */) || - (decl.kind === 253 /* InterfaceDeclaration */ && root.parent.parent.token === 93 /* ExtendsKeyword */); + return (decl.kind === 249 /* ClassDeclaration */ && root.parent.parent.token === 116 /* ImplementsKeyword */) || + (decl.kind === 250 /* InterfaceDeclaration */ && root.parent.parent.token === 93 /* ExtendsKeyword */); } return false; } @@ -113332,15 +110757,15 @@ var ts; switch (node.kind) { case 107 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 187 /* ThisType */: + case 186 /* ThisType */: return true; } switch (node.parent.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return true; - case 195 /* ImportType */: + case 192 /* ImportType */: return !node.parent.isTypeOf; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; @@ -113407,7 +110832,7 @@ var ts; ts.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 245 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 242 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -113468,22 +110893,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 288 /* PropertyAssignment */: - case 291 /* EnumMember */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 256 /* ModuleDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 285 /* PropertyAssignment */: + case 288 /* EnumMember */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 253 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return true; - case 191 /* LiteralType */: - return node.parent.parent.kind === 189 /* IndexedAccessType */; + case 190 /* LiteralType */: + return node.parent.parent.kind === 188 /* IndexedAccessType */; default: return false; } @@ -113507,17 +110932,17 @@ var ts; return undefined; } switch (node.kind) { - case 297 /* SourceFile */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 256 /* ModuleDeclaration */: + case 294 /* SourceFile */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: return node; } } @@ -113525,54 +110950,54 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return "class" /* classElement */; - case 253 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 254 /* TypeAliasDeclaration */: - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: + case 250 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 251 /* TypeAliasDeclaration */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 255 /* EnumDeclaration */: return "enum" /* enumElement */; - case 249 /* VariableDeclaration */: + case 252 /* EnumDeclaration */: return "enum" /* enumElement */; + case 246 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 209 /* ArrowFunction */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return "function" /* functionElement */; - case 167 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 168 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 166 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 167 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: var initializer = node.initializer; return ts.isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 289 /* ShorthandPropertyAssignment */: - case 290 /* SpreadAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 286 /* ShorthandPropertyAssignment */: + case 287 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 171 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 170 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 169 /* CallSignature */: return "call" /* callSignatureElement */; - case 166 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 159 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 291 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 160 /* Parameter */: return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 260 /* ImportEqualsDeclaration */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: - case 263 /* NamespaceImport */: - case 269 /* NamespaceExport */: + case 170 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 169 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 168 /* CallSignature */: return "call" /* callSignatureElement */; + case 165 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 158 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 288 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 159 /* Parameter */: return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 257 /* ImportEqualsDeclaration */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: + case 260 /* NamespaceImport */: + case 266 /* NamespaceExport */: return "alias" /* alias */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var kind = ts.getAssignmentDeclarationKind(node); var right = node.right; switch (kind) { @@ -113601,7 +111026,7 @@ var ts; } case 78 /* Identifier */: return ts.isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: var scriptKind = getNodeKind(node.expression); // If the expression didn't come back with something (like it does for an identifiers) return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; @@ -113624,7 +111049,7 @@ var ts; return true; case 78 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 160 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 159 /* Parameter */; default: return false; } @@ -113689,42 +111114,42 @@ var ts; return false; } switch (n.kind) { - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 200 /* ObjectLiteralExpression */: - case 196 /* ObjectBindingPattern */: - case 177 /* TypeLiteral */: - case 230 /* Block */: - case 257 /* ModuleBlock */: - case 258 /* CaseBlock */: - case 264 /* NamedImports */: - case 268 /* NamedExports */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 197 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 176 /* TypeLiteral */: + case 227 /* Block */: + case 254 /* ModuleBlock */: + case 255 /* CaseBlock */: + case 261 /* NamedImports */: + case 265 /* NamedExports */: return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 204 /* NewExpression */: + case 201 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 203 /* CallExpression */: - case 207 /* ParenthesizedExpression */: - case 186 /* ParenthesizedType */: + case 200 /* CallExpression */: + case 204 /* ParenthesizedExpression */: + case 185 /* ParenthesizedType */: return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 170 /* ConstructSignature */: - case 169 /* CallSignature */: - case 209 /* ArrowFunction */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 169 /* ConstructSignature */: + case 168 /* CallSignature */: + case 206 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -113734,65 +111159,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 234 /* IfStatement */: + case 231 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile); - case 199 /* ArrayLiteralExpression */: - case 197 /* ArrayBindingPattern */: - case 202 /* ElementAccessExpression */: - case 158 /* ComputedPropertyName */: - case 179 /* TupleType */: + case 196 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 199 /* ElementAccessExpression */: + case 157 /* ComputedPropertyName */: + case 178 /* TupleType */: return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 236 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 233 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 235 /* DoStatement */: + case 232 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 114 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 211 /* TypeOfExpression */: - case 210 /* DeleteExpression */: - case 212 /* VoidExpression */: - case 219 /* YieldExpression */: - case 220 /* SpreadElement */: + case 208 /* TypeOfExpression */: + case 207 /* DeleteExpression */: + case 209 /* VoidExpression */: + case 216 /* YieldExpression */: + case 217 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 267 /* ExportDeclaration */: - case 261 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -113899,11 +111324,11 @@ var ts; function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return getAdjustedLocationForFunction(node); } } @@ -113998,11 +111423,11 @@ var ts; node.kind === 97 /* FunctionKeyword */ ? ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(node) : node.kind === 117 /* InterfaceKeyword */ ? ts.isInterfaceDeclaration(parent) : node.kind === 91 /* EnumKeyword */ ? ts.isEnumDeclaration(parent) : - node.kind === 149 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : - node.kind === 140 /* NamespaceKeyword */ || node.kind === 139 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : + node.kind === 148 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : + node.kind === 139 /* NamespaceKeyword */ || node.kind === 138 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : node.kind === 99 /* ImportKeyword */ ? ts.isImportEqualsDeclaration(parent) : node.kind === 134 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : - node.kind === 146 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { + node.kind === 145 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { var location = getAdjustedLocationForDeclaration(parent, forRename); if (location) { return location; @@ -114016,7 +111441,7 @@ var ts; return decl.name; } } - if (node.kind === 149 /* TypeKeyword */) { + if (node.kind === 148 /* TypeKeyword */) { // import /**/type [|name|] from ...; // import /**/type { [|name|] } from ...; // import /**/type { propertyName as [|name|] } from ...; @@ -114083,12 +111508,12 @@ var ts; } } // import name = /**/require("[|module|]"); - if (node.kind === 143 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { + if (node.kind === 142 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { return parent.expression; } // import ... /**/from "[|module|]"; // export ... /**/from "[|module|]"; - if (node.kind === 153 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { + if (node.kind === 152 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { return parent.moduleSpecifier; } // class ... /**/extends [|name|] ... @@ -114121,12 +111546,12 @@ var ts; return parent.name; } // /**/keyof [|T|] - if (node.kind === 138 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 138 /* KeyOfKeyword */ && + if (node.kind === 137 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 137 /* KeyOfKeyword */ && ts.isTypeReferenceNode(parent.type)) { return parent.type.typeName; } // /**/readonly [|name|][] - if (node.kind === 142 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 142 /* ReadonlyKeyword */ && + if (node.kind === 141 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 141 /* ReadonlyKeyword */ && ts.isArrayTypeNode(parent.type) && ts.isTypeReferenceNode(parent.type.elementType)) { return parent.type.elementType.typeName; } @@ -114163,7 +111588,7 @@ var ts; // for (... /**/in [|name|]) // for (... /**/of [|name|]) if (node.kind === 100 /* InKeyword */ && ts.isForInStatement(parent) || - node.kind === 156 /* OfKeyword */ && ts.isForOfStatement(parent)) { + node.kind === 155 /* OfKeyword */ && ts.isForOfStatement(parent)) { return ts.skipOuterExpressions(parent.expression); } } @@ -114281,21 +111706,7 @@ var ts; return n; } var children = n.getChildren(sourceFile); - var i = ts.binarySearchKey(children, position, function (_, i) { return i; }, function (middle, _) { - // This last callback is more of a selector than a comparator - - // `EqualTo` causes the `middle` result to be returned - // `GreaterThan` causes recursion on the left of the middle - // `LessThan` causes recursion on the right of the middle - if (position < children[middle].end) { - // first element whose end position is greater than the input position - if (!children[middle - 1] || position >= children[middle - 1].end) { - return 0 /* EqualTo */; - } - return 1 /* GreaterThan */; - } - return -1 /* LessThan */; - }); - if (i >= 0 && children[i]) { + for (var i = 0; i < children.length; i++) { var child = children[i]; // Note that the span of a node's tokens is [node.getStart(...), node.end). // Given that `position < child.end` and child has constituent tokens, we distinguish these cases: @@ -114318,7 +111729,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 297 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 294 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -114336,9 +111747,6 @@ var ts; return n; } var children = n.getChildren(sourceFile); - if (children.length === 0) { - return n; - } var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length, sourceFile); return candidate && findRightmostToken(candidate, sourceFile); } @@ -114391,17 +111799,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 283 /* JsxExpression */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 280 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 283 /* JsxExpression */) { + if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 280 /* JsxExpression */) { return true; } //
|
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 276 /* JsxClosingElement */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 273 /* JsxClosingElement */) { return true; } return false; @@ -114432,7 +111840,7 @@ var ts; function isInsideJsxElement(sourceFile, position) { function isInsideJsxElementTraversal(node) { while (node) { - if (node.kind >= 274 /* JsxSelfClosingElement */ && node.kind <= 283 /* JsxExpression */ + if (node.kind >= 271 /* JsxSelfClosingElement */ && node.kind <= 280 /* JsxExpression */ || node.kind === 11 /* JsxText */ || node.kind === 29 /* LessThanToken */ || node.kind === 31 /* GreaterThanToken */ @@ -114442,7 +111850,7 @@ var ts; || node.kind === 43 /* SlashToken */) { node = node.parent; } - else if (node.kind === 273 /* JsxElement */) { + else if (node.kind === 270 /* JsxElement */) { if (position > node.getStart(sourceFile)) return true; node = node.parent; @@ -114569,7 +111977,7 @@ var ts; // falls through case 111 /* TypeOfKeyword */: case 93 /* ExtendsKeyword */: - case 138 /* KeyOfKeyword */: + case 137 /* KeyOfKeyword */: case 24 /* DotToken */: case 51 /* BarToken */: case 57 /* QuestionToken */: @@ -114626,16 +112034,16 @@ var ts; result.push("deprecated" /* deprecatedModifier */); if (node.flags & 8388608 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 266 /* ExportAssignment */) + if (node.kind === 263 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 173 /* TypeReference */ || node.kind === 203 /* CallExpression */) { + if (node.kind === 172 /* TypeReference */ || node.kind === 200 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 252 /* ClassDeclaration */ || node.kind === 253 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 249 /* ClassDeclaration */ || node.kind === 250 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -114680,18 +112088,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 199 /* ArrayLiteralExpression */ || - node.kind === 200 /* ObjectLiteralExpression */) { + if (node.kind === 196 /* ArrayLiteralExpression */ || + node.kind === 197 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 216 /* BinaryExpression */ && + if (node.parent.kind === 213 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 239 /* ForOfStatement */ && + if (node.parent.kind === 236 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -114699,7 +112107,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 288 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 285 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -114763,29 +112171,29 @@ var ts; ts.typeKeywords = [ 128 /* AnyKeyword */, 127 /* AssertsKeyword */, - 155 /* BigIntKeyword */, + 154 /* BigIntKeyword */, 131 /* BooleanKeyword */, 94 /* FalseKeyword */, - 138 /* KeyOfKeyword */, - 141 /* NeverKeyword */, + 137 /* KeyOfKeyword */, + 140 /* NeverKeyword */, 103 /* NullKeyword */, - 144 /* NumberKeyword */, - 145 /* ObjectKeyword */, - 142 /* ReadonlyKeyword */, - 147 /* StringKeyword */, - 148 /* SymbolKeyword */, + 143 /* NumberKeyword */, + 144 /* ObjectKeyword */, + 141 /* ReadonlyKeyword */, + 146 /* StringKeyword */, + 147 /* SymbolKeyword */, 109 /* TrueKeyword */, 113 /* VoidKeyword */, - 150 /* UndefinedKeyword */, - 151 /* UniqueKeyword */, - 152 /* UnknownKeyword */, + 149 /* UndefinedKeyword */, + 150 /* UniqueKeyword */, + 151 /* UnknownKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); } ts.isTypeKeyword = isTypeKeyword; function isTypeKeywordToken(node) { - return node.kind === 149 /* TypeKeyword */; + return node.kind === 148 /* TypeKeyword */; } ts.isTypeKeywordToken = isTypeKeywordToken; /** True if the symbol is for an external module, as opposed to a namespace. */ @@ -114818,7 +112226,7 @@ var ts; } ts.skipConstraint = skipConstraint; function getNameFromPropertyName(name) { - return name.kind === 158 /* ComputedPropertyName */ + return name.kind === 157 /* ComputedPropertyName */ // treat computed property names where expression is string/numeric literal as just string/numeric literal ? ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined : ts.isPrivateIdentifier(name) ? ts.idText(name) : ts.getTextOfIdentifierOrLiteral(name); @@ -114849,7 +112257,7 @@ var ts; getSourceFiles: function () { return program.getSourceFiles(); }, redirectTargetsMap: program.redirectTargetsMap, getProjectReferenceRedirect: function (fileName) { return program.getProjectReferenceRedirect(fileName); }, - isSourceOfProjectReferenceRedirect: function (fileName) { return program.isSourceOfProjectReferenceRedirect(fileName); } + isSourceOfProjectReferenceRedirect: function (fileName) { return program.isSourceOfProjectReferenceRedirect(fileName); }, }; } ts.createModuleSpecifierResolutionHost = createModuleSpecifierResolutionHost; @@ -114887,9 +112295,7 @@ var ts; return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */; } else { - // ignore synthetic import added when importHelpers: true - var firstModuleSpecifier = sourceFile.imports && - ts.find(sourceFile.imports, function (n) { return ts.isStringLiteral(n) && !ts.nodeIsSynthesized(n.parent); }); + var firstModuleSpecifier = sourceFile.imports && ts.find(sourceFile.imports, ts.isStringLiteral); return firstModuleSpecifier ? quotePreferenceFromString(firstModuleSpecifier, sourceFile) : 1 /* Double */; } } @@ -114981,7 +112387,7 @@ var ts; ts.findModifier = findModifier; function insertImports(changes, sourceFile, imports, blankLineBetween) { var decl = ts.isArray(imports) ? imports[0] : imports; - var importKindPredicate = decl.kind === 232 /* VariableStatement */ ? ts.isRequireVariableStatement : ts.isAnyImportSyntax; + var importKindPredicate = decl.kind === 229 /* VariableStatement */ ? ts.isRequireVariableStatement : ts.isAnyImportSyntax; var existingImportStatements = ts.filter(sourceFile.statements, importKindPredicate); var sortedNewImports = ts.isArray(imports) ? ts.stableSort(imports, ts.OrganizeImports.compareImportsOrRequireStatements) : [imports]; if (!existingImportStatements.length) { @@ -114992,10 +112398,7 @@ var ts; var newImport = sortedNewImports_1[_i]; var insertionIndex = ts.OrganizeImports.getImportDeclarationInsertionIndex(existingImportStatements, newImport); if (insertionIndex === 0) { - // If the first import is top-of-file, insert after the leading comment which is likely the header. - var options = existingImportStatements[0] === sourceFile.statements[0] ? - { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude } : {}; - changes.insertNodeBefore(sourceFile, existingImportStatements[0], newImport, /*blankLineBetween*/ false, options); + changes.insertNodeBefore(sourceFile, existingImportStatements[0], newImport, /*blankLineBetween*/ false); } else { var prevImport = existingImportStatements[insertionIndex - 1]; @@ -115059,7 +112462,7 @@ var ts; // Display-part writer helpers // #region function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 160 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 159 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -115340,22 +112743,36 @@ var ts; return clone; } ts.getSynthesizedDeepClone = getSynthesizedDeepClone; - function getSynthesizedDeepCloneWithReplacements(node, includeTrivia, replaceNode) { - var clone = replaceNode(node); - if (clone) { - ts.setOriginalNode(clone, node); + function getSynthesizedDeepCloneWithRenames(node, includeTrivia, renameMap, checker, callback) { + if (includeTrivia === void 0) { includeTrivia = true; } + var clone; + if (renameMap && checker && ts.isBindingElement(node) && ts.isIdentifier(node.name) && ts.isObjectBindingPattern(node.parent)) { + var symbol = checker.getSymbolAtLocation(node.name); + var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); + if (renameInfo && renameInfo.text !== (node.name || node.propertyName).getText()) { + clone = ts.setOriginalNode(ts.factory.createBindingElement(node.dotDotDotToken, node.propertyName || node.name, renameInfo, node.initializer), node); + } } - else { - clone = getSynthesizedDeepCloneWorker(node, replaceNode); + else if (renameMap && checker && ts.isIdentifier(node)) { + var symbol = checker.getSymbolAtLocation(node); + var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); + if (renameInfo) { + clone = ts.setOriginalNode(ts.factory.createIdentifier(renameInfo.text), node); + } + } + if (!clone) { + clone = getSynthesizedDeepCloneWorker(node, renameMap, checker, callback); } if (clone && !includeTrivia) suppressLeadingAndTrailingTrivia(clone); + if (callback && clone) + callback(node, clone); return clone; } - ts.getSynthesizedDeepCloneWithReplacements = getSynthesizedDeepCloneWithReplacements; - function getSynthesizedDeepCloneWorker(node, replaceNode) { - var visited = replaceNode ? - ts.visitEachChild(node, function (n) { return getSynthesizedDeepCloneWithReplacements(n, /*includeTrivia*/ true, replaceNode); }, ts.nullTransformationContext) : + ts.getSynthesizedDeepCloneWithRenames = getSynthesizedDeepCloneWithRenames; + function getSynthesizedDeepCloneWorker(node, renameMap, checker, callback) { + var visited = (renameMap || checker || callback) ? + ts.visitEachChild(node, wrapper, ts.nullTransformationContext) : ts.visitEachChild(node, getSynthesizedDeepClone, ts.nullTransformationContext); if (visited === node) { // This only happens for leaf nodes - internal nodes always see their children change. @@ -115369,16 +112786,15 @@ var ts; // would have made. visited.parent = undefined; return visited; + function wrapper(node) { + return getSynthesizedDeepCloneWithRenames(node, /*includeTrivia*/ true, renameMap, checker, callback); + } } function getSynthesizedDeepClones(nodes, includeTrivia) { if (includeTrivia === void 0) { includeTrivia = true; } return nodes && ts.factory.createNodeArray(nodes.map(function (n) { return getSynthesizedDeepClone(n, includeTrivia); }), nodes.hasTrailingComma); } ts.getSynthesizedDeepClones = getSynthesizedDeepClones; - function getSynthesizedDeepClonesWithReplacements(nodes, includeTrivia, replaceNode) { - return ts.factory.createNodeArray(nodes.map(function (n) { return getSynthesizedDeepCloneWithReplacements(n, includeTrivia, replaceNode); }), nodes.hasTrailingComma); - } - ts.getSynthesizedDeepClonesWithReplacements = getSynthesizedDeepClonesWithReplacements; /** * Sets EmitFlags to suppress leading and trailing trivia on the node. */ @@ -115523,26 +112939,35 @@ var ts; function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 204 /* NewExpression */: + case 201 /* NewExpression */: return checker.getContextualType(parent); - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 284 /* CaseClause */: + case 281 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); } } ts.getContextualTypeFromParent = getContextualTypeFromParent; - function quote(sourceFile, preferences, text) { + function quote(text, preferences) { // Editors can pass in undefined or empty string - we want to infer the preference in those cases. - var quotePreference = getQuotePreference(sourceFile, preferences); + var quotePreference = preferences.quotePreference || "auto"; var quoted = JSON.stringify(text); - return quotePreference === 0 /* Single */ ? "'" + ts.stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'" : quoted; + switch (quotePreference) { + // TODO use getQuotePreference to infer the actual quote style. + case "auto": + case "double": + return quoted; + case "single": + return "'" + ts.stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'"; + default: + return ts.Debug.assertNever(quotePreference); + } } ts.quote = quote; function isEqualityOperatorKind(kind) { @@ -115561,8 +112986,8 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: - case 205 /* TaggedTemplateExpression */: + case 215 /* TemplateExpression */: + case 202 /* TaggedTemplateExpression */: return true; default: return false; @@ -115582,7 +113007,7 @@ var ts; var checker = program.getTypeChecker(); var typeIsAccessible = true; var notAccessible = function () { typeIsAccessible = false; }; - var res = checker.typeToTypeNode(type, enclosingScope, 1 /* NoTruncation */, { + var res = checker.typeToTypeNode(type, enclosingScope, /*flags*/ undefined, { trackSymbol: function (symbol, declaration, meaning) { typeIsAccessible = typeIsAccessible && checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility === 0 /* Accessible */; }, @@ -115595,41 +113020,41 @@ var ts; } ts.getTypeNodeIfAccessible = getTypeNodeIfAccessible; function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 169 /* CallSignature */ - || kind === 170 /* ConstructSignature */ - || kind === 171 /* IndexSignature */ - || kind === 162 /* PropertySignature */ - || kind === 164 /* MethodSignature */; + return kind === 168 /* CallSignature */ + || kind === 169 /* ConstructSignature */ + || kind === 170 /* IndexSignature */ + || kind === 161 /* PropertySignature */ + || kind === 163 /* MethodSignature */; } ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI; function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 251 /* FunctionDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 248 /* FunctionDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI; function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 256 /* ModuleDeclaration */; + return kind === 253 /* ModuleDeclaration */; } ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI; function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 232 /* VariableStatement */ - || kind === 233 /* ExpressionStatement */ - || kind === 235 /* DoStatement */ - || kind === 240 /* ContinueStatement */ - || kind === 241 /* BreakStatement */ - || kind === 242 /* ReturnStatement */ - || kind === 246 /* ThrowStatement */ - || kind === 248 /* DebuggerStatement */ - || kind === 163 /* PropertyDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 267 /* ExportDeclaration */ - || kind === 259 /* NamespaceExportDeclaration */ - || kind === 266 /* ExportAssignment */; + return kind === 229 /* VariableStatement */ + || kind === 230 /* ExpressionStatement */ + || kind === 232 /* DoStatement */ + || kind === 237 /* ContinueStatement */ + || kind === 238 /* BreakStatement */ + || kind === 239 /* ReturnStatement */ + || kind === 243 /* ThrowStatement */ + || kind === 245 /* DebuggerStatement */ + || kind === 162 /* PropertyDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 264 /* ExportDeclaration */ + || kind === 256 /* NamespaceExportDeclaration */ + || kind === 263 /* ExportAssignment */; } ts.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI; ts.syntaxMayBeASICandidate = ts.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI); @@ -115659,7 +113084,7 @@ var ts; return false; } // See comment in parser’s `parseDoStatement` - if (node.kind === 235 /* DoStatement */) { + if (node.kind === 232 /* DoStatement */) { return true; } var topNode = ts.findAncestor(node, function (ancestor) { return !ancestor.parent; }); @@ -116078,10 +113503,10 @@ var ts; } break; case 128 /* AnyKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -116271,7 +113696,7 @@ var ts; } switch (keyword2) { case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: case 132 /* ConstructorKeyword */: case 123 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". @@ -116416,13 +113841,13 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -116642,18 +114067,18 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; break; - case 329 /* JSDocTypeTag */: + case 325 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; break; - case 327 /* JSDocReturnTag */: + case 323 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; break; @@ -116804,22 +114229,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -116848,17 +114273,17 @@ var ts; var parent = token.parent; if (tokenKind === 62 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (parent.kind === 249 /* VariableDeclaration */ || - parent.kind === 163 /* PropertyDeclaration */ || - parent.kind === 160 /* Parameter */ || - parent.kind === 280 /* JsxAttribute */) { + if (parent.kind === 246 /* VariableDeclaration */ || + parent.kind === 162 /* PropertyDeclaration */ || + parent.kind === 159 /* Parameter */ || + parent.kind === 277 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent.kind === 216 /* BinaryExpression */ || - parent.kind === 214 /* PrefixUnaryExpression */ || - parent.kind === 215 /* PostfixUnaryExpression */ || - parent.kind === 217 /* ConditionalExpression */) { + if (parent.kind === 213 /* BinaryExpression */ || + parent.kind === 211 /* PrefixUnaryExpression */ || + parent.kind === 212 /* PostfixUnaryExpression */ || + parent.kind === 214 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -116871,7 +114296,7 @@ var ts; return 25 /* bigintLiteral */; } else if (tokenKind === 10 /* StringLiteral */) { - return token && token.parent.kind === 280 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 277 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 13 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -116887,32 +114312,32 @@ var ts; else if (tokenKind === 78 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 160 /* Parameter */: + case 159 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -116941,254 +114366,6 @@ var ts; } ts.getEncodedSyntacticClassifications = getEncodedSyntacticClassifications; })(ts || (ts = {})); -/** @internal */ -var ts; -(function (ts) { - var classifier; - (function (classifier) { - var v2020; - (function (v2020) { - var TokenEncodingConsts; - (function (TokenEncodingConsts) { - TokenEncodingConsts[TokenEncodingConsts["typeOffset"] = 8] = "typeOffset"; - TokenEncodingConsts[TokenEncodingConsts["modifierMask"] = 255] = "modifierMask"; - })(TokenEncodingConsts = v2020.TokenEncodingConsts || (v2020.TokenEncodingConsts = {})); - var TokenType; - (function (TokenType) { - TokenType[TokenType["class"] = 0] = "class"; - TokenType[TokenType["enum"] = 1] = "enum"; - TokenType[TokenType["interface"] = 2] = "interface"; - TokenType[TokenType["namespace"] = 3] = "namespace"; - TokenType[TokenType["typeParameter"] = 4] = "typeParameter"; - TokenType[TokenType["type"] = 5] = "type"; - TokenType[TokenType["parameter"] = 6] = "parameter"; - TokenType[TokenType["variable"] = 7] = "variable"; - TokenType[TokenType["enumMember"] = 8] = "enumMember"; - TokenType[TokenType["property"] = 9] = "property"; - TokenType[TokenType["function"] = 10] = "function"; - TokenType[TokenType["member"] = 11] = "member"; - })(TokenType = v2020.TokenType || (v2020.TokenType = {})); - var TokenModifier; - (function (TokenModifier) { - TokenModifier[TokenModifier["declaration"] = 0] = "declaration"; - TokenModifier[TokenModifier["static"] = 1] = "static"; - TokenModifier[TokenModifier["async"] = 2] = "async"; - TokenModifier[TokenModifier["readonly"] = 3] = "readonly"; - TokenModifier[TokenModifier["defaultLibrary"] = 4] = "defaultLibrary"; - TokenModifier[TokenModifier["local"] = 5] = "local"; - })(TokenModifier = v2020.TokenModifier || (v2020.TokenModifier = {})); - /** This is mainly used internally for testing */ - function getSemanticClassifications(program, cancellationToken, sourceFile, span) { - var classifications = getEncodedSemanticClassifications(program, cancellationToken, sourceFile, span); - ts.Debug.assert(classifications.spans.length % 3 === 0); - var dense = classifications.spans; - var result = []; - for (var i = 0; i < dense.length; i += 3) { - result.push({ - textSpan: ts.createTextSpan(dense[i], dense[i + 1]), - classificationType: dense[i + 2] - }); - } - return result; - } - v2020.getSemanticClassifications = getSemanticClassifications; - function getEncodedSemanticClassifications(program, cancellationToken, sourceFile, span) { - return { - spans: getSemanticTokens(program, sourceFile, span, cancellationToken), - endOfLineState: 0 /* None */ - }; - } - v2020.getEncodedSemanticClassifications = getEncodedSemanticClassifications; - function getSemanticTokens(program, sourceFile, span, cancellationToken) { - var resultTokens = []; - var collector = function (node, typeIdx, modifierSet) { - resultTokens.push(node.getStart(sourceFile), node.getWidth(sourceFile), ((typeIdx + 1) << 8 /* typeOffset */) + modifierSet); - }; - if (program && sourceFile) { - collectTokens(program, sourceFile, span, collector, cancellationToken); - } - return resultTokens; - } - function collectTokens(program, sourceFile, span, collector, cancellationToken) { - var typeChecker = program.getTypeChecker(); - var inJSXElement = false; - function visit(node) { - switch (node.kind) { - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - cancellationToken.throwIfCancellationRequested(); - } - if (!node || !ts.textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) { - return; - } - var prevInJSXElement = inJSXElement; - if (ts.isJsxElement(node) || ts.isJsxSelfClosingElement(node)) { - inJSXElement = true; - } - if (ts.isJsxExpression(node)) { - inJSXElement = false; - } - if (ts.isIdentifier(node) && !inJSXElement && !inImportClause(node)) { - var symbol = typeChecker.getSymbolAtLocation(node); - if (symbol) { - if (symbol.flags & 2097152 /* Alias */) { - symbol = typeChecker.getAliasedSymbol(symbol); - } - var typeIdx = classifySymbol(symbol, ts.getMeaningFromLocation(node)); - if (typeIdx !== undefined) { - var modifierSet = 0; - if (node.parent) { - var parentIsDeclaration = (ts.isBindingElement(node.parent) || tokenFromDeclarationMapping.get(node.parent.kind) === typeIdx); - if (parentIsDeclaration && node.parent.name === node) { - modifierSet = 1 << 0 /* declaration */; - } - } - // property declaration in constructor - if (typeIdx === 6 /* parameter */ && isRightSideOfQualifiedNameOrPropertyAccess(node)) { - typeIdx = 9 /* property */; - } - typeIdx = reclassifyByType(typeChecker, node, typeIdx); - var decl = symbol.valueDeclaration; - if (decl) { - var modifiers = ts.getCombinedModifierFlags(decl); - var nodeFlags = ts.getCombinedNodeFlags(decl); - if (modifiers & 32 /* Static */) { - modifierSet |= 1 << 1 /* static */; - } - if (modifiers & 256 /* Async */) { - modifierSet |= 1 << 2 /* async */; - } - if (typeIdx !== 0 /* class */ && typeIdx !== 2 /* interface */) { - if ((modifiers & 64 /* Readonly */) || (nodeFlags & 2 /* Const */) || (symbol.getFlags() & 8 /* EnumMember */)) { - modifierSet |= 1 << 3 /* readonly */; - } - } - if ((typeIdx === 7 /* variable */ || typeIdx === 10 /* function */) && isLocalDeclaration(decl, sourceFile)) { - modifierSet |= 1 << 5 /* local */; - } - if (program.isSourceFileDefaultLibrary(decl.getSourceFile())) { - modifierSet |= 1 << 4 /* defaultLibrary */; - } - } - else if (symbol.declarations && symbol.declarations.some(function (d) { return program.isSourceFileDefaultLibrary(d.getSourceFile()); })) { - modifierSet |= 1 << 4 /* defaultLibrary */; - } - collector(node, typeIdx, modifierSet); - } - } - } - ts.forEachChild(node, visit); - inJSXElement = prevInJSXElement; - } - visit(sourceFile); - } - function classifySymbol(symbol, meaning) { - var flags = symbol.getFlags(); - if (flags & 32 /* Class */) { - return 0 /* class */; - } - else if (flags & 384 /* Enum */) { - return 1 /* enum */; - } - else if (flags & 524288 /* TypeAlias */) { - return 5 /* type */; - } - else if (flags & 64 /* Interface */) { - if (meaning & 2 /* Type */) { - return 2 /* interface */; - } - } - else if (flags & 262144 /* TypeParameter */) { - return 4 /* typeParameter */; - } - var decl = symbol.valueDeclaration || symbol.declarations && symbol.declarations[0]; - if (decl && ts.isBindingElement(decl)) { - decl = getDeclarationForBindingElement(decl); - } - return decl && tokenFromDeclarationMapping.get(decl.kind); - } - function reclassifyByType(typeChecker, node, typeIdx) { - // type based classifications - if (typeIdx === 7 /* variable */ || typeIdx === 9 /* property */ || typeIdx === 6 /* parameter */) { - var type_1 = typeChecker.getTypeAtLocation(node); - if (type_1) { - var test = function (condition) { - return condition(type_1) || type_1.isUnion() && type_1.types.some(condition); - }; - if (typeIdx !== 6 /* parameter */ && test(function (t) { return t.getConstructSignatures().length > 0; })) { - return 0 /* class */; - } - if (test(function (t) { return t.getCallSignatures().length > 0; }) && !test(function (t) { return t.getProperties().length > 0; }) || isExpressionInCallExpression(node)) { - return typeIdx === 9 /* property */ ? 11 /* member */ : 10 /* function */; - } - } - } - return typeIdx; - } - function isLocalDeclaration(decl, sourceFile) { - if (ts.isBindingElement(decl)) { - decl = getDeclarationForBindingElement(decl); - } - if (ts.isVariableDeclaration(decl)) { - return (!ts.isSourceFile(decl.parent.parent.parent) || ts.isCatchClause(decl.parent)) && decl.getSourceFile() === sourceFile; - } - else if (ts.isFunctionDeclaration(decl)) { - return !ts.isSourceFile(decl.parent) && decl.getSourceFile() === sourceFile; - } - return false; - } - function getDeclarationForBindingElement(element) { - while (true) { - if (ts.isBindingElement(element.parent.parent)) { - element = element.parent.parent; - } - else { - return element.parent.parent; - } - } - } - function inImportClause(node) { - var parent = node.parent; - return parent && (ts.isImportClause(parent) || ts.isImportSpecifier(parent) || ts.isNamespaceImport(parent)); - } - function isExpressionInCallExpression(node) { - while (isRightSideOfQualifiedNameOrPropertyAccess(node)) { - node = node.parent; - } - return ts.isCallExpression(node.parent) && node.parent.expression === node; - } - function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (ts.isQualifiedName(node.parent) && node.parent.right === node) || (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node); - } - var tokenFromDeclarationMapping = new ts.Map([ - [249 /* VariableDeclaration */, 7 /* variable */], - [160 /* Parameter */, 6 /* parameter */], - [163 /* PropertyDeclaration */, 9 /* property */], - [256 /* ModuleDeclaration */, 3 /* namespace */], - [255 /* EnumDeclaration */, 1 /* enum */], - [291 /* EnumMember */, 8 /* enumMember */], - [252 /* ClassDeclaration */, 0 /* class */], - [165 /* MethodDeclaration */, 11 /* member */], - [251 /* FunctionDeclaration */, 10 /* function */], - [208 /* FunctionExpression */, 10 /* function */], - [164 /* MethodSignature */, 11 /* member */], - [167 /* GetAccessor */, 9 /* property */], - [168 /* SetAccessor */, 9 /* property */], - [162 /* PropertySignature */, 9 /* property */], - [253 /* InterfaceDeclaration */, 2 /* interface */], - [254 /* TypeAliasDeclaration */, 5 /* type */], - [159 /* TypeParameter */, 4 /* typeParameter */], - [288 /* PropertyAssignment */, 9 /* property */], - [289 /* ShorthandPropertyAssignment */, 9 /* property */] - ]); - })(v2020 = classifier.v2020 || (classifier.v2020 = {})); - })(classifier = ts.classifier || (ts.classifier = {})); -})(ts || (ts = {})); /* @internal */ var ts; (function (ts) { @@ -117213,24 +114390,23 @@ var ts; if (completion === undefined) { return undefined; } - var optionalReplacementSpan = ts.createTextSpanFromStringLiteralLikeContent(contextToken); switch (completion.kind) { case 0 /* Paths */: return convertPathCompletions(completion.paths); case 1 /* Properties */: { var entries = []; Completions.getCompletionEntriesFromSymbols(completion.symbols, entries, contextToken, sourceFile, sourceFile, checker, 99 /* ESNext */, log, 4 /* String */, preferences); // Target will not be used, so arbitrary - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan: optionalReplacementSpan, entries: entries }; + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, entries: entries }; } case 2 /* Types */: { var entries = completion.types.map(function (type) { return ({ name: type.value, kindModifiers: "" /* none */, kind: "string" /* string */, - sortText: Completions.SortText.LocationPriority, + sortText: "0", replacementSpan: ts.getReplacementSpanForContextToken(contextToken) }); }); - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, optionalReplacementSpan: optionalReplacementSpan, entries: entries }; + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, entries: entries }; } default: return ts.Debug.assertNever(completion); @@ -117289,46 +114465,33 @@ var ts; StringLiteralCompletionKind[StringLiteralCompletionKind["Types"] = 2] = "Types"; })(StringLiteralCompletionKind || (StringLiteralCompletionKind = {})); function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { - var parent = walkUpParentheses(node.parent); + var parent = node.parent; switch (parent.kind) { - case 191 /* LiteralType */: { - var grandParent = walkUpParentheses(parent.parent); - switch (grandParent.kind) { - case 173 /* TypeReference */: { - var typeReference_1 = grandParent; - var typeArgument = ts.findAncestor(parent, function (n) { return n.parent === typeReference_1; }); - if (typeArgument) { - return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false }; - } - return undefined; - } - case 189 /* IndexedAccessType */: + case 190 /* LiteralType */: + switch (parent.parent.kind) { + case 172 /* TypeReference */: + return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent)), isNewIdentifier: false }; + case 188 /* IndexedAccessType */: // Get all apparent property names // i.e. interface Foo { // foo: string; // bar: string; // } // let x: Foo["/*completion position*/"] - var _a = grandParent, indexType = _a.indexType, objectType = _a.objectType; - if (!ts.rangeContainsPosition(indexType, position)) { - return undefined; - } - return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType)); - case 195 /* ImportType */: + return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(parent.parent.objectType)); + case 192 /* ImportType */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; - case 182 /* UnionType */: { - if (!ts.isTypeReferenceNode(grandParent.parent)) { + case 181 /* UnionType */: { + if (!ts.isTypeReferenceNode(parent.parent.parent)) return undefined; - } - var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent); - var types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(grandParent)).filter(function (t) { return !ts.contains(alreadyUsedTypes_1, t.value); }); + var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(parent.parent, parent); + var types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent.parent)).filter(function (t) { return !ts.contains(alreadyUsedTypes_1, t.value); }); return { kind: 2 /* Types */, types: types, isNewIdentifier: false }; } default: return undefined; } - } - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { @@ -117345,9 +114508,9 @@ var ts; return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(parent.parent)); } return fromContextualType(); - case 202 /* ElementAccessExpression */: { - var _b = parent, expression = _b.expression, argumentExpression = _b.argumentExpression; - if (node === ts.skipParentheses(argumentExpression)) { + case 199 /* ElementAccessExpression */: { + var _a = parent, expression = _a.expression, argumentExpression = _a.argumentExpression; + if (node === argumentExpression) { // Get all names of properties on the expression // i.e. interface A { // 'prop1': string @@ -117358,8 +114521,8 @@ var ts; } return undefined; } - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ false) && !ts.isImportCall(parent)) { var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile); // Get string literal completions from specialized signatures of the target @@ -117368,9 +114531,9 @@ var ts; return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType(); } // falls through (is `require("")` or `import("")`) - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 272 /* ExternalModuleReference */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 269 /* ExternalModuleReference */: // Get all known external module names or complete a path to a module // i.e. import * as ns from "/*completion position*/"; // var y = import("/*completion position*/"); @@ -117387,16 +114550,6 @@ var ts; return { kind: 2 /* Types */, types: getStringLiteralTypes(ts.getContextualTypeFromParent(node, typeChecker)), isNewIdentifier: false }; } } - function walkUpParentheses(node) { - switch (node.kind) { - case 186 /* ParenthesizedType */: - return ts.walkUpParenthesizedTypes(node); - case 207 /* ParenthesizedExpression */: - return ts.walkUpParenthesizedExpressions(node); - default: - return node; - } - } function getAlreadyUsedTypesInStringLiteralUnion(union, current) { return ts.mapDefined(union.types, function (type) { return type !== current && ts.isLiteralTypeNode(type) && ts.isStringLiteral(type.literal) ? type.literal.text : undefined; @@ -117843,14 +114996,13 @@ var ts; (function (Completions) { var SortText; (function (SortText) { - SortText["LocalDeclarationPriority"] = "0"; - SortText["LocationPriority"] = "1"; - SortText["OptionalMember"] = "2"; - SortText["MemberDeclaredBySpreadAssignment"] = "3"; - SortText["SuggestedClassMembers"] = "4"; - SortText["GlobalsOrKeywords"] = "5"; - SortText["AutoImportSuggestions"] = "6"; - SortText["JavascriptIdentifiers"] = "7"; + SortText["LocationPriority"] = "0"; + SortText["OptionalMember"] = "1"; + SortText["MemberDeclaredBySpreadAssignment"] = "2"; + SortText["SuggestedClassMembers"] = "3"; + SortText["GlobalsOrKeywords"] = "4"; + SortText["AutoImportSuggestions"] = "5"; + SortText["JavascriptIdentifiers"] = "6"; })(SortText = Completions.SortText || (Completions.SortText = {})); /** * Special values for `CompletionInfo['source']` used to disambiguate @@ -117997,10 +115149,6 @@ var ts; function jsdocCompletionInfo(entries) { return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; } - function getOptionalReplacementSpan(location) { - // StringLiteralLike locations are handled separately in stringCompletions.ts - return (location === null || location === void 0 ? void 0 : location.kind) === 78 /* Identifier */ ? ts.createTextSpanFromNode(location) : undefined; - } function completionInfoFromData(sourceFile, typeChecker, compilerOptions, log, completionData, preferences) { var symbols = completionData.symbols, completionKind = completionData.completionKind, isInSnippetScope = completionData.isInSnippetScope, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, literals = completionData.literals, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer, insideJsDocTagTypeExpression = completionData.insideJsDocTagTypeExpression, symbolToSortTextMap = completionData.symbolToSortTextMap; if (location && location.parent && ts.isJsxClosingElement(location.parent)) { @@ -118018,7 +115166,7 @@ var ts; kindModifiers: undefined, sortText: SortText.LocationPriority, }; - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, optionalReplacementSpan: getOptionalReplacementSpan(location), entries: [entry] }; + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, entries: [entry] }; } var entries = []; if (isUncheckedFile(sourceFile, compilerOptions)) { @@ -118044,15 +115192,9 @@ var ts; } for (var _b = 0, literals_1 = literals; _b < literals_1.length; _b++) { var literal = literals_1[_b]; - entries.push(createCompletionEntryForLiteral(sourceFile, preferences, literal)); + entries.push(createCompletionEntryForLiteral(literal, preferences)); } - return { - isGlobalCompletion: isInSnippetScope, - isMemberCompletion: isMemberCompletionKind(completionKind), - isNewIdentifierLocation: isNewIdentifierLocation, - optionalReplacementSpan: getOptionalReplacementSpan(location), - entries: entries - }; + return { isGlobalCompletion: isInSnippetScope, isMemberCompletion: isMemberCompletionKind(completionKind), isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; } function isUncheckedFile(sourceFile, compilerOptions) { return ts.isSourceFileJS(sourceFile) && !ts.isCheckJsEnabledForFile(sourceFile, compilerOptions); @@ -118086,12 +115228,12 @@ var ts; } }); } - function completionNameForLiteral(sourceFile, preferences, literal) { + function completionNameForLiteral(literal, preferences) { return typeof literal === "object" ? ts.pseudoBigIntToString(literal) + "n" : - ts.isString(literal) ? ts.quote(sourceFile, preferences, literal) : JSON.stringify(literal); + ts.isString(literal) ? ts.quote(literal, preferences) : JSON.stringify(literal); } - function createCompletionEntryForLiteral(sourceFile, preferences, literal) { - return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; + function createCompletionEntryForLiteral(literal, preferences) { + return { name: completionNameForLiteral(literal, preferences), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; } function createCompletionEntry(symbol, sortText, contextToken, location, sourceFile, typeChecker, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, preferences) { var insertText; @@ -118100,13 +115242,13 @@ var ts; var useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess; if (origin && originIsThisType(origin)) { insertText = needsConvertPropertyAccess - ? "this" + (insertQuestionDot ? "?." : "") + "[" + quotePropertyName(sourceFile, preferences, name) + "]" + ? "this" + (insertQuestionDot ? "?." : "") + "[" + quotePropertyName(name, preferences) + "]" : "this" + (insertQuestionDot ? "?." : ".") + name; } // We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790. // Somehow there was a global with a non-identifier name. Hopefully someone will complain about getting a "foo bar" global completion and provide a repro. else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) { - insertText = useBraces ? needsConvertPropertyAccess ? "[" + quotePropertyName(sourceFile, preferences, name) + "]" : "[" + name + "]" : name; + insertText = useBraces ? needsConvertPropertyAccess ? "[" + quotePropertyName(name, preferences) + "]" : "[" + name + "]" : name; if (insertQuestionDot || propertyAccessToConvert.questionDotToken) { insertText = "?." + insertText; } @@ -118162,11 +115304,11 @@ var ts; isPackageJsonImport: originIsPackageJsonImport(origin) || undefined, }; } - function quotePropertyName(sourceFile, preferences, name) { + function quotePropertyName(name, preferences) { if (/^\d+$/.test(name)) { return name; } - return ts.quote(sourceFile, preferences, name); + return ts.quote(name, preferences); } function isRecommendedCompletionMatch(localSymbol, recommendedCompletion, checker) { return localSymbol === recommendedCompletion || @@ -118257,7 +115399,7 @@ var ts; return { type: "request", request: completionData }; } var symbols = completionData.symbols, literals = completionData.literals, location = completionData.location, completionKind = completionData.completionKind, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, previousToken = completionData.previousToken, isJsxInitializer = completionData.isJsxInitializer, isTypeOnlyLocation = completionData.isTypeOnlyLocation; - var literal = ts.find(literals, function (l) { return completionNameForLiteral(sourceFile, preferences, l) === entryId.name; }); + var literal = ts.find(literals, function (l) { return completionNameForLiteral(l, preferences) === entryId.name; }); if (literal !== undefined) return { type: "literal", literal: literal }; // Find the symbol with the matching entry name. @@ -118303,7 +115445,7 @@ var ts; } case "literal": { var literal = symbolCompletion.literal; - return createSimpleDetails(completionNameForLiteral(sourceFile, preferences, literal), "string" /* string */, typeof literal === "string" ? ts.SymbolDisplayPartKind.stringLiteral : ts.SymbolDisplayPartKind.numericLiteral); + return createSimpleDetails(completionNameForLiteral(literal, preferences), "string" /* string */, typeof literal === "string" ? ts.SymbolDisplayPartKind.stringLiteral : ts.SymbolDisplayPartKind.numericLiteral); } case "none": // Didn't find a symbol with this name. See if we can find a keyword instead. @@ -118375,11 +115517,11 @@ var ts; return ts.getContextualTypeFromParent(previousToken, checker); case 62 /* EqualsToken */: switch (parent.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return checker.getContextualType(parent.initializer); // TODO: GH#18217 - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return checker.getTypeAtLocation(parent.left); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent); default: return undefined; @@ -118389,7 +115531,7 @@ var ts; case 81 /* CaseKeyword */: return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); case 18 /* OpenBraceToken */: - return ts.isJsxExpression(parent) && parent.parent.kind !== 273 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + return ts.isJsxExpression(parent) && parent.parent.kind !== 270 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); return argInfo ? @@ -118408,7 +115550,7 @@ var ts; return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 297 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 294 /* SourceFile */; }); } function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId, host) { var typeChecker = program.getTypeChecker(); @@ -118459,11 +115601,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 301 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 298 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 333 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 328 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -118516,7 +115658,7 @@ var ts; isRightOfDot = contextToken.kind === 24 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; if ((ts.isCallExpression(node) || ts.isFunctionLike(node)) && @@ -118529,14 +115671,14 @@ var ts; return undefined; } break; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: node = parent.left; break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: node = parent.name; break; - case 195 /* ImportType */: - case 226 /* MetaProperty */: + case 192 /* ImportType */: + case 223 /* MetaProperty */: node = parent; break; default: @@ -118549,7 +115691,7 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 201 /* PropertyAccessExpression */) { + if (parent && parent.kind === 198 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } @@ -118557,51 +115699,39 @@ var ts; if (currentToken.parent === location) { switch (currentToken.kind) { case 31 /* GreaterThanToken */: - if (currentToken.parent.kind === 273 /* JsxElement */ || currentToken.parent.kind === 275 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 270 /* JsxElement */ || currentToken.parent.kind === 272 /* JsxOpeningElement */) { location = currentToken; } break; case 43 /* SlashToken */: - if (currentToken.parent.kind === 274 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 271 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent.kind) { - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: if (contextToken.kind === 43 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent)) { break; } // falls through - case 274 /* JsxSelfClosingElement */: - case 273 /* JsxElement */: - case 275 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 270 /* JsxElement */: + case 272 /* JsxOpeningElement */: isJsxIdentifierExpected = true; if (contextToken.kind === 29 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 283 /* JsxExpression */: - // For `
`, `parent` will be `{true}` and `previousToken` will be `}` - if (previousToken.kind === 19 /* CloseBraceToken */ && currentToken.kind === 31 /* GreaterThanToken */) { - isJsxIdentifierExpected = true; - } - break; - case 280 /* JsxAttribute */: - // For `
`, `parent` will be JsxAttribute and `previousToken` will be its initializer - if (parent.initializer === previousToken && - previousToken.end < position) { - isJsxIdentifierExpected = true; - break; - } + case 277 /* JsxAttribute */: switch (previousToken.kind) { case 62 /* EqualsToken */: isJsxInitializer = true; @@ -118683,11 +115813,11 @@ var ts; }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 331 /* JSDocTypedefTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 327 /* JSDocTypedefTag */: return true; default: return false; @@ -118703,7 +115833,7 @@ var ts; || ts.isPartOfTypeNode(node.parent) || ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); var isRhsOfImportDeclaration = ts.isInRightSideOfInternalImportEqualsDeclaration(node); - if (ts.isEntityName(node) || isImportType || ts.isPropertyAccessExpression(node)) { + if (ts.isEntityName(node) || isImportType) { var isNamespaceName = ts.isModuleDeclaration(node.parent); if (isNamespaceName) isNewIdentifierLocation = true; @@ -118732,7 +115862,7 @@ var ts; // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). if (!isTypeLocation && symbol.declarations && - symbol.declarations.some(function (d) { return d.kind !== 297 /* SourceFile */ && d.kind !== 256 /* ModuleDeclaration */ && d.kind !== 255 /* EnumDeclaration */; })) { + symbol.declarations.some(function (d) { return d.kind !== 294 /* SourceFile */ && d.kind !== 253 /* ModuleDeclaration */ && d.kind !== 252 /* EnumDeclaration */; })) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); var insertQuestionDot = false; if (type.isNullableType()) { @@ -118779,7 +115909,7 @@ var ts; if (isRightOfQuestionDot && ts.some(type.getCallSignatures())) { isNewIdentifierLocation = true; } - var propertyAccess = node.kind === 195 /* ImportType */ ? node : node.parent; + var propertyAccess = node.kind === 192 /* ImportType */ ? node : node.parent; if (isUncheckedFile) { // In javascript files, for union types, we don't just get the members that // the individual types have in common, we also include all the members that @@ -118792,7 +115922,7 @@ var ts; for (var _i = 0, _a = type.getApparentProperties(); _i < _a.length; _i++) { var symbol = _a[_i]; if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type, symbol)) { - addPropertySymbol(symbol, /* insertAwait */ false, insertQuestionDot); + addPropertySymbol(symbol, /*insertAwait*/ false, insertQuestionDot); } } } @@ -118828,20 +115958,13 @@ var ts; } else if (preferences.includeCompletionsWithInsertText) { addSymbolOriginInfo(symbol); - addSymbolSortInfo(symbol); symbols.push(symbol); } } else { addSymbolOriginInfo(symbol); - addSymbolSortInfo(symbol); symbols.push(symbol); } - function addSymbolSortInfo(symbol) { - if (isStaticProperty(symbol)) { - symbolToSortTextMap[ts.getSymbolId(symbol)] = SortText.LocalDeclarationPriority; - } - } function addSymbolOriginInfo(symbol) { if (preferences.includeCompletionsWithInsertText) { if (insertAwait && !symbolToOriginInfoMap[ts.getSymbolId(symbol)]) { @@ -118943,7 +116066,7 @@ var ts; } } // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 297 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 294 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false); if (thisType && !isProbablyGlobalType(thisType, sourceFile, typeChecker)) { for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) { @@ -118993,10 +116116,10 @@ var ts; } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 297 /* SourceFile */: - case 218 /* TemplateExpression */: - case 283 /* JsxExpression */: - case 230 /* Block */: + case 294 /* SourceFile */: + case 215 /* TemplateExpression */: + case 280 /* JsxExpression */: + case 227 /* Block */: return true; default: return ts.isStatement(scopeNode); @@ -119039,27 +116162,27 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 111 /* TypeOfKeyword */ && - (contextToken.parent.kind === 176 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); + (contextToken.parent.kind === 175 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 58 /* ColonToken */: - return parentKind === 163 /* PropertyDeclaration */ || - parentKind === 162 /* PropertySignature */ || - parentKind === 160 /* Parameter */ || - parentKind === 249 /* VariableDeclaration */ || + return parentKind === 162 /* PropertyDeclaration */ || + parentKind === 161 /* PropertySignature */ || + parentKind === 159 /* Parameter */ || + parentKind === 246 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 62 /* EqualsToken */: - return parentKind === 254 /* TypeAliasDeclaration */; + return parentKind === 251 /* TypeAliasDeclaration */; case 126 /* AsKeyword */: - return parentKind === 224 /* AsExpression */; + return parentKind === 221 /* AsExpression */; case 29 /* LessThanToken */: - return parentKind === 173 /* TypeReference */ || - parentKind === 206 /* TypeAssertionExpression */; + return parentKind === 172 /* TypeReference */ || + parentKind === 203 /* TypeAssertionExpression */; case 93 /* ExtendsKeyword */: - return parentKind === 159 /* TypeParameter */; + return parentKind === 158 /* TypeParameter */; } } return false; @@ -119270,7 +116393,7 @@ var ts; return true; } if (contextToken.kind === 31 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 275 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 272 /* JsxOpeningElement */) { // Two possibilities: // 1.
/**/ // - contextToken: GreaterThanToken (before cursor) @@ -119280,10 +116403,10 @@ var ts; // - contextToken: GreaterThanToken (before cursor) // - location: GreaterThanToken (after cursor) // - same parent (JSXOpeningElement) - return location.parent.kind !== 275 /* JsxOpeningElement */; + return location.parent.kind !== 272 /* JsxOpeningElement */; } - if (contextToken.parent.kind === 276 /* JsxClosingElement */ || contextToken.parent.kind === 274 /* JsxSelfClosingElement */) { - return !!contextToken.parent.parent && contextToken.parent.parent.kind === 273 /* JsxElement */; + if (contextToken.parent.kind === 273 /* JsxClosingElement */ || contextToken.parent.kind === 271 /* JsxSelfClosingElement */) { + return !!contextToken.parent.parent && contextToken.parent.parent.kind === 270 /* JsxElement */; } } return false; @@ -119294,40 +116417,40 @@ var ts; // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(previousToken)) { case 27 /* CommaToken */: - return containingNodeKind === 203 /* CallExpression */ // func( a, | - || containingNodeKind === 166 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 204 /* NewExpression */ // new C(a, | - || containingNodeKind === 199 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 216 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 174 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 200 /* CallExpression */ // func( a, | + || containingNodeKind === 165 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 201 /* NewExpression */ // new C(a, | + || containingNodeKind === 196 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 213 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 173 /* FunctionType */; // var x: (s: string, list| case 20 /* OpenParenToken */: - return containingNodeKind === 203 /* CallExpression */ // func( | - || containingNodeKind === 166 /* Constructor */ // constructor( | - || containingNodeKind === 204 /* NewExpression */ // new C(a| - || containingNodeKind === 207 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 186 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 200 /* CallExpression */ // func( | + || containingNodeKind === 165 /* Constructor */ // constructor( | + || containingNodeKind === 201 /* NewExpression */ // new C(a| + || containingNodeKind === 204 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 185 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 22 /* OpenBracketToken */: - return containingNodeKind === 199 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 171 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 158 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 139 /* ModuleKeyword */: // module | - case 140 /* NamespaceKeyword */: // namespace | + return containingNodeKind === 196 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 170 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 157 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 138 /* ModuleKeyword */: // module | + case 139 /* NamespaceKeyword */: // namespace | return true; case 24 /* DotToken */: - return containingNodeKind === 256 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 253 /* ModuleDeclaration */; // module A.| case 18 /* OpenBraceToken */: - return containingNodeKind === 252 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 249 /* ClassDeclaration */; // class A{ | case 62 /* EqualsToken */: - return containingNodeKind === 249 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 216 /* BinaryExpression */; // x = a| + return containingNodeKind === 246 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 213 /* BinaryExpression */; // x = a| case 15 /* TemplateHead */: - return containingNodeKind === 218 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 215 /* TemplateExpression */; // `aa ${| case 16 /* TemplateMiddle */: - return containingNodeKind === 228 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 225 /* TemplateSpan */; // `aa ${10} dd ${| case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - return containingNodeKind === 163 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 162 /* PropertyDeclaration */; // class A{ public | } } return false; @@ -119354,18 +116477,17 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 200 /* ObjectLiteralExpression */) { - var instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker); - if (instantiatedType === undefined) { + if (objectLikeContainer.kind === 197 /* ObjectLiteralExpression */) { + var instantiatedType = typeChecker.getContextualType(objectLikeContainer); + var completionsType = instantiatedType && typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); + if (!instantiatedType || !completionsType) return 2 /* Fail */; - } - var completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); - isNewIdentifierLocation = ts.hasIndexSignature(completionsType || instantiatedType); + isNewIdentifierLocation = ts.hasIndexSignature(instantiatedType || completionsType); typeMembers = getPropertiesForObjectExpression(instantiatedType, completionsType, objectLikeContainer, typeChecker); existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 196 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 193 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -119376,12 +116498,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 239 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 160 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 236 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 159 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 165 /* MethodDeclaration */ || rootDeclaration.parent.kind === 168 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 164 /* MethodDeclaration */ || rootDeclaration.parent.kind === 167 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -119428,9 +116550,9 @@ var ts; if (!namedImportsOrExports) return 0 /* Continue */; // try to show exported member for imported/re-exported module - var moduleSpecifier = (namedImportsOrExports.kind === 264 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + var moduleSpecifier = (namedImportsOrExports.kind === 261 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; if (!moduleSpecifier) - return namedImportsOrExports.kind === 264 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; + return namedImportsOrExports.kind === 261 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217 if (!moduleSpecifierSymbol) return 2 /* Fail */; @@ -119583,11 +116705,11 @@ var ts; case 30 /* LessThanSlashToken */: case 43 /* SlashToken */: case 78 /* Identifier */: - case 201 /* PropertyAccessExpression */: - case 281 /* JsxAttributes */: - case 280 /* JsxAttribute */: - case 282 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 274 /* JsxSelfClosingElement */ || parent.kind === 275 /* JsxOpeningElement */)) { + case 198 /* PropertyAccessExpression */: + case 278 /* JsxAttributes */: + case 277 /* JsxAttribute */: + case 279 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 271 /* JsxSelfClosingElement */ || parent.kind === 272 /* JsxOpeningElement */)) { if (contextToken.kind === 31 /* GreaterThanToken */) { var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); if (!parent.typeArguments || (precedingToken && precedingToken.kind === 43 /* SlashToken */)) @@ -119595,7 +116717,7 @@ var ts; } return parent; } - else if (parent.kind === 280 /* JsxAttribute */) { + else if (parent.kind === 277 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -119607,7 +116729,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 10 /* StringLiteral */: - if (parent && ((parent.kind === 280 /* JsxAttribute */) || (parent.kind === 282 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 277 /* JsxAttribute */) || (parent.kind === 279 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -119617,8 +116739,8 @@ var ts; break; case 19 /* CloseBraceToken */: if (parent && - parent.kind === 283 /* JsxExpression */ && - parent.parent && parent.parent.kind === 280 /* JsxAttribute */) { + parent.kind === 280 /* JsxExpression */ && + parent.parent && parent.parent.kind === 277 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -119626,7 +116748,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 282 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 279 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -119646,51 +116768,51 @@ var ts; var containingNodeKind = parent.kind; switch (contextToken.kind) { case 27 /* CommaToken */: - return containingNodeKind === 249 /* VariableDeclaration */ || + return containingNodeKind === 246 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken) || - containingNodeKind === 232 /* VariableStatement */ || - containingNodeKind === 255 /* EnumDeclaration */ || // enum a { foo, | + containingNodeKind === 229 /* VariableStatement */ || + containingNodeKind === 252 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 253 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 24 /* DotToken */: - return containingNodeKind === 197 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 194 /* ArrayBindingPattern */; // var [.| case 58 /* ColonToken */: - return containingNodeKind === 198 /* BindingElement */; // var {x :html| + return containingNodeKind === 195 /* BindingElement */; // var {x :html| case 22 /* OpenBracketToken */: - return containingNodeKind === 197 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 194 /* ArrayBindingPattern */; // var [x| case 20 /* OpenParenToken */: - return containingNodeKind === 287 /* CatchClause */ || + return containingNodeKind === 284 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 18 /* OpenBraceToken */: - return containingNodeKind === 255 /* EnumDeclaration */; // enum a { | + return containingNodeKind === 252 /* EnumDeclaration */; // enum a { | case 29 /* LessThanToken */: - return containingNodeKind === 252 /* ClassDeclaration */ || // class A< | - containingNodeKind === 221 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 253 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 254 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 249 /* ClassDeclaration */ || // class A< | + containingNodeKind === 218 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 250 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 251 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 123 /* StaticKeyword */: - return containingNodeKind === 163 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); + return containingNodeKind === 162 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); case 25 /* DotDotDotToken */: - return containingNodeKind === 160 /* Parameter */ || - (!!parent.parent && parent.parent.kind === 197 /* ArrayBindingPattern */); // var [...z| + return containingNodeKind === 159 /* Parameter */ || + (!!parent.parent && parent.parent.kind === 194 /* ArrayBindingPattern */); // var [...z| case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - return containingNodeKind === 160 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); + return containingNodeKind === 159 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); case 126 /* AsKeyword */: - return containingNodeKind === 265 /* ImportSpecifier */ || - containingNodeKind === 270 /* ExportSpecifier */ || - containingNodeKind === 263 /* NamespaceImport */; + return containingNodeKind === 262 /* ImportSpecifier */ || + containingNodeKind === 267 /* ExportSpecifier */ || + containingNodeKind === 260 /* NamespaceImport */; case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken); case 83 /* ClassKeyword */: case 91 /* EnumKeyword */: @@ -119700,7 +116822,7 @@ var ts; case 99 /* ImportKeyword */: case 118 /* LetKeyword */: case 84 /* ConstKeyword */: - case 149 /* TypeKeyword */: // type htm| + case 148 /* TypeKeyword */: // type htm| return true; case 41 /* AsteriskToken */: return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent); @@ -119747,7 +116869,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 166 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 165 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -119757,7 +116879,7 @@ var ts; return false; } function isVariableDeclarationListButNotTypeArgument(node) { - return node.parent.kind === 250 /* VariableDeclarationList */ + return node.parent.kind === 247 /* VariableDeclarationList */ && !ts.isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker); } /** @@ -119775,13 +116897,13 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 288 /* PropertyAssignment */ && - m.kind !== 289 /* ShorthandPropertyAssignment */ && - m.kind !== 198 /* BindingElement */ && - m.kind !== 165 /* MethodDeclaration */ && - m.kind !== 167 /* GetAccessor */ && - m.kind !== 168 /* SetAccessor */ && - m.kind !== 290 /* SpreadAssignment */) { + if (m.kind !== 285 /* PropertyAssignment */ && + m.kind !== 286 /* ShorthandPropertyAssignment */ && + m.kind !== 195 /* BindingElement */ && + m.kind !== 164 /* MethodDeclaration */ && + m.kind !== 166 /* GetAccessor */ && + m.kind !== 167 /* SetAccessor */ && + m.kind !== 287 /* SpreadAssignment */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -119854,10 +116976,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 163 /* PropertyDeclaration */ && - m.kind !== 165 /* MethodDeclaration */ && - m.kind !== 167 /* GetAccessor */ && - m.kind !== 168 /* SetAccessor */) { + if (m.kind !== 162 /* PropertyDeclaration */ && + m.kind !== 164 /* MethodDeclaration */ && + m.kind !== 166 /* GetAccessor */ && + m.kind !== 167 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -119899,7 +117021,7 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 280 /* JsxAttribute */) { + if (attr.kind === 277 /* JsxAttribute */) { seenNames.add(attr.name.escapedText); } else if (ts.isJsxSpreadAttribute(attr)) { @@ -119949,7 +117071,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 80 /* FirstKeyword */; i <= 156 /* LastKeyword */; i++) { + for (var i = 80 /* FirstKeyword */; i <= 155 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -119976,10 +117098,11 @@ var ts; case 1 /* All */: return isFunctionLikeBodyKeyword(kind) || kind === 133 /* DeclareKeyword */ - || kind === 139 /* ModuleKeyword */ - || kind === 149 /* TypeKeyword */ - || kind === 140 /* NamespaceKeyword */ - || ts.isTypeKeyword(kind) && kind !== 150 /* UndefinedKeyword */; + || kind === 138 /* ModuleKeyword */ + || kind === 148 /* TypeKeyword */ + || kind === 139 /* NamespaceKeyword */ + || kind === 126 /* AsKeyword */ + || ts.isTypeKeyword(kind) && kind !== 149 /* UndefinedKeyword */; case 5 /* FunctionLikeBodyKeywords */: return isFunctionLikeBodyKeyword(kind); case 2 /* ClassElementKeywords */: @@ -120001,44 +117124,44 @@ var ts; switch (kind) { case 125 /* AbstractKeyword */: case 128 /* AnyKeyword */: - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: case 133 /* DeclareKeyword */: case 91 /* EnumKeyword */: - case 154 /* GlobalKeyword */: + case 153 /* GlobalKeyword */: case 116 /* ImplementsKeyword */: case 135 /* InferKeyword */: case 117 /* InterfaceKeyword */: - case 137 /* IsKeyword */: - case 138 /* KeyOfKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: - case 141 /* NeverKeyword */: - case 144 /* NumberKeyword */: - case 145 /* ObjectKeyword */: + case 136 /* IsKeyword */: + case 137 /* KeyOfKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: + case 140 /* NeverKeyword */: + case 143 /* NumberKeyword */: + case 144 /* ObjectKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 122 /* PublicKeyword */: - case 142 /* ReadonlyKeyword */: - case 147 /* StringKeyword */: - case 148 /* SymbolKeyword */: - case 149 /* TypeKeyword */: - case 151 /* UniqueKeyword */: - case 152 /* UnknownKeyword */: + case 141 /* ReadonlyKeyword */: + case 146 /* StringKeyword */: + case 147 /* SymbolKeyword */: + case 148 /* TypeKeyword */: + case 150 /* UniqueKeyword */: + case 151 /* UnknownKeyword */: return true; default: return false; } } function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 142 /* ReadonlyKeyword */; + return kind === 141 /* ReadonlyKeyword */; } function isClassMemberCompletionKeyword(kind) { switch (kind) { case 125 /* AbstractKeyword */: case 132 /* ConstructorKeyword */: case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: case 129 /* AsyncKeyword */: case 133 /* DeclareKeyword */: return true; @@ -120049,7 +117172,6 @@ var ts; function isFunctionLikeBodyKeyword(kind) { return kind === 129 /* AsyncKeyword */ || kind === 130 /* AwaitKeyword */ - || kind === 126 /* AsKeyword */ || !ts.isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } function keywordForNode(node) { @@ -120100,7 +117222,7 @@ var ts; function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { // class c { method() { } | method2() { } } switch (location.kind) { - case 334 /* SyntaxList */: + case 329 /* SyntaxList */: return ts.tryCast(location.parent, ts.isObjectTypeDeclaration); case 1 /* EndOfFileToken */: var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration); @@ -120203,19 +117325,6 @@ var ts; } return false; } - function isStaticProperty(symbol) { - return !!(symbol.valueDeclaration && ts.getEffectiveModifierFlags(symbol.valueDeclaration) & 32 /* Static */ && ts.isClassLike(symbol.valueDeclaration.parent)); - } - function tryGetObjectLiteralContextualType(node, typeChecker) { - var type = typeChecker.getContextualType(node); - if (type) { - return type; - } - if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 62 /* EqualsToken */) { - return typeChecker.getTypeAtLocation(node.parent); - } - return undefined; - } })(Completions = ts.Completions || (ts.Completions = {})); })(ts || (ts = {})); var ts; @@ -120299,8 +117408,8 @@ var ts; case 132 /* ConstructorKeyword */: return getFromAllDeclarations(ts.isConstructorDeclaration, [132 /* ConstructorKeyword */]); case 134 /* GetKeyword */: - case 146 /* SetKeyword */: - return getFromAllDeclarations(ts.isAccessor, [134 /* GetKeyword */, 146 /* SetKeyword */]); + case 145 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [134 /* GetKeyword */, 145 /* SetKeyword */]); case 130 /* AwaitKeyword */: return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences); case 129 /* AsyncKeyword */: @@ -120348,7 +117457,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 297 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 294 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has @@ -120380,16 +117489,16 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 244 /* SwitchStatement */: - if (statement.kind === 240 /* ContinueStatement */) { + case 241 /* SwitchStatement */: + if (statement.kind === 237 /* ContinueStatement */) { return false; } // falls through - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 236 /* WhileStatement */: - case 235 /* DoStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 233 /* WhileStatement */: + case 232 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. @@ -120405,11 +117514,11 @@ var ts; // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 257 /* ModuleBlock */: - case 297 /* SourceFile */: - case 230 /* Block */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 254 /* ModuleBlock */: + case 294 /* SourceFile */: + case 227 /* Block */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return __spreadArrays(declaration.members, [declaration]); @@ -120417,14 +117526,14 @@ var ts; else { return container.statements; } - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : [])); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 177 /* TypeLiteral */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 176 /* TypeLiteral */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -120438,9 +117547,6 @@ var ts; return __spreadArrays(nodes, [container]); } return nodes; - // Syntactically invalid positions that the parser might produce anyway - case 200 /* ObjectLiteralExpression */: - return undefined; default: ts.Debug.assertNever(container, "Invalid container kind."); } @@ -120460,7 +117566,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 96 /* ForKeyword */, 114 /* WhileKeyword */, 89 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 235 /* DoStatement */) { + if (loopNode.kind === 232 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 114 /* WhileKeyword */)) { @@ -120480,13 +117586,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -120853,39 +117959,41 @@ var ts; if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 249 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 246 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 78 /* Identifier */) { directImports.push(name); break; } } + // Don't support re-exporting 'require()' calls, so just add a single indirect user. + addIndirectUser(direct.getSourceFile()); } break; case 78 /* Identifier */: // for 'const x = require("y"); break; // TODO: GH#23879 - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasSyntacticModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false); break; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: directImports.push(direct); var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 263 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 260 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name, /*isReExport*/ false, /*alreadyAddedDirect*/ true); } else if (!isAvailableThroughGlobal && ts.isDefaultImport(direct)) { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); // Add a check for indirect uses to handle synthetic default imports } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); } - else if (direct.exportClause.kind === 269 /* NamespaceExport */) { + else if (direct.exportClause.kind === 266 /* NamespaceExport */) { // `export * as foo from "foo"` add to indirect uses addIndirectUsers(getSourceFileLikeForImportDeclaration(direct)); } @@ -120894,7 +118002,7 @@ var ts; directImports.push(direct); } break; - case 195 /* ImportType */: + case 192 /* ImportType */: directImports.push(direct); break; default: @@ -120911,7 +118019,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 297 /* SourceFile */ || sourceFileLike.kind === 256 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 294 /* SourceFile */ || sourceFileLike.kind === 253 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -120968,7 +118076,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 260 /* ImportEqualsDeclaration */) { + if (decl.kind === 257 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -120978,7 +118086,7 @@ var ts; handleNamespaceImportLike(decl); return; } - if (decl.kind === 195 /* ImportType */) { + if (decl.kind === 192 /* ImportType */) { if (decl.qualifier) { var firstIdentifier = ts.getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === ts.symbolName(exportSymbol)) { @@ -120994,7 +118102,7 @@ var ts; if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) { return; } - if (decl.kind === 267 /* ExportDeclaration */) { + if (decl.kind === 264 /* ExportDeclaration */) { if (decl.exportClause && ts.isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -121003,10 +118111,10 @@ var ts; var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: // 'default' might be accessed as a named import `{ default as foo }`. if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); @@ -121056,7 +118164,7 @@ var ts; } } else { - var localSymbol = element.kind === 270 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 267 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -121085,7 +118193,7 @@ var ts; for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { var referencingFile = sourceFiles_1[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 297 /* SourceFile */) { + if (searchSourceFile.kind === 294 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -121133,7 +118241,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 297 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 294 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -121148,15 +118256,15 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 267 /* ExportDeclaration */: - case 261 /* ImportDeclaration */: { + case 264 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 260 /* ImportEqualsDeclaration */: { + case 257 /* ImportEqualsDeclaration */: { var decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -121180,7 +118288,7 @@ var ts; var parent = node.parent; var grandParent = parent.parent; if (symbol.exportSymbol) { - if (parent.kind === 201 /* PropertyAccessExpression */) { + if (parent.kind === 198 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent) @@ -121313,17 +118421,15 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return !parent.propertyName; - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return true; - case 198 /* BindingElement */: - return ts.isInJSFile(node) && ts.isRequireVariableDeclaration(parent, /*requireStringLiteralLikeArgument*/ true); default: return false; } @@ -121346,14 +118452,6 @@ var ts; if (ts.isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) { return checker.getExportSpecifierLocalTargetSymbol(declaration); } - else if (ts.isPropertyAccessExpression(declaration) && ts.isModuleExportsAccessExpression(declaration.expression) && !ts.isPrivateIdentifier(declaration.name)) { - return checker.getExportSpecifierLocalTargetSymbol(declaration.name); - } - else if (ts.isShorthandPropertyAssignment(declaration) - && ts.isBinaryExpression(declaration.parent.parent) - && ts.getAssignmentDeclarationKind(declaration.parent.parent) === 2 /* ModuleExports */) { - return checker.getExportSpecifierLocalTargetSymbol(declaration.name); - } } } return symbol; @@ -121362,21 +118460,21 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 297 /* SourceFile */) { + if (parent.kind === 294 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 257 /* ModuleBlock */); + ts.Debug.assert(parent.kind === 254 /* ModuleBlock */); return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; + return node.kind === 253 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 272 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; + return eq.moduleReference.kind === 269 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -121478,7 +118576,7 @@ var ts; if (!node) return undefined; switch (node.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return !ts.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : ts.isVariableStatement(node.parent.parent) ? @@ -121486,28 +118584,28 @@ var ts; ts.isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getContextNode(node.parent.parent); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return node.parent.parent.parent; - case 270 /* ExportSpecifier */: - case 263 /* NamespaceImport */: + case 267 /* ExportSpecifier */: + case 260 /* NamespaceImport */: return node.parent.parent; - case 262 /* ImportClause */: - case 269 /* NamespaceExport */: + case 259 /* ImportClause */: + case 266 /* NamespaceExport */: return node.parent; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return ts.isExpressionStatement(node.parent) ? node.parent : node; - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(ts.findAncestor(node.parent, function (node) { return ts.isBinaryExpression(node) || ts.isForInOrOfStatement(node); @@ -121564,9 +118662,9 @@ var ts; var node = ts.getTouchingPropertyName(sourceFile, position); var referenceEntries; var entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); - if (node.parent.kind === 201 /* PropertyAccessExpression */ - || node.parent.kind === 198 /* BindingElement */ - || node.parent.kind === 202 /* ElementAccessExpression */ + if (node.parent.kind === 198 /* PropertyAccessExpression */ + || node.parent.kind === 195 /* BindingElement */ + || node.parent.kind === 199 /* ElementAccessExpression */ || node.kind === 105 /* SuperKeyword */) { referenceEntries = entries && __spreadArrays(entries); } @@ -121590,13 +118688,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 286 /* ShorthandPropertyAssignment */) { var result_1 = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); }); return result_1; @@ -121762,13 +118860,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 200 /* ObjectLiteralExpression */) { + else if (node.kind === 197 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(21 /* CloseParenToken */)] }; } - else if (node.kind === 221 /* ClassExpression */) { + else if (node.kind === 218 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(21 /* CloseParenToken */)] @@ -121829,47 +118927,47 @@ var ts; if (!!(decl.flags & 8388608 /* Ambient */)) return true; switch (decl.kind) { - case 216 /* BinaryExpression */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 213 /* BinaryExpression */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: case 87 /* DefaultKeyword */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 270 /* ExportSpecifier */: - case 262 /* ImportClause */: // default import - case 260 /* ImportEqualsDeclaration */: - case 265 /* ImportSpecifier */: - case 253 /* InterfaceDeclaration */: - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 280 /* JsxAttribute */: - case 256 /* ModuleDeclaration */: - case 259 /* NamespaceExportDeclaration */: - case 263 /* NamespaceImport */: - case 269 /* NamespaceExport */: - case 160 /* Parameter */: - case 289 /* ShorthandPropertyAssignment */: - case 254 /* TypeAliasDeclaration */: - case 159 /* TypeParameter */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 267 /* ExportSpecifier */: + case 259 /* ImportClause */: // default import + case 257 /* ImportEqualsDeclaration */: + case 262 /* ImportSpecifier */: + case 250 /* InterfaceDeclaration */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 277 /* JsxAttribute */: + case 253 /* ModuleDeclaration */: + case 256 /* NamespaceExportDeclaration */: + case 260 /* NamespaceImport */: + case 266 /* NamespaceExport */: + case 159 /* Parameter */: + case 286 /* ShorthandPropertyAssignment */: + case 251 /* TypeAliasDeclaration */: + case 158 /* TypeParameter */: return true; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.) return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return !!decl.body; - case 249 /* VariableDeclaration */: - case 163 /* PropertyDeclaration */: + case 246 /* VariableDeclaration */: + case 162 /* PropertyDeclaration */: return !!decl.initializer || ts.isCatchClause(decl.parent); - case 164 /* MethodSignature */: - case 162 /* PropertySignature */: - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: + case 163 /* MethodSignature */: + case 161 /* PropertySignature */: + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: return false; default: return ts.Debug.failBadSyntaxKind(decl); @@ -122030,10 +119128,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -122062,9 +119160,9 @@ var ts; } /** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */ function isReadonlyTypeOperator(node) { - return node.kind === 142 /* ReadonlyKeyword */ + return node.kind === 141 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(node.parent) - && node.parent.operator === 142 /* ReadonlyKeyword */; + && node.parent.operator === 141 /* ReadonlyKeyword */; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -122075,12 +119173,12 @@ var ts; } // A modifier readonly (like on a property declaration) is not special; // a readonly type keyword (like `readonly string[]`) is. - if (node.kind === 142 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { + if (node.kind === 141 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { return undefined; } // Likewise, when we *are* looking for a special keyword, make sure we // *don’t* include readonly member modifiers. - return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 142 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 141 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); } // Labels if (ts.isJumpStatementTarget(node)) { @@ -122381,7 +119479,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 208 /* FunctionExpression */ || valueDeclaration.kind === 221 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 205 /* FunctionExpression */ || valueDeclaration.kind === 218 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -122391,7 +119489,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasEffectiveModifier(d, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(d); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 252 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 249 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -122420,7 +119518,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 297 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 294 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -122792,14 +119890,14 @@ var ts; for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var ctrKeyword = ts.findChildOfKind(decl, 132 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 166 /* Constructor */ && !!ctrKeyword); + ts.Debug.assert(decl.kind === 165 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 165 /* MethodDeclaration */) { + if (decl && decl.kind === 164 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 107 /* ThisKeyword */, function (thisKeyword) { @@ -122823,7 +119921,7 @@ var ts; } for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 166 /* Constructor */); + ts.Debug.assert(decl.kind === 165 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 105 /* SuperKeyword */, function (node) { @@ -122853,7 +119951,7 @@ var ts; if (refNode.kind !== 78 /* Identifier */) { return; } - if (refNode.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 286 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -122873,7 +119971,7 @@ var ts; } else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) { var body = typeHavingNode.body; - if (body.kind === 230 /* Block */) { + if (body.kind === 227 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -122901,13 +119999,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: - case 200 /* ObjectLiteralExpression */: - case 221 /* ClassExpression */: - case 199 /* ArrayLiteralExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 197 /* ObjectLiteralExpression */: + case 218 /* ClassExpression */: + case 196 /* ArrayLiteralExpression */: return true; default: return false; @@ -122960,13 +120058,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: staticFlag &= ts.getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -122987,41 +120085,41 @@ var ts; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } function isParameterName(node) { - return node.kind === 78 /* Identifier */ && node.parent.kind === 160 /* Parameter */ && node.parent.name === node; + return node.kind === 78 /* Identifier */ && node.parent.kind === 159 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: staticFlag &= ts.getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return undefined; } - var references = ts.flatMap(searchSpaceNode.kind === 297 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { + var references = ts.flatMap(searchSpaceNode.kind === 294 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) { if (!ts.isThis(node)) { @@ -123029,19 +120127,19 @@ var ts; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getSyntacticModifierFlags(container) & 32 /* Static */) === staticFlag; - case 297 /* SourceFile */: - return container.kind === 297 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); + case 294 /* SourceFile */: + return container.kind === 294 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return nodeEntry(n); }); @@ -123140,7 +120238,7 @@ var ts; ts.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); // is [parameter, property] return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - var exportSpecifier = ts.getDeclarationOfKind(symbol, 270 /* ExportSpecifier */); + var exportSpecifier = ts.getDeclarationOfKind(symbol, 267 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -123185,7 +120283,7 @@ var ts; }); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { - var bindingElement = ts.getDeclarationOfKind(symbol, 198 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 195 /* BindingElement */); if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { return ts.getPropertySymbolFromBindingElement(checker, bindingElement); } @@ -123412,16 +120510,16 @@ var ts; return; } switch (node.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: - if (node.parent.kind === 200 /* ObjectLiteralExpression */) { + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: + if (node.parent.kind === 197 /* ObjectLiteralExpression */) { return (_a = ts.getAssignedName(node.parent)) === null || _a === void 0 ? void 0 : _a.getText(); } return (_b = ts.getNameOfDeclaration(node.parent)) === null || _b === void 0 ? void 0 : _b.getText(); - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: if (ts.isModuleBlock(node.parent) && ts.isIdentifier(node.parent.parent.name)) { return node.parent.parent.name.getText(); } @@ -123627,55 +120725,55 @@ var ts; } switch (node.kind) { case 78 /* Identifier */: - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: // do not descend into nodes that cannot contain callable nodes return; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: // do not descend into the type side of an assertion collect(node.expression); return; - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: // do not descend into the type of a variable or parameter declaration collect(node.name); collect(node.initializer); return; - case 203 /* CallExpression */: + case 200 /* CallExpression */: // do not descend into the type arguments of a call expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 204 /* NewExpression */: + case 201 /* NewExpression */: // do not descend into the type arguments of a new expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: // do not descend into the type arguments of a tagged template expression recordCallSite(node); collect(node.tag); collect(node.template); return; - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: // do not descend into the type arguments of a JsxOpeningLikeElement recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 161 /* Decorator */: + case 160 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: recordCallSite(node); ts.forEachChild(node, collect); break; @@ -123725,22 +120823,22 @@ var ts; var callSites = []; var collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; default: @@ -124021,7 +121119,9 @@ var ts; var sigInfo = createDefinitionFromSignatureDeclaration(typeChecker, calledDeclaration); // For a function, if this is the original function definition, return just sigInfo. // If this is the original constructor definition, parent is the class. - if (typeChecker.getRootSymbols(symbol).some(function (s) { return symbolMatchesSignature(s, calledDeclaration); })) { + if (typeChecker.getRootSymbols(symbol).some(function (s) { return symbolMatchesSignature(s, calledDeclaration); }) || + // TODO: GH#25533 Following check shouldn't be necessary if 'require' is an alias + symbol.declarations && symbol.declarations.some(function (d) { return ts.isVariableDeclaration(d) && !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ false); })) { return [sigInfo]; } else { @@ -124035,7 +121135,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 286 /* ShorthandPropertyAssignment */) { var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : []; } @@ -124080,11 +121180,6 @@ var ts; return getDefinitionFromSymbol(typeChecker, symbol, node); } GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition; - function isShorthandPropertyAssignmentOfModuleExports(symbol) { - var shorthandProperty = ts.tryCast(symbol.valueDeclaration, ts.isShorthandPropertyAssignment); - var binaryExpression = ts.tryCast(shorthandProperty === null || shorthandProperty === void 0 ? void 0 : shorthandProperty.parent.parent, ts.isAssignmentExpression); - return !!binaryExpression && ts.getAssignmentDeclarationKind(binaryExpression) === 2 /* ModuleExports */; - } /** * True if we should not add definitions for both the signature symbol and the definition symbol. * True for `const |f = |() => 0`, false for `function |f() {} const |g = f;`. @@ -124182,24 +121277,19 @@ var ts; // get the aliased symbol instead. This allows for goto def on an import e.g. // import {A, B} from "mod"; // to jump to the implementation directly. - while (symbol) { - if (symbol.flags & 2097152 /* Alias */ && shouldSkipAlias(node, symbol.declarations[0])) { - var aliased = checker.getAliasedSymbol(symbol); - if (!aliased.declarations) { - break; - } - symbol = aliased; + if (symbol && symbol.flags & 2097152 /* Alias */ && shouldSkipAlias(node, symbol.declarations[0])) { + var aliased = checker.getAliasedSymbol(symbol); + if (aliased.declarations) { + return aliased; } - else if (isShorthandPropertyAssignmentOfModuleExports(symbol)) { - // Skip past `module.exports = { Foo }` even though 'Foo' is not a real alias - var shorthandTarget = checker.resolveName(symbol.name, symbol.valueDeclaration, 111551 /* Value */, /*excludeGlobals*/ false); - if (!ts.some(shorthandTarget === null || shorthandTarget === void 0 ? void 0 : shorthandTarget.declarations)) { - break; + } + if (symbol && ts.isInJSFile(node)) { + var requireCall = ts.forEach(symbol.declarations, function (d) { return ts.isVariableDeclaration(d) && !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true) ? d.initializer : undefined; }); + if (requireCall) { + var moduleSymbol = checker.getSymbolAtLocation(requireCall.arguments[0]); + if (moduleSymbol) { + return checker.resolveExternalModuleSymbol(moduleSymbol); } - symbol = shorthandTarget; - } - else { - break; } } return symbol; @@ -124217,14 +121307,11 @@ var ts; return true; } switch (declaration.kind) { - case 262 /* ImportClause */: - case 260 /* ImportEqualsDeclaration */: + case 259 /* ImportClause */: + case 257 /* ImportEqualsDeclaration */: return true; - case 265 /* ImportSpecifier */: - return declaration.parent.kind === 264 /* NamedImports */; - case 198 /* BindingElement */: - case 249 /* VariableDeclaration */: - return ts.isInJSFile(declaration) && ts.isRequireVariableDeclaration(declaration, /*requireStringLiteralLikeArgument*/ true); + case 262 /* ImportSpecifier */: + return declaration.parent.kind === 261 /* NamedImports */; default: return false; } @@ -124309,9 +121396,9 @@ var ts; } function isConstructorLike(node) { switch (node.kind) { - case 166 /* Constructor */: - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 165 /* Constructor */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: return true; default: return false; @@ -124426,11 +121513,11 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return [declaration]; - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: return [declaration, declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -124451,19 +121538,18 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return withNode(tag.class); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return withNode(tag.class); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 329 /* JSDocTypeTag */: + case 325 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: - case 332 /* JSDocSeeTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -124485,7 +121571,7 @@ var ts; name: tagName, kind: "keyword" /* keyword */, kindModifiers: "", - sortText: ts.Completions.SortText.LocationPriority, + sortText: "0", }; })); } @@ -124497,7 +121583,7 @@ var ts; name: "@" + tagName, kind: "keyword" /* keyword */, kindModifiers: "", - sortText: ts.Completions.SortText.LocationPriority + sortText: "0" }; })); } @@ -124531,7 +121617,7 @@ var ts; || nameThusFar !== undefined && !ts.startsWith(name, nameThusFar)) { return undefined; } - return { name: name, kind: "parameter" /* parameterElement */, kindModifiers: "", sortText: ts.Completions.SortText.LocationPriority }; + return { name: name, kind: "parameter" /* parameterElement */, kindModifiers: "", sortText: "0" }; }); } JsDoc.getJSDocParameterNameCompletions = getJSDocParameterNameCompletions; @@ -124632,24 +121718,23 @@ var ts; } function getCommentOwnerInfoWorker(commentOwner) { switch (commentOwner.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 164 /* MethodSignature */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 163 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer); - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 162 /* PropertySignature */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 254 /* TypeAliasDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 161 /* PropertySignature */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 251 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 232 /* VariableStatement */: { + case 229 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -124657,16 +121742,16 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 297 /* SourceFile */: + case 294 /* SourceFile */: return "quit"; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 256 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 233 /* ExpressionStatement */: + return commentOwner.parent.kind === 253 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 230 /* ExpressionStatement */: return getCommentOwnerInfoWorker(commentOwner.expression); - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var be = commentOwner; if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; @@ -124674,7 +121759,7 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: var init = commentOwner.initializer; if (init && (ts.isFunctionExpression(init) || ts.isArrowFunction(init))) { return { commentOwner: commentOwner, parameters: init.parameters }; @@ -124690,14 +121775,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 207 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 204 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return rightHandSide.parameters; - case 221 /* ClassExpression */: { + case 218 /* ClassExpression */: { var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration); return ctr ? ctr.parameters : ts.emptyArray; } @@ -124759,9 +121844,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 262 /* ImportClause */: - case 265 /* ImportSpecifier */: - case 260 /* ImportEqualsDeclaration */: + case 259 /* ImportClause */: + case 262 /* ImportSpecifier */: + case 257 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217 var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -124771,7 +121856,7 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { var name = ts.getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 158 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 157 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } // Only added the names of computed properties if they're simple dotted expressions, like: // @@ -124788,7 +121873,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name && name.kind === 158 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 157 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return ts.emptyArray; } // Don't include the last portion. @@ -124996,7 +122081,7 @@ var ts; return; } switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -125008,21 +122093,21 @@ var ts; } } break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 163 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -125034,7 +122119,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 263 /* NamespaceImport */) { + if (namedBindings.kind === 260 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -125045,17 +122130,17 @@ var ts; } } break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: var expression = node.expression; // Use the expression as the name of the SpreadAssignment, otherwise show as . ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 198 /* BindingElement */: - case 288 /* PropertyAssignment */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 285 /* PropertyAssignment */: + case 246 /* VariableDeclaration */: var _e = node, name = _e.name, initializer = _e.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -125070,7 +122155,7 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: var nameNode = node.name; // If we see a function declaration track as a possible ES5 class if (nameNode && ts.isIdentifier(nameNode)) { @@ -125078,11 +122163,11 @@ var ts; } addNodeWithRecursiveChild(node, node.body); break; - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -125092,9 +122177,9 @@ var ts; } endNode(); break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: startNode(node); for (var _h = 0, _j = node.members; _h < _j.length; _h++) { var member = _j[_h]; @@ -125102,12 +122187,12 @@ var ts; } endNode(); break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { var expression_1 = node.expression; - var child = ts.isObjectLiteralExpression(expression_1) || ts.isCallExpression(expression_1) ? expression_1 : + var child = ts.isObjectLiteralExpression(expression_1) ? expression_1 : ts.isArrowFunction(expression_1) || ts.isFunctionExpression(expression_1) ? expression_1.body : undefined; if (child) { startNode(node); @@ -125119,16 +122204,16 @@ var ts; } break; } - case 270 /* ExportSpecifier */: - case 260 /* ImportEqualsDeclaration */: - case 171 /* IndexSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 254 /* TypeAliasDeclaration */: + case 267 /* ExportSpecifier */: + case 257 /* ImportEqualsDeclaration */: + case 170 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 251 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 203 /* CallExpression */: - case 216 /* BinaryExpression */: { + case 200 /* CallExpression */: + case 213 /* BinaryExpression */: { var special = ts.getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -125370,12 +122455,12 @@ var ts; return false; } switch (a.kind) { - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return ts.hasSyntacticModifier(a, 32 /* Static */) === ts.hasSyntacticModifier(b, 32 /* Static */); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -125391,7 +122476,7 @@ var ts; // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { // TODO: GH#18217 - return a.body.kind === b.body.kind && (a.body.kind !== 256 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 253 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -125421,7 +122506,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 256 /* ModuleDeclaration */) { + if (node.kind === 253 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -125430,16 +122515,16 @@ var ts; return propertyName && ts.unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 221 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 218 /* ClassExpression */: return getFunctionOrClassName(node); default: return undefined; } } function getItemName(node, name) { - if (node.kind === 256 /* ModuleDeclaration */) { + if (node.kind === 253 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -125451,18 +122536,18 @@ var ts; } } switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 209 /* ArrowFunction */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: if (ts.getSyntacticModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -125470,13 +122555,13 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return "constructor"; - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return "new()"; - case 169 /* CallSignature */: + case 168 /* CallSignature */: return "()"; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return "[]"; default: return ""; @@ -125509,19 +122594,19 @@ var ts; } // Some nodes are otherwise important enough to always include in the primary navigation menu. switch (navigationBarNodeKind(item)) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 255 /* EnumDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 297 /* SourceFile */: - case 254 /* TypeAliasDeclaration */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 252 /* EnumDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 294 /* SourceFile */: + case 251 /* TypeAliasDeclaration */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: return true; - case 209 /* ArrowFunction */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -125531,10 +122616,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 257 /* ModuleBlock */: - case 297 /* SourceFile */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: + case 254 /* ModuleBlock */: + case 294 /* SourceFile */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: return true; default: return false; @@ -125592,8 +122677,9 @@ var ts; return ts.getTextOfNode(moduleDeclaration.name); } // Otherwise, we need to aggregate each identifier to build up the qualified name. - var result = [ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)]; - while (moduleDeclaration.body && moduleDeclaration.body.kind === 256 /* ModuleDeclaration */) { + var result = []; + result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); + while (moduleDeclaration.body && moduleDeclaration.body.kind === 253 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -125607,13 +122693,13 @@ var ts; return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 158 /* ComputedPropertyName */; + return !member.name || member.name.kind === 157 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 297 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 294 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 249 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 246 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -125671,9 +122757,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: return true; default: return false; @@ -126027,11 +123113,11 @@ var ts; function getModuleSpecifierExpression(declaration) { var _a; switch (declaration.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return (_a = ts.tryCast(declaration.moduleReference, ts.isExternalModuleReference)) === null || _a === void 0 ? void 0 : _a.expression; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return declaration.moduleSpecifier; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return declaration.declarationList.declarations[0].initializer.arguments[0]; } } @@ -126070,19 +123156,19 @@ var ts; function getImportKindOrder(s1) { var _a; switch (s1.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: if (!s1.importClause) return 0; if (s1.importClause.isTypeOnly) return 1; - if (((_a = s1.importClause.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 263 /* NamespaceImport */) + if (((_a = s1.importClause.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 260 /* NamespaceImport */) return 2; if (s1.importClause.name) return 3; return 4; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return 5; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return 6; } } @@ -126128,9 +123214,12 @@ var ts; if (depthRemaining === 0) return; cancellationToken.throwIfCancellationRequested(); - if (ts.isDeclaration(n) || ts.isVariableStatement(n) || n.kind === 1 /* EndOfFileToken */) { + if (ts.isDeclaration(n) || n.kind === 1 /* EndOfFileToken */) { addOutliningForLeadingCommentsForNode(n, sourceFile, cancellationToken, out); } + if (isFunctionExpressionAssignedToVariable(n)) { + addOutliningForLeadingCommentsForNode(n.parent.parent.parent, sourceFile, cancellationToken, out); + } if (ts.isFunctionLike(n) && ts.isBinaryExpression(n.parent) && ts.isPropertyAccessExpression(n.parent.left)) { addOutliningForLeadingCommentsForNode(n.parent.left, sourceFile, cancellationToken, out); } @@ -126158,6 +123247,13 @@ var ts; } depthRemaining++; } + function isFunctionExpressionAssignedToVariable(n) { + if (!ts.isFunctionExpression(n) && !ts.isArrowFunction(n)) { + return false; + } + var ancestor = ts.findAncestor(n, ts.isVariableStatement); + return !!ancestor && ts.getSingleInitializerOfVariableStatementOrPropertyDeclaration(ancestor) === n; + } } function addRegionOutliningSpans(sourceFile, out) { var regions = []; @@ -126238,7 +123334,7 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 230 /* Block */: + case 227 /* Block */: if (ts.isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } @@ -126246,16 +123342,16 @@ var ts; // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 235 /* DoStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 237 /* ForStatement */: - case 234 /* IfStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 287 /* CatchClause */: + case 232 /* DoStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 234 /* ForStatement */: + case 231 /* IfStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 284 /* CatchClause */: return spanForNode(n.parent); - case 247 /* TryStatement */: + case 244 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -126272,40 +123368,40 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return spanForNode(n.parent); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 258 /* CaseBlock */: - case 177 /* TypeLiteral */: - case 196 /* ObjectBindingPattern */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 255 /* CaseBlock */: + case 176 /* TypeLiteral */: + case 193 /* ObjectBindingPattern */: return spanForNode(n); - case 179 /* TupleType */: + case 178 /* TupleType */: return spanForNode(n, /*autoCollapse*/ false, /*useFullStart*/ !ts.isTupleTypeNode(n.parent), 22 /* OpenBracketToken */); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: return spanForNodeArray(n.statements); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return spanForJSXElement(n); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return spanForJSXFragment(n); - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return spanForNode(n, /*autoCollapse*/ false, /*useFullStart*/ !ts.isBindingElement(n.parent), 22 /* OpenBracketToken */); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return spanForArrowFunction(n); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return spanForCallExpression(n); } function spanForCallExpression(node) { @@ -126372,7 +123468,7 @@ var ts; function functionSpan(node, body, sourceFile) { var openToken = tryGetFunctionOpenToken(node, body, sourceFile); var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile); - return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 209 /* ArrowFunction */); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 206 /* ArrowFunction */); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -126919,7 +124015,7 @@ var ts; if (token === 133 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 139 /* ModuleKeyword */) { + if (token === 138 /* ModuleKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { recordAmbientExternalModule(); @@ -126953,10 +124049,10 @@ var ts; return true; } else { - if (token === 149 /* TypeKeyword */) { + if (token === 148 /* TypeKeyword */) { var skipTypeKeyword = ts.scanner.lookAhead(function () { var token = ts.scanner.scan(); - return token !== 153 /* FromKeyword */ && (token === 41 /* AsteriskToken */ || + return token !== 152 /* FromKeyword */ && (token === 41 /* AsteriskToken */ || token === 18 /* OpenBraceToken */ || token === 78 /* Identifier */ || ts.isKeyword(token)); @@ -126967,7 +124063,7 @@ var ts; } if (token === 78 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import d from "mod"; @@ -126998,7 +124094,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import {a as A} from "mod"; @@ -127014,7 +124110,7 @@ var ts; token = nextToken(); if (token === 78 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import * as NS from "mod" @@ -127035,7 +124131,7 @@ var ts; if (token === 92 /* ExportKeyword */) { markAsExternalModuleIfTopLevel(); token = nextToken(); - if (token === 149 /* TypeKeyword */) { + if (token === 148 /* TypeKeyword */) { var skipTypeKeyword = ts.scanner.lookAhead(function () { var token = ts.scanner.scan(); return token === 41 /* AsteriskToken */ || @@ -127054,7 +124150,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export {a as A} from "mod"; @@ -127066,7 +124162,7 @@ var ts; } else if (token === 41 /* AsteriskToken */) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export * from "mod" @@ -127076,7 +124172,7 @@ var ts; } else if (token === 99 /* ImportKeyword */) { token = nextToken(); - if (token === 149 /* TypeKeyword */) { + if (token === 148 /* TypeKeyword */) { var skipTypeKeyword = ts.scanner.lookAhead(function () { var token = ts.scanner.scan(); return token === 78 /* Identifier */ || @@ -127102,7 +124198,7 @@ var ts; function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) { if (allowTemplateLiterals === void 0) { allowTemplateLiterals = false; } var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 143 /* RequireKeyword */) { + if (token === 142 /* RequireKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); @@ -127245,13 +124341,8 @@ var ts; Rename.getRenameInfo = getRenameInfo; function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile, options) { var symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { - if (ts.isLabelName(node)) { - var name = ts.getTextOfNode(node); - return getRenameInfoSuccess(name, name, "label" /* label */, "" /* none */, node, sourceFile); - } - return undefined; - } + if (!symbol) + return; // Only allow a symbol to be renamed if it actually has at least one declaration. var declarations = symbol.declarations; if (!declarations || declarations.length === 0) @@ -127268,7 +124359,7 @@ var ts; return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 158 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 157 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -127344,7 +124435,6 @@ var ts; var SmartSelectionRange; (function (SmartSelectionRange) { function getSmartSelectionRange(pos, sourceFile) { - var _a; var selectionRange = { textSpan: ts.createTextSpanFromBounds(sourceFile.getFullStart(), sourceFile.getEnd()) }; @@ -127357,7 +124447,7 @@ var ts; var prevNode = children[i - 1]; var node = children[i]; var nextNode = children[i + 1]; - if (ts.getTokenPosOfNode(node, sourceFile, /*includeJsDoc*/ true) > pos) { + if (node.getStart(sourceFile) > pos) { break outer; } if (positionShouldSnapToNode(sourceFile, pos, node)) { @@ -127366,14 +124456,14 @@ var ts; // of things that should be considered independently. // 3. A VariableStatement’s children are just a VaraiableDeclarationList and a semicolon. // 4. A lone VariableDeclaration in a VaraibleDeclaration feels redundant with the VariableStatement. + // // Dive in without pushing a selection range. if (ts.isBlock(node) || ts.isTemplateSpan(node) || ts.isTemplateHead(node) || ts.isTemplateTail(node) || prevNode && ts.isTemplateHead(prevNode) || ts.isVariableDeclarationList(node) && ts.isVariableStatement(parentNode) || ts.isSyntaxList(node) && ts.isVariableDeclarationList(parentNode) - || ts.isVariableDeclaration(node) && ts.isSyntaxList(parentNode) && children.length === 1 - || ts.isJSDocTypeExpression(node) || ts.isJSDocSignature(node) || ts.isJSDocTypeLiteral(node)) { + || ts.isVariableDeclaration(node) && ts.isSyntaxList(parentNode) && children.length === 1) { parentNode = node; break; } @@ -127385,12 +124475,15 @@ var ts; } // Blocks with braces, brackets, parens, or JSX tags on separate lines should be // selected from open to close, including whitespace but not including the braces/etc. themselves. - var isBetweenMultiLineBookends = ts.isSyntaxList(node) && isListOpener(prevNode) && isListCloser(nextNode) + var isBetweenMultiLineBookends = ts.isSyntaxList(node) + && isListOpener(prevNode) + && isListCloser(nextNode) && !ts.positionsAreOnSameLine(prevNode.getStart(), nextNode.getStart(), sourceFile); + var jsDocCommentStart = ts.hasJSDocNodes(node) && node.jsDoc[0].getStart(); var start = isBetweenMultiLineBookends ? prevNode.getEnd() : node.getStart(); - var end = isBetweenMultiLineBookends ? nextNode.getStart() : getEndPos(sourceFile, node); - if (ts.hasJSDocNodes(node) && ((_a = node.jsDoc) === null || _a === void 0 ? void 0 : _a.length)) { - pushSelectionRange(ts.first(node.jsDoc).getStart(), end); + var end = isBetweenMultiLineBookends ? nextNode.getStart() : node.getEnd(); + if (ts.isNumber(jsDocCommentStart)) { + pushSelectionRange(jsDocCommentStart, end); } pushSelectionRange(start, end); // String literals should have a stop both inside and outside their quotes. @@ -127478,14 +124571,14 @@ var ts; ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */); // Group `-/+readonly` and `-/+?` var groupedWithPlusMinusTokens = groupChildren(children, function (child) { - return child === node.readonlyToken || child.kind === 142 /* ReadonlyKeyword */ || + return child === node.readonlyToken || child.kind === 141 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */; }); // Group type parameter with surrounding brackets var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) { var kind = _a.kind; return kind === 22 /* OpenBracketToken */ || - kind === 159 /* TypeParameter */ || + kind === 158 /* TypeParameter */ || kind === 23 /* CloseBracketToken */; }); return [ @@ -127599,26 +124692,14 @@ var ts; return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ - || kind === 275 /* JsxOpeningElement */; + || kind === 272 /* JsxOpeningElement */; } function isListCloser(token) { var kind = token && token.kind; return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ - || kind === 276 /* JsxClosingElement */; - } - function getEndPos(sourceFile, node) { - switch (node.kind) { - case 326 /* JSDocParameterTag */: - case 324 /* JSDocCallbackTag */: - case 333 /* JSDocPropertyTag */: - case 331 /* JSDocTypedefTag */: - case 328 /* JSDocThisTag */: - return sourceFile.getLineEndOfPosition(node.getStart()); - default: - return node.getEnd(); - } + || kind === 273 /* JsxClosingElement */; } })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {})); })(ts || (ts = {})); @@ -127824,10 +124905,10 @@ var ts; } return undefined; } - else if (ts.isTemplateHead(node) && parent.parent.kind === 205 /* TaggedTemplateExpression */) { + else if (ts.isTemplateHead(node) && parent.parent.kind === 202 /* TaggedTemplateExpression */) { var templateExpression = parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 218 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 215 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } @@ -127896,17 +124977,17 @@ var ts; return undefined; var parent = startingToken.parent; switch (parent.kind) { - case 207 /* ParenthesizedExpression */: - case 165 /* MethodDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 204 /* ParenthesizedExpression */: + case 164 /* MethodDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: var info = getArgumentOrParameterListInfo(startingToken, sourceFile); if (!info) return undefined; var argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan; var contextualType = ts.isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent); return contextualType && { contextualType: contextualType, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan }; - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var highestBinary = getHighestBinary(parent); var contextualType_1 = checker.getContextualType(highestBinary); var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1; @@ -128030,7 +125111,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 218 /* TemplateExpression */) { + if (template.kind === 215 /* TemplateExpression */) { var lastSpan = ts.last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -128382,7 +125463,7 @@ var ts; return diags.sort(function (d1, d2) { return d1.start - d2.start; }); function check(node) { if (isJsFile) { - if (canBeConvertedToClass(node, checker)) { + if (canBeConvertedToClass(node)) { diags.push(ts.createDiagnosticForNode(ts.isVariableDeclaration(node.parent) ? node.parent.name : node, ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration)); } } @@ -128411,11 +125492,11 @@ var ts; function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some(function (statement) { switch (statement.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return statement.declarationList.declarations.some(function (decl) { return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true); }); - case 233 /* ExpressionStatement */: { + case 230 /* ExpressionStatement */: { var expression = statement.expression; if (!ts.isBinaryExpression(expression)) return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true); @@ -128432,12 +125513,12 @@ var ts; } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 263 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 260 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : undefined; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node.name; default: return undefined; @@ -128506,9 +125587,9 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 103 /* NullKeyword */: @@ -128521,16 +125602,17 @@ var ts; function getKeyFromNode(exp) { return exp.pos.toString() + ":" + exp.end.toString(); } - function canBeConvertedToClass(node, checker) { + function canBeConvertedToClass(node) { var _a, _b, _c, _d; - if (node.kind === 208 /* FunctionExpression */) { + if (node.kind === 205 /* FunctionExpression */) { if (ts.isVariableDeclaration(node.parent) && ((_a = node.symbol.members) === null || _a === void 0 ? void 0 : _a.size)) { return true; } - var symbol = checker.getSymbolOfExpando(node, /*allowDeclaration*/ false); + var decl = ts.getDeclarationOfExpando(node); + var symbol = decl === null || decl === void 0 ? void 0 : decl.symbol; return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size))); } - if (node.kind === 251 /* FunctionDeclaration */) { + if (node.kind === 248 /* FunctionDeclaration */) { return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size); } return false; @@ -128550,7 +125632,7 @@ var ts; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 221 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 218 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -128636,11 +125718,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 275 /* JsxOpeningElement */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: return location.kind === 78 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -128684,7 +125766,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 201 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 198 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -128704,7 +125786,7 @@ var ts; } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217 - var useConstructSignatures = callExpressionLike.kind === 204 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 105 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 201 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 105 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -128760,7 +125842,7 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 132 /* ConstructorKeyword */ && location.parent.kind === 166 /* Constructor */)) { // At constructor keyword of constructor declaration + (location.kind === 132 /* ConstructorKeyword */ && location.parent.kind === 165 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration @@ -128768,21 +125850,21 @@ var ts; return declaration === (location.kind === 132 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 166 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 165 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); // TODO: GH#18217 } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 166 /* Constructor */) { + if (functionDeclaration_1.kind === 165 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 169 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 168 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -128793,7 +125875,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 221 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 218 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -128816,7 +125898,7 @@ var ts; } if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(149 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(148 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -128837,9 +125919,9 @@ var ts; } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 256 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 253 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 78 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 140 /* NamespaceKeyword */ : 139 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 139 /* NamespaceKeyword */ : 138 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -128858,7 +125940,7 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 159 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 158 /* TypeParameter */); if (decl === undefined) return ts.Debug.fail(); var declaration = decl.parent; @@ -128866,21 +125948,21 @@ var ts; if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217 - if (declaration.kind === 170 /* ConstructSignature */) { + if (declaration.kind === 169 /* ConstructSignature */) { displayParts.push(ts.keywordPart(102 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 169 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 168 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 254 /* TypeAliasDeclaration */) { + else if (declaration.kind === 251 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(149 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(148 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -128892,7 +125974,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 291 /* EnumMember */) { + if (declaration.kind === 288 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -128923,17 +126005,17 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(92 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(140 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(139 /* NamespaceKeyword */)); break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: displayParts.push(ts.keywordPart(92 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 62 /* EqualsToken */ : 87 /* DefaultKeyword */)); break; - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: displayParts.push(ts.keywordPart(92 /* ExportKeyword */)); break; default: @@ -128942,13 +126024,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 260 /* ImportEqualsDeclaration */) { + if (declaration.kind === 257 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(62 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(143 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(142 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(20 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(21 /* CloseParenToken */)); @@ -129029,10 +126111,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 297 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 294 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 216 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 213 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -129150,16 +126232,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 208 /* FunctionExpression */) { + if (declaration.kind === 205 /* FunctionExpression */) { return true; } - if (declaration.kind !== 249 /* VariableDeclaration */ && declaration.kind !== 251 /* FunctionDeclaration */) { + if (declaration.kind !== 246 /* VariableDeclaration */ && declaration.kind !== 248 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 297 /* SourceFile */ || parent.kind === 257 /* ModuleBlock */) { + if (parent.kind === 294 /* SourceFile */ || parent.kind === 254 /* ModuleBlock */) { return false; } } @@ -129460,10 +126542,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 280 /* JsxAttribute */: - case 275 /* JsxOpeningElement */: - case 276 /* JsxClosingElement */: - case 274 /* JsxSelfClosingElement */: + case 277 /* JsxAttribute */: + case 272 /* JsxOpeningElement */: + case 273 /* JsxClosingElement */: + case 271 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 78 /* Identifier */; } @@ -129664,7 +126746,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 156 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 155 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -129679,9 +126761,9 @@ var ts; var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */])); var anyTokenIncludingEOF = tokenRangeFrom(__spreadArrays(allTokens, [1 /* EndOfFileToken */])); - var keywords = tokenRangeFromRange(80 /* FirstKeyword */, 156 /* LastKeyword */); + var keywords = tokenRangeFromRange(80 /* FirstKeyword */, 155 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 77 /* LastBinaryOperator */); - var binaryKeywordOperators = [100 /* InKeyword */, 101 /* InstanceOfKeyword */, 156 /* OfKeyword */, 126 /* AsKeyword */, 137 /* IsKeyword */]; + var binaryKeywordOperators = [100 /* InKeyword */, 101 /* InstanceOfKeyword */, 155 /* OfKeyword */, 126 /* AsKeyword */, 136 /* IsKeyword */]; var unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 78 /* Identifier */, 20 /* OpenParenToken */, @@ -129755,7 +126837,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [134 /* GetKeyword */, 146 /* SetKeyword */], 78 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), + rule("SpaceAfterGetSetInMember", [134 /* GetKeyword */, 145 /* SetKeyword */], 78 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), rule("NoSpaceBetweenYieldKeywordAndStar", 124 /* YieldKeyword */, 41 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [124 /* YieldKeyword */, 41 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */), rule("NoSpaceBetweenReturnAndSemicolon", 104 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), @@ -129779,7 +126861,7 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 62 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [139 /* ModuleKeyword */, 143 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceAfterModuleImport", [138 /* ModuleKeyword */, 142 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 125 /* AbstractKeyword */, @@ -129793,20 +126875,20 @@ var ts; 116 /* ImplementsKeyword */, 99 /* ImportKeyword */, 117 /* InterfaceKeyword */, - 139 /* ModuleKeyword */, - 140 /* NamespaceKeyword */, + 138 /* ModuleKeyword */, + 139 /* NamespaceKeyword */, 120 /* PrivateKeyword */, 122 /* PublicKeyword */, 121 /* ProtectedKeyword */, - 142 /* ReadonlyKeyword */, - 146 /* SetKeyword */, + 141 /* ReadonlyKeyword */, + 145 /* SetKeyword */, 123 /* StaticKeyword */, - 149 /* TypeKeyword */, - 153 /* FromKeyword */, - 138 /* KeyOfKeyword */, + 148 /* TypeKeyword */, + 152 /* FromKeyword */, + 137 /* KeyOfKeyword */, 135 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [93 /* ExtendsKeyword */, 116 /* ImplementsKeyword */, 153 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [93 /* ExtendsKeyword */, 116 /* ImplementsKeyword */, 152 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 10 /* StringLiteral */, 18 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */), // Lambda expressions @@ -129838,7 +126920,7 @@ var ts; 120 /* PrivateKeyword */, 121 /* ProtectedKeyword */, 134 /* GetKeyword */, - 146 /* SetKeyword */, + 145 /* SetKeyword */, 22 /* OpenBracketToken */, 41 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 4 /* InsertSpace */), @@ -129992,51 +127074,51 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 237 /* ForStatement */; + return context.contextNode.kind === 234 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 27 /* CommaToken */; - case 217 /* ConditionalExpression */: - case 184 /* ConditionalType */: - case 224 /* AsExpression */: - case 270 /* ExportSpecifier */: - case 265 /* ImportSpecifier */: - case 172 /* TypePredicate */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 214 /* ConditionalExpression */: + case 183 /* ConditionalType */: + case 221 /* AsExpression */: + case 267 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 171 /* TypePredicate */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 198 /* BindingElement */: + case 195 /* BindingElement */: // equals in type X = ... // falls through - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // equal in let a = 0 // falls through - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: // equal in p = 0 // falls through - case 160 /* Parameter */: - case 291 /* EnumMember */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 159 /* Parameter */: + case 288 /* EnumMember */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return context.currentTokenSpan.kind === 100 /* InKeyword */ || context.nextTokenSpan.kind === 100 /* InKeyword */ || context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 239 /* ForOfStatement */: - return context.currentTokenSpan.kind === 156 /* OfKeyword */ || context.nextTokenSpan.kind === 156 /* OfKeyword */; + case 236 /* ForOfStatement */: + return context.currentTokenSpan.kind === 155 /* OfKeyword */ || context.nextTokenSpan.kind === 155 /* OfKeyword */; } return false; } @@ -130048,22 +127130,22 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 163 /* PropertyDeclaration */ || - contextKind === 162 /* PropertySignature */ || - contextKind === 160 /* Parameter */ || - contextKind === 249 /* VariableDeclaration */ || + return contextKind === 162 /* PropertyDeclaration */ || + contextKind === 161 /* PropertySignature */ || + contextKind === 159 /* Parameter */ || + contextKind === 246 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 217 /* ConditionalExpression */ || - context.contextNode.kind === 184 /* ConditionalType */; + return context.contextNode.kind === 214 /* ConditionalExpression */ || + context.contextNode.kind === 183 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 196 /* ObjectBindingPattern */ || - context.contextNode.kind === 190 /* MappedType */ || + return context.contextNode.kind === 193 /* ObjectBindingPattern */ || + context.contextNode.kind === 189 /* MappedType */ || isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration @@ -130089,34 +127171,34 @@ var ts; return true; } switch (node.kind) { - case 230 /* Block */: - case 258 /* CaseBlock */: - case 200 /* ObjectLiteralExpression */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 197 /* ObjectLiteralExpression */: + case 254 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 169 /* CallSignature */: - case 208 /* FunctionExpression */: - case 166 /* Constructor */: - case 209 /* ArrowFunction */: + case 168 /* CallSignature */: + case 205 /* FunctionExpression */: + case 165 /* Constructor */: + case 206 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 253 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one + case 250 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; @@ -130125,40 +127207,40 @@ var ts; return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 251 /* FunctionDeclaration */ || context.contextNode.kind === 208 /* FunctionExpression */; + return context.contextNode.kind === 248 /* FunctionDeclaration */ || context.contextNode.kind === 205 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 177 /* TypeLiteral */: - case 256 /* ModuleDeclaration */: - case 267 /* ExportDeclaration */: - case 268 /* NamedExports */: - case 261 /* ImportDeclaration */: - case 264 /* NamedImports */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 176 /* TypeLiteral */: + case 253 /* ModuleDeclaration */: + case 264 /* ExportDeclaration */: + case 265 /* NamedExports */: + case 258 /* ImportDeclaration */: + case 261 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 287 /* CatchClause */: - case 257 /* ModuleBlock */: - case 244 /* SwitchStatement */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 284 /* CatchClause */: + case 254 /* ModuleBlock */: + case 241 /* SwitchStatement */: return true; - case 230 /* Block */: { + case 227 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 209 /* ArrowFunction */ && blockParent.kind !== 208 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 206 /* ArrowFunction */ && blockParent.kind !== 205 /* FunctionExpression */) { return true; } } @@ -130167,32 +127249,32 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 234 /* IfStatement */: - case 244 /* SwitchStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 236 /* WhileStatement */: - case 247 /* TryStatement */: - case 235 /* DoStatement */: - case 243 /* WithStatement */: + case 231 /* IfStatement */: + case 241 /* SwitchStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 233 /* WhileStatement */: + case 244 /* TryStatement */: + case 232 /* DoStatement */: + case 240 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 287 /* CatchClause */: + case 284 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 200 /* ObjectLiteralExpression */; + return context.contextNode.kind === 197 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 203 /* CallExpression */; + return context.contextNode.kind === 200 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 204 /* NewExpression */; + return context.contextNode.kind === 201 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -130207,10 +127289,10 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 209 /* ArrowFunction */; + return context.contextNode.kind === 206 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 195 /* ImportType */; + return context.contextNode.kind === 192 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */; @@ -130219,19 +127301,19 @@ var ts; return context.contextNode.kind !== 11 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 273 /* JsxElement */ && context.contextNode.kind !== 277 /* JsxFragment */; + return context.contextNode.kind !== 270 /* JsxElement */ && context.contextNode.kind !== 274 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 283 /* JsxExpression */ || context.contextNode.kind === 282 /* JsxSpreadAttribute */; + return context.contextNode.kind === 280 /* JsxExpression */ || context.contextNode.kind === 279 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 280 /* JsxAttribute */; + return context.nextTokenParent.kind === 277 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 280 /* JsxAttribute */; + return context.contextNode.kind === 277 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 274 /* JsxSelfClosingElement */; + return context.contextNode.kind === 271 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -130246,45 +127328,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 161 /* Decorator */; + return node.kind === 160 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 250 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 247 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 256 /* ModuleDeclaration */; + return context.contextNode.kind === 253 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 177 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 176 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 170 /* ConstructSignature */; + return context.contextNode.kind === 169 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 173 /* TypeReference */: - case 206 /* TypeAssertionExpression */: - case 254 /* TypeAliasDeclaration */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 223 /* ExpressionWithTypeArguments */: + case 172 /* TypeReference */: + case 203 /* TypeAssertionExpression */: + case 251 /* TypeAliasDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 220 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -130295,28 +127377,28 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 206 /* TypeAssertionExpression */; + return context.contextNode.kind === 203 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 113 /* VoidKeyword */ && context.currentTokenParent.kind === 212 /* VoidExpression */; + return context.currentTokenSpan.kind === 113 /* VoidKeyword */ && context.currentTokenParent.kind === 209 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 219 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 216 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 225 /* NonNullExpression */; + return context.contextNode.kind === 222 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 234 /* IfStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 231 /* IfStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return true; default: return false; @@ -130341,12 +127423,12 @@ var ts; return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; } - if (nextTokenKind === 229 /* SemicolonClassElement */ || + if (nextTokenKind === 226 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 253 /* InterfaceDeclaration */ || - context.contextNode.kind === 254 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 250 /* InterfaceDeclaration */ || + context.contextNode.kind === 251 /* TypeAliasDeclaration */) { // Can’t remove semicolon after `foo`; it would parse as a method declaration: // // interface I { @@ -130360,9 +127442,9 @@ var ts; if (ts.isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 237 /* ForStatement */ - && context.currentTokenParent.kind !== 231 /* EmptyStatement */ - && context.currentTokenParent.kind !== 229 /* SemicolonClassElement */ + return context.currentTokenParent.kind !== 234 /* ForStatement */ + && context.currentTokenParent.kind !== 228 /* EmptyStatement */ + && context.currentTokenParent.kind !== 226 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ @@ -130370,7 +127452,7 @@ var ts; && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ - && nextTokenKind !== 218 /* TemplateExpression */ + && nextTokenKind !== 215 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */; @@ -130461,12 +127543,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 156 /* LastKeyword */ && column <= 156 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 155 /* LastKeyword */ && column <= 155 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 156 /* LastToken */ + 1; + var mapRowLength = 155 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["StopRulesSpecific"] = 0] = "StopRulesSpecific"; @@ -130654,17 +127736,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var body = parent.body; - return !!body && body.kind === 257 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 297 /* SourceFile */: - case 230 /* Block */: - case 257 /* ModuleBlock */: + return !!body && body.kind === 254 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 294 /* SourceFile */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -130891,19 +127973,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 252 /* ClassDeclaration */: return 83 /* ClassKeyword */; - case 253 /* InterfaceDeclaration */: return 117 /* InterfaceKeyword */; - case 251 /* FunctionDeclaration */: return 97 /* FunctionKeyword */; - case 255 /* EnumDeclaration */: return 255 /* EnumDeclaration */; - case 167 /* GetAccessor */: return 134 /* GetKeyword */; - case 168 /* SetAccessor */: return 146 /* SetKeyword */; - case 165 /* MethodDeclaration */: + case 249 /* ClassDeclaration */: return 83 /* ClassKeyword */; + case 250 /* InterfaceDeclaration */: return 117 /* InterfaceKeyword */; + case 248 /* FunctionDeclaration */: return 97 /* FunctionKeyword */; + case 252 /* EnumDeclaration */: return 252 /* EnumDeclaration */; + case 166 /* GetAccessor */: return 134 /* GetKeyword */; + case 167 /* SetAccessor */: return 145 /* SetKeyword */; + case 164 /* MethodDeclaration */: if (node.asteriskToken) { return 41 /* AsteriskToken */; } // falls through - case 163 /* PropertyDeclaration */: - case 160 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 159 /* Parameter */: var name = ts.getNameOfDeclaration(node); if (name) { return name.kind; @@ -130960,15 +128042,15 @@ var ts; case 43 /* SlashToken */: case 31 /* GreaterThanToken */: switch (container.kind) { - case 275 /* JsxOpeningElement */: - case 276 /* JsxClosingElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 273 /* JsxClosingElement */: + case 271 /* JsxSelfClosingElement */: return false; } break; case 22 /* OpenBracketToken */: case 23 /* CloseBracketToken */: - if (container.kind !== 190 /* MappedType */) { + if (container.kind !== 189 /* MappedType */) { return false; } break; @@ -131076,7 +128158,7 @@ var ts; return inheritedIndentation; } } - var effectiveParentStartLine = child.kind === 161 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 160 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 11 /* JsxText */) { @@ -131096,7 +128178,7 @@ var ts; } } childContextNode = node; - if (isFirstListItem && parent.kind === 199 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 196 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -131536,12 +128618,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 209 /* ArrowFunction */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 206 /* ArrowFunction */: if (node.typeParameters === list) { return 29 /* LessThanToken */; } @@ -131549,8 +128631,8 @@ var ts; return 20 /* OpenParenToken */; } break; - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } @@ -131558,12 +128640,12 @@ var ts; return 20 /* OpenParenToken */; } break; - case 173 /* TypeReference */: + case 172 /* TypeReference */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } break; - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return 18 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -131681,7 +128763,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 216 /* BinaryExpression */) { + if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 213 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -131835,7 +128917,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 297 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 294 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -131883,7 +128965,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 234 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 231 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 90 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -131921,40 +129003,40 @@ var ts; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return getList(node.typeArguments); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return getList(node.properties); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getList(node.elements); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return getList(node.members); - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 166 /* Constructor */: - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 165 /* Constructor */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 204 /* NewExpression */: - case 203 /* CallExpression */: + case 201 /* NewExpression */: + case 200 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return getList(node.declarations); - case 264 /* NamedImports */: - case 268 /* NamedExports */: + case 261 /* NamedImports */: + case 265 /* NamedExports */: return getList(node.elements); - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -131977,7 +129059,7 @@ var ts; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 250 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 247 /* VariableDeclarationList */) { // VariableDeclarationList has no wrapping tokens return -1 /* Unknown */; } @@ -132050,91 +129132,87 @@ var ts; function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 233 /* ExpressionStatement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 199 /* ArrayLiteralExpression */: - case 230 /* Block */: - case 257 /* ModuleBlock */: - case 200 /* ObjectLiteralExpression */: - case 177 /* TypeLiteral */: - case 190 /* MappedType */: - case 179 /* TupleType */: - case 258 /* CaseBlock */: - case 285 /* DefaultClause */: - case 284 /* CaseClause */: - case 207 /* ParenthesizedExpression */: - case 201 /* PropertyAccessExpression */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 232 /* VariableStatement */: - case 266 /* ExportAssignment */: - case 242 /* ReturnStatement */: - case 217 /* ConditionalExpression */: - case 197 /* ArrayBindingPattern */: - case 196 /* ObjectBindingPattern */: - case 275 /* JsxOpeningElement */: - case 278 /* JsxOpeningFragment */: - case 274 /* JsxSelfClosingElement */: - case 283 /* JsxExpression */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 160 /* Parameter */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 186 /* ParenthesizedType */: - case 205 /* TaggedTemplateExpression */: - case 213 /* AwaitExpression */: - case 268 /* NamedExports */: - case 264 /* NamedImports */: - case 270 /* ExportSpecifier */: - case 265 /* ImportSpecifier */: - case 163 /* PropertyDeclaration */: + case 230 /* ExpressionStatement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 196 /* ArrayLiteralExpression */: + case 227 /* Block */: + case 254 /* ModuleBlock */: + case 197 /* ObjectLiteralExpression */: + case 176 /* TypeLiteral */: + case 189 /* MappedType */: + case 178 /* TupleType */: + case 255 /* CaseBlock */: + case 282 /* DefaultClause */: + case 281 /* CaseClause */: + case 204 /* ParenthesizedExpression */: + case 198 /* PropertyAccessExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 229 /* VariableStatement */: + case 263 /* ExportAssignment */: + case 239 /* ReturnStatement */: + case 214 /* ConditionalExpression */: + case 194 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 272 /* JsxOpeningElement */: + case 275 /* JsxOpeningFragment */: + case 271 /* JsxSelfClosingElement */: + case 280 /* JsxExpression */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 159 /* Parameter */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 185 /* ParenthesizedType */: + case 202 /* TaggedTemplateExpression */: + case 210 /* AwaitExpression */: + case 265 /* NamedExports */: + case 261 /* NamedImports */: + case 267 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 162 /* PropertyDeclaration */: return true; - case 249 /* VariableDeclaration */: - case 288 /* PropertyAssignment */: - case 216 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 200 /* ObjectLiteralExpression */) { // TODO: GH#18217 + case 246 /* VariableDeclaration */: + case 285 /* PropertyAssignment */: + case 213 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 197 /* ObjectLiteralExpression */) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child); } - if (parent.kind !== 216 /* BinaryExpression */) { + if (parent.kind !== 213 /* BinaryExpression */) { return true; } break; - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 237 /* ForStatement */: - case 234 /* IfStatement */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - return childKind !== 230 /* Block */; - case 209 /* ArrowFunction */: - if (sourceFile && childKind === 207 /* ParenthesizedExpression */) { - return rangeIsOnOneLine(sourceFile, child); - } - return childKind !== 230 /* Block */; - case 267 /* ExportDeclaration */: - return childKind !== 268 /* NamedExports */; - case 261 /* ImportDeclaration */: - return childKind !== 262 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 264 /* NamedImports */); - case 273 /* JsxElement */: - return childKind !== 276 /* JsxClosingElement */; - case 277 /* JsxFragment */: - return childKind !== 279 /* JsxClosingFragment */; - case 183 /* IntersectionType */: - case 182 /* UnionType */: - if (childKind === 177 /* TypeLiteral */ || childKind === 179 /* TupleType */) { + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 234 /* ForStatement */: + case 231 /* IfStatement */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 206 /* ArrowFunction */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + return childKind !== 227 /* Block */; + case 264 /* ExportDeclaration */: + return childKind !== 265 /* NamedExports */; + case 258 /* ImportDeclaration */: + return childKind !== 259 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 261 /* NamedImports */); + case 270 /* JsxElement */: + return childKind !== 273 /* JsxClosingElement */; + case 274 /* JsxFragment */: + return childKind !== 276 /* JsxClosingFragment */; + case 182 /* IntersectionType */: + case 181 /* UnionType */: + if (childKind === 176 /* TypeLiteral */ || childKind === 178 /* TupleType */) { return false; } // falls through @@ -132145,11 +129223,11 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 242 /* ReturnStatement */: - case 246 /* ThrowStatement */: - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: - return parent.kind !== 230 /* Block */; + case 239 /* ReturnStatement */: + case 243 /* ThrowStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: + return parent.kind !== 227 /* Block */; default: return false; } @@ -132223,10 +129301,8 @@ var ts; (function (TrailingTriviaOption) { /** Exclude all trailing trivia (use getEnd()) */ TrailingTriviaOption[TrailingTriviaOption["Exclude"] = 0] = "Exclude"; - /** Doesn't include whitespace, but does strip comments */ - TrailingTriviaOption[TrailingTriviaOption["ExcludeWhitespace"] = 1] = "ExcludeWhitespace"; /** Include trailing trivia */ - TrailingTriviaOption[TrailingTriviaOption["Include"] = 2] = "Include"; + TrailingTriviaOption[TrailingTriviaOption["Include"] = 1] = "Include"; })(TrailingTriviaOption = textChanges_3.TrailingTriviaOption || (textChanges_3.TrailingTriviaOption = {})); function skipWhitespacesAndLineBreaks(text, start) { return ts.skipTrivia(text, start, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); @@ -132297,18 +129373,9 @@ var ts; return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); } function getAdjustedEndPosition(sourceFile, node, options) { - var _a; var end = node.end; var trailingTriviaOption = options.trailingTriviaOption; - if (trailingTriviaOption === TrailingTriviaOption.Exclude) { - return end; - } - if (trailingTriviaOption === TrailingTriviaOption.ExcludeWhitespace) { - var comments = ts.concatenate(ts.getTrailingCommentRanges(sourceFile.text, end), ts.getLeadingCommentRanges(sourceFile.text, end)); - var realEnd = (_a = comments === null || comments === void 0 ? void 0 : comments[comments.length - 1]) === null || _a === void 0 ? void 0 : _a.end; - if (realEnd) { - return realEnd; - } + if (trailingTriviaOption === TrailingTriviaOption.Exclude || (ts.isExpression(node) && trailingTriviaOption !== TrailingTriviaOption.Include)) { return end; } var newEnd = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true); @@ -132320,7 +129387,7 @@ var ts; * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 200 /* ObjectLiteralExpression */)); + return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 197 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -132459,10 +129526,9 @@ var ts; this.insertNodeAt(sourceFile, parameters.pos, newParam); } }; - ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween, options) { + ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween) { if (blankLineBetween === void 0) { blankLineBetween = false; } - if (options === void 0) { options = {}; } - this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween)); + this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, {}), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween)); }; ChangeTracker.prototype.insertModifierBefore = function (sourceFile, modifier, before) { var pos = before.getStart(sourceFile); @@ -132524,7 +129590,7 @@ var ts; } } else { - endNode = (_a = (node.kind === 249 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken)) !== null && _a !== void 0 ? _a : node.name; + endNode = (_a = (node.kind === 246 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken)) !== null && _a !== void 0 ? _a : node.name; } this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " }); return true; @@ -132681,18 +129747,18 @@ var ts; }; ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: case 10 /* StringLiteral */: case 78 /* Identifier */: return { prefix: ", " }; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 92 /* ExportKeyword */: return { prefix: " " }; - case 160 /* Parameter */: + case 159 /* Parameter */: return {}; default: ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it @@ -132701,7 +129767,7 @@ var ts; }; ChangeTracker.prototype.insertName = function (sourceFile, node, name) { ts.Debug.assert(!node.name); - if (node.kind === 209 /* ArrowFunction */) { + if (node.kind === 206 /* ArrowFunction */) { var arrow = ts.findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile); var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile); if (lparen) { @@ -132715,14 +129781,14 @@ var ts; // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)` this.replaceRange(sourceFile, arrow, ts.factory.createToken(21 /* CloseParenToken */)); } - if (node.body.kind !== 230 /* Block */) { + if (node.body.kind !== 227 /* Block */) { // `() => 0` => `function f() { return 0; }` this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.factory.createToken(18 /* OpenBraceToken */), ts.factory.createToken(104 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [ts.factory.createToken(26 /* SemicolonToken */), ts.factory.createToken(19 /* CloseBraceToken */)], { joiner: " " }); } } else { - var pos = ts.findChildOfKind(node, node.kind === 208 /* FunctionExpression */ ? 97 /* FunctionKeyword */ : 83 /* ClassKeyword */, sourceFile).end; + var pos = ts.findChildOfKind(node, node.kind === 205 /* FunctionExpression */ ? 97 /* FunctionKeyword */ : 83 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, ts.factory.createIdentifier(name), { prefix: " " }); } }; @@ -133018,12 +130084,7 @@ var ts; function getNonformattedText(node, sourceFile, newLineCharacter) { var writer = createWriter(newLineCharacter); var newLine = newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */; - ts.createPrinter({ - newLine: newLine, - neverAsciiEscape: true, - preserveSourceNewlines: true, - terminateUnterminatedLiterals: true - }, writer).writeNode(4 /* Unspecified */, node, sourceFile, writer); + ts.createPrinter({ newLine: newLine, neverAsciiEscape: true, preserveSourceNewlines: true }, writer).writeNode(4 /* Unspecified */, node, sourceFile, writer); return { text: writer.getText(), node: assignPositionsToNode(node) }; } changesToText.getNonformattedText = getNonformattedText; @@ -133297,14 +130358,14 @@ var ts; } textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; function needSemicolonBetween(a, b) { - return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 158 /* ComputedPropertyName */ + return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 157 /* ComputedPropertyName */ || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[` } var deleteDeclaration; (function (deleteDeclaration_1) { function deleteDeclaration(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 160 /* Parameter */: { + case 159 /* Parameter */: { var oldFunction = node.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && @@ -133319,15 +130380,15 @@ var ts; } break; } - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: var isFirstImport = sourceFile.imports.length && node === ts.first(sourceFile.imports).parent || node === ts.find(sourceFile.statements, ts.isAnyImportSyntax); // For first import, leave header comment in place, otherwise only delete JSDoc comments deleteNode(changes, sourceFile, node, { leadingTriviaOption: isFirstImport ? LeadingTriviaOption.Exclude : ts.hasJSDocNodes(node) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: var pattern = node.parent; - var preserveComma = pattern.kind === 197 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); + var preserveComma = pattern.kind === 194 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } @@ -133335,13 +130396,13 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: var namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -133350,7 +130411,7 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; case 26 /* SemicolonToken */: @@ -133359,8 +130420,8 @@ var ts; case 97 /* FunctionKeyword */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: LeadingTriviaOption.Exclude }); break; - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: ts.hasJSDocNodes(node) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); break; default: @@ -133407,13 +130468,13 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(node, 261 /* ImportDeclaration */); + var importDecl = ts.getAncestor(node, 258 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { var parent = node.parent; - if (parent.kind === 287 /* CatchClause */) { + if (parent.kind === 284 /* CatchClause */) { // TODO: There's currently no unused diagnostic for this, could be a suggestion changes.deleteNodeRange(sourceFile, ts.findChildOfKind(parent, 20 /* OpenParenToken */, sourceFile), ts.findChildOfKind(parent, 21 /* CloseParenToken */, sourceFile)); return; @@ -133424,14 +130485,14 @@ var ts; } var gp = parent.parent; switch (gp.kind) { - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: changes.replaceNode(sourceFile, node, ts.factory.createObjectLiteralExpression()); break; - case 237 /* ForStatement */: + case 234 /* ForStatement */: deleteNode(changes, sourceFile, parent); break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: deleteNode(changes, sourceFile, gp, { leadingTriviaOption: ts.hasJSDocNodes(gp) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); break; default: @@ -133610,8 +130671,8 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var assertion = ts.Debug.checkDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertionExpression(n); }), "Expected to find an assertion expression"); var replacement = ts.isAsExpression(assertion) - ? ts.factory.createAsExpression(assertion.expression, ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */)) - : ts.factory.createTypeAssertion(ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */), assertion.expression); + ? ts.factory.createAsExpression(assertion.expression, ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */)) + : ts.factory.createTypeAssertion(ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */), assertion.expression); changeTracker.replaceNode(sourceFile, assertion.expression, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -133840,7 +130901,7 @@ var ts; } var declaration = ts.tryCast(symbol.valueDeclaration, ts.isVariableDeclaration); var variableName = declaration && ts.tryCast(declaration.name, ts.isIdentifier); - var variableStatement = ts.getAncestor(declaration, 232 /* VariableStatement */); + var variableStatement = ts.getAncestor(declaration, 229 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || @@ -133918,10 +130979,10 @@ var ts; function isInsideAwaitableBody(node) { return node.kind & 32768 /* AwaitContext */ || !!ts.findAncestor(node, function (ancestor) { return ancestor.parent && ts.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || - ts.isBlock(ancestor) && (ancestor.parent.kind === 251 /* FunctionDeclaration */ || - ancestor.parent.kind === 208 /* FunctionExpression */ || - ancestor.parent.kind === 209 /* ArrowFunction */ || - ancestor.parent.kind === 165 /* MethodDeclaration */); + ts.isBlock(ancestor) && (ancestor.parent.kind === 248 /* FunctionDeclaration */ || + ancestor.parent.kind === 205 /* FunctionExpression */ || + ancestor.parent.kind === 206 /* ArrowFunction */ || + ancestor.parent.kind === 164 /* MethodDeclaration */); }); } function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { @@ -134040,10 +131101,10 @@ var ts; function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 78 /* Identifier */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -134058,7 +131119,7 @@ var ts; function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 78 /* Identifier */: - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: case 27 /* CommaToken */: return true; default: @@ -134107,7 +131168,7 @@ var ts; return; } var declaration = token.parent; - if (declaration.kind === 163 /* PropertyDeclaration */ && + if (declaration.kind === 162 /* PropertyDeclaration */ && (!fixedNodes || ts.tryAddToSet(fixedNodes, declaration))) { changeTracker.insertModifierBefore(sourceFile, 133 /* DeclareKeyword */, declaration); } @@ -134244,26 +131305,26 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 249 /* VariableDeclaration */ || - node.kind === 162 /* PropertySignature */ || - node.kind === 163 /* PropertyDeclaration */; + node.kind === 246 /* VariableDeclaration */ || + node.kind === 161 /* PropertySignature */ || + node.kind === 162 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: return ts.factory.createTypeReferenceNode("any", ts.emptyArray); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 306 /* JSDocNonNullableType */: + case 302 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, ts.nullTransformationContext); @@ -134288,7 +131349,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 309 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 + var isRest = node.type.kind === 305 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.factory.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; return ts.factory.createParameterDeclaration(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -134328,8 +131389,8 @@ var ts; var index = ts.factory.createParameterDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 144 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.factory.createTypeReferenceNode(node.typeArguments[0].kind === 144 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 143 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.factory.createTypeReferenceNode(node.typeArguments[0].kind === 143 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.factory.createTypeLiteralNode([ts.factory.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -134458,7 +131519,7 @@ var ts; return members; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 233 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 230 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentExpr) { @@ -134514,7 +131575,7 @@ var ts; var arrowFunctionBody = arrowFunction.body; var bodyBlock; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 230 /* Block */) { + if (arrowFunctionBody.kind === 227 /* Block */) { bodyBlock = arrowFunctionBody; } // case 2: () => [1,2,3] @@ -134709,7 +131770,7 @@ var ts; // will eventually become // const response = await fetch('...') // so we push an entry for 'response'. - if (lastCallSignature && !ts.isParameter(node.parent) && !ts.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { + if (lastCallSignature && !ts.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { var firstParameter = ts.firstOrUndefined(lastCallSignature.parameters); var ident = firstParameter && ts.isParameter(firstParameter.valueDeclaration) && ts.tryCast(firstParameter.valueDeclaration.name, ts.isIdentifier) || ts.factory.createUniqueName("result", 16 /* Optimistic */); var synthName = getNewNameIfConflict(ident, collidingSymbolMap); @@ -134735,22 +131796,7 @@ var ts; } } }); - return ts.getSynthesizedDeepCloneWithReplacements(nodeToRename, /*includeTrivia*/ true, function (original) { - if (ts.isBindingElement(original) && ts.isIdentifier(original.name) && ts.isObjectBindingPattern(original.parent)) { - var symbol = checker.getSymbolAtLocation(original.name); - var renameInfo = symbol && identsToRenameMap.get(String(ts.getSymbolId(symbol))); - if (renameInfo && renameInfo.text !== (original.name || original.propertyName).getText()) { - return ts.factory.createBindingElement(original.dotDotDotToken, original.propertyName || original.name, renameInfo, original.initializer); - } - } - else if (ts.isIdentifier(original)) { - var symbol = checker.getSymbolAtLocation(original); - var renameInfo = symbol && identsToRenameMap.get(String(ts.getSymbolId(symbol))); - if (renameInfo) { - return ts.factory.createIdentifier(renameInfo.text); - } - } - }); + return ts.getSynthesizedDeepCloneWithRenames(nodeToRename, /*includeTrivia*/ true, identsToRenameMap, checker); } function getNewNameIfConflict(name, originalNames) { var numVarsSameName = (originalNames.get(name.text) || ts.emptyArray).length; @@ -134831,7 +131877,7 @@ var ts; } var tryStatement = ts.factory.createTryStatement(tryBlock, catchClause, /*finallyBlock*/ undefined); var destructuredResult = prevArgName && varDeclIdentifier && isSynthBindingPattern(prevArgName) - && ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(ts.getSynthesizedDeepClone(prevArgName.bindingPattern), /*exclamationToken*/ undefined, /*type*/ undefined, varDeclIdentifier)], 2 /* Const */)); + && ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(ts.getSynthesizedDeepCloneWithRenames(prevArgName.bindingPattern), /*exclamationToken*/ undefined, /*type*/ undefined, varDeclIdentifier)], 2 /* Const */)); return ts.compact([varDeclList, tryStatement, destructuredResult]); } function createUniqueSynthName(prevArgName) { @@ -134890,7 +131936,7 @@ var ts; } // should be kept up to date with isFixablePromiseArgument in suggestionDiagnostics.ts function getTransformationBody(func, prevArgName, argName, parent, transformer) { - var _a, _b, _c, _d, _e; + var _a, _b, _c, _d; switch (func.kind) { case 103 /* NullKeyword */: // do not produce a transformed statement for a null argument @@ -134916,24 +131962,22 @@ var ts; prevArgName.types.push(returnType); } return varDeclOrAssignment; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: { + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: { var funcBody = func.body; - var returnType_1 = (_c = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) === null || _c === void 0 ? void 0 : _c.getReturnType(); // Arrow functions with block bodies { } will enter this control flow if (ts.isBlock(funcBody)) { var refactoredStmts = []; var seenReturnStatement = false; - for (var _i = 0, _f = funcBody.statements; _i < _f.length; _i++) { - var statement = _f[_i]; + for (var _i = 0, _e = funcBody.statements; _i < _e.length; _i++) { + var statement = _e[_i]; if (ts.isReturnStatement(statement)) { seenReturnStatement = true; if (ts.isReturnStatementWithFixablePromiseHandler(statement)) { refactoredStmts = refactoredStmts.concat(getInnerTransformationBody(transformer, [statement], prevArgName)); } else { - var possiblyAwaitedRightHandSide = returnType_1 && statement.expression ? getPossiblyAwaitedRightHandSide(transformer.checker, returnType_1, statement.expression) : statement.expression; - refactoredStmts.push.apply(refactoredStmts, maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_d = parent.typeArguments) === null || _d === void 0 ? void 0 : _d[0])); + refactoredStmts.push.apply(refactoredStmts, maybeAnnotateAndReturn(statement.expression, (_c = parent.typeArguments) === null || _c === void 0 ? void 0 : _c[0])); } } else { @@ -134950,21 +131994,19 @@ var ts; if (innerCbBody.length > 0) { return innerCbBody; } - if (returnType_1) { - var possiblyAwaitedRightHandSide = getPossiblyAwaitedRightHandSide(transformer.checker, returnType_1, funcBody); - if (!shouldReturn(parent, transformer)) { - var transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide, /*typeAnnotation*/ undefined); - if (prevArgName) { - prevArgName.types.push(returnType_1); - } - return transformedStatement; - } - else { - return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_e = parent.typeArguments) === null || _e === void 0 ? void 0 : _e[0]); + var type_1 = transformer.checker.getTypeAtLocation(func); + var returnType_1 = getLastCallSignature(type_1, transformer.checker).getReturnType(); + var rightHandSide = ts.getSynthesizedDeepClone(funcBody); + var possiblyAwaitedRightHandSide = !!transformer.checker.getPromisedTypeOfPromise(returnType_1) ? ts.factory.createAwaitExpression(rightHandSide) : rightHandSide; + if (!shouldReturn(parent, transformer)) { + var transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide, /*typeAnnotation*/ undefined); + if (prevArgName) { + prevArgName.types.push(returnType_1); } + return transformedStatement; } else { - return silentFail(); + return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_d = parent.typeArguments) === null || _d === void 0 ? void 0 : _d[0]); } } } @@ -134974,10 +132016,6 @@ var ts; } return ts.emptyArray; } - function getPossiblyAwaitedRightHandSide(checker, type, expr) { - var rightHandSide = ts.getSynthesizedDeepClone(expr); - return !!checker.getPromisedTypeOfPromise(type) ? ts.factory.createAwaitExpression(rightHandSide) : rightHandSide; - } function getLastCallSignature(type, checker) { var callSignatures = checker.getSignaturesOfType(type, 0 /* Call */); return ts.lastOrUndefined(callSignatures); @@ -135133,10 +132171,10 @@ var ts; } var importNode = ts.importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference)); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) { changes.replaceNode(importingFile, importNode, ts.factory.createPropertyAccessExpression(ts.getSynthesizedDeepClone(importNode), "default")); } @@ -135150,25 +132188,11 @@ var ts; var exports = collectExportRenames(sourceFile, checker, identifiers); convertExportsAccesses(sourceFile, exports, changes); var moduleExportsChangedToDefault = false; - var useSitesToUnqualify; - // Process variable statements first to collect use sites that need to be updated inside other transformations - for (var _i = 0, _a = ts.filter(sourceFile.statements, ts.isVariableStatement); _i < _a.length; _i++) { + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var statement = _a[_i]; - var newUseSites = convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); - if (newUseSites) { - ts.copyEntries(newUseSites, useSitesToUnqualify !== null && useSitesToUnqualify !== void 0 ? useSitesToUnqualify : (useSitesToUnqualify = new ts.Map())); - } - } - // `convertStatement` will delete entries from `useSitesToUnqualify` when containing statements are replaced - for (var _b = 0, _c = ts.filter(sourceFile.statements, function (s) { return !ts.isVariableStatement(s); }); _b < _c.length; _b++) { - var statement = _c[_b]; - var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference); + var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference); moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; } - // Remaining use sites can be changed directly - useSitesToUnqualify === null || useSitesToUnqualify === void 0 ? void 0 : useSitesToUnqualify.forEach(function (replacement, original) { - changes.replaceNode(sourceFile, original, replacement); - }); return moduleExportsChangedToDefault; } function collectExportRenames(sourceFile, checker, identifiers) { @@ -135201,24 +132225,24 @@ var ts; node.forEachChild(recur); }); } - function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference) { + function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference) { switch (statement.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 233 /* ExpressionStatement */: { + case 230 /* ExpressionStatement */: { var expression = statement.expression; switch (expression.kind) { - case 203 /* CallExpression */: { + case 200 /* CallExpression */: { if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true)) { // For side-effecting require() call, just make a side-effecting import. changes.replaceNode(sourceFile, statement, ts.makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0], quotePreference)); } return false; } - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var operatorToken = expression.operatorToken; - return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports, useSitesToUnqualify); + return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); } } } @@ -135230,17 +132254,17 @@ var ts; function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference) { var declarationList = statement.declarationList; var foundImport = false; - var converted = ts.map(declarationList.declarations, function (decl) { + var newNodes = ts.flatMap(declarationList.declarations, function (decl) { var name = decl.name, initializer = decl.initializer; if (initializer) { if (ts.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { // `const alias = module.exports;` can be removed. foundImport = true; - return convertedImports([]); + return []; } else if (ts.isRequireCall(initializer, /*checkArgumentIsStringLiteralLike*/ true)) { foundImport = true; - return convertSingleImport(name, initializer.arguments[0], checker, identifiers, target, quotePreference); + return convertSingleImport(sourceFile, name, initializer.arguments[0], changes, checker, identifiers, target, quotePreference); } else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, /*checkArgumentIsStringLiteralLike*/ true)) { foundImport = true; @@ -135248,40 +132272,33 @@ var ts; } } // Move it out to its own variable statement. (This will not be used if `!foundImport`) - return convertedImports([ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([decl], declarationList.flags))]); + return ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([decl], declarationList.flags)); }); if (foundImport) { // useNonAdjustedEndPosition to ensure we don't eat the newline after the statement. - changes.replaceNodeWithNodes(sourceFile, statement, ts.flatMap(converted, function (c) { return c.newImports; })); - var combinedUseSites_1; - ts.forEach(converted, function (c) { - if (c.useSitesToUnqualify) { - ts.copyEntries(c.useSitesToUnqualify, combinedUseSites_1 !== null && combinedUseSites_1 !== void 0 ? combinedUseSites_1 : (combinedUseSites_1 = new ts.Map())); - } - }); - return combinedUseSites_1; + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); } } /** Converts `const name = require("moduleSpecifier").propertyName` */ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: { + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: { // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` var tmp = makeUniqueName(propertyName, identifiers); - return convertedImports([ + return [ makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference), makeConst(/*modifiers*/ undefined, name, ts.factory.createIdentifier(tmp)), - ]); + ]; } case 78 /* Identifier */: // `const a = require("b").c` --> `import { c as a } from "./b"; - return convertedImports([makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]); + return [makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]; default: return ts.Debug.assertNever(name, "Convert to ES6 module got invalid syntax form " + name.kind); } } - function convertAssignment(sourceFile, checker, assignment, changes, exports, useSitesToUnqualify) { + function convertAssignment(sourceFile, checker, assignment, changes, exports) { var left = assignment.left, right = assignment.right; if (!ts.isPropertyAccessExpression(left)) { return false; @@ -135292,7 +132309,7 @@ var ts; changes.delete(sourceFile, assignment.parent); } else { - var replacement = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right, useSitesToUnqualify) + var replacement = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right) : ts.isRequireCall(right, /*checkArgumentIsStringLiteralLike*/ true) ? convertReExportAll(right.arguments[0], checker) : undefined; if (replacement) { @@ -135314,20 +132331,20 @@ var ts; * Convert `module.exports = { ... }` to individual exports.. * We can't always do this if the module has interesting members -- then it will be a default export instead. */ - function tryChangeModuleExportsObject(object, useSitesToUnqualify) { + function tryChangeModuleExportsObject(object) { var statements = ts.mapAllOrFail(object.properties, function (prop) { switch (prop.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 289 /* ShorthandPropertyAssignment */: - case 290 /* SpreadAssignment */: + case 286 /* ShorthandPropertyAssignment */: + case 287 /* SpreadAssignment */: return undefined; - case 288 /* PropertyAssignment */: - return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify); - case 165 /* MethodDeclaration */: - return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(92 /* ExportKeyword */)], prop, useSitesToUnqualify); + case 285 /* PropertyAssignment */: + return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer); + case 164 /* MethodDeclaration */: + return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(92 /* ExportKeyword */)], prop); default: ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind); } @@ -135387,10 +132404,10 @@ var ts; } } // TODO: GH#22492 this will cause an error if a change has been made inside the body of the node. - function convertExportsDotXEquals_replaceNode(name, exported, useSitesToUnqualify) { + function convertExportsDotXEquals_replaceNode(name, exported) { var modifiers = [ts.factory.createToken(92 /* ExportKeyword */)]; switch (exported.kind) { - case 208 /* FunctionExpression */: { + case 205 /* FunctionExpression */: { var expressionName = exported.name; if (expressionName && expressionName.text !== name) { // `exports.f = function g() {}` -> `export const f = function g() {}` @@ -135398,35 +132415,18 @@ var ts; } } // falls through - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // `exports.f = function() {}` --> `export function f() {}` - return functionExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); - case 221 /* ClassExpression */: + return functionExpressionToDeclaration(name, modifiers, exported); + case 218 /* ClassExpression */: // `exports.C = class {}` --> `export class C {}` - return classExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); + return classExpressionToDeclaration(name, modifiers, exported); default: return exportConst(); } function exportConst() { // `exports.x = 0;` --> `export const x = 0;` - return makeConst(modifiers, ts.factory.createIdentifier(name), replaceImportUseSites(exported, useSitesToUnqualify)); // TODO: GH#18217 - } - } - function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) { - if (!useSitesToUnqualify || !ts.some(ts.arrayFrom(useSitesToUnqualify.keys()), function (original) { return ts.rangeContainsRange(nodeOrNodes, original); })) { - return nodeOrNodes; - } - return ts.isArray(nodeOrNodes) - ? ts.getSynthesizedDeepClonesWithReplacements(nodeOrNodes, /*includeTrivia*/ true, replaceNode) - : ts.getSynthesizedDeepCloneWithReplacements(nodeOrNodes, /*includeTrivia*/ true, replaceNode); - function replaceNode(original) { - // We are replacing `mod.SomeExport` wih `SomeExport`, so we only need to look at PropertyAccessExpressions - if (original.kind === 201 /* PropertyAccessExpression */) { - var replacement = useSitesToUnqualify.get(original); - // Remove entry from `useSitesToUnqualify` so the refactor knows it's taken care of by the parent statement we're replacing - useSitesToUnqualify.delete(original); - return replacement; - } + return makeConst(modifiers, ts.factory.createIdentifier(name), exported); // TODO: GH#18217 } } /** @@ -135434,9 +132434,9 @@ var ts; * Returns nodes that will replace the variable declaration for the commonjs import. * May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`. */ - function convertSingleImport(name, moduleSpecifier, checker, identifiers, target, quotePreference) { + function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 196 /* ObjectBindingPattern */: { + case 193 /* ObjectBindingPattern */: { var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) ? undefined @@ -135445,23 +132445,23 @@ var ts; : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text); }); if (importSpecifiers) { - return convertedImports([ts.makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier, quotePreference)]); + return [ts.makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier, quotePreference)]; } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 197 /* ArrayBindingPattern */: { + case 194 /* ArrayBindingPattern */: { /* import x from "x"; const [a, b, c] = x; */ var tmp = makeUniqueName(codefix.moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers); - return convertedImports([ + return [ ts.makeImport(ts.factory.createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier, quotePreference), makeConst(/*modifiers*/ undefined, ts.getSynthesizedDeepClone(name), ts.factory.createIdentifier(tmp)), - ]); + ]; } case 78 /* Identifier */: - return convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference); + return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers, quotePreference); default: return ts.Debug.assertNever(name, "Convert to ES6 module got invalid name kind " + name.kind); } @@ -135470,13 +132470,12 @@ var ts; * Convert `import x = require("x").` * Also converts uses like `x.y()` to `y()` and uses a named import. */ - function convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference) { + function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers, quotePreference) { var nameSymbol = checker.getSymbolAtLocation(name); // Maps from module property name to name actually used. (The same if there isn't shadowing.) var namedBindingsNames = new ts.Map(); // True if there is some non-property use like `x()` or `f(x)`. var needDefaultImport = false; - var useSitesToUnqualify; for (var _i = 0, _a = identifiers.original.get(name.text); _i < _a.length; _i++) { var use = _a[_i]; if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) { @@ -135492,7 +132491,7 @@ var ts; idName = makeUniqueName(propertyName, identifiers); namedBindingsNames.set(propertyName, idName); } - (useSitesToUnqualify !== null && useSitesToUnqualify !== void 0 ? useSitesToUnqualify : (useSitesToUnqualify = new ts.Map())).set(parent, ts.factory.createIdentifier(idName)); + changes.replaceNode(file, parent, ts.factory.createIdentifier(idName)); } else { needDefaultImport = true; @@ -135506,7 +132505,7 @@ var ts; // If it was unused, ensure that we at least import *something*. needDefaultImport = true; } - return convertedImports([ts.makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier, quotePreference)], useSitesToUnqualify); + return [ts.makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier, quotePreference)]; } // Identifiers helpers function makeUniqueName(name, identifiers) { @@ -135533,24 +132532,24 @@ var ts; function isFreeIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return parent.name !== node; - case 198 /* BindingElement */: + case 195 /* BindingElement */: return parent.propertyName !== node; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return parent.propertyName !== node; default: return true; } } // Node helpers - function functionExpressionToDeclaration(name, additionalModifiers, fn, useSitesToUnqualify) { + function functionExpressionToDeclaration(name, additionalModifiers, fn) { return ts.factory.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal. - ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.factory.converters.convertToFunctionBlock(replaceImportUseSites(fn.body, useSitesToUnqualify))); + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.factory.converters.convertToFunctionBlock(ts.getSynthesizedDeepClone(fn.body))); } - function classExpressionToDeclaration(name, additionalModifiers, cls, useSitesToUnqualify) { + function classExpressionToDeclaration(name, additionalModifiers, cls) { return ts.factory.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), // TODO: GH#19915 Don't think this is even legal. - ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), replaceImportUseSites(cls.members, useSitesToUnqualify)); + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), ts.getSynthesizedDeepClones(cls.members)); } function makeSingleImport(localName, propertyName, moduleSpecifier, quotePreference) { return propertyName === "default" @@ -135569,12 +132568,6 @@ var ts; /*modifiers*/ undefined, /*isTypeOnly*/ false, exportSpecifiers && ts.factory.createNamedExports(exportSpecifiers), moduleSpecifier === undefined ? undefined : ts.factory.createStringLiteral(moduleSpecifier)); } - function convertedImports(newImports, useSitesToUnqualify) { - return { - newImports: newImports, - useSitesToUnqualify: useSitesToUnqualify - }; - } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -135634,7 +132627,7 @@ var ts; var fixedExportDeclarations = new ts.Map(); return codefix.codeFixAll(context, errorCodes, function (changes, diag) { var exportSpecifier = getExportSpecifierForDiagnosticSpan(diag, context.sourceFile); - if (exportSpecifier && ts.addToSeen(fixedExportDeclarations, ts.getNodeId(exportSpecifier.parent.parent))) { + if (exportSpecifier && !ts.addToSeen(fixedExportDeclarations, ts.getNodeId(exportSpecifier.parent.parent))) { fixSingleExportDeclaration(changes, exportSpecifier, context); } }); @@ -135651,7 +132644,8 @@ var ts; var exportDeclaration = exportClause.parent; var typeExportSpecifiers = getTypeExportSpecifiers(exportSpecifier, context); if (typeExportSpecifiers.length === exportClause.elements.length) { - changes.insertModifierBefore(context.sourceFile, 149 /* TypeKeyword */, exportClause); + changes.replaceNode(context.sourceFile, exportDeclaration, ts.factory.updateExportDeclaration(exportDeclaration, exportDeclaration.decorators, exportDeclaration.modifiers, + /*isTypeOnly*/ true, exportClause, exportDeclaration.moduleSpecifier)); } else { var valueExportDeclaration = ts.factory.updateExportDeclaration(exportDeclaration, exportDeclaration.decorators, exportDeclaration.modifiers, @@ -135660,10 +132654,7 @@ var ts; /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ true, ts.factory.createNamedExports(typeExportSpecifiers), exportDeclaration.moduleSpecifier); - changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, { - leadingTriviaOption: ts.textChanges.LeadingTriviaOption.IncludeAll, - trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Exclude - }); + changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration); changes.insertNodeAfter(context.sourceFile, exportDeclaration, typeExportDeclaration); } } @@ -135730,53 +132721,6 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; -(function (ts) { - var codefix; - (function (codefix) { - var fixId = "convertLiteralTypeToMappedType"; - var errorCodes = [ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code]; - codefix.registerCodeFix({ - errorCodes: errorCodes, - getCodeActions: function (context) { - var sourceFile = context.sourceFile, span = context.span; - var info = getInfo(sourceFile, span.start); - if (!info) { - return undefined; - } - var name = info.name, constraint = info.constraint; - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); }); - return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Convert_0_to_1_in_0, constraint, name], fixId, ts.Diagnostics.Convert_all_type_literals_to_mapped_type)]; - }, - fixIds: [fixId], - getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { - var info = getInfo(diag.file, diag.start); - if (info) { - doChange(changes, diag.file, info); - } - }); } - }); - function getInfo(sourceFile, pos) { - var token = ts.getTokenAtPosition(sourceFile, pos); - if (ts.isIdentifier(token)) { - var propertySignature = ts.cast(token.parent.parent, ts.isPropertySignature); - var propertyName = token.getText(sourceFile); - return { - container: ts.cast(propertySignature.parent, ts.isTypeLiteralNode), - typeNode: propertySignature.type, - constraint: propertyName, - name: propertyName === "K" ? "P" : "K", - }; - } - return undefined; - } - function doChange(changes, sourceFile, _a) { - var container = _a.container, typeNode = _a.typeNode, constraint = _a.constraint, name = _a.name; - changes.replaceNode(sourceFile, container, ts.factory.createMappedTypeNode(/*readonlyToken*/ undefined, ts.factory.createTypeParameterDeclaration(name, ts.factory.createTypeReferenceNode(constraint)), /*nameType*/ undefined, /*questionToken*/ undefined, typeNode)); - } - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; (function (ts) { var codefix; (function (codefix) { @@ -135921,7 +132865,7 @@ var ts; var symbol = checker.getMergedSymbol(ts.skipAlias(exportedSymbol, checker)); var exportInfos = getAllReExportingModules(sourceFile, symbol, moduleSymbol, symbolName, host, program, useAutoImportProvider); var preferTypeOnlyImport = !!usageIsTypeOnly && compilerOptions.importsNotUsedAsValues === 2 /* Error */; - var useRequire = shouldUseRequire(sourceFile, program); + var useRequire = shouldUseRequire(sourceFile, compilerOptions); var fix = getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, /*position*/ undefined, preferTypeOnlyImport, useRequire, host, preferences); addImport({ fixes: [fix], symbolName: symbolName }); } @@ -136024,7 +132968,7 @@ var ts; function getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, symbolName, host, program, formatContext, position, preferences) { var compilerOptions = program.getCompilerOptions(); var exportInfos = getAllReExportingModules(sourceFile, exportedSymbol, moduleSymbol, symbolName, host, program, /*useAutoImportProvider*/ true); - var useRequire = shouldUseRequire(sourceFile, program); + var useRequire = shouldUseRequire(sourceFile, compilerOptions); var preferTypeOnlyImport = compilerOptions.importsNotUsedAsValues === 2 /* Error */ && !ts.isSourceFileJS(sourceFile) && ts.isValidTypeOnlyAliasUseSite(ts.getTokenAtPosition(sourceFile, position)); var moduleSpecifier = ts.first(getNewImportInfos(program, sourceFile, position, preferTypeOnlyImport, useRequire, exportInfos, host, preferences)).moduleSpecifier; var fix = getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, position, preferTypeOnlyImport, useRequire, host, preferences); @@ -136050,7 +132994,7 @@ var ts; return; } var defaultInfo = getDefaultLikeExportInfo(importingFile, moduleSymbol, checker, compilerOptions); - if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && ts.skipAlias(defaultInfo.symbol, checker) === exportedSymbol) { + if (defaultInfo && defaultInfo.name === symbolName && ts.skipAlias(defaultInfo.symbol, checker) === exportedSymbol) { result.push({ moduleSymbol: moduleSymbol, importKind: defaultInfo.kind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(defaultInfo.symbol, checker) }); } for (var _i = 0, _a = checker.getExportsAndPropertiesOfModule(moduleSymbol); _i < _a.length; _i++) { @@ -136106,11 +133050,11 @@ var ts; function getTargetModuleFromNamespaceLikeImport(declaration, checker) { var _a; switch (declaration.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return checker.getAliasedSymbol(declaration.symbol); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport); return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); default: @@ -136120,11 +133064,11 @@ var ts; function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return declaration.name.text; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text; default: return ts.Debug.assertNever(declaration); @@ -136133,10 +133077,10 @@ var ts; function tryAddToExistingImport(existingImports, canUseTypeOnlyImport) { return ts.firstDefined(existingImports, function (_a) { var declaration = _a.declaration, importKind = _a.importKind; - if (declaration.kind === 260 /* ImportEqualsDeclaration */) + if (declaration.kind === 257 /* ImportEqualsDeclaration */) return undefined; - if (declaration.kind === 249 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 196 /* ObjectBindingPattern */ + if (declaration.kind === 246 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 193 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind: importKind, moduleSpecifier: declaration.initializer.arguments[0].text, canUseTypeOnlyImport: false } : undefined; } @@ -136144,7 +133088,7 @@ var ts; if (!importClause) return undefined; var name = importClause.name, namedBindings = importClause.namedBindings; - return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 264 /* NamedImports */) + return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 261 /* NamedImports */) ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: importClause, importKind: importKind, moduleSpecifier: declaration.moduleSpecifier.getText(), canUseTypeOnlyImport: canUseTypeOnlyImport } : undefined; }); @@ -136157,38 +133101,15 @@ var ts; if (ts.isRequireVariableDeclaration(i.parent, /*requireStringLiteralLikeArgument*/ true)) { return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind } : undefined; } - if (i.kind === 261 /* ImportDeclaration */ || i.kind === 260 /* ImportEqualsDeclaration */) { + if (i.kind === 258 /* ImportDeclaration */ || i.kind === 257 /* ImportEqualsDeclaration */) { return checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined; } }); } - function shouldUseRequire(sourceFile, program) { - // 1. TypeScript files don't use require variable declarations - if (!ts.isSourceFileJS(sourceFile)) { - return false; - } - // 2. If the current source file is unambiguously CJS or ESM, go with that - if (sourceFile.commonJsModuleIndicator && !sourceFile.externalModuleIndicator) - return true; - if (sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) - return false; - // 3. If there's a tsconfig/jsconfig, use its module setting - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions.configFile) { - return ts.getEmitModuleKind(compilerOptions) < ts.ModuleKind.ES2015; - } - // 4. Match the first other JS file in the program that's unambiguously CJS or ESM - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var otherFile = _a[_i]; - if (otherFile === sourceFile || !ts.isSourceFileJS(otherFile) || program.isSourceFileFromExternalLibrary(otherFile)) - continue; - if (otherFile.commonJsModuleIndicator && !otherFile.externalModuleIndicator) - return true; - if (otherFile.externalModuleIndicator && !otherFile.commonJsModuleIndicator) - return false; - } - // 5. Literally nothing to go on - return true; + function shouldUseRequire(sourceFile, compilerOptions) { + return ts.isSourceFileJS(sourceFile) + && !sourceFile.externalModuleIndicator + && (!!sourceFile.commonJsModuleIndicator || ts.getEmitModuleKind(compilerOptions) < ts.ModuleKind.ES2015); } function getNewImportInfos(program, sourceFile, position, preferTypeOnlyImport, useRequire, moduleSymbols, host, preferences) { var isJs = ts.isSourceFileJS(sourceFile); @@ -136223,9 +133144,9 @@ var ts; } function newImportInfoFromExistingSpecifier(_a, preferTypeOnlyImport, useRequire) { var declaration = _a.declaration, importKind = _a.importKind; - var moduleSpecifier = declaration.kind === 261 /* ImportDeclaration */ ? declaration.moduleSpecifier : - declaration.kind === 249 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : - declaration.moduleReference.kind === 272 /* ExternalModuleReference */ ? declaration.moduleReference.expression : + var moduleSpecifier = declaration.kind === 258 /* ImportDeclaration */ ? declaration.moduleSpecifier : + declaration.kind === 246 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : + declaration.moduleReference.kind === 269 /* ExternalModuleReference */ ? declaration.moduleReference.expression : undefined; return moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier.text, importKind: importKind, typeOnly: preferTypeOnlyImport, useRequire: useRequire } @@ -136247,7 +133168,7 @@ var ts; var symbol = checker.getAliasedSymbol(umdSymbol); var symbolName = umdSymbol.name; var exportInfos = [{ moduleSymbol: symbol, importKind: getUmdImportKind(sourceFile, program.getCompilerOptions()), exportedSymbolIsTypeOnly: false }]; - var useRequire = shouldUseRequire(sourceFile, program); + var useRequire = shouldUseRequire(sourceFile, program.getCompilerOptions()); var fixes = getFixForImport(exportInfos, symbolName, ts.isIdentifier(token) ? token.getStart(sourceFile) : undefined, /*preferTypeOnlyImport*/ false, useRequire, program, sourceFile, host, preferences); return { fixes: fixes, symbolName: symbolName }; } @@ -136296,8 +133217,8 @@ var ts; ts.Debug.assert(symbolName !== "default" /* Default */, "'default' isn't a legal identifier and couldn't occur here"); var compilerOptions = program.getCompilerOptions(); var preferTypeOnlyImport = compilerOptions.importsNotUsedAsValues === 2 /* Error */ && ts.isValidTypeOnlyAliasUseSite(symbolToken); - var useRequire = shouldUseRequire(sourceFile, program); - var exportInfos = getExportInfos(symbolName, ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host); + var useRequire = shouldUseRequire(sourceFile, compilerOptions); + var exportInfos = getExportInfos(symbolName, ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, checker, program, useAutoImportProvider, host); var fixes = ts.arrayFrom(ts.flatMapIterator(exportInfos.entries(), function (_a) { var _ = _a[0], exportInfos = _a[1]; return getFixForImport(exportInfos, symbolName, symbolToken.getStart(sourceFile), preferTypeOnlyImport, useRequire, program, sourceFile, host, preferences); @@ -136315,25 +133236,23 @@ var ts; return symbolToken.text; } // Returns a map from an exported symbol's ID to a list of every way it's (re-)exported. - function getExportInfos(symbolName, currentTokenMeaning, cancellationToken, sourceFile, program, useAutoImportProvider, host) { + function getExportInfos(symbolName, currentTokenMeaning, cancellationToken, sourceFile, checker, program, useAutoImportProvider, host) { // For each original symbol, keep all re-exports of that symbol together so we can call `getCodeActionsForImport` on the whole group at once. // Maps symbol id to info for modules providing that symbol (original export + re-exports). var originalSymbolToExportInfos = ts.createMultiMap(); - function addSymbol(moduleSymbol, exportedSymbol, importKind, checker) { + function addSymbol(moduleSymbol, exportedSymbol, importKind) { originalSymbolToExportInfos.add(ts.getUniqueSymbolId(exportedSymbol, checker).toString(), { moduleSymbol: moduleSymbol, importKind: importKind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(exportedSymbol, checker) }); } - forEachExternalModuleToImportFrom(program, host, sourceFile, /*filterByPackageJson*/ true, useAutoImportProvider, function (moduleSymbol, _, program) { - var checker = program.getTypeChecker(); + forEachExternalModuleToImportFrom(program, host, sourceFile, /*filterByPackageJson*/ true, useAutoImportProvider, function (moduleSymbol) { cancellationToken.throwIfCancellationRequested(); - var compilerOptions = program.getCompilerOptions(); - var defaultInfo = getDefaultLikeExportInfo(sourceFile, moduleSymbol, checker, compilerOptions); - if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) { - addSymbol(moduleSymbol, defaultInfo.symbol, defaultInfo.kind, checker); + var defaultInfo = getDefaultLikeExportInfo(sourceFile, moduleSymbol, checker, program.getCompilerOptions()); + if (defaultInfo && defaultInfo.name === symbolName && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) { + addSymbol(moduleSymbol, defaultInfo.symbol, defaultInfo.kind); } // check exports with the same name var exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName, moduleSymbol); if (exportSymbolWithIdenticalName && symbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { - addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */, checker); + addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */); } }); return originalSymbolToExportInfos; @@ -136387,13 +133306,7 @@ var ts; return { symbolForMeaning: defaultExport, name: name }; if (defaultExport.flags & 2097152 /* Alias */) { var aliased = checker.getImmediateAliasedSymbol(defaultExport); - if (aliased && aliased.parent) { - // - `aliased` will be undefined if the module is exporting an unresolvable name, - // but we can still offer completions for it. - // - `aliased.parent` will be undefined if the module is exporting `globalThis.something`, - // or another expression that resolves to a global. - return getDefaultExportInfoWorker(aliased, aliased.parent, checker, compilerOptions); - } + return aliased && getDefaultExportInfoWorker(aliased, ts.Debug.checkDefined(aliased.parent, "Alias targets of default exports must have a parent"), checker, compilerOptions); } if (defaultExport.escapedName !== "default" /* Default */ && defaultExport.escapedName !== "export=" /* ExportEquals */) { @@ -136449,7 +133362,7 @@ var ts; } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, canUseTypeOnlyImport) { - if (clause.kind === 196 /* ObjectBindingPattern */) { + if (clause.kind === 193 /* ObjectBindingPattern */) { if (defaultImport) { addElementToBindingPattern(clause, defaultImport, "default"); } @@ -136483,7 +133396,7 @@ var ts; else if (existingSpecifiers === null || existingSpecifiers === void 0 ? void 0 : existingSpecifiers.length) { for (var _b = 0, newSpecifiers_2 = newSpecifiers; _b < newSpecifiers_2.length; _b++) { var spec = newSpecifiers_2[_b]; - changes.insertNodeInListAfter(sourceFile, ts.last(existingSpecifiers), spec, existingSpecifiers); + changes.insertNodeAtEndOfList(sourceFile, existingSpecifiers, spec); } } else { @@ -136856,7 +133769,7 @@ var ts; }); function getNamedTupleMember(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); - return ts.findAncestor(token, function (t) { return t.kind === 192 /* NamedTupleMember */; }); + return ts.findAncestor(token, function (t) { return t.kind === 191 /* NamedTupleMember */; }); } function doChange(changes, sourceFile, namedTupleMember) { if (!namedTupleMember) { @@ -136865,11 +133778,11 @@ var ts; var unwrappedType = namedTupleMember.type; var sawOptional = false; var sawRest = false; - while (unwrappedType.kind === 180 /* OptionalType */ || unwrappedType.kind === 181 /* RestType */ || unwrappedType.kind === 186 /* ParenthesizedType */) { - if (unwrappedType.kind === 180 /* OptionalType */) { + while (unwrappedType.kind === 179 /* OptionalType */ || unwrappedType.kind === 180 /* RestType */ || unwrappedType.kind === 185 /* ParenthesizedType */) { + if (unwrappedType.kind === 179 /* OptionalType */) { sawOptional = true; } - else if (unwrappedType.kind === 181 /* RestType */) { + else if (unwrappedType.kind === 180 /* RestType */) { sawRest = true; } unwrappedType = unwrappedType.type; @@ -136893,7 +133806,7 @@ var ts; ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code, - ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code, + ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2.code, // for JSX class components ts.Diagnostics.No_overload_matches_this_call.code, // for JSX FC @@ -136940,12 +133853,6 @@ var ts; } suggestedSymbol = checker.getSuggestedSymbolForNonexistentProperty(node, containingType); } - else if (ts.isQualifiedName(parent) && parent.right === node) { - var symbol = checker.getSymbolAtLocation(parent.left); - if (symbol && symbol.flags & 1536 /* Module */) { - suggestedSymbol = checker.getSuggestedSymbolForNonexistentModule(parent.right, symbol); - } - } else if (ts.isImportSpecifier(parent) && parent.name === node) { ts.Debug.assertNode(node, ts.isIdentifier, "Expected an identifier for spelling (import)"); var importDeclaration = ts.findAncestor(node, ts.isImportDeclaration); @@ -137169,19 +134076,19 @@ var ts; } function getVariableLikeInitializer(declaration) { switch (declaration.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: return declaration.initializer; - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return declaration.initializer && (ts.isJsxExpression(declaration.initializer) ? declaration.initializer.expression : undefined); - case 289 /* ShorthandPropertyAssignment */: - case 162 /* PropertySignature */: - case 291 /* EnumMember */: - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: + case 286 /* ShorthandPropertyAssignment */: + case 161 /* PropertySignature */: + case 288 /* EnumMember */: + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: return undefined; } } @@ -137367,7 +134274,7 @@ var ts; function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, token, makeStatic) { var tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 221 /* ClassExpression */) { + if (classDeclaration.kind === 218 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -137419,7 +134326,7 @@ var ts; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 216 /* BinaryExpression */) { + if (token.parent.parent.kind === 213 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -137458,7 +134365,7 @@ var ts; } function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.factory.createKeywordTypeNode(147 /* StringKeyword */); + var stringTypeNode = ts.factory.createKeywordTypeNode(146 /* StringKeyword */); var indexingParameter = ts.factory.createParameterDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -137509,7 +134416,7 @@ var ts; */ var hasStringInitializer = ts.some(enumDeclaration.members, function (member) { var type = checker.getTypeAtLocation(member); - return !!(type && type.flags & 402653316 /* StringLike */); + return !!(type && type.flags & 132 /* StringLike */); }); var enumMember = ts.factory.createEnumMember(token, hasStringInitializer ? ts.factory.createStringLiteral(token.text) : undefined); changes.replaceNode(enumDeclaration.getSourceFile(), enumDeclaration, ts.factory.updateEnumDeclaration(enumDeclaration, enumDeclaration.decorators, enumDeclaration.modifiers, enumDeclaration.name, ts.concatenate(enumDeclaration.members, ts.singleElementArray(enumMember))), { @@ -138033,7 +134940,7 @@ var ts; if (!isValidCharacter(character)) { return; } - var replacement = useHtmlEntity ? htmlEntity[character] : "{" + ts.quote(sourceFile, preferences, character) + "}"; + var replacement = useHtmlEntity ? htmlEntity[character] : "{" + ts.quote(character, preferences) + "}"; changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -138175,7 +135082,7 @@ var ts; }, }); function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */)); + changes.replaceNode(sourceFile, token.parent, ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */)); } function createDeleteFix(changes, diag) { return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations); @@ -138191,7 +135098,7 @@ var ts; return ts.isVariableDeclarationList(token.parent) && ts.first(token.parent.getChildren(sourceFile)) === token; } function deleteEntireVariableStatement(changes, sourceFile, node) { - changes.delete(sourceFile, node.parent.kind === 232 /* VariableStatement */ ? node.parent : node); + changes.delete(sourceFile, node.parent.kind === 229 /* VariableStatement */ ? node.parent : node); } function deleteDestructuringElements(changes, sourceFile, node) { ts.forEach(node.elements, function (n) { return changes.delete(sourceFile, n); }); @@ -138216,14 +135123,14 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 160 /* Parameter */: - case 159 /* TypeParameter */: + case 159 /* Parameter */: + case 158 /* TypeParameter */: return true; - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: return true; } } @@ -138255,10 +135162,12 @@ var ts; } function tryDeleteParameter(changes, sourceFile, p, checker, sourceFiles, isFixAll) { if (isFixAll === void 0) { isFixAll = false; } - if (mayDeleteParameter(checker, sourceFile, p, isFixAll)) { - if (p.modifiers && p.modifiers.length > 0 && - (!ts.isIdentifier(p.name) || ts.FindAllReferences.Core.isSymbolReferencedInFile(p.name, checker, sourceFile))) { - p.modifiers.forEach(function (modifier) { return changes.deleteModifier(sourceFile, modifier); }); + if (mayDeleteParameter(p, checker, isFixAll)) { + if (p.modifiers && p.modifiers.length > 0 + && (!ts.isIdentifier(p.name) || ts.FindAllReferences.Core.isSymbolReferencedInFile(p.name, checker, sourceFile))) { + p.modifiers.forEach(function (modifier) { + changes.deleteModifier(sourceFile, modifier); + }); } else { changes.delete(sourceFile, p); @@ -138266,28 +135175,29 @@ var ts; } } } - function mayDeleteParameter(checker, sourceFile, parameter, isFixAll) { - var parent = parameter.parent; + function mayDeleteParameter(p, checker, isFixAll) { + var parent = p.parent; switch (parent.kind) { - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // Don't remove a parameter if this overrides something. var symbol = checker.getSymbolAtLocation(parent.name); if (ts.isMemberSymbolInBaseType(symbol, checker)) return false; // falls through - case 166 /* Constructor */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: return true; - case 251 /* FunctionDeclaration */: { - if (parent.name && isCallbackLike(checker, sourceFile, parent.name)) { - return isLastParameter(parent, parameter, isFixAll); - } - return true; - } - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: { // Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused. - return isLastParameter(parent, parameter, isFixAll); - case 168 /* SetAccessor */: + var parameters = parent.parameters; + var index = parameters.indexOf(p); + ts.Debug.assert(index !== -1, "The parameter should already be in the list"); + return isFixAll + ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 78 /* Identifier */ && !p.symbol.isReferenced; }) + : index === parameters.length - 1; + } + case 167 /* SetAccessor */: // Setter must have a parameter return false; default: @@ -138302,19 +135212,6 @@ var ts; } }); } - function isCallbackLike(checker, sourceFile, name) { - return !!ts.FindAllReferences.Core.eachSymbolReferenceInFile(name, checker, sourceFile, function (reference) { - return ts.isIdentifier(reference) && ts.isCallExpression(reference.parent) && reference.parent.arguments.indexOf(reference) >= 0; - }); - } - function isLastParameter(func, parameter, isFixAll) { - var parameters = func.parameters; - var index = parameters.indexOf(parameter); - ts.Debug.assert(index !== -1, "The parameter should already be in the list"); - return isFixAll ? - parameters.slice(index + 1).every(function (p) { return ts.isIdentifier(p.name) && !p.symbol.isReferenced; }) : - index === parameters.length - 1; - } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -138349,7 +135246,7 @@ var ts; var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent; if (!ts.isBlock(statement.parent) || statement === ts.first(statement.parent.statements)) { switch (container.kind) { - case 234 /* IfStatement */: + case 231 /* IfStatement */: if (container.elseStatement) { if (ts.isBlock(statement.parent)) { break; @@ -138360,8 +135257,8 @@ var ts; return; } // falls through - case 236 /* WhileStatement */: - case 237 /* ForStatement */: + case 233 /* WhileStatement */: + case 234 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -138434,7 +135331,7 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 305 /* JSDocNullableType */) { + if (typeNode.kind === 301 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); @@ -138454,7 +135351,7 @@ var ts; if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 305 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + var fixedType = typeNode.kind === 301 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -138471,22 +135368,22 @@ var ts; // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 224 /* AsExpression */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 251 /* FunctionDeclaration */: - case 167 /* GetAccessor */: - case 171 /* IndexSignature */: - case 190 /* MappedType */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 168 /* SetAccessor */: - case 254 /* TypeAliasDeclaration */: - case 206 /* TypeAssertionExpression */: - case 249 /* VariableDeclaration */: + case 221 /* AsExpression */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 248 /* FunctionDeclaration */: + case 166 /* GetAccessor */: + case 170 /* IndexSignature */: + case 189 /* MappedType */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 167 /* SetAccessor */: + case 251 /* TypeAliasDeclaration */: + case 203 /* TypeAssertionExpression */: + case 246 /* VariableDeclaration */: return true; default: return false; @@ -138588,14 +135485,14 @@ var ts; } var insertBefore; switch (containingFunction.kind) { - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 97 /* FunctionKeyword */, sourceFile); break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -138674,7 +135571,7 @@ var ts; else { ts.Debug.fail("fixPropertyOverrideAccessor codefix got unexpected error code " + code); } - return codefix.generateAccessorFromProperty(file, context.program, startPosition, endPosition, context, ts.Diagnostics.Generate_get_and_set_accessors.message); + return codefix.generateAccessorFromProperty(file, startPosition, endPosition, context, ts.Diagnostics.Generate_get_and_set_accessors.message); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -138928,7 +135825,7 @@ var ts; function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (ts.isInJSFile(sourceFile) && declaration.kind !== 162 /* PropertySignature */) { + if (ts.isInJSFile(sourceFile) && declaration.kind !== 161 /* PropertySignature */) { var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration; if (!parent) { return; @@ -138977,14 +135874,14 @@ var ts; return !!merged; }); }); var tag = ts.factory.createJSDocComment(comments.join("\n"), ts.factory.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags))); - var jsDocNode = parent.kind === 209 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; + var jsDocNode = parent.kind === 206 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; jsDocNode.jsDoc = parent.jsDoc; jsDocNode.jsDocCache = parent.jsDocCache; changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag); } codefix.addJSDocTags = addJSDocTags; function getJsDocNodeForArrowFunction(signature) { - if (signature.parent.kind === 163 /* PropertyDeclaration */) { + if (signature.parent.kind === 162 /* PropertyDeclaration */) { return signature.parent; } return signature.parent.parent; @@ -138994,14 +135891,14 @@ var ts; return undefined; } switch (oldTag.kind) { - case 326 /* JSDocParameterTag */: { + case 322 /* JSDocParameterTag */: { var oldParam = oldTag; var newParam = newTag; return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts.factory.createJSDocParameterTag(/*tagName*/ undefined, newParam.name, /*isBracketed*/ false, newParam.typeExpression, newParam.isNameFirst, oldParam.comment) : undefined; } - case 327 /* JSDocReturnTag */: + case 323 /* JSDocReturnTag */: return ts.factory.createJSDocReturnTag(/*tagName*/ undefined, newTag.typeExpression, oldTag.comment); } } @@ -139026,18 +135923,18 @@ var ts; function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { var searchToken; switch (containingFunction.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: searchToken = ts.findChildOfKind(containingFunction, 132 /* ConstructorKeyword */, sourceFile); break; - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: var parent = containingFunction.parent; searchToken = ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) ? parent.name : containingFunction.name; break; - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: searchToken = containingFunction.name; break; } @@ -139179,24 +136076,24 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: inferTypeFromExpressionStatement(node, usage); break; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } @@ -139204,20 +136101,20 @@ var ts; inferTypeFromContextualType(node, usage); } break; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { var _a = node.parent, name = _a.name, initializer = _a.initializer; if (node === name) { if (initializer) { // This can happen for `let x = null;` which still has an implicit-any error. @@ -139312,7 +136209,7 @@ var ts; else if (otherOperandType.flags & 296 /* NumberLike */) { usage.isNumber = true; } - else if (otherOperandType.flags & 402653316 /* StringLike */) { + else if (otherOperandType.flags & 132 /* StringLike */) { usage.isString = true; } else if (otherOperandType.flags & 1 /* Any */) { @@ -139339,7 +136236,7 @@ var ts; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: if (node === parent.left && - (node.parent.parent.kind === 249 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 246 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usage, checker.getTypeAtLocation(parent.right)); @@ -139367,7 +136264,7 @@ var ts; } } calculateUsageOfNode(parent, call.return_); - if (parent.kind === 203 /* CallExpression */) { + if (parent.kind === 200 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { @@ -139810,8 +136707,8 @@ var ts; var ambient = !!(enclosingDeclaration.flags & 8388608 /* Ambient */); var quotePreference = ts.getQuotePreference(sourceFile, preferences); switch (declaration.kind) { - case 162 /* PropertySignature */: - case 163 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 162 /* PropertyDeclaration */: var flags = quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined; var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { @@ -139825,8 +136722,8 @@ var ts; /*decorators*/ undefined, modifiers, name, optional ? ts.factory.createToken(57 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: { + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: { var typeNode_1 = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); var allAccessors = ts.getAllAccessorDeclarations(declarations, declaration); var orderedAccessors = allAccessors.secondAccessor @@ -139855,8 +136752,8 @@ var ts; } break; } - case 164 /* MethodSignature */: - case 165 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 164 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -139902,7 +136799,7 @@ var ts; var checker = program.getTypeChecker(); var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions()); var flags = 1 /* NoTruncation */ | 1073741824 /* NoUndefinedOptionalParameterType */ | 256 /* SuppressAnyReturnType */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0); - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 165 /* MethodDeclaration */, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 164 /* MethodDeclaration */, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -140151,8 +137048,8 @@ var ts; (function (ts) { var codefix; (function (codefix) { - function generateAccessorFromProperty(file, program, start, end, context, _actionName) { - var fieldInfo = getAccessorConvertiblePropertyAtPosition(file, program, start, end); + function generateAccessorFromProperty(file, start, end, context, _actionName) { + var fieldInfo = getAccessorConvertiblePropertyAtPosition(file, start, end); if (!fieldInfo || !fieldInfo.info) return undefined; var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); @@ -140175,7 +137072,7 @@ var ts; fieldModifiers = createModifiers(prepareModifierFlagsForField(modifierFlags)); } } - updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, fieldModifiers); + updateFieldDeclaration(changeTracker, file, declaration, fieldName, fieldModifiers); var getAccessor = generateGetAccessor(fieldName, accessorName, type, accessorModifiers, isStatic, container); ts.suppressLeadingAndTrailingTrivia(getAccessor); insertAccessor(changeTracker, file, getAccessor, declaration, container); @@ -140224,7 +137121,7 @@ var ts; modifierFlags |= 8 /* Private */; return modifierFlags; } - function getAccessorConvertiblePropertyAtPosition(file, program, start, end, considerEmptySpans) { + function getAccessorConvertiblePropertyAtPosition(file, start, end, considerEmptySpans) { if (considerEmptySpans === void 0) { considerEmptySpans = true; } var node = ts.getTokenAtPosition(file, start); var cursorRequest = start === end && considerEmptySpans; @@ -140254,8 +137151,8 @@ var ts; info: { isStatic: ts.hasStaticModifier(declaration), isReadonly: ts.hasEffectiveReadonlyModifier(declaration), - type: getDeclarationType(declaration, program), - container: declaration.kind === 160 /* Parameter */ ? declaration.parent.parent : declaration.parent, + type: ts.getTypeAnnotationNode(declaration), + container: declaration.kind === 159 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, @@ -140283,17 +137180,17 @@ var ts; ts.factory.createExpressionStatement(ts.factory.createAssignment(createAccessorAccessExpression(fieldName, isStatic, container), ts.factory.createIdentifier("value"))) ], /*multiLine*/ true)); } - function updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) { - var property = ts.factory.updatePropertyDeclaration(declaration, declaration.decorators, modifiers, fieldName, declaration.questionToken || declaration.exclamationToken, type, declaration.initializer); + function updatePropertyDeclaration(changeTracker, file, declaration, fieldName, modifiers) { + var property = ts.factory.updatePropertyDeclaration(declaration, declaration.decorators, modifiers, fieldName, declaration.questionToken || declaration.exclamationToken, declaration.type, declaration.initializer); changeTracker.replaceNode(file, declaration, property); } function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) { var assignment = ts.factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer); changeTracker.replacePropertyAssignment(file, declaration, assignment); } - function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) { + function updateFieldDeclaration(changeTracker, file, declaration, fieldName, modifiers) { if (ts.isPropertyDeclaration(declaration)) { - updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers); + updatePropertyDeclaration(changeTracker, file, declaration, fieldName, modifiers); } else if (ts.isPropertyAssignment(declaration)) { updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName); @@ -140326,18 +137223,6 @@ var ts; } }); } - function getDeclarationType(declaration, program) { - var typeNode = ts.getTypeAnnotationNode(declaration); - if (ts.isPropertyDeclaration(declaration) && typeNode && declaration.questionToken) { - var typeChecker = program.getTypeChecker(); - var type = typeChecker.getTypeFromTypeNode(typeNode); - if (!typeChecker.isTypeAssignableTo(typeChecker.getUndefinedType(), type)) { - var types = ts.isUnionTypeNode(typeNode) ? typeNode.types : [typeNode]; - return ts.factory.createUnionTypeNode(__spreadArrays(types, [ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)])); - } - } - return typeNode; - } function getAllSupers(decl, checker) { var res = []; while (decl) { @@ -140391,7 +137276,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 203 /* CallExpression */ : 204 /* NewExpression */; + var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 200 /* CallExpression */ : 201 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind; }); if (!node) { return []; @@ -140510,7 +137395,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, ts.Diagnostics.Add_undefined_type_to_all_uninitialized_properties); } function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { - var undefinedTypeNode = ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */); + var undefinedTypeNode = ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */); var type = propertyDeclaration.type; // TODO: GH#18217 var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode]; changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.factory.createUnionTypeNode(types)); @@ -140725,7 +137610,7 @@ var ts; function getImportTypeNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); ts.Debug.assert(token.kind === 99 /* ImportKeyword */, "This token should be an ImportKeyword"); - ts.Debug.assert(token.parent.kind === 195 /* ImportType */, "Token parent should be an ImportType"); + ts.Debug.assert(token.parent.kind === 192 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange(changes, sourceFile, importType) { @@ -140857,8 +137742,7 @@ var ts; var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); }); var parameter = ts.first(indexSignature.parameters); var mappedTypeParameter = ts.factory.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type); - var mappedIntersectionType = ts.factory.createMappedTypeNode(ts.hasEffectiveReadonlyModifier(indexSignature) ? ts.factory.createModifier(142 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, - /*nameType*/ undefined, indexSignature.questionToken, indexSignature.type); + var mappedIntersectionType = ts.factory.createMappedTypeNode(ts.hasEffectiveReadonlyModifier(indexSignature) ? ts.factory.createModifier(141 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); var intersectionType = ts.factory.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [ mappedIntersectionType ], (otherMembers.length ? [ts.factory.createTypeLiteralNode(otherMembers)] : ts.emptyArray))); @@ -141047,90 +137931,6 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; -(function (ts) { - var codefix; - (function (codefix) { - var fixName = "addVoidToPromise"; - var fixId = "addVoidToPromise"; - var errorCodes = [ - ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code - ]; - codefix.registerCodeFix({ - errorCodes: errorCodes, - fixIds: [fixId], - getCodeActions: function (context) { - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span, context.program); }); - if (changes.length > 0) { - return [codefix.createCodeFixAction(fixName, changes, ts.Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId, ts.Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]; - } - }, - getAllCodeActions: function (context) { - return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag, context.program, new ts.Set()); }); - } - }); - function makeChange(changes, sourceFile, span, program, seen) { - var node = ts.getTokenAtPosition(sourceFile, span.start); - if (!ts.isIdentifier(node) || !ts.isCallExpression(node.parent) || node.parent.expression !== node || node.parent.arguments.length !== 0) - return; - var checker = program.getTypeChecker(); - var symbol = checker.getSymbolAtLocation(node); - // decl should be `new Promise(() => {})` - var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration; - if (!decl || !ts.isParameter(decl) || !ts.isNewExpression(decl.parent.parent)) - return; - // no need to make this change if we have already seen this parameter. - if (seen === null || seen === void 0 ? void 0 : seen.has(decl)) - return; - seen === null || seen === void 0 ? void 0 : seen.add(decl); - var typeArguments = getEffectiveTypeArguments(decl.parent.parent); - if (ts.some(typeArguments)) { - // append ` | void` to type argument - var typeArgument = typeArguments[0]; - var needsParens = !ts.isUnionTypeNode(typeArgument) && !ts.isParenthesizedTypeNode(typeArgument) && - ts.isParenthesizedTypeNode(ts.factory.createUnionTypeNode([typeArgument, ts.factory.createKeywordTypeNode(113 /* VoidKeyword */)]).types[0]); - if (needsParens) { - changes.insertText(sourceFile, typeArgument.pos, "("); - } - changes.insertText(sourceFile, typeArgument.end, needsParens ? ") | void" : " | void"); - } - else { - // make sure the Promise is type is untyped (i.e., `unknown`) - var signature = checker.getResolvedSignature(node.parent); - var parameter = signature === null || signature === void 0 ? void 0 : signature.parameters[0]; - var parameterType = parameter && checker.getTypeOfSymbolAtLocation(parameter, decl.parent.parent); - if (ts.isInJSFile(decl)) { - if (!parameterType || parameterType.flags & 3 /* AnyOrUnknown */) { - // give the expression a type - changes.insertText(sourceFile, decl.parent.parent.end, ")"); - changes.insertText(sourceFile, ts.skipTrivia(sourceFile.text, decl.parent.parent.pos), "/** @type {Promise} */("); - } - } - else { - if (!parameterType || parameterType.flags & 2 /* Unknown */) { - // add `void` type argument - changes.insertText(sourceFile, decl.parent.parent.expression.end, ""); - } - } - } - } - function getEffectiveTypeArguments(node) { - var _a; - if (ts.isInJSFile(node)) { - if (ts.isParenthesizedExpression(node.parent)) { - var jsDocType = (_a = ts.getJSDocTypeTag(node.parent)) === null || _a === void 0 ? void 0 : _a.typeExpression.type; - if (jsDocType && ts.isTypeReferenceNode(jsDocType) && ts.isIdentifier(jsDocType.typeName) && ts.idText(jsDocType.typeName) === "Promise") { - return jsDocType.typeArguments; - } - } - } - else { - return node.typeArguments; - } - } - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; (function (ts) { var refactor; (function (refactor) { @@ -141178,16 +137978,16 @@ var ts; return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.This_file_already_has_a_default_export) }; } switch (exportNode.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 256 /* ModuleDeclaration */: { + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 253 /* ModuleDeclaration */: { var node = exportNode; return node.name && ts.isIdentifier(node.name) ? { info: { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } } : undefined; } - case 232 /* VariableStatement */: { + case 229 /* VariableStatement */: { var vs = exportNode; // Must be `export const x = something;`. if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { @@ -141215,23 +138015,22 @@ var ts; else { var exportKeyword = ts.Debug.checkDefined(ts.findModifier(exportNode, 92 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.factory.createToken(87 /* DefaultKeyword */)); break; - case 232 /* VariableStatement */: - // If 'x' isn't used in this file and doesn't have type definition, `export const x = 0;` --> `export default 0;` - var decl = ts.first(exportNode.declarationList.declarations); - if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile) && !decl.type) { + case 229 /* VariableStatement */: + // If 'x' isn't used in this file, `export const x = 0;` --> `export default 0;` + if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile)) { // We checked in `getInfo` that an initializer exists. - changes.replaceNode(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.Debug.checkDefined(decl.initializer, "Initializer was previously known to be present"))); + changes.replaceNode(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.Debug.checkDefined(ts.first(exportNode.declarationList.declarations).initializer, "Initializer was previously known to be present"))); break; } // falls through - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 256 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 253 /* ModuleDeclaration */: // `export type T = number;` -> `type T = number; export default T;` changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.factory.createIdentifier(exportName.text))); @@ -141258,18 +138057,18 @@ var ts; function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { var parent = ref.parent; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: // `a.default` --> `a.foo` changes.replaceNode(importingSourceFile, ref, ts.factory.createIdentifier(exportName)); break; - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: { + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: { var spec = parent; // `default as foo` --> `foo`, `default as bar` --> `foo as bar` changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 262 /* ImportClause */: { + case 259 /* ImportClause */: { var clause = parent; ts.Debug.assert(clause.name === ref, "Import clause name should match provided ref"); var spec = makeImportSpecifier(exportName, ref.text); @@ -141278,7 +138077,7 @@ var ts; // `import foo from "./a";` --> `import { foo } from "./a";` changes.replaceNode(importingSourceFile, ref, ts.factory.createNamedImports([spec])); } - else if (namedBindings.kind === 263 /* NamespaceImport */) { + else if (namedBindings.kind === 260 /* NamespaceImport */) { // `import foo, * as a from "./a";` --> `import * as a from ".a/"; import { foo } from "./a";` changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); var quotePreference = ts.isStringLiteral(clause.parent.moduleSpecifier) ? ts.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; @@ -141299,11 +138098,11 @@ var ts; function changeNamedToDefaultImport(importingSourceFile, ref, changes) { var parent = ref.parent; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: // `a.foo` --> `a.default` changes.replaceNode(importingSourceFile, ref, ts.factory.createIdentifier("default")); break; - case 265 /* ImportSpecifier */: { + case 262 /* ImportSpecifier */: { // `import { foo } from "./a";` --> `import foo from "./a";` // `import { foo as bar } from "./a";` --> `import bar from "./a";` var defaultImport = ts.factory.createIdentifier(parent.name.text); @@ -141316,7 +138115,7 @@ var ts; } break; } - case 270 /* ExportSpecifier */: { + case 267 /* ExportSpecifier */: { // `export { foo } from "./a";` --> `export { default as foo } from "./a";` // `export { foo as bar } from "./a";` --> `export { default as bar } from "./a";` // `export { foo as default } from "./a";` --> `export { default } from "./a";` @@ -141350,8 +138149,8 @@ var ts; if (!i) return ts.emptyArray; if (i.error === undefined) { - var description = i.info.kind === 263 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; - var actionName = i.info.kind === 263 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; + var description = i.info.kind === 260 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; + var actionName = i.info.kind === 260 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }]; } if (context.preferences.provideRefactorNotApplicableReason) { @@ -141390,7 +138189,7 @@ var ts; } function doChange(sourceFile, program, changes, toConvert) { var checker = program.getTypeChecker(); - if (toConvert.kind === 263 /* NamespaceImport */) { + if (toConvert.kind === 260 /* NamespaceImport */) { doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())); } else { @@ -141561,6 +138360,7 @@ var ts; if (!finalExpression || checker.isNullableType(checker.getTypeAtLocation(finalExpression))) { return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_convertible_access_expression) }; } + ; if ((ts.isPropertyAccessExpression(condition) || ts.isIdentifier(condition)) && getMatchingStart(condition, finalExpression.expression)) { return { info: { finalExpression: finalExpression, occurrences: [condition], expression: expression } }; @@ -141607,25 +138407,23 @@ var ts; * Returns subchain if chain begins with subchain syntactically. */ function getMatchingStart(chain, subchain) { - if (!ts.isIdentifier(subchain) && !ts.isPropertyAccessExpression(subchain) && !ts.isElementAccessExpression(subchain)) { - return undefined; - } - return chainStartsWith(chain, subchain) ? subchain : undefined; + return (ts.isIdentifier(subchain) || ts.isPropertyAccessExpression(subchain)) && + chainStartsWith(chain, subchain) ? subchain : undefined; } /** * Returns true if chain begins with subchain syntactically. */ function chainStartsWith(chain, subchain) { // skip until we find a matching identifier. - while (ts.isCallExpression(chain) || ts.isPropertyAccessExpression(chain) || ts.isElementAccessExpression(chain)) { - if (getTextOfChainNode(chain) === getTextOfChainNode(subchain)) + while (ts.isCallExpression(chain) || ts.isPropertyAccessExpression(chain)) { + var subchainName = ts.isPropertyAccessExpression(subchain) ? subchain.name.getText() : subchain.getText(); + if (ts.isPropertyAccessExpression(chain) && chain.name.getText() === subchainName) break; chain = chain.expression; } - // check that the chains match at each access. Call chains in subchain are not valid. - while ((ts.isPropertyAccessExpression(chain) && ts.isPropertyAccessExpression(subchain)) || - (ts.isElementAccessExpression(chain) && ts.isElementAccessExpression(subchain))) { - if (getTextOfChainNode(chain) !== getTextOfChainNode(subchain)) + // check that the chains match at each access. Call chains in subchain are not valid. + while (ts.isPropertyAccessExpression(chain) && ts.isPropertyAccessExpression(subchain)) { + if (chain.name.getText() !== subchain.name.getText()) return false; chain = chain.expression; subchain = subchain.expression; @@ -141633,18 +138431,6 @@ var ts; // check if we have reached a final identifier. return ts.isIdentifier(chain) && ts.isIdentifier(subchain) && chain.getText() === subchain.getText(); } - function getTextOfChainNode(node) { - if (ts.isIdentifier(node) || ts.isStringOrNumericLiteralLike(node)) { - return node.getText(); - } - if (ts.isPropertyAccessExpression(node)) { - return getTextOfChainNode(node.name); - } - if (ts.isElementAccessExpression(node)) { - return getTextOfChainNode(node.argumentExpression); - } - return undefined; - } /** * Find the least ancestor of the input node that is a valid type for extraction and contains the input span. */ @@ -141697,7 +138483,7 @@ var ts; return getFinalExpressionInChain(node.left); } // foo && |foo.bar()()| - nested calls are treated like further accesses. - else if ((ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) || ts.isCallExpression(node)) && !ts.isOptionalChain(node)) { + else if ((ts.isPropertyAccessExpression(node) || ts.isCallExpression(node)) && !ts.isOptionalChain(node)) { return node; } return undefined; @@ -141706,7 +138492,7 @@ var ts; * Creates an access chain from toConvert with '?.' accesses at expressions appearing in occurrences. */ function convertOccurrences(checker, toConvert, occurrences) { - if (ts.isPropertyAccessExpression(toConvert) || ts.isElementAccessExpression(toConvert) || ts.isCallExpression(toConvert)) { + if (ts.isPropertyAccessExpression(toConvert) || ts.isCallExpression(toConvert)) { var chain = convertOccurrences(checker, toConvert.expression, occurrences); var lastOccurrence = occurrences.length > 0 ? occurrences[occurrences.length - 1] : undefined; var isOccurrence = (lastOccurrence === null || lastOccurrence === void 0 ? void 0 : lastOccurrence.getText()) === toConvert.expression.getText(); @@ -141722,11 +138508,6 @@ var ts; ts.factory.createPropertyAccessChain(chain, ts.factory.createToken(28 /* QuestionDotToken */), toConvert.name) : ts.factory.createPropertyAccessChain(chain, toConvert.questionDotToken, toConvert.name); } - else if (ts.isElementAccessExpression(toConvert)) { - return isOccurrence ? - ts.factory.createElementAccessChain(chain, ts.factory.createToken(28 /* QuestionDotToken */), toConvert.argumentExpression) : - ts.factory.createElementAccessChain(chain, toConvert.questionDotToken, toConvert.argumentExpression); - } } return toConvert; } @@ -141734,7 +138515,7 @@ var ts; var finalExpression = info.finalExpression, occurrences = info.occurrences, expression = info.expression; var firstOccurrence = occurrences[occurrences.length - 1]; var convertedChain = convertOccurrences(checker, finalExpression, occurrences); - if (convertedChain && (ts.isPropertyAccessExpression(convertedChain) || ts.isElementAccessExpression(convertedChain) || ts.isCallExpression(convertedChain))) { + if (convertedChain && (ts.isPropertyAccessExpression(convertedChain) || ts.isCallExpression(convertedChain))) { if (ts.isBinaryExpression(expression)) { changes.replaceNodeRange(sourceFile, firstOccurrence, finalExpression, convertedChain); } @@ -141779,27 +138560,27 @@ var ts; var lastDeclaration = signatureDecls[signatureDecls.length - 1]; var updated = lastDeclaration; switch (lastDeclaration.kind) { - case 164 /* MethodSignature */: { + case 163 /* MethodSignature */: { updated = ts.factory.updateMethodSignature(lastDeclaration, lastDeclaration.modifiers, lastDeclaration.name, lastDeclaration.questionToken, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); break; } - case 165 /* MethodDeclaration */: { + case 164 /* MethodDeclaration */: { updated = ts.factory.updateMethodDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, lastDeclaration.asteriskToken, lastDeclaration.name, lastDeclaration.questionToken, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type, lastDeclaration.body); break; } - case 169 /* CallSignature */: { + case 168 /* CallSignature */: { updated = ts.factory.updateCallSignature(lastDeclaration, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); break; } - case 166 /* Constructor */: { + case 165 /* Constructor */: { updated = ts.factory.updateConstructorDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.body); break; } - case 170 /* ConstructSignature */: { + case 169 /* ConstructSignature */: { updated = ts.factory.updateConstructSignature(lastDeclaration, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); break; } - case 251 /* FunctionDeclaration */: { + case 248 /* FunctionDeclaration */: { updated = ts.factory.updateFunctionDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, lastDeclaration.asteriskToken, lastDeclaration.name, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type, lastDeclaration.body); break; } @@ -141851,12 +138632,12 @@ var ts; } function isConvertableSignatureDeclaration(d) { switch (d.kind) { - case 164 /* MethodSignature */: - case 165 /* MethodDeclaration */: - case 169 /* CallSignature */: - case 166 /* Constructor */: - case 170 /* ConstructSignature */: - case 251 /* FunctionDeclaration */: + case 163 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 168 /* CallSignature */: + case 165 /* Constructor */: + case 169 /* ConstructSignature */: + case 248 /* FunctionDeclaration */: return true; } return false; @@ -142219,20 +139000,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 163 /* PropertyDeclaration */) { + if (current.kind === 162 /* PropertyDeclaration */) { if (ts.hasSyntacticModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 160 /* Parameter */) { + else if (current.kind === 159 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 166 /* Constructor */) { + if (ctorOrMethod.kind === 165 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 165 /* MethodDeclaration */) { + else if (current.kind === 164 /* MethodDeclaration */) { if (ts.hasSyntacticModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -142275,7 +139056,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 249 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 246 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasSyntacticModifier(declaringNode, 1 /* Export */)) { // TODO: GH#18217 Silly to use `errors ||` since it's definitely not defined (see top of `visit`) // Also, if we're only pushing one error, just use `let error: Diagnostic | undefined`! @@ -142287,16 +139068,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; - case 266 /* ExportAssignment */: - (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractExportedEntity)); - return true; case 105 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 203 /* CallExpression */) { + if (node.parent.kind === 200 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); // TODO:GH#18217 if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -142308,7 +139086,7 @@ var ts; rangeFacts |= RangeFacts.UsesThis; } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // check if arrow function uses this ts.forEachChild(node, function check(n) { if (ts.isThis(n)) { @@ -142322,39 +139100,39 @@ var ts; } }); // falls through - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); } // falls through - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // do not dive into functions or classes return false; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 234 /* IfStatement */: + case 231 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 230 /* Block */: - if (node.parent && node.parent.kind === 247 /* TryStatement */ && node.parent.finallyBlock === node) { + case 227 /* Block */: + if (node.parent && node.parent.kind === 244 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 285 /* DefaultClause */: - case 284 /* CaseClause */: + case 282 /* DefaultClause */: + case 281 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -142366,19 +139144,19 @@ var ts; break; } switch (node.kind) { - case 187 /* ThisType */: + case 186 /* ThisType */: case 107 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 245 /* LabeledStatement */: { + case 242 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); ts.forEachChild(node, visit); seenLabels.pop(); break; } - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: { + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: { var label = node.label; if (label) { if (!ts.contains(seenLabels, label.escapedText)) { @@ -142387,20 +139165,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 241 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 238 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -142454,7 +139232,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 160 /* Parameter */) { + if (current.kind === 159 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -142465,7 +139243,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 297 /* SourceFile */) { + if (current.kind === 294 /* SourceFile */) { return scopes; } } @@ -142555,32 +139333,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return "constructor"; - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : ts.ANONYMOUS; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return "arrow function"; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return "method '" + scope.name.getText() + "'"; - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 252 /* ClassDeclaration */ + return scope.kind === 249 /* ClassDeclaration */ ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 257 /* ModuleBlock */ + return scope.kind === 254 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -142806,9 +139584,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 150 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 149 /* UndefinedKeyword */; }) ? clone - : ts.factory.createUnionTypeNode([clone, ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)]); + : ts.factory.createUnionTypeNode([clone, ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */)]); } } /** @@ -142837,7 +139615,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.factory.createModifier(123 /* StaticKeyword */)); } - modifiers.push(ts.factory.createModifier(142 /* ReadonlyKeyword */)); + modifiers.push(ts.factory.createModifier(141 /* ReadonlyKeyword */)); var newVariable = ts.factory.createPropertyDeclaration( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -142869,7 +139647,7 @@ var ts; var localReference = ts.factory.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); } - else if (node.parent.kind === 233 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 230 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.factory.createVariableStatement( @@ -142888,7 +139666,7 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 233 /* ExpressionStatement */) { + if (node.parent.kind === 230 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. changeTracker.delete(context.file, node.parent); } @@ -143215,7 +139993,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: new ts.Map(), typeParameterUsages: new ts.Map(), substitutions: new ts.Map() }); substitutionsPerScope.push(new ts.Map()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 251 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 248 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -143534,30 +140312,30 @@ var ts; function isExtractableExpression(node) { var parent = node.parent; switch (parent.kind) { - case 291 /* EnumMember */: + case 288 /* EnumMember */: return false; } switch (node.kind) { case 10 /* StringLiteral */: - return parent.kind !== 261 /* ImportDeclaration */ && - parent.kind !== 265 /* ImportSpecifier */; - case 220 /* SpreadElement */: - case 196 /* ObjectBindingPattern */: - case 198 /* BindingElement */: + return parent.kind !== 258 /* ImportDeclaration */ && + parent.kind !== 262 /* ImportSpecifier */; + case 217 /* SpreadElement */: + case 193 /* ObjectBindingPattern */: + case 195 /* BindingElement */: return false; case 78 /* Identifier */: - return parent.kind !== 198 /* BindingElement */ && - parent.kind !== 265 /* ImportSpecifier */ && - parent.kind !== 270 /* ExportSpecifier */; + return parent.kind !== 195 /* BindingElement */ && + parent.kind !== 262 /* ImportSpecifier */ && + parent.kind !== 267 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 230 /* Block */: - case 297 /* SourceFile */: - case 257 /* ModuleBlock */: - case 284 /* CaseClause */: + case 227 /* Block */: + case 294 /* SourceFile */: + case 254 /* ModuleBlock */: + case 281 /* CaseClause */: return true; default: return false; @@ -143690,7 +140468,7 @@ var ts; if (symbol) { var declaration = ts.cast(ts.first(symbol.declarations), ts.isTypeParameterDeclaration); if (rangeContainsSkipTrivia(statement, declaration, file) && !rangeContainsSkipTrivia(selection, declaration, file)) { - ts.pushIfUnique(result, declaration); + result.push(declaration); } } } @@ -143732,18 +140510,16 @@ var ts; /* decorators */ undefined, /* modifiers */ undefined, name, typeParameters.map(function (id) { return ts.factory.updateTypeParameterDeclaration(id, id.name, id.constraint, /* defaultType */ undefined); }), selection); changes.insertNodeBefore(file, firstStatement, ts.ignoreSourceNewlines(newTypeNode), /* blankLineBetween */ true); - changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); })), { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude, trailingTriviaOption: ts.textChanges.TrailingTriviaOption.ExcludeWhitespace }); + changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); }))); } function doInterfaceChange(changes, file, name, info) { - var _a; var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters, typeElements = info.typeElements; var newTypeNode = ts.factory.createInterfaceDeclaration( /* decorators */ undefined, /* modifiers */ undefined, name, typeParameters, /* heritageClauses */ undefined, typeElements); - ts.setTextRange(newTypeNode, (_a = typeElements[0]) === null || _a === void 0 ? void 0 : _a.parent); changes.insertNodeBefore(file, firstStatement, ts.ignoreSourceNewlines(newTypeNode), /* blankLineBetween */ true); - changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); })), { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude, trailingTriviaOption: ts.textChanges.TrailingTriviaOption.ExcludeWhitespace }); + changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); }))); } function doTypedefChange(changes, file, name, info) { var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters; @@ -143773,10 +140549,10 @@ var ts; getEditsForAction: function (context, actionName) { if (!context.endPosition) return undefined; - var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition); + var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.startPosition, context.endPosition); if (!info || !info.info) return undefined; - var edits = ts.codefix.generateAccessorFromProperty(context.file, context.program, context.startPosition, context.endPosition, context, actionName); + var edits = ts.codefix.generateAccessorFromProperty(context.file, context.startPosition, context.endPosition, context, actionName); if (!edits) return undefined; var renameFilename = context.file.fileName; @@ -143788,7 +140564,7 @@ var ts; getAvailableActions: function (context) { if (!context.endPosition) return ts.emptyArray; - var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition, context.triggerReason === "invoked"); + var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.startPosition, context.endPosition, context.triggerReason === "invoked"); if (!info) return ts.emptyArray; if (!info.error) { @@ -143874,6 +140650,7 @@ var ts; changes.createNewFile(oldFile, ts.combinePaths(currentDirectory, newFileNameWithExtension), getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences)); addNewFileToTsconfig(program, changes, oldFile.fileName, newFileNameWithExtension, ts.hostGetCanonicalFileName(host)); } + // Filters imports out of the range of statements to move. Imports will be copied to the new file anyway, and may still be needed in the old file. function getStatementsToMove(context) { var rangeToMove = getRangeToMove(context); if (rangeToMove === undefined) @@ -143881,27 +140658,20 @@ var ts; var all = []; var ranges = []; var toMove = rangeToMove.toMove, afterLast = rangeToMove.afterLast; - ts.getRangesWhere(toMove, isAllowedStatementToMove, function (start, afterEndIndex) { + ts.getRangesWhere(toMove, function (s) { return !isPureImport(s); }, function (start, afterEndIndex) { for (var i = start; i < afterEndIndex; i++) all.push(toMove[i]); ranges.push({ first: toMove[start], afterLast: afterLast }); }); return all.length === 0 ? undefined : { all: all, ranges: ranges }; } - function isAllowedStatementToMove(statement) { - // Filters imports and prologue directives out of the range of statements to move. - // Imports will be copied to the new file anyway, and may still be needed in the old file. - // Prologue directives will be copied to the new file and should be left in the old file. - return !isPureImport(statement) && !ts.isPrologueDirective(statement); - ; - } function isPureImport(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return true; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return !ts.hasSyntacticModifier(node, 1 /* Export */); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); }); default: return false; @@ -143923,10 +140693,9 @@ var ts; } function getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences) { var checker = program.getTypeChecker(); - var prologueDirectives = ts.takeWhile(oldFile.statements, ts.isPrologueDirective); if (!oldFile.externalModuleIndicator && !oldFile.commonJsModuleIndicator) { deleteMovedStatements(oldFile, toMove.ranges, changes); - return __spreadArrays(prologueDirectives, toMove.all); + return toMove.all; } var useEs6ModuleSyntax = !!oldFile.externalModuleIndicator; var quotePreference = ts.getQuotePreference(oldFile, preferences); @@ -143940,11 +140709,11 @@ var ts; var imports = getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference); var body = addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax); if (imports.length && body.length) { - return __spreadArrays(prologueDirectives, imports, [ + return __spreadArrays(imports, [ 4 /* NewLineTrivia */ ], body); } - return __spreadArrays(prologueDirectives, imports, body); + return __spreadArrays(imports, body); } function deleteMovedStatements(sourceFile, moved, changes) { for (var _i = 0, moved_1 = moved; _i < moved_1.length; _i++) { @@ -143997,12 +140766,12 @@ var ts; } function getNamespaceLikeImport(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 263 /* NamespaceImport */ ? + case 258 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 260 /* NamespaceImport */ ? node.importClause.namedBindings.name : undefined; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node.name; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ts.tryCast(node.name, ts.isIdentifier); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); @@ -144033,20 +140802,20 @@ var ts; var newNamespaceId = ts.factory.createIdentifier(newNamespaceName); var newModuleString = ts.factory.createStringLiteral(newModuleSpecifier); switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, ts.factory.createNamespaceImport(newNamespaceId)), newModuleString); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return ts.factory.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newNamespaceId, ts.factory.createExternalModuleReference(newModuleString)); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ts.factory.createVariableDeclaration(newNamespaceId, /*exclamationToken*/ undefined, /*type*/ undefined, createRequireCall(newModuleString)); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); } } function moduleSpecifierFromImport(i) { - return (i.kind === 261 /* ImportDeclaration */ ? i.moduleSpecifier - : i.kind === 260 /* ImportEqualsDeclaration */ ? i.moduleReference.expression + return (i.kind === 258 /* ImportDeclaration */ ? i.moduleSpecifier + : i.kind === 257 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]); } function forEachImportInStatement(statement, cb) { @@ -144116,15 +140885,15 @@ var ts; } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -144137,7 +140906,7 @@ var ts; var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings; var defaultUnused = !name || isUnused(name); var namedBindingsUnused = !namedBindings || - (namedBindings.kind === 263 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); + (namedBindings.kind === 260 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } @@ -144149,7 +140918,7 @@ var ts; if (namedBindingsUnused) { changes.replaceNode(sourceFile, importDecl.importClause, ts.factory.updateImportClause(importDecl.importClause, importDecl.importClause.isTypeOnly, name, /*namedBindings*/ undefined)); } - else if (namedBindings.kind === 264 /* NamedImports */) { + else if (namedBindings.kind === 261 /* NamedImports */) { for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { var element = _b[_i]; if (isUnused(element.name)) @@ -144167,9 +140936,9 @@ var ts; changes.delete(sourceFile, name); } break; - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: break; - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) { changes.delete(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); } @@ -144296,14 +141065,14 @@ var ts; // Below should all be utilities function isInImport(decl) { switch (decl.kind) { - case 260 /* ImportEqualsDeclaration */: - case 265 /* ImportSpecifier */: - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: + case 257 /* ImportEqualsDeclaration */: + case 262 /* ImportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: return true; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -144315,7 +141084,7 @@ var ts; } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 261 /* ImportDeclaration */: { + case 258 /* ImportDeclaration */: { var clause = i.importClause; if (!clause) return undefined; @@ -144325,9 +141094,9 @@ var ts; ? ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, defaultImport, namedBindings), moduleSpecifier) : undefined; } - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return keep(i.name) ? i : undefined; - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { var name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined; } @@ -144336,7 +141105,7 @@ var ts; } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 263 /* NamespaceImport */) { + if (namedBindings.kind === 260 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : undefined; } else { @@ -144348,9 +141117,9 @@ var ts; switch (name.kind) { case 78 /* Identifier */: return keep(name) ? name : undefined; - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return name; - case 196 /* ObjectBindingPattern */: { + case 193 /* ObjectBindingPattern */: { // We can't handle nested destructurings or property names well here, so just copy them all. var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); }); return newElements.length ? ts.factory.createObjectBindingPattern(newElements) : undefined; @@ -144407,13 +141176,13 @@ var ts; } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 257 /* ImportEqualsDeclaration */: return true; default: return false; @@ -144421,17 +141190,17 @@ var ts; } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 257 /* ImportEqualsDeclaration */: return cb(statement); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); }); - case 233 /* ExpressionStatement */: { + case 230 /* ExpressionStatement */: { var expression = statement.expression; return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) @@ -144443,8 +141212,8 @@ var ts; switch (name.kind) { case 78 /* Identifier */: return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); })); - case 197 /* ArrayBindingPattern */: - case 196 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); }); default: return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind); @@ -144455,9 +141224,9 @@ var ts; } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return d.parent.parent; - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); })); default: return d; @@ -144490,23 +141259,23 @@ var ts; function addEs6Export(d) { var modifiers = ts.concatenate([ts.factory.createModifier(92 /* ExportKeyword */)], d.modifiers); switch (d.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return ts.factory.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return ts.factory.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return ts.factory.updateVariableStatement(d, modifiers, d.declarationList); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return ts.factory.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return ts.factory.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return ts.factory.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return ts.factory.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return ts.factory.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind); @@ -144517,18 +141286,18 @@ var ts; } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; }); - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 257 /* ImportEqualsDeclaration */: return ts.emptyArray; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind); @@ -144833,15 +141602,15 @@ var ts; var parent = functionReference.parent; switch (parent.kind) { // foo(...) or super(...) or new Foo(...) - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression); @@ -144851,7 +141620,7 @@ var ts; } break; // x["foo"](...) - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression); @@ -144870,14 +141639,14 @@ var ts; var parent = reference.parent; switch (parent.kind) { // `C.foo` - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -144919,11 +141688,11 @@ var ts; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return isSingleImplementation(functionDeclaration, checker); - case 166 /* Constructor */: + case 165 /* Constructor */: if (ts.isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } @@ -144931,8 +141700,8 @@ var ts; return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -145082,7 +141851,7 @@ var ts; } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; @@ -145090,7 +141859,7 @@ var ts; // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(classDeclaration, 87 /* DefaultKeyword */), "Nameless class declaration should be a default export"); return [defaultModifier]; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: var classExpression = constructorDeclaration.parent; var variableDeclaration = constructorDeclaration.parent.parent; var className = classExpression.name; @@ -145101,25 +141870,25 @@ var ts; } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; // If the function declaration doesn't have a name, it should have a default modifier. // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(functionDeclaration, 87 /* DefaultKeyword */), "Nameless function declaration should be a default export"); return [defaultModifier]; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return [functionDeclaration.name]; - case 166 /* Constructor */: + case 165 /* Constructor */: var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 132 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); - if (functionDeclaration.parent.kind === 221 /* ClassExpression */) { + if (functionDeclaration.parent.kind === 218 /* ClassExpression */) { var variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -145195,18 +141964,10 @@ var ts; return node.operatorToken.kind !== 62 /* EqualsToken */; } function getParentBinaryExpression(expr) { - var container = ts.findAncestor(expr.parent, function (n) { - switch (n.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - return false; - case 216 /* BinaryExpression */: - return !(ts.isBinaryExpression(n.parent) && isNotEqualsOperator(n.parent)); - default: - return "quit"; - } - }); - return container || expr; + while (ts.isBinaryExpression(expr.parent) && isNotEqualsOperator(expr.parent)) { + expr = expr.parent; + } + return expr; } function isStringConcatenationValid(node) { var _a = treeToArray(node), containsString = _a.containsString, areOperatorsValid = _a.areOperatorsValid; @@ -145555,8 +142316,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 301 /* FirstJSDocNode */ || kid.kind > 333 /* LastJSDocNode */; }); - return child.kind < 157 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 298 /* FirstJSDocNode */ || kid.kind > 328 /* LastJSDocNode */; }); + return child.kind < 156 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -145567,7 +142328,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 157 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 156 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -145625,7 +142386,7 @@ var ts; } } function createSyntaxList(nodes, parent) { - var list = createNode(334 /* SyntaxList */, nodes.pos, nodes.end, parent); + var list = createNode(329 /* SyntaxList */, nodes.pos, nodes.end, parent); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { @@ -145736,13 +142497,13 @@ var ts; }; SymbolObject.prototype.getContextualDocumentationComment = function (context, checker) { switch (context === null || context === void 0 ? void 0 : context.kind) { - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: if (!this.contextualGetAccessorDocumentationComment) { this.contextualGetAccessorDocumentationComment = ts.emptyArray; this.contextualGetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isGetAccessor), checker); } return this.contextualGetAccessorDocumentationComment; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: if (!this.contextualSetAccessorDocumentationComment) { this.contextualSetAccessorDocumentationComment = ts.emptyArray; this.contextualSetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isSetAccessor), checker); @@ -145963,7 +142724,7 @@ var ts; __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { var _this = _super.call(this, kind, pos, end) || this; - _this.kind = 297 /* SourceFile */; + _this.kind = 294 /* SourceFile */; return _this; } SourceFileObject.prototype.update = function (newText, textChangeRange) { @@ -146022,10 +142783,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -146045,31 +142806,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 256 /* ModuleDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 270 /* ExportSpecifier */: - case 265 /* ImportSpecifier */: - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 177 /* TypeLiteral */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 267 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 176 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 160 /* Parameter */: + case 159 /* Parameter */: // Only consider parameter properties if (!ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: { + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -146080,12 +142841,12 @@ var ts; } } // falls through - case 291 /* EnumMember */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 288 /* EnumMember */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: addDeclaration(node); break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; var exportDeclaration = node; @@ -146098,7 +142859,7 @@ var ts; } } break; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -146110,7 +142871,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 260 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -146119,7 +142880,7 @@ var ts; } } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -146774,12 +143535,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return !ts.isLabelName(node) && !ts.isTagName(node); - case 201 /* PropertyAccessExpression */: - case 157 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` return !ts.isInComment(sourceFile, position); case 107 /* ThisKeyword */: - case 187 /* ThisType */: + case 186 /* ThisType */: case 105 /* SuperKeyword */: return true; default: @@ -146864,7 +143625,7 @@ var ts; * This is a semantic operation. */ function getSignatureHelpItems(fileName, position, _a) { - var _b = _a === void 0 ? ts.emptyOptions : _a, triggerReason = _b.triggerReason; + var triggerReason = (_a === void 0 ? ts.emptyOptions : _a).triggerReason; synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, triggerReason, cancellationToken); @@ -146881,15 +143642,15 @@ var ts; return undefined; } switch (node.kind) { - case 201 /* PropertyAccessExpression */: - case 157 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: case 10 /* StringLiteral */: case 94 /* FalseKeyword */: case 109 /* TrueKeyword */: case 103 /* NullKeyword */: case 105 /* SuperKeyword */: case 107 /* ThisKeyword */: - case 187 /* ThisType */: + case 186 /* ThisType */: case 78 /* Identifier */: break; // Cant create the text span @@ -146906,7 +143667,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 256 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 253 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -146938,33 +143699,21 @@ var ts; var kind = ts.getScriptKind(fileName, host); return kind === 3 /* TS */ || kind === 4 /* TSX */; } - function getSemanticClassifications(fileName, span, format) { + function getSemanticClassifications(fileName, span) { if (!isTsOrTsxFile(fileName)) { // do not run semantic classification on non-ts-or-tsx files return []; } synchronizeHostData(); - var responseFormat = format || "original" /* Original */; - if (responseFormat === "2020" /* TwentyTwenty */) { - return ts.classifier.v2020.getSemanticClassifications(program, cancellationToken, getValidSourceFile(fileName), span); - } - else { - return ts.getSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); - } + return ts.getSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); } - function getEncodedSemanticClassifications(fileName, span, format) { + function getEncodedSemanticClassifications(fileName, span) { if (!isTsOrTsxFile(fileName)) { // do not run semantic classification on non-ts-or-tsx files return { spans: [], endOfLineState: 0 /* None */ }; } synchronizeHostData(); - var responseFormat = format || "original" /* Original */; - if (responseFormat === "original" /* Original */) { - return ts.getEncodedSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); - } - else { - return ts.classifier.v2020.getEncodedSemanticClassifications(program, cancellationToken, getValidSourceFile(fileName), span); - } + return ts.getEncodedSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); } function getSyntacticClassifications(fileName, span) { // doesn't use compiler - no need to synchronize with host @@ -147145,10 +143894,6 @@ var ts; } // Push all text changes. for (var i = firstLine; i <= lastLine; i++) { - // If the range is multiline and ends on a beginning of a line, don't comment/uncomment. - if (firstLine !== lastLine && lineStarts[i] === textRange.end) { - continue; - } var lineTextStart = lineTextStarts.get(i.toString()); // If the line is not an empty line; otherwise no-op. if (lineTextStart !== undefined) { @@ -147627,7 +144372,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 272 /* ExternalModuleReference */ || + node.parent.kind === 269 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -147645,13 +144390,13 @@ var ts; case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 158 /* ComputedPropertyName */) { + if (node.parent.kind === 157 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 78 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 200 /* ObjectLiteralExpression */ || node.parent.parent.kind === 281 /* JsxAttributes */) && + (node.parent.parent.kind === 197 /* ObjectLiteralExpression */ || node.parent.parent.kind === 278 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -147693,7 +144438,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 202 /* ElementAccessExpression */ && + node.parent.kind === 199 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -147773,114 +144518,114 @@ var ts; if (node) { var parent = node.parent; switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 249 /* VariableDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 246 /* VariableDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return spanInVariableDeclaration(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return spanInParameterDeclaration(node); - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 230 /* Block */: + case 227 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return spanInBlock(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return spanInBlock(node.block); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 235 /* DoStatement */: + case 232 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 248 /* DebuggerStatement */: + case 245 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 234 /* IfStatement */: + case 231 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return spanInForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 247 /* TryStatement */: + case 244 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 198 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 195 /* BindingElement */: // span on complete node return textSpan(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 161 /* Decorator */: + case 160 /* Decorator */: return spanInNodeArray(parent.decorators); - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return undefined; // Tokens: case 26 /* SemicolonToken */: @@ -147910,7 +144655,7 @@ var ts; case 82 /* CatchKeyword */: case 95 /* FinallyKeyword */: return spanInNextNode(node); - case 156 /* OfKeyword */: + case 155 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -147923,13 +144668,13 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 78 /* Identifier */ || - node.kind === 220 /* SpreadElement */ || - node.kind === 288 /* PropertyAssignment */ || - node.kind === 289 /* ShorthandPropertyAssignment */) && + node.kind === 217 /* SpreadElement */ || + node.kind === 285 /* PropertyAssignment */ || + node.kind === 286 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) { return textSpan(node); } - if (node.kind === 216 /* BinaryExpression */) { + if (node.kind === 213 /* BinaryExpression */) { var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -147951,22 +144696,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (parent.kind) { - case 235 /* DoStatement */: + case 232 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 161 /* Decorator */: + case 160 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: return textSpan(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (node.parent.operatorToken.kind === 27 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -147975,21 +144720,21 @@ var ts; } } switch (node.parent.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // If this is name of property assignment, set breakpoint in the initializer if (node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: // Breakpoint in type assertion goes to its operand if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: { + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: { // initializer of variable/parameter declaration go to previous node var _b = node.parent, initializer = _b.initializer, type = _b.type; if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { @@ -147997,7 +144742,7 @@ var ts; } break; } - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var left = node.parent.left; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { // If initializer of destructuring assignment move to previous token @@ -148027,7 +144772,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 238 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 235 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } var parent = variableDeclaration.parent; @@ -148039,7 +144784,7 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasSyntacticModifier(variableDeclaration, 1 /* Export */) || - parent.parent.kind === 239 /* ForOfStatement */) { + parent.parent.kind === 236 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (ts.isVariableDeclarationList(variableDeclaration.parent) && @@ -148080,7 +144825,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasSyntacticModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 252 /* ClassDeclaration */ && functionDeclaration.kind !== 166 /* Constructor */); + (functionDeclaration.parent.kind === 249 /* ClassDeclaration */ && functionDeclaration.kind !== 165 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -148103,26 +144848,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement // falls through - case 236 /* WhileStatement */: - case 234 /* IfStatement */: - case 238 /* ForInStatement */: + case 233 /* WhileStatement */: + case 231 /* IfStatement */: + case 235 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 250 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 247 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -148147,21 +144892,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 222 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 219 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 198 /* BindingElement */) { + if (bindingPattern.parent.kind === 195 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 197 /* ArrayBindingPattern */ && node.kind !== 196 /* ObjectBindingPattern */); - var elements = node.kind === 199 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 222 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 194 /* ArrayBindingPattern */ && node.kind !== 193 /* ObjectBindingPattern */); + var elements = node.kind === 196 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 219 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -148169,18 +144914,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 216 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 213 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -148188,25 +144933,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 255 /* EnumDeclaration */: - case 252 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 249 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 230 /* Block */: + case 227 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 287 /* CatchClause */: + case 284 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -148214,7 +144959,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -148230,7 +144975,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -148245,12 +144990,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 235 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 203 /* CallExpression */ || - node.parent.kind === 204 /* NewExpression */) { + if (node.parent.kind === 232 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 200 /* CallExpression */ || + node.parent.kind === 201 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 207 /* ParenthesizedExpression */) { + if (node.parent.kind === 204 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -148259,21 +145004,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 236 /* WhileStatement */: - case 235 /* DoStatement */: - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 207 /* ParenthesizedExpression */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 233 /* WhileStatement */: + case 232 /* DoStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 204 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -148283,20 +145028,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 288 /* PropertyAssignment */ || - node.parent.kind === 160 /* Parameter */) { + node.parent.kind === 285 /* PropertyAssignment */ || + node.parent.kind === 159 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 206 /* TypeAssertionExpression */) { + if (node.parent.kind === 203 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 235 /* DoStatement */) { + if (node.parent.kind === 232 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -148304,7 +145049,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 239 /* ForOfStatement */) { + if (node.parent.kind === 236 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -149249,7 +145994,7 @@ var ts; function nowString() { // E.g. "12:34:56.789" var d = new Date(); - return ts.padLeft(d.getHours().toString(), 2, "0") + ":" + ts.padLeft(d.getMinutes().toString(), 2, "0") + ":" + ts.padLeft(d.getSeconds().toString(), 2, "0") + "." + ts.padLeft(d.getMilliseconds().toString(), 3, "0"); + return d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + "." + d.getMilliseconds(); } server.nowString = nowString; })(server = ts.server || (ts.server = {})); @@ -149359,9 +146104,7 @@ var ts; var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); getTypingNamesFromPackagesFolder(nodeModulesPath, filesToWatch); }); - if (!typeAcquisition.disableFilenameBasedTypeAcquisition) { - getTypingNamesFromSourceFileNames(fileNames); - } + getTypingNamesFromSourceFileNames(fileNames); // add typings for unresolved imports if (unresolvedImports) { var module_1 = ts.deduplicate(unresolvedImports.map(nonRelativeModuleNameForTypingCache), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); @@ -149983,8 +146726,6 @@ var ts; JsxEmit["Preserve"] = "Preserve"; JsxEmit["ReactNative"] = "ReactNative"; JsxEmit["React"] = "React"; - JsxEmit["ReactJSX"] = "ReactJSX"; - JsxEmit["ReactJSXDev"] = "ReactJSXDev"; })(JsxEmit = protocol.JsxEmit || (protocol.JsxEmit = {})); var ModuleKind; (function (ModuleKind) { @@ -149995,7 +146736,6 @@ var ts; ModuleKind["System"] = "System"; ModuleKind["ES6"] = "ES6"; ModuleKind["ES2015"] = "ES2015"; - ModuleKind["ES2020"] = "ES2020"; ModuleKind["ESNext"] = "ESNext"; })(ModuleKind = protocol.ModuleKind || (protocol.ModuleKind = {})); var ModuleResolutionKind; @@ -150019,7 +146759,6 @@ var ts; ScriptTarget["ES2018"] = "ES2018"; ScriptTarget["ES2019"] = "ES2019"; ScriptTarget["ES2020"] = "ES2020"; - ScriptTarget["JSON"] = "JSON"; ScriptTarget["ESNext"] = "ESNext"; })(ScriptTarget = protocol.ScriptTarget || (protocol.ScriptTarget = {})); })(protocol = server.protocol || (server.protocol = {})); @@ -150621,7 +147360,7 @@ var ts; } function compilerOptionsChanged(opt1, opt2) { // TODO: add more relevant properties - return ts.getAllowJSCompilerOption(opt1) !== ts.getAllowJSCompilerOption(opt2); + return opt1.allowJs !== opt2.allowJs; } function unresolvedImportsChanged(imports1, imports2) { if (imports1 === imports2) { @@ -150822,7 +147561,7 @@ var ts; this.compilerOptions.allowNonTsExtensions = true; this.compilerOptions.allowJs = true; } - else if (hasExplicitListOfFiles || ts.getAllowJSCompilerOption(this.compilerOptions) || this.projectService.hasDeferredExtension()) { + else if (hasExplicitListOfFiles || this.compilerOptions.allowJs || this.projectService.hasDeferredExtension()) { // If files are listed explicitly or allowJs is specified, allow all extensions this.compilerOptions.allowNonTsExtensions = true; } @@ -151128,7 +147867,9 @@ var ts; } server.updateProjectIfDirty(this); this.builderState = ts.BuilderState.create(this.program, this.projectService.toCanonicalFileName, this.builderState); - return ts.mapDefined(ts.BuilderState.getFilesAffectedBy(this.builderState, this.program, scriptInfo.path, this.cancellationToken, ts.maybeBind(this.projectService.host, this.projectService.host.createHash)), function (sourceFile) { return _this.shouldEmitFile(_this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : undefined; }); + return ts.mapDefined(ts.BuilderState.getFilesAffectedBy(this.builderState, this.program, scriptInfo.path, this.cancellationToken, function (data) { return _this.projectService.host.createHash(data); }), // TODO: GH#18217 + function (// TODO: GH#18217 + sourceFile) { return _this.shouldEmitFile(_this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : undefined; }); }; /** * Returns true if emit was conducted @@ -151149,10 +147890,7 @@ var ts; var dtsFiles = outputFiles.filter(function (f) { return ts.fileExtensionIs(f.name, ".d.ts" /* Dts */); }); if (dtsFiles.length === 1) { var sourceFile = this.program.getSourceFile(scriptInfo.fileName); - var signature = this.projectService.host.createHash ? - this.projectService.host.createHash(dtsFiles[0].text) : - ts.generateDjb2Hash(dtsFiles[0].text); - ts.BuilderState.updateSignatureOfFile(this.builderState, signature, sourceFile.resolvedPath); + ts.BuilderState.updateSignatureOfFile(this.builderState, this.projectService.host.createHash(dtsFiles[0].text), sourceFile.resolvedPath); } } } @@ -151231,7 +147969,9 @@ var ts; this.detachScriptInfoIfNotRoot(f.fileName); } this.program.forEachResolvedProjectReference(function (ref) { - return _this.detachScriptInfoFromProject(ref.sourceFile.fileName); + if (ref) { + _this.detachScriptInfoFromProject(ref.sourceFile.fileName); + } }); } // Release external files @@ -151534,7 +148274,7 @@ var ts; // bump up the version if // - oldProgram is not set - this is a first time updateGraph is called // - newProgram is different from the old program and structure of the old program was not reused. - var hasNewProgram = this.program && (!oldProgram || (this.program !== oldProgram && !(this.program.structureIsReused & 2 /* Completely */))); + var hasNewProgram = this.program && (!oldProgram || (this.program !== oldProgram && !(oldProgram.structureIsReused & 2 /* Completely */))); if (hasNewProgram) { if (oldProgram) { for (var _i = 0, _a = oldProgram.getSourceFiles(); _i < _a.length; _i++) { @@ -151546,8 +148286,8 @@ var ts; this.detachScriptInfoFromProject(f.fileName, !!this.program.getSourceFileByPath(f.path)); } } - oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference) { - if (!_this.program.getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) { + oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference, resolvedProjectReferencePath) { + if (resolvedProjectReference && !_this.program.getResolvedProjectReferenceByPath(resolvedProjectReferencePath)) { _this.detachScriptInfoFromProject(resolvedProjectReference.sourceFile.fileName); } }); @@ -151588,7 +148328,7 @@ var ts; } } if (!this.importSuggestionsCache.isEmpty()) { - if (this.hasAddedorRemovedFiles || oldProgram && !this.program.structureIsReused) { + if (this.hasAddedorRemovedFiles || oldProgram && !oldProgram.structureIsReused) { this.importSuggestionsCache.clear(); } else if (this.dirtyFilesForSuggestions && oldProgram && this.program) { @@ -151625,7 +148365,7 @@ var ts; this.print(/*writeProjectFileNames*/ true); } else if (this.program !== oldProgram) { - this.writeLog("Different program with same set of files:: structureIsReused:: " + this.program.structureIsReused); + this.writeLog("Different program with same set of files:: oldProgram.structureIsReused:: " + (oldProgram && oldProgram.structureIsReused)); } return hasNewProgram; }; @@ -151814,14 +148554,6 @@ var ts; Project.prototype.getWatchOptions = function () { return this.watchOptions; }; - Project.prototype.setTypeAcquisition = function (newTypeAcquisition) { - if (newTypeAcquisition) { - this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition); - } - }; - Project.prototype.getTypeAcquisition = function () { - return this.typeAcquisition || {}; - }; /* @internal */ Project.prototype.getChangesSinceVersion = function (lastKnownVersion, includeProjectReferenceRedirectInfo) { var _this = this; @@ -152025,8 +148757,6 @@ var ts; }; /*@internal*/ Project.prototype.getPackageJsonsVisibleToFile = function (fileName, rootDir) { - if (this.projectService.serverMode !== ts.LanguageServiceMode.Semantic) - return server.emptyArray; return this.projectService.getPackageJsonsVisibleToFile(fileName, rootDir); }; /*@internal*/ @@ -152070,13 +148800,9 @@ var ts; if (this.autoImportProviderHost === false) { return undefined; } - if (this.projectService.serverMode !== ts.LanguageServiceMode.Semantic) { - this.autoImportProviderHost = false; - return undefined; - } if (this.autoImportProviderHost) { server.updateProjectIfDirty(this.autoImportProviderHost); - if (this.autoImportProviderHost.isEmpty()) { + if (!this.autoImportProviderHost.hasRoots()) { this.autoImportProviderHost.close(); this.autoImportProviderHost = undefined; return undefined; @@ -152085,11 +148811,9 @@ var ts; } var dependencySelection = this.includePackageJsonAutoImports(); if (dependencySelection) { - var start = ts.timestamp(); this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.getModuleResolutionHostForAutoImportProvider(), this.documentRegistry); if (this.autoImportProviderHost) { server.updateProjectIfDirty(this.autoImportProviderHost); - this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", ts.timestamp() - start); return this.autoImportProviderHost.getCurrentProgram(); } } @@ -152135,14 +148859,13 @@ var ts; var InferredProject = /** @class */ (function (_super) { __extends(InferredProject, _super); /*@internal*/ - function InferredProject(projectService, documentRegistry, compilerOptions, watchOptions, projectRootPath, currentDirectory, pluginConfigOverrides, typeAcquisition) { + function InferredProject(projectService, documentRegistry, compilerOptions, watchOptions, projectRootPath, currentDirectory, pluginConfigOverrides) { var _this = _super.call(this, InferredProject.newName(), ProjectKind.Inferred, projectService, documentRegistry, // TODO: GH#18217 /*files*/ undefined, /*lastFileExceededProgramSize*/ undefined, compilerOptions, /*compileOnSaveEnabled*/ false, watchOptions, projectService.host, currentDirectory) || this; _this._isJsInferredProject = false; - _this.typeAcquisition = typeAcquisition; _this.projectRootPath = projectRootPath && projectService.toCanonicalFileName(projectRootPath); if (!projectRootPath && !projectService.useSingleInferredProject) { _this.canonicalCurrentDirectory = projectService.toCanonicalFileName(_this.currentDirectory); @@ -152205,7 +148928,7 @@ var ts; _super.prototype.close.call(this); }; InferredProject.prototype.getTypeAcquisition = function () { - return this.typeAcquisition || { + return { enable: allRootFilesAreJsOrDts(this), include: ts.emptyArray, exclude: ts.emptyArray @@ -152278,10 +149001,6 @@ var ts; } return new AutoImportProviderProject(hostProject, rootNames, documentRegistry, compilerOptions); }; - /*@internal*/ - AutoImportProviderProject.prototype.isEmpty = function () { - return !ts.some(this.rootFileNames); - }; AutoImportProviderProject.prototype.isOrphan = function () { return true; }; @@ -152447,11 +149166,6 @@ var ts; return program && program.getResolvedProjectReferenceToRedirect(fileName); }; /*@internal*/ - ConfiguredProject.prototype.forEachResolvedProjectReference = function (cb) { - var _a; - return (_a = this.getCurrentProgram()) === null || _a === void 0 ? void 0 : _a.forEachResolvedProjectReference(cb); - }; - /*@internal*/ ConfiguredProject.prototype.enablePluginsWithOptions = function (options, pluginConfigOverrides) { var host = this.projectService.host; if (!host.require) { @@ -152490,6 +149204,12 @@ var ts; ConfiguredProject.prototype.setProjectErrors = function (projectErrors) { this.projectErrors = projectErrors; }; + ConfiguredProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { + this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition); + }; + ConfiguredProject.prototype.getTypeAcquisition = function () { + return this.typeAcquisition || {}; + }; /*@internal*/ ConfiguredProject.prototype.watchWildcards = function (wildcardDirectories) { var _this = this; @@ -152532,7 +149252,7 @@ var ts; /* @internal */ /** Find the configured project from the project references in project which contains the info directly */ ConfiguredProject.prototype.getDefaultChildProjectFromProjectWithReferences = function (info) { - return server.forEachResolvedProjectReferenceProject(this, info.path, function (child) { return server.projectContainsInfoDirectly(child, info) ? + return server.forEachResolvedProjectReferenceProject(this, function (child) { return server.projectContainsInfoDirectly(child, info) ? child : undefined; }, server.ProjectReferenceProjectLoadKind.Find); }; @@ -152560,7 +149280,7 @@ var ts; return ts.forEachEntry(configFileExistenceInfo.openFilesImpactedByConfigFile, function (_value, infoPath) { var info = _this.projectService.getScriptInfoForPath(infoPath); return _this.containsScriptInfo(info) || - !!server.forEachResolvedProjectReferenceProject(_this, info.path, function (child) { return child.containsScriptInfo(info); }, server.ProjectReferenceProjectLoadKind.Find); + !!server.forEachResolvedProjectReferenceProject(_this, function (child) { return child.containsScriptInfo(info); }, server.ProjectReferenceProjectLoadKind.Find); }) || false; }; /*@internal*/ @@ -152601,6 +149321,16 @@ var ts; ExternalProject.prototype.getExcludedFiles = function () { return this.excludedFiles; }; + ExternalProject.prototype.getTypeAcquisition = function () { + return this.typeAcquisition || {}; + }; + ExternalProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { + ts.Debug.assert(!!newTypeAcquisition, "newTypeAcquisition may not be null/undefined"); + ts.Debug.assert(!!newTypeAcquisition.include, "newTypeAcquisition.include may not be null/undefined"); + ts.Debug.assert(!!newTypeAcquisition.exclude, "newTypeAcquisition.exclude may not be null/undefined"); + ts.Debug.assert(typeof newTypeAcquisition.enable === "boolean", "newTypeAcquisition.enable may not be null/undefined"); + this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition); + }; return ExternalProject; }(Project)); server.ExternalProject = ExternalProject; @@ -152736,17 +149466,6 @@ var ts; return result; } server.convertWatchOptions = convertWatchOptions; - function convertTypeAcquisition(protocolOptions) { - var result; - ts.typeAcquisitionDeclarations.forEach(function (option) { - var propertyValue = protocolOptions[option.name]; - if (propertyValue === undefined) - return; - (result || (result = {}))[option.name] = propertyValue; - }); - return result; - } - server.convertTypeAcquisition = convertTypeAcquisition; function tryConvertScriptKindName(scriptKindName) { return ts.isString(scriptKindName) ? convertScriptKindName(scriptKindName) : scriptKindName; } @@ -152832,72 +149551,51 @@ var ts; /** Find existing project or create and load it for the project reference */ ProjectReferenceProjectLoadKind[ProjectReferenceProjectLoadKind["FindCreateLoad"] = 2] = "FindCreateLoad"; })(ProjectReferenceProjectLoadKind = server.ProjectReferenceProjectLoadKind || (server.ProjectReferenceProjectLoadKind = {})); - function forEachResolvedProjectReferenceProject(project, fileName, cb, projectReferenceProjectLoadKind, reason) { + function forEachResolvedProjectReferenceProject(project, cb, projectReferenceProjectLoadKind, reason) { var _a; - var resolvedRefs = (_a = project.getCurrentProgram()) === null || _a === void 0 ? void 0 : _a.getResolvedProjectReferences(); - if (!resolvedRefs) - return undefined; var seenResolvedRefs; - var possibleDefaultRef = fileName ? project.getResolvedProjectReferenceToRedirect(fileName) : undefined; - if (possibleDefaultRef) { - // Try to find the name of the file directly through resolved project references - var configFileName = server.toNormalizedPath(possibleDefaultRef.sourceFile.fileName); - var child = project.projectService.findConfiguredProjectByProjectName(configFileName); - if (child) { - var result = cb(child); - if (result) + return worker((_a = project.getCurrentProgram()) === null || _a === void 0 ? void 0 : _a.getResolvedProjectReferences(), project.getCompilerOptions()); + function worker(resolvedProjectReferences, parentOptions) { + var loadKind = parentOptions.disableReferencedProjectLoad ? ProjectReferenceProjectLoadKind.Find : projectReferenceProjectLoadKind; + return ts.forEach(resolvedProjectReferences, function (ref) { + if (!ref) + return undefined; + var configFileName = server.toNormalizedPath(ref.sourceFile.fileName); + var canonicalPath = project.projectService.toCanonicalFileName(configFileName); + var seenValue = seenResolvedRefs === null || seenResolvedRefs === void 0 ? void 0 : seenResolvedRefs.get(canonicalPath); + if (seenValue !== undefined && seenValue >= loadKind) { + return undefined; + } + var child = project.projectService.findConfiguredProjectByProjectName(configFileName) || (loadKind === ProjectReferenceProjectLoadKind.Find ? + undefined : + loadKind === ProjectReferenceProjectLoadKind.FindCreate ? + project.projectService.createConfiguredProject(configFileName) : + loadKind === ProjectReferenceProjectLoadKind.FindCreateLoad ? + project.projectService.createAndLoadConfiguredProject(configFileName, reason) : + ts.Debug.assertNever(loadKind)); + var result = child && cb(child); + if (result) { return result; - } - else if (projectReferenceProjectLoadKind !== ProjectReferenceProjectLoadKind.Find) { - seenResolvedRefs = new ts.Map(); - // Try to see if this project can be loaded - var result = forEachResolvedProjectReferenceProjectWorker(resolvedRefs, project.getCompilerOptions(), function (ref, loadKind) { return possibleDefaultRef === ref ? callback(ref, loadKind) : undefined; }, projectReferenceProjectLoadKind, project.projectService, seenResolvedRefs); - if (result) - return result; - // Cleanup seenResolvedRefs - seenResolvedRefs.clear(); - } - } - return forEachResolvedProjectReferenceProjectWorker(resolvedRefs, project.getCompilerOptions(), function (ref, loadKind) { return possibleDefaultRef !== ref ? callback(ref, loadKind) : undefined; }, projectReferenceProjectLoadKind, project.projectService, seenResolvedRefs); - function callback(ref, loadKind) { - var configFileName = server.toNormalizedPath(ref.sourceFile.fileName); - var child = project.projectService.findConfiguredProjectByProjectName(configFileName) || (loadKind === ProjectReferenceProjectLoadKind.Find ? - undefined : - loadKind === ProjectReferenceProjectLoadKind.FindCreate ? - project.projectService.createConfiguredProject(configFileName) : - loadKind === ProjectReferenceProjectLoadKind.FindCreateLoad ? - project.projectService.createAndLoadConfiguredProject(configFileName, reason) : - ts.Debug.assertNever(loadKind)); - return child && cb(child); + } + (seenResolvedRefs || (seenResolvedRefs = new ts.Map())).set(canonicalPath, loadKind); + return worker(ref.references, ref.commandLine.options); + }); } } server.forEachResolvedProjectReferenceProject = forEachResolvedProjectReferenceProject; - function forEachResolvedProjectReferenceProjectWorker(resolvedProjectReferences, parentOptions, cb, projectReferenceProjectLoadKind, projectService, seenResolvedRefs) { - var loadKind = parentOptions.disableReferencedProjectLoad ? ProjectReferenceProjectLoadKind.Find : projectReferenceProjectLoadKind; - return ts.forEach(resolvedProjectReferences, function (ref) { - if (!ref) - return undefined; - var configFileName = server.toNormalizedPath(ref.sourceFile.fileName); - var canonicalPath = projectService.toCanonicalFileName(configFileName); - var seenValue = seenResolvedRefs === null || seenResolvedRefs === void 0 ? void 0 : seenResolvedRefs.get(canonicalPath); - if (seenValue !== undefined && seenValue >= loadKind) { - return undefined; - } - var result = cb(ref, loadKind); - if (result) { - return result; - } - (seenResolvedRefs || (seenResolvedRefs = new ts.Map())).set(canonicalPath, loadKind); - return ref.references && forEachResolvedProjectReferenceProjectWorker(ref.references, ref.commandLine.options, cb, loadKind, projectService, seenResolvedRefs); - }); + /*@internal*/ + function forEachResolvedProjectReference(project, cb) { + var program = project.getCurrentProgram(); + return program && program.forEachResolvedProjectReference(cb); } + server.forEachResolvedProjectReference = forEachResolvedProjectReference; function forEachPotentialProjectReference(project, cb) { return project.potentialProjectReferences && ts.forEachKey(project.potentialProjectReferences, cb); } function forEachAnyProjectReferenceKind(project, cb, cbProjectRef, cbPotentialProjectRef) { return project.getCurrentProgram() ? - project.forEachResolvedProjectReference(cb) : + forEachResolvedProjectReference(project, cb) : project.isInitialLoadPending() ? forEachPotentialProjectReference(project, cbPotentialProjectRef) : ts.forEach(project.getProjectReferences(), cbProjectRef); @@ -152907,7 +149605,7 @@ var ts; return refProject && cb(refProject); } function forEachReferencedProject(project, cb) { - return forEachAnyProjectReferenceKind(project, function (resolvedRef) { return callbackRefProject(project, cb, resolvedRef.sourceFile.path); }, function (projectRef) { return callbackRefProject(project, cb, project.toPath(ts.resolveProjectReferencePath(projectRef))); }, function (potentialProjectRef) { return callbackRefProject(project, cb, potentialProjectRef); }); + return forEachAnyProjectReferenceKind(project, function (resolvedRef) { return callbackRefProject(project, cb, resolvedRef && resolvedRef.sourceFile.path); }, function (projectRef) { return callbackRefProject(project, cb, project.toPath(projectRef.path)); }, function (potentialProjectRef) { return callbackRefProject(project, cb, potentialProjectRef); }); } function getDetailWatchInfo(watchType, project) { return "Project: " + (project ? project.getProjectName() : "") + " WatchType: " + watchType; @@ -152978,7 +149676,6 @@ var ts; this.openFilesWithNonRootedDiskPath = new ts.Map(); this.compilerOptionsForInferredProjectsPerProjectRoot = new ts.Map(); this.watchOptionsForInferredProjectsPerProjectRoot = new ts.Map(); - this.typeAcquisitionForInferredProjectsPerProjectRoot = new ts.Map(); /** * Project size for configured or external projects */ @@ -153023,6 +149720,7 @@ var ts; this.serverMode = ts.LanguageServiceMode.Semantic; this.syntaxOnly = false; } + ts.Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService"); if (this.host.realpath) { this.realpathToScriptInfos = ts.createMultiMap(); } @@ -153252,7 +149950,6 @@ var ts; ts.Debug.assert(projectRootPath === undefined || this.useInferredProjectPerProjectRoot, "Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled"); var compilerOptions = convertCompilerOptions(projectCompilerOptions); var watchOptions = convertWatchOptions(projectCompilerOptions); - var typeAcquisition = convertTypeAcquisition(projectCompilerOptions); // always set 'allowNonTsExtensions' for inferred projects since user cannot configure it from the outside // previously we did not expose a way for user to change these settings and this option was enabled by default compilerOptions.allowNonTsExtensions = true; @@ -153260,12 +149957,10 @@ var ts; if (canonicalProjectRootPath) { this.compilerOptionsForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, compilerOptions); this.watchOptionsForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, watchOptions || false); - this.typeAcquisitionForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, typeAcquisition); } else { this.compilerOptionsForInferredProjects = compilerOptions; this.watchOptionsForInferredProjects = watchOptions; - this.typeAcquisitionForInferredProjects = typeAcquisition; } for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { var project = _a[_i]; @@ -153282,7 +149977,6 @@ var ts; !project.projectRootPath || !this.compilerOptionsForInferredProjectsPerProjectRoot.has(project.projectRootPath)) { project.setCompilerOptions(compilerOptions); project.setWatchOptions(watchOptions); - project.setTypeAcquisition(typeAcquisition); project.compileOnSaveEnabled = compilerOptions.compileOnSave; project.markAsDirty(); this.delayUpdateProjectGraph(project); @@ -154391,18 +151085,13 @@ var ts; ProjectService.prototype.createInferredProject = function (currentDirectory, isSingleInferredProject, projectRootPath) { var compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects; // TODO: GH#18217 var watchOptions; - var typeAcquisition; if (projectRootPath) { watchOptions = this.watchOptionsForInferredProjectsPerProjectRoot.get(projectRootPath); - typeAcquisition = this.typeAcquisitionForInferredProjectsPerProjectRoot.get(projectRootPath); } if (watchOptions === undefined) { watchOptions = this.watchOptionsForInferredProjects; } - if (typeAcquisition === undefined) { - typeAcquisition = this.typeAcquisitionForInferredProjects; - } - var project = new server.InferredProject(this, this.documentRegistry, compilerOptions, watchOptions || undefined, projectRootPath, currentDirectory, this.currentPluginConfigOverrides, typeAcquisition); + var project = new server.InferredProject(this, this.documentRegistry, compilerOptions, watchOptions || undefined, projectRootPath, currentDirectory, this.currentPluginConfigOverrides); if (isSingleInferredProject) { this.inferredProjects.unshift(project); } @@ -154891,14 +151580,13 @@ var ts; _this.reloadConfiguredProject(project, reason, /*isInitialLoad*/ false); // If this project does not contain this file directly, reload the project till the reloaded project contains the script info directly if (!projectContainsInfoDirectly(project, info)) { - var referencedProject = forEachResolvedProjectReferenceProject(project, info.path, function (child) { + var referencedProject = forEachResolvedProjectReferenceProject(project, function (child) { reloadChildProject(child); return projectContainsInfoDirectly(child, info); }, ProjectReferenceProjectLoadKind.FindCreate); if (referencedProject) { // Reload the project's tree that is already present - forEachResolvedProjectReferenceProject(project, - /*fileName*/ undefined, reloadChildProject, ProjectReferenceProjectLoadKind.Find); + forEachResolvedProjectReferenceProject(project, reloadChildProject, ProjectReferenceProjectLoadKind.Find); } } } @@ -154991,10 +151679,10 @@ var ts; }; if (configuredProject.isSolution() || !projectContainsOriginalInfo(configuredProject)) { // Find the project that is referenced from this solution that contains the script info directly - configuredProject = forEachResolvedProjectReferenceProject(configuredProject, fileName, function (child) { + configuredProject = forEachResolvedProjectReferenceProject(configuredProject, function (child) { updateProjectIfDirty(child); return projectContainsOriginalInfo(child) ? child : undefined; - }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution " + configuredProject.projectName + " to find possible configured project for original file: " + originalFileInfo.fileName + (location !== originalLocation ? " for location: " + location.fileName : "")); + }, configuredProject.getCompilerOptions().disableReferencedProjectLoad ? ProjectReferenceProjectLoadKind.Find : ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution " + configuredProject.projectName + " to find possible configured project for original file: " + originalFileInfo.fileName + (location !== originalLocation ? " for location: " + location.fileName : "")); if (!configuredProject) return undefined; if (configuredProject === project) @@ -155060,7 +151748,7 @@ var ts; // If this configured project doesnt contain script info but // it is solution with project references, try those project references if (!projectContainsInfoDirectly(project, info)) { - forEachResolvedProjectReferenceProject(project, info.path, function (child) { + forEachResolvedProjectReferenceProject(project, function (child) { updateProjectIfDirty(child); // Retain these projects if (!ts.isArray(retainProjects)) { @@ -155156,38 +151844,21 @@ var ts; for (var _i = 0, _a = ts.arrayFrom(this.configuredProjects.values()); _i < _a.length; _i++) { var project = _a[_i]; // If this project has potential project reference for any of the project we are loading ancestor tree for - // load this project first - if (forEachPotentialProjectReference(project, function (potentialRefPath) { return forProjects.has(potentialRefPath); })) { - updateProjectIfDirty(project); + // we need to load this project tree + if (forEachPotentialProjectReference(project, function (potentialRefPath) { return forProjects.has(potentialRefPath); }) || forEachResolvedProjectReference(project, function (_ref, resolvedPath) { return forProjects.has(resolvedPath); })) { + // Load children + this.ensureProjectChildren(project, seenProjects); } - this.ensureProjectChildren(project, forProjects, seenProjects); } }; - ProjectService.prototype.ensureProjectChildren = function (project, forProjects, seenProjects) { - var _a; + ProjectService.prototype.ensureProjectChildren = function (project, seenProjects) { + var _this = this; if (!ts.tryAddToSet(seenProjects, project.canonicalConfigFilePath)) return; - // If this project disables child load ignore it - if (project.getCompilerOptions().disableReferencedProjectLoad) - return; - var children = (_a = project.getCurrentProgram()) === null || _a === void 0 ? void 0 : _a.getResolvedProjectReferences(); - if (!children) - return; - for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { - var child = children_1[_i]; - if (!child) - continue; - var referencedProject = ts.forEachResolvedProjectReference(child.references, function (ref) { return forProjects.has(ref.sourceFile.path) ? ref : undefined; }); - if (!referencedProject) - continue; - // Load this project, - var configFileName = server.toNormalizedPath(child.sourceFile.fileName); - var childProject = project.projectService.findConfiguredProjectByProjectName(configFileName) || - project.projectService.createAndLoadConfiguredProject(configFileName, "Creating project referenced by : " + project.projectName + " as it references project " + referencedProject.sourceFile.fileName); - updateProjectIfDirty(childProject); - // Ensure children for this project - this.ensureProjectChildren(childProject, forProjects, seenProjects); - } + // Update the project + updateProjectIfDirty(project); + // Create tree because project is uptodate we only care of resolved references + forEachResolvedProjectReferenceProject(project, function (child) { return _this.ensureProjectChildren(child, seenProjects); }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project for reference of project: " + project.projectName); }; ProjectService.prototype.cleanupAfterOpeningFile = function (toRetainConfigProjects) { // This was postponed from closeOpenFile to after opening next file, @@ -155472,7 +152143,8 @@ var ts; var rootFiles = proj.rootFiles; var typeAcquisition = proj.typeAcquisition; ts.Debug.assert(!!typeAcquisition, "proj.typeAcquisition should be set by now"); - if (typeAcquisition.enable === false || typeAcquisition.disableFilenameBasedTypeAcquisition) { + // If type acquisition has been explicitly disabled, do not exclude anything from the project + if (typeAcquisition.enable === false) { return []; } var typeAcqInclude = typeAcquisition.include || (typeAcquisition.include = []); @@ -155731,7 +152403,7 @@ var ts; var processDirectory = function (directory) { switch (packageJsonCache.directoryHasPackageJson(directory)) { // Sync and check same directory again - case 3 /* Maybe */: + case 1 /* Maybe */: packageJsonCache.searchDirectoryAndAncestors(directory); return processDirectory(directory); // Check package.json @@ -155837,7 +152509,7 @@ var ts; directoryHasPackageJson: directoryHasPackageJson, searchDirectoryAndAncestors: function (directory) { ts.forEachAncestorDirectory(directory, function (ancestor) { - if (directoryHasPackageJson(ancestor) !== 3 /* Maybe */) { + if (directoryHasPackageJson(ancestor) !== 1 /* Maybe */) { return true; } var packageJsonFileName = host.toPath(ts.combinePaths(ancestor, "package.json")); @@ -155858,7 +152530,7 @@ var ts; function directoryHasPackageJson(directory) { return packageJsons.has(ts.combinePaths(directory, "package.json")) ? -1 /* True */ : directoriesWithoutPackageJson.has(directory) ? 0 /* False */ : - 3 /* Maybe */; + 1 /* Maybe */; } } server.createPackageJsonCache = createPackageJsonCache; @@ -157084,7 +153756,7 @@ var ts; }; Session.prototype.getEncodedSemanticClassifications = function (args) { var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - return project.getLanguageService().getEncodedSemanticClassifications(file, args, args.format); + return project.getLanguageService().getEncodedSemanticClassifications(file, args); }; Session.prototype.getProject = function (projectFileName) { return projectFileName === undefined ? undefined : this.projectService.findProject(projectFileName); @@ -157664,7 +154336,7 @@ var ts; entries.metadata = completions.metadata; return entries; } - var res = __assign(__assign({}, completions), { optionalReplacementSpan: completions.optionalReplacementSpan && toProtocolTextSpan(completions.optionalReplacementSpan, scriptInfo), entries: entries }); + var res = __assign(__assign({}, completions), { entries: entries }); return res; }; Session.prototype.getCompletionEntryDetails = function (args, simplifiedResult) { @@ -158197,7 +154869,6 @@ var ts; kind: item.kind, kindModifiers: item.kindModifiers, file: item.file, - containerName: item.containerName, span: toProtocolTextSpan(item.span, scriptInfo), selectionSpan: toProtocolTextSpan(item.selectionSpan, scriptInfo) }; @@ -159845,7 +156516,7 @@ var ts; } else { type = operatorOrType; - operator = 138 /* KeyOfKeyword */; + operator = 137 /* KeyOfKeyword */; } return ts.factory.createTypeOperatorNode(operator, type); }, factoryDeprecation); @@ -160023,7 +156694,7 @@ var ts; ts.createNode = ts.Debug.deprecate(function createNode(kind, pos, end) { if (pos === void 0) { pos = 0; } if (end === void 0) { end = 0; } - return ts.setTextRangePosEnd(kind === 297 /* SourceFile */ ? ts.parseBaseNodeFactory.createBaseSourceFileNode(kind) : + return ts.setTextRangePosEnd(kind === 294 /* SourceFile */ ? ts.parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 78 /* Identifier */ ? ts.parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 79 /* PrivateIdentifier */ ? ts.parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !ts.isNodeKind(kind) ? ts.parseBaseNodeFactory.createBaseTokenNode(kind) : @@ -160052,7 +156723,7 @@ var ts; // #region Renamed node Tests /** @deprecated Use `isTypeAssertionExpression` instead. */ ts.isTypeAssertion = ts.Debug.deprecate(function isTypeAssertion(node) { - return node.kind === 206 /* TypeAssertionExpression */; + return node.kind === 203 /* TypeAssertionExpression */; }, { since: "4.0", warnAfter: "4.1", @@ -160286,11 +156957,7 @@ var ts; } this.installer = childProcess.fork(ts.combinePaths(__dirname, "typingsInstaller.js"), args, { execArgv: execArgv }); this.installer.on("message", function (m) { return _this.handleMessage(m); }); - // We have to schedule this event to the next tick - // cause this fn will be called during - // new IOSession => super(which is Session) => new ProjectService => NodeTypingsInstaller.attach - // and if "event" is referencing "this" before super class is initialized, it will be a ReferenceError in ES6 class. - this.host.setImmediate(function () { return _this.event({ pid: _this.installer.pid }, "typingsInstallerPid"); }); + this.event({ pid: this.installer.pid }, "typingsInstallerPid"); process.on("exit", function () { _this.installer.kill(); }); @@ -160440,7 +157107,17 @@ var ts; function IOSession() { var _this = this; var event = function (body, eventName) { - _this.event(body, eventName); + if (_this.constructed) { + _this.event(body, eventName); + } + else { + // It is unsafe to dereference `this` before initialization completes, + // so we defer until the next tick. + // + // Construction should finish before the next tick fires, so we do not need to do this recursively. + // eslint-disable-next-line no-restricted-globals + setImmediate(function () { return _this.event(body, eventName); }); + } }; var host = sys; var typingsInstaller = disableAutomaticTypingAcquisition diff --git a/node_modules/typescript/lib/tsserverlibrary.d.ts b/node_modules/typescript/lib/tsserverlibrary.d.ts index 668034e..aad0523 100644 --- a/node_modules/typescript/lib/tsserverlibrary.d.ts +++ b/node_modules/typescript/lib/tsserverlibrary.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "4.1"; + const versionMajorMinor = "4.0"; /** The version of the TypeScript compiler release */ const version: string; /** @@ -240,212 +240,207 @@ declare namespace ts { DeclareKeyword = 133, GetKeyword = 134, InferKeyword = 135, - IntrinsicKeyword = 136, - IsKeyword = 137, - KeyOfKeyword = 138, - ModuleKeyword = 139, - NamespaceKeyword = 140, - NeverKeyword = 141, - ReadonlyKeyword = 142, - RequireKeyword = 143, - NumberKeyword = 144, - ObjectKeyword = 145, - SetKeyword = 146, - StringKeyword = 147, - SymbolKeyword = 148, - TypeKeyword = 149, - UndefinedKeyword = 150, - UniqueKeyword = 151, - UnknownKeyword = 152, - FromKeyword = 153, - GlobalKeyword = 154, - BigIntKeyword = 155, - OfKeyword = 156, - QualifiedName = 157, - ComputedPropertyName = 158, - TypeParameter = 159, - Parameter = 160, - Decorator = 161, - PropertySignature = 162, - PropertyDeclaration = 163, - MethodSignature = 164, - MethodDeclaration = 165, - Constructor = 166, - GetAccessor = 167, - SetAccessor = 168, - CallSignature = 169, - ConstructSignature = 170, - IndexSignature = 171, - TypePredicate = 172, - TypeReference = 173, - FunctionType = 174, - ConstructorType = 175, - TypeQuery = 176, - TypeLiteral = 177, - ArrayType = 178, - TupleType = 179, - OptionalType = 180, - RestType = 181, - UnionType = 182, - IntersectionType = 183, - ConditionalType = 184, - InferType = 185, - ParenthesizedType = 186, - ThisType = 187, - TypeOperator = 188, - IndexedAccessType = 189, - MappedType = 190, - LiteralType = 191, - NamedTupleMember = 192, - TemplateLiteralType = 193, - TemplateLiteralTypeSpan = 194, - ImportType = 195, - ObjectBindingPattern = 196, - ArrayBindingPattern = 197, - BindingElement = 198, - ArrayLiteralExpression = 199, - ObjectLiteralExpression = 200, - PropertyAccessExpression = 201, - ElementAccessExpression = 202, - CallExpression = 203, - NewExpression = 204, - TaggedTemplateExpression = 205, - TypeAssertionExpression = 206, - ParenthesizedExpression = 207, - FunctionExpression = 208, - ArrowFunction = 209, - DeleteExpression = 210, - TypeOfExpression = 211, - VoidExpression = 212, - AwaitExpression = 213, - PrefixUnaryExpression = 214, - PostfixUnaryExpression = 215, - BinaryExpression = 216, - ConditionalExpression = 217, - TemplateExpression = 218, - YieldExpression = 219, - SpreadElement = 220, - ClassExpression = 221, - OmittedExpression = 222, - ExpressionWithTypeArguments = 223, - AsExpression = 224, - NonNullExpression = 225, - MetaProperty = 226, - SyntheticExpression = 227, - TemplateSpan = 228, - SemicolonClassElement = 229, - Block = 230, - EmptyStatement = 231, - VariableStatement = 232, - ExpressionStatement = 233, - IfStatement = 234, - DoStatement = 235, - WhileStatement = 236, - ForStatement = 237, - ForInStatement = 238, - ForOfStatement = 239, - ContinueStatement = 240, - BreakStatement = 241, - ReturnStatement = 242, - WithStatement = 243, - SwitchStatement = 244, - LabeledStatement = 245, - ThrowStatement = 246, - TryStatement = 247, - DebuggerStatement = 248, - VariableDeclaration = 249, - VariableDeclarationList = 250, - FunctionDeclaration = 251, - ClassDeclaration = 252, - InterfaceDeclaration = 253, - TypeAliasDeclaration = 254, - EnumDeclaration = 255, - ModuleDeclaration = 256, - ModuleBlock = 257, - CaseBlock = 258, - NamespaceExportDeclaration = 259, - ImportEqualsDeclaration = 260, - ImportDeclaration = 261, - ImportClause = 262, - NamespaceImport = 263, - NamedImports = 264, - ImportSpecifier = 265, - ExportAssignment = 266, - ExportDeclaration = 267, - NamedExports = 268, - NamespaceExport = 269, - ExportSpecifier = 270, - MissingDeclaration = 271, - ExternalModuleReference = 272, - JsxElement = 273, - JsxSelfClosingElement = 274, - JsxOpeningElement = 275, - JsxClosingElement = 276, - JsxFragment = 277, - JsxOpeningFragment = 278, - JsxClosingFragment = 279, - JsxAttribute = 280, - JsxAttributes = 281, - JsxSpreadAttribute = 282, - JsxExpression = 283, - CaseClause = 284, - DefaultClause = 285, - HeritageClause = 286, - CatchClause = 287, - PropertyAssignment = 288, - ShorthandPropertyAssignment = 289, - SpreadAssignment = 290, - EnumMember = 291, - UnparsedPrologue = 292, - UnparsedPrepend = 293, - UnparsedText = 294, - UnparsedInternalText = 295, - UnparsedSyntheticReference = 296, - SourceFile = 297, - Bundle = 298, - UnparsedSource = 299, - InputFiles = 300, - JSDocTypeExpression = 301, - JSDocNameReference = 302, - JSDocAllType = 303, - JSDocUnknownType = 304, - JSDocNullableType = 305, - JSDocNonNullableType = 306, - JSDocOptionalType = 307, - JSDocFunctionType = 308, - JSDocVariadicType = 309, - JSDocNamepathType = 310, - JSDocComment = 311, - JSDocTypeLiteral = 312, - JSDocSignature = 313, - JSDocTag = 314, - JSDocAugmentsTag = 315, - JSDocImplementsTag = 316, - JSDocAuthorTag = 317, - JSDocDeprecatedTag = 318, - JSDocClassTag = 319, - JSDocPublicTag = 320, - JSDocPrivateTag = 321, - JSDocProtectedTag = 322, - JSDocReadonlyTag = 323, - JSDocCallbackTag = 324, - JSDocEnumTag = 325, - JSDocParameterTag = 326, - JSDocReturnTag = 327, - JSDocThisTag = 328, - JSDocTypeTag = 329, - JSDocTemplateTag = 330, - JSDocTypedefTag = 331, - JSDocSeeTag = 332, - JSDocPropertyTag = 333, - SyntaxList = 334, - NotEmittedStatement = 335, - PartiallyEmittedExpression = 336, - CommaListExpression = 337, - MergeDeclarationMarker = 338, - EndOfDeclarationMarker = 339, - SyntheticReferenceExpression = 340, - Count = 341, + IsKeyword = 136, + KeyOfKeyword = 137, + ModuleKeyword = 138, + NamespaceKeyword = 139, + NeverKeyword = 140, + ReadonlyKeyword = 141, + RequireKeyword = 142, + NumberKeyword = 143, + ObjectKeyword = 144, + SetKeyword = 145, + StringKeyword = 146, + SymbolKeyword = 147, + TypeKeyword = 148, + UndefinedKeyword = 149, + UniqueKeyword = 150, + UnknownKeyword = 151, + FromKeyword = 152, + GlobalKeyword = 153, + BigIntKeyword = 154, + OfKeyword = 155, + QualifiedName = 156, + ComputedPropertyName = 157, + TypeParameter = 158, + Parameter = 159, + Decorator = 160, + PropertySignature = 161, + PropertyDeclaration = 162, + MethodSignature = 163, + MethodDeclaration = 164, + Constructor = 165, + GetAccessor = 166, + SetAccessor = 167, + CallSignature = 168, + ConstructSignature = 169, + IndexSignature = 170, + TypePredicate = 171, + TypeReference = 172, + FunctionType = 173, + ConstructorType = 174, + TypeQuery = 175, + TypeLiteral = 176, + ArrayType = 177, + TupleType = 178, + OptionalType = 179, + RestType = 180, + UnionType = 181, + IntersectionType = 182, + ConditionalType = 183, + InferType = 184, + ParenthesizedType = 185, + ThisType = 186, + TypeOperator = 187, + IndexedAccessType = 188, + MappedType = 189, + LiteralType = 190, + NamedTupleMember = 191, + ImportType = 192, + ObjectBindingPattern = 193, + ArrayBindingPattern = 194, + BindingElement = 195, + ArrayLiteralExpression = 196, + ObjectLiteralExpression = 197, + PropertyAccessExpression = 198, + ElementAccessExpression = 199, + CallExpression = 200, + NewExpression = 201, + TaggedTemplateExpression = 202, + TypeAssertionExpression = 203, + ParenthesizedExpression = 204, + FunctionExpression = 205, + ArrowFunction = 206, + DeleteExpression = 207, + TypeOfExpression = 208, + VoidExpression = 209, + AwaitExpression = 210, + PrefixUnaryExpression = 211, + PostfixUnaryExpression = 212, + BinaryExpression = 213, + ConditionalExpression = 214, + TemplateExpression = 215, + YieldExpression = 216, + SpreadElement = 217, + ClassExpression = 218, + OmittedExpression = 219, + ExpressionWithTypeArguments = 220, + AsExpression = 221, + NonNullExpression = 222, + MetaProperty = 223, + SyntheticExpression = 224, + TemplateSpan = 225, + SemicolonClassElement = 226, + Block = 227, + EmptyStatement = 228, + VariableStatement = 229, + ExpressionStatement = 230, + IfStatement = 231, + DoStatement = 232, + WhileStatement = 233, + ForStatement = 234, + ForInStatement = 235, + ForOfStatement = 236, + ContinueStatement = 237, + BreakStatement = 238, + ReturnStatement = 239, + WithStatement = 240, + SwitchStatement = 241, + LabeledStatement = 242, + ThrowStatement = 243, + TryStatement = 244, + DebuggerStatement = 245, + VariableDeclaration = 246, + VariableDeclarationList = 247, + FunctionDeclaration = 248, + ClassDeclaration = 249, + InterfaceDeclaration = 250, + TypeAliasDeclaration = 251, + EnumDeclaration = 252, + ModuleDeclaration = 253, + ModuleBlock = 254, + CaseBlock = 255, + NamespaceExportDeclaration = 256, + ImportEqualsDeclaration = 257, + ImportDeclaration = 258, + ImportClause = 259, + NamespaceImport = 260, + NamedImports = 261, + ImportSpecifier = 262, + ExportAssignment = 263, + ExportDeclaration = 264, + NamedExports = 265, + NamespaceExport = 266, + ExportSpecifier = 267, + MissingDeclaration = 268, + ExternalModuleReference = 269, + JsxElement = 270, + JsxSelfClosingElement = 271, + JsxOpeningElement = 272, + JsxClosingElement = 273, + JsxFragment = 274, + JsxOpeningFragment = 275, + JsxClosingFragment = 276, + JsxAttribute = 277, + JsxAttributes = 278, + JsxSpreadAttribute = 279, + JsxExpression = 280, + CaseClause = 281, + DefaultClause = 282, + HeritageClause = 283, + CatchClause = 284, + PropertyAssignment = 285, + ShorthandPropertyAssignment = 286, + SpreadAssignment = 287, + EnumMember = 288, + UnparsedPrologue = 289, + UnparsedPrepend = 290, + UnparsedText = 291, + UnparsedInternalText = 292, + UnparsedSyntheticReference = 293, + SourceFile = 294, + Bundle = 295, + UnparsedSource = 296, + InputFiles = 297, + JSDocTypeExpression = 298, + JSDocAllType = 299, + JSDocUnknownType = 300, + JSDocNullableType = 301, + JSDocNonNullableType = 302, + JSDocOptionalType = 303, + JSDocFunctionType = 304, + JSDocVariadicType = 305, + JSDocNamepathType = 306, + JSDocComment = 307, + JSDocTypeLiteral = 308, + JSDocSignature = 309, + JSDocTag = 310, + JSDocAugmentsTag = 311, + JSDocImplementsTag = 312, + JSDocAuthorTag = 313, + JSDocDeprecatedTag = 314, + JSDocClassTag = 315, + JSDocPublicTag = 316, + JSDocPrivateTag = 317, + JSDocProtectedTag = 318, + JSDocReadonlyTag = 319, + JSDocCallbackTag = 320, + JSDocEnumTag = 321, + JSDocParameterTag = 322, + JSDocReturnTag = 323, + JSDocThisTag = 324, + JSDocTypeTag = 325, + JSDocTemplateTag = 326, + JSDocTypedefTag = 327, + JSDocPropertyTag = 328, + SyntaxList = 329, + NotEmittedStatement = 330, + PartiallyEmittedExpression = 331, + CommaListExpression = 332, + MergeDeclarationMarker = 333, + EndOfDeclarationMarker = 334, + SyntheticReferenceExpression = 335, + Count = 336, FirstAssignment = 62, LastAssignment = 77, FirstCompoundAssignment = 63, @@ -453,15 +448,15 @@ declare namespace ts { FirstReservedWord = 80, LastReservedWord = 115, FirstKeyword = 80, - LastKeyword = 156, + LastKeyword = 155, FirstFutureReservedWord = 116, LastFutureReservedWord = 124, - FirstTypeNode = 172, - LastTypeNode = 195, + FirstTypeNode = 171, + LastTypeNode = 192, FirstPunctuation = 18, LastPunctuation = 77, FirstToken = 0, - LastToken = 156, + LastToken = 155, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -470,21 +465,21 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 77, - FirstStatement = 232, - LastStatement = 248, - FirstNode = 157, - FirstJSDocNode = 301, - LastJSDocNode = 333, - FirstJSDocTagNode = 314, - LastJSDocTagNode = 333, + FirstStatement = 229, + LastStatement = 245, + FirstNode = 156, + FirstJSDocNode = 298, + LastJSDocNode = 328, + FirstJSDocTagNode = 310, + LastJSDocTagNode = 328, } export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail; export type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | 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; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.StaticKeyword; - export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; + export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind; export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; @@ -615,8 +610,7 @@ declare namespace ts { None = 0, ReservedInNestedScopes = 8, Optimistic = 16, - FileLevel = 32, - AllowNameSubstitution = 64 + FileLevel = 32 } export interface Identifier extends PrimaryExpression, Declaration { readonly kind: SyntaxKind.Identifier; @@ -948,7 +942,6 @@ declare namespace ts { readonly kind: SyntaxKind.MappedType; readonly readonlyToken?: ReadonlyToken | PlusToken | MinusToken; readonly typeParameter: TypeParameterDeclaration; - readonly nameType?: TypeNode; readonly questionToken?: QuestionToken | PlusToken | MinusToken; readonly type?: TypeNode; } @@ -961,17 +954,6 @@ declare namespace ts { } export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; export type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral; - export interface TemplateLiteralTypeNode extends TypeNode { - kind: SyntaxKind.TemplateLiteralType; - readonly head: TemplateHead; - readonly templateSpans: NodeArray; - } - export interface TemplateLiteralTypeSpan extends TypeNode { - readonly kind: SyntaxKind.TemplateLiteralTypeSpan; - readonly parent: TemplateLiteralTypeNode; - readonly type: TypeNode; - readonly literal: TemplateMiddle | TemplateTail; - } export interface Expression extends Node { _expressionBrand: any; } @@ -1160,15 +1142,15 @@ declare namespace ts { export type LiteralToken = NumericLiteral | BigIntLiteral | StringLiteral | JsxText | RegularExpressionLiteral | NoSubstitutionTemplateLiteral; export interface TemplateHead extends TemplateLiteralLikeNode { readonly kind: SyntaxKind.TemplateHead; - readonly parent: TemplateExpression | TemplateLiteralTypeNode; + readonly parent: TemplateExpression; } export interface TemplateMiddle extends TemplateLiteralLikeNode { readonly kind: SyntaxKind.TemplateMiddle; - readonly parent: TemplateSpan | TemplateLiteralTypeSpan; + readonly parent: TemplateSpan; } export interface TemplateTail extends TemplateLiteralLikeNode { readonly kind: SyntaxKind.TemplateTail; - readonly parent: TemplateSpan | TemplateLiteralTypeSpan; + readonly parent: TemplateSpan; } export type PseudoLiteralToken = TemplateHead | TemplateMiddle | TemplateTail; export type TemplateLiteralToken = NoSubstitutionTemplateLiteral | PseudoLiteralToken; @@ -1700,10 +1682,6 @@ declare namespace ts { readonly kind: SyntaxKind.JSDocTypeExpression; readonly type: TypeNode; } - export interface JSDocNameReference extends Node { - readonly kind: SyntaxKind.JSDocNameReference; - readonly name: EntityName; - } export interface JSDocType extends TypeNode { _jsDocTypeBrand: any; } @@ -1802,10 +1780,6 @@ declare namespace ts { readonly constraint: JSDocTypeExpression | undefined; readonly typeParameters: NodeArray; } - export interface JSDocSeeTag extends JSDocTag { - readonly kind: SyntaxKind.JSDocSeeTag; - readonly name?: JSDocNameReference; - } export interface JSDocReturnTag extends JSDocTag { readonly kind: SyntaxKind.JSDocReturnTag; readonly typeExpression?: JSDocTypeExpression; @@ -2079,7 +2053,6 @@ declare namespace ts { * Gets a type checker that can be used to semantically analyze source files in the program. */ getTypeChecker(): TypeChecker; - getTypeCatalog(): readonly Type[]; getNodeCount(): number; getIdentifierCount(): number; getSymbolCount(): number; @@ -2186,7 +2159,7 @@ declare namespace ts { * This is necessary as an identifier in short-hand property assignment can contains two meaning: property name and property value. */ getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined; - getExportSpecifierLocalTargetSymbol(location: ExportSpecifier | Identifier): Symbol | undefined; + getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol | undefined; /** * If a symbol is a local symbol with an associated exported symbol, returns the exported symbol. * Otherwise returns its input. @@ -2207,7 +2180,6 @@ declare namespace ts { getFullyQualifiedName(symbol: Symbol): string; getAugmentedPropertiesOfType(type: Type): Symbol[]; getRootSymbols(symbol: Symbol): readonly Symbol[]; - getSymbolOfExpando(node: Node, allowDeclaration: boolean): Symbol | undefined; getContextualType(node: Expression): Type | undefined; /** * returns unknownSignature in the case of an error. @@ -2478,13 +2450,11 @@ declare namespace ts { Conditional = 16777216, Substitution = 33554432, NonPrimitive = 67108864, - TemplateLiteral = 134217728, - StringMapping = 268435456, Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, PossiblyFalsy = 117724, - StringLike = 402653316, + StringLike = 132, NumberLike = 296, BigIntLike = 2112, BooleanLike = 528, @@ -2495,10 +2465,10 @@ declare namespace ts { StructuredType = 3670016, TypeVariable = 8650752, InstantiableNonPrimitive = 58982400, - InstantiablePrimitive = 406847488, - Instantiable = 465829888, - StructuredOrInstantiable = 469499904, - Narrowable = 536624127, + InstantiablePrimitive = 4194304, + Instantiable = 63176704, + StructuredOrInstantiable = 66846720, + Narrowable = 133970943, } export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; export interface Type { @@ -2635,6 +2605,8 @@ declare namespace ts { node: ConditionalTypeNode; checkType: Type; extendsType: Type; + trueType: Type; + falseType: Type; isDistributive: boolean; inferTypeParameters?: TypeParameter[]; outerTypeParameters?: TypeParameter[]; @@ -2649,14 +2621,6 @@ declare namespace ts { resolvedTrueType: Type; resolvedFalseType: Type; } - export interface TemplateLiteralType extends InstantiableType { - texts: readonly string[]; - types: readonly Type[]; - } - export interface StringMappingType extends InstantiableType { - symbol: Symbol; - type: Type; - } export interface SubstitutionType extends InstantiableType { baseType: Type; substitute: Type; @@ -2834,7 +2798,6 @@ declare namespace ts { assumeChangesOnlyAffectDirectDependencies?: boolean; noLib?: boolean; noResolve?: boolean; - noUncheckedIndexedAccess?: boolean; out?: string; outDir?: string; outFile?: string; @@ -2845,7 +2808,6 @@ declare namespace ts { reactNamespace?: string; jsxFactory?: string; jsxFragmentFactory?: string; - jsxImportSource?: string; composite?: boolean; incremental?: boolean; tsBuildInfoFile?: string; @@ -2890,8 +2852,7 @@ declare namespace ts { enable?: boolean; include?: string[]; exclude?: string[]; - disableFilenameBasedTypeAcquisition?: boolean; - [option: string]: CompilerOptionsValue | undefined; + [option: string]: string[] | boolean | undefined; } export enum ModuleKind { None = 0, @@ -2907,9 +2868,7 @@ declare namespace ts { None = 0, Preserve = 1, React = 2, - ReactNative = 3, - ReactJSX = 4, - ReactJSXDev = 5 + ReactNative = 3 } export enum ImportsNotUsedAsValues { Remove = 0, @@ -3219,8 +3178,6 @@ declare namespace ts { updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructSignatureDeclaration; createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; - createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; - updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; createKeywordTypeNode(kind: TKind): KeywordTypeNode; createTypePredicateNode(assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode | string, type: TypeNode | undefined): TypePredicateNode; updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode; @@ -3261,12 +3218,10 @@ declare namespace ts { updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; - createMappedTypeNode(readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; - updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; + createMappedTypeNode(readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; + updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode; updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode; - createTemplateLiteralType(head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode; - updateTemplateLiteralType(node: TemplateLiteralTypeNode, head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode; createObjectBindingPattern(elements: readonly BindingElement[]): ObjectBindingPattern; updateObjectBindingPattern(node: ObjectBindingPattern, elements: readonly BindingElement[]): ObjectBindingPattern; createArrayBindingPattern(elements: readonly ArrayBindingElement[]): ArrayBindingPattern; @@ -3446,8 +3401,6 @@ declare namespace ts { updateJSDocNamepathType(node: JSDocNamepathType, type: TypeNode): JSDocNamepathType; createJSDocTypeExpression(type: TypeNode): JSDocTypeExpression; updateJSDocTypeExpression(node: JSDocTypeExpression, type: TypeNode): JSDocTypeExpression; - createJSDocNameReference(name: EntityName): JSDocNameReference; - updateJSDocNameReference(node: JSDocNameReference, name: EntityName): JSDocNameReference; createJSDocTypeLiteral(jsDocPropertyTags?: readonly JSDocPropertyLikeTag[], isArrayType?: boolean): JSDocTypeLiteral; updateJSDocTypeLiteral(node: JSDocTypeLiteral, jsDocPropertyTags: readonly JSDocPropertyLikeTag[] | undefined, isArrayType: boolean | undefined): JSDocTypeLiteral; createJSDocSignature(typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag): JSDocSignature; @@ -3462,8 +3415,6 @@ declare namespace ts { updateJSDocPropertyTag(node: JSDocPropertyTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | undefined): JSDocPropertyTag; createJSDocTypeTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocTypeTag; updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocTypeTag; - createJSDocSeeTag(tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string): JSDocSeeTag; - updateJSDocSeeTag(node: JSDocSeeTag, tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string): JSDocSeeTag; createJSDocReturnTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocReturnTag; updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocReturnTag; createJSDocThisTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocThisTag; @@ -4051,14 +4002,6 @@ declare namespace ts { function getOriginalNode(node: Node, nodeTest: (node: Node) => node is T): T; function getOriginalNode(node: Node | undefined): Node | undefined; function getOriginalNode(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined; - /** - * Iterates through the parent chain of a node and performs the callback on each parent until the callback - * returns a truthy value, then returns that value. - * If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit" - * At that point findAncestor returns undefined. - */ - function findAncestor(node: Node | undefined, callback: (element: Node) => element is T): T | undefined; - function findAncestor(node: Node | undefined, callback: (element: Node) => boolean | "quit"): Node | undefined; /** * Gets a value indicating whether a node originated in the parse tree. * @@ -4377,8 +4320,6 @@ declare namespace ts { function isMappedTypeNode(node: Node): node is MappedTypeNode; function isLiteralTypeNode(node: Node): node is LiteralTypeNode; function isImportTypeNode(node: Node): node is ImportTypeNode; - function isTemplateLiteralTypeSpan(node: Node): node is TemplateLiteralTypeSpan; - function isTemplateLiteralTypeNode(node: Node): node is TemplateLiteralTypeNode; function isObjectBindingPattern(node: Node): node is ObjectBindingPattern; function isArrayBindingPattern(node: Node): node is ArrayBindingPattern; function isBindingElement(node: Node): node is BindingElement; @@ -4483,7 +4424,6 @@ declare namespace ts { function isBundle(node: Node): node is Bundle; function isUnparsedSource(node: Node): node is UnparsedSource; function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression; - function isJSDocNameReference(node: Node): node is JSDocNameReference; function isJSDocAllType(node: Node): node is JSDocAllType; function isJSDocUnknownType(node: Node): node is JSDocUnknownType; function isJSDocNullableType(node: Node): node is JSDocNullableType; @@ -5417,10 +5357,6 @@ declare namespace ts { type WithMetadata = T & { metadata?: unknown; }; - enum SemanticClassificationFormat { - Original = "original", - TwentyTwenty = "2020" - } interface LanguageService { /** This is used as a part of restarting the language service. */ cleanupSemanticCache(): void; @@ -5472,22 +5408,10 @@ declare namespace ts { getCompilerOptionsDiagnostics(): Diagnostic[]; /** @deprecated Use getEncodedSyntacticClassifications instead. */ getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSyntacticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[]; /** @deprecated Use getEncodedSemanticClassifications instead. */ getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSemanticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[]; - /** Encoded as triples of [start, length, ClassificationType]. */ getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications; - /** - * Gets semantic highlights information for a particular file. Has two formats, an older - * version used by VS and a format used by VS Code. - * - * @param fileName The path to the file - * @param position A text span to return results within - * @param format Which format to use, defaults to "original" - * @returns a number array encoded as triples of [start, length, ClassificationType, ...]. - */ - getEncodedSemanticClassifications(fileName: string, span: TextSpan, format?: SemanticClassificationFormat): Classifications; + getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications; /** * Gets completion entries at a particular position in a file. * @@ -5646,10 +5570,6 @@ declare namespace ts { textSpan: TextSpan; classificationType: ClassificationTypeNames; } - interface ClassifiedSpan2020 { - textSpan: TextSpan; - classificationType: number; - } /** * Navigation bar interface designed for visual studio's dual-column layout. * This does not form a proper tree. @@ -6046,12 +5966,6 @@ declare namespace ts { /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; - /** - * In the absence of `CompletionEntry["replacementSpan"], the editor may choose whether to use - * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span - * must be used to commit that completion entry. - */ - optionalReplacementSpan?: TextSpan; /** * true when the current location also allows for a new identifier */ @@ -6967,11 +6881,6 @@ declare namespace ts.server.protocol { * so this description should make sense by itself if the parent is inlineable=true */ description: string; - /** - * A message to show to the user if the refactoring cannot be applied in - * the current context. - */ - notApplicableReason?: string; } interface GetEditsForRefactorRequest extends Request { command: CommandTypes.GetEditsForRefactor; @@ -7755,10 +7664,6 @@ declare namespace ts.server.protocol { */ closedFiles?: string[]; } - /** - * External projects have a typeAcquisition option so they need to be added separately to compiler options for inferred projects. - */ - type InferredProjectCompilerOptions = ExternalProjectCompilerOptions & TypeAcquisition; /** * Request to set compiler options for inferred projects. * External projects are opened / closed explicitly. @@ -7779,7 +7684,7 @@ declare namespace ts.server.protocol { /** * Compiler options to be used with inferred projects. */ - options: InferredProjectCompilerOptions; + options: ExternalProjectCompilerOptions; /** * Specifies the project root path used to scope compiler options. * It is an error to provide this property if the server has not been started with @@ -8199,12 +8104,6 @@ declare namespace ts.server.protocol { readonly isGlobalCompletion: boolean; readonly isMemberCompletion: boolean; readonly isNewIdentifierLocation: boolean; - /** - * In the absence of `CompletionEntry["replacementSpan"]`, the editor may choose whether to use - * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span - * must be used to commit that completion entry. - */ - readonly optionalReplacementSpan?: TextSpan; readonly entries: readonly CompletionEntry[]; } interface CompletionDetailsResponse extends Response { @@ -8966,7 +8865,6 @@ declare namespace ts.server.protocol { insertSpaceAfterConstructor?: boolean; insertSpaceAfterKeywordsInControlFlowStatements?: boolean; insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean; - insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean; insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean; insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean; insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean; @@ -9004,7 +8902,6 @@ declare namespace ts.server.protocol { readonly allowTextChangesInNewFiles?: boolean; readonly lazyConfiguredProjectsFromExternalProject?: boolean; readonly providePrefixAndSuffixTextForRename?: boolean; - readonly provideRefactorNotApplicableReason?: boolean; readonly allowRenameOfImportPath?: boolean; readonly includePackageJsonAutoImports?: "auto" | "on" | "off"; } @@ -9084,9 +8981,7 @@ declare namespace ts.server.protocol { None = "None", Preserve = "Preserve", ReactNative = "ReactNative", - React = "React", - ReactJSX = "ReactJSX", - ReactJSXDev = "ReactJSXDev" + React = "React" } enum ModuleKind { None = "None", @@ -9096,7 +8991,6 @@ declare namespace ts.server.protocol { System = "System", ES6 = "ES6", ES2015 = "ES2015", - ES2020 = "ES2020", ESNext = "ESNext" } enum ModuleResolutionKind { @@ -9117,7 +9011,6 @@ declare namespace ts.server.protocol { ES2018 = "ES2018", ES2019 = "ES2019", ES2020 = "ES2020", - JSON = "JSON", ESNext = "ESNext" } } @@ -9310,6 +9203,7 @@ declare namespace ts.server { enableLanguageService(): void; disableLanguageService(lastFileExceededProgramSize?: string): void; getProjectName(): string; + abstract getTypeAcquisition(): TypeAcquisition; protected removeLocalTypingsFromTypeAcquisition(newTypeAcquisition: TypeAcquisition): TypeAcquisition; getExternalFiles(): SortedReadonlyArray; getSourceFile(path: Path): SourceFile | undefined; @@ -9348,8 +9242,6 @@ declare namespace ts.server { getScriptInfo(uncheckedFileName: string): ScriptInfo | undefined; filesToString(writeProjectFileNames: boolean): string; setCompilerOptions(compilerOptions: CompilerOptions): void; - setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void; - getTypeAcquisition(): TypeAcquisition; protected removeRoot(info: ScriptInfo): void; protected enableGlobalPlugins(options: CompilerOptions, pluginConfigOverrides: Map | undefined): void; protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[], pluginConfigOverrides: Map | undefined): void; @@ -9395,6 +9287,7 @@ declare namespace ts.server { * Otherwise it will create an InferredProject. */ class ConfiguredProject extends Project { + private typeAcquisition; private directoriesWatchedForWildcards; readonly canonicalConfigFilePath: NormalizedPath; /** Ref count to the project when opened from external project */ @@ -9418,6 +9311,8 @@ declare namespace ts.server { */ getAllProjectErrors(): readonly Diagnostic[]; setProjectErrors(projectErrors: Diagnostic[]): void; + setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void; + getTypeAcquisition(): TypeAcquisition; close(): void; getEffectiveTypeRoots(): string[]; } @@ -9429,8 +9324,11 @@ declare namespace ts.server { externalProjectName: string; compileOnSaveEnabled: boolean; excludedFiles: readonly NormalizedPath[]; + private typeAcquisition; updateGraph(): boolean; getExcludedFiles(): readonly NormalizedPath[]; + getTypeAcquisition(): TypeAcquisition; + setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void; } } declare namespace ts.server { @@ -9564,7 +9462,6 @@ declare namespace ts.server { export function convertFormatOptions(protocolOptions: protocol.FormatCodeSettings): FormatCodeSettings; export function convertCompilerOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): CompilerOptions & protocol.CompileOnSaveMixin; export function convertWatchOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): WatchOptions | undefined; - export function convertTypeAcquisition(protocolOptions: protocol.InferredProjectCompilerOptions): TypeAcquisition | undefined; export function tryConvertScriptKindName(scriptKindName: protocol.ScriptKindName | ScriptKind): ScriptKind; export function convertScriptKindName(scriptKindName: protocol.ScriptKindName): ScriptKind.Unknown | ScriptKind.JS | ScriptKind.JSX | ScriptKind.TS | ScriptKind.TSX; export interface HostConfiguration { @@ -9633,8 +9530,6 @@ declare namespace ts.server { private compilerOptionsForInferredProjectsPerProjectRoot; private watchOptionsForInferredProjects; private watchOptionsForInferredProjectsPerProjectRoot; - private typeAcquisitionForInferredProjects; - private typeAcquisitionForInferredProjectsPerProjectRoot; /** * Project size for configured or external projects */ @@ -9680,7 +9575,7 @@ declare namespace ts.server { updateTypingsForProject(response: SetTypings | InvalidateCachedTypings | PackageInstalledResponse): void; private delayUpdateProjectGraph; private delayUpdateProjectGraphs; - setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void; + setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions, projectRootPath?: string): void; findProject(projectName: string): Project | undefined; getDefaultProjectForFile(fileName: NormalizedPath, ensureProject: boolean): Project | undefined; private doEnsureDefaultProjectForFile; @@ -10228,9 +10123,9 @@ declare namespace ts { /** @deprecated Use `factory.updateIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */ const updateIndexedAccessTypeNode: (node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode; /** @deprecated Use `factory.createMappedTypeNode` or the factory supplied by your transformation context instead. */ - const createMappedTypeNode: (readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; + const createMappedTypeNode: (readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; /** @deprecated Use `factory.updateMappedTypeNode` or the factory supplied by your transformation context instead. */ - const updateMappedTypeNode: (node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; + const updateMappedTypeNode: (node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; /** @deprecated Use `factory.createLiteralTypeNode` or the factory supplied by your transformation context instead. */ const createLiteralTypeNode: (literal: LiteralExpression | TrueLiteral | FalseLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode; /** @deprecated Use `factory.updateLiteralTypeNode` or the factory supplied by your transformation context instead. */ diff --git a/node_modules/typescript/lib/tsserverlibrary.js b/node_modules/typescript/lib/tsserverlibrary.js index a74476c..16a7a7b 100644 --- a/node_modules/typescript/lib/tsserverlibrary.js +++ b/node_modules/typescript/lib/tsserverlibrary.js @@ -286,9 +286,9 @@ var ts; (function (ts) { // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configurePrerelease` too. - ts.versionMajorMinor = "4.1"; + ts.versionMajorMinor = "4.0"; /** The version of the TypeScript compiler release */ - ts.version = "4.1.3"; + ts.version = "4.0.2"; /* @internal */ var Comparison; (function (Comparison) { @@ -1381,7 +1381,7 @@ var ts; var high = array.length - 1; while (low <= high) { var middle = low + ((high - low) >> 1); - var midKey = keySelector(array[middle], middle); + var midKey = keySelector(array[middle]); switch (keyComparer(midKey, key)) { case -1 /* LessThan */: low = middle + 1; @@ -1476,14 +1476,15 @@ var ts; return values; } ts.getOwnValues = getOwnValues; - var _entries = Object.entries || (function (obj) { + var _entries = Object.entries ? Object.entries : function (obj) { var keys = getOwnKeys(obj); var result = Array(keys.length); - for (var i = 0; i < keys.length; i++) { - result[i] = [keys[i], obj[keys[i]]]; + for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { + var key = keys_1[_i]; + result.push([key, obj[key]]); } return result; - }); + }; function getEntries(obj) { return obj ? _entries(obj) : []; } @@ -2355,39 +2356,20 @@ var ts; } } } - /** - * Returns string left-padded with spaces or zeros until it reaches the given length. - * - * @param s String to pad. - * @param length Final padded length. If less than or equal to 's.length', returns 's' unchanged. - * @param padString Character to use as padding (default " "). - */ - function padLeft(s, length, padString) { - if (padString === void 0) { padString = " "; } - return length <= s.length ? s : padString.repeat(length - s.length) + s; + function padLeft(s, length) { + while (s.length < length) { + s = " " + s; + } + return s; } ts.padLeft = padLeft; - /** - * Returns string right-padded with spaces until it reaches the given length. - * - * @param s String to pad. - * @param length Final padded length. If less than or equal to 's.length', returns 's' unchanged. - * @param padString Character to use as padding (default " "). - */ - function padRight(s, length, padString) { - if (padString === void 0) { padString = " "; } - return length <= s.length ? s : s + padString.repeat(length - s.length); + function padRight(s, length) { + while (s.length < length) { + s = s + " "; + } + return s; } ts.padRight = padRight; - function takeWhile(array, predicate) { - var len = array.length; - var index = 0; - while (index < len && predicate(array[index])) { - index++; - } - return array.slice(0, index); - } - ts.takeWhile = takeWhile; })(ts || (ts = {})); /* @internal */ var ts; @@ -2702,10 +2684,6 @@ var ts; return formatEnum(flags, ts.ObjectFlags, /*isFlags*/ true); } Debug.formatObjectFlags = formatObjectFlags; - function formatFlowFlags(flags) { - return formatEnum(flags, ts.FlowFlags, /*isFlags*/ true); - } - Debug.formatFlowFlags = formatFlowFlags; var isDebugInfoEnabled = false; var extendedDebugModule; function extendedDebug() { @@ -2723,167 +2701,31 @@ var ts; return extendedDebug().formatControlFlowGraph(flowNode); } Debug.formatControlFlowGraph = formatControlFlowGraph; - var flowNodeProto; - function attachFlowNodeDebugInfoWorker(flowNode) { - if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line no-in-operator - Object.defineProperties(flowNode, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var flowHeader = this.flags & 2 /* Start */ ? "FlowStart" : - this.flags & 4 /* BranchLabel */ ? "FlowBranchLabel" : - this.flags & 8 /* LoopLabel */ ? "FlowLoopLabel" : - this.flags & 16 /* Assignment */ ? "FlowAssignment" : - this.flags & 32 /* TrueCondition */ ? "FlowTrueCondition" : - this.flags & 64 /* FalseCondition */ ? "FlowFalseCondition" : - this.flags & 128 /* SwitchClause */ ? "FlowSwitchClause" : - this.flags & 256 /* ArrayMutation */ ? "FlowArrayMutation" : - this.flags & 512 /* Call */ ? "FlowCall" : - this.flags & 1024 /* ReduceLabel */ ? "FlowReduceLabel" : - this.flags & 1 /* Unreachable */ ? "FlowUnreachable" : - "UnknownFlow"; - var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1); - return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : ""); - } - }, - __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } }, - __debugToString: { value: function () { return formatControlFlowGraph(this); } } - }); - } - } function attachFlowNodeDebugInfo(flowNode) { if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - // if we're in es2015, attach the method to a shared prototype for `FlowNode` - // so the method doesn't show up in the watch window. - if (!flowNodeProto) { - flowNodeProto = Object.create(Object.prototype); - attachFlowNodeDebugInfoWorker(flowNodeProto); - } - Object.setPrototypeOf(flowNode, flowNodeProto); - } - else { - // not running in an es2015 environment, attach the method directly. - attachFlowNodeDebugInfoWorker(flowNode); + if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line no-in-operator + Object.defineProperties(flowNode, { + __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } }, + __debugToString: { value: function () { return formatControlFlowGraph(this); } } + }); } } } Debug.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo; - var nodeArrayProto; - function attachNodeArrayDebugInfoWorker(array) { - if (!("__tsDebuggerDisplay" in array)) { // eslint-disable-line no-in-operator - Object.defineProperties(array, { - __tsDebuggerDisplay: { - value: function (defaultValue) { - // An `Array` with extra properties is rendered as `[A, B, prop1: 1, prop2: 2]`. Most of - // these aren't immediately useful so we trim off the `prop1: ..., prop2: ...` part from the - // formatted string. - defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]"); - return "NodeArray " + defaultValue; - } - } - }); - } - } - function attachNodeArrayDebugInfo(array) { - if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - // if we're in es2015, attach the method to a shared prototype for `NodeArray` - // so the method doesn't show up in the watch window. - if (!nodeArrayProto) { - nodeArrayProto = Object.create(Array.prototype); - attachNodeArrayDebugInfoWorker(nodeArrayProto); - } - Object.setPrototypeOf(array, nodeArrayProto); - } - else { - // not running in an es2015 environment, attach the method directly. - attachNodeArrayDebugInfoWorker(array); - } - } - } - Debug.attachNodeArrayDebugInfo = attachNodeArrayDebugInfo; /** * Injects debug information into frequently used types. */ function enableDebugInfo() { if (isDebugInfoEnabled) return; - // avoid recomputing - var weakTypeTextMap; - var weakNodeTextMap; - function getWeakTypeTextMap() { - if (weakTypeTextMap === undefined) { - if (typeof WeakMap === "function") - weakTypeTextMap = new WeakMap(); - } - return weakTypeTextMap; - } - function getWeakNodeTextMap() { - if (weakNodeTextMap === undefined) { - if (typeof WeakMap === "function") - weakNodeTextMap = new WeakMap(); - } - return weakNodeTextMap; - } // Add additional properties in debug mode to assist with debugging. Object.defineProperties(ts.objectAllocator.getSymbolConstructor().prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" : - "Symbol"; - var remainingSymbolFlags = this.flags & ~33554432 /* Transient */; - return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : ""); - } - }, __debugFlags: { get: function () { return formatSymbolFlags(this.flags); } } }); Object.defineProperties(ts.objectAllocator.getTypeConstructor().prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" : - this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType " + JSON.stringify(this.value) : - this.flags & 2048 /* BigIntLiteral */ ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" : - this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : - this.flags & 32 /* Enum */ ? "EnumType" : - this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType " + this.intrinsicName : - this.flags & 1048576 /* Union */ ? "UnionType" : - this.flags & 2097152 /* Intersection */ ? "IntersectionType" : - this.flags & 4194304 /* Index */ ? "IndexType" : - this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : - this.flags & 16777216 /* Conditional */ ? "ConditionalType" : - this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : - this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : - this.flags & 524288 /* Object */ ? - this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : - this.objectFlags & 4 /* Reference */ ? "TypeReference" : - this.objectFlags & 8 /* Tuple */ ? "TupleType" : - this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : - this.objectFlags & 32 /* Mapped */ ? "MappedType" : - this.objectFlags & 2048 /* ReverseMapped */ ? "ReverseMappedType" : - this.objectFlags & 256 /* EvolvingArray */ ? "EvolvingArrayType" : - "ObjectType" : - "Type"; - var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~2367 /* ObjectTypeKindMask */ : 0; - return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : ""); - } - }, __debugFlags: { get: function () { return formatTypeFlags(this.flags); } }, __debugObjectFlags: { get: function () { return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : ""; } }, - __debugTypeToString: { - value: function () { - // avoid recomputing - var map = getWeakTypeTextMap(); - var text = map === null || map === void 0 ? void 0 : map.get(this); - if (text === undefined) { - text = this.checker.typeToString(this); - map === null || map === void 0 ? void 0 : map.set(this, text); - } - return text; - } - }, + __debugTypeToString: { value: function () { return this.checker.typeToString(this); } }, }); var nodeConstructors = [ ts.objectAllocator.getNodeConstructor(), @@ -2895,49 +2737,6 @@ var ts; var ctor = nodeConstructors_1[_i]; if (!ctor.prototype.hasOwnProperty("__debugKind")) { Object.defineProperties(ctor.prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" : - ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" : - ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" : - ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") : - ts.isNumericLiteral(this) ? "NumericLiteral " + this.text : - ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" : - ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" : - ts.isParameter(this) ? "ParameterDeclaration" : - ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" : - ts.isGetAccessorDeclaration(this) ? "GetAccessorDeclaration" : - ts.isSetAccessorDeclaration(this) ? "SetAccessorDeclaration" : - ts.isCallSignatureDeclaration(this) ? "CallSignatureDeclaration" : - ts.isConstructSignatureDeclaration(this) ? "ConstructSignatureDeclaration" : - ts.isIndexSignatureDeclaration(this) ? "IndexSignatureDeclaration" : - ts.isTypePredicateNode(this) ? "TypePredicateNode" : - ts.isTypeReferenceNode(this) ? "TypeReferenceNode" : - ts.isFunctionTypeNode(this) ? "FunctionTypeNode" : - ts.isConstructorTypeNode(this) ? "ConstructorTypeNode" : - ts.isTypeQueryNode(this) ? "TypeQueryNode" : - ts.isTypeLiteralNode(this) ? "TypeLiteralNode" : - ts.isArrayTypeNode(this) ? "ArrayTypeNode" : - ts.isTupleTypeNode(this) ? "TupleTypeNode" : - ts.isOptionalTypeNode(this) ? "OptionalTypeNode" : - ts.isRestTypeNode(this) ? "RestTypeNode" : - ts.isUnionTypeNode(this) ? "UnionTypeNode" : - ts.isIntersectionTypeNode(this) ? "IntersectionTypeNode" : - ts.isConditionalTypeNode(this) ? "ConditionalTypeNode" : - ts.isInferTypeNode(this) ? "InferTypeNode" : - ts.isParenthesizedTypeNode(this) ? "ParenthesizedTypeNode" : - ts.isThisTypeNode(this) ? "ThisTypeNode" : - ts.isTypeOperatorNode(this) ? "TypeOperatorNode" : - ts.isIndexedAccessTypeNode(this) ? "IndexedAccessTypeNode" : - ts.isMappedTypeNode(this) ? "MappedTypeNode" : - ts.isLiteralTypeNode(this) ? "LiteralTypeNode" : - ts.isNamedTupleMember(this) ? "NamedTupleMember" : - ts.isImportTypeNode(this) ? "ImportTypeNode" : - formatSyntaxKind(this.kind); - return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : ""); - } - }, __debugKind: { get: function () { return formatSyntaxKind(this.kind); } }, __debugNodeFlags: { get: function () { return formatNodeFlags(this.flags); } }, __debugModifierFlags: { get: function () { return formatModifierFlags(ts.getEffectiveModifierFlagsNoCache(this)); } }, @@ -2948,16 +2747,9 @@ var ts; value: function (includeTrivia) { if (ts.nodeIsSynthesized(this)) return ""; - // avoid recomputing - var map = getWeakNodeTextMap(); - var text = map === null || map === void 0 ? void 0 : map.get(this); - if (text === undefined) { - var parseNode = ts.getParseTreeNode(this); - var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); - text = sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; - map === null || map === void 0 ? void 0 : map.set(this, text); - } - return text; + var parseNode = ts.getParseTreeNode(this); + var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); + return sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; } } }); @@ -3029,6 +2821,168 @@ var ts; Debug.deprecate = deprecate; })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); +/*@internal*/ +var ts; +(function (ts) { + /** Gets a timestamp with (at least) ms resolution */ + ts.timestamp = typeof performance !== "undefined" && performance.now ? function () { return performance.now(); } : Date.now ? Date.now : function () { return +(new Date()); }; +})(ts || (ts = {})); +/*@internal*/ +/** Performance measurements for the compiler. */ +var ts; +(function (ts) { + var performance; + (function (performance) { + // NOTE: cannot use ts.noop as core.ts loads after this + var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : function () { }; + var enabled = false; + var profilerStart = 0; + var counts; + var marks; + var measures; + function createTimerIf(condition, measureName, startMarkName, endMarkName) { + return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer; + } + performance.createTimerIf = createTimerIf; + function createTimer(measureName, startMarkName, endMarkName) { + var enterCount = 0; + return { + enter: enter, + exit: exit + }; + function enter() { + if (++enterCount === 1) { + mark(startMarkName); + } + } + function exit() { + if (--enterCount === 0) { + mark(endMarkName); + measure(measureName, startMarkName, endMarkName); + } + else if (enterCount < 0) { + ts.Debug.fail("enter/exit count does not match."); + } + } + } + performance.createTimer = createTimer; + performance.nullTimer = { enter: ts.noop, exit: ts.noop }; + /** + * Marks a performance event. + * + * @param markName The name of the mark. + */ + function mark(markName) { + if (enabled) { + marks.set(markName, ts.timestamp()); + counts.set(markName, (counts.get(markName) || 0) + 1); + profilerEvent(markName); + } + } + performance.mark = mark; + /** + * Adds a performance measurement with the specified name. + * + * @param measureName The name of the performance measurement. + * @param startMarkName The name of the starting mark. If not supplied, the point at which the + * profiler was enabled is used. + * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is + * used. + */ + function measure(measureName, startMarkName, endMarkName) { + if (enabled) { + var end = endMarkName && marks.get(endMarkName) || ts.timestamp(); + var start = startMarkName && marks.get(startMarkName) || profilerStart; + measures.set(measureName, (measures.get(measureName) || 0) + (end - start)); + } + } + performance.measure = measure; + /** + * Gets the number of times a marker was encountered. + * + * @param markName The name of the mark. + */ + function getCount(markName) { + return counts && counts.get(markName) || 0; + } + performance.getCount = getCount; + /** + * Gets the total duration of all measurements with the supplied name. + * + * @param measureName The name of the measure whose durations should be accumulated. + */ + function getDuration(measureName) { + return measures && measures.get(measureName) || 0; + } + performance.getDuration = getDuration; + /** + * Iterate over each measure, performing some action + * + * @param cb The action to perform for each measure + */ + function forEachMeasure(cb) { + measures.forEach(function (measure, key) { + cb(key, measure); + }); + } + performance.forEachMeasure = forEachMeasure; + /** Enables (and resets) performance measurements for the compiler. */ + function enable() { + counts = new ts.Map(); + marks = new ts.Map(); + measures = new ts.Map(); + enabled = true; + profilerStart = ts.timestamp(); + } + performance.enable = enable; + /** Disables performance measurements for the compiler. */ + function disable() { + enabled = false; + } + performance.disable = disable; + })(performance = ts.performance || (ts.performance = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var _a; + var nullLogger = { + logEvent: ts.noop, + logErrEvent: ts.noop, + logPerfEvent: ts.noop, + logInfoEvent: ts.noop, + logStartCommand: ts.noop, + logStopCommand: ts.noop, + logStartUpdateProgram: ts.noop, + logStopUpdateProgram: ts.noop, + logStartUpdateGraph: ts.noop, + logStopUpdateGraph: ts.noop, + logStartResolveModule: ts.noop, + logStopResolveModule: ts.noop, + logStartParseSourceFile: ts.noop, + logStopParseSourceFile: ts.noop, + logStartReadFile: ts.noop, + logStopReadFile: ts.noop, + logStartBindFile: ts.noop, + logStopBindFile: ts.noop, + logStartScheduledOperation: ts.noop, + logStopScheduledOperation: ts.noop, + }; + // Load optional module to enable Event Tracing for Windows + // See https://github.com/microsoft/typescript-etw for more information + var etwModule; + try { + var etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) !== null && _a !== void 0 ? _a : "./node_modules/@microsoft/typescript-etw"; + // require() will throw an exception if the module is not found + // It may also return undefined if not installed properly + etwModule = require(etwModulePath); + } + catch (e) { + etwModule = undefined; + } + /** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */ + ts.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; +})(ts || (ts = {})); /* @internal */ var ts; (function (ts) { @@ -3105,7 +3059,7 @@ var ts; return ts.compareValues(this.major, other.major) || ts.compareValues(this.minor, other.minor) || ts.compareValues(this.patch, other.patch) - || comparePrereleaseIdentifiers(this.prerelease, other.prerelease); + || comparePrerelaseIdentifiers(this.prerelease, other.prerelease); }; Version.prototype.increment = function (field) { switch (field) { @@ -3144,7 +3098,7 @@ var ts; build: build }; } - function comparePrereleaseIdentifiers(left, right) { + function comparePrerelaseIdentifiers(left, right) { // https://semver.org/#spec-item-11 // > When major, minor, and patch are equal, a pre-release version has lower precedence // > than a normal version. @@ -3389,485 +3343,6 @@ var ts; return "" + comparator.operator + comparator.operand; } })(ts || (ts = {})); -/*@internal*/ -var ts; -(function (ts) { - // The following definitions provide the minimum compatible support for the Web Performance User Timings API - // between browsers and NodeJS: - // eslint-disable-next-line @typescript-eslint/naming-convention - function hasRequiredAPI(performance, PerformanceObserver) { - return typeof performance === "object" && - typeof performance.timeOrigin === "number" && - typeof performance.mark === "function" && - typeof performance.measure === "function" && - typeof performance.now === "function" && - typeof PerformanceObserver === "function"; - } - function tryGetWebPerformanceHooks() { - if (typeof performance === "object" && - typeof PerformanceObserver === "function" && - hasRequiredAPI(performance, PerformanceObserver)) { - return { - performance: performance, - PerformanceObserver: PerformanceObserver - }; - } - } - function tryGetNodePerformanceHooks() { - if (typeof module === "object" && typeof require === "function") { - try { - var _a = require("perf_hooks"), performance_1 = _a.performance, PerformanceObserver_1 = _a.PerformanceObserver; - if (hasRequiredAPI(performance_1, PerformanceObserver_1)) { - // There is a bug in Node's performance.measure prior to 12.16.3/13.13.0 that does not - // match the Web Performance API specification. Node's implementation did not allow - // optional `start` and `end` arguments for `performance.measure`. - // See https://github.com/nodejs/node/pull/32651 for more information. - var version_1 = new ts.Version(process.versions.node); - var range = new ts.VersionRange("<12.16.3 || 13 <13.13"); - if (range.test(version_1)) { - return { - performance: { - get timeOrigin() { return performance_1.timeOrigin; }, - now: function () { return performance_1.now(); }, - mark: function (name) { return performance_1.mark(name); }, - measure: function (name, start, end) { - if (start === void 0) { start = "nodeStart"; } - if (end === undefined) { - end = "__performance.measure-fix__"; - performance_1.mark(end); - } - performance_1.measure(name, start, end); - if (end === "__performance.measure-fix__") { - performance_1.clearMarks("__performance.measure-fix__"); - } - } - }, - PerformanceObserver: PerformanceObserver_1 - }; - } - return { - performance: performance_1, - PerformanceObserver: PerformanceObserver_1 - }; - } - } - catch (_b) { - // ignore errors - } - } - } - // Unlike with the native Map/Set 'tryGet' functions in corePublic.ts, we eagerly evaluate these - // since we will need them for `timestamp`, below. - var nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks(); - var nativePerformance = nativePerformanceHooks === null || nativePerformanceHooks === void 0 ? void 0 : nativePerformanceHooks.performance; - function tryGetNativePerformanceHooks() { - return nativePerformanceHooks; - } - ts.tryGetNativePerformanceHooks = tryGetNativePerformanceHooks; - /** Gets a timestamp with (at least) ms resolution */ - ts.timestamp = nativePerformance ? function () { return nativePerformance.now(); } : - Date.now ? Date.now : - function () { return +(new Date()); }; -})(ts || (ts = {})); -/*@internal*/ -/** Performance measurements for the compiler. */ -var ts; -(function (ts) { - var performance; - (function (performance) { - var perfHooks; - var perfObserver; - // when set, indicates the implementation of `Performance` to use for user timing. - // when unset, indicates user timing is unavailable or disabled. - var performanceImpl; - function createTimerIf(condition, measureName, startMarkName, endMarkName) { - return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer; - } - performance.createTimerIf = createTimerIf; - function createTimer(measureName, startMarkName, endMarkName) { - var enterCount = 0; - return { - enter: enter, - exit: exit - }; - function enter() { - if (++enterCount === 1) { - mark(startMarkName); - } - } - function exit() { - if (--enterCount === 0) { - mark(endMarkName); - measure(measureName, startMarkName, endMarkName); - } - else if (enterCount < 0) { - ts.Debug.fail("enter/exit count does not match."); - } - } - } - performance.createTimer = createTimer; - performance.nullTimer = { enter: ts.noop, exit: ts.noop }; - var counts = new ts.Map(); - var durations = new ts.Map(); - /** - * Marks a performance event. - * - * @param markName The name of the mark. - */ - function mark(markName) { - performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.mark(markName); - } - performance.mark = mark; - /** - * Adds a performance measurement with the specified name. - * - * @param measureName The name of the performance measurement. - * @param startMarkName The name of the starting mark. If not supplied, the point at which the - * profiler was enabled is used. - * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is - * used. - */ - function measure(measureName, startMarkName, endMarkName) { - performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName); - } - performance.measure = measure; - /** - * Gets the number of times a marker was encountered. - * - * @param markName The name of the mark. - */ - function getCount(markName) { - return counts.get(markName) || 0; - } - performance.getCount = getCount; - /** - * Gets the total duration of all measurements with the supplied name. - * - * @param measureName The name of the measure whose durations should be accumulated. - */ - function getDuration(measureName) { - return durations.get(measureName) || 0; - } - performance.getDuration = getDuration; - /** - * Iterate over each measure, performing some action - * - * @param cb The action to perform for each measure - */ - function forEachMeasure(cb) { - durations.forEach(function (duration, measureName) { return cb(measureName, duration); }); - } - performance.forEachMeasure = forEachMeasure; - /** - * Indicates whether the performance API is enabled. - */ - function isEnabled() { - return !!performanceImpl; - } - performance.isEnabled = isEnabled; - /** Enables (and resets) performance measurements for the compiler. */ - function enable() { - if (!performanceImpl) { - perfHooks || (perfHooks = ts.tryGetNativePerformanceHooks()); - if (!perfHooks) - return false; - perfObserver || (perfObserver = new perfHooks.PerformanceObserver(updateStatisticsFromList)); - perfObserver.observe({ entryTypes: ["mark", "measure"] }); - performanceImpl = perfHooks.performance; - } - return true; - } - performance.enable = enable; - /** Disables performance measurements for the compiler. */ - function disable() { - perfObserver === null || perfObserver === void 0 ? void 0 : perfObserver.disconnect(); - performanceImpl = undefined; - counts.clear(); - durations.clear(); - } - performance.disable = disable; - function updateStatisticsFromList(list) { - for (var _i = 0, _a = list.getEntriesByType("mark"); _i < _a.length; _i++) { - var mark_1 = _a[_i]; - counts.set(mark_1.name, (counts.get(mark_1.name) || 0) + 1); - } - for (var _b = 0, _c = list.getEntriesByType("measure"); _b < _c.length; _b++) { - var measure_1 = _c[_b]; - durations.set(measure_1.name, (durations.get(measure_1.name) || 0) + measure_1.duration); - } - } - })(performance = ts.performance || (ts.performance = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var _a; - var nullLogger = { - logEvent: ts.noop, - logErrEvent: ts.noop, - logPerfEvent: ts.noop, - logInfoEvent: ts.noop, - logStartCommand: ts.noop, - logStopCommand: ts.noop, - logStartUpdateProgram: ts.noop, - logStopUpdateProgram: ts.noop, - logStartUpdateGraph: ts.noop, - logStopUpdateGraph: ts.noop, - logStartResolveModule: ts.noop, - logStopResolveModule: ts.noop, - logStartParseSourceFile: ts.noop, - logStopParseSourceFile: ts.noop, - logStartReadFile: ts.noop, - logStopReadFile: ts.noop, - logStartBindFile: ts.noop, - logStopBindFile: ts.noop, - logStartScheduledOperation: ts.noop, - logStopScheduledOperation: ts.noop, - }; - // Load optional module to enable Event Tracing for Windows - // See https://github.com/microsoft/typescript-etw for more information - var etwModule; - try { - var etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) !== null && _a !== void 0 ? _a : "./node_modules/@microsoft/typescript-etw"; - // require() will throw an exception if the module is not found - // It may also return undefined if not installed properly - etwModule = require(etwModulePath); - } - catch (e) { - etwModule = undefined; - } - /** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */ - ts.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; -})(ts || (ts = {})); -/*@internal*/ -/** Tracing events for the compiler. */ -var ts; -(function (ts) { - var tracing; - (function (tracing) { - var fs; - var traceCount = 0; - var traceFd; - var legendPath; - var legend = []; - /** Starts tracing for the given project (unless the `fs` module is unavailable). */ - function startTracing(configFilePath, traceDir, isBuildMode) { - ts.Debug.assert(!traceFd, "Tracing already started"); - if (fs === undefined) { - try { - fs = require("fs"); - } - catch (_a) { - fs = false; - } - } - if (!fs) { - return; - } - if (legendPath === undefined) { - legendPath = ts.combinePaths(traceDir, "legend.json"); - } - // Note that writing will fail later on if it exists and is not a directory - if (!fs.existsSync(traceDir)) { - fs.mkdirSync(traceDir, { recursive: true }); - } - var countPart = isBuildMode ? "." + ++traceCount : ""; - var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json"); - var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json"); - legend.push({ - configFilePath: configFilePath, - tracePath: tracePath, - typesPath: typesPath, - }); - traceFd = fs.openSync(tracePath, "w"); - // Start with a prefix that contains some metadata that the devtools profiler expects (also avoids a warning on import) - var meta = { cat: "__metadata", ph: "M", ts: 1000 * ts.timestamp(), pid: 1, tid: 1 }; - fs.writeSync(traceFd, "[\n" - + [__assign({ name: "process_name", args: { name: "tsc" } }, meta), __assign({ name: "thread_name", args: { name: "Main" } }, meta), __assign(__assign({ name: "TracingStartedInBrowser" }, meta), { cat: "disabled-by-default-devtools.timeline" })] - .map(function (v) { return JSON.stringify(v); }).join(",\n")); - } - tracing.startTracing = startTracing; - /** Stops tracing for the in-progress project and dumps the type catalog (unless the `fs` module is unavailable). */ - function stopTracing(typeCatalog) { - if (!traceFd) { - ts.Debug.assert(!fs, "Tracing is not in progress"); - return; - } - ts.Debug.assert(fs); - fs.writeSync(traceFd, "\n]\n"); - fs.closeSync(traceFd); - traceFd = undefined; - if (typeCatalog) { - dumpTypes(typeCatalog); - } - else { - // We pre-computed this path for convenience, but clear it - // now that the file won't be created. - legend[legend.length - 1].typesPath = undefined; - } - } - tracing.stopTracing = stopTracing; - function isTracing() { - return !!traceFd; - } - tracing.isTracing = isTracing; - var Phase; - (function (Phase) { - Phase["Parse"] = "parse"; - Phase["Program"] = "program"; - Phase["Bind"] = "bind"; - Phase["Check"] = "check"; - Phase["Emit"] = "emit"; - })(Phase = tracing.Phase || (tracing.Phase = {})); - /** Note: `push`/`pop` should be used by default. - * `begin`/`end` are for special cases where we need the data point even if the event never - * terminates (typically for reducing a scenario too big to trace to one that can be completed). - * In the future we might implement an exit handler to dump unfinished events which would - * deprecate these operations. - */ - function begin(phase, name, args) { - if (!traceFd) - return; - writeEvent("B", phase, name, args); - } - tracing.begin = begin; - function end(phase, name, args) { - if (!traceFd) - return; - writeEvent("E", phase, name, args); - } - tracing.end = end; - function instant(phase, name, args) { - if (!traceFd) - return; - writeEvent("I", phase, name, args, "\"s\":\"g\""); - } - tracing.instant = instant; - // Used for "Complete" (ph:"X") events - var completeEvents = []; - function push(phase, name, args) { - if (!traceFd) - return; - completeEvents.push({ phase: phase, name: name, args: args, time: 1000 * ts.timestamp() }); - } - tracing.push = push; - function pop() { - if (!traceFd) - return; - ts.Debug.assert(completeEvents.length > 0); - var _a = completeEvents.pop(), phase = _a.phase, name = _a.name, args = _a.args, time = _a.time; - var dur = 1000 * ts.timestamp() - time; - writeEvent("X", phase, name, args, "\"dur\":" + dur, time); - } - tracing.pop = pop; - function writeEvent(eventType, phase, name, args, extras, time) { - if (time === void 0) { time = 1000 * ts.timestamp(); } - ts.Debug.assert(traceFd); - ts.Debug.assert(fs); - ts.performance.mark("beginTracing"); - fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\""); - if (extras) - fs.writeSync(traceFd, "," + extras); - if (args) - fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args)); - fs.writeSync(traceFd, "}"); - ts.performance.mark("endTracing"); - ts.performance.measure("Tracing", "beginTracing", "endTracing"); - } - function indexFromOne(lc) { - return { - line: lc.line + 1, - character: lc.character + 1, - }; - } - function dumpTypes(types) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r; - ts.Debug.assert(fs); - ts.performance.mark("beginDumpTypes"); - var typesPath = legend[legend.length - 1].typesPath; - var typesFd = fs.openSync(typesPath, "w"); - var recursionIdentityMap = new ts.Map(); - // Cleverness: no line break here so that the type ID will match the line number - fs.writeSync(typesFd, "["); - var numTypes = types.length; - for (var i = 0; i < numTypes; i++) { - var type = types[i]; - var objectFlags = type.objectFlags; - var symbol = (_a = type.aliasSymbol) !== null && _a !== void 0 ? _a : type.symbol; - var firstDeclaration = (_b = symbol === null || symbol === void 0 ? void 0 : symbol.declarations) === null || _b === void 0 ? void 0 : _b[0]; - var firstFile = firstDeclaration && ts.getSourceFileOfNode(firstDeclaration); - // It's slow to compute the display text, so skip it unless it's really valuable (or cheap) - var display = void 0; - if ((objectFlags & 16 /* Anonymous */) | (type.flags & 2944 /* Literal */)) { - try { - display = (_c = type.checker) === null || _c === void 0 ? void 0 : _c.typeToString(type); - } - catch (_s) { - display = undefined; - } - } - var indexedAccessProperties = {}; - if (type.flags & 8388608 /* IndexedAccess */) { - var indexedAccessType = type; - indexedAccessProperties = { - indexedAccessObjectType: (_d = indexedAccessType.objectType) === null || _d === void 0 ? void 0 : _d.id, - indexedAccessIndexType: (_e = indexedAccessType.indexType) === null || _e === void 0 ? void 0 : _e.id, - }; - } - var referenceProperties = {}; - if (objectFlags & 4 /* Reference */) { - var referenceType = type; - referenceProperties = { - instantiatedType: (_f = referenceType.target) === null || _f === void 0 ? void 0 : _f.id, - typeArguments: (_g = referenceType.resolvedTypeArguments) === null || _g === void 0 ? void 0 : _g.map(function (t) { return t.id; }), - }; - } - var conditionalProperties = {}; - if (type.flags & 16777216 /* Conditional */) { - var conditionalType = type; - conditionalProperties = { - conditionalCheckType: (_h = conditionalType.checkType) === null || _h === void 0 ? void 0 : _h.id, - conditionalExtendsType: (_j = conditionalType.extendsType) === null || _j === void 0 ? void 0 : _j.id, - conditionalTrueType: (_l = (_k = conditionalType.resolvedTrueType) === null || _k === void 0 ? void 0 : _k.id) !== null && _l !== void 0 ? _l : -1, - conditionalFalseType: (_o = (_m = conditionalType.resolvedFalseType) === null || _m === void 0 ? void 0 : _m.id) !== null && _o !== void 0 ? _o : -1, - }; - } - // We can't print out an arbitrary object, so just assign each one a unique number. - // Don't call it an "id" so people don't treat it as a type id. - var recursionToken = void 0; - var recursionIdentity = type.checker.getRecursionIdentity(type); - if (recursionIdentity) { - recursionToken = recursionIdentityMap.get(recursionIdentity); - if (!recursionToken) { - recursionToken = recursionIdentityMap.size; - recursionIdentityMap.set(recursionIdentity, recursionToken); - } - } - var descriptor = __assign(__assign(__assign(__assign({ id: type.id, intrinsicName: type.intrinsicName, symbolName: (symbol === null || symbol === void 0 ? void 0 : symbol.escapedName) && ts.unescapeLeadingUnderscores(symbol.escapedName), recursionId: recursionToken, unionTypes: (type.flags & 1048576 /* Union */) ? (_p = type.types) === null || _p === void 0 ? void 0 : _p.map(function (t) { return t.id; }) : undefined, intersectionTypes: (type.flags & 2097152 /* Intersection */) ? type.types.map(function (t) { return t.id; }) : undefined, aliasTypeArguments: (_q = type.aliasTypeArguments) === null || _q === void 0 ? void 0 : _q.map(function (t) { return t.id; }), keyofType: (type.flags & 4194304 /* Index */) ? (_r = type.type) === null || _r === void 0 ? void 0 : _r.id : undefined }, indexedAccessProperties), referenceProperties), conditionalProperties), { firstDeclaration: firstDeclaration && { - path: firstFile.path, - start: indexFromOne(ts.getLineAndCharacterOfPosition(firstFile, firstDeclaration.pos)), - end: indexFromOne(ts.getLineAndCharacterOfPosition(ts.getSourceFileOfNode(firstDeclaration), firstDeclaration.end)), - }, flags: ts.Debug.formatTypeFlags(type.flags).split("|"), display: display }); - fs.writeSync(typesFd, JSON.stringify(descriptor)); - if (i < numTypes - 1) { - fs.writeSync(typesFd, ",\n"); - } - } - fs.writeSync(typesFd, "]\n"); - fs.closeSync(typesFd); - ts.performance.mark("endDumpTypes"); - ts.performance.measure("Dump types", "beginDumpTypes", "endDumpTypes"); - } - function dumpLegend() { - if (!legendPath) { - return; - } - ts.Debug.assert(fs); - fs.writeFileSync(legendPath, JSON.stringify(legend)); - } - tracing.dumpLegend = dumpLegend; - })(tracing = ts.tracing || (ts.tracing = {})); -})(ts || (ts = {})); var ts; (function (ts) { // token > SyntaxKind.Identifier => token is a keyword @@ -4022,235 +3497,230 @@ var ts; SyntaxKind[SyntaxKind["DeclareKeyword"] = 133] = "DeclareKeyword"; SyntaxKind[SyntaxKind["GetKeyword"] = 134] = "GetKeyword"; SyntaxKind[SyntaxKind["InferKeyword"] = 135] = "InferKeyword"; - SyntaxKind[SyntaxKind["IntrinsicKeyword"] = 136] = "IntrinsicKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 137] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 138] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 139] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 140] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 141] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 142] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 143] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 144] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 145] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 146] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 147] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 148] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 149] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 150] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 151] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 152] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 153] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 154] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 155] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 156] = "OfKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 136] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 137] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 138] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 139] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 140] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 141] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 142] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 143] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 144] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 145] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 146] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 147] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 148] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 149] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 150] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 151] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 152] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 153] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 154] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 155] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 157] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 158] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 156] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 157] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 159] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 160] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 161] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 158] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 159] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 160] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 162] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 163] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 164] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 165] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 166] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 167] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 168] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 169] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 170] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 171] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 161] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 162] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 163] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 164] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 165] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 166] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 167] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 168] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 169] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 170] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 172] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 173] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 174] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 175] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 176] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 177] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 178] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 179] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 180] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 181] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 182] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 183] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 184] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 185] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 186] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 187] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 188] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 189] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 190] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 191] = "LiteralType"; - SyntaxKind[SyntaxKind["NamedTupleMember"] = 192] = "NamedTupleMember"; - SyntaxKind[SyntaxKind["TemplateLiteralType"] = 193] = "TemplateLiteralType"; - SyntaxKind[SyntaxKind["TemplateLiteralTypeSpan"] = 194] = "TemplateLiteralTypeSpan"; - SyntaxKind[SyntaxKind["ImportType"] = 195] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 171] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 172] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 173] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 174] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 175] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 176] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 177] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 178] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 179] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 180] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 181] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 182] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 183] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 184] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 185] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 186] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 187] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 188] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 189] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 190] = "LiteralType"; + SyntaxKind[SyntaxKind["NamedTupleMember"] = 191] = "NamedTupleMember"; + SyntaxKind[SyntaxKind["ImportType"] = 192] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 196] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 197] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 198] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 193] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 194] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 195] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 199] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 200] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 201] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 202] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 203] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 204] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 205] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 206] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 207] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 208] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 209] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 210] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 211] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 212] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 213] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 214] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 215] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 216] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 217] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 218] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 219] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 220] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 221] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 222] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 223] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 224] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 225] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 226] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 227] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 196] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 197] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 198] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 199] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 200] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 201] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 202] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 203] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 204] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 205] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 206] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 207] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 208] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 209] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 210] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 211] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 212] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 213] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 214] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 215] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 216] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 217] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 218] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 219] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 220] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 221] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 222] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 223] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 224] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 228] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 229] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 225] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 226] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 230] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 231] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 232] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 233] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 234] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 235] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 236] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 237] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 238] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 239] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 240] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 241] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 242] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 243] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 244] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 245] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 246] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 247] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 248] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 249] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 250] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 251] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 252] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 253] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 254] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 255] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 256] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 257] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 258] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 259] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 260] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 261] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 262] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 263] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 264] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 265] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 266] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 267] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 268] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 269] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 270] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 271] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 227] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 228] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 229] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 230] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 231] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 232] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 233] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 234] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 235] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 236] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 237] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 238] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 239] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 240] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 241] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 242] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 243] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 244] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 245] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 246] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 247] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 248] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 249] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 250] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 251] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 252] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 253] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 254] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 255] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 256] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 257] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 258] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 259] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 260] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 261] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 262] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 263] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 264] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 265] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 266] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 267] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 268] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 272] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 269] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 273] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 274] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 275] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 276] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 277] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 278] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 279] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 280] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 281] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 282] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 283] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 270] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 271] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 272] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 273] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 274] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 275] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 276] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 277] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 278] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 279] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 280] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 284] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 285] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 286] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 287] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 281] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 282] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 283] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 284] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 288] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 289] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 290] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 285] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 286] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 287] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 291] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 288] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 292] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 293] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 294] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 295] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 296] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 289] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 290] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 291] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 292] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 293] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 297] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 298] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 299] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 300] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 294] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 295] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 296] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 297] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 301] = "JSDocTypeExpression"; - SyntaxKind[SyntaxKind["JSDocNameReference"] = 302] = "JSDocNameReference"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 298] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 303] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 299] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 304] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 305] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 306] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 307] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 308] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 309] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 300] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 301] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 302] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 303] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 304] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 305] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 310] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 311] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 312] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 313] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 314] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 315] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 316] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 317] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 318] = "JSDocDeprecatedTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 319] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 320] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 321] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 322] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 323] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 324] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 325] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 326] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 327] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 328] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 329] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 330] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 331] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocSeeTag"] = 332] = "JSDocSeeTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 333] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 306] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 307] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 308] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 309] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 310] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 311] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 312] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 313] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 314] = "JSDocDeprecatedTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 315] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 316] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 317] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 318] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 319] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 320] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 321] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 322] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 323] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 324] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 325] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 326] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 327] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 328] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 334] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 329] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 335] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 336] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 337] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 338] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 339] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 340] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 330] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 331] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 332] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 333] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 334] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 335] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 341] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 336] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 77] = "LastAssignment"; @@ -4259,15 +3729,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 80] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 115] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 80] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 156] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 155] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 116] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 124] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 172] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 195] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 171] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 192] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 77] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 156] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 155] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -4276,15 +3746,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 77] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 232] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 248] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 157] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 301] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 333] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 314] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 333] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 229] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 245] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 156] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 298] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 328] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 310] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 328] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 125] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 156] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 155] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -4395,7 +3865,6 @@ var ts; GeneratedIdentifierFlags[GeneratedIdentifierFlags["ReservedInNestedScopes"] = 8] = "ReservedInNestedScopes"; GeneratedIdentifierFlags[GeneratedIdentifierFlags["Optimistic"] = 16] = "Optimistic"; GeneratedIdentifierFlags[GeneratedIdentifierFlags["FileLevel"] = 32] = "FileLevel"; - GeneratedIdentifierFlags[GeneratedIdentifierFlags["AllowNameSubstitution"] = 64] = "AllowNameSubstitution"; })(GeneratedIdentifierFlags = ts.GeneratedIdentifierFlags || (ts.GeneratedIdentifierFlags = {})); var TokenFlags; (function (TokenFlags) { @@ -4839,8 +4308,6 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; - TypeFlags[TypeFlags["TemplateLiteral"] = 134217728] = "TemplateLiteral"; - TypeFlags[TypeFlags["StringMapping"] = 268435456] = "StringMapping"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -4857,7 +4324,7 @@ var ts; TypeFlags[TypeFlags["Intrinsic"] = 67359327] = "Intrinsic"; /* @internal */ TypeFlags[TypeFlags["Primitive"] = 131068] = "Primitive"; - TypeFlags[TypeFlags["StringLike"] = 402653316] = "StringLike"; + TypeFlags[TypeFlags["StringLike"] = 132] = "StringLike"; TypeFlags[TypeFlags["NumberLike"] = 296] = "NumberLike"; TypeFlags[TypeFlags["BigIntLike"] = 2112] = "BigIntLike"; TypeFlags[TypeFlags["BooleanLike"] = 528] = "BooleanLike"; @@ -4865,28 +4332,28 @@ var ts; TypeFlags[TypeFlags["ESSymbolLike"] = 12288] = "ESSymbolLike"; TypeFlags[TypeFlags["VoidLike"] = 49152] = "VoidLike"; /* @internal */ - TypeFlags[TypeFlags["DisjointDomains"] = 469892092] = "DisjointDomains"; + TypeFlags[TypeFlags["DisjointDomains"] = 67238908] = "DisjointDomains"; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; - TypeFlags[TypeFlags["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 465829888] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; + TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ TypeFlags[TypeFlags["Simplifiable"] = 25165824] = "Simplifiable"; /* @internal */ - TypeFlags[TypeFlags["Substructure"] = 469237760] = "Substructure"; + TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 536624127] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 469647395] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ - TypeFlags[TypeFlags["IncludesMask"] = 205258751] = "IncludesMask"; + TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; // The following flags are used for different purposes during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesStructuredOrInstantiable"] = 262144] = "IncludesStructuredOrInstantiable"; @@ -4943,16 +4410,11 @@ var ts; ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] = 268435456] = "IsNeverIntersectionComputed"; /* @internal */ ObjectFlags[ObjectFlags["IsNeverIntersection"] = 536870912] = "IsNeverIntersection"; - /* @internal */ - ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 1073741824] = "IsClassInstanceClone"; ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; /* @internal */ ObjectFlags[ObjectFlags["RequiresWidening"] = 1572864] = "RequiresWidening"; /* @internal */ ObjectFlags[ObjectFlags["PropagatingFlags"] = 3670016] = "PropagatingFlags"; - // Object flags that uniquely identify the kind of ObjectType - /* @internal */ - ObjectFlags[ObjectFlags["ObjectTypeKindMask"] = 2367] = "ObjectTypeKindMask"; })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); /* @internal */ var VarianceFlags; @@ -5042,18 +4504,18 @@ var ts; })(InferenceFlags = ts.InferenceFlags || (ts.InferenceFlags = {})); /** * Ternary values are defined such that - * x & y picks the lesser in the order False < Unknown < Maybe < True, and - * x | y picks the greater in the order False < Unknown < Maybe < True. - * Generally, Ternary.Maybe is used as the result of a relation that depends on itself, and - * Ternary.Unknown is used as the result of a variance check that depends on itself. We make - * a distinction because we don't want to cache circular variance check results. + * x & y is False if either x or y is False. + * x & y is Maybe if either x or y is Maybe, but neither x or y is False. + * x & y is True if both x and y are True. + * x | y is False if both x and y are False. + * x | y is Maybe if either x or y is Maybe, but neither x or y is True. + * x | y is True if either x or y is True. */ /* @internal */ var Ternary; (function (Ternary) { Ternary[Ternary["False"] = 0] = "False"; - Ternary[Ternary["Unknown"] = 1] = "Unknown"; - Ternary[Ternary["Maybe"] = 3] = "Maybe"; + Ternary[Ternary["Maybe"] = 1] = "Maybe"; Ternary[Ternary["True"] = -1] = "True"; })(Ternary = ts.Ternary || (ts.Ternary = {})); /* @internal */ @@ -5061,7 +4523,6 @@ var ts; (function (AssignmentDeclarationKind) { AssignmentDeclarationKind[AssignmentDeclarationKind["None"] = 0] = "None"; /// exports.name = expr - /// module.exports.name = expr AssignmentDeclarationKind[AssignmentDeclarationKind["ExportsProperty"] = 1] = "ExportsProperty"; /// module.exports = expr AssignmentDeclarationKind[AssignmentDeclarationKind["ModuleExports"] = 2] = "ModuleExports"; @@ -5142,8 +4603,6 @@ var ts; JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve"; JsxEmit[JsxEmit["React"] = 2] = "React"; JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative"; - JsxEmit[JsxEmit["ReactJSX"] = 4] = "ReactJSX"; - JsxEmit[JsxEmit["ReactJSXDev"] = 5] = "ReactJSXDev"; })(JsxEmit = ts.JsxEmit || (ts.JsxEmit = {})); var ImportsNotUsedAsValues; (function (ImportsNotUsedAsValues) { @@ -5662,696 +5121,8 @@ var ts; args: [{ name: "factory" }], kind: 4 /* MultiLine */ }, - "jsximportsource": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - }, - "jsxruntime": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - }, }; })(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - /** - * Internally, we represent paths as strings with '/' as the directory separator. - * When we make system calls (eg: LanguageServiceHost.getDirectory()), - * we expect the host to correctly handle paths in our specified format. - */ - ts.directorySeparator = "/"; - var altDirectorySeparator = "\\"; - var urlSchemeSeparator = "://"; - var backslashRegExp = /\\/g; - //// Path Tests - /** - * Determines whether a charCode corresponds to `/` or `\`. - */ - function isAnyDirectorySeparator(charCode) { - return charCode === 47 /* slash */ || charCode === 92 /* backslash */; - } - ts.isAnyDirectorySeparator = isAnyDirectorySeparator; - /** - * Determines whether a path starts with a URL scheme (e.g. starts with `http://`, `ftp://`, `file://`, etc.). - */ - function isUrl(path) { - return getEncodedRootLength(path) < 0; - } - ts.isUrl = isUrl; - /** - * Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path - * like `c:`, `c:\` or `c:/`). - */ - function isRootedDiskPath(path) { - return getEncodedRootLength(path) > 0; - } - ts.isRootedDiskPath = isRootedDiskPath; - /** - * Determines whether a path consists only of a path root. - */ - function isDiskPathRoot(path) { - var rootLength = getEncodedRootLength(path); - return rootLength > 0 && rootLength === path.length; - } - ts.isDiskPathRoot = isDiskPathRoot; - /** - * Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.). - * - * ```ts - * // POSIX - * pathIsAbsolute("/path/to/file.ext") === true - * // DOS - * pathIsAbsolute("c:/path/to/file.ext") === true - * // URL - * pathIsAbsolute("file:///path/to/file.ext") === true - * // Non-absolute - * pathIsAbsolute("path/to/file.ext") === false - * pathIsAbsolute("./path/to/file.ext") === false - * ``` - */ - function pathIsAbsolute(path) { - return getEncodedRootLength(path) !== 0; - } - ts.pathIsAbsolute = pathIsAbsolute; - /** - * Determines whether a path starts with a relative path component (i.e. `.` or `..`). - */ - function pathIsRelative(path) { - return /^\.\.?($|[\\/])/.test(path); - } - ts.pathIsRelative = pathIsRelative; - /** - * Determines whether a path is neither relative nor absolute, e.g. "path/to/file". - * Also known misleadingly as "non-relative". - */ - function pathIsBareSpecifier(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path); - } - ts.pathIsBareSpecifier = pathIsBareSpecifier; - function hasExtension(fileName) { - return ts.stringContains(getBaseFileName(fileName), "."); - } - ts.hasExtension = hasExtension; - function fileExtensionIs(path, extension) { - return path.length > extension.length && ts.endsWith(path, extension); - } - ts.fileExtensionIs = fileExtensionIs; - function fileExtensionIsOneOf(path, extensions) { - for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { - var extension = extensions_1[_i]; - if (fileExtensionIs(path, extension)) { - return true; - } - } - return false; - } - ts.fileExtensionIsOneOf = fileExtensionIsOneOf; - /** - * Determines whether a path has a trailing separator (`/` or `\\`). - */ - function hasTrailingDirectorySeparator(path) { - return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); - } - ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator; - //// Path Parsing - function isVolumeCharacter(charCode) { - return (charCode >= 97 /* a */ && charCode <= 122 /* z */) || - (charCode >= 65 /* A */ && charCode <= 90 /* Z */); - } - function getFileUrlVolumeSeparatorEnd(url, start) { - var ch0 = url.charCodeAt(start); - if (ch0 === 58 /* colon */) - return start + 1; - if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { - var ch2 = url.charCodeAt(start + 2); - if (ch2 === 97 /* a */ || ch2 === 65 /* A */) - return start + 3; - } - return -1; - } - /** - * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). - * If the root is part of a URL, the twos-complement of the root length is returned. - */ - function getEncodedRootLength(path) { - if (!path) - return 0; - var ch0 = path.charCodeAt(0); - // POSIX or UNC - if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { - if (path.charCodeAt(1) !== ch0) - return 1; // POSIX: "/" (or non-normalized "\") - var p1 = path.indexOf(ch0 === 47 /* slash */ ? ts.directorySeparator : altDirectorySeparator, 2); - if (p1 < 0) - return path.length; // UNC: "//server" or "\\server" - return p1 + 1; // UNC: "//server/" or "\\server\" - } - // DOS - if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) { - var ch2 = path.charCodeAt(2); - if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) - return 3; // DOS: "c:/" or "c:\" - if (path.length === 2) - return 2; // DOS: "c:" (but not "c:d") - } - // URL - var schemeEnd = path.indexOf(urlSchemeSeparator); - if (schemeEnd !== -1) { - var authorityStart = schemeEnd + urlSchemeSeparator.length; - var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart); - if (authorityEnd !== -1) { // URL: "file:///", "file://server/", "file://server/path" - // For local "file" URLs, include the leading DOS volume (if present). - // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a - // special case interpreted as "the machine from which the URL is being interpreted". - var scheme = path.slice(0, schemeEnd); - var authority = path.slice(authorityStart, authorityEnd); - if (scheme === "file" && (authority === "" || authority === "localhost") && - isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { - var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); - if (volumeSeparatorEnd !== -1) { - if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { - // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/" - return ~(volumeSeparatorEnd + 1); - } - if (volumeSeparatorEnd === path.length) { - // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a" - // but not "file:///c:d" or "file:///c%3ad" - return ~volumeSeparatorEnd; - } - } - } - return ~(authorityEnd + 1); // URL: "file://server/", "http://server/" - } - return ~path.length; // URL: "file://server", "http://server" - } - // relative - return 0; - } - /** - * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). - * - * For example: - * ```ts - * getRootLength("a") === 0 // "" - * getRootLength("/") === 1 // "/" - * getRootLength("c:") === 2 // "c:" - * getRootLength("c:d") === 0 // "" - * getRootLength("c:/") === 3 // "c:/" - * getRootLength("c:\\") === 3 // "c:\\" - * getRootLength("//server") === 7 // "//server" - * getRootLength("//server/share") === 8 // "//server/" - * getRootLength("\\\\server") === 7 // "\\\\server" - * getRootLength("\\\\server\\share") === 8 // "\\\\server\\" - * getRootLength("file:///path") === 8 // "file:///" - * getRootLength("file:///c:") === 10 // "file:///c:" - * getRootLength("file:///c:d") === 8 // "file:///" - * getRootLength("file:///c:/path") === 11 // "file:///c:/" - * getRootLength("file://server") === 13 // "file://server" - * getRootLength("file://server/path") === 14 // "file://server/" - * getRootLength("http://server") === 13 // "http://server" - * getRootLength("http://server/path") === 14 // "http://server/" - * ``` - */ - function getRootLength(path) { - var rootLength = getEncodedRootLength(path); - return rootLength < 0 ? ~rootLength : rootLength; - } - ts.getRootLength = getRootLength; - function getDirectoryPath(path) { - path = normalizeSlashes(path); - // If the path provided is itself the root, then return it. - var rootLength = getRootLength(path); - if (rootLength === path.length) - return path; - // return the leading portion of the path up to the last (non-terminal) directory separator - // but not including any trailing directory separator. - path = removeTrailingDirectorySeparator(path); - return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator))); - } - ts.getDirectoryPath = getDirectoryPath; - function getBaseFileName(path, extensions, ignoreCase) { - path = normalizeSlashes(path); - // if the path provided is itself the root, then it has not file name. - var rootLength = getRootLength(path); - if (rootLength === path.length) - return ""; - // return the trailing portion of the path starting after the last (non-terminal) directory - // separator but not including any trailing directory separator. - path = removeTrailingDirectorySeparator(path); - var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1)); - var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined; - return extension ? name.slice(0, name.length - extension.length) : name; - } - ts.getBaseFileName = getBaseFileName; - function tryGetExtensionFromPath(path, extension, stringEqualityComparer) { - if (!ts.startsWith(extension, ".")) - extension = "." + extension; - if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46 /* dot */) { - var pathExtension = path.slice(path.length - extension.length); - if (stringEqualityComparer(pathExtension, extension)) { - return pathExtension; - } - } - } - function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) { - if (typeof extensions === "string") { - return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || ""; - } - for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) { - var extension = extensions_2[_i]; - var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer); - if (result) - return result; - } - return ""; - } - function getAnyExtensionFromPath(path, extensions, ignoreCase) { - // Retrieves any string from the final "." onwards from a base file name. - // Unlike extensionFromPath, which throws an exception on unrecognized extensions. - if (extensions) { - return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive); - } - var baseFileName = getBaseFileName(path); - var extensionIndex = baseFileName.lastIndexOf("."); - if (extensionIndex >= 0) { - return baseFileName.substring(extensionIndex); - } - return ""; - } - ts.getAnyExtensionFromPath = getAnyExtensionFromPath; - function pathComponents(path, rootLength) { - var root = path.substring(0, rootLength); - var rest = path.substring(rootLength).split(ts.directorySeparator); - if (rest.length && !ts.lastOrUndefined(rest)) - rest.pop(); - return __spreadArrays([root], rest); - } - /** - * Parse a path into an array containing a root component (at index 0) and zero or more path - * components (at indices > 0). The result is not normalized. - * If the path is relative, the root component is `""`. - * If the path is absolute, the root component includes the first path separator (`/`). - * - * ```ts - * // POSIX - * getPathComponents("/path/to/file.ext") === ["/", "path", "to", "file.ext"] - * getPathComponents("/path/to/") === ["/", "path", "to"] - * getPathComponents("/") === ["/"] - * // DOS - * getPathComponents("c:/path/to/file.ext") === ["c:/", "path", "to", "file.ext"] - * getPathComponents("c:/path/to/") === ["c:/", "path", "to"] - * getPathComponents("c:/") === ["c:/"] - * getPathComponents("c:") === ["c:"] - * // URL - * getPathComponents("http://typescriptlang.org/path/to/file.ext") === ["http://typescriptlang.org/", "path", "to", "file.ext"] - * getPathComponents("http://typescriptlang.org/path/to/") === ["http://typescriptlang.org/", "path", "to"] - * getPathComponents("http://typescriptlang.org/") === ["http://typescriptlang.org/"] - * getPathComponents("http://typescriptlang.org") === ["http://typescriptlang.org"] - * getPathComponents("file://server/path/to/file.ext") === ["file://server/", "path", "to", "file.ext"] - * getPathComponents("file://server/path/to/") === ["file://server/", "path", "to"] - * getPathComponents("file://server/") === ["file://server/"] - * getPathComponents("file://server") === ["file://server"] - * getPathComponents("file:///path/to/file.ext") === ["file:///", "path", "to", "file.ext"] - * getPathComponents("file:///path/to/") === ["file:///", "path", "to"] - * getPathComponents("file:///") === ["file:///"] - * getPathComponents("file://") === ["file://"] - */ - function getPathComponents(path, currentDirectory) { - if (currentDirectory === void 0) { currentDirectory = ""; } - path = combinePaths(currentDirectory, path); - return pathComponents(path, getRootLength(path)); - } - ts.getPathComponents = getPathComponents; - //// Path Formatting - /** - * Formats a parsed path consisting of a root component (at index 0) and zero or more path - * segments (at indices > 0). - * - * ```ts - * getPathFromPathComponents(["/", "path", "to", "file.ext"]) === "/path/to/file.ext" - * ``` - */ - function getPathFromPathComponents(pathComponents) { - if (pathComponents.length === 0) - return ""; - var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]); - return root + pathComponents.slice(1).join(ts.directorySeparator); - } - ts.getPathFromPathComponents = getPathFromPathComponents; - //// Path Normalization - /** - * Normalize path separators, converting `\` into `/`. - */ - function normalizeSlashes(path) { - return path.replace(backslashRegExp, ts.directorySeparator); - } - ts.normalizeSlashes = normalizeSlashes; - /** - * Reduce an array of path components to a more simplified path by navigating any - * `"."` or `".."` entries in the path. - */ - function reducePathComponents(components) { - if (!ts.some(components)) - return []; - var reduced = [components[0]]; - for (var i = 1; i < components.length; i++) { - var component = components[i]; - if (!component) - continue; - if (component === ".") - continue; - if (component === "..") { - if (reduced.length > 1) { - if (reduced[reduced.length - 1] !== "..") { - reduced.pop(); - continue; - } - } - else if (reduced[0]) - continue; - } - reduced.push(component); - } - return reduced; - } - ts.reducePathComponents = reducePathComponents; - /** - * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. - * - * ```ts - * // Non-rooted - * combinePaths("path", "to", "file.ext") === "path/to/file.ext" - * combinePaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file.ext" - * // POSIX - * combinePaths("/path", "to", "file.ext") === "/path/to/file.ext" - * combinePaths("/path", "/to", "file.ext") === "/to/file.ext" - * // DOS - * combinePaths("c:/path", "to", "file.ext") === "c:/path/to/file.ext" - * combinePaths("c:/path", "c:/to", "file.ext") === "c:/to/file.ext" - * // URL - * combinePaths("file:///path", "to", "file.ext") === "file:///path/to/file.ext" - * combinePaths("file:///path", "file:///to", "file.ext") === "file:///to/file.ext" - * ``` - */ - function combinePaths(path) { - var paths = []; - for (var _i = 1; _i < arguments.length; _i++) { - paths[_i - 1] = arguments[_i]; - } - if (path) - path = normalizeSlashes(path); - for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { - var relativePath = paths_1[_a]; - if (!relativePath) - continue; - relativePath = normalizeSlashes(relativePath); - if (!path || getRootLength(relativePath) !== 0) { - path = relativePath; - } - else { - path = ensureTrailingDirectorySeparator(path) + relativePath; - } - } - return path; - } - ts.combinePaths = combinePaths; - /** - * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any - * `.` and `..` path components are resolved. Trailing directory separators are preserved. - * - * ```ts - * resolvePath("/path", "to", "file.ext") === "path/to/file.ext" - * resolvePath("/path", "to", "file.ext/") === "path/to/file.ext/" - * resolvePath("/path", "dir", "..", "to", "file.ext") === "path/to/file.ext" - * ``` - */ - function resolvePath(path) { - var paths = []; - for (var _i = 1; _i < arguments.length; _i++) { - paths[_i - 1] = arguments[_i]; - } - return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : normalizeSlashes(path)); - } - ts.resolvePath = resolvePath; - /** - * Parse a path into an array containing a root component (at index 0) and zero or more path - * components (at indices > 0). The result is normalized. - * If the path is relative, the root component is `""`. - * If the path is absolute, the root component includes the first path separator (`/`). - * - * ```ts - * getNormalizedPathComponents("to/dir/../file.ext", "/path/") === ["/", "path", "to", "file.ext"] - * ``` - */ - function getNormalizedPathComponents(path, currentDirectory) { - return reducePathComponents(getPathComponents(path, currentDirectory)); - } - ts.getNormalizedPathComponents = getNormalizedPathComponents; - function getNormalizedAbsolutePath(fileName, currentDirectory) { - return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); - } - ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; - function normalizePath(path) { - path = normalizeSlashes(path); - var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); - return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; - } - ts.normalizePath = normalizePath; - function getPathWithoutRoot(pathComponents) { - if (pathComponents.length === 0) - return ""; - return pathComponents.slice(1).join(ts.directorySeparator); - } - function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { - return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); - } - ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; - function toPath(fileName, basePath, getCanonicalFileName) { - var nonCanonicalizedPath = isRootedDiskPath(fileName) - ? normalizePath(fileName) - : getNormalizedAbsolutePath(fileName, basePath); - return getCanonicalFileName(nonCanonicalizedPath); - } - ts.toPath = toPath; - function normalizePathAndParts(path) { - path = normalizeSlashes(path); - var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1); - if (parts.length) { - var joinedParts = root + parts.join(ts.directorySeparator); - return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts }; - } - else { - return { path: root, parts: parts }; - } - } - ts.normalizePathAndParts = normalizePathAndParts; - function removeTrailingDirectorySeparator(path) { - if (hasTrailingDirectorySeparator(path)) { - return path.substr(0, path.length - 1); - } - return path; - } - ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator; - function ensureTrailingDirectorySeparator(path) { - if (!hasTrailingDirectorySeparator(path)) { - return path + ts.directorySeparator; - } - return path; - } - ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; - /** - * Ensures a path is either absolute (prefixed with `/` or `c:`) or dot-relative (prefixed - * with `./` or `../`) so as not to be confused with an unprefixed module name. - * - * ```ts - * ensurePathIsNonModuleName("/path/to/file.ext") === "/path/to/file.ext" - * ensurePathIsNonModuleName("./path/to/file.ext") === "./path/to/file.ext" - * ensurePathIsNonModuleName("../path/to/file.ext") === "../path/to/file.ext" - * ensurePathIsNonModuleName("path/to/file.ext") === "./path/to/file.ext" - * ``` - */ - function ensurePathIsNonModuleName(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; - } - ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName; - function changeAnyExtension(path, ext, extensions, ignoreCase) { - var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path); - return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path; - } - ts.changeAnyExtension = changeAnyExtension; - //// Path Comparisons - // check path for these segments: '', '.'. '..' - var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; - function comparePathsWorker(a, b, componentComparer) { - if (a === b) - return 0 /* EqualTo */; - if (a === undefined) - return -1 /* LessThan */; - if (b === undefined) - return 1 /* GreaterThan */; - // NOTE: Performance optimization - shortcut if the root segments differ as there would be no - // need to perform path reduction. - var aRoot = a.substring(0, getRootLength(a)); - var bRoot = b.substring(0, getRootLength(b)); - var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); - if (result !== 0 /* EqualTo */) { - return result; - } - // NOTE: Performance optimization - shortcut if there are no relative path segments in - // the non-root portion of the path - var aRest = a.substring(aRoot.length); - var bRest = b.substring(bRoot.length); - if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { - return componentComparer(aRest, bRest); - } - // The path contains a relative path segment. Normalize the paths and perform a slower component - // by component comparison. - var aComponents = reducePathComponents(getPathComponents(a)); - var bComponents = reducePathComponents(getPathComponents(b)); - var sharedLength = Math.min(aComponents.length, bComponents.length); - for (var i = 1; i < sharedLength; i++) { - var result_2 = componentComparer(aComponents[i], bComponents[i]); - if (result_2 !== 0 /* EqualTo */) { - return result_2; - } - } - return ts.compareValues(aComponents.length, bComponents.length); - } - /** - * Performs a case-sensitive comparison of two paths. Path roots are always compared case-insensitively. - */ - function comparePathsCaseSensitive(a, b) { - return comparePathsWorker(a, b, ts.compareStringsCaseSensitive); - } - ts.comparePathsCaseSensitive = comparePathsCaseSensitive; - /** - * Performs a case-insensitive comparison of two paths. - */ - function comparePathsCaseInsensitive(a, b) { - return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive); - } - ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive; - function comparePaths(a, b, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - a = combinePaths(currentDirectory, a); - b = combinePaths(currentDirectory, b); - } - else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase)); - } - ts.comparePaths = comparePaths; - function containsPath(parent, child, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - parent = combinePaths(currentDirectory, parent); - child = combinePaths(currentDirectory, child); - } - else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - if (parent === undefined || child === undefined) - return false; - if (parent === child) - return true; - var parentComponents = reducePathComponents(getPathComponents(parent)); - var childComponents = reducePathComponents(getPathComponents(child)); - if (childComponents.length < parentComponents.length) { - return false; - } - var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive; - for (var i = 0; i < parentComponents.length; i++) { - var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer; - if (!equalityComparer(parentComponents[i], childComponents[i])) { - return false; - } - } - return true; - } - ts.containsPath = containsPath; - /** - * Determines whether `fileName` starts with the specified `directoryName` using the provided path canonicalization callback. - * Comparison is case-sensitive between the canonical paths. - * - * @deprecated Use `containsPath` if possible. - */ - function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { - var canonicalFileName = getCanonicalFileName(fileName); - var canonicalDirectoryName = getCanonicalFileName(directoryName); - return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\"); - } - ts.startsWithDirectory = startsWithDirectory; - //// Relative Paths - function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { - var fromComponents = reducePathComponents(getPathComponents(from)); - var toComponents = reducePathComponents(getPathComponents(to)); - var start; - for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { - var fromComponent = getCanonicalFileName(fromComponents[start]); - var toComponent = getCanonicalFileName(toComponents[start]); - var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer; - if (!comparer(fromComponent, toComponent)) - break; - } - if (start === 0) { - return toComponents; - } - var components = toComponents.slice(start); - var relative = []; - for (; start < fromComponents.length; start++) { - relative.push(".."); - } - return __spreadArrays([""], relative, components); - } - ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo; - function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { - ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative"); - var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity; - var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; - var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName); - return getPathFromPathComponents(pathComponents); - } - ts.getRelativePathFromDirectory = getRelativePathFromDirectory; - function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { - return !isRootedDiskPath(absoluteOrRelativePath) - ? absoluteOrRelativePath - : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); - } - ts.convertToRelativePath = convertToRelativePath; - function getRelativePathFromFile(from, to, getCanonicalFileName) { - return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); - } - ts.getRelativePathFromFile = getRelativePathFromFile; - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { - var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName); - var firstComponent = pathComponents[0]; - if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { - var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///"; - pathComponents[0] = prefix + firstComponent; - } - return getPathFromPathComponents(pathComponents); - } - ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; - function forEachAncestorDirectory(directory, callback) { - while (true) { - var result = callback(directory); - if (result !== undefined) { - return result; - } - var parentPath = getDirectoryPath(directory); - if (parentPath === directory) { - return undefined; - } - directory = parentPath; - } - } - ts.forEachAncestorDirectory = forEachAncestorDirectory; - function isNodeModulesDirectory(dirPath) { - return ts.endsWith(dirPath, "/node_modules"); - } - ts.isNodeModulesDirectory = isNodeModulesDirectory; -})(ts || (ts = {})); var ts; (function (ts) { /** @@ -7597,10 +6368,6 @@ var ts; return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath); } function fileSystemEntryExists(path, entryKind) { - // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve - // the CPU time performance. - var originalStackTraceLimit = Error.stackTraceLimit; - Error.stackTraceLimit = 0; try { var stat = _fs.statSync(path); switch (entryKind) { @@ -7612,9 +6379,6 @@ var ts; catch (e) { return false; } - finally { - Error.stackTraceLimit = originalStackTraceLimit; - } } function fileExists(path) { return fileSystemEntryExists(path, 0 /* File */); @@ -7685,6 +6449,678 @@ var ts; ts.Debug.isDebugging = true; } })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + /** + * Internally, we represent paths as strings with '/' as the directory separator. + * When we make system calls (eg: LanguageServiceHost.getDirectory()), + * we expect the host to correctly handle paths in our specified format. + */ + ts.directorySeparator = "/"; + var altDirectorySeparator = "\\"; + var urlSchemeSeparator = "://"; + var backslashRegExp = /\\/g; + //// Path Tests + /** + * Determines whether a charCode corresponds to `/` or `\`. + */ + function isAnyDirectorySeparator(charCode) { + return charCode === 47 /* slash */ || charCode === 92 /* backslash */; + } + ts.isAnyDirectorySeparator = isAnyDirectorySeparator; + /** + * Determines whether a path starts with a URL scheme (e.g. starts with `http://`, `ftp://`, `file://`, etc.). + */ + function isUrl(path) { + return getEncodedRootLength(path) < 0; + } + ts.isUrl = isUrl; + /** + * Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path + * like `c:`, `c:\` or `c:/`). + */ + function isRootedDiskPath(path) { + return getEncodedRootLength(path) > 0; + } + ts.isRootedDiskPath = isRootedDiskPath; + /** + * Determines whether a path consists only of a path root. + */ + function isDiskPathRoot(path) { + var rootLength = getEncodedRootLength(path); + return rootLength > 0 && rootLength === path.length; + } + ts.isDiskPathRoot = isDiskPathRoot; + /** + * Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.). + * + * ```ts + * // POSIX + * pathIsAbsolute("/path/to/file.ext") === true + * // DOS + * pathIsAbsolute("c:/path/to/file.ext") === true + * // URL + * pathIsAbsolute("file:///path/to/file.ext") === true + * // Non-absolute + * pathIsAbsolute("path/to/file.ext") === false + * pathIsAbsolute("./path/to/file.ext") === false + * ``` + */ + function pathIsAbsolute(path) { + return getEncodedRootLength(path) !== 0; + } + ts.pathIsAbsolute = pathIsAbsolute; + /** + * Determines whether a path starts with a relative path component (i.e. `.` or `..`). + */ + function pathIsRelative(path) { + return /^\.\.?($|[\\/])/.test(path); + } + ts.pathIsRelative = pathIsRelative; + function hasExtension(fileName) { + return ts.stringContains(getBaseFileName(fileName), "."); + } + ts.hasExtension = hasExtension; + function fileExtensionIs(path, extension) { + return path.length > extension.length && ts.endsWith(path, extension); + } + ts.fileExtensionIs = fileExtensionIs; + function fileExtensionIsOneOf(path, extensions) { + for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { + var extension = extensions_1[_i]; + if (fileExtensionIs(path, extension)) { + return true; + } + } + return false; + } + ts.fileExtensionIsOneOf = fileExtensionIsOneOf; + /** + * Determines whether a path has a trailing separator (`/` or `\\`). + */ + function hasTrailingDirectorySeparator(path) { + return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); + } + ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator; + //// Path Parsing + function isVolumeCharacter(charCode) { + return (charCode >= 97 /* a */ && charCode <= 122 /* z */) || + (charCode >= 65 /* A */ && charCode <= 90 /* Z */); + } + function getFileUrlVolumeSeparatorEnd(url, start) { + var ch0 = url.charCodeAt(start); + if (ch0 === 58 /* colon */) + return start + 1; + if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { + var ch2 = url.charCodeAt(start + 2); + if (ch2 === 97 /* a */ || ch2 === 65 /* A */) + return start + 3; + } + return -1; + } + /** + * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). + * If the root is part of a URL, the twos-complement of the root length is returned. + */ + function getEncodedRootLength(path) { + if (!path) + return 0; + var ch0 = path.charCodeAt(0); + // POSIX or UNC + if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { + if (path.charCodeAt(1) !== ch0) + return 1; // POSIX: "/" (or non-normalized "\") + var p1 = path.indexOf(ch0 === 47 /* slash */ ? ts.directorySeparator : altDirectorySeparator, 2); + if (p1 < 0) + return path.length; // UNC: "//server" or "\\server" + return p1 + 1; // UNC: "//server/" or "\\server\" + } + // DOS + if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) { + var ch2 = path.charCodeAt(2); + if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) + return 3; // DOS: "c:/" or "c:\" + if (path.length === 2) + return 2; // DOS: "c:" (but not "c:d") + } + // URL + var schemeEnd = path.indexOf(urlSchemeSeparator); + if (schemeEnd !== -1) { + var authorityStart = schemeEnd + urlSchemeSeparator.length; + var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart); + if (authorityEnd !== -1) { // URL: "file:///", "file://server/", "file://server/path" + // For local "file" URLs, include the leading DOS volume (if present). + // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a + // special case interpreted as "the machine from which the URL is being interpreted". + var scheme = path.slice(0, schemeEnd); + var authority = path.slice(authorityStart, authorityEnd); + if (scheme === "file" && (authority === "" || authority === "localhost") && + isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { + var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); + if (volumeSeparatorEnd !== -1) { + if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { + // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/" + return ~(volumeSeparatorEnd + 1); + } + if (volumeSeparatorEnd === path.length) { + // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a" + // but not "file:///c:d" or "file:///c%3ad" + return ~volumeSeparatorEnd; + } + } + } + return ~(authorityEnd + 1); // URL: "file://server/", "http://server/" + } + return ~path.length; // URL: "file://server", "http://server" + } + // relative + return 0; + } + /** + * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). + * + * For example: + * ```ts + * getRootLength("a") === 0 // "" + * getRootLength("/") === 1 // "/" + * getRootLength("c:") === 2 // "c:" + * getRootLength("c:d") === 0 // "" + * getRootLength("c:/") === 3 // "c:/" + * getRootLength("c:\\") === 3 // "c:\\" + * getRootLength("//server") === 7 // "//server" + * getRootLength("//server/share") === 8 // "//server/" + * getRootLength("\\\\server") === 7 // "\\\\server" + * getRootLength("\\\\server\\share") === 8 // "\\\\server\\" + * getRootLength("file:///path") === 8 // "file:///" + * getRootLength("file:///c:") === 10 // "file:///c:" + * getRootLength("file:///c:d") === 8 // "file:///" + * getRootLength("file:///c:/path") === 11 // "file:///c:/" + * getRootLength("file://server") === 13 // "file://server" + * getRootLength("file://server/path") === 14 // "file://server/" + * getRootLength("http://server") === 13 // "http://server" + * getRootLength("http://server/path") === 14 // "http://server/" + * ``` + */ + function getRootLength(path) { + var rootLength = getEncodedRootLength(path); + return rootLength < 0 ? ~rootLength : rootLength; + } + ts.getRootLength = getRootLength; + function getDirectoryPath(path) { + path = normalizeSlashes(path); + // If the path provided is itself the root, then return it. + var rootLength = getRootLength(path); + if (rootLength === path.length) + return path; + // return the leading portion of the path up to the last (non-terminal) directory separator + // but not including any trailing directory separator. + path = removeTrailingDirectorySeparator(path); + return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator))); + } + ts.getDirectoryPath = getDirectoryPath; + function getBaseFileName(path, extensions, ignoreCase) { + path = normalizeSlashes(path); + // if the path provided is itself the root, then it has not file name. + var rootLength = getRootLength(path); + if (rootLength === path.length) + return ""; + // return the trailing portion of the path starting after the last (non-terminal) directory + // separator but not including any trailing directory separator. + path = removeTrailingDirectorySeparator(path); + var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1)); + var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined; + return extension ? name.slice(0, name.length - extension.length) : name; + } + ts.getBaseFileName = getBaseFileName; + function tryGetExtensionFromPath(path, extension, stringEqualityComparer) { + if (!ts.startsWith(extension, ".")) + extension = "." + extension; + if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46 /* dot */) { + var pathExtension = path.slice(path.length - extension.length); + if (stringEqualityComparer(pathExtension, extension)) { + return pathExtension; + } + } + } + function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) { + if (typeof extensions === "string") { + return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || ""; + } + for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) { + var extension = extensions_2[_i]; + var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer); + if (result) + return result; + } + return ""; + } + function getAnyExtensionFromPath(path, extensions, ignoreCase) { + // Retrieves any string from the final "." onwards from a base file name. + // Unlike extensionFromPath, which throws an exception on unrecognized extensions. + if (extensions) { + return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive); + } + var baseFileName = getBaseFileName(path); + var extensionIndex = baseFileName.lastIndexOf("."); + if (extensionIndex >= 0) { + return baseFileName.substring(extensionIndex); + } + return ""; + } + ts.getAnyExtensionFromPath = getAnyExtensionFromPath; + function pathComponents(path, rootLength) { + var root = path.substring(0, rootLength); + var rest = path.substring(rootLength).split(ts.directorySeparator); + if (rest.length && !ts.lastOrUndefined(rest)) + rest.pop(); + return __spreadArrays([root], rest); + } + /** + * Parse a path into an array containing a root component (at index 0) and zero or more path + * components (at indices > 0). The result is not normalized. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + * + * ```ts + * // POSIX + * getPathComponents("/path/to/file.ext") === ["/", "path", "to", "file.ext"] + * getPathComponents("/path/to/") === ["/", "path", "to"] + * getPathComponents("/") === ["/"] + * // DOS + * getPathComponents("c:/path/to/file.ext") === ["c:/", "path", "to", "file.ext"] + * getPathComponents("c:/path/to/") === ["c:/", "path", "to"] + * getPathComponents("c:/") === ["c:/"] + * getPathComponents("c:") === ["c:"] + * // URL + * getPathComponents("http://typescriptlang.org/path/to/file.ext") === ["http://typescriptlang.org/", "path", "to", "file.ext"] + * getPathComponents("http://typescriptlang.org/path/to/") === ["http://typescriptlang.org/", "path", "to"] + * getPathComponents("http://typescriptlang.org/") === ["http://typescriptlang.org/"] + * getPathComponents("http://typescriptlang.org") === ["http://typescriptlang.org"] + * getPathComponents("file://server/path/to/file.ext") === ["file://server/", "path", "to", "file.ext"] + * getPathComponents("file://server/path/to/") === ["file://server/", "path", "to"] + * getPathComponents("file://server/") === ["file://server/"] + * getPathComponents("file://server") === ["file://server"] + * getPathComponents("file:///path/to/file.ext") === ["file:///", "path", "to", "file.ext"] + * getPathComponents("file:///path/to/") === ["file:///", "path", "to"] + * getPathComponents("file:///") === ["file:///"] + * getPathComponents("file://") === ["file://"] + */ + function getPathComponents(path, currentDirectory) { + if (currentDirectory === void 0) { currentDirectory = ""; } + path = combinePaths(currentDirectory, path); + return pathComponents(path, getRootLength(path)); + } + ts.getPathComponents = getPathComponents; + //// Path Formatting + /** + * Formats a parsed path consisting of a root component (at index 0) and zero or more path + * segments (at indices > 0). + * + * ```ts + * getPathFromPathComponents(["/", "path", "to", "file.ext"]) === "/path/to/file.ext" + * ``` + */ + function getPathFromPathComponents(pathComponents) { + if (pathComponents.length === 0) + return ""; + var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]); + return root + pathComponents.slice(1).join(ts.directorySeparator); + } + ts.getPathFromPathComponents = getPathFromPathComponents; + //// Path Normalization + /** + * Normalize path separators, converting `\` into `/`. + */ + function normalizeSlashes(path) { + return path.replace(backslashRegExp, ts.directorySeparator); + } + ts.normalizeSlashes = normalizeSlashes; + /** + * Reduce an array of path components to a more simplified path by navigating any + * `"."` or `".."` entries in the path. + */ + function reducePathComponents(components) { + if (!ts.some(components)) + return []; + var reduced = [components[0]]; + for (var i = 1; i < components.length; i++) { + var component = components[i]; + if (!component) + continue; + if (component === ".") + continue; + if (component === "..") { + if (reduced.length > 1) { + if (reduced[reduced.length - 1] !== "..") { + reduced.pop(); + continue; + } + } + else if (reduced[0]) + continue; + } + reduced.push(component); + } + return reduced; + } + ts.reducePathComponents = reducePathComponents; + /** + * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. + * + * ```ts + * // Non-rooted + * combinePaths("path", "to", "file.ext") === "path/to/file.ext" + * combinePaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file.ext" + * // POSIX + * combinePaths("/path", "to", "file.ext") === "/path/to/file.ext" + * combinePaths("/path", "/to", "file.ext") === "/to/file.ext" + * // DOS + * combinePaths("c:/path", "to", "file.ext") === "c:/path/to/file.ext" + * combinePaths("c:/path", "c:/to", "file.ext") === "c:/to/file.ext" + * // URL + * combinePaths("file:///path", "to", "file.ext") === "file:///path/to/file.ext" + * combinePaths("file:///path", "file:///to", "file.ext") === "file:///to/file.ext" + * ``` + */ + function combinePaths(path) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + if (path) + path = normalizeSlashes(path); + for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { + var relativePath = paths_1[_a]; + if (!relativePath) + continue; + relativePath = normalizeSlashes(relativePath); + if (!path || getRootLength(relativePath) !== 0) { + path = relativePath; + } + else { + path = ensureTrailingDirectorySeparator(path) + relativePath; + } + } + return path; + } + ts.combinePaths = combinePaths; + /** + * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any + * `.` and `..` path components are resolved. Trailing directory separators are preserved. + * + * ```ts + * resolvePath("/path", "to", "file.ext") === "path/to/file.ext" + * resolvePath("/path", "to", "file.ext/") === "path/to/file.ext/" + * resolvePath("/path", "dir", "..", "to", "file.ext") === "path/to/file.ext" + * ``` + */ + function resolvePath(path) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : normalizeSlashes(path)); + } + ts.resolvePath = resolvePath; + /** + * Parse a path into an array containing a root component (at index 0) and zero or more path + * components (at indices > 0). The result is normalized. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + * + * ```ts + * getNormalizedPathComponents("to/dir/../file.ext", "/path/") === ["/", "path", "to", "file.ext"] + * ``` + */ + function getNormalizedPathComponents(path, currentDirectory) { + return reducePathComponents(getPathComponents(path, currentDirectory)); + } + ts.getNormalizedPathComponents = getNormalizedPathComponents; + function getNormalizedAbsolutePath(fileName, currentDirectory) { + return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; + function normalizePath(path) { + path = normalizeSlashes(path); + var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); + return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; + } + ts.normalizePath = normalizePath; + function getPathWithoutRoot(pathComponents) { + if (pathComponents.length === 0) + return ""; + return pathComponents.slice(1).join(ts.directorySeparator); + } + function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { + return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; + function toPath(fileName, basePath, getCanonicalFileName) { + var nonCanonicalizedPath = isRootedDiskPath(fileName) + ? normalizePath(fileName) + : getNormalizedAbsolutePath(fileName, basePath); + return getCanonicalFileName(nonCanonicalizedPath); + } + ts.toPath = toPath; + function normalizePathAndParts(path) { + path = normalizeSlashes(path); + var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1); + if (parts.length) { + var joinedParts = root + parts.join(ts.directorySeparator); + return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts }; + } + else { + return { path: root, parts: parts }; + } + } + ts.normalizePathAndParts = normalizePathAndParts; + function removeTrailingDirectorySeparator(path) { + if (hasTrailingDirectorySeparator(path)) { + return path.substr(0, path.length - 1); + } + return path; + } + ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator; + function ensureTrailingDirectorySeparator(path) { + if (!hasTrailingDirectorySeparator(path)) { + return path + ts.directorySeparator; + } + return path; + } + ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; + /** + * Ensures a path is either absolute (prefixed with `/` or `c:`) or dot-relative (prefixed + * with `./` or `../`) so as not to be confused with an unprefixed module name. + * + * ```ts + * ensurePathIsNonModuleName("/path/to/file.ext") === "/path/to/file.ext" + * ensurePathIsNonModuleName("./path/to/file.ext") === "./path/to/file.ext" + * ensurePathIsNonModuleName("../path/to/file.ext") === "../path/to/file.ext" + * ensurePathIsNonModuleName("path/to/file.ext") === "./path/to/file.ext" + * ``` + */ + function ensurePathIsNonModuleName(path) { + return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; + } + ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName; + function changeAnyExtension(path, ext, extensions, ignoreCase) { + var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path); + return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path; + } + ts.changeAnyExtension = changeAnyExtension; + //// Path Comparisons + // check path for these segments: '', '.'. '..' + var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; + function comparePathsWorker(a, b, componentComparer) { + if (a === b) + return 0 /* EqualTo */; + if (a === undefined) + return -1 /* LessThan */; + if (b === undefined) + return 1 /* GreaterThan */; + // NOTE: Performance optimization - shortcut if the root segments differ as there would be no + // need to perform path reduction. + var aRoot = a.substring(0, getRootLength(a)); + var bRoot = b.substring(0, getRootLength(b)); + var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); + if (result !== 0 /* EqualTo */) { + return result; + } + // NOTE: Performance optimization - shortcut if there are no relative path segments in + // the non-root portion of the path + var aRest = a.substring(aRoot.length); + var bRest = b.substring(bRoot.length); + if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { + return componentComparer(aRest, bRest); + } + // The path contains a relative path segment. Normalize the paths and perform a slower component + // by component comparison. + var aComponents = reducePathComponents(getPathComponents(a)); + var bComponents = reducePathComponents(getPathComponents(b)); + var sharedLength = Math.min(aComponents.length, bComponents.length); + for (var i = 1; i < sharedLength; i++) { + var result_2 = componentComparer(aComponents[i], bComponents[i]); + if (result_2 !== 0 /* EqualTo */) { + return result_2; + } + } + return ts.compareValues(aComponents.length, bComponents.length); + } + /** + * Performs a case-sensitive comparison of two paths. Path roots are always compared case-insensitively. + */ + function comparePathsCaseSensitive(a, b) { + return comparePathsWorker(a, b, ts.compareStringsCaseSensitive); + } + ts.comparePathsCaseSensitive = comparePathsCaseSensitive; + /** + * Performs a case-insensitive comparison of two paths. + */ + function comparePathsCaseInsensitive(a, b) { + return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive); + } + ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive; + function comparePaths(a, b, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + a = combinePaths(currentDirectory, a); + b = combinePaths(currentDirectory, b); + } + else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase)); + } + ts.comparePaths = comparePaths; + function containsPath(parent, child, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + parent = combinePaths(currentDirectory, parent); + child = combinePaths(currentDirectory, child); + } + else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + if (parent === undefined || child === undefined) + return false; + if (parent === child) + return true; + var parentComponents = reducePathComponents(getPathComponents(parent)); + var childComponents = reducePathComponents(getPathComponents(child)); + if (childComponents.length < parentComponents.length) { + return false; + } + var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive; + for (var i = 0; i < parentComponents.length; i++) { + var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer; + if (!equalityComparer(parentComponents[i], childComponents[i])) { + return false; + } + } + return true; + } + ts.containsPath = containsPath; + /** + * Determines whether `fileName` starts with the specified `directoryName` using the provided path canonicalization callback. + * Comparison is case-sensitive between the canonical paths. + * + * @deprecated Use `containsPath` if possible. + */ + function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { + var canonicalFileName = getCanonicalFileName(fileName); + var canonicalDirectoryName = getCanonicalFileName(directoryName); + return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\"); + } + ts.startsWithDirectory = startsWithDirectory; + //// Relative Paths + function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { + var fromComponents = reducePathComponents(getPathComponents(from)); + var toComponents = reducePathComponents(getPathComponents(to)); + var start; + for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { + var fromComponent = getCanonicalFileName(fromComponents[start]); + var toComponent = getCanonicalFileName(toComponents[start]); + var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer; + if (!comparer(fromComponent, toComponent)) + break; + } + if (start === 0) { + return toComponents; + } + var components = toComponents.slice(start); + var relative = []; + for (; start < fromComponents.length; start++) { + relative.push(".."); + } + return __spreadArrays([""], relative, components); + } + ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo; + function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { + ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative"); + var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity; + var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; + var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName); + return getPathFromPathComponents(pathComponents); + } + ts.getRelativePathFromDirectory = getRelativePathFromDirectory; + function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { + return !isRootedDiskPath(absoluteOrRelativePath) + ? absoluteOrRelativePath + : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); + } + ts.convertToRelativePath = convertToRelativePath; + function getRelativePathFromFile(from, to, getCanonicalFileName) { + return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); + } + ts.getRelativePathFromFile = getRelativePathFromFile; + function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { + var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName); + var firstComponent = pathComponents[0]; + if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { + var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///"; + pathComponents[0] = prefix + firstComponent; + } + return getPathFromPathComponents(pathComponents); + } + ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; + function forEachAncestorDirectory(directory, callback) { + while (true) { + var result = callback(directory); + if (result !== undefined) { + return result; + } + var parentPath = getDirectoryPath(directory); + if (parentPath === directory) { + return undefined; + } + directory = parentPath; + } + } + ts.forEachAncestorDirectory = forEachAncestorDirectory; + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + ts.isNodeModulesDirectory = isNodeModulesDirectory; +})(ts || (ts = {})); // // generated from './diagnosticInformationMap.generated.ts' by 'src/compiler' /* @internal */ @@ -7719,7 +7155,7 @@ var ts; Accessibility_modifier_already_seen: diag(1028, ts.DiagnosticCategory.Error, "Accessibility_modifier_already_seen_1028", "Accessibility modifier already seen."), _0_modifier_must_precede_1_modifier: diag(1029, ts.DiagnosticCategory.Error, "_0_modifier_must_precede_1_modifier_1029", "'{0}' modifier must precede '{1}' modifier."), _0_modifier_already_seen: diag(1030, ts.DiagnosticCategory.Error, "_0_modifier_already_seen_1030", "'{0}' modifier already seen."), - _0_modifier_cannot_appear_on_class_elements_of_this_kind: diag(1031, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031", "'{0}' modifier cannot appear on class elements of this kind."), + _0_modifier_cannot_appear_on_a_class_element: diag(1031, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_class_element_1031", "'{0}' modifier cannot appear on a class element."), super_must_be_followed_by_an_argument_list_or_member_access: diag(1034, ts.DiagnosticCategory.Error, "super_must_be_followed_by_an_argument_list_or_member_access_1034", "'super' must be followed by an argument list or member access."), Only_ambient_modules_can_use_quoted_names: diag(1035, ts.DiagnosticCategory.Error, "Only_ambient_modules_can_use_quoted_names_1035", "Only ambient modules can use quoted names."), Statements_are_not_allowed_in_ambient_contexts: diag(1036, ts.DiagnosticCategory.Error, "Statements_are_not_allowed_in_ambient_contexts_1036", "Statements are not allowed in ambient contexts."), @@ -7859,7 +7295,7 @@ var ts; Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, ts.DiagnosticCategory.Error, "Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205", "Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."), Decorators_are_not_valid_here: diag(1206, ts.DiagnosticCategory.Error, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, ts.DiagnosticCategory.Error, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), - _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, ts.DiagnosticCategory.Error, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."), + All_files_must_be_modules_when_the_isolatedModules_flag_is_provided: diag(1208, ts.DiagnosticCategory.Error, "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208", "All files must be modules when the '--isolatedModules' flag is provided."), Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: diag(1210, ts.DiagnosticCategory.Error, "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", "Invalid use of '{0}'. Class definitions are automatically in strict mode."), A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, ts.DiagnosticCategory.Error, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), Identifier_expected_0_is_a_reserved_word_in_strict_mode: diag(1212, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", "Identifier expected. '{0}' is a reserved word in strict mode."), @@ -7907,12 +7343,11 @@ var ts; A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, ts.DiagnosticCategory.Error, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."), A_rest_element_must_be_last_in_a_tuple_type: diag(1256, ts.DiagnosticCategory.Error, "A_rest_element_must_be_last_in_a_tuple_type_1256", "A rest element must be last in a tuple type."), A_required_element_cannot_follow_an_optional_element: diag(1257, ts.DiagnosticCategory.Error, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."), + Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation: diag(1258, ts.DiagnosticCategory.Error, "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258", "Definite assignment assertions can only be used along with a type annotation."), Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, ts.DiagnosticCategory.Error, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"), Keywords_cannot_contain_escape_characters: diag(1260, ts.DiagnosticCategory.Error, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."), Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, ts.DiagnosticCategory.Error, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."), Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."), - Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, ts.DiagnosticCategory.Error, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."), - Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, ts.DiagnosticCategory.Error, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."), with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."), @@ -7929,7 +7364,7 @@ var ts; Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_or_umd: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'esnext', 'commonjs', 'amd', 'system', or 'umd'."), Dynamic_import_must_have_one_specifier_as_an_argument: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_import_must_have_one_specifier_as_an_argument_1324", "Dynamic import must have one specifier as an argument."), Specifier_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Specifier_of_dynamic_import_cannot_be_spread_element_1325", "Specifier of dynamic import cannot be spread element."), - Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments."), + Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments"), String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."), Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: diag(1328, ts.DiagnosticCategory.Error, "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328", "Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."), _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: diag(1329, ts.DiagnosticCategory.Error, "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329", "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"), @@ -7945,9 +7380,9 @@ var ts; Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."), - The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system_1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'."), + The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system_1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'esnext' or 'system'."), A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), - An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), + An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness"), This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."), use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, ts.DiagnosticCategory.Error, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."), Non_simple_parameter_declared_here: diag(1348, ts.DiagnosticCategory.Error, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."), @@ -7990,7 +7425,6 @@ var ts; Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."), - _0_is_not_allowed_as_a_variable_declaration_name: diag(1389, ts.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."), The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true), @@ -8116,7 +7550,6 @@ var ts; Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts.DiagnosticCategory.Error, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), - Types_of_construct_signatures_are_incompatible: diag(2419, ts.DiagnosticCategory.Error, "Types_of_construct_signatures_are_incompatible_2419", "Types of construct signatures are incompatible."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), @@ -8240,7 +7673,6 @@ var ts; The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: diag(2547, ts.DiagnosticCategory.Error, "The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547", "The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."), Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2548, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."), Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2549, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."), - Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later: diag(2550, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550", "Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later."), Property_0_does_not_exist_on_type_1_Did_you_mean_2: diag(2551, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", "Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"), Cannot_find_name_0_Did_you_mean_1: diag(2552, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Did_you_mean_1_2552", "Cannot find name '{0}'. Did you mean '{1}'?"), Computed_values_are_not_permitted_in_an_enum_with_string_valued_members: diag(2553, ts.DiagnosticCategory.Error, "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553", "Computed values are not permitted in an enum with string valued members."), @@ -8264,13 +7696,13 @@ var ts; Property_0_is_incompatible_with_rest_element_type: diag(2573, ts.DiagnosticCategory.Error, "Property_0_is_incompatible_with_rest_element_type_2573", "Property '{0}' is incompatible with rest element type."), A_rest_element_type_must_be_an_array_type: diag(2574, ts.DiagnosticCategory.Error, "A_rest_element_type_must_be_an_array_type_2574", "A rest element type must be an array type."), No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), - Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'."), + Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"), Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), Unused_ts_expect_error_directive: diag(2578, ts.DiagnosticCategory.Error, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."), - Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."), + Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."), @@ -8278,9 +7710,9 @@ var ts; Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), Type_instantiation_is_excessively_deep_and_possibly_infinite: diag(2589, ts.DiagnosticCategory.Error, "Type_instantiation_is_excessively_deep_and_possibly_infinite_2589", "Type instantiation is excessively deep and possibly infinite."), Expression_produces_a_union_type_that_is_too_complex_to_represent: diag(2590, ts.DiagnosticCategory.Error, "Expression_produces_a_union_type_that_is_too_complex_to_represent_2590", "Expression produces a union type that is too complex to represent."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."), This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, ts.DiagnosticCategory.Error, "This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594", "This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag."), _0_can_only_be_imported_by_using_a_default_import: diag(2595, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."), _0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."), @@ -8348,7 +7780,6 @@ var ts; All_declarations_of_0_must_have_identical_modifiers: diag(2687, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_modifiers_2687", "All declarations of '{0}' must have identical modifiers."), Cannot_find_type_definition_file_for_0: diag(2688, ts.DiagnosticCategory.Error, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, ts.DiagnosticCategory.Error, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), - _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, ts.DiagnosticCategory.Error, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."), _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, ts.DiagnosticCategory.Error, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), @@ -8382,7 +7813,7 @@ var ts; Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), - _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"), + Module_0_has_no_exported_member_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_2_2724", "Module '{0}' has no exported member '{1}'. Did you mean '{2}'?"), Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, ts.DiagnosticCategory.Error, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."), Cannot_find_lib_definition_for_0: diag(2726, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."), Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"), @@ -8390,7 +7821,7 @@ var ts; Property_0_is_used_before_its_initialization: diag(2729, ts.DiagnosticCategory.Error, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."), An_arrow_function_cannot_have_a_this_parameter: diag(2730, ts.DiagnosticCategory.Error, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."), Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."), - Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."), + Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension"), Property_0_was_also_declared_here: diag(2733, ts.DiagnosticCategory.Error, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."), Are_you_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"), Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"), @@ -8451,10 +7882,6 @@ var ts; The_operand_of_a_delete_operator_must_be_optional: diag(2790, ts.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_must_be_optional_2790", "The operand of a 'delete' operator must be optional."), Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: diag(2791, ts.DiagnosticCategory.Error, "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791", "Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."), Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option: diag(2792, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792", "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"), - The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: diag(2793, ts.DiagnosticCategory.Error, "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793", "The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."), - Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: diag(2794, ts.DiagnosticCategory.Error, "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794", "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"), - The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, ts.DiagnosticCategory.Error, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."), - It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked: diag(2796, ts.DiagnosticCategory.Error, "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796", "It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -8568,6 +7995,7 @@ var ts; Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: diag(5057, ts.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", "Cannot find a tsconfig.json file at the specified directory: '{0}'."), The_specified_path_does_not_exist_Colon_0: diag(5058, ts.DiagnosticCategory.Error, "The_specified_path_does_not_exist_Colon_0_5058", "The specified path does not exist: '{0}'."), Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, ts.DiagnosticCategory.Error, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."), + Option_paths_cannot_be_used_without_specifying_baseUrl_option: diag(5060, ts.DiagnosticCategory.Error, "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", "Option 'paths' cannot be used without specifying '--baseUrl' option."), Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, ts.DiagnosticCategory.Error, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."), Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: diag(5062, ts.DiagnosticCategory.Error, "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' can have at most one '*' character."), Substitutions_for_pattern_0_should_be_an_array: diag(5063, ts.DiagnosticCategory.Error, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."), @@ -8596,8 +8024,6 @@ var ts; A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: diag(5086, ts.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086", "A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."), A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, ts.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087", "A labeled tuple element is declared as rest with a `...` before the name, rather than before the type."), The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), - Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, ts.DiagnosticCategory.Error, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), - Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, ts.DiagnosticCategory.Error, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -8788,7 +8214,7 @@ var ts; Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"), _0_was_also_declared_here: diag(6203, ts.DiagnosticCategory.Message, "_0_was_also_declared_here_6203", "'{0}' was also declared here."), and_here: diag(6204, ts.DiagnosticCategory.Message, "and_here_6204", "and here."), - All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused."), + All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused"), package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."), package_json_does_not_have_a_typesVersions_entry_that_matches_version_0: diag(6207, ts.DiagnosticCategory.Message, "package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207", "'package.json' does not have a 'typesVersions' entry that matches version '{0}'."), package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2: diag(6208, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208", "'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."), @@ -8820,8 +8246,6 @@ var ts; This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without: diag(6234, ts.DiagnosticCategory.Error, "This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234", "This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"), Disable_loading_referenced_projects: diag(6235, ts.DiagnosticCategory.Message, "Disable_loading_referenced_projects_6235", "Disable loading referenced projects."), Arguments_for_the_rest_parameter_0_were_not_provided: diag(6236, ts.DiagnosticCategory.Error, "Arguments_for_the_rest_parameter_0_were_not_provided_6236", "Arguments for the rest parameter '{0}' were not provided."), - Generates_an_event_trace_and_a_list_of_types: diag(6237, ts.DiagnosticCategory.Message, "Generates_an_event_trace_and_a_list_of_types_6237", "Generates an event trace and a list of types."), - Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react: diag(6238, ts.DiagnosticCategory.Error, "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238", "Specify the module specifier to be used to import the `jsx` and `jsxs` factory functions from. eg, react"), Projects_to_reference: diag(6300, ts.DiagnosticCategory.Message, "Projects_to_reference_6300", "Projects to reference"), Enable_project_compilation: diag(6302, ts.DiagnosticCategory.Message, "Enable_project_compilation_6302", "Enable project compilation"), Composite_projects_may_not_disable_declaration_emit: diag(6304, ts.DiagnosticCategory.Error, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), @@ -8867,13 +8291,11 @@ var ts; Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, ts.DiagnosticCategory.Message, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"), Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, ts.DiagnosticCategory.Message, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."), _0_is_deprecated: diag(6385, ts.DiagnosticCategory.Suggestion, "_0_is_deprecated_6385", "'{0}' is deprecated", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ undefined, /*reportsDeprecated*/ true), - Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, ts.DiagnosticCategory.Message, "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386", "Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing: diag(6503, ts.DiagnosticCategory.Message, "Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503", "Print names of files that are part of the compilation and then stop processing."), File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, ts.DiagnosticCategory.Error, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"), - Include_undefined_in_index_signature_results: diag(6800, ts.DiagnosticCategory.Message, "Include_undefined_in_index_signature_results_6800", "Include 'undefined' in index signature results"), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -8901,7 +8323,7 @@ var ts; Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: diag(7032, ts.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."), Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: diag(7033, ts.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."), Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), - Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035", "Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), + Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035", "Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts.DiagnosticCategory.Error, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead: diag(7038, ts.DiagnosticCategory.Message, "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038", "Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."), @@ -8922,7 +8344,6 @@ var ts; Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: diag(7053, ts.DiagnosticCategory.Error, "Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053", "Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."), No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1: diag(7054, ts.DiagnosticCategory.Error, "No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054", "No index signature with a parameter of type '{0}' was found on type '{1}'."), _0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type: diag(7055, ts.DiagnosticCategory.Error, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055", "'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."), - The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed: diag(7056, ts.DiagnosticCategory.Error, "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056", "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."), @@ -9033,7 +8454,6 @@ var ts; Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), - Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), Extract_function: diag(95005, ts.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"), Extract_constant: diag(95006, ts.DiagnosticCategory.Message, "Extract_constant_95006", "Extract constant"), @@ -9051,7 +8471,6 @@ var ts; Add_undefined_type_to_property_0: diag(95018, ts.DiagnosticCategory.Message, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"), Add_initializer_to_property_0: diag(95019, ts.DiagnosticCategory.Message, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"), Add_definite_assignment_assertion_to_property_0: diag(95020, ts.DiagnosticCategory.Message, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"), - Convert_all_type_literals_to_mapped_type: diag(95021, ts.DiagnosticCategory.Message, "Convert_all_type_literals_to_mapped_type_95021", "Convert all type literals to mapped type"), Add_all_missing_members: diag(95022, ts.DiagnosticCategory.Message, "Add_all_missing_members_95022", "Add all missing members"), Infer_all_types_from_usage: diag(95023, ts.DiagnosticCategory.Message, "Infer_all_types_from_usage_95023", "Infer all types from usage"), Delete_all_unused_declarations: diag(95024, ts.DiagnosticCategory.Message, "Delete_all_unused_declarations_95024", "Delete all unused declarations"), @@ -9173,12 +8592,10 @@ var ts; Could_not_find_convertible_access_expression: diag(95140, ts.DiagnosticCategory.Message, "Could_not_find_convertible_access_expression_95140", "Could not find convertible access expression"), Could_not_find_matching_access_expressions: diag(95141, ts.DiagnosticCategory.Message, "Could_not_find_matching_access_expressions_95141", "Could not find matching access expressions"), Can_only_convert_logical_AND_access_chains: diag(95142, ts.DiagnosticCategory.Message, "Can_only_convert_logical_AND_access_chains_95142", "Can only convert logical AND access chains"), - Add_void_to_Promise_resolved_without_a_value: diag(95143, ts.DiagnosticCategory.Message, "Add_void_to_Promise_resolved_without_a_value_95143", "Add 'void' to Promise resolved without a value"), - Add_void_to_all_Promises_resolved_without_a_value: diag(95144, ts.DiagnosticCategory.Message, "Add_void_to_all_Promises_resolved_without_a_value_95144", "Add 'void' to all Promises resolved without a value"), No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."), Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."), JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"), - Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts.DiagnosticCategory.Error, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters."), + Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts.DiagnosticCategory.Error, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters"), An_accessibility_modifier_cannot_be_used_with_a_private_identifier: diag(18010, ts.DiagnosticCategory.Error, "An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010", "An accessibility modifier cannot be used with a private identifier."), The_operand_of_a_delete_operator_cannot_be_a_private_identifier: diag(18011, ts.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011", "The operand of a 'delete' operator cannot be a private identifier."), constructor_is_a_reserved_word: diag(18012, ts.DiagnosticCategory.Error, "constructor_is_a_reserved_word_18012", "'#constructor' is a reserved word."), @@ -9188,7 +8605,7 @@ var ts; Private_identifiers_are_not_allowed_outside_class_bodies: diag(18016, ts.DiagnosticCategory.Error, "Private_identifiers_are_not_allowed_outside_class_bodies_18016", "Private identifiers are not allowed outside class bodies."), The_shadowing_declaration_of_0_is_defined_here: diag(18017, ts.DiagnosticCategory.Error, "The_shadowing_declaration_of_0_is_defined_here_18017", "The shadowing declaration of '{0}' is defined here"), The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here: diag(18018, ts.DiagnosticCategory.Error, "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018", "The declaration of '{0}' that you probably intended to use is defined here"), - _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier."), + _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier"), A_method_cannot_be_named_with_a_private_identifier: diag(18022, ts.DiagnosticCategory.Error, "A_method_cannot_be_named_with_a_private_identifier_18022", "A method cannot be named with a private identifier."), An_accessor_cannot_be_named_with_a_private_identifier: diag(18023, ts.DiagnosticCategory.Error, "An_accessor_cannot_be_named_with_a_private_identifier_18023", "An accessor cannot be named with a private identifier."), An_enum_member_cannot_be_named_with_a_private_identifier: diag(18024, ts.DiagnosticCategory.Error, "An_enum_member_cannot_be_named_with_a_private_identifier_18024", "An enum member cannot be named with a private identifier."), @@ -9222,7 +8639,7 @@ var ts; any: 128 /* AnyKeyword */, as: 126 /* AsKeyword */, asserts: 127 /* AssertsKeyword */, - bigint: 155 /* BigIntKeyword */, + bigint: 154 /* BigIntKeyword */, boolean: 131 /* BooleanKeyword */, break: 80 /* BreakKeyword */, case: 81 /* CaseKeyword */, @@ -9244,7 +8661,7 @@ var ts; _a.false = 94 /* FalseKeyword */, _a.finally = 95 /* FinallyKeyword */, _a.for = 96 /* ForKeyword */, - _a.from = 153 /* FromKeyword */, + _a.from = 152 /* FromKeyword */, _a.function = 97 /* FunctionKeyword */, _a.get = 134 /* GetKeyword */, _a.if = 98 /* IfKeyword */, @@ -9254,40 +8671,39 @@ var ts; _a.infer = 135 /* InferKeyword */, _a.instanceof = 101 /* InstanceOfKeyword */, _a.interface = 117 /* InterfaceKeyword */, - _a.intrinsic = 136 /* IntrinsicKeyword */, - _a.is = 137 /* IsKeyword */, - _a.keyof = 138 /* KeyOfKeyword */, + _a.is = 136 /* IsKeyword */, + _a.keyof = 137 /* KeyOfKeyword */, _a.let = 118 /* LetKeyword */, - _a.module = 139 /* ModuleKeyword */, - _a.namespace = 140 /* NamespaceKeyword */, - _a.never = 141 /* NeverKeyword */, + _a.module = 138 /* ModuleKeyword */, + _a.namespace = 139 /* NamespaceKeyword */, + _a.never = 140 /* NeverKeyword */, _a.new = 102 /* NewKeyword */, _a.null = 103 /* NullKeyword */, - _a.number = 144 /* NumberKeyword */, - _a.object = 145 /* ObjectKeyword */, + _a.number = 143 /* NumberKeyword */, + _a.object = 144 /* ObjectKeyword */, _a.package = 119 /* PackageKeyword */, _a.private = 120 /* PrivateKeyword */, _a.protected = 121 /* ProtectedKeyword */, _a.public = 122 /* PublicKeyword */, - _a.readonly = 142 /* ReadonlyKeyword */, - _a.require = 143 /* RequireKeyword */, - _a.global = 154 /* GlobalKeyword */, + _a.readonly = 141 /* ReadonlyKeyword */, + _a.require = 142 /* RequireKeyword */, + _a.global = 153 /* GlobalKeyword */, _a.return = 104 /* ReturnKeyword */, - _a.set = 146 /* SetKeyword */, + _a.set = 145 /* SetKeyword */, _a.static = 123 /* StaticKeyword */, - _a.string = 147 /* StringKeyword */, + _a.string = 146 /* StringKeyword */, _a.super = 105 /* SuperKeyword */, _a.switch = 106 /* SwitchKeyword */, - _a.symbol = 148 /* SymbolKeyword */, + _a.symbol = 147 /* SymbolKeyword */, _a.this = 107 /* ThisKeyword */, _a.throw = 108 /* ThrowKeyword */, _a.true = 109 /* TrueKeyword */, _a.try = 110 /* TryKeyword */, - _a.type = 149 /* TypeKeyword */, + _a.type = 148 /* TypeKeyword */, _a.typeof = 111 /* TypeOfKeyword */, - _a.undefined = 150 /* UndefinedKeyword */, - _a.unique = 151 /* UniqueKeyword */, - _a.unknown = 152 /* UnknownKeyword */, + _a.undefined = 149 /* UndefinedKeyword */, + _a.unique = 150 /* UniqueKeyword */, + _a.unknown = 151 /* UnknownKeyword */, _a.var = 112 /* VarKeyword */, _a.void = 113 /* VoidKeyword */, _a.while = 114 /* WhileKeyword */, @@ -9295,7 +8711,7 @@ var ts; _a.yield = 124 /* YieldKeyword */, _a.async = 129 /* AsyncKeyword */, _a.await = 130 /* AwaitKeyword */, - _a.of = 156 /* OfKeyword */, + _a.of = 155 /* OfKeyword */, _a); var textToKeyword = new ts.Map(ts.getEntries(textToKeywordObj)); var textToToken = new ts.Map(ts.getEntries(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 77 /* CaretEqualsToken */, "||=": 74 /* BarBarEqualsToken */, "&&=": 75 /* AmpersandAmpersandEqualsToken */, "??=": 76 /* QuestionQuestionEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ }))); @@ -10476,9 +9892,9 @@ var ts; return result; } function getIdentifierToken() { - // Reserved words are between 2 and 12 characters long and start with a lowercase letter + // Reserved words are between 2 and 11 characters long and start with a lowercase letter var len = tokenValue.length; - if (len >= 2 && len <= 12) { + if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 /* a */ && ch <= 122 /* z */) { var keyword = textToKeyword.get(tokenValue); @@ -11681,9 +11097,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 159 /* TypeParameter */) { + if (d && d.kind === 158 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 253 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 250 /* InterfaceDeclaration */) { return current; } } @@ -11691,7 +11107,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 166 /* Constructor */; + return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 165 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -11721,14 +11137,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 249 /* VariableDeclaration */) { + if (node.kind === 246 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 250 /* VariableDeclarationList */) { + if (node && node.kind === 247 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 232 /* VariableStatement */) { + if (node && node.kind === 229 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -11819,20 +11235,6 @@ var ts; return !nodeTest || nodeTest(node) ? node : undefined; } ts.getOriginalNode = getOriginalNode; - function findAncestor(node, callback) { - while (node) { - var result = callback(node); - if (result === "quit") { - return undefined; - } - else if (result) { - return node; - } - node = node.parent; - } - return undefined; - } - ts.findAncestor = findAncestor; /** * Gets a value indicating whether a node originated in the parse tree. * @@ -11898,30 +11300,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 216 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 213 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return expr.name; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; } } break; - case 207 /* ParenthesizedExpression */: { + case 204 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 245 /* LabeledStatement */: { + case 242 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -11958,16 +11360,16 @@ var ts; switch (declaration.kind) { case 78 /* Identifier */: return declaration; - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: { + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 157 /* QualifiedName */) { + if (name.kind === 156 /* QualifiedName */) { return name.right; } break; } - case 203 /* CallExpression */: - case 216 /* BinaryExpression */: { + case 200 /* CallExpression */: + case 213 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -11983,15 +11385,15 @@ var ts; return undefined; } } - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 325 /* JSDocEnumTag */: + case 321 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -12286,7 +11688,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 311 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 307 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -12318,7 +11720,7 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 168 /* SetAccessor */ || node.kind === 167 /* GetAccessor */; + return node.kind === 167 /* SetAccessor */ || node.kind === 166 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; function isPropertyAccessChain(node) { @@ -12336,10 +11738,10 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 201 /* PropertyAccessExpression */ - || kind === 202 /* ElementAccessExpression */ - || kind === 203 /* CallExpression */ - || kind === 225 /* NonNullExpression */); + (kind === 198 /* PropertyAccessExpression */ + || kind === 199 /* ElementAccessExpression */ + || kind === 200 /* CallExpression */ + || kind === 222 /* NonNullExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ @@ -12374,7 +11776,7 @@ var ts; } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isConstTypeReference(node) { @@ -12391,17 +11793,17 @@ var ts; } ts.isNonNullChain = isNonNullChain; function isBreakOrContinueStatement(node) { - return node.kind === 241 /* BreakStatement */ || node.kind === 240 /* ContinueStatement */; + return node.kind === 238 /* BreakStatement */ || node.kind === 237 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isNamedExportBindings(node) { - return node.kind === 269 /* NamespaceExport */ || node.kind === 268 /* NamedExports */; + return node.kind === 266 /* NamespaceExport */ || node.kind === 265 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isUnparsedTextLike(node) { switch (node.kind) { - case 294 /* UnparsedText */: - case 295 /* UnparsedInternalText */: + case 291 /* UnparsedText */: + case 292 /* UnparsedInternalText */: return true; default: return false; @@ -12410,12 +11812,12 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 292 /* UnparsedPrologue */ || - node.kind === 296 /* UnparsedSyntheticReference */; + node.kind === 289 /* UnparsedPrologue */ || + node.kind === 293 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; function isJSDocPropertyLikeTag(node) { - return node.kind === 333 /* JSDocPropertyTag */ || node.kind === 326 /* JSDocParameterTag */; + return node.kind === 328 /* JSDocPropertyTag */ || node.kind === 322 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; // #endregion @@ -12431,7 +11833,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 157 /* FirstNode */; + return kind >= 156 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -12440,7 +11842,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 156 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 155 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -12481,12 +11883,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return node.parent.isTypeOnly; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -12527,7 +11929,7 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 123 /* StaticKeyword */: return true; } @@ -12550,7 +11952,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 157 /* QualifiedName */ + return kind === 156 /* QualifiedName */ || kind === 78 /* Identifier */; } ts.isEntityName = isEntityName; @@ -12560,14 +11962,14 @@ var ts; || kind === 79 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 158 /* ComputedPropertyName */; + || kind === 157 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 78 /* Identifier */ - || kind === 196 /* ObjectBindingPattern */ - || kind === 197 /* ArrayBindingPattern */; + || kind === 193 /* ObjectBindingPattern */ + || kind === 194 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12582,13 +11984,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; default: return false; @@ -12597,14 +11999,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 174 /* FunctionType */: - case 308 /* JSDocFunctionType */: - case 175 /* ConstructorType */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 173 /* FunctionType */: + case 304 /* JSDocFunctionType */: + case 174 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12619,29 +12021,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 166 /* Constructor */ - || kind === 163 /* PropertyDeclaration */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 171 /* IndexSignature */ - || kind === 229 /* SemicolonClassElement */; + return kind === 165 /* Constructor */ + || kind === 162 /* PropertyDeclaration */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 170 /* IndexSignature */ + || kind === 226 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */); + return node && (node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */); + return node && (node.kind === 166 /* GetAccessor */ || node.kind === 167 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return true; default: return false; @@ -12651,11 +12053,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 170 /* ConstructSignature */ - || kind === 169 /* CallSignature */ - || kind === 162 /* PropertySignature */ - || kind === 164 /* MethodSignature */ - || kind === 171 /* IndexSignature */; + return kind === 169 /* ConstructSignature */ + || kind === 168 /* CallSignature */ + || kind === 161 /* PropertySignature */ + || kind === 163 /* MethodSignature */ + || kind === 170 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12664,12 +12066,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 288 /* PropertyAssignment */ - || kind === 289 /* ShorthandPropertyAssignment */ - || kind === 290 /* SpreadAssignment */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 285 /* PropertyAssignment */ + || kind === 286 /* ShorthandPropertyAssignment */ + || kind === 287 /* SpreadAssignment */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12684,8 +12086,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return true; } return false; @@ -12696,8 +12098,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 197 /* ArrayBindingPattern */ - || kind === 196 /* ObjectBindingPattern */; + return kind === 194 /* ArrayBindingPattern */ + || kind === 193 /* ObjectBindingPattern */; } return false; } @@ -12705,15 +12107,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 199 /* ArrayLiteralExpression */ - || kind === 200 /* ObjectLiteralExpression */; + return kind === 196 /* ArrayLiteralExpression */ + || kind === 197 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 198 /* BindingElement */ - || kind === 222 /* OmittedExpression */; + return kind === 195 /* BindingElement */ + || kind === 219 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12722,9 +12124,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: return true; } return false; @@ -12745,8 +12147,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 196 /* ObjectBindingPattern */: - case 200 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 197 /* ObjectLiteralExpression */: return true; } return false; @@ -12758,8 +12160,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: return true; } return false; @@ -12768,26 +12170,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 201 /* PropertyAccessExpression */ - || kind === 157 /* QualifiedName */ - || kind === 195 /* ImportType */; + return kind === 198 /* PropertyAccessExpression */ + || kind === 156 /* QualifiedName */ + || kind === 192 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 201 /* PropertyAccessExpression */ - || kind === 157 /* QualifiedName */; + return kind === 198 /* PropertyAccessExpression */ + || kind === 156 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 161 /* Decorator */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 160 /* Decorator */: return true; default: return false; @@ -12795,12 +12197,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 203 /* CallExpression */ || node.kind === 204 /* NewExpression */; + return node.kind === 200 /* CallExpression */ || node.kind === 201 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 218 /* TemplateExpression */ + return kind === 215 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12811,33 +12213,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 204 /* NewExpression */: - case 203 /* CallExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: - case 205 /* TaggedTemplateExpression */: - case 199 /* ArrayLiteralExpression */: - case 207 /* ParenthesizedExpression */: - case 200 /* ObjectLiteralExpression */: - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 201 /* NewExpression */: + case 200 /* CallExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: + case 202 /* TaggedTemplateExpression */: + case 196 /* ArrayLiteralExpression */: + case 204 /* ParenthesizedExpression */: + case 197 /* ObjectLiteralExpression */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: case 78 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: case 94 /* FalseKeyword */: case 103 /* NullKeyword */: case 107 /* ThisKeyword */: case 109 /* TrueKeyword */: case 105 /* SuperKeyword */: - case 225 /* NonNullExpression */: - case 226 /* MetaProperty */: + case 222 /* NonNullExpression */: + case 223 /* MetaProperty */: case 99 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12851,13 +12253,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: - case 210 /* DeleteExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 213 /* AwaitExpression */: - case 206 /* TypeAssertionExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 207 /* DeleteExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 210 /* AwaitExpression */: + case 203 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12866,9 +12268,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return true; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12887,15 +12289,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 217 /* ConditionalExpression */: - case 219 /* YieldExpression */: - case 209 /* ArrowFunction */: - case 216 /* BinaryExpression */: - case 220 /* SpreadElement */: - case 224 /* AsExpression */: - case 222 /* OmittedExpression */: - case 337 /* CommaListExpression */: - case 336 /* PartiallyEmittedExpression */: + case 214 /* ConditionalExpression */: + case 216 /* YieldExpression */: + case 206 /* ArrowFunction */: + case 213 /* BinaryExpression */: + case 217 /* SpreadElement */: + case 221 /* AsExpression */: + case 219 /* OmittedExpression */: + case 332 /* CommaListExpression */: + case 331 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12903,8 +12305,8 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 206 /* TypeAssertionExpression */ - || kind === 224 /* AsExpression */; + return kind === 203 /* TypeAssertionExpression */ + || kind === 221 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ @@ -12915,13 +12317,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return true; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12950,7 +12352,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 238 /* ForInStatement */ || node.kind === 239 /* ForOfStatement */; + return node.kind === 235 /* ForInStatement */ || node.kind === 236 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12974,114 +12376,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 257 /* ModuleBlock */ - || kind === 256 /* ModuleDeclaration */ + return kind === 254 /* ModuleBlock */ + || kind === 253 /* ModuleDeclaration */ || kind === 78 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 257 /* ModuleBlock */ - || kind === 256 /* ModuleDeclaration */; + return kind === 254 /* ModuleBlock */ + || kind === 253 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 78 /* Identifier */ - || kind === 256 /* ModuleDeclaration */; + || kind === 253 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 264 /* NamedImports */ - || kind === 263 /* NamespaceImport */; + return kind === 261 /* NamedImports */ + || kind === 260 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */ || node.kind === 255 /* EnumDeclaration */; + return node.kind === 253 /* ModuleDeclaration */ || node.kind === 252 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 209 /* ArrowFunction */ - || kind === 198 /* BindingElement */ - || kind === 252 /* ClassDeclaration */ - || kind === 221 /* ClassExpression */ - || kind === 166 /* Constructor */ - || kind === 255 /* EnumDeclaration */ - || kind === 291 /* EnumMember */ - || kind === 270 /* ExportSpecifier */ - || kind === 251 /* FunctionDeclaration */ - || kind === 208 /* FunctionExpression */ - || kind === 167 /* GetAccessor */ - || kind === 262 /* ImportClause */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 265 /* ImportSpecifier */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 280 /* JsxAttribute */ - || kind === 165 /* MethodDeclaration */ - || kind === 164 /* MethodSignature */ - || kind === 256 /* ModuleDeclaration */ - || kind === 259 /* NamespaceExportDeclaration */ - || kind === 263 /* NamespaceImport */ - || kind === 269 /* NamespaceExport */ - || kind === 160 /* Parameter */ - || kind === 288 /* PropertyAssignment */ - || kind === 163 /* PropertyDeclaration */ - || kind === 162 /* PropertySignature */ - || kind === 168 /* SetAccessor */ - || kind === 289 /* ShorthandPropertyAssignment */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 159 /* TypeParameter */ - || kind === 249 /* VariableDeclaration */ - || kind === 331 /* JSDocTypedefTag */ - || kind === 324 /* JSDocCallbackTag */ - || kind === 333 /* JSDocPropertyTag */; + return kind === 206 /* ArrowFunction */ + || kind === 195 /* BindingElement */ + || kind === 249 /* ClassDeclaration */ + || kind === 218 /* ClassExpression */ + || kind === 165 /* Constructor */ + || kind === 252 /* EnumDeclaration */ + || kind === 288 /* EnumMember */ + || kind === 267 /* ExportSpecifier */ + || kind === 248 /* FunctionDeclaration */ + || kind === 205 /* FunctionExpression */ + || kind === 166 /* GetAccessor */ + || kind === 259 /* ImportClause */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 262 /* ImportSpecifier */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 277 /* JsxAttribute */ + || kind === 164 /* MethodDeclaration */ + || kind === 163 /* MethodSignature */ + || kind === 253 /* ModuleDeclaration */ + || kind === 256 /* NamespaceExportDeclaration */ + || kind === 260 /* NamespaceImport */ + || kind === 266 /* NamespaceExport */ + || kind === 159 /* Parameter */ + || kind === 285 /* PropertyAssignment */ + || kind === 162 /* PropertyDeclaration */ + || kind === 161 /* PropertySignature */ + || kind === 167 /* SetAccessor */ + || kind === 286 /* ShorthandPropertyAssignment */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 158 /* TypeParameter */ + || kind === 246 /* VariableDeclaration */ + || kind === 327 /* JSDocTypedefTag */ + || kind === 320 /* JSDocCallbackTag */ + || kind === 328 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 251 /* FunctionDeclaration */ - || kind === 271 /* MissingDeclaration */ - || kind === 252 /* ClassDeclaration */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 255 /* EnumDeclaration */ - || kind === 256 /* ModuleDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 267 /* ExportDeclaration */ - || kind === 266 /* ExportAssignment */ - || kind === 259 /* NamespaceExportDeclaration */; + return kind === 248 /* FunctionDeclaration */ + || kind === 268 /* MissingDeclaration */ + || kind === 249 /* ClassDeclaration */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 252 /* EnumDeclaration */ + || kind === 253 /* ModuleDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 264 /* ExportDeclaration */ + || kind === 263 /* ExportAssignment */ + || kind === 256 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 241 /* BreakStatement */ - || kind === 240 /* ContinueStatement */ - || kind === 248 /* DebuggerStatement */ - || kind === 235 /* DoStatement */ - || kind === 233 /* ExpressionStatement */ - || kind === 231 /* EmptyStatement */ - || kind === 238 /* ForInStatement */ - || kind === 239 /* ForOfStatement */ - || kind === 237 /* ForStatement */ - || kind === 234 /* IfStatement */ - || kind === 245 /* LabeledStatement */ - || kind === 242 /* ReturnStatement */ - || kind === 244 /* SwitchStatement */ - || kind === 246 /* ThrowStatement */ - || kind === 247 /* TryStatement */ - || kind === 232 /* VariableStatement */ - || kind === 236 /* WhileStatement */ - || kind === 243 /* WithStatement */ - || kind === 335 /* NotEmittedStatement */ - || kind === 339 /* EndOfDeclarationMarker */ - || kind === 338 /* MergeDeclarationMarker */; + return kind === 238 /* BreakStatement */ + || kind === 237 /* ContinueStatement */ + || kind === 245 /* DebuggerStatement */ + || kind === 232 /* DoStatement */ + || kind === 230 /* ExpressionStatement */ + || kind === 228 /* EmptyStatement */ + || kind === 235 /* ForInStatement */ + || kind === 236 /* ForOfStatement */ + || kind === 234 /* ForStatement */ + || kind === 231 /* IfStatement */ + || kind === 242 /* LabeledStatement */ + || kind === 239 /* ReturnStatement */ + || kind === 241 /* SwitchStatement */ + || kind === 243 /* ThrowStatement */ + || kind === 244 /* TryStatement */ + || kind === 229 /* VariableStatement */ + || kind === 233 /* WhileStatement */ + || kind === 240 /* WithStatement */ + || kind === 330 /* NotEmittedStatement */ + || kind === 334 /* EndOfDeclarationMarker */ + || kind === 333 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 159 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 330 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 158 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 326 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -13108,10 +12510,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 230 /* Block */) + if (node.kind !== 227 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 247 /* TryStatement */ || node.parent.kind === 287 /* CatchClause */) { + if (node.parent.kind === 244 /* TryStatement */ || node.parent.kind === 284 /* CatchClause */) { return false; } } @@ -13125,15 +12527,15 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 230 /* Block */; + || kind === 227 /* Block */; } ts.isStatementOrBlock = isStatementOrBlock; // Module references /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 272 /* ExternalModuleReference */ - || kind === 157 /* QualifiedName */ + return kind === 269 /* ExternalModuleReference */ + || kind === 156 /* QualifiedName */ || kind === 78 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -13143,70 +12545,70 @@ var ts; var kind = node.kind; return kind === 107 /* ThisKeyword */ || kind === 78 /* Identifier */ - || kind === 201 /* PropertyAccessExpression */; + || kind === 198 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 273 /* JsxElement */ - || kind === 283 /* JsxExpression */ - || kind === 274 /* JsxSelfClosingElement */ + return kind === 270 /* JsxElement */ + || kind === 280 /* JsxExpression */ + || kind === 271 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 277 /* JsxFragment */; + || kind === 274 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 280 /* JsxAttribute */ - || kind === 282 /* JsxSpreadAttribute */; + return kind === 277 /* JsxAttribute */ + || kind === 279 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 283 /* JsxExpression */; + || kind === 280 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 275 /* JsxOpeningElement */ - || kind === 274 /* JsxSelfClosingElement */; + return kind === 272 /* JsxOpeningElement */ + || kind === 271 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 284 /* CaseClause */ - || kind === 285 /* DefaultClause */; + return kind === 281 /* CaseClause */ + || kind === 282 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 301 /* FirstJSDocNode */ && node.kind <= 333 /* LastJSDocNode */; + return node.kind >= 298 /* FirstJSDocNode */ && node.kind <= 328 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 311 /* JSDocComment */ || node.kind === 310 /* JSDocNamepathType */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node); + return node.kind === 307 /* JSDocComment */ || node.kind === 306 /* JSDocNamepathType */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 314 /* FirstJSDocTagNode */ && node.kind <= 333 /* LastJSDocTagNode */; + return node.kind >= 310 /* FirstJSDocTagNode */ && node.kind <= 328 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 168 /* SetAccessor */; + return node.kind === 167 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 167 /* GetAccessor */; + return node.kind === 166 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -13232,13 +12634,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 162 /* PropertySignature */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: - case 291 /* EnumMember */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 161 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: + case 288 /* EnumMember */: return true; default: return false; @@ -13246,12 +12648,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 280 /* JsxAttribute */ || node.kind === 282 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 277 /* JsxAttribute */ || node.kind === 279 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 173 /* TypeReference */ || node.kind === 223 /* ExpressionWithTypeArguments */; + return node.kind === 172 /* TypeReference */ || node.kind === 220 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -13384,6 +12786,20 @@ var ts; }); } ts.optionsHaveModuleResolutionChanges = optionsHaveModuleResolutionChanges; + function findAncestor(node, callback) { + while (node) { + var result = callback(node); + if (result === "quit") { + return undefined; + } + else if (result) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.findAncestor = findAncestor; function forEachAncestor(node, callback) { while (true) { var res = callback(node); @@ -13532,7 +12948,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 297 /* SourceFile */) { + while (node && node.kind !== 294 /* SourceFile */) { node = node.parent; } return node; @@ -13540,11 +12956,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 230 /* Block */: - case 258 /* CaseBlock */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return true; } return false; @@ -13740,7 +13156,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 334 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 329 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13759,12 +13175,8 @@ var ts; } ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile; function isJSDocTypeExpressionOrChild(node) { - return !!ts.findAncestor(node, ts.isJSDocTypeExpression); + return !!findAncestor(node, ts.isJSDocTypeExpression); } - function isExportNamespaceAsDefaultDeclaration(node) { - return !!(ts.isExportDeclaration(node) && node.exportClause && ts.isNamespaceExport(node.exportClause) && node.exportClause.name.escapedText === "default"); - } - ts.isExportNamespaceAsDefaultDeclaration = isExportNamespaceAsDefaultDeclaration; function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) { if (includeTrivia === void 0) { includeTrivia = false; } if (nodeIsMissing(node)) { @@ -13802,85 +13214,10 @@ var ts; return emitNode && emitNode.flags || 0; } ts.getEmitFlags = getEmitFlags; - ; - function getScriptTargetFeatures() { - return { - es2015: { - Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"], - RegExp: ["flags", "sticky", "unicode"], - Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"], - ArrayConstructor: ["from", "of"], - ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"], - NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"], - Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"], - Map: ["entries", "keys", "values"], - Set: ["entries", "keys", "values"], - Promise: ts.emptyArray, - PromiseConstructor: ["all", "race", "reject", "resolve"], - Symbol: ["for", "keyFor"], - WeakMap: ["entries", "keys", "values"], - WeakSet: ["entries", "keys", "values"], - Iterator: ts.emptyArray, - AsyncIterator: ts.emptyArray, - String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"], - StringConstructor: ["fromCodePoint", "raw"] - }, - es2016: { - Array: ["includes"] - }, - es2017: { - Atomics: ts.emptyArray, - SharedArrayBuffer: ts.emptyArray, - String: ["padStart", "padEnd"], - ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"], - DateTimeFormat: ["formatToParts"] - }, - es2018: { - Promise: ["finally"], - RegExpMatchArray: ["groups"], - RegExpExecArray: ["groups"], - RegExp: ["dotAll"], - Intl: ["PluralRules"], - AsyncIterable: ts.emptyArray, - AsyncIterableIterator: ts.emptyArray, - AsyncGenerator: ts.emptyArray, - AsyncGeneratorFunction: ts.emptyArray, - }, - es2019: { - Array: ["flat", "flatMap"], - ObjectConstructor: ["fromEntries"], - String: ["trimStart", "trimEnd", "trimLeft", "trimRight"], - Symbol: ["description"] - }, - es2020: { - BigInt: ts.emptyArray, - BigInt64Array: ts.emptyArray, - BigUint64Array: ts.emptyArray, - PromiseConstructor: ["allSettled"], - SymbolConstructor: ["matchAll"], - String: ["matchAll"], - DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"], - RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"] - }, - esnext: { - PromiseConstructor: ["any"], - String: ["replaceAll"], - NumberFormat: ["formatToParts"] - } - }; - } - ts.getScriptTargetFeatures = getScriptTargetFeatures; - var GetLiteralTextFlags; - (function (GetLiteralTextFlags) { - GetLiteralTextFlags[GetLiteralTextFlags["None"] = 0] = "None"; - GetLiteralTextFlags[GetLiteralTextFlags["NeverAsciiEscape"] = 1] = "NeverAsciiEscape"; - GetLiteralTextFlags[GetLiteralTextFlags["JsxAttributeEscape"] = 2] = "JsxAttributeEscape"; - GetLiteralTextFlags[GetLiteralTextFlags["TerminateUnterminatedLiterals"] = 4] = "TerminateUnterminatedLiterals"; - })(GetLiteralTextFlags = ts.GetLiteralTextFlags || (ts.GetLiteralTextFlags = {})); - function getLiteralText(node, sourceFile, flags) { + function getLiteralText(node, sourceFile, neverAsciiEscape, jsxAttributeEscape) { // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. - if (!nodeIsSynthesized(node) && node.parent && !(flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) || + if (!nodeIsSynthesized(node) && node.parent && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) || ts.isBigIntLiteral(node))) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); } @@ -13888,8 +13225,8 @@ var ts; // or a (possibly escaped) quoted form of the original text if it's string-like. switch (node.kind) { case 10 /* StringLiteral */: { - var escapeText = flags & 2 /* JsxAttributeEscape */ ? escapeJsxAttributeString : - flags & 1 /* NeverAsciiEscape */ || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : + var escapeText = jsxAttributeEscape ? escapeJsxAttributeString : + neverAsciiEscape || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : escapeNonAsciiString; if (node.singleQuote) { return "'" + escapeText(node.text, 39 /* singleQuote */) + "'"; @@ -13904,7 +13241,7 @@ var ts; case 17 /* TemplateTail */: { // If a NoSubstitutionTemplateLiteral appears to have a substitution in it, the original text // had to include a backslash: `not \${a} substitution`. - var escapeText = flags & 1 /* NeverAsciiEscape */ || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : + var escapeText = neverAsciiEscape || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : escapeNonAsciiString; var rawText = node.rawText || escapeTemplateSubstitution(escapeText(node.text, 96 /* backtick */)); switch (node.kind) { @@ -13921,11 +13258,7 @@ var ts; } case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: - return node.text; case 13 /* RegularExpressionLiteral */: - if (flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) { - return node.text + (node.text.charCodeAt(node.text.length - 1) === 92 /* backslash */ ? " /" : "/"); - } return node.text; } return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); @@ -13948,7 +13281,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 249 /* VariableDeclaration */ && node.parent.kind === 287 /* CatchClause */; + return node.kind === 246 /* VariableDeclaration */ && node.parent.kind === 284 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13980,11 +13313,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 256 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 253 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 297 /* SourceFile */ || - node.kind === 256 /* ModuleDeclaration */ || + return node.kind === 294 /* SourceFile */ || + node.kind === 253 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -14001,9 +13334,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: return ts.isExternalModule(node.parent); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -14056,22 +13389,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 297 /* SourceFile */: - case 258 /* CaseBlock */: - case 287 /* CatchClause */: - case 256 /* ModuleDeclaration */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 294 /* SourceFile */: + case 255 /* CaseBlock */: + case 284 /* CatchClause */: + case 253 /* ModuleDeclaration */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; - case 230 /* Block */: + case 227 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -14081,9 +13414,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 313 /* JSDocSignature */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 309 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -14093,25 +13426,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 308 /* JSDocFunctionType */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 304 /* JSDocFunctionType */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -14121,8 +13454,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: return true; default: return false; @@ -14131,15 +13464,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 232 /* VariableStatement */: - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 229 /* VariableStatement */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: return true; default: return false; @@ -14153,7 +13486,7 @@ var ts; // Gets the nearest enclosing block scope container that has the provided node // as a descendant, that is not the provided node. function getEnclosingBlockScopeContainer(node) { - return ts.findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); }); + return findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); }); } ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; // Return display name of an identifier @@ -14168,7 +13501,7 @@ var ts; } ts.getNameFromIndexInfo = getNameFromIndexInfo; function isComputedNonLiteralName(name) { - return name.kind === 158 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); + return name.kind === 157 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); } ts.isComputedNonLiteralName = isComputedNonLiteralName; function getTextOfPropertyName(name) { @@ -14180,7 +13513,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -14196,9 +13529,9 @@ var ts; case 79 /* PrivateIdentifier */: case 78 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -14239,18 +13572,6 @@ var ts; }; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; - function createDiagnosticForFileFromMessageChain(sourceFile, messageChain, relatedInformation) { - return { - file: sourceFile, - start: 0, - length: 0, - code: messageChain.code, - category: messageChain.category, - messageText: messageChain.next ? messageChain : messageChain.messageText, - relatedInformation: relatedInformation - }; - } - ts.createDiagnosticForFileFromMessageChain = createDiagnosticForFileFromMessageChain; function createDiagnosticForRange(sourceFile, range, message) { return { file: sourceFile, @@ -14271,7 +13592,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 230 /* Block */) { + if (node.body && node.body.kind === 227 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -14285,7 +13606,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -14294,28 +13615,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 254 /* TypeAliasDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 251 /* TypeAliasDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: errorNode = node.name; break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -14367,11 +13688,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 203 /* CallExpression */ && n.expression.kind === 105 /* SuperKeyword */; + return n.kind === 200 /* CallExpression */ && n.expression.kind === 105 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 203 /* CallExpression */ && n.expression.kind === 99 /* ImportKeyword */; + return n.kind === 200 /* CallExpression */ && n.expression.kind === 99 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -14385,7 +13706,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 233 /* ExpressionStatement */ + return node.kind === 230 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -14413,11 +13734,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 160 /* Parameter */ || - node.kind === 159 /* TypeParameter */ || - node.kind === 208 /* FunctionExpression */ || - node.kind === 209 /* ArrowFunction */ || - node.kind === 207 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 159 /* Parameter */ || + node.kind === 158 /* TypeParameter */ || + node.kind === 205 /* FunctionExpression */ || + node.kind === 206 /* ArrowFunction */ || + node.kind === 204 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -14433,48 +13754,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (172 /* FirstTypeNode */ <= node.kind && node.kind <= 195 /* LastTypeNode */) { + if (171 /* FirstTypeNode */ <= node.kind && node.kind <= 192 /* LastTypeNode */) { return true; } switch (node.kind) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 147 /* StringKeyword */: + case 151 /* UnknownKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 146 /* StringKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: - case 145 /* ObjectKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: + case 147 /* SymbolKeyword */: + case 144 /* ObjectKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: return true; case 113 /* VoidKeyword */: - return node.parent.kind !== 212 /* VoidExpression */; - case 223 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 209 /* VoidExpression */; + case 220 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 159 /* TypeParameter */: - return node.parent.kind === 190 /* MappedType */ || node.parent.kind === 185 /* InferType */; + case 158 /* TypeParameter */: + return node.parent.kind === 189 /* MappedType */ || node.parent.kind === 184 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 78 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 156 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */ || node.kind === 201 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 78 /* Identifier */ || node.kind === 156 /* QualifiedName */ || node.kind === 198 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 157 /* QualifiedName */: - case 201 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: case 107 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 176 /* TypeQuery */) { + if (parent.kind === 175 /* TypeQuery */) { return false; } - if (parent.kind === 195 /* ImportType */) { + if (parent.kind === 192 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -14483,40 +13804,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (172 /* FirstTypeNode */ <= parent.kind && parent.kind <= 195 /* LastTypeNode */) { + if (171 /* FirstTypeNode */ <= parent.kind && parent.kind <= 192 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return node === parent.constraint; - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return node === parent.constraint; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 160 /* Parameter */: - case 249 /* VariableDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 159 /* Parameter */: + case 246 /* VariableDeclaration */: return node === parent.type; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return node === parent.type; - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return node === parent.type; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return node === parent.type; - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -14541,23 +13862,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitor(node); - case 258 /* CaseBlock */: - case 230 /* Block */: - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 243 /* WithStatement */: - case 244 /* SwitchStatement */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 245 /* LabeledStatement */: - case 247 /* TryStatement */: - case 287 /* CatchClause */: + case 255 /* CaseBlock */: + case 227 /* Block */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 240 /* WithStatement */: + case 241 /* SwitchStatement */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 242 /* LabeledStatement */: + case 244 /* TryStatement */: + case 284 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -14567,23 +13888,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 255 /* EnumDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 157 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. traverse(node.name.expression); @@ -14606,10 +13927,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 178 /* ArrayType */) { + if (node && node.kind === 177 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 173 /* TypeReference */) { + else if (node && node.kind === 172 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -14619,12 +13940,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 177 /* TypeLiteral */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 176 /* TypeLiteral */: return node.members; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return node.properties; } } @@ -14632,14 +13953,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 198 /* BindingElement */: - case 291 /* EnumMember */: - case 160 /* Parameter */: - case 288 /* PropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 289 /* ShorthandPropertyAssignment */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 288 /* EnumMember */: + case 159 /* Parameter */: + case 285 /* PropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 286 /* ShorthandPropertyAssignment */: + case 246 /* VariableDeclaration */: return true; } } @@ -14651,8 +13972,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 250 /* VariableDeclarationList */ - && node.parent.parent.kind === 232 /* VariableStatement */; + return node.parent.kind === 247 /* VariableDeclarationList */ + && node.parent.parent.kind === 229 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -14663,13 +13984,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return true; } return false; @@ -14680,7 +14001,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 245 /* LabeledStatement */) { + if (node.statement.kind !== 242 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -14688,17 +14009,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 230 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 227 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 165 /* MethodDeclaration */ && node.parent.kind === 200 /* ObjectLiteralExpression */; + return node && node.kind === 164 /* MethodDeclaration */ && node.parent.kind === 197 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 165 /* MethodDeclaration */ && - (node.parent.kind === 200 /* ObjectLiteralExpression */ || - node.parent.kind === 221 /* ClassExpression */); + return node.kind === 164 /* MethodDeclaration */ && + (node.parent.kind === 197 /* ObjectLiteralExpression */ || + node.parent.kind === 218 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -14711,7 +14032,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 288 /* PropertyAssignment */) { + if (property.kind === 285 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -14740,26 +14061,26 @@ var ts; } ts.getTsConfigPropArray = getTsConfigPropArray; function getContainingFunction(node) { - return ts.findAncestor(node.parent, ts.isFunctionLike); + return findAncestor(node.parent, ts.isFunctionLike); } ts.getContainingFunction = getContainingFunction; function getContainingFunctionDeclaration(node) { - return ts.findAncestor(node.parent, ts.isFunctionLikeDeclaration); + return findAncestor(node.parent, ts.isFunctionLikeDeclaration); } ts.getContainingFunctionDeclaration = getContainingFunctionDeclaration; function getContainingClass(node) { - return ts.findAncestor(node.parent, ts.isClassLike); + return findAncestor(node.parent, ts.isClassLike); } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 297 /* SourceFile */); + ts.Debug.assert(node.kind !== 294 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -14774,9 +14095,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 159 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14787,26 +14108,26 @@ var ts; node = node.parent; } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 256 /* ModuleDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 255 /* EnumDeclaration */: - case 297 /* SourceFile */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 253 /* ModuleDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 252 /* EnumDeclaration */: + case 294 /* SourceFile */: return node; } } @@ -14825,9 +14146,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return container; } } @@ -14849,27 +14170,27 @@ var ts; return node; } switch (node.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: node = node.parent; break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return node; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 159 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14885,14 +14206,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 208 /* FunctionExpression */ || func.kind === 209 /* ArrowFunction */) { + if (func.kind === 205 /* FunctionExpression */ || func.kind === 206 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 207 /* ParenthesizedExpression */) { + while (parent.kind === 204 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 203 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 200 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14908,7 +14229,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */) + return (kind === 198 /* PropertyAccessExpression */ || kind === 199 /* ElementAccessExpression */) && node.expression.kind === 105 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14917,26 +14238,21 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */) + return (kind === 198 /* PropertyAccessExpression */ || kind === 199 /* ElementAccessExpression */) && node.expression.kind === 107 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; - function isThisInitializedDeclaration(node) { - var _a; - return !!node && ts.isVariableDeclaration(node) && ((_a = node.initializer) === null || _a === void 0 ? void 0 : _a.kind) === 107 /* ThisKeyword */; - } - ts.isThisInitializedDeclaration = isThisInitializedDeclaration; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 78 /* Identifier */: - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return node; } return undefined; @@ -14944,10 +14260,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return node.tag; - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14960,25 +14276,25 @@ var ts; return false; } switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: // classes are valid targets return true; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 252 /* ClassDeclaration */; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + return parent.kind === 249 /* ClassDeclaration */; + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 252 /* ClassDeclaration */; - case 160 /* Parameter */: + && parent.kind === 249 /* ClassDeclaration */; + case 159 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 166 /* Constructor */ - || parent.kind === 165 /* MethodDeclaration */ - || parent.kind === 168 /* SetAccessor */) - && grandparent.kind === 252 /* ClassDeclaration */; + && (parent.kind === 165 /* Constructor */ + || parent.kind === 164 /* MethodDeclaration */ + || parent.kind === 167 /* SetAccessor */) + && grandparent.kind === 249 /* ClassDeclaration */; } return false; } @@ -14994,10 +14310,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 165 /* MethodDeclaration */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 167 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -15006,9 +14322,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 275 /* JsxOpeningElement */ || - parent.kind === 274 /* JsxSelfClosingElement */ || - parent.kind === 276 /* JsxClosingElement */) { + if (parent.kind === 272 /* JsxOpeningElement */ || + parent.kind === 271 /* JsxSelfClosingElement */ || + parent.kind === 273 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -15021,44 +14337,44 @@ var ts; case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 224 /* AsExpression */: - case 206 /* TypeAssertionExpression */: - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: - case 209 /* ArrowFunction */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 211 /* TypeOfExpression */: - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: - case 216 /* BinaryExpression */: - case 217 /* ConditionalExpression */: - case 220 /* SpreadElement */: - case 218 /* TemplateExpression */: - case 222 /* OmittedExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: - case 219 /* YieldExpression */: - case 213 /* AwaitExpression */: - case 226 /* MetaProperty */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 221 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 208 /* TypeOfExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 213 /* BinaryExpression */: + case 214 /* ConditionalExpression */: + case 217 /* SpreadElement */: + case 215 /* TemplateExpression */: + case 219 /* OmittedExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: + case 216 /* YieldExpression */: + case 210 /* AwaitExpression */: + case 223 /* MetaProperty */: return true; - case 157 /* QualifiedName */: - while (node.parent.kind === 157 /* QualifiedName */) { + case 156 /* QualifiedName */: + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 175 /* TypeQuery */ || isJSXTagName(node); case 78 /* Identifier */: - if (node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 175 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -15076,49 +14392,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 291 /* EnumMember */: - case 288 /* PropertyAssignment */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 288 /* EnumMember */: + case 285 /* PropertyAssignment */: + case 195 /* BindingElement */: return parent.initializer === node; - case 233 /* ExpressionStatement */: - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 242 /* ReturnStatement */: - case 243 /* WithStatement */: - case 244 /* SwitchStatement */: - case 284 /* CaseClause */: - case 246 /* ThrowStatement */: + case 230 /* ExpressionStatement */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 239 /* ReturnStatement */: + case 240 /* WithStatement */: + case 241 /* SwitchStatement */: + case 281 /* CaseClause */: + case 243 /* ThrowStatement */: return parent.expression === node; - case 237 /* ForStatement */: + case 234 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 250 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 247 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 250 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 247 /* VariableDeclarationList */) || forInStatement.expression === node; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return node === parent.expression; - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return node === parent.expression; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return node === parent.expression; - case 161 /* Decorator */: - case 283 /* JsxExpression */: - case 282 /* JsxSpreadAttribute */: - case 290 /* SpreadAssignment */: + case 160 /* Decorator */: + case 280 /* JsxExpression */: + case 279 /* JsxSpreadAttribute */: + case 287 /* SpreadAssignment */: return true; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -15126,14 +14442,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 157 /* QualifiedName */ || node.kind === 78 /* Identifier */) { + while (node.kind === 156 /* QualifiedName */ || node.kind === 78 /* Identifier */) { node = node.parent; } - return node.kind === 176 /* TypeQuery */; + return node.kind === 175 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 272 /* ExternalModuleReference */; + return node.kind === 257 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 269 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -15141,13 +14457,8 @@ var ts; return node.moduleReference.expression; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; - function getExternalModuleRequireArgument(node) { - return isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true) - && getLeftmostAccessExpression(node.initializer).arguments[0]; - } - ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 272 /* ExternalModuleReference */; + return node.kind === 257 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 269 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -15179,11 +14490,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 147 /* StringKeyword */ || node.typeArguments[0].kind === 144 /* NumberKeyword */); + (node.typeArguments[0].kind === 146 /* StringKeyword */ || node.typeArguments[0].kind === 143 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 203 /* CallExpression */) { + if (callExpression.kind !== 200 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -15198,10 +14509,7 @@ var ts; } ts.isRequireCall = isRequireCall; function isRequireVariableDeclaration(node, requireStringLiteralLikeArgument) { - if (node.kind === 198 /* BindingElement */) { - node = node.parent.parent; - } - return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(getLeftmostAccessExpression(node.initializer), requireStringLiteralLikeArgument); + return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(node.initializer, requireStringLiteralLikeArgument); } ts.isRequireVariableDeclaration = isRequireVariableDeclaration; function isRequireVariableStatement(node, requireStringLiteralLikeArgument) { @@ -15219,6 +14527,46 @@ var ts; return getSourceTextOfNodeFromSourceFile(sourceFile, str).charCodeAt(0) === 34 /* doubleQuote */; } ts.isStringDoubleQuoted = isStringDoubleQuoted; + function getDeclarationOfExpando(node) { + if (!node.parent) { + return undefined; + } + var name; + var decl; + if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) { + if (!isInJSFile(node) && !isVarConst(node.parent)) { + return undefined; + } + name = node.parent.name; + decl = node.parent; + } + else if (ts.isBinaryExpression(node.parent)) { + var parentNode = node.parent; + var parentNodeOperator = node.parent.operatorToken.kind; + if (parentNodeOperator === 62 /* EqualsToken */ && parentNode.right === node) { + name = parentNode.left; + decl = name; + } + else if (parentNodeOperator === 56 /* BarBarToken */ || parentNodeOperator === 60 /* QuestionQuestionToken */) { + if (ts.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { + name = parentNode.parent.name; + decl = parentNode.parent; + } + else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 /* EqualsToken */ && parentNode.parent.right === parentNode) { + name = parentNode.parent.left; + decl = name; + } + if (!name || !isBindableStaticNameExpression(name) || !isSameEntityName(name, parentNode.left)) { + return undefined; + } + } + } + if (!name || !getExpandoInitializer(node, isPrototypeAccess(name))) { + return undefined; + } + return decl; + } + ts.getDeclarationOfExpando = getDeclarationOfExpando; function isAssignmentDeclaration(decl) { return ts.isBinaryExpression(decl) || isAccessExpression(decl) || ts.isIdentifier(decl) || ts.isCallExpression(decl); } @@ -15280,11 +14628,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 208 /* FunctionExpression */ || e.kind === 209 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 205 /* FunctionExpression */ || e.kind === 206 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 208 /* FunctionExpression */ || - initializer.kind === 221 /* ClassExpression */ || - initializer.kind === 209 /* ArrowFunction */) { + if (initializer.kind === 205 /* FunctionExpression */ || + initializer.kind === 218 /* ClassExpression */ || + initializer.kind === 206 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -15359,7 +14707,6 @@ var ts; } return false; } - ts.isSameEntityName = isSameEntityName; function getRightMostAssignedExpression(node) { while (isAssignmentExpression(node, /*excludeCompoundAssignments*/ true)) { node = node.right; @@ -15538,7 +14885,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 233 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 230 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -15559,7 +14906,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 251 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 248 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -15568,14 +14915,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return node.parent; - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return node.parent.parent; - case 203 /* CallExpression */: + case 200 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 191 /* LiteralType */: + case 190 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -15585,12 +14932,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return node.moduleSpecifier; - case 260 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 272 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 195 /* ImportType */: + case 257 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 269 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 192 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -15599,11 +14946,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -15611,7 +14958,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 261 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 258 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -15632,13 +14979,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 160 /* Parameter */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 289 /* ShorthandPropertyAssignment */: - case 288 /* PropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 159 /* Parameter */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 286 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -15652,7 +14999,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 331 /* JSDocTypedefTag */ || node.kind === 324 /* JSDocCallbackTag */ || node.kind === 325 /* JSDocEnumTag */; + return node.kind === 327 /* JSDocTypedefTag */ || node.kind === 320 /* JSDocCallbackTag */ || node.kind === 321 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -15677,12 +15024,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return node.initializer; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return node.initializer; } } @@ -15694,7 +15041,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 256 /* ModuleDeclaration */ + node.body.kind === 253 /* ModuleDeclaration */ ? node.body : undefined; } @@ -15709,11 +15056,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 160 /* Parameter */) { + if (node.kind === 159 /* Parameter */) { result = ts.addRange(result, (noCache ? ts.getJSDocParameterTagsNoCache : ts.getJSDocParameterTags)(node)); break; } - if (node.kind === 159 /* TypeParameter */) { + if (node.kind === 158 /* TypeParameter */) { result = ts.addRange(result, (noCache ? ts.getJSDocTypeParameterTagsNoCache : ts.getJSDocTypeParameterTags)(node)); break; } @@ -15724,10 +15071,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 288 /* PropertyAssignment */ || - parent.kind === 266 /* ExportAssignment */ || - parent.kind === 163 /* PropertyDeclaration */ || - parent.kind === 233 /* ExpressionStatement */ && node.kind === 201 /* PropertyAccessExpression */ || + if (parent.kind === 285 /* PropertyAssignment */ || + parent.kind === 263 /* ExportAssignment */ || + parent.kind === 162 /* PropertyDeclaration */ || + parent.kind === 230 /* ExpressionStatement */ && node.kind === 198 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -15785,7 +15132,7 @@ var ts; ts.getEffectiveJSDocHost = getEffectiveJSDocHost; /** Use getEffectiveJSDocHost if you additionally need to look for jsdoc on parent nodes, like assignments. */ function getJSDocHost(node) { - return ts.Debug.checkDefined(ts.findAncestor(node.parent, ts.isJSDoc)).parent; + return ts.Debug.checkDefined(findAncestor(node.parent, ts.isJSDoc)).parent; } ts.getJSDocHost = getJSDocHost; function getTypeParameterFromJsDoc(node) { @@ -15801,7 +15148,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 309 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 305 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15818,31 +15165,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 207 /* ParenthesizedExpression */: - case 199 /* ArrayLiteralExpression */: - case 220 /* SpreadElement */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 196 /* ArrayLiteralExpression */: + case 217 /* SpreadElement */: + case 222 /* NonNullExpression */: node = parent; break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15869,22 +15216,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 230 /* Block */: - case 232 /* VariableStatement */: - case 243 /* WithStatement */: - case 234 /* IfStatement */: - case 244 /* SwitchStatement */: - case 258 /* CaseBlock */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 245 /* LabeledStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 247 /* TryStatement */: - case 287 /* CatchClause */: + case 227 /* Block */: + case 229 /* VariableStatement */: + case 240 /* WithStatement */: + case 231 /* IfStatement */: + case 241 /* SwitchStatement */: + case 255 /* CaseBlock */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 242 /* LabeledStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 244 /* TryStatement */: + case 284 /* CatchClause */: return true; } return false; @@ -15901,44 +15248,30 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 186 /* ParenthesizedType */); + return walkUp(node, 185 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 207 /* ParenthesizedExpression */); + return walkUp(node, 204 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; - /** - * Walks up parenthesized types. - * It returns both the outermost parenthesized type and its parent. - * If given node is not a parenthesiezd type, undefined is return as the former. - */ - function walkUpParenthesizedTypesAndGetParentAndChild(node) { - var child; - while (node && node.kind === 186 /* ParenthesizedType */) { - child = node; - node = node.parent; - } - return [child, node]; - } - ts.walkUpParenthesizedTypesAndGetParentAndChild = walkUpParenthesizedTypesAndGetParentAndChild; function skipParentheses(node) { return ts.skipOuterExpressions(node, 1 /* Parentheses */); } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 207 /* ParenthesizedExpression */) { + while (node.kind === 204 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 201 /* PropertyAccessExpression */ && node.kind !== 202 /* ElementAccessExpression */) { + if (node.kind !== 198 /* PropertyAccessExpression */ && node.kind !== 199 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 210 /* DeleteExpression */; + return node && node.kind === 207 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15991,7 +15324,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 158 /* ComputedPropertyName */ && + node.parent.kind === 157 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15999,26 +15332,26 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 291 /* EnumMember */: - case 288 /* PropertyAssignment */: - case 201 /* PropertyAccessExpression */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 288 /* EnumMember */: + case 285 /* PropertyAssignment */: + case 198 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference return parent.right === node; - case 198 /* BindingElement */: - case 265 /* ImportSpecifier */: + case 195 /* BindingElement */: + case 262 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 270 /* ExportSpecifier */: - case 280 /* JsxAttribute */: + case 267 /* ExportSpecifier */: + case 277 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -16038,33 +15371,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ || - node.kind === 259 /* NamespaceExportDeclaration */ || - node.kind === 262 /* ImportClause */ && !!node.name || - node.kind === 263 /* NamespaceImport */ || - node.kind === 269 /* NamespaceExport */ || - node.kind === 265 /* ImportSpecifier */ || - node.kind === 270 /* ExportSpecifier */ || - node.kind === 266 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 256 /* NamespaceExportDeclaration */ || + node.kind === 259 /* ImportClause */ && !!node.name || + node.kind === 260 /* NamespaceImport */ || + node.kind === 266 /* NamespaceExport */ || + node.kind === 262 /* ImportSpecifier */ || + node.kind === 267 /* ExportSpecifier */ || + node.kind === 263 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 289 /* ShorthandPropertyAssignment */ || - node.kind === 288 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 286 /* ShorthandPropertyAssignment */ || + node.kind === 285 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 262 /* ImportClause */: - case 265 /* ImportSpecifier */: - case 263 /* NamespaceImport */: - case 270 /* ExportSpecifier */: - case 266 /* ExportAssignment */: - case 260 /* ImportEqualsDeclaration */: + case 259 /* ImportClause */: + case 262 /* ImportSpecifier */: + case 260 /* NamespaceImport */: + case 267 /* ExportSpecifier */: + case 263 /* ExportAssignment */: + case 257 /* ImportEqualsDeclaration */: return node.parent; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 157 /* QualifiedName */); + } while (node.parent.kind === 156 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -16083,7 +15416,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 289 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 288 /* PropertyAssignment */ ? node.initializer : + return node.kind === 286 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 285 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -16149,11 +15482,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 80 /* FirstKeyword */ <= token && token <= 156 /* LastKeyword */; + return 80 /* FirstKeyword */ <= token && token <= 155 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 125 /* FirstContextualKeyword */ <= token && token <= 156 /* LastContextualKeyword */; + return 125 /* FirstContextualKeyword */ <= token && token <= 155 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -16197,14 +15530,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (hasSyntacticModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -16218,10 +15551,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasSyntacticModifier(node, 256 /* Async */); @@ -16254,7 +15587,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 158 /* ComputedPropertyName */ || name.kind === 202 /* ElementAccessExpression */)) { + if (!(name.kind === 157 /* ComputedPropertyName */ || name.kind === 199 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression; @@ -16280,7 +15613,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -16349,11 +15682,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 160 /* Parameter */; + return root.kind === 159 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 198 /* BindingElement */) { + while (node.kind === 195 /* BindingElement */) { node = node.parent.parent; } return node; @@ -16361,15 +15694,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 166 /* Constructor */ - || kind === 208 /* FunctionExpression */ - || kind === 251 /* FunctionDeclaration */ - || kind === 209 /* ArrowFunction */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 256 /* ModuleDeclaration */ - || kind === 297 /* SourceFile */; + return kind === 165 /* Constructor */ + || kind === 205 /* FunctionExpression */ + || kind === 248 /* FunctionDeclaration */ + || kind === 206 /* ArrowFunction */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 253 /* ModuleDeclaration */ + || kind === 294 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -16388,23 +15721,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 201 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 204 /* NewExpression */: + case 201 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 214 /* PrefixUnaryExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 213 /* AwaitExpression */: - case 217 /* ConditionalExpression */: - case 219 /* YieldExpression */: + case 211 /* PrefixUnaryExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 210 /* AwaitExpression */: + case 214 /* ConditionalExpression */: + case 216 /* YieldExpression */: return 1 /* Right */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -16431,15 +15764,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 201 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 216 /* BinaryExpression */) { + if (expression.kind === 213 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 214 /* PrefixUnaryExpression */ || expression.kind === 215 /* PostfixUnaryExpression */) { + else if (expression.kind === 211 /* PrefixUnaryExpression */ || expression.kind === 212 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -16618,15 +15951,15 @@ var ts; })(OperatorPrecedence = ts.OperatorPrecedence || (ts.OperatorPrecedence = {})); function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return 0 /* Comma */; - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return 1 /* Spread */; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return 2 /* Yield */; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return 4 /* Conditional */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0 /* Comma */; @@ -16652,21 +15985,21 @@ var ts; } // TODO: Should prefix `++` and `--` be moved to the `Update` precedence? // TODO: We are missing `TypeAssertionExpression` - case 214 /* PrefixUnaryExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 213 /* AwaitExpression */: + case 211 /* PrefixUnaryExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 210 /* AwaitExpression */: return 16 /* Unary */; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return 17 /* Update */; - case 203 /* CallExpression */: + case 200 /* CallExpression */: return 18 /* LeftHandSide */; - case 204 /* NewExpression */: + case 201 /* NewExpression */: return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */; - case 205 /* TaggedTemplateExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 202 /* TaggedTemplateExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return 19 /* Member */; case 107 /* ThisKeyword */: case 105 /* SuperKeyword */: @@ -16677,19 +16010,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 221 /* ClassExpression */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 218 /* ClassExpression */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: - case 207 /* ParenthesizedExpression */: - case 222 /* OmittedExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: + case 215 /* TemplateExpression */: + case 204 /* ParenthesizedExpression */: + case 219 /* OmittedExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: return 20 /* Primary */; default: return -1 /* Invalid */; @@ -16742,19 +16075,6 @@ var ts; return -1; } ts.getBinaryOperatorPrecedence = getBinaryOperatorPrecedence; - function getSemanticJsxChildren(children) { - return ts.filter(children, function (i) { - switch (i.kind) { - case 283 /* JsxExpression */: - return !!i.expression; - case 11 /* JsxText */: - return !i.containsOnlyTriviaWhiteSpaces; - default: - return true; - } - }); - } - ts.getSemanticJsxChildren = getSemanticJsxChildren; function createDiagnosticCollection() { var nonFileDiagnostics = []; // See GH#19873 var filesWithDiagnostics = []; @@ -16949,10 +16269,8 @@ var ts; ts.isIntrinsicJsxName = isIntrinsicJsxName; var indentStrings = ["", " "]; function getIndentString(level) { - // prepopulate cache - var singleLevel = indentStrings[1]; - for (var current = indentStrings.length; current <= level; current++) { - indentStrings.push(indentStrings[current - 1] + singleLevel); + if (indentStrings[level] === undefined) { + indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; } return indentStrings[level]; } @@ -17191,14 +16509,6 @@ var ts; return options.outFile || options.out; } ts.outFile = outFile; - /** Returns 'undefined' if and only if 'options.paths' is undefined. */ - function getPathsBasePath(options, host) { - var _a, _b; - if (!options.paths) - return undefined; - return (_a = options.baseUrl) !== null && _a !== void 0 ? _a : ts.Debug.checkDefined(options.pathsBasePath || ((_b = host.getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(host)), "Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'."); - } - ts.getPathsBasePath = getPathsBasePath; /** * Gets the source files that are expected to have an emit output. * @@ -17327,10 +16637,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 167 /* GetAccessor */) { + if (accessor.kind === 166 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 168 /* SetAccessor */) { + else if (accessor.kind === 167 /* SetAccessor */) { setAccessor = accessor; } else { @@ -17350,10 +16660,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 167 /* GetAccessor */ && !getAccessor) { + if (member.kind === 166 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 168 /* SetAccessor */ && !setAccessor) { + if (member.kind === 167 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -17402,7 +16712,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 311 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 307 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -17638,7 +16948,7 @@ var ts; } ts.getSelectedSyntacticModifierFlags = getSelectedSyntacticModifierFlags; function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 156 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 155 /* LastToken */) { return 0 /* None */; } if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) { @@ -17734,7 +17044,7 @@ var ts; case 84 /* ConstKeyword */: return 2048 /* Const */; case 87 /* DefaultKeyword */: return 512 /* Default */; case 129 /* AsyncKeyword */: return 256 /* Async */; - case 142 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 141 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -17784,8 +17094,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 200 /* ObjectLiteralExpression */ - || kind === 199 /* ArrayLiteralExpression */; + return kind === 197 /* ObjectLiteralExpression */ + || kind === 196 /* ArrayLiteralExpression */; } return false; } @@ -17802,12 +17112,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.left; } while (node.kind !== 78 /* Identifier */); return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 78 /* Identifier */); @@ -17817,8 +17127,8 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 78 /* Identifier */ || node.kind === 107 /* ThisKeyword */ || node.kind === 105 /* SuperKeyword */ || - node.kind === 201 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 207 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 198 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 204 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { @@ -17843,17 +17153,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 156 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 200 /* ObjectLiteralExpression */ && + return expression.kind === 197 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 199 /* ArrayLiteralExpression */ && + return expression.kind === 196 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -18185,8 +17495,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 255 /* EnumDeclaration */: - case 256 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -18263,35 +17573,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return accessKind(parent); - case 215 /* PostfixUnaryExpression */: - case 214 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 288 /* PropertyAssignment */: { + case 285 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 233 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 230 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -18440,37 +17750,37 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */) + return (kind >= 171 /* FirstTypeNode */ && kind <= 192 /* LastTypeNode */) || kind === 128 /* AnyKeyword */ - || kind === 152 /* UnknownKeyword */ - || kind === 144 /* NumberKeyword */ - || kind === 155 /* BigIntKeyword */ - || kind === 145 /* ObjectKeyword */ + || kind === 151 /* UnknownKeyword */ + || kind === 143 /* NumberKeyword */ + || kind === 154 /* BigIntKeyword */ + || kind === 144 /* ObjectKeyword */ || kind === 131 /* BooleanKeyword */ - || kind === 147 /* StringKeyword */ - || kind === 148 /* SymbolKeyword */ + || kind === 146 /* StringKeyword */ + || kind === 147 /* SymbolKeyword */ || kind === 113 /* VoidKeyword */ - || kind === 150 /* UndefinedKeyword */ - || kind === 141 /* NeverKeyword */ - || kind === 223 /* ExpressionWithTypeArguments */ - || kind === 303 /* JSDocAllType */ - || kind === 304 /* JSDocUnknownType */ - || kind === 305 /* JSDocNullableType */ - || kind === 306 /* JSDocNonNullableType */ - || kind === 307 /* JSDocOptionalType */ - || kind === 308 /* JSDocFunctionType */ - || kind === 309 /* JSDocVariadicType */; + || kind === 149 /* UndefinedKeyword */ + || kind === 140 /* NeverKeyword */ + || kind === 220 /* ExpressionWithTypeArguments */ + || kind === 299 /* JSDocAllType */ + || kind === 300 /* JSDocUnknownType */ + || kind === 301 /* JSDocNullableType */ + || kind === 302 /* JSDocNonNullableType */ + || kind === 303 /* JSDocOptionalType */ + || kind === 304 /* JSDocFunctionType */ + || kind === 305 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 201 /* PropertyAccessExpression */ || node.kind === 202 /* ElementAccessExpression */; + return node.kind === 198 /* PropertyAccessExpression */ || node.kind === 199 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 201 /* PropertyAccessExpression */) { + if (node.kind === 198 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 202 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 199 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -18485,41 +17795,34 @@ var ts; } ts.isBundleFileTextLike = isBundleFileTextLike; function isNamedImportsOrExports(node) { - return node.kind === 264 /* NamedImports */ || node.kind === 268 /* NamedExports */; + return node.kind === 261 /* NamedImports */ || node.kind === 265 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; - function getLeftmostAccessExpression(expr) { - while (isAccessExpression(expr)) { - expr = expr.expression; - } - return expr; - } - ts.getLeftmostAccessExpression = getLeftmostAccessExpression; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: node = node.operand; continue; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: node = node.left; continue; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: node = node.condition; continue; - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: node = node.tag; continue; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 224 /* AsExpression */: - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: - case 225 /* NonNullExpression */: - case 336 /* PartiallyEmittedExpression */: + case 221 /* AsExpression */: + case 199 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 222 /* NonNullExpression */: + case 331 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -18538,7 +17841,7 @@ var ts; } function Type(checker, flags) { this.flags = flags; - if (ts.Debug.isDebugging || ts.tracing.isTracing()) { + if (ts.Debug.isDebugging) { this.checker = checker; } } @@ -18895,10 +18198,6 @@ var ts; return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag]; } ts.getStrictOptionValue = getStrictOptionValue; - function getAllowJSCompilerOption(compilerOptions) { - return compilerOptions.allowJs === undefined ? !!compilerOptions.checkJs : compilerOptions.allowJs; - } - ts.getAllowJSCompilerOption = getAllowJSCompilerOption; function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) { return oldOptions !== newOptions && ts.semanticDiagnosticsOptionDeclarations.some(function (option) { return !isJsonEqual(getCompilerOptionValue(oldOptions, option), getCompilerOptionValue(newOptions, option)); }); @@ -18913,26 +18212,6 @@ var ts; return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name]; } ts.getCompilerOptionValue = getCompilerOptionValue; - function getJSXTransformEnabled(options) { - var jsx = options.jsx; - return jsx === 2 /* React */ || jsx === 4 /* ReactJSX */ || jsx === 5 /* ReactJSXDev */; - } - ts.getJSXTransformEnabled = getJSXTransformEnabled; - function getJSXImplicitImportBase(compilerOptions, file) { - var jsxImportSourcePragmas = file === null || file === void 0 ? void 0 : file.pragmas.get("jsximportsource"); - var jsxImportSourcePragma = ts.isArray(jsxImportSourcePragmas) ? jsxImportSourcePragmas[0] : jsxImportSourcePragmas; - return compilerOptions.jsx === 4 /* ReactJSX */ || - compilerOptions.jsx === 5 /* ReactJSXDev */ || - compilerOptions.jsxImportSource || - jsxImportSourcePragma ? - (jsxImportSourcePragma === null || jsxImportSourcePragma === void 0 ? void 0 : jsxImportSourcePragma.arguments.factory) || compilerOptions.jsxImportSource || "react" : - undefined; - } - ts.getJSXImplicitImportBase = getJSXImplicitImportBase; - function getJSXRuntimeImport(base, options) { - return base ? base + "/" + (options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined; - } - ts.getJSXRuntimeImport = getJSXRuntimeImport; function hasZeroOrOneAsteriskCharacter(str) { var seenAsterisk = false; for (var i = 0; i < str.length; i++) { @@ -19312,7 +18591,7 @@ var ts; var allSupportedExtensions = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions); var allSupportedExtensionsWithJson = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions, [".json" /* Json */]); function getSupportedExtensions(options, extraFileExtensions) { - var needJsExtensions = options && getAllowJSCompilerOption(options); + var needJsExtensions = options && options.allowJs; if (!extraFileExtensions || extraFileExtensions.length === 0) { return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions; } @@ -19523,7 +18802,6 @@ var ts; if (!diagnostic.relatedInformation) { diagnostic.relatedInformation = []; } - ts.Debug.assert(diagnostic.relatedInformation !== ts.emptyArray, "Diagnostic had empty array singleton for related info, but is still being constructed!"); (_a = diagnostic.relatedInformation).push.apply(_a, relatedInformation); return diagnostic; } @@ -19652,38 +18930,38 @@ var ts; } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 270 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 267 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 78 /* Identifier */ || node.kind === 201 /* PropertyAccessExpression */) { + while (node.kind === 78 /* Identifier */ || node.kind === 198 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 158 /* ComputedPropertyName */) { + if (node.kind !== 157 /* ComputedPropertyName */) { return false; } if (hasSyntacticModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 253 /* InterfaceDeclaration */ || containerKind === 177 /* TypeLiteral */; + return containerKind === 250 /* InterfaceDeclaration */ || containerKind === 176 /* TypeLiteral */; } /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ function isIdentifierInNonEmittingHeritageClause(node) { if (node.kind !== 78 /* Identifier */) return false; - var heritageClause = ts.findAncestor(node.parent, function (parent) { + var heritageClause = findAncestor(node.parent, function (parent) { switch (parent.kind) { - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return true; - case 201 /* PropertyAccessExpression */: - case 223 /* ExpressionWithTypeArguments */: + case 198 /* PropertyAccessExpression */: + case 220 /* ExpressionWithTypeArguments */: return false; default: return "quit"; } }); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 253 /* InterfaceDeclaration */; + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 250 /* InterfaceDeclaration */; } function isIdentifierTypeReference(node) { return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName); @@ -19877,10 +19155,10 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(216 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(213 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(213 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 209 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { + if (!isLeftSideOfBinary && operand.kind === 206 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -19892,7 +19170,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 219 /* YieldExpression */) { + && operand.kind === 216 /* YieldExpression */) { return false; } return true; @@ -19980,7 +19258,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -20006,7 +19284,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 207 /* ParenthesizedExpression */) { + if (skipped.kind === 204 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -20023,7 +19301,7 @@ var ts; return ts.isCommaSequence(expression) ? factory.createParenthesizedExpression(expression) : expression; } function parenthesizeConditionOfConditionalExpression(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(217 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(214 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -20056,8 +19334,8 @@ var ts; var needsParens = ts.isCommaSequence(check); if (!needsParens) { switch (ts.getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: needsParens = true; } } @@ -20070,9 +19348,9 @@ var ts; function parenthesizeExpressionOfNew(expression) { var leftmostExpr = ts.getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: return factory.createParenthesizedExpression(expression); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return !leftmostExpr.arguments ? factory.createParenthesizedExpression(expression) : expression; // TODO(rbuckton): Verify this assertion holds @@ -20092,7 +19370,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 204 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 201 /* NewExpression */ || emittedExpression.arguments)) { // TODO(rbuckton): Verify whether this assertion holds. return expression; } @@ -20114,7 +19392,7 @@ var ts; function parenthesizeExpressionForDisallowedComma(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(213 /* BinaryExpression */, 27 /* CommaToken */); // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(factory.createParenthesizedExpression(expression), expression); } @@ -20123,44 +19401,44 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 208 /* FunctionExpression */ || kind === 209 /* ArrowFunction */) { + if (kind === 205 /* FunctionExpression */ || kind === 206 /* ArrowFunction */) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. var updated = factory.updateCallExpression(emittedExpression, ts.setTextRange(factory.createParenthesizedExpression(callee), callee), emittedExpression.typeArguments, emittedExpression.arguments); return factory.restoreOuterExpressions(expression, updated, 8 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = ts.getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 200 /* ObjectLiteralExpression */ || leftmostExpressionKind === 208 /* FunctionExpression */) { + if (leftmostExpressionKind === 197 /* ObjectLiteralExpression */ || leftmostExpressionKind === 205 /* FunctionExpression */) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return ts.setTextRange(factory.createParenthesizedExpression(expression), expression); } return expression; } function parenthesizeConciseBodyOfArrowFunction(body) { - if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 200 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 197 /* ObjectLiteralExpression */)) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return ts.setTextRange(factory.createParenthesizedExpression(body), body); } return body; } function parenthesizeMemberOfConditionalType(member) { - return member.kind === 184 /* ConditionalType */ ? factory.createParenthesizedType(member) : member; + return member.kind === 183 /* ConditionalType */ ? factory.createParenthesizedType(member) : member; } function parenthesizeMemberOfElementType(member) { switch (member.kind) { - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return factory.createParenthesizedType(member); } return parenthesizeMemberOfConditionalType(member); } function parenthesizeElementTypeOfArrayType(member) { switch (member.kind) { - case 176 /* TypeQuery */: - case 188 /* TypeOperator */: - case 185 /* InferType */: + case 175 /* TypeQuery */: + case 187 /* TypeOperator */: + case 184 /* InferType */: return factory.createParenthesizedType(member); } return parenthesizeMemberOfElementType(member); @@ -20264,11 +19542,11 @@ var ts; } function convertToAssignmentPattern(node) { switch (node.kind) { - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 196 /* ObjectBindingPattern */: - case 200 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 197 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -20396,8 +19674,6 @@ var ts; updateConstructSignature: updateConstructSignature, createIndexSignature: createIndexSignature, updateIndexSignature: updateIndexSignature, - createTemplateLiteralTypeSpan: createTemplateLiteralTypeSpan, - updateTemplateLiteralTypeSpan: updateTemplateLiteralTypeSpan, createKeywordTypeNode: createKeywordTypeNode, createTypePredicateNode: createTypePredicateNode, updateTypePredicateNode: updateTypePredicateNode, @@ -20442,8 +19718,6 @@ var ts; updateMappedTypeNode: updateMappedTypeNode, createLiteralTypeNode: createLiteralTypeNode, updateLiteralTypeNode: updateLiteralTypeNode, - createTemplateLiteralType: createTemplateLiteralType, - updateTemplateLiteralType: updateTemplateLiteralType, createObjectBindingPattern: createObjectBindingPattern, updateObjectBindingPattern: updateObjectBindingPattern, createArrayBindingPattern: createArrayBindingPattern, @@ -20609,18 +19883,18 @@ var ts; createExternalModuleReference: createExternalModuleReference, updateExternalModuleReference: updateExternalModuleReference, // lazily load factory members for JSDoc types with similar structure - get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(303 /* JSDocAllType */); }, - get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(304 /* JSDocUnknownType */); }, - get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(306 /* JSDocNonNullableType */); }, - get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(306 /* JSDocNonNullableType */); }, - get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(305 /* JSDocNullableType */); }, - get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(305 /* JSDocNullableType */); }, - get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(307 /* JSDocOptionalType */); }, - get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(307 /* JSDocOptionalType */); }, - get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(309 /* JSDocVariadicType */); }, - get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(309 /* JSDocVariadicType */); }, - get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(310 /* JSDocNamepathType */); }, - get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(310 /* JSDocNamepathType */); }, + get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(299 /* JSDocAllType */); }, + get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(300 /* JSDocUnknownType */); }, + get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(302 /* JSDocNonNullableType */); }, + get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(302 /* JSDocNonNullableType */); }, + get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(301 /* JSDocNullableType */); }, + get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(301 /* JSDocNullableType */); }, + get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(303 /* JSDocOptionalType */); }, + get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(303 /* JSDocOptionalType */); }, + get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(305 /* JSDocVariadicType */); }, + get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(305 /* JSDocVariadicType */); }, + get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(306 /* JSDocNamepathType */); }, + get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(306 /* JSDocNamepathType */); }, createJSDocFunctionType: createJSDocFunctionType, updateJSDocFunctionType: updateJSDocFunctionType, createJSDocTypeLiteral: createJSDocTypeLiteral, @@ -20643,33 +19917,29 @@ var ts; updateJSDocAugmentsTag: updateJSDocAugmentsTag, createJSDocImplementsTag: createJSDocImplementsTag, updateJSDocImplementsTag: updateJSDocImplementsTag, - createJSDocSeeTag: createJSDocSeeTag, - updateJSDocSeeTag: updateJSDocSeeTag, - createJSDocNameReference: createJSDocNameReference, - updateJSDocNameReference: updateJSDocNameReference, // lazily load factory members for JSDoc tags with similar structure - get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(329 /* JSDocTypeTag */); }, - get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(329 /* JSDocTypeTag */); }, - get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(327 /* JSDocReturnTag */); }, - get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(327 /* JSDocReturnTag */); }, - get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(328 /* JSDocThisTag */); }, - get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(328 /* JSDocThisTag */); }, - get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(325 /* JSDocEnumTag */); }, - get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(325 /* JSDocEnumTag */); }, - get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(317 /* JSDocAuthorTag */); }, - get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(317 /* JSDocAuthorTag */); }, - get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(319 /* JSDocClassTag */); }, - get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(319 /* JSDocClassTag */); }, - get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(320 /* JSDocPublicTag */); }, - get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(320 /* JSDocPublicTag */); }, - get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(321 /* JSDocPrivateTag */); }, - get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(321 /* JSDocPrivateTag */); }, - get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(322 /* JSDocProtectedTag */); }, - get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(322 /* JSDocProtectedTag */); }, - get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(323 /* JSDocReadonlyTag */); }, - get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(323 /* JSDocReadonlyTag */); }, - get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(318 /* JSDocDeprecatedTag */); }, - get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(318 /* JSDocDeprecatedTag */); }, + get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(325 /* JSDocTypeTag */); }, + get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(325 /* JSDocTypeTag */); }, + get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(323 /* JSDocReturnTag */); }, + get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(323 /* JSDocReturnTag */); }, + get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(324 /* JSDocThisTag */); }, + get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(324 /* JSDocThisTag */); }, + get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(321 /* JSDocEnumTag */); }, + get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(321 /* JSDocEnumTag */); }, + get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(313 /* JSDocAuthorTag */); }, + get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(313 /* JSDocAuthorTag */); }, + get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(315 /* JSDocClassTag */); }, + get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(315 /* JSDocClassTag */); }, + get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(316 /* JSDocPublicTag */); }, + get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(316 /* JSDocPublicTag */); }, + get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(317 /* JSDocPrivateTag */); }, + get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(317 /* JSDocPrivateTag */); }, + get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(318 /* JSDocProtectedTag */); }, + get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(318 /* JSDocProtectedTag */); }, + get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(319 /* JSDocReadonlyTag */); }, + get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(319 /* JSDocReadonlyTag */); }, + get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(314 /* JSDocDeprecatedTag */); }, + get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(314 /* JSDocDeprecatedTag */); }, createJSDocUnknownTag: createJSDocUnknownTag, updateJSDocUnknownTag: updateJSDocUnknownTag, createJSDocComment: createJSDocComment, @@ -20814,7 +20084,6 @@ var ts; if (elements.transformFlags === undefined) { aggregateChildrenFlags(elements); } - ts.Debug.attachNodeArrayDebugInfo(elements); return elements; } // Since the element list of a node array is typically created by starting with an empty array and @@ -20825,7 +20094,6 @@ var ts; ts.setTextRangePosEnd(array, -1, -1); array.hasTrailingComma = !!hasTrailingComma; aggregateChildrenFlags(array); - ts.Debug.attachNodeArrayDebugInfo(array); return array; } function createBaseNode(kind) { @@ -20855,11 +20123,11 @@ var ts; // don't propagate child flags. if (name) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: if (ts.isIdentifier(name)) { node.transformFlags |= propagateIdentifierNameFlags(name); break; @@ -21087,7 +20355,7 @@ var ts; return baseFactory.createBaseTokenNode(kind); } function createToken(token) { - ts.Debug.assert(token >= 0 /* FirstToken */ && token <= 156 /* LastToken */, "Invalid token"); + ts.Debug.assert(token >= 0 /* FirstToken */ && token <= 155 /* LastToken */, "Invalid token"); ts.Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); ts.Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals."); ts.Debug.assert(token !== 78 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers"); @@ -21103,21 +20371,21 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 125 /* AbstractKeyword */: case 133 /* DeclareKeyword */: case 84 /* ConstKeyword */: case 128 /* AnyKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 141 /* NeverKeyword */: - case 145 /* ObjectKeyword */: - case 147 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 140 /* NeverKeyword */: + case 144 /* ObjectKeyword */: + case 146 /* StringKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: case 113 /* VoidKeyword */: - case 152 /* UnknownKeyword */: - case 150 /* UndefinedKeyword */: // `undefined` is an Identifier in the expression case. + case 151 /* UnknownKeyword */: + case 149 /* UndefinedKeyword */: // `undefined` is an Identifier in the expression case. transformFlags = 1 /* ContainsTypeScript */; break; case 123 /* StaticKeyword */: @@ -21195,7 +20463,7 @@ var ts; result.push(createModifier(123 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(142 /* ReadonlyKeyword */)); + result.push(createModifier(141 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(129 /* AsyncKeyword */)); @@ -21207,7 +20475,7 @@ var ts; // // @api function createQualifiedName(left, right) { - var node = createBaseNode(157 /* QualifiedName */); + var node = createBaseNode(156 /* QualifiedName */); node.left = left; node.right = asName(right); node.transformFlags |= @@ -21224,7 +20492,7 @@ var ts; } // @api function createComputedPropertyName(expression) { - var node = createBaseNode(158 /* ComputedPropertyName */); + var node = createBaseNode(157 /* ComputedPropertyName */); node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -21243,7 +20511,7 @@ var ts; // // @api function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createBaseNamedDeclaration(159 /* TypeParameter */, + var node = createBaseNamedDeclaration(158 /* TypeParameter */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.constraint = constraint; @@ -21261,7 +20529,7 @@ var ts; } // @api function createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(160 /* Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); + var node = createBaseVariableLikeDeclaration(159 /* Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); node.dotDotDotToken = dotDotDotToken; node.questionToken = questionToken; if (ts.isThisIdentifier(node.name)) { @@ -21294,7 +20562,7 @@ var ts; } // @api function createDecorator(expression) { - var node = createBaseNode(161 /* Decorator */); + var node = createBaseNode(160 /* Decorator */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -21313,7 +20581,7 @@ var ts; // // @api function createPropertySignature(modifiers, name, questionToken, type) { - var node = createBaseNamedDeclaration(162 /* PropertySignature */, + var node = createBaseNamedDeclaration(161 /* PropertySignature */, /*decorators*/ undefined, modifiers, name); node.type = type; node.questionToken = questionToken; @@ -21331,7 +20599,7 @@ var ts; } // @api function createPropertyDeclaration(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(163 /* PropertyDeclaration */, decorators, modifiers, name, type, initializer); + var node = createBaseVariableLikeDeclaration(162 /* PropertyDeclaration */, decorators, modifiers, name, type, initializer); node.questionToken = questionOrExclamationToken && ts.isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined; node.exclamationToken = questionOrExclamationToken && ts.isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined; node.transformFlags |= @@ -21360,7 +20628,7 @@ var ts; } // @api function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(164 /* MethodSignature */, + var node = createBaseSignatureDeclaration(163 /* MethodSignature */, /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type); node.questionToken = questionToken; node.transformFlags = 1 /* ContainsTypeScript */; @@ -21379,7 +20647,7 @@ var ts; } // @api function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(165 /* MethodDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); + var node = createBaseFunctionLikeDeclaration(164 /* MethodDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; node.questionToken = questionToken; node.transformFlags |= @@ -21418,7 +20686,7 @@ var ts; } // @api function createConstructorDeclaration(decorators, modifiers, parameters, body) { - var node = createBaseFunctionLikeDeclaration(166 /* Constructor */, decorators, modifiers, + var node = createBaseFunctionLikeDeclaration(165 /* Constructor */, decorators, modifiers, /*name*/ undefined, /*typeParameters*/ undefined, parameters, /*type*/ undefined, body); @@ -21436,7 +20704,7 @@ var ts; } // @api function createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) { - return createBaseFunctionLikeDeclaration(167 /* GetAccessor */, decorators, modifiers, name, + return createBaseFunctionLikeDeclaration(166 /* GetAccessor */, decorators, modifiers, name, /*typeParameters*/ undefined, parameters, type, body); } // @api @@ -21452,7 +20720,7 @@ var ts; } // @api function createSetAccessorDeclaration(decorators, modifiers, name, parameters, body) { - return createBaseFunctionLikeDeclaration(168 /* SetAccessor */, decorators, modifiers, name, + return createBaseFunctionLikeDeclaration(167 /* SetAccessor */, decorators, modifiers, name, /*typeParameters*/ undefined, parameters, /*type*/ undefined, body); } @@ -21468,7 +20736,7 @@ var ts; } // @api function createCallSignature(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(169 /* CallSignature */, + var node = createBaseSignatureDeclaration(168 /* CallSignature */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21485,7 +20753,7 @@ var ts; } // @api function createConstructSignature(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(170 /* ConstructSignature */, + var node = createBaseSignatureDeclaration(169 /* ConstructSignature */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21502,7 +20770,7 @@ var ts; } // @api function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createBaseSignatureDeclaration(171 /* IndexSignature */, decorators, modifiers, + var node = createBaseSignatureDeclaration(170 /* IndexSignature */, decorators, modifiers, /*name*/ undefined, /*typeParameters*/ undefined, parameters, type); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21517,21 +20785,6 @@ var ts; ? updateBaseSignatureDeclaration(createIndexSignature(decorators, modifiers, parameters, type), node) : node; } - // @api - function createTemplateLiteralTypeSpan(type, literal) { - var node = createBaseNode(194 /* TemplateLiteralTypeSpan */); - node.type = type; - node.literal = literal; - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - // @api - function updateTemplateLiteralTypeSpan(node, type, literal) { - return node.type !== type - || node.literal !== literal - ? update(createTemplateLiteralTypeSpan(type, literal), node) - : node; - } // // Types // @@ -21541,7 +20794,7 @@ var ts; } // @api function createTypePredicateNode(assertsModifier, parameterName, type) { - var node = createBaseNode(172 /* TypePredicate */); + var node = createBaseNode(171 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -21558,7 +20811,7 @@ var ts; } // @api function createTypeReferenceNode(typeName, typeArguments) { - var node = createBaseNode(173 /* TypeReference */); + var node = createBaseNode(172 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21573,7 +20826,7 @@ var ts; } // @api function createFunctionTypeNode(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(174 /* FunctionType */, + var node = createBaseSignatureDeclaration(173 /* FunctionType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21590,7 +20843,7 @@ var ts; } // @api function createConstructorTypeNode(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(175 /* ConstructorType */, + var node = createBaseSignatureDeclaration(174 /* ConstructorType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21607,7 +20860,7 @@ var ts; } // @api function createTypeQueryNode(exprName) { - var node = createBaseNode(176 /* TypeQuery */); + var node = createBaseNode(175 /* TypeQuery */); node.exprName = exprName; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21620,7 +20873,7 @@ var ts; } // @api function createTypeLiteralNode(members) { - var node = createBaseNode(177 /* TypeLiteral */); + var node = createBaseNode(176 /* TypeLiteral */); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21633,7 +20886,7 @@ var ts; } // @api function createArrayTypeNode(elementType) { - var node = createBaseNode(178 /* ArrayType */); + var node = createBaseNode(177 /* ArrayType */); node.elementType = parenthesizerRules().parenthesizeElementTypeOfArrayType(elementType); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21646,7 +20899,7 @@ var ts; } // @api function createTupleTypeNode(elements) { - var node = createBaseNode(179 /* TupleType */); + var node = createBaseNode(178 /* TupleType */); node.elements = createNodeArray(elements); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21659,7 +20912,7 @@ var ts; } // @api function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { - var node = createBaseNode(192 /* NamedTupleMember */); + var node = createBaseNode(191 /* NamedTupleMember */); node.dotDotDotToken = dotDotDotToken; node.name = name; node.questionToken = questionToken; @@ -21678,7 +20931,7 @@ var ts; } // @api function createOptionalTypeNode(type) { - var node = createBaseNode(180 /* OptionalType */); + var node = createBaseNode(179 /* OptionalType */); node.type = parenthesizerRules().parenthesizeElementTypeOfArrayType(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21691,7 +20944,7 @@ var ts; } // @api function createRestTypeNode(type) { - var node = createBaseNode(181 /* RestType */); + var node = createBaseNode(180 /* RestType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21715,7 +20968,7 @@ var ts; } // @api function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(182 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(181 /* UnionType */, types); } // @api function updateUnionTypeNode(node, types) { @@ -21723,7 +20976,7 @@ var ts; } // @api function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(183 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(182 /* IntersectionType */, types); } // @api function updateIntersectionTypeNode(node, types) { @@ -21731,7 +20984,7 @@ var ts; } // @api function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createBaseNode(184 /* ConditionalType */); + var node = createBaseNode(183 /* ConditionalType */); node.checkType = parenthesizerRules().parenthesizeMemberOfConditionalType(checkType); node.extendsType = parenthesizerRules().parenthesizeMemberOfConditionalType(extendsType); node.trueType = trueType; @@ -21750,7 +21003,7 @@ var ts; } // @api function createInferTypeNode(typeParameter) { - var node = createBaseNode(185 /* InferType */); + var node = createBaseNode(184 /* InferType */); node.typeParameter = typeParameter; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21762,24 +21015,9 @@ var ts; : node; } // @api - function createTemplateLiteralType(head, templateSpans) { - var node = createBaseNode(193 /* TemplateLiteralType */); - node.head = head; - node.templateSpans = createNodeArray(templateSpans); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - // @api - function updateTemplateLiteralType(node, head, templateSpans) { - return node.head !== head - || node.templateSpans !== templateSpans - ? update(createTemplateLiteralType(head, templateSpans), node) - : node; - } - // @api function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { if (isTypeOf === void 0) { isTypeOf = false; } - var node = createBaseNode(195 /* ImportType */); + var node = createBaseNode(192 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); @@ -21799,7 +21037,7 @@ var ts; } // @api function createParenthesizedType(type) { - var node = createBaseNode(186 /* ParenthesizedType */); + var node = createBaseNode(185 /* ParenthesizedType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21812,13 +21050,13 @@ var ts; } // @api function createThisTypeNode() { - var node = createBaseNode(187 /* ThisType */); + var node = createBaseNode(186 /* ThisType */); node.transformFlags = 1 /* ContainsTypeScript */; return node; } // @api function createTypeOperatorNode(operator, type) { - var node = createBaseNode(188 /* TypeOperator */); + var node = createBaseNode(187 /* TypeOperator */); node.operator = operator; node.type = parenthesizerRules().parenthesizeMemberOfElementType(type); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21832,7 +21070,7 @@ var ts; } // @api function createIndexedAccessTypeNode(objectType, indexType) { - var node = createBaseNode(189 /* IndexedAccessType */); + var node = createBaseNode(188 /* IndexedAccessType */); node.objectType = parenthesizerRules().parenthesizeMemberOfElementType(objectType); node.indexType = indexType; node.transformFlags = 1 /* ContainsTypeScript */; @@ -21846,29 +21084,27 @@ var ts; : node; } // @api - function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type) { - var node = createBaseNode(190 /* MappedType */); + function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { + var node = createBaseNode(189 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; - node.nameType = nameType; node.questionToken = questionToken; node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; } // @api - function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type) { + function updateMappedTypeNode(node, readonlyToken, typeParameter, questionToken, type) { return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter - || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type - ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), node) + ? update(createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), node) : node; } // @api function createLiteralTypeNode(literal) { - var node = createBaseNode(191 /* LiteralType */); + var node = createBaseNode(190 /* LiteralType */); node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21884,7 +21120,7 @@ var ts; // // @api function createObjectBindingPattern(elements) { - var node = createBaseNode(196 /* ObjectBindingPattern */); + var node = createBaseNode(193 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | @@ -21905,7 +21141,7 @@ var ts; } // @api function createArrayBindingPattern(elements) { - var node = createBaseNode(197 /* ArrayBindingPattern */); + var node = createBaseNode(194 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | @@ -21921,7 +21157,7 @@ var ts; } // @api function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createBaseBindingLikeDeclaration(198 /* BindingElement */, + var node = createBaseBindingLikeDeclaration(195 /* BindingElement */, /*decorators*/ undefined, /*modifiers*/ undefined, name, initializer); node.propertyName = asName(propertyName); @@ -21957,7 +21193,7 @@ var ts; } // @api function createArrayLiteralExpression(elements, multiLine) { - var node = createBaseExpression(199 /* ArrayLiteralExpression */); + var node = createBaseExpression(196 /* ArrayLiteralExpression */); node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(elements)); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.elements); @@ -21971,7 +21207,7 @@ var ts; } // @api function createObjectLiteralExpression(properties, multiLine) { - var node = createBaseExpression(200 /* ObjectLiteralExpression */); + var node = createBaseExpression(197 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); @@ -21985,7 +21221,7 @@ var ts; } // @api function createPropertyAccessExpression(expression, name) { - var node = createBaseExpression(201 /* PropertyAccessExpression */); + var node = createBaseExpression(198 /* PropertyAccessExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.name = asName(name); node.transformFlags = @@ -22014,7 +21250,7 @@ var ts; } // @api function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createBaseExpression(201 /* PropertyAccessExpression */); + var node = createBaseExpression(198 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -22041,7 +21277,7 @@ var ts; } // @api function createElementAccessExpression(expression, index) { - var node = createBaseExpression(202 /* ElementAccessExpression */); + var node = createBaseExpression(199 /* ElementAccessExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.argumentExpression = asExpression(index); node.transformFlags |= @@ -22068,7 +21304,7 @@ var ts; } // @api function createElementAccessChain(expression, questionDotToken, index) { - var node = createBaseExpression(202 /* ElementAccessExpression */); + var node = createBaseExpression(199 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -22093,7 +21329,7 @@ var ts; } // @api function createCallExpression(expression, typeArguments, argumentsArray) { - var node = createBaseExpression(203 /* CallExpression */); + var node = createBaseExpression(200 /* CallExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)); @@ -22125,7 +21361,7 @@ var ts; } // @api function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createBaseExpression(203 /* CallExpression */); + var node = createBaseExpression(200 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -22157,7 +21393,7 @@ var ts; } // @api function createNewExpression(expression, typeArguments, argumentsArray) { - var node = createBaseExpression(204 /* NewExpression */); + var node = createBaseExpression(201 /* NewExpression */); node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : undefined; @@ -22181,7 +21417,7 @@ var ts; } // @api function createTaggedTemplateExpression(tag, typeArguments, template) { - var node = createBaseExpression(205 /* TaggedTemplateExpression */); + var node = createBaseExpression(202 /* TaggedTemplateExpression */); node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag); node.typeArguments = asNodeArray(typeArguments); node.template = template; @@ -22208,7 +21444,7 @@ var ts; } // @api function createTypeAssertion(type, expression) { - var node = createBaseExpression(206 /* TypeAssertionExpression */); + var node = createBaseExpression(203 /* TypeAssertionExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.type = type; node.transformFlags |= @@ -22226,7 +21462,7 @@ var ts; } // @api function createParenthesizedExpression(expression) { - var node = createBaseExpression(207 /* ParenthesizedExpression */); + var node = createBaseExpression(204 /* ParenthesizedExpression */); node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); return node; @@ -22239,7 +21475,7 @@ var ts; } // @api function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(208 /* FunctionExpression */, + var node = createBaseFunctionLikeDeclaration(205 /* FunctionExpression */, /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; node.transformFlags |= propagateChildFlags(node.asteriskToken); @@ -22273,7 +21509,7 @@ var ts; } // @api function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createBaseFunctionLikeDeclaration(209 /* ArrowFunction */, + var node = createBaseFunctionLikeDeclaration(206 /* ArrowFunction */, /*decorators*/ undefined, modifiers, /*name*/ undefined, typeParameters, parameters, type, parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body)); node.equalsGreaterThanToken = equalsGreaterThanToken !== null && equalsGreaterThanToken !== void 0 ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */); @@ -22298,7 +21534,7 @@ var ts; } // @api function createDeleteExpression(expression) { - var node = createBaseExpression(210 /* DeleteExpression */); + var node = createBaseExpression(207 /* DeleteExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22311,7 +21547,7 @@ var ts; } // @api function createTypeOfExpression(expression) { - var node = createBaseExpression(211 /* TypeOfExpression */); + var node = createBaseExpression(208 /* TypeOfExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22324,7 +21560,7 @@ var ts; } // @api function createVoidExpression(expression) { - var node = createBaseExpression(212 /* VoidExpression */); + var node = createBaseExpression(209 /* VoidExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22337,7 +21573,7 @@ var ts; } // @api function createAwaitExpression(expression) { - var node = createBaseExpression(213 /* AwaitExpression */); + var node = createBaseExpression(210 /* AwaitExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22354,7 +21590,7 @@ var ts; } // @api function createPrefixUnaryExpression(operator, operand) { - var node = createBaseExpression(214 /* PrefixUnaryExpression */); + var node = createBaseExpression(211 /* PrefixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand); node.transformFlags |= propagateChildFlags(node.operand); @@ -22368,7 +21604,7 @@ var ts; } // @api function createPostfixUnaryExpression(operand, operator) { - var node = createBaseExpression(215 /* PostfixUnaryExpression */); + var node = createBaseExpression(212 /* PostfixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand); node.transformFlags = propagateChildFlags(node.operand); @@ -22382,7 +21618,7 @@ var ts; } // @api function createBinaryExpression(left, operator, right) { - var node = createBaseExpression(216 /* BinaryExpression */); + var node = createBaseExpression(213 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left); @@ -22400,14 +21636,12 @@ var ts; node.transformFlags |= 256 /* ContainsES2015 */ | 32 /* ContainsES2018 */ | - 1024 /* ContainsDestructuringAssignment */ | - propagateAssignmentPatternFlags(node.left); + 1024 /* ContainsDestructuringAssignment */; } else if (ts.isArrayLiteralExpression(node.left)) { node.transformFlags |= 256 /* ContainsES2015 */ | - 1024 /* ContainsDestructuringAssignment */ | - propagateAssignmentPatternFlags(node.left); + 1024 /* ContainsDestructuringAssignment */; } } else if (operatorKind === 42 /* AsteriskAsteriskToken */ || operatorKind === 66 /* AsteriskAsteriskEqualsToken */) { @@ -22418,29 +21652,6 @@ var ts; } return node; } - function propagateAssignmentPatternFlags(node) { - if (node.transformFlags & 16384 /* ContainsObjectRestOrSpread */) - return 16384 /* ContainsObjectRestOrSpread */; - if (node.transformFlags & 32 /* ContainsES2018 */) { - // check for nested spread assignments, otherwise '{ x: { a, ...b } = foo } = c' - // will not be correctly interpreted by the ES2018 transformer - for (var _i = 0, _a = ts.getElementsOfBindingOrAssignmentPattern(node); _i < _a.length; _i++) { - var element = _a[_i]; - var target = ts.getTargetOfBindingOrAssignmentElement(element); - if (target && ts.isAssignmentPattern(target)) { - if (target.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { - return 16384 /* ContainsObjectRestOrSpread */; - } - if (target.transformFlags & 32 /* ContainsES2018 */) { - var flags_1 = propagateAssignmentPatternFlags(target); - if (flags_1) - return flags_1; - } - } - } - } - return 0 /* None */; - } // @api function updateBinaryExpression(node, left, operator, right) { return node.left !== left @@ -22451,7 +21662,7 @@ var ts; } // @api function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { - var node = createBaseExpression(217 /* ConditionalExpression */); + var node = createBaseExpression(214 /* ConditionalExpression */); node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); node.questionToken = questionToken !== null && questionToken !== void 0 ? questionToken : createToken(57 /* QuestionToken */); node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); @@ -22477,7 +21688,7 @@ var ts; } // @api function createTemplateExpression(head, templateSpans) { - var node = createBaseExpression(218 /* TemplateExpression */); + var node = createBaseExpression(215 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); node.transformFlags |= @@ -22547,7 +21758,7 @@ var ts; // @api function createYieldExpression(asteriskToken, expression) { ts.Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression."); - var node = createBaseExpression(219 /* YieldExpression */); + var node = createBaseExpression(216 /* YieldExpression */); node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.asteriskToken = asteriskToken; node.transformFlags |= @@ -22567,7 +21778,7 @@ var ts; } // @api function createSpreadElement(expression) { - var node = createBaseExpression(220 /* SpreadElement */); + var node = createBaseExpression(217 /* SpreadElement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22583,7 +21794,7 @@ var ts; } // @api function createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseClassLikeDeclaration(221 /* ClassExpression */, decorators, modifiers, name, typeParameters, heritageClauses, members); + var node = createBaseClassLikeDeclaration(218 /* ClassExpression */, decorators, modifiers, name, typeParameters, heritageClauses, members); node.transformFlags |= 256 /* ContainsES2015 */; return node; } @@ -22600,11 +21811,11 @@ var ts; } // @api function createOmittedExpression() { - return createBaseExpression(222 /* OmittedExpression */); + return createBaseExpression(219 /* OmittedExpression */); } // @api function createExpressionWithTypeArguments(expression, typeArguments) { - var node = createBaseNode(223 /* ExpressionWithTypeArguments */); + var node = createBaseNode(220 /* ExpressionWithTypeArguments */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.transformFlags |= @@ -22622,7 +21833,7 @@ var ts; } // @api function createAsExpression(expression, type) { - var node = createBaseExpression(224 /* AsExpression */); + var node = createBaseExpression(221 /* AsExpression */); node.expression = expression; node.type = type; node.transformFlags |= @@ -22640,7 +21851,7 @@ var ts; } // @api function createNonNullExpression(expression) { - var node = createBaseExpression(225 /* NonNullExpression */); + var node = createBaseExpression(222 /* NonNullExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22658,7 +21869,7 @@ var ts; } // @api function createNonNullChain(expression) { - var node = createBaseExpression(225 /* NonNullExpression */); + var node = createBaseExpression(222 /* NonNullExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= @@ -22675,7 +21886,7 @@ var ts; } // @api function createMetaProperty(keywordToken, name) { - var node = createBaseExpression(226 /* MetaProperty */); + var node = createBaseExpression(223 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; node.transformFlags |= propagateChildFlags(node.name); @@ -22702,7 +21913,7 @@ var ts; // // @api function createTemplateSpan(expression, literal) { - var node = createBaseNode(228 /* TemplateSpan */); + var node = createBaseNode(225 /* TemplateSpan */); node.expression = expression; node.literal = literal; node.transformFlags |= @@ -22720,7 +21931,7 @@ var ts; } // @api function createSemicolonClassElement() { - var node = createBaseNode(229 /* SemicolonClassElement */); + var node = createBaseNode(226 /* SemicolonClassElement */); node.transformFlags |= 256 /* ContainsES2015 */; return node; } @@ -22729,7 +21940,7 @@ var ts; // // @api function createBlock(statements, multiLine) { - var node = createBaseNode(230 /* Block */); + var node = createBaseNode(227 /* Block */); node.statements = createNodeArray(statements); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); @@ -22743,7 +21954,7 @@ var ts; } // @api function createVariableStatement(modifiers, declarationList) { - var node = createBaseDeclaration(232 /* VariableStatement */, /*decorators*/ undefined, modifiers); + var node = createBaseDeclaration(229 /* VariableStatement */, /*decorators*/ undefined, modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; node.transformFlags |= propagateChildFlags(node.declarationList); @@ -22761,11 +21972,11 @@ var ts; } // @api function createEmptyStatement() { - return createBaseNode(231 /* EmptyStatement */); + return createBaseNode(228 /* EmptyStatement */); } // @api function createExpressionStatement(expression) { - var node = createBaseNode(233 /* ExpressionStatement */); + var node = createBaseNode(230 /* ExpressionStatement */); node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22778,7 +21989,7 @@ var ts; } // @api function createIfStatement(expression, thenStatement, elseStatement) { - var node = createBaseNode(234 /* IfStatement */); + var node = createBaseNode(231 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -22798,7 +22009,7 @@ var ts; } // @api function createDoStatement(statement, expression) { - var node = createBaseNode(235 /* DoStatement */); + var node = createBaseNode(232 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; node.transformFlags |= @@ -22815,7 +22026,7 @@ var ts; } // @api function createWhileStatement(expression, statement) { - var node = createBaseNode(236 /* WhileStatement */); + var node = createBaseNode(233 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22832,7 +22043,7 @@ var ts; } // @api function createForStatement(initializer, condition, incrementor, statement) { - var node = createBaseNode(237 /* ForStatement */); + var node = createBaseNode(234 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -22855,7 +22066,7 @@ var ts; } // @api function createForInStatement(initializer, expression, statement) { - var node = createBaseNode(238 /* ForInStatement */); + var node = createBaseNode(235 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -22875,7 +22086,7 @@ var ts; } // @api function createForOfStatement(awaitModifier, initializer, expression, statement) { - var node = createBaseNode(239 /* ForOfStatement */); + var node = createBaseNode(236 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); @@ -22901,7 +22112,7 @@ var ts; } // @api function createContinueStatement(label) { - var node = createBaseNode(240 /* ContinueStatement */); + var node = createBaseNode(237 /* ContinueStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | @@ -22916,7 +22127,7 @@ var ts; } // @api function createBreakStatement(label) { - var node = createBaseNode(241 /* BreakStatement */); + var node = createBaseNode(238 /* BreakStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | @@ -22931,7 +22142,7 @@ var ts; } // @api function createReturnStatement(expression) { - var node = createBaseNode(242 /* ReturnStatement */); + var node = createBaseNode(239 /* ReturnStatement */); node.expression = expression; // return in an ES2018 async generator must be awaited node.transformFlags |= @@ -22948,7 +22159,7 @@ var ts; } // @api function createWithStatement(expression, statement) { - var node = createBaseNode(243 /* WithStatement */); + var node = createBaseNode(240 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22965,7 +22176,7 @@ var ts; } // @api function createSwitchStatement(expression, caseBlock) { - var node = createBaseNode(244 /* SwitchStatement */); + var node = createBaseNode(241 /* SwitchStatement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.caseBlock = caseBlock; node.transformFlags |= @@ -22982,7 +22193,7 @@ var ts; } // @api function createLabeledStatement(label, statement) { - var node = createBaseNode(245 /* LabeledStatement */); + var node = createBaseNode(242 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22999,7 +22210,7 @@ var ts; } // @api function createThrowStatement(expression) { - var node = createBaseNode(246 /* ThrowStatement */); + var node = createBaseNode(243 /* ThrowStatement */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -23012,7 +22223,7 @@ var ts; } // @api function createTryStatement(tryBlock, catchClause, finallyBlock) { - var node = createBaseNode(247 /* TryStatement */); + var node = createBaseNode(244 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -23032,11 +22243,11 @@ var ts; } // @api function createDebuggerStatement() { - return createBaseNode(248 /* DebuggerStatement */); + return createBaseNode(245 /* DebuggerStatement */); } // @api function createVariableDeclaration(name, exclamationToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(249 /* VariableDeclaration */, + var node = createBaseVariableLikeDeclaration(246 /* VariableDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); node.exclamationToken = exclamationToken; @@ -23058,7 +22269,7 @@ var ts; // @api function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createBaseNode(250 /* VariableDeclarationList */); + var node = createBaseNode(247 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); node.transformFlags |= @@ -23079,7 +22290,7 @@ var ts; } // @api function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(251 /* FunctionDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); + var node = createBaseFunctionLikeDeclaration(248 /* FunctionDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; if (!node.body || ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; @@ -23117,7 +22328,7 @@ var ts; } // @api function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseClassLikeDeclaration(252 /* ClassDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses, members); + var node = createBaseClassLikeDeclaration(249 /* ClassDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses, members); if (ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } @@ -23142,7 +22353,7 @@ var ts; } // @api function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseInterfaceOrClassLikeDeclaration(253 /* InterfaceDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses); + var node = createBaseInterfaceOrClassLikeDeclaration(250 /* InterfaceDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -23160,7 +22371,7 @@ var ts; } // @api function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createBaseGenericNamedDeclaration(254 /* TypeAliasDeclaration */, decorators, modifiers, name, typeParameters); + var node = createBaseGenericNamedDeclaration(251 /* TypeAliasDeclaration */, decorators, modifiers, name, typeParameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -23177,7 +22388,7 @@ var ts; } // @api function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createBaseNamedDeclaration(255 /* EnumDeclaration */, decorators, modifiers, name); + var node = createBaseNamedDeclaration(252 /* EnumDeclaration */, decorators, modifiers, name); node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.members) | @@ -23197,7 +22408,7 @@ var ts; // @api function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createBaseDeclaration(256 /* ModuleDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(253 /* ModuleDeclaration */, decorators, modifiers); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.name = name; node.body = body; @@ -23224,7 +22435,7 @@ var ts; } // @api function createModuleBlock(statements) { - var node = createBaseNode(257 /* ModuleBlock */); + var node = createBaseNode(254 /* ModuleBlock */); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); return node; @@ -23237,7 +22448,7 @@ var ts; } // @api function createCaseBlock(clauses) { - var node = createBaseNode(258 /* CaseBlock */); + var node = createBaseNode(255 /* CaseBlock */); node.clauses = createNodeArray(clauses); node.transformFlags |= propagateChildrenFlags(node.clauses); return node; @@ -23250,7 +22461,7 @@ var ts; } // @api function createNamespaceExportDeclaration(name) { - var node = createBaseNamedDeclaration(259 /* NamespaceExportDeclaration */, + var node = createBaseNamedDeclaration(256 /* NamespaceExportDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.transformFlags = 1 /* ContainsTypeScript */; @@ -23264,7 +22475,7 @@ var ts; } // @api function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createBaseNamedDeclaration(260 /* ImportEqualsDeclaration */, decorators, modifiers, name); + var node = createBaseNamedDeclaration(257 /* ImportEqualsDeclaration */, decorators, modifiers, name); node.moduleReference = moduleReference; node.transformFlags |= propagateChildFlags(node.moduleReference); if (!ts.isExternalModuleReference(node.moduleReference)) @@ -23283,7 +22494,7 @@ var ts; } // @api function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createBaseDeclaration(261 /* ImportDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(258 /* ImportDeclaration */, decorators, modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; node.transformFlags |= @@ -23303,7 +22514,7 @@ var ts; } // @api function createImportClause(isTypeOnly, name, namedBindings) { - var node = createBaseNode(262 /* ImportClause */); + var node = createBaseNode(259 /* ImportClause */); node.isTypeOnly = isTypeOnly; node.name = name; node.namedBindings = namedBindings; @@ -23326,7 +22537,7 @@ var ts; } // @api function createNamespaceImport(name) { - var node = createBaseNode(263 /* NamespaceImport */); + var node = createBaseNode(260 /* NamespaceImport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23340,7 +22551,7 @@ var ts; } // @api function createNamespaceExport(name) { - var node = createBaseNode(269 /* NamespaceExport */); + var node = createBaseNode(266 /* NamespaceExport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name) | @@ -23356,7 +22567,7 @@ var ts; } // @api function createNamedImports(elements) { - var node = createBaseNode(264 /* NamedImports */); + var node = createBaseNode(261 /* NamedImports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23370,7 +22581,7 @@ var ts; } // @api function createImportSpecifier(propertyName, name) { - var node = createBaseNode(265 /* ImportSpecifier */); + var node = createBaseNode(262 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; node.transformFlags |= @@ -23388,7 +22599,7 @@ var ts; } // @api function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createBaseDeclaration(266 /* ExportAssignment */, decorators, modifiers); + var node = createBaseDeclaration(263 /* ExportAssignment */, decorators, modifiers); node.isExportEquals = isExportEquals; node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary(62 /* EqualsToken */, /*leftSide*/ undefined, expression) @@ -23407,7 +22618,7 @@ var ts; } // @api function createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier) { - var node = createBaseDeclaration(267 /* ExportDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(264 /* ExportDeclaration */, decorators, modifiers); node.isTypeOnly = isTypeOnly; node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; @@ -23429,7 +22640,7 @@ var ts; } // @api function createNamedExports(elements) { - var node = createBaseNode(268 /* NamedExports */); + var node = createBaseNode(265 /* NamedExports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23443,7 +22654,7 @@ var ts; } // @api function createExportSpecifier(propertyName, name) { - var node = createBaseNode(270 /* ExportSpecifier */); + var node = createBaseNode(267 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); node.transformFlags |= @@ -23461,7 +22672,7 @@ var ts; } // @api function createMissingDeclaration() { - var node = createBaseDeclaration(271 /* MissingDeclaration */, + var node = createBaseDeclaration(268 /* MissingDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined); return node; @@ -23471,7 +22682,7 @@ var ts; // // @api function createExternalModuleReference(expression) { - var node = createBaseNode(272 /* ExternalModuleReference */); + var node = createBaseNode(269 /* ExternalModuleReference */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23516,7 +22727,7 @@ var ts; } // @api function createJSDocFunctionType(parameters, type) { - var node = createBaseSignatureDeclaration(308 /* JSDocFunctionType */, + var node = createBaseSignatureDeclaration(304 /* JSDocFunctionType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, @@ -23533,7 +22744,7 @@ var ts; // @api function createJSDocTypeLiteral(propertyTags, isArrayType) { if (isArrayType === void 0) { isArrayType = false; } - var node = createBaseNode(312 /* JSDocTypeLiteral */); + var node = createBaseNode(308 /* JSDocTypeLiteral */); node.jsDocPropertyTags = asNodeArray(propertyTags); node.isArrayType = isArrayType; return node; @@ -23547,7 +22758,7 @@ var ts; } // @api function createJSDocTypeExpression(type) { - var node = createBaseNode(301 /* JSDocTypeExpression */); + var node = createBaseNode(298 /* JSDocTypeExpression */); node.type = type; return node; } @@ -23559,7 +22770,7 @@ var ts; } // @api function createJSDocSignature(typeParameters, parameters, type) { - var node = createBaseNode(313 /* JSDocSignature */); + var node = createBaseNode(309 /* JSDocSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; @@ -23588,7 +22799,7 @@ var ts; } // @api function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { - var node = createBaseJSDocTag(330 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment); + var node = createBaseJSDocTag(326 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment); node.constraint = constraint; node.typeParameters = createNodeArray(typeParameters); return node; @@ -23605,7 +22816,7 @@ var ts; } // @api function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { - var node = createBaseJSDocTag(331 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment); + var node = createBaseJSDocTag(327 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = ts.getJSDocTypeAliasName(fullName); @@ -23623,7 +22834,7 @@ var ts; } // @api function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - var node = createBaseJSDocTag(326 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment); + var node = createBaseJSDocTag(322 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -23644,7 +22855,7 @@ var ts; } // @api function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - var node = createBaseJSDocTag(333 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment); + var node = createBaseJSDocTag(328 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -23665,7 +22876,7 @@ var ts; } // @api function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { - var node = createBaseJSDocTag(324 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment); + var node = createBaseJSDocTag(320 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = ts.getJSDocTypeAliasName(fullName); @@ -23683,7 +22894,7 @@ var ts; } // @api function createJSDocAugmentsTag(tagName, className, comment) { - var node = createBaseJSDocTag(315 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment); + var node = createBaseJSDocTag(311 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment); node.class = className; return node; } @@ -23698,37 +22909,11 @@ var ts; } // @api function createJSDocImplementsTag(tagName, className, comment) { - var node = createBaseJSDocTag(316 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment); + var node = createBaseJSDocTag(312 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment); node.class = className; return node; } // @api - function createJSDocSeeTag(tagName, name, comment) { - var node = createBaseJSDocTag(332 /* JSDocSeeTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("see"), comment); - node.name = name; - return node; - } - // @api - function updateJSDocSeeTag(node, tagName, name, comment) { - return node.tagName !== tagName - || node.name !== name - || node.comment !== comment - ? update(createJSDocSeeTag(tagName, name, comment), node) - : node; - } - // @api - function createJSDocNameReference(name) { - var node = createBaseNode(302 /* JSDocNameReference */); - node.name = name; - return node; - } - // @api - function updateJSDocNameReference(node, name) { - return node.name !== name - ? update(createJSDocNameReference(name), node) - : node; - } - // @api function updateJSDocImplementsTag(node, tagName, className, comment) { if (tagName === void 0) { tagName = getDefaultTagName(node); } return node.tagName !== tagName @@ -23789,7 +22974,7 @@ var ts; } // @api function createJSDocUnknownTag(tagName, comment) { - var node = createBaseJSDocTag(314 /* JSDocTag */, tagName, comment); + var node = createBaseJSDocTag(310 /* JSDocTag */, tagName, comment); return node; } // @api @@ -23801,7 +22986,7 @@ var ts; } // @api function createJSDocComment(comment, tags) { - var node = createBaseNode(311 /* JSDocComment */); + var node = createBaseNode(307 /* JSDocComment */); node.comment = comment; node.tags = asNodeArray(tags); return node; @@ -23818,7 +23003,7 @@ var ts; // // @api function createJsxElement(openingElement, children, closingElement) { - var node = createBaseNode(273 /* JsxElement */); + var node = createBaseNode(270 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -23839,7 +23024,7 @@ var ts; } // @api function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createBaseNode(274 /* JsxSelfClosingElement */); + var node = createBaseNode(271 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -23863,7 +23048,7 @@ var ts; } // @api function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createBaseNode(275 /* JsxOpeningElement */); + var node = createBaseNode(272 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -23887,7 +23072,7 @@ var ts; } // @api function createJsxClosingElement(tagName) { - var node = createBaseNode(276 /* JsxClosingElement */); + var node = createBaseNode(273 /* JsxClosingElement */); node.tagName = tagName; node.transformFlags |= propagateChildFlags(node.tagName) | @@ -23902,7 +23087,7 @@ var ts; } // @api function createJsxFragment(openingFragment, children, closingFragment) { - var node = createBaseNode(277 /* JsxFragment */); + var node = createBaseNode(274 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -23938,19 +23123,19 @@ var ts; } // @api function createJsxOpeningFragment() { - var node = createBaseNode(278 /* JsxOpeningFragment */); + var node = createBaseNode(275 /* JsxOpeningFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } // @api function createJsxJsxClosingFragment() { - var node = createBaseNode(279 /* JsxClosingFragment */); + var node = createBaseNode(276 /* JsxClosingFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } // @api function createJsxAttribute(name, initializer) { - var node = createBaseNode(280 /* JsxAttribute */); + var node = createBaseNode(277 /* JsxAttribute */); node.name = name; node.initializer = initializer; node.transformFlags |= @@ -23968,7 +23153,7 @@ var ts; } // @api function createJsxAttributes(properties) { - var node = createBaseNode(281 /* JsxAttributes */); + var node = createBaseNode(278 /* JsxAttributes */); node.properties = createNodeArray(properties); node.transformFlags |= propagateChildrenFlags(node.properties) | @@ -23983,7 +23168,7 @@ var ts; } // @api function createJsxSpreadAttribute(expression) { - var node = createBaseNode(282 /* JsxSpreadAttribute */); + var node = createBaseNode(279 /* JsxSpreadAttribute */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | @@ -23998,7 +23183,7 @@ var ts; } // @api function createJsxExpression(dotDotDotToken, expression) { - var node = createBaseNode(283 /* JsxExpression */); + var node = createBaseNode(280 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; node.transformFlags |= @@ -24018,7 +23203,7 @@ var ts; // // @api function createCaseClause(expression, statements) { - var node = createBaseNode(284 /* CaseClause */); + var node = createBaseNode(281 /* CaseClause */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.statements = createNodeArray(statements); node.transformFlags |= @@ -24035,7 +23220,7 @@ var ts; } // @api function createDefaultClause(statements) { - var node = createBaseNode(285 /* DefaultClause */); + var node = createBaseNode(282 /* DefaultClause */); node.statements = createNodeArray(statements); node.transformFlags = propagateChildrenFlags(node.statements); return node; @@ -24048,7 +23233,7 @@ var ts; } // @api function createHeritageClause(token, types) { - var node = createBaseNode(286 /* HeritageClause */); + var node = createBaseNode(283 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); node.transformFlags |= propagateChildrenFlags(node.types); @@ -24072,7 +23257,7 @@ var ts; } // @api function createCatchClause(variableDeclaration, block) { - var node = createBaseNode(287 /* CatchClause */); + var node = createBaseNode(284 /* CatchClause */); variableDeclaration = !ts.isString(variableDeclaration) ? variableDeclaration : createVariableDeclaration(variableDeclaration, /*exclamationToken*/ undefined, /*type*/ undefined, @@ -24098,7 +23283,7 @@ var ts; // // @api function createPropertyAssignment(name, initializer) { - var node = createBaseNamedDeclaration(288 /* PropertyAssignment */, + var node = createBaseNamedDeclaration(285 /* PropertyAssignment */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); @@ -24128,7 +23313,7 @@ var ts; } // @api function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createBaseNamedDeclaration(289 /* ShorthandPropertyAssignment */, + var node = createBaseNamedDeclaration(286 /* ShorthandPropertyAssignment */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); @@ -24160,7 +23345,7 @@ var ts; } // @api function createSpreadAssignment(expression) { - var node = createBaseNode(290 /* SpreadAssignment */); + var node = createBaseNode(287 /* SpreadAssignment */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -24179,7 +23364,7 @@ var ts; // // @api function createEnumMember(name, initializer) { - var node = createBaseNode(291 /* EnumMember */); + var node = createBaseNode(288 /* EnumMember */); node.name = asName(name); node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= @@ -24200,7 +23385,7 @@ var ts; // // @api function createSourceFile(statements, endOfFileToken, flags) { - var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */); + var node = baseFactory.createBaseSourceFileNode(294 /* SourceFile */); node.statements = createNodeArray(statements); node.endOfFileToken = endOfFileToken; node.flags |= flags; @@ -24217,7 +23402,7 @@ var ts; return node; } function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) { - var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */); + var node = baseFactory.createBaseSourceFileNode(294 /* SourceFile */); for (var p in source) { if (p === "emitNode" || ts.hasProperty(node, p) || !ts.hasProperty(source, p)) continue; @@ -24255,7 +23440,7 @@ var ts; // @api function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = createBaseNode(298 /* Bundle */); + var node = createBaseNode(295 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -24270,7 +23455,7 @@ var ts; } // @api function createUnparsedSource(prologues, syntheticReferences, texts) { - var node = createBaseNode(299 /* UnparsedSource */); + var node = createBaseNode(296 /* UnparsedSource */); node.prologues = prologues; node.syntheticReferences = syntheticReferences; node.texts = texts; @@ -24288,28 +23473,28 @@ var ts; } // @api function createUnparsedPrologue(data) { - return createBaseUnparsedNode(292 /* UnparsedPrologue */, data); + return createBaseUnparsedNode(289 /* UnparsedPrologue */, data); } // @api function createUnparsedPrepend(data, texts) { - var node = createBaseUnparsedNode(293 /* UnparsedPrepend */, data); + var node = createBaseUnparsedNode(290 /* UnparsedPrepend */, data); node.texts = texts; return node; } // @api function createUnparsedTextLike(data, internal) { - return createBaseUnparsedNode(internal ? 295 /* UnparsedInternalText */ : 294 /* UnparsedText */, data); + return createBaseUnparsedNode(internal ? 292 /* UnparsedInternalText */ : 291 /* UnparsedText */, data); } // @api function createUnparsedSyntheticReference(section) { - var node = createBaseNode(296 /* UnparsedSyntheticReference */); + var node = createBaseNode(293 /* UnparsedSyntheticReference */); node.data = section.data; node.section = section; return node; } // @api function createInputFiles() { - var node = createBaseNode(300 /* InputFiles */); + var node = createBaseNode(297 /* InputFiles */); node.javascriptText = ""; node.declarationText = ""; return node; @@ -24320,7 +23505,7 @@ var ts; // @api function createSyntheticExpression(type, isSpread, tupleNameSource) { if (isSpread === void 0) { isSpread = false; } - var node = createBaseNode(227 /* SyntheticExpression */); + var node = createBaseNode(224 /* SyntheticExpression */); node.type = type; node.isSpread = isSpread; node.tupleNameSource = tupleNameSource; @@ -24328,7 +23513,7 @@ var ts; } // @api function createSyntaxList(children) { - var node = createBaseNode(334 /* SyntaxList */); + var node = createBaseNode(329 /* SyntaxList */); node._children = children; return node; } @@ -24343,7 +23528,7 @@ var ts; */ // @api function createNotEmittedStatement(original) { - var node = createBaseNode(335 /* NotEmittedStatement */); + var node = createBaseNode(330 /* NotEmittedStatement */); node.original = original; ts.setTextRange(node, original); return node; @@ -24357,7 +23542,7 @@ var ts; */ // @api function createPartiallyEmittedExpression(expression, original) { - var node = createBaseNode(336 /* PartiallyEmittedExpression */); + var node = createBaseNode(331 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; node.transformFlags |= @@ -24385,7 +23570,7 @@ var ts; } // @api function createCommaListExpression(elements) { - var node = createBaseNode(337 /* CommaListExpression */); + var node = createBaseNode(332 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; @@ -24402,7 +23587,7 @@ var ts; */ // @api function createEndOfDeclarationMarker(original) { - var node = createBaseNode(339 /* EndOfDeclarationMarker */); + var node = createBaseNode(334 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -24413,14 +23598,14 @@ var ts; */ // @api function createMergeDeclarationMarker(original) { - var node = createBaseNode(338 /* MergeDeclarationMarker */); + var node = createBaseNode(333 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } // @api function createSyntheticReferenceExpression(expression, thisArg) { - var node = createBaseNode(340 /* SyntheticReferenceExpression */); + var node = createBaseNode(335 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= @@ -24442,7 +23627,7 @@ var ts; if (node === undefined) { return node; } - var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(297 /* SourceFile */) : + var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(294 /* SourceFile */) : ts.isIdentifier(node) ? baseFactory.createBaseIdentifierNode(78 /* Identifier */) : ts.isPrivateIdentifier(node) ? baseFactory.createBasePrivateIdentifierNode(79 /* PrivateIdentifier */) : !ts.isNodeKind(node.kind) ? baseFactory.createBaseTokenNode(node.kind) : @@ -24549,11 +23734,11 @@ var ts; } function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 207 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); - case 206 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 224 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type); - case 225 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); - case 336 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); + case 204 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); + case 203 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 221 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type); + case 222 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); + case 331 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -24607,13 +23792,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -25016,23 +24201,23 @@ var ts; } function getDefaultTagNameForKind(kind) { switch (kind) { - case 329 /* JSDocTypeTag */: return "type"; - case 327 /* JSDocReturnTag */: return "returns"; - case 328 /* JSDocThisTag */: return "this"; - case 325 /* JSDocEnumTag */: return "enum"; - case 317 /* JSDocAuthorTag */: return "author"; - case 319 /* JSDocClassTag */: return "class"; - case 320 /* JSDocPublicTag */: return "public"; - case 321 /* JSDocPrivateTag */: return "private"; - case 322 /* JSDocProtectedTag */: return "protected"; - case 323 /* JSDocReadonlyTag */: return "readonly"; - case 330 /* JSDocTemplateTag */: return "template"; - case 331 /* JSDocTypedefTag */: return "typedef"; - case 326 /* JSDocParameterTag */: return "param"; - case 333 /* JSDocPropertyTag */: return "prop"; - case 324 /* JSDocCallbackTag */: return "callback"; - case 315 /* JSDocAugmentsTag */: return "augments"; - case 316 /* JSDocImplementsTag */: return "implements"; + case 325 /* JSDocTypeTag */: return "type"; + case 323 /* JSDocReturnTag */: return "returns"; + case 324 /* JSDocThisTag */: return "this"; + case 321 /* JSDocEnumTag */: return "enum"; + case 313 /* JSDocAuthorTag */: return "author"; + case 315 /* JSDocClassTag */: return "class"; + case 316 /* JSDocPublicTag */: return "public"; + case 317 /* JSDocPrivateTag */: return "private"; + case 318 /* JSDocProtectedTag */: return "protected"; + case 319 /* JSDocReadonlyTag */: return "readonly"; + case 326 /* JSDocTemplateTag */: return "template"; + case 327 /* JSDocTypedefTag */: return "typedef"; + case 322 /* JSDocParameterTag */: return "param"; + case 328 /* JSDocPropertyTag */: return "prop"; + case 320 /* JSDocCallbackTag */: return "callback"; + case 311 /* JSDocAugmentsTag */: return "augments"; + case 312 /* JSDocImplementsTag */: return "implements"; default: return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind)); } @@ -25112,69 +24297,69 @@ var ts; */ /* @internal */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */) { + if (kind >= 171 /* FirstTypeNode */ && kind <= 192 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 199 /* ArrayLiteralExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 196 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return 546379776 /* ModuleExcludes */; - case 160 /* Parameter */: + case 159 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return 547309568 /* ArrowFunctionExcludes */; - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: return 547313664 /* FunctionExcludes */; - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 166 /* Constructor */: + case 165 /* Constructor */: return 547311616 /* ConstructorExcludes */; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return 536875008 /* PropertyExcludes */; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 128 /* AnyKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 141 /* NeverKeyword */: - case 147 /* StringKeyword */: - case 145 /* ObjectKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 140 /* NeverKeyword */: + case 146 /* StringKeyword */: + case 144 /* ObjectKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: case 113 /* VoidKeyword */: - case 159 /* TypeParameter */: - case 162 /* PropertySignature */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 158 /* TypeParameter */: + case 161 /* PropertySignature */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 287 /* CatchClause */: + case 284 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: - case 336 /* PartiallyEmittedExpression */: - case 207 /* ParenthesizedExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: + case 331 /* PartiallyEmittedExpression */: + case 204 /* ParenthesizedExpression */: case 105 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -25473,7 +24658,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = (_a = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node)))) !== null && _a !== void 0 ? _a : ts.Debug.fail("Could not determine parsed source file."); @@ -26330,11 +25515,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 157 /* QualifiedName */; + return node.kind === 156 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 158 /* ComputedPropertyName */; + return node.kind === 157 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -26369,580 +25554,572 @@ var ts; ts.isExclamationToken = isExclamationToken; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 159 /* TypeParameter */; + return node.kind === 158 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; // TODO(rbuckton): Rename to 'isParameterDeclaration' function isParameter(node) { - return node.kind === 160 /* Parameter */; + return node.kind === 159 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 161 /* Decorator */; + return node.kind === 160 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 162 /* PropertySignature */; + return node.kind === 161 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 163 /* PropertyDeclaration */; + return node.kind === 162 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 164 /* MethodSignature */; + return node.kind === 163 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 165 /* MethodDeclaration */; + return node.kind === 164 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 166 /* Constructor */; + return node.kind === 165 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 167 /* GetAccessor */; + return node.kind === 166 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 168 /* SetAccessor */; + return node.kind === 167 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 169 /* CallSignature */; + return node.kind === 168 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 170 /* ConstructSignature */; + return node.kind === 169 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 171 /* IndexSignature */; + return node.kind === 170 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 172 /* TypePredicate */; + return node.kind === 171 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 173 /* TypeReference */; + return node.kind === 172 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 174 /* FunctionType */; + return node.kind === 173 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 175 /* ConstructorType */; + return node.kind === 174 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 176 /* TypeQuery */; + return node.kind === 175 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 177 /* TypeLiteral */; + return node.kind === 176 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 178 /* ArrayType */; + return node.kind === 177 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 179 /* TupleType */; + return node.kind === 178 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isNamedTupleMember(node) { - return node.kind === 192 /* NamedTupleMember */; + return node.kind === 191 /* NamedTupleMember */; } ts.isNamedTupleMember = isNamedTupleMember; function isOptionalTypeNode(node) { - return node.kind === 180 /* OptionalType */; + return node.kind === 179 /* OptionalType */; } ts.isOptionalTypeNode = isOptionalTypeNode; function isRestTypeNode(node) { - return node.kind === 181 /* RestType */; + return node.kind === 180 /* RestType */; } ts.isRestTypeNode = isRestTypeNode; function isUnionTypeNode(node) { - return node.kind === 182 /* UnionType */; + return node.kind === 181 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 183 /* IntersectionType */; + return node.kind === 182 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 184 /* ConditionalType */; + return node.kind === 183 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 185 /* InferType */; + return node.kind === 184 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 186 /* ParenthesizedType */; + return node.kind === 185 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 187 /* ThisType */; + return node.kind === 186 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 188 /* TypeOperator */; + return node.kind === 187 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 189 /* IndexedAccessType */; + return node.kind === 188 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 190 /* MappedType */; + return node.kind === 189 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 191 /* LiteralType */; + return node.kind === 190 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 195 /* ImportType */; + return node.kind === 192 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; - function isTemplateLiteralTypeSpan(node) { - return node.kind === 194 /* TemplateLiteralTypeSpan */; - } - ts.isTemplateLiteralTypeSpan = isTemplateLiteralTypeSpan; - function isTemplateLiteralTypeNode(node) { - return node.kind === 193 /* TemplateLiteralType */; - } - ts.isTemplateLiteralTypeNode = isTemplateLiteralTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 196 /* ObjectBindingPattern */; + return node.kind === 193 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 197 /* ArrayBindingPattern */; + return node.kind === 194 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 198 /* BindingElement */; + return node.kind === 195 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 199 /* ArrayLiteralExpression */; + return node.kind === 196 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 200 /* ObjectLiteralExpression */; + return node.kind === 197 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 201 /* PropertyAccessExpression */; + return node.kind === 198 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 202 /* ElementAccessExpression */; + return node.kind === 199 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 203 /* CallExpression */; + return node.kind === 200 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 204 /* NewExpression */; + return node.kind === 201 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 205 /* TaggedTemplateExpression */; + return node.kind === 202 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertionExpression(node) { - return node.kind === 206 /* TypeAssertionExpression */; + return node.kind === 203 /* TypeAssertionExpression */; } ts.isTypeAssertionExpression = isTypeAssertionExpression; function isParenthesizedExpression(node) { - return node.kind === 207 /* ParenthesizedExpression */; + return node.kind === 204 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function isFunctionExpression(node) { - return node.kind === 208 /* FunctionExpression */; + return node.kind === 205 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 209 /* ArrowFunction */; + return node.kind === 206 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 210 /* DeleteExpression */; + return node.kind === 207 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 211 /* TypeOfExpression */; + return node.kind === 208 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 212 /* VoidExpression */; + return node.kind === 209 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 213 /* AwaitExpression */; + return node.kind === 210 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 214 /* PrefixUnaryExpression */; + return node.kind === 211 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 215 /* PostfixUnaryExpression */; + return node.kind === 212 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 216 /* BinaryExpression */; + return node.kind === 213 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 217 /* ConditionalExpression */; + return node.kind === 214 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 218 /* TemplateExpression */; + return node.kind === 215 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 219 /* YieldExpression */; + return node.kind === 216 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 220 /* SpreadElement */; + return node.kind === 217 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 221 /* ClassExpression */; + return node.kind === 218 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 222 /* OmittedExpression */; + return node.kind === 219 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 223 /* ExpressionWithTypeArguments */; + return node.kind === 220 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 224 /* AsExpression */; + return node.kind === 221 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 225 /* NonNullExpression */; + return node.kind === 222 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 226 /* MetaProperty */; + return node.kind === 223 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; function isSyntheticExpression(node) { - return node.kind === 227 /* SyntheticExpression */; + return node.kind === 224 /* SyntheticExpression */; } ts.isSyntheticExpression = isSyntheticExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 336 /* PartiallyEmittedExpression */; + return node.kind === 331 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isCommaListExpression(node) { - return node.kind === 337 /* CommaListExpression */; + return node.kind === 332 /* CommaListExpression */; } ts.isCommaListExpression = isCommaListExpression; // Misc function isTemplateSpan(node) { - return node.kind === 228 /* TemplateSpan */; + return node.kind === 225 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 229 /* SemicolonClassElement */; + return node.kind === 226 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Elements function isBlock(node) { - return node.kind === 230 /* Block */; + return node.kind === 227 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 232 /* VariableStatement */; + return node.kind === 229 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 231 /* EmptyStatement */; + return node.kind === 228 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 233 /* ExpressionStatement */; + return node.kind === 230 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 234 /* IfStatement */; + return node.kind === 231 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 235 /* DoStatement */; + return node.kind === 232 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 236 /* WhileStatement */; + return node.kind === 233 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 237 /* ForStatement */; + return node.kind === 234 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 238 /* ForInStatement */; + return node.kind === 235 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 239 /* ForOfStatement */; + return node.kind === 236 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 240 /* ContinueStatement */; + return node.kind === 237 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 241 /* BreakStatement */; + return node.kind === 238 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isReturnStatement(node) { - return node.kind === 242 /* ReturnStatement */; + return node.kind === 239 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 243 /* WithStatement */; + return node.kind === 240 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 244 /* SwitchStatement */; + return node.kind === 241 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 245 /* LabeledStatement */; + return node.kind === 242 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 246 /* ThrowStatement */; + return node.kind === 243 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 247 /* TryStatement */; + return node.kind === 244 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 248 /* DebuggerStatement */; + return node.kind === 245 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 249 /* VariableDeclaration */; + return node.kind === 246 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 250 /* VariableDeclarationList */; + return node.kind === 247 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 251 /* FunctionDeclaration */; + return node.kind === 248 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 252 /* ClassDeclaration */; + return node.kind === 249 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 253 /* InterfaceDeclaration */; + return node.kind === 250 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 254 /* TypeAliasDeclaration */; + return node.kind === 251 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 255 /* EnumDeclaration */; + return node.kind === 252 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */; + return node.kind === 253 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 257 /* ModuleBlock */; + return node.kind === 254 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 258 /* CaseBlock */; + return node.kind === 255 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 259 /* NamespaceExportDeclaration */; + return node.kind === 256 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */; + return node.kind === 257 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 261 /* ImportDeclaration */; + return node.kind === 258 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 262 /* ImportClause */; + return node.kind === 259 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 263 /* NamespaceImport */; + return node.kind === 260 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 269 /* NamespaceExport */; + return node.kind === 266 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedImports(node) { - return node.kind === 264 /* NamedImports */; + return node.kind === 261 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 265 /* ImportSpecifier */; + return node.kind === 262 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 266 /* ExportAssignment */; + return node.kind === 263 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 267 /* ExportDeclaration */; + return node.kind === 264 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 268 /* NamedExports */; + return node.kind === 265 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 270 /* ExportSpecifier */; + return node.kind === 267 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 271 /* MissingDeclaration */; + return node.kind === 268 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; function isNotEmittedStatement(node) { - return node.kind === 335 /* NotEmittedStatement */; + return node.kind === 330 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 340 /* SyntheticReferenceExpression */; + return node.kind === 335 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ function isMergeDeclarationMarker(node) { - return node.kind === 338 /* MergeDeclarationMarker */; + return node.kind === 333 /* MergeDeclarationMarker */; } ts.isMergeDeclarationMarker = isMergeDeclarationMarker; /* @internal */ function isEndOfDeclarationMarker(node) { - return node.kind === 339 /* EndOfDeclarationMarker */; + return node.kind === 334 /* EndOfDeclarationMarker */; } ts.isEndOfDeclarationMarker = isEndOfDeclarationMarker; // Module References function isExternalModuleReference(node) { - return node.kind === 272 /* ExternalModuleReference */; + return node.kind === 269 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 273 /* JsxElement */; + return node.kind === 270 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 274 /* JsxSelfClosingElement */; + return node.kind === 271 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 275 /* JsxOpeningElement */; + return node.kind === 272 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 276 /* JsxClosingElement */; + return node.kind === 273 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 277 /* JsxFragment */; + return node.kind === 274 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 278 /* JsxOpeningFragment */; + return node.kind === 275 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 279 /* JsxClosingFragment */; + return node.kind === 276 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 280 /* JsxAttribute */; + return node.kind === 277 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 281 /* JsxAttributes */; + return node.kind === 278 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 282 /* JsxSpreadAttribute */; + return node.kind === 279 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 283 /* JsxExpression */; + return node.kind === 280 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 284 /* CaseClause */; + return node.kind === 281 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 285 /* DefaultClause */; + return node.kind === 282 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 286 /* HeritageClause */; + return node.kind === 283 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 287 /* CatchClause */; + return node.kind === 284 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 288 /* PropertyAssignment */; + return node.kind === 285 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 289 /* ShorthandPropertyAssignment */; + return node.kind === 286 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 290 /* SpreadAssignment */; + return node.kind === 287 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 291 /* EnumMember */; + return node.kind === 288 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Unparsed // TODO(rbuckton): isUnparsedPrologue function isUnparsedPrepend(node) { - return node.kind === 293 /* UnparsedPrepend */; + return node.kind === 290 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; // TODO(rbuckton): isUnparsedText @@ -26950,152 +26127,148 @@ var ts; // TODO(rbuckton): isUnparsedSyntheticReference // Top-level nodes function isSourceFile(node) { - return node.kind === 297 /* SourceFile */; + return node.kind === 294 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 298 /* Bundle */; + return node.kind === 295 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 299 /* UnparsedSource */; + return node.kind === 296 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; // TODO(rbuckton): isInputFiles // JSDoc Elements function isJSDocTypeExpression(node) { - return node.kind === 301 /* JSDocTypeExpression */; + return node.kind === 298 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; - function isJSDocNameReference(node) { - return node.kind === 302 /* JSDocNameReference */; - } - ts.isJSDocNameReference = isJSDocNameReference; function isJSDocAllType(node) { - return node.kind === 303 /* JSDocAllType */; + return node.kind === 299 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 304 /* JSDocUnknownType */; + return node.kind === 300 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 305 /* JSDocNullableType */; + return node.kind === 301 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 306 /* JSDocNonNullableType */; + return node.kind === 302 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 307 /* JSDocOptionalType */; + return node.kind === 303 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 308 /* JSDocFunctionType */; + return node.kind === 304 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 309 /* JSDocVariadicType */; + return node.kind === 305 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDocNamepathType(node) { - return node.kind === 310 /* JSDocNamepathType */; + return node.kind === 306 /* JSDocNamepathType */; } ts.isJSDocNamepathType = isJSDocNamepathType; function isJSDoc(node) { - return node.kind === 311 /* JSDocComment */; + return node.kind === 307 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocTypeLiteral(node) { - return node.kind === 312 /* JSDocTypeLiteral */; + return node.kind === 308 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocSignature(node) { - return node.kind === 313 /* JSDocSignature */; + return node.kind === 309 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // JSDoc Tags function isJSDocAugmentsTag(node) { - return node.kind === 315 /* JSDocAugmentsTag */; + return node.kind === 311 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocAuthorTag(node) { - return node.kind === 317 /* JSDocAuthorTag */; + return node.kind === 313 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocClassTag(node) { - return node.kind === 319 /* JSDocClassTag */; + return node.kind === 315 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocCallbackTag(node) { - return node.kind === 324 /* JSDocCallbackTag */; + return node.kind === 320 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocPublicTag(node) { - return node.kind === 320 /* JSDocPublicTag */; + return node.kind === 316 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 321 /* JSDocPrivateTag */; + return node.kind === 317 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 322 /* JSDocProtectedTag */; + return node.kind === 318 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 323 /* JSDocReadonlyTag */; + return node.kind === 319 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocDeprecatedTag(node) { - return node.kind === 318 /* JSDocDeprecatedTag */; + return node.kind === 314 /* JSDocDeprecatedTag */; } ts.isJSDocDeprecatedTag = isJSDocDeprecatedTag; function isJSDocEnumTag(node) { - return node.kind === 325 /* JSDocEnumTag */; + return node.kind === 321 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocParameterTag(node) { - return node.kind === 326 /* JSDocParameterTag */; + return node.kind === 322 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 327 /* JSDocReturnTag */; + return node.kind === 323 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocThisTag(node) { - return node.kind === 328 /* JSDocThisTag */; + return node.kind === 324 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocTypeTag(node) { - return node.kind === 329 /* JSDocTypeTag */; + return node.kind === 325 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 330 /* JSDocTemplateTag */; + return node.kind === 326 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 331 /* JSDocTypedefTag */; + return node.kind === 327 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocUnknownTag(node) { - return node.kind === 314 /* JSDocTag */; + return node.kind === 310 /* JSDocTag */; } ts.isJSDocUnknownTag = isJSDocUnknownTag; function isJSDocPropertyTag(node) { - return node.kind === 333 /* JSDocPropertyTag */; + return node.kind === 328 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocImplementsTag(node) { - return node.kind === 316 /* JSDocImplementsTag */; + return node.kind === 312 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; // Synthesized list /* @internal */ function isSyntaxList(n) { - return n.kind === 334 /* SyntaxList */; + return n.kind === 329 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; })(ts || (ts = {})); @@ -27146,13 +26319,12 @@ var ts; createJsxFactoryExpressionFromEntityName(factory, jsxFactoryEntity, parent) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), "createElement"); } - ts.createJsxFactoryExpression = createJsxFactoryExpression; function createJsxFragmentFactoryExpression(factory, jsxFragmentFactoryEntity, reactNamespace, parent) { return jsxFragmentFactoryEntity ? createJsxFactoryExpressionFromEntityName(factory, jsxFragmentFactoryEntity, parent) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), "Fragment"); } - function createExpressionForJsxElement(factory, callee, tagName, props, children, location) { + function createExpressionForJsxElement(factory, jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { var argumentsList = [tagName]; if (props) { argumentsList.push(props); @@ -27172,7 +26344,7 @@ var ts; argumentsList.push(children[0]); } } - return ts.setTextRange(factory.createCallExpression(callee, + return ts.setTextRange(factory.createCallExpression(createJsxFactoryExpression(factory, jsxFactoryEntity, reactNamespace, parentElement), /*typeArguments*/ undefined, argumentsList), location); } ts.createExpressionForJsxElement = createExpressionForJsxElement; @@ -27294,14 +26466,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return createExpressionForAccessorDeclaration(factory, node.properties, property, receiver, !!node.multiLine); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return createExpressionForPropertyAssignment(factory, property, receiver); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(factory, property, receiver); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return createExpressionForMethodDeclaration(factory, property, receiver); } } @@ -27354,21 +26526,21 @@ var ts; } ts.startsWithUseStrict = startsWithUseStrict; function isCommaSequence(node) { - return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 337 /* CommaListExpression */; + return node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 332 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 15 /* All */; } switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return (kinds & 2 /* TypeAssertions */) !== 0; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return (kinds & 4 /* NonNullAssertions */) !== 0; - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -27485,14 +26657,14 @@ var ts; */ function getLocalNameForExternalImport(factory, node, sourceFile) { var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); - if (namespaceDeclaration && !ts.isDefaultImport(node) && !ts.isExportNamespaceAsDefaultDeclaration(node)) { + if (namespaceDeclaration && !ts.isDefaultImport(node)) { var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : factory.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 261 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 258 /* ImportDeclaration */ && node.importClause) { return factory.getGeneratedNameForNode(node); } - if (node.kind === 267 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 264 /* ExportDeclaration */ && node.moduleSpecifier) { return factory.getGeneratedNameForNode(node); } return undefined; @@ -27611,7 +26783,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -27623,11 +26795,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -27659,12 +26831,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 160 /* Parameter */: - case 198 /* BindingElement */: + case 159 /* Parameter */: + case 195 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 220 /* SpreadElement */: - case 290 /* SpreadAssignment */: + case 217 /* SpreadElement */: + case 287 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -27682,7 +26854,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 198 /* BindingElement */: + case 195 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -27697,7 +26869,7 @@ var ts; : propertyName; } break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -27712,7 +26884,7 @@ var ts; : propertyName; } break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -27735,13 +26907,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -27762,29 +26934,29 @@ var ts; ts.getJSDocTypeAliasName = getJSDocTypeAliasName; function canHaveModifiers(node) { var kind = node.kind; - return kind === 160 /* Parameter */ - || kind === 162 /* PropertySignature */ - || kind === 163 /* PropertyDeclaration */ - || kind === 164 /* MethodSignature */ - || kind === 165 /* MethodDeclaration */ - || kind === 166 /* Constructor */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 171 /* IndexSignature */ - || kind === 208 /* FunctionExpression */ - || kind === 209 /* ArrowFunction */ - || kind === 221 /* ClassExpression */ - || kind === 232 /* VariableStatement */ - || kind === 251 /* FunctionDeclaration */ - || kind === 252 /* ClassDeclaration */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 255 /* EnumDeclaration */ - || kind === 256 /* ModuleDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 266 /* ExportAssignment */ - || kind === 267 /* ExportDeclaration */; + return kind === 159 /* Parameter */ + || kind === 161 /* PropertySignature */ + || kind === 162 /* PropertyDeclaration */ + || kind === 163 /* MethodSignature */ + || kind === 164 /* MethodDeclaration */ + || kind === 165 /* Constructor */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 170 /* IndexSignature */ + || kind === 205 /* FunctionExpression */ + || kind === 206 /* ArrowFunction */ + || kind === 218 /* ClassExpression */ + || kind === 229 /* VariableStatement */ + || kind === 248 /* FunctionDeclaration */ + || kind === 249 /* ClassDeclaration */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 252 /* EnumDeclaration */ + || kind === 253 /* ModuleDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 263 /* ExportAssignment */ + || kind === 264 /* ExportDeclaration */; } ts.canHaveModifiers = canHaveModifiers; /* @internal */ @@ -27883,19 +27055,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 156 /* LastToken */) { + if (!node || node.kind <= 155 /* LastToken */) { return; } switch (node.kind) { - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -27903,9 +27075,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -27913,7 +27085,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -27921,51 +27093,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -27977,374 +27149,364 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 179 /* TupleType */: + case 178 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elements); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 185 /* InferType */: + case 184 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 195 /* ImportType */: + case 192 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 186 /* ParenthesizedType */: - case 188 /* TypeOperator */: + case 185 /* ParenthesizedType */: + case 187 /* TypeOperator */: return visitNode(cbNode, node.type); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 190 /* MappedType */: + case 189 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || - visitNode(cbNode, node.nameType) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return visitNode(cbNode, node.literal); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 224 /* AsExpression */: + case 221 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return visitNode(cbNode, node.name); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 297 /* SourceFile */: + case 294 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: return visitNode(cbNode, node.label); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 284 /* CaseClause */: + case 281 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 161 /* Decorator */: + case 160 /* Decorator */: return visitNode(cbNode, node.expression); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 291 /* EnumMember */: + case 288 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 264 /* NamedImports */: - case 268 /* NamedExports */: + case 261 /* NamedImports */: + case 265 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 193 /* TemplateLiteralType */: - return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 194 /* TemplateLiteralTypeSpan */: - return visitNode(cbNode, node.type) || visitNode(cbNode, node.literal); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 180 /* OptionalType */: - case 181 /* RestType */: - case 301 /* JSDocTypeExpression */: - case 306 /* JSDocNonNullableType */: - case 305 /* JSDocNullableType */: - case 307 /* JSDocOptionalType */: - case 309 /* JSDocVariadicType */: + case 179 /* OptionalType */: + case 180 /* RestType */: + case 298 /* JSDocTypeExpression */: + case 302 /* JSDocNonNullableType */: + case 301 /* JSDocNullableType */: + case 303 /* JSDocOptionalType */: + case 305 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 311 /* JSDocComment */: + case 307 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 332 /* JSDocSeeTag */: - return visitNode(cbNode, node.tagName) || - visitNode(cbNode, node.name); - case 302 /* JSDocNameReference */: - return visitNode(cbNode, node.name); - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 317 /* JSDocAuthorTag */: + case 313 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 301 /* JSDocTypeExpression */ + node.typeExpression.kind === 298 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 324 /* JSDocCallbackTag */: + case 320 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 328 /* JSDocThisTag */: - case 325 /* JSDocEnumTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 324 /* JSDocThisTag */: + case 321 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 313 /* JSDocSignature */: + case 309 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 312 /* JSDocTypeLiteral */: + case 308 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 314 /* JSDocTag */: - case 319 /* JSDocClassTag */: - case 320 /* JSDocPublicTag */: - case 321 /* JSDocPrivateTag */: - case 322 /* JSDocProtectedTag */: - case 323 /* JSDocReadonlyTag */: + case 310 /* JSDocTag */: + case 315 /* JSDocClassTag */: + case 316 /* JSDocPublicTag */: + case 317 /* JSDocPrivateTag */: + case 318 /* JSDocProtectedTag */: + case 319 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -28419,8 +27581,6 @@ var ts; ts.forEachChildRecursively = forEachChildRecursively; function createSourceFile(fileName, sourceText, languageVersion, setParentNodes, scriptKind) { if (setParentNodes === void 0) { setParentNodes = false; } - var tracingData = ["parse" /* Parse */, "createSourceFile", { path: fileName }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeParse"); var result; ts.perfLogger.logStartParseSourceFile(fileName); @@ -28433,7 +27593,6 @@ var ts; ts.perfLogger.logStopParseSourceFile(); ts.performance.mark("afterParse"); ts.performance.measure("Parse", "beforeParse", "afterParse"); - ts.tracing.end.apply(ts.tracing, tracingData); return result; } ts.createSourceFile = createSourceFile; @@ -29294,7 +28453,7 @@ var ts; ts.isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode(kind, "", "", /*templateFlags*/ undefined) : kind === 8 /* NumericLiteral */ ? factory.createNumericLiteral("", /*numericLiteralFlags*/ undefined) : kind === 10 /* StringLiteral */ ? factory.createStringLiteral("", /*isSingleQuote*/ undefined) : - kind === 271 /* MissingDeclaration */ ? factory.createMissingDeclaration() : + kind === 268 /* MissingDeclaration */ ? factory.createMissingDeclaration() : factory.createToken(kind); return finishNode(result, pos); } @@ -29408,7 +28567,7 @@ var ts; if (token() === 87 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 149 /* TypeKeyword */) { + if (token() === 148 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); @@ -29416,7 +28575,7 @@ var ts; return nextTokenCanFollowDefaultKeyword(); case 123 /* StaticKeyword */: case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -29826,14 +28985,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 166 /* Constructor */: - case 171 /* IndexSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 229 /* SemicolonClassElement */: + case 165 /* Constructor */: + case 170 /* IndexSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 226 /* SemicolonClassElement */: return true; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -29848,8 +29007,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: return true; } } @@ -29858,58 +29017,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 232 /* VariableStatement */: - case 230 /* Block */: - case 234 /* IfStatement */: - case 233 /* ExpressionStatement */: - case 246 /* ThrowStatement */: - case 242 /* ReturnStatement */: - case 244 /* SwitchStatement */: - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 237 /* ForStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 231 /* EmptyStatement */: - case 247 /* TryStatement */: - case 245 /* LabeledStatement */: - case 235 /* DoStatement */: - case 248 /* DebuggerStatement */: - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 248 /* FunctionDeclaration */: + case 229 /* VariableStatement */: + case 227 /* Block */: + case 231 /* IfStatement */: + case 230 /* ExpressionStatement */: + case 243 /* ThrowStatement */: + case 239 /* ReturnStatement */: + case 241 /* SwitchStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 234 /* ForStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 228 /* EmptyStatement */: + case 244 /* TryStatement */: + case 242 /* LabeledStatement */: + case 232 /* DoStatement */: + case 245 /* DebuggerStatement */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 291 /* EnumMember */; + return node.kind === 288 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 162 /* PropertySignature */: - case 169 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 161 /* PropertySignature */: + case 168 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 249 /* VariableDeclaration */) { + if (node.kind !== 246 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -29930,7 +29089,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 160 /* Parameter */) { + if (node.kind !== 159 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -29939,7 +29098,7 @@ var ts; } // Returns true if we should abort parsing. function abortParsingListOrMoveToNextToken(kind) { - parsingContextErrors(kind); + parseErrorAtCurrentToken(parsingContextErrors(kind)); if (isInSomeParsingContext()) { return true; } @@ -29948,34 +29107,31 @@ var ts; } function parsingContextErrors(context) { switch (context) { - case 0 /* SourceElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); - case 1 /* BlockStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); - case 2 /* SwitchClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.case_or_default_expected); - case 3 /* SwitchClauseStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Statement_expected); + case 0 /* SourceElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 1 /* BlockStatements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 2 /* SwitchClauses */: return ts.Diagnostics.case_or_default_expected; + case 3 /* SwitchClauseStatements */: return ts.Diagnostics.Statement_expected; case 18 /* RestProperties */: // fallthrough - case 4 /* TypeMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_or_signature_expected); - case 5 /* ClassMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); - case 6 /* EnumMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Enum_member_expected); - case 7 /* HeritageClauseElement */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_expected); - case 8 /* VariableDeclarations */: - return ts.isKeyword(token()) - ? parseErrorAtCurrentToken(ts.Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, ts.tokenToString(token())) - : parseErrorAtCurrentToken(ts.Diagnostics.Variable_declaration_expected); - case 9 /* ObjectBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_destructuring_pattern_expected); - case 10 /* ArrayBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Array_element_destructuring_pattern_expected); - case 11 /* ArgumentExpressions */: return parseErrorAtCurrentToken(ts.Diagnostics.Argument_expression_expected); - case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_assignment_expected); - case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_or_comma_expected); - case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); - case 16 /* Parameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); - case 19 /* TypeParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_parameter_declaration_expected); - case 20 /* TypeArguments */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_argument_expected); - case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_expected); - case 22 /* HeritageClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_expected); - case 23 /* ImportOrExportSpecifiers */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - case 13 /* JsxAttributes */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - case 14 /* JsxChildren */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - default: return [undefined]; // TODO: GH#18217 `default: Debug.assertNever(context);` + case 4 /* TypeMembers */: return ts.Diagnostics.Property_or_signature_expected; + case 5 /* ClassMembers */: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 6 /* EnumMembers */: return ts.Diagnostics.Enum_member_expected; + case 7 /* HeritageClauseElement */: return ts.Diagnostics.Expression_expected; + case 8 /* VariableDeclarations */: return ts.Diagnostics.Variable_declaration_expected; + case 9 /* ObjectBindingElements */: return ts.Diagnostics.Property_destructuring_pattern_expected; + case 10 /* ArrayBindingElements */: return ts.Diagnostics.Array_element_destructuring_pattern_expected; + case 11 /* ArgumentExpressions */: return ts.Diagnostics.Argument_expression_expected; + case 12 /* ObjectLiteralMembers */: return ts.Diagnostics.Property_assignment_expected; + case 15 /* ArrayLiteralMembers */: return ts.Diagnostics.Expression_or_comma_expected; + case 17 /* JSDocParameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 16 /* Parameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 19 /* TypeParameters */: return ts.Diagnostics.Type_parameter_declaration_expected; + case 20 /* TypeArguments */: return ts.Diagnostics.Type_argument_expected; + case 21 /* TupleElementTypes */: return ts.Diagnostics.Type_expected; + case 22 /* HeritageClauses */: return ts.Diagnostics.Unexpected_token_expected; + case 23 /* ImportOrExportSpecifiers */: return ts.Diagnostics.Identifier_expected; + case 13 /* JsxAttributes */: return ts.Diagnostics.Identifier_expected; + case 14 /* JsxChildren */: return ts.Diagnostics.Identifier_expected; + default: return undefined; // TODO: GH#18217 `default: Debug.assertNever(context);` } } // Parses a comma-delimited list of elements @@ -30120,24 +29276,6 @@ var ts; var pos = getNodePos(); return finishNode(factory.createTemplateExpression(parseTemplateHead(isTaggedTemplate), parseTemplateSpans(isTaggedTemplate)), pos); } - function parseTemplateType() { - var pos = getNodePos(); - return finishNode(factory.createTemplateLiteralType(parseTemplateHead(/*isTaggedTemplate*/ false), parseTemplateTypeSpans()), pos); - } - function parseTemplateTypeSpans() { - var pos = getNodePos(); - var list = []; - var node; - do { - node = parseTemplateTypeSpan(); - list.push(node); - } while (node.literal.kind === 16 /* TemplateMiddle */); - return createNodeArray(list, pos); - } - function parseTemplateTypeSpan() { - var pos = getNodePos(); - return finishNode(factory.createTemplateLiteralTypeSpan(parseType(), parseLiteralOfTemplateSpan(/*isTaggedTemplate*/ false)), pos); - } function parseLiteralOfTemplateSpan(isTaggedTemplate) { if (token() === 19 /* CloseBraceToken */) { reScanTemplateToken(isTaggedTemplate); @@ -30211,14 +29349,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: { + case 173 /* FunctionType */: + case 174 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -30298,7 +29436,7 @@ var ts; function parseJSDocType() { scanner.setInJSDocType(true); var pos = getNodePos(); - if (parseOptional(139 /* ModuleKeyword */)) { + if (parseOptional(138 /* ModuleKeyword */)) { // TODO(rbuckton): We never set the type for a JSDocNamepathType. What should we put here? var moduleTag = factory.createJSDocNamepathType(/*type*/ undefined); terminate: while (true) { @@ -30498,14 +29636,14 @@ var ts; function parseSignatureMember(kind) { var pos = getNodePos(); var hasJSDoc = hasPrecedingJSDocComment(); - if (kind === 170 /* ConstructSignature */) { + if (kind === 169 /* ConstructSignature */) { parseExpected(102 /* NewKeyword */); } var typeParameters = parseTypeParameters(); var parameters = parseParameters(4 /* Type */); var type = parseReturnType(58 /* ColonToken */, /*isType*/ true); parseTypeMemberSemicolon(); - var node = kind === 169 /* CallSignature */ + var node = kind === 168 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, type) : factory.createConstructSignature(typeParameters, parameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -30628,10 +29766,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(169 /* CallSignature */); + return parseSignatureMember(168 /* CallSignature */); } if (token() === 102 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(170 /* ConstructSignature */); + return parseSignatureMember(169 /* ConstructSignature */); } var pos = getNodePos(); var hasJSDoc = hasPrecedingJSDocComment(); @@ -30675,9 +29813,9 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 142 /* ReadonlyKeyword */; + return nextToken() === 141 /* ReadonlyKeyword */; } - if (token() === 142 /* ReadonlyKeyword */) { + if (token() === 141 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 100 /* InKeyword */; @@ -30693,15 +29831,14 @@ var ts; var pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); var readonlyToken; - if (token() === 142 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 141 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { readonlyToken = parseTokenNode(); - if (readonlyToken.kind !== 142 /* ReadonlyKeyword */) { - parseExpected(142 /* ReadonlyKeyword */); + if (readonlyToken.kind !== 141 /* ReadonlyKeyword */) { + parseExpected(141 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); var typeParameter = parseMappedTypeParameter(); - var nameType = parseOptional(126 /* AsKeyword */) ? parseType() : undefined; parseExpected(23 /* CloseBracketToken */); var questionToken; if (token() === 57 /* QuestionToken */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { @@ -30713,7 +29850,7 @@ var ts; var type = parseTypeAnnotation(); parseSemicolon(); parseExpected(19 /* CloseBraceToken */); - return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), pos); + return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), pos); } function parseTupleElementType() { var pos = getNodePos(); @@ -30815,15 +29952,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 148 /* SymbolKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 147 /* SymbolKeyword */: case 131 /* BooleanKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: - case 145 /* ObjectKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: + case 144 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 65 /* AsteriskEqualsToken */: @@ -30856,7 +29993,7 @@ var ts; return parseTokenNode(); case 107 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 136 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -30875,8 +30012,6 @@ var ts; return parseImportType(); case 127 /* AssertsKeyword */: return lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine) ? parseAssertsTypePredicate() : parseTypeReference(); - case 15 /* TemplateHead */: - return parseTemplateType(); default: return parseTypeReference(); } @@ -30884,20 +30019,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: - case 142 /* ReadonlyKeyword */: - case 148 /* SymbolKeyword */: - case 151 /* UniqueKeyword */: + case 141 /* ReadonlyKeyword */: + case 147 /* SymbolKeyword */: + case 150 /* UniqueKeyword */: case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: case 103 /* NullKeyword */: case 107 /* ThisKeyword */: case 111 /* TypeOfKeyword */: - case 141 /* NeverKeyword */: + case 140 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -30909,7 +30044,7 @@ var ts; case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: @@ -30917,8 +30052,6 @@ var ts; case 135 /* InferKeyword */: case 99 /* ImportKeyword */: case 127 /* AssertsKeyword */: - case 14 /* NoSubstitutionTemplateLiteral */: - case 15 /* TemplateHead */: return true; case 97 /* FunctionKeyword */: return !inStartOfParameter; @@ -30990,9 +30123,9 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 138 /* KeyOfKeyword */: - case 151 /* UniqueKeyword */: - case 142 /* ReadonlyKeyword */: + case 137 /* KeyOfKeyword */: + case 150 /* UniqueKeyword */: + case 141 /* ReadonlyKeyword */: return parseTypeOperator(operator); case 135 /* InferKeyword */: return parseInferType(); @@ -31109,7 +30242,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 136 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -31118,7 +30251,7 @@ var ts; var pos = getNodePos(); var assertsModifier = parseExpectedToken(127 /* AssertsKeyword */); var parameterName = token() === 107 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - var type = parseOptional(137 /* IsKeyword */) ? parseType() : undefined; + var type = parseOptional(136 /* IsKeyword */) ? parseType() : undefined; return finishNode(factory.createTypePredicateNode(assertsModifier, parameterName, type), pos); } function parseType() { @@ -31650,7 +30783,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand, pos); } function isInOrOfKeyword(t) { - return t === 100 /* InKeyword */ || t === 156 /* OfKeyword */; + return t === 100 /* InKeyword */ || t === 155 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand, pos) { while (true) { @@ -31790,7 +30923,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 206 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 203 /* TypeAssertionExpression */) { parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -32041,7 +31174,7 @@ var ts; var pos = getNodePos(); var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 275 /* JsxOpeningElement */) { + if (opening.kind === 272 /* JsxOpeningElement */) { var children = parseJsxChildren(opening); var closingElement = parseJsxClosingElement(inExpressionContext); if (!tagNamesAreEquivalent(opening.tagName, closingElement.tagName)) { @@ -32049,11 +31182,11 @@ var ts; } result = finishNode(factory.createJsxElement(opening, children, closingElement), pos); } - else if (opening.kind === 278 /* JsxOpeningFragment */) { + else if (opening.kind === 275 /* JsxOpeningFragment */) { result = finishNode(factory.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos); } else { - ts.Debug.assert(opening.kind === 274 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 271 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -32548,10 +31681,10 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(); if (parseContextualModifier(134 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */); + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 166 /* GetAccessor */); } - if (parseContextualModifier(146 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */); + if (parseContextualModifier(145 /* SetKeyword */)) { + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -32762,7 +31895,7 @@ var ts; } } var node; - if (awaitToken ? parseExpected(156 /* OfKeyword */) : parseOptional(156 /* OfKeyword */)) { + if (awaitToken ? parseExpected(155 /* OfKeyword */) : parseOptional(155 /* OfKeyword */)) { var expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(21 /* CloseParenToken */); node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement()); @@ -32788,10 +31921,10 @@ var ts; } function parseBreakOrContinueStatement(kind) { var pos = getNodePos(); - parseExpected(kind === 241 /* BreakStatement */ ? 80 /* BreakKeyword */ : 85 /* ContinueKeyword */); + parseExpected(kind === 238 /* BreakStatement */ ? 80 /* BreakKeyword */ : 85 /* ContinueKeyword */); var label = canParseSemicolon() ? undefined : parseIdentifier(); parseSemicolon(); - var node = kind === 241 /* BreakStatement */ + var node = kind === 238 /* BreakStatement */ ? factory.createBreakStatement(label) : factory.createContinueStatement(label); return finishNode(node, pos); @@ -32970,10 +32103,10 @@ var ts; // // could be legal, it would add complexity for very little gain. case 117 /* InterfaceKeyword */: - case 149 /* TypeKeyword */: + case 148 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 125 /* AbstractKeyword */: case 129 /* AsyncKeyword */: @@ -32981,14 +32114,14 @@ var ts; case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 122 /* PublicKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 154 /* GlobalKeyword */: + case 153 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 78 /* Identifier */ || token() === 92 /* ExportKeyword */; case 99 /* ImportKeyword */: @@ -32997,7 +32130,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 92 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 149 /* TypeKeyword */) { + if (currentToken_1 === 148 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -33053,17 +32186,17 @@ var ts; case 129 /* AsyncKeyword */: case 133 /* DeclareKeyword */: case 117 /* InterfaceKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: - case 149 /* TypeKeyword */: - case 154 /* GlobalKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: + case 148 /* TypeKeyword */: + case 153 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 123 /* StaticKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -33106,9 +32239,9 @@ var ts; case 96 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 85 /* ContinueKeyword */: - return parseBreakOrContinueStatement(240 /* ContinueStatement */); + return parseBreakOrContinueStatement(237 /* ContinueStatement */); case 80 /* BreakKeyword */: - return parseBreakOrContinueStatement(241 /* BreakStatement */); + return parseBreakOrContinueStatement(238 /* BreakStatement */); case 104 /* ReturnKeyword */: return parseReturnStatement(); case 115 /* WithKeyword */: @@ -33129,9 +32262,9 @@ var ts; return parseDeclaration(); case 129 /* AsyncKeyword */: case 117 /* InterfaceKeyword */: - case 149 /* TypeKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 148 /* TypeKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: case 133 /* DeclareKeyword */: case 84 /* ConstKeyword */: case 91 /* EnumKeyword */: @@ -33142,8 +32275,8 @@ var ts; case 122 /* PublicKeyword */: case 125 /* AbstractKeyword */: case 123 /* StaticKeyword */: - case 142 /* ReadonlyKeyword */: - case 154 /* GlobalKeyword */: + case 141 /* ReadonlyKeyword */: + case 153 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -33203,13 +32336,13 @@ var ts; return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers); case 117 /* InterfaceKeyword */: return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers); - case 149 /* TypeKeyword */: + case 148 /* TypeKeyword */: return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers); case 91 /* EnumKeyword */: return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers); - case 154 /* GlobalKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 153 /* GlobalKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers); case 99 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers); @@ -33228,7 +32361,7 @@ var ts; if (decorators || modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(271 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(268 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); ts.setTextRangePos(missing, pos); missing.decorators = decorators; missing.modifiers = modifiers; @@ -33347,7 +32480,7 @@ var ts; // this context. // The checker will then give an error that there is an empty declaration list. var declarations; - if (token() === 156 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 155 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { declarations = createMissingList(); } else { @@ -33451,12 +32584,12 @@ var ts; var parameters = parseParameters(0 /* None */); var type = parseReturnType(58 /* ColonToken */, /*isType*/ false); var body = parseFunctionBlockOrSemicolon(0 /* None */); - var node = kind === 167 /* GetAccessor */ + var node = kind === 166 /* GetAccessor */ ? factory.createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) : factory.createSetAccessorDeclaration(decorators, modifiers, name, parameters, body); // Keep track of `typeParameters` (for both) and `type` (for setters) if they were parsed those indicate grammar errors node.typeParameters = typeParameters; - if (type && node.kind === 168 /* SetAccessor */) + if (type && node.kind === 167 /* SetAccessor */) node.type = type; return withJSDoc(finishNode(node, pos), hasJSDoc); } @@ -33495,7 +32628,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 146 /* SetKeyword */ || idToken === 134 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 145 /* SetKeyword */ || idToken === 134 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -33599,10 +32732,10 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); if (parseContextualModifier(134 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */); + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 166 /* GetAccessor */); } - if (parseContextualModifier(146 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */); + if (parseContextualModifier(145 /* SetKeyword */)) { + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* SetAccessor */); } if (token() === 132 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers); @@ -33641,10 +32774,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, 221 /* ClassExpression */); + return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, 218 /* ClassExpression */); } function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 252 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 249 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) { var savedAwaitContext = inAwaitContext(); @@ -33666,7 +32799,7 @@ var ts; members = createMissingList(); } setAwaitContext(savedAwaitContext); - var node = kind === 252 /* ClassDeclaration */ + var node = kind === 249 /* ClassDeclaration */ ? factory.createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) : factory.createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -33726,11 +32859,11 @@ var ts; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) { - parseExpected(149 /* TypeKeyword */); + parseExpected(148 /* TypeKeyword */); var name = parseIdentifier(); var typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); - var type = token() === 136 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType(); + var type = parseType(); parseSemicolon(); var node = factory.createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -33786,7 +32919,7 @@ var ts; function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { var flags = 0; var name; - if (token() === 154 /* GlobalKeyword */) { + if (token() === 153 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation name = parseIdentifier(); flags |= 1024 /* GlobalAugmentation */; @@ -33807,15 +32940,15 @@ var ts; } function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { var flags = 0; - if (token() === 154 /* GlobalKeyword */) { + if (token() === 153 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); } - else if (parseOptional(140 /* NamespaceKeyword */)) { + else if (parseOptional(139 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(139 /* ModuleKeyword */); + parseExpected(138 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); } @@ -33823,7 +32956,7 @@ var ts; return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags); } function isExternalModuleReference() { - return token() === 143 /* RequireKeyword */ && + return token() === 142 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -33834,7 +32967,7 @@ var ts; } function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) { parseExpected(126 /* AsKeyword */); - parseExpected(140 /* NamespaceKeyword */); + parseExpected(139 /* NamespaceKeyword */); var name = parseIdentifier(); parseSemicolon(); var node = factory.createNamespaceExportDeclaration(name); @@ -33852,7 +32985,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 153 /* FromKeyword */ && + if (token() !== 152 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -33870,7 +33003,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(153 /* FromKeyword */); + parseExpected(152 /* FromKeyword */); } var moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -33883,7 +33016,7 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 153 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 152 /* FromKeyword */; } function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) { parseExpected(62 /* EqualsToken */); @@ -33908,7 +33041,7 @@ var ts; var namedBindings; if (!identifier || parseOptional(27 /* CommaToken */)) { - namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(264 /* NamedImports */); + namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(261 /* NamedImports */); } return finishNode(factory.createImportClause(isTypeOnly, identifier, namedBindings), pos); } @@ -33919,7 +33052,7 @@ var ts; } function parseExternalModuleReference() { var pos = getNodePos(); - parseExpected(143 /* RequireKeyword */); + parseExpected(142 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); var expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -33956,16 +33089,16 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - var node = kind === 264 /* NamedImports */ + var node = kind === 261 /* NamedImports */ ? factory.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); return finishNode(node, pos); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(270 /* ExportSpecifier */); + return parseImportOrExportSpecifier(267 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(265 /* ImportSpecifier */); + return parseImportOrExportSpecifier(262 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var pos = getNodePos(); @@ -33992,38 +33125,38 @@ var ts; else { name = identifierName; } - if (kind === 265 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 262 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } - var node = kind === 265 /* ImportSpecifier */ + var node = kind === 262 /* ImportSpecifier */ ? factory.createImportSpecifier(propertyName, name) : factory.createExportSpecifier(propertyName, name); return finishNode(node, pos); } function parseNamespaceExport(pos) { - return finishNode(factory.createNamespaceExport(parseIdentifierName()), pos); + return finishNode(factory.createNamespaceExport(parseIdentifier()), pos); } function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) { var savedAwaitContext = inAwaitContext(); setAwaitContext(/*value*/ true); var exportClause; var moduleSpecifier; - var isTypeOnly = parseOptional(149 /* TypeKeyword */); + var isTypeOnly = parseOptional(148 /* TypeKeyword */); var namespaceExportPos = getNodePos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(126 /* AsKeyword */)) { exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(153 /* FromKeyword */); + parseExpected(152 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } else { - exportClause = parseNamedImportsOrExports(268 /* NamedExports */); + exportClause = parseNamedImportsOrExports(265 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 153 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(153 /* FromKeyword */); + if (token() === 152 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(152 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } } @@ -34140,18 +33273,6 @@ var ts; return finishNode(result, pos); } JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression; - function parseJSDocNameReference() { - var pos = getNodePos(); - var hasBrace = parseOptional(18 /* OpenBraceToken */); - var entityName = parseEntityName(/* allowReservedWords*/ false); - if (hasBrace) { - parseExpectedJSDoc(19 /* CloseBraceToken */); - } - var result = factory.createJSDocNameReference(entityName); - fixupParentReferences(result); - return finishNode(result, pos); - } - JSDocParser.parseJSDocNameReference = parseJSDocNameReference; function parseIsolatedJSDocComment(content, start, length) { initializeState("", content, 99 /* Latest */, /*_syntaxCursor:*/ undefined, 1 /* JS */); var jsDoc = doInsideOfContext(4194304 /* JSDoc */, function () { return parseJSDocCommentWorker(start, length); }); @@ -34215,8 +33336,7 @@ var ts; var state = 1 /* SawAsterisk */; var margin; // + 4 for leading '/** ' - // + 1 because the last index of \n is always one index before the first character in the line and coincidentally, if there is no \n before start, it is -1, which is also one index before the first character - var indent = start - (content.lastIndexOf("\n", start) + 1) + 4; + var indent = start - Math.max(content.lastIndexOf("\n", start), 0) + 4; function pushComment(text) { if (!margin) { margin = indent; @@ -34272,7 +33392,7 @@ var ts; comments.push(whitespace); } else if (margin !== undefined && indent + whitespace.length > margin) { - comments.push(whitespace.slice(margin - indent)); + comments.push(whitespace.slice(margin - indent - 1)); } indent += whitespace.length; break; @@ -34416,9 +33536,6 @@ var ts; case "callback": tag = parseCallbackTag(start, tagName, margin, indentText); break; - case "see": - tag = parseSeeTag(start, tagName, margin, indentText); - break; default: tag = parseUnknownTag(start, tagName, margin, indentText); break; @@ -34568,9 +33685,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return true; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -34602,12 +33719,12 @@ var ts; var child = void 0; var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) { + if (child.kind === 322 /* JSDocParameterTag */ || child.kind === 328 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 178 /* ArrayType */), pos); + var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 177 /* ArrayType */), pos); return finishNode(factory.createJSDocTypeExpression(literal), pos); } } @@ -34629,12 +33746,6 @@ var ts; var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined; return finishNode(factory.createJSDocTypeTag(tagName, typeExpression, comments), start, end); } - function parseSeeTag(start, tagName, indent, indentText) { - var nameExpression = parseJSDocNameReference(); - var end = getNodePos(); - var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined; - return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start, end); - } function parseAuthorTag(start, tagName, indent, indentText) { var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -34750,7 +33861,7 @@ var ts; var hasChildren = false; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { hasChildren = true; - if (child.kind === 329 /* JSDocTypeTag */) { + if (child.kind === 325 /* JSDocTypeTag */) { if (childTypeTag) { parseErrorAtCurrentToken(ts.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); var lastError = ts.lastOrUndefined(parseDiagnostics); @@ -34768,7 +33879,7 @@ var ts; } } if (hasChildren) { - var isArrayType = typeExpression && typeExpression.type.kind === 178 /* ArrayType */; + var isArrayType = typeExpression && typeExpression.type.kind === 177 /* ArrayType */; var jsdocTypeLiteral = factory.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType); typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : @@ -34821,7 +33932,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 327 /* JSDocReturnTag */) { + if (tag && tag.kind === 323 /* JSDocReturnTag */) { return tag; } } @@ -34856,7 +33967,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) && + if (child && (child.kind === 322 /* JSDocParameterTag */ || child.kind === 328 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -35602,8 +34713,6 @@ var ts; } case "jsx": case "jsxfrag": - case "jsximportsource": - case "jsxruntime": return; // Accessed directly default: ts.Debug.fail("Unhandled pragma kind"); // Can this be made into an assertNever in the future? } @@ -35728,18 +34837,6 @@ var ts; (function (ts) { /* @internal */ ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; - var jsxOptionMap = new ts.Map(ts.getEntries({ - "preserve": 1 /* Preserve */, - "react-native": 3 /* ReactNative */, - "react": 2 /* React */, - "react-jsx": 4 /* ReactJSX */, - "react-jsxdev": 5 /* ReactJSXDev */, - })); - /* @internal */ - ts.inverseJsxOptionMap = new ts.Map(ts.arrayFrom(ts.mapIterator(jsxOptionMap.entries(), function (_a) { - var key = _a[0], value = _a[1]; - return ["" + value, key]; - }))); // NOTE: The order here is important to default lib ordering as entries will have the same // order in the generated program (see `getDefaultLibPriority` in program.ts). This // order also affects overload resolution when a type declared in one lib is @@ -35761,7 +34858,6 @@ var ts; ["dom.iterable", "lib.dom.iterable.d.ts"], ["webworker", "lib.webworker.d.ts"], ["webworker.importscripts", "lib.webworker.importscripts.d.ts"], - ["webworker.iterable", "lib.webworker.iterable.d.ts"], ["scripthost", "lib.scripthost.d.ts"], // ES2015 Or ESNext By-feature options ["es2015.core", "lib.es2015.core.d.ts"], @@ -35790,7 +34886,6 @@ var ts; ["es2019.symbol", "lib.es2019.symbol.d.ts"], ["es2020.bigint", "lib.es2020.bigint.d.ts"], ["es2020.promise", "lib.es2020.promise.d.ts"], - ["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"], ["es2020.string", "lib.es2020.string.d.ts"], ["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"], ["es2020.intl", "lib.es2020.intl.d.ts"], @@ -35800,8 +34895,7 @@ var ts; ["esnext.intl", "lib.esnext.intl.d.ts"], ["esnext.bigint", "lib.es2020.bigint.d.ts"], ["esnext.string", "lib.esnext.string.d.ts"], - ["esnext.promise", "lib.esnext.promise.d.ts"], - ["esnext.weakref", "lib.esnext.weakref.d.ts"] + ["esnext.promise", "lib.esnext.promise.d.ts"] ]; /** * An array of supported "lib" reference file names used to determine the order for inclusion @@ -35933,15 +35027,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Generates_a_CPU_profile }, - { - name: "generateTrace", - type: "string", - isFilePath: true, - isCommandLineOnly: true, - paramType: ts.Diagnostics.DIRECTORY, - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Generates_an_event_trace_and_a_list_of_types - }, { name: "incremental", shortName: "i", @@ -36097,10 +35182,12 @@ var ts; }, { name: "jsx", - type: jsxOptionMap, + type: new ts.Map(ts.getEntries({ + "preserve": 1 /* Preserve */, + "react-native": 3 /* ReactNative */, + "react": 2 /* React */ + })), affectsSourceFile: true, - affectsEmit: true, - affectsModuleResolution: true, paramType: ts.Diagnostics.KIND, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, @@ -36343,14 +35430,6 @@ var ts; category: ts.Diagnostics.Additional_Checks, description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement }, - { - name: "noUncheckedIndexedAccess", - type: "boolean", - affectsSemanticDiagnostics: true, - showInSimplifiedHelpView: false, - category: ts.Diagnostics.Additional_Checks, - description: ts.Diagnostics.Include_undefined_in_index_signature_results - }, // Module Resolution { name: "moduleResolution", @@ -36512,15 +35591,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment }, - { - name: "jsxImportSource", - type: "string", - affectsSemanticDiagnostics: true, - affectsEmit: true, - affectsModuleResolution: true, - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react - }, { name: "resolveJsonModule", type: "boolean", @@ -36832,11 +35902,7 @@ var ts; name: "exclude", type: "string" } - }, - { - name: "disableFilenameBasedTypeAcquisition", - type: "boolean", - }, + } ]; /*@internal*/ function createOptionNameMap(optionDeclarations) { @@ -37191,7 +36257,7 @@ var ts; */ function readJsonConfigFile(fileName, readFile) { var textOrDiagnostic = tryReadFile(fileName, readFile); - return ts.isString(textOrDiagnostic) ? ts.parseJsonText(fileName, textOrDiagnostic) : { fileName: fileName, parseDiagnostics: [textOrDiagnostic] }; + return ts.isString(textOrDiagnostic) ? ts.parseJsonText(fileName, textOrDiagnostic) : { parseDiagnostics: [textOrDiagnostic] }; } ts.readJsonConfigFile = readJsonConfigFile; /*@internal*/ @@ -37334,7 +36400,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_4 = function (element) { - if (element.kind !== 288 /* PropertyAssignment */) { + if (element.kind !== 285 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -37425,13 +36491,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -37448,7 +36514,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -37933,7 +36999,6 @@ var ts; * It does *not* resolve the included files. */ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache) { - var _a; basePath = ts.normalizeSlashes(basePath); var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { @@ -37943,13 +37008,6 @@ var ts; var ownConfig = json ? parseOwnConfigOfJson(json, host, basePath, configFileName, errors) : parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); - if ((_a = ownConfig.options) === null || _a === void 0 ? void 0 : _a.paths) { - // If we end up needing to resolve relative paths from 'paths' relative to - // the config file location, we'll need to know where that config file was. - // Since 'paths' can be inherited from an extended config in another directory, - // we wouldn't know which directory to use unless we store it here. - ownConfig.options.pathsBasePath = basePath; - } if (ownConfig.extendedConfigPath) { // copy the resolution stack so it is never reused between branches in potential diamond-problem scenarios. resolutionStack = resolutionStack.concat([resolvedPath]); @@ -39249,15 +38307,12 @@ var ts; } function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) { var _a = state.compilerOptions, baseUrl = _a.baseUrl, paths = _a.paths; - if (paths && !ts.pathIsRelative(moduleName)) { + if (baseUrl && paths && !ts.pathIsRelative(moduleName)) { if (state.traceEnabled) { - if (baseUrl) { - trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); - } + trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName); } - var baseDirectory = ts.getPathsBasePath(state.compilerOptions, state.host); // Always defined when 'paths' is defined - return tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, loader, /*onlyRecordFailures*/ false, state); + return tryLoadModuleUsingPaths(extensions, moduleName, baseUrl, paths, loader, /*onlyRecordFailures*/ false, state); } } function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state) { @@ -39756,7 +38811,6 @@ var ts; } var resolved = ts.forEach(paths[matchedPatternText], function (subst) { var path = matchedStar_1 ? subst.replace("*", matchedStar_1) : subst; - // When baseUrl is not specified, the command line parser resolves relative paths to the config file location. var candidate = ts.normalizePath(ts.combinePaths(baseDirectory, path)); if (state.traceEnabled) { trace(state.host, ts.Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path); @@ -39922,26 +38976,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: if (!(ts.hasSyntacticModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 268 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 265 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -39957,7 +39011,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 257 /* ModuleBlock */: { + case 254 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -39979,7 +39033,7 @@ var ts; }); return state_1; } - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 78 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -40051,15 +39105,12 @@ var ts; } var binder = createBinder(); function bindSourceFile(file, options) { - var tracingData = ["bind" /* Bind */, "bindSourceFile", { path: file.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeBind"); ts.perfLogger.logStartBindFile("" + file.fileName); binder(file, options); ts.perfLogger.logStopBindFile(); ts.performance.mark("afterBind"); ts.performance.measure("Bind", "beforeBind", "afterBind"); - ts.tracing.end.apply(ts.tracing, tracingData); } ts.bindSourceFile = bindSourceFile; function createBinder() { @@ -40091,8 +39142,6 @@ var ts; // not depending on if we see "use strict" in certain places or if we hit a class/namespace // or if compiler options contain alwaysStrict. var inStrictMode; - // If we are binding an assignment pattern, we will bind certain expressions differently. - var inAssignmentPattern = false; var symbolCount = 0; var Symbol; var classifiableNames; @@ -40142,7 +39191,6 @@ var ts; currentExceptionTarget = undefined; activeLabelList = undefined; hasExplicitReturn = false; - inAssignmentPattern = false; emitFlags = 0 /* None */; } return bindSourceFile; @@ -40180,7 +39228,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 266 /* ExportAssignment */) { + if (node.kind === 263 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -40189,7 +39237,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 158 /* ComputedPropertyName */) { + if (name.kind === 157 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -40217,36 +39265,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return "__constructor" /* Constructor */; - case 174 /* FunctionType */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: + case 173 /* FunctionType */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: return "__call" /* Call */; - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: return "__new" /* New */; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return "__index" /* Index */; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 160 /* Parameter */: + case 159 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 308 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 304 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -40346,7 +39394,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 266 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 263 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -40383,9 +39431,9 @@ var ts; return symbol; } function declareModuleMember(node, symbolFlags, symbolExcludes) { - var hasExportModifier = !!(ts.getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node); + var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 270 /* ExportSpecifier */ || (node.kind === 260 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 267 /* ExportSpecifier */ || (node.kind === 257 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -40409,7 +39457,7 @@ var ts; // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. if (ts.isJSDocTypeAlias(node)) ts.Debug.assert(ts.isInJSFile(node)); // We shouldn't add symbols for JSDoc nodes if not in a JS file. - if (!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) { + if ((!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) || ts.isJSDocTypeAlias(node)) { if (!container.locals || (ts.hasSyntacticModifier(node, 512 /* Default */) && !getDeclarationName(node))) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); // No local symbol for an unnamed default! } @@ -40424,28 +39472,6 @@ var ts; } } } - function jsdocTreatAsExported(node) { - if (node.parent && ts.isModuleDeclaration(node)) { - node = node.parent; - } - if (!ts.isJSDocTypeAlias(node)) - return false; - // jsdoc typedef handling is a bit of a doozy, but to summarize, treat the typedef as exported if: - // 1. It has an explicit name (since by default typedefs are always directly exported, either at the top level or in a container), or - if (!ts.isJSDocEnumTag(node) && !!node.fullName) - return true; - // 2. The thing a nameless typedef pulls its name from is implicitly a direct export (either by assignment or actual export flag). - var declName = ts.getNameOfDeclaration(node); - if (!declName) - return false; - if (ts.isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent)) - return true; - if (ts.isDeclaration(declName.parent) && ts.getCombinedModifierFlags(declName.parent) & 1 /* Export */) - return true; - // This could potentially be simplified by having `delayedBindJSDocTypedefTag` pass in an override for `hasExportModifier`, since it should - // already have calculated and branched on most of this. - return false; - } // All container nodes are kept on a linked list in declaration order. This list is used by // the getLocalNameOfContainer function in the type checker to validate that the local name // used for a container is unique. @@ -40474,7 +39500,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 209 /* ArrowFunction */) { + if (node.kind !== 206 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -40507,7 +39533,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 166 /* Constructor */ || (ts.isInJSFile && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 165 /* Constructor */ || (ts.isInJSFile && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */)) ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -40522,13 +39548,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 166 /* Constructor */ || (ts.isInJSFile && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */))) { + if (node.kind === 165 /* Constructor */ || (ts.isInJSFile && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */))) { node.returnFlowNode = currentFlow; } } @@ -40555,8 +39581,8 @@ var ts; blockScopeContainer = savedBlockScopeContainer; } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 251 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 251 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 248 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 248 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -40569,156 +39595,129 @@ var ts; ts.forEachChild(node, bind, bindEach); } function bindChildren(node) { - var saveInAssignmentPattern = inAssignmentPattern; - // Most nodes aren't valid in an assignment pattern, so we clear the value here - // and set it before we descend into nodes that could actually be part of an assignment pattern. - inAssignmentPattern = false; if (checkUnreachable(node)) { bindEachChild(node); bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; return; } - if (node.kind >= 232 /* FirstStatement */ && node.kind <= 248 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 229 /* FirstStatement */ && node.kind <= 245 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: bindWhileStatement(node); break; - case 235 /* DoStatement */: + case 232 /* DoStatement */: bindDoStatement(node); break; - case 237 /* ForStatement */: + case 234 /* ForStatement */: bindForStatement(node); break; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 234 /* IfStatement */: + case 231 /* IfStatement */: bindIfStatement(node); break; - case 242 /* ReturnStatement */: - case 246 /* ThrowStatement */: + case 239 /* ReturnStatement */: + case 243 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: bindTryStatement(node); break; - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: bindSwitchStatement(node); break; - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: bindCaseBlock(node); break; - case 284 /* CaseClause */: + case 281 /* CaseClause */: bindCaseClause(node); break; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: bindLabeledStatement(node); break; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 216 /* BinaryExpression */: - if (ts.isDestructuringAssignment(node)) { - // Carry over whether we are in an assignment pattern to - // binary expressions that could actually be an initializer - inAssignmentPattern = saveInAssignmentPattern; - bindDestructuringAssignmentFlow(node); - return; - } + case 213 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: bindCallExpressionFlow(node); break; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: bindNonNullExpressionFlow(node); break; - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 297 /* SourceFile */: { + case 294 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; - case 198 /* BindingElement */: - bindBindingElementFlow(node); - break; - case 200 /* ObjectLiteralExpression */: - case 199 /* ArrayLiteralExpression */: - case 288 /* PropertyAssignment */: - case 220 /* SpreadElement */: - // Carry over whether we are in an assignment pattern of Object and Array literals - // as well as their children that are valid assignment targets. - inAssignmentPattern = saveInAssignmentPattern; - // falls through default: bindEachChild(node); break; } bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; } function isNarrowingExpression(expr) { switch (expr.kind) { case 78 /* Identifier */: - case 79 /* PrivateIdentifier */: case 107 /* ThisKeyword */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return hasNarrowableArgument(expr); - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; } function isNarrowableReference(expr) { - return expr.kind === 78 /* Identifier */ || expr.kind === 79 /* PrivateIdentifier */ || expr.kind === 107 /* ThisKeyword */ || expr.kind === 105 /* SuperKeyword */ || + return expr.kind === 78 /* Identifier */ || expr.kind === 107 /* ThisKeyword */ || expr.kind === 105 /* SuperKeyword */ || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) || - ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right) || ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression) || ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left); } @@ -40734,7 +39733,7 @@ var ts; } } } - if (expr.expression.kind === 201 /* PropertyAccessExpression */ && + if (expr.expression.kind === 198 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -40770,9 +39769,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -40848,26 +39847,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 234 /* IfStatement */: - case 236 /* WhileStatement */: - case 235 /* DoStatement */: + case 231 /* IfStatement */: + case 233 /* WhileStatement */: + case 232 /* DoStatement */: return parent.expression === node; - case 237 /* ForStatement */: - case 217 /* ConditionalExpression */: + case 234 /* ForStatement */: + case 214 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 207 /* ParenthesizedExpression */) { + if (node.kind === 204 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 214 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 211 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 213 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -40914,7 +39913,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 245 /* LabeledStatement */) { + while (label && node.parent.kind === 242 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -40965,12 +39964,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 239 /* ForOfStatement */) { + if (node.kind === 236 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 250 /* VariableDeclarationList */) { + if (node.initializer.kind !== 247 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -40992,7 +39991,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 242 /* ReturnStatement */) { + if (node.kind === 239 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -41009,7 +40008,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 241 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 238 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -41114,7 +40113,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 285 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 282 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -41157,13 +40156,10 @@ var ts; } function bindExpressionStatement(node) { bind(node.expression); - maybeBindExpressionFlowIfCall(node.expression); - } - function maybeBindExpressionFlowIfCall(node) { - // A top level or LHS of comma expression call expression with a dotted function name and at least one argument + // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.kind === 203 /* CallExpression */) { - var call = node; + if (node.expression.kind === 200 /* CallExpression */) { + var call = node.expression; if (ts.isDottedName(call.expression) && call.expression.kind !== 105 /* SuperKeyword */) { currentFlow = createFlowCall(currentFlow, call); } @@ -41188,7 +40184,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -41199,10 +40195,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 199 /* ArrayLiteralExpression */) { + else if (node.kind === 196 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 220 /* SpreadElement */) { + if (e.kind === 217 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -41210,16 +40206,16 @@ var ts; } } } - else if (node.kind === 200 /* ObjectLiteralExpression */) { + else if (node.kind === 197 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 288 /* PropertyAssignment */) { + if (p.kind === 285 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 289 /* ShorthandPropertyAssignment */) { + else if (p.kind === 286 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 290 /* SpreadAssignment */) { + else if (p.kind === 287 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -41267,23 +40263,6 @@ var ts; bindAssignmentTargetFlow(node.operand); } } - function bindDestructuringAssignmentFlow(node) { - if (inAssignmentPattern) { - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - inAssignmentPattern = true; - bind(node.left); - } - else { - inAssignmentPattern = true; - bind(node.left); - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - } - bindAssignmentTargetFlow(node.left); - } var BindBinaryExpressionFlowState; (function (BindBinaryExpressionFlowState) { BindBinaryExpressionFlowState[BindBinaryExpressionFlowState["BindThenBindChildren"] = 0] = "BindThenBindChildren"; @@ -41338,9 +40317,6 @@ var ts; break; } case 2 /* BindToken */: { - if (node.operatorToken.kind === 27 /* CommaToken */) { - maybeBindExpressionFlowIfCall(node.left); - } advanceState(3 /* BindRight */); maybeBind(node.operatorToken); break; @@ -41354,7 +40330,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 202 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 199 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -41391,7 +40367,7 @@ var ts; * If `node` is a BinaryExpression, adds it to the local work stack, otherwise recursively binds it */ function maybeBind(node) { - if (node && ts.isBinaryExpression(node) && !ts.isDestructuringAssignment(node)) { + if (node && ts.isBinaryExpression(node)) { stackIndex++; workStacks.expr[stackIndex] = node; workStacks.state[stackIndex] = 0 /* BindThenBindChildren */; @@ -41405,7 +40381,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 201 /* PropertyAccessExpression */) { + if (node.expression.kind === 198 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -41442,27 +40418,9 @@ var ts; bindInitializedVariableFlow(node); } } - function bindBindingElementFlow(node) { - if (ts.isBindingPattern(node.name)) { - // When evaluating a binding pattern, the initializer is evaluated before the binding pattern, per: - // - https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-iteratorbindinginitialization - // - `BindingElement: BindingPattern Initializer?` - // - https://tc39.es/ecma262/#sec-runtime-semantics-keyedbindinginitialization - // - `BindingElement: BindingPattern Initializer?` - bindEach(node.decorators); - bindEach(node.modifiers); - bind(node.dotDotDotToken); - bind(node.propertyName); - bind(node.initializer); - bind(node.name); - } - else { - bindEachChild(node); - } - } function bindJSDocTypeAlias(node) { ts.setParent(node.tagName, node); - if (node.kind !== 325 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 321 /* JSDocEnumTag */ && node.fullName) { ts.setParent(node.fullName, node); ts.setParentRecursive(node.fullName, /*incremental*/ false); } @@ -41470,7 +40428,7 @@ var ts; function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 165 /* MethodDeclaration */) { + if (host && host.kind !== 164 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -41483,15 +40441,15 @@ var ts; } function bindOptionalChainRest(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: bind(node.questionDotToken); bind(node.name); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: bind(node.questionDotToken); bind(node.argumentExpression); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); @@ -41556,7 +40514,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 208 /* FunctionExpression */ || expr.kind === 209 /* ArrowFunction */) { + if (expr.kind === 205 /* FunctionExpression */ || expr.kind === 206 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -41568,7 +40526,7 @@ var ts; } } } - if (node.expression.kind === 201 /* PropertyAccessExpression */) { + if (node.expression.kind === 198 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -41577,54 +40535,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 200 /* ObjectLiteralExpression */: - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 281 /* JsxAttributes */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 197 /* ObjectLiteralExpression */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 278 /* JsxAttributes */: return 1 /* IsContainer */; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 190 /* MappedType */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 189 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: - case 308 /* JSDocFunctionType */: - case 174 /* FunctionType */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 175 /* ConstructorType */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: + case 304 /* JSDocFunctionType */: + case 173 /* FunctionType */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 174 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 287 /* CatchClause */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 258 /* CaseBlock */: + case 284 /* CatchClause */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 255 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 230 /* Block */: + case 227 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -41657,45 +40615,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 297 /* SourceFile */: + case 294 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 200 /* ObjectLiteralExpression */: - case 253 /* InterfaceDeclaration */: - case 281 /* JsxAttributes */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 197 /* ObjectLiteralExpression */: + case 250 /* InterfaceDeclaration */: + case 278 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 313 /* JSDocSignature */: - case 171 /* IndexSignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 308 /* JSDocFunctionType */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 254 /* TypeAliasDeclaration */: - case 190 /* MappedType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 309 /* JSDocSignature */: + case 170 /* IndexSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 304 /* JSDocFunctionType */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 251 /* TypeAliasDeclaration */: + case 189 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -41796,7 +40754,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 290 /* SpreadAssignment */ || prop.name.kind !== 78 /* Identifier */) { + if (prop.kind === 287 /* SpreadAssignment */ || prop.name.kind !== 78 /* Identifier */) { continue; } var identifier = prop.name; @@ -41808,7 +40766,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 288 /* PropertyAssignment */ || prop.kind === 289 /* ShorthandPropertyAssignment */ || prop.kind === 165 /* MethodDeclaration */ + var currentKind = prop.kind === 285 /* PropertyAssignment */ || prop.kind === 286 /* ShorthandPropertyAssignment */ || prop.kind === 164 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -41840,10 +40798,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -42042,8 +41000,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 297 /* SourceFile */ && - blockScopeContainer.kind !== 256 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 294 /* SourceFile */ && + blockScopeContainer.kind !== 253 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -42138,7 +41096,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 156 /* LastToken */) { + if (node.kind > 155 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -42214,7 +41172,7 @@ var ts; } // falls through case 107 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 289 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 286 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkContextualIdentifier(node); @@ -42223,8 +41181,8 @@ var ts; break; case 79 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -42235,11 +41193,11 @@ var ts; if (ts.isInJSFile(expr) && file.commonJsModuleIndicator && ts.isModuleExportsAccessExpression(expr) && - !lookupSymbolForName(blockScopeContainer, "module")) { + !lookupSymbolForNameWorker(blockScopeContainer, "module")) { declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -42258,14 +41216,6 @@ var ts; bindThisPropertyAssignment(node); break; case 5 /* Property */: - var expression = node.left.expression; - if (ts.isInJSFile(node) && ts.isIdentifier(expression)) { - var symbol = lookupSymbolForName(blockScopeContainer, expression.escapedText); - if (ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration)) { - bindThisPropertyAssignment(node); - break; - } - } bindSpecialPropertyAssignment(node); break; case 0 /* None */: @@ -42275,78 +41225,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return checkStrictModeCatchClause(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return checkStrictModeWithStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 187 /* ThisType */: + case 186 /* ThisType */: seenThisKeyword = true; return; - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: break; // Binding the children will handle everything - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return bindTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return bindParameter(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return bindPropertyWorker(node); - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 291 /* EnumMember */: + case 288 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 174 /* FunctionType */: - case 308 /* JSDocFunctionType */: - case 313 /* JSDocSignature */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 304 /* JSDocFunctionType */: + case 309 /* JSDocSignature */: + case 174 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 190 /* MappedType */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 189 /* MappedType */: return bindAnonymousTypeWorker(node); - case 319 /* JSDocClassTag */: + case 315 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return bindFunctionExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -42365,65 +41315,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return bindJsxAttributes(node); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return bindImportClause(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return bindExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return bindExportAssignment(node); - case 297 /* SourceFile */: + case 294 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 230 /* Block */: + case 227 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 326 /* JSDocParameterTag */: - if (node.parent.kind === 313 /* JSDocSignature */) { + case 322 /* JSDocParameterTag */: + if (node.parent.kind === 309 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 312 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 308 /* JSDocTypeLiteral */) { break; } // falls through - case 333 /* JSDocPropertyTag */: + case 328 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 307 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 303 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -42544,9 +41494,9 @@ var ts; return symbol; }); if (symbol) { - var isAlias = ts.isAliasableExpression(node.right) && (ts.isExportsIdentifier(node.left.expression) || ts.isModuleExportsAccessExpression(node.left.expression)); - var flags = isAlias ? 2097152 /* Alias */ : 4 /* Property */ | 1048576 /* ExportValue */; - ts.setParent(node.left, node); + var flags = ts.isClassExpression(node.right) ? + 4 /* Property */ | 1048576 /* ExportValue */ | 32 /* Class */ : + 4 /* Property */ | 1048576 /* ExportValue */; declareSymbol(symbol.exports, symbol, node.left, flags, 0 /* None */); } } @@ -42562,10 +41512,6 @@ var ts; if (ts.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { return; } - if (ts.isObjectLiteralExpression(assignedExpression) && ts.every(assignedExpression.properties, ts.isShorthandPropertyAssignment)) { - ts.forEach(assignedExpression.properties, bindExportAssignedObjectMemberAlias); - return; - } // 'module.exports = expr' assignment var flags = ts.exportAssignmentIsAlias(node) ? 2097152 /* Alias */ @@ -42573,9 +41519,6 @@ var ts; var symbol = declareSymbol(file.symbol.exports, file.symbol, node, flags | 67108864 /* Assignment */, 0 /* None */); ts.setValueDeclaration(symbol, node); } - function bindExportAssignedObjectMemberAlias(node) { - declareSymbol(file.symbol.exports, file.symbol, node, 2097152 /* Alias */ | 67108864 /* Assignment */, 0 /* None */); - } function bindThisPropertyAssignment(node) { ts.Debug.assert(ts.isInJSFile(node)); // private identifiers *must* be declared (even in JS files) @@ -42586,8 +41529,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -42609,11 +41552,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 166 /* Constructor */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 165 /* Constructor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -42625,7 +41568,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -42654,7 +41597,7 @@ var ts; if (node.expression.kind === 107 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 297 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 294 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -42694,21 +41637,16 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 297 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 294 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } function bindSpecialPropertyAssignment(node) { - var _a; // Class declarations in Typescript do not allow property declarations var parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, container) || lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer); if (!ts.isInJSFile(node) && !ts.isFunctionSymbol(parentSymbol)) { return; } - var rootExpr = ts.getLeftmostAccessExpression(node.left); - if (ts.isIdentifier(rootExpr) && ((_a = lookupSymbolForName(container, rootExpr.escapedText)) === null || _a === void 0 ? void 0 : _a.flags) & 2097152 /* Alias */) { - return; - } // Fix up parent pointers since we're going to use these nodes before we bind into them ts.setParent(node.left, node); ts.setParent(node.right, node); @@ -42742,17 +41680,17 @@ var ts; } if (isToplevel && !isPrototypeProperty) { // make symbols or add declarations for intermediate containers - var flags_2 = 1536 /* Module */ | 67108864 /* Assignment */; + var flags_1 = 1536 /* Module */ | 67108864 /* Assignment */; var excludeFlags_1 = 110735 /* ValueModuleExcludes */ & ~67108864 /* Assignment */; namespaceSymbol = forEachIdentifierInEntityName(entityName, namespaceSymbol, function (id, symbol, parent) { if (symbol) { - addDeclarationToSymbol(symbol, id, flags_2); + addDeclarationToSymbol(symbol, id, flags_1); return symbol; } else { var table = parent ? parent.exports : file.jsGlobalAugmentations || (file.jsGlobalAugmentations = ts.createSymbolTable()); - return declareSymbol(table, parent, id, flags_2, excludeFlags_1); + return declareSymbol(table, parent, id, flags_1, excludeFlags_1); } }); } @@ -42803,8 +41741,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 297 /* SourceFile */ - : propertyAccess.parent.parent.kind === 297 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 294 /* SourceFile */ + : propertyAccess.parent.parent.kind === 294 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer); @@ -42851,7 +41789,7 @@ var ts; function lookupSymbolForPropertyAccess(node, lookupContainer) { if (lookupContainer === void 0) { lookupContainer = container; } if (ts.isIdentifier(node)) { - return lookupSymbolForName(lookupContainer, node.escapedText); + return lookupSymbolForNameWorker(lookupContainer, node.escapedText); } else { var symbol = lookupSymbolForPropertyAccess(node.expression); @@ -42883,7 +41821,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 252 /* ClassDeclaration */) { + if (node.kind === 249 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -42925,10 +41863,7 @@ var ts; checkStrictModeEvalOrArguments(node, node.name); } if (!ts.isBindingPattern(node.name)) { - if (ts.isInJSFile(node) && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true) && !ts.getJSDocTypeTag(node)) { - declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - } - else if (ts.isBlockOrCatchScoped(node)) { + if (ts.isBlockOrCatchScoped(node)) { bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */); } else if (ts.isParameterDeclaration(node)) { @@ -42949,7 +41884,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 326 /* JSDocParameterTag */ && container.kind !== 313 /* JSDocSignature */) { + if (node.kind === 322 /* JSDocParameterTag */ && container.kind !== 309 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -43026,7 +41961,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 185 /* InferType */) { + else if (node.parent.kind === 184 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -43054,11 +41989,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 231 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 228 /* EmptyStatement */) || // report error on class declarations - node.kind === 252 /* ClassDeclaration */ || + node.kind === 249 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 256 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 253 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -43102,12 +42037,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return ts.hasSyntacticModifier(s, 2048 /* Const */); default: return false; @@ -43123,7 +42058,7 @@ var ts; return true; } else if (ts.isIdentifier(node)) { - var symbol = lookupSymbolForName(sourceFile, node.escapedText); + var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText); if (!!symbol && !!symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) { var init = symbol.valueDeclaration.initializer; q.push(init); @@ -43137,7 +42072,7 @@ var ts; return false; } ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias; - function lookupSymbolForName(container, name) { + function lookupSymbolForNameWorker(container, name) { var local = container.locals && container.locals.get(name); if (local) { return local.exportSymbol || local; @@ -43307,7 +42242,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 176 /* TypeQuery */) { + if (d.type && d.type.kind === 175 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -43337,7 +42272,6 @@ var ts; IterationUse[IterationUse["YieldStarFlag"] = 16] = "YieldStarFlag"; IterationUse[IterationUse["SpreadFlag"] = 32] = "SpreadFlag"; IterationUse[IterationUse["DestructuringFlag"] = 64] = "DestructuringFlag"; - IterationUse[IterationUse["PossiblyOutOfBounds"] = 128] = "PossiblyOutOfBounds"; // Spread, Destructuring, Array element assignment IterationUse[IterationUse["Element"] = 1] = "Element"; IterationUse[IterationUse["Spread"] = 33] = "Spread"; @@ -43484,7 +42418,6 @@ var ts; AccessFlags[AccessFlags["Writing"] = 2] = "Writing"; AccessFlags[AccessFlags["CacheSymbol"] = 4] = "CacheSymbol"; AccessFlags[AccessFlags["NoTupleBoundsCheck"] = 8] = "NoTupleBoundsCheck"; - AccessFlags[AccessFlags["ExpressionPosition"] = 16] = "ExpressionPosition"; })(AccessFlags || (AccessFlags = {})); var SignatureCheckMode; (function (SignatureCheckMode) { @@ -43543,25 +42476,6 @@ var ts; DeclarationSpaces[DeclarationSpaces["ExportType"] = 2] = "ExportType"; DeclarationSpaces[DeclarationSpaces["ExportNamespace"] = 4] = "ExportNamespace"; })(DeclarationSpaces || (DeclarationSpaces = {})); - var MinArgumentCountFlags; - (function (MinArgumentCountFlags) { - MinArgumentCountFlags[MinArgumentCountFlags["None"] = 0] = "None"; - MinArgumentCountFlags[MinArgumentCountFlags["StrongArityForUntypedJS"] = 1] = "StrongArityForUntypedJS"; - MinArgumentCountFlags[MinArgumentCountFlags["VoidIsNonOptional"] = 2] = "VoidIsNonOptional"; - })(MinArgumentCountFlags || (MinArgumentCountFlags = {})); - var IntrinsicTypeKind; - (function (IntrinsicTypeKind) { - IntrinsicTypeKind[IntrinsicTypeKind["Uppercase"] = 0] = "Uppercase"; - IntrinsicTypeKind[IntrinsicTypeKind["Lowercase"] = 1] = "Lowercase"; - IntrinsicTypeKind[IntrinsicTypeKind["Capitalize"] = 2] = "Capitalize"; - IntrinsicTypeKind[IntrinsicTypeKind["Uncapitalize"] = 3] = "Uncapitalize"; - })(IntrinsicTypeKind || (IntrinsicTypeKind = {})); - var intrinsicTypeKinds = new ts.Map(ts.getEntries({ - Uppercase: 0 /* Uppercase */, - Lowercase: 1 /* Lowercase */, - Capitalize: 2 /* Capitalize */, - Uncapitalize: 3 /* Uncapitalize */ - })); function SymbolLinks() { } function NodeLinks() { @@ -43625,7 +42539,6 @@ var ts; var instantiationDepth = 0; var constraintDepth = 0; var currentNode; - var typeCatalog = []; // NB: id is index + 1 var emptySymbols = ts.createSymbolTable(); var arrayVariances = [1 /* Covariant */]; var compilerOptions = host.getCompilerOptions(); @@ -43662,7 +42575,6 @@ var ts; getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount") + symbolCount; }, - getTypeCatalog: function () { return typeCatalog; }, getTypeCount: function () { return typeCount; }, getInstantiationCount: function () { return totalInstantiationCount; }, getRelationCacheSizes: function () { return ({ @@ -43677,7 +42589,6 @@ var ts; getMergedSymbol: getMergedSymbol, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getRecursionIdentity: getRecursionIdentity, getTypeOfSymbolAtLocation: function (symbol, locationIn) { var location = ts.getParseTreeNode(locationIn); return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType; @@ -43786,7 +42697,6 @@ var ts; }, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getSymbolOfExpando: getSymbolOfExpando, getContextualType: function (nodeIn, contextFlags) { var node = ts.getParseTreeNode(nodeIn, ts.isExpression); if (!node) { @@ -43980,8 +42890,6 @@ var ts; var intersectionTypes = new ts.Map(); var literalTypes = new ts.Map(); var indexedAccessTypes = new ts.Map(); - var templateLiteralTypes = new ts.Map(); - var stringMappingTypes = new ts.Map(); var substitutionTypes = new ts.Map(); var evolvingArrayTypes = []; var undefinedProperties = new ts.Map(); @@ -43992,7 +42900,6 @@ var ts; var wildcardType = createIntrinsicType(1 /* Any */, "any"); var errorType = createIntrinsicType(1 /* Any */, "error"); var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 524288 /* ContainsWideningType */); - var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); var unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 524288 /* ContainsWideningType */); @@ -44031,7 +42938,6 @@ var ts; var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; var numberOrBigIntType = getUnionType([numberType, bigintType]); - var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; }); var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; }); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -44303,16 +43209,6 @@ var ts; } } function errorOrSuggestion(isError, location, message, arg0, arg1, arg2, arg3) { - // Pseudo-synthesized input node - if (location.pos < 0 || location.end < 0) { - if (!isError) { - return; // Drop suggestions (we have no span to suggest on) - } - // Issue errors globally - var file = ts.getSourceFileOfNode(location); - addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message)); // eslint-disable-line no-in-operator - return; - } addErrorOrSuggestion(isError, "message" in message ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForNodeFromMessageChain(location, message)); // eslint-disable-line no-in-operator } function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) { @@ -44602,7 +43498,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 297 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 294 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -44661,17 +43557,17 @@ var ts; } if (declaration.pos <= usage.pos && !(ts.isPropertyDeclaration(declaration) && ts.isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) { // declaration is before usage - if (declaration.kind === 198 /* BindingElement */) { + if (declaration.kind === 195 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 198 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 195 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 249 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 246 /* VariableDeclaration */), usage); } - else if (declaration.kind === 249 /* VariableDeclaration */) { + else if (declaration.kind === 246 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -44701,12 +43597,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 270 /* ExportSpecifier */ || (usage.parent.kind === 266 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 267 /* ExportSpecifier */ || (usage.parent.kind === 263 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 266 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 263 /* ExportAssignment */ && usage.isExportEquals) { return true; } if (!!(usage.flags & 4194304 /* JSDoc */) || isInTypeQuery(usage) || usageInTypeDeclaration()) { @@ -44728,9 +43624,9 @@ var ts; } function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { switch (declaration.parent.parent.kind) { - case 232 /* VariableStatement */: - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: + case 229 /* VariableStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, declContainer)) { @@ -44751,16 +43647,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 163 /* PropertyDeclaration */ && + current.parent.kind === 162 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasSyntacticModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 165 /* MethodDeclaration */) { + if (declaration.kind === 164 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -44782,19 +43678,19 @@ var ts; return "quit"; } switch (node.kind) { - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return true; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 230 /* Block */: + case 227 /* Block */: switch (node.parent.kind) { - case 167 /* GetAccessor */: - case 165 /* MethodDeclaration */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 164 /* MethodDeclaration */: + case 167 /* SetAccessor */: return true; default: return false; @@ -44830,18 +43726,18 @@ var ts; } function requiresScopeChangeWorker(node) { switch (node.kind) { - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 166 /* Constructor */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 165 /* Constructor */: // do not descend into these return false; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 288 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 285 /* PropertyAssignment */: return requiresScopeChangeWorker(node.name); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // static properties in classes introduce temporary variables if (ts.hasStaticModifier(node)) { return target < 99 /* ESNext */ || !compilerOptions.useDefineForClassFields; @@ -44895,12 +43791,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 311 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 307 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 160 /* Parameter */ || - lastLocation.kind === 159 /* TypeParameter */ + lastLocation.kind === 159 /* Parameter */ || + lastLocation.kind === 158 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -44915,13 +43811,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 160 /* Parameter */ || + lastLocation.kind === 159 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 184 /* ConditionalType */) { + else if (location.kind === 183 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -44936,14 +43832,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 297 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 294 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -44967,7 +43863,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 270 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 269 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 267 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 266 /* NamespaceExport */))) { break; } } @@ -44981,12 +43877,12 @@ var ts; } } break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -45003,9 +43899,9 @@ var ts; } } break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -45024,7 +43920,7 @@ var ts; } break loop; } - if (location.kind === 221 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 218 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -45032,7 +43928,7 @@ var ts; } } break; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 93 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -45052,9 +43948,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 253 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 250 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -45062,24 +43958,24 @@ var ts; } } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -45092,7 +43988,7 @@ var ts; } } break; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -45101,7 +43997,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 160 /* Parameter */) { + if (location.parent && location.parent.kind === 159 /* Parameter */) { location = location.parent; } // @@ -45116,17 +44012,17 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 252 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 249 /* ClassDeclaration */)) { location = location.parent; } break; - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 160 /* Parameter */: + case 159 /* Parameter */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && ts.isBindingPattern(lastLocation))) { if (!associatedDeclarationForContainingInitializerOrBindingName) { @@ -45134,20 +44030,14 @@ var ts; } } break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && ts.isBindingPattern(lastLocation))) { - if (ts.isParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) { - associatedDeclarationForContainingInitializerOrBindingName = location; - } - } - break; - case 185 /* InferType */: - if (meaning & 262144 /* TypeParameter */) { - var parameterName = location.typeParameter.name; - if (parameterName && name === parameterName.escapedText) { - result = location.typeParameter.symbol; - break loop; + var root = ts.getRootDeclaration(location); + if (root.kind === 159 /* Parameter */) { + if (!associatedDeclarationForContainingInitializerOrBindingName) { + associatedDeclarationForContainingInitializerOrBindingName = location; + } } } break; @@ -45166,7 +44056,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 297 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 294 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -45204,15 +44094,7 @@ var ts; } } if (!suggestion) { - if (nameArg) { - var lib = getSuggestedLibForNonExistentName(nameArg); - if (lib) { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg), lib); - } - else { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); - } - } + error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); } suggestionCount++; } @@ -45291,10 +44173,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 209 /* ArrowFunction */ && location.kind !== 208 /* FunctionExpression */) { + if (location.kind !== 206 /* ArrowFunction */ && location.kind !== 205 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -45307,12 +44189,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 256 /* ModuleDeclaration */: // For `namespace N { N; }` + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 253 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -45324,7 +44206,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 159 /* TypeParameter */) { + if (decl.kind === 158 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -45380,9 +44262,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 78 /* Identifier */: - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -45426,7 +44308,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 270 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 267 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -45440,31 +44322,15 @@ var ts; } var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* Type */ & ~111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol && !(symbol.flags & 1024 /* NamespaceModule */)) { - var rawName = ts.unescapeLeadingUnderscores(name); - if (isES2015OrLaterConstructorName(name)) { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName); - } - else if (maybeMappedType(errorLocation, symbol)) { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0, rawName, rawName === "K" ? "P" : "K"); - } - else { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, rawName); - } + var message = isES2015OrLaterConstructorName(name) + ? ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later + : ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here; + error(errorLocation, message, ts.unescapeLeadingUnderscores(name)); return true; } } return false; } - function maybeMappedType(node, symbol) { - var container = ts.findAncestor(node.parent, function (n) { - return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit"; - }); - if (container && container.members.length === 1) { - var type = getDeclaredTypeOfSymbol(symbol); - return !!(type.flags & 1048576 /* Union */) && allTypesAssignableToKind(type, 384 /* StringOrNumberLiteral */, /*strict*/ true); - } - return false; - } function isES2015OrLaterConstructorName(n) { switch (n) { case "Promise": @@ -45501,7 +44367,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 255 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 252 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -45536,13 +44402,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.parent; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return node.parent.parent; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -45566,37 +44432,29 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ - || node.kind === 259 /* NamespaceExportDeclaration */ - || node.kind === 262 /* ImportClause */ && !!node.name - || node.kind === 263 /* NamespaceImport */ - || node.kind === 269 /* NamespaceExport */ - || node.kind === 265 /* ImportSpecifier */ - || node.kind === 270 /* ExportSpecifier */ - || node.kind === 266 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) - || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) - || ts.isAccessExpression(node) + return node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 256 /* NamespaceExportDeclaration */ || + node.kind === 259 /* ImportClause */ && !!node.name || + node.kind === 260 /* NamespaceImport */ || + node.kind === 266 /* NamespaceExport */ || + node.kind === 262 /* ImportSpecifier */ || + node.kind === 267 /* ExportSpecifier */ || + node.kind === 263 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || + ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ - && isAliasableOrJsExpression(node.parent.right) - || node.kind === 289 /* ShorthandPropertyAssignment */ - || node.kind === 288 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) - || ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true); + && isAliasableOrJsExpression(node.parent.right) || + node.kind === 286 /* ShorthandPropertyAssignment */ || + node.kind === 285 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - var commonJSPropertyAccess = getCommonJSPropertyAccess(node); - if (commonJSPropertyAccess) { - var name = ts.getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0]; - return ts.isIdentifier(commonJSPropertyAccess.name) - ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText)) - : undefined; - } - if (ts.isVariableDeclaration(node) || node.moduleReference.kind === 272 /* ExternalModuleReference */) { - var immediate = resolveExternalModuleName(node, ts.getExternalModuleRequireArgument(node) || ts.getExternalModuleImportEqualsDeclarationExpression(node)); + if (node.moduleReference.kind === 269 /* ExternalModuleReference */) { + var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); return resolved_4; @@ -45623,7 +44481,10 @@ var ts; } function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) { var exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */); - var exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports.get(name); + if (exportValue) { + return getPropertyOfType(getTypeOfSymbol(exportValue), name); + } + var exportSymbol = moduleSymbol.exports.get(name); var resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(sourceNode, exportSymbol, resolved, /*overwriteEmpty*/ false); return resolved; @@ -45764,9 +44625,11 @@ var ts; result.exports = new ts.Map(valueSymbol.exports); return result; } - function getExportOfModule(symbol, name, specifier, dontResolveAlias) { + function getExportOfModule(symbol, specifier, dontResolveAlias) { + var _a; if (symbol.flags & 1536 /* Module */) { - var exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText); + var name = ((_a = specifier.propertyName) !== null && _a !== void 0 ? _a : specifier.name).escapedText; + var exportSymbol = getExportsOfSymbol(symbol).get(name); var resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(specifier, exportSymbol, resolved, /*overwriteEmpty*/ false); return resolved; @@ -45783,14 +44646,10 @@ var ts; function getExternalModuleMember(node, specifier, dontResolveAlias) { var _a; if (dontResolveAlias === void 0) { dontResolveAlias = false; } - var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier; - var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); // TODO: GH#18217 - var name = !ts.isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name; - if (!ts.isIdentifier(name)) { - return undefined; - } + var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); + var name = specifier.propertyName || specifier.name; var suppressInteropError = name.escapedText === "default" /* Default */ && !!(compilerOptions.allowSyntheticDefaultImports || compilerOptions.esModuleInterop); - var targetSymbol = resolveESModuleSymbol(moduleSymbol, moduleSpecifier, dontResolveAlias, suppressInteropError); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias, suppressInteropError); if (targetSymbol) { if (name.escapedText) { if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { @@ -45806,7 +44665,7 @@ var ts; } // if symbolFromVariable is export - get its final target symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); - var symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias); + var symbolFromModule = getExportOfModule(targetSymbol, specifier, dontResolveAlias); if (symbolFromModule === undefined && name.escapedText === "default" /* Default */) { var file = ts.find(moduleSymbol.declarations, ts.isSourceFile); if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias)) { @@ -45822,7 +44681,7 @@ var ts; var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol); if (suggestion !== undefined) { var suggestionName = symbolToString(suggestion); - var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName); + var diagnostic = error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2, moduleName, declarationName, suggestionName); if (suggestion.valueDeclaration) { ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName)); } @@ -45883,21 +44742,10 @@ var ts; } } function getTargetOfImportSpecifier(node, dontResolveAlias) { - var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent; - var commonJSPropertyAccess = getCommonJSPropertyAccess(root); - var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias); - var name = node.propertyName || node.name; - if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) { - return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias); - } + var resolved = getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false); return resolved; } - function getCommonJSPropertyAccess(node) { - if (ts.isVariableDeclaration(node) && node.initializer && ts.isPropertyAccessExpression(node.initializer)) { - return node.initializer; - } - } function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { var resolved = resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false); @@ -45934,7 +44782,7 @@ var ts; var expression = node.initializer; return getTargetOfAliasLikeExpression(expression, dontRecursivelyResolve); } - function getTargetOfAccessExpression(node, dontRecursivelyResolve) { + function getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve) { if (!(ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */)) { return undefined; } @@ -45943,32 +44791,29 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: - case 249 /* VariableDeclaration */: + case 257 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 265 /* ImportSpecifier */: - case 198 /* BindingElement */: + case 262 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 266 /* ExportAssignment */: - case 216 /* BinaryExpression */: + case 263 /* ExportAssignment */: + case 213 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: - return getTargetOfAccessExpression(node, dontRecursivelyResolve); + case 198 /* PropertyAccessExpression */: + return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); } @@ -46035,7 +44880,7 @@ var ts; * @param overwriteEmpty Checks `resolvesToSymbol` for type-only declarations even if `aliasDeclaration` */ function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) { - if (!aliasDeclaration || ts.isPropertyAccessExpression(aliasDeclaration)) + if (!aliasDeclaration) return false; // If the declaration itself is type-only, mark it and return. // No need to check what it resolves to. @@ -46119,13 +44964,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 78 /* Identifier */ || entityName.parent.kind === 157 /* QualifiedName */) { + if (entityName.kind === 78 /* Identifier */ || entityName.parent.kind === 156 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 260 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 257 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -46149,9 +44994,9 @@ var ts; return getMergedSymbol(symbolFromJSPrototype); } } - else if (name.kind === 157 /* QualifiedName */ || name.kind === 201 /* PropertyAccessExpression */) { - var left = name.kind === 157 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 157 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 156 /* QualifiedName */ || name.kind === 198 /* PropertyAccessExpression */) { + var left = name.kind === 156 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 156 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -46177,12 +45022,7 @@ var ts; symbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, meaning)); if (!symbol) { if (!ignoreErrors) { - var namespaceName = getFullyQualifiedName(namespace); - var declarationName = ts.declarationNameToString(right); - var suggestion = getSuggestedSymbolForNonexistentModule(right, namespace); - suggestion ? - error(right, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestion)) : - error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName); + error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); } return undefined; } @@ -46191,7 +45031,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 266 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 263 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -46375,7 +45215,7 @@ var ts; ? ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, packageId.name, ts.mangleScopedPackageName(packageId.name)) : ts.chainDiagnosticMessages( - /*details*/ undefined, ts.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name)) + /*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name)) : undefined; errorOrSuggestion(isError, errorNode, ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedFileName)); } @@ -46417,7 +45257,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 297 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 294 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -46719,7 +45559,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 166 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 165 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -46728,7 +45568,6 @@ var ts; var result = new Type(checker, flags); typeCount++; result.id = typeCount; - typeCatalog.push(result); return result; } function createIntrinsicType(kind, intrinsicName, objectFlags) { @@ -46807,12 +45646,12 @@ var ts; } } switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -46821,9 +45660,9 @@ var ts; return { value: result }; } break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -46906,7 +45745,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 267 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -46950,7 +45789,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 267 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -46965,10 +45804,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: continue; default: return false; @@ -47097,10 +45936,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -47109,7 +45948,6 @@ var ts; } return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { - var _a, _b; if (!isDeclarationVisible(declaration)) { // Mark the unexported alias as visible if its parent is visible // because these kind of aliases can be used to name types in declaration file @@ -47129,14 +45967,6 @@ var ts; && isDeclarationVisible(declaration.parent)) { return addVisibleAlias(declaration, declaration); } - else if (symbol.flags & 2097152 /* Alias */ && ts.isBindingElement(declaration) && ts.isInJSFile(declaration) && ((_a = declaration.parent) === null || _a === void 0 ? void 0 : _a.parent) // exported import-like top-level JS require statement - && ts.isVariableDeclaration(declaration.parent.parent) - && ((_b = declaration.parent.parent.parent) === null || _b === void 0 ? void 0 : _b.parent) && ts.isVariableStatement(declaration.parent.parent.parent.parent) - && !ts.hasSyntacticModifier(declaration.parent.parent.parent.parent, 1 /* Export */) - && declaration.parent.parent.parent.parent.parent // check if the thing containing the variable statement is visible (ie, the file) - && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) { - return addVisibleAlias(declaration, declaration.parent.parent.parent.parent); - } // Declaration is not visible return false; } @@ -47156,14 +45986,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 176 /* TypeQuery */ || + if (entityName.parent.kind === 175 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 158 /* ComputedPropertyName */) { + entityName.parent.kind === 157 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 157 /* QualifiedName */ || entityName.kind === 201 /* PropertyAccessExpression */ || - entityName.parent.kind === 260 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 156 /* QualifiedName */ || entityName.kind === 198 /* PropertyAccessExpression */ || + entityName.parent.kind === 257 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -47204,7 +46034,7 @@ var ts; function symbolToStringWorker(writer) { var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217 // add neverAsciiEscape for GH#39027 - var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 297 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true }); + var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 294 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, entity, /*sourceFile*/ sourceFile, writer); return writer; @@ -47216,10 +46046,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 175 /* ConstructorType */ : 174 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 174 /* ConstructorType */ : 173 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 170 /* ConstructSignature */ : 169 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 169 /* ConstructSignature */ : 168 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -47265,9 +46095,6 @@ var ts; if (flags === void 0) { flags = 0 /* None */; } return flags & 814775659 /* NodeBuilderFlagsMask */; } - function isClassInstanceSide(type) { - return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(ts.getObjectFlags(type) & 1073741824 /* IsClassInstanceClone */)); - } function createNodeBuilder() { return { typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) { @@ -47299,7 +46126,6 @@ var ts; }, }; function withContext(enclosingDeclaration, flags, tracker, cb) { - var _a, _b; ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); var context = { enclosingDeclaration: enclosingDeclaration, @@ -47323,9 +46149,6 @@ var ts; approximateLength: 0 }; var resultingNode = cb(context); - if (context.truncating && context.flags & 1 /* NoTruncation */) { - (_b = (_a = context.tracker) === null || _a === void 0 ? void 0 : _a.reportTruncationError) === null || _b === void 0 ? void 0 : _b.call(_a); - } return context.encounteredError ? undefined : resultingNode; } function checkTruncationLength(context) { @@ -47352,22 +46175,22 @@ var ts; } if (type.flags & 1 /* Any */) { context.approximateLength += 3; - return ts.factory.createKeywordTypeNode(type === intrinsicMarkerType ? 136 /* IntrinsicKeyword */ : 128 /* AnyKeyword */); + return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */); + return ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(147 /* StringKeyword */); + return ts.factory.createKeywordTypeNode(146 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(144 /* NumberKeyword */); + return ts.factory.createKeywordTypeNode(143 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(155 /* BigIntKeyword */); + return ts.factory.createKeywordTypeNode(154 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; @@ -47376,23 +46199,10 @@ var ts; if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); var parentName = symbolToTypeNode(parentSymbol, context, 788968 /* Type */); - if (getDeclaredTypeOfSymbol(parentSymbol) === type) { - return parentName; - } - var memberName = ts.symbolName(type.symbol); - if (ts.isIdentifierText(memberName, 0 /* ES3 */)) { - return appendReferenceToType(parentName, ts.factory.createTypeReferenceNode(memberName, /*typeArguments*/ undefined)); - } - if (ts.isImportTypeNode(parentName)) { - parentName.isTypeOf = true; // mutably update, node is freshly manufactured anyhow - return ts.factory.createIndexedAccessTypeNode(parentName, ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName))); - } - else if (ts.isTypeReferenceNode(parentName)) { - return ts.factory.createIndexedAccessTypeNode(ts.factory.createTypeQueryNode(parentName.typeName), ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName))); - } - else { - return ts.Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`."); - } + var enumLiteralName = getDeclaredTypeOfSymbol(parentSymbol) === type + ? parentName + : appendReferenceToType(parentName, ts.factory.createTypeReferenceNode(ts.symbolName(type.symbol), /*typeArguments*/ undefined)); + return enumLiteralName; } if (type.flags & 1056 /* EnumLike */) { return symbolToTypeNode(type.symbol, context, 788968 /* Type */); @@ -47425,7 +46235,7 @@ var ts; } } context.approximateLength += 13; - return ts.factory.createTypeOperatorNode(151 /* UniqueKeyword */, ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */)); + return ts.factory.createTypeOperatorNode(150 /* UniqueKeyword */, ts.factory.createKeywordTypeNode(147 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -47433,7 +46243,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */); + return ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -47441,15 +46251,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.factory.createKeywordTypeNode(141 /* NeverKeyword */); + return ts.factory.createKeywordTypeNode(140 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */); + return ts.factory.createKeywordTypeNode(147 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(145 /* ObjectKeyword */); + return ts.factory.createKeywordTypeNode(144 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -47517,19 +46327,7 @@ var ts; var indexedType = type.type; context.approximateLength += 6; var indexTypeNode = typeToTypeNodeHelper(indexedType, context); - return ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, indexTypeNode); - } - if (type.flags & 134217728 /* TemplateLiteral */) { - var texts_1 = type.texts; - var types_1 = type.types; - var templateHead = ts.factory.createTemplateHead(texts_1[0]); - var templateSpans = ts.factory.createNodeArray(ts.map(types_1, function (t, i) { return ts.factory.createTemplateLiteralTypeSpan(typeToTypeNodeHelper(t, context), (i < types_1.length - 1 ? ts.factory.createTemplateMiddle : ts.factory.createTemplateTail)(texts_1[i + 1])); })); - context.approximateLength += 2; - return ts.factory.createTemplateLiteralType(templateHead, templateSpans); - } - if (type.flags & 268435456 /* StringMapping */) { - var typeNode = typeToTypeNodeHelper(type.type, context); - return symbolToTypeNode(type.symbol, context, 788968 /* Type */, [typeNode]); + return ts.factory.createTypeOperatorNode(137 /* KeyOfKeyword */, indexTypeNode); } if (type.flags & 8388608 /* IndexedAccess */) { var objectTypeNode = typeToTypeNodeHelper(type.objectType, context); @@ -47574,15 +46372,14 @@ var ts; if (isMappedTypeWithKeyofConstraintDeclaration(type)) { // We have a { [P in keyof T]: X } // We do this to ensure we retain the toplevel keyof-ness of the type which may be lost due to keyof distribution during `getConstraintTypeFromMappedType` - appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context)); + appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(137 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context)); } else { appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type), context); } var typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type), context, appropriateConstraintTypeNode); - var nameTypeNode = type.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type), context) : undefined; var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); - var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode); + var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); context.approximateLength += 10; return ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */); } @@ -47591,16 +46388,16 @@ var ts; var typeId = type.id; var symbol = type.symbol; if (symbol) { - var isInstanceType = isClassInstanceSide(type) ? 788968 /* Type */ : 111551 /* Value */; if (isJSConstructor(symbol.valueDeclaration)) { // Instance and static types share the same symbol; only add 'typeof' for the static side. + var isInstanceType = type === getDeclaredTypeOfClassOrInterface(symbol) ? 788968 /* Type */ : 111551 /* Value */; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 221 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 218 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { - return symbolToTypeNode(symbol, context, isInstanceType); + return symbolToTypeNode(symbol, context, 111551 /* Value */); } else if ((_a = context.visitedTypes) === null || _a === void 0 ? void 0 : _a.has(typeId)) { // If type is an anonymous type literal in a type alias declaration, use type alias name @@ -47628,7 +46425,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 297 /* SourceFile */ || declaration.parent.kind === 257 /* ModuleBlock */; + return declaration.parent.kind === 294 /* SourceFile */ || declaration.parent.kind === 254 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -47679,12 +46476,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 174 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 173 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 175 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 174 /* ConstructorType */, context); return signatureNode; } } @@ -47705,7 +46502,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.factory.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -47729,12 +46526,12 @@ var ts; } } var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode(tupleConstituentNodes), 1 /* SingleLine */); - return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode([]), 1 /* SingleLine */); - return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -47762,10 +46559,10 @@ var ts; // the default outer type arguments), we don't show the group. if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { var typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start, i), context); - var flags_3 = context.flags; + var flags_2 = context.flags; context.flags |= 16 /* ForbidIndexedAccessSymbolReferences */; var ref = symbolToTypeNode(parent, context, 788968 /* Type */, typeArgumentSlice); - context.flags = flags_3; + context.flags = flags_2; resultType = !resultType ? ref : appendReferenceToType(resultType, ref); } } @@ -47841,11 +46638,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 169 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 168 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 170 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 169 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -47921,7 +46718,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 164 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 163 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); typeElements.push(preserveCommentsOn(methodDeclaration)); } } @@ -47936,7 +46733,7 @@ var ts; propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(141 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -47944,8 +46741,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 328 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 328 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -47977,8 +46774,8 @@ var ts; var seenNames = mayHaveNameCollisions ? ts.createUnderscoreEscapedMultiMap() : undefined; var result_4 = []; var i = 0; - for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { - var type = types_2[_i]; + for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { + var type = types_1[_i]; i++; if (checkTruncationLength(context) && (i + 2 < types.length - 1)) { result_4.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", /*typeArguments*/ undefined)); @@ -48013,8 +46810,8 @@ var ts; var b = _b[0]; return typesAreSameReference(a, b); })) { - for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { - var _a = types_3[_i], type = _a[0], resultIndex = _a[1]; + for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { + var _a = types_2[_i], type = _a[0], resultIndex = _a[1]; result_4[resultIndex] = typeToTypeNodeHelper(type, context); } } @@ -48031,7 +46828,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context, typeNode) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 /* String */ ? 147 /* StringKeyword */ : 144 /* NumberKeyword */); + var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 /* String */ ? 146 /* StringKeyword */ : 143 /* NumberKeyword */); var indexingParameter = ts.factory.createParameterDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -48046,7 +46843,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.factory.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.factory.createToken(141 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context, options) { var _a, _b, _c, _d; @@ -48061,9 +46858,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var expandedParams = getExpandedParameters(signature, /*skipUnionExpanding*/ true)[0]; - // If the expanded parameter list had a variadic in a non-trailing position, don't expand it - var parameters = (ts.some(expandedParams, function (p) { return p !== expandedParams[expandedParams.length - 1] && !!(ts.getCheckFlags(p) & 32768 /* RestParameter */); }) ? signature.parameters : expandedParams).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 166 /* Constructor */, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); }); + var parameters = getExpandedParameters(signature, /*skipUnionExpanding*/ true)[0].map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 165 /* Constructor */, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -48090,20 +46885,20 @@ var ts; } } context.approximateLength += 3; // Usually a signature contributes a few more characters than this, but 3 is the minimum - var node = kind === 169 /* CallSignature */ ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) : - kind === 170 /* ConstructSignature */ ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : - kind === 164 /* MethodSignature */ ? ts.factory.createMethodSignature(options === null || options === void 0 ? void 0 : options.modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : - kind === 165 /* MethodDeclaration */ ? ts.factory.createMethodDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) : - kind === 166 /* Constructor */ ? ts.factory.createConstructorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, /*body*/ undefined) : - kind === 167 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) : - kind === 168 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, /*body*/ undefined) : - kind === 171 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, returnTypeNode) : - kind === 308 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) : - kind === 174 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : - kind === 175 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : - kind === 251 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) : - kind === 208 /* FunctionExpression */ ? ts.factory.createFunctionExpression(options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) : - kind === 209 /* ArrowFunction */ ? ts.factory.createArrowFunction(options === null || options === void 0 ? void 0 : options.modifiers, typeParameters, parameters, returnTypeNode, /*equalsGreaterThanToken*/ undefined, ts.factory.createBlock([])) : + var node = kind === 168 /* CallSignature */ ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) : + kind === 169 /* ConstructSignature */ ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : + kind === 163 /* MethodSignature */ ? ts.factory.createMethodSignature(options === null || options === void 0 ? void 0 : options.modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : + kind === 164 /* MethodDeclaration */ ? ts.factory.createMethodDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) : + kind === 165 /* Constructor */ ? ts.factory.createConstructorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, /*body*/ undefined) : + kind === 166 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) : + kind === 167 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, /*body*/ undefined) : + kind === 170 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, returnTypeNode) : + kind === 304 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) : + kind === 173 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : + kind === 174 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : + kind === 248 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) : + kind === 205 /* FunctionExpression */ ? ts.factory.createFunctionExpression(options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) : + kind === 206 /* ArrowFunction */ ? ts.factory.createArrowFunction(options === null || options === void 0 ? void 0 : options.modifiers, typeParameters, parameters, returnTypeNode, /*equalsGreaterThanToken*/ undefined, ts.factory.createBlock([])) : ts.Debug.assertNever(kind); if (typeArguments) { node.typeArguments = ts.factory.createNodeArray(typeArguments); @@ -48125,9 +46920,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 160 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 159 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 326 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 322 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -48142,7 +46937,7 @@ var ts; var dotDotDotToken = isRest ? ts.factory.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 78 /* Identifier */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 157 /* QualifiedName */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 156 /* QualifiedName */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -48307,11 +47102,11 @@ var ts; } function getSpecifierForModuleSymbol(symbol, context) { var _a; - var file = ts.getDeclarationOfKind(symbol, 297 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 294 /* SourceFile */); if (!file) { var equivalentFileSymbol = ts.firstDefined(symbol.declarations, function (d) { return getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol); }); if (equivalentFileSymbol) { - file = ts.getDeclarationOfKind(equivalentFileSymbol, 297 /* SourceFile */); + file = ts.getDeclarationOfKind(equivalentFileSymbol, 294 /* SourceFile */); } } if (file && file.moduleName !== undefined) { @@ -48350,7 +47145,7 @@ var ts; // specifier preference var moduleResolverHost = context.tracker.moduleResolverHost; var specifierCompilerOptions = isBundle_1 ? __assign(__assign({}, compilerOptions), { baseUrl: moduleResolverHost.getCommonSourceDirectory() }) : compilerOptions; - specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative", importModuleSpecifierEnding: isBundle_1 ? "minimal" : undefined })); + specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative" })); (_a = links.specifierCache) !== null && _a !== void 0 ? _a : (links.specifierCache = new ts.Map()); links.specifierCache.set(contextFile.path, specifier); } @@ -48656,7 +47451,7 @@ var ts; } var oldFlags = context.flags; if (type.flags & 8192 /* UniqueESSymbol */ && - type.symbol === symbol && (!context.enclosingDeclaration || ts.some(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === ts.getSourceFileOfNode(context.enclosingDeclaration); }))) { + type.symbol === symbol) { context.flags |= 1048576 /* AllowUniqueESSymbolType */; } var result = typeToTypeNodeHelper(type, context); @@ -48689,17 +47484,17 @@ var ts; function visitExistingNodeTreeSymbols(node) { var _a, _b; // We don't _actually_ support jsdoc namepath types, emit `any` instead - if (ts.isJSDocAllType(node) || node.kind === 310 /* JSDocNamepathType */) { + if (ts.isJSDocAllType(node) || node.kind === 306 /* JSDocNamepathType */) { return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */); + return ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createLiteralTypeNode(ts.factory.createNull())]); } if (ts.isJSDocOptionalType(node)) { - return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)]); + return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -48813,8 +47608,8 @@ var ts; } } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 165 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 164 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 164 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 163 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -49093,50 +47888,38 @@ var ts; if (textRange && ts.isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) { textRange = textRange.parent.parent; } - var propertyAccessRequire = ts.find(symbol.declarations, ts.isPropertyAccessExpression); - if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right) - && type.symbol && ts.isSourceFile(type.symbol.valueDeclaration)) { - var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right; + var statement = ts.setTextRange(ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ + ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) + ], flags)), textRange); + addResult(statement, name !== localName ? modifierFlags & ~1 /* Export */ : modifierFlags); + if (name !== localName && !isPrivate) { + // We rename the variable declaration we generate for Property symbols since they may have a name which + // conflicts with a local declaration. For example, given input: + // ``` + // function g() {} + // module.exports.g = g + // ``` + // In such a situation, we have a local variable named `g`, and a separate exported variable named `g`. + // Naively, we would emit + // ``` + // function g() {} + // export const g: typeof g; + // ``` + // That's obviously incorrect - the `g` in the type annotation needs to refer to the local `g`, but + // the export declaration shadows it. + // To work around that, we instead write + // ``` + // function g() {} + // const g_1: typeof g; + // export { g_1 as g }; + // ``` + // To create an export named `g` that does _not_ shadow the local `g` addResult(ts.factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(alias, localName)])), 0 /* None */); - context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551 /* Value */); - } - else { - var statement = ts.setTextRange(ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ - ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) - ], flags)), textRange); - addResult(statement, name !== localName ? modifierFlags & ~1 /* Export */ : modifierFlags); - if (name !== localName && !isPrivate) { - // We rename the variable declaration we generate for Property symbols since they may have a name which - // conflicts with a local declaration. For example, given input: - // ``` - // function g() {} - // module.exports.g = g - // ``` - // In such a situation, we have a local variable named `g`, and a separate exported variable named `g`. - // Naively, we would emit - // ``` - // function g() {} - // export const g: typeof g; - // ``` - // That's obviously incorrect - the `g` in the type annotation needs to refer to the local `g`, but - // the export declaration shadows it. - // To work around that, we instead write - // ``` - // function g() {} - // const g_1: typeof g; - // export { g_1 as g }; - // ``` - // To create an export named `g` that does _not_ shadow the local `g` - addResult(ts.factory.createExportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, - /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0 /* None */); - needsExportDeclaration = false; - needsPostExportDefault = false; - } + /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0 /* None */); + needsExportDeclaration = false; + needsPostExportDefault = false; } } } @@ -49158,8 +47941,7 @@ var ts; if ((symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && (!isConstMergedWithNS || isTypeOnlyNamespace(symbol))) || isConstMergedWithNSPrintableAsSignatureMerge) { serializeModule(symbol, symbolName, modifierFlags); } - // The class meaning serialization should handle serializing all interface members - if (symbol.flags & 64 /* Interface */ && !(symbol.flags & 32 /* Class */)) { + if (symbol.flags & 64 /* Interface */) { serializeInterface(symbol, symbolName, modifierFlags); } if (symbol.flags & 2097152 /* Alias */) { @@ -49254,8 +48036,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 169 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 170 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 168 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 169 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.factory.createHeritageClause(93 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b, 111551 /* Value */); }))]; addResult(ts.factory.createInterfaceDeclaration( @@ -49324,7 +48106,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 251 /* FunctionDeclaration */, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); + var decl = signatureToSignatureDeclarationHelper(sig, 248 /* FunctionDeclaration */, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); // for expressions assigned to `var`s, use the `var` as the text range addResult(ts.setTextRange(decl, sig.declaration && ts.isVariableDeclaration(sig.declaration.parent) && sig.declaration.parent.parent || sig.declaration), modifierFlags); } @@ -49387,7 +48169,7 @@ var ts; } function isNamespaceMember(p) { return !!(p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) || - !(p.flags & 4194304 /* Prototype */ || p.escapedName === "prototype" || p.valueDeclaration && ts.getEffectiveModifierFlags(p.valueDeclaration) & 32 /* Static */ && ts.isClassLike(p.valueDeclaration.parent)); + !(p.flags & 4194304 /* Prototype */ || p.escapedName === "prototype" || p.valueDeclaration && ts.isClassLike(p.valueDeclaration.parent)); } function serializeAsClass(symbol, localName, modifierFlags) { var _a; @@ -49438,14 +48220,13 @@ var ts; !ts.some(getSignaturesOfType(staticType, 1 /* Construct */)); var constructors = isNonConstructableClassLikeInJsFile ? [ts.factory.createConstructorDeclaration(/*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags(8 /* Private */), [], /*body*/ undefined)] : - serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 166 /* Constructor */); + serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 165 /* Constructor */); var indexSignatures = serializeIndexSignatures(classType, baseTypes[0]); addResult(ts.setTextRange(ts.factory.createClassDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, localName, typeParamDecls, heritageClauses, __spreadArrays(indexSignatures, staticMembers, constructors, publicProperties, privateProperties)), symbol.declarations && ts.filter(symbol.declarations, function (d) { return ts.isClassDeclaration(d) || ts.isClassExpression(d); })[0]), modifierFlags); } function serializeAsAlias(symbol, localName, modifierFlags) { - var _a, _b, _c, _d, _e; // synthesize an alias, eg `export { symbolName as Name }` // need to mark the alias `symbol` points at // as something we need to serialize as a private declaration as well @@ -49464,66 +48245,23 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 198 /* BindingElement */: - if (((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.kind) === 249 /* VariableDeclaration */) { - // const { SomeClass } = require('./lib'); - var specifier_1 = getSpecifierForModuleSymbol(target.parent || target, context); // './lib' - var propertyName = node.propertyName; - addResult(ts.factory.createImportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1)), 0 /* None */); - break; - } - // We don't know how to serialize this (nested?) binding element - ts.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization"); - break; - case 289 /* ShorthandPropertyAssignment */: - if (((_e = (_d = node.parent) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.kind) === 216 /* BinaryExpression */) { - // module.exports = { SomeClass } - serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), targetName); - } - break; - case 249 /* VariableDeclaration */: - // commonjs require: const x = require('y') - if (ts.isPropertyAccessExpression(node.initializer)) { - // const x = require('y').z - var initializer = node.initializer; // require('y').z - var uniqueName = ts.factory.createUniqueName(localName); // _x - var specifier_2 = getSpecifierForModuleSymbol(target.parent || target, context); // 'y' - // import _x = require('y'); - addResult(ts.factory.createImportEqualsDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, uniqueName, ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(specifier_2))), 0 /* None */); - // import x = _x.z - addResult(ts.factory.createImportEqualsDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.factory.createIdentifier(localName), ts.factory.createQualifiedName(uniqueName, initializer.name)), modifierFlags); - break; - } - // else fall through and treat commonjs require just like import= - case 260 /* ImportEqualsDeclaration */: - // This _specifically_ only exists to handle json declarations - where we make aliases, but since - // we emit no declarations for the json document, must not refer to it in the declarations - if (target.escapedName === "export=" /* ExportEquals */ && ts.some(target.declarations, ts.isJsonSourceFile)) { - serializeMaybeAliasAssignment(symbol); - break; - } + case 257 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` - var isLocalImport = !(target.flags & 512 /* ValueModule */) && !ts.isVariableDeclaration(node); + var isLocalImport = !(target.flags & 512 /* ValueModule */); addResult(ts.factory.createImportEqualsDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createIdentifier(localName), isLocalImport ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) - : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))), isLocalImport ? modifierFlags : 0 /* None */); + : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.factory.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, ts.factory.createIdentifier(localName), /*namedBindings*/ undefined), @@ -49532,18 +48270,18 @@ var ts; // In such cases, the `target` refers to the module itself already ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*importClause*/ undefined, ts.factory.createNamespaceImport(ts.factory.createIdentifier(localName))), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: addResult(ts.factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, ts.factory.createNamespaceExport(ts.factory.createIdentifier(localName)), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause( @@ -49552,7 +48290,7 @@ var ts; ts.factory.createImportSpecifier(localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName)) ])), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -49560,12 +48298,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.factory.createStringLiteral(specifier.text) : undefined); break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 216 /* BinaryExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 213 /* BinaryExpression */: + case 198 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -49596,7 +48333,7 @@ var ts; var name = ts.unescapeLeadingUnderscores(symbol.escapedName); var isExportEquals = name === "export=" /* ExportEquals */; var isDefault = name === "default" /* Default */; - var isExportAssignmentCompatibleSymbolName = isExportEquals || isDefault; + var isExportAssignment = isExportEquals || isDefault; // synthesize export = ref // ref should refer to either be a locally scoped symbol which we need to emit, or // a reference to another namespace/module which we may need to emit an `import` statement for @@ -49608,8 +48345,8 @@ var ts; // In case `target` refers to a namespace member, look at the declaration and serialize the leftmost symbol in it // eg, `namespace A { export class B {} }; exports = A.B;` // Technically, this is all that's required in the case where the assignment is an entity name expression - var expr = aliasDecl && ((ts.isExportAssignment(aliasDecl) || ts.isBinaryExpression(aliasDecl)) ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl)); - var first_1 = expr && ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; + var expr = isExportAssignment ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl); + var first_1 = ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; var referenced = first_1 && resolveEntityName(first_1, 67108863 /* All */, /*ignoreErrors*/ true, /*dontResolveAlias*/ true, enclosingDeclaration); if (referenced || target) { includePrivateSymbol(referenced || target); @@ -49621,17 +48358,17 @@ var ts; // into the containing scope anyway, so we want to skip the visibility checks. var oldTrack = context.tracker.trackSymbol; context.tracker.trackSymbol = ts.noop; - if (isExportAssignmentCompatibleSymbolName) { + if (isExportAssignment) { results.push(ts.factory.createExportAssignment( /*decorators*/ undefined, /*modifiers*/ undefined, isExportEquals, symbolToExpression(target, context, 67108863 /* All */))); } else { - if (first_1 === expr && first_1) { + if (first_1 === expr) { // serialize as `export {target as name}` serializeExportSpecifier(name, ts.idText(first_1)); } - else if (expr && ts.isClassExpression(expr)) { + else if (ts.isClassExpression(expr)) { serializeExportSpecifier(name, getInternalSymbolName(target, ts.symbolName(target))); } else { @@ -49654,19 +48391,15 @@ var ts; var typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol))); if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) { // If there are no index signatures and `typeToSerialize` is an object type, emit as a namespace instead of a const - serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 1 /* Export */); + serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignment ? 0 /* None */ : 1 /* Export */); } else { var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ ts.factory.createVariableDeclaration(varName, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) ], 2 /* Const */)); - // Inlined JSON types exported with [module.]exports= will already emit an export=, so should use `declare`. - // Otherwise, the type itself should be exported. - addResult(statement, target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ? 2 /* Ambient */ - : name === varName ? 1 /* Export */ - : 0 /* None */); + addResult(statement, name === varName ? 1 /* Export */ : 0 /* None */); } - if (isExportAssignmentCompatibleSymbolName) { + if (isExportAssignment) { results.push(ts.factory.createExportAssignment( /*decorators*/ undefined, /*modifiers*/ undefined, isExportEquals, ts.factory.createIdentifier(varName))); @@ -49687,8 +48420,7 @@ var ts; return ts.getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !getIndexInfoOfType(typeToSerialize, 0 /* String */) && !getIndexInfoOfType(typeToSerialize, 1 /* Number */) && - !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class - !!(ts.length(ts.filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || ts.length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && + !!(ts.length(getPropertiesOfType(typeToSerialize)) || ts.length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !ts.length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && ts.some(typeToSerialize.symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== ctxSrc; })) && @@ -49736,7 +48468,7 @@ var ts; } // This is an else/if as accessors and properties can't merge in TS, but might in JS // If this happens, we assume the accessor takes priority, as it imposes more constraints - else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) { + else if (p.flags & (4 /* Property */ | 3 /* Variable */)) { return ts.setTextRange(createProperty( /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined, isPrivate ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357 @@ -49979,7 +48711,7 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = ts.walkUpParenthesizedTypes(type.symbol.declarations[0].parent); - if (node.kind === 254 /* TypeAliasDeclaration */) { + if (node.kind === 251 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -49987,11 +48719,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 257 /* ModuleBlock */ && + node.parent.kind === 254 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 297 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 294 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -50050,17 +48782,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 249 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 246 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 221 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 218 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -50077,28 +48809,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 325 /* JSDocEnumTag */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 321 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 251 /* FunctionDeclaration */: - case 255 /* EnumDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 248 /* FunctionDeclaration */: + case 252 /* EnumDeclaration */: + case 257 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -50106,55 +48838,55 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 260 /* ImportEqualsDeclaration */ && parent.kind !== 297 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 257 /* ImportEqualsDeclaration */ && parent.kind !== 294 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasEffectiveModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 166 /* Constructor */: - case 170 /* ConstructSignature */: - case 169 /* CallSignature */: - case 171 /* IndexSignature */: - case 160 /* Parameter */: - case 257 /* ModuleBlock */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 177 /* TypeLiteral */: - case 173 /* TypeReference */: - case 178 /* ArrayType */: - case 179 /* TupleType */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: + case 165 /* Constructor */: + case 169 /* ConstructSignature */: + case 168 /* CallSignature */: + case 170 /* IndexSignature */: + case 159 /* Parameter */: + case 254 /* ModuleBlock */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 176 /* TypeLiteral */: + case 172 /* TypeReference */: + case 177 /* ArrayType */: + case 178 /* TupleType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: return false; // Type parameters are always visible - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 297 /* SourceFile */: - case 259 /* NamespaceExportDeclaration */: + case 294 /* SourceFile */: + case 256 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return false; default: return false; @@ -50163,10 +48895,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 266 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 263 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 270 /* ExportSpecifier */) { + else if (node.parent.kind === 267 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -50271,12 +49003,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 249 /* VariableDeclaration */: - case 250 /* VariableDeclarationList */: - case 265 /* ImportSpecifier */: - case 264 /* NamedImports */: - case 263 /* NamespaceImport */: - case 262 /* ImportClause */: + case 246 /* VariableDeclaration */: + case 247 /* VariableDeclarationList */: + case 262 /* ImportSpecifier */: + case 261 /* NamedImports */: + case 260 /* NamespaceImport */: + case 259 /* ImportClause */: return false; default: return true; @@ -50361,13 +49093,9 @@ var ts; var propName = getDestructuringPropertyName(node); if (propName) { var literal = ts.setTextRange(ts.parseNodeFactory.createStringLiteral(propName), node); - var lhsExpr = ts.isLeftHandSideExpression(parentAccess) ? parentAccess : ts.parseNodeFactory.createParenthesizedExpression(parentAccess); - var result = ts.setTextRange(ts.parseNodeFactory.createElementAccessExpression(lhsExpr, literal), node); + var result = ts.setTextRange(ts.parseNodeFactory.createElementAccessExpression(parentAccess, literal), node); ts.setParent(literal, result); ts.setParent(result, node); - if (lhsExpr !== parentAccess) { - ts.setParent(lhsExpr, result); - } result.flowNode = parentAccess.flowNode; return result; } @@ -50376,23 +49104,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 198 /* BindingElement */: - case 288 /* PropertyAssignment */: + case 195 /* BindingElement */: + case 285 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ancestor.initializer; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 198 /* BindingElement */ && parent.kind === 196 /* ObjectBindingPattern */) { + if (node.kind === 195 /* BindingElement */ && parent.kind === 193 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 288 /* PropertyAssignment */ || node.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.kind === 285 /* PropertyAssignment */ || node.kind === 286 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -50418,7 +49146,7 @@ var ts; parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); } var type; - if (pattern.kind === 196 /* ObjectBindingPattern */) { + if (pattern.kind === 193 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -50438,7 +49166,7 @@ var ts; // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name = declaration.propertyName || declaration.name; var indexType = getLiteralTypeFromPropertyName(name); - var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */), declaration.name); + var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, name), declaration.name); type = getFlowTypeOfDestructuring(declaration, declaredType); } } @@ -50446,7 +49174,7 @@ var ts; // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern); + var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */, parentType, undefinedType, pattern); var index_2 = pattern.elements.indexOf(declaration); if (declaration.dotDotDotToken) { // If the parent is a tuple type, the rest element has a tuple type of the @@ -50459,7 +49187,7 @@ var ts; else if (isArrayLikeType(parentType)) { var indexType = getLiteralType(index_2); var accessFlags = hasDefaultValue(declaration) ? 8 /* NoTupleBoundsCheck */ : 0; - var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, declaration.name, accessFlags | 16 /* ExpressionPosition */) || errorType, declaration.name); + var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, declaration.name, accessFlags) || errorType, declaration.name); type = getFlowTypeOfDestructuring(declaration, declaredType); } else { @@ -50491,7 +49219,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 199 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 196 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -50501,11 +49229,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 238 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 235 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 236 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -50542,8 +49270,8 @@ var ts; if (ts.isParameter(declaration)) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 168 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 167 /* GetAccessor */); + if (func.kind === 167 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 166 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -50610,11 +49338,10 @@ var ts; if (symbol.valueDeclaration && ts.isBinaryExpression(symbol.valueDeclaration)) { var links = getSymbolLinks(symbol); if (links.isConstructorDeclaredProperty === undefined) { - links.isConstructorDeclaredProperty = false; links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && ts.every(symbol.declarations, function (declaration) { return ts.isBinaryExpression(declaration) && - isPossiblyAliasedThisProperty(declaration) && - (declaration.left.kind !== 202 /* ElementAccessExpression */ || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && + ts.getAssignmentDeclarationKind(declaration) === 4 /* ThisProperty */ && + (declaration.left.kind !== 199 /* ElementAccessExpression */ || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(/*declaredType*/ undefined, declaration, symbol, declaration); }); } @@ -50633,16 +49360,13 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; var container = ts.getThisContainer(declaration, /*includeArrowFunctions*/ false); - if (container && (container.kind === 166 /* Constructor */ || isJSConstructor(container))) { + if (container && (container.kind === 165 /* Constructor */ || isJSConstructor(container))) { return container; } } } function getFlowTypeInConstructor(symbol, constructor) { - var accessName = ts.startsWith(symbol.escapedName, "__#") - ? ts.factory.createPrivateIdentifier(symbol.escapedName.split("@")[1]) - : ts.unescapeLeadingUnderscores(symbol.escapedName); - var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), accessName); + var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), ts.unescapeLeadingUnderscores(symbol.escapedName)); ts.setParent(reference.expression, reference); ts.setParent(reference, constructor); reference.flowNode = constructor.returnFlowNode; @@ -50690,7 +49414,7 @@ var ts; var kind = ts.isAccessExpression(expression) ? ts.getAssignmentDeclarationPropertyAccessKind(expression) : ts.getAssignmentDeclarationKind(expression); - if (kind === 4 /* ThisProperty */ || ts.isBinaryExpression(expression) && isPossiblyAliasedThisProperty(expression, kind)) { + if (kind === 4 /* ThisProperty */) { if (isDeclarationInConstructor(expression)) { definedInConstructor = true; } @@ -50807,7 +49531,6 @@ var ts; var exportedType = resolveStructuredTypeMembers(type); var members_4 = ts.createSymbolTable(); ts.copyEntries(exportedType.members, members_4); - var initialSize = members_4.size; if (resolvedSymbol && !resolvedSymbol.exports) { resolvedSymbol.exports = ts.createSymbolTable(); } @@ -50846,12 +49569,8 @@ var ts; members_4.set(name, s); } }); - var result = createAnonymousType(initialSize !== members_4.size ? undefined : exportedType.symbol, // Only set the type's symbol if it looks to be the same as the original type - members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo); + var result = createAnonymousType(exportedType.symbol, members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo); result.objectFlags |= (ts.getObjectFlags(type) & 16384 /* JSLiteral */); // Propagate JSLiteral flag - if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) { - result.objectFlags |= 1073741824 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type - } return result; } if (isEmptyArrayLiteralType(type)) { @@ -50869,9 +49588,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 166 /* Constructor */ || - thisContainer.kind === 251 /* FunctionDeclaration */ || - (thisContainer.kind === 208 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 165 /* Constructor */ || + thisContainer.kind === 248 /* FunctionDeclaration */ || + (thisContainer.kind === 205 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -50941,7 +49660,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var restElement = lastElement && lastElement.kind === 198 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : undefined; + var restElement = lastElement && lastElement.kind === 195 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : undefined; if (elements.length === 0 || elements.length === 1 && restElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -50966,7 +49685,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 196 /* ObjectBindingPattern */ + return pattern.kind === 193 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -51005,7 +49724,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 160 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 159 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -51068,7 +49787,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 266 /* ExportAssignment */) { + if (declaration.kind === 263 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -51139,7 +49858,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 167 /* GetAccessor */) { + if (accessor.kind === 166 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -51173,15 +49892,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 166 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 168 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 166 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 167 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -51232,9 +49951,9 @@ var ts; var links = getSymbolLinks(symbol); var originalLinks = links; if (!links.type) { - var expando = symbol.valueDeclaration && getSymbolOfExpando(symbol.valueDeclaration, /*allowDeclaration*/ false); - if (expando) { - var merged = mergeJSSymbols(symbol, expando); + var jsDeclaration = symbol.valueDeclaration && ts.getDeclarationOfExpando(symbol.valueDeclaration); + if (jsDeclaration) { + var merged = mergeJSSymbols(symbol, getSymbolOfNode(jsDeclaration)); if (merged) { // note:we overwrite links because we just cloned the symbol symbol = links = merged; @@ -51249,9 +49968,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration && (declaration.kind === 216 /* BinaryExpression */ || + else if (declaration && (declaration.kind === 213 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 216 /* BinaryExpression */)) { + declaration.parent.kind === 213 /* BinaryExpression */)) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -51318,7 +50037,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 160 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 159 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -51417,43 +50136,43 @@ var ts; return undefined; } switch (node.kind) { - case 232 /* VariableStatement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 308 /* JSDocFunctionType */: - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: - case 331 /* JSDocTypedefTag */: - case 325 /* JSDocEnumTag */: - case 324 /* JSDocCallbackTag */: - case 190 /* MappedType */: - case 184 /* ConditionalType */: + case 229 /* VariableStatement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 304 /* JSDocFunctionType */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: + case 327 /* JSDocTypedefTag */: + case 321 /* JSDocEnumTag */: + case 320 /* JSDocCallbackTag */: + case 189 /* MappedType */: + case 183 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 190 /* MappedType */) { + if (node.kind === 189 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 184 /* ConditionalType */) { + else if (node.kind === 183 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } - else if (node.kind === 232 /* VariableStatement */ && !ts.isInJSFile(node)) { + else if (node.kind === 229 /* VariableStatement */ && !ts.isInJSFile(node)) { break; } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */ || node.kind === 253 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */ || node.kind === 250 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: var paramSymbol = ts.getParameterSymbolFromJSDoc(node); if (paramSymbol) { node = paramSymbol.valueDeclaration; @@ -51464,7 +50183,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 250 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -51474,9 +50193,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 253 /* InterfaceDeclaration */ || - node.kind === 252 /* ClassDeclaration */ || - node.kind === 221 /* ClassExpression */ || + if (node.kind === 250 /* InterfaceDeclaration */ || + node.kind === 249 /* ClassDeclaration */ || + node.kind === 218 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -51620,7 +50339,7 @@ var ts; if (!popTypeResolution()) { for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 252 /* ClassDeclaration */ || declaration.kind === 253 /* InterfaceDeclaration */) { + if (declaration.kind === 249 /* ClassDeclaration */ || declaration.kind === 250 /* InterfaceDeclaration */) { reportCircularBaseType(declaration, type); } } @@ -51715,7 +50434,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 253 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 250 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -51751,7 +50470,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 253 /* InterfaceDeclaration */) { + if (declaration.kind === 250 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -51839,7 +50558,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 216 /* BinaryExpression */) { + else if (expr.kind === 213 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -51854,12 +50573,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 78 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -51873,7 +50592,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 255 /* EnumDeclaration */) { + if (declaration.kind === 252 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -51900,7 +50619,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 255 /* EnumDeclaration */) { + if (declaration.kind === 252 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -51973,21 +50692,21 @@ var ts; function isThislessType(node) { switch (node.kind) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: - case 145 /* ObjectKeyword */: + case 147 /* SymbolKeyword */: + case 144 /* ObjectKeyword */: case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: - case 191 /* LiteralType */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: + case 190 /* LiteralType */: return true; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return isThislessType(node.elementType); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -52013,7 +50732,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 166 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 165 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -52029,14 +50748,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -52241,7 +50960,7 @@ var ts; links[resolutionKind] = earlySymbols || emptySymbols; // fill in any as-yet-unresolved late-bound members. var lateSymbols = ts.createSymbolTable(); - for (var _i = 0, _a = symbol.declarations || ts.emptyArray; _i < _a.length; _i++) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var members = ts.getMembersOfDeclaration(decl); if (members) { @@ -52260,7 +50979,7 @@ var ts; var member = decls_1[_c]; var assignmentKind = ts.getAssignmentDeclarationKind(member); var isInstanceMember = assignmentKind === 3 /* PrototypeProperty */ - || ts.isBinaryExpression(member) && isPossiblyAliasedThisProperty(member, assignmentKind) + || assignmentKind === 4 /* ThisProperty */ || assignmentKind === 9 /* ObjectDefinePrototypeProperty */ || assignmentKind === 6 /* Prototype */; // A straight `Prototype` assignment probably can never have a computed name if (isStatic === !isInstanceMember && hasLateBindableName(member)) { @@ -52383,7 +51102,6 @@ var ts; sig.resolvedReturnType = resolvedReturnType; sig.resolvedTypePredicate = resolvedTypePredicate; sig.minArgumentCount = minArgumentCount; - sig.resolvedMinArgumentCount = undefined; sig.target = undefined; sig.mapper = undefined; sig.unionSignatures = undefined; @@ -52627,8 +51345,8 @@ var ts; function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; - for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { - var type = types_4[_i]; + for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { + var type = types_3[_i]; var indexInfo = getIndexInfoOfType(getApparentType(type), kind); if (!indexInfo) { return undefined; @@ -52827,6 +51545,9 @@ var ts; // bound includes those keys that are known to always be present, for example because // because of constraints on type parameters (e.g. 'keyof T' for a constrained T). function getLowerBoundOfKeyType(type) { + if (type.flags & (1 /* Any */ | 131068 /* Primitive */)) { + return type; + } if (type.flags & 4194304 /* Index */) { var t = getApparentType(type.type); return isGenericTupleType(t) ? getKnownKeysOfTupleType(t) : getIndexType(t); @@ -52847,7 +51568,7 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return getIntersectionType(ts.sameMap(type.types, getLowerBoundOfKeyType)); } - return type; + return neverType; } /** Resolve the members of a mapped type { [P in K]: T } */ function resolveMappedTypeMembers(type) { @@ -52860,7 +51581,6 @@ var ts; // and T as the template type. var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); - var nameType = getNameTypeFromMappedType(type.target || type); var templateType = getTemplateTypeFromMappedType(type.target || type); var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' var templateModifiers = getMappedTypeModifiers(type); @@ -52882,25 +51602,25 @@ var ts; forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType); } setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); - function addMemberForKeyType(keyType) { - var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType; - forEachType(propNameType, function (t) { return addMemberForKeyTypeWorker(keyType, t); }); - } - function addMemberForKeyTypeWorker(keyType, propNameType) { + function addMemberForKeyType(t) { + // Create a mapper from T to the current iteration type constituent. Then, if the + // mapped type is itself an instantiated type, combine the iteration mapper with the + // instantiation mapper. + var templateMapper = appendTypeMapping(type.mapper, typeParameter, t); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. - if (isTypeUsableAsPropertyName(propNameType)) { - var propName = getPropertyNameFromType(propNameType); + if (isTypeUsableAsPropertyName(t)) { + var propName = getPropertyNameFromType(t); // String enum members from separate enums with identical values // are distinct types with the same property name. Make the resulting // property symbol's name type be the union of those enum member types. var existingProp = members.get(propName); if (existingProp) { - existingProp.nameType = getUnionType([existingProp.nameType, propNameType]); - existingProp.keyType = getUnionType([existingProp.keyType, keyType]); + existingProp.nameType = getUnionType([existingProp.nameType, t]); + existingProp.mapper = appendTypeMapping(type.mapper, typeParameter, existingProp.nameType); } else { - var modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : undefined; + var modifiersProp = getPropertyOfType(modifiersType, propName); var isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */); var isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || @@ -52908,19 +51628,19 @@ var ts; var stripOptional = strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */; var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0)); prop.mappedType = type; - prop.nameType = propNameType; - prop.keyType = keyType; if (modifiersProp) { prop.syntheticOrigin = modifiersProp; prop.declarations = modifiersProp.declarations; } + prop.nameType = t; + prop.mapper = templateMapper; members.set(propName, prop); } } - else if (propNameType.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 32 /* Enum */)) { - var propType = instantiateType(templateType, appendTypeMapping(type.mapper, typeParameter, keyType)); - if (propNameType.flags & (1 /* Any */ | 4 /* String */)) { - stringIndexInfo = createIndexInfo(stringIndexInfo ? getUnionType([stringIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */)); + else if (t.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 32 /* Enum */)) { + var propType = instantiateType(templateType, templateMapper); + if (t.flags & (1 /* Any */ | 4 /* String */)) { + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1 /* IncludeReadonly */)); } else { numberIndexInfo = createIndexInfo(numberIndexInfo ? getUnionType([numberIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */)); @@ -52930,14 +51650,12 @@ var ts; } function getTypeOfMappedSymbol(symbol) { if (!symbol.type) { - var mappedType = symbol.mappedType; if (!pushTypeResolution(symbol, 0 /* Type */)) { - mappedType.containsError = true; + symbol.mappedType.containsError = true; return errorType; } - var templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType); - var mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.keyType); - var propType = instantiateType(templateType, mapper); + var templateType = getTemplateTypeFromMappedType(symbol.mappedType.target || symbol.mappedType); + var propType = instantiateType(templateType, symbol.mapper); // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks // mode, if the underlying property is optional we remove 'undefined' from the type. @@ -52945,10 +51663,11 @@ var ts; symbol.checkFlags & 524288 /* StripOptional */ ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType; if (!popTypeResolution()) { - error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType)); + error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(symbol.mappedType)); type = errorType; } symbol.type = type; + symbol.mapper = undefined; } return symbol.type; } @@ -52960,11 +51679,6 @@ var ts; return type.constraintType || (type.constraintType = getConstraintOfTypeParameter(getTypeParameterFromMappedType(type)) || errorType); } - function getNameTypeFromMappedType(type) { - return type.declaration.nameType ? - type.nameType || (type.nameType = instantiateType(getTypeFromTypeNode(type.declaration.nameType), type.mapper)) : - undefined; - } function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? @@ -52976,8 +51690,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 188 /* TypeOperator */ && - constraintDeclaration.operator === 138 /* KeyOfKeyword */; + return constraintDeclaration.kind === 187 /* TypeOperator */ && + constraintDeclaration.operator === 137 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -53111,8 +51825,8 @@ var ts; return getAugmentedPropertiesOfType(unionType); } var props = ts.createSymbolTable(); - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var memberType = types_5[_i]; + for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { + var memberType = types_4[_i]; for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) { var escapedName = _b[_a].escapedName; if (!props.has(escapedName)) { @@ -53144,14 +51858,14 @@ var ts; function getConstraintFromIndexedAccess(type) { var indexConstraint = getSimplifiedTypeOrConstraint(type.indexType); if (indexConstraint && indexConstraint !== type.indexType) { - var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.noUncheckedIndexedAccessCandidate); + var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint); if (indexedAccess) { return indexedAccess; } } var objectConstraint = getSimplifiedTypeOrConstraint(type.objectType); if (objectConstraint && objectConstraint !== type.objectType) { - return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType, type.noUncheckedIndexedAccessCandidate); + return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType); } return undefined; } @@ -53200,9 +51914,9 @@ var ts; function getEffectiveConstraintOfIntersection(types, targetIsUnion) { var constraints; var hasDisjointDomainType = false; - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var t = types_6[_i]; - if (t.flags & 465829888 /* Instantiable */) { + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var t = types_5[_i]; + if (t.flags & 63176704 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -53216,7 +51930,7 @@ var ts; } } } - else if (t.flags & 469892092 /* DisjointDomains */) { + else if (t.flags & 67238908 /* DisjointDomains */) { hasDisjointDomainType = true; } } @@ -53226,9 +51940,9 @@ var ts; if (hasDisjointDomainType) { // We add any types belong to one of the disjoint domains because they might cause the final // intersection operation to reduce the union constraints. - for (var _a = 0, types_7 = types; _a < types_7.length; _a++) { - var t = types_7[_a]; - if (t.flags & 469892092 /* DisjointDomains */) { + for (var _a = 0, types_6 = types; _a < types_6.length; _a++) { + var t = types_6[_a]; + if (t.flags & 67238908 /* DisjointDomains */) { constraints = ts.append(constraints, t); } } @@ -53238,7 +51952,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) { + if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -53260,12 +51974,9 @@ var ts; * circularly references the type variable. */ function getResolvedBaseConstraint(type) { - if (type.resolvedBaseConstraint) { - return type.resolvedBaseConstraint; - } var nonTerminating = false; - var stack = []; - return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type); + return type.resolvedBaseConstraint || + (type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type)); function getImmediateBaseConstraint(t) { if (!t.immediateBaseConstraint) { if (!pushTypeResolution(t, 4 /* ImmediateBaseConstraint */)) { @@ -53276,19 +51987,13 @@ var ts; // very high likelihood we're dealing with an infinite generic type that perpetually generates // new type identities as we descend into it. We stop the recursion here and mark this type // and the outer types as having circular constraints. - ts.tracing.instant("check" /* Check */, "getImmediateBaseConstraint_DepthLimit", { typeId: t.id, originalTypeId: type.id, depth: constraintDepth }); error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); nonTerminating = true; return t.immediateBaseConstraint = noConstraintType; } - var result = void 0; - if (!isDeeplyNestedType(t, stack, stack.length)) { - stack.push(t); - constraintDepth++; - result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false)); - constraintDepth--; - stack.pop(); - } + constraintDepth++; + var result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false)); + constraintDepth--; if (!popTypeResolution()) { if (t.flags & 262144 /* TypeParameter */) { var errorNode = getConstraintDeclaration(t); @@ -53322,8 +52027,8 @@ var ts; if (t.flags & 3145728 /* UnionOrIntersection */) { var types = t.types; var baseTypes = []; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var type_3 = types_8[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var type_3 = types_7[_i]; var baseType = getBaseConstraint(type_3); if (baseType) { baseTypes.push(baseType); @@ -53336,19 +52041,10 @@ var ts; if (t.flags & 4194304 /* Index */) { return keyofConstraintType; } - if (t.flags & 134217728 /* TemplateLiteral */) { - var types = t.types; - var constraints = ts.mapDefined(types, getBaseConstraint); - return constraints.length === types.length ? getTemplateLiteralType(t.texts, constraints) : stringType; - } - if (t.flags & 268435456 /* StringMapping */) { - var constraint = getBaseConstraint(t.type); - return constraint ? getStringMappingType(t.symbol, constraint) : stringType; - } if (t.flags & 8388608 /* IndexedAccess */) { var baseObjectType = getBaseConstraint(t.objectType); var baseIndexType = getBaseConstraint(t.indexType); - var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t.noUncheckedIndexedAccessCandidate); + var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType); return baseIndexedAccess && getBaseConstraint(baseIndexedAccess); } if (t.flags & 16777216 /* Conditional */) { @@ -53415,7 +52111,7 @@ var ts; } function getResolvedApparentTypeOfMappedType(type) { var typeVariable = getHomomorphicTypeVariable(type); - if (typeVariable && !type.declaration.nameType) { + if (typeVariable) { var constraint = getConstraintOfTypeParameter(typeVariable); if (constraint && (isArrayType(constraint) || isTupleType(constraint))) { return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper)); @@ -53429,10 +52125,10 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : - t.flags & 402653316 /* StringLike */ ? globalStringType : + t.flags & 132 /* StringLike */ ? globalStringType : t.flags & 296 /* NumberLike */ ? globalNumberType : t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType(/*reportErrors*/ languageVersion >= 7 /* ES2020 */) : t.flags & 528 /* BooleanLike */ ? globalBooleanType : @@ -53757,10 +52453,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 307 /* JSDocOptionalType */ + node.type && node.type.kind === 303 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 303 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -53779,10 +52475,7 @@ var ts; var signature = getSignatureFromDeclaration(node.parent); var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); - // Only consider syntactic or instantiated parameters as optional, not `void` parameters as this function is used - // in grammar checks and checking for `void` too early results in parameter types widening too early - // and causes some noImplicitAny errors to be lost. - return parameterIndex >= getMinArgumentCount(signature, 1 /* StrongArityForUntypedJS */ | 2 /* VoidIsNonOptional */); + return parameterIndex >= getMinArgumentCount(signature, /*strongArityForUntypedJS*/ true); } var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); if (iife) { @@ -53797,7 +52490,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 303 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -53879,7 +52572,7 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 191 /* LiteralType */) { + if (type && type.kind === 190 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter @@ -53892,16 +52585,16 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 167 /* GetAccessor */ || declaration.kind === 168 /* SetAccessor */) && + if ((declaration.kind === 166 /* GetAccessor */ || declaration.kind === 167 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + var otherKind = declaration.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 166 /* Constructor */ ? + var classType = declaration.kind === 165 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -53966,11 +52659,11 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - return node.name.kind === 158 /* ComputedPropertyName */ + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + return node.name.kind === 157 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -54042,7 +52735,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 187 /* ThisType */ ? + return parameterName.kind === 186 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -54085,7 +52778,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 166 /* Constructor */) { + if (declaration.kind === 165 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -54095,12 +52788,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 167 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 166 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 168 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 167 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -54190,7 +52883,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 166 /* Constructor */ || kind === 170 /* ConstructSignature */ || kind === 175 /* ConstructorType */; + var isConstructor = kind === 165 /* Constructor */ || kind === 169 /* ConstructSignature */ || kind === 174 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -54204,7 +52897,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 144 /* NumberKeyword */ : 147 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 143 /* NumberKeyword */ : 146 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -54238,17 +52931,17 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 185 /* InferType */) { + if (declaration.parent.kind === 184 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. - var _b = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _c = _b[0], childTypeParameter = _c === void 0 ? declaration.parent : _c, grandParent = _b[1]; - if (grandParent.kind === 173 /* TypeReference */) { + var grandParent = declaration.parent.parent; + if (grandParent.kind === 172 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { - var index = typeReference.typeArguments.indexOf(childTypeParameter); + var index = typeReference.typeArguments.indexOf(declaration.parent); if (index < typeParameters.length) { var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); if (declaredConstraint) { @@ -54269,16 +52962,11 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter declaration, a rest type // or a named rest tuple element, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 160 /* Parameter */ && grandParent.dotDotDotToken || - grandParent.kind === 181 /* RestType */ || - grandParent.kind === 192 /* NamedTupleMember */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 159 /* Parameter */ && grandParent.dotDotDotToken || + grandParent.kind === 180 /* RestType */ || + grandParent.kind === 191 /* NamedTupleMember */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } - // When an 'infer T' declaration is immediately contained in a string template type, we infer a 'string' - // constraint. - else if (grandParent.kind === 194 /* TemplateLiteralTypeSpan */) { - inferences = ts.append(inferences, stringType); - } } } } @@ -54301,7 +52989,7 @@ var ts; if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), // use unknown otherwise - type = constraintDeclaration.parent.parent.kind === 190 /* MappedType */ ? keyofConstraintType : unknownType; + type = constraintDeclaration.parent.parent.kind === 189 /* MappedType */ ? keyofConstraintType : unknownType; } typeParameter.constraint = type; } @@ -54310,7 +52998,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 159 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 158 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -54343,8 +53031,8 @@ var ts; // that care about the presence of such types at arbitrary depth in a containing type. function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var type = types_9[_i]; + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; if (!(type.flags & excludeKinds)) { result |= ts.getObjectFlags(type); } @@ -54390,8 +53078,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 173 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 172 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 177 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -54433,7 +53121,7 @@ var ts; return errorType; } } - if (node.kind === 173 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 172 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -54446,9 +53134,6 @@ var ts; } function getTypeAliasInstantiation(symbol, typeArguments) { var type = getDeclaredTypeOfSymbol(symbol); - if (type === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName) && typeArguments && typeArguments.length === 1) { - return getStringMappingType(symbol, typeArguments[0]); - } var links = getSymbolLinks(symbol); var typeParameters = links.typeParameters; var id = getTypeListId(typeArguments); @@ -54481,9 +53166,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -54531,7 +53216,8 @@ var ts; } /** * A JSdoc TypeReference may be to a value, but resolve it as a type anyway. - * Example: import('./b').ConstructorFunction + * Note: If the value is imported from commonjs, it should really be an alias, + * but this function's special-case code fakes alias resolution as well. */ function getTypeFromJSDocValueReference(node, symbol) { var links = getNodeLinks(node); @@ -54539,9 +53225,19 @@ var ts; var valueType = getTypeOfSymbol(symbol); var typeType = valueType; if (symbol.valueDeclaration) { - var isImportTypeWithQualifier = node.kind === 195 /* ImportType */ && node.qualifier; + var decl = ts.getRootDeclaration(symbol.valueDeclaration); + var isRequireAlias = false; + if (ts.isVariableDeclaration(decl) && decl.initializer) { + var expr = decl.initializer; + // skip past entity names, eg `require("x").a.b.c` + while (ts.isPropertyAccessExpression(expr)) { + expr = expr.expression; + } + isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; + } + var isImportTypeWithQualifier = node.kind === 192 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} - if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) { + if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); } } @@ -54565,7 +53261,7 @@ var ts; return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 179 /* TupleType */ && node.elements.length === 1; + return node.kind === 178 /* TupleType */ && node.elements.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) : @@ -54574,9 +53270,9 @@ var ts; } function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 311 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 307 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 184 /* ConditionalType */ && node === parent.trueType) { + if (parent.kind === 183 /* ConditionalType */ && node === parent.trueType) { var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); @@ -54587,7 +53283,7 @@ var ts; return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 173 /* TypeReference */ || node.kind === 195 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 172 /* TypeReference */ || node.kind === 192 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -54700,9 +53396,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: return declaration; } } @@ -54823,11 +53519,11 @@ var ts; } function getTupleElementFlags(node) { switch (node.kind) { - case 180 /* OptionalType */: + case 179 /* OptionalType */: return 2 /* Optional */; - case 181 /* RestType */: + case 180 /* RestType */: return getRestTypeElementFlags(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return node.questionToken ? 2 /* Optional */ : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1 /* Required */; @@ -54845,14 +53541,14 @@ var ts; return readonly ? globalReadonlyArrayType : globalArrayType; } var elementFlags = ts.map(node.elements, getTupleElementFlags); - var missingName = ts.some(node.elements, function (e) { return e.kind !== 192 /* NamedTupleMember */; }); + var missingName = ts.some(node.elements, function (e) { return e.kind !== 191 /* NamedTupleMember */; }); return getTupleTargetType(elementFlags, readonly, /*associatedNames*/ missingName ? undefined : node.elements); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 178 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 179 /* TupleType */ ? ts.some(node.elements, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 177 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 178 /* TupleType */ ? ts.some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -54861,18 +53557,18 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: - case 173 /* TypeReference */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 189 /* IndexedAccessType */: - case 184 /* ConditionalType */: - case 188 /* TypeOperator */: - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: + case 172 /* TypeReference */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 188 /* IndexedAccessType */: + case 183 /* ConditionalType */: + case 187 /* TypeOperator */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return isResolvedByTypeAlias(parent); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; } return false; @@ -54881,28 +53577,28 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return true; - case 188 /* TypeOperator */: - return node.operator !== 151 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 186 /* ParenthesizedType */: - case 180 /* OptionalType */: - case 192 /* NamedTupleMember */: - case 307 /* JSDocOptionalType */: - case 305 /* JSDocNullableType */: - case 306 /* JSDocNonNullableType */: - case 301 /* JSDocTypeExpression */: + case 187 /* TypeOperator */: + return node.operator !== 150 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 185 /* ParenthesizedType */: + case 179 /* OptionalType */: + case 191 /* NamedTupleMember */: + case 303 /* JSDocOptionalType */: + case 301 /* JSDocNullableType */: + case 302 /* JSDocNonNullableType */: + case 298 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 181 /* RestType */: - return node.type.kind !== 178 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 180 /* RestType */: + return node.type.kind !== 177 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 181 /* UnionType */: + case 182 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -54915,19 +53611,19 @@ var ts; if (target === emptyGenericType) { links.resolvedType = emptyObjectType; } - else if (!(node.kind === 179 /* TupleType */ && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8 /* Variadic */); })) && isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 179 /* TupleType */ && node.elements.length === 0 ? target : + else if (!(node.kind === 178 /* TupleType */ && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8 /* Variadic */); })) && isDeferredTypeReferenceNode(node)) { + links.resolvedType = node.kind === 178 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); + var elementTypes = node.kind === 177 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); links.resolvedType = createNormalizedTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 142 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 141 /* ReadonlyKeyword */; } function createTupleType(elementTypes, elementFlags, readonly, namedMemberDeclarations) { if (readonly === void 0) { readonly = false; } @@ -55024,9 +53720,7 @@ var ts; // Transform [A, ...(X | Y | Z)] into [A, ...X] | [A, ...Y] | [A, ...Z] var unionIndex = ts.findIndex(elementTypes, function (t, i) { return !!(target.elementFlags[i] & 8 /* Variadic */ && t.flags & (131072 /* Never */ | 1048576 /* Union */)); }); if (unionIndex >= 0) { - return checkCrossProductUnion(ts.map(elementTypes, function (t, i) { return target.elementFlags[i] & 8 /* Variadic */ ? t : unknownType; })) ? - mapType(elementTypes[unionIndex], function (t) { return createNormalizedTupleType(target, ts.replaceElement(elementTypes, unionIndex, t)); }) : - errorType; + return mapType(elementTypes[unionIndex], function (t) { return createNormalizedTupleType(target, ts.replaceElement(elementTypes, unionIndex, t)); }); } // If there are no variadic elements with non-generic types, just create a type reference with the same target type. var spreadIndex = ts.findIndex(elementTypes, function (t, i) { return !!(target.elementFlags[i] & 8 /* Variadic */) && !(t.flags & 58982400 /* InstantiableNonPrimitive */) && !isGenericMappedType(t); }); @@ -55140,8 +53834,8 @@ var ts; } // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { - includes |= flags & 205258751 /* IncludesMask */; - if (flags & 469499904 /* StructuredOrInstantiable */) + includes |= flags & 71041023 /* IncludesMask */; + if (flags & 66846720 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -55162,8 +53856,8 @@ var ts; // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. function addTypesToUnion(typeSet, includes, types) { - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var type = types_10[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var type = types_9[_i]; includes = addTypeToUnion(typeSet, includes, type); } return includes; @@ -55192,8 +53886,8 @@ var ts; while (i > 0) { i--; var source = types[i]; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var target = types_11[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var target = types_10[_i]; if (source !== target) { if (count === 100000) { // After 100000 subtype checks we estimate the remaining amount of work by assuming the @@ -55203,7 +53897,6 @@ var ts; // caps union types at 5000 unique literal types and 1000 unique object types. var estimatedCount = (count / (len - i)) * len; if (estimatedCount > (primitivesOnly ? 25000000 : 1000000)) { - ts.tracing.instant("check" /* Check */, "removeSubtypes_DepthLimit", { typeIds: types.map(function (t) { return t.id; }) }); error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return false; } @@ -55235,22 +53928,6 @@ var ts; } } } - function removeStringLiteralsMatchedByTemplateLiterals(types) { - var templates = ts.filter(types, isPatternLiteralType); - if (templates.length) { - var i = types.length; - var _loop_14 = function () { - i--; - var t = types[i]; - if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeSubtypeOf(t, template); })) { - ts.orderedRemoveItemAt(types, i); - } - }; - while (i > 0) { - _loop_14(); - } - } - } // We sort and deduplicate the constituent types based on object identity. If the subtypeReduction // flag is specified we also reduce the constituent type set to only include types that aren't subtypes // of other types. Subtype reduction is expensive for large union types and is possible only when union @@ -55277,9 +53954,6 @@ var ts; if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */)) { removeRedundantLiteralTypes(typeSet, includes); } - if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) { - removeStringLiteralsMatchedByTemplateLiterals(typeSet); - } break; case 2 /* Subtype */: if (!removeSubtypes(typeSet, !(includes & 262144 /* IncludesStructuredOrInstantiable */))) { @@ -55293,7 +53967,7 @@ var ts; neverType; } } - var objectFlags = (includes & 469647395 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -55385,15 +54059,15 @@ var ts; } typeSet.set(type.id.toString(), type); } - includes |= flags & 205258751 /* IncludesMask */; + includes |= flags & 71041023 /* IncludesMask */; } return includes; } // Add the given types to the given type set. Order is preserved, freshness is removed from literal // types, duplicates are removed, and nested types of the given kind are flattened into the set. function addTypesToIntersection(typeSet, includes, types) { - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var type = types_12[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var type = types_11[_i]; includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); } return includes; @@ -55431,31 +54105,6 @@ var ts; } return true; } - /** - * Returns `true` if the intersection of the template literals and string literals is the empty set, eg `get${string}` & "setX", and should reduce to `never` - */ - function extractRedundantTemplateLiterals(types) { - var i = types.length; - var literals = ts.filter(types, function (t) { return !!(t.flags & 128 /* StringLiteral */); }); - while (i > 0) { - i--; - var t = types[i]; - if (!(t.flags & 134217728 /* TemplateLiteral */)) - continue; - for (var _i = 0, literals_1 = literals; _i < literals_1.length; _i++) { - var t2 = literals_1[_i]; - if (isTypeSubtypeOf(t2, t)) { - // eg, ``get${T}` & "getX"` is just `"getX"` - ts.orderedRemoveItemAt(types, i); - break; - } - else if (isPatternLiteralType(t)) { - return true; - } - } - } - return false; - } function extractIrreducible(types, flag) { if (ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) { for (var i = 0; i < types.length; i++) { @@ -55544,15 +54193,12 @@ var ts; // a non-primitive type and a type known to be primitive. if (includes & 131072 /* Never */ || strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) || - includes & 67108864 /* NonPrimitive */ && includes & (469892092 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || - includes & 402653316 /* StringLike */ && includes & (469892092 /* DisjointDomains */ & ~402653316 /* StringLike */) || - includes & 296 /* NumberLike */ && includes & (469892092 /* DisjointDomains */ & ~296 /* NumberLike */) || - includes & 2112 /* BigIntLike */ && includes & (469892092 /* DisjointDomains */ & ~2112 /* BigIntLike */) || - includes & 12288 /* ESSymbolLike */ && includes & (469892092 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || - includes & 49152 /* VoidLike */ && includes & (469892092 /* DisjointDomains */ & ~49152 /* VoidLike */)) { - return neverType; - } - if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) { + includes & 67108864 /* NonPrimitive */ && includes & (67238908 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || + includes & 132 /* StringLike */ && includes & (67238908 /* DisjointDomains */ & ~132 /* StringLike */) || + includes & 296 /* NumberLike */ && includes & (67238908 /* DisjointDomains */ & ~296 /* NumberLike */) || + includes & 2112 /* BigIntLike */ && includes & (67238908 /* DisjointDomains */ & ~2112 /* BigIntLike */) || + includes & 12288 /* ESSymbolLike */ && includes & (67238908 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || + includes & 49152 /* VoidLike */ && includes & (67238908 /* DisjointDomains */ & ~49152 /* VoidLike */)) { return neverType; } if (includes & 1 /* Any */) { @@ -55596,7 +54242,9 @@ var ts; // We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of // the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain. // If the estimated size of the resulting union type exceeds 100000 constituents, report an error. - if (!checkCrossProductUnion(typeSet)) { + var size = ts.reduceLeft(typeSet, function (n, t) { return n * (t.flags & 1048576 /* Union */ ? t.types.length : 1); }, 1); + if (size >= 100000) { + error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return errorType; } var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 1048576 /* Union */) !== 0; }); @@ -55611,15 +54259,6 @@ var ts; } return result; } - function checkCrossProductUnion(types) { - var size = ts.reduceLeft(types, function (n, t) { return n * (t.flags & 1048576 /* Union */ ? t.types.length : t.flags & 131072 /* Never */ ? 0 : 1); }, 1); - if (size >= 100000) { - ts.tracing.instant("check" /* Check */, "checkCrossProductUnion_DepthLimit", { typeIds: types.map(function (t) { return t.id; }), size: size }); - error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); - return false; - } - return true; - } function getTypeFromIntersectionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -55639,24 +54278,6 @@ var ts; type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, /*stringsOnly*/ true)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, /*stringsOnly*/ false)); } - function getIndexTypeForMappedType(type, noIndexSignatures) { - var constraint = filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }); - var nameType = type.declaration.nameType && getTypeFromTypeNode(type.declaration.nameType); - return nameType ? - mapType(constraint, function (t) { return instantiateType(nameType, appendTypeMapping(type.mapper, getTypeParameterFromMappedType(type), t)); }) : - constraint; - } - // Ordinarily we reduce a keyof M where M is a mapped type { [P in K as N

]: X } to simply N. This however presumes - // that N distributes over union types, i.e. that N is equivalent to N | N | N. That presumption is - // generally true, except when N is a non-distributive conditional type or an instantiable type with non-distributive - // conditional type as a constituent. In those cases, we cannot reduce keyof M and need to preserve it as is. - function isNonDistributiveNameType(type) { - return !!(type && (type.flags & 16777216 /* Conditional */ && !type.root.isDistributive || - type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && ts.some(type.types, isNonDistributiveNameType) || - type.flags & (4194304 /* Index */ | 268435456 /* StringMapping */) && isNonDistributiveNameType(type.type) || - type.flags & 8388608 /* IndexedAccess */ && isNonDistributiveNameType(type.indexType) || - type.flags & 33554432 /* Substitution */ && isNonDistributiveNameType(type.substitute))); - } function getLiteralTypeFromPropertyName(name) { if (ts.isPrivateIdentifier(name)) { return neverType; @@ -55700,8 +54321,8 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && isNonDistributiveNameType(getNameTypeFromMappedType(type)) ? getIndexTypeForGenericType(type, stringsOnly) : - ts.getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, noIndexSignatures) : + type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) ? getIndexTypeForGenericType(type, stringsOnly) : + ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : @@ -55725,15 +54346,15 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 138 /* KeyOfKeyword */: + case 137 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 151 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 148 /* SymbolKeyword */ + case 150 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 147 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; default: @@ -55742,115 +54363,12 @@ var ts; } return links.resolvedType; } - function getTypeFromTemplateTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getTemplateLiteralType(__spreadArrays([node.head.text], ts.map(node.templateSpans, function (span) { return span.literal.text; })), ts.map(node.templateSpans, function (span) { return getTypeFromTypeNode(span.type); })); - } - return links.resolvedType; - } - function getTemplateLiteralType(texts, types) { - var unionIndex = ts.findIndex(types, function (t) { return !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)); }); - if (unionIndex >= 0) { - return checkCrossProductUnion(types) ? - mapType(types[unionIndex], function (t) { return getTemplateLiteralType(texts, ts.replaceElement(types, unionIndex, t)); }) : - errorType; - } - if (ts.contains(types, wildcardType)) { - return wildcardType; - } - var newTypes = []; - var newTexts = []; - var text = texts[0]; - if (!addSpans(texts, types)) { - return stringType; - } - if (newTypes.length === 0) { - return getLiteralType(text); - } - newTexts.push(text); - var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join(""); - var type = templateLiteralTypes.get(id); - if (!type) { - templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes)); - } - return type; - function addSpans(texts, types) { - for (var i = 0; i < types.length; i++) { - var t = types[i]; - if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) { - text += getTemplateStringForType(t) || ""; - text += texts[i + 1]; - } - else if (t.flags & 134217728 /* TemplateLiteral */) { - text += t.texts[0]; - if (!addSpans(t.texts, t.types)) - return false; - text += texts[i + 1]; - } - else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) { - newTypes.push(t); - newTexts.push(text); - text = texts[i + 1]; - } - else { - return false; - } - } - return true; - } - } - function getTemplateStringForType(type) { - return type.flags & 128 /* StringLiteral */ ? type.value : - type.flags & 256 /* NumberLiteral */ ? "" + type.value : - type.flags & 2048 /* BigIntLiteral */ ? ts.pseudoBigIntToString(type.value) : - type.flags & 512 /* BooleanLiteral */ ? type.intrinsicName : - type.flags & 65536 /* Null */ ? "null" : - type.flags & 32768 /* Undefined */ ? "undefined" : - undefined; - } - function createTemplateLiteralType(texts, types) { - var type = createType(134217728 /* TemplateLiteral */); - type.texts = texts; - type.types = types; - return type; - } - function getStringMappingType(symbol, type) { - return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) : - isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) : - type.flags & 128 /* StringLiteral */ ? getLiteralType(applyStringMapping(symbol, type.value)) : - type; - } - function applyStringMapping(symbol, str) { - switch (intrinsicTypeKinds.get(symbol.escapedName)) { - case 0 /* Uppercase */: return str.toUpperCase(); - case 1 /* Lowercase */: return str.toLowerCase(); - case 2 /* Capitalize */: return str.charAt(0).toUpperCase() + str.slice(1); - case 3 /* Uncapitalize */: return str.charAt(0).toLowerCase() + str.slice(1); - } - return str; - } - function getStringMappingTypeForGenericType(symbol, type) { - var id = getSymbolId(symbol) + "," + getTypeId(type); - var result = stringMappingTypes.get(id); - if (!result) { - stringMappingTypes.set(id, result = createStringMappingType(symbol, type)); - } - return result; - } - function createStringMappingType(symbol, type) { - var result = createType(268435456 /* StringMapping */); - result.symbol = symbol; - result.type = type; - return result; - } - function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined) { + function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments) { var type = createType(8388608 /* IndexedAccess */); type.objectType = objectType; type.indexType = indexType; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; - type.noUncheckedIndexedAccessCandidate = shouldIncludeUndefined; return type; } /** @@ -55875,13 +54393,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -55896,15 +54414,15 @@ var ts; || !ts.isCallLikeExpression(ts.findAncestor(node, function (n) { return !ts.isAccessExpression(n); }) || node.parent) && ts.every(symbol.declarations, function (d) { return !ts.isFunctionLike(d) || !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }); } - function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, noUncheckedIndexedAccessCandidate, reportDeprecated) { - var _a; - var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined; + function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, reportDeprecated) { + var _a, _b; + var accessExpression = accessNode && accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); if (prop) { - if (reportDeprecated && accessNode && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) { - var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); + if (reportDeprecated && accessNode && ((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.flags) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) { + var deprecatedNode = (_b = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _b !== void 0 ? _b : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); errorOrSuggestion(/* isError */ false, deprecatedNode, ts.Diagnostics._0_is_deprecated, propName); } if (accessExpression) { @@ -55936,13 +54454,10 @@ var ts; } } errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, 1 /* Number */)); - return mapType(objectType, function (t) { - var restType = getRestTypeOfTupleType(t) || undefinedType; - return noUncheckedIndexedAccessCandidate ? getUnionType([restType, undefinedType]) : restType; - }); + return mapType(objectType, function (t) { return getRestTypeOfTupleType(t) || undefinedType; }); } } - if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) { + if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) { if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) { return objectType; } @@ -55958,10 +54473,10 @@ var ts; if (accessNode && !isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) { var indexNode = getIndexNodeForAccessExpression(accessNode); error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); - return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + return indexInfo.type; } errorIfWritingToReadonlyIndex(indexInfo); - return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + return indexInfo.type; } if (indexType.flags & 131072 /* Never */) { return neverType; @@ -56045,17 +54560,11 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 189 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 158 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 188 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 157 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } - function isPatternLiteralPlaceholderType(type) { - return templateConstraintType.types.indexOf(type) !== -1 || !!(type.flags & 1 /* Any */); - } - function isPatternLiteralType(type) { - return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType); - } function isGenericObjectType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { if (!(type.objectFlags & 4194304 /* IsGenericObjectTypeComputed */)) { @@ -56074,7 +54583,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) && !isPatternLiteralType(type); + return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -56127,7 +54636,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 465829888 /* Instantiable */)) { + if (!(indexType.flags & 63176704 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -56190,9 +54699,8 @@ var ts; var templateMapper = combineTypeMappers(objectType.mapper, mapper); return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); } - function getIndexedAccessType(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, aliasSymbol, aliasTypeArguments, accessFlags) { - if (accessFlags === void 0) { accessFlags = 0 /* None */; } - return getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType); + function getIndexedAccessType(objectType, indexType, accessNode, aliasSymbol, aliasTypeArguments) { + return getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, 0 /* None */, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType); } function indexTypeLessThan(indexType, limit) { return everyType(indexType, function (t) { @@ -56206,14 +54714,11 @@ var ts; return false; }); } - function getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) { + function getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) { if (accessFlags === void 0) { accessFlags = 0 /* None */; } if (objectType === wildcardType || indexType === wildcardType) { return wildcardType; } - var shouldIncludeUndefined = noUncheckedIndexedAccessCandidate || - (!!compilerOptions.noUncheckedIndexedAccess && - (accessFlags & (2 /* Writing */ | 16 /* ExpressionPosition */)) === 16 /* ExpressionPosition */); // If the object type has a string index signature and no other members we know that the result will // always be the type of that index signature and we can simplify accordingly. if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) { @@ -56225,17 +54730,17 @@ var ts; // for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in an expression. This is to // preserve backwards compatibility. For example, an element access 'this["foo"]' has always been resolved // eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 189 /* IndexedAccessType */ ? + if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 188 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } // Defer the operation by creating an indexed access type. - var id = objectType.id + "," + indexType.id + (shouldIncludeUndefined ? "?" : ""); + var id = objectType.id + "," + indexType.id; var type = indexedAccessTypes.get(id); if (!type) { - indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined)); + indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments)); } return type; } @@ -56248,7 +54753,7 @@ var ts; var wasMissingProp = false; for (var _i = 0, _a = indexType.types; _i < _a.length; _i++) { var t = _a[_i]; - var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags, shouldIncludeUndefined); + var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags); if (propType) { propTypes.push(propType); } @@ -56264,11 +54769,9 @@ var ts; if (wasMissingProp) { return undefined; } - return accessFlags & 2 /* Writing */ - ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) - : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments); + return accessFlags & 2 /* Writing */ ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments); } - return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, /* supressNoImplicitAnyError */ false, accessNode, accessFlags | 4 /* CacheSymbol */, shouldIncludeUndefined, /* reportDeprecated */ true); + return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, /* supressNoImplicitAnyError */ false, accessNode, accessFlags | 4 /* CacheSymbol */, /* reportDeprecated */ true); } function getTypeFromIndexedAccessTypeNode(node) { var links = getNodeLinks(node); @@ -56276,7 +54779,7 @@ var ts; var objectType = getTypeFromTypeNode(node.objectType); var indexType = getTypeFromTypeNode(node.indexType); var potentialAlias = getAliasSymbolForTypeNode(node); - var resolved = getIndexedAccessType(objectType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); + var resolved = getIndexedAccessType(objectType, indexType, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); links.resolvedType = resolved.flags & 8388608 /* IndexedAccess */ && resolved.objectType === objectType && resolved.indexType === indexType ? @@ -56311,7 +54814,7 @@ var ts; function getConditionalType(root, mapper) { var result; var extraTypes; - var _loop_15 = function () { + var _loop_14 = function () { var checkType = instantiateType(root.checkType, mapper); var checkTypeInstantiable = isGenericObjectType(checkType) || isGenericIndexType(checkType); var extendsType = instantiateType(root.extendsType, mapper); @@ -56344,11 +54847,11 @@ var ts; if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) { // Return union of trueType and falseType for 'any' since it matches anything if (checkType.flags & 1 /* Any */) { - (extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper)); + (extraTypes || (extraTypes = [])).push(instantiateTypeWithoutDepthIncrease(root.trueType, combinedMapper || mapper)); } // If falseType is an immediately nested conditional type that isn't distributive or has an // identical checkType, switch to that type and loop. - var falseType_1 = getTypeFromTypeNode(root.node.falseType); + var falseType_1 = root.falseType; if (falseType_1.flags & 16777216 /* Conditional */) { var newRoot = falseType_1.root; if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) { @@ -56356,7 +54859,7 @@ var ts; return "continue"; } } - result = instantiateType(falseType_1, mapper); + result = instantiateTypeWithoutDepthIncrease(falseType_1, mapper); return "break"; } // Return trueType for a definitely true extends check. We check instantiations of the two @@ -56365,7 +54868,7 @@ var ts; // type Foo = T extends { x: string } ? string : number // doesn't immediately resolve to 'string' instead of being deferred. if (inferredExtendsType.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) { - result = instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper); + result = instantiateTypeWithoutDepthIncrease(root.trueType, combinedMapper || mapper); return "break"; } } @@ -56385,7 +54888,7 @@ var ts; // types of the form 'A extends B ? X : C extends D ? Y : E extends F ? Z : ...' as a single construct for // purposes of resolution. This means such types aren't subject to the instatiation depth limiter. while (true) { - var state_4 = _loop_15(); + var state_4 = _loop_14(); if (typeof state_4 === "object") return state_4.value; if (state_4 === "break") @@ -56394,13 +54897,13 @@ var ts; return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result; } function getTrueTypeFromConditionalType(type) { - return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.mapper)); + return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(type.root.trueType, type.mapper)); } function getFalseTypeFromConditionalType(type) { - return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(getTypeFromTypeNode(type.root.node.falseType), type.mapper)); + return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(type.root.falseType, type.mapper)); } function getInferredTrueTypeFromConditionalType(type) { - return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.combinedMapper) : getTrueTypeFromConditionalType(type)); + return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(type.root.trueType, type.combinedMapper) : getTrueTypeFromConditionalType(type)); } function getInferTypeParameters(node) { var result; @@ -56425,6 +54928,8 @@ var ts; node: node, checkType: checkType, extendsType: getTypeFromTypeNode(node.extendsType), + trueType: getTypeFromTypeNode(node.trueType), + falseType: getTypeFromTypeNode(node.falseType), isDistributive: !!(checkType.flags & 262144 /* TypeParameter */), inferTypeParameters: getInferTypeParameters(node), outerTypeParameters: outerTypeParameters, @@ -56482,13 +54987,7 @@ var ts; var current = void 0; while (current = nameStack.shift()) { var meaning = nameStack.length ? 1920 /* Namespace */ : targetMeaning; - // typeof a.b.c is normally resolved using `checkExpression` which in turn defers to `checkQualifiedName` - // That, in turn, ultimately uses `getPropertyOfType` on the type of the symbol, which differs slightly from - // the `exports` lookup process that only looks up namespace members which is used for most type references - var mergedResolvedSymbol = getMergedSymbol(resolveSymbol(currentNamespace)); - var next = node.isTypeOf - ? getPropertyOfType(getTypeOfSymbol(mergedResolvedSymbol), current.escapedText) - : getSymbol(getExportsOfSymbol(mergedResolvedSymbol), current.escapedText, meaning); + var next = getSymbol(getExportsOfSymbol(getMergedSymbol(resolveSymbol(currentNamespace))), current.escapedText, meaning); if (!next) { error(current, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), ts.declarationNameToString(current)); return links.resolvedType = errorType; @@ -56547,7 +55046,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isJSDocTypeExpression(host) || ts.isTypeOperatorNode(host) && host.operator === 142 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 141 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -56559,7 +55058,12 @@ var ts; return !!(type.flags & 524288 /* Object */) && !isGenericMappedType(type); } function isEmptyObjectTypeOrSpreadsIntoEmptyObject(type) { - return isEmptyObjectType(type) || !!(type.flags & (65536 /* Null */ | 32768 /* Undefined */ | 528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)); + return isEmptyObjectType(type) || !!(type.flags & (65536 /* Null */ | 32768 /* Undefined */ | 528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)); + } + function isSinglePropertyAnonymousObjectType(type) { + return !!(type.flags & 524288 /* Object */) && + !!(ts.getObjectFlags(type) & 16 /* Anonymous */) && + (ts.length(getPropertiesOfType(type)) === 1 || ts.every(getPropertiesOfType(type), function (p) { return !!(p.flags & 16777216 /* Optional */); })); } function tryMergeUnionOfObjectTypeAndEmptyObject(type, readonly) { if (type.types.length === 2) { @@ -56568,10 +55072,10 @@ var ts; if (ts.every(type.types, isEmptyObjectTypeOrSpreadsIntoEmptyObject)) { return isEmptyObjectType(firstType) ? firstType : isEmptyObjectType(secondType) ? secondType : emptyObjectType; } - if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(firstType)) { + if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(firstType) && isSinglePropertyAnonymousObjectType(secondType)) { return getAnonymousPartialType(secondType); } - if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(secondType)) { + if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(secondType) && isSinglePropertyAnonymousObjectType(firstType)) { return getAnonymousPartialType(firstType); } } @@ -56622,20 +55126,16 @@ var ts; if (merged) { return getSpreadType(merged, right, symbol, objectFlags, readonly); } - return checkCrossProductUnion([left, right]) - ? mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }) - : errorType; + return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }); } if (right.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); if (merged) { return getSpreadType(left, merged, symbol, objectFlags, readonly); } - return checkCrossProductUnion([left, right]) - ? mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }) - : errorType; + return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }); } - if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { + if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { return left; } if (isGenericObjectType(left) || isGenericObjectType(right)) { @@ -56796,7 +55296,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 253 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 250 /* InterfaceDeclaration */)) { if (!ts.hasSyntacticModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -56831,17 +55331,17 @@ var ts; } function getArrayElementTypeNode(node) { switch (node.kind) { - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return getArrayElementTypeNode(node.type); - case 179 /* TupleType */: + case 178 /* TupleType */: if (node.elements.length === 1) { node = node.elements[0]; - if (node.kind === 181 /* RestType */ || node.kind === 192 /* NamedTupleMember */ && node.dotDotDotToken) { + if (node.kind === 180 /* RestType */ || node.kind === 191 /* NamedTupleMember */ && node.dotDotDotToken) { return getArrayElementTypeNode(node.type); } } break; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return node.elementType; } return undefined; @@ -56859,98 +55359,94 @@ var ts; function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 128 /* AnyKeyword */: - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: return anyType; - case 152 /* UnknownKeyword */: + case 151 /* UnknownKeyword */: return unknownType; - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: return stringType; - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: return numberType; - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: return bigintType; case 131 /* BooleanKeyword */: return booleanType; - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: return esSymbolType; case 113 /* VoidKeyword */: return voidType; - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: return undefinedType; case 103 /* NullKeyword */: // TODO(rbuckton): `NullKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service. return nullType; - case 141 /* NeverKeyword */: + case 140 /* NeverKeyword */: return neverType; - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 136 /* IntrinsicKeyword */: - return intrinsicMarkerType; - case 187 /* ThisType */: + case 186 /* ThisType */: case 107 /* ThisKeyword */: // TODO(rbuckton): `ThisKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service and because of `isPartOfTypeNode`. return getTypeFromThisTypeNode(node); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return getTypeFromTypeReference(node); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 182 /* UnionType */: + case 181 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return getTypeFromNamedTupleTypeNode(node); - case 186 /* ParenthesizedType */: - case 306 /* JSDocNonNullableType */: - case 301 /* JSDocTypeExpression */: + case 185 /* ParenthesizedType */: + case 302 /* JSDocNonNullableType */: + case 298 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 181 /* RestType */: + case 180 /* RestType */: return getTypeFromRestTypeNode(node); - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 308 /* JSDocFunctionType */: - case 313 /* JSDocSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 304 /* JSDocFunctionType */: + case 309 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 185 /* InferType */: + case 184 /* InferType */: return getTypeFromInferTypeNode(node); - case 193 /* TemplateLiteralType */: - return getTypeFromTemplateTypeNode(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier, qualified name, or property access expression is a type expression // Callers should first ensure this by calling `isPartOfTypeNode` // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 78 /* Identifier */: - case 157 /* QualifiedName */: - case 201 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -57104,10 +55600,9 @@ var ts; return result; } function getObjectTypeInstantiation(type, mapper) { + var target = type.objectFlags & 64 /* Instantiated */ ? type.target : type; var declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.symbol.declarations[0]; var links = getNodeLinks(declaration); - var target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : - type.objectFlags & 64 /* Instantiated */ ? type.target : type; var typeParameters = links.outerTypeParameters; if (!typeParameters) { // The first time an anonymous type is instantiated we compute and store a list of the type @@ -57124,6 +55619,10 @@ var ts; ts.filter(typeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration); }) : typeParameters; links.outerTypeParameters = typeParameters; + if (typeParameters.length) { + links.instantiations = new ts.Map(); + links.instantiations.set(getTypeListId(typeParameters), target); + } } if (typeParameters.length) { // We are instantiating an anonymous type that has one or more type parameters in scope. Apply the @@ -57132,26 +55631,22 @@ var ts; var combinedMapper_1 = combineTypeMappers(type.mapper, mapper); var typeArguments = ts.map(typeParameters, function (t) { return getMappedType(t, combinedMapper_1); }); var id = getTypeListId(typeArguments); - if (!target.instantiations) { - target.instantiations = new ts.Map(); - target.instantiations.set(getTypeListId(typeParameters), target); - } - var result = target.instantiations.get(id); + var result = links.instantiations.get(id); if (!result) { var newMapper = createTypeMapper(typeParameters, typeArguments); result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper) : instantiateAnonymousType(target, newMapper); - target.instantiations.set(id, result); + links.instantiations.set(id, result); } return result; } return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 157 /* QualifiedName */ || - node.parent.kind === 173 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 195 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 156 /* QualifiedName */ || + node.parent.kind === 172 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 192 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -57160,7 +55655,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 230 /* Block */ || n.kind === 184 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 227 /* Block */ || n.kind === 183 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -57169,12 +55664,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 187 /* ThisType */: + case 186 /* ThisType */: return !!tp.isThisType; case 78 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -57207,18 +55702,13 @@ var ts; if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { - if (!type.declaration.nameType) { - if (isArrayType(t)) { - return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper)); - } - if (isGenericTupleType(t)) { - return instantiateMappedGenericTupleType(t, type, typeVariable, mapper); - } - if (isTupleType(t)) { - return instantiateMappedTupleType(t, type, prependTypeMapping(typeVariable, t, mapper)); - } + if (isGenericTupleType(t)) { + return instantiateMappedGenericTupleType(t, type, typeVariable, mapper); } - return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper)); + var replacementMapper = prependTypeMapping(typeVariable, t, mapper); + return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : + isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : + instantiateAnonymousType(type, replacementMapper); } return t; }); @@ -57327,7 +55817,6 @@ var ts; // We have reached 50 recursive type instantiations and there is a very high likelyhood we're dealing // with a combination of infinite generic types that perpetually generate new type identities. We stop // the recursion here by yielding the error type. - ts.tracing.instant("check" /* Check */, "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth: instantiationDepth, instantiationCount: instantiationCount }); error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); return errorType; } @@ -57338,6 +55827,16 @@ var ts; instantiationDepth--; return result; } + /** + * This can be used to avoid the penalty on instantiation depth for types which result from immediate + * simplification. It essentially removes the depth increase done in `instantiateType`. + */ + function instantiateTypeWithoutDepthIncrease(type, mapper) { + instantiationDepth--; + var result = instantiateType(type, mapper); + instantiationDepth++; + return result; + } function instantiateTypeWorker(type, mapper) { var flags = type.flags; if (flags & 262144 /* TypeParameter */) { @@ -57366,14 +55865,8 @@ var ts; if (flags & 4194304 /* Index */) { return getIndexType(instantiateType(type.type, mapper)); } - if (flags & 134217728 /* TemplateLiteral */) { - return getTemplateLiteralType(type.texts, instantiateTypes(type.types, mapper)); - } - if (flags & 268435456 /* StringMapping */) { - return getStringMappingType(type.symbol, instantiateType(type.type, mapper)); - } if (flags & 8388608 /* IndexedAccess */) { - return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), type.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), /*accessNode*/ undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); } if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); @@ -57419,35 +55912,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 280 /* JsxAttribute */: { + case 277 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 283 /* JsxExpression */: { + case 280 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g

) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -57466,7 +55959,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 209 /* ArrowFunction */) { + if (node.kind !== 206 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -57479,7 +55972,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 230 /* Block */ && isContextSensitive(node.body); + return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 227 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -57535,7 +56028,7 @@ var ts; source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : - hasBaseType(source, getTargetType(target)) || (isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType)); + hasBaseType(source, getTargetType(target)); } /** * This is *not* a bi-directional relationship. @@ -57582,23 +56075,23 @@ var ts; return true; } switch (node.kind) { - case 283 /* JsxExpression */: - case 207 /* ParenthesizedExpression */: + case 280 /* JsxExpression */: + case 204 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -57798,7 +56291,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -57807,15 +56300,18 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: return ts.Debug.assertNever(child, "Found invalid jsx child"); } } + function getSemanticJsxChildren(children) { + return ts.filter(children, function (i) { return !ts.isJsxText(i) || !i.containsOnlyTriviaWhiteSpaces; }); + } function elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer) { var result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer); var invalidTextDiagnostic; @@ -57825,7 +56321,7 @@ var ts; var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName); var childrenNameType = getLiteralType(childrenPropName); var childrenTargetType = getIndexedAccessType(target, childrenNameType); - var validChildren = ts.getSemanticJsxChildren(containingElement.children); + var validChildren = getSemanticJsxChildren(containingElement.children); if (!ts.length(validChildren)) { return result; } @@ -57957,11 +56453,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 168 /* SetAccessor */: return [3 /*break*/, 2]; - case 167 /* GetAccessor */: return [3 /*break*/, 2]; - case 165 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 289 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 288 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 167 /* SetAccessor */: return [3 /*break*/, 2]; + case 166 /* GetAccessor */: return [3 /*break*/, 2]; + case 164 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 286 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 285 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -58038,8 +56534,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 165 /* MethodDeclaration */ && - kind !== 164 /* MethodSignature */ && kind !== 166 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 164 /* MethodDeclaration */ && + kind !== 163 /* MethodSignature */ && kind !== 165 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -58060,36 +56556,34 @@ var ts; var paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount); var restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1; for (var i = 0; i < paramCount; i++) { - var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i); - var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i); - if (sourceType && targetType) { - // In order to ensure that any generic type Foo is at least co-variant with respect to T no matter - // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions, - // they naturally relate only contra-variantly). However, if the source and target parameters both have - // function types with a single call signature, we know we are relating two callback parameters. In - // that case it is sufficient to only relate the parameters of the signatures co-variantly because, - // similar to return values, callback parameters are output positions. This means that a Promise, - // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) - // with respect to T. - var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); - var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType)); - var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && - (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */); - var related = callbacks ? - compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : - !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); - // With strict arity, (x: number | undefined) => void is a subtype of (x?: number | undefined) => void - if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, /*reportErrors*/ false)) { - related = 0 /* False */; - } - if (!related) { - if (reportErrors) { - errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), ts.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); - } - return 0 /* False */; - } - result &= related; + var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : getTypeAtPosition(source, i); + var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : getTypeAtPosition(target, i); + // In order to ensure that any generic type Foo is at least co-variant with respect to T no matter + // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions, + // they naturally relate only contra-variantly). However, if the source and target parameters both have + // function types with a single call signature, we know we are relating two callback parameters. In + // that case it is sufficient to only relate the parameters of the signatures co-variantly because, + // similar to return values, callback parameters are output positions. This means that a Promise, + // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) + // with respect to T. + var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); + var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType)); + var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && + (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */); + var related = callbacks ? + compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : + !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); + // With strict arity, (x: number | undefined) => void is a subtype of (x?: number | undefined) => void + if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, /*reportErrors*/ false)) { + related = 0 /* False */; } + if (!related) { + if (reportErrors) { + errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), ts.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); + } + return 0 /* False */; + } + result &= related; } if (!(checkMode & 4 /* IgnoreReturnTypes */)) { // If a signature resolution is already in-flight, skip issuing a circularity error @@ -58232,7 +56726,7 @@ var ts; return true; if (t & 131072 /* Never */) return false; - if (s & 402653316 /* StringLike */ && t & 4 /* String */) + if (s & 132 /* StringLike */ && t & 4 /* String */) return true; if (s & 128 /* StringLiteral */ && s & 1024 /* EnumLiteral */ && t & 128 /* StringLiteral */ && !(t & 1024 /* EnumLiteral */) && @@ -58294,7 +56788,7 @@ var ts; } else { if (!(source.flags & 3145728 /* UnionOrIntersection */) && !(target.flags & 3145728 /* UnionOrIntersection */) && - source.flags !== target.flags && !(source.flags & 469237760 /* Substructure */)) + source.flags !== target.flags && !(source.flags & 66584576 /* Substructure */)) return false; } if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) { @@ -58303,7 +56797,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) { + if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -58356,7 +56850,6 @@ var ts; reportIncompatibleStack(); } if (overflow) { - ts.tracing.instant("check" /* Check */, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: depth }); var diag = error(errorNode || currentNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); if (errorOutputContainer) { (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); @@ -58731,7 +57224,7 @@ var ts; // breaking the intersection apart. result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); } - if (!result && (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -58829,7 +57322,7 @@ var ts; } function isIdenticalTo(source, target) { var flags = source.flags & target.flags; - if (!(flags & 469237760 /* Substructure */)) { + if (!(flags & 66584576 /* Substructure */)) { return 0 /* False */; } if (flags & 3145728 /* UnionOrIntersection */) { @@ -58865,7 +57358,7 @@ var ts; reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target); checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget]; } - var _loop_16 = function (prop) { + var _loop_15 = function (prop) { if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) { if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) { if (reportErrors) { @@ -58928,7 +57421,7 @@ var ts; }; for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; - var state_5 = _loop_16(prop); + var state_5 = _loop_15(prop); if (typeof state_5 === "object") return state_5.value; } @@ -59114,7 +57607,7 @@ var ts; for (var i = 0; i < maybeCount; i++) { // If source and target are already being compared, consider them related with assumptions if (id === maybeKeys[i]) { - return 3 /* Maybe */; + return 1 /* Maybe */; } } if (depth === 100) { @@ -59142,16 +57635,7 @@ var ts; return originalHandler(onlyUnreliable); }; } - if (expandingFlags === 3 /* Both */) { - ts.tracing.instant("check" /* Check */, "recursiveTypeRelatedTo_DepthLimit", { - sourceId: source.id, - sourceIdStack: sourceStack.map(function (t) { return t.id; }), - targetId: target.id, - targetIdStack: targetStack.map(function (t) { return t.id; }), - depth: depth, - }); - } - var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3 /* Maybe */; + var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 1 /* Maybe */; if (outofbandVarianceMarkerHandler) { outofbandVarianceMarkerHandler = originalHandler; } @@ -59159,12 +57643,9 @@ var ts; depth--; if (result) { if (result === -1 /* True */ || depth === 0) { - if (result === -1 /* True */ || result === 3 /* Maybe */) { - // If result is definitely true, record all maybe keys as having succeeded. Also, record Ternary.Maybe - // results as having succeeded once we reach depth 0, but never record Ternary.Unknown results. - for (var i = maybeStart; i < maybeCount; i++) { - relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags); - } + // If result is definitely true, record all maybe keys as having succeeded + for (var i = maybeStart; i < maybeCount; i++) { + relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags); } maybeCount = maybeStart; } @@ -59178,12 +57659,6 @@ var ts; return result; } function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) { - ts.tracing.push("check" /* Check */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id }); - var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState); - ts.tracing.pop(); - return result; - } - function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) { if (intersectionState & 4 /* PropertyCheck */) { return propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */); } @@ -59230,7 +57705,7 @@ var ts; !(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) { var variances = getAliasVariances(source.aliasSymbol); if (variances === ts.emptyArray) { - return 1 /* Unknown */; + return 1 /* Maybe */; } var varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances, intersectionState); if (varianceResult !== undefined) { @@ -59245,7 +57720,7 @@ var ts; } if (target.flags & 262144 /* TypeParameter */) { // A source type { [P in Q]: X } is related to a target type T if keyof T is related to Q and X is related to T[Q]. - if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) { + if (ts.getObjectFlags(source) & 32 /* Mapped */ && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) { if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) { var templateType = getTemplateTypeFromMappedType(source); var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); @@ -59295,14 +57770,14 @@ var ts; var baseIndexType = getBaseConstraintOfType(indexType) || indexType; if (!isGenericObjectType(baseObjectType) && !isGenericIndexType(baseIndexType)) { var accessFlags = 2 /* Writing */ | (baseObjectType !== objectType ? 1 /* NoIndexSignatures */ : 0); - var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, target.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, accessFlags); + var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, /*accessNode*/ undefined, accessFlags); if (constraint && (result = isRelatedTo(source, constraint, reportErrors))) { return result; } } } } - else if (isGenericMappedType(target) && !target.declaration.nameType) { + else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); var modifiers = getMappedTypeModifiers(target); @@ -59344,15 +57819,6 @@ var ts; } } } - else if (target.flags & 134217728 /* TemplateLiteral */ && source.flags & 128 /* StringLiteral */) { - if (isPatternLiteralType(target)) { - // match all non-`string` segments - var result_8 = inferLiteralsFromTemplateLiteralType(source, target); - if (result_8 && ts.every(result_8, function (r, i) { return isStringLiteralTypeValueParsableAsType(r, target.types[i]); })) { - return -1 /* True */; - } - } - } if (source.flags & 8650752 /* TypeVariable */) { if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) { // A type S[K] is related to a type T[J] if S is related to T and K is related to J. @@ -59391,35 +57857,6 @@ var ts; return result; } } - else if (source.flags & 134217728 /* TemplateLiteral */) { - if (target.flags & 134217728 /* TemplateLiteral */ && - source.texts.length === target.texts.length && - source.types.length === target.types.length && - ts.every(source.texts, function (t, i) { return t === target.texts[i]; }) && - ts.every(instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)).types, function (t, i) { return !!(target.types[i].flags & (1 /* Any */ | 4 /* String */)) || !!isRelatedTo(t, target.types[i], /*reportErrors*/ false); })) { - return -1 /* True */; - } - var constraint = getBaseConstraintOfType(source); - if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, reportErrors))) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - else if (source.flags & 268435456 /* StringMapping */) { - if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) { - if (result = isRelatedTo(source.type, target.type, reportErrors)) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - else { - var constraint = getBaseConstraintOfType(source); - if (constraint && (result = isRelatedTo(constraint, target, reportErrors))) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - } else if (source.flags & 16777216 /* Conditional */) { if (target.flags & 16777216 /* Conditional */) { // Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if @@ -59498,7 +57935,7 @@ var ts; // effectively means we measure variance only from type parameter occurrences that aren't nested in // recursive instantiations of the generic type. if (variances === ts.emptyArray) { - return 1 /* Unknown */; + return 1 /* Maybe */; } var varianceResult = relateVariances(getTypeArguments(source), getTypeArguments(target), variances, intersectionState); if (varianceResult !== undefined) { @@ -59555,9 +57992,9 @@ var ts; if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) { var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */); if (objectOnlyTarget.flags & 1048576 /* Union */) { - var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget); - if (result_9) { - return result_9; + var result_8 = typeRelatedToDiscriminatedType(source, objectOnlyTarget); + if (result_8) { + return result_8; } } } @@ -59624,14 +58061,12 @@ var ts; var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { - var result_10; + var result_9; var targetConstraint = getConstraintTypeFromMappedType(target); var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers)); - if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { + if (result_9 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); - if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) { - return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); - } + return result_9 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); } } return 0 /* False */; @@ -59661,7 +58096,6 @@ var ts; numCombinations *= countTypes(getTypeOfSymbol(sourceProperty)); if (numCombinations > 25) { // We've reached the complexity limit. - ts.tracing.instant("check" /* Check */, "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source.id, targetId: target.id, numCombinations: numCombinations }); return 0 /* False */; } } @@ -59680,11 +58114,11 @@ var ts; // constituents of 'target'. If any combination does not have a match then 'source' is not relatable. var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes); var matchingTypes = []; - var _loop_17 = function (combination) { + var _loop_16 = function (combination) { var hasMatch = false; outer: for (var _i = 0, _a = target.types; _i < _a.length; _i++) { var type = _a[_i]; - var _loop_18 = function (i) { + var _loop_17 = function (i) { var sourceProperty = sourcePropertiesFiltered[i]; var targetProperty = getPropertyOfType(type, sourceProperty.escapedName); if (!targetProperty) @@ -59700,7 +58134,7 @@ var ts; } }; for (var i = 0; i < sourcePropertiesFiltered.length; i++) { - var state_7 = _loop_18(i); + var state_7 = _loop_17(i); switch (state_7) { case "continue-outer": continue outer; } @@ -59714,7 +58148,7 @@ var ts; }; for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) { var combination = discriminantCombinations_1[_a]; - var state_6 = _loop_17(combination); + var state_6 = _loop_16(combination); if (typeof state_6 === "object") return state_6.value; } @@ -59770,7 +58204,7 @@ var ts; ts.Debug.assertIsDefined(links.deferralParent); ts.Debug.assertIsDefined(links.deferralConstituents); var unionParent = !!(links.deferralParent.flags & 1048576 /* Union */); - var result_11 = unionParent ? 0 /* False */ : -1 /* True */; + var result_10 = unionParent ? 0 /* False */ : -1 /* True */; var targetTypes = links.deferralConstituents; for (var _i = 0, targetTypes_3 = targetTypes; _i < targetTypes_3.length; _i++) { var targetType = targetTypes_3[_i]; @@ -59780,7 +58214,7 @@ var ts; // Can't assign to a target individually - have to fallback to assigning to the _whole_ intersection (which forces normalization) return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors); } - result_11 &= related; + result_10 &= related; } else { if (related) { @@ -59788,17 +58222,17 @@ var ts; } } } - if (unionParent && !result_11 && targetIsOptional) { - result_11 = isRelatedTo(source, undefinedType); + if (unionParent && !result_10 && targetIsOptional) { + result_10 = isRelatedTo(source, undefinedType); } - if (unionParent && !result_11 && reportErrors) { + if (unionParent && !result_10 && reportErrors) { // The easiest way to get the right errors here is to un-defer (which may be costly) // If it turns out this is too costly too often, we can replicate the error handling logic within // typeRelatedToSomeType without the discriminatable type branch (as that requires a manifest union // type on which to hand discriminable properties, which we are expressly trying to avoid here) return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors); } - return result_11; + return result_10; } else { return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors, /*headMessage*/ undefined, intersectionState); @@ -60058,7 +58492,6 @@ var ts; return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { - var _a, _b; if (relation === identityRelation) { return signaturesIdenticalTo(source, target, kind); } @@ -60089,9 +58522,7 @@ var ts; var result = -1 /* True */; var saveErrorInfo = captureErrorCalculationState(); var incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn; - var sourceObjectFlags = ts.getObjectFlags(source); - var targetObjectFlags = ts.getObjectFlags(target); - if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source.symbol === target.symbol) { + if (ts.getObjectFlags(source) & 64 /* Instantiated */ && ts.getObjectFlags(target) & 64 /* Instantiated */ && source.symbol === target.symbol) { // We have instantiations of the same anonymous type (which typically will be the type of a // method). Simply do a pairwise comparison of the signatures in the two signature lists instead // of the much more expensive N * M comparison matrix we explore below. We erase type parameters @@ -60111,26 +58542,15 @@ var ts; // this regardless of the number of signatures, but the potential costs are prohibitive due // to the quadratic nature of the logic below. var eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; - var sourceSignature = ts.first(sourceSignatures); - var targetSignature = ts.first(targetSignatures); - result = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors, incompatibleReporter(sourceSignature, targetSignature)); - if (!result && reportErrors && kind === 1 /* Construct */ && (sourceObjectFlags & targetObjectFlags) && - (((_a = targetSignature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 166 /* Constructor */ || ((_b = sourceSignature.declaration) === null || _b === void 0 ? void 0 : _b.kind) === 166 /* Constructor */)) { - var constructSignatureToString = function (signature) { - return signatureToString(signature, /*enclosingDeclaration*/ undefined, 262144 /* WriteArrowStyleSignature */, kind); - }; - reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature)); - reportError(ts.Diagnostics.Types_of_construct_signatures_are_incompatible); - return result; - } + result = signatureRelatedTo(sourceSignatures[0], targetSignatures[0], eraseGenerics, reportErrors, incompatibleReporter(sourceSignatures[0], targetSignatures[0])); } else { outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) { var t = targetSignatures_1[_i]; // Only elaborate errors from the first failure var shouldElaborateErrors = reportErrors; - for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) { - var s = sourceSignatures_1[_c]; + for (var _a = 0, sourceSignatures_1 = sourceSignatures; _a < sourceSignatures_1.length; _a++) { + var s = sourceSignatures_1[_a]; var related = signatureRelatedTo(s, t, /*erase*/ true, shouldElaborateErrors, incompatibleReporter(s, t)); if (related) { result &= related; @@ -60294,13 +58714,13 @@ var ts; if (type.flags & 3145728 /* UnionOrIntersection */) { return !!ts.forEach(type.types, typeCouldHaveTopLevelSingletonTypes); } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getConstraintOfType(type); - if (constraint && constraint !== type) { + if (constraint) { return typeCouldHaveTopLevelSingletonTypes(constraint); } } - return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */); + return isUnitType(type); } function getBestMatchingType(source, target, isRelatedTo) { if (isRelatedTo === void 0) { isRelatedTo = compareTypesAssignable; } @@ -60334,18 +58754,8 @@ var ts; } } var match = discriminable.indexOf(/*searchElement*/ true); - if (match === -1) { - return defaultValue; - } // make sure exactly 1 matches before returning it - var nextMatch = discriminable.indexOf(/*searchElement*/ true, match + 1); - while (nextMatch !== -1) { - if (!isTypeIdenticalTo(target.types[match], target.types[nextMatch])) { - return defaultValue; - } - nextMatch = discriminable.indexOf(/*searchElement*/ true, nextMatch + 1); - } - return target.types[match]; + return match === -1 || discriminable.indexOf(/*searchElement*/ true, match + 1) !== -1 ? defaultValue : target.types[match]; } /** * A type is 'weak' if it is an object type with at least one optional property @@ -60394,15 +58804,13 @@ var ts; // instantiations of the generic type for type arguments with known relations. The function // returns the emptyArray singleton when invoked recursively for the given generic type. function getVariancesWorker(typeParameters, cache, createMarkerType) { - var _a, _b, _c; if (typeParameters === void 0) { typeParameters = ts.emptyArray; } var variances = cache.variances; if (!variances) { - ts.tracing.push("check" /* Check */, "getVariancesWorker", { arity: typeParameters.length, id: (_c = (_a = cache.id) !== null && _a !== void 0 ? _a : (_b = cache.declaredType) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : -1 }); // The emptyArray singleton is used to signal a recursive invocation. cache.variances = ts.emptyArray; variances = []; - var _loop_19 = function (tp) { + var _loop_18 = function (tp) { var unmeasurable = false; var unreliable = false; var oldHandler = outofbandVarianceMarkerHandler; @@ -60434,10 +58842,9 @@ var ts; }; for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) { var tp = typeParameters_1[_i]; - _loop_19(tp); + _loop_18(tp); } cache.variances = variances; - ts.tracing.pop(); } return variances; } @@ -60568,54 +58975,58 @@ var ts; // has expanded into `[A>>>>>]` // in such cases we need to terminate the expansion, and we do so here. function isDeeplyNestedType(type, stack, depth) { - if (depth >= 5) { - var identity_1 = getRecursionIdentity(type); - if (identity_1) { - var count = 0; - for (var i = 0; i < depth; i++) { - if (getRecursionIdentity(stack[i]) === identity_1) { - count++; - if (count >= 5) { - return true; + // We track all object types that have an associated symbol (representing the origin of the type) + if (depth >= 5 && type.flags & 524288 /* Object */) { + if (!isObjectOrArrayLiteralType(type)) { + var symbol = type.symbol; + if (symbol) { + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 524288 /* Object */ && t.symbol === symbol) { + count++; + if (count >= 5) + return true; } } } } + if (ts.getObjectFlags(type) && 4 /* Reference */ && !!type.node) { + var root = type.target; + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (ts.getObjectFlags(t) && 4 /* Reference */ && !!t.node && t.target === root) { + count++; + if (count >= 5) + return true; + } + } + } + } + if (depth >= 5 && type.flags & 8388608 /* IndexedAccess */) { + var root = getRootObjectTypeFromIndexedAccessChain(type); + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (getRootObjectTypeFromIndexedAccessChain(t) === root) { + count++; + if (count >= 5) + return true; + } + } } return false; } - // Types with constituents that could circularly reference the type have a recursion identity. The recursion - // identity is some object that is common to instantiations of the type with the same origin. - function getRecursionIdentity(type) { - if (type.flags & 524288 /* Object */ && !isObjectOrArrayLiteralType(type)) { - if (ts.getObjectFlags(type) && 4 /* Reference */ && type.node) { - // Deferred type references are tracked through their associated AST node. This gives us finer - // granularity than using their associated target because each manifest type reference has a - // unique AST node. - return type.node; - } - if (type.symbol && !(ts.getObjectFlags(type) & 16 /* Anonymous */ && type.symbol.flags & 32 /* Class */)) { - // We track all object types that have an associated symbol (representing the origin of the type), but - // exclude the static side of classes from this check since it shares its symbol with the instance side. - return type.symbol; - } - if (isTupleType(type)) { - // Tuple types are tracked through their target type - return type.target; - } + /** + * Gets the leftmost object type in a chain of indexed accesses, eg, in A[P][Q], returns A + */ + function getRootObjectTypeFromIndexedAccessChain(type) { + var t = type; + while (t.flags & 8388608 /* IndexedAccess */) { + t = t.objectType; } - if (type.flags & 8388608 /* IndexedAccess */) { - // Identity is the leftmost object type in a chain of indexed accesses, eg, in A[P][Q] it is A - do { - type = type.objectType; - } while (type.flags & 8388608 /* IndexedAccess */); - return type; - } - if (type.flags & 16777216 /* Conditional */) { - // The root object represents the origin of the conditional type - return type.root; - } - return undefined; + return t; } function isPropertyIdenticalTo(sourceProp, targetProp) { return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0 /* False */; @@ -60738,8 +59149,8 @@ var ts; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var t = types_13[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -60913,8 +59324,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var t = types_14[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var t = types_13[_i]; result |= getFalsyFlags(t); } return result; @@ -60944,7 +59355,7 @@ var ts; type.flags & 64 /* BigInt */ ? zeroBigIntType : type === regularFalseType || type === falseType || - type.flags & (16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */ | 3 /* AnyOrUnknown */) || + type.flags & (16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */) || type.flags & 128 /* StringLiteral */ && type.value === "" || type.flags & 256 /* NumberLiteral */ && type.value === 0 || type.flags & 2048 /* BigIntLiteral */ && isZeroBigInt(type) ? type : @@ -61247,12 +59658,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 216 /* BinaryExpression */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 213 /* BinaryExpression */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 160 /* Parameter */: + case 159 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -61267,23 +59678,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 3 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -61297,7 +59708,7 @@ var ts; wideningKind === 3 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 190 /* MappedType */: + case 189 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -61427,7 +59838,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 465829888 /* Instantiable */ || + var result = !!(type.flags & 63176704 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */)) || @@ -61439,15 +59850,16 @@ var ts; } function isNonGenericTopLevelType(type) { if (type.aliasSymbol && !type.aliasTypeArguments) { - var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 254 /* TypeAliasDeclaration */); - return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 297 /* SourceFile */ ? true : n.kind === 256 /* ModuleDeclaration */ ? false : "quit"; })); + var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 251 /* TypeAliasDeclaration */); + return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 294 /* SourceFile */ ? true : n.kind === 253 /* ModuleDeclaration */ ? false : "quit"; })); } return false; } function isTypeParameterAtTopLevel(type, typeParameter) { return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && ts.some(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }) || - type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); + type.flags & 16777216 /* Conditional */ && (isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type), typeParameter) || + isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type), typeParameter))); } /** Create an object with properties named in the string literal type. Every property has type `any` */ function createEmptyObjectTypeFromStringLiteral(type) { @@ -61494,8 +59906,7 @@ var ts; // arrow function, but is considered partially inferable because property 'a' has an inferable type. function isPartiallyInferableType(type) { return !(ts.getObjectFlags(type) & 2097152 /* NonInferrableType */) || - isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }) || - isTupleType(type) && ts.some(getTypeArguments(type), isPartiallyInferableType); + isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }); } function createReverseMappedType(source, target, constraint) { // We consider a source type reverse mappable if it has a string index signature or if @@ -61599,73 +60010,17 @@ var ts; function isFromInferenceBlockedSource(type) { return !!(type.symbol && ts.some(type.symbol.declarations, hasSkipDirectInferenceFlag)); } - function isValidBigIntString(s) { - var scanner = ts.createScanner(99 /* ESNext */, /*skipTrivia*/ false); - var success = true; - scanner.setOnError(function () { return success = false; }); - scanner.setText(s + "n"); - var result = scanner.scan(); - if (result === 40 /* MinusToken */) { - result = scanner.scan(); - } - var flags = scanner.getTokenFlags(); - // validate that - // * scanning proceeded without error - // * a bigint can be scanned, and that when it is scanned, it is - // * the full length of the input string (so the scanner is one character beyond the augmented input length) - // * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input) - return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === (s.length + 1) && !(flags & 512 /* ContainsSeparator */); - } - function isStringLiteralTypeValueParsableAsType(s, target) { - if (target.flags & 1048576 /* Union */) { - return !!forEachType(target, function (t) { return isStringLiteralTypeValueParsableAsType(s, t); }); - } - switch (target) { - case stringType: return true; - case numberType: return s.value !== "" && isFinite(+(s.value)); - case bigintType: return s.value !== "" && isValidBigIntString(s.value); - // the next 4 should be handled in `getTemplateLiteralType`, as they are all exactly one value, but are here for completeness, just in case - // this function is ever used on types which don't come from template literal holes - case trueType: return s.value === "true"; - case falseType: return s.value === "false"; - case undefinedType: return s.value === "undefined"; - case nullType: return s.value === "null"; - default: return !!(target.flags & 1 /* Any */); - } - } - function inferLiteralsFromTemplateLiteralType(source, target) { - var value = source.value; - var texts = target.texts; - var lastIndex = texts.length - 1; - var startText = texts[0]; - var endText = texts[lastIndex]; - if (!(value.startsWith(startText) && value.slice(startText.length).endsWith(endText))) - return undefined; - var matches = []; - var str = value.slice(startText.length, value.length - endText.length); - var pos = 0; - for (var i = 1; i < lastIndex; i++) { - var delim = texts[i]; - var delimPos = delim.length > 0 ? str.indexOf(delim, pos) : pos < str.length ? pos + 1 : -1; - if (delimPos < 0) - return undefined; - matches.push(getLiteralType(str.slice(pos, delimPos))); - pos = delimPos + delim.length; - } - matches.push(getLiteralType(str.slice(pos))); - return matches; - } function inferTypes(inferences, originalSource, originalTarget, priority, contravariant) { if (priority === void 0) { priority = 0; } if (contravariant === void 0) { contravariant = false; } + var symbolOrTypeStack; + var visited; var bivariant = false; var propagationType; var inferencePriority = 1024 /* MaxValue */; var allowComplexConstraintInference = true; - var visited; - var sourceStack; - var targetStack; - var expandingFlags = 0 /* None */; + var objectTypeComparisonDepth = 0; + var targetStack = []; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { if (!couldContainTypeVariables(target)) { @@ -61793,7 +60148,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 465829888 /* Instantiable */) { + if (indexType.flags & 63176704 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -61822,13 +60177,18 @@ var ts; inferFromTypes(source.objectType, target.objectType); inferFromTypes(source.indexType, target.indexType); } - else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) { - if (source.symbol === target.symbol) { - inferFromTypes(source.type, target.type); - } + else if (source.flags & 16777216 /* Conditional */ && target.flags & 16777216 /* Conditional */) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); + inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } else if (target.flags & 16777216 /* Conditional */) { - invokeOnce(source, target, inferToConditionalType); + var savePriority = priority; + priority |= contravariant ? 32 /* ContravariantConditional */ : 0; + var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; + inferToMultipleTypes(source, targetTypes, target.flags); + priority = savePriority; } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); @@ -61841,12 +60201,9 @@ var ts; inferFromTypes(sourceType, target); } } - else if (target.flags & 134217728 /* TemplateLiteral */) { - inferToTemplateLiteralType(source, target); - } else { source = getReducedType(source); - if (!(priority & 256 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) { + if (!(priority & 256 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -61891,30 +60248,7 @@ var ts; (visited || (visited = new ts.Map())).set(key, -1 /* Circularity */); var saveInferencePriority = inferencePriority; inferencePriority = 1024 /* MaxValue */; - // We stop inferring and report a circularity if we encounter duplicate recursion identities on both - // the source side and the target side. - var saveExpandingFlags = expandingFlags; - var sourceIdentity = getRecursionIdentity(source) || source; - var targetIdentity = getRecursionIdentity(target) || target; - if (sourceIdentity && ts.contains(sourceStack, sourceIdentity)) - expandingFlags |= 1 /* Source */; - if (targetIdentity && ts.contains(targetStack, targetIdentity)) - expandingFlags |= 2 /* Target */; - if (expandingFlags !== 3 /* Both */) { - if (sourceIdentity) - (sourceStack || (sourceStack = [])).push(sourceIdentity); - if (targetIdentity) - (targetStack || (targetStack = [])).push(targetIdentity); - action(source, target); - if (targetIdentity) - targetStack.pop(); - if (sourceIdentity) - sourceStack.pop(); - } - else { - inferencePriority = -1 /* Circularity */; - } - expandingFlags = saveExpandingFlags; + action(source, target); visited.set(key, inferencePriority); inferencePriority = Math.min(inferencePriority, saveInferencePriority); } @@ -61971,8 +60305,8 @@ var ts; } function getSingleTypeVariableFromIntersectionTypes(types) { var typeVariable; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var type = types_15[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var type = types_14[_i]; var t = type.flags & 2097152 /* Intersection */ && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); }); if (!t || typeVariable && t !== typeVariable) { return undefined; @@ -62110,31 +60444,40 @@ var ts; } return false; } - function inferToConditionalType(source, target) { - if (source.flags & 16777216 /* Conditional */) { - inferFromTypes(source.checkType, target.checkType); - inferFromTypes(source.extendsType, target.extendsType); - inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); - inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); + function inferFromObjectTypes(source, target) { + // If we are already processing another target type with the same associated symbol (such as + // an instantiation of the same generic type), we do not explore this target as it would yield + // no further inferences. We exclude the static side of classes from this check since it shares + // its symbol with the instance side which would lead to false positives. + var isNonConstructorObject = target.flags & 524288 /* Object */ && + !(ts.getObjectFlags(target) & 16 /* Anonymous */ && target.symbol && target.symbol.flags & 32 /* Class */); + var symbolOrType = ts.getObjectFlags(target) & 4 /* Reference */ && target.node ? getNormalizedType(target, /*writing*/ false) : isNonConstructorObject ? isTupleType(target) ? target.target : target.symbol : undefined; + if (symbolOrType) { + if (ts.contains(symbolOrTypeStack, symbolOrType)) { + if (ts.getObjectFlags(target) & 4 /* Reference */ && target.node) { + // Don't set the circularity flag for re-encountered recursive type references just because we're already exploring them + return; + } + inferencePriority = -1 /* Circularity */; + return; + } + targetStack[objectTypeComparisonDepth] = target; + objectTypeComparisonDepth++; + if (isDeeplyNestedType(target, targetStack, objectTypeComparisonDepth)) { + inferencePriority = -1 /* Circularity */; + objectTypeComparisonDepth--; + return; + } + (symbolOrTypeStack || (symbolOrTypeStack = [])).push(symbolOrType); + inferFromObjectTypesWorker(source, target); + symbolOrTypeStack.pop(); + objectTypeComparisonDepth--; } else { - var savePriority = priority; - priority |= contravariant ? 32 /* ContravariantConditional */ : 0; - var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; - inferToMultipleTypes(source, targetTypes, target.flags); - priority = savePriority; + inferFromObjectTypesWorker(source, target); } } - function inferToTemplateLiteralType(source, target) { - var matches = source.flags & 128 /* StringLiteral */ ? inferLiteralsFromTemplateLiteralType(source, target) : - source.flags & 134217728 /* TemplateLiteral */ && ts.arraysEqual(source.texts, target.texts) ? source.types : - undefined; - var types = target.types; - for (var i = 0; i < types.length; i++) { - inferFromTypes(matches ? matches[i] : neverType, types[i]); - } - } - function inferFromObjectTypes(source, target) { + function inferFromObjectTypesWorker(source, target) { if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) { // If source and target are references to the same generic type, infer from type arguments inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target)); @@ -62145,12 +60488,8 @@ var ts; // from S to T and from X to Y. inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target)); inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); - var sourceNameType = getNameTypeFromMappedType(source); - var targetNameType = getNameTypeFromMappedType(target); - if (sourceNameType && targetNameType) - inferFromTypes(sourceNameType, targetNameType); } - if (ts.getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) { + if (ts.getObjectFlags(target) & 32 /* Mapped */) { var constraintType = getConstraintTypeFromMappedType(target); if (inferToMappedType(source, target, constraintType)) { return; @@ -62258,7 +60597,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 165 /* MethodDeclaration */ || kind === 164 /* MethodSignature */ || kind === 166 /* Constructor */; + bivariant = bivariant || kind === 164 /* MethodDeclaration */ || kind === 163 /* MethodSignature */ || kind === 165 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -62293,7 +60632,7 @@ var ts; } function hasPrimitiveConstraint(type) { var constraint = getConstraintOfTypeParameter(type); - return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */); } function isObjectLiteralType(type) { return !!(ts.getObjectFlags(type) & 128 /* ObjectLiteral */); @@ -62402,22 +60741,22 @@ var ts; return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom; case "$": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery; case "describe": case "suite": case "it": case "test": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha; case "process": case "require": case "Buffer": case "module": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode; case "Map": case "Set": case "Promise": @@ -62426,19 +60765,9 @@ var ts; case "WeakSet": case "Iterator": case "AsyncIterator": - case "SharedArrayBuffer": - case "Atomics": - case "AsyncIterable": - case "AsyncIterableIterator": - case "AsyncGenerator": - case "AsyncGeneratorFunction": - case "BigInt": - case "Reflect": - case "BigInt64Array": - case "BigUint64Array": - return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later; + return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 286 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -62459,7 +60788,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 176 /* TypeQuery */ ? true : n.kind === 78 /* Identifier */ || n.kind === 157 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 175 /* TypeQuery */ ? true : n.kind === 78 /* Identifier */ || n.kind === 156 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -62474,11 +60803,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 107 /* ThisKeyword */: return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType); - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -62489,28 +60818,26 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: return isMatchingReference(source, target.expression); - case 216 /* BinaryExpression */: - return (ts.isAssignmentExpression(target) && isMatchingReference(source, target.left)) || - (ts.isBinaryExpression(target) && target.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source, target.right)); + case 213 /* BinaryExpression */: + return ts.isAssignmentExpression(target) && isMatchingReference(source, target.left); } switch (source.kind) { case 78 /* Identifier */: - case 79 /* PrivateIdentifier */: return target.kind === 78 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 249 /* VariableDeclaration */ || target.kind === 198 /* BindingElement */) && + (target.kind === 246 /* VariableDeclaration */ || target.kind === 195 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 107 /* ThisKeyword */: return target.kind === 107 /* ThisKeyword */; case 105 /* SuperKeyword */: return target.kind === 105 /* SuperKeyword */; - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -62520,11 +60847,11 @@ var ts; // Given a source x, check if target matches x or is an && operation with an operand that matches x. function containsTruthyCheck(source, target) { return isMatchingReference(source, target) || - (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && + (target.kind === 213 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right))); } function getAccessedPropertyName(access) { - return access.kind === 201 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 198 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -62553,7 +60880,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 465829888 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -62586,7 +60913,7 @@ var ts; } } } - if (callExpression.expression.kind === 201 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 198 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -62635,8 +60962,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0 /* None */; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var t = types_16[_i]; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var t = types_15[_i]; result |= getTypeFacts(t); } return result; @@ -62707,7 +61034,7 @@ var ts; if (flags & 131072 /* Never */) { return 0 /* None */; } - if (flags & 465829888 /* Instantiable */) { + if (flags & 63176704 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -62731,35 +61058,28 @@ var ts; return errorType; var text = getPropertyNameFromType(nameType); return getConstraintForLocation(getTypeOfPropertyOfType(type, text), name) || - isNumericLiteralName(text) && includeUndefinedInIndexSignature(getIndexTypeOfType(type, 1 /* Number */)) || - includeUndefinedInIndexSignature(getIndexTypeOfType(type, 0 /* String */)) || + isNumericLiteralName(text) && getIndexTypeOfType(type, 1 /* Number */) || + getIndexTypeOfType(type, 0 /* String */) || errorType; } function getTypeOfDestructuredArrayElement(type, index) { return everyType(type, isTupleLikeType) && getTupleElementType(type, index) || - includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined)) || + checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType; } - function includeUndefinedInIndexSignature(type) { - if (!type) - return type; - return compilerOptions.noUncheckedIndexedAccess ? - getUnionType([type, undefinedType]) : - type; - } function getTypeOfDestructuredSpreadExpression(type) { return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 199 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 288 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 196 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 285 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 216 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 239 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 213 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 236 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -62776,21 +61096,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return stringType; - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return checkRightHandSideOfForOf(parent) || errorType; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return undefinedType; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -62798,7 +61118,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 196 /* ObjectBindingPattern */ ? + var type = pattern.kind === 193 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -62816,30 +61136,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 238 /* ForInStatement */) { + if (node.parent.parent.kind === 235 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 239 /* ForOfStatement */) { + if (node.parent.parent.kind === 236 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 249 /* VariableDeclaration */ ? + return node.kind === 246 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 249 /* VariableDeclaration */ && node.initializer && + return node.kind === 246 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 198 /* BindingElement */ && node.parent.kind === 216 /* BinaryExpression */ && + node.kind !== 195 /* BindingElement */ && node.parent.kind === 213 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 74 /* BarBarEqualsToken */: @@ -62854,13 +61174,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 207 /* ParenthesizedExpression */ || - parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 204 /* ParenthesizedExpression */ || + parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -62880,7 +61200,7 @@ var ts; var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; @@ -63017,8 +61337,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { - var t = types_17[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var t = types_16[_i]; if (!(t.flags & 131072 /* Never */)) { if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) { return false; @@ -63042,12 +61362,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 203 /* CallExpression */ + parent.parent.kind === 200 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 202 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 199 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 216 /* BinaryExpression */ && + parent.parent.kind === 213 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -63055,8 +61375,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return (declaration.kind === 249 /* VariableDeclaration */ || declaration.kind === 160 /* Parameter */ || - declaration.kind === 163 /* PropertyDeclaration */ || declaration.kind === 162 /* PropertySignature */) && + return (declaration.kind === 246 /* VariableDeclaration */ || declaration.kind === 159 /* Parameter */ || + declaration.kind === 162 /* PropertyDeclaration */ || declaration.kind === 161 /* PropertySignature */) && !!ts.getEffectiveTypeAnnotationNode(declaration); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -63064,18 +61384,12 @@ var ts; return getTypeOfSymbol(symbol); } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { - if (ts.getCheckFlags(symbol) & 262144 /* Mapped */) { - var origin = symbol.syntheticOrigin; - if (origin && getExplicitTypeOfSymbol(origin)) { - return getTypeOfSymbol(symbol); - } - } var declaration = symbol.valueDeclaration; if (declaration) { if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 236 /* ForOfStatement */) { var statement = declaration.parent.parent; var expressionType = getTypeOfDottedName(statement.expression, /*diagnostic*/ undefined); if (expressionType) { @@ -63103,11 +61417,11 @@ var ts; return getExplicitThisType(node); case 105 /* SuperKeyword */: return checkSuperExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -63121,7 +61435,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 233 /* ExpressionStatement */) { + if (node.parent.kind === 230 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 105 /* SuperKeyword */) { @@ -63165,7 +61479,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 94 /* FalseKeyword */ || node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 94 /* FalseKeyword */ || node.kind === 213 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -63284,7 +61598,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 536624127 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -63296,7 +61610,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 225 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 222 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -63311,13 +61625,11 @@ var ts; if (flowDepth === 2000) { // We have made 2000 recursive invocations. To avoid overflowing the call stack we report an error // and disable further control flow analysis in the containing function or module body. - ts.tracing.instant("check" /* Check */, "getTypeAtFlowNode_DepthLimit", { flowId: flow.id }); flowAnalysisDisabled = true; reportFlowControlError(reference); return errorType; } flowDepth++; - var sharedFlow; while (true) { var flags = flow.flags; if (flags & 4096 /* Shared */) { @@ -63330,7 +61642,6 @@ var ts; return sharedFlowTypes[i]; } } - sharedFlow = flow; } var type = void 0; if (flags & 16 /* Assignment */) { @@ -63380,8 +61691,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 201 /* PropertyAccessExpression */ && - reference.kind !== 202 /* ElementAccessExpression */ && + reference.kind !== 198 /* PropertyAccessExpression */ && + reference.kind !== 199 /* ElementAccessExpression */ && reference.kind !== 107 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -63394,9 +61705,9 @@ var ts; // simply return the non-auto declared type to reduce follow-on errors. type = convertAutoToAny(declaredType); } - if (sharedFlow) { + if (flags & 4096 /* Shared */) { // Record visited node and the associated type in the cache. - sharedFlowNodes[sharedFlowCount] = sharedFlow; + sharedFlowNodes[sharedFlowCount] = flow; sharedFlowTypes[sharedFlowCount] = type; sharedFlowCount++; } @@ -63406,7 +61717,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -63446,14 +61757,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 208 /* FunctionExpression */ || init.kind === 209 /* ArrowFunction */)) { + if (init && (init.kind === 205 /* FunctionExpression */ || init.kind === 206 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 238 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 235 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -63464,7 +61775,7 @@ var ts; if (node.kind === 94 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 216 /* BinaryExpression */) { + if (node.kind === 213 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -63495,7 +61806,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 203 /* CallExpression */ ? + var expr = node.kind === 200 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -63503,7 +61814,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -63551,7 +61862,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 211 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 208 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -63559,7 +61870,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 211 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 208 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -63777,10 +62088,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 208 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 208 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -63900,7 +62211,7 @@ var ts; if (assumeTrue && type.flags & 2 /* Unknown */ && literal.text === "object") { // The pattern x && typeof x === 'object', where x is of type unknown, narrows x to type object. We don't // need to check for the reverse typeof x === 'object' && x since that already narrows correctly. - if (typeOfExpr.parent.parent.kind === 216 /* BinaryExpression */) { + if (typeOfExpr.parent.parent.kind === 213 /* BinaryExpression */) { var expr = typeOfExpr.parent.parent; if (expr.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) { return nonPrimitiveType; @@ -63983,7 +62294,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -64148,10 +62459,15 @@ var ts; return assignableType; } } - // If the candidate type is a subtype of the target type, narrow to the candidate type, - // if the target type is a subtype of the candidate type, narrow to the target type, - // otherwise, narrow to an intersection of the two types. - return isTypeSubtypeOf(candidate, type) ? candidate : isTypeSubtypeOf(type, candidate) ? type : getIntersectionType([type, candidate]); + // If the candidate type is a subtype of the target type, narrow to the candidate type. + // Otherwise, if the target type is assignable to the candidate type, keep the target type. + // Otherwise, if the candidate type is assignable to the target type, narrow to the candidate + // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the + // two types. + return isTypeSubtypeOf(candidate, type) ? candidate : + isTypeAssignableTo(type, candidate) ? type : + isTypeAssignableTo(candidate, type) ? candidate : + getIntersectionType([type, candidate]); } function narrowTypeByCallExpression(type, callExpression, assumeTrue) { if (hasMatchingArgument(callExpression, reference)) { @@ -64194,17 +62510,16 @@ var ts; case 78 /* Identifier */: case 107 /* ThisKeyword */: case 105 /* SuperKeyword */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -64249,9 +62564,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 257 /* ModuleBlock */ || - node.kind === 297 /* SourceFile */ || - node.kind === 163 /* PropertyDeclaration */; + node.kind === 254 /* ModuleBlock */ || + node.kind === 294 /* SourceFile */ || + node.kind === 162 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -64273,7 +62588,7 @@ var ts; if (node.kind === 78 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 160 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 159 /* Parameter */) { symbol.isAssigned = true; } } @@ -64289,7 +62604,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 160 /* Parameter */ && + declaration.kind === 159 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -64303,10 +62618,10 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 201 /* PropertyAccessExpression */ || - parent.kind === 203 /* CallExpression */ && parent.expression === node || - parent.kind === 202 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 198 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 198 /* PropertyAccessExpression */ || + parent.kind === 200 /* CallExpression */ && parent.expression === node || + parent.kind === 199 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 195 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); @@ -64348,7 +62663,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 209 /* ArrowFunction */) { + if (container.kind === 206 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasSyntacticModifier(container, 256 /* Async */)) { @@ -64364,16 +62679,16 @@ var ts; markAliasReferenced(symbol, node); } var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - var sourceSymbol = localOrExportSymbol.flags & 2097152 /* Alias */ ? resolveAlias(localOrExportSymbol) : localOrExportSymbol; - if (getDeclarationNodeFlagsFromSymbol(sourceSymbol) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node.parent, sourceSymbol)) { - errorOrSuggestion(/* isError */ false, node, ts.Diagnostics._0_is_deprecated, node.escapedText); - } var declaration = localOrExportSymbol.valueDeclaration; + if (declaration && ts.getCombinedNodeFlags(declaration) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node.parent, localOrExportSymbol)) { + errorOrSuggestion(/* isError */ false, node, ts.Diagnostics._0_is_deprecated, node.escapedText); + ; + } if (localOrExportSymbol.flags & 32 /* Class */) { // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 252 /* ClassDeclaration */ + if (declaration.kind === 249 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -64385,14 +62700,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 221 /* ClassExpression */) { + else if (declaration.kind === 218 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 297 /* SourceFile */) { + while (container.kind !== 294 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 163 /* PropertyDeclaration */ && ts.hasSyntacticModifier(container, 32 /* Static */)) { + if (container.kind === 162 /* PropertyDeclaration */ && ts.hasSyntacticModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -64441,7 +62756,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 160 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 159 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -64450,8 +62765,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 208 /* FunctionExpression */ || - flowContainer.kind === 209 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 205 /* FunctionExpression */ || + flowContainer.kind === 206 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -64460,9 +62775,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 270 /* ExportSpecifier */) || - node.parent.kind === 225 /* NonNullExpression */ || - declaration.kind === 249 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 267 /* ExportSpecifier */) || + node.parent.kind === 222 /* NonNullExpression */ || + declaration.kind === 246 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -64497,7 +62812,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 287 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 284 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -64520,7 +62835,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 247 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -64541,7 +62856,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 247 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -64560,7 +62875,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 207 /* ParenthesizedExpression */) { + while (current.parent.kind === 204 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -64568,7 +62883,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 214 /* PrefixUnaryExpression */ || current.parent.kind === 215 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 211 /* PrefixUnaryExpression */ || current.parent.kind === 212 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -64581,7 +62896,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 163 /* PropertyDeclaration */ || container.kind === 166 /* Constructor */) { + if (container.kind === 162 /* PropertyDeclaration */ || container.kind === 165 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -64621,37 +62936,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 166 /* Constructor */) { + if (container.kind === 165 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 209 /* ArrowFunction */) { + if (container.kind === 206 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 166 /* Constructor */: + case 165 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: if (ts.hasSyntacticModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -64739,7 +63054,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 208 /* FunctionExpression */ && + if (container.kind === 205 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -64749,16 +63064,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 165 /* MethodDeclaration */ && - container.parent.kind === 200 /* ObjectLiteralExpression */ && + else if (container.kind === 164 /* MethodDeclaration */ && + container.parent.kind === 197 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 208 /* FunctionExpression */ && - container.parent.kind === 288 /* PropertyAssignment */ && - container.parent.parent.kind === 200 /* ObjectLiteralExpression */ && + else if (container.kind === 205 /* FunctionExpression */ && + container.parent.kind === 285 /* PropertyAssignment */ && + container.parent.parent.kind === 197 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -64766,7 +63081,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 208 /* FunctionExpression */ && + else if (container.kind === 205 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -64791,7 +63106,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 308 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 304 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -64805,16 +63120,16 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 160 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 159 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 203 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 200 /* CallExpression */ && node.parent.expression === node; var immediateContainer = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var container = immediateContainer; var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 209 /* ArrowFunction */) { + while (container && container.kind === 206 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -64827,14 +63142,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 158 /* ComputedPropertyName */; }); - if (current && current.kind === 158 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 157 /* ComputedPropertyName */; }); + if (current && current.kind === 157 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 197 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -64842,7 +63157,7 @@ var ts; } return errorType; } - if (!isCallExpression && immediateContainer.kind === 166 /* Constructor */) { + if (!isCallExpression && immediateContainer.kind === 165 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasSyntacticModifier(container, 32 /* Static */) || isCallExpression) { @@ -64911,7 +63226,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 165 /* MethodDeclaration */ && ts.hasSyntacticModifier(container, 256 /* Async */)) { + if (container.kind === 164 /* MethodDeclaration */ && ts.hasSyntacticModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -64925,7 +63240,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 200 /* ObjectLiteralExpression */) { + if (container.parent.kind === 197 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -64946,7 +63261,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 166 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 165 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -64961,7 +63276,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 166 /* Constructor */; + return container.kind === 165 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -64969,21 +63284,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 197 /* ObjectLiteralExpression */) { if (ts.hasSyntacticModifier(container, 32 /* Static */)) { - return container.kind === 165 /* MethodDeclaration */ || - container.kind === 164 /* MethodSignature */ || - container.kind === 167 /* GetAccessor */ || - container.kind === 168 /* SetAccessor */; + return container.kind === 164 /* MethodDeclaration */ || + container.kind === 163 /* MethodSignature */ || + container.kind === 166 /* GetAccessor */ || + container.kind === 167 /* SetAccessor */; } else { - return container.kind === 165 /* MethodDeclaration */ || - container.kind === 164 /* MethodSignature */ || - container.kind === 167 /* GetAccessor */ || - container.kind === 168 /* SetAccessor */ || - container.kind === 163 /* PropertyDeclaration */ || - container.kind === 162 /* PropertySignature */ || - container.kind === 166 /* Constructor */; + return container.kind === 164 /* MethodDeclaration */ || + container.kind === 163 /* MethodSignature */ || + container.kind === 166 /* GetAccessor */ || + container.kind === 167 /* SetAccessor */ || + container.kind === 162 /* PropertyDeclaration */ || + container.kind === 161 /* PropertySignature */ || + container.kind === 165 /* Constructor */; } } } @@ -64991,10 +63306,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 165 /* MethodDeclaration */ || - func.kind === 167 /* GetAccessor */ || - func.kind === 168 /* SetAccessor */) && func.parent.kind === 200 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 208 /* FunctionExpression */ && func.parent.kind === 288 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 164 /* MethodDeclaration */ || + func.kind === 166 /* GetAccessor */ || + func.kind === 167 /* SetAccessor */) && func.parent.kind === 197 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 205 /* FunctionExpression */ && func.parent.kind === 285 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -65006,7 +63321,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 209 /* ArrowFunction */) { + if (func.kind === 206 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -65033,7 +63348,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 288 /* PropertyAssignment */) { + if (literal.parent.kind !== 285 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -65047,7 +63362,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -65100,41 +63415,25 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 160 /* Parameter */: + case 159 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getContextualTypeForBindingElement(declaration); - case 163 /* PropertyDeclaration */: - if (ts.hasSyntacticModifier(declaration, 32 /* Static */)) { - return getContextualTypeForStaticPropertyDeclaration(declaration); - } - // By default, do nothing and return undefined - only the above cases have context implied by a parent + // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } } function getContextualTypeForBindingElement(declaration) { var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 198 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); - if (!parentType || ts.isBindingPattern(name) || ts.isComputedNonLiteralName(name)) - return undefined; - if (parent.name.kind === 197 /* ArrayBindingPattern */) { - var index = ts.indexOfNode(declaration.parent.elements, declaration); - if (index < 0) - return undefined; - return getContextualTypeForElementExpression(parentType, index); + parent.kind !== 195 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + if (parentType && !ts.isBindingPattern(name) && !ts.isComputedNonLiteralName(name)) { + var nameType = getLiteralTypeFromPropertyName(name); + if (isTypeUsableAsPropertyName(nameType)) { + var text = getPropertyNameFromType(nameType); + return getTypeOfPropertyOfType(parentType, text); + } } - var nameType = getLiteralTypeFromPropertyName(name); - if (isTypeUsableAsPropertyName(nameType)) { - var text = getPropertyNameFromType(nameType); - return getTypeOfPropertyOfType(parentType, text); - } - } - function getContextualTypeForStaticPropertyDeclaration(declaration) { - var parentType = ts.isExpression(declaration.parent) && getContextualType(declaration.parent); - if (!parentType) - return undefined; - return getTypeOfPropertyOfContextualType(parentType, getSymbolOfNode(declaration).escapedName); } // In a variable, parameter or property declaration with a type annotation, // the contextual type of an initializer expression is the type of the variable, parameter or property. @@ -65255,7 +63554,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 205 /* TaggedTemplateExpression */) { + if (template.parent.kind === 202 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -65268,7 +63567,14 @@ var ts; case 75 /* AmpersandAmpersandEqualsToken */: case 74 /* BarBarEqualsToken */: case 76 /* QuestionQuestionEqualsToken */: - return node === right ? getContextualTypeForAssignmentDeclaration(binaryExpression) : undefined; + if (node !== right) { + return undefined; + } + var contextSensitive = getIsContextSensitiveAssignmentOrContextType(binaryExpression); + if (!contextSensitive) { + return undefined; + } + return contextSensitive === true ? getTypeOfExpression(left) : contextSensitive; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: // When an || expression has a contextual type, the operands are contextually typed by that type, except @@ -65288,27 +63594,24 @@ var ts; } // In an assignment expression, the right operand is contextually typed by the type of the left operand. // Don't do this for assignment declarations unless there is a type tag on the assignment, to avoid circularity from checking the right operand. - function getContextualTypeForAssignmentDeclaration(binaryExpression) { + function getIsContextSensitiveAssignmentOrContextType(binaryExpression) { var kind = ts.getAssignmentDeclarationKind(binaryExpression); switch (kind) { case 0 /* None */: - return getTypeOfExpression(binaryExpression.left); + return true; case 5 /* Property */: case 1 /* ExportsProperty */: case 6 /* Prototype */: case 3 /* PrototypeProperty */: - if (isPossiblyAliasedThisProperty(binaryExpression, kind)) { - return getContextualTypeForThisPropertyAssignment(binaryExpression, kind); - } // If `binaryExpression.left` was assigned a symbol, then this is a new declaration; otherwise it is an assignment to an existing declaration. // See `bindStaticPropertyAssignment` in `binder.ts`. - else if (!binaryExpression.left.symbol) { - return getTypeOfExpression(binaryExpression.left); + if (!binaryExpression.left.symbol) { + return true; } else { var decl = binaryExpression.left.symbol.valueDeclaration; if (!decl) { - return undefined; + return false; } var lhs = ts.cast(binaryExpression.left, ts.isAccessExpression); var overallAnnotation = ts.getEffectiveTypeAnnotationNode(decl); @@ -65321,19 +63624,39 @@ var ts; if (parentSymbol) { var annotated = parentSymbol.valueDeclaration && ts.getEffectiveTypeAnnotationNode(parentSymbol.valueDeclaration); if (annotated) { - var nameStr = ts.getElementOrPropertyAccessName(lhs); - if (nameStr !== undefined) { - return getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr); + var nameStr_1 = ts.getElementOrPropertyAccessName(lhs); + if (nameStr_1 !== undefined) { + var type = getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr_1); + return type || false; } } - return undefined; + return false; } } - return ts.isInJSFile(decl) ? undefined : getTypeOfExpression(binaryExpression.left); + return !ts.isInJSFile(decl); } case 2 /* ModuleExports */: case 4 /* ThisProperty */: - return getContextualTypeForThisPropertyAssignment(binaryExpression, kind); + if (!binaryExpression.symbol) + return true; + if (binaryExpression.symbol.valueDeclaration) { + var annotated = ts.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); + if (annotated) { + var type = getTypeFromTypeNode(annotated); + if (type) { + return type; + } + } + } + if (kind === 2 /* ModuleExports */) + return false; + var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression); + if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, /*includeArrowFunctions*/ false))) { + return false; + } + var thisType = checkThisExpression(thisAccess.expression); + var nameStr = ts.getElementOrPropertyAccessName(thisAccess); + return nameStr !== undefined && thisType && getTypeOfPropertyOfContextualType(thisType, nameStr) || false; case 7 /* ObjectDefinePropertyValue */: case 8 /* ObjectDefinePropertyExports */: case 9 /* ObjectDefinePrototypeProperty */: @@ -65342,40 +63665,6 @@ var ts; return ts.Debug.assertNever(kind); } } - function isPossiblyAliasedThisProperty(declaration, kind) { - if (kind === void 0) { kind = ts.getAssignmentDeclarationKind(declaration); } - if (kind === 4 /* ThisProperty */) { - return true; - } - if (!ts.isInJSFile(declaration) || kind !== 5 /* Property */ || !ts.isIdentifier(declaration.left.expression)) { - return false; - } - var name = declaration.left.expression.escapedText; - var symbol = resolveName(declaration.left, name, 111551 /* Value */, undefined, undefined, /*isUse*/ true, /*excludeGlobals*/ true); - return ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration); - } - function getContextualTypeForThisPropertyAssignment(binaryExpression, kind) { - if (!binaryExpression.symbol) - return getTypeOfExpression(binaryExpression.left); - if (binaryExpression.symbol.valueDeclaration) { - var annotated = ts.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); - if (annotated) { - var type = getTypeFromTypeNode(annotated); - if (type) { - return type; - } - } - } - if (kind === 2 /* ModuleExports */) - return undefined; - var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression); - if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, /*includeArrowFunctions*/ false))) { - return undefined; - } - var thisType = checkThisExpression(thisAccess.expression); - var nameStr = ts.getElementOrPropertyAccessName(thisAccess); - return nameStr !== undefined && getTypeOfPropertyOfContextualType(thisType, nameStr) || undefined; - } function isCircularMappedProperty(symbol) { return !!(ts.getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0); } @@ -65445,8 +63734,7 @@ var ts; // type of T. function getContextualTypeForElementExpression(arrayContextualType, index) { return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) - || mapType(arrayContextualType, function (t) { return getIteratedTypeOrElementType(1 /* Element */, t, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false); }, - /*noReductions*/ true)); + || getIteratedTypeOrElementType(1 /* Element */, arrayContextualType, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false)); } // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type. function getContextualTypeForConditionalOperand(node, contextFlags) { @@ -65460,7 +63748,7 @@ var ts; if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) { return undefined; } - var realChildren = ts.getSemanticJsxChildren(node.children); + var realChildren = getSemanticJsxChildren(node.children); var childIndex = realChildren.indexOf(child); var childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName); return childFieldType && (realChildren.length === 1 ? childFieldType : mapType(childFieldType, function (t) { @@ -65508,21 +63796,21 @@ var ts; case 94 /* FalseKeyword */: case 103 /* NullKeyword */: case 78 /* Identifier */: - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: return true; - case 201 /* PropertyAccessExpression */: - case 207 /* ParenthesizedExpression */: + case 198 /* PropertyAccessExpression */: + case 204 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 288 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 285 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 280 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 277 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -65547,7 +63835,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -65570,7 +63858,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -65608,58 +63896,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 195 /* BindingElement */: return getContextualTypeForInitializerExpression(node, contextFlags); - case 209 /* ArrowFunction */: - case 242 /* ReturnStatement */: + case 206 /* ArrowFunction */: + case 239 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent, contextFlags); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (parent.expression.kind === 99 /* ImportKeyword */) { return stringType; } /* falls through */ - case 204 /* NewExpression */: + case 201 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(parent.type); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 199 /* ArrayLiteralExpression */: { + case 196 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 228 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 218 /* TemplateExpression */); + case 225 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 215 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 207 /* ParenthesizedExpression */: { + case 204 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 280 /* JsxAttribute */: - case 282 /* JsxSpreadAttribute */: + case 277 /* JsxAttribute */: + case 279 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -65822,7 +64110,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 208 /* FunctionExpression */ || node.kind === 209 /* ArrowFunction */; + return node.kind === 205 /* FunctionExpression */ || node.kind === 206 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -65836,7 +64124,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -65850,8 +64138,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var current = types_18[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var current = types_17[_i]; var signature = getContextualCallSignature(current, node); if (signature) { if (!signatureList) { @@ -65884,8 +64172,8 @@ var ts; return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type; } function hasDefaultValue(node) { - return (node.kind === 198 /* BindingElement */ && !!node.initializer) || - (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 195 /* BindingElement */ && !!node.initializer) || + (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -65897,7 +64185,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - if (e.kind === 220 /* SpreadElement */) { + if (e.kind === 217 /* SpreadElement */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 2048 /* SpreadArrays */); } @@ -65960,7 +64248,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return isNumericComputedName(name); case 78 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -66010,7 +64298,7 @@ var ts; // This will allow types number, string, symbol or any. It will also allow enums, the unknown // type, and any union of these types (like string | number). if (links.resolvedType.flags & 98304 /* Nullable */ || - !isTypeAssignableToKind(links.resolvedType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && + !isTypeAssignableToKind(links.resolvedType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) { error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } @@ -66056,7 +64344,7 @@ var ts; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 196 /* ObjectBindingPattern */ || contextualType.pattern.kind === 200 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 193 /* ObjectBindingPattern */ || contextualType.pattern.kind === 197 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -66079,16 +64367,16 @@ var ts; for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var memberDecl = _c[_b]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 158 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 157 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 288 /* PropertyAssignment */ || - memberDecl.kind === 289 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 285 /* PropertyAssignment */ || + memberDecl.kind === 286 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 288 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + var type = memberDecl.kind === 285 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`. // we don't want to say "could not find 'a'". - memberDecl.kind === 289 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : + memberDecl.kind === 286 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -66111,8 +64399,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 288 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 289 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 285 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 286 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -66138,7 +64426,7 @@ var ts; member = prop; allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 290 /* SpreadAssignment */) { + else if (memberDecl.kind === 287 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -66167,7 +64455,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 167 /* GetAccessor */ || memberDecl.kind === 168 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 166 /* GetAccessor */ || memberDecl.kind === 167 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -66192,7 +64480,7 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 290 /* SpreadAssignment */) { + if (contextualTypeHasPattern && node.parent.kind !== 287 /* SpreadAssignment */) { for (var _d = 0, _e = getPropertiesOfType(contextualType); _d < _e.length; _d++) { var prop = _e[_d]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { @@ -66234,7 +64522,7 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); @@ -66246,6 +64534,7 @@ var ts; } function checkJsxSelfClosingElementDeferred(node) { checkJsxOpeningLikeElementOrOpeningFragment(node); + resolveUntypedCall(node); // ensure type arguments and parameters are typechecked, even if there is an arity error } function checkJsxSelfClosingElement(node, _checkMode) { checkNodeDeferred(node); @@ -66272,7 +64561,7 @@ var ts; // by default, jsx:'react' will use jsxFactory = React.createElement and jsxFragmentFactory = React.Fragment // if jsxFactory compiler option is provided, ensure jsxFragmentFactory compiler option or @jsxFrag pragma is provided too var nodeSourceFile = ts.getSourceFileOfNode(node); - if (ts.getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) + if (compilerOptions.jsx === 2 /* React */ && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) && !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) { error(node, compilerOptions.jsxFactory ? ts.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option @@ -66324,7 +64613,7 @@ var ts; if (ts.isJsxAttribute(attributeDecl)) { var exprType = checkJsxAttribute(attributeDecl, checkMode); objectFlags |= ts.getObjectFlags(exprType) & 3670016 /* PropagatingFlags */; - var attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName); + var attributeSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */ | member.flags, member.escapedName); attributeSymbol.declarations = member.declarations; attributeSymbol.parent = member.parent; if (member.valueDeclaration) { @@ -66339,7 +64628,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 282 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 279 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -66365,7 +64654,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 273 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 270 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -66379,7 +64668,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(openingLikeElement.attributes); var childrenContextualType = contextualType && getTypeOfPropertyOfContextualType(contextualType, jsxChildrenPropertyName); // If there are children in the body of JSX element, create dummy attribute "children" with the union of children types so that it will pass the attribute checking process - var childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName); + var childrenPropSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */, jsxChildrenPropertyName); childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && forEachType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes)); @@ -66422,9 +64711,6 @@ var ts; childrenTypes.push(stringType); } } - else if (child.kind === 283 /* JsxExpression */ && !child.expression) { - continue; // empty jsx expressions don't *really* count as present children - } else { childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); } @@ -66494,60 +64780,29 @@ var ts; } return links.resolvedSymbol; } - function getJsxNamespaceContainerForImplicitImport(location) { - var file = location && ts.getSourceFileOfNode(location); - var links = file && getNodeLinks(file); - if (links && links.jsxImplicitImportContainer === false) { - return undefined; - } - if (links && links.jsxImplicitImportContainer) { - return links.jsxImplicitImportContainer; - } - var runtimeImportSpecifier = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(compilerOptions, file), compilerOptions); - if (!runtimeImportSpecifier) { - return undefined; - } - var isClassic = ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Classic; - var errorMessage = isClassic - ? ts.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option - : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations; - var mod = resolveExternalModule(location, runtimeImportSpecifier, errorMessage, location); - var result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : undefined; - if (links) { - links.jsxImplicitImportContainer = result || false; - } - return result; - } function getJsxNamespaceAt(location) { var links = location && getNodeLinks(location); if (links && links.jsxNamespace) { return links.jsxNamespace; } if (!links || links.jsxNamespace !== false) { - var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); - if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { - var namespaceName = getJsxNamespace(location); - resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); - } + var namespaceName = getJsxNamespace(location); + var resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); if (resolvedNamespace) { var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */)); - if (candidate && candidate !== unknownSymbol) { + if (candidate) { if (links) { links.jsxNamespace = candidate; } return candidate; } - } - if (links) { - links.jsxNamespace = false; + if (links) { + links.jsxNamespace = false; + } } } // JSX global fallback - var s = resolveSymbol(getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined)); - if (s === unknownSymbol) { - return undefined; // TODO: GH#18217 - } - return s; // TODO: GH#18217 + return getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined); // TODO: GH#18217 } /** * Look into JSX namespace and then look for container with matching name as nameOfAttribPropContainer. @@ -66734,25 +64989,23 @@ var ts; checkGrammarJsxElement(node); } checkJsxPreconditions(node); - if (!getJsxNamespaceContainerForImplicitImport(node)) { - // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. - // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. - var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var jsxFactoryNamespace = getJsxNamespace(node); - var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; - // allow null as jsxFragmentFactory - var jsxFactorySym = void 0; - if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); - } - if (jsxFactorySym) { - // Mark local symbol as referenced here because it might not have been marked - // if jsx emit was not jsxFactory as there wont be error being emitted - jsxFactorySym.isReferenced = 67108863 /* All */; - // If react/jsxFactory symbol is alias, mark it as refereced - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { - markAliasSymbolAsReferenced(jsxFactorySym); - } + // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. + // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. + var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var jsxFactoryNamespace = getJsxNamespace(node); + var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + // allow null as jsxFragmentFactory + var jsxFactorySym; + if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); + } + if (jsxFactorySym) { + // Mark local symbol as referenced here because it might not have been marked + // if jsx emit was not jsxFactory as there wont be error being emitted + jsxFactorySym.isReferenced = 67108863 /* All */; + // If react/jsxFactory symbol is alias, mark it as refereced + if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); } } if (isNodeOpeningLikeElement) { @@ -66842,7 +65095,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 157 /* QualifiedName */ ? node.right : node.kind === 195 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 156 /* QualifiedName */ ? node.right : node.kind === 192 /* ImportType */ ? node : node.name; if (isSuper) { // TS 1.0 spec (April 2014): 4.8.2 // - In a constructor, instance member function, instance member accessor, or @@ -66996,7 +65249,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 207 /* ParenthesizedExpression */) { + while (node.parent.kind === 204 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -67054,10 +65307,10 @@ var ts; return false; } function isThisPropertyAccessInConstructor(node, prop) { - return (isConstructorDeclaredProperty(prop) || ts.isThisProperty(node) && isAutoTypedProperty(prop)) - && ts.getThisContainer(node, /*includeArrowFunctions*/ true) === getDeclaringConstructor(prop); + return ts.isThisProperty(node) && (isAutoTypedProperty(prop) || isConstructorDeclaredProperty(prop)) && ts.getThisContainer(node, /*includeArrowFunctions*/ true) === getDeclaringConstructor(prop); } function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right) { + var _a; var parentSymbol = getNodeLinks(left).resolvedSymbol; var assignmentKind = ts.getAssignmentTargetKind(node); var apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType); @@ -67119,10 +65372,10 @@ var ts; if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) { error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); } - propType = (compilerOptions.noUncheckedIndexedAccess && !ts.isAssignmentTarget(node)) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + propType = indexInfo.type; } else { - if (getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) { + if (((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.flags) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) { errorOrSuggestion(/* isError */ false, right, ts.Diagnostics._0_is_deprecated, right.escapedText); } checkPropertyNotUsedBeforeDeclaration(prop, node, right); @@ -67159,7 +65412,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 166 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 165 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -67191,8 +65444,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 252 /* ClassDeclaration */ && - node.parent.kind !== 173 /* TypeReference */ && + else if (valueDeclaration.kind === 249 /* ClassDeclaration */ && + node.parent.kind !== 172 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -67204,22 +65457,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return true; - case 288 /* PropertyAssignment */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 290 /* SpreadAssignment */: - case 158 /* ComputedPropertyName */: - case 228 /* TemplateSpan */: - case 283 /* JsxExpression */: - case 280 /* JsxAttribute */: - case 281 /* JsxAttributes */: - case 282 /* JsxSpreadAttribute */: - case 275 /* JsxOpeningElement */: - case 223 /* ExpressionWithTypeArguments */: - case 286 /* HeritageClause */: + case 285 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 287 /* SpreadAssignment */: + case 157 /* ComputedPropertyName */: + case 225 /* TemplateSpan */: + case 280 /* JsxExpression */: + case 277 /* JsxAttribute */: + case 278 /* JsxAttributes */: + case 279 /* JsxSpreadAttribute */: + case 272 /* JsxOpeningElement */: + case 220 /* ExpressionWithTypeArguments */: + case 283 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -67275,22 +65528,14 @@ var ts; relatedInfo = ts.createDiagnosticForNode(propNode, ts.Diagnostics.Did_you_forget_to_use_await); } else { - var missingProperty = ts.declarationNameToString(propNode); - var container = typeToString(containingType); - var libSuggestion = getSuggestedLibForNonExistentProperty(missingProperty, containingType); - if (libSuggestion !== undefined) { - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later, missingProperty, container, libSuggestion); + var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); + if (suggestion !== undefined) { + var suggestedName = ts.symbolName(suggestion); + errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, ts.declarationNameToString(propNode), typeToString(containingType), suggestedName); + relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName); } else { - var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); - if (suggestion !== undefined) { - var suggestedName = ts.symbolName(suggestion); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, missingProperty, container, suggestedName); - relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName); - } - else { - errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, missingProperty, container); - } + errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(propNode), typeToString(containingType)); } } } @@ -67304,34 +65549,6 @@ var ts; var prop = containingType.symbol && getPropertyOfType(getTypeOfSymbol(containingType.symbol), propName); return prop !== undefined && prop.valueDeclaration && ts.hasSyntacticModifier(prop.valueDeclaration, 32 /* Static */); } - function getSuggestedLibForNonExistentName(name) { - var missingName = diagnosticName(name); - var allFeatures = ts.getScriptTargetFeatures(); - var libTargets = ts.getOwnKeys(allFeatures); - for (var _i = 0, libTargets_1 = libTargets; _i < libTargets_1.length; _i++) { - var libTarget = libTargets_1[_i]; - var containingTypes = ts.getOwnKeys(allFeatures[libTarget]); - if (containingTypes !== undefined && ts.contains(containingTypes, missingName)) { - return libTarget; - } - } - } - function getSuggestedLibForNonExistentProperty(missingProperty, containingType) { - var container = getApparentType(containingType).symbol; - if (!container) { - return undefined; - } - var allFeatures = ts.getScriptTargetFeatures(); - var libTargets = ts.getOwnKeys(allFeatures); - for (var _i = 0, libTargets_2 = libTargets; _i < libTargets_2.length; _i++) { - var libTarget = libTargets_2[_i]; - var featuresOfLib = allFeatures[libTarget]; - var featuresOfContainingType = featuresOfLib[ts.symbolName(container)]; - if (featuresOfContainingType !== undefined && ts.contains(featuresOfContainingType, missingProperty)) { - return libTarget; - } - } - } function getSuggestedSymbolForNonexistentProperty(name, containingType) { return getSpellingSuggestionForName(ts.isString(name) ? name : ts.idText(name), getPropertiesOfType(containingType), 111551 /* Value */); } @@ -67452,16 +65669,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 105 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 195 /* ImportType */: + case 192 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 201 /* PropertyAccessExpression */ && node.expression.kind === 105 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 198 /* PropertyAccessExpression */ && node.expression.kind === 105 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -67484,7 +65701,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 250 /* VariableDeclarationList */) { + if (initializer.kind === 247 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -67513,7 +65730,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 238 /* ForInStatement */ && + if (node.kind === 235 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -67550,7 +65767,7 @@ var ts; var accessFlags = ts.isAssignmentTarget(node) ? 2 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 /* NoIndexSignatures */ : 0) : 0 /* None */; - var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, accessFlags | 16 /* ExpressionPosition */) || errorType; + var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType; return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node); } function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { @@ -67597,13 +65814,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 161 /* Decorator */) { + else if (node.kind !== 160 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -67667,7 +65884,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 220 /* SpreadElement */ || arg.kind === 227 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 217 /* SpreadElement */ || arg.kind === 224 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -67675,18 +65892,15 @@ var ts; function acceptsVoid(t) { return !!(t.flags & 16384 /* Void */); } - function acceptsVoidUndefinedUnknownOrAny(t) { - return !!(t.flags & (16384 /* Void */ | 32768 /* Undefined */ | 2 /* Unknown */ | 1 /* Any */)); - } function hasCorrectArity(node, args, signature, signatureHelpTrailingComma) { if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } var argCount; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 218 /* TemplateExpression */) { + if (node.template.kind === 215 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -67701,7 +65915,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 161 /* Decorator */) { + else if (node.kind === 160 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -67715,7 +65929,7 @@ var ts; } else if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 204 /* NewExpression */); + ts.Debug.assert(node.kind === 201 /* NewExpression */); return getMinArgumentCount(signature) === 0; } else { @@ -67739,7 +65953,7 @@ var ts; } for (var i = argCount; i < effectiveMinimumArguments; i++) { var type = getTypeAtPosition(signature, i); - if (filterType(type, ts.isInJSFile(node) && !strictNullChecks ? acceptsVoidUndefinedUnknownOrAny : acceptsVoid).flags & 131072 /* Never */) { + if (filterType(type, acceptsVoid).flags & 131072 /* Never */) { return false; } } @@ -67809,7 +66023,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 161 /* Decorator */) { + if (node.kind !== 160 /* Decorator */) { var contextualType = getContextualType(node, ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); }) ? 8 /* SkipBindingPatterns */ : 0 /* None */); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -67858,7 +66072,7 @@ var ts; } for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 222 /* OmittedExpression */) { + if (arg.kind !== 219 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -67882,7 +66096,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return getMutableArrayOrTupleType(arg.kind === 227 /* SyntheticExpression */ ? arg.type : + return getMutableArrayOrTupleType(arg.kind === 224 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode)); } } @@ -67892,24 +66106,24 @@ var ts; for (var i = index; i < argCount; i++) { var arg = args[i]; if (isSpreadArgument(arg)) { - var spreadType = arg.kind === 227 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); + var spreadType = arg.kind === 224 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); if (isArrayLikeType(spreadType)) { types.push(spreadType); flags.push(8 /* Variadic */); } else { - types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 220 /* SpreadElement */ ? arg.expression : arg)); + types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 217 /* SpreadElement */ ? arg.expression : arg)); flags.push(4 /* Rest */); } } else { var contextualType = getIndexedAccessType(restType, getLiteralType(i - index)); var argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode); - var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */); types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(1 /* Required */); } - if (arg.kind === 227 /* SyntheticExpression */ && arg.tupleNameSource) { + if (arg.kind === 224 /* SyntheticExpression */ && arg.tupleNameSource) { names.push(arg.tupleNameSource); } } @@ -68050,7 +66264,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 204 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 201 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -68080,7 +66294,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 222 /* OmittedExpression */) { + if (arg.kind !== 219 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -68121,7 +66335,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -68138,17 +66352,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 218 /* TemplateExpression */) { + if (template.kind === 215 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 161 /* Decorator */) { + if (node.kind === 160 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -68159,10 +66373,10 @@ var ts; if (spreadIndex >= 0) { // Create synthetic arguments from spreads of tuple types. var effectiveArgs_1 = args.slice(0, spreadIndex); - var _loop_20 = function (i) { + var _loop_19 = function (i) { var arg = args[i]; // We can call checkExpressionCached because spread expressions never have a contextual type. - var spreadType = arg.kind === 220 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); + var spreadType = arg.kind === 217 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); if (spreadType && isTupleType(spreadType)) { ts.forEach(getTypeArguments(spreadType), function (t, i) { var _a; @@ -68176,7 +66390,7 @@ var ts; } }; for (var i = spreadIndex; i < args.length; i++) { - _loop_20(i); + _loop_19(i); } return effectiveArgs_1; } @@ -68189,30 +66403,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 160 /* Parameter */: + case 159 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 166 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 165 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 163 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 162 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -68226,17 +66440,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return 1; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return 2; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 160 /* Parameter */: + case 159 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -68267,20 +66481,6 @@ var ts; return ts.createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); } } - function isPromiseResolveArityError(node) { - if (!ts.isCallExpression(node) || !ts.isIdentifier(node.expression)) - return false; - var symbol = resolveName(node.expression, node.expression.escapedText, 111551 /* Value */, undefined, undefined, false); - var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration; - if (!decl || !ts.isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !ts.isNewExpression(decl.parent.parent) || !ts.isIdentifier(decl.parent.parent.expression)) { - return false; - } - var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(/*reportErrors*/ false); - if (!globalPromiseSymbol) - return false; - var constructorSymbol = getSymbolAtLocation(decl.parent.parent.expression, /*ignoreErrors*/ true); - return constructorSymbol === globalPromiseSymbol; - } function getArgumentArityError(node, signatures, args) { var min = Number.POSITIVE_INFINITY; var max = Number.NEGATIVE_INFINITY; @@ -68312,15 +66512,9 @@ var ts; } var spanArray; var related; - var error = hasRestParameter || hasSpreadArgument ? - hasRestParameter && hasSpreadArgument ? - ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more : - hasRestParameter ? - ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 : - ts.Diagnostics.Expected_0_arguments_but_got_1_or_more : - paramRange === 1 && argCount === 0 && isPromiseResolveArityError(node) ? - ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : - ts.Diagnostics.Expected_0_arguments_but_got_1; + var error = hasRestParameter || hasSpreadArgument ? hasRestParameter && hasSpreadArgument ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more : + hasRestParameter ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 : + ts.Diagnostics.Expected_0_arguments_but_got_1_or_more : ts.Diagnostics.Expected_0_arguments_but_got_1; if (closestSignature && getMinArgumentCount(closestSignature) > argCount && closestSignature.declaration) { var paramDecl = closestSignature.declaration.parameters[closestSignature.thisParameter ? argCount + 1 : argCount]; if (paramDecl) { @@ -68383,8 +66577,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 205 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 161 /* Decorator */; + var isTaggedTemplate = node.kind === 202 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 160 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray && produceDiagnostics; var typeArguments; @@ -68446,7 +66640,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 203 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 200 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -68458,10 +66652,10 @@ var ts; // is just important for choosing the best signature. So in the case where there is only one // signature, the subtype pass is useless. So skipping it is an optimization. if (candidates.length > 1) { - result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma); } if (!result) { - result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + result = chooseOverload(candidates, assignableRelation, signatureHelpTrailingComma); } if (result) { return result; @@ -68486,7 +66680,6 @@ var ts; if (last_2.declaration && candidatesForArgumentError.length > 3) { ts.addRelatedInfo(d, ts.createDiagnosticForNode(last_2.declaration, ts.Diagnostics.The_last_overload_is_declared_here)); } - addImplementationSuccessElaboration(last_2, d); diagnostics.add(d); } } @@ -68500,7 +66693,7 @@ var ts; var min_3 = Number.MAX_VALUE; var minIndex = 0; var i_1 = 0; - var _loop_21 = function (c) { + var _loop_20 = function (c) { var chain_2 = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); }; var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* Normal */, /*reportErrors*/ true, chain_2); if (diags_2) { @@ -68518,24 +66711,19 @@ var ts; }; for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) { var c = candidatesForArgumentError_1[_a]; - _loop_21(c); + _loop_20(c); } var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics); ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures"); var chain = ts.chainDiagnosticMessages(ts.map(diags_3, function (d) { return typeof d.messageText === "string" ? d : d.messageText; }), ts.Diagnostics.No_overload_matches_this_call); - // The below is a spread to guarantee we get a new (mutable) array - our `flatMap` helper tries to do "smart" optimizations where it reuses input - // arrays and the emptyArray singleton where possible, which is decidedly not what we want while we're still constructing this diagnostic - var related = __spreadArrays(ts.flatMap(diags_3, function (d) { return d.relatedInformation; })); - var diag = void 0; + var related = ts.flatMap(diags_3, function (d) { return d.relatedInformation; }); if (ts.every(diags_3, function (d) { return d.start === diags_3[0].start && d.length === diags_3[0].length && d.file === diags_3[0].file; })) { var _b = diags_3[0], file = _b.file, start = _b.start, length_6 = _b.length; - diag = { file: file, start: start, length: length_6, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }; + diagnostics.add({ file: file, start: start, length: length_6, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }); } else { - diag = ts.createDiagnosticForNodeFromMessageChain(node, chain, related); + diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(node, chain, related)); } - addImplementationSuccessElaboration(candidatesForArgumentError[0], diag); - diagnostics.add(diag); } } else if (candidateForArgumentArityError) { @@ -68558,26 +66746,7 @@ var ts; } } return getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray); - function addImplementationSuccessElaboration(failed, diagnostic) { - var _a, _b; - var oldCandidatesForArgumentError = candidatesForArgumentError; - var oldCandidateForArgumentArityError = candidateForArgumentArityError; - var oldCandidateForTypeArgumentError = candidateForTypeArgumentError; - var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray; - var isOverload = failedSignatureDeclarations.length > 1; - var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined; - if (implDecl) { - var candidate = getSignatureFromDeclaration(implDecl); - var isSingleNonGenericCandidate_1 = !candidate.typeParameters; - if (chooseOverload([candidate], assignableRelation, isSingleNonGenericCandidate_1)) { - ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(implDecl, ts.Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible)); - } - } - candidatesForArgumentError = oldCandidatesForArgumentError; - candidateForArgumentArityError = oldCandidateForArgumentArityError; - candidateForTypeArgumentError = oldCandidateForTypeArgumentError; - } - function chooseOverload(candidates, relation, isSingleNonGenericCandidate, signatureHelpTrailingComma) { + function chooseOverload(candidates, relation, signatureHelpTrailingComma) { if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } candidatesForArgumentError = undefined; candidateForArgumentArityError = undefined; @@ -68676,7 +66845,7 @@ var ts; } var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max; var parameters = []; - var _loop_22 = function (i) { + var _loop_21 = function (i) { var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ? i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) : i < s.parameters.length ? s.parameters[i] : undefined; }); @@ -68684,7 +66853,7 @@ var ts; parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); }))); }; for (var i = 0; i < maxNonRestParam; i++) { - _loop_22(i); + _loop_21(i); } var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; }); var flags = 0 /* None */; @@ -68987,7 +67156,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedEffectiveModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 166 /* Constructor */) { + if (!modifiers || declaration.kind !== 165 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -69019,8 +67188,8 @@ var ts; if (apparentType.flags & 1048576 /* Union */) { var types = apparentType.types; var hasSignatures = false; - for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { - var constituent = types_19[_i]; + for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { + var constituent = types_18[_i]; var signatures = getSignaturesOfType(constituent, kind); if (signatures.length !== 0) { hasSignatures = true; @@ -69116,11 +67285,6 @@ var ts; return resolveUntypedCall(node); } if (!callSignatures.length) { - if (ts.isArrayLiteralExpression(node.parent)) { - var diagnostic = ts.createDiagnosticForNode(node.tag, ts.Diagnostics.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked); - diagnostics.add(diagnostic); - return resolveErrorCall(node); - } invocationError(node.tag, apparentType, 0 /* Call */); return resolveErrorCall(node); } @@ -69131,16 +67295,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 160 /* Parameter */: + case 159 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -69199,10 +67363,6 @@ var ts; var result = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); var fakeSignature = createSignatureForJSXIntrinsic(node, result); checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), /*mapper*/ undefined, 0 /* Normal */), result, node.tagName, node.attributes); - if (ts.length(node.typeArguments)) { - ts.forEach(node.typeArguments, checkSourceElement); - diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), node.typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, 0, ts.length(node.typeArguments))); - } return fakeSignature; } var exprTypes = checkExpression(node.tagName); @@ -69235,16 +67395,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 161 /* Decorator */: + case 160 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -69322,61 +67482,20 @@ var ts; } } function getAssignedClassSymbol(decl) { - var _a; - var assignmentSymbol = decl && getSymbolOfExpando(decl, /*allowDeclaration*/ true); - var prototype = (_a = assignmentSymbol === null || assignmentSymbol === void 0 ? void 0 : assignmentSymbol.exports) === null || _a === void 0 ? void 0 : _a.get("prototype"); - var init = (prototype === null || prototype === void 0 ? void 0 : prototype.valueDeclaration) && getAssignedJSPrototype(prototype.valueDeclaration); + var assignmentSymbol = decl && decl.parent && + (ts.isFunctionDeclaration(decl) && getSymbolOfNode(decl) || + ts.isBinaryExpression(decl.parent) && getSymbolOfNode(decl.parent.left) || + ts.isVariableDeclaration(decl.parent) && getSymbolOfNode(decl.parent)); + var prototype = assignmentSymbol && assignmentSymbol.exports && assignmentSymbol.exports.get("prototype"); + var init = prototype && prototype.valueDeclaration && getAssignedJSPrototype(prototype.valueDeclaration); return init ? getSymbolOfNode(init) : undefined; } - function getSymbolOfExpando(node, allowDeclaration) { - if (!node.parent) { - return undefined; - } - var name; - var decl; - if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) { - if (!ts.isInJSFile(node) && !(ts.isVarConst(node.parent) && ts.isFunctionLikeDeclaration(node))) { - return undefined; - } - name = node.parent.name; - decl = node.parent; - } - else if (ts.isBinaryExpression(node.parent)) { - var parentNode = node.parent; - var parentNodeOperator = node.parent.operatorToken.kind; - if (parentNodeOperator === 62 /* EqualsToken */ && (allowDeclaration || parentNode.right === node)) { - name = parentNode.left; - decl = name; - } - else if (parentNodeOperator === 56 /* BarBarToken */ || parentNodeOperator === 60 /* QuestionQuestionToken */) { - if (ts.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { - name = parentNode.parent.name; - decl = parentNode.parent; - } - else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 /* EqualsToken */ && (allowDeclaration || parentNode.parent.right === parentNode)) { - name = parentNode.parent.left; - decl = name; - } - if (!name || !ts.isBindableStaticNameExpression(name) || !ts.isSameEntityName(name, parentNode.left)) { - return undefined; - } - } - } - else if (allowDeclaration && ts.isFunctionDeclaration(node)) { - name = node.name; - decl = node; - } - if (!decl || !name || (!allowDeclaration && !ts.getExpandoInitializer(node, ts.isPrototypeAccess(name)))) { - return undefined; - } - return getSymbolOfNode(decl); - } function getAssignedJSPrototype(node) { if (!node.parent) { return false; } var parent = node.parent; - while (parent && parent.kind === 201 /* PropertyAccessExpression */) { + while (parent && parent.kind === 198 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -69403,12 +67522,12 @@ var ts; if (node.expression.kind === 105 /* SuperKeyword */) { return voidType; } - if (node.kind === 204 /* NewExpression */) { + if (node.kind === 201 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 166 /* Constructor */ && - declaration.kind !== 170 /* ConstructSignature */ && - declaration.kind !== 175 /* ConstructorType */ && + declaration.kind !== 165 /* Constructor */ && + declaration.kind !== 169 /* ConstructSignature */ && + declaration.kind !== 174 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -69428,7 +67547,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 203 /* CallExpression */ && node.parent.kind === 233 /* ExpressionStatement */ && + if (node.kind === 200 /* CallExpression */ && node.parent.kind === 230 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -69439,11 +67558,14 @@ var ts; } } if (ts.isInJSFile(node)) { - var jsSymbol = getSymbolOfExpando(node, /*allowDeclaration*/ false); - if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) { - var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined); - jsAssignmentType.objectFlags |= 16384 /* JSLiteral */; - return getIntersectionType([returnType, jsAssignmentType]); + var decl = ts.getDeclarationOfExpando(node); + if (decl) { + var jsSymbol = getSymbolOfNode(decl); + if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) { + var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined); + jsAssignmentType.objectFlags |= 16384 /* JSLiteral */; + return getIntersectionType([returnType, jsAssignmentType]); + } } } return returnType; @@ -69457,20 +67579,20 @@ var ts; function getDeprecatedSuggestionNode(node) { node = ts.skipParentheses(node); switch (node.kind) { - case 203 /* CallExpression */: - case 161 /* Decorator */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 160 /* Decorator */: + case 201 /* NewExpression */: return getDeprecatedSuggestionNode(node.expression); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return getDeprecatedSuggestionNode(node.tag); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return getDeprecatedSuggestionNode(node.tagName); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return node.argumentExpression; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.name; - case 173 /* TypeReference */: + case 172 /* TypeReference */: var typeReference = node; return ts.isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference; default: @@ -69529,7 +67651,6 @@ var ts; if (hasSyntheticDefault) { var memberTable = ts.createSymbolTable(); var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */); - newSymbol.parent = originalSymbol; newSymbol.nameType = getLiteralType("default"); newSymbol.target = resolveSymbol(symbol); memberTable.set("default" /* Default */, newSymbol); @@ -69562,9 +67683,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 251 /* FunctionDeclaration */ + ? 248 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 249 /* VariableDeclaration */ + ? 246 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -69594,19 +67715,18 @@ var ts; case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 218 /* TemplateExpression */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return true; - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -69662,7 +67782,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 166 /* Constructor */) { + else if (container.kind === 165 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -69672,8 +67792,8 @@ var ts; } } function checkImportMetaProperty(node) { - if (moduleKind !== ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) { - error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system); + if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) { + error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system); } var file = ts.getSourceFileOfNode(node); ts.Debug.assert(!!(file.flags & 2097152 /* PossiblyContainsImportMeta */), "Containing file is missing import meta node flag."); @@ -69709,7 +67829,7 @@ var ts; return restParameter.escapedName; } function isValidDeclarationForTupleLabel(d) { - return d.kind === 192 /* NamedTupleMember */ || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name)); + return d.kind === 191 /* NamedTupleMember */ || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name)); } function getNameableDeclarationAtPosition(signature, pos) { var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); @@ -69782,40 +67902,21 @@ var ts; } return length; } - function getMinArgumentCount(signature, flags) { - var strongArityForUntypedJS = flags & 1 /* StrongArityForUntypedJS */; - var voidIsNonOptional = flags & 2 /* VoidIsNonOptional */; - if (voidIsNonOptional || signature.resolvedMinArgumentCount === undefined) { - var minArgumentCount = void 0; - if (signatureHasRestParameter(signature)) { - var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - if (isTupleType(restType)) { - var firstOptionalIndex = ts.findIndex(restType.target.elementFlags, function (f) { return !(f & 1 /* Required */); }); - var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; - if (requiredCount > 0) { - minArgumentCount = signature.parameters.length - 1 + requiredCount; - } + function getMinArgumentCount(signature, strongArityForUntypedJS) { + if (signatureHasRestParameter(signature)) { + var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + if (isTupleType(restType)) { + var firstOptionalIndex = ts.findIndex(restType.target.elementFlags, function (f) { return !(f & 1 /* Required */); }); + var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; + if (requiredCount > 0) { + return signature.parameters.length - 1 + requiredCount; } } - if (minArgumentCount === undefined) { - if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { - return 0; - } - minArgumentCount = signature.minArgumentCount; - } - if (voidIsNonOptional) { - return minArgumentCount; - } - for (var i = minArgumentCount - 1; i >= 0; i--) { - var type = getTypeAtPosition(signature, i); - if (filterType(type, acceptsVoid).flags & 131072 /* Never */) { - break; - } - minArgumentCount = i; - } - signature.resolvedMinArgumentCount = minArgumentCount; } - return signature.resolvedMinArgumentCount; + if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { + return 0; + } + return signature.minArgumentCount; } function hasEffectiveRestParameter(signature) { if (signatureHasRestParameter(signature)) { @@ -69981,7 +68082,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 230 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 227 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -70166,7 +68267,7 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 211 /* TypeOfExpression */) { + if (node.expression.kind === 208 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. @@ -70229,11 +68330,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; - case 165 /* MethodDeclaration */: - return func.parent.kind === 200 /* ObjectLiteralExpression */; + case 164 /* MethodDeclaration */: + return func.parent.kind === 197 /* ObjectLiteralExpression */; default: return false; } @@ -70259,7 +68360,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 164 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 230 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 163 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 227 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -70292,7 +68393,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -70316,7 +68417,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 208 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 205 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -70362,7 +68463,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -70375,7 +68476,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 230 /* Block */) { + if (node.body.kind === 227 /* Block */) { checkSourceElement(node.body); } else { @@ -70465,7 +68566,7 @@ var ts; expr.expression.kind === 107 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && (ctor.kind === 166 /* Constructor */ || isJSConstructor(ctor)))) { + if (!(ctor && (ctor.kind === 165 /* Constructor */ || isJSConstructor(ctor)))) { return true; } if (symbol.valueDeclaration) { @@ -70490,7 +68591,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 263 /* NamespaceImport */; + return !!declaration && declaration.kind === 260 /* NamespaceImport */; } } } @@ -70571,7 +68672,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 166 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 165 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -70673,8 +68774,8 @@ var ts; } if (type.flags & 3145728 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { - var t = types_20[_i]; + for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { + var t = types_19[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -70691,7 +68792,7 @@ var ts; } return !!(kind & 296 /* NumberLike */) && isTypeAssignableTo(source, numberType) || !!(kind & 2112 /* BigIntLike */) && isTypeAssignableTo(source, bigintType) || - !!(kind & 402653316 /* StringLike */) && isTypeAssignableTo(source, stringType) || + !!(kind & 132 /* StringLike */) && isTypeAssignableTo(source, stringType) || !!(kind & 528 /* BooleanLike */) && isTypeAssignableTo(source, booleanType) || !!(kind & 16384 /* Void */) && isTypeAssignableTo(source, voidType) || !!(kind & 131072 /* Never */) && isTypeAssignableTo(source, neverType) || @@ -70740,8 +68841,8 @@ var ts; // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, // and the right operand to be of type Any, an object type, or a type parameter type. // The result is always of the Boolean primitive type. - if (!(allTypesAssignableToKind(leftType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) || - isTypeAssignableToKind(leftType, 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */ | 262144 /* TypeParameter */))) { + if (!(allTypesAssignableToKind(leftType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) || + isTypeAssignableToKind(leftType, 4194304 /* Index */ | 262144 /* TypeParameter */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { @@ -70764,7 +68865,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 288 /* PropertyAssignment */ || property.kind === 289 /* ShorthandPropertyAssignment */) { + if (property.kind === 285 /* PropertyAssignment */ || property.kind === 286 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -70775,11 +68876,11 @@ var ts; checkPropertyAccessibility(property, /*isSuper*/ false, objectLiteralType, prop); } } - var elementType = getIndexedAccessType(objectLiteralType, exprType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */); + var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 289 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 286 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 290 /* SpreadAssignment */) { + else if (property.kind === 287 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -70813,28 +68914,23 @@ var ts; // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType; - var inBoundsType = compilerOptions.noUncheckedIndexedAccess ? undefined : possiblyOutOfBoundsType; + var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType; for (var i = 0; i < elements.length; i++) { - var type = possiblyOutOfBoundsType; - if (node.elements[i].kind === 220 /* SpreadElement */) { - type = inBoundsType = inBoundsType !== null && inBoundsType !== void 0 ? inBoundsType : (checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType); - } - checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode); + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode); } return sourceType; } function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 222 /* OmittedExpression */) { - if (element.kind !== 220 /* SpreadElement */) { + if (element.kind !== 219 /* OmittedExpression */) { + if (element.kind !== 217 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused // when the element is a SyntaxKind.ElementAccessExpression. - var accessFlags = 16 /* ExpressionPosition */ | (hasDefaultValue(element) ? 8 /* NoTupleBoundsCheck */ : 0); - var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, createSyntheticExpression(element, indexType), accessFlags) || errorType; + var accessFlags = hasDefaultValue(element) ? 8 /* NoTupleBoundsCheck */ : 0; + var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, createSyntheticExpression(element, indexType), accessFlags) || errorType; var assignedType = hasDefaultValue(element) ? getTypeWithFacts(elementType_2, 524288 /* NEUndefined */) : elementType_2; var type = getFlowTypeOfDestructuring(element, assignedType); return checkDestructuringAssignment(element, type, checkMode); @@ -70846,7 +68942,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 216 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 213 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -70862,7 +68958,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 289 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 286 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -70878,24 +68974,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 213 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 200 /* ObjectLiteralExpression */) { + if (target.kind === 197 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 199 /* ArrayLiteralExpression */) { + if (target.kind === 196 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 290 /* SpreadAssignment */ ? + var error = target.parent.kind === 287 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 290 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 287 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -70920,36 +69016,36 @@ var ts; case 78 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 205 /* TaggedTemplateExpression */: - case 218 /* TemplateExpression */: + case 202 /* TaggedTemplateExpression */: + case 215 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: case 103 /* NullKeyword */: - case 150 /* UndefinedKeyword */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: - case 209 /* ArrowFunction */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 211 /* TypeOfExpression */: - case 225 /* NonNullExpression */: - case 274 /* JsxSelfClosingElement */: - case 273 /* JsxElement */: + case 149 /* UndefinedKeyword */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 208 /* TypeOfExpression */: + case 222 /* NonNullExpression */: + case 271 /* JsxSelfClosingElement */: + case 270 /* JsxElement */: return true; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -70961,9 +69057,9 @@ var ts; } return false; // Some forms listed here for clarity - case 212 /* VoidExpression */: // Explicit opt-out - case 206 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 224 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 209 /* VoidExpression */: // Explicit opt-out + case 203 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 221 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -70995,7 +69091,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 200 /* ObjectLiteralExpression */ || node.left.kind === 199 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 197 /* ObjectLiteralExpression */ || node.left.kind === 196 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 107 /* ThisKeyword */)); break; } @@ -71062,7 +69158,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 200 /* ObjectLiteralExpression */ || left.kind === 199 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 197 /* ObjectLiteralExpression */ || left.kind === 196 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 107 /* ThisKeyword */); } var leftType; @@ -71155,7 +69251,7 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeAssignableToKind(leftType, 402653316 /* StringLike */) && !isTypeAssignableToKind(rightType, 402653316 /* StringLike */)) { + if (!isTypeAssignableToKind(leftType, 132 /* StringLike */) && !isTypeAssignableToKind(rightType, 132 /* StringLike */)) { leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); } @@ -71169,7 +69265,7 @@ var ts; // If both operands are of the BigInt primitive type, the result is of the BigInt primitive type. resultType = bigintType; } - else if (isTypeAssignableToKind(leftType, 402653316 /* StringLike */, /*strict*/ true) || isTypeAssignableToKind(rightType, 402653316 /* StringLike */, /*strict*/ true)) { + else if (isTypeAssignableToKind(leftType, 132 /* StringLike */, /*strict*/ true) || isTypeAssignableToKind(rightType, 132 /* StringLike */, /*strict*/ true)) { // If one or both operands are of the String primitive type, the result is of the String primitive type. resultType = stringType; } @@ -71187,7 +69283,7 @@ var ts; // If both types have an awaited type of one of these, we'll assume the user // might be missing an await without doing an exhaustive check that inserting // await(s) will actually be a completely valid binary expression. - var closeEnoughKind_1 = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 3 /* AnyOrUnknown */; + var closeEnoughKind_1 = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 3 /* AnyOrUnknown */; reportOperatorError(function (left, right) { return isTypeAssignableToKind(left, closeEnoughKind_1) && isTypeAssignableToKind(right, closeEnoughKind_1); @@ -71488,21 +69584,20 @@ var ts; return getUnionType([type1, type2], 2 /* Subtype */); } function checkTemplateExpression(node) { - var texts = [node.head.text]; - var types = []; - for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) { - var span = _a[_i]; - var type = checkExpression(span.expression); - if (maybeTypeOfKind(type, 12288 /* ESSymbolLike */)) { - error(span.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); + // We just want to check each expressions, but we are unconcerned with + // the type of each expression, as any value may be coerced into a string. + // It is worth asking whether this is what we really want though. + // A place where we actually *are* concerned with the expressions' types are + // in tagged templates. + ts.forEach(node.templateSpans, function (templateSpan) { + if (maybeTypeOfKind(checkExpression(templateSpan.expression), 12288 /* ESSymbolLike */)) { + error(templateSpan.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); } - texts.push(span.literal.text); - types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType); - } - return isConstContext(node) ? getTemplateLiteralType(texts, types) : stringType; + }); + return stringType; } function getContextNode(node) { - if (node.kind === 281 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 278 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -71551,13 +69646,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 206 /* TypeAssertionExpression */ || node.kind === 224 /* AsExpression */; + return node.kind === 203 /* TypeAssertionExpression */ || node.kind === 221 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 197 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 194 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -71567,7 +69662,7 @@ var ts; var elementFlags = type.target.elementFlags.slice(); for (var i = getTypeReferenceArity(type); i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 198 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 195 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); elementFlags.push(2 /* Optional */); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { @@ -71610,7 +69705,7 @@ var ts; } // If the contextual type is a literal of a particular primitive type, we consider this a // literal context for all literals of that primitive type. - return !!(contextualType.flags & (128 /* StringLiteral */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || + return !!(contextualType.flags & (128 /* StringLiteral */ | 4194304 /* Index */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || contextualType.flags & 256 /* NumberLiteral */ && maybeTypeOfKind(candidateType, 256 /* NumberLiteral */) || contextualType.flags & 2048 /* BigIntLiteral */ && maybeTypeOfKind(candidateType, 2048 /* BigIntLiteral */) || contextualType.flags & 512 /* BooleanLiteral */ && maybeTypeOfKind(candidateType, 512 /* BooleanLiteral */) || @@ -71622,7 +69717,7 @@ var ts; var parent = node.parent; return ts.isAssertionExpression(parent) && ts.isConstTypeReference(parent.type) || (ts.isParenthesizedExpression(parent) || ts.isArrayLiteralExpression(parent) || ts.isSpreadElement(parent)) && isConstContext(parent) || - (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent) || ts.isTemplateSpan(parent)) && isConstContext(parent.parent); + (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent)) && isConstContext(parent.parent); } function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) { var type = checkExpression(node, checkMode, forceTuple); @@ -71634,7 +69729,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -71645,7 +69740,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -71863,7 +69958,6 @@ var ts; } } function checkExpression(node, checkMode, forceTuple) { - ts.tracing.push("check" /* Check */, "checkExpression", { kind: node.kind, pos: node.pos, end: node.end }); var saveCurrentNode = currentNode; currentNode = node; instantiationCount = 0; @@ -71873,7 +69967,6 @@ var ts; checkConstEnumAccess(node, type); } currentNode = saveCurrentNode; - ts.tracing.pop(); return type; } function checkConstEnumAccess(node, type) { @@ -71881,11 +69974,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 202 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 176 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 270 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 199 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 78 /* Identifier */ || node.kind === 156 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 175 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 267 /* ExportSpecifier */); // We allow reexporting const enums if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -71910,9 +70003,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -71938,78 +70031,78 @@ var ts; return trueType; case 94 /* FalseKeyword */: return falseType; - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return checkQualifiedName(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (node.expression.kind === 99 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 204 /* NewExpression */: + case 201 /* NewExpression */: return checkCallExpression(node, checkMode); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return checkClassExpression(node); - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return checkAssertion(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return checkNonNullAssertion(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return checkMetaProperty(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return checkDeleteExpression(node); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return checkVoidExpression(node); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return checkAwaitExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 222 /* OmittedExpression */: + case 219 /* OmittedExpression */: return undefinedWideningType; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return checkYieldExpression(node); - case 227 /* SyntheticExpression */: + case 224 /* SyntheticExpression */: return checkSyntheticExpression(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return checkJsxElement(node, checkMode); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return checkJsxFragment(node); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -72046,10 +70139,10 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 166 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 165 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 166 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 165 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -72060,13 +70153,13 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 166 /* Constructor */ || func.kind === 170 /* ConstructSignature */ || func.kind === 175 /* ConstructorType */) { + if (func.kind === 165 /* Constructor */ || func.kind === 169 /* ConstructSignature */ || func.kind === 174 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 209 /* ArrowFunction */) { + if (func.kind === 206 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 167 /* GetAccessor */ || func.kind === 168 /* SetAccessor */) { + if (func.kind === 166 /* GetAccessor */ || func.kind === 167 /* SetAccessor */) { error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -72124,13 +70217,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 209 /* ArrowFunction */: - case 169 /* CallSignature */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 174 /* FunctionType */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 206 /* ArrowFunction */: + case 168 /* CallSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 173 /* FunctionType */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -72148,7 +70241,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 197 /* ArrayBindingPattern */ || name.kind === 196 /* ObjectBindingPattern */) { + else if (name.kind === 194 /* ArrayBindingPattern */ || name.kind === 193 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -72157,13 +70250,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 171 /* IndexSignature */) { + if (node.kind === 170 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 174 /* FunctionType */ || node.kind === 251 /* FunctionDeclaration */ || node.kind === 175 /* ConstructorType */ || - node.kind === 169 /* CallSignature */ || node.kind === 166 /* Constructor */ || - node.kind === 170 /* ConstructSignature */) { + else if (node.kind === 173 /* FunctionType */ || node.kind === 248 /* FunctionDeclaration */ || node.kind === 174 /* ConstructorType */ || + node.kind === 168 /* CallSignature */ || node.kind === 165 /* Constructor */ || + node.kind === 169 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -72193,10 +70286,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -72226,7 +70319,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 171 /* IndexSignature */ && node.kind !== 308 /* JSDocFunctionType */) { + if (node.kind !== 170 /* IndexSignature */ && node.kind !== 304 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -72238,7 +70331,7 @@ var ts; var privateIdentifiers = new ts.Map(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 166 /* Constructor */) { + if (member.kind === 165 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -72258,16 +70351,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -72330,7 +70423,7 @@ var ts; var names = new ts.Map(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 162 /* PropertySignature */) { + if (member.kind === 161 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -72355,7 +70448,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 253 /* InterfaceDeclaration */) { + if (node.kind === 250 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -72375,7 +70468,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -72383,7 +70476,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -72425,7 +70518,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 165 /* MethodDeclaration */ && node.body) { + if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 164 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -72453,7 +70546,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 163 /* PropertyDeclaration */ && + return n.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(n, 32 /* Static */) && !!n.initializer; } @@ -72484,7 +70577,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_4 = statements; _i < statements_4.length; _i++) { var statement = statements_4[_i]; - if (statement.kind === 233 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 230 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -72509,7 +70602,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -72519,7 +70612,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -72528,7 +70621,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + var otherKind = node.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getEffectiveModifierFlags(node); @@ -72546,7 +70639,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -72594,7 +70687,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 173 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 172 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -72643,27 +70736,28 @@ var ts; function checkTupleType(node) { var elementTypes = node.elements; var seenOptionalElement = false; - var seenRestElement = false; - var hasNamedElement = ts.some(elementTypes, ts.isNamedTupleMember); + var seenNamedElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind !== 192 /* NamedTupleMember */ && hasNamedElement) { + if (e.kind === 191 /* NamedTupleMember */) { + seenNamedElement = true; + } + else if (seenNamedElement) { grammarErrorOnNode(e, ts.Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names); break; } var flags = getTupleElementFlags(e); if (flags & 8 /* Variadic */) { - var type = getTypeFromTypeNode(e.type); - if (!isArrayLikeType(type)) { + if (!isArrayLikeType(getTypeFromTypeNode(e.type))) { error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); break; } - if (isArrayType(type) || isTupleType(type) && type.target.combinedFlags & 4 /* Rest */) { - seenRestElement = true; - } } else if (flags & 4 /* Rest */) { - seenRestElement = true; + if (i !== elementTypes.length - 1) { + grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); + break; + } } else if (flags & 2 /* Optional */) { seenOptionalElement = true; @@ -72672,17 +70766,11 @@ var ts; grammarErrorOnNode(e, ts.Diagnostics.A_required_element_cannot_follow_an_optional_element); break; } - if (seenRestElement && i !== elementTypes.length - 1) { - grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); - break; - } } ts.forEach(node.elements, checkSourceElement); - getTypeFromTypeNode(node); } function checkUnionOrIntersectionType(node) { ts.forEach(node.types, checkSourceElement); - getTypeFromTypeNode(node); } function checkIndexedAccessIndexType(type, accessNode) { if (!(type.flags & 8388608 /* IndexedAccess */)) { @@ -72692,7 +70780,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 202 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 199 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -72724,20 +70812,13 @@ var ts; } function checkMappedType(node) { checkSourceElement(node.typeParameter); - checkSourceElement(node.nameType); checkSourceElement(node.type); if (!node.type) { reportImplicitAny(node, anyType); } var type = getTypeFromMappedTypeNode(node); - var nameType = getNameTypeFromMappedType(type); - if (nameType) { - checkTypeAssignableTo(nameType, keyofConstraintType, node.nameType); - } - else { - var constraintType = getConstraintTypeFromMappedType(type); - checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter)); - } + var constraintType = getConstraintTypeFromMappedType(type); + checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter)); } function checkThisType(node) { getTypeFromThisTypeNode(node); @@ -72750,21 +70831,12 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 184 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 183 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); registerForUnusedIdentifiersCheck(node); } - function checkTemplateLiteralType(node) { - for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) { - var span = _a[_i]; - checkSourceElement(span.type); - var type = getTypeFromTypeNode(span.type); - checkTypeAssignableTo(type, templateConstraintType, span.type); - } - getTypeFromTypeNode(node); - } function checkImportType(node) { checkSourceElement(node.argument); getTypeFromTypeNode(node); @@ -72773,10 +70845,10 @@ var ts; if (node.dotDotDotToken && node.questionToken) { grammarErrorOnNode(node, ts.Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest); } - if (node.type.kind === 180 /* OptionalType */) { + if (node.type.kind === 179 /* OptionalType */) { grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type); } - if (node.type.kind === 181 /* RestType */) { + if (node.type.kind === 180 /* RestType */) { grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type); } checkSourceElement(node.type); @@ -72789,9 +70861,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 253 /* InterfaceDeclaration */ && - n.parent.kind !== 252 /* ClassDeclaration */ && - n.parent.kind !== 221 /* ClassExpression */ && + if (n.parent.kind !== 250 /* InterfaceDeclaration */ && + n.parent.kind !== 249 /* ClassDeclaration */ && + n.parent.kind !== 218 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -72887,7 +70959,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */) && + var reportError = (node.kind === 164 /* MethodDeclaration */ || node.kind === 163 /* MethodSignature */) && ts.hasSyntacticModifier(node, 32 /* Static */) !== ts.hasSyntacticModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -72928,7 +71000,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent && (node.parent.kind === 253 /* InterfaceDeclaration */ || node.parent.kind === 177 /* TypeLiteral */) || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 250 /* InterfaceDeclaration */ || node.parent.kind === 176 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -72939,10 +71011,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 251 /* FunctionDeclaration */ || node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */ || node.kind === 166 /* Constructor */) { + if (node.kind === 248 /* FunctionDeclaration */ || node.kind === 164 /* MethodDeclaration */ || node.kind === 163 /* MethodSignature */ || node.kind === 165 /* Constructor */) { functionDeclarations.push(node); var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; @@ -73075,25 +71147,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return 2 /* ExportType */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -73101,17 +71173,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 262 /* ImportClause */: - var result_12 = 0 /* None */; + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 259 /* ImportClause */: + var result_11 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result_12 |= getDeclarationSpaces(d); }); - return result_12; - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: - case 251 /* FunctionDeclaration */: - case 265 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + ts.forEach(target.declarations, function (d) { result_11 |= getDeclarationSpaces(d); }); + return result_11; + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 248 /* FunctionDeclaration */: + case 262 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 78 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -73404,24 +71476,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 160 /* Parameter */: + case 159 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -73468,30 +71540,30 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 183 /* IntersectionType */: - case 182 /* UnionType */: + case 182 /* IntersectionType */: + case 181 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: return getEntityNameForDecoratorMetadata(node.type); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; } } } function getEntityNameForDecoratorMetadataFromTypeList(types) { var commonEntityName; - for (var _i = 0, types_21 = types; _i < types_21.length; _i++) { - var typeNode = types_21[_i]; - while (typeNode.kind === 186 /* ParenthesizedType */ || typeNode.kind === 192 /* NamedTupleMember */) { + for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { + var typeNode = types_20[_i]; + while (typeNode.kind === 185 /* ParenthesizedType */ || typeNode.kind === 191 /* NamedTupleMember */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 141 /* NeverKeyword */) { + if (typeNode.kind === 140 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 190 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 149 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -73537,14 +71609,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 160 /* Parameter */) { + if (node.kind === 159 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -73553,23 +71625,23 @@ var ts; } } break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + var otherKind = node.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 160 /* Parameter */: + case 159 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -73632,7 +71704,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 157 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 156 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -73676,7 +71748,7 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -73689,7 +71761,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 157 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -73711,11 +71783,14 @@ var ts; checkFunctionOrConstructorSymbol(localSymbol); } if (symbol.parent) { - // run check on export symbol to check that modifiers agree across all exported declarations - checkFunctionOrConstructorSymbol(symbol); + // run check once for the first declaration + if (ts.getDeclarationOfKind(symbol, node.kind) === node) { + // run check on export symbol to check that modifiers agree across all exported declarations + checkFunctionOrConstructorSymbol(symbol); + } } } - var body = node.kind === 164 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 163 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -73757,42 +71832,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 297 /* SourceFile */: - case 256 /* ModuleDeclaration */: - case 230 /* Block */: - case 258 /* CaseBlock */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 294 /* SourceFile */: + case 253 /* ModuleDeclaration */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 166 /* Constructor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 165 /* Constructor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 185 /* InferType */: + case 184 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -73812,11 +71887,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 165 /* MethodDeclaration */: - case 163 /* PropertyDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - if (member.kind === 168 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 164 /* MethodDeclaration */: + case 162 /* PropertyDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + if (member.kind === 167 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -73827,7 +71902,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 166 /* Constructor */: + case 165 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasSyntacticModifier(parameter, 8 /* Private */)) { @@ -73835,8 +71910,8 @@ var ts; } } break; - case 171 /* IndexSignature */: - case 229 /* SemicolonClassElement */: + case 170 /* IndexSignature */: + case 226 /* SemicolonClassElement */: // Can't be private break; default: @@ -73863,7 +71938,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 185 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 184 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (ts.tryAddToSet(seenParentsWithEveryUnused, parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -73955,7 +72030,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 263 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 260 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -73973,7 +72048,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 249 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 250 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 246 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 247 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -73994,7 +72069,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 232 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 229 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -74008,22 +72083,22 @@ var ts; switch (name.kind) { case 78 /* Identifier */: return ts.idText(name); - case 197 /* ArrayBindingPattern */: - case 196 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 262 /* ImportClause */ || node.kind === 265 /* ImportSpecifier */ || node.kind === 263 /* NamespaceImport */; + return node.kind === 259 /* ImportClause */ || node.kind === 262 /* ImportSpecifier */ || node.kind === 260 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 262 /* ImportClause */ ? decl : decl.kind === 263 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 259 /* ImportClause */ ? decl : decl.kind === 260 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 230 /* Block */) { + if (node.kind === 227 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -74053,12 +72128,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 163 /* PropertyDeclaration */ || - node.kind === 162 /* PropertySignature */ || - node.kind === 165 /* MethodDeclaration */ || - node.kind === 164 /* MethodSignature */ || - node.kind === 167 /* GetAccessor */ || - node.kind === 168 /* SetAccessor */) { + if (node.kind === 162 /* PropertyDeclaration */ || + node.kind === 161 /* PropertySignature */ || + node.kind === 164 /* MethodDeclaration */ || + node.kind === 163 /* MethodSignature */ || + node.kind === 166 /* GetAccessor */ || + node.kind === 167 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -74067,7 +72142,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 160 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 159 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -74124,7 +72199,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -74139,7 +72214,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -74174,7 +72249,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 249 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 246 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -74186,17 +72261,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 250 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 232 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 247 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 229 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 230 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 257 /* ModuleBlock */ || - container.kind === 256 /* ModuleDeclaration */ || - container.kind === 297 /* SourceFile */); + (container.kind === 227 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 254 /* ModuleBlock */ || + container.kind === 253 /* ModuleDeclaration */ || + container.kind === 294 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -74227,18 +72302,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 198 /* BindingElement */) { - if (node.parent.kind === 196 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 195 /* BindingElement */) { + if (node.parent.kind === 193 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 158 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -74259,19 +72334,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 197 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 194 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.isParameterDeclaration(node) && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 159 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 238 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 235 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -74297,12 +72372,7 @@ var ts; } return; } - // For a commonjs `const x = require`, validate the alias and exit var symbol = getSymbolOfNode(node); - if (symbol.flags & 2097152 /* Alias */ && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true)) { - checkAliasSymbol(node); - return; - } var type = convertAutoToAny(getTypeOfSymbol(symbol)); if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer @@ -74313,7 +72383,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && !!((_a = symbol.exports) === null || _a === void 0 ? void 0 : _a.size); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 238 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 235 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -74339,10 +72409,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */) { + if (node.kind !== 162 /* PropertyDeclaration */ && node.kind !== 161 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -74354,7 +72424,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 163 /* PropertyDeclaration */ || nextDeclaration.kind === 162 /* PropertySignature */ + var message = nextDeclaration.kind === 162 /* PropertyDeclaration */ || nextDeclaration.kind === 161 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -74364,8 +72434,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 160 /* Parameter */ && right.kind === 249 /* VariableDeclaration */) || - (left.kind === 249 /* VariableDeclaration */ && right.kind === 160 /* Parameter */)) { + if ((left.kind === 159 /* Parameter */ && right.kind === 246 /* VariableDeclaration */) || + (left.kind === 246 /* VariableDeclaration */ && right.kind === 159 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -74381,10 +72451,8 @@ var ts; return ts.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts.getSelectedEffectiveModifierFlags(right, interestingFlags); } function checkVariableDeclaration(node) { - ts.tracing.push("check" /* Check */, "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end }); checkGrammarVariableDeclaration(node); - checkVariableLikeDeclaration(node); - ts.tracing.pop(); + return checkVariableLikeDeclaration(node); } function checkBindingElement(node) { checkGrammarBindingElement(node); @@ -74407,7 +72475,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 231 /* EmptyStatement */) { + if (node.thenStatement.kind === 228 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -74500,12 +72568,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 247 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -74539,14 +72607,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node); // There may be a destructuring assignment on the left side - if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) { + if (varExpr.kind === 196 /* ArrayLiteralExpression */ || varExpr.kind === 197 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -74578,7 +72646,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -74592,7 +72660,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) { + if (varExpr.kind === 196 /* ArrayLiteralExpression */ || varExpr.kind === 197 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -74644,7 +72712,6 @@ var ts; } var uplevelIteration = languageVersion >= 2 /* ES2015 */; var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; - var possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & 128 /* PossiblyOutOfBounds */); // Get the iterated type of an `Iterable` or `IterableIterator` only in ES2015 // or higher, when inside of an async generator or for-await-if, or when // downlevelIteration is requested. @@ -74664,7 +72731,7 @@ var ts; } } if (iterationTypes || uplevelIteration) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType) : (iterationTypes && iterationTypes.yieldType); + return iterationTypes && iterationTypes.yieldType; } } var arrayType = inputType; @@ -74678,12 +72745,12 @@ var ts; // After we remove all types that are StringLike, we will know if there was a string constituent // based on whether the result of filter is a new array. var arrayTypes = inputType.types; - var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 402653316 /* StringLike */); }); + var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 132 /* StringLike */); }); if (filteredTypes !== arrayTypes) { arrayType = getUnionType(filteredTypes, 2 /* Subtype */); } } - else if (arrayType.flags & 402653316 /* StringLike */) { + else if (arrayType.flags & 132 /* StringLike */) { arrayType = neverType; } hasStringConstituent = arrayType !== inputType; @@ -74697,7 +72764,7 @@ var ts; // Now that we've removed all the StringLike types, if no constituents remain, then the entire // arrayOrStringType was a string. if (arrayType.flags & 131072 /* Never */) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType; + return stringType; } } } @@ -74722,17 +72789,17 @@ var ts; : [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true], defaultDiagnostic = _a[0], maybeMissingAwait = _a[1]; errorAndMaybeSuggestAwait(errorNode, maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType), defaultDiagnostic, typeToString(arrayType)); } - return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType : undefined; + return hasStringConstituent ? stringType : undefined; } var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */); if (hasStringConstituent && arrayElementType) { // This is just an optimization for the case where arrayOrStringType is string | string[] - if (arrayElementType.flags & 402653316 /* StringLike */ && !compilerOptions.noUncheckedIndexedAccess) { + if (arrayElementType.flags & 132 /* StringLike */) { return stringType; } - return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2 /* Subtype */); + return getUnionType([arrayElementType, stringType], 2 /* Subtype */); } - return (use & 128 /* PossiblyOutOfBounds */) ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType; + return arrayElementType; } /** * Gets the requested "iteration type" from an `Iterable`-like or `AsyncIterable`-like type. @@ -74848,9 +72915,8 @@ var ts; if (iterationTypes_2 === noIterationTypes) { if (errorNode) { reportTypeNotIterableError(errorNode, type, !!(use & 2 /* AllowsAsyncIterablesFlag */)); + errorNode = undefined; } - setCachedIterationTypes(type, cacheKey, noIterationTypes); - return undefined; } else { allIterationTypes = ts.append(allIterationTypes, iterationTypes_2); @@ -75128,7 +73194,6 @@ var ts; * record is returned. Otherwise, we return `undefined`. */ function getIterationTypesOfMethod(type, resolver, methodName, errorNode) { - var _a, _b, _c, _d; var method = getPropertyOfType(type, methodName); // Ignore 'return' or 'throw' if they are missing. if (!method && methodName !== "next") { @@ -75152,24 +73217,6 @@ var ts; } return methodName === "next" ? anyIterationTypes : undefined; } - // If the method signature comes exclusively from the global iterator or generator type, - // create iteration types from its type arguments like `getIterationTypesOfIteratorFast` - // does (so as to remove `undefined` from the next and return types). We arrive here when - // a contextual type for a generator was not a direct reference to one of those global types, - // but looking up `methodType` referred to one of them (and nothing else). E.g., in - // `interface SpecialIterator extends Iterator {}`, `SpecialIterator` is not a - // reference to `Iterator`, but its `next` member derives exclusively from `Iterator`. - if ((methodType === null || methodType === void 0 ? void 0 : methodType.symbol) && methodSignatures.length === 1) { - var globalGeneratorType = resolver.getGlobalGeneratorType(/*reportErrors*/ false); - var globalIteratorType = resolver.getGlobalIteratorType(/*reportErrors*/ false); - var isGeneratorMethod = ((_b = (_a = globalGeneratorType.symbol) === null || _a === void 0 ? void 0 : _a.members) === null || _b === void 0 ? void 0 : _b.get(methodName)) === methodType.symbol; - var isIteratorMethod = !isGeneratorMethod && ((_d = (_c = globalIteratorType.symbol) === null || _c === void 0 ? void 0 : _c.members) === null || _d === void 0 ? void 0 : _d.get(methodName)) === methodType.symbol; - if (isGeneratorMethod || isIteratorMethod) { - var globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType; - var mapper = methodType.mapper; - return createIterationTypes(getMappedType(globalType.typeParameters[0], mapper), getMappedType(globalType.typeParameters[1], mapper), methodName === "next" ? getMappedType(globalType.typeParameters[2], mapper) : undefined); - } - } // Extract the first parameter and return type of each signature. var methodParameterTypes; var methodReturnTypes; @@ -75287,12 +73334,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 168 /* SetAccessor */) { + if (func.kind === 167 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 166 /* Constructor */) { + else if (func.kind === 165 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -75310,7 +73357,7 @@ var ts; } } } - else if (func.kind !== 166 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 165 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -75339,7 +73386,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 285 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 282 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -75348,7 +73395,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 284 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 281 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -75380,7 +73427,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 245 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 242 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -75409,15 +73456,11 @@ var ts; if (catchClause) { // Grammar checking if (catchClause.variableDeclaration) { - var declaration = catchClause.variableDeclaration; - if (declaration.type) { - var type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ false); - if (type && !(type.flags & 3 /* AnyOrUnknown */)) { - grammarErrorOnFirstToken(declaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); - } + if (catchClause.variableDeclaration.type && getTypeOfNode(catchClause.variableDeclaration) === errorType) { + grammarErrorOnFirstToken(catchClause.variableDeclaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); } - else if (declaration.initializer) { - grammarErrorOnFirstToken(declaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); + else if (catchClause.variableDeclaration.initializer) { + grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); } else { var blockLocals_1 = catchClause.block.locals; @@ -75494,8 +73537,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 216 /* BinaryExpression */ || - name.kind === 158 /* ComputedPropertyName */ || + (propDeclaration.kind === 213 /* BinaryExpression */ || + name.kind === 157 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -75572,7 +73615,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 173 /* TypeReference */) { + if (node.kind === 172 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -75683,7 +73726,6 @@ var ts; var typeWithThis = getTypeWithThisArgument(type); var staticType = getTypeOfSymbol(symbol); checkTypeParameterListsIdentical(symbol); - checkFunctionOrConstructorSymbol(symbol); checkClassForDuplicateDeclarations(node); // Only check for reserved static identifiers on non-ambient context. if (!(node.flags & 8388608 /* Ambient */)) { @@ -75774,7 +73816,7 @@ var ts; function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible var issuedMemberError = false; - var _loop_23 = function (member) { + var _loop_22 = function (member) { if (ts.hasStaticModifier(member)) { return "continue"; } @@ -75793,7 +73835,7 @@ var ts; }; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - _loop_23(member); + _loop_22(member); } if (!issuedMemberError) { // check again with diagnostics to generate a less-specific error @@ -75819,7 +73861,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 252 /* ClassDeclaration */ || d.kind === 253 /* InterfaceDeclaration */; + return d.kind === 249 /* ClassDeclaration */ || d.kind === 250 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -75874,7 +73916,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 221 /* ClassExpression */) { + if (derivedClassDecl.kind === 218 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -75895,7 +73937,7 @@ var ts; if (basePropertyFlags && derivedPropertyFlags) { // property/accessor is overridden with property/accessor if (baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 253 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 250 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -75910,7 +73952,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else if (compilerOptions.useDefineForClassFields) { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 163 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 162 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -76026,7 +74068,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 163 /* PropertyDeclaration */ && + return node.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -76050,7 +74092,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 250 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -76083,15 +74125,8 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); checkExportsOnMergedDeclarations(node); checkTypeParameters(node.typeParameters); - if (node.type.kind === 136 /* IntrinsicKeyword */) { - if (!intrinsicTypeKinds.has(node.name.escapedText) || ts.length(node.typeParameters) !== 1) { - error(node.type, ts.Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types); - } - } - else { - checkSourceElement(node.type); - registerForUnusedIdentifiersCheck(node); - } + checkSourceElement(node.type); + registerForUnusedIdentifiersCheck(node); } function computeEnumMemberValues(node) { var nodeLinks = getNodeLinks(node); @@ -76169,7 +74204,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -76179,7 +74214,7 @@ var ts; } } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -76208,7 +74243,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return evaluate(expr.expression); case 78 /* Identifier */: var identifier = expr; @@ -76216,14 +74251,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 201 /* PropertyAccessExpression */) { + if (ex.kind === 198 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -76256,8 +74291,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 78 /* Identifier */ || - node.kind === 201 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 202 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 198 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 199 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -76293,7 +74328,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 255 /* EnumDeclaration */) { + if (declaration.kind !== 252 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -76321,8 +74356,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 252 /* ClassDeclaration */ || - (declaration.kind === 251 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 249 /* ClassDeclaration */ || + (declaration.kind === 248 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -76385,7 +74420,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 252 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 249 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -76435,23 +74470,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 198 /* BindingElement */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 246 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -76462,12 +74497,12 @@ var ts; break; } // falls through - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 251 /* FunctionDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 248 /* FunctionDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -76490,12 +74525,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.left; } while (node.kind !== 78 /* Identifier */); return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -76515,9 +74550,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 267 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 254 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 294 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 264 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -76551,14 +74586,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 270 /* ExportSpecifier */ ? + var message = node.kind === 267 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 270 /* ExportSpecifier */ + && node.kind === 267 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -76573,7 +74608,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); checkAliasSymbol(node); - if (node.kind === 265 /* ImportSpecifier */ && + if (node.kind === 262 /* ImportSpecifier */ && ts.idText(node.propertyName || node.name) === "default" && compilerOptions.esModuleInterop && moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015) { @@ -76595,7 +74630,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 260 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); if (moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015 && compilerOptions.esModuleInterop) { // import * as ns from "foo"; @@ -76623,7 +74658,7 @@ var ts; if (ts.hasSyntacticModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 272 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 269 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -76663,10 +74698,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 257 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 254 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 254 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 294 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -76699,14 +74734,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 268 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 265 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 297 /* SourceFile */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 256 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 294 /* SourceFile */ || node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 253 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -76770,8 +74805,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 294 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 253 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -76796,9 +74831,6 @@ var ts; checkExpressionCached(node.expression); } } - else { - checkExpressionCached(node.expression); // doesn't resolve, check as expression to mark as error - } if (ts.getEmitDeclarations(compilerOptions)) { collectLinkedAliases(node.expression, /*setVisibility*/ true); } @@ -76888,171 +74920,169 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 232 /* FirstStatement */ && kind <= 248 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 229 /* FirstStatement */ && kind <= 245 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return checkTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return checkParameter(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return checkPropertySignature(node); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return checkSignatureDeclaration(node); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: return checkMethodDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return checkConstructorDeclaration(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return checkAccessorDeclaration(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return checkTypeReferenceNode(node); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return checkTypePredicate(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return checkTypeQuery(node); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return checkTypeLiteral(node); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return checkArrayType(node); - case 179 /* TupleType */: + case 178 /* TupleType */: return checkTupleType(node); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 186 /* ParenthesizedType */: - case 180 /* OptionalType */: - case 181 /* RestType */: + case 185 /* ParenthesizedType */: + case 179 /* OptionalType */: + case 180 /* RestType */: return checkSourceElement(node.type); - case 187 /* ThisType */: + case 186 /* ThisType */: return checkThisType(node); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return checkTypeOperator(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return checkConditionalType(node); - case 185 /* InferType */: + case 184 /* InferType */: return checkInferType(node); - case 193 /* TemplateLiteralType */: - return checkTemplateLiteralType(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return checkImportType(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return checkNamedTupleMember(node); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 329 /* JSDocTypeTag */: + case 325 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 333 /* JSDocPropertyTag */: + case 328 /* JSDocPropertyTag */: return checkJSDocPropertyTag(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 306 /* JSDocNonNullableType */: - case 305 /* JSDocNullableType */: - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: - case 312 /* JSDocTypeLiteral */: + case 302 /* JSDocNonNullableType */: + case 301 /* JSDocNullableType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: + case 308 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 301 /* JSDocTypeExpression */: + case 298 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return checkMappedType(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return checkBlock(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return checkVariableStatement(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return checkExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return checkIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return checkDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return checkWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return checkForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return checkForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return checkForOfStatement(node); - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return checkReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return checkWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return checkSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return checkLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return checkThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return checkTryStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return checkBindingElement(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return checkClassDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return checkImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return checkExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return checkExportAssignment(node); - case 231 /* EmptyStatement */: - case 248 /* DebuggerStatement */: + case 228 /* EmptyStatement */: + case 245 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -77147,46 +75177,43 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 161 /* Decorator */: - case 275 /* JsxOpeningElement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 160 /* Decorator */: + case 272 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 273 /* JsxElement */: + case 270 /* JsxElement */: checkJsxElementDeferred(node); break; } currentNode = saveCurrentNode; } function checkSourceFile(node) { - var tracingData = ["check" /* Check */, "checkSourceFile", { path: node.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeCheck"); checkSourceFileWorker(node); ts.performance.mark("afterCheck"); ts.performance.measure("Check", "beforeCheck", "afterCheck"); - ts.tracing.end.apply(ts.tracing, tracingData); } function unusedIsError(kind, isAmbient) { if (isAmbient) { @@ -77319,17 +75346,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -77337,8 +75364,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -77347,7 +75374,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -77395,19 +75422,19 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 159 /* TypeParameter */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 158 /* TypeParameter */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return true; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.isTypeOnly; - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -77415,25 +75442,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 157 /* QualifiedName */) { + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 173 /* TypeReference */; + return node.parent.kind === 172 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 201 /* PropertyAccessExpression */) { + while (node.parent.kind === 198 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 223 /* ExpressionWithTypeArguments */; - } - function isJSDocEntryNameReference(node) { - while (node.parent.kind === 157 /* QualifiedName */) { - node = node.parent; - } - while (node.parent.kind === 201 /* PropertyAccessExpression */) { - node = node.parent; - } - return node.parent.kind === 302 /* JSDocNameReference */; + return node.parent.kind === 220 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -77461,13 +75479,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 157 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 156 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 260 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 257 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 266 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 263 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -77493,7 +75511,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 195 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 192 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -77503,7 +75521,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 201 /* PropertyAccessExpression */ && + name.parent.kind === 198 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -77513,7 +75531,7 @@ var ts; } } } - if (name.parent.kind === 266 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 263 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -77523,7 +75541,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 260 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 257 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -77541,7 +75559,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 223 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 220 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -77557,10 +75575,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 326 /* JSDocParameterTag */) { + if (name.parent.kind === 322 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 159 /* TypeParameter */ && name.parent.parent.kind === 330 /* JSDocTemplateTag */) { + if (name.parent.kind === 158 /* TypeParameter */ && name.parent.parent.kind === 326 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -77577,12 +75595,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 201 /* PropertyAccessExpression */ || name.kind === 157 /* QualifiedName */) { + else if (name.kind === 198 /* PropertyAccessExpression */ || name.kind === 156 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 201 /* PropertyAccessExpression */) { + if (name.kind === 198 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -77592,21 +75610,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 173 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 172 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (isJSDocEntryNameReference(name)) { - var meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */; - return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true, ts.getHostSignatureFromJSDoc(name)); - } - if (name.parent.kind === 172 /* TypePredicate */) { + if (name.parent.kind === 171 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -77629,8 +75643,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 198 /* BindingElement */ && - grandParent.kind === 196 /* ObjectBindingPattern */ && + else if (parent.kind === 195 /* BindingElement */ && + grandParent.kind === 193 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -77642,8 +75656,8 @@ var ts; switch (node.kind) { case 78 /* Identifier */: case 79 /* PrivateIdentifier */: - case 201 /* PropertyAccessExpression */: - case 157 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 107 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -77657,14 +75671,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 187 /* ThisType */: + case 186 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 105 /* SuperKeyword */: return checkExpression(node).symbol; case 132 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 166 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 165 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -77675,7 +75689,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 261 /* ImportDeclaration */ || node.parent.kind === 267 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 258 /* ImportDeclaration */ || node.parent.kind === 264 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -77697,7 +75711,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 83 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 195 /* ImportType */: + case 192 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 92 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -77706,26 +75720,18 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 289 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 286 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; } /** Returns the target of an export specifier without following aliases */ function getExportSpecifierLocalTargetSymbol(node) { - if (ts.isExportSpecifier(node)) { - return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); - } - else { - return resolveEntityName(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); - } + return node.parent.parent.moduleSpecifier ? + getExternalModuleMember(node.parent.parent, node) : + resolveEntityName(node.propertyName || node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } function getTypeOfNode(node) { - if (ts.isSourceFile(node) && !ts.isExternalModule(node)) { - return errorType; - } if (node.flags & 16777216 /* InWithStatement */) { // We cannot answer semantic questions within a with block, do not proceed any further return errorType; @@ -77785,23 +75791,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 200 /* ObjectLiteralExpression */ || expr.kind === 199 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 197 /* ObjectLiteralExpression */ || expr.kind === 196 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 239 /* ForOfStatement */) { + if (expr.parent.kind === 236 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 216 /* BinaryExpression */) { + if (expr.parent.kind === 213 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 288 /* PropertyAssignment */) { + if (expr.parent.kind === 285 /* PropertyAssignment */) { var node_2 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_2) || errorType; var propertyIndex = ts.indexOfNode(node_2.properties, expr.parent); @@ -77849,7 +75855,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -77966,7 +75972,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 297 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 294 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -77981,9 +75987,6 @@ var ts; // When resolved as an expression identifier, if the given node references an import, return the declaration of // that import. Otherwise, return undefined. function getReferencedImportDeclaration(nodeIn) { - if (nodeIn.generatedImportReference) { - return nodeIn.generatedImportReference; - } var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { var symbol = getReferencedValueSymbol(node); @@ -77997,7 +76000,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 287 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 284 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -78028,7 +76031,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 230 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 227 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -78069,19 +76072,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return node.expression && node.expression.kind === 78 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -78090,7 +76093,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 297 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 294 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -78197,15 +76200,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 291 /* EnumMember */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 288 /* EnumMember */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 291 /* EnumMember */) { + if (node.kind === 288 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -78271,7 +76274,7 @@ var ts; else if (isTypeAssignableToKind(type, 2112 /* BigIntLike */)) { return ts.TypeReferenceSerializationKind.BigIntLikeType; } - else if (isTypeAssignableToKind(type, 402653316 /* StringLike */)) { + else if (isTypeAssignableToKind(type, 132 /* StringLike */)) { return ts.TypeReferenceSerializationKind.StringLikeType; } else if (isTupleType(type)) { @@ -78474,12 +76477,12 @@ var ts; getJsxFragmentFactoryEntity: getJsxFragmentFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 168 /* SetAccessor */ ? 167 /* GetAccessor */ : 168 /* SetAccessor */; + var otherKind = accessor.kind === 167 /* SetAccessor */ ? 166 /* GetAccessor */ : 167 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 168 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 167 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 167 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 166 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -78495,7 +76498,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 297 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 294 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -78530,7 +76533,7 @@ var ts; return false; } function isInHeritageClause(node) { - return node.parent && node.parent.kind === 223 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 286 /* HeritageClause */; + return node.parent && node.parent.kind === 220 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 283 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -78542,7 +76545,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 78 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 201 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 78 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 198 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -78593,7 +76596,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 297 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 294 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -78621,12 +76624,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 256 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 253 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 297 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 294 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -78820,14 +76823,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 165 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 164 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */) { + else if (node.kind === 166 /* GetAccessor */ || node.kind === 167 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -78844,17 +76847,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 142 /* ReadonlyKeyword */) { - if (node.kind === 162 /* PropertySignature */ || node.kind === 164 /* MethodSignature */) { + if (modifier.kind !== 141 /* ReadonlyKeyword */) { + if (node.kind === 161 /* PropertySignature */ || node.kind === 163 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 171 /* IndexSignature */) { + if (node.kind === 170 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 84 /* ConstKeyword */: - if (node.kind !== 255 /* EnumDeclaration */) { + if (node.kind !== 252 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(84 /* ConstKeyword */)); } break; @@ -78874,7 +76877,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + else if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -78900,10 +76903,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + else if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -78915,11 +76918,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */ && node.kind !== 171 /* IndexSignature */ && node.kind !== 160 /* Parameter */) { + else if (node.kind !== 162 /* PropertyDeclaration */ && node.kind !== 161 /* PropertySignature */ && node.kind !== 170 /* IndexSignature */ && node.kind !== 159 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -78940,16 +76943,16 @@ var ts; return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } else if (ts.isClassLike(node.parent)) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 87 /* DefaultKeyword */: - var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 294 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 253 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; @@ -78962,12 +76965,12 @@ var ts; return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 257 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 254 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -78980,14 +76983,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 252 /* ClassDeclaration */) { - if (node.kind !== 165 /* MethodDeclaration */ && - node.kind !== 163 /* PropertyDeclaration */ && - node.kind !== 167 /* GetAccessor */ && - node.kind !== 168 /* SetAccessor */) { + if (node.kind !== 249 /* ClassDeclaration */) { + if (node.kind !== 164 /* MethodDeclaration */ && + node.kind !== 162 /* PropertyDeclaration */ && + node.kind !== 166 /* GetAccessor */ && + node.kind !== 167 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 252 /* ClassDeclaration */ && ts.hasSyntacticModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 249 /* ClassDeclaration */ && ts.hasSyntacticModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -78996,9 +76999,6 @@ var ts; if (flags & 8 /* Private */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); } - if (flags & 256 /* Async */ && lastAsync) { - return grammarErrorOnNode(lastAsync, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } } if (ts.isNamedDeclaration(node) && node.name.kind === 79 /* PrivateIdentifier */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); @@ -79012,18 +77012,15 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } - if (flags & 128 /* Abstract */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } flags |= 256 /* Async */; lastAsync = modifier; break; } } - if (node.kind === 166 /* Constructor */) { + if (node.kind === 165 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -79038,13 +77035,13 @@ var ts; } return false; } - else if ((node.kind === 261 /* ImportDeclaration */ || node.kind === 260 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 258 /* ImportDeclaration */ || node.kind === 257 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 159 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 159 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -79065,37 +77062,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 256 /* ModuleDeclaration */: - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 160 /* Parameter */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 253 /* ModuleDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 159 /* Parameter */: return false; default: - if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return false; } switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 129 /* AsyncKeyword */); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 125 /* AbstractKeyword */); - case 253 /* InterfaceDeclaration */: - case 232 /* VariableStatement */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 229 /* VariableStatement */: + case 251 /* TypeAliasDeclaration */: return true; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 84 /* ConstKeyword */); default: ts.Debug.fail(); @@ -79108,10 +77105,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -79230,7 +77227,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 147 /* StringKeyword */ && parameter.type.kind !== 144 /* NumberKeyword */) { + if (parameter.type.kind !== 146 /* StringKeyword */ && parameter.type.kind !== 143 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -79272,7 +77269,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 222 /* OmittedExpression */) { + if (arg.kind === 219 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -79349,20 +77346,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 158 /* ComputedPropertyName */) { + if (node.kind !== 157 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 216 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 213 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 251 /* FunctionDeclaration */ || - node.kind === 208 /* FunctionExpression */ || - node.kind === 165 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 248 /* FunctionDeclaration */ || + node.kind === 205 /* FunctionExpression */ || + node.kind === 164 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -79381,7 +77378,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 290 /* SpreadAssignment */) { + if (prop.kind === 287 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -79392,11 +77389,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 158 /* ComputedPropertyName */) { + if (name.kind === 157 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 289 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 286 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern); @@ -79409,7 +77406,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 129 /* AsyncKeyword */ || prop.kind !== 165 /* MethodDeclaration */) { + if (mod.kind !== 129 /* AsyncKeyword */ || prop.kind !== 164 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -79424,10 +77421,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -79435,13 +77432,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -79480,7 +77477,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 282 /* JsxSpreadAttribute */) { + if (attr.kind === 279 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -79490,7 +77487,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 283 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 280 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -79504,14 +77501,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 239 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 236 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 166 /* Constructor */) { + if (func && func.kind !== 165 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -79522,7 +77519,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 250 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 247 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -79537,20 +77534,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -79575,11 +77572,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 167 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 166 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 168 /* SetAccessor */) { + if (accessor.kind === 167 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -79601,17 +77598,17 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 166 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 166 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 151 /* UniqueKeyword */) { - if (node.type.kind !== 148 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(148 /* SymbolKeyword */)); + if (node.operator === 150 /* UniqueKeyword */) { + if (node.type.kind !== 147 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(147 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) { @@ -79622,7 +77619,7 @@ var ts; } } switch (parent.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 78 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -79634,13 +77631,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: if (!ts.hasSyntacticModifier(parent, 32 /* Static */) || !ts.hasEffectiveModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: if (!ts.hasSyntacticModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -79649,9 +77646,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 142 /* ReadonlyKeyword */) { - if (node.type.kind !== 178 /* ArrayType */ && node.type.kind !== 179 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(148 /* SymbolKeyword */)); + else if (node.operator === 141 /* ReadonlyKeyword */) { + if (node.type.kind !== 177 /* ArrayType */ && node.type.kind !== 178 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(147 /* SymbolKeyword */)); } } } @@ -79664,8 +77661,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 165 /* MethodDeclaration */) { - if (node.parent.kind === 200 /* ObjectLiteralExpression */) { + if (node.kind === 164 /* MethodDeclaration */) { + if (node.parent.kind === 197 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 129 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -79693,14 +77690,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 165 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 164 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 253 /* InterfaceDeclaration */) { + else if (node.parent.kind === 250 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 177 /* TypeLiteral */) { + else if (node.parent.kind === 176 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -79711,11 +77708,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 240 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 237 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -79723,8 +77720,8 @@ var ts; return false; } break; - case 244 /* SwitchStatement */: - if (node.kind === 241 /* BreakStatement */ && !node.label) { + case 241 /* SwitchStatement */: + if (node.kind === 238 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -79739,13 +77736,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 241 /* BreakStatement */ + var message = node.kind === 238 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 241 /* BreakStatement */ + var message = node.kind === 238 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -79769,12 +77766,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 211 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 211 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -79805,7 +77802,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 238 /* ForInStatement */ && node.parent.parent.kind !== 239 /* ForOfStatement */) { + if (node.parent.parent.kind !== 235 /* ForInStatement */ && node.parent.parent.kind !== 236 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -79818,11 +77815,8 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 232 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { - var message = node.initializer - ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions - : ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations; - return grammarErrorOnNode(node.exclamationToken, message); + if (node.exclamationToken && (node.parent.parent.kind !== 229 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); if (moduleKind < ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.System && @@ -79884,15 +77878,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return false; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -79984,7 +77978,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 253 /* InterfaceDeclaration */) { + else if (node.parent.kind === 250 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -79992,7 +77986,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 177 /* TypeLiteral */) { + else if (node.parent.kind === 176 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -80005,12 +77999,7 @@ var ts; } if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || node.flags & 8388608 /* Ambient */ || ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */))) { - var message = node.initializer - ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions - : !node.type - ? ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations - : ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; - return grammarErrorOnNode(node.exclamationToken, message); + return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { @@ -80026,13 +78015,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 253 /* InterfaceDeclaration */ || - node.kind === 254 /* TypeAliasDeclaration */ || - node.kind === 261 /* ImportDeclaration */ || - node.kind === 260 /* ImportEqualsDeclaration */ || - node.kind === 267 /* ExportDeclaration */ || - node.kind === 266 /* ExportAssignment */ || - node.kind === 259 /* NamespaceExportDeclaration */ || + if (node.kind === 250 /* InterfaceDeclaration */ || + node.kind === 251 /* TypeAliasDeclaration */ || + node.kind === 258 /* ImportDeclaration */ || + node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 264 /* ExportDeclaration */ || + node.kind === 263 /* ExportAssignment */ || + node.kind === 256 /* NamespaceExportDeclaration */ || ts.hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -80041,7 +78030,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 232 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 229 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -80064,7 +78053,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 230 /* Block */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + if (node.parent.kind === 227 /* Block */ || node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -80086,10 +78075,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 191 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 190 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 291 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 288 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -80264,14 +78253,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 251 /* FunctionDeclaration */ && declaration.kind !== 165 /* MethodDeclaration */) || + return (declaration.kind !== 248 /* FunctionDeclaration */ && declaration.kind !== 164 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -80279,14 +78268,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 262 /* ImportClause */: // For default import - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: // For rename import `x as y` + case 259 /* ImportClause */: // For default import + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: // For rename import `x as y` return true; case 78 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 265 /* ImportSpecifier */; + return decl.parent.kind === 262 /* ImportSpecifier */; default: return false; } @@ -80518,7 +78507,7 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 156 /* LastToken */) || kind === 187 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 155 /* LastToken */) || kind === 186 /* ThisType */) { return node; } var factory = context.factory; @@ -80526,291 +78515,287 @@ var ts; // Names case 78 /* Identifier */: return factory.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return factory.updateQualifiedName(node, nodeVisitor(node.left, visitor, ts.isEntityName), nodeVisitor(node.right, visitor, ts.isIdentifier)); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return factory.updateComputedPropertyName(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Signature elements - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return factory.updateTypeParameterDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.constraint, visitor, ts.isTypeNode), nodeVisitor(node.default, visitor, ts.isTypeNode)); - case 160 /* Parameter */: + case 159 /* Parameter */: return factory.updateParameterDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 161 /* Decorator */: + case 160 /* Decorator */: return factory.updateDecorator(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Type elements - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return factory.updatePropertyDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too nodeVisitor(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 164 /* MethodSignature */: + case 163 /* MethodSignature */: return factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return factory.updateMethodDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 166 /* Constructor */: + case 165 /* Constructor */: return factory.updateConstructorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return factory.updateGetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return factory.updateSetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 169 /* CallSignature */: + case 168 /* CallSignature */: return factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return factory.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); // Types - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return factory.updateTypePredicateNode(node, nodeVisitor(node.assertsModifier, visitor), nodeVisitor(node.parameterName, visitor), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return factory.updateTypeReferenceNode(node, nodeVisitor(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 174 /* FunctionType */: + case 173 /* FunctionType */: return factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 175 /* ConstructorType */: + case 174 /* ConstructorType */: return factory.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName)); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return factory.updateArrayTypeNode(node, nodeVisitor(node.elementType, visitor, ts.isTypeNode)); - case 179 /* TupleType */: + case 178 /* TupleType */: return factory.updateTupleTypeNode(node, nodesVisitor(node.elements, visitor, ts.isTypeNode)); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return factory.updateOptionalTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 181 /* RestType */: + case 180 /* RestType */: return factory.updateRestTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 182 /* UnionType */: + case 181 /* UnionType */: return factory.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return factory.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return factory.updateConditionalTypeNode(node, nodeVisitor(node.checkType, visitor, ts.isTypeNode), nodeVisitor(node.extendsType, visitor, ts.isTypeNode), nodeVisitor(node.trueType, visitor, ts.isTypeNode), nodeVisitor(node.falseType, visitor, ts.isTypeNode)); - case 185 /* InferType */: + case 184 /* InferType */: return factory.updateInferTypeNode(node, nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 195 /* ImportType */: + case 192 /* ImportType */: return factory.updateImportTypeNode(node, nodeVisitor(node.argument, visitor, ts.isTypeNode), nodeVisitor(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return factory.updateNamedTupleMember(node, visitNode(node.dotDotDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return factory.updateParenthesizedType(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return factory.updateTypeOperatorNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return factory.updateIndexedAccessTypeNode(node, nodeVisitor(node.objectType, visitor, ts.isTypeNode), nodeVisitor(node.indexType, visitor, ts.isTypeNode)); - case 190 /* MappedType */: - return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.nameType, visitor, ts.isTypeNode), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 191 /* LiteralType */: + case 189 /* MappedType */: + return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); + case 190 /* LiteralType */: return factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.isExpression)); - case 193 /* TemplateLiteralType */: - return factory.updateTemplateLiteralType(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateLiteralTypeSpan)); - case 194 /* TemplateLiteralTypeSpan */: - return factory.updateTemplateLiteralTypeSpan(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Binding patterns - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: return factory.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return factory.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return factory.updateBindingElement(node, nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.propertyName, visitor, ts.isPropertyName), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.initializer, visitor, ts.isExpression)); // Expression - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return factory.updateArrayLiteralExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return factory.updateObjectLiteralExpression(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updatePropertyAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier)); } return factory.updatePropertyAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateElementAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.argumentExpression, visitor, ts.isExpression)); } return factory.updateElementAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.argumentExpression, visitor, ts.isExpression)); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateCallChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return factory.updateCallExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return factory.updateNewExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return factory.updateTaggedTemplateExpression(node, nodeVisitor(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), nodeVisitor(node.template, visitor, ts.isTemplateLiteral)); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return factory.updateTypeAssertion(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return factory.updateParenthesizedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return factory.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return factory.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return factory.updateDeleteExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return factory.updateTypeOfExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return factory.updateVoidExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return factory.updateAwaitExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return factory.updatePrefixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression)); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return factory.updatePostfixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression)); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return factory.updateBinaryExpression(node, nodeVisitor(node.left, visitor, ts.isExpression), nodeVisitor(node.operatorToken, tokenVisitor, ts.isToken), nodeVisitor(node.right, visitor, ts.isExpression)); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return factory.updateConditionalExpression(node, nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenTrue, visitor, ts.isExpression), nodeVisitor(node.colonToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenFalse, visitor, ts.isExpression)); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return factory.updateTemplateExpression(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return factory.updateYieldExpression(node, nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return factory.updateSpreadElement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return factory.updateClassExpression(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return factory.updateExpressionWithTypeArguments(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 224 /* AsExpression */: + case 221 /* AsExpression */: return factory.updateAsExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateNonNullChain(node, nodeVisitor(node.expression, visitor, ts.isExpression)); } return factory.updateNonNullExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return factory.updateMetaProperty(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); // Misc - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return factory.updateTemplateSpan(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 230 /* Block */: + case 227 /* Block */: return factory.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return factory.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return factory.updateExpressionStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return factory.updateIfStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.thenStatement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.elseStatement, visitor, ts.isStatement, factory.liftToBlock)); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return factory.updateDoStatement(node, nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return factory.updateWhileStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return factory.updateForStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.incrementor, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return factory.updateForInStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return factory.updateForOfStatement(node, nodeVisitor(node.awaitModifier, tokenVisitor, ts.isToken), nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return factory.updateContinueStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier)); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return factory.updateBreakStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier)); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return factory.updateReturnStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return factory.updateWithStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return factory.updateSwitchStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.caseBlock, visitor, ts.isCaseBlock)); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return factory.updateLabeledStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return factory.updateThrowStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return factory.updateTryStatement(node, nodeVisitor(node.tryBlock, visitor, ts.isBlock), nodeVisitor(node.catchClause, visitor, ts.isCatchClause), nodeVisitor(node.finallyBlock, visitor, ts.isBlock)); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return factory.updateVariableDeclaration(node, nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return factory.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return factory.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return factory.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return factory.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return factory.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return factory.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return factory.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.body, visitor, ts.isModuleBody)); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return factory.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return factory.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return factory.updateNamespaceExportDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return factory.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.moduleReference, visitor, ts.isModuleReference)); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return factory.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.importClause, visitor, ts.isImportClause), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression)); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts.isNamedImportBindings)); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return factory.updateNamespaceImport(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return factory.updateNamespaceExport(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 264 /* NamedImports */: + case 261 /* NamedImports */: return factory.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return factory.updateImportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return factory.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return factory.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, ts.isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression)); - case 268 /* NamedExports */: + case 265 /* NamedExports */: return factory.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return factory.updateExportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier)); // Module references - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return factory.updateExternalModuleReference(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // JSX - case 273 /* JsxElement */: + case 270 /* JsxElement */: return factory.updateJsxElement(node, nodeVisitor(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingElement, visitor, ts.isJsxClosingElement)); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return factory.updateJsxSelfClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes)); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: return factory.updateJsxOpeningElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes)); - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: return factory.updateJsxClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return factory.updateJsxFragment(node, nodeVisitor(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return factory.updateJsxAttribute(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return factory.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return factory.updateJsxSpreadAttribute(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return factory.updateJsxExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Clauses - case 284 /* CaseClause */: + case 281 /* CaseClause */: return factory.updateCaseClause(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return factory.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return factory.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return factory.updateCatchClause(node, nodeVisitor(node.variableDeclaration, visitor, ts.isVariableDeclaration), nodeVisitor(node.block, visitor, ts.isBlock)); // Property assignments - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return factory.updatePropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return factory.updateShorthandPropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return factory.updateSpreadAssignment(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Enum - case 291 /* EnumMember */: + case 288 /* EnumMember */: return factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 297 /* SourceFile */: + case 294 /* SourceFile */: return factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return factory.updateCommaListExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -81485,7 +79470,7 @@ var ts; function chainBundle(context, transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 297 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 294 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -81536,7 +79521,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -81549,13 +79534,13 @@ var ts; hasImportDefault = true; } break; - case 260 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 272 /* ExternalModuleReference */) { + case 257 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 269 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -81586,13 +79571,13 @@ var ts; addExportedNamesForExportDeclaration(node); } break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { for (var _b = 0, _c = node.declarationList.declarations; _b < _c.length; _b++) { var decl = _c[_b]; @@ -81600,7 +79585,7 @@ var ts; } } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { if (ts.hasSyntacticModifier(node, 512 /* Default */)) { // export default function() { } @@ -81620,7 +79605,7 @@ var ts; } } break; - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { if (ts.hasSyntacticModifier(node, 512 /* Default */)) { // export default class { } @@ -81794,7 +79779,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 163 /* PropertyDeclaration */ + return member.kind === 162 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -82013,27 +79998,18 @@ var ts; * for the element. */ function flattenBindingOrAssignmentElement(flattenContext, element, value, location, skipInitializer) { - var bindingTarget = ts.getTargetOfBindingOrAssignmentElement(element); // TODO: GH#18217 if (!skipInitializer) { var initializer = ts.visitNode(ts.getInitializerOfBindingOrAssignmentElement(element), flattenContext.visitor, ts.isExpression); if (initializer) { // Combine value and initializer - if (value) { - value = createDefaultValueCheck(flattenContext, value, initializer, location); - // If 'value' is not a simple expression, it could contain side-effecting code that should evaluate before an object or array binding pattern. - if (!ts.isSimpleInlineableExpression(initializer) && ts.isBindingOrAssignmentPattern(bindingTarget)) { - value = ensureIdentifier(flattenContext, value, /*reuseIdentifierExpressions*/ true, location); - } - } - else { - value = initializer; - } + value = value ? createDefaultValueCheck(flattenContext, value, initializer, location) : initializer; } else if (!value) { // Use 'void 0' in absence of value and initializer value = flattenContext.context.factory.createVoidZero(); } } + var bindingTarget = ts.getTargetOfBindingOrAssignmentElement(element); // TODO: GH#18217 if (ts.isObjectBindingOrAssignmentPattern(bindingTarget)) { flattenObjectBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value, location); } @@ -82138,8 +80114,7 @@ var ts; if (flattenContext.level >= 1 /* ObjectRest */) { // If an array pattern contains an ObjectRest, we must cache the result so that we // can perform the ObjectRest destructuring in a different declaration - if (element.transformFlags & 16384 /* ContainsObjectRestOrSpread */ || flattenContext.hasTransformedPriorElement && !isSimpleBindingOrAssignmentElement(element)) { - flattenContext.hasTransformedPriorElement = true; + if (element.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { var temp = flattenContext.context.factory.createTempVariable(/*recordTempVariable*/ undefined); if (flattenContext.hoistTempVariables) { flattenContext.context.hoistVariableDeclaration(temp); @@ -82173,20 +80148,6 @@ var ts; } } } - function isSimpleBindingOrAssignmentElement(element) { - var target = ts.getTargetOfBindingOrAssignmentElement(element); - if (!target || ts.isOmittedExpression(target)) - return true; - var propertyName = ts.tryGetPropertyNameOfBindingOrAssignmentElement(element); - if (propertyName && !ts.isPropertyNameLiteral(propertyName)) - return false; - var initializer = ts.getInitializerOfBindingOrAssignmentElement(element); - if (initializer && !ts.isSimpleInlineableExpression(initializer)) - return false; - if (ts.isBindingOrAssignmentPattern(target)) - return ts.every(ts.getElementsOfBindingOrAssignmentPattern(target), isSimpleBindingOrAssignmentElement); - return ts.isIdentifier(target); - } /** * Creates an expression used to provide a default value if a value is `undefined` at runtime. * @@ -82396,8 +80357,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -82423,14 +80384,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 298 /* Bundle */) { + if (node.kind === 295 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return factory.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 300 /* InputFiles */) { + if (prepend.kind === 297 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -82481,16 +80442,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 297 /* SourceFile */: - case 258 /* CaseBlock */: - case 257 /* ModuleBlock */: - case 230 /* Block */: + case 294 /* SourceFile */: + case 255 /* CaseBlock */: + case 254 /* ModuleBlock */: + case 227 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.hasSyntacticModifier(node, 2 /* Ambient */)) { break; } @@ -82502,7 +80463,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 252 /* ClassDeclaration */ || ts.hasSyntacticModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 249 /* ClassDeclaration */ || ts.hasSyntacticModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -82545,10 +80506,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: return visitElidableStatement(node); default: return visitorWorker(node); @@ -82569,13 +80530,13 @@ var ts; return node; } switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -82595,11 +80556,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 267 /* ExportDeclaration */ || - node.kind === 261 /* ImportDeclaration */ || - node.kind === 262 /* ImportClause */ || - (node.kind === 260 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 272 /* ExternalModuleReference */)) { + if (node.kind === 264 /* ExportDeclaration */ || + node.kind === 258 /* ImportDeclaration */ || + node.kind === 259 /* ImportClause */ || + (node.kind === 257 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 269 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -82623,19 +80584,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return visitConstructor(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 171 /* IndexSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + case 170 /* IndexSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -82672,61 +80633,61 @@ var ts; case 125 /* AbstractKeyword */: case 84 /* ConstKeyword */: case 133 /* DeclareKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 178 /* ArrayType */: - case 179 /* TupleType */: - case 180 /* OptionalType */: - case 181 /* RestType */: - case 177 /* TypeLiteral */: - case 172 /* TypePredicate */: - case 159 /* TypeParameter */: + case 177 /* ArrayType */: + case 178 /* TupleType */: + case 179 /* OptionalType */: + case 180 /* RestType */: + case 176 /* TypeLiteral */: + case 171 /* TypePredicate */: + case 158 /* TypeParameter */: case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: + case 151 /* UnknownKeyword */: case 131 /* BooleanKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 141 /* NeverKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 140 /* NeverKeyword */: case 113 /* VoidKeyword */: - case 148 /* SymbolKeyword */: - case 175 /* ConstructorType */: - case 174 /* FunctionType */: - case 176 /* TypeQuery */: - case 173 /* TypeReference */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 184 /* ConditionalType */: - case 186 /* ParenthesizedType */: - case 187 /* ThisType */: - case 188 /* TypeOperator */: - case 189 /* IndexedAccessType */: - case 190 /* MappedType */: - case 191 /* LiteralType */: + case 147 /* SymbolKeyword */: + case 174 /* ConstructorType */: + case 173 /* FunctionType */: + case 175 /* TypeQuery */: + case 172 /* TypeReference */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 183 /* ConditionalType */: + case 185 /* ParenthesizedType */: + case 186 /* ThisType */: + case 187 /* TypeOperator */: + case 188 /* IndexedAccessType */: + case 189 /* MappedType */: + case 190 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 161 /* Decorator */: + case 160 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 166 /* Constructor */: + case 165 /* Constructor */: return visitConstructor(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return factory.createNotEmittedStatement(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -82736,7 +80697,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -82746,35 +80707,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 160 /* Parameter */: + case 159 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -82784,40 +80745,40 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: return visitJsxJsxOpeningElement(node); default: // node contains some other TypeScript syntax @@ -83226,12 +81187,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -83384,7 +81345,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 163 /* PropertyDeclaration */ + ? member.kind === 162 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? factory.createVoidZero() @@ -83508,10 +81469,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 163 /* PropertyDeclaration */; + return kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 162 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -83521,7 +81482,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 165 /* MethodDeclaration */; + return node.kind === 164 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -83532,12 +81493,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return true; } return false; @@ -83554,15 +81515,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: - case 160 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 159 /* Parameter */: return serializeTypeNode(node.type); - case 168 /* SetAccessor */: - case 167 /* GetAccessor */: + case 167 /* SetAccessor */: + case 166 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 165 /* MethodDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 164 /* MethodDeclaration */: return factory.createIdentifier("Function"); default: return factory.createVoidZero(); @@ -83599,7 +81560,7 @@ var ts; return factory.createArrayLiteralExpression(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 167 /* GetAccessor */) { + if (container && node.kind === 166 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -83645,30 +81606,30 @@ var ts; } switch (node.kind) { case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: return factory.createVoidZero(); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return factory.createIdentifier("Function"); - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return factory.createIdentifier("Array"); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: case 131 /* BooleanKeyword */: return factory.createIdentifier("Boolean"); - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: return factory.createIdentifier("String"); - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return factory.createIdentifier("Object"); - case 191 /* LiteralType */: + case 190 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return factory.createIdentifier("String"); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return factory.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -83681,45 +81642,45 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: return factory.createIdentifier("Number"); - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : factory.createIdentifier("Symbol"); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return serializeTypeReferenceNode(node); - case 183 /* IntersectionType */: - case 182 /* UnionType */: + case 182 /* IntersectionType */: + case 181 /* UnionType */: return serializeTypeList(node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 188 /* TypeOperator */: - if (node.operator === 142 /* ReadonlyKeyword */) { + case 187 /* TypeOperator */: + if (node.operator === 141 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 176 /* TypeQuery */: - case 189 /* IndexedAccessType */: - case 190 /* MappedType */: - case 177 /* TypeLiteral */: + case 175 /* TypeQuery */: + case 188 /* IndexedAccessType */: + case 189 /* MappedType */: + case 176 /* TypeLiteral */: case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 187 /* ThisType */: - case 195 /* ImportType */: + case 151 /* UnknownKeyword */: + case 186 /* ThisType */: + case 192 /* ImportType */: break; // handle JSDoc types from an invalid parse - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: - case 308 /* JSDocFunctionType */: - case 309 /* JSDocVariadicType */: - case 310 /* JSDocNamepathType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: + case 304 /* JSDocFunctionType */: + case 305 /* JSDocVariadicType */: + case 306 /* JSDocNamepathType */: break; - case 305 /* JSDocNullableType */: - case 306 /* JSDocNonNullableType */: - case 307 /* JSDocOptionalType */: + case 301 /* JSDocNullableType */: + case 302 /* JSDocNonNullableType */: + case 303 /* JSDocOptionalType */: return serializeTypeNode(node.type); default: return ts.Debug.failBadSyntaxKind(node); @@ -83730,15 +81691,15 @@ var ts; // Note when updating logic here also update getEntityNameForDecoratorMetadata // so that aliases can be marked as referenced var serializedUnion; - for (var _i = 0, types_22 = types; _i < types_22.length; _i++) { - var typeNode = types_22[_i]; - while (typeNode.kind === 186 /* ParenthesizedType */) { + for (var _i = 0, types_21 = types; _i < types_21.length; _i++) { + var typeNode = types_21[_i]; + while (typeNode.kind === 185 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 141 /* NeverKeyword */) { + if (typeNode.kind === 140 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 190 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 149 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -83848,7 +81809,7 @@ var ts; name.original = undefined; ts.setParent(name, ts.getParseTreeNode(currentLexicalScope)); // ensure the parent is set to a parse tree node. return name; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -84422,12 +82383,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = factory.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), factory.createVariableDeclarationList([ factory.createVariableDeclaration(factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 297 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 294 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 255 /* EnumDeclaration */) { + if (node.kind === 252 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -84552,7 +82513,7 @@ var ts; var statementsLocation; var blockLocation; if (node.body) { - if (node.body.kind === 257 /* ModuleBlock */) { + if (node.body.kind === 254 /* ModuleBlock */) { saveStateAndInvoke(node.body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = node.body.statements; blockLocation = node.body; @@ -84599,13 +82560,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (!node.body || node.body.kind !== 257 /* ModuleBlock */) { + if (!node.body || node.body.kind !== 254 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 256 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 253 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -84655,7 +82616,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 263 /* NamespaceImport */) { + if (node.kind === 260 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -84904,16 +82865,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(78 /* Identifier */); - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(256 /* ModuleDeclaration */); + context.enableEmitNotification(253 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 256 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 253 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 255 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 252 /* EnumDeclaration */; } /** * Hook for node emit. @@ -84974,9 +82935,9 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -85014,9 +82975,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 297 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 256 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 255 /* EnumDeclaration */); + if (container && container.kind !== 294 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 253 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 252 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(container), node), /*location*/ node); @@ -85116,40 +83077,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: return visitClassLike(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); case 79 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 200 /* ObjectLiteralExpression */: - case 199 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -85172,20 +83133,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -85937,31 +83898,31 @@ var ts; case 129 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitAwaitExpression(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return ts.visitEachChild(node, visitor, context); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -85970,27 +83931,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 230 /* Block */: - case 244 /* SwitchStatement */: - case 258 /* CaseBlock */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 247 /* TryStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 234 /* IfStatement */: - case 243 /* WithStatement */: - case 245 /* LabeledStatement */: + case 227 /* Block */: + case 241 /* SwitchStatement */: + case 255 /* CaseBlock */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 244 /* TryStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 231 /* IfStatement */: + case 240 /* WithStatement */: + case 242 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -86195,7 +84156,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 209 /* ArrowFunction */; + var isArrowFunction = node.kind === 206 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -86286,17 +84247,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(203 /* CallExpression */); - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(200 /* CallExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(252 /* ClassDeclaration */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(166 /* Constructor */); + context.enableEmitNotification(249 /* ClassDeclaration */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(165 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(232 /* VariableStatement */); + context.enableEmitNotification(229 /* VariableStatement */); } } /** @@ -86344,11 +84305,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -86380,11 +84341,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 252 /* ClassDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 249 /* ClassDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -86535,10 +84496,10 @@ var ts; return visited; } function visitor(node) { - return visitorWorker(node, /*expressionResultIsUnused*/ false); + return visitorWorker(node, /*noDestructuringValue*/ false); } - function visitorWithUnusedExpressionResult(node) { - return visitorWorker(node, /*expressionResultIsUnused*/ true); + function visitorNoDestructuringValue(node) { + return visitorWorker(node, /*noDestructuringValue*/ true); } function visitorNoAsyncModifier(node) { if (node.kind === 129 /* AsyncKeyword */) { @@ -86558,79 +84519,73 @@ var ts; function visitDefault(node) { return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitorWorker(node, expressionResultIsUnused) { + function visitorWorker(node, noDestructuringValue) { if ((node.transformFlags & 32 /* ContainsES2018 */) === 0) { return node; } switch (node.kind) { - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitAwaitExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 216 /* BinaryExpression */: - return visitBinaryExpression(node, expressionResultIsUnused); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node, expressionResultIsUnused); - case 287 /* CatchClause */: + case 213 /* BinaryExpression */: + return visitBinaryExpression(node, noDestructuringValue); + case 284 /* CatchClause */: return visitCatchClause(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 238 /* ForInStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 235 /* ForInStatement */: return doWithHierarchyFacts(visitDefault, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return doWithHierarchyFacts(visitForStatement, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return visitVoidExpression(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return doWithHierarchyFacts(visitConstructorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return doWithHierarchyFacts(visitMethodDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return doWithHierarchyFacts(visitGetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return doWithHierarchyFacts(visitSetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return doWithHierarchyFacts(visitFunctionDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return doWithHierarchyFacts(visitFunctionExpression, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return doWithHierarchyFacts(visitArrowFunction, node, 2 /* ArrowFunctionExcludes */, 0 /* ArrowFunctionIncludes */); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitParameter(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 207 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, expressionResultIsUnused); - case 205 /* TaggedTemplateExpression */: + case 204 /* ParenthesizedExpression */: + return visitParenthesizedExpression(node, noDestructuringValue); + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return ts.visitEachChild(node, visitor, context); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return doWithHierarchyFacts(visitDefault, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); default: return ts.visitEachChild(node, visitor, context); @@ -86666,7 +84621,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 239 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 236 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return factory.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement, factory.liftToBlock), node); @@ -86678,7 +84633,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 290 /* SpreadAssignment */) { + if (e.kind === 287 /* SpreadAssignment */) { if (chunkObject) { objects.push(factory.createObjectLiteralExpression(chunkObject)); chunkObject = undefined; @@ -86687,7 +84642,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 288 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 285 /* PropertyAssignment */ ? factory.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -86721,7 +84676,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 200 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 197 /* ObjectLiteralExpression */) { objects.unshift(factory.createObjectLiteralExpression()); } var expression = objects[0]; @@ -86738,14 +84693,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitExpressionStatement(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + return ts.visitEachChild(node, visitorNoDestructuringValue, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitParenthesizedExpression(node, expressionResultIsUnused) { - return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context); + function visitParenthesizedExpression(node, noDestructuringValue) { + return ts.visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context); } function visitSourceFile(node) { var ancestorFacts = enterSubtree(2 /* SourceFileExcludes */, ts.isEffectiveStrictModeSourceFile(node, compilerOptions) ? @@ -86767,38 +84718,16 @@ var ts; * Visits a BinaryExpression that contains a destructuring assignment. * * @param node A BinaryExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). */ - function visitBinaryExpression(node, expressionResultIsUnused) { + function visitBinaryExpression(node, noDestructuringValue) { if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { - return ts.flattenDestructuringAssignment(node, visitor, context, 1 /* ObjectRest */, !expressionResultIsUnused); + return ts.flattenDestructuringAssignment(node, visitor, context, 1 /* ObjectRest */, !noDestructuringValue); } - if (node.operatorToken.kind === 27 /* CommaToken */) { - return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression)); + else if (node.operatorToken.kind === 27 /* CommaToken */) { + return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorNoDestructuringValue, ts.isExpression), node.operatorToken, ts.visitNode(node.right, noDestructuringValue ? visitorNoDestructuringValue : visitor, ts.isExpression)); } return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitCommaListExpression(node, expressionResultIsUnused) { - if (expressionResultIsUnused) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - var result; - for (var i = 0; i < node.elements.length; i++) { - var element = node.elements[i]; - var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - result.push(visited); - } - } - var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements; - return factory.updateCommaListExpression(node, elements); - } function visitCatchClause(node) { if (node.variableDeclaration && ts.isBindingPattern(node.variableDeclaration.name) && @@ -86850,10 +84779,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitForStatement(node) { - return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement)); + return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorNoDestructuringValue, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement)); } function visitVoidExpression(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + return ts.visitEachChild(node, visitorNoDestructuringValue, context); } /** * Visits a ForOfStatement and converts it into a ES2015-compatible ForOfStatement. @@ -87134,17 +85063,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(203 /* CallExpression */); - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(200 /* CallExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(252 /* ClassDeclaration */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(166 /* Constructor */); + context.enableEmitNotification(249 /* ClassDeclaration */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(165 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(232 /* VariableStatement */); + context.enableEmitNotification(229 /* VariableStatement */); } } /** @@ -87192,11 +85121,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -87228,11 +85157,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 252 /* ClassDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 249 /* ClassDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -87264,7 +85193,7 @@ var ts; return node; } switch (node.kind) { - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -87296,21 +85225,21 @@ var ts; return node; } switch (node.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 203 /* CallExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 200 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -87353,7 +85282,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 201 /* PropertyAccessExpression */ + expression = node.kind === 198 /* PropertyAccessExpression */ ? factory.updatePropertyAccessExpression(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : factory.updateElementAccessExpression(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? factory.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -87367,10 +85296,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 203 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 204 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 200 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -87390,8 +85319,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (!ts.isSimpleCopiableExpression(rightExpression)) { thisArg = factory.createTempVariable(hoistVariableDeclaration); @@ -87402,11 +85331,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 201 /* PropertyAccessExpression */ + rightExpression = segment.kind === 198 /* PropertyAccessExpression */ ? factory.createPropertyAccessExpression(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : factory.createElementAccessExpression(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = factory.createFunctionCallCall(rightExpression, leftThisArg.kind === 105 /* SuperKeyword */ ? factory.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -87463,7 +85392,7 @@ var ts; return node; } switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var binaryExpression = node; if (ts.isLogicalOrCoalescingAssignmentExpression(binaryExpression)) { return transformLogicalAssignment(binaryExpression); @@ -87508,49 +85437,7 @@ var ts; var factory = context.factory, emitHelpers = context.getEmitHelperFactory; var compilerOptions = context.getCompilerOptions(); var currentSourceFile; - var currentFileState; return ts.chainBundle(context, transformSourceFile); - function getCurrentFileNameExpression() { - if (currentFileState.filenameDeclaration) { - return currentFileState.filenameDeclaration.name; - } - var declaration = factory.createVariableDeclaration(factory.createUniqueName("_jsxFileName", 16 /* Optimistic */ | 32 /* FileLevel */), /*exclaimationToken*/ undefined, /*type*/ undefined, factory.createStringLiteral(currentSourceFile.fileName)); - currentFileState.filenameDeclaration = declaration; - return currentFileState.filenameDeclaration.name; - } - function getJsxFactoryCalleePrimitive(childrenLength) { - return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" : childrenLength > 1 ? "jsxs" : "jsx"; - } - function getJsxFactoryCallee(childrenLength) { - var type = getJsxFactoryCalleePrimitive(childrenLength); - return getImplicitImportForName(type); - } - function getImplicitJsxFragmentReference() { - return getImplicitImportForName("Fragment"); - } - function getImplicitImportForName(name) { - var _a, _b; - var importSource = name === "createElement" - ? currentFileState.importSpecifier - : ts.getJSXRuntimeImport(currentFileState.importSpecifier, compilerOptions); - var existing = (_b = (_a = currentFileState.utilizedImplicitRuntimeImports) === null || _a === void 0 ? void 0 : _a.get(importSource)) === null || _b === void 0 ? void 0 : _b.get(name); - if (existing) { - return existing.name; - } - if (!currentFileState.utilizedImplicitRuntimeImports) { - currentFileState.utilizedImplicitRuntimeImports = ts.createMap(); - } - var specifierSourceImports = currentFileState.utilizedImplicitRuntimeImports.get(importSource); - if (!specifierSourceImports) { - specifierSourceImports = ts.createMap(); - currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports); - } - var generatedName = factory.createUniqueName("_" + name, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */); - var specifier = factory.createImportSpecifier(factory.createIdentifier(name), generatedName); - generatedName.generatedImportReference = specifier; - specifierSourceImports.set(name, specifier); - return generatedName; - } /** * Transform JSX-specific syntax in a SourceFile. * @@ -87561,42 +85448,8 @@ var ts; return node; } currentSourceFile = node; - currentFileState = {}; - currentFileState.importSpecifier = ts.getJSXImplicitImportBase(compilerOptions, node); var visited = ts.visitEachChild(node, visitor, context); ts.addEmitHelpers(visited, context.readEmitHelpers()); - var statements = visited.statements; - if (currentFileState.filenameDeclaration) { - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([currentFileState.filenameDeclaration], 2 /* Const */))); - } - if (currentFileState.utilizedImplicitRuntimeImports) { - for (var _i = 0, _a = ts.arrayFrom(currentFileState.utilizedImplicitRuntimeImports.entries()); _i < _a.length; _i++) { - var _b = _a[_i], importSource = _b[0], importSpecifiersMap = _b[1]; - if (ts.isExternalModule(node)) { - // Add `import` statement - var importStatement = factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, factory.createImportClause(/*typeOnly*/ false, /*name*/ undefined, factory.createNamedImports(ts.arrayFrom(importSpecifiersMap.values()))), factory.createStringLiteral(importSource)); - ts.setParentRecursive(importStatement, /*incremental*/ false); - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), importStatement); - } - else if (ts.isExternalOrCommonJsModule(node)) { - // Add `require` statement - var requireStatement = factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([ - factory.createVariableDeclaration(factory.createObjectBindingPattern(ts.map(ts.arrayFrom(importSpecifiersMap.values()), function (s) { return factory.createBindingElement(/*dotdotdot*/ undefined, s.propertyName, s.name); })), - /*exclaimationToken*/ undefined, - /*type*/ undefined, factory.createCallExpression(factory.createIdentifier("require"), /*typeArguments*/ undefined, [factory.createStringLiteral(importSource)])) - ], 2 /* Const */)); - ts.setParentRecursive(requireStatement, /*incremental*/ false); - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), requireStatement); - } - else { - // Do nothing (script file) - consider an error in the checker? - } - } - } - if (statements !== visited.statements) { - visited = factory.updateSourceFile(visited, statements); - } - currentFileState = undefined; return visited; } function visitor(node) { @@ -87609,13 +85462,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -87625,122 +85478,28 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitJsxExpression(node); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); } } - /** - * The react jsx/jsxs transform falls back to `createElement` when an explicit `key` argument comes after a spread - */ - function hasKeyAfterPropsSpread(node) { - var spread = false; - for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { - var elem = _a[_i]; - if (ts.isJsxSpreadAttribute(elem)) { - spread = true; - } - else if (spread && ts.isJsxAttribute(elem) && elem.name.escapedText === "key") { - return true; - } - } - return false; - } - function shouldUseCreateElement(node) { - return currentFileState.importSpecifier === undefined || hasKeyAfterPropsSpread(node); - } function visitJsxElement(node, isChild) { - var tagTransform = shouldUseCreateElement(node.openingElement) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform(node.openingElement, node.children, isChild, /*location*/ node); + return visitJsxOpeningLikeElement(node.openingElement, node.children, isChild, /*location*/ node); } function visitJsxSelfClosingElement(node, isChild) { - var tagTransform = shouldUseCreateElement(node) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform(node, /*children*/ undefined, isChild, /*location*/ node); + return visitJsxOpeningLikeElement(node, /*children*/ undefined, isChild, /*location*/ node); } function visitJsxFragment(node, isChild) { - var tagTransform = currentFileState.importSpecifier === undefined ? visitJsxOpeningFragmentCreateElement : visitJsxOpeningFragmentJSX; - return tagTransform(node.openingFragment, node.children, isChild, /*location*/ node); + return visitJsxOpeningFragment(node.openingFragment, node.children, isChild, /*location*/ node); } - function convertJsxChildrenToChildrenPropObject(children) { - var nonWhitespaceChildren = ts.getSemanticJsxChildren(children); - if (ts.length(nonWhitespaceChildren) === 1) { - var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]); - return result_13 && factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("children", result_13) - ]); - } - var result = ts.mapDefined(children, transformJsxChildToExpression); - return !result.length ? undefined : factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) - ]); - } - function visitJsxOpeningLikeElementJSX(node, children, isChild, location) { - var tagName = getTagName(node); - var objectProperties; - var keyAttr = ts.find(node.attributes.properties, function (p) { return !!p.name && ts.isIdentifier(p.name) && p.name.escapedText === "key"; }); - var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties; - var segments = []; - if (attrs.length) { - // Map spans of JsxAttribute nodes into object literals and spans - // of JsxSpreadAttribute nodes into expressions. - segments = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread - ? ts.map(attrs, transformJsxSpreadAttributeToExpression) - : factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); })); - if (ts.isJsxSpreadAttribute(attrs[0])) { - // We must always emit at least one object literal before a spread - // argument.factory.createObjectLiteral - segments.unshift(factory.createObjectLiteralExpression()); - } - } - if (children && children.length) { - var result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - segments.push(result); - } - } - if (segments.length === 0) { - objectProperties = factory.createObjectLiteralExpression([]); - // When there are no attributes, React wants {} - } - else { - // Either emit one big object literal (no spread attribs), or - // a call to the __assign helper. - objectProperties = ts.singleOrUndefined(segments) || emitHelpers().createAssignHelper(segments); - } - return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, ts.length(ts.getSemanticJsxChildren(children || ts.emptyArray)), isChild, location); - } - function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, childrenLength, isChild, location) { - var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)]; - if (compilerOptions.jsx === 5 /* ReactJSXDev */) { - var originalFile = ts.getOriginalNode(currentSourceFile); - if (originalFile && ts.isSourceFile(originalFile)) { - // isStaticChildren development flag - args.push(childrenLength > 1 ? factory.createTrue() : factory.createFalse()); - // __source development flag - var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos); - args.push(factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("fileName", getCurrentFileNameExpression()), - factory.createPropertyAssignment("lineNumber", factory.createNumericLiteral(lineCol.line + 1)), - factory.createPropertyAssignment("columnNumber", factory.createNumericLiteral(lineCol.character + 1)) - ])); - // __self development flag - args.push(factory.createThis()); - } - } - var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(childrenLength), /*typeArguments*/ undefined, args), location); - if (isChild) { - ts.startOnNewLine(element); - } - return element; - } - function visitJsxOpeningLikeElementCreateElement(node, children, isChild, location) { + function visitJsxOpeningLikeElement(node, children, isChild, location) { var tagName = getTagName(node); var objectProperties; var attrs = node.attributes.properties; @@ -87766,28 +85525,14 @@ var ts; objectProperties = emitHelpers().createAssignHelper(segments); } } - var callee = currentFileState.importSpecifier === undefined - ? ts.createJsxFactoryExpression(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 - node) - : getImplicitImportForName("createElement"); - var element = ts.createExpressionForJsxElement(factory, callee, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), location); + var element = ts.createExpressionForJsxElement(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 + tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } return element; } - function visitJsxOpeningFragmentJSX(_node, children, isChild, location) { - var childrenProps; - if (children && children.length) { - var result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - childrenProps = result; - } - } - return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]), - /*keyAttr*/ undefined, ts.length(ts.getSemanticJsxChildren(children)), isChild, location); - } - function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) { + function visitJsxOpeningFragment(node, children, isChild, location) { var element = ts.createExpressionForJsxFragment(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { @@ -87814,7 +85559,7 @@ var ts; var literal = factory.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote); return ts.setTextRange(literal, node); } - else if (node.kind === 283 /* JsxExpression */) { + else if (node.kind === 280 /* JsxExpression */) { if (node.expression === undefined) { return factory.createTrue(); } @@ -87908,7 +85653,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 273 /* JsxElement */) { + if (node.kind === 270 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -88214,7 +85959,7 @@ var ts; return node; } switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -88427,7 +86172,7 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 242 /* ReturnStatement */ + && node.kind === 239 /* ReturnStatement */ && !node.expression; } function isOrMayContainReturnCompletion(node) { @@ -88453,10 +86198,12 @@ var ts; || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } function visitor(node) { - return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ false) : node; - } - function visitorWithUnusedExpressionResult(node) { - return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ true) : node; + if (shouldVisitNode(node)) { + return visitJavaScript(node); + } + else { + return node; + } } function callExpressionVisitor(node) { if (node.kind === 105 /* SuperKeyword */) { @@ -88464,70 +86211,68 @@ var ts; } return visitor(node); } - function visitorWorker(node, expressionResultIsUnused) { + function visitJavaScript(node) { switch (node.kind) { case 123 /* StaticKeyword */: return undefined; // elide static keyword - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return visitClassExpression(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitParameter(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return visitArrowFunction(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); case 78 /* Identifier */: return visitIdentifier(node); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitCaseBlock(node); - case 230 /* Block */: + case 227 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); - case 207 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, expressionResultIsUnused); - case 216 /* BinaryExpression */: - return visitBinaryExpression(node, expressionResultIsUnused); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node, expressionResultIsUnused); + case 204 /* ParenthesizedExpression */: + return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); + case 213 /* BinaryExpression */: + return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: case 16 /* TemplateMiddle */: @@ -88537,31 +86282,29 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return visitTemplateExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return visitSpreadElement(node); case 105 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 107 /* ThisKeyword */: return visitThisKeyword(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return visitMetaProperty(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return visitAccessorDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); - case 212 /* VoidExpression */: - return visitVoidExpression(node); default: return ts.visitEachChild(node, visitor, context); } @@ -88632,9 +86375,6 @@ var ts; } return node; } - function visitVoidExpression(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } function visitIdentifier(node) { if (!convertedLoopState) { return node; @@ -88650,14 +86390,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 241 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 238 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 241 /* BreakStatement */) { + if (node.kind === 238 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -88668,7 +86408,7 @@ var ts; } } else { - if (node.kind === 241 /* BreakStatement */) { + if (node.kind === 238 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -88820,17 +86560,16 @@ var ts; */ function transformClassBody(node, extendsClauseElement) { var statements = []; - var name = factory.getInternalName(node); - var constructorLikeName = ts.isIdentifierANonContextualKeyword(name) ? factory.getGeneratedNameForNode(name) : name; startLexicalEnvironment(); addExtendsHelperIfNeeded(statements, node, extendsClauseElement); - addConstructor(statements, node, constructorLikeName, extendsClauseElement); + addConstructor(statements, node, extendsClauseElement); addClassMembers(statements, node); // Create a synthetic text range for the return statement. var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 19 /* CloseBraceToken */); + var localName = factory.getInternalName(node); // The following partially-emitted expression exists purely to align our sourcemap // emit with the original emitter. - var outer = factory.createPartiallyEmittedExpression(constructorLikeName); + var outer = factory.createPartiallyEmittedExpression(localName); ts.setTextRangeEnd(outer, closingBraceLocation.end); ts.setEmitFlags(outer, 1536 /* NoComments */); var statement = factory.createReturnStatement(outer); @@ -88862,7 +86601,7 @@ var ts; * @param node The ClassExpression or ClassDeclaration node. * @param extendsClauseElement The expression for the class `extends` clause. */ - function addConstructor(statements, node, name, extendsClauseElement) { + function addConstructor(statements, node, extendsClauseElement) { var savedConvertedLoopState = convertedLoopState; convertedLoopState = undefined; var ancestorFacts = enterSubtree(16278 /* ConstructorExcludes */, 73 /* ConstructorIncludes */); @@ -88871,7 +86610,7 @@ var ts; var constructorFunction = factory.createFunctionDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*asteriskToken*/ undefined, name, + /*asteriskToken*/ undefined, factory.getInternalName(node), /*typeParameters*/ undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper)); ts.setTextRange(constructorFunction, constructor || node); @@ -89066,11 +86805,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 242 /* ReturnStatement */) { + if (statement.kind === 239 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 234 /* IfStatement */) { + else if (statement.kind === 231 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -89078,7 +86817,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 230 /* Block */) { + else if (statement.kind === 227 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -89280,7 +87019,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 209 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 206 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, factory.createThis()); return true; } @@ -89302,22 +87041,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return statements; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = factory.createVoidZero(); break; - case 166 /* Constructor */: + case 165 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = factory.createPropertyAccessExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = factory.createConditionalExpression(factory.createLogicalAnd(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), factory.createBinaryExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), 101 /* InstanceOfKeyword */, factory.getLocalName(node))), @@ -89352,20 +87091,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 166 /* Constructor */: + case 165 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -89568,7 +87307,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */)) { name = factory.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -89614,7 +87353,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 209 /* ArrowFunction */); + ts.Debug.assert(node.kind === 206 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -89680,55 +87419,51 @@ var ts; * @param node An ExpressionStatement node. */ function visitExpressionStatement(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + // If we are here it is most likely because our expression is a destructuring assignment. + switch (node.expression.kind) { + case 204 /* ParenthesizedExpression */: + return factory.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); + case 213 /* BinaryExpression */: + return factory.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); + } + return ts.visitEachChild(node, visitor, context); } /** * Visits a ParenthesizedExpression that may contain a destructuring assignment. * * @param node A ParenthesizedExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). + * @param needsDestructuringValue A value indicating whether we need to hold onto the rhs + * of a destructuring assignment. */ - function visitParenthesizedExpression(node, expressionResultIsUnused) { - return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context); + function visitParenthesizedExpression(node, needsDestructuringValue) { + // If we are here it is most likely because our expression is a destructuring assignment. + if (!needsDestructuringValue) { + // By default we always emit the RHS at the end of a flattened destructuring + // expression. If we are in a state where we do not need the destructuring value, + // we pass that information along to the children that care about it. + switch (node.expression.kind) { + case 204 /* ParenthesizedExpression */: + return factory.updateParenthesizedExpression(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); + case 213 /* BinaryExpression */: + return factory.updateParenthesizedExpression(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); + } + } + return ts.visitEachChild(node, visitor, context); } /** * Visits a BinaryExpression that contains a destructuring assignment. * * @param node A BinaryExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). + * @param needsDestructuringValue A value indicating whether we need to hold onto the rhs + * of a destructuring assignment. */ - function visitBinaryExpression(node, expressionResultIsUnused) { + function visitBinaryExpression(node, needsDestructuringValue) { // If we are here it is because this is a destructuring assignment. if (ts.isDestructuringAssignment(node)) { - return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, !expressionResultIsUnused); - } - if (node.operatorToken.kind === 27 /* CommaToken */) { - return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression)); + return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, needsDestructuringValue); } return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitCommaListExpression(node, expressionResultIsUnused) { - if (expressionResultIsUnused) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - var result; - for (var i = 0; i < node.elements.length; i++) { - var element = node.elements[i]; - var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - result.push(visited); - } - } - var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements; - return factory.updateCommaListExpression(node, elements); - } function isVariableStatementOfTypeScriptClassWrapper(node) { return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer @@ -89921,14 +87656,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -89944,9 +87679,6 @@ var ts; function visitForStatement(node, outermostLabeledStatement) { return visitIterationStatementWithFacts(5056 /* ForStatementExcludes */, 3328 /* ForStatementIncludes */, node, outermostLabeledStatement); } - function visitEachChildOfForStatement(node) { - return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - } function visitForInStatement(node, outermostLabeledStatement) { return visitIterationStatementWithFacts(3008 /* ForInOrForOfStatementExcludes */, 5376 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement); } @@ -89989,7 +87721,7 @@ var ts; // evaluated on every iteration. var assignment = factory.createAssignment(initializer, boundValue); if (ts.isDestructuringAssignment(assignment)) { - statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*expressionResultIsUnused*/ true))); + statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*needsDestructuringValue*/ false))); } else { ts.setTextRangeEnd(assignment, initializer.end); @@ -90114,7 +87846,7 @@ var ts; var property = properties[i]; if ((property.transformFlags & 262144 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */) - || (hasComputed = ts.Debug.checkDefined(property.name).kind === 158 /* ComputedPropertyName */)) { + || (hasComputed = ts.Debug.checkDefined(property.name).kind === 157 /* ComputedPropertyName */)) { numInitialProperties = i; break; } @@ -90190,7 +87922,7 @@ var ts; } var result = convert ? convert(node, outermostLabeledStatement, /*convertedLoopBodyStatements*/ undefined, ancestorFacts) - : factory.restoreEnclosingLabel(ts.isForStatement(node) ? visitEachChildOfForStatement(node) : ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); + : factory.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); if (convertedLoopState) { convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; } @@ -90230,18 +87962,18 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 237 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 238 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 239 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 235 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 236 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 234 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 235 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 236 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 232 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 233 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } function convertForStatement(node, initializerFunction, convertedLoopBody) { var shouldConvertCondition = node.condition && shouldConvertPartOfIterationStatement(node.condition); var shouldConvertIncrementor = shouldConvertCondition || node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); - return factory.updateForStatement(node, ts.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(shouldConvertCondition ? undefined : node.condition, visitor, ts.isExpression), ts.visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), convertedLoopBody); + return factory.updateForStatement(node, ts.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitor, ts.isForInitializer), ts.visitNode(shouldConvertCondition ? undefined : node.condition, visitor, ts.isExpression), ts.visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitor, ts.isExpression), convertedLoopBody); } function convertForOfStatement(node, convertedLoopBody) { return factory.updateForOfStatement(node, @@ -90259,11 +87991,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 250 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 247 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -90671,20 +88403,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -90791,7 +88523,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { updated = factory.updateGetAccessorDeclaration(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -91283,13 +89015,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(107 /* ThisKeyword */); - context.enableEmitNotification(166 /* Constructor */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(209 /* ArrowFunction */); - context.enableEmitNotification(208 /* FunctionExpression */); - context.enableEmitNotification(251 /* FunctionDeclaration */); + context.enableEmitNotification(165 /* Constructor */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(206 /* ArrowFunction */); + context.enableEmitNotification(205 /* FunctionExpression */); + context.enableEmitNotification(248 /* FunctionDeclaration */); } } /** @@ -91330,10 +89062,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 246 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -91415,11 +89147,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 233 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 230 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 203 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 200 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -91427,7 +89159,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 220 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 217 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -91453,15 +89185,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(275 /* JsxOpeningElement */); - context.enableEmitNotification(276 /* JsxClosingElement */); - context.enableEmitNotification(274 /* JsxSelfClosingElement */); + context.enableEmitNotification(272 /* JsxOpeningElement */); + context.enableEmitNotification(273 /* JsxClosingElement */); + context.enableEmitNotification(271 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(288 /* PropertyAssignment */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(285 /* PropertyAssignment */); return ts.chainBundle(context, transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -91480,9 +89212,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 275 /* JsxOpeningElement */: - case 276 /* JsxClosingElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 273 /* JsxClosingElement */: + case 271 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -91817,13 +89549,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitWhileStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -91836,24 +89568,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return visitAccessorDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return visitBreakStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return visitContinueStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -91874,23 +89606,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return visitConditionalExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -91903,9 +89633,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -92113,7 +89843,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -92125,7 +89855,7 @@ var ts; // _a.b = %sent%; target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -92172,61 +89902,6 @@ var ts; } return ts.visitEachChild(node, visitor, context); } - /** - * Visits a comma expression containing `yield`. - * - * @param node The node to visit. - */ - function visitCommaExpression(node) { - // [source] - // x = a(), yield, b(); - // - // [intermediate] - // a(); - // .yield resumeLabel - // .mark resumeLabel - // x = %sent%, b(); - var pendingExpressions = []; - visit(node.left); - visit(node.right); - return factory.inlineExpressions(pendingExpressions); - function visit(node) { - if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { - visit(node.left); - visit(node.right); - } - else { - if (containsYield(node) && pendingExpressions.length > 0) { - emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); - pendingExpressions = []; - } - pendingExpressions.push(ts.visitNode(node, visitor, ts.isExpression)); - } - } - } - /** - * Visits a comma-list expression. - * - * @param node The node to visit. - */ - function visitCommaListExpression(node) { - // flattened version of `visitCommaExpression` - var pendingExpressions = []; - for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { - var elem = _a[_i]; - if (ts.isBinaryExpression(elem) && elem.operatorToken.kind === 27 /* CommaToken */) { - pendingExpressions.push(visitCommaExpression(elem)); - } - else { - if (containsYield(elem) && pendingExpressions.length > 0) { - emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); - pendingExpressions = []; - } - pendingExpressions.push(ts.visitNode(elem, visitor, ts.isExpression)); - } - } - return factory.inlineExpressions(pendingExpressions); - } /** * Visits a logical binary expression containing `yield`. * @@ -92276,6 +89951,38 @@ var ts; markLabel(resultLabel); return resultLocal; } + /** + * Visits a comma expression containing `yield`. + * + * @param node The node to visit. + */ + function visitCommaExpression(node) { + // [source] + // x = a(), yield, b(); + // + // [intermediate] + // a(); + // .yield resumeLabel + // .mark resumeLabel + // x = %sent%, b(); + var pendingExpressions = []; + visit(node.left); + visit(node.right); + return factory.inlineExpressions(pendingExpressions); + function visit(node) { + if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { + visit(node.left); + visit(node.right); + } + else { + if (containsYield(node) && pendingExpressions.length > 0) { + emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); + pendingExpressions = []; + } + pendingExpressions.push(ts.visitNode(node, visitor, ts.isExpression)); + } + } + } /** * Visits a conditional expression containing `yield`. * @@ -92519,35 +90226,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 230 /* Block */: + case 227 /* Block */: return transformAndEmitBlock(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return transformAndEmitIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return transformAndEmitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return transformAndEmitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return transformAndEmitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -92977,7 +90684,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 285 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 282 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -92990,7 +90697,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -94151,11 +91858,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(213 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(211 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(212 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(294 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -94206,10 +91913,7 @@ var ts; ts.append(statements, createUnderscoreUnderscoreESModule()); } if (ts.length(currentModuleInfo.exportedNames)) { - var chunkSize = 50; - for (var i = 0; i < currentModuleInfo.exportedNames.length; i += chunkSize) { - ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames.slice(i, i + chunkSize), function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero()))); - } + ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames, function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero()))); } ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); @@ -94483,23 +92187,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 338 /* MergeDeclarationMarker */: + case 333 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 339 /* EndOfDeclarationMarker */: + case 334 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -94526,24 +92230,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -94878,11 +92582,9 @@ var ts; else if (node.exportClause) { var statements = []; // export * as ns from "mod"; - // export * as default from "mod"; statements.push(ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(createExportExpression(factory.cloneNode(node.exportClause.name), getHelperExpressionForExport(node, moduleKind !== ts.ModuleKind.AMD ? createRequireCall(node) : - ts.isExportNamespaceAsDefaultDeclaration(node) ? generatedName : - factory.createIdentifier(ts.idText(node.exportClause.name))))), node), node)); + factory.createIdentifier(ts.idText(node.exportClause.name))))), node), node)); return ts.singleOrMany(statements); } else { @@ -94975,7 +92677,6 @@ var ts; var expressions; if (ts.hasSyntacticModifier(node, 1 /* Export */)) { var modifiers = void 0; - var removeCommentsOnExpressions = false; // If we're exporting these variables, then these just become assignments to 'exports.x'. for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var variable = _a[_i]; @@ -94986,28 +92687,14 @@ var ts; variables = ts.append(variables, variable); } else if (variable.initializer) { - if (!ts.isBindingPattern(variable.name) && (ts.isArrowFunction(variable.initializer) || ts.isFunctionExpression(variable.initializer) || ts.isClassExpression(variable.initializer))) { - var expression = factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), variable.name), - /*location*/ variable.name), factory.createIdentifier(ts.getTextOfIdentifierOrLiteral(variable.name))); - var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, moduleExpressionElementVisitor)); - variables = ts.append(variables, updatedVariable); - expressions = ts.append(expressions, expression); - removeCommentsOnExpressions = true; - } - else { - expressions = ts.append(expressions, transformInitializedVariable(variable)); - } + expressions = ts.append(expressions, transformInitializedVariable(variable)); } } if (variables) { statements = ts.append(statements, factory.updateVariableStatement(node, modifiers, factory.updateVariableDeclarationList(node.declarationList, variables))); } if (expressions) { - var statement = ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node); - if (removeCommentsOnExpressions) { - ts.removeAllComments(statement); - } - statements = ts.append(statements, statement); + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node)); } } else { @@ -95068,7 +92755,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 229 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -95123,10 +92810,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -95339,7 +93026,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -95403,10 +93090,10 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return substituteBinaryExpression(node); - case 215 /* PostfixUnaryExpression */: - case 214 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -95425,9 +93112,9 @@ var ts; } return node; } - if (!(ts.isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !ts.isLocalName(node)) { + if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 297 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 294 /* SourceFile */) { return ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.cloneNode(node)), /*location*/ node); } @@ -95502,7 +93189,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 215 /* PostfixUnaryExpression */ + var expression = node.kind === 212 /* PostfixUnaryExpression */ ? ts.setTextRange(factory.createBinaryExpression(node.operand, factory.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), factory.createNumericLiteral(1)), /*location*/ node) : node; @@ -95554,12 +93241,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(226 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(213 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(211 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(212 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(223 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(294 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -95783,7 +93470,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 267 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 264 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -95873,19 +93560,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(factory, entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(factory.createExpressionStatement(factory.createAssignment(importVariableName, parameterName))); break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -95944,13 +93631,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -96130,7 +93817,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 297 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 294 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -96194,7 +93881,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 229 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasSyntacticModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -96256,10 +93943,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -96439,43 +94126,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitWhileStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return visitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitCaseBlock(node); - case 284 /* CaseClause */: + case 281 /* CaseClause */: return visitCaseClause(node); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return visitDefaultClause(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return visitTryStatement(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); - case 230 /* Block */: + case 227 /* Block */: return visitBlock(node); - case 338 /* MergeDeclarationMarker */: + case 333 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 339 /* EndOfDeclarationMarker */: + case 334 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -96722,7 +94409,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 297 /* SourceFile */; + return container !== undefined && container.kind === 294 /* SourceFile */; } else { return false; @@ -96755,7 +94442,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -96805,7 +94492,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -96841,12 +94528,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return substituteBinaryExpression(node); - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -96939,14 +94626,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 215 /* PostfixUnaryExpression */ + var expression = node.kind === 212 /* PostfixUnaryExpression */ ? ts.setTextRange(factory.createPrefixUnaryExpression(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 215 /* PostfixUnaryExpression */) { + if (node.kind === 212 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? factory.createSubtract(preventSubstitution(expression), factory.createNumericLiteral(1)) : factory.createAdd(preventSubstitution(expression), factory.createNumericLiteral(1)); @@ -96974,7 +94661,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 297 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 294 /* SourceFile */) { exportedNames = ts.append(exportedNames, factory.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -97014,7 +94701,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(297 /* SourceFile */); + context.enableEmitNotification(294 /* SourceFile */); context.enableSubstitution(78 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(context, transformSourceFile); @@ -97046,12 +94733,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -97078,7 +94765,7 @@ var ts; /*isTypeOnly*/ false, /*name*/ undefined, factory.createNamespaceImport(synthName)), node.moduleSpecifier); ts.setOriginalNode(importDecl, node.exportClause); - var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration( + var exportDecl = factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, factory.createNamedExports([factory.createExportSpecifier(synthName, oldIdentifier)])); @@ -97185,7 +94872,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97214,7 +94901,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97261,7 +94948,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97270,8 +94957,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 163 /* PropertyDeclaration */ || node.kind === 201 /* PropertyAccessExpression */ || node.kind === 162 /* PropertySignature */ || - (node.kind === 160 /* Parameter */ && ts.hasSyntacticModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 162 /* PropertyDeclaration */ || node.kind === 198 /* PropertyAccessExpression */ || node.kind === 161 /* PropertySignature */ || + (node.kind === 159 /* Parameter */ && ts.hasSyntacticModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasSyntacticModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -97280,7 +94967,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */ || node.kind === 160 /* Parameter */) { + else if (node.parent.kind === 249 /* ClassDeclaration */ || node.kind === 159 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97305,7 +94992,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 168 /* SetAccessor */) { + if (node.kind === 167 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasSyntacticModifier(node, 32 /* Static */)) { @@ -97344,26 +95031,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -97371,7 +95058,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -97385,7 +95072,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -97410,30 +95097,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 170 /* ConstructSignature */: - case 175 /* ConstructorType */: + case 169 /* ConstructSignature */: + case 174 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 169 /* CallSignature */: + case 168 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -97441,7 +95128,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97454,15 +95141,15 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 251 /* FunctionDeclaration */: - case 174 /* FunctionType */: + case 248 /* FunctionDeclaration */: + case 173 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 168 /* SetAccessor */: - case 167 /* GetAccessor */: + case 167 /* SetAccessor */: + case 166 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97476,39 +95163,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 190 /* MappedType */: + case 189 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 249 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174 /* FunctionType */: - case 251 /* FunctionDeclaration */: + case 173 /* FunctionType */: + case 248 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -97572,7 +95259,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 160 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 159 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -97627,7 +95314,6 @@ var ts; reportCyclicStructureError: reportCyclicStructureError, reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression, reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError, - reportTruncationError: reportTruncationError, moduleResolverHost: host, trackReferencedAmbientModule: trackReferencedAmbientModule, trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode, @@ -97727,11 +95413,6 @@ var ts; context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier)); } } - function reportTruncationError() { - if (errorNameNode) { - context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed)); - } - } function reportNonlocalAugmentation(containingFile, parentSymbol, symbol) { var primaryDeclaration = ts.find(parentSymbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === containingFile; }); var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; }); @@ -97753,10 +95434,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 297 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 294 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 298 /* Bundle */) { + if (node.kind === 295 /* Bundle */) { isBundledEmit = true; refs = new ts.Map(); libs = new ts.Map(); @@ -97786,7 +95467,7 @@ var ts; var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return factory.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 300 /* InputFiles */) { + if (prepend.kind === 297 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -97927,7 +95608,7 @@ var ts; return name; } else { - if (name.kind === 197 /* ArrayBindingPattern */) { + if (name.kind === 194 /* ArrayBindingPattern */) { return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -97935,7 +95616,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 222 /* OmittedExpression */) { + if (elem.kind === 219 /* OmittedExpression */) { return elem; } return factory.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -97973,7 +95654,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 160 /* Parameter */ && + var shouldUseResolverType = node.kind === 159 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -97982,7 +95663,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : factory.createKeywordTypeNode(128 /* AnyKeyword */); } - if (node.kind === 168 /* SetAccessor */) { + if (node.kind === 167 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return factory.createKeywordTypeNode(128 /* AnyKeyword */); @@ -97993,12 +95674,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 160 /* Parameter */ - || node.kind === 163 /* PropertyDeclaration */ - || node.kind === 162 /* PropertySignature */) { + if (node.kind === 159 /* Parameter */ + || node.kind === 162 /* PropertyDeclaration */ + || node.kind === 161 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -98015,20 +95696,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: return false; } return false; @@ -98109,7 +95790,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 256 /* ModuleDeclaration */ && parent.kind !== 195 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 253 /* ModuleDeclaration */ && parent.kind !== 192 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -98129,7 +95810,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 272 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 269 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return factory.updateImportEqualsDeclaration(decl, @@ -98156,7 +95837,7 @@ var ts; return visibleDefaultBinding && factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, /*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 260 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -98251,7 +95932,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 177 /* TypeLiteral */ || input.kind === 190 /* MappedType */) && input.parent.kind !== 254 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 176 /* TypeLiteral */ || input.kind === 189 /* MappedType */) && input.parent.kind !== 251 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasEffectiveModifier(input, 8 /* Private */)) { @@ -98272,21 +95953,21 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 223 /* ExpressionWithTypeArguments */: { + case 220 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments)); } - case 173 /* TypeReference */: { + case 172 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory.updateTypeReferenceNode(node, node.typeName, node.typeArguments)); } - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return cleanup(factory.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 166 /* Constructor */: { + case 165 /* Constructor */: { // A constructor declaration may not have a type annotation var ctor = factory.createConstructorDeclaration( /*decorators*/ undefined, @@ -98294,7 +95975,7 @@ var ts; /*body*/ undefined); return cleanup(ctor); } - case 165 /* MethodDeclaration */: { + case 164 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98304,7 +95985,7 @@ var ts; /*body*/ undefined); return cleanup(sig); } - case 167 /* GetAccessor */: { + case 166 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98313,7 +95994,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 168 /* SetAccessor */: { + case 167 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98321,31 +96002,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updatePropertyDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type))); - case 164 /* MethodSignature */: { + case 163 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updateMethodSignature(input, ensureModifiers(input), input.name, input.questionToken, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 169 /* CallSignature */: { + case 168 /* CallSignature */: { return cleanup(factory.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 171 /* IndexSignature */: { + case 170 /* IndexSignature */: { return cleanup(factory.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || factory.createKeywordTypeNode(128 /* AnyKeyword */))); } - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -98353,13 +96034,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(factory.updateVariableDeclaration(input, input.name, /*exclamationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 159 /* TypeParameter */: { + case 158 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(factory.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 184 /* ConditionalType */: { + case 183 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -98371,13 +96052,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(factory.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 174 /* FunctionType */: { + case 173 /* FunctionType */: { return cleanup(factory.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 175 /* ConstructorType */: { + case 174 /* ConstructorType */: { return cleanup(factory.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 195 /* ImportType */: { + case 192 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -98409,7 +96090,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 165 /* MethodDeclaration */ && ts.hasEffectiveModifier(node.parent, 8 /* Private */); + return node.parent.kind === 164 /* MethodDeclaration */ && ts.hasEffectiveModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -98419,7 +96100,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 267 /* ExportDeclaration */: { + case 264 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -98429,7 +96110,7 @@ var ts; return factory.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier)); } - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -98468,10 +96149,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 260 /* ImportEqualsDeclaration */: { + case 257 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 261 /* ImportDeclaration */: { + case 258 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -98492,14 +96173,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 254 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 251 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(factory.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 253 /* InterfaceDeclaration */: { + case 250 /* InterfaceDeclaration */: { return cleanup(factory.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 251 /* FunctionDeclaration */: { + case 248 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(factory.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -98566,10 +96247,10 @@ var ts; return clean; } } - case 256 /* ModuleDeclaration */: { + case 253 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 257 /* ModuleBlock */) { + if (inner && inner.kind === 254 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -98612,7 +96293,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 252 /* ClassDeclaration */: { + case 249 /* ClassDeclaration */: { var modifiers = factory.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -98693,10 +96374,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 232 /* VariableStatement */: { + case 229 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 255 /* EnumDeclaration */: { + case 252 /* EnumDeclaration */: { return cleanup(factory.updateEnumDeclaration(input, /*decorators*/ undefined, factory.createNodeArray(ensureModifiers(input)), input.name, factory.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -98715,7 +96396,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 256 /* ModuleDeclaration */) { + if (input.kind === 253 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -98736,7 +96417,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 222 /* OmittedExpression */) { + if (e.kind === 219 /* OmittedExpression */) { return; } if (e.name) { @@ -98786,7 +96467,7 @@ var ts; function ensureModifierFlags(node) { var mask = 11263 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 297 /* SourceFile */; + var parentIsFile = node.parent.kind === 294 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -98815,7 +96496,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 253 /* InterfaceDeclaration */) { + if (node.kind === 250 /* InterfaceDeclaration */) { return true; } return false; @@ -98840,7 +96521,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 167 /* GetAccessor */ + return accessor.kind === 166 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -98849,52 +96530,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return !ts.hasEffectiveModifier(node, 8 /* Private */); - case 160 /* Parameter */: - case 249 /* VariableDeclaration */: + case 159 /* Parameter */: + case 246 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 232 /* VariableStatement */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 229 /* VariableStatement */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 170 /* ConstructSignature */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 171 /* IndexSignature */: - case 249 /* VariableDeclaration */: - case 159 /* TypeParameter */: - case 223 /* ExpressionWithTypeArguments */: - case 173 /* TypeReference */: - case 184 /* ConditionalType */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 195 /* ImportType */: + case 169 /* ConstructSignature */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 170 /* IndexSignature */: + case 246 /* VariableDeclaration */: + case 158 /* TypeParameter */: + case 220 /* ExpressionWithTypeArguments */: + case 172 /* TypeReference */: + case 183 /* ConditionalType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 192 /* ImportType */: return true; } return false; @@ -98938,13 +96619,14 @@ var ts; function getScriptTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles) { if (emitOnlyDtsFiles) return ts.emptyArray; + var jsx = compilerOptions.jsx; var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var transformers = []; ts.addRange(transformers, customTransformers && ts.map(customTransformers.before, wrapScriptTransformerFactory)); transformers.push(ts.transformTypeScript); transformers.push(ts.transformClassFields); - if (ts.getJSXTransformEnabled(compilerOptions)) { + if (jsx === 2 /* React */) { transformers.push(ts.transformJsx); } if (languageVersion < 99 /* ESNext */) { @@ -99026,7 +96708,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, factory, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(341 /* Count */); + var enabledSyntaxKindFeatures = new Array(336 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentStatements; @@ -99099,13 +96781,7 @@ var ts; // prevent modification of transformation hooks. state = 1 /* Initialized */; // Transform each node. - var transformed = []; - for (var _a = 0, nodes_3 = nodes; _a < nodes_3.length; _a++) { - var node = nodes_3[_a]; - ts.tracing.push("emit" /* Emit */, "transformNodes", node.kind === 297 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); - transformed.push((allowDtsFiles ? transformation : transformRoot)(node)); - ts.tracing.pop(); - } + var transformed = ts.map(nodes, allowDtsFiles ? transformation : transformRoot); // prevent modification of the lexical environment. state = 2 /* Completed */; ts.performance.mark("afterTransform"); @@ -99341,8 +97017,8 @@ var ts; function dispose() { if (state < 3 /* Disposed */) { // Clean up emit nodes on parse tree - for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { - var node = nodes_4[_i]; + for (var _i = 0, nodes_3 = nodes; _i < nodes_3.length; _i++) { + var node = nodes_3[_i]; ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); } // Release references to external entries for GC purposes. @@ -99474,7 +97150,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 298 /* Bundle */) { + if (sourceFile.kind === 295 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -99670,15 +97346,9 @@ var ts; sourceFiles: sourceFileOrBundle.sourceFiles.map(function (file) { return relativeToBuildInfo(ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory())); }) }; } - ts.tracing.push("emit" /* Emit */, "emitJsFileOrBundle", { jsFilePath: jsFilePath }); emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo); - ts.tracing.pop(); - ts.tracing.push("emit" /* Emit */, "emitDeclarationFileOrBundle", { declarationFilePath: declarationFilePath }); emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo); - ts.tracing.pop(); - ts.tracing.push("emit" /* Emit */, "emitBuildInfo", { buildInfoPath: buildInfoPath }); emitBuildInfo(bundleBuildInfo, buildInfoPath); - ts.tracing.pop(); if (!emitSkipped && emittedFilesList) { if (!emitOnlyDtsFiles) { if (jsFilePath) { @@ -99810,7 +97480,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 297 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 294 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -99833,8 +97503,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 298 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 297 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 295 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 294 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -99875,7 +97545,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 297 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 294 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -99919,16 +97589,16 @@ var ts; if (ts.getRootLength(sourceMapDir) === 0) { // The relative paths are relative to the common directory sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - return encodeURI(ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath + return ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath ts.combinePaths(sourceMapDir, sourceMapFile), // this is where user expects to see sourceMap host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ true)); + /*isAbsolutePathAnUrl*/ true); } else { - return encodeURI(ts.combinePaths(sourceMapDir, sourceMapFile)); + return ts.combinePaths(sourceMapDir, sourceMapFile); } } - return encodeURI(sourceMapFile); + return sourceMapFile; } } ts.emitFiles = emitFiles; @@ -100143,8 +97813,6 @@ var ts; var sourceMapGenerator; var sourceMapSource; var sourceMapSourceIndex = -1; - var mostRecentlyAddedSourceMapSource; - var mostRecentlyAddedSourceMapSourceIndex = -1; // Comments var containerPos = -1; var containerEnd = -1; @@ -100183,9 +97851,9 @@ var ts; break; } switch (node.kind) { - case 297 /* SourceFile */: return printFile(node); - case 298 /* Bundle */: return printBundle(node); - case 299 /* UnparsedSource */: return printUnparsedSource(node); + case 294 /* SourceFile */: return printFile(node); + case 295 /* Bundle */: return printBundle(node); + case 296 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -100441,12 +98109,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 297 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 294 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 297 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 294 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -100488,15 +98156,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 299 /* UnparsedSource */: - case 293 /* UnparsedPrepend */: + case 296 /* UnparsedSource */: + case 290 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 292 /* UnparsedPrologue */: + case 289 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 294 /* UnparsedText */: - case 295 /* UnparsedInternalText */: + case 291 /* UnparsedText */: + case 292 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 296 /* UnparsedSyntheticReference */: + case 293 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 78 /* Identifier */: @@ -100506,270 +98174,262 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return emitQualifiedName(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return emitTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return emitParameter(node); - case 161 /* Decorator */: + case 160 /* Decorator */: return emitDecorator(node); // Type members - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return emitPropertySignature(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 164 /* MethodSignature */: + case 163 /* MethodSignature */: return emitMethodSignature(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return emitConstructor(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return emitAccessorDeclaration(node); - case 169 /* CallSignature */: + case 168 /* CallSignature */: return emitCallSignature(node); - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return emitConstructSignature(node); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return emitIndexSignature(node); - case 194 /* TemplateLiteralTypeSpan */: - return emitTemplateTypeSpan(node); // Types - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return emitTypePredicate(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return emitTypeReference(node); - case 174 /* FunctionType */: + case 173 /* FunctionType */: return emitFunctionType(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 175 /* ConstructorType */: + case 174 /* ConstructorType */: return emitConstructorType(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return emitTypeQuery(node); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return emitTypeLiteral(node); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return emitArrayType(node); - case 179 /* TupleType */: + case 178 /* TupleType */: return emitTupleType(node); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return emitOptionalType(node); - case 182 /* UnionType */: + case 181 /* UnionType */: return emitUnionType(node); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return emitIntersectionType(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return emitConditionalType(node); - case 185 /* InferType */: + case 184 /* InferType */: return emitInferType(node); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return emitParenthesizedType(node); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 187 /* ThisType */: + case 186 /* ThisType */: return emitThisType(); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return emitTypeOperator(node); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return emitMappedType(node); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return emitLiteralType(node); - case 193 /* TemplateLiteralType */: - return emitTemplateType(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return emitImportTypeNode(node); - case 303 /* JSDocAllType */: + case 299 /* JSDocAllType */: writePunctuation("*"); return; - case 304 /* JSDocUnknownType */: + case 300 /* JSDocUnknownType */: writePunctuation("?"); return; - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 306 /* JSDocNonNullableType */: + case 302 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 181 /* RestType */: - case 309 /* JSDocVariadicType */: + case 180 /* RestType */: + case 305 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return emitNamedTupleMember(node); // Binding patterns - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return emitBindingElement(node); // Misc - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return emitTemplateSpan(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 230 /* Block */: + case 227 /* Block */: return emitBlock(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return emitVariableStatement(node); - case 231 /* EmptyStatement */: + case 228 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return emitExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return emitIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return emitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return emitWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return emitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return emitForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return emitForOfStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return emitContinueStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return emitBreakStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return emitReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return emitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return emitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return emitLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return emitThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return emitTryStatement(node); - case 248 /* DebuggerStatement */: + case 245 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return emitClassDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return emitModuleBlock(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return emitCaseBlock(node); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return emitImportDeclaration(node); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return emitImportClause(node); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return emitNamespaceImport(node); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return emitNamespaceExport(node); - case 264 /* NamedImports */: + case 261 /* NamedImports */: return emitNamedImports(node); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return emitImportSpecifier(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return emitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return emitExportDeclaration(node); - case 268 /* NamedExports */: + case 265 /* NamedExports */: return emitNamedExports(node); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return emitExportSpecifier(node); - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return; // Module references - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 275 /* JsxOpeningElement */: - case 278 /* JsxOpeningFragment */: + case 272 /* JsxOpeningElement */: + case 275 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 276 /* JsxClosingElement */: - case 279 /* JsxClosingFragment */: + case 273 /* JsxClosingElement */: + case 276 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return emitJsxAttribute(node); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return emitJsxAttributes(node); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 284 /* CaseClause */: + case 281 /* CaseClause */: return emitCaseClause(node); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return emitDefaultClause(node); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return emitHeritageClause(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 291 /* EnumMember */: + case 288 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 328 /* JSDocThisTag */: - case 325 /* JSDocEnumTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 324 /* JSDocThisTag */: + case 321 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 316 /* JSDocImplementsTag */: - case 315 /* JSDocAugmentsTag */: + case 312 /* JSDocImplementsTag */: + case 311 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 324 /* JSDocCallbackTag */: + case 320 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 313 /* JSDocSignature */: + case 309 /* JSDocSignature */: return emitJSDocSignature(node); - case 312 /* JSDocTypeLiteral */: + case 308 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 319 /* JSDocClassTag */: - case 314 /* JSDocTag */: + case 315 /* JSDocClassTag */: + case 310 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 332 /* JSDocSeeTag */: - return emitJSDocSeeTag(node); - case 302 /* JSDocNameReference */: - return emitJSDocNameReference(node); - case 311 /* JSDocComment */: + case 307 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -100806,71 +98466,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return emitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return emitNewExpression(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return emitFunctionExpression(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return emitArrowFunction(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return emitDeleteExpression(node); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return emitVoidExpression(node); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return emitAwaitExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return emitBinaryExpression(node); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return emitConditionalExpression(node); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return emitTemplateExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return emitYieldExpression(node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return emitSpreadExpression(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return emitClassExpression(node); - case 222 /* OmittedExpression */: + case 219 /* OmittedExpression */: return; - case 224 /* AsExpression */: + case 221 /* AsExpression */: return emitAsExpression(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return emitNonNullExpression(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 273 /* JsxElement */: + case 270 /* JsxElement */: return emitJsxElement(node); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return emitCommaList(node); } } @@ -100912,7 +98572,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 298 /* Bundle */ ? node : undefined; + var bundle = node.kind === 295 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -101012,7 +98672,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 294 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 291 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -101085,7 +98745,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 308 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 304 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -101147,7 +98807,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 167 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 166 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -101181,10 +98841,6 @@ var ts; emitTypeAnnotation(node.type); writeTrailingSemicolon(); } - function emitTemplateTypeSpan(node) { - emit(node.type); - emit(node.literal); - } function emitSemicolonClassElement() { writeTrailingSemicolon(); } @@ -101343,19 +98999,13 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 142 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 141 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); } writePunctuation("["); pipelineEmit(3 /* MappedTypeParameter */, node.typeParameter); - if (node.nameType) { - writeSpace(); - writeKeyword("as"); - writeSpace(); - emit(node.nameType); - } writePunctuation("]"); if (node.questionToken) { emit(node.questionToken); @@ -101379,10 +99029,6 @@ var ts; function emitLiteralType(node) { emitExpression(node.literal); } - function emitTemplateType(node) { - emit(node.head); - emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); - } function emitImportTypeNode(node) { if (node.isTypeOf) { writeKeyword("typeof"); @@ -101581,7 +99227,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 214 /* PrefixUnaryExpression */ + return operand.kind === 211 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -101769,7 +99415,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node, node.thenStatement, node.elseStatement); emitTokenWithComment(90 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 234 /* IfStatement */) { + if (node.elseStatement.kind === 231 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -101832,7 +99478,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(156 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(155 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -101840,7 +99486,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 250 /* VariableDeclarationList */) { + if (node.kind === 247 /* VariableDeclarationList */) { emit(node); } else { @@ -102136,7 +99782,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 256 /* ModuleDeclaration */) { + while (body.kind === 253 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -102181,7 +99827,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(153 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(152 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -102189,7 +99835,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(149 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(148 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -102229,7 +99875,7 @@ var ts; var nextPos = emitTokenWithComment(92 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(149 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(148 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -102241,7 +99887,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(153 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(152 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -102252,7 +99898,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(126 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(140 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(139 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -102475,7 +100121,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 329 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 325 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -102491,17 +100137,6 @@ var ts; emitJSDocTypeExpression(tag.typeExpression); emitJSDocComment(tag.comment); } - function emitJSDocSeeTag(tag) { - emitJSDocTagName(tag.tagName); - emit(tag.name); - emitJSDocComment(tag.comment); - } - function emitJSDocNameReference(node) { - writeSpace(); - writePunctuation("{"); - emit(node.name); - writePunctuation("}"); - } function emitJSDocHeritageTag(tag) { emitJSDocTagName(tag.tagName); writeSpace(); @@ -102520,7 +100155,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 301 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 298 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -102539,7 +100174,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 312 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 308 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -102673,8 +100308,8 @@ var ts; bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName }); writeLine(); } - for (var _d = 0, types_23 = types; _d < types_23.length; _d++) { - var directive = types_23[_d]; + for (var _d = 0, types_22 = types; _d < types_22.length; _d++) { + var directive = types_22[_d]; var pos = writer.getTextPos(); writeComment("/// "); if (bundleFileInfo) @@ -103403,7 +101038,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 207 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 204 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -103436,10 +101071,7 @@ var ts; return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape); } } - var flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) - | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) - | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0); - return ts.getLiteralText(node, currentSourceFile, flags); + return ts.getLiteralText(node, currentSourceFile, neverAsciiEscape, jsxAttributeEscape); } /** * Push a new name generation scope. @@ -103472,84 +101104,84 @@ var ts; if (!node) return; switch (node.kind) { - case 230 /* Block */: + case 227 /* Block */: ts.forEach(node.statements, generateNames); break; - case 245 /* LabeledStatement */: - case 243 /* WithStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 242 /* LabeledStatement */: + case 240 /* WithStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: generateNames(node.statement); break; - case 234 /* IfStatement */: + case 231 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 287 /* CatchClause */: + case 284 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: generateNames(node.declarationList); break; - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: generateNames(node.importClause); break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -103558,12 +101190,12 @@ var ts; if (!node) return; switch (node.kind) { - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -103745,23 +101377,23 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 266 /* ExportAssignment */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 263 /* ExportAssignment */: return generateNameForExportDefault(); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return generateNameForClassExpression(); - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -103809,7 +101441,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 335 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 330 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -103833,7 +101465,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 250 /* VariableDeclarationList */) { + if (node.kind === 247 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -103926,12 +101558,7 @@ var ts; function emitLeadingComments(pos, isEmittedNode) { hasWrittenComment = false; if (isEmittedNode) { - if (pos === 0 && (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.isDeclarationFile)) { - forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment); - } - else { - forEachLeadingCommentToEmit(pos, emitLeadingComment); - } + forEachLeadingCommentToEmit(pos, emitLeadingComment); } else if (pos === 0) { // If the node will not be emitted in JS, remove all the comments(normal, pinned and ///) associated with the node, @@ -103950,11 +101577,6 @@ var ts; emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); } } - function emitNonTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { - if (!isTripleSlashComment(commentPos, commentEnd)) { - emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); - } - } function shouldWriteComment(text, pos) { if (printerOptions.onlyPrintJsDocStyle) { return (ts.isJSDocLikeText(text, pos) || ts.isPinnedComment(text, pos)); @@ -104102,7 +101724,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 335 /* NotEmittedStatement */ + if (node.kind !== 330 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -104115,7 +101737,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 335 /* NotEmittedStatement */ + if (node.kind !== 330 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -104148,10 +101770,9 @@ var ts; function emitSourcePos(source, pos) { if (source !== sourceMapSource) { var savedSourceMapSource = sourceMapSource; - var savedSourceMapSourceIndex = sourceMapSourceIndex; setSourceMapSource(source); emitPos(pos); - resetSourceMapSource(savedSourceMapSource, savedSourceMapSourceIndex); + setSourceMapSource(savedSourceMapSource); } else { emitPos(pos); @@ -104190,12 +101811,6 @@ var ts; return; } sourceMapSource = source; - if (source === mostRecentlyAddedSourceMapSource) { - // Fast path for when the new source map is the most recently added, in which case - // we use its captured index without going through the source map generator. - sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex; - return; - } if (isJsonSourceMapSource(source)) { return; } @@ -104203,12 +101818,6 @@ var ts; if (printerOptions.inlineSources) { sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text); } - mostRecentlyAddedSourceMapSource = source; - mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex; - } - function resetSourceMapSource(source, sourceIndex) { - sourceMapSource = source; - sourceMapSourceIndex = sourceIndex; } function isJsonSourceMapSource(sourceFile) { return ts.fileExtensionIs(sourceFile.fileName, ".json" /* Json */); @@ -104707,7 +102316,6 @@ var ts; if (system === void 0) { system = ts.sys; } var existingDirectories = new ts.Map(); var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames); - var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash; function getSourceFile(fileName, languageVersion, onError) { var text; try { @@ -104752,14 +102360,14 @@ var ts; } var outputFingerprints; function writeFileWorker(fileName, data, writeByteOrderMark) { - if (!ts.isWatchSet(options) || !system.getModifiedTime) { + if (!ts.isWatchSet(options) || !system.createHash || !system.getModifiedTime) { system.writeFile(fileName, data, writeByteOrderMark); return; } if (!outputFingerprints) { outputFingerprints = new ts.Map(); } - var hash = computeHash(data); + var hash = system.createHash(data); var mtimeBefore = system.getModifiedTime(fileName); if (mtimeBefore) { var fingerprint = outputFingerprints.get(fileName); @@ -105112,35 +102720,6 @@ var ts; } ts.loadWithLocalCache = loadWithLocalCache; /* @internal */ - function forEachResolvedProjectReference(resolvedProjectReferences, cb) { - return forEachProjectReference(/*projectReferences*/ undefined, resolvedProjectReferences, function (resolvedRef, parent) { return resolvedRef && cb(resolvedRef, parent); }); - } - ts.forEachResolvedProjectReference = forEachResolvedProjectReference; - function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { - var seenResolvedRefs; - return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined); - function worker(projectReferences, resolvedProjectReferences, parent) { - // Visit project references first - if (cbRef) { - var result = cbRef(projectReferences, parent); - if (result) { - return result; - } - } - return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) { - if (resolvedRef && (seenResolvedRefs === null || seenResolvedRefs === void 0 ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) { - // ignore recursives - return undefined; - } - var result = cbResolvedRef(resolvedRef, parent, index); - if (result || !resolvedRef) - return result; - (seenResolvedRefs || (seenResolvedRefs = new ts.Set())).add(resolvedRef.sourceFile.path); - return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef); - }); - } - } - /* @internal */ ts.inferredTypesContainingFile = "__inferred type names__.ts"; /** * Determines if program structure is upto date or needs to be recreated @@ -105276,8 +102855,6 @@ var ts; var modulesWithElidedImports = new ts.Map(); // Track source files that are source files found by searching under node_modules, as these shouldn't be compiled. var sourceFilesFoundSearchingNodeModules = new ts.Map(); - var tracingData = ["program" /* Program */, "createProgram"]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeProgram"); var host = createProgramOptions.host || createCompilerHost(options); var configParsingHost = parseConfigHostFromCompilerHostLike(host); @@ -105353,16 +102930,12 @@ var ts; getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, forEachResolvedProjectReference: forEachResolvedProjectReference }), onProgramCreateComplete = _c.onProgramCreateComplete, fileExists = _c.fileExists, directoryExists = _c.directoryExists; - ts.tracing.push("program" /* Program */, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram }); var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); - ts.tracing.pop(); // We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks // `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`. - var structureIsReused; - ts.tracing.push("program" /* Program */, "tryReuseStructureFromOldProgram", {}); - structureIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const - ts.tracing.pop(); - if (structureIsReused !== 2 /* Completely */) { + var structuralIsReused; + structuralIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const + if (structuralIsReused !== 2 /* Completely */) { processingDefaultLibFiles = []; processingOtherFiles = []; if (projectReferences) { @@ -105399,13 +102972,10 @@ var ts; } } } - ts.tracing.push("program" /* Program */, "processRootFiles", { count: rootNames.length }); ts.forEach(rootNames, function (name) { return processRootFile(name, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false); }); - ts.tracing.pop(); // load type declarations specified via 'types' argument or implicitly from types/ and node_modules/@types folders var typeReferences = rootNames.length ? ts.getAutomaticTypeDirectiveNames(options, host) : ts.emptyArray; if (typeReferences.length) { - ts.tracing.push("program" /* Program */, "processTypeReferences", { count: typeReferences.length }); // This containingFilename needs to match with the one used in managed-side var containingDirectory = options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : host.getCurrentDirectory(); var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile); @@ -105413,7 +102983,6 @@ var ts; for (var i = 0; i < typeReferences.length; i++) { processTypeReferenceDirective(typeReferences[i], resolutions[i]); } - ts.tracing.pop(); } // Do not process the default library if: // - The '--noLib' flag is used. @@ -105454,8 +103023,8 @@ var ts; host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path)); } } - oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference) { - if (!getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) { + oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference, resolvedProjectReferencePath) { + if (resolvedProjectReference && !getResolvedProjectReferenceByPath(resolvedProjectReferencePath)) { host.onReleaseOldSourceFile(resolvedProjectReference.sourceFile, oldProgram.getCompilerOptions(), /*hasSourceFileByPath*/ false); } }); @@ -105475,7 +103044,6 @@ var ts; getOptionsDiagnostics: getOptionsDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getSemanticDiagnostics: getSemanticDiagnostics, - getCachedSemanticDiagnostics: getCachedSemanticDiagnostics, getSuggestionDiagnostics: getSuggestionDiagnostics, getDeclarationDiagnostics: getDeclarationDiagnostics, getBindAndCheckDiagnostics: getBindAndCheckDiagnostics, @@ -105489,7 +103057,6 @@ var ts; getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, - getTypeCatalog: function () { return getDiagnosticsProducingTypeChecker().getTypeCatalog(); }, getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); }, getInstantiationCount: function () { return getDiagnosticsProducingTypeChecker().getInstantiationCount(); }, getRelationCacheSizes: function () { return getDiagnosticsProducingTypeChecker().getRelationCacheSizes(); }, @@ -105518,73 +103085,26 @@ var ts; getSymlinkCache: getSymlinkCache, realpath: (_b = host.realpath) === null || _b === void 0 ? void 0 : _b.bind(host), useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, - structureIsReused: structureIsReused, }; onProgramCreateComplete(); verifyCompilerOptions(); ts.performance.mark("afterProgram"); ts.performance.measure("Program", "beforeProgram", "afterProgram"); - ts.tracing.end.apply(ts.tracing, tracingData); return program; - function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames) { - if (!moduleNames.length) - return ts.emptyArray; - var containingFileName = ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); - var redirectedReference = getRedirectReferenceForResolution(containingFile); - ts.tracing.push("program" /* Program */, "resolveModuleNamesWorker", { containingFileName: containingFileName }); + function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames, redirectedReference) { ts.performance.mark("beforeResolveModule"); - var result = actualResolveModuleNamesWorker(moduleNames, containingFileName, reusedNames, redirectedReference); + var result = actualResolveModuleNamesWorker(moduleNames, containingFile, reusedNames, redirectedReference); ts.performance.mark("afterResolveModule"); ts.performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule"); - ts.tracing.pop(); return result; } - function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile) { - if (!typeDirectiveNames.length) - return []; - var containingFileName = !ts.isString(containingFile) ? ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile; - var redirectedReference = !ts.isString(containingFile) ? getRedirectReferenceForResolution(containingFile) : undefined; - ts.tracing.push("program" /* Program */, "resolveTypeReferenceDirectiveNamesWorker", { containingFileName: containingFileName }); + function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, redirectedReference) { ts.performance.mark("beforeResolveTypeReference"); - var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference); + var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, redirectedReference); ts.performance.mark("afterResolveTypeReference"); ts.performance.measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference"); - ts.tracing.pop(); return result; } - function getRedirectReferenceForResolution(file) { - var redirect = getResolvedProjectReferenceToRedirect(file.originalFileName); - if (redirect || !ts.fileExtensionIs(file.originalFileName, ".d.ts" /* Dts */)) - return redirect; - // The originalFileName could not be actual source file name if file found was d.ts from referecned project - // So in this case try to look up if this is output from referenced project, if it is use the redirected project in that case - var resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.originalFileName, file.path); - if (resultFromDts) - return resultFromDts; - // If preserveSymlinks is true, module resolution wont jump the symlink - // but the resolved real path may be the .d.ts from project reference - // Note:: Currently we try the real path only if the - // file is from node_modules to avoid having to run real path on all file paths - if (!host.realpath || !options.preserveSymlinks || !ts.stringContains(file.originalFileName, ts.nodeModulesPathPart)) - return undefined; - var realDeclarationFileName = host.realpath(file.originalFileName); - var realDeclarationPath = toPath(realDeclarationFileName); - return realDeclarationPath === file.path ? undefined : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationFileName, realDeclarationPath); - } - function getRedirectReferenceForResolutionFromSourceOfProject(fileName, filePath) { - var source = getSourceOfProjectReferenceRedirect(fileName); - if (ts.isString(source)) - return getResolvedProjectReferenceToRedirect(source); - if (!source) - return undefined; - // Output of .d.ts file so return resolved ref that matches the out file name - return forEachResolvedProjectReference(function (resolvedRef) { - var out = ts.outFile(resolvedRef.commandLine.options); - if (!out) - return undefined; - return toPath(out) === filePath ? resolvedRef : undefined; - }); - } function compareDefaultLibFiles(a, b) { return ts.compareValues(getDefaultLibFilePriority(a), getDefaultLibFilePriority(b)); } @@ -105643,13 +103163,13 @@ var ts; } return classifiableNames; } - function resolveModuleNamesReusingOldState(moduleNames, file) { - if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) { + function resolveModuleNamesReusingOldState(moduleNames, containingFile, file) { + if (structuralIsReused === 0 /* Not */ && !file.ambientModuleNames.length) { // If the old program state does not permit reusing resolutions and `file` does not contain locally defined ambient modules, // the best we can do is fallback to the default logic. - return resolveModuleNamesWorker(moduleNames, file, /*reusedNames*/ undefined); + return resolveModuleNamesWorker(moduleNames, containingFile, /*reusedNames*/ undefined, getResolvedProjectReferenceToRedirect(file.originalFileName)); } - var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName); + var oldSourceFile = oldProgram && oldProgram.getSourceFile(containingFile); if (oldSourceFile !== file && file.resolvedModules) { // `file` was created for the new program. // @@ -105659,13 +103179,13 @@ var ts; // which per above occurred during the current program creation. // Since we assume the filesystem does not change during program creation, // it is safe to reuse resolutions from the earlier call. - var result_14 = []; + var result_12 = []; for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { var moduleName = moduleNames_1[_i]; var resolvedModule = file.resolvedModules.get(moduleName); - result_14.push(resolvedModule); + result_12.push(resolvedModule); } - return result_14; + return result_12; } // At this point, we know at least one of the following hold: // - file has local declarations for ambient modules @@ -105693,7 +103213,7 @@ var ts; var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName); if (oldResolvedModule) { if (ts.isTraceEnabled(options, host)) { - ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, containingFile); } (result || (result = new Array(moduleNames.length)))[i] = oldResolvedModule; (reusedNames || (reusedNames = [])).push(moduleName); @@ -105708,7 +103228,7 @@ var ts; if (ts.contains(file.ambientModuleNames, moduleName)) { resolvesToAmbientModuleInNonModifiedFile = true; if (ts.isTraceEnabled(options, host)) { - ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, containingFile); } } else { @@ -105723,7 +103243,7 @@ var ts; } } var resolutions = unknownModuleNames && unknownModuleNames.length - ? resolveModuleNamesWorker(unknownModuleNames, file, reusedNames) + ? resolveModuleNamesWorker(unknownModuleNames, containingFile, reusedNames, getResolvedProjectReferenceToRedirect(file.originalFileName)) : ts.emptyArray; // Combine results of resolutions and predicted results if (!result) { @@ -105771,7 +103291,7 @@ var ts; } } function canReuseProjectReferences() { - return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, parent, index) { + return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, index, parent) { var newRef = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; var newResolvedRef = parseProjectReferenceConfigFile(newRef); if (oldResolvedRef) { @@ -105797,19 +103317,19 @@ var ts; // if any of these properties has changed - structure cannot be reused var oldOptions = oldProgram.getCompilerOptions(); if (ts.changesAffectModuleResolution(oldOptions, options)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } // there is an old program, check if we can reuse its structure var oldRootNames = oldProgram.getRootFileNames(); if (!ts.arrayIsEqualTo(oldRootNames, rootNames)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (!ts.arrayIsEqualTo(options.types, oldOptions.types)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } // Check if any referenced project tsconfig files are different if (!canReuseProjectReferences()) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (projectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); @@ -105817,12 +103337,12 @@ var ts; // check if program source files has changed in the way that can affect structure of the program var newSourceFiles = []; var modifiedSourceFiles = []; - structureIsReused = 2 /* Completely */; + oldProgram.structureIsReused = 2 /* Completely */; // If the missing file paths are now present, it can change the progam structure, // and hence cant reuse the structure. // This is same as how we dont reuse the structure if one of the file from old program is now missing if (oldProgram.getMissingFilePaths().some(function (missingFilePath) { return host.fileExists(missingFilePath); })) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } var oldSourceFiles = oldProgram.getSourceFiles(); var SeenPackageName; @@ -105837,7 +103357,7 @@ var ts; ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, options.target, /*onError*/ undefined, shouldCreateNewSourceFile) : host.getSourceFile(oldSourceFile.fileName, options.target, /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217 if (!newSourceFile) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } ts.Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); var fileChanged = void 0; @@ -105846,7 +103366,7 @@ var ts; // This lets us know if the unredirected file has changed. If it has we should break the redirect. if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { // Underlying file has changed. Might not redirect anymore. Must rebuild program. - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } fileChanged = false; newSourceFile = oldSourceFile; // Use the redirect. @@ -105854,7 +103374,7 @@ var ts; else if (oldProgram.redirectTargetsMap.has(oldSourceFile.path)) { // If a redirected-to source file changes, the redirect may be broken. if (newSourceFile !== oldSourceFile) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } fileChanged = false; } @@ -105873,7 +103393,7 @@ var ts; var prevKind = seenPackageNames.get(packageName); var newKind = fileChanged ? 1 /* Modified */ : 0 /* Exists */; if ((prevKind !== undefined && newKind === 1 /* Modified */) || prevKind === 1 /* Modified */) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } seenPackageNames.set(packageName, newKind); } @@ -105881,50 +103401,50 @@ var ts; // The `newSourceFile` object was created for the new program. if (!ts.arrayIsEqualTo(oldSourceFile.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) { // 'lib' references has changed. Matches behavior in changesAffectModuleResolution - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { // value of no-default-lib has changed // this will affect if default library is injected into the list of files - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // check tripleslash references if (!ts.arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) { // tripleslash references has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // check imports and module augmentations collectExternalModuleReferences(newSourceFile); if (!ts.arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) { // imports has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { // moduleAugmentations has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if ((oldSourceFile.flags & 3145728 /* PermanentlySetIncrementalFlags */) !== (newSourceFile.flags & 3145728 /* PermanentlySetIncrementalFlags */)) { // dynamicImport has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { // 'types' references has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // tentatively approve the file modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); } else if (hasInvalidatedResolution(oldSourceFile.path)) { // 'module/types' references could have changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; // add file to the modified list so that we will resolve it later modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); } // if file has passed all checks it should be safe to reuse it newSourceFiles.push(newSourceFile); } - if (structureIsReused !== 2 /* Completely */) { - return structureIsReused; + if (oldProgram.structureIsReused !== 2 /* Completely */) { + return oldProgram.structureIsReused; } var modifiedFiles = modifiedSourceFiles.map(function (f) { return f.oldFile; }); for (var _b = 0, oldSourceFiles_3 = oldSourceFiles; _b < oldSourceFiles_3.length; _b++) { @@ -105939,35 +103459,38 @@ var ts; // try to verify results of module resolution for (var _e = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _e < modifiedSourceFiles_1.length; _e++) { var _f = modifiedSourceFiles_1[_e], oldSourceFile = _f.oldFile, newSourceFile = _f.newFile; + var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.originalFileName, currentDirectory); var moduleNames = getModuleNames(newSourceFile); - var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile); + var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile); // ensure that module resolution results are still correct var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo); if (resolutionsChanged) { - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; newSourceFile.resolvedModules = ts.zipToMap(moduleNames, resolutions); } else { newSourceFile.resolvedModules = oldSourceFile.resolvedModules; } - // We lower-case all type references because npm automatically lowercases all packages. See GH#9824. - var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); }); - var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile); - // ensure that types resolutions are still correct - var typeReferenceEesolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo); - if (typeReferenceEesolutionsChanged) { - structureIsReused = 1 /* SafeModules */; - newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, typeReferenceResolutions); - } - else { - newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; + if (resolveTypeReferenceDirectiveNamesWorker) { + // We lower-case all type references because npm automatically lowercases all packages. See GH#9824. + var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); }); + var resolutions_1 = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFilePath, getResolvedProjectReferenceToRedirect(newSourceFile.originalFileName)); + // ensure that types resolutions are still correct + var resolutionsChanged_1 = ts.hasChangesInResolutions(typesReferenceDirectives, resolutions_1, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo); + if (resolutionsChanged_1) { + oldProgram.structureIsReused = 1 /* SafeModules */; + newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, resolutions_1); + } + else { + newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; + } } } - if (structureIsReused !== 2 /* Completely */) { - return structureIsReused; + if (oldProgram.structureIsReused !== 2 /* Completely */) { + return oldProgram.structureIsReused; } if ((_a = host.hasChangedAutomaticTypeDirectiveNames) === null || _a === void 0 ? void 0 : _a.call(host)) { - return 1 /* SafeModules */; + return oldProgram.structureIsReused = 1 /* SafeModules */; } missingFilePaths = oldProgram.getMissingFilePaths(); refFileMap = oldProgram.getRefFileMap(); @@ -106001,7 +103524,7 @@ var ts; resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); sourceFileToPackageName = oldProgram.sourceFileToPackageName; redirectTargetsMap = oldProgram.redirectTargetsMap; - return 2 /* Completely */; + return oldProgram.structureIsReused = 2 /* Completely */; } function getEmitHost(writeFileCallback) { return { @@ -106041,8 +103564,6 @@ var ts; } function emitBuildInfo(writeFileCallback) { ts.Debug.assert(!ts.outFile(options)); - var tracingData = ["emit" /* Emit */, "emitBuildInfo"]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeEmit"); var emitResult = ts.emitFiles(ts.notImplementedResolver, getEmitHost(writeFileCallback), /*targetSourceFile*/ undefined, @@ -106051,7 +103572,6 @@ var ts; /*onlyBuildInfo*/ true); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); - ts.tracing.end.apply(ts.tracing, tracingData); return emitResult; } function getResolvedProjectReferences() { @@ -106097,11 +103617,7 @@ var ts; return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, /*produceDiagnostics:*/ false)); } function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit) { - var tracingData = ["emit" /* Emit */, "emit", { path: sourceFile === null || sourceFile === void 0 ? void 0 : sourceFile.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); - var result = runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); }); - ts.tracing.end.apply(ts.tracing, tracingData); - return result; + return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); }); } function isEmitBlocked(emitFileName) { return hasEmitBlockingDiagnostics.has(toPath(emitFileName)); @@ -106151,11 +103667,6 @@ var ts; function getSemanticDiagnostics(sourceFile, cancellationToken) { return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken); } - function getCachedSemanticDiagnostics(sourceFile) { - var _a; - return sourceFile - ? (_a = cachedBindAndCheckDiagnosticsForFile.perFile) === null || _a === void 0 ? void 0 : _a.get(sourceFile.path) : cachedBindAndCheckDiagnosticsForFile.allDiagnostics; - } function getBindAndCheckDiagnostics(sourceFile, cancellationToken) { return getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken); } @@ -106241,17 +103752,17 @@ var ts; sourceFile.scriptKind === 5 /* External */ || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; - return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); + return getMergedBindAndCheckDiagnostics(sourceFile, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); }); } - function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics) { + function getMergedBindAndCheckDiagnostics(sourceFile) { var _a; var allDiagnostics = []; - for (var _i = 2; _i < arguments.length; _i++) { - allDiagnostics[_i - 2] = arguments[_i]; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; } var flatDiagnostics = ts.flatten(allDiagnostics); - if (!includeBindAndCheckDiagnostics || !((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { return flatDiagnostics; } var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives; @@ -106312,22 +103823,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 249 /* VariableDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 246 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -106335,58 +103846,58 @@ var ts; } } switch (node.kind) { - case 262 /* ImportClause */: + case 259 /* ImportClause */: if (node.isTypeOnly) { - diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); + diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 116 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(117 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 256 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(140 /* NamespaceKeyword */) : ts.tokenToString(139 /* ModuleKeyword */); + case 253 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(139 /* NamespaceKeyword */) : ts.tokenToString(138 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(91 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 224 /* AsExpression */: + case 221 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -106395,29 +103906,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 232 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 229 /* VariableStatement */); return "skip"; } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -106429,19 +103940,19 @@ var ts; return "skip"; } break; - case 160 /* Parameter */: + case 159 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 223 /* ExpressionWithTypeArguments */: - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: - case 205 /* TaggedTemplateExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 220 /* ExpressionWithTypeArguments */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 202 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -106463,7 +103974,7 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 133 /* DeclareKeyword */: case 125 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); @@ -106524,7 +104035,9 @@ var ts; } var diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName); forEachResolvedProjectReference(function (resolvedRef) { - diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + if (resolvedRef) { + diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + } }); return diagnostics; } @@ -106545,18 +104058,6 @@ var ts; ? b.kind === 78 /* Identifier */ && a.escapedText === b.escapedText : b.kind === 10 /* StringLiteral */ && a.text === b.text; } - function createSyntheticImport(text, file) { - var externalHelpersModuleReference = ts.factory.createStringLiteral(text); - var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference); - ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */); - ts.setParent(externalHelpersModuleReference, importDecl); - ts.setParent(importDecl, file); - // explicitly unset the synthesized flag on these declarations so the checker API will answer questions about them - // (which is required to build the dependency graph for incremental emit) - externalHelpersModuleReference.flags &= ~8 /* Synthesized */; - importDecl.flags &= ~8 /* Synthesized */; - return externalHelpersModuleReference; - } function collectExternalModuleReferences(file) { if (file.imports) { return; @@ -106569,17 +104070,16 @@ var ts; var ambientModules; // If we are importing helpers, we need to add a synthetic reference to resolve the // helpers library. - if ((options.isolatedModules || isExternalModuleFile) + if (options.importHelpers + && (options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { - if (options.importHelpers) { - // synthesize 'import "tslib"' declaration - imports = [createSyntheticImport(ts.externalHelpersModuleNameText, file)]; - } - var jsxImport = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(options, file), options); - if (jsxImport) { - // synthesize `import "base/jsx-runtime"` declaration - (imports || (imports = [])).push(createSyntheticImport(jsxImport, file)); - } + // synthesize 'import "tslib"' declaration + var externalHelpersModuleReference = ts.factory.createStringLiteral(ts.externalHelpersModuleNameText); + var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference); + ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */); + ts.setParent(externalHelpersModuleReference, importDecl); + ts.setParent(importDecl, file); + imports = [externalHelpersModuleReference]; } for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; @@ -106763,16 +104263,6 @@ var ts; } // Get source file from normalized fileName function findSourceFile(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) { - ts.tracing.push("program" /* Program */, "findSourceFile", { - fileName: fileName, - isDefaultLib: isDefaultLib || undefined, - refKind: refFile ? ts.RefFileKind[refFile.kind] : undefined, - }); - var result = findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId); - ts.tracing.pop(); - return result; - } - function findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) { if (useSourceOfProjectReferenceRedirect) { var source = getSourceOfProjectReferenceRedirect(fileName); // If preserveSymlinks is true, module resolution wont jump the symlink @@ -106960,11 +104450,12 @@ var ts; function getResolvedProjectReferenceToRedirect(fileName) { if (mapFromFileToProjectReferenceRedirects === undefined) { mapFromFileToProjectReferenceRedirects = new ts.Map(); - forEachResolvedProjectReference(function (referencedProject) { + forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { // not input file from the referenced project, ignore - if (toPath(options.configFilePath) !== referencedProject.sourceFile.path) { + if (referencedProject && + toPath(options.configFilePath) !== referenceProjectPath) { referencedProject.commandLine.fileNames.forEach(function (f) { - return mapFromFileToProjectReferenceRedirects.set(toPath(f), referencedProject.sourceFile.path); + return mapFromFileToProjectReferenceRedirects.set(toPath(f), referenceProjectPath); }); } }); @@ -106973,7 +104464,11 @@ var ts; return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); } function forEachResolvedProjectReference(cb) { - return ts.forEachResolvedProjectReference(resolvedProjectReferences, cb); + return forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { + var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; + var resolvedRefPath = toPath(resolveProjectReferencePath(ref)); + return cb(resolvedRef, resolvedRefPath); + }); } function getSourceOfProjectReferenceRedirect(file) { if (!ts.isDeclarationFileName(file)) @@ -106981,19 +104476,21 @@ var ts; if (mapFromToProjectReferenceRedirectSource === undefined) { mapFromToProjectReferenceRedirectSource = new ts.Map(); forEachResolvedProjectReference(function (resolvedRef) { - var out = ts.outFile(resolvedRef.commandLine.options); - if (out) { - // Dont know which source file it means so return true? - var outputDts = ts.changeExtension(out, ".d.ts" /* Dts */); - mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), true); - } - else { - ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) { - if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { - var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames()); - mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName); - } - }); + if (resolvedRef) { + var out = ts.outFile(resolvedRef.commandLine.options); + if (out) { + // Dont know which source file it means so return true? + var outputDts = ts.changeExtension(out, ".d.ts" /* Dts */); + mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), true); + } + else { + ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) { + if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { + var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames()); + mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName); + } + }); + } } }); } @@ -107002,6 +104499,33 @@ var ts; function isSourceOfProjectReferenceRedirect(fileName) { return useSourceOfProjectReferenceRedirect && !!getResolvedProjectReferenceToRedirect(fileName); } + function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { + var seenResolvedRefs; + return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined, cbResolvedRef, cbRef); + function worker(projectReferences, resolvedProjectReferences, parent, cbResolvedRef, cbRef) { + // Visit project references first + if (cbRef) { + var result = cbRef(projectReferences, parent); + if (result) { + return result; + } + } + return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) { + if (ts.contains(seenResolvedRefs, resolvedRef)) { + // ignore recursives + return undefined; + } + var result = cbResolvedRef(resolvedRef, index, parent); + if (result) { + return result; + } + if (!resolvedRef) + return undefined; + (seenResolvedRefs || (seenResolvedRefs = [])).push(resolvedRef); + return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef, cbResolvedRef, cbRef); + }); + } + } function getResolvedProjectReferenceByPath(projectReferencePath) { if (!projectReferenceRedirects) { return undefined; @@ -107028,7 +104552,7 @@ var ts; if (!typeDirectives) { return; } - var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file); + var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file.originalFileName, getResolvedProjectReferenceToRedirect(file.originalFileName)); for (var i = 0; i < typeDirectives.length; i++) { var ref = file.typeReferenceDirectives[i]; var resolvedTypeReferenceDirective = resolutions[i]; @@ -107045,11 +104569,6 @@ var ts; } } function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, refFile) { - ts.tracing.push("program" /* Program */, "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolveModuleNamesReusingOldState, refKind: refFile === null || refFile === void 0 ? void 0 : refFile.kind, refPath: refFile === null || refFile === void 0 ? void 0 : refFile.file.path }); - processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, refFile); - ts.tracing.pop(); - } - function processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, refFile) { // If we already found this library as a primary reference - nothing to do var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective); if (previousResolution && previousResolution.primary) { @@ -107134,7 +104653,7 @@ var ts; if (file.imports.length || file.moduleAugmentations.length) { // Because global augmentation doesn't have string literal name, we can check for global augmentation as such. var moduleNames = getModuleNames(file); - var resolutions = resolveModuleNamesReusingOldState(moduleNames, file); + var resolutions = resolveModuleNamesReusingOldState(moduleNames, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory), file); ts.Debug.assert(resolutions.length === moduleNames.length); for (var i = 0; i < moduleNames.length; i++) { var resolution = resolutions[i]; @@ -107162,7 +104681,7 @@ var ts; && !options.noResolve && i < file.imports.length && !elideImport - && !(isJsFile && !ts.getAllowJSCompilerOption(options)) + && !(isJsFile && !options.allowJs) && (ts.isInJSFile(file.imports[i]) || !(file.imports[i].flags & 4194304 /* JSDoc */)); if (elideImport) { modulesWithElidedImports.set(file.path, true); @@ -107278,6 +104797,9 @@ var ts; createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap"); } } + if (options.paths && options.baseUrl === undefined) { + createDiagnosticForOptionName(ts.Diagnostics.Option_paths_cannot_be_used_without_specifying_baseUrl_option, "paths"); + } if (options.composite) { if (options.declaration === false) { createDiagnosticForOptionName(ts.Diagnostics.Composite_projects_may_not_disable_declaration_emit, "declaration"); @@ -107327,9 +104849,6 @@ var ts; if (!ts.hasZeroOrOneAsteriskCharacter(subst)) { createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character, subst, key); } - if (!options.baseUrl && !ts.pathIsRelative(subst) && !ts.pathIsAbsolute(subst)) { - createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash); - } } else { createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2, subst, key, typeOfSubst); @@ -107382,7 +104901,7 @@ var ts; var firstNonExternalModuleSourceFile = ts.find(files, function (f) { return !ts.isExternalModule(f) && !ts.isSourceFileJS(f) && !f.isDeclarationFile && f.scriptKind !== 6 /* JSON */; }); if (firstNonExternalModuleSourceFile) { var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); - programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts.getBaseFileName(firstNonExternalModuleSourceFile.fileName))); + programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.All_files_must_be_modules_when_the_isolatedModules_flag_is_provided)); } } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ES2015 */ && options.module === ts.ModuleKind.None) { @@ -107424,7 +104943,7 @@ var ts; if (options.useDefineForClassFields && languageVersion === 0 /* ES3 */) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, "useDefineForClassFields"); } - if (options.checkJs && !ts.getAllowJSCompilerOption(options)) { + if (options.checkJs && !options.allowJs) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); } if (options.emitDeclarationOnly) { @@ -107443,9 +104962,6 @@ var ts; if (options.reactNamespace) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "reactNamespace", "jsxFactory"); } - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFactory", ts.inverseJsxOptionMap.get("" + options.jsx)); - } if (!ts.parseIsolatedEntityName(options.jsxFactory, languageVersion)) { createOptionValueDiagnostic("jsxFactory", ts.Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFactory); } @@ -107457,23 +104973,10 @@ var ts; if (!options.jsxFactory) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "jsxFragmentFactory", "jsxFactory"); } - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFragmentFactory", ts.inverseJsxOptionMap.get("" + options.jsx)); - } if (!ts.parseIsolatedEntityName(options.jsxFragmentFactory, languageVersion)) { createOptionValueDiagnostic("jsxFragmentFactory", ts.Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFragmentFactory); } } - if (options.reactNamespace) { - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "reactNamespace", ts.inverseJsxOptionMap.get("" + options.jsx)); - } - } - if (options.jsxImportSource) { - if (options.jsx === 2 /* React */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxImportSource", ts.inverseJsxOptionMap.get("" + options.jsx)); - } - } // If the emit is enabled make sure that every output file is unique and not overwriting any of the input files if (!options.noEmit && !options.suppressOutputPathCheck) { var emitHost = getEmitHost(); @@ -107548,7 +105051,7 @@ var ts; } function verifyProjectReferences() { var buildInfoPath = !options.suppressOutputPathCheck ? ts.getTsBuildInfoEmitOutputFilePath(options) : undefined; - forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, parent, index) { + forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; var parentFile = parent && parent.sourceFile; if (!resolvedRef) { @@ -107743,6 +105246,8 @@ var ts; if (!setOfDeclarationDirectories) { setOfDeclarationDirectories = new ts.Set(); host.forEachResolvedProjectReference(function (ref) { + if (!ref) + return; var out = ts.outFile(ref.commandLine.options); if (out) { setOfDeclarationDirectories.add(ts.getDirectoryPath(host.toPath(out))); @@ -107975,7 +105480,7 @@ var ts; return options.jsx ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set; } function needAllowJs() { - return ts.getAllowJSCompilerOption(options) || !ts.getStrictOptionValue(options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; + return options.allowJs || !ts.getStrictOptionValue(options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; } function needResolveJsonModule() { return options.resolveJsonModule ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used; @@ -108129,7 +105634,7 @@ var ts; // Create the reference map, and set the file infos for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; - var version_2 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); + var version_1 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined; if (referencedMap) { var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName); @@ -108144,7 +105649,7 @@ var ts; } } } - fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) }); + fileInfos.set(sourceFile.resolvedPath, { version: version_1, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) }); } return { fileInfos: fileInfos, @@ -108246,7 +105751,7 @@ var ts; emitOutput_1.outputFiles.length > 0 ? emitOutput_1.outputFiles[0] : undefined; if (firstDts_1) { ts.Debug.assert(ts.fileExtensionIs(firstDts_1.name, ".d.ts" /* Dts */), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); }); - latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text); + latestSignature = computeHash(firstDts_1.text); if (exportedModulesMapCache && latestSignature !== prevSignature) { updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache); } @@ -108439,12 +105944,14 @@ var ts; if (!seenFileNamesMap.has(currentPath)) { var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); seenFileNamesMap.set(currentPath, currentSourceFile); - if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) { - queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath)); + if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) { // TODO: GH#18217 + queue.push.apply(// TODO: GH#18217 + queue, getReferencedByPaths(state, currentSourceFile.resolvedPath)); } } } // Return array of values that needs emit + // Return array of values that needs emit return ts.arrayFrom(ts.mapDefinedIterator(seenFileNamesMap.values(), function (value) { return value; })); } })(BuilderState = ts.BuilderState || (ts.BuilderState = {})); @@ -108565,7 +106072,7 @@ var ts; result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function (r) { return convertToDiagnosticRelatedInformation(r, newProgram, toPath); }) : - [] : + ts.emptyArray : undefined; return result; }); @@ -108757,10 +106264,10 @@ var ts; state.semanticDiagnosticsPerFile.delete(path); return !state.semanticDiagnosticsFromOldState.size; } - function isChangedSignature(state, path) { + function isChangedSignagure(state, path) { var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path); - var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature; - return newSignature !== oldSignature; + var oldSignagure = ts.Debug.checkDefined(state.fileInfos.get(path)).signature; + return newSignature !== oldSignagure; } /** * Iterate on referencing modules that export entities from affected file @@ -108771,7 +106278,7 @@ var ts; if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) { return; } - if (!isChangedSignature(state, affectedFile.resolvedPath)) + if (!isChangedSignagure(state, affectedFile.resolvedPath)) return; // Since isolated modules dont change js files, files affected by change in signature is itself // But we need to cleanup semantic diagnostics and queue dts emit for affected files @@ -108784,7 +106291,7 @@ var ts; if (!seenFileNamesMap.has(currentPath)) { seenFileNamesMap.set(currentPath, true); var result = fn(state, currentPath); - if (result && isChangedSignature(state, currentPath)) { + if (result && isChangedSignagure(state, currentPath)) { var currentSourceFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(currentPath); queue.push.apply(queue, ts.BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath)); } @@ -109034,7 +106541,7 @@ var ts; result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function (r) { return convertToReusableDiagnosticRelatedInformation(r, relativeToBuildInfo); }) : - [] : + ts.emptyArray : undefined; return result; }); @@ -109096,7 +106603,7 @@ var ts; /** * Computing hash to for signature verification */ - var computeHash = ts.maybeBind(host, host.createHash); + var computeHash = host.createHash || ts.generateDjb2Hash; var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState); var backupState; newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); }; @@ -109192,54 +106699,31 @@ var ts; * in that order would be used to write the files */ function emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { - var restorePendingEmitOnHandlingNoEmitSuccess = false; - var savedAffectedFilesPendingEmit; - var savedAffectedFilesPendingEmitKind; - var savedAffectedFilesPendingEmitIndex; - // Backup and restore affected pendings emit state for non emit Builder if noEmitOnError is enabled and emitBuildInfo could be written in case there are errors - // This ensures pending files to emit is updated in tsbuildinfo - // Note that when there are no errors, emit proceeds as if everything is emitted as it is callers reponsibility to write the files to disk if at all (because its builder that doesnt track files to emit) - if (kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram && - !targetSourceFile && - !ts.outFile(state.compilerOptions) && - !state.compilerOptions.noEmit && - state.compilerOptions.noEmitOnError) { - restorePendingEmitOnHandlingNoEmitSuccess = true; - savedAffectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice(); - savedAffectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind); - savedAffectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex; - } if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile); - } - var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken); - if (result) - return result; - if (restorePendingEmitOnHandlingNoEmitSuccess) { - state.affectedFilesPendingEmit = savedAffectedFilesPendingEmit; - state.affectedFilesPendingEmitKind = savedAffectedFilesPendingEmitKind; - state.affectedFilesPendingEmitIndex = savedAffectedFilesPendingEmitIndex; - } - // Emit only affected files if using builder for emit - if (!targetSourceFile && kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { - // Emit and report any errors we ran into. - var sourceMaps = []; - var emitSkipped = false; - var diagnostics = void 0; - var emittedFiles = []; - var affectedEmitResult = void 0; - while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { - emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; - diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); - emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); - sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken); + if (result) + return result; + if (!targetSourceFile) { + // Emit and report any errors we ran into. + var sourceMaps = []; + var emitSkipped = false; + var diagnostics = void 0; + var emittedFiles = []; + var affectedEmitResult = void 0; + while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { + emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; + diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); + emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); + sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + } + return { + emitSkipped: emitSkipped, + diagnostics: diagnostics || ts.emptyArray, + emittedFiles: emittedFiles, + sourceMaps: sourceMaps + }; } - return { - emitSkipped: emitSkipped, - diagnostics: diagnostics || ts.emptyArray, - emittedFiles: emittedFiles, - sourceMaps: sourceMaps - }; } return ts.Debug.checkDefined(state.program).emit(targetSourceFile, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers); } @@ -109259,8 +106743,7 @@ var ts; return toAffectedFileResult(state, state.program.getSemanticDiagnostics(/*targetSourceFile*/ undefined, cancellationToken), affected); } // Add file to affected file pending emit to handle for later emit time - // Apart for emit builder do this for tsbuildinfo, do this for non emit builder when noEmit is set as tsbuildinfo is written and reused between emitters - if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram || state.compilerOptions.noEmit || state.compilerOptions.noEmitOnError) { + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { addToAffectedFilesPendingEmit(state, affected.resolvedPath, 1 /* Full */); } // Get diagnostics for the affected file if its not ignored @@ -109974,8 +107457,8 @@ var ts; if (!resolutions) return false; var invalidated = false; - for (var _i = 0, resolutions_1 = resolutions; _i < resolutions_1.length; _i++) { - var resolution = resolutions_1[_i]; + for (var _i = 0, resolutions_2 = resolutions; _i < resolutions_2.length; _i++) { + var resolution = resolutions_2[_i]; if (resolution.isInvalidated || !canInvalidate(resolution)) continue; resolution.isInvalidated = invalidated = true; @@ -110187,14 +107670,14 @@ var ts; function getNodeModulesPackageName(compilerOptions, importingSourceFileName, nodeModulesFileName, host) { var info = getInfo(importingSourceFileName, host); var modulePaths = getAllModulePaths(importingSourceFileName, nodeModulesFileName, host); - return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions, /*packageNameOnly*/ true); }); + return ts.firstDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions, /*packageNameOnly*/ true); }); } moduleSpecifiers.getNodeModulesPackageName = getNodeModulesPackageName; function getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, preferences) { var info = getInfo(importingSourceFileName, host); var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host); - return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); }) || - getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences); + return ts.firstDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions); }) || + getLocalModuleSpecifier(toFileName, info, compilerOptions, preferences); } /** Returns an import for each symlink and for the realpath. */ function getModuleSpecifiers(moduleSymbol, compilerOptions, importingSourceFile, host, userPreferences) { @@ -110205,46 +107688,8 @@ var ts; var moduleSourceFile = ts.getSourceFileOfNode(moduleSymbol.valueDeclaration || ts.getNonAugmentationDeclaration(moduleSymbol)); var modulePaths = getAllModulePaths(importingSourceFile.path, moduleSourceFile.originalFileName, host); var preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile); - var importedFileIsInNodeModules = ts.some(modulePaths, function (p) { return p.isInNodeModules; }); - // Module specifier priority: - // 1. "Bare package specifiers" (e.g. "@foo/bar") resulting from a path through node_modules to a package.json's "types" entry - // 2. Specifiers generated using "paths" from tsconfig - // 3. Non-relative specfiers resulting from a path through node_modules (e.g. "@foo/bar/path/to/file") - // 4. Relative paths - var nodeModulesSpecifiers; - var pathsSpecifiers; - var relativeSpecifiers; - for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) { - var modulePath = modulePaths_1[_i]; - var specifier = tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); - nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier); - if (specifier && modulePath.isRedirect) { - // If we got a specifier for a redirect, it was a bare package specifier (e.g. "@foo/bar", - // not "@foo/bar/path/to/file"). No other specifier will be this good, so stop looking. - return nodeModulesSpecifiers; - } - if (!specifier && !modulePath.isRedirect) { - var local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, preferences); - if (ts.pathIsBareSpecifier(local)) { - pathsSpecifiers = ts.append(pathsSpecifiers, local); - } - else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) { - // Why this extra conditional, not just an `else`? If some path to the file contained - // 'node_modules', but we can't create a non-relative specifier (e.g. "@foo/bar/path/to/file"), - // that means we had to go through a *sibling's* node_modules, not one we can access directly. - // If some path to the file was in node_modules but another was not, this likely indicates that - // we have a monorepo structure with symlinks. In this case, the non-node_modules path is - // probably the realpath, e.g. "../bar/path/to/file", but a relative path to another package - // in a monorepo is probably not portable. So, the module specifier we actually go with will be - // the relative path through node_modules, so that the declaration emitter can produce a - // portability error. (See declarationEmitReexportedSymlinkReference3) - relativeSpecifiers = ts.append(relativeSpecifiers, local); - } - } - } - return (pathsSpecifiers === null || pathsSpecifiers === void 0 ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : - (nodeModulesSpecifiers === null || nodeModulesSpecifiers === void 0 ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : - ts.Debug.checkDefined(relativeSpecifiers); + var global = ts.mapDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions); }); + return global.length ? global : modulePaths.map(function (moduleFileName) { return getLocalModuleSpecifier(moduleFileName, info, compilerOptions, preferences); }); } moduleSpecifiers.getModuleSpecifiers = getModuleSpecifiers; // importingSourceFileName is separate because getEditsForFileRename may need to specify an updated path @@ -110253,26 +107698,22 @@ var ts; var sourceDirectory = ts.getDirectoryPath(importingSourceFileName); return { getCanonicalFileName: getCanonicalFileName, sourceDirectory: sourceDirectory }; } - function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, host, _b) { + function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, _b) { var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory; var ending = _b.ending, relativePreference = _b.relativePreference; var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs; var relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) || removeExtensionAndIndexPostFix(ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions); - if (!baseUrl && !paths || relativePreference === 0 /* Relative */) { + if (!baseUrl || relativePreference === 0 /* Relative */) { return relativePath; } - var baseDirectory = ts.getPathsBasePath(compilerOptions, host) || baseUrl; - var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseDirectory, getCanonicalFileName); + var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); if (!relativeToBaseUrl) { return relativePath; } var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions); var fromPaths = paths && tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); - var nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths; - if (!nonRelative) { - return relativePath; - } + var nonRelative = fromPaths === undefined ? importRelativeToBaseUrl : fromPaths; if (relativePreference === 1 /* NonRelative */) { return nonRelative; } @@ -110301,8 +107742,8 @@ var ts; var match = str.match(/\//g); return match ? match.length : 0; } - function comparePathsByRedirectAndNumberOfDirectorySeparators(a, b) { - return ts.compareBooleans(b.isRedirect, a.isRedirect) || ts.compareValues(numberOfDirectorySeparators(a.path), numberOfDirectorySeparators(b.path)); + function comparePathsByNumberOfDirectorySeparators(a, b) { + return ts.compareValues(numberOfDirectorySeparators(a), numberOfDirectorySeparators(b)); } function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) { var getCanonicalFileName = ts.hostGetCanonicalFileName(host); @@ -110312,36 +107753,34 @@ var ts; var importedFileNames = __spreadArrays((referenceRedirect ? [referenceRedirect] : ts.emptyArray), [importedFileName], redirects); var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); }); if (!preferSymlinks) { - var result_15 = ts.forEach(targets, function (p) { return cb(p, referenceRedirect === p); }); - if (result_15) - return result_15; + var result_13 = ts.forEach(targets, cb); + if (result_13) + return result_13; } var links = host.getSymlinkCache ? host.getSymlinkCache() : ts.discoverProbableSymlinks(host.getSourceFiles(), getCanonicalFileName, cwd); var symlinkedDirectories = links.getSymlinkedDirectories(); - var useCaseSensitiveFileNames = !host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames(); + var compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive; var result = symlinkedDirectories && ts.forEachEntry(symlinkedDirectories, function (resolved, path) { if (resolved === false) return undefined; if (ts.startsWithDirectory(importingFileName, resolved.realPath, getCanonicalFileName)) { return undefined; // Don't want to a package to globally import from itself } - return ts.forEach(targets, function (target) { - if (!ts.containsPath(resolved.real, target, !useCaseSensitiveFileNames)) { - return; - } - var relative = ts.getRelativePathFromDirectory(resolved.real, target, getCanonicalFileName); - var option = ts.resolvePath(path, relative); - if (!host.fileExists || host.fileExists(option)) { - var result_16 = cb(option, target === referenceRedirect); - if (result_16) - return result_16; - } - }); + var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.real.length), resolved.real) === 0 /* EqualTo */; }); + if (target === undefined) + return undefined; + var relative = ts.getRelativePathFromDirectory(resolved.real, target, getCanonicalFileName); + var option = ts.resolvePath(path, relative); + if (!host.fileExists || host.fileExists(option)) { + var result_14 = cb(option); + if (result_14) + return result_14; + } }); return result || - (preferSymlinks ? ts.forEach(targets, function (p) { return cb(p, p === referenceRedirect); }) : undefined); + (preferSymlinks ? ts.forEach(targets, cb) : undefined); } moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule; /** @@ -110354,27 +107793,28 @@ var ts; var allFileNames = new ts.Map(); var importedFileFromNodeModules = false; forEachFileNameOfModule(importingFileName, importedFileName, host, - /*preferSymlinks*/ true, function (path, isRedirect) { - var isInNodeModules = ts.pathContainsNodeModules(path); - allFileNames.set(path, { path: getCanonicalFileName(path), isRedirect: isRedirect, isInNodeModules: isInNodeModules }); - importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules; - // don't return value, so we collect everything + /*preferSymlinks*/ true, function (path) { + // dont return value, so we collect everything + allFileNames.set(path, getCanonicalFileName(path)); + importedFileFromNodeModules = importedFileFromNodeModules || ts.pathContainsNodeModules(path); }); // Sort by paths closest to importing file Name directory var sortedPaths = []; - var _loop_24 = function (directory) { + var _loop_23 = function (directory) { var directoryStart = ts.ensureTrailingDirectorySeparator(directory); var pathsInDirectory; - allFileNames.forEach(function (_a, fileName) { - var path = _a.path, isRedirect = _a.isRedirect, isInNodeModules = _a.isInNodeModules; - if (ts.startsWith(path, directoryStart)) { - (pathsInDirectory || (pathsInDirectory = [])).push({ path: fileName, isRedirect: isRedirect, isInNodeModules: isInNodeModules }); + allFileNames.forEach(function (canonicalFileName, fileName) { + if (ts.startsWith(canonicalFileName, directoryStart)) { + // If the importedFile is from node modules, use only paths in node_modules folder as option + if (!importedFileFromNodeModules || ts.pathContainsNodeModules(fileName)) { + (pathsInDirectory || (pathsInDirectory = [])).push(fileName); + } allFileNames.delete(fileName); } }); if (pathsInDirectory) { if (pathsInDirectory.length > 1) { - pathsInDirectory.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + pathsInDirectory.sort(comparePathsByNumberOfDirectorySeparators); } sortedPaths.push.apply(sortedPaths, pathsInDirectory); } @@ -110386,7 +107826,7 @@ var ts; }; var out_directory_1; for (var directory = ts.getDirectoryPath(ts.toPath(importingFileName, cwd, getCanonicalFileName)); allFileNames.size !== 0;) { - var state_8 = _loop_24(directory); + var state_8 = _loop_23(directory); directory = out_directory_1; if (state_8 === "break") break; @@ -110394,7 +107834,7 @@ var ts; if (allFileNames.size) { var remainingPaths = ts.arrayFrom(allFileNames.values()); if (remainingPaths.length > 1) - remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + remainingPaths.sort(comparePathsByNumberOfDirectorySeparators); sortedPaths.push.apply(sortedPaths, remainingPaths); } return sortedPaths; @@ -110439,43 +107879,37 @@ var ts; ? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions) : ts.removeFileExtension(relativePath); } - function tryGetModuleNameAsNodeModule(_a, _b, host, options, packageNameOnly) { - var path = _a.path, isRedirect = _a.isRedirect; - var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory; + function tryGetModuleNameAsNodeModule(moduleFileName, _a, host, options, packageNameOnly) { + var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory; if (!host.fileExists || !host.readFile) { return undefined; } - var parts = getNodeModulePathParts(path); + var parts = getNodeModulePathParts(moduleFileName); if (!parts) { return undefined; } // Simplify the full file path to something that can be resolved by Node. - var moduleSpecifier = path; - var isPackageRootPath = false; + var moduleSpecifier = moduleFileName; if (!packageNameOnly) { var packageRootIndex = parts.packageRootIndex; var moduleFileNameForExtensionless = void 0; while (true) { // If the module could be imported by a directory name, use that directory's name - var _c = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _c.moduleFileToTry, packageRootPath = _c.packageRootPath; + var _b = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _b.moduleFileToTry, packageRootPath = _b.packageRootPath; if (packageRootPath) { moduleSpecifier = packageRootPath; - isPackageRootPath = true; break; } if (!moduleFileNameForExtensionless) moduleFileNameForExtensionless = moduleFileToTry; // try with next level of directory - packageRootIndex = path.indexOf(ts.directorySeparator, packageRootIndex + 1); + packageRootIndex = moduleFileName.indexOf(ts.directorySeparator, packageRootIndex + 1); if (packageRootIndex === -1) { moduleSpecifier = getExtensionlessFileName(moduleFileNameForExtensionless); break; } } } - if (isRedirect && !isPackageRootPath) { - return undefined; - } var globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); // Get a path that's relative to node_modules or the importing file's path // if node_modules folder is in this folder or any of its parent folders, no need to keep it. @@ -110489,16 +107923,16 @@ var ts; // For classic resolution, only allow importing from node_modules/@types, not other node_modules return ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs && packageName === nodeModulesDirectoryName ? undefined : packageName; function tryDirectoryWithPackageJson(packageRootIndex) { - var packageRootPath = path.substring(0, packageRootIndex); + var packageRootPath = moduleFileName.substring(0, packageRootIndex); var packageJsonPath = ts.combinePaths(packageRootPath, "package.json"); - var moduleFileToTry = path; + var moduleFileToTry = moduleFileName; if (host.fileExists(packageJsonPath)) { var packageJsonContent = JSON.parse(host.readFile(packageJsonPath)); var versionPaths = packageJsonContent.typesVersions ? ts.getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions) : undefined; if (versionPaths) { - var subModuleName = path.slice(packageRootPath.length + 1); + var subModuleName = moduleFileName.slice(packageRootPath.length + 1); var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(subModuleName), removeExtensionAndIndexPostFix(subModuleName, 0 /* Minimal */, options), versionPaths.paths); if (fromPaths !== undefined) { moduleFileToTry = ts.combinePaths(packageRootPath, fromPaths); @@ -110902,7 +108336,7 @@ var ts; ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost; function setGetSourceFileAsHashVersioned(compilerHost, host) { var originalGetSourceFile = compilerHost.getSourceFile; - var computeHash = ts.maybeBind(host, host.createHash) || ts.generateDjb2Hash; + var computeHash = host.createHash || ts.generateDjb2Hash; compilerHost.getSourceFile = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -110910,7 +108344,7 @@ var ts; } var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args)); if (result) { - result.version = computeHash(result.text); + result.version = computeHash.call(host, result.text); } return result; }; @@ -111429,7 +108863,7 @@ var ts; } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); - var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions); + var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost); if (ts.updateErrorForNoInputFiles(result, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) { hasChangedConfigFileParsingErrors = true; } @@ -111515,7 +108949,6 @@ var ts; fileOrDirectoryPath: fileOrDirectoryPath, configFileName: configFileName, configFileSpecs: configFileSpecs, - extraFileExtensions: extraFileExtensions, options: compilerOptions, program: getCurrentBuilderProgram(), currentDirectory: currentDirectory, @@ -113104,7 +110537,7 @@ var ts; function nowString() { // E.g. "12:34:56.789" var d = new Date(); - return ts.padLeft(d.getHours().toString(), 2, "0") + ":" + ts.padLeft(d.getMinutes().toString(), 2, "0") + ":" + ts.padLeft(d.getSeconds().toString(), 2, "0") + "." + ts.padLeft(d.getMilliseconds().toString(), 3, "0"); + return d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + "." + d.getMilliseconds(); } server.nowString = nowString; })(server = ts.server || (ts.server = {})); @@ -113214,9 +110647,7 @@ var ts; var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); getTypingNamesFromPackagesFolder(nodeModulesPath, filesToWatch); }); - if (!typeAcquisition.disableFilenameBasedTypeAcquisition) { - getTypingNamesFromSourceFileNames(fileNames); - } + getTypingNamesFromSourceFileNames(fileNames); // add typings for unresolved imports if (unresolvedImports) { var module_1 = ts.deduplicate(unresolvedImports.map(nonRelativeModuleNameForTypingCache), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); @@ -113477,11 +110908,6 @@ var ts; })(LanguageServiceMode = ts.LanguageServiceMode || (ts.LanguageServiceMode = {})); /* @internal */ ts.emptyOptions = {}; - var SemanticClassificationFormat; - (function (SemanticClassificationFormat) { - SemanticClassificationFormat["Original"] = "original"; - SemanticClassificationFormat["TwentyTwenty"] = "2020"; - })(SemanticClassificationFormat = ts.SemanticClassificationFormat || (ts.SemanticClassificationFormat = {})); var HighlightSpanKind; (function (HighlightSpanKind) { HighlightSpanKind["none"] = "none"; @@ -113755,37 +111181,37 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 287 /* CatchClause */: - case 280 /* JsxAttribute */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 284 /* CatchClause */: + case 277 /* JsxAttribute */: return 1 /* Value */; - case 159 /* TypeParameter */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 177 /* TypeLiteral */: + case 158 /* TypeParameter */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 176 /* TypeLiteral */: return 2 /* Type */; - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 291 /* EnumMember */: - case 252 /* ClassDeclaration */: + case 288 /* EnumMember */: + case 249 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -113795,16 +111221,16 @@ var ts; else { return 4 /* Namespace */; } - case 255 /* EnumDeclaration */: - case 264 /* NamedImports */: - case 265 /* ImportSpecifier */: - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 252 /* EnumDeclaration */: + case 261 /* NamedImports */: + case 262 /* ImportSpecifier */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -113812,13 +111238,13 @@ var ts; ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 266 /* ExportAssignment */ - || node.parent.kind === 272 /* ExternalModuleReference */ - || node.parent.kind === 265 /* ImportSpecifier */ - || node.parent.kind === 262 /* ImportClause */ + else if (node.parent.kind === 263 /* ExportAssignment */ + || node.parent.kind === 269 /* ExternalModuleReference */ + || node.parent.kind === 262 /* ImportSpecifier */ + || node.parent.kind === 259 /* ImportClause */ || ts.isImportEqualsDeclaration(node.parent) && node === node.parent.name) { return 7 /* All */; } @@ -113828,9 +111254,6 @@ var ts; else if (ts.isDeclarationName(node)) { return getMeaningFromDeclaration(node.parent); } - else if (ts.isEntityName(node) && ts.isJSDocNameReference(node.parent)) { - return 7 /* All */; - } else if (isTypeReference(node)) { return 2 /* Type */; } @@ -113854,11 +111277,11 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - var name = node.kind === 157 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; - return name && name.parent.kind === 260 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + var name = node.kind === 156 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 257 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 157 /* QualifiedName */) { + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -113870,27 +111293,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 157 /* QualifiedName */) { - while (root.parent && root.parent.kind === 157 /* QualifiedName */) { + if (root.parent.kind === 156 /* QualifiedName */) { + while (root.parent && root.parent.kind === 156 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 173 /* TypeReference */ && !isLastClause; + return root.parent.kind === 172 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 201 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 201 /* PropertyAccessExpression */) { + if (root.parent.kind === 198 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 198 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 223 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 286 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 220 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 283 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 252 /* ClassDeclaration */ && root.parent.parent.token === 116 /* ImplementsKeyword */) || - (decl.kind === 253 /* InterfaceDeclaration */ && root.parent.parent.token === 93 /* ExtendsKeyword */); + return (decl.kind === 249 /* ClassDeclaration */ && root.parent.parent.token === 116 /* ImplementsKeyword */) || + (decl.kind === 250 /* InterfaceDeclaration */ && root.parent.parent.token === 93 /* ExtendsKeyword */); } return false; } @@ -113901,15 +111324,15 @@ var ts; switch (node.kind) { case 107 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 187 /* ThisType */: + case 186 /* ThisType */: return true; } switch (node.parent.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return true; - case 195 /* ImportType */: + case 192 /* ImportType */: return !node.parent.isTypeOf; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; @@ -113976,7 +111399,7 @@ var ts; ts.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 245 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 242 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -114037,22 +111460,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 288 /* PropertyAssignment */: - case 291 /* EnumMember */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 256 /* ModuleDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 285 /* PropertyAssignment */: + case 288 /* EnumMember */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 253 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return true; - case 191 /* LiteralType */: - return node.parent.parent.kind === 189 /* IndexedAccessType */; + case 190 /* LiteralType */: + return node.parent.parent.kind === 188 /* IndexedAccessType */; default: return false; } @@ -114076,17 +111499,17 @@ var ts; return undefined; } switch (node.kind) { - case 297 /* SourceFile */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 256 /* ModuleDeclaration */: + case 294 /* SourceFile */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: return node; } } @@ -114094,54 +111517,54 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return "class" /* classElement */; - case 253 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 254 /* TypeAliasDeclaration */: - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: + case 250 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 251 /* TypeAliasDeclaration */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 255 /* EnumDeclaration */: return "enum" /* enumElement */; - case 249 /* VariableDeclaration */: + case 252 /* EnumDeclaration */: return "enum" /* enumElement */; + case 246 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 209 /* ArrowFunction */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return "function" /* functionElement */; - case 167 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 168 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 166 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 167 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: var initializer = node.initializer; return ts.isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 289 /* ShorthandPropertyAssignment */: - case 290 /* SpreadAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 286 /* ShorthandPropertyAssignment */: + case 287 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 171 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 170 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 169 /* CallSignature */: return "call" /* callSignatureElement */; - case 166 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 159 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 291 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 160 /* Parameter */: return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 260 /* ImportEqualsDeclaration */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: - case 263 /* NamespaceImport */: - case 269 /* NamespaceExport */: + case 170 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 169 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 168 /* CallSignature */: return "call" /* callSignatureElement */; + case 165 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 158 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 288 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 159 /* Parameter */: return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 257 /* ImportEqualsDeclaration */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: + case 260 /* NamespaceImport */: + case 266 /* NamespaceExport */: return "alias" /* alias */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var kind = ts.getAssignmentDeclarationKind(node); var right = node.right; switch (kind) { @@ -114170,7 +111593,7 @@ var ts; } case 78 /* Identifier */: return ts.isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: var scriptKind = getNodeKind(node.expression); // If the expression didn't come back with something (like it does for an identifiers) return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; @@ -114193,7 +111616,7 @@ var ts; return true; case 78 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 160 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 159 /* Parameter */; default: return false; } @@ -114258,42 +111681,42 @@ var ts; return false; } switch (n.kind) { - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 200 /* ObjectLiteralExpression */: - case 196 /* ObjectBindingPattern */: - case 177 /* TypeLiteral */: - case 230 /* Block */: - case 257 /* ModuleBlock */: - case 258 /* CaseBlock */: - case 264 /* NamedImports */: - case 268 /* NamedExports */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 197 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 176 /* TypeLiteral */: + case 227 /* Block */: + case 254 /* ModuleBlock */: + case 255 /* CaseBlock */: + case 261 /* NamedImports */: + case 265 /* NamedExports */: return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 204 /* NewExpression */: + case 201 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 203 /* CallExpression */: - case 207 /* ParenthesizedExpression */: - case 186 /* ParenthesizedType */: + case 200 /* CallExpression */: + case 204 /* ParenthesizedExpression */: + case 185 /* ParenthesizedType */: return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 170 /* ConstructSignature */: - case 169 /* CallSignature */: - case 209 /* ArrowFunction */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 169 /* ConstructSignature */: + case 168 /* CallSignature */: + case 206 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -114303,65 +111726,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 234 /* IfStatement */: + case 231 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile); - case 199 /* ArrayLiteralExpression */: - case 197 /* ArrayBindingPattern */: - case 202 /* ElementAccessExpression */: - case 158 /* ComputedPropertyName */: - case 179 /* TupleType */: + case 196 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 199 /* ElementAccessExpression */: + case 157 /* ComputedPropertyName */: + case 178 /* TupleType */: return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 236 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 233 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 235 /* DoStatement */: + case 232 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 114 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 211 /* TypeOfExpression */: - case 210 /* DeleteExpression */: - case 212 /* VoidExpression */: - case 219 /* YieldExpression */: - case 220 /* SpreadElement */: + case 208 /* TypeOfExpression */: + case 207 /* DeleteExpression */: + case 209 /* VoidExpression */: + case 216 /* YieldExpression */: + case 217 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 267 /* ExportDeclaration */: - case 261 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -114468,11 +111891,11 @@ var ts; function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return getAdjustedLocationForFunction(node); } } @@ -114567,11 +111990,11 @@ var ts; node.kind === 97 /* FunctionKeyword */ ? ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(node) : node.kind === 117 /* InterfaceKeyword */ ? ts.isInterfaceDeclaration(parent) : node.kind === 91 /* EnumKeyword */ ? ts.isEnumDeclaration(parent) : - node.kind === 149 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : - node.kind === 140 /* NamespaceKeyword */ || node.kind === 139 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : + node.kind === 148 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : + node.kind === 139 /* NamespaceKeyword */ || node.kind === 138 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : node.kind === 99 /* ImportKeyword */ ? ts.isImportEqualsDeclaration(parent) : node.kind === 134 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : - node.kind === 146 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { + node.kind === 145 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { var location = getAdjustedLocationForDeclaration(parent, forRename); if (location) { return location; @@ -114585,7 +112008,7 @@ var ts; return decl.name; } } - if (node.kind === 149 /* TypeKeyword */) { + if (node.kind === 148 /* TypeKeyword */) { // import /**/type [|name|] from ...; // import /**/type { [|name|] } from ...; // import /**/type { propertyName as [|name|] } from ...; @@ -114652,12 +112075,12 @@ var ts; } } // import name = /**/require("[|module|]"); - if (node.kind === 143 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { + if (node.kind === 142 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { return parent.expression; } // import ... /**/from "[|module|]"; // export ... /**/from "[|module|]"; - if (node.kind === 153 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { + if (node.kind === 152 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { return parent.moduleSpecifier; } // class ... /**/extends [|name|] ... @@ -114690,12 +112113,12 @@ var ts; return parent.name; } // /**/keyof [|T|] - if (node.kind === 138 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 138 /* KeyOfKeyword */ && + if (node.kind === 137 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 137 /* KeyOfKeyword */ && ts.isTypeReferenceNode(parent.type)) { return parent.type.typeName; } // /**/readonly [|name|][] - if (node.kind === 142 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 142 /* ReadonlyKeyword */ && + if (node.kind === 141 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 141 /* ReadonlyKeyword */ && ts.isArrayTypeNode(parent.type) && ts.isTypeReferenceNode(parent.type.elementType)) { return parent.type.elementType.typeName; } @@ -114732,7 +112155,7 @@ var ts; // for (... /**/in [|name|]) // for (... /**/of [|name|]) if (node.kind === 100 /* InKeyword */ && ts.isForInStatement(parent) || - node.kind === 156 /* OfKeyword */ && ts.isForOfStatement(parent)) { + node.kind === 155 /* OfKeyword */ && ts.isForOfStatement(parent)) { return ts.skipOuterExpressions(parent.expression); } } @@ -114850,21 +112273,7 @@ var ts; return n; } var children = n.getChildren(sourceFile); - var i = ts.binarySearchKey(children, position, function (_, i) { return i; }, function (middle, _) { - // This last callback is more of a selector than a comparator - - // `EqualTo` causes the `middle` result to be returned - // `GreaterThan` causes recursion on the left of the middle - // `LessThan` causes recursion on the right of the middle - if (position < children[middle].end) { - // first element whose end position is greater than the input position - if (!children[middle - 1] || position >= children[middle - 1].end) { - return 0 /* EqualTo */; - } - return 1 /* GreaterThan */; - } - return -1 /* LessThan */; - }); - if (i >= 0 && children[i]) { + for (var i = 0; i < children.length; i++) { var child = children[i]; // Note that the span of a node's tokens is [node.getStart(...), node.end). // Given that `position < child.end` and child has constituent tokens, we distinguish these cases: @@ -114887,7 +112296,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 297 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 294 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -114905,9 +112314,6 @@ var ts; return n; } var children = n.getChildren(sourceFile); - if (children.length === 0) { - return n; - } var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length, sourceFile); return candidate && findRightmostToken(candidate, sourceFile); } @@ -114960,17 +112366,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 283 /* JsxExpression */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 280 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 283 /* JsxExpression */) { + if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 280 /* JsxExpression */) { return true; } //
|
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 276 /* JsxClosingElement */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 273 /* JsxClosingElement */) { return true; } return false; @@ -115001,7 +112407,7 @@ var ts; function isInsideJsxElement(sourceFile, position) { function isInsideJsxElementTraversal(node) { while (node) { - if (node.kind >= 274 /* JsxSelfClosingElement */ && node.kind <= 283 /* JsxExpression */ + if (node.kind >= 271 /* JsxSelfClosingElement */ && node.kind <= 280 /* JsxExpression */ || node.kind === 11 /* JsxText */ || node.kind === 29 /* LessThanToken */ || node.kind === 31 /* GreaterThanToken */ @@ -115011,7 +112417,7 @@ var ts; || node.kind === 43 /* SlashToken */) { node = node.parent; } - else if (node.kind === 273 /* JsxElement */) { + else if (node.kind === 270 /* JsxElement */) { if (position > node.getStart(sourceFile)) return true; node = node.parent; @@ -115138,7 +112544,7 @@ var ts; // falls through case 111 /* TypeOfKeyword */: case 93 /* ExtendsKeyword */: - case 138 /* KeyOfKeyword */: + case 137 /* KeyOfKeyword */: case 24 /* DotToken */: case 51 /* BarToken */: case 57 /* QuestionToken */: @@ -115195,16 +112601,16 @@ var ts; result.push("deprecated" /* deprecatedModifier */); if (node.flags & 8388608 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 266 /* ExportAssignment */) + if (node.kind === 263 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 173 /* TypeReference */ || node.kind === 203 /* CallExpression */) { + if (node.kind === 172 /* TypeReference */ || node.kind === 200 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 252 /* ClassDeclaration */ || node.kind === 253 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 249 /* ClassDeclaration */ || node.kind === 250 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -115249,18 +112655,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 199 /* ArrayLiteralExpression */ || - node.kind === 200 /* ObjectLiteralExpression */) { + if (node.kind === 196 /* ArrayLiteralExpression */ || + node.kind === 197 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 216 /* BinaryExpression */ && + if (node.parent.kind === 213 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 239 /* ForOfStatement */ && + if (node.parent.kind === 236 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -115268,7 +112674,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 288 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 285 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -115332,29 +112738,29 @@ var ts; ts.typeKeywords = [ 128 /* AnyKeyword */, 127 /* AssertsKeyword */, - 155 /* BigIntKeyword */, + 154 /* BigIntKeyword */, 131 /* BooleanKeyword */, 94 /* FalseKeyword */, - 138 /* KeyOfKeyword */, - 141 /* NeverKeyword */, + 137 /* KeyOfKeyword */, + 140 /* NeverKeyword */, 103 /* NullKeyword */, - 144 /* NumberKeyword */, - 145 /* ObjectKeyword */, - 142 /* ReadonlyKeyword */, - 147 /* StringKeyword */, - 148 /* SymbolKeyword */, + 143 /* NumberKeyword */, + 144 /* ObjectKeyword */, + 141 /* ReadonlyKeyword */, + 146 /* StringKeyword */, + 147 /* SymbolKeyword */, 109 /* TrueKeyword */, 113 /* VoidKeyword */, - 150 /* UndefinedKeyword */, - 151 /* UniqueKeyword */, - 152 /* UnknownKeyword */, + 149 /* UndefinedKeyword */, + 150 /* UniqueKeyword */, + 151 /* UnknownKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); } ts.isTypeKeyword = isTypeKeyword; function isTypeKeywordToken(node) { - return node.kind === 149 /* TypeKeyword */; + return node.kind === 148 /* TypeKeyword */; } ts.isTypeKeywordToken = isTypeKeywordToken; /** True if the symbol is for an external module, as opposed to a namespace. */ @@ -115387,7 +112793,7 @@ var ts; } ts.skipConstraint = skipConstraint; function getNameFromPropertyName(name) { - return name.kind === 158 /* ComputedPropertyName */ + return name.kind === 157 /* ComputedPropertyName */ // treat computed property names where expression is string/numeric literal as just string/numeric literal ? ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined : ts.isPrivateIdentifier(name) ? ts.idText(name) : ts.getTextOfIdentifierOrLiteral(name); @@ -115418,7 +112824,7 @@ var ts; getSourceFiles: function () { return program.getSourceFiles(); }, redirectTargetsMap: program.redirectTargetsMap, getProjectReferenceRedirect: function (fileName) { return program.getProjectReferenceRedirect(fileName); }, - isSourceOfProjectReferenceRedirect: function (fileName) { return program.isSourceOfProjectReferenceRedirect(fileName); } + isSourceOfProjectReferenceRedirect: function (fileName) { return program.isSourceOfProjectReferenceRedirect(fileName); }, }; } ts.createModuleSpecifierResolutionHost = createModuleSpecifierResolutionHost; @@ -115456,9 +112862,7 @@ var ts; return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */; } else { - // ignore synthetic import added when importHelpers: true - var firstModuleSpecifier = sourceFile.imports && - ts.find(sourceFile.imports, function (n) { return ts.isStringLiteral(n) && !ts.nodeIsSynthesized(n.parent); }); + var firstModuleSpecifier = sourceFile.imports && ts.find(sourceFile.imports, ts.isStringLiteral); return firstModuleSpecifier ? quotePreferenceFromString(firstModuleSpecifier, sourceFile) : 1 /* Double */; } } @@ -115550,7 +112954,7 @@ var ts; ts.findModifier = findModifier; function insertImports(changes, sourceFile, imports, blankLineBetween) { var decl = ts.isArray(imports) ? imports[0] : imports; - var importKindPredicate = decl.kind === 232 /* VariableStatement */ ? ts.isRequireVariableStatement : ts.isAnyImportSyntax; + var importKindPredicate = decl.kind === 229 /* VariableStatement */ ? ts.isRequireVariableStatement : ts.isAnyImportSyntax; var existingImportStatements = ts.filter(sourceFile.statements, importKindPredicate); var sortedNewImports = ts.isArray(imports) ? ts.stableSort(imports, ts.OrganizeImports.compareImportsOrRequireStatements) : [imports]; if (!existingImportStatements.length) { @@ -115561,10 +112965,7 @@ var ts; var newImport = sortedNewImports_1[_i]; var insertionIndex = ts.OrganizeImports.getImportDeclarationInsertionIndex(existingImportStatements, newImport); if (insertionIndex === 0) { - // If the first import is top-of-file, insert after the leading comment which is likely the header. - var options = existingImportStatements[0] === sourceFile.statements[0] ? - { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude } : {}; - changes.insertNodeBefore(sourceFile, existingImportStatements[0], newImport, /*blankLineBetween*/ false, options); + changes.insertNodeBefore(sourceFile, existingImportStatements[0], newImport, /*blankLineBetween*/ false); } else { var prevImport = existingImportStatements[insertionIndex - 1]; @@ -115628,7 +113029,7 @@ var ts; // Display-part writer helpers // #region function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 160 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 159 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -115909,22 +113310,36 @@ var ts; return clone; } ts.getSynthesizedDeepClone = getSynthesizedDeepClone; - function getSynthesizedDeepCloneWithReplacements(node, includeTrivia, replaceNode) { - var clone = replaceNode(node); - if (clone) { - ts.setOriginalNode(clone, node); + function getSynthesizedDeepCloneWithRenames(node, includeTrivia, renameMap, checker, callback) { + if (includeTrivia === void 0) { includeTrivia = true; } + var clone; + if (renameMap && checker && ts.isBindingElement(node) && ts.isIdentifier(node.name) && ts.isObjectBindingPattern(node.parent)) { + var symbol = checker.getSymbolAtLocation(node.name); + var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); + if (renameInfo && renameInfo.text !== (node.name || node.propertyName).getText()) { + clone = ts.setOriginalNode(ts.factory.createBindingElement(node.dotDotDotToken, node.propertyName || node.name, renameInfo, node.initializer), node); + } } - else { - clone = getSynthesizedDeepCloneWorker(node, replaceNode); + else if (renameMap && checker && ts.isIdentifier(node)) { + var symbol = checker.getSymbolAtLocation(node); + var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); + if (renameInfo) { + clone = ts.setOriginalNode(ts.factory.createIdentifier(renameInfo.text), node); + } + } + if (!clone) { + clone = getSynthesizedDeepCloneWorker(node, renameMap, checker, callback); } if (clone && !includeTrivia) suppressLeadingAndTrailingTrivia(clone); + if (callback && clone) + callback(node, clone); return clone; } - ts.getSynthesizedDeepCloneWithReplacements = getSynthesizedDeepCloneWithReplacements; - function getSynthesizedDeepCloneWorker(node, replaceNode) { - var visited = replaceNode ? - ts.visitEachChild(node, function (n) { return getSynthesizedDeepCloneWithReplacements(n, /*includeTrivia*/ true, replaceNode); }, ts.nullTransformationContext) : + ts.getSynthesizedDeepCloneWithRenames = getSynthesizedDeepCloneWithRenames; + function getSynthesizedDeepCloneWorker(node, renameMap, checker, callback) { + var visited = (renameMap || checker || callback) ? + ts.visitEachChild(node, wrapper, ts.nullTransformationContext) : ts.visitEachChild(node, getSynthesizedDeepClone, ts.nullTransformationContext); if (visited === node) { // This only happens for leaf nodes - internal nodes always see their children change. @@ -115938,16 +113353,15 @@ var ts; // would have made. visited.parent = undefined; return visited; + function wrapper(node) { + return getSynthesizedDeepCloneWithRenames(node, /*includeTrivia*/ true, renameMap, checker, callback); + } } function getSynthesizedDeepClones(nodes, includeTrivia) { if (includeTrivia === void 0) { includeTrivia = true; } return nodes && ts.factory.createNodeArray(nodes.map(function (n) { return getSynthesizedDeepClone(n, includeTrivia); }), nodes.hasTrailingComma); } ts.getSynthesizedDeepClones = getSynthesizedDeepClones; - function getSynthesizedDeepClonesWithReplacements(nodes, includeTrivia, replaceNode) { - return ts.factory.createNodeArray(nodes.map(function (n) { return getSynthesizedDeepCloneWithReplacements(n, includeTrivia, replaceNode); }), nodes.hasTrailingComma); - } - ts.getSynthesizedDeepClonesWithReplacements = getSynthesizedDeepClonesWithReplacements; /** * Sets EmitFlags to suppress leading and trailing trivia on the node. */ @@ -116092,26 +113506,35 @@ var ts; function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 204 /* NewExpression */: + case 201 /* NewExpression */: return checker.getContextualType(parent); - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 284 /* CaseClause */: + case 281 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); } } ts.getContextualTypeFromParent = getContextualTypeFromParent; - function quote(sourceFile, preferences, text) { + function quote(text, preferences) { // Editors can pass in undefined or empty string - we want to infer the preference in those cases. - var quotePreference = getQuotePreference(sourceFile, preferences); + var quotePreference = preferences.quotePreference || "auto"; var quoted = JSON.stringify(text); - return quotePreference === 0 /* Single */ ? "'" + ts.stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'" : quoted; + switch (quotePreference) { + // TODO use getQuotePreference to infer the actual quote style. + case "auto": + case "double": + return quoted; + case "single": + return "'" + ts.stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'"; + default: + return ts.Debug.assertNever(quotePreference); + } } ts.quote = quote; function isEqualityOperatorKind(kind) { @@ -116130,8 +113553,8 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: - case 205 /* TaggedTemplateExpression */: + case 215 /* TemplateExpression */: + case 202 /* TaggedTemplateExpression */: return true; default: return false; @@ -116151,7 +113574,7 @@ var ts; var checker = program.getTypeChecker(); var typeIsAccessible = true; var notAccessible = function () { typeIsAccessible = false; }; - var res = checker.typeToTypeNode(type, enclosingScope, 1 /* NoTruncation */, { + var res = checker.typeToTypeNode(type, enclosingScope, /*flags*/ undefined, { trackSymbol: function (symbol, declaration, meaning) { typeIsAccessible = typeIsAccessible && checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility === 0 /* Accessible */; }, @@ -116164,41 +113587,41 @@ var ts; } ts.getTypeNodeIfAccessible = getTypeNodeIfAccessible; function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 169 /* CallSignature */ - || kind === 170 /* ConstructSignature */ - || kind === 171 /* IndexSignature */ - || kind === 162 /* PropertySignature */ - || kind === 164 /* MethodSignature */; + return kind === 168 /* CallSignature */ + || kind === 169 /* ConstructSignature */ + || kind === 170 /* IndexSignature */ + || kind === 161 /* PropertySignature */ + || kind === 163 /* MethodSignature */; } ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI; function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 251 /* FunctionDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 248 /* FunctionDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI; function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 256 /* ModuleDeclaration */; + return kind === 253 /* ModuleDeclaration */; } ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI; function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 232 /* VariableStatement */ - || kind === 233 /* ExpressionStatement */ - || kind === 235 /* DoStatement */ - || kind === 240 /* ContinueStatement */ - || kind === 241 /* BreakStatement */ - || kind === 242 /* ReturnStatement */ - || kind === 246 /* ThrowStatement */ - || kind === 248 /* DebuggerStatement */ - || kind === 163 /* PropertyDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 267 /* ExportDeclaration */ - || kind === 259 /* NamespaceExportDeclaration */ - || kind === 266 /* ExportAssignment */; + return kind === 229 /* VariableStatement */ + || kind === 230 /* ExpressionStatement */ + || kind === 232 /* DoStatement */ + || kind === 237 /* ContinueStatement */ + || kind === 238 /* BreakStatement */ + || kind === 239 /* ReturnStatement */ + || kind === 243 /* ThrowStatement */ + || kind === 245 /* DebuggerStatement */ + || kind === 162 /* PropertyDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 264 /* ExportDeclaration */ + || kind === 256 /* NamespaceExportDeclaration */ + || kind === 263 /* ExportAssignment */; } ts.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI; ts.syntaxMayBeASICandidate = ts.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI); @@ -116228,7 +113651,7 @@ var ts; return false; } // See comment in parser’s `parseDoStatement` - if (node.kind === 235 /* DoStatement */) { + if (node.kind === 232 /* DoStatement */) { return true; } var topNode = ts.findAncestor(node, function (ancestor) { return !ancestor.parent; }); @@ -116647,10 +114070,10 @@ var ts; } break; case 128 /* AnyKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -116840,7 +114263,7 @@ var ts; } switch (keyword2) { case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: case 132 /* ConstructorKeyword */: case 123 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". @@ -116985,13 +114408,13 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -117211,18 +114634,18 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; break; - case 329 /* JSDocTypeTag */: + case 325 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; break; - case 327 /* JSDocReturnTag */: + case 323 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; break; @@ -117373,22 +114796,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -117417,17 +114840,17 @@ var ts; var parent = token.parent; if (tokenKind === 62 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (parent.kind === 249 /* VariableDeclaration */ || - parent.kind === 163 /* PropertyDeclaration */ || - parent.kind === 160 /* Parameter */ || - parent.kind === 280 /* JsxAttribute */) { + if (parent.kind === 246 /* VariableDeclaration */ || + parent.kind === 162 /* PropertyDeclaration */ || + parent.kind === 159 /* Parameter */ || + parent.kind === 277 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent.kind === 216 /* BinaryExpression */ || - parent.kind === 214 /* PrefixUnaryExpression */ || - parent.kind === 215 /* PostfixUnaryExpression */ || - parent.kind === 217 /* ConditionalExpression */) { + if (parent.kind === 213 /* BinaryExpression */ || + parent.kind === 211 /* PrefixUnaryExpression */ || + parent.kind === 212 /* PostfixUnaryExpression */ || + parent.kind === 214 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -117440,7 +114863,7 @@ var ts; return 25 /* bigintLiteral */; } else if (tokenKind === 10 /* StringLiteral */) { - return token && token.parent.kind === 280 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 277 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 13 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -117456,32 +114879,32 @@ var ts; else if (tokenKind === 78 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 160 /* Parameter */: + case 159 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -117510,254 +114933,6 @@ var ts; } ts.getEncodedSyntacticClassifications = getEncodedSyntacticClassifications; })(ts || (ts = {})); -/** @internal */ -var ts; -(function (ts) { - var classifier; - (function (classifier) { - var v2020; - (function (v2020) { - var TokenEncodingConsts; - (function (TokenEncodingConsts) { - TokenEncodingConsts[TokenEncodingConsts["typeOffset"] = 8] = "typeOffset"; - TokenEncodingConsts[TokenEncodingConsts["modifierMask"] = 255] = "modifierMask"; - })(TokenEncodingConsts = v2020.TokenEncodingConsts || (v2020.TokenEncodingConsts = {})); - var TokenType; - (function (TokenType) { - TokenType[TokenType["class"] = 0] = "class"; - TokenType[TokenType["enum"] = 1] = "enum"; - TokenType[TokenType["interface"] = 2] = "interface"; - TokenType[TokenType["namespace"] = 3] = "namespace"; - TokenType[TokenType["typeParameter"] = 4] = "typeParameter"; - TokenType[TokenType["type"] = 5] = "type"; - TokenType[TokenType["parameter"] = 6] = "parameter"; - TokenType[TokenType["variable"] = 7] = "variable"; - TokenType[TokenType["enumMember"] = 8] = "enumMember"; - TokenType[TokenType["property"] = 9] = "property"; - TokenType[TokenType["function"] = 10] = "function"; - TokenType[TokenType["member"] = 11] = "member"; - })(TokenType = v2020.TokenType || (v2020.TokenType = {})); - var TokenModifier; - (function (TokenModifier) { - TokenModifier[TokenModifier["declaration"] = 0] = "declaration"; - TokenModifier[TokenModifier["static"] = 1] = "static"; - TokenModifier[TokenModifier["async"] = 2] = "async"; - TokenModifier[TokenModifier["readonly"] = 3] = "readonly"; - TokenModifier[TokenModifier["defaultLibrary"] = 4] = "defaultLibrary"; - TokenModifier[TokenModifier["local"] = 5] = "local"; - })(TokenModifier = v2020.TokenModifier || (v2020.TokenModifier = {})); - /** This is mainly used internally for testing */ - function getSemanticClassifications(program, cancellationToken, sourceFile, span) { - var classifications = getEncodedSemanticClassifications(program, cancellationToken, sourceFile, span); - ts.Debug.assert(classifications.spans.length % 3 === 0); - var dense = classifications.spans; - var result = []; - for (var i = 0; i < dense.length; i += 3) { - result.push({ - textSpan: ts.createTextSpan(dense[i], dense[i + 1]), - classificationType: dense[i + 2] - }); - } - return result; - } - v2020.getSemanticClassifications = getSemanticClassifications; - function getEncodedSemanticClassifications(program, cancellationToken, sourceFile, span) { - return { - spans: getSemanticTokens(program, sourceFile, span, cancellationToken), - endOfLineState: 0 /* None */ - }; - } - v2020.getEncodedSemanticClassifications = getEncodedSemanticClassifications; - function getSemanticTokens(program, sourceFile, span, cancellationToken) { - var resultTokens = []; - var collector = function (node, typeIdx, modifierSet) { - resultTokens.push(node.getStart(sourceFile), node.getWidth(sourceFile), ((typeIdx + 1) << 8 /* typeOffset */) + modifierSet); - }; - if (program && sourceFile) { - collectTokens(program, sourceFile, span, collector, cancellationToken); - } - return resultTokens; - } - function collectTokens(program, sourceFile, span, collector, cancellationToken) { - var typeChecker = program.getTypeChecker(); - var inJSXElement = false; - function visit(node) { - switch (node.kind) { - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - cancellationToken.throwIfCancellationRequested(); - } - if (!node || !ts.textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) { - return; - } - var prevInJSXElement = inJSXElement; - if (ts.isJsxElement(node) || ts.isJsxSelfClosingElement(node)) { - inJSXElement = true; - } - if (ts.isJsxExpression(node)) { - inJSXElement = false; - } - if (ts.isIdentifier(node) && !inJSXElement && !inImportClause(node)) { - var symbol = typeChecker.getSymbolAtLocation(node); - if (symbol) { - if (symbol.flags & 2097152 /* Alias */) { - symbol = typeChecker.getAliasedSymbol(symbol); - } - var typeIdx = classifySymbol(symbol, ts.getMeaningFromLocation(node)); - if (typeIdx !== undefined) { - var modifierSet = 0; - if (node.parent) { - var parentIsDeclaration = (ts.isBindingElement(node.parent) || tokenFromDeclarationMapping.get(node.parent.kind) === typeIdx); - if (parentIsDeclaration && node.parent.name === node) { - modifierSet = 1 << 0 /* declaration */; - } - } - // property declaration in constructor - if (typeIdx === 6 /* parameter */ && isRightSideOfQualifiedNameOrPropertyAccess(node)) { - typeIdx = 9 /* property */; - } - typeIdx = reclassifyByType(typeChecker, node, typeIdx); - var decl = symbol.valueDeclaration; - if (decl) { - var modifiers = ts.getCombinedModifierFlags(decl); - var nodeFlags = ts.getCombinedNodeFlags(decl); - if (modifiers & 32 /* Static */) { - modifierSet |= 1 << 1 /* static */; - } - if (modifiers & 256 /* Async */) { - modifierSet |= 1 << 2 /* async */; - } - if (typeIdx !== 0 /* class */ && typeIdx !== 2 /* interface */) { - if ((modifiers & 64 /* Readonly */) || (nodeFlags & 2 /* Const */) || (symbol.getFlags() & 8 /* EnumMember */)) { - modifierSet |= 1 << 3 /* readonly */; - } - } - if ((typeIdx === 7 /* variable */ || typeIdx === 10 /* function */) && isLocalDeclaration(decl, sourceFile)) { - modifierSet |= 1 << 5 /* local */; - } - if (program.isSourceFileDefaultLibrary(decl.getSourceFile())) { - modifierSet |= 1 << 4 /* defaultLibrary */; - } - } - else if (symbol.declarations && symbol.declarations.some(function (d) { return program.isSourceFileDefaultLibrary(d.getSourceFile()); })) { - modifierSet |= 1 << 4 /* defaultLibrary */; - } - collector(node, typeIdx, modifierSet); - } - } - } - ts.forEachChild(node, visit); - inJSXElement = prevInJSXElement; - } - visit(sourceFile); - } - function classifySymbol(symbol, meaning) { - var flags = symbol.getFlags(); - if (flags & 32 /* Class */) { - return 0 /* class */; - } - else if (flags & 384 /* Enum */) { - return 1 /* enum */; - } - else if (flags & 524288 /* TypeAlias */) { - return 5 /* type */; - } - else if (flags & 64 /* Interface */) { - if (meaning & 2 /* Type */) { - return 2 /* interface */; - } - } - else if (flags & 262144 /* TypeParameter */) { - return 4 /* typeParameter */; - } - var decl = symbol.valueDeclaration || symbol.declarations && symbol.declarations[0]; - if (decl && ts.isBindingElement(decl)) { - decl = getDeclarationForBindingElement(decl); - } - return decl && tokenFromDeclarationMapping.get(decl.kind); - } - function reclassifyByType(typeChecker, node, typeIdx) { - // type based classifications - if (typeIdx === 7 /* variable */ || typeIdx === 9 /* property */ || typeIdx === 6 /* parameter */) { - var type_1 = typeChecker.getTypeAtLocation(node); - if (type_1) { - var test = function (condition) { - return condition(type_1) || type_1.isUnion() && type_1.types.some(condition); - }; - if (typeIdx !== 6 /* parameter */ && test(function (t) { return t.getConstructSignatures().length > 0; })) { - return 0 /* class */; - } - if (test(function (t) { return t.getCallSignatures().length > 0; }) && !test(function (t) { return t.getProperties().length > 0; }) || isExpressionInCallExpression(node)) { - return typeIdx === 9 /* property */ ? 11 /* member */ : 10 /* function */; - } - } - } - return typeIdx; - } - function isLocalDeclaration(decl, sourceFile) { - if (ts.isBindingElement(decl)) { - decl = getDeclarationForBindingElement(decl); - } - if (ts.isVariableDeclaration(decl)) { - return (!ts.isSourceFile(decl.parent.parent.parent) || ts.isCatchClause(decl.parent)) && decl.getSourceFile() === sourceFile; - } - else if (ts.isFunctionDeclaration(decl)) { - return !ts.isSourceFile(decl.parent) && decl.getSourceFile() === sourceFile; - } - return false; - } - function getDeclarationForBindingElement(element) { - while (true) { - if (ts.isBindingElement(element.parent.parent)) { - element = element.parent.parent; - } - else { - return element.parent.parent; - } - } - } - function inImportClause(node) { - var parent = node.parent; - return parent && (ts.isImportClause(parent) || ts.isImportSpecifier(parent) || ts.isNamespaceImport(parent)); - } - function isExpressionInCallExpression(node) { - while (isRightSideOfQualifiedNameOrPropertyAccess(node)) { - node = node.parent; - } - return ts.isCallExpression(node.parent) && node.parent.expression === node; - } - function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (ts.isQualifiedName(node.parent) && node.parent.right === node) || (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node); - } - var tokenFromDeclarationMapping = new ts.Map([ - [249 /* VariableDeclaration */, 7 /* variable */], - [160 /* Parameter */, 6 /* parameter */], - [163 /* PropertyDeclaration */, 9 /* property */], - [256 /* ModuleDeclaration */, 3 /* namespace */], - [255 /* EnumDeclaration */, 1 /* enum */], - [291 /* EnumMember */, 8 /* enumMember */], - [252 /* ClassDeclaration */, 0 /* class */], - [165 /* MethodDeclaration */, 11 /* member */], - [251 /* FunctionDeclaration */, 10 /* function */], - [208 /* FunctionExpression */, 10 /* function */], - [164 /* MethodSignature */, 11 /* member */], - [167 /* GetAccessor */, 9 /* property */], - [168 /* SetAccessor */, 9 /* property */], - [162 /* PropertySignature */, 9 /* property */], - [253 /* InterfaceDeclaration */, 2 /* interface */], - [254 /* TypeAliasDeclaration */, 5 /* type */], - [159 /* TypeParameter */, 4 /* typeParameter */], - [288 /* PropertyAssignment */, 9 /* property */], - [289 /* ShorthandPropertyAssignment */, 9 /* property */] - ]); - })(v2020 = classifier.v2020 || (classifier.v2020 = {})); - })(classifier = ts.classifier || (ts.classifier = {})); -})(ts || (ts = {})); /* @internal */ var ts; (function (ts) { @@ -117782,24 +114957,23 @@ var ts; if (completion === undefined) { return undefined; } - var optionalReplacementSpan = ts.createTextSpanFromStringLiteralLikeContent(contextToken); switch (completion.kind) { case 0 /* Paths */: return convertPathCompletions(completion.paths); case 1 /* Properties */: { var entries = []; Completions.getCompletionEntriesFromSymbols(completion.symbols, entries, contextToken, sourceFile, sourceFile, checker, 99 /* ESNext */, log, 4 /* String */, preferences); // Target will not be used, so arbitrary - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan: optionalReplacementSpan, entries: entries }; + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, entries: entries }; } case 2 /* Types */: { var entries = completion.types.map(function (type) { return ({ name: type.value, kindModifiers: "" /* none */, kind: "string" /* string */, - sortText: Completions.SortText.LocationPriority, + sortText: "0", replacementSpan: ts.getReplacementSpanForContextToken(contextToken) }); }); - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, optionalReplacementSpan: optionalReplacementSpan, entries: entries }; + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, entries: entries }; } default: return ts.Debug.assertNever(completion); @@ -117858,46 +115032,33 @@ var ts; StringLiteralCompletionKind[StringLiteralCompletionKind["Types"] = 2] = "Types"; })(StringLiteralCompletionKind || (StringLiteralCompletionKind = {})); function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { - var parent = walkUpParentheses(node.parent); + var parent = node.parent; switch (parent.kind) { - case 191 /* LiteralType */: { - var grandParent = walkUpParentheses(parent.parent); - switch (grandParent.kind) { - case 173 /* TypeReference */: { - var typeReference_1 = grandParent; - var typeArgument = ts.findAncestor(parent, function (n) { return n.parent === typeReference_1; }); - if (typeArgument) { - return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false }; - } - return undefined; - } - case 189 /* IndexedAccessType */: + case 190 /* LiteralType */: + switch (parent.parent.kind) { + case 172 /* TypeReference */: + return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent)), isNewIdentifier: false }; + case 188 /* IndexedAccessType */: // Get all apparent property names // i.e. interface Foo { // foo: string; // bar: string; // } // let x: Foo["/*completion position*/"] - var _a = grandParent, indexType = _a.indexType, objectType = _a.objectType; - if (!ts.rangeContainsPosition(indexType, position)) { - return undefined; - } - return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType)); - case 195 /* ImportType */: + return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(parent.parent.objectType)); + case 192 /* ImportType */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; - case 182 /* UnionType */: { - if (!ts.isTypeReferenceNode(grandParent.parent)) { + case 181 /* UnionType */: { + if (!ts.isTypeReferenceNode(parent.parent.parent)) return undefined; - } - var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent); - var types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(grandParent)).filter(function (t) { return !ts.contains(alreadyUsedTypes_1, t.value); }); + var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(parent.parent, parent); + var types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent.parent)).filter(function (t) { return !ts.contains(alreadyUsedTypes_1, t.value); }); return { kind: 2 /* Types */, types: types, isNewIdentifier: false }; } default: return undefined; } - } - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { @@ -117914,9 +115075,9 @@ var ts; return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(parent.parent)); } return fromContextualType(); - case 202 /* ElementAccessExpression */: { - var _b = parent, expression = _b.expression, argumentExpression = _b.argumentExpression; - if (node === ts.skipParentheses(argumentExpression)) { + case 199 /* ElementAccessExpression */: { + var _a = parent, expression = _a.expression, argumentExpression = _a.argumentExpression; + if (node === argumentExpression) { // Get all names of properties on the expression // i.e. interface A { // 'prop1': string @@ -117927,8 +115088,8 @@ var ts; } return undefined; } - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ false) && !ts.isImportCall(parent)) { var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile); // Get string literal completions from specialized signatures of the target @@ -117937,9 +115098,9 @@ var ts; return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType(); } // falls through (is `require("")` or `import("")`) - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 272 /* ExternalModuleReference */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 269 /* ExternalModuleReference */: // Get all known external module names or complete a path to a module // i.e. import * as ns from "/*completion position*/"; // var y = import("/*completion position*/"); @@ -117956,16 +115117,6 @@ var ts; return { kind: 2 /* Types */, types: getStringLiteralTypes(ts.getContextualTypeFromParent(node, typeChecker)), isNewIdentifier: false }; } } - function walkUpParentheses(node) { - switch (node.kind) { - case 186 /* ParenthesizedType */: - return ts.walkUpParenthesizedTypes(node); - case 207 /* ParenthesizedExpression */: - return ts.walkUpParenthesizedExpressions(node); - default: - return node; - } - } function getAlreadyUsedTypesInStringLiteralUnion(union, current) { return ts.mapDefined(union.types, function (type) { return type !== current && ts.isLiteralTypeNode(type) && ts.isStringLiteral(type.literal) ? type.literal.text : undefined; @@ -118412,14 +115563,13 @@ var ts; (function (Completions) { var SortText; (function (SortText) { - SortText["LocalDeclarationPriority"] = "0"; - SortText["LocationPriority"] = "1"; - SortText["OptionalMember"] = "2"; - SortText["MemberDeclaredBySpreadAssignment"] = "3"; - SortText["SuggestedClassMembers"] = "4"; - SortText["GlobalsOrKeywords"] = "5"; - SortText["AutoImportSuggestions"] = "6"; - SortText["JavascriptIdentifiers"] = "7"; + SortText["LocationPriority"] = "0"; + SortText["OptionalMember"] = "1"; + SortText["MemberDeclaredBySpreadAssignment"] = "2"; + SortText["SuggestedClassMembers"] = "3"; + SortText["GlobalsOrKeywords"] = "4"; + SortText["AutoImportSuggestions"] = "5"; + SortText["JavascriptIdentifiers"] = "6"; })(SortText = Completions.SortText || (Completions.SortText = {})); /** * Special values for `CompletionInfo['source']` used to disambiguate @@ -118566,10 +115716,6 @@ var ts; function jsdocCompletionInfo(entries) { return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; } - function getOptionalReplacementSpan(location) { - // StringLiteralLike locations are handled separately in stringCompletions.ts - return (location === null || location === void 0 ? void 0 : location.kind) === 78 /* Identifier */ ? ts.createTextSpanFromNode(location) : undefined; - } function completionInfoFromData(sourceFile, typeChecker, compilerOptions, log, completionData, preferences) { var symbols = completionData.symbols, completionKind = completionData.completionKind, isInSnippetScope = completionData.isInSnippetScope, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, literals = completionData.literals, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer, insideJsDocTagTypeExpression = completionData.insideJsDocTagTypeExpression, symbolToSortTextMap = completionData.symbolToSortTextMap; if (location && location.parent && ts.isJsxClosingElement(location.parent)) { @@ -118587,7 +115733,7 @@ var ts; kindModifiers: undefined, sortText: SortText.LocationPriority, }; - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, optionalReplacementSpan: getOptionalReplacementSpan(location), entries: [entry] }; + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, entries: [entry] }; } var entries = []; if (isUncheckedFile(sourceFile, compilerOptions)) { @@ -118613,15 +115759,9 @@ var ts; } for (var _b = 0, literals_1 = literals; _b < literals_1.length; _b++) { var literal = literals_1[_b]; - entries.push(createCompletionEntryForLiteral(sourceFile, preferences, literal)); + entries.push(createCompletionEntryForLiteral(literal, preferences)); } - return { - isGlobalCompletion: isInSnippetScope, - isMemberCompletion: isMemberCompletionKind(completionKind), - isNewIdentifierLocation: isNewIdentifierLocation, - optionalReplacementSpan: getOptionalReplacementSpan(location), - entries: entries - }; + return { isGlobalCompletion: isInSnippetScope, isMemberCompletion: isMemberCompletionKind(completionKind), isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; } function isUncheckedFile(sourceFile, compilerOptions) { return ts.isSourceFileJS(sourceFile) && !ts.isCheckJsEnabledForFile(sourceFile, compilerOptions); @@ -118655,12 +115795,12 @@ var ts; } }); } - function completionNameForLiteral(sourceFile, preferences, literal) { + function completionNameForLiteral(literal, preferences) { return typeof literal === "object" ? ts.pseudoBigIntToString(literal) + "n" : - ts.isString(literal) ? ts.quote(sourceFile, preferences, literal) : JSON.stringify(literal); + ts.isString(literal) ? ts.quote(literal, preferences) : JSON.stringify(literal); } - function createCompletionEntryForLiteral(sourceFile, preferences, literal) { - return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; + function createCompletionEntryForLiteral(literal, preferences) { + return { name: completionNameForLiteral(literal, preferences), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; } function createCompletionEntry(symbol, sortText, contextToken, location, sourceFile, typeChecker, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, preferences) { var insertText; @@ -118669,13 +115809,13 @@ var ts; var useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess; if (origin && originIsThisType(origin)) { insertText = needsConvertPropertyAccess - ? "this" + (insertQuestionDot ? "?." : "") + "[" + quotePropertyName(sourceFile, preferences, name) + "]" + ? "this" + (insertQuestionDot ? "?." : "") + "[" + quotePropertyName(name, preferences) + "]" : "this" + (insertQuestionDot ? "?." : ".") + name; } // We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790. // Somehow there was a global with a non-identifier name. Hopefully someone will complain about getting a "foo bar" global completion and provide a repro. else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) { - insertText = useBraces ? needsConvertPropertyAccess ? "[" + quotePropertyName(sourceFile, preferences, name) + "]" : "[" + name + "]" : name; + insertText = useBraces ? needsConvertPropertyAccess ? "[" + quotePropertyName(name, preferences) + "]" : "[" + name + "]" : name; if (insertQuestionDot || propertyAccessToConvert.questionDotToken) { insertText = "?." + insertText; } @@ -118731,11 +115871,11 @@ var ts; isPackageJsonImport: originIsPackageJsonImport(origin) || undefined, }; } - function quotePropertyName(sourceFile, preferences, name) { + function quotePropertyName(name, preferences) { if (/^\d+$/.test(name)) { return name; } - return ts.quote(sourceFile, preferences, name); + return ts.quote(name, preferences); } function isRecommendedCompletionMatch(localSymbol, recommendedCompletion, checker) { return localSymbol === recommendedCompletion || @@ -118826,7 +115966,7 @@ var ts; return { type: "request", request: completionData }; } var symbols = completionData.symbols, literals = completionData.literals, location = completionData.location, completionKind = completionData.completionKind, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, previousToken = completionData.previousToken, isJsxInitializer = completionData.isJsxInitializer, isTypeOnlyLocation = completionData.isTypeOnlyLocation; - var literal = ts.find(literals, function (l) { return completionNameForLiteral(sourceFile, preferences, l) === entryId.name; }); + var literal = ts.find(literals, function (l) { return completionNameForLiteral(l, preferences) === entryId.name; }); if (literal !== undefined) return { type: "literal", literal: literal }; // Find the symbol with the matching entry name. @@ -118872,7 +116012,7 @@ var ts; } case "literal": { var literal = symbolCompletion.literal; - return createSimpleDetails(completionNameForLiteral(sourceFile, preferences, literal), "string" /* string */, typeof literal === "string" ? ts.SymbolDisplayPartKind.stringLiteral : ts.SymbolDisplayPartKind.numericLiteral); + return createSimpleDetails(completionNameForLiteral(literal, preferences), "string" /* string */, typeof literal === "string" ? ts.SymbolDisplayPartKind.stringLiteral : ts.SymbolDisplayPartKind.numericLiteral); } case "none": // Didn't find a symbol with this name. See if we can find a keyword instead. @@ -118944,11 +116084,11 @@ var ts; return ts.getContextualTypeFromParent(previousToken, checker); case 62 /* EqualsToken */: switch (parent.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return checker.getContextualType(parent.initializer); // TODO: GH#18217 - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return checker.getTypeAtLocation(parent.left); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent); default: return undefined; @@ -118958,7 +116098,7 @@ var ts; case 81 /* CaseKeyword */: return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); case 18 /* OpenBraceToken */: - return ts.isJsxExpression(parent) && parent.parent.kind !== 273 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + return ts.isJsxExpression(parent) && parent.parent.kind !== 270 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); return argInfo ? @@ -118977,7 +116117,7 @@ var ts; return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 297 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 294 /* SourceFile */; }); } function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId, host) { var typeChecker = program.getTypeChecker(); @@ -119028,11 +116168,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 301 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 298 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 333 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 328 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -119085,7 +116225,7 @@ var ts; isRightOfDot = contextToken.kind === 24 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; if ((ts.isCallExpression(node) || ts.isFunctionLike(node)) && @@ -119098,14 +116238,14 @@ var ts; return undefined; } break; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: node = parent.left; break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: node = parent.name; break; - case 195 /* ImportType */: - case 226 /* MetaProperty */: + case 192 /* ImportType */: + case 223 /* MetaProperty */: node = parent; break; default: @@ -119118,7 +116258,7 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 201 /* PropertyAccessExpression */) { + if (parent && parent.kind === 198 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } @@ -119126,51 +116266,39 @@ var ts; if (currentToken.parent === location) { switch (currentToken.kind) { case 31 /* GreaterThanToken */: - if (currentToken.parent.kind === 273 /* JsxElement */ || currentToken.parent.kind === 275 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 270 /* JsxElement */ || currentToken.parent.kind === 272 /* JsxOpeningElement */) { location = currentToken; } break; case 43 /* SlashToken */: - if (currentToken.parent.kind === 274 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 271 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent.kind) { - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: if (contextToken.kind === 43 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent)) { break; } // falls through - case 274 /* JsxSelfClosingElement */: - case 273 /* JsxElement */: - case 275 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 270 /* JsxElement */: + case 272 /* JsxOpeningElement */: isJsxIdentifierExpected = true; if (contextToken.kind === 29 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 283 /* JsxExpression */: - // For `
`, `parent` will be `{true}` and `previousToken` will be `}` - if (previousToken.kind === 19 /* CloseBraceToken */ && currentToken.kind === 31 /* GreaterThanToken */) { - isJsxIdentifierExpected = true; - } - break; - case 280 /* JsxAttribute */: - // For `
`, `parent` will be JsxAttribute and `previousToken` will be its initializer - if (parent.initializer === previousToken && - previousToken.end < position) { - isJsxIdentifierExpected = true; - break; - } + case 277 /* JsxAttribute */: switch (previousToken.kind) { case 62 /* EqualsToken */: isJsxInitializer = true; @@ -119252,11 +116380,11 @@ var ts; }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 331 /* JSDocTypedefTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 327 /* JSDocTypedefTag */: return true; default: return false; @@ -119272,7 +116400,7 @@ var ts; || ts.isPartOfTypeNode(node.parent) || ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); var isRhsOfImportDeclaration = ts.isInRightSideOfInternalImportEqualsDeclaration(node); - if (ts.isEntityName(node) || isImportType || ts.isPropertyAccessExpression(node)) { + if (ts.isEntityName(node) || isImportType) { var isNamespaceName = ts.isModuleDeclaration(node.parent); if (isNamespaceName) isNewIdentifierLocation = true; @@ -119301,7 +116429,7 @@ var ts; // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). if (!isTypeLocation && symbol.declarations && - symbol.declarations.some(function (d) { return d.kind !== 297 /* SourceFile */ && d.kind !== 256 /* ModuleDeclaration */ && d.kind !== 255 /* EnumDeclaration */; })) { + symbol.declarations.some(function (d) { return d.kind !== 294 /* SourceFile */ && d.kind !== 253 /* ModuleDeclaration */ && d.kind !== 252 /* EnumDeclaration */; })) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); var insertQuestionDot = false; if (type.isNullableType()) { @@ -119348,7 +116476,7 @@ var ts; if (isRightOfQuestionDot && ts.some(type.getCallSignatures())) { isNewIdentifierLocation = true; } - var propertyAccess = node.kind === 195 /* ImportType */ ? node : node.parent; + var propertyAccess = node.kind === 192 /* ImportType */ ? node : node.parent; if (isUncheckedFile) { // In javascript files, for union types, we don't just get the members that // the individual types have in common, we also include all the members that @@ -119361,7 +116489,7 @@ var ts; for (var _i = 0, _a = type.getApparentProperties(); _i < _a.length; _i++) { var symbol = _a[_i]; if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type, symbol)) { - addPropertySymbol(symbol, /* insertAwait */ false, insertQuestionDot); + addPropertySymbol(symbol, /*insertAwait*/ false, insertQuestionDot); } } } @@ -119397,20 +116525,13 @@ var ts; } else if (preferences.includeCompletionsWithInsertText) { addSymbolOriginInfo(symbol); - addSymbolSortInfo(symbol); symbols.push(symbol); } } else { addSymbolOriginInfo(symbol); - addSymbolSortInfo(symbol); symbols.push(symbol); } - function addSymbolSortInfo(symbol) { - if (isStaticProperty(symbol)) { - symbolToSortTextMap[ts.getSymbolId(symbol)] = SortText.LocalDeclarationPriority; - } - } function addSymbolOriginInfo(symbol) { if (preferences.includeCompletionsWithInsertText) { if (insertAwait && !symbolToOriginInfoMap[ts.getSymbolId(symbol)]) { @@ -119512,7 +116633,7 @@ var ts; } } // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 297 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 294 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false); if (thisType && !isProbablyGlobalType(thisType, sourceFile, typeChecker)) { for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) { @@ -119562,10 +116683,10 @@ var ts; } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 297 /* SourceFile */: - case 218 /* TemplateExpression */: - case 283 /* JsxExpression */: - case 230 /* Block */: + case 294 /* SourceFile */: + case 215 /* TemplateExpression */: + case 280 /* JsxExpression */: + case 227 /* Block */: return true; default: return ts.isStatement(scopeNode); @@ -119608,27 +116729,27 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 111 /* TypeOfKeyword */ && - (contextToken.parent.kind === 176 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); + (contextToken.parent.kind === 175 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 58 /* ColonToken */: - return parentKind === 163 /* PropertyDeclaration */ || - parentKind === 162 /* PropertySignature */ || - parentKind === 160 /* Parameter */ || - parentKind === 249 /* VariableDeclaration */ || + return parentKind === 162 /* PropertyDeclaration */ || + parentKind === 161 /* PropertySignature */ || + parentKind === 159 /* Parameter */ || + parentKind === 246 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 62 /* EqualsToken */: - return parentKind === 254 /* TypeAliasDeclaration */; + return parentKind === 251 /* TypeAliasDeclaration */; case 126 /* AsKeyword */: - return parentKind === 224 /* AsExpression */; + return parentKind === 221 /* AsExpression */; case 29 /* LessThanToken */: - return parentKind === 173 /* TypeReference */ || - parentKind === 206 /* TypeAssertionExpression */; + return parentKind === 172 /* TypeReference */ || + parentKind === 203 /* TypeAssertionExpression */; case 93 /* ExtendsKeyword */: - return parentKind === 159 /* TypeParameter */; + return parentKind === 158 /* TypeParameter */; } } return false; @@ -119839,7 +116960,7 @@ var ts; return true; } if (contextToken.kind === 31 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 275 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 272 /* JsxOpeningElement */) { // Two possibilities: // 1.
/**/ // - contextToken: GreaterThanToken (before cursor) @@ -119849,10 +116970,10 @@ var ts; // - contextToken: GreaterThanToken (before cursor) // - location: GreaterThanToken (after cursor) // - same parent (JSXOpeningElement) - return location.parent.kind !== 275 /* JsxOpeningElement */; + return location.parent.kind !== 272 /* JsxOpeningElement */; } - if (contextToken.parent.kind === 276 /* JsxClosingElement */ || contextToken.parent.kind === 274 /* JsxSelfClosingElement */) { - return !!contextToken.parent.parent && contextToken.parent.parent.kind === 273 /* JsxElement */; + if (contextToken.parent.kind === 273 /* JsxClosingElement */ || contextToken.parent.kind === 271 /* JsxSelfClosingElement */) { + return !!contextToken.parent.parent && contextToken.parent.parent.kind === 270 /* JsxElement */; } } return false; @@ -119863,40 +116984,40 @@ var ts; // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(previousToken)) { case 27 /* CommaToken */: - return containingNodeKind === 203 /* CallExpression */ // func( a, | - || containingNodeKind === 166 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 204 /* NewExpression */ // new C(a, | - || containingNodeKind === 199 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 216 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 174 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 200 /* CallExpression */ // func( a, | + || containingNodeKind === 165 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 201 /* NewExpression */ // new C(a, | + || containingNodeKind === 196 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 213 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 173 /* FunctionType */; // var x: (s: string, list| case 20 /* OpenParenToken */: - return containingNodeKind === 203 /* CallExpression */ // func( | - || containingNodeKind === 166 /* Constructor */ // constructor( | - || containingNodeKind === 204 /* NewExpression */ // new C(a| - || containingNodeKind === 207 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 186 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 200 /* CallExpression */ // func( | + || containingNodeKind === 165 /* Constructor */ // constructor( | + || containingNodeKind === 201 /* NewExpression */ // new C(a| + || containingNodeKind === 204 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 185 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 22 /* OpenBracketToken */: - return containingNodeKind === 199 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 171 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 158 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 139 /* ModuleKeyword */: // module | - case 140 /* NamespaceKeyword */: // namespace | + return containingNodeKind === 196 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 170 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 157 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 138 /* ModuleKeyword */: // module | + case 139 /* NamespaceKeyword */: // namespace | return true; case 24 /* DotToken */: - return containingNodeKind === 256 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 253 /* ModuleDeclaration */; // module A.| case 18 /* OpenBraceToken */: - return containingNodeKind === 252 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 249 /* ClassDeclaration */; // class A{ | case 62 /* EqualsToken */: - return containingNodeKind === 249 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 216 /* BinaryExpression */; // x = a| + return containingNodeKind === 246 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 213 /* BinaryExpression */; // x = a| case 15 /* TemplateHead */: - return containingNodeKind === 218 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 215 /* TemplateExpression */; // `aa ${| case 16 /* TemplateMiddle */: - return containingNodeKind === 228 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 225 /* TemplateSpan */; // `aa ${10} dd ${| case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - return containingNodeKind === 163 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 162 /* PropertyDeclaration */; // class A{ public | } } return false; @@ -119923,18 +117044,17 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 200 /* ObjectLiteralExpression */) { - var instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker); - if (instantiatedType === undefined) { + if (objectLikeContainer.kind === 197 /* ObjectLiteralExpression */) { + var instantiatedType = typeChecker.getContextualType(objectLikeContainer); + var completionsType = instantiatedType && typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); + if (!instantiatedType || !completionsType) return 2 /* Fail */; - } - var completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); - isNewIdentifierLocation = ts.hasIndexSignature(completionsType || instantiatedType); + isNewIdentifierLocation = ts.hasIndexSignature(instantiatedType || completionsType); typeMembers = getPropertiesForObjectExpression(instantiatedType, completionsType, objectLikeContainer, typeChecker); existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 196 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 193 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -119945,12 +117065,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 239 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 160 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 236 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 159 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 165 /* MethodDeclaration */ || rootDeclaration.parent.kind === 168 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 164 /* MethodDeclaration */ || rootDeclaration.parent.kind === 167 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -119997,9 +117117,9 @@ var ts; if (!namedImportsOrExports) return 0 /* Continue */; // try to show exported member for imported/re-exported module - var moduleSpecifier = (namedImportsOrExports.kind === 264 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + var moduleSpecifier = (namedImportsOrExports.kind === 261 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; if (!moduleSpecifier) - return namedImportsOrExports.kind === 264 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; + return namedImportsOrExports.kind === 261 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217 if (!moduleSpecifierSymbol) return 2 /* Fail */; @@ -120152,11 +117272,11 @@ var ts; case 30 /* LessThanSlashToken */: case 43 /* SlashToken */: case 78 /* Identifier */: - case 201 /* PropertyAccessExpression */: - case 281 /* JsxAttributes */: - case 280 /* JsxAttribute */: - case 282 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 274 /* JsxSelfClosingElement */ || parent.kind === 275 /* JsxOpeningElement */)) { + case 198 /* PropertyAccessExpression */: + case 278 /* JsxAttributes */: + case 277 /* JsxAttribute */: + case 279 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 271 /* JsxSelfClosingElement */ || parent.kind === 272 /* JsxOpeningElement */)) { if (contextToken.kind === 31 /* GreaterThanToken */) { var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); if (!parent.typeArguments || (precedingToken && precedingToken.kind === 43 /* SlashToken */)) @@ -120164,7 +117284,7 @@ var ts; } return parent; } - else if (parent.kind === 280 /* JsxAttribute */) { + else if (parent.kind === 277 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -120176,7 +117296,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 10 /* StringLiteral */: - if (parent && ((parent.kind === 280 /* JsxAttribute */) || (parent.kind === 282 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 277 /* JsxAttribute */) || (parent.kind === 279 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -120186,8 +117306,8 @@ var ts; break; case 19 /* CloseBraceToken */: if (parent && - parent.kind === 283 /* JsxExpression */ && - parent.parent && parent.parent.kind === 280 /* JsxAttribute */) { + parent.kind === 280 /* JsxExpression */ && + parent.parent && parent.parent.kind === 277 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -120195,7 +117315,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 282 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 279 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -120215,51 +117335,51 @@ var ts; var containingNodeKind = parent.kind; switch (contextToken.kind) { case 27 /* CommaToken */: - return containingNodeKind === 249 /* VariableDeclaration */ || + return containingNodeKind === 246 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken) || - containingNodeKind === 232 /* VariableStatement */ || - containingNodeKind === 255 /* EnumDeclaration */ || // enum a { foo, | + containingNodeKind === 229 /* VariableStatement */ || + containingNodeKind === 252 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 253 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 24 /* DotToken */: - return containingNodeKind === 197 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 194 /* ArrayBindingPattern */; // var [.| case 58 /* ColonToken */: - return containingNodeKind === 198 /* BindingElement */; // var {x :html| + return containingNodeKind === 195 /* BindingElement */; // var {x :html| case 22 /* OpenBracketToken */: - return containingNodeKind === 197 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 194 /* ArrayBindingPattern */; // var [x| case 20 /* OpenParenToken */: - return containingNodeKind === 287 /* CatchClause */ || + return containingNodeKind === 284 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 18 /* OpenBraceToken */: - return containingNodeKind === 255 /* EnumDeclaration */; // enum a { | + return containingNodeKind === 252 /* EnumDeclaration */; // enum a { | case 29 /* LessThanToken */: - return containingNodeKind === 252 /* ClassDeclaration */ || // class A< | - containingNodeKind === 221 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 253 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 254 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 249 /* ClassDeclaration */ || // class A< | + containingNodeKind === 218 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 250 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 251 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 123 /* StaticKeyword */: - return containingNodeKind === 163 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); + return containingNodeKind === 162 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); case 25 /* DotDotDotToken */: - return containingNodeKind === 160 /* Parameter */ || - (!!parent.parent && parent.parent.kind === 197 /* ArrayBindingPattern */); // var [...z| + return containingNodeKind === 159 /* Parameter */ || + (!!parent.parent && parent.parent.kind === 194 /* ArrayBindingPattern */); // var [...z| case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - return containingNodeKind === 160 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); + return containingNodeKind === 159 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); case 126 /* AsKeyword */: - return containingNodeKind === 265 /* ImportSpecifier */ || - containingNodeKind === 270 /* ExportSpecifier */ || - containingNodeKind === 263 /* NamespaceImport */; + return containingNodeKind === 262 /* ImportSpecifier */ || + containingNodeKind === 267 /* ExportSpecifier */ || + containingNodeKind === 260 /* NamespaceImport */; case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken); case 83 /* ClassKeyword */: case 91 /* EnumKeyword */: @@ -120269,7 +117389,7 @@ var ts; case 99 /* ImportKeyword */: case 118 /* LetKeyword */: case 84 /* ConstKeyword */: - case 149 /* TypeKeyword */: // type htm| + case 148 /* TypeKeyword */: // type htm| return true; case 41 /* AsteriskToken */: return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent); @@ -120316,7 +117436,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 166 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 165 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -120326,7 +117446,7 @@ var ts; return false; } function isVariableDeclarationListButNotTypeArgument(node) { - return node.parent.kind === 250 /* VariableDeclarationList */ + return node.parent.kind === 247 /* VariableDeclarationList */ && !ts.isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker); } /** @@ -120344,13 +117464,13 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 288 /* PropertyAssignment */ && - m.kind !== 289 /* ShorthandPropertyAssignment */ && - m.kind !== 198 /* BindingElement */ && - m.kind !== 165 /* MethodDeclaration */ && - m.kind !== 167 /* GetAccessor */ && - m.kind !== 168 /* SetAccessor */ && - m.kind !== 290 /* SpreadAssignment */) { + if (m.kind !== 285 /* PropertyAssignment */ && + m.kind !== 286 /* ShorthandPropertyAssignment */ && + m.kind !== 195 /* BindingElement */ && + m.kind !== 164 /* MethodDeclaration */ && + m.kind !== 166 /* GetAccessor */ && + m.kind !== 167 /* SetAccessor */ && + m.kind !== 287 /* SpreadAssignment */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -120423,10 +117543,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 163 /* PropertyDeclaration */ && - m.kind !== 165 /* MethodDeclaration */ && - m.kind !== 167 /* GetAccessor */ && - m.kind !== 168 /* SetAccessor */) { + if (m.kind !== 162 /* PropertyDeclaration */ && + m.kind !== 164 /* MethodDeclaration */ && + m.kind !== 166 /* GetAccessor */ && + m.kind !== 167 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -120468,7 +117588,7 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 280 /* JsxAttribute */) { + if (attr.kind === 277 /* JsxAttribute */) { seenNames.add(attr.name.escapedText); } else if (ts.isJsxSpreadAttribute(attr)) { @@ -120518,7 +117638,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 80 /* FirstKeyword */; i <= 156 /* LastKeyword */; i++) { + for (var i = 80 /* FirstKeyword */; i <= 155 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -120545,10 +117665,11 @@ var ts; case 1 /* All */: return isFunctionLikeBodyKeyword(kind) || kind === 133 /* DeclareKeyword */ - || kind === 139 /* ModuleKeyword */ - || kind === 149 /* TypeKeyword */ - || kind === 140 /* NamespaceKeyword */ - || ts.isTypeKeyword(kind) && kind !== 150 /* UndefinedKeyword */; + || kind === 138 /* ModuleKeyword */ + || kind === 148 /* TypeKeyword */ + || kind === 139 /* NamespaceKeyword */ + || kind === 126 /* AsKeyword */ + || ts.isTypeKeyword(kind) && kind !== 149 /* UndefinedKeyword */; case 5 /* FunctionLikeBodyKeywords */: return isFunctionLikeBodyKeyword(kind); case 2 /* ClassElementKeywords */: @@ -120570,44 +117691,44 @@ var ts; switch (kind) { case 125 /* AbstractKeyword */: case 128 /* AnyKeyword */: - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: case 133 /* DeclareKeyword */: case 91 /* EnumKeyword */: - case 154 /* GlobalKeyword */: + case 153 /* GlobalKeyword */: case 116 /* ImplementsKeyword */: case 135 /* InferKeyword */: case 117 /* InterfaceKeyword */: - case 137 /* IsKeyword */: - case 138 /* KeyOfKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: - case 141 /* NeverKeyword */: - case 144 /* NumberKeyword */: - case 145 /* ObjectKeyword */: + case 136 /* IsKeyword */: + case 137 /* KeyOfKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: + case 140 /* NeverKeyword */: + case 143 /* NumberKeyword */: + case 144 /* ObjectKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 122 /* PublicKeyword */: - case 142 /* ReadonlyKeyword */: - case 147 /* StringKeyword */: - case 148 /* SymbolKeyword */: - case 149 /* TypeKeyword */: - case 151 /* UniqueKeyword */: - case 152 /* UnknownKeyword */: + case 141 /* ReadonlyKeyword */: + case 146 /* StringKeyword */: + case 147 /* SymbolKeyword */: + case 148 /* TypeKeyword */: + case 150 /* UniqueKeyword */: + case 151 /* UnknownKeyword */: return true; default: return false; } } function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 142 /* ReadonlyKeyword */; + return kind === 141 /* ReadonlyKeyword */; } function isClassMemberCompletionKeyword(kind) { switch (kind) { case 125 /* AbstractKeyword */: case 132 /* ConstructorKeyword */: case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: case 129 /* AsyncKeyword */: case 133 /* DeclareKeyword */: return true; @@ -120618,7 +117739,6 @@ var ts; function isFunctionLikeBodyKeyword(kind) { return kind === 129 /* AsyncKeyword */ || kind === 130 /* AwaitKeyword */ - || kind === 126 /* AsKeyword */ || !ts.isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } function keywordForNode(node) { @@ -120669,7 +117789,7 @@ var ts; function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { // class c { method() { } | method2() { } } switch (location.kind) { - case 334 /* SyntaxList */: + case 329 /* SyntaxList */: return ts.tryCast(location.parent, ts.isObjectTypeDeclaration); case 1 /* EndOfFileToken */: var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration); @@ -120772,19 +117892,6 @@ var ts; } return false; } - function isStaticProperty(symbol) { - return !!(symbol.valueDeclaration && ts.getEffectiveModifierFlags(symbol.valueDeclaration) & 32 /* Static */ && ts.isClassLike(symbol.valueDeclaration.parent)); - } - function tryGetObjectLiteralContextualType(node, typeChecker) { - var type = typeChecker.getContextualType(node); - if (type) { - return type; - } - if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 62 /* EqualsToken */) { - return typeChecker.getTypeAtLocation(node.parent); - } - return undefined; - } })(Completions = ts.Completions || (ts.Completions = {})); })(ts || (ts = {})); var ts; @@ -120868,8 +117975,8 @@ var ts; case 132 /* ConstructorKeyword */: return getFromAllDeclarations(ts.isConstructorDeclaration, [132 /* ConstructorKeyword */]); case 134 /* GetKeyword */: - case 146 /* SetKeyword */: - return getFromAllDeclarations(ts.isAccessor, [134 /* GetKeyword */, 146 /* SetKeyword */]); + case 145 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [134 /* GetKeyword */, 145 /* SetKeyword */]); case 130 /* AwaitKeyword */: return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences); case 129 /* AsyncKeyword */: @@ -120917,7 +118024,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 297 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 294 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has @@ -120949,16 +118056,16 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 244 /* SwitchStatement */: - if (statement.kind === 240 /* ContinueStatement */) { + case 241 /* SwitchStatement */: + if (statement.kind === 237 /* ContinueStatement */) { return false; } // falls through - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 236 /* WhileStatement */: - case 235 /* DoStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 233 /* WhileStatement */: + case 232 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. @@ -120974,11 +118081,11 @@ var ts; // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 257 /* ModuleBlock */: - case 297 /* SourceFile */: - case 230 /* Block */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 254 /* ModuleBlock */: + case 294 /* SourceFile */: + case 227 /* Block */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return __spreadArrays(declaration.members, [declaration]); @@ -120986,14 +118093,14 @@ var ts; else { return container.statements; } - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : [])); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 177 /* TypeLiteral */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 176 /* TypeLiteral */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -121007,9 +118114,6 @@ var ts; return __spreadArrays(nodes, [container]); } return nodes; - // Syntactically invalid positions that the parser might produce anyway - case 200 /* ObjectLiteralExpression */: - return undefined; default: ts.Debug.assertNever(container, "Invalid container kind."); } @@ -121029,7 +118133,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 96 /* ForKeyword */, 114 /* WhileKeyword */, 89 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 235 /* DoStatement */) { + if (loopNode.kind === 232 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 114 /* WhileKeyword */)) { @@ -121049,13 +118153,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -121422,39 +118526,41 @@ var ts; if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 249 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 246 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 78 /* Identifier */) { directImports.push(name); break; } } + // Don't support re-exporting 'require()' calls, so just add a single indirect user. + addIndirectUser(direct.getSourceFile()); } break; case 78 /* Identifier */: // for 'const x = require("y"); break; // TODO: GH#23879 - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasSyntacticModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false); break; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: directImports.push(direct); var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 263 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 260 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name, /*isReExport*/ false, /*alreadyAddedDirect*/ true); } else if (!isAvailableThroughGlobal && ts.isDefaultImport(direct)) { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); // Add a check for indirect uses to handle synthetic default imports } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); } - else if (direct.exportClause.kind === 269 /* NamespaceExport */) { + else if (direct.exportClause.kind === 266 /* NamespaceExport */) { // `export * as foo from "foo"` add to indirect uses addIndirectUsers(getSourceFileLikeForImportDeclaration(direct)); } @@ -121463,7 +118569,7 @@ var ts; directImports.push(direct); } break; - case 195 /* ImportType */: + case 192 /* ImportType */: directImports.push(direct); break; default: @@ -121480,7 +118586,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 297 /* SourceFile */ || sourceFileLike.kind === 256 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 294 /* SourceFile */ || sourceFileLike.kind === 253 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -121537,7 +118643,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 260 /* ImportEqualsDeclaration */) { + if (decl.kind === 257 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -121547,7 +118653,7 @@ var ts; handleNamespaceImportLike(decl); return; } - if (decl.kind === 195 /* ImportType */) { + if (decl.kind === 192 /* ImportType */) { if (decl.qualifier) { var firstIdentifier = ts.getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === ts.symbolName(exportSymbol)) { @@ -121563,7 +118669,7 @@ var ts; if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) { return; } - if (decl.kind === 267 /* ExportDeclaration */) { + if (decl.kind === 264 /* ExportDeclaration */) { if (decl.exportClause && ts.isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -121572,10 +118678,10 @@ var ts; var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: // 'default' might be accessed as a named import `{ default as foo }`. if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); @@ -121625,7 +118731,7 @@ var ts; } } else { - var localSymbol = element.kind === 270 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 267 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -121654,7 +118760,7 @@ var ts; for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { var referencingFile = sourceFiles_1[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 297 /* SourceFile */) { + if (searchSourceFile.kind === 294 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -121702,7 +118808,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 297 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 294 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -121717,15 +118823,15 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 267 /* ExportDeclaration */: - case 261 /* ImportDeclaration */: { + case 264 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 260 /* ImportEqualsDeclaration */: { + case 257 /* ImportEqualsDeclaration */: { var decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -121749,7 +118855,7 @@ var ts; var parent = node.parent; var grandParent = parent.parent; if (symbol.exportSymbol) { - if (parent.kind === 201 /* PropertyAccessExpression */) { + if (parent.kind === 198 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent) @@ -121882,17 +118988,15 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return !parent.propertyName; - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return true; - case 198 /* BindingElement */: - return ts.isInJSFile(node) && ts.isRequireVariableDeclaration(parent, /*requireStringLiteralLikeArgument*/ true); default: return false; } @@ -121915,14 +119019,6 @@ var ts; if (ts.isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) { return checker.getExportSpecifierLocalTargetSymbol(declaration); } - else if (ts.isPropertyAccessExpression(declaration) && ts.isModuleExportsAccessExpression(declaration.expression) && !ts.isPrivateIdentifier(declaration.name)) { - return checker.getExportSpecifierLocalTargetSymbol(declaration.name); - } - else if (ts.isShorthandPropertyAssignment(declaration) - && ts.isBinaryExpression(declaration.parent.parent) - && ts.getAssignmentDeclarationKind(declaration.parent.parent) === 2 /* ModuleExports */) { - return checker.getExportSpecifierLocalTargetSymbol(declaration.name); - } } } return symbol; @@ -121931,21 +119027,21 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 297 /* SourceFile */) { + if (parent.kind === 294 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 257 /* ModuleBlock */); + ts.Debug.assert(parent.kind === 254 /* ModuleBlock */); return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; + return node.kind === 253 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 272 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; + return eq.moduleReference.kind === 269 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -122047,7 +119143,7 @@ var ts; if (!node) return undefined; switch (node.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return !ts.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : ts.isVariableStatement(node.parent.parent) ? @@ -122055,28 +119151,28 @@ var ts; ts.isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getContextNode(node.parent.parent); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return node.parent.parent.parent; - case 270 /* ExportSpecifier */: - case 263 /* NamespaceImport */: + case 267 /* ExportSpecifier */: + case 260 /* NamespaceImport */: return node.parent.parent; - case 262 /* ImportClause */: - case 269 /* NamespaceExport */: + case 259 /* ImportClause */: + case 266 /* NamespaceExport */: return node.parent; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return ts.isExpressionStatement(node.parent) ? node.parent : node; - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(ts.findAncestor(node.parent, function (node) { return ts.isBinaryExpression(node) || ts.isForInOrOfStatement(node); @@ -122133,9 +119229,9 @@ var ts; var node = ts.getTouchingPropertyName(sourceFile, position); var referenceEntries; var entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); - if (node.parent.kind === 201 /* PropertyAccessExpression */ - || node.parent.kind === 198 /* BindingElement */ - || node.parent.kind === 202 /* ElementAccessExpression */ + if (node.parent.kind === 198 /* PropertyAccessExpression */ + || node.parent.kind === 195 /* BindingElement */ + || node.parent.kind === 199 /* ElementAccessExpression */ || node.kind === 105 /* SuperKeyword */) { referenceEntries = entries && __spreadArrays(entries); } @@ -122159,13 +119255,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 286 /* ShorthandPropertyAssignment */) { var result_1 = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); }); return result_1; @@ -122331,13 +119427,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 200 /* ObjectLiteralExpression */) { + else if (node.kind === 197 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(21 /* CloseParenToken */)] }; } - else if (node.kind === 221 /* ClassExpression */) { + else if (node.kind === 218 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(21 /* CloseParenToken */)] @@ -122398,47 +119494,47 @@ var ts; if (!!(decl.flags & 8388608 /* Ambient */)) return true; switch (decl.kind) { - case 216 /* BinaryExpression */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 213 /* BinaryExpression */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: case 87 /* DefaultKeyword */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 270 /* ExportSpecifier */: - case 262 /* ImportClause */: // default import - case 260 /* ImportEqualsDeclaration */: - case 265 /* ImportSpecifier */: - case 253 /* InterfaceDeclaration */: - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 280 /* JsxAttribute */: - case 256 /* ModuleDeclaration */: - case 259 /* NamespaceExportDeclaration */: - case 263 /* NamespaceImport */: - case 269 /* NamespaceExport */: - case 160 /* Parameter */: - case 289 /* ShorthandPropertyAssignment */: - case 254 /* TypeAliasDeclaration */: - case 159 /* TypeParameter */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 267 /* ExportSpecifier */: + case 259 /* ImportClause */: // default import + case 257 /* ImportEqualsDeclaration */: + case 262 /* ImportSpecifier */: + case 250 /* InterfaceDeclaration */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 277 /* JsxAttribute */: + case 253 /* ModuleDeclaration */: + case 256 /* NamespaceExportDeclaration */: + case 260 /* NamespaceImport */: + case 266 /* NamespaceExport */: + case 159 /* Parameter */: + case 286 /* ShorthandPropertyAssignment */: + case 251 /* TypeAliasDeclaration */: + case 158 /* TypeParameter */: return true; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.) return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return !!decl.body; - case 249 /* VariableDeclaration */: - case 163 /* PropertyDeclaration */: + case 246 /* VariableDeclaration */: + case 162 /* PropertyDeclaration */: return !!decl.initializer || ts.isCatchClause(decl.parent); - case 164 /* MethodSignature */: - case 162 /* PropertySignature */: - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: + case 163 /* MethodSignature */: + case 161 /* PropertySignature */: + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: return false; default: return ts.Debug.failBadSyntaxKind(decl); @@ -122599,10 +119695,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -122631,9 +119727,9 @@ var ts; } /** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */ function isReadonlyTypeOperator(node) { - return node.kind === 142 /* ReadonlyKeyword */ + return node.kind === 141 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(node.parent) - && node.parent.operator === 142 /* ReadonlyKeyword */; + && node.parent.operator === 141 /* ReadonlyKeyword */; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -122644,12 +119740,12 @@ var ts; } // A modifier readonly (like on a property declaration) is not special; // a readonly type keyword (like `readonly string[]`) is. - if (node.kind === 142 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { + if (node.kind === 141 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { return undefined; } // Likewise, when we *are* looking for a special keyword, make sure we // *don’t* include readonly member modifiers. - return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 142 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 141 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); } // Labels if (ts.isJumpStatementTarget(node)) { @@ -122950,7 +120046,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 208 /* FunctionExpression */ || valueDeclaration.kind === 221 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 205 /* FunctionExpression */ || valueDeclaration.kind === 218 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -122960,7 +120056,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasEffectiveModifier(d, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(d); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 252 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 249 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -122989,7 +120085,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 297 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 294 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -123361,14 +120457,14 @@ var ts; for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var ctrKeyword = ts.findChildOfKind(decl, 132 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 166 /* Constructor */ && !!ctrKeyword); + ts.Debug.assert(decl.kind === 165 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 165 /* MethodDeclaration */) { + if (decl && decl.kind === 164 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 107 /* ThisKeyword */, function (thisKeyword) { @@ -123392,7 +120488,7 @@ var ts; } for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 166 /* Constructor */); + ts.Debug.assert(decl.kind === 165 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 105 /* SuperKeyword */, function (node) { @@ -123422,7 +120518,7 @@ var ts; if (refNode.kind !== 78 /* Identifier */) { return; } - if (refNode.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 286 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -123442,7 +120538,7 @@ var ts; } else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) { var body = typeHavingNode.body; - if (body.kind === 230 /* Block */) { + if (body.kind === 227 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -123470,13 +120566,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: - case 200 /* ObjectLiteralExpression */: - case 221 /* ClassExpression */: - case 199 /* ArrayLiteralExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 197 /* ObjectLiteralExpression */: + case 218 /* ClassExpression */: + case 196 /* ArrayLiteralExpression */: return true; default: return false; @@ -123529,13 +120625,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: staticFlag &= ts.getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -123556,41 +120652,41 @@ var ts; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } function isParameterName(node) { - return node.kind === 78 /* Identifier */ && node.parent.kind === 160 /* Parameter */ && node.parent.name === node; + return node.kind === 78 /* Identifier */ && node.parent.kind === 159 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: staticFlag &= ts.getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return undefined; } - var references = ts.flatMap(searchSpaceNode.kind === 297 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { + var references = ts.flatMap(searchSpaceNode.kind === 294 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) { if (!ts.isThis(node)) { @@ -123598,19 +120694,19 @@ var ts; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getSyntacticModifierFlags(container) & 32 /* Static */) === staticFlag; - case 297 /* SourceFile */: - return container.kind === 297 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); + case 294 /* SourceFile */: + return container.kind === 294 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return nodeEntry(n); }); @@ -123709,7 +120805,7 @@ var ts; ts.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); // is [parameter, property] return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - var exportSpecifier = ts.getDeclarationOfKind(symbol, 270 /* ExportSpecifier */); + var exportSpecifier = ts.getDeclarationOfKind(symbol, 267 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -123754,7 +120850,7 @@ var ts; }); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { - var bindingElement = ts.getDeclarationOfKind(symbol, 198 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 195 /* BindingElement */); if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { return ts.getPropertySymbolFromBindingElement(checker, bindingElement); } @@ -123981,16 +121077,16 @@ var ts; return; } switch (node.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: - if (node.parent.kind === 200 /* ObjectLiteralExpression */) { + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: + if (node.parent.kind === 197 /* ObjectLiteralExpression */) { return (_a = ts.getAssignedName(node.parent)) === null || _a === void 0 ? void 0 : _a.getText(); } return (_b = ts.getNameOfDeclaration(node.parent)) === null || _b === void 0 ? void 0 : _b.getText(); - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: if (ts.isModuleBlock(node.parent) && ts.isIdentifier(node.parent.parent.name)) { return node.parent.parent.name.getText(); } @@ -124196,55 +121292,55 @@ var ts; } switch (node.kind) { case 78 /* Identifier */: - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: // do not descend into nodes that cannot contain callable nodes return; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: // do not descend into the type side of an assertion collect(node.expression); return; - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: // do not descend into the type of a variable or parameter declaration collect(node.name); collect(node.initializer); return; - case 203 /* CallExpression */: + case 200 /* CallExpression */: // do not descend into the type arguments of a call expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 204 /* NewExpression */: + case 201 /* NewExpression */: // do not descend into the type arguments of a new expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: // do not descend into the type arguments of a tagged template expression recordCallSite(node); collect(node.tag); collect(node.template); return; - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: // do not descend into the type arguments of a JsxOpeningLikeElement recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 161 /* Decorator */: + case 160 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: recordCallSite(node); ts.forEachChild(node, collect); break; @@ -124294,22 +121390,22 @@ var ts; var callSites = []; var collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; default: @@ -124590,7 +121686,9 @@ var ts; var sigInfo = createDefinitionFromSignatureDeclaration(typeChecker, calledDeclaration); // For a function, if this is the original function definition, return just sigInfo. // If this is the original constructor definition, parent is the class. - if (typeChecker.getRootSymbols(symbol).some(function (s) { return symbolMatchesSignature(s, calledDeclaration); })) { + if (typeChecker.getRootSymbols(symbol).some(function (s) { return symbolMatchesSignature(s, calledDeclaration); }) || + // TODO: GH#25533 Following check shouldn't be necessary if 'require' is an alias + symbol.declarations && symbol.declarations.some(function (d) { return ts.isVariableDeclaration(d) && !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ false); })) { return [sigInfo]; } else { @@ -124604,7 +121702,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 286 /* ShorthandPropertyAssignment */) { var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : []; } @@ -124649,11 +121747,6 @@ var ts; return getDefinitionFromSymbol(typeChecker, symbol, node); } GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition; - function isShorthandPropertyAssignmentOfModuleExports(symbol) { - var shorthandProperty = ts.tryCast(symbol.valueDeclaration, ts.isShorthandPropertyAssignment); - var binaryExpression = ts.tryCast(shorthandProperty === null || shorthandProperty === void 0 ? void 0 : shorthandProperty.parent.parent, ts.isAssignmentExpression); - return !!binaryExpression && ts.getAssignmentDeclarationKind(binaryExpression) === 2 /* ModuleExports */; - } /** * True if we should not add definitions for both the signature symbol and the definition symbol. * True for `const |f = |() => 0`, false for `function |f() {} const |g = f;`. @@ -124751,24 +121844,19 @@ var ts; // get the aliased symbol instead. This allows for goto def on an import e.g. // import {A, B} from "mod"; // to jump to the implementation directly. - while (symbol) { - if (symbol.flags & 2097152 /* Alias */ && shouldSkipAlias(node, symbol.declarations[0])) { - var aliased = checker.getAliasedSymbol(symbol); - if (!aliased.declarations) { - break; - } - symbol = aliased; + if (symbol && symbol.flags & 2097152 /* Alias */ && shouldSkipAlias(node, symbol.declarations[0])) { + var aliased = checker.getAliasedSymbol(symbol); + if (aliased.declarations) { + return aliased; } - else if (isShorthandPropertyAssignmentOfModuleExports(symbol)) { - // Skip past `module.exports = { Foo }` even though 'Foo' is not a real alias - var shorthandTarget = checker.resolveName(symbol.name, symbol.valueDeclaration, 111551 /* Value */, /*excludeGlobals*/ false); - if (!ts.some(shorthandTarget === null || shorthandTarget === void 0 ? void 0 : shorthandTarget.declarations)) { - break; + } + if (symbol && ts.isInJSFile(node)) { + var requireCall = ts.forEach(symbol.declarations, function (d) { return ts.isVariableDeclaration(d) && !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true) ? d.initializer : undefined; }); + if (requireCall) { + var moduleSymbol = checker.getSymbolAtLocation(requireCall.arguments[0]); + if (moduleSymbol) { + return checker.resolveExternalModuleSymbol(moduleSymbol); } - symbol = shorthandTarget; - } - else { - break; } } return symbol; @@ -124786,14 +121874,11 @@ var ts; return true; } switch (declaration.kind) { - case 262 /* ImportClause */: - case 260 /* ImportEqualsDeclaration */: + case 259 /* ImportClause */: + case 257 /* ImportEqualsDeclaration */: return true; - case 265 /* ImportSpecifier */: - return declaration.parent.kind === 264 /* NamedImports */; - case 198 /* BindingElement */: - case 249 /* VariableDeclaration */: - return ts.isInJSFile(declaration) && ts.isRequireVariableDeclaration(declaration, /*requireStringLiteralLikeArgument*/ true); + case 262 /* ImportSpecifier */: + return declaration.parent.kind === 261 /* NamedImports */; default: return false; } @@ -124878,9 +121963,9 @@ var ts; } function isConstructorLike(node) { switch (node.kind) { - case 166 /* Constructor */: - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 165 /* Constructor */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: return true; default: return false; @@ -124995,11 +122080,11 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return [declaration]; - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: return [declaration, declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -125020,19 +122105,18 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return withNode(tag.class); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return withNode(tag.class); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 329 /* JSDocTypeTag */: + case 325 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: - case 332 /* JSDocSeeTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -125054,7 +122138,7 @@ var ts; name: tagName, kind: "keyword" /* keyword */, kindModifiers: "", - sortText: ts.Completions.SortText.LocationPriority, + sortText: "0", }; })); } @@ -125066,7 +122150,7 @@ var ts; name: "@" + tagName, kind: "keyword" /* keyword */, kindModifiers: "", - sortText: ts.Completions.SortText.LocationPriority + sortText: "0" }; })); } @@ -125100,7 +122184,7 @@ var ts; || nameThusFar !== undefined && !ts.startsWith(name, nameThusFar)) { return undefined; } - return { name: name, kind: "parameter" /* parameterElement */, kindModifiers: "", sortText: ts.Completions.SortText.LocationPriority }; + return { name: name, kind: "parameter" /* parameterElement */, kindModifiers: "", sortText: "0" }; }); } JsDoc.getJSDocParameterNameCompletions = getJSDocParameterNameCompletions; @@ -125201,24 +122285,23 @@ var ts; } function getCommentOwnerInfoWorker(commentOwner) { switch (commentOwner.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 164 /* MethodSignature */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 163 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer); - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 162 /* PropertySignature */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 254 /* TypeAliasDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 161 /* PropertySignature */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 251 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 232 /* VariableStatement */: { + case 229 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -125226,16 +122309,16 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 297 /* SourceFile */: + case 294 /* SourceFile */: return "quit"; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 256 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 233 /* ExpressionStatement */: + return commentOwner.parent.kind === 253 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 230 /* ExpressionStatement */: return getCommentOwnerInfoWorker(commentOwner.expression); - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var be = commentOwner; if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; @@ -125243,7 +122326,7 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: var init = commentOwner.initializer; if (init && (ts.isFunctionExpression(init) || ts.isArrowFunction(init))) { return { commentOwner: commentOwner, parameters: init.parameters }; @@ -125259,14 +122342,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 207 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 204 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return rightHandSide.parameters; - case 221 /* ClassExpression */: { + case 218 /* ClassExpression */: { var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration); return ctr ? ctr.parameters : ts.emptyArray; } @@ -125328,9 +122411,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 262 /* ImportClause */: - case 265 /* ImportSpecifier */: - case 260 /* ImportEqualsDeclaration */: + case 259 /* ImportClause */: + case 262 /* ImportSpecifier */: + case 257 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217 var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -125340,7 +122423,7 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { var name = ts.getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 158 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 157 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } // Only added the names of computed properties if they're simple dotted expressions, like: // @@ -125357,7 +122440,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name && name.kind === 158 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 157 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return ts.emptyArray; } // Don't include the last portion. @@ -125565,7 +122648,7 @@ var ts; return; } switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -125577,21 +122660,21 @@ var ts; } } break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 163 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -125603,7 +122686,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 263 /* NamespaceImport */) { + if (namedBindings.kind === 260 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -125614,17 +122697,17 @@ var ts; } } break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: var expression = node.expression; // Use the expression as the name of the SpreadAssignment, otherwise show as . ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 198 /* BindingElement */: - case 288 /* PropertyAssignment */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 285 /* PropertyAssignment */: + case 246 /* VariableDeclaration */: var _e = node, name = _e.name, initializer = _e.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -125639,7 +122722,7 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: var nameNode = node.name; // If we see a function declaration track as a possible ES5 class if (nameNode && ts.isIdentifier(nameNode)) { @@ -125647,11 +122730,11 @@ var ts; } addNodeWithRecursiveChild(node, node.body); break; - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -125661,9 +122744,9 @@ var ts; } endNode(); break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: startNode(node); for (var _h = 0, _j = node.members; _h < _j.length; _h++) { var member = _j[_h]; @@ -125671,12 +122754,12 @@ var ts; } endNode(); break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { var expression_1 = node.expression; - var child = ts.isObjectLiteralExpression(expression_1) || ts.isCallExpression(expression_1) ? expression_1 : + var child = ts.isObjectLiteralExpression(expression_1) ? expression_1 : ts.isArrowFunction(expression_1) || ts.isFunctionExpression(expression_1) ? expression_1.body : undefined; if (child) { startNode(node); @@ -125688,16 +122771,16 @@ var ts; } break; } - case 270 /* ExportSpecifier */: - case 260 /* ImportEqualsDeclaration */: - case 171 /* IndexSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 254 /* TypeAliasDeclaration */: + case 267 /* ExportSpecifier */: + case 257 /* ImportEqualsDeclaration */: + case 170 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 251 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 203 /* CallExpression */: - case 216 /* BinaryExpression */: { + case 200 /* CallExpression */: + case 213 /* BinaryExpression */: { var special = ts.getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -125939,12 +123022,12 @@ var ts; return false; } switch (a.kind) { - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return ts.hasSyntacticModifier(a, 32 /* Static */) === ts.hasSyntacticModifier(b, 32 /* Static */); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -125960,7 +123043,7 @@ var ts; // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { // TODO: GH#18217 - return a.body.kind === b.body.kind && (a.body.kind !== 256 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 253 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -125990,7 +123073,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 256 /* ModuleDeclaration */) { + if (node.kind === 253 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -125999,16 +123082,16 @@ var ts; return propertyName && ts.unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 221 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 218 /* ClassExpression */: return getFunctionOrClassName(node); default: return undefined; } } function getItemName(node, name) { - if (node.kind === 256 /* ModuleDeclaration */) { + if (node.kind === 253 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -126020,18 +123103,18 @@ var ts; } } switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 209 /* ArrowFunction */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: if (ts.getSyntacticModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -126039,13 +123122,13 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return "constructor"; - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return "new()"; - case 169 /* CallSignature */: + case 168 /* CallSignature */: return "()"; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return "[]"; default: return ""; @@ -126078,19 +123161,19 @@ var ts; } // Some nodes are otherwise important enough to always include in the primary navigation menu. switch (navigationBarNodeKind(item)) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 255 /* EnumDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 297 /* SourceFile */: - case 254 /* TypeAliasDeclaration */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 252 /* EnumDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 294 /* SourceFile */: + case 251 /* TypeAliasDeclaration */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: return true; - case 209 /* ArrowFunction */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -126100,10 +123183,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 257 /* ModuleBlock */: - case 297 /* SourceFile */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: + case 254 /* ModuleBlock */: + case 294 /* SourceFile */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: return true; default: return false; @@ -126161,8 +123244,9 @@ var ts; return ts.getTextOfNode(moduleDeclaration.name); } // Otherwise, we need to aggregate each identifier to build up the qualified name. - var result = [ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)]; - while (moduleDeclaration.body && moduleDeclaration.body.kind === 256 /* ModuleDeclaration */) { + var result = []; + result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); + while (moduleDeclaration.body && moduleDeclaration.body.kind === 253 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -126176,13 +123260,13 @@ var ts; return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 158 /* ComputedPropertyName */; + return !member.name || member.name.kind === 157 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 297 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 294 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 249 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 246 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -126240,9 +123324,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: return true; default: return false; @@ -126596,11 +123680,11 @@ var ts; function getModuleSpecifierExpression(declaration) { var _a; switch (declaration.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return (_a = ts.tryCast(declaration.moduleReference, ts.isExternalModuleReference)) === null || _a === void 0 ? void 0 : _a.expression; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return declaration.moduleSpecifier; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return declaration.declarationList.declarations[0].initializer.arguments[0]; } } @@ -126639,19 +123723,19 @@ var ts; function getImportKindOrder(s1) { var _a; switch (s1.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: if (!s1.importClause) return 0; if (s1.importClause.isTypeOnly) return 1; - if (((_a = s1.importClause.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 263 /* NamespaceImport */) + if (((_a = s1.importClause.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 260 /* NamespaceImport */) return 2; if (s1.importClause.name) return 3; return 4; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return 5; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return 6; } } @@ -126697,9 +123781,12 @@ var ts; if (depthRemaining === 0) return; cancellationToken.throwIfCancellationRequested(); - if (ts.isDeclaration(n) || ts.isVariableStatement(n) || n.kind === 1 /* EndOfFileToken */) { + if (ts.isDeclaration(n) || n.kind === 1 /* EndOfFileToken */) { addOutliningForLeadingCommentsForNode(n, sourceFile, cancellationToken, out); } + if (isFunctionExpressionAssignedToVariable(n)) { + addOutliningForLeadingCommentsForNode(n.parent.parent.parent, sourceFile, cancellationToken, out); + } if (ts.isFunctionLike(n) && ts.isBinaryExpression(n.parent) && ts.isPropertyAccessExpression(n.parent.left)) { addOutliningForLeadingCommentsForNode(n.parent.left, sourceFile, cancellationToken, out); } @@ -126727,6 +123814,13 @@ var ts; } depthRemaining++; } + function isFunctionExpressionAssignedToVariable(n) { + if (!ts.isFunctionExpression(n) && !ts.isArrowFunction(n)) { + return false; + } + var ancestor = ts.findAncestor(n, ts.isVariableStatement); + return !!ancestor && ts.getSingleInitializerOfVariableStatementOrPropertyDeclaration(ancestor) === n; + } } function addRegionOutliningSpans(sourceFile, out) { var regions = []; @@ -126807,7 +123901,7 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 230 /* Block */: + case 227 /* Block */: if (ts.isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } @@ -126815,16 +123909,16 @@ var ts; // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 235 /* DoStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 237 /* ForStatement */: - case 234 /* IfStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 287 /* CatchClause */: + case 232 /* DoStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 234 /* ForStatement */: + case 231 /* IfStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 284 /* CatchClause */: return spanForNode(n.parent); - case 247 /* TryStatement */: + case 244 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -126841,40 +123935,40 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return spanForNode(n.parent); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 258 /* CaseBlock */: - case 177 /* TypeLiteral */: - case 196 /* ObjectBindingPattern */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 255 /* CaseBlock */: + case 176 /* TypeLiteral */: + case 193 /* ObjectBindingPattern */: return spanForNode(n); - case 179 /* TupleType */: + case 178 /* TupleType */: return spanForNode(n, /*autoCollapse*/ false, /*useFullStart*/ !ts.isTupleTypeNode(n.parent), 22 /* OpenBracketToken */); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: return spanForNodeArray(n.statements); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return spanForJSXElement(n); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return spanForJSXFragment(n); - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return spanForNode(n, /*autoCollapse*/ false, /*useFullStart*/ !ts.isBindingElement(n.parent), 22 /* OpenBracketToken */); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return spanForArrowFunction(n); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return spanForCallExpression(n); } function spanForCallExpression(node) { @@ -126941,7 +124035,7 @@ var ts; function functionSpan(node, body, sourceFile) { var openToken = tryGetFunctionOpenToken(node, body, sourceFile); var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile); - return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 209 /* ArrowFunction */); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 206 /* ArrowFunction */); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -127488,7 +124582,7 @@ var ts; if (token === 133 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 139 /* ModuleKeyword */) { + if (token === 138 /* ModuleKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { recordAmbientExternalModule(); @@ -127522,10 +124616,10 @@ var ts; return true; } else { - if (token === 149 /* TypeKeyword */) { + if (token === 148 /* TypeKeyword */) { var skipTypeKeyword = ts.scanner.lookAhead(function () { var token = ts.scanner.scan(); - return token !== 153 /* FromKeyword */ && (token === 41 /* AsteriskToken */ || + return token !== 152 /* FromKeyword */ && (token === 41 /* AsteriskToken */ || token === 18 /* OpenBraceToken */ || token === 78 /* Identifier */ || ts.isKeyword(token)); @@ -127536,7 +124630,7 @@ var ts; } if (token === 78 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import d from "mod"; @@ -127567,7 +124661,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import {a as A} from "mod"; @@ -127583,7 +124677,7 @@ var ts; token = nextToken(); if (token === 78 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import * as NS from "mod" @@ -127604,7 +124698,7 @@ var ts; if (token === 92 /* ExportKeyword */) { markAsExternalModuleIfTopLevel(); token = nextToken(); - if (token === 149 /* TypeKeyword */) { + if (token === 148 /* TypeKeyword */) { var skipTypeKeyword = ts.scanner.lookAhead(function () { var token = ts.scanner.scan(); return token === 41 /* AsteriskToken */ || @@ -127623,7 +124717,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export {a as A} from "mod"; @@ -127635,7 +124729,7 @@ var ts; } else if (token === 41 /* AsteriskToken */) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export * from "mod" @@ -127645,7 +124739,7 @@ var ts; } else if (token === 99 /* ImportKeyword */) { token = nextToken(); - if (token === 149 /* TypeKeyword */) { + if (token === 148 /* TypeKeyword */) { var skipTypeKeyword = ts.scanner.lookAhead(function () { var token = ts.scanner.scan(); return token === 78 /* Identifier */ || @@ -127671,7 +124765,7 @@ var ts; function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) { if (allowTemplateLiterals === void 0) { allowTemplateLiterals = false; } var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 143 /* RequireKeyword */) { + if (token === 142 /* RequireKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); @@ -127814,13 +124908,8 @@ var ts; Rename.getRenameInfo = getRenameInfo; function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile, options) { var symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { - if (ts.isLabelName(node)) { - var name = ts.getTextOfNode(node); - return getRenameInfoSuccess(name, name, "label" /* label */, "" /* none */, node, sourceFile); - } - return undefined; - } + if (!symbol) + return; // Only allow a symbol to be renamed if it actually has at least one declaration. var declarations = symbol.declarations; if (!declarations || declarations.length === 0) @@ -127837,7 +124926,7 @@ var ts; return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 158 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 157 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -127913,7 +125002,6 @@ var ts; var SmartSelectionRange; (function (SmartSelectionRange) { function getSmartSelectionRange(pos, sourceFile) { - var _a; var selectionRange = { textSpan: ts.createTextSpanFromBounds(sourceFile.getFullStart(), sourceFile.getEnd()) }; @@ -127926,7 +125014,7 @@ var ts; var prevNode = children[i - 1]; var node = children[i]; var nextNode = children[i + 1]; - if (ts.getTokenPosOfNode(node, sourceFile, /*includeJsDoc*/ true) > pos) { + if (node.getStart(sourceFile) > pos) { break outer; } if (positionShouldSnapToNode(sourceFile, pos, node)) { @@ -127935,14 +125023,14 @@ var ts; // of things that should be considered independently. // 3. A VariableStatement’s children are just a VaraiableDeclarationList and a semicolon. // 4. A lone VariableDeclaration in a VaraibleDeclaration feels redundant with the VariableStatement. + // // Dive in without pushing a selection range. if (ts.isBlock(node) || ts.isTemplateSpan(node) || ts.isTemplateHead(node) || ts.isTemplateTail(node) || prevNode && ts.isTemplateHead(prevNode) || ts.isVariableDeclarationList(node) && ts.isVariableStatement(parentNode) || ts.isSyntaxList(node) && ts.isVariableDeclarationList(parentNode) - || ts.isVariableDeclaration(node) && ts.isSyntaxList(parentNode) && children.length === 1 - || ts.isJSDocTypeExpression(node) || ts.isJSDocSignature(node) || ts.isJSDocTypeLiteral(node)) { + || ts.isVariableDeclaration(node) && ts.isSyntaxList(parentNode) && children.length === 1) { parentNode = node; break; } @@ -127954,12 +125042,15 @@ var ts; } // Blocks with braces, brackets, parens, or JSX tags on separate lines should be // selected from open to close, including whitespace but not including the braces/etc. themselves. - var isBetweenMultiLineBookends = ts.isSyntaxList(node) && isListOpener(prevNode) && isListCloser(nextNode) + var isBetweenMultiLineBookends = ts.isSyntaxList(node) + && isListOpener(prevNode) + && isListCloser(nextNode) && !ts.positionsAreOnSameLine(prevNode.getStart(), nextNode.getStart(), sourceFile); + var jsDocCommentStart = ts.hasJSDocNodes(node) && node.jsDoc[0].getStart(); var start = isBetweenMultiLineBookends ? prevNode.getEnd() : node.getStart(); - var end = isBetweenMultiLineBookends ? nextNode.getStart() : getEndPos(sourceFile, node); - if (ts.hasJSDocNodes(node) && ((_a = node.jsDoc) === null || _a === void 0 ? void 0 : _a.length)) { - pushSelectionRange(ts.first(node.jsDoc).getStart(), end); + var end = isBetweenMultiLineBookends ? nextNode.getStart() : node.getEnd(); + if (ts.isNumber(jsDocCommentStart)) { + pushSelectionRange(jsDocCommentStart, end); } pushSelectionRange(start, end); // String literals should have a stop both inside and outside their quotes. @@ -128047,14 +125138,14 @@ var ts; ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */); // Group `-/+readonly` and `-/+?` var groupedWithPlusMinusTokens = groupChildren(children, function (child) { - return child === node.readonlyToken || child.kind === 142 /* ReadonlyKeyword */ || + return child === node.readonlyToken || child.kind === 141 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */; }); // Group type parameter with surrounding brackets var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) { var kind = _a.kind; return kind === 22 /* OpenBracketToken */ || - kind === 159 /* TypeParameter */ || + kind === 158 /* TypeParameter */ || kind === 23 /* CloseBracketToken */; }); return [ @@ -128168,26 +125259,14 @@ var ts; return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ - || kind === 275 /* JsxOpeningElement */; + || kind === 272 /* JsxOpeningElement */; } function isListCloser(token) { var kind = token && token.kind; return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ - || kind === 276 /* JsxClosingElement */; - } - function getEndPos(sourceFile, node) { - switch (node.kind) { - case 326 /* JSDocParameterTag */: - case 324 /* JSDocCallbackTag */: - case 333 /* JSDocPropertyTag */: - case 331 /* JSDocTypedefTag */: - case 328 /* JSDocThisTag */: - return sourceFile.getLineEndOfPosition(node.getStart()); - default: - return node.getEnd(); - } + || kind === 273 /* JsxClosingElement */; } })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {})); })(ts || (ts = {})); @@ -128393,10 +125472,10 @@ var ts; } return undefined; } - else if (ts.isTemplateHead(node) && parent.parent.kind === 205 /* TaggedTemplateExpression */) { + else if (ts.isTemplateHead(node) && parent.parent.kind === 202 /* TaggedTemplateExpression */) { var templateExpression = parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 218 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 215 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } @@ -128465,17 +125544,17 @@ var ts; return undefined; var parent = startingToken.parent; switch (parent.kind) { - case 207 /* ParenthesizedExpression */: - case 165 /* MethodDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 204 /* ParenthesizedExpression */: + case 164 /* MethodDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: var info = getArgumentOrParameterListInfo(startingToken, sourceFile); if (!info) return undefined; var argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan; var contextualType = ts.isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent); return contextualType && { contextualType: contextualType, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan }; - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var highestBinary = getHighestBinary(parent); var contextualType_1 = checker.getContextualType(highestBinary); var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1; @@ -128599,7 +125678,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 218 /* TemplateExpression */) { + if (template.kind === 215 /* TemplateExpression */) { var lastSpan = ts.last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -128951,7 +126030,7 @@ var ts; return diags.sort(function (d1, d2) { return d1.start - d2.start; }); function check(node) { if (isJsFile) { - if (canBeConvertedToClass(node, checker)) { + if (canBeConvertedToClass(node)) { diags.push(ts.createDiagnosticForNode(ts.isVariableDeclaration(node.parent) ? node.parent.name : node, ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration)); } } @@ -128980,11 +126059,11 @@ var ts; function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some(function (statement) { switch (statement.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return statement.declarationList.declarations.some(function (decl) { return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true); }); - case 233 /* ExpressionStatement */: { + case 230 /* ExpressionStatement */: { var expression = statement.expression; if (!ts.isBinaryExpression(expression)) return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true); @@ -129001,12 +126080,12 @@ var ts; } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 263 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 260 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : undefined; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node.name; default: return undefined; @@ -129075,9 +126154,9 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 103 /* NullKeyword */: @@ -129090,16 +126169,17 @@ var ts; function getKeyFromNode(exp) { return exp.pos.toString() + ":" + exp.end.toString(); } - function canBeConvertedToClass(node, checker) { + function canBeConvertedToClass(node) { var _a, _b, _c, _d; - if (node.kind === 208 /* FunctionExpression */) { + if (node.kind === 205 /* FunctionExpression */) { if (ts.isVariableDeclaration(node.parent) && ((_a = node.symbol.members) === null || _a === void 0 ? void 0 : _a.size)) { return true; } - var symbol = checker.getSymbolOfExpando(node, /*allowDeclaration*/ false); + var decl = ts.getDeclarationOfExpando(node); + var symbol = decl === null || decl === void 0 ? void 0 : decl.symbol; return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size))); } - if (node.kind === 251 /* FunctionDeclaration */) { + if (node.kind === 248 /* FunctionDeclaration */) { return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size); } return false; @@ -129119,7 +126199,7 @@ var ts; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 221 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 218 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -129205,11 +126285,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 275 /* JsxOpeningElement */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: return location.kind === 78 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -129253,7 +126333,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 201 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 198 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -129273,7 +126353,7 @@ var ts; } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217 - var useConstructSignatures = callExpressionLike.kind === 204 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 105 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 201 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 105 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -129329,7 +126409,7 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 132 /* ConstructorKeyword */ && location.parent.kind === 166 /* Constructor */)) { // At constructor keyword of constructor declaration + (location.kind === 132 /* ConstructorKeyword */ && location.parent.kind === 165 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration @@ -129337,21 +126417,21 @@ var ts; return declaration === (location.kind === 132 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 166 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 165 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); // TODO: GH#18217 } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 166 /* Constructor */) { + if (functionDeclaration_1.kind === 165 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 169 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 168 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -129362,7 +126442,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 221 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 218 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -129385,7 +126465,7 @@ var ts; } if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(149 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(148 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -129406,9 +126486,9 @@ var ts; } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 256 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 253 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 78 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 140 /* NamespaceKeyword */ : 139 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 139 /* NamespaceKeyword */ : 138 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -129427,7 +126507,7 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 159 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 158 /* TypeParameter */); if (decl === undefined) return ts.Debug.fail(); var declaration = decl.parent; @@ -129435,21 +126515,21 @@ var ts; if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217 - if (declaration.kind === 170 /* ConstructSignature */) { + if (declaration.kind === 169 /* ConstructSignature */) { displayParts.push(ts.keywordPart(102 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 169 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 168 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 254 /* TypeAliasDeclaration */) { + else if (declaration.kind === 251 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(149 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(148 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -129461,7 +126541,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 291 /* EnumMember */) { + if (declaration.kind === 288 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -129492,17 +126572,17 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(92 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(140 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(139 /* NamespaceKeyword */)); break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: displayParts.push(ts.keywordPart(92 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 62 /* EqualsToken */ : 87 /* DefaultKeyword */)); break; - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: displayParts.push(ts.keywordPart(92 /* ExportKeyword */)); break; default: @@ -129511,13 +126591,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 260 /* ImportEqualsDeclaration */) { + if (declaration.kind === 257 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(62 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(143 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(142 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(20 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(21 /* CloseParenToken */)); @@ -129598,10 +126678,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 297 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 294 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 216 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 213 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -129719,16 +126799,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 208 /* FunctionExpression */) { + if (declaration.kind === 205 /* FunctionExpression */) { return true; } - if (declaration.kind !== 249 /* VariableDeclaration */ && declaration.kind !== 251 /* FunctionDeclaration */) { + if (declaration.kind !== 246 /* VariableDeclaration */ && declaration.kind !== 248 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 297 /* SourceFile */ || parent.kind === 257 /* ModuleBlock */) { + if (parent.kind === 294 /* SourceFile */ || parent.kind === 254 /* ModuleBlock */) { return false; } } @@ -130029,10 +127109,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 280 /* JsxAttribute */: - case 275 /* JsxOpeningElement */: - case 276 /* JsxClosingElement */: - case 274 /* JsxSelfClosingElement */: + case 277 /* JsxAttribute */: + case 272 /* JsxOpeningElement */: + case 273 /* JsxClosingElement */: + case 271 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 78 /* Identifier */; } @@ -130233,7 +127313,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 156 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 155 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -130248,9 +127328,9 @@ var ts; var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */])); var anyTokenIncludingEOF = tokenRangeFrom(__spreadArrays(allTokens, [1 /* EndOfFileToken */])); - var keywords = tokenRangeFromRange(80 /* FirstKeyword */, 156 /* LastKeyword */); + var keywords = tokenRangeFromRange(80 /* FirstKeyword */, 155 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 77 /* LastBinaryOperator */); - var binaryKeywordOperators = [100 /* InKeyword */, 101 /* InstanceOfKeyword */, 156 /* OfKeyword */, 126 /* AsKeyword */, 137 /* IsKeyword */]; + var binaryKeywordOperators = [100 /* InKeyword */, 101 /* InstanceOfKeyword */, 155 /* OfKeyword */, 126 /* AsKeyword */, 136 /* IsKeyword */]; var unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 78 /* Identifier */, 20 /* OpenParenToken */, @@ -130324,7 +127404,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [134 /* GetKeyword */, 146 /* SetKeyword */], 78 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), + rule("SpaceAfterGetSetInMember", [134 /* GetKeyword */, 145 /* SetKeyword */], 78 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), rule("NoSpaceBetweenYieldKeywordAndStar", 124 /* YieldKeyword */, 41 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [124 /* YieldKeyword */, 41 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */), rule("NoSpaceBetweenReturnAndSemicolon", 104 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), @@ -130348,7 +127428,7 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 62 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [139 /* ModuleKeyword */, 143 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceAfterModuleImport", [138 /* ModuleKeyword */, 142 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 125 /* AbstractKeyword */, @@ -130362,20 +127442,20 @@ var ts; 116 /* ImplementsKeyword */, 99 /* ImportKeyword */, 117 /* InterfaceKeyword */, - 139 /* ModuleKeyword */, - 140 /* NamespaceKeyword */, + 138 /* ModuleKeyword */, + 139 /* NamespaceKeyword */, 120 /* PrivateKeyword */, 122 /* PublicKeyword */, 121 /* ProtectedKeyword */, - 142 /* ReadonlyKeyword */, - 146 /* SetKeyword */, + 141 /* ReadonlyKeyword */, + 145 /* SetKeyword */, 123 /* StaticKeyword */, - 149 /* TypeKeyword */, - 153 /* FromKeyword */, - 138 /* KeyOfKeyword */, + 148 /* TypeKeyword */, + 152 /* FromKeyword */, + 137 /* KeyOfKeyword */, 135 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [93 /* ExtendsKeyword */, 116 /* ImplementsKeyword */, 153 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [93 /* ExtendsKeyword */, 116 /* ImplementsKeyword */, 152 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 10 /* StringLiteral */, 18 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */), // Lambda expressions @@ -130407,7 +127487,7 @@ var ts; 120 /* PrivateKeyword */, 121 /* ProtectedKeyword */, 134 /* GetKeyword */, - 146 /* SetKeyword */, + 145 /* SetKeyword */, 22 /* OpenBracketToken */, 41 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 4 /* InsertSpace */), @@ -130561,51 +127641,51 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 237 /* ForStatement */; + return context.contextNode.kind === 234 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 27 /* CommaToken */; - case 217 /* ConditionalExpression */: - case 184 /* ConditionalType */: - case 224 /* AsExpression */: - case 270 /* ExportSpecifier */: - case 265 /* ImportSpecifier */: - case 172 /* TypePredicate */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 214 /* ConditionalExpression */: + case 183 /* ConditionalType */: + case 221 /* AsExpression */: + case 267 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 171 /* TypePredicate */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 198 /* BindingElement */: + case 195 /* BindingElement */: // equals in type X = ... // falls through - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // equal in let a = 0 // falls through - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: // equal in p = 0 // falls through - case 160 /* Parameter */: - case 291 /* EnumMember */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 159 /* Parameter */: + case 288 /* EnumMember */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return context.currentTokenSpan.kind === 100 /* InKeyword */ || context.nextTokenSpan.kind === 100 /* InKeyword */ || context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 239 /* ForOfStatement */: - return context.currentTokenSpan.kind === 156 /* OfKeyword */ || context.nextTokenSpan.kind === 156 /* OfKeyword */; + case 236 /* ForOfStatement */: + return context.currentTokenSpan.kind === 155 /* OfKeyword */ || context.nextTokenSpan.kind === 155 /* OfKeyword */; } return false; } @@ -130617,22 +127697,22 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 163 /* PropertyDeclaration */ || - contextKind === 162 /* PropertySignature */ || - contextKind === 160 /* Parameter */ || - contextKind === 249 /* VariableDeclaration */ || + return contextKind === 162 /* PropertyDeclaration */ || + contextKind === 161 /* PropertySignature */ || + contextKind === 159 /* Parameter */ || + contextKind === 246 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 217 /* ConditionalExpression */ || - context.contextNode.kind === 184 /* ConditionalType */; + return context.contextNode.kind === 214 /* ConditionalExpression */ || + context.contextNode.kind === 183 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 196 /* ObjectBindingPattern */ || - context.contextNode.kind === 190 /* MappedType */ || + return context.contextNode.kind === 193 /* ObjectBindingPattern */ || + context.contextNode.kind === 189 /* MappedType */ || isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration @@ -130658,34 +127738,34 @@ var ts; return true; } switch (node.kind) { - case 230 /* Block */: - case 258 /* CaseBlock */: - case 200 /* ObjectLiteralExpression */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 197 /* ObjectLiteralExpression */: + case 254 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 169 /* CallSignature */: - case 208 /* FunctionExpression */: - case 166 /* Constructor */: - case 209 /* ArrowFunction */: + case 168 /* CallSignature */: + case 205 /* FunctionExpression */: + case 165 /* Constructor */: + case 206 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 253 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one + case 250 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; @@ -130694,40 +127774,40 @@ var ts; return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 251 /* FunctionDeclaration */ || context.contextNode.kind === 208 /* FunctionExpression */; + return context.contextNode.kind === 248 /* FunctionDeclaration */ || context.contextNode.kind === 205 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 177 /* TypeLiteral */: - case 256 /* ModuleDeclaration */: - case 267 /* ExportDeclaration */: - case 268 /* NamedExports */: - case 261 /* ImportDeclaration */: - case 264 /* NamedImports */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 176 /* TypeLiteral */: + case 253 /* ModuleDeclaration */: + case 264 /* ExportDeclaration */: + case 265 /* NamedExports */: + case 258 /* ImportDeclaration */: + case 261 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 287 /* CatchClause */: - case 257 /* ModuleBlock */: - case 244 /* SwitchStatement */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 284 /* CatchClause */: + case 254 /* ModuleBlock */: + case 241 /* SwitchStatement */: return true; - case 230 /* Block */: { + case 227 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 209 /* ArrowFunction */ && blockParent.kind !== 208 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 206 /* ArrowFunction */ && blockParent.kind !== 205 /* FunctionExpression */) { return true; } } @@ -130736,32 +127816,32 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 234 /* IfStatement */: - case 244 /* SwitchStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 236 /* WhileStatement */: - case 247 /* TryStatement */: - case 235 /* DoStatement */: - case 243 /* WithStatement */: + case 231 /* IfStatement */: + case 241 /* SwitchStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 233 /* WhileStatement */: + case 244 /* TryStatement */: + case 232 /* DoStatement */: + case 240 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 287 /* CatchClause */: + case 284 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 200 /* ObjectLiteralExpression */; + return context.contextNode.kind === 197 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 203 /* CallExpression */; + return context.contextNode.kind === 200 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 204 /* NewExpression */; + return context.contextNode.kind === 201 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -130776,10 +127856,10 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 209 /* ArrowFunction */; + return context.contextNode.kind === 206 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 195 /* ImportType */; + return context.contextNode.kind === 192 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */; @@ -130788,19 +127868,19 @@ var ts; return context.contextNode.kind !== 11 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 273 /* JsxElement */ && context.contextNode.kind !== 277 /* JsxFragment */; + return context.contextNode.kind !== 270 /* JsxElement */ && context.contextNode.kind !== 274 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 283 /* JsxExpression */ || context.contextNode.kind === 282 /* JsxSpreadAttribute */; + return context.contextNode.kind === 280 /* JsxExpression */ || context.contextNode.kind === 279 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 280 /* JsxAttribute */; + return context.nextTokenParent.kind === 277 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 280 /* JsxAttribute */; + return context.contextNode.kind === 277 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 274 /* JsxSelfClosingElement */; + return context.contextNode.kind === 271 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -130815,45 +127895,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 161 /* Decorator */; + return node.kind === 160 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 250 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 247 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 256 /* ModuleDeclaration */; + return context.contextNode.kind === 253 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 177 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 176 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 170 /* ConstructSignature */; + return context.contextNode.kind === 169 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 173 /* TypeReference */: - case 206 /* TypeAssertionExpression */: - case 254 /* TypeAliasDeclaration */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 223 /* ExpressionWithTypeArguments */: + case 172 /* TypeReference */: + case 203 /* TypeAssertionExpression */: + case 251 /* TypeAliasDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 220 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -130864,28 +127944,28 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 206 /* TypeAssertionExpression */; + return context.contextNode.kind === 203 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 113 /* VoidKeyword */ && context.currentTokenParent.kind === 212 /* VoidExpression */; + return context.currentTokenSpan.kind === 113 /* VoidKeyword */ && context.currentTokenParent.kind === 209 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 219 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 216 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 225 /* NonNullExpression */; + return context.contextNode.kind === 222 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 234 /* IfStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 231 /* IfStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return true; default: return false; @@ -130910,12 +127990,12 @@ var ts; return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; } - if (nextTokenKind === 229 /* SemicolonClassElement */ || + if (nextTokenKind === 226 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 253 /* InterfaceDeclaration */ || - context.contextNode.kind === 254 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 250 /* InterfaceDeclaration */ || + context.contextNode.kind === 251 /* TypeAliasDeclaration */) { // Can’t remove semicolon after `foo`; it would parse as a method declaration: // // interface I { @@ -130929,9 +128009,9 @@ var ts; if (ts.isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 237 /* ForStatement */ - && context.currentTokenParent.kind !== 231 /* EmptyStatement */ - && context.currentTokenParent.kind !== 229 /* SemicolonClassElement */ + return context.currentTokenParent.kind !== 234 /* ForStatement */ + && context.currentTokenParent.kind !== 228 /* EmptyStatement */ + && context.currentTokenParent.kind !== 226 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ @@ -130939,7 +128019,7 @@ var ts; && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ - && nextTokenKind !== 218 /* TemplateExpression */ + && nextTokenKind !== 215 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */; @@ -131030,12 +128110,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 156 /* LastKeyword */ && column <= 156 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 155 /* LastKeyword */ && column <= 155 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 156 /* LastToken */ + 1; + var mapRowLength = 155 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["StopRulesSpecific"] = 0] = "StopRulesSpecific"; @@ -131223,17 +128303,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var body = parent.body; - return !!body && body.kind === 257 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 297 /* SourceFile */: - case 230 /* Block */: - case 257 /* ModuleBlock */: + return !!body && body.kind === 254 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 294 /* SourceFile */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -131460,19 +128540,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 252 /* ClassDeclaration */: return 83 /* ClassKeyword */; - case 253 /* InterfaceDeclaration */: return 117 /* InterfaceKeyword */; - case 251 /* FunctionDeclaration */: return 97 /* FunctionKeyword */; - case 255 /* EnumDeclaration */: return 255 /* EnumDeclaration */; - case 167 /* GetAccessor */: return 134 /* GetKeyword */; - case 168 /* SetAccessor */: return 146 /* SetKeyword */; - case 165 /* MethodDeclaration */: + case 249 /* ClassDeclaration */: return 83 /* ClassKeyword */; + case 250 /* InterfaceDeclaration */: return 117 /* InterfaceKeyword */; + case 248 /* FunctionDeclaration */: return 97 /* FunctionKeyword */; + case 252 /* EnumDeclaration */: return 252 /* EnumDeclaration */; + case 166 /* GetAccessor */: return 134 /* GetKeyword */; + case 167 /* SetAccessor */: return 145 /* SetKeyword */; + case 164 /* MethodDeclaration */: if (node.asteriskToken) { return 41 /* AsteriskToken */; } // falls through - case 163 /* PropertyDeclaration */: - case 160 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 159 /* Parameter */: var name = ts.getNameOfDeclaration(node); if (name) { return name.kind; @@ -131529,15 +128609,15 @@ var ts; case 43 /* SlashToken */: case 31 /* GreaterThanToken */: switch (container.kind) { - case 275 /* JsxOpeningElement */: - case 276 /* JsxClosingElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 273 /* JsxClosingElement */: + case 271 /* JsxSelfClosingElement */: return false; } break; case 22 /* OpenBracketToken */: case 23 /* CloseBracketToken */: - if (container.kind !== 190 /* MappedType */) { + if (container.kind !== 189 /* MappedType */) { return false; } break; @@ -131645,7 +128725,7 @@ var ts; return inheritedIndentation; } } - var effectiveParentStartLine = child.kind === 161 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 160 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 11 /* JsxText */) { @@ -131665,7 +128745,7 @@ var ts; } } childContextNode = node; - if (isFirstListItem && parent.kind === 199 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 196 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -132105,12 +129185,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 209 /* ArrowFunction */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 206 /* ArrowFunction */: if (node.typeParameters === list) { return 29 /* LessThanToken */; } @@ -132118,8 +129198,8 @@ var ts; return 20 /* OpenParenToken */; } break; - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } @@ -132127,12 +129207,12 @@ var ts; return 20 /* OpenParenToken */; } break; - case 173 /* TypeReference */: + case 172 /* TypeReference */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } break; - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return 18 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -132250,7 +129330,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 216 /* BinaryExpression */) { + if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 213 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -132404,7 +129484,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 297 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 294 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -132452,7 +129532,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 234 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 231 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 90 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -132490,40 +129570,40 @@ var ts; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return getList(node.typeArguments); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return getList(node.properties); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getList(node.elements); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return getList(node.members); - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 166 /* Constructor */: - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 165 /* Constructor */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 204 /* NewExpression */: - case 203 /* CallExpression */: + case 201 /* NewExpression */: + case 200 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return getList(node.declarations); - case 264 /* NamedImports */: - case 268 /* NamedExports */: + case 261 /* NamedImports */: + case 265 /* NamedExports */: return getList(node.elements); - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -132546,7 +129626,7 @@ var ts; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 250 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 247 /* VariableDeclarationList */) { // VariableDeclarationList has no wrapping tokens return -1 /* Unknown */; } @@ -132619,91 +129699,87 @@ var ts; function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 233 /* ExpressionStatement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 199 /* ArrayLiteralExpression */: - case 230 /* Block */: - case 257 /* ModuleBlock */: - case 200 /* ObjectLiteralExpression */: - case 177 /* TypeLiteral */: - case 190 /* MappedType */: - case 179 /* TupleType */: - case 258 /* CaseBlock */: - case 285 /* DefaultClause */: - case 284 /* CaseClause */: - case 207 /* ParenthesizedExpression */: - case 201 /* PropertyAccessExpression */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 232 /* VariableStatement */: - case 266 /* ExportAssignment */: - case 242 /* ReturnStatement */: - case 217 /* ConditionalExpression */: - case 197 /* ArrayBindingPattern */: - case 196 /* ObjectBindingPattern */: - case 275 /* JsxOpeningElement */: - case 278 /* JsxOpeningFragment */: - case 274 /* JsxSelfClosingElement */: - case 283 /* JsxExpression */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 160 /* Parameter */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 186 /* ParenthesizedType */: - case 205 /* TaggedTemplateExpression */: - case 213 /* AwaitExpression */: - case 268 /* NamedExports */: - case 264 /* NamedImports */: - case 270 /* ExportSpecifier */: - case 265 /* ImportSpecifier */: - case 163 /* PropertyDeclaration */: + case 230 /* ExpressionStatement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 196 /* ArrayLiteralExpression */: + case 227 /* Block */: + case 254 /* ModuleBlock */: + case 197 /* ObjectLiteralExpression */: + case 176 /* TypeLiteral */: + case 189 /* MappedType */: + case 178 /* TupleType */: + case 255 /* CaseBlock */: + case 282 /* DefaultClause */: + case 281 /* CaseClause */: + case 204 /* ParenthesizedExpression */: + case 198 /* PropertyAccessExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 229 /* VariableStatement */: + case 263 /* ExportAssignment */: + case 239 /* ReturnStatement */: + case 214 /* ConditionalExpression */: + case 194 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 272 /* JsxOpeningElement */: + case 275 /* JsxOpeningFragment */: + case 271 /* JsxSelfClosingElement */: + case 280 /* JsxExpression */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 159 /* Parameter */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 185 /* ParenthesizedType */: + case 202 /* TaggedTemplateExpression */: + case 210 /* AwaitExpression */: + case 265 /* NamedExports */: + case 261 /* NamedImports */: + case 267 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 162 /* PropertyDeclaration */: return true; - case 249 /* VariableDeclaration */: - case 288 /* PropertyAssignment */: - case 216 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 200 /* ObjectLiteralExpression */) { // TODO: GH#18217 + case 246 /* VariableDeclaration */: + case 285 /* PropertyAssignment */: + case 213 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 197 /* ObjectLiteralExpression */) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child); } - if (parent.kind !== 216 /* BinaryExpression */) { + if (parent.kind !== 213 /* BinaryExpression */) { return true; } break; - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 237 /* ForStatement */: - case 234 /* IfStatement */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - return childKind !== 230 /* Block */; - case 209 /* ArrowFunction */: - if (sourceFile && childKind === 207 /* ParenthesizedExpression */) { - return rangeIsOnOneLine(sourceFile, child); - } - return childKind !== 230 /* Block */; - case 267 /* ExportDeclaration */: - return childKind !== 268 /* NamedExports */; - case 261 /* ImportDeclaration */: - return childKind !== 262 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 264 /* NamedImports */); - case 273 /* JsxElement */: - return childKind !== 276 /* JsxClosingElement */; - case 277 /* JsxFragment */: - return childKind !== 279 /* JsxClosingFragment */; - case 183 /* IntersectionType */: - case 182 /* UnionType */: - if (childKind === 177 /* TypeLiteral */ || childKind === 179 /* TupleType */) { + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 234 /* ForStatement */: + case 231 /* IfStatement */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 206 /* ArrowFunction */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + return childKind !== 227 /* Block */; + case 264 /* ExportDeclaration */: + return childKind !== 265 /* NamedExports */; + case 258 /* ImportDeclaration */: + return childKind !== 259 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 261 /* NamedImports */); + case 270 /* JsxElement */: + return childKind !== 273 /* JsxClosingElement */; + case 274 /* JsxFragment */: + return childKind !== 276 /* JsxClosingFragment */; + case 182 /* IntersectionType */: + case 181 /* UnionType */: + if (childKind === 176 /* TypeLiteral */ || childKind === 178 /* TupleType */) { return false; } // falls through @@ -132714,11 +129790,11 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 242 /* ReturnStatement */: - case 246 /* ThrowStatement */: - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: - return parent.kind !== 230 /* Block */; + case 239 /* ReturnStatement */: + case 243 /* ThrowStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: + return parent.kind !== 227 /* Block */; default: return false; } @@ -132792,10 +129868,8 @@ var ts; (function (TrailingTriviaOption) { /** Exclude all trailing trivia (use getEnd()) */ TrailingTriviaOption[TrailingTriviaOption["Exclude"] = 0] = "Exclude"; - /** Doesn't include whitespace, but does strip comments */ - TrailingTriviaOption[TrailingTriviaOption["ExcludeWhitespace"] = 1] = "ExcludeWhitespace"; /** Include trailing trivia */ - TrailingTriviaOption[TrailingTriviaOption["Include"] = 2] = "Include"; + TrailingTriviaOption[TrailingTriviaOption["Include"] = 1] = "Include"; })(TrailingTriviaOption = textChanges_3.TrailingTriviaOption || (textChanges_3.TrailingTriviaOption = {})); function skipWhitespacesAndLineBreaks(text, start) { return ts.skipTrivia(text, start, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); @@ -132866,18 +129940,9 @@ var ts; return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); } function getAdjustedEndPosition(sourceFile, node, options) { - var _a; var end = node.end; var trailingTriviaOption = options.trailingTriviaOption; - if (trailingTriviaOption === TrailingTriviaOption.Exclude) { - return end; - } - if (trailingTriviaOption === TrailingTriviaOption.ExcludeWhitespace) { - var comments = ts.concatenate(ts.getTrailingCommentRanges(sourceFile.text, end), ts.getLeadingCommentRanges(sourceFile.text, end)); - var realEnd = (_a = comments === null || comments === void 0 ? void 0 : comments[comments.length - 1]) === null || _a === void 0 ? void 0 : _a.end; - if (realEnd) { - return realEnd; - } + if (trailingTriviaOption === TrailingTriviaOption.Exclude || (ts.isExpression(node) && trailingTriviaOption !== TrailingTriviaOption.Include)) { return end; } var newEnd = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true); @@ -132889,7 +129954,7 @@ var ts; * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 200 /* ObjectLiteralExpression */)); + return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 197 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -133028,10 +130093,9 @@ var ts; this.insertNodeAt(sourceFile, parameters.pos, newParam); } }; - ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween, options) { + ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween) { if (blankLineBetween === void 0) { blankLineBetween = false; } - if (options === void 0) { options = {}; } - this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween)); + this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, {}), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween)); }; ChangeTracker.prototype.insertModifierBefore = function (sourceFile, modifier, before) { var pos = before.getStart(sourceFile); @@ -133093,7 +130157,7 @@ var ts; } } else { - endNode = (_a = (node.kind === 249 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken)) !== null && _a !== void 0 ? _a : node.name; + endNode = (_a = (node.kind === 246 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken)) !== null && _a !== void 0 ? _a : node.name; } this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " }); return true; @@ -133250,18 +130314,18 @@ var ts; }; ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: case 10 /* StringLiteral */: case 78 /* Identifier */: return { prefix: ", " }; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 92 /* ExportKeyword */: return { prefix: " " }; - case 160 /* Parameter */: + case 159 /* Parameter */: return {}; default: ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it @@ -133270,7 +130334,7 @@ var ts; }; ChangeTracker.prototype.insertName = function (sourceFile, node, name) { ts.Debug.assert(!node.name); - if (node.kind === 209 /* ArrowFunction */) { + if (node.kind === 206 /* ArrowFunction */) { var arrow = ts.findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile); var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile); if (lparen) { @@ -133284,14 +130348,14 @@ var ts; // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)` this.replaceRange(sourceFile, arrow, ts.factory.createToken(21 /* CloseParenToken */)); } - if (node.body.kind !== 230 /* Block */) { + if (node.body.kind !== 227 /* Block */) { // `() => 0` => `function f() { return 0; }` this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.factory.createToken(18 /* OpenBraceToken */), ts.factory.createToken(104 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [ts.factory.createToken(26 /* SemicolonToken */), ts.factory.createToken(19 /* CloseBraceToken */)], { joiner: " " }); } } else { - var pos = ts.findChildOfKind(node, node.kind === 208 /* FunctionExpression */ ? 97 /* FunctionKeyword */ : 83 /* ClassKeyword */, sourceFile).end; + var pos = ts.findChildOfKind(node, node.kind === 205 /* FunctionExpression */ ? 97 /* FunctionKeyword */ : 83 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, ts.factory.createIdentifier(name), { prefix: " " }); } }; @@ -133587,12 +130651,7 @@ var ts; function getNonformattedText(node, sourceFile, newLineCharacter) { var writer = createWriter(newLineCharacter); var newLine = newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */; - ts.createPrinter({ - newLine: newLine, - neverAsciiEscape: true, - preserveSourceNewlines: true, - terminateUnterminatedLiterals: true - }, writer).writeNode(4 /* Unspecified */, node, sourceFile, writer); + ts.createPrinter({ newLine: newLine, neverAsciiEscape: true, preserveSourceNewlines: true }, writer).writeNode(4 /* Unspecified */, node, sourceFile, writer); return { text: writer.getText(), node: assignPositionsToNode(node) }; } changesToText.getNonformattedText = getNonformattedText; @@ -133866,14 +130925,14 @@ var ts; } textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; function needSemicolonBetween(a, b) { - return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 158 /* ComputedPropertyName */ + return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 157 /* ComputedPropertyName */ || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[` } var deleteDeclaration; (function (deleteDeclaration_1) { function deleteDeclaration(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 160 /* Parameter */: { + case 159 /* Parameter */: { var oldFunction = node.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && @@ -133888,15 +130947,15 @@ var ts; } break; } - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: var isFirstImport = sourceFile.imports.length && node === ts.first(sourceFile.imports).parent || node === ts.find(sourceFile.statements, ts.isAnyImportSyntax); // For first import, leave header comment in place, otherwise only delete JSDoc comments deleteNode(changes, sourceFile, node, { leadingTriviaOption: isFirstImport ? LeadingTriviaOption.Exclude : ts.hasJSDocNodes(node) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: var pattern = node.parent; - var preserveComma = pattern.kind === 197 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); + var preserveComma = pattern.kind === 194 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } @@ -133904,13 +130963,13 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: var namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -133919,7 +130978,7 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; case 26 /* SemicolonToken */: @@ -133928,8 +130987,8 @@ var ts; case 97 /* FunctionKeyword */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: LeadingTriviaOption.Exclude }); break; - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: ts.hasJSDocNodes(node) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); break; default: @@ -133976,13 +131035,13 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(node, 261 /* ImportDeclaration */); + var importDecl = ts.getAncestor(node, 258 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { var parent = node.parent; - if (parent.kind === 287 /* CatchClause */) { + if (parent.kind === 284 /* CatchClause */) { // TODO: There's currently no unused diagnostic for this, could be a suggestion changes.deleteNodeRange(sourceFile, ts.findChildOfKind(parent, 20 /* OpenParenToken */, sourceFile), ts.findChildOfKind(parent, 21 /* CloseParenToken */, sourceFile)); return; @@ -133993,14 +131052,14 @@ var ts; } var gp = parent.parent; switch (gp.kind) { - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: changes.replaceNode(sourceFile, node, ts.factory.createObjectLiteralExpression()); break; - case 237 /* ForStatement */: + case 234 /* ForStatement */: deleteNode(changes, sourceFile, parent); break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: deleteNode(changes, sourceFile, gp, { leadingTriviaOption: ts.hasJSDocNodes(gp) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); break; default: @@ -134179,8 +131238,8 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var assertion = ts.Debug.checkDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertionExpression(n); }), "Expected to find an assertion expression"); var replacement = ts.isAsExpression(assertion) - ? ts.factory.createAsExpression(assertion.expression, ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */)) - : ts.factory.createTypeAssertion(ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */), assertion.expression); + ? ts.factory.createAsExpression(assertion.expression, ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */)) + : ts.factory.createTypeAssertion(ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */), assertion.expression); changeTracker.replaceNode(sourceFile, assertion.expression, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -134409,7 +131468,7 @@ var ts; } var declaration = ts.tryCast(symbol.valueDeclaration, ts.isVariableDeclaration); var variableName = declaration && ts.tryCast(declaration.name, ts.isIdentifier); - var variableStatement = ts.getAncestor(declaration, 232 /* VariableStatement */); + var variableStatement = ts.getAncestor(declaration, 229 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || @@ -134487,10 +131546,10 @@ var ts; function isInsideAwaitableBody(node) { return node.kind & 32768 /* AwaitContext */ || !!ts.findAncestor(node, function (ancestor) { return ancestor.parent && ts.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || - ts.isBlock(ancestor) && (ancestor.parent.kind === 251 /* FunctionDeclaration */ || - ancestor.parent.kind === 208 /* FunctionExpression */ || - ancestor.parent.kind === 209 /* ArrowFunction */ || - ancestor.parent.kind === 165 /* MethodDeclaration */); + ts.isBlock(ancestor) && (ancestor.parent.kind === 248 /* FunctionDeclaration */ || + ancestor.parent.kind === 205 /* FunctionExpression */ || + ancestor.parent.kind === 206 /* ArrowFunction */ || + ancestor.parent.kind === 164 /* MethodDeclaration */); }); } function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { @@ -134609,10 +131668,10 @@ var ts; function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 78 /* Identifier */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -134627,7 +131686,7 @@ var ts; function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 78 /* Identifier */: - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: case 27 /* CommaToken */: return true; default: @@ -134676,7 +131735,7 @@ var ts; return; } var declaration = token.parent; - if (declaration.kind === 163 /* PropertyDeclaration */ && + if (declaration.kind === 162 /* PropertyDeclaration */ && (!fixedNodes || ts.tryAddToSet(fixedNodes, declaration))) { changeTracker.insertModifierBefore(sourceFile, 133 /* DeclareKeyword */, declaration); } @@ -134813,26 +131872,26 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 249 /* VariableDeclaration */ || - node.kind === 162 /* PropertySignature */ || - node.kind === 163 /* PropertyDeclaration */; + node.kind === 246 /* VariableDeclaration */ || + node.kind === 161 /* PropertySignature */ || + node.kind === 162 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: return ts.factory.createTypeReferenceNode("any", ts.emptyArray); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 306 /* JSDocNonNullableType */: + case 302 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, ts.nullTransformationContext); @@ -134857,7 +131916,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 309 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 + var isRest = node.type.kind === 305 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.factory.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; return ts.factory.createParameterDeclaration(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -134897,8 +131956,8 @@ var ts; var index = ts.factory.createParameterDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 144 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.factory.createTypeReferenceNode(node.typeArguments[0].kind === 144 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 143 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.factory.createTypeReferenceNode(node.typeArguments[0].kind === 143 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.factory.createTypeLiteralNode([ts.factory.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -135027,7 +132086,7 @@ var ts; return members; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 233 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 230 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentExpr) { @@ -135083,7 +132142,7 @@ var ts; var arrowFunctionBody = arrowFunction.body; var bodyBlock; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 230 /* Block */) { + if (arrowFunctionBody.kind === 227 /* Block */) { bodyBlock = arrowFunctionBody; } // case 2: () => [1,2,3] @@ -135278,7 +132337,7 @@ var ts; // will eventually become // const response = await fetch('...') // so we push an entry for 'response'. - if (lastCallSignature && !ts.isParameter(node.parent) && !ts.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { + if (lastCallSignature && !ts.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { var firstParameter = ts.firstOrUndefined(lastCallSignature.parameters); var ident = firstParameter && ts.isParameter(firstParameter.valueDeclaration) && ts.tryCast(firstParameter.valueDeclaration.name, ts.isIdentifier) || ts.factory.createUniqueName("result", 16 /* Optimistic */); var synthName = getNewNameIfConflict(ident, collidingSymbolMap); @@ -135304,22 +132363,7 @@ var ts; } } }); - return ts.getSynthesizedDeepCloneWithReplacements(nodeToRename, /*includeTrivia*/ true, function (original) { - if (ts.isBindingElement(original) && ts.isIdentifier(original.name) && ts.isObjectBindingPattern(original.parent)) { - var symbol = checker.getSymbolAtLocation(original.name); - var renameInfo = symbol && identsToRenameMap.get(String(ts.getSymbolId(symbol))); - if (renameInfo && renameInfo.text !== (original.name || original.propertyName).getText()) { - return ts.factory.createBindingElement(original.dotDotDotToken, original.propertyName || original.name, renameInfo, original.initializer); - } - } - else if (ts.isIdentifier(original)) { - var symbol = checker.getSymbolAtLocation(original); - var renameInfo = symbol && identsToRenameMap.get(String(ts.getSymbolId(symbol))); - if (renameInfo) { - return ts.factory.createIdentifier(renameInfo.text); - } - } - }); + return ts.getSynthesizedDeepCloneWithRenames(nodeToRename, /*includeTrivia*/ true, identsToRenameMap, checker); } function getNewNameIfConflict(name, originalNames) { var numVarsSameName = (originalNames.get(name.text) || ts.emptyArray).length; @@ -135400,7 +132444,7 @@ var ts; } var tryStatement = ts.factory.createTryStatement(tryBlock, catchClause, /*finallyBlock*/ undefined); var destructuredResult = prevArgName && varDeclIdentifier && isSynthBindingPattern(prevArgName) - && ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(ts.getSynthesizedDeepClone(prevArgName.bindingPattern), /*exclamationToken*/ undefined, /*type*/ undefined, varDeclIdentifier)], 2 /* Const */)); + && ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(ts.getSynthesizedDeepCloneWithRenames(prevArgName.bindingPattern), /*exclamationToken*/ undefined, /*type*/ undefined, varDeclIdentifier)], 2 /* Const */)); return ts.compact([varDeclList, tryStatement, destructuredResult]); } function createUniqueSynthName(prevArgName) { @@ -135459,7 +132503,7 @@ var ts; } // should be kept up to date with isFixablePromiseArgument in suggestionDiagnostics.ts function getTransformationBody(func, prevArgName, argName, parent, transformer) { - var _a, _b, _c, _d, _e; + var _a, _b, _c, _d; switch (func.kind) { case 103 /* NullKeyword */: // do not produce a transformed statement for a null argument @@ -135485,24 +132529,22 @@ var ts; prevArgName.types.push(returnType); } return varDeclOrAssignment; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: { + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: { var funcBody = func.body; - var returnType_1 = (_c = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) === null || _c === void 0 ? void 0 : _c.getReturnType(); // Arrow functions with block bodies { } will enter this control flow if (ts.isBlock(funcBody)) { var refactoredStmts = []; var seenReturnStatement = false; - for (var _i = 0, _f = funcBody.statements; _i < _f.length; _i++) { - var statement = _f[_i]; + for (var _i = 0, _e = funcBody.statements; _i < _e.length; _i++) { + var statement = _e[_i]; if (ts.isReturnStatement(statement)) { seenReturnStatement = true; if (ts.isReturnStatementWithFixablePromiseHandler(statement)) { refactoredStmts = refactoredStmts.concat(getInnerTransformationBody(transformer, [statement], prevArgName)); } else { - var possiblyAwaitedRightHandSide = returnType_1 && statement.expression ? getPossiblyAwaitedRightHandSide(transformer.checker, returnType_1, statement.expression) : statement.expression; - refactoredStmts.push.apply(refactoredStmts, maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_d = parent.typeArguments) === null || _d === void 0 ? void 0 : _d[0])); + refactoredStmts.push.apply(refactoredStmts, maybeAnnotateAndReturn(statement.expression, (_c = parent.typeArguments) === null || _c === void 0 ? void 0 : _c[0])); } } else { @@ -135519,21 +132561,19 @@ var ts; if (innerCbBody.length > 0) { return innerCbBody; } - if (returnType_1) { - var possiblyAwaitedRightHandSide = getPossiblyAwaitedRightHandSide(transformer.checker, returnType_1, funcBody); - if (!shouldReturn(parent, transformer)) { - var transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide, /*typeAnnotation*/ undefined); - if (prevArgName) { - prevArgName.types.push(returnType_1); - } - return transformedStatement; - } - else { - return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_e = parent.typeArguments) === null || _e === void 0 ? void 0 : _e[0]); + var type_1 = transformer.checker.getTypeAtLocation(func); + var returnType_1 = getLastCallSignature(type_1, transformer.checker).getReturnType(); + var rightHandSide = ts.getSynthesizedDeepClone(funcBody); + var possiblyAwaitedRightHandSide = !!transformer.checker.getPromisedTypeOfPromise(returnType_1) ? ts.factory.createAwaitExpression(rightHandSide) : rightHandSide; + if (!shouldReturn(parent, transformer)) { + var transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide, /*typeAnnotation*/ undefined); + if (prevArgName) { + prevArgName.types.push(returnType_1); } + return transformedStatement; } else { - return silentFail(); + return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_d = parent.typeArguments) === null || _d === void 0 ? void 0 : _d[0]); } } } @@ -135543,10 +132583,6 @@ var ts; } return ts.emptyArray; } - function getPossiblyAwaitedRightHandSide(checker, type, expr) { - var rightHandSide = ts.getSynthesizedDeepClone(expr); - return !!checker.getPromisedTypeOfPromise(type) ? ts.factory.createAwaitExpression(rightHandSide) : rightHandSide; - } function getLastCallSignature(type, checker) { var callSignatures = checker.getSignaturesOfType(type, 0 /* Call */); return ts.lastOrUndefined(callSignatures); @@ -135702,10 +132738,10 @@ var ts; } var importNode = ts.importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference)); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) { changes.replaceNode(importingFile, importNode, ts.factory.createPropertyAccessExpression(ts.getSynthesizedDeepClone(importNode), "default")); } @@ -135719,25 +132755,11 @@ var ts; var exports = collectExportRenames(sourceFile, checker, identifiers); convertExportsAccesses(sourceFile, exports, changes); var moduleExportsChangedToDefault = false; - var useSitesToUnqualify; - // Process variable statements first to collect use sites that need to be updated inside other transformations - for (var _i = 0, _a = ts.filter(sourceFile.statements, ts.isVariableStatement); _i < _a.length; _i++) { + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var statement = _a[_i]; - var newUseSites = convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); - if (newUseSites) { - ts.copyEntries(newUseSites, useSitesToUnqualify !== null && useSitesToUnqualify !== void 0 ? useSitesToUnqualify : (useSitesToUnqualify = new ts.Map())); - } - } - // `convertStatement` will delete entries from `useSitesToUnqualify` when containing statements are replaced - for (var _b = 0, _c = ts.filter(sourceFile.statements, function (s) { return !ts.isVariableStatement(s); }); _b < _c.length; _b++) { - var statement = _c[_b]; - var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference); + var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference); moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; } - // Remaining use sites can be changed directly - useSitesToUnqualify === null || useSitesToUnqualify === void 0 ? void 0 : useSitesToUnqualify.forEach(function (replacement, original) { - changes.replaceNode(sourceFile, original, replacement); - }); return moduleExportsChangedToDefault; } function collectExportRenames(sourceFile, checker, identifiers) { @@ -135770,24 +132792,24 @@ var ts; node.forEachChild(recur); }); } - function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference) { + function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference) { switch (statement.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 233 /* ExpressionStatement */: { + case 230 /* ExpressionStatement */: { var expression = statement.expression; switch (expression.kind) { - case 203 /* CallExpression */: { + case 200 /* CallExpression */: { if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true)) { // For side-effecting require() call, just make a side-effecting import. changes.replaceNode(sourceFile, statement, ts.makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0], quotePreference)); } return false; } - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var operatorToken = expression.operatorToken; - return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports, useSitesToUnqualify); + return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); } } } @@ -135799,17 +132821,17 @@ var ts; function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference) { var declarationList = statement.declarationList; var foundImport = false; - var converted = ts.map(declarationList.declarations, function (decl) { + var newNodes = ts.flatMap(declarationList.declarations, function (decl) { var name = decl.name, initializer = decl.initializer; if (initializer) { if (ts.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { // `const alias = module.exports;` can be removed. foundImport = true; - return convertedImports([]); + return []; } else if (ts.isRequireCall(initializer, /*checkArgumentIsStringLiteralLike*/ true)) { foundImport = true; - return convertSingleImport(name, initializer.arguments[0], checker, identifiers, target, quotePreference); + return convertSingleImport(sourceFile, name, initializer.arguments[0], changes, checker, identifiers, target, quotePreference); } else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, /*checkArgumentIsStringLiteralLike*/ true)) { foundImport = true; @@ -135817,40 +132839,33 @@ var ts; } } // Move it out to its own variable statement. (This will not be used if `!foundImport`) - return convertedImports([ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([decl], declarationList.flags))]); + return ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([decl], declarationList.flags)); }); if (foundImport) { // useNonAdjustedEndPosition to ensure we don't eat the newline after the statement. - changes.replaceNodeWithNodes(sourceFile, statement, ts.flatMap(converted, function (c) { return c.newImports; })); - var combinedUseSites_1; - ts.forEach(converted, function (c) { - if (c.useSitesToUnqualify) { - ts.copyEntries(c.useSitesToUnqualify, combinedUseSites_1 !== null && combinedUseSites_1 !== void 0 ? combinedUseSites_1 : (combinedUseSites_1 = new ts.Map())); - } - }); - return combinedUseSites_1; + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); } } /** Converts `const name = require("moduleSpecifier").propertyName` */ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: { + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: { // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` var tmp = makeUniqueName(propertyName, identifiers); - return convertedImports([ + return [ makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference), makeConst(/*modifiers*/ undefined, name, ts.factory.createIdentifier(tmp)), - ]); + ]; } case 78 /* Identifier */: // `const a = require("b").c` --> `import { c as a } from "./b"; - return convertedImports([makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]); + return [makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]; default: return ts.Debug.assertNever(name, "Convert to ES6 module got invalid syntax form " + name.kind); } } - function convertAssignment(sourceFile, checker, assignment, changes, exports, useSitesToUnqualify) { + function convertAssignment(sourceFile, checker, assignment, changes, exports) { var left = assignment.left, right = assignment.right; if (!ts.isPropertyAccessExpression(left)) { return false; @@ -135861,7 +132876,7 @@ var ts; changes.delete(sourceFile, assignment.parent); } else { - var replacement = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right, useSitesToUnqualify) + var replacement = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right) : ts.isRequireCall(right, /*checkArgumentIsStringLiteralLike*/ true) ? convertReExportAll(right.arguments[0], checker) : undefined; if (replacement) { @@ -135883,20 +132898,20 @@ var ts; * Convert `module.exports = { ... }` to individual exports.. * We can't always do this if the module has interesting members -- then it will be a default export instead. */ - function tryChangeModuleExportsObject(object, useSitesToUnqualify) { + function tryChangeModuleExportsObject(object) { var statements = ts.mapAllOrFail(object.properties, function (prop) { switch (prop.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 289 /* ShorthandPropertyAssignment */: - case 290 /* SpreadAssignment */: + case 286 /* ShorthandPropertyAssignment */: + case 287 /* SpreadAssignment */: return undefined; - case 288 /* PropertyAssignment */: - return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify); - case 165 /* MethodDeclaration */: - return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(92 /* ExportKeyword */)], prop, useSitesToUnqualify); + case 285 /* PropertyAssignment */: + return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer); + case 164 /* MethodDeclaration */: + return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(92 /* ExportKeyword */)], prop); default: ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind); } @@ -135956,10 +132971,10 @@ var ts; } } // TODO: GH#22492 this will cause an error if a change has been made inside the body of the node. - function convertExportsDotXEquals_replaceNode(name, exported, useSitesToUnqualify) { + function convertExportsDotXEquals_replaceNode(name, exported) { var modifiers = [ts.factory.createToken(92 /* ExportKeyword */)]; switch (exported.kind) { - case 208 /* FunctionExpression */: { + case 205 /* FunctionExpression */: { var expressionName = exported.name; if (expressionName && expressionName.text !== name) { // `exports.f = function g() {}` -> `export const f = function g() {}` @@ -135967,35 +132982,18 @@ var ts; } } // falls through - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // `exports.f = function() {}` --> `export function f() {}` - return functionExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); - case 221 /* ClassExpression */: + return functionExpressionToDeclaration(name, modifiers, exported); + case 218 /* ClassExpression */: // `exports.C = class {}` --> `export class C {}` - return classExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); + return classExpressionToDeclaration(name, modifiers, exported); default: return exportConst(); } function exportConst() { // `exports.x = 0;` --> `export const x = 0;` - return makeConst(modifiers, ts.factory.createIdentifier(name), replaceImportUseSites(exported, useSitesToUnqualify)); // TODO: GH#18217 - } - } - function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) { - if (!useSitesToUnqualify || !ts.some(ts.arrayFrom(useSitesToUnqualify.keys()), function (original) { return ts.rangeContainsRange(nodeOrNodes, original); })) { - return nodeOrNodes; - } - return ts.isArray(nodeOrNodes) - ? ts.getSynthesizedDeepClonesWithReplacements(nodeOrNodes, /*includeTrivia*/ true, replaceNode) - : ts.getSynthesizedDeepCloneWithReplacements(nodeOrNodes, /*includeTrivia*/ true, replaceNode); - function replaceNode(original) { - // We are replacing `mod.SomeExport` wih `SomeExport`, so we only need to look at PropertyAccessExpressions - if (original.kind === 201 /* PropertyAccessExpression */) { - var replacement = useSitesToUnqualify.get(original); - // Remove entry from `useSitesToUnqualify` so the refactor knows it's taken care of by the parent statement we're replacing - useSitesToUnqualify.delete(original); - return replacement; - } + return makeConst(modifiers, ts.factory.createIdentifier(name), exported); // TODO: GH#18217 } } /** @@ -136003,9 +133001,9 @@ var ts; * Returns nodes that will replace the variable declaration for the commonjs import. * May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`. */ - function convertSingleImport(name, moduleSpecifier, checker, identifiers, target, quotePreference) { + function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 196 /* ObjectBindingPattern */: { + case 193 /* ObjectBindingPattern */: { var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) ? undefined @@ -136014,23 +133012,23 @@ var ts; : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text); }); if (importSpecifiers) { - return convertedImports([ts.makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier, quotePreference)]); + return [ts.makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier, quotePreference)]; } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 197 /* ArrayBindingPattern */: { + case 194 /* ArrayBindingPattern */: { /* import x from "x"; const [a, b, c] = x; */ var tmp = makeUniqueName(codefix.moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers); - return convertedImports([ + return [ ts.makeImport(ts.factory.createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier, quotePreference), makeConst(/*modifiers*/ undefined, ts.getSynthesizedDeepClone(name), ts.factory.createIdentifier(tmp)), - ]); + ]; } case 78 /* Identifier */: - return convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference); + return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers, quotePreference); default: return ts.Debug.assertNever(name, "Convert to ES6 module got invalid name kind " + name.kind); } @@ -136039,13 +133037,12 @@ var ts; * Convert `import x = require("x").` * Also converts uses like `x.y()` to `y()` and uses a named import. */ - function convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference) { + function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers, quotePreference) { var nameSymbol = checker.getSymbolAtLocation(name); // Maps from module property name to name actually used. (The same if there isn't shadowing.) var namedBindingsNames = new ts.Map(); // True if there is some non-property use like `x()` or `f(x)`. var needDefaultImport = false; - var useSitesToUnqualify; for (var _i = 0, _a = identifiers.original.get(name.text); _i < _a.length; _i++) { var use = _a[_i]; if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) { @@ -136061,7 +133058,7 @@ var ts; idName = makeUniqueName(propertyName, identifiers); namedBindingsNames.set(propertyName, idName); } - (useSitesToUnqualify !== null && useSitesToUnqualify !== void 0 ? useSitesToUnqualify : (useSitesToUnqualify = new ts.Map())).set(parent, ts.factory.createIdentifier(idName)); + changes.replaceNode(file, parent, ts.factory.createIdentifier(idName)); } else { needDefaultImport = true; @@ -136075,7 +133072,7 @@ var ts; // If it was unused, ensure that we at least import *something*. needDefaultImport = true; } - return convertedImports([ts.makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier, quotePreference)], useSitesToUnqualify); + return [ts.makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier, quotePreference)]; } // Identifiers helpers function makeUniqueName(name, identifiers) { @@ -136102,24 +133099,24 @@ var ts; function isFreeIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return parent.name !== node; - case 198 /* BindingElement */: + case 195 /* BindingElement */: return parent.propertyName !== node; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return parent.propertyName !== node; default: return true; } } // Node helpers - function functionExpressionToDeclaration(name, additionalModifiers, fn, useSitesToUnqualify) { + function functionExpressionToDeclaration(name, additionalModifiers, fn) { return ts.factory.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal. - ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.factory.converters.convertToFunctionBlock(replaceImportUseSites(fn.body, useSitesToUnqualify))); + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.factory.converters.convertToFunctionBlock(ts.getSynthesizedDeepClone(fn.body))); } - function classExpressionToDeclaration(name, additionalModifiers, cls, useSitesToUnqualify) { + function classExpressionToDeclaration(name, additionalModifiers, cls) { return ts.factory.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), // TODO: GH#19915 Don't think this is even legal. - ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), replaceImportUseSites(cls.members, useSitesToUnqualify)); + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), ts.getSynthesizedDeepClones(cls.members)); } function makeSingleImport(localName, propertyName, moduleSpecifier, quotePreference) { return propertyName === "default" @@ -136138,12 +133135,6 @@ var ts; /*modifiers*/ undefined, /*isTypeOnly*/ false, exportSpecifiers && ts.factory.createNamedExports(exportSpecifiers), moduleSpecifier === undefined ? undefined : ts.factory.createStringLiteral(moduleSpecifier)); } - function convertedImports(newImports, useSitesToUnqualify) { - return { - newImports: newImports, - useSitesToUnqualify: useSitesToUnqualify - }; - } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -136203,7 +133194,7 @@ var ts; var fixedExportDeclarations = new ts.Map(); return codefix.codeFixAll(context, errorCodes, function (changes, diag) { var exportSpecifier = getExportSpecifierForDiagnosticSpan(diag, context.sourceFile); - if (exportSpecifier && ts.addToSeen(fixedExportDeclarations, ts.getNodeId(exportSpecifier.parent.parent))) { + if (exportSpecifier && !ts.addToSeen(fixedExportDeclarations, ts.getNodeId(exportSpecifier.parent.parent))) { fixSingleExportDeclaration(changes, exportSpecifier, context); } }); @@ -136220,7 +133211,8 @@ var ts; var exportDeclaration = exportClause.parent; var typeExportSpecifiers = getTypeExportSpecifiers(exportSpecifier, context); if (typeExportSpecifiers.length === exportClause.elements.length) { - changes.insertModifierBefore(context.sourceFile, 149 /* TypeKeyword */, exportClause); + changes.replaceNode(context.sourceFile, exportDeclaration, ts.factory.updateExportDeclaration(exportDeclaration, exportDeclaration.decorators, exportDeclaration.modifiers, + /*isTypeOnly*/ true, exportClause, exportDeclaration.moduleSpecifier)); } else { var valueExportDeclaration = ts.factory.updateExportDeclaration(exportDeclaration, exportDeclaration.decorators, exportDeclaration.modifiers, @@ -136229,10 +133221,7 @@ var ts; /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ true, ts.factory.createNamedExports(typeExportSpecifiers), exportDeclaration.moduleSpecifier); - changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, { - leadingTriviaOption: ts.textChanges.LeadingTriviaOption.IncludeAll, - trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Exclude - }); + changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration); changes.insertNodeAfter(context.sourceFile, exportDeclaration, typeExportDeclaration); } } @@ -136299,53 +133288,6 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; -(function (ts) { - var codefix; - (function (codefix) { - var fixId = "convertLiteralTypeToMappedType"; - var errorCodes = [ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code]; - codefix.registerCodeFix({ - errorCodes: errorCodes, - getCodeActions: function (context) { - var sourceFile = context.sourceFile, span = context.span; - var info = getInfo(sourceFile, span.start); - if (!info) { - return undefined; - } - var name = info.name, constraint = info.constraint; - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); }); - return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Convert_0_to_1_in_0, constraint, name], fixId, ts.Diagnostics.Convert_all_type_literals_to_mapped_type)]; - }, - fixIds: [fixId], - getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { - var info = getInfo(diag.file, diag.start); - if (info) { - doChange(changes, diag.file, info); - } - }); } - }); - function getInfo(sourceFile, pos) { - var token = ts.getTokenAtPosition(sourceFile, pos); - if (ts.isIdentifier(token)) { - var propertySignature = ts.cast(token.parent.parent, ts.isPropertySignature); - var propertyName = token.getText(sourceFile); - return { - container: ts.cast(propertySignature.parent, ts.isTypeLiteralNode), - typeNode: propertySignature.type, - constraint: propertyName, - name: propertyName === "K" ? "P" : "K", - }; - } - return undefined; - } - function doChange(changes, sourceFile, _a) { - var container = _a.container, typeNode = _a.typeNode, constraint = _a.constraint, name = _a.name; - changes.replaceNode(sourceFile, container, ts.factory.createMappedTypeNode(/*readonlyToken*/ undefined, ts.factory.createTypeParameterDeclaration(name, ts.factory.createTypeReferenceNode(constraint)), /*nameType*/ undefined, /*questionToken*/ undefined, typeNode)); - } - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; (function (ts) { var codefix; (function (codefix) { @@ -136490,7 +133432,7 @@ var ts; var symbol = checker.getMergedSymbol(ts.skipAlias(exportedSymbol, checker)); var exportInfos = getAllReExportingModules(sourceFile, symbol, moduleSymbol, symbolName, host, program, useAutoImportProvider); var preferTypeOnlyImport = !!usageIsTypeOnly && compilerOptions.importsNotUsedAsValues === 2 /* Error */; - var useRequire = shouldUseRequire(sourceFile, program); + var useRequire = shouldUseRequire(sourceFile, compilerOptions); var fix = getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, /*position*/ undefined, preferTypeOnlyImport, useRequire, host, preferences); addImport({ fixes: [fix], symbolName: symbolName }); } @@ -136593,7 +133535,7 @@ var ts; function getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, symbolName, host, program, formatContext, position, preferences) { var compilerOptions = program.getCompilerOptions(); var exportInfos = getAllReExportingModules(sourceFile, exportedSymbol, moduleSymbol, symbolName, host, program, /*useAutoImportProvider*/ true); - var useRequire = shouldUseRequire(sourceFile, program); + var useRequire = shouldUseRequire(sourceFile, compilerOptions); var preferTypeOnlyImport = compilerOptions.importsNotUsedAsValues === 2 /* Error */ && !ts.isSourceFileJS(sourceFile) && ts.isValidTypeOnlyAliasUseSite(ts.getTokenAtPosition(sourceFile, position)); var moduleSpecifier = ts.first(getNewImportInfos(program, sourceFile, position, preferTypeOnlyImport, useRequire, exportInfos, host, preferences)).moduleSpecifier; var fix = getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, position, preferTypeOnlyImport, useRequire, host, preferences); @@ -136619,7 +133561,7 @@ var ts; return; } var defaultInfo = getDefaultLikeExportInfo(importingFile, moduleSymbol, checker, compilerOptions); - if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && ts.skipAlias(defaultInfo.symbol, checker) === exportedSymbol) { + if (defaultInfo && defaultInfo.name === symbolName && ts.skipAlias(defaultInfo.symbol, checker) === exportedSymbol) { result.push({ moduleSymbol: moduleSymbol, importKind: defaultInfo.kind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(defaultInfo.symbol, checker) }); } for (var _i = 0, _a = checker.getExportsAndPropertiesOfModule(moduleSymbol); _i < _a.length; _i++) { @@ -136675,11 +133617,11 @@ var ts; function getTargetModuleFromNamespaceLikeImport(declaration, checker) { var _a; switch (declaration.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return checker.getAliasedSymbol(declaration.symbol); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport); return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); default: @@ -136689,11 +133631,11 @@ var ts; function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return declaration.name.text; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text; default: return ts.Debug.assertNever(declaration); @@ -136702,10 +133644,10 @@ var ts; function tryAddToExistingImport(existingImports, canUseTypeOnlyImport) { return ts.firstDefined(existingImports, function (_a) { var declaration = _a.declaration, importKind = _a.importKind; - if (declaration.kind === 260 /* ImportEqualsDeclaration */) + if (declaration.kind === 257 /* ImportEqualsDeclaration */) return undefined; - if (declaration.kind === 249 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 196 /* ObjectBindingPattern */ + if (declaration.kind === 246 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 193 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind: importKind, moduleSpecifier: declaration.initializer.arguments[0].text, canUseTypeOnlyImport: false } : undefined; } @@ -136713,7 +133655,7 @@ var ts; if (!importClause) return undefined; var name = importClause.name, namedBindings = importClause.namedBindings; - return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 264 /* NamedImports */) + return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 261 /* NamedImports */) ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: importClause, importKind: importKind, moduleSpecifier: declaration.moduleSpecifier.getText(), canUseTypeOnlyImport: canUseTypeOnlyImport } : undefined; }); @@ -136726,38 +133668,15 @@ var ts; if (ts.isRequireVariableDeclaration(i.parent, /*requireStringLiteralLikeArgument*/ true)) { return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind } : undefined; } - if (i.kind === 261 /* ImportDeclaration */ || i.kind === 260 /* ImportEqualsDeclaration */) { + if (i.kind === 258 /* ImportDeclaration */ || i.kind === 257 /* ImportEqualsDeclaration */) { return checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined; } }); } - function shouldUseRequire(sourceFile, program) { - // 1. TypeScript files don't use require variable declarations - if (!ts.isSourceFileJS(sourceFile)) { - return false; - } - // 2. If the current source file is unambiguously CJS or ESM, go with that - if (sourceFile.commonJsModuleIndicator && !sourceFile.externalModuleIndicator) - return true; - if (sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) - return false; - // 3. If there's a tsconfig/jsconfig, use its module setting - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions.configFile) { - return ts.getEmitModuleKind(compilerOptions) < ts.ModuleKind.ES2015; - } - // 4. Match the first other JS file in the program that's unambiguously CJS or ESM - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var otherFile = _a[_i]; - if (otherFile === sourceFile || !ts.isSourceFileJS(otherFile) || program.isSourceFileFromExternalLibrary(otherFile)) - continue; - if (otherFile.commonJsModuleIndicator && !otherFile.externalModuleIndicator) - return true; - if (otherFile.externalModuleIndicator && !otherFile.commonJsModuleIndicator) - return false; - } - // 5. Literally nothing to go on - return true; + function shouldUseRequire(sourceFile, compilerOptions) { + return ts.isSourceFileJS(sourceFile) + && !sourceFile.externalModuleIndicator + && (!!sourceFile.commonJsModuleIndicator || ts.getEmitModuleKind(compilerOptions) < ts.ModuleKind.ES2015); } function getNewImportInfos(program, sourceFile, position, preferTypeOnlyImport, useRequire, moduleSymbols, host, preferences) { var isJs = ts.isSourceFileJS(sourceFile); @@ -136792,9 +133711,9 @@ var ts; } function newImportInfoFromExistingSpecifier(_a, preferTypeOnlyImport, useRequire) { var declaration = _a.declaration, importKind = _a.importKind; - var moduleSpecifier = declaration.kind === 261 /* ImportDeclaration */ ? declaration.moduleSpecifier : - declaration.kind === 249 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : - declaration.moduleReference.kind === 272 /* ExternalModuleReference */ ? declaration.moduleReference.expression : + var moduleSpecifier = declaration.kind === 258 /* ImportDeclaration */ ? declaration.moduleSpecifier : + declaration.kind === 246 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : + declaration.moduleReference.kind === 269 /* ExternalModuleReference */ ? declaration.moduleReference.expression : undefined; return moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier.text, importKind: importKind, typeOnly: preferTypeOnlyImport, useRequire: useRequire } @@ -136816,7 +133735,7 @@ var ts; var symbol = checker.getAliasedSymbol(umdSymbol); var symbolName = umdSymbol.name; var exportInfos = [{ moduleSymbol: symbol, importKind: getUmdImportKind(sourceFile, program.getCompilerOptions()), exportedSymbolIsTypeOnly: false }]; - var useRequire = shouldUseRequire(sourceFile, program); + var useRequire = shouldUseRequire(sourceFile, program.getCompilerOptions()); var fixes = getFixForImport(exportInfos, symbolName, ts.isIdentifier(token) ? token.getStart(sourceFile) : undefined, /*preferTypeOnlyImport*/ false, useRequire, program, sourceFile, host, preferences); return { fixes: fixes, symbolName: symbolName }; } @@ -136865,8 +133784,8 @@ var ts; ts.Debug.assert(symbolName !== "default" /* Default */, "'default' isn't a legal identifier and couldn't occur here"); var compilerOptions = program.getCompilerOptions(); var preferTypeOnlyImport = compilerOptions.importsNotUsedAsValues === 2 /* Error */ && ts.isValidTypeOnlyAliasUseSite(symbolToken); - var useRequire = shouldUseRequire(sourceFile, program); - var exportInfos = getExportInfos(symbolName, ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host); + var useRequire = shouldUseRequire(sourceFile, compilerOptions); + var exportInfos = getExportInfos(symbolName, ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, checker, program, useAutoImportProvider, host); var fixes = ts.arrayFrom(ts.flatMapIterator(exportInfos.entries(), function (_a) { var _ = _a[0], exportInfos = _a[1]; return getFixForImport(exportInfos, symbolName, symbolToken.getStart(sourceFile), preferTypeOnlyImport, useRequire, program, sourceFile, host, preferences); @@ -136884,25 +133803,23 @@ var ts; return symbolToken.text; } // Returns a map from an exported symbol's ID to a list of every way it's (re-)exported. - function getExportInfos(symbolName, currentTokenMeaning, cancellationToken, sourceFile, program, useAutoImportProvider, host) { + function getExportInfos(symbolName, currentTokenMeaning, cancellationToken, sourceFile, checker, program, useAutoImportProvider, host) { // For each original symbol, keep all re-exports of that symbol together so we can call `getCodeActionsForImport` on the whole group at once. // Maps symbol id to info for modules providing that symbol (original export + re-exports). var originalSymbolToExportInfos = ts.createMultiMap(); - function addSymbol(moduleSymbol, exportedSymbol, importKind, checker) { + function addSymbol(moduleSymbol, exportedSymbol, importKind) { originalSymbolToExportInfos.add(ts.getUniqueSymbolId(exportedSymbol, checker).toString(), { moduleSymbol: moduleSymbol, importKind: importKind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(exportedSymbol, checker) }); } - forEachExternalModuleToImportFrom(program, host, sourceFile, /*filterByPackageJson*/ true, useAutoImportProvider, function (moduleSymbol, _, program) { - var checker = program.getTypeChecker(); + forEachExternalModuleToImportFrom(program, host, sourceFile, /*filterByPackageJson*/ true, useAutoImportProvider, function (moduleSymbol) { cancellationToken.throwIfCancellationRequested(); - var compilerOptions = program.getCompilerOptions(); - var defaultInfo = getDefaultLikeExportInfo(sourceFile, moduleSymbol, checker, compilerOptions); - if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) { - addSymbol(moduleSymbol, defaultInfo.symbol, defaultInfo.kind, checker); + var defaultInfo = getDefaultLikeExportInfo(sourceFile, moduleSymbol, checker, program.getCompilerOptions()); + if (defaultInfo && defaultInfo.name === symbolName && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) { + addSymbol(moduleSymbol, defaultInfo.symbol, defaultInfo.kind); } // check exports with the same name var exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName, moduleSymbol); if (exportSymbolWithIdenticalName && symbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { - addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */, checker); + addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */); } }); return originalSymbolToExportInfos; @@ -136956,13 +133873,7 @@ var ts; return { symbolForMeaning: defaultExport, name: name }; if (defaultExport.flags & 2097152 /* Alias */) { var aliased = checker.getImmediateAliasedSymbol(defaultExport); - if (aliased && aliased.parent) { - // - `aliased` will be undefined if the module is exporting an unresolvable name, - // but we can still offer completions for it. - // - `aliased.parent` will be undefined if the module is exporting `globalThis.something`, - // or another expression that resolves to a global. - return getDefaultExportInfoWorker(aliased, aliased.parent, checker, compilerOptions); - } + return aliased && getDefaultExportInfoWorker(aliased, ts.Debug.checkDefined(aliased.parent, "Alias targets of default exports must have a parent"), checker, compilerOptions); } if (defaultExport.escapedName !== "default" /* Default */ && defaultExport.escapedName !== "export=" /* ExportEquals */) { @@ -137018,7 +133929,7 @@ var ts; } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, canUseTypeOnlyImport) { - if (clause.kind === 196 /* ObjectBindingPattern */) { + if (clause.kind === 193 /* ObjectBindingPattern */) { if (defaultImport) { addElementToBindingPattern(clause, defaultImport, "default"); } @@ -137052,7 +133963,7 @@ var ts; else if (existingSpecifiers === null || existingSpecifiers === void 0 ? void 0 : existingSpecifiers.length) { for (var _b = 0, newSpecifiers_2 = newSpecifiers; _b < newSpecifiers_2.length; _b++) { var spec = newSpecifiers_2[_b]; - changes.insertNodeInListAfter(sourceFile, ts.last(existingSpecifiers), spec, existingSpecifiers); + changes.insertNodeAtEndOfList(sourceFile, existingSpecifiers, spec); } } else { @@ -137425,7 +134336,7 @@ var ts; }); function getNamedTupleMember(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); - return ts.findAncestor(token, function (t) { return t.kind === 192 /* NamedTupleMember */; }); + return ts.findAncestor(token, function (t) { return t.kind === 191 /* NamedTupleMember */; }); } function doChange(changes, sourceFile, namedTupleMember) { if (!namedTupleMember) { @@ -137434,11 +134345,11 @@ var ts; var unwrappedType = namedTupleMember.type; var sawOptional = false; var sawRest = false; - while (unwrappedType.kind === 180 /* OptionalType */ || unwrappedType.kind === 181 /* RestType */ || unwrappedType.kind === 186 /* ParenthesizedType */) { - if (unwrappedType.kind === 180 /* OptionalType */) { + while (unwrappedType.kind === 179 /* OptionalType */ || unwrappedType.kind === 180 /* RestType */ || unwrappedType.kind === 185 /* ParenthesizedType */) { + if (unwrappedType.kind === 179 /* OptionalType */) { sawOptional = true; } - else if (unwrappedType.kind === 181 /* RestType */) { + else if (unwrappedType.kind === 180 /* RestType */) { sawRest = true; } unwrappedType = unwrappedType.type; @@ -137462,7 +134373,7 @@ var ts; ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code, - ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code, + ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2.code, // for JSX class components ts.Diagnostics.No_overload_matches_this_call.code, // for JSX FC @@ -137509,12 +134420,6 @@ var ts; } suggestedSymbol = checker.getSuggestedSymbolForNonexistentProperty(node, containingType); } - else if (ts.isQualifiedName(parent) && parent.right === node) { - var symbol = checker.getSymbolAtLocation(parent.left); - if (symbol && symbol.flags & 1536 /* Module */) { - suggestedSymbol = checker.getSuggestedSymbolForNonexistentModule(parent.right, symbol); - } - } else if (ts.isImportSpecifier(parent) && parent.name === node) { ts.Debug.assertNode(node, ts.isIdentifier, "Expected an identifier for spelling (import)"); var importDeclaration = ts.findAncestor(node, ts.isImportDeclaration); @@ -137738,19 +134643,19 @@ var ts; } function getVariableLikeInitializer(declaration) { switch (declaration.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: return declaration.initializer; - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return declaration.initializer && (ts.isJsxExpression(declaration.initializer) ? declaration.initializer.expression : undefined); - case 289 /* ShorthandPropertyAssignment */: - case 162 /* PropertySignature */: - case 291 /* EnumMember */: - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: + case 286 /* ShorthandPropertyAssignment */: + case 161 /* PropertySignature */: + case 288 /* EnumMember */: + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: return undefined; } } @@ -137936,7 +134841,7 @@ var ts; function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, token, makeStatic) { var tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 221 /* ClassExpression */) { + if (classDeclaration.kind === 218 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -137988,7 +134893,7 @@ var ts; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 216 /* BinaryExpression */) { + if (token.parent.parent.kind === 213 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -138027,7 +134932,7 @@ var ts; } function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.factory.createKeywordTypeNode(147 /* StringKeyword */); + var stringTypeNode = ts.factory.createKeywordTypeNode(146 /* StringKeyword */); var indexingParameter = ts.factory.createParameterDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -138078,7 +134983,7 @@ var ts; */ var hasStringInitializer = ts.some(enumDeclaration.members, function (member) { var type = checker.getTypeAtLocation(member); - return !!(type && type.flags & 402653316 /* StringLike */); + return !!(type && type.flags & 132 /* StringLike */); }); var enumMember = ts.factory.createEnumMember(token, hasStringInitializer ? ts.factory.createStringLiteral(token.text) : undefined); changes.replaceNode(enumDeclaration.getSourceFile(), enumDeclaration, ts.factory.updateEnumDeclaration(enumDeclaration, enumDeclaration.decorators, enumDeclaration.modifiers, enumDeclaration.name, ts.concatenate(enumDeclaration.members, ts.singleElementArray(enumMember))), { @@ -138602,7 +135507,7 @@ var ts; if (!isValidCharacter(character)) { return; } - var replacement = useHtmlEntity ? htmlEntity[character] : "{" + ts.quote(sourceFile, preferences, character) + "}"; + var replacement = useHtmlEntity ? htmlEntity[character] : "{" + ts.quote(character, preferences) + "}"; changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -138744,7 +135649,7 @@ var ts; }, }); function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */)); + changes.replaceNode(sourceFile, token.parent, ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */)); } function createDeleteFix(changes, diag) { return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations); @@ -138760,7 +135665,7 @@ var ts; return ts.isVariableDeclarationList(token.parent) && ts.first(token.parent.getChildren(sourceFile)) === token; } function deleteEntireVariableStatement(changes, sourceFile, node) { - changes.delete(sourceFile, node.parent.kind === 232 /* VariableStatement */ ? node.parent : node); + changes.delete(sourceFile, node.parent.kind === 229 /* VariableStatement */ ? node.parent : node); } function deleteDestructuringElements(changes, sourceFile, node) { ts.forEach(node.elements, function (n) { return changes.delete(sourceFile, n); }); @@ -138785,14 +135690,14 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 160 /* Parameter */: - case 159 /* TypeParameter */: + case 159 /* Parameter */: + case 158 /* TypeParameter */: return true; - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: return true; } } @@ -138824,10 +135729,12 @@ var ts; } function tryDeleteParameter(changes, sourceFile, p, checker, sourceFiles, isFixAll) { if (isFixAll === void 0) { isFixAll = false; } - if (mayDeleteParameter(checker, sourceFile, p, isFixAll)) { - if (p.modifiers && p.modifiers.length > 0 && - (!ts.isIdentifier(p.name) || ts.FindAllReferences.Core.isSymbolReferencedInFile(p.name, checker, sourceFile))) { - p.modifiers.forEach(function (modifier) { return changes.deleteModifier(sourceFile, modifier); }); + if (mayDeleteParameter(p, checker, isFixAll)) { + if (p.modifiers && p.modifiers.length > 0 + && (!ts.isIdentifier(p.name) || ts.FindAllReferences.Core.isSymbolReferencedInFile(p.name, checker, sourceFile))) { + p.modifiers.forEach(function (modifier) { + changes.deleteModifier(sourceFile, modifier); + }); } else { changes.delete(sourceFile, p); @@ -138835,28 +135742,29 @@ var ts; } } } - function mayDeleteParameter(checker, sourceFile, parameter, isFixAll) { - var parent = parameter.parent; + function mayDeleteParameter(p, checker, isFixAll) { + var parent = p.parent; switch (parent.kind) { - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // Don't remove a parameter if this overrides something. var symbol = checker.getSymbolAtLocation(parent.name); if (ts.isMemberSymbolInBaseType(symbol, checker)) return false; // falls through - case 166 /* Constructor */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: return true; - case 251 /* FunctionDeclaration */: { - if (parent.name && isCallbackLike(checker, sourceFile, parent.name)) { - return isLastParameter(parent, parameter, isFixAll); - } - return true; - } - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: { // Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused. - return isLastParameter(parent, parameter, isFixAll); - case 168 /* SetAccessor */: + var parameters = parent.parameters; + var index = parameters.indexOf(p); + ts.Debug.assert(index !== -1, "The parameter should already be in the list"); + return isFixAll + ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 78 /* Identifier */ && !p.symbol.isReferenced; }) + : index === parameters.length - 1; + } + case 167 /* SetAccessor */: // Setter must have a parameter return false; default: @@ -138871,19 +135779,6 @@ var ts; } }); } - function isCallbackLike(checker, sourceFile, name) { - return !!ts.FindAllReferences.Core.eachSymbolReferenceInFile(name, checker, sourceFile, function (reference) { - return ts.isIdentifier(reference) && ts.isCallExpression(reference.parent) && reference.parent.arguments.indexOf(reference) >= 0; - }); - } - function isLastParameter(func, parameter, isFixAll) { - var parameters = func.parameters; - var index = parameters.indexOf(parameter); - ts.Debug.assert(index !== -1, "The parameter should already be in the list"); - return isFixAll ? - parameters.slice(index + 1).every(function (p) { return ts.isIdentifier(p.name) && !p.symbol.isReferenced; }) : - index === parameters.length - 1; - } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -138918,7 +135813,7 @@ var ts; var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent; if (!ts.isBlock(statement.parent) || statement === ts.first(statement.parent.statements)) { switch (container.kind) { - case 234 /* IfStatement */: + case 231 /* IfStatement */: if (container.elseStatement) { if (ts.isBlock(statement.parent)) { break; @@ -138929,8 +135824,8 @@ var ts; return; } // falls through - case 236 /* WhileStatement */: - case 237 /* ForStatement */: + case 233 /* WhileStatement */: + case 234 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -139003,7 +135898,7 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 305 /* JSDocNullableType */) { + if (typeNode.kind === 301 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); @@ -139023,7 +135918,7 @@ var ts; if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 305 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + var fixedType = typeNode.kind === 301 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -139040,22 +135935,22 @@ var ts; // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 224 /* AsExpression */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 251 /* FunctionDeclaration */: - case 167 /* GetAccessor */: - case 171 /* IndexSignature */: - case 190 /* MappedType */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 168 /* SetAccessor */: - case 254 /* TypeAliasDeclaration */: - case 206 /* TypeAssertionExpression */: - case 249 /* VariableDeclaration */: + case 221 /* AsExpression */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 248 /* FunctionDeclaration */: + case 166 /* GetAccessor */: + case 170 /* IndexSignature */: + case 189 /* MappedType */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 167 /* SetAccessor */: + case 251 /* TypeAliasDeclaration */: + case 203 /* TypeAssertionExpression */: + case 246 /* VariableDeclaration */: return true; default: return false; @@ -139157,14 +136052,14 @@ var ts; } var insertBefore; switch (containingFunction.kind) { - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 97 /* FunctionKeyword */, sourceFile); break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -139243,7 +136138,7 @@ var ts; else { ts.Debug.fail("fixPropertyOverrideAccessor codefix got unexpected error code " + code); } - return codefix.generateAccessorFromProperty(file, context.program, startPosition, endPosition, context, ts.Diagnostics.Generate_get_and_set_accessors.message); + return codefix.generateAccessorFromProperty(file, startPosition, endPosition, context, ts.Diagnostics.Generate_get_and_set_accessors.message); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -139497,7 +136392,7 @@ var ts; function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (ts.isInJSFile(sourceFile) && declaration.kind !== 162 /* PropertySignature */) { + if (ts.isInJSFile(sourceFile) && declaration.kind !== 161 /* PropertySignature */) { var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration; if (!parent) { return; @@ -139546,14 +136441,14 @@ var ts; return !!merged; }); }); var tag = ts.factory.createJSDocComment(comments.join("\n"), ts.factory.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags))); - var jsDocNode = parent.kind === 209 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; + var jsDocNode = parent.kind === 206 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; jsDocNode.jsDoc = parent.jsDoc; jsDocNode.jsDocCache = parent.jsDocCache; changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag); } codefix.addJSDocTags = addJSDocTags; function getJsDocNodeForArrowFunction(signature) { - if (signature.parent.kind === 163 /* PropertyDeclaration */) { + if (signature.parent.kind === 162 /* PropertyDeclaration */) { return signature.parent; } return signature.parent.parent; @@ -139563,14 +136458,14 @@ var ts; return undefined; } switch (oldTag.kind) { - case 326 /* JSDocParameterTag */: { + case 322 /* JSDocParameterTag */: { var oldParam = oldTag; var newParam = newTag; return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts.factory.createJSDocParameterTag(/*tagName*/ undefined, newParam.name, /*isBracketed*/ false, newParam.typeExpression, newParam.isNameFirst, oldParam.comment) : undefined; } - case 327 /* JSDocReturnTag */: + case 323 /* JSDocReturnTag */: return ts.factory.createJSDocReturnTag(/*tagName*/ undefined, newTag.typeExpression, oldTag.comment); } } @@ -139595,18 +136490,18 @@ var ts; function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { var searchToken; switch (containingFunction.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: searchToken = ts.findChildOfKind(containingFunction, 132 /* ConstructorKeyword */, sourceFile); break; - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: var parent = containingFunction.parent; searchToken = ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) ? parent.name : containingFunction.name; break; - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: searchToken = containingFunction.name; break; } @@ -139748,24 +136643,24 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: inferTypeFromExpressionStatement(node, usage); break; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } @@ -139773,20 +136668,20 @@ var ts; inferTypeFromContextualType(node, usage); } break; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { var _a = node.parent, name = _a.name, initializer = _a.initializer; if (node === name) { if (initializer) { // This can happen for `let x = null;` which still has an implicit-any error. @@ -139881,7 +136776,7 @@ var ts; else if (otherOperandType.flags & 296 /* NumberLike */) { usage.isNumber = true; } - else if (otherOperandType.flags & 402653316 /* StringLike */) { + else if (otherOperandType.flags & 132 /* StringLike */) { usage.isString = true; } else if (otherOperandType.flags & 1 /* Any */) { @@ -139908,7 +136803,7 @@ var ts; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: if (node === parent.left && - (node.parent.parent.kind === 249 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 246 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usage, checker.getTypeAtLocation(parent.right)); @@ -139936,7 +136831,7 @@ var ts; } } calculateUsageOfNode(parent, call.return_); - if (parent.kind === 203 /* CallExpression */) { + if (parent.kind === 200 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { @@ -140379,8 +137274,8 @@ var ts; var ambient = !!(enclosingDeclaration.flags & 8388608 /* Ambient */); var quotePreference = ts.getQuotePreference(sourceFile, preferences); switch (declaration.kind) { - case 162 /* PropertySignature */: - case 163 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 162 /* PropertyDeclaration */: var flags = quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined; var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { @@ -140394,8 +137289,8 @@ var ts; /*decorators*/ undefined, modifiers, name, optional ? ts.factory.createToken(57 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: { + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: { var typeNode_1 = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); var allAccessors = ts.getAllAccessorDeclarations(declarations, declaration); var orderedAccessors = allAccessors.secondAccessor @@ -140424,8 +137319,8 @@ var ts; } break; } - case 164 /* MethodSignature */: - case 165 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 164 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -140471,7 +137366,7 @@ var ts; var checker = program.getTypeChecker(); var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions()); var flags = 1 /* NoTruncation */ | 1073741824 /* NoUndefinedOptionalParameterType */ | 256 /* SuppressAnyReturnType */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0); - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 165 /* MethodDeclaration */, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 164 /* MethodDeclaration */, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -140720,8 +137615,8 @@ var ts; (function (ts) { var codefix; (function (codefix) { - function generateAccessorFromProperty(file, program, start, end, context, _actionName) { - var fieldInfo = getAccessorConvertiblePropertyAtPosition(file, program, start, end); + function generateAccessorFromProperty(file, start, end, context, _actionName) { + var fieldInfo = getAccessorConvertiblePropertyAtPosition(file, start, end); if (!fieldInfo || !fieldInfo.info) return undefined; var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); @@ -140744,7 +137639,7 @@ var ts; fieldModifiers = createModifiers(prepareModifierFlagsForField(modifierFlags)); } } - updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, fieldModifiers); + updateFieldDeclaration(changeTracker, file, declaration, fieldName, fieldModifiers); var getAccessor = generateGetAccessor(fieldName, accessorName, type, accessorModifiers, isStatic, container); ts.suppressLeadingAndTrailingTrivia(getAccessor); insertAccessor(changeTracker, file, getAccessor, declaration, container); @@ -140793,7 +137688,7 @@ var ts; modifierFlags |= 8 /* Private */; return modifierFlags; } - function getAccessorConvertiblePropertyAtPosition(file, program, start, end, considerEmptySpans) { + function getAccessorConvertiblePropertyAtPosition(file, start, end, considerEmptySpans) { if (considerEmptySpans === void 0) { considerEmptySpans = true; } var node = ts.getTokenAtPosition(file, start); var cursorRequest = start === end && considerEmptySpans; @@ -140823,8 +137718,8 @@ var ts; info: { isStatic: ts.hasStaticModifier(declaration), isReadonly: ts.hasEffectiveReadonlyModifier(declaration), - type: getDeclarationType(declaration, program), - container: declaration.kind === 160 /* Parameter */ ? declaration.parent.parent : declaration.parent, + type: ts.getTypeAnnotationNode(declaration), + container: declaration.kind === 159 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, @@ -140852,17 +137747,17 @@ var ts; ts.factory.createExpressionStatement(ts.factory.createAssignment(createAccessorAccessExpression(fieldName, isStatic, container), ts.factory.createIdentifier("value"))) ], /*multiLine*/ true)); } - function updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) { - var property = ts.factory.updatePropertyDeclaration(declaration, declaration.decorators, modifiers, fieldName, declaration.questionToken || declaration.exclamationToken, type, declaration.initializer); + function updatePropertyDeclaration(changeTracker, file, declaration, fieldName, modifiers) { + var property = ts.factory.updatePropertyDeclaration(declaration, declaration.decorators, modifiers, fieldName, declaration.questionToken || declaration.exclamationToken, declaration.type, declaration.initializer); changeTracker.replaceNode(file, declaration, property); } function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) { var assignment = ts.factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer); changeTracker.replacePropertyAssignment(file, declaration, assignment); } - function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) { + function updateFieldDeclaration(changeTracker, file, declaration, fieldName, modifiers) { if (ts.isPropertyDeclaration(declaration)) { - updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers); + updatePropertyDeclaration(changeTracker, file, declaration, fieldName, modifiers); } else if (ts.isPropertyAssignment(declaration)) { updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName); @@ -140895,18 +137790,6 @@ var ts; } }); } - function getDeclarationType(declaration, program) { - var typeNode = ts.getTypeAnnotationNode(declaration); - if (ts.isPropertyDeclaration(declaration) && typeNode && declaration.questionToken) { - var typeChecker = program.getTypeChecker(); - var type = typeChecker.getTypeFromTypeNode(typeNode); - if (!typeChecker.isTypeAssignableTo(typeChecker.getUndefinedType(), type)) { - var types = ts.isUnionTypeNode(typeNode) ? typeNode.types : [typeNode]; - return ts.factory.createUnionTypeNode(__spreadArrays(types, [ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)])); - } - } - return typeNode; - } function getAllSupers(decl, checker) { var res = []; while (decl) { @@ -140960,7 +137843,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 203 /* CallExpression */ : 204 /* NewExpression */; + var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 200 /* CallExpression */ : 201 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind; }); if (!node) { return []; @@ -141079,7 +137962,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, ts.Diagnostics.Add_undefined_type_to_all_uninitialized_properties); } function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { - var undefinedTypeNode = ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */); + var undefinedTypeNode = ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */); var type = propertyDeclaration.type; // TODO: GH#18217 var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode]; changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.factory.createUnionTypeNode(types)); @@ -141294,7 +138177,7 @@ var ts; function getImportTypeNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); ts.Debug.assert(token.kind === 99 /* ImportKeyword */, "This token should be an ImportKeyword"); - ts.Debug.assert(token.parent.kind === 195 /* ImportType */, "Token parent should be an ImportType"); + ts.Debug.assert(token.parent.kind === 192 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange(changes, sourceFile, importType) { @@ -141426,8 +138309,7 @@ var ts; var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); }); var parameter = ts.first(indexSignature.parameters); var mappedTypeParameter = ts.factory.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type); - var mappedIntersectionType = ts.factory.createMappedTypeNode(ts.hasEffectiveReadonlyModifier(indexSignature) ? ts.factory.createModifier(142 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, - /*nameType*/ undefined, indexSignature.questionToken, indexSignature.type); + var mappedIntersectionType = ts.factory.createMappedTypeNode(ts.hasEffectiveReadonlyModifier(indexSignature) ? ts.factory.createModifier(141 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); var intersectionType = ts.factory.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [ mappedIntersectionType ], (otherMembers.length ? [ts.factory.createTypeLiteralNode(otherMembers)] : ts.emptyArray))); @@ -141616,90 +138498,6 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; -(function (ts) { - var codefix; - (function (codefix) { - var fixName = "addVoidToPromise"; - var fixId = "addVoidToPromise"; - var errorCodes = [ - ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code - ]; - codefix.registerCodeFix({ - errorCodes: errorCodes, - fixIds: [fixId], - getCodeActions: function (context) { - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span, context.program); }); - if (changes.length > 0) { - return [codefix.createCodeFixAction(fixName, changes, ts.Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId, ts.Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]; - } - }, - getAllCodeActions: function (context) { - return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag, context.program, new ts.Set()); }); - } - }); - function makeChange(changes, sourceFile, span, program, seen) { - var node = ts.getTokenAtPosition(sourceFile, span.start); - if (!ts.isIdentifier(node) || !ts.isCallExpression(node.parent) || node.parent.expression !== node || node.parent.arguments.length !== 0) - return; - var checker = program.getTypeChecker(); - var symbol = checker.getSymbolAtLocation(node); - // decl should be `new Promise(() => {})` - var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration; - if (!decl || !ts.isParameter(decl) || !ts.isNewExpression(decl.parent.parent)) - return; - // no need to make this change if we have already seen this parameter. - if (seen === null || seen === void 0 ? void 0 : seen.has(decl)) - return; - seen === null || seen === void 0 ? void 0 : seen.add(decl); - var typeArguments = getEffectiveTypeArguments(decl.parent.parent); - if (ts.some(typeArguments)) { - // append ` | void` to type argument - var typeArgument = typeArguments[0]; - var needsParens = !ts.isUnionTypeNode(typeArgument) && !ts.isParenthesizedTypeNode(typeArgument) && - ts.isParenthesizedTypeNode(ts.factory.createUnionTypeNode([typeArgument, ts.factory.createKeywordTypeNode(113 /* VoidKeyword */)]).types[0]); - if (needsParens) { - changes.insertText(sourceFile, typeArgument.pos, "("); - } - changes.insertText(sourceFile, typeArgument.end, needsParens ? ") | void" : " | void"); - } - else { - // make sure the Promise is type is untyped (i.e., `unknown`) - var signature = checker.getResolvedSignature(node.parent); - var parameter = signature === null || signature === void 0 ? void 0 : signature.parameters[0]; - var parameterType = parameter && checker.getTypeOfSymbolAtLocation(parameter, decl.parent.parent); - if (ts.isInJSFile(decl)) { - if (!parameterType || parameterType.flags & 3 /* AnyOrUnknown */) { - // give the expression a type - changes.insertText(sourceFile, decl.parent.parent.end, ")"); - changes.insertText(sourceFile, ts.skipTrivia(sourceFile.text, decl.parent.parent.pos), "/** @type {Promise} */("); - } - } - else { - if (!parameterType || parameterType.flags & 2 /* Unknown */) { - // add `void` type argument - changes.insertText(sourceFile, decl.parent.parent.expression.end, ""); - } - } - } - } - function getEffectiveTypeArguments(node) { - var _a; - if (ts.isInJSFile(node)) { - if (ts.isParenthesizedExpression(node.parent)) { - var jsDocType = (_a = ts.getJSDocTypeTag(node.parent)) === null || _a === void 0 ? void 0 : _a.typeExpression.type; - if (jsDocType && ts.isTypeReferenceNode(jsDocType) && ts.isIdentifier(jsDocType.typeName) && ts.idText(jsDocType.typeName) === "Promise") { - return jsDocType.typeArguments; - } - } - } - else { - return node.typeArguments; - } - } - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; (function (ts) { var refactor; (function (refactor) { @@ -141747,16 +138545,16 @@ var ts; return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.This_file_already_has_a_default_export) }; } switch (exportNode.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 256 /* ModuleDeclaration */: { + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 253 /* ModuleDeclaration */: { var node = exportNode; return node.name && ts.isIdentifier(node.name) ? { info: { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } } : undefined; } - case 232 /* VariableStatement */: { + case 229 /* VariableStatement */: { var vs = exportNode; // Must be `export const x = something;`. if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { @@ -141784,23 +138582,22 @@ var ts; else { var exportKeyword = ts.Debug.checkDefined(ts.findModifier(exportNode, 92 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.factory.createToken(87 /* DefaultKeyword */)); break; - case 232 /* VariableStatement */: - // If 'x' isn't used in this file and doesn't have type definition, `export const x = 0;` --> `export default 0;` - var decl = ts.first(exportNode.declarationList.declarations); - if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile) && !decl.type) { + case 229 /* VariableStatement */: + // If 'x' isn't used in this file, `export const x = 0;` --> `export default 0;` + if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile)) { // We checked in `getInfo` that an initializer exists. - changes.replaceNode(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.Debug.checkDefined(decl.initializer, "Initializer was previously known to be present"))); + changes.replaceNode(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.Debug.checkDefined(ts.first(exportNode.declarationList.declarations).initializer, "Initializer was previously known to be present"))); break; } // falls through - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 256 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 253 /* ModuleDeclaration */: // `export type T = number;` -> `type T = number; export default T;` changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.factory.createIdentifier(exportName.text))); @@ -141827,18 +138624,18 @@ var ts; function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { var parent = ref.parent; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: // `a.default` --> `a.foo` changes.replaceNode(importingSourceFile, ref, ts.factory.createIdentifier(exportName)); break; - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: { + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: { var spec = parent; // `default as foo` --> `foo`, `default as bar` --> `foo as bar` changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 262 /* ImportClause */: { + case 259 /* ImportClause */: { var clause = parent; ts.Debug.assert(clause.name === ref, "Import clause name should match provided ref"); var spec = makeImportSpecifier(exportName, ref.text); @@ -141847,7 +138644,7 @@ var ts; // `import foo from "./a";` --> `import { foo } from "./a";` changes.replaceNode(importingSourceFile, ref, ts.factory.createNamedImports([spec])); } - else if (namedBindings.kind === 263 /* NamespaceImport */) { + else if (namedBindings.kind === 260 /* NamespaceImport */) { // `import foo, * as a from "./a";` --> `import * as a from ".a/"; import { foo } from "./a";` changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); var quotePreference = ts.isStringLiteral(clause.parent.moduleSpecifier) ? ts.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; @@ -141868,11 +138665,11 @@ var ts; function changeNamedToDefaultImport(importingSourceFile, ref, changes) { var parent = ref.parent; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: // `a.foo` --> `a.default` changes.replaceNode(importingSourceFile, ref, ts.factory.createIdentifier("default")); break; - case 265 /* ImportSpecifier */: { + case 262 /* ImportSpecifier */: { // `import { foo } from "./a";` --> `import foo from "./a";` // `import { foo as bar } from "./a";` --> `import bar from "./a";` var defaultImport = ts.factory.createIdentifier(parent.name.text); @@ -141885,7 +138682,7 @@ var ts; } break; } - case 270 /* ExportSpecifier */: { + case 267 /* ExportSpecifier */: { // `export { foo } from "./a";` --> `export { default as foo } from "./a";` // `export { foo as bar } from "./a";` --> `export { default as bar } from "./a";` // `export { foo as default } from "./a";` --> `export { default } from "./a";` @@ -141919,8 +138716,8 @@ var ts; if (!i) return ts.emptyArray; if (i.error === undefined) { - var description = i.info.kind === 263 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; - var actionName = i.info.kind === 263 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; + var description = i.info.kind === 260 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; + var actionName = i.info.kind === 260 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }]; } if (context.preferences.provideRefactorNotApplicableReason) { @@ -141959,7 +138756,7 @@ var ts; } function doChange(sourceFile, program, changes, toConvert) { var checker = program.getTypeChecker(); - if (toConvert.kind === 263 /* NamespaceImport */) { + if (toConvert.kind === 260 /* NamespaceImport */) { doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())); } else { @@ -142130,6 +138927,7 @@ var ts; if (!finalExpression || checker.isNullableType(checker.getTypeAtLocation(finalExpression))) { return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_convertible_access_expression) }; } + ; if ((ts.isPropertyAccessExpression(condition) || ts.isIdentifier(condition)) && getMatchingStart(condition, finalExpression.expression)) { return { info: { finalExpression: finalExpression, occurrences: [condition], expression: expression } }; @@ -142176,25 +138974,23 @@ var ts; * Returns subchain if chain begins with subchain syntactically. */ function getMatchingStart(chain, subchain) { - if (!ts.isIdentifier(subchain) && !ts.isPropertyAccessExpression(subchain) && !ts.isElementAccessExpression(subchain)) { - return undefined; - } - return chainStartsWith(chain, subchain) ? subchain : undefined; + return (ts.isIdentifier(subchain) || ts.isPropertyAccessExpression(subchain)) && + chainStartsWith(chain, subchain) ? subchain : undefined; } /** * Returns true if chain begins with subchain syntactically. */ function chainStartsWith(chain, subchain) { // skip until we find a matching identifier. - while (ts.isCallExpression(chain) || ts.isPropertyAccessExpression(chain) || ts.isElementAccessExpression(chain)) { - if (getTextOfChainNode(chain) === getTextOfChainNode(subchain)) + while (ts.isCallExpression(chain) || ts.isPropertyAccessExpression(chain)) { + var subchainName = ts.isPropertyAccessExpression(subchain) ? subchain.name.getText() : subchain.getText(); + if (ts.isPropertyAccessExpression(chain) && chain.name.getText() === subchainName) break; chain = chain.expression; } - // check that the chains match at each access. Call chains in subchain are not valid. - while ((ts.isPropertyAccessExpression(chain) && ts.isPropertyAccessExpression(subchain)) || - (ts.isElementAccessExpression(chain) && ts.isElementAccessExpression(subchain))) { - if (getTextOfChainNode(chain) !== getTextOfChainNode(subchain)) + // check that the chains match at each access. Call chains in subchain are not valid. + while (ts.isPropertyAccessExpression(chain) && ts.isPropertyAccessExpression(subchain)) { + if (chain.name.getText() !== subchain.name.getText()) return false; chain = chain.expression; subchain = subchain.expression; @@ -142202,18 +138998,6 @@ var ts; // check if we have reached a final identifier. return ts.isIdentifier(chain) && ts.isIdentifier(subchain) && chain.getText() === subchain.getText(); } - function getTextOfChainNode(node) { - if (ts.isIdentifier(node) || ts.isStringOrNumericLiteralLike(node)) { - return node.getText(); - } - if (ts.isPropertyAccessExpression(node)) { - return getTextOfChainNode(node.name); - } - if (ts.isElementAccessExpression(node)) { - return getTextOfChainNode(node.argumentExpression); - } - return undefined; - } /** * Find the least ancestor of the input node that is a valid type for extraction and contains the input span. */ @@ -142266,7 +139050,7 @@ var ts; return getFinalExpressionInChain(node.left); } // foo && |foo.bar()()| - nested calls are treated like further accesses. - else if ((ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) || ts.isCallExpression(node)) && !ts.isOptionalChain(node)) { + else if ((ts.isPropertyAccessExpression(node) || ts.isCallExpression(node)) && !ts.isOptionalChain(node)) { return node; } return undefined; @@ -142275,7 +139059,7 @@ var ts; * Creates an access chain from toConvert with '?.' accesses at expressions appearing in occurrences. */ function convertOccurrences(checker, toConvert, occurrences) { - if (ts.isPropertyAccessExpression(toConvert) || ts.isElementAccessExpression(toConvert) || ts.isCallExpression(toConvert)) { + if (ts.isPropertyAccessExpression(toConvert) || ts.isCallExpression(toConvert)) { var chain = convertOccurrences(checker, toConvert.expression, occurrences); var lastOccurrence = occurrences.length > 0 ? occurrences[occurrences.length - 1] : undefined; var isOccurrence = (lastOccurrence === null || lastOccurrence === void 0 ? void 0 : lastOccurrence.getText()) === toConvert.expression.getText(); @@ -142291,11 +139075,6 @@ var ts; ts.factory.createPropertyAccessChain(chain, ts.factory.createToken(28 /* QuestionDotToken */), toConvert.name) : ts.factory.createPropertyAccessChain(chain, toConvert.questionDotToken, toConvert.name); } - else if (ts.isElementAccessExpression(toConvert)) { - return isOccurrence ? - ts.factory.createElementAccessChain(chain, ts.factory.createToken(28 /* QuestionDotToken */), toConvert.argumentExpression) : - ts.factory.createElementAccessChain(chain, toConvert.questionDotToken, toConvert.argumentExpression); - } } return toConvert; } @@ -142303,7 +139082,7 @@ var ts; var finalExpression = info.finalExpression, occurrences = info.occurrences, expression = info.expression; var firstOccurrence = occurrences[occurrences.length - 1]; var convertedChain = convertOccurrences(checker, finalExpression, occurrences); - if (convertedChain && (ts.isPropertyAccessExpression(convertedChain) || ts.isElementAccessExpression(convertedChain) || ts.isCallExpression(convertedChain))) { + if (convertedChain && (ts.isPropertyAccessExpression(convertedChain) || ts.isCallExpression(convertedChain))) { if (ts.isBinaryExpression(expression)) { changes.replaceNodeRange(sourceFile, firstOccurrence, finalExpression, convertedChain); } @@ -142348,27 +139127,27 @@ var ts; var lastDeclaration = signatureDecls[signatureDecls.length - 1]; var updated = lastDeclaration; switch (lastDeclaration.kind) { - case 164 /* MethodSignature */: { + case 163 /* MethodSignature */: { updated = ts.factory.updateMethodSignature(lastDeclaration, lastDeclaration.modifiers, lastDeclaration.name, lastDeclaration.questionToken, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); break; } - case 165 /* MethodDeclaration */: { + case 164 /* MethodDeclaration */: { updated = ts.factory.updateMethodDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, lastDeclaration.asteriskToken, lastDeclaration.name, lastDeclaration.questionToken, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type, lastDeclaration.body); break; } - case 169 /* CallSignature */: { + case 168 /* CallSignature */: { updated = ts.factory.updateCallSignature(lastDeclaration, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); break; } - case 166 /* Constructor */: { + case 165 /* Constructor */: { updated = ts.factory.updateConstructorDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.body); break; } - case 170 /* ConstructSignature */: { + case 169 /* ConstructSignature */: { updated = ts.factory.updateConstructSignature(lastDeclaration, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); break; } - case 251 /* FunctionDeclaration */: { + case 248 /* FunctionDeclaration */: { updated = ts.factory.updateFunctionDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, lastDeclaration.asteriskToken, lastDeclaration.name, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type, lastDeclaration.body); break; } @@ -142420,12 +139199,12 @@ var ts; } function isConvertableSignatureDeclaration(d) { switch (d.kind) { - case 164 /* MethodSignature */: - case 165 /* MethodDeclaration */: - case 169 /* CallSignature */: - case 166 /* Constructor */: - case 170 /* ConstructSignature */: - case 251 /* FunctionDeclaration */: + case 163 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 168 /* CallSignature */: + case 165 /* Constructor */: + case 169 /* ConstructSignature */: + case 248 /* FunctionDeclaration */: return true; } return false; @@ -142788,20 +139567,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 163 /* PropertyDeclaration */) { + if (current.kind === 162 /* PropertyDeclaration */) { if (ts.hasSyntacticModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 160 /* Parameter */) { + else if (current.kind === 159 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 166 /* Constructor */) { + if (ctorOrMethod.kind === 165 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 165 /* MethodDeclaration */) { + else if (current.kind === 164 /* MethodDeclaration */) { if (ts.hasSyntacticModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -142844,7 +139623,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 249 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 246 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasSyntacticModifier(declaringNode, 1 /* Export */)) { // TODO: GH#18217 Silly to use `errors ||` since it's definitely not defined (see top of `visit`) // Also, if we're only pushing one error, just use `let error: Diagnostic | undefined`! @@ -142856,16 +139635,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; - case 266 /* ExportAssignment */: - (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractExportedEntity)); - return true; case 105 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 203 /* CallExpression */) { + if (node.parent.kind === 200 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); // TODO:GH#18217 if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -142877,7 +139653,7 @@ var ts; rangeFacts |= RangeFacts.UsesThis; } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // check if arrow function uses this ts.forEachChild(node, function check(n) { if (ts.isThis(n)) { @@ -142891,39 +139667,39 @@ var ts; } }); // falls through - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); } // falls through - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // do not dive into functions or classes return false; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 234 /* IfStatement */: + case 231 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 230 /* Block */: - if (node.parent && node.parent.kind === 247 /* TryStatement */ && node.parent.finallyBlock === node) { + case 227 /* Block */: + if (node.parent && node.parent.kind === 244 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 285 /* DefaultClause */: - case 284 /* CaseClause */: + case 282 /* DefaultClause */: + case 281 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -142935,19 +139711,19 @@ var ts; break; } switch (node.kind) { - case 187 /* ThisType */: + case 186 /* ThisType */: case 107 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 245 /* LabeledStatement */: { + case 242 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); ts.forEachChild(node, visit); seenLabels.pop(); break; } - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: { + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: { var label = node.label; if (label) { if (!ts.contains(seenLabels, label.escapedText)) { @@ -142956,20 +139732,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 241 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 238 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -143023,7 +139799,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 160 /* Parameter */) { + if (current.kind === 159 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -143034,7 +139810,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 297 /* SourceFile */) { + if (current.kind === 294 /* SourceFile */) { return scopes; } } @@ -143124,32 +139900,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return "constructor"; - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : ts.ANONYMOUS; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return "arrow function"; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return "method '" + scope.name.getText() + "'"; - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 252 /* ClassDeclaration */ + return scope.kind === 249 /* ClassDeclaration */ ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 257 /* ModuleBlock */ + return scope.kind === 254 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -143375,9 +140151,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 150 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 149 /* UndefinedKeyword */; }) ? clone - : ts.factory.createUnionTypeNode([clone, ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)]); + : ts.factory.createUnionTypeNode([clone, ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */)]); } } /** @@ -143406,7 +140182,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.factory.createModifier(123 /* StaticKeyword */)); } - modifiers.push(ts.factory.createModifier(142 /* ReadonlyKeyword */)); + modifiers.push(ts.factory.createModifier(141 /* ReadonlyKeyword */)); var newVariable = ts.factory.createPropertyDeclaration( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -143438,7 +140214,7 @@ var ts; var localReference = ts.factory.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); } - else if (node.parent.kind === 233 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 230 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.factory.createVariableStatement( @@ -143457,7 +140233,7 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 233 /* ExpressionStatement */) { + if (node.parent.kind === 230 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. changeTracker.delete(context.file, node.parent); } @@ -143784,7 +140560,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: new ts.Map(), typeParameterUsages: new ts.Map(), substitutions: new ts.Map() }); substitutionsPerScope.push(new ts.Map()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 251 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 248 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -144103,30 +140879,30 @@ var ts; function isExtractableExpression(node) { var parent = node.parent; switch (parent.kind) { - case 291 /* EnumMember */: + case 288 /* EnumMember */: return false; } switch (node.kind) { case 10 /* StringLiteral */: - return parent.kind !== 261 /* ImportDeclaration */ && - parent.kind !== 265 /* ImportSpecifier */; - case 220 /* SpreadElement */: - case 196 /* ObjectBindingPattern */: - case 198 /* BindingElement */: + return parent.kind !== 258 /* ImportDeclaration */ && + parent.kind !== 262 /* ImportSpecifier */; + case 217 /* SpreadElement */: + case 193 /* ObjectBindingPattern */: + case 195 /* BindingElement */: return false; case 78 /* Identifier */: - return parent.kind !== 198 /* BindingElement */ && - parent.kind !== 265 /* ImportSpecifier */ && - parent.kind !== 270 /* ExportSpecifier */; + return parent.kind !== 195 /* BindingElement */ && + parent.kind !== 262 /* ImportSpecifier */ && + parent.kind !== 267 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 230 /* Block */: - case 297 /* SourceFile */: - case 257 /* ModuleBlock */: - case 284 /* CaseClause */: + case 227 /* Block */: + case 294 /* SourceFile */: + case 254 /* ModuleBlock */: + case 281 /* CaseClause */: return true; default: return false; @@ -144259,7 +141035,7 @@ var ts; if (symbol) { var declaration = ts.cast(ts.first(symbol.declarations), ts.isTypeParameterDeclaration); if (rangeContainsSkipTrivia(statement, declaration, file) && !rangeContainsSkipTrivia(selection, declaration, file)) { - ts.pushIfUnique(result, declaration); + result.push(declaration); } } } @@ -144301,18 +141077,16 @@ var ts; /* decorators */ undefined, /* modifiers */ undefined, name, typeParameters.map(function (id) { return ts.factory.updateTypeParameterDeclaration(id, id.name, id.constraint, /* defaultType */ undefined); }), selection); changes.insertNodeBefore(file, firstStatement, ts.ignoreSourceNewlines(newTypeNode), /* blankLineBetween */ true); - changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); })), { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude, trailingTriviaOption: ts.textChanges.TrailingTriviaOption.ExcludeWhitespace }); + changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); }))); } function doInterfaceChange(changes, file, name, info) { - var _a; var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters, typeElements = info.typeElements; var newTypeNode = ts.factory.createInterfaceDeclaration( /* decorators */ undefined, /* modifiers */ undefined, name, typeParameters, /* heritageClauses */ undefined, typeElements); - ts.setTextRange(newTypeNode, (_a = typeElements[0]) === null || _a === void 0 ? void 0 : _a.parent); changes.insertNodeBefore(file, firstStatement, ts.ignoreSourceNewlines(newTypeNode), /* blankLineBetween */ true); - changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); })), { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude, trailingTriviaOption: ts.textChanges.TrailingTriviaOption.ExcludeWhitespace }); + changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); }))); } function doTypedefChange(changes, file, name, info) { var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters; @@ -144342,10 +141116,10 @@ var ts; getEditsForAction: function (context, actionName) { if (!context.endPosition) return undefined; - var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition); + var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.startPosition, context.endPosition); if (!info || !info.info) return undefined; - var edits = ts.codefix.generateAccessorFromProperty(context.file, context.program, context.startPosition, context.endPosition, context, actionName); + var edits = ts.codefix.generateAccessorFromProperty(context.file, context.startPosition, context.endPosition, context, actionName); if (!edits) return undefined; var renameFilename = context.file.fileName; @@ -144357,7 +141131,7 @@ var ts; getAvailableActions: function (context) { if (!context.endPosition) return ts.emptyArray; - var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition, context.triggerReason === "invoked"); + var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.startPosition, context.endPosition, context.triggerReason === "invoked"); if (!info) return ts.emptyArray; if (!info.error) { @@ -144443,6 +141217,7 @@ var ts; changes.createNewFile(oldFile, ts.combinePaths(currentDirectory, newFileNameWithExtension), getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences)); addNewFileToTsconfig(program, changes, oldFile.fileName, newFileNameWithExtension, ts.hostGetCanonicalFileName(host)); } + // Filters imports out of the range of statements to move. Imports will be copied to the new file anyway, and may still be needed in the old file. function getStatementsToMove(context) { var rangeToMove = getRangeToMove(context); if (rangeToMove === undefined) @@ -144450,27 +141225,20 @@ var ts; var all = []; var ranges = []; var toMove = rangeToMove.toMove, afterLast = rangeToMove.afterLast; - ts.getRangesWhere(toMove, isAllowedStatementToMove, function (start, afterEndIndex) { + ts.getRangesWhere(toMove, function (s) { return !isPureImport(s); }, function (start, afterEndIndex) { for (var i = start; i < afterEndIndex; i++) all.push(toMove[i]); ranges.push({ first: toMove[start], afterLast: afterLast }); }); return all.length === 0 ? undefined : { all: all, ranges: ranges }; } - function isAllowedStatementToMove(statement) { - // Filters imports and prologue directives out of the range of statements to move. - // Imports will be copied to the new file anyway, and may still be needed in the old file. - // Prologue directives will be copied to the new file and should be left in the old file. - return !isPureImport(statement) && !ts.isPrologueDirective(statement); - ; - } function isPureImport(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return true; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return !ts.hasSyntacticModifier(node, 1 /* Export */); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); }); default: return false; @@ -144492,10 +141260,9 @@ var ts; } function getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences) { var checker = program.getTypeChecker(); - var prologueDirectives = ts.takeWhile(oldFile.statements, ts.isPrologueDirective); if (!oldFile.externalModuleIndicator && !oldFile.commonJsModuleIndicator) { deleteMovedStatements(oldFile, toMove.ranges, changes); - return __spreadArrays(prologueDirectives, toMove.all); + return toMove.all; } var useEs6ModuleSyntax = !!oldFile.externalModuleIndicator; var quotePreference = ts.getQuotePreference(oldFile, preferences); @@ -144509,11 +141276,11 @@ var ts; var imports = getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference); var body = addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax); if (imports.length && body.length) { - return __spreadArrays(prologueDirectives, imports, [ + return __spreadArrays(imports, [ 4 /* NewLineTrivia */ ], body); } - return __spreadArrays(prologueDirectives, imports, body); + return __spreadArrays(imports, body); } function deleteMovedStatements(sourceFile, moved, changes) { for (var _i = 0, moved_1 = moved; _i < moved_1.length; _i++) { @@ -144566,12 +141333,12 @@ var ts; } function getNamespaceLikeImport(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 263 /* NamespaceImport */ ? + case 258 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 260 /* NamespaceImport */ ? node.importClause.namedBindings.name : undefined; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node.name; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ts.tryCast(node.name, ts.isIdentifier); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); @@ -144602,20 +141369,20 @@ var ts; var newNamespaceId = ts.factory.createIdentifier(newNamespaceName); var newModuleString = ts.factory.createStringLiteral(newModuleSpecifier); switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, ts.factory.createNamespaceImport(newNamespaceId)), newModuleString); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return ts.factory.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newNamespaceId, ts.factory.createExternalModuleReference(newModuleString)); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ts.factory.createVariableDeclaration(newNamespaceId, /*exclamationToken*/ undefined, /*type*/ undefined, createRequireCall(newModuleString)); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); } } function moduleSpecifierFromImport(i) { - return (i.kind === 261 /* ImportDeclaration */ ? i.moduleSpecifier - : i.kind === 260 /* ImportEqualsDeclaration */ ? i.moduleReference.expression + return (i.kind === 258 /* ImportDeclaration */ ? i.moduleSpecifier + : i.kind === 257 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]); } function forEachImportInStatement(statement, cb) { @@ -144685,15 +141452,15 @@ var ts; } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -144706,7 +141473,7 @@ var ts; var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings; var defaultUnused = !name || isUnused(name); var namedBindingsUnused = !namedBindings || - (namedBindings.kind === 263 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); + (namedBindings.kind === 260 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } @@ -144718,7 +141485,7 @@ var ts; if (namedBindingsUnused) { changes.replaceNode(sourceFile, importDecl.importClause, ts.factory.updateImportClause(importDecl.importClause, importDecl.importClause.isTypeOnly, name, /*namedBindings*/ undefined)); } - else if (namedBindings.kind === 264 /* NamedImports */) { + else if (namedBindings.kind === 261 /* NamedImports */) { for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { var element = _b[_i]; if (isUnused(element.name)) @@ -144736,9 +141503,9 @@ var ts; changes.delete(sourceFile, name); } break; - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: break; - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) { changes.delete(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); } @@ -144865,14 +141632,14 @@ var ts; // Below should all be utilities function isInImport(decl) { switch (decl.kind) { - case 260 /* ImportEqualsDeclaration */: - case 265 /* ImportSpecifier */: - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: + case 257 /* ImportEqualsDeclaration */: + case 262 /* ImportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: return true; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -144884,7 +141651,7 @@ var ts; } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 261 /* ImportDeclaration */: { + case 258 /* ImportDeclaration */: { var clause = i.importClause; if (!clause) return undefined; @@ -144894,9 +141661,9 @@ var ts; ? ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, defaultImport, namedBindings), moduleSpecifier) : undefined; } - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return keep(i.name) ? i : undefined; - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { var name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined; } @@ -144905,7 +141672,7 @@ var ts; } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 263 /* NamespaceImport */) { + if (namedBindings.kind === 260 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : undefined; } else { @@ -144917,9 +141684,9 @@ var ts; switch (name.kind) { case 78 /* Identifier */: return keep(name) ? name : undefined; - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return name; - case 196 /* ObjectBindingPattern */: { + case 193 /* ObjectBindingPattern */: { // We can't handle nested destructurings or property names well here, so just copy them all. var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); }); return newElements.length ? ts.factory.createObjectBindingPattern(newElements) : undefined; @@ -144976,13 +141743,13 @@ var ts; } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 257 /* ImportEqualsDeclaration */: return true; default: return false; @@ -144990,17 +141757,17 @@ var ts; } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 257 /* ImportEqualsDeclaration */: return cb(statement); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); }); - case 233 /* ExpressionStatement */: { + case 230 /* ExpressionStatement */: { var expression = statement.expression; return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) @@ -145012,8 +141779,8 @@ var ts; switch (name.kind) { case 78 /* Identifier */: return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); })); - case 197 /* ArrayBindingPattern */: - case 196 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); }); default: return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind); @@ -145024,9 +141791,9 @@ var ts; } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return d.parent.parent; - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); })); default: return d; @@ -145059,23 +141826,23 @@ var ts; function addEs6Export(d) { var modifiers = ts.concatenate([ts.factory.createModifier(92 /* ExportKeyword */)], d.modifiers); switch (d.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return ts.factory.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return ts.factory.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return ts.factory.updateVariableStatement(d, modifiers, d.declarationList); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return ts.factory.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return ts.factory.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return ts.factory.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return ts.factory.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return ts.factory.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind); @@ -145086,18 +141853,18 @@ var ts; } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; }); - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 257 /* ImportEqualsDeclaration */: return ts.emptyArray; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind); @@ -145402,15 +142169,15 @@ var ts; var parent = functionReference.parent; switch (parent.kind) { // foo(...) or super(...) or new Foo(...) - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression); @@ -145420,7 +142187,7 @@ var ts; } break; // x["foo"](...) - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression); @@ -145439,14 +142206,14 @@ var ts; var parent = reference.parent; switch (parent.kind) { // `C.foo` - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -145488,11 +142255,11 @@ var ts; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return isSingleImplementation(functionDeclaration, checker); - case 166 /* Constructor */: + case 165 /* Constructor */: if (ts.isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } @@ -145500,8 +142267,8 @@ var ts; return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -145651,7 +142418,7 @@ var ts; } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; @@ -145659,7 +142426,7 @@ var ts; // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(classDeclaration, 87 /* DefaultKeyword */), "Nameless class declaration should be a default export"); return [defaultModifier]; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: var classExpression = constructorDeclaration.parent; var variableDeclaration = constructorDeclaration.parent.parent; var className = classExpression.name; @@ -145670,25 +142437,25 @@ var ts; } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; // If the function declaration doesn't have a name, it should have a default modifier. // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(functionDeclaration, 87 /* DefaultKeyword */), "Nameless function declaration should be a default export"); return [defaultModifier]; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return [functionDeclaration.name]; - case 166 /* Constructor */: + case 165 /* Constructor */: var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 132 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); - if (functionDeclaration.parent.kind === 221 /* ClassExpression */) { + if (functionDeclaration.parent.kind === 218 /* ClassExpression */) { var variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -145764,18 +142531,10 @@ var ts; return node.operatorToken.kind !== 62 /* EqualsToken */; } function getParentBinaryExpression(expr) { - var container = ts.findAncestor(expr.parent, function (n) { - switch (n.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - return false; - case 216 /* BinaryExpression */: - return !(ts.isBinaryExpression(n.parent) && isNotEqualsOperator(n.parent)); - default: - return "quit"; - } - }); - return container || expr; + while (ts.isBinaryExpression(expr.parent) && isNotEqualsOperator(expr.parent)) { + expr = expr.parent; + } + return expr; } function isStringConcatenationValid(node) { var _a = treeToArray(node), containsString = _a.containsString, areOperatorsValid = _a.areOperatorsValid; @@ -146124,8 +142883,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 301 /* FirstJSDocNode */ || kid.kind > 333 /* LastJSDocNode */; }); - return child.kind < 157 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 298 /* FirstJSDocNode */ || kid.kind > 328 /* LastJSDocNode */; }); + return child.kind < 156 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -146136,7 +142895,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 157 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 156 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -146194,7 +142953,7 @@ var ts; } } function createSyntaxList(nodes, parent) { - var list = createNode(334 /* SyntaxList */, nodes.pos, nodes.end, parent); + var list = createNode(329 /* SyntaxList */, nodes.pos, nodes.end, parent); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { @@ -146305,13 +143064,13 @@ var ts; }; SymbolObject.prototype.getContextualDocumentationComment = function (context, checker) { switch (context === null || context === void 0 ? void 0 : context.kind) { - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: if (!this.contextualGetAccessorDocumentationComment) { this.contextualGetAccessorDocumentationComment = ts.emptyArray; this.contextualGetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isGetAccessor), checker); } return this.contextualGetAccessorDocumentationComment; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: if (!this.contextualSetAccessorDocumentationComment) { this.contextualSetAccessorDocumentationComment = ts.emptyArray; this.contextualSetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isSetAccessor), checker); @@ -146532,7 +143291,7 @@ var ts; __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { var _this = _super.call(this, kind, pos, end) || this; - _this.kind = 297 /* SourceFile */; + _this.kind = 294 /* SourceFile */; return _this; } SourceFileObject.prototype.update = function (newText, textChangeRange) { @@ -146591,10 +143350,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -146614,31 +143373,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 256 /* ModuleDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 270 /* ExportSpecifier */: - case 265 /* ImportSpecifier */: - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 177 /* TypeLiteral */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 267 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 176 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 160 /* Parameter */: + case 159 /* Parameter */: // Only consider parameter properties if (!ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: { + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -146649,12 +143408,12 @@ var ts; } } // falls through - case 291 /* EnumMember */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 288 /* EnumMember */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: addDeclaration(node); break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; var exportDeclaration = node; @@ -146667,7 +143426,7 @@ var ts; } } break; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -146679,7 +143438,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 260 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -146688,7 +143447,7 @@ var ts; } } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -147343,12 +144102,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return !ts.isLabelName(node) && !ts.isTagName(node); - case 201 /* PropertyAccessExpression */: - case 157 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` return !ts.isInComment(sourceFile, position); case 107 /* ThisKeyword */: - case 187 /* ThisType */: + case 186 /* ThisType */: case 105 /* SuperKeyword */: return true; default: @@ -147433,7 +144192,7 @@ var ts; * This is a semantic operation. */ function getSignatureHelpItems(fileName, position, _a) { - var _b = _a === void 0 ? ts.emptyOptions : _a, triggerReason = _b.triggerReason; + var triggerReason = (_a === void 0 ? ts.emptyOptions : _a).triggerReason; synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, triggerReason, cancellationToken); @@ -147450,15 +144209,15 @@ var ts; return undefined; } switch (node.kind) { - case 201 /* PropertyAccessExpression */: - case 157 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: case 10 /* StringLiteral */: case 94 /* FalseKeyword */: case 109 /* TrueKeyword */: case 103 /* NullKeyword */: case 105 /* SuperKeyword */: case 107 /* ThisKeyword */: - case 187 /* ThisType */: + case 186 /* ThisType */: case 78 /* Identifier */: break; // Cant create the text span @@ -147475,7 +144234,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 256 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 253 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -147507,33 +144266,21 @@ var ts; var kind = ts.getScriptKind(fileName, host); return kind === 3 /* TS */ || kind === 4 /* TSX */; } - function getSemanticClassifications(fileName, span, format) { + function getSemanticClassifications(fileName, span) { if (!isTsOrTsxFile(fileName)) { // do not run semantic classification on non-ts-or-tsx files return []; } synchronizeHostData(); - var responseFormat = format || "original" /* Original */; - if (responseFormat === "2020" /* TwentyTwenty */) { - return ts.classifier.v2020.getSemanticClassifications(program, cancellationToken, getValidSourceFile(fileName), span); - } - else { - return ts.getSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); - } + return ts.getSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); } - function getEncodedSemanticClassifications(fileName, span, format) { + function getEncodedSemanticClassifications(fileName, span) { if (!isTsOrTsxFile(fileName)) { // do not run semantic classification on non-ts-or-tsx files return { spans: [], endOfLineState: 0 /* None */ }; } synchronizeHostData(); - var responseFormat = format || "original" /* Original */; - if (responseFormat === "original" /* Original */) { - return ts.getEncodedSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); - } - else { - return ts.classifier.v2020.getEncodedSemanticClassifications(program, cancellationToken, getValidSourceFile(fileName), span); - } + return ts.getEncodedSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); } function getSyntacticClassifications(fileName, span) { // doesn't use compiler - no need to synchronize with host @@ -147714,10 +144461,6 @@ var ts; } // Push all text changes. for (var i = firstLine; i <= lastLine; i++) { - // If the range is multiline and ends on a beginning of a line, don't comment/uncomment. - if (firstLine !== lastLine && lineStarts[i] === textRange.end) { - continue; - } var lineTextStart = lineTextStarts.get(i.toString()); // If the line is not an empty line; otherwise no-op. if (lineTextStart !== undefined) { @@ -148196,7 +144939,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 272 /* ExternalModuleReference */ || + node.parent.kind === 269 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -148214,13 +144957,13 @@ var ts; case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 158 /* ComputedPropertyName */) { + if (node.parent.kind === 157 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 78 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 200 /* ObjectLiteralExpression */ || node.parent.parent.kind === 281 /* JsxAttributes */) && + (node.parent.parent.kind === 197 /* ObjectLiteralExpression */ || node.parent.parent.kind === 278 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -148262,7 +145005,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 202 /* ElementAccessExpression */ && + node.parent.kind === 199 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -148342,114 +145085,114 @@ var ts; if (node) { var parent = node.parent; switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 249 /* VariableDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 246 /* VariableDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return spanInVariableDeclaration(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return spanInParameterDeclaration(node); - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 230 /* Block */: + case 227 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return spanInBlock(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return spanInBlock(node.block); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 235 /* DoStatement */: + case 232 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 248 /* DebuggerStatement */: + case 245 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 234 /* IfStatement */: + case 231 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return spanInForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 247 /* TryStatement */: + case 244 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 198 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 195 /* BindingElement */: // span on complete node return textSpan(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 161 /* Decorator */: + case 160 /* Decorator */: return spanInNodeArray(parent.decorators); - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return undefined; // Tokens: case 26 /* SemicolonToken */: @@ -148479,7 +145222,7 @@ var ts; case 82 /* CatchKeyword */: case 95 /* FinallyKeyword */: return spanInNextNode(node); - case 156 /* OfKeyword */: + case 155 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -148492,13 +145235,13 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 78 /* Identifier */ || - node.kind === 220 /* SpreadElement */ || - node.kind === 288 /* PropertyAssignment */ || - node.kind === 289 /* ShorthandPropertyAssignment */) && + node.kind === 217 /* SpreadElement */ || + node.kind === 285 /* PropertyAssignment */ || + node.kind === 286 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) { return textSpan(node); } - if (node.kind === 216 /* BinaryExpression */) { + if (node.kind === 213 /* BinaryExpression */) { var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -148520,22 +145263,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (parent.kind) { - case 235 /* DoStatement */: + case 232 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 161 /* Decorator */: + case 160 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: return textSpan(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (node.parent.operatorToken.kind === 27 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -148544,21 +145287,21 @@ var ts; } } switch (node.parent.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // If this is name of property assignment, set breakpoint in the initializer if (node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: // Breakpoint in type assertion goes to its operand if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: { + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: { // initializer of variable/parameter declaration go to previous node var _b = node.parent, initializer = _b.initializer, type = _b.type; if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { @@ -148566,7 +145309,7 @@ var ts; } break; } - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var left = node.parent.left; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { // If initializer of destructuring assignment move to previous token @@ -148596,7 +145339,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 238 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 235 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } var parent = variableDeclaration.parent; @@ -148608,7 +145351,7 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasSyntacticModifier(variableDeclaration, 1 /* Export */) || - parent.parent.kind === 239 /* ForOfStatement */) { + parent.parent.kind === 236 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (ts.isVariableDeclarationList(variableDeclaration.parent) && @@ -148649,7 +145392,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasSyntacticModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 252 /* ClassDeclaration */ && functionDeclaration.kind !== 166 /* Constructor */); + (functionDeclaration.parent.kind === 249 /* ClassDeclaration */ && functionDeclaration.kind !== 165 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -148672,26 +145415,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement // falls through - case 236 /* WhileStatement */: - case 234 /* IfStatement */: - case 238 /* ForInStatement */: + case 233 /* WhileStatement */: + case 231 /* IfStatement */: + case 235 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 250 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 247 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -148716,21 +145459,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 222 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 219 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 198 /* BindingElement */) { + if (bindingPattern.parent.kind === 195 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 197 /* ArrayBindingPattern */ && node.kind !== 196 /* ObjectBindingPattern */); - var elements = node.kind === 199 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 222 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 194 /* ArrayBindingPattern */ && node.kind !== 193 /* ObjectBindingPattern */); + var elements = node.kind === 196 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 219 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -148738,18 +145481,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 216 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 213 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -148757,25 +145500,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 255 /* EnumDeclaration */: - case 252 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 249 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 230 /* Block */: + case 227 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 287 /* CatchClause */: + case 284 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -148783,7 +145526,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -148799,7 +145542,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -148814,12 +145557,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 235 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 203 /* CallExpression */ || - node.parent.kind === 204 /* NewExpression */) { + if (node.parent.kind === 232 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 200 /* CallExpression */ || + node.parent.kind === 201 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 207 /* ParenthesizedExpression */) { + if (node.parent.kind === 204 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -148828,21 +145571,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 236 /* WhileStatement */: - case 235 /* DoStatement */: - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 207 /* ParenthesizedExpression */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 233 /* WhileStatement */: + case 232 /* DoStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 204 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -148852,20 +145595,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 288 /* PropertyAssignment */ || - node.parent.kind === 160 /* Parameter */) { + node.parent.kind === 285 /* PropertyAssignment */ || + node.parent.kind === 159 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 206 /* TypeAssertionExpression */) { + if (node.parent.kind === 203 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 235 /* DoStatement */) { + if (node.parent.kind === 232 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -148873,7 +145616,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 239 /* ForOfStatement */) { + if (node.parent.kind === 236 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -150177,8 +146920,6 @@ var ts; JsxEmit["Preserve"] = "Preserve"; JsxEmit["ReactNative"] = "ReactNative"; JsxEmit["React"] = "React"; - JsxEmit["ReactJSX"] = "ReactJSX"; - JsxEmit["ReactJSXDev"] = "ReactJSXDev"; })(JsxEmit = protocol.JsxEmit || (protocol.JsxEmit = {})); var ModuleKind; (function (ModuleKind) { @@ -150189,7 +146930,6 @@ var ts; ModuleKind["System"] = "System"; ModuleKind["ES6"] = "ES6"; ModuleKind["ES2015"] = "ES2015"; - ModuleKind["ES2020"] = "ES2020"; ModuleKind["ESNext"] = "ESNext"; })(ModuleKind = protocol.ModuleKind || (protocol.ModuleKind = {})); var ModuleResolutionKind; @@ -150213,7 +146953,6 @@ var ts; ScriptTarget["ES2018"] = "ES2018"; ScriptTarget["ES2019"] = "ES2019"; ScriptTarget["ES2020"] = "ES2020"; - ScriptTarget["JSON"] = "JSON"; ScriptTarget["ESNext"] = "ESNext"; })(ScriptTarget = protocol.ScriptTarget || (protocol.ScriptTarget = {})); })(protocol = server.protocol || (server.protocol = {})); @@ -150815,7 +147554,7 @@ var ts; } function compilerOptionsChanged(opt1, opt2) { // TODO: add more relevant properties - return ts.getAllowJSCompilerOption(opt1) !== ts.getAllowJSCompilerOption(opt2); + return opt1.allowJs !== opt2.allowJs; } function unresolvedImportsChanged(imports1, imports2) { if (imports1 === imports2) { @@ -151016,7 +147755,7 @@ var ts; this.compilerOptions.allowNonTsExtensions = true; this.compilerOptions.allowJs = true; } - else if (hasExplicitListOfFiles || ts.getAllowJSCompilerOption(this.compilerOptions) || this.projectService.hasDeferredExtension()) { + else if (hasExplicitListOfFiles || this.compilerOptions.allowJs || this.projectService.hasDeferredExtension()) { // If files are listed explicitly or allowJs is specified, allow all extensions this.compilerOptions.allowNonTsExtensions = true; } @@ -151322,7 +148061,9 @@ var ts; } server.updateProjectIfDirty(this); this.builderState = ts.BuilderState.create(this.program, this.projectService.toCanonicalFileName, this.builderState); - return ts.mapDefined(ts.BuilderState.getFilesAffectedBy(this.builderState, this.program, scriptInfo.path, this.cancellationToken, ts.maybeBind(this.projectService.host, this.projectService.host.createHash)), function (sourceFile) { return _this.shouldEmitFile(_this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : undefined; }); + return ts.mapDefined(ts.BuilderState.getFilesAffectedBy(this.builderState, this.program, scriptInfo.path, this.cancellationToken, function (data) { return _this.projectService.host.createHash(data); }), // TODO: GH#18217 + function (// TODO: GH#18217 + sourceFile) { return _this.shouldEmitFile(_this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : undefined; }); }; /** * Returns true if emit was conducted @@ -151343,10 +148084,7 @@ var ts; var dtsFiles = outputFiles.filter(function (f) { return ts.fileExtensionIs(f.name, ".d.ts" /* Dts */); }); if (dtsFiles.length === 1) { var sourceFile = this.program.getSourceFile(scriptInfo.fileName); - var signature = this.projectService.host.createHash ? - this.projectService.host.createHash(dtsFiles[0].text) : - ts.generateDjb2Hash(dtsFiles[0].text); - ts.BuilderState.updateSignatureOfFile(this.builderState, signature, sourceFile.resolvedPath); + ts.BuilderState.updateSignatureOfFile(this.builderState, this.projectService.host.createHash(dtsFiles[0].text), sourceFile.resolvedPath); } } } @@ -151425,7 +148163,9 @@ var ts; this.detachScriptInfoIfNotRoot(f.fileName); } this.program.forEachResolvedProjectReference(function (ref) { - return _this.detachScriptInfoFromProject(ref.sourceFile.fileName); + if (ref) { + _this.detachScriptInfoFromProject(ref.sourceFile.fileName); + } }); } // Release external files @@ -151728,7 +148468,7 @@ var ts; // bump up the version if // - oldProgram is not set - this is a first time updateGraph is called // - newProgram is different from the old program and structure of the old program was not reused. - var hasNewProgram = this.program && (!oldProgram || (this.program !== oldProgram && !(this.program.structureIsReused & 2 /* Completely */))); + var hasNewProgram = this.program && (!oldProgram || (this.program !== oldProgram && !(oldProgram.structureIsReused & 2 /* Completely */))); if (hasNewProgram) { if (oldProgram) { for (var _i = 0, _a = oldProgram.getSourceFiles(); _i < _a.length; _i++) { @@ -151740,8 +148480,8 @@ var ts; this.detachScriptInfoFromProject(f.fileName, !!this.program.getSourceFileByPath(f.path)); } } - oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference) { - if (!_this.program.getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) { + oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference, resolvedProjectReferencePath) { + if (resolvedProjectReference && !_this.program.getResolvedProjectReferenceByPath(resolvedProjectReferencePath)) { _this.detachScriptInfoFromProject(resolvedProjectReference.sourceFile.fileName); } }); @@ -151782,7 +148522,7 @@ var ts; } } if (!this.importSuggestionsCache.isEmpty()) { - if (this.hasAddedorRemovedFiles || oldProgram && !this.program.structureIsReused) { + if (this.hasAddedorRemovedFiles || oldProgram && !oldProgram.structureIsReused) { this.importSuggestionsCache.clear(); } else if (this.dirtyFilesForSuggestions && oldProgram && this.program) { @@ -151819,7 +148559,7 @@ var ts; this.print(/*writeProjectFileNames*/ true); } else if (this.program !== oldProgram) { - this.writeLog("Different program with same set of files:: structureIsReused:: " + this.program.structureIsReused); + this.writeLog("Different program with same set of files:: oldProgram.structureIsReused:: " + (oldProgram && oldProgram.structureIsReused)); } return hasNewProgram; }; @@ -152008,14 +148748,6 @@ var ts; Project.prototype.getWatchOptions = function () { return this.watchOptions; }; - Project.prototype.setTypeAcquisition = function (newTypeAcquisition) { - if (newTypeAcquisition) { - this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition); - } - }; - Project.prototype.getTypeAcquisition = function () { - return this.typeAcquisition || {}; - }; /* @internal */ Project.prototype.getChangesSinceVersion = function (lastKnownVersion, includeProjectReferenceRedirectInfo) { var _this = this; @@ -152219,8 +148951,6 @@ var ts; }; /*@internal*/ Project.prototype.getPackageJsonsVisibleToFile = function (fileName, rootDir) { - if (this.projectService.serverMode !== ts.LanguageServiceMode.Semantic) - return server.emptyArray; return this.projectService.getPackageJsonsVisibleToFile(fileName, rootDir); }; /*@internal*/ @@ -152264,13 +148994,9 @@ var ts; if (this.autoImportProviderHost === false) { return undefined; } - if (this.projectService.serverMode !== ts.LanguageServiceMode.Semantic) { - this.autoImportProviderHost = false; - return undefined; - } if (this.autoImportProviderHost) { server.updateProjectIfDirty(this.autoImportProviderHost); - if (this.autoImportProviderHost.isEmpty()) { + if (!this.autoImportProviderHost.hasRoots()) { this.autoImportProviderHost.close(); this.autoImportProviderHost = undefined; return undefined; @@ -152279,11 +149005,9 @@ var ts; } var dependencySelection = this.includePackageJsonAutoImports(); if (dependencySelection) { - var start = ts.timestamp(); this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.getModuleResolutionHostForAutoImportProvider(), this.documentRegistry); if (this.autoImportProviderHost) { server.updateProjectIfDirty(this.autoImportProviderHost); - this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", ts.timestamp() - start); return this.autoImportProviderHost.getCurrentProgram(); } } @@ -152329,14 +149053,13 @@ var ts; var InferredProject = /** @class */ (function (_super) { __extends(InferredProject, _super); /*@internal*/ - function InferredProject(projectService, documentRegistry, compilerOptions, watchOptions, projectRootPath, currentDirectory, pluginConfigOverrides, typeAcquisition) { + function InferredProject(projectService, documentRegistry, compilerOptions, watchOptions, projectRootPath, currentDirectory, pluginConfigOverrides) { var _this = _super.call(this, InferredProject.newName(), ProjectKind.Inferred, projectService, documentRegistry, // TODO: GH#18217 /*files*/ undefined, /*lastFileExceededProgramSize*/ undefined, compilerOptions, /*compileOnSaveEnabled*/ false, watchOptions, projectService.host, currentDirectory) || this; _this._isJsInferredProject = false; - _this.typeAcquisition = typeAcquisition; _this.projectRootPath = projectRootPath && projectService.toCanonicalFileName(projectRootPath); if (!projectRootPath && !projectService.useSingleInferredProject) { _this.canonicalCurrentDirectory = projectService.toCanonicalFileName(_this.currentDirectory); @@ -152399,7 +149122,7 @@ var ts; _super.prototype.close.call(this); }; InferredProject.prototype.getTypeAcquisition = function () { - return this.typeAcquisition || { + return { enable: allRootFilesAreJsOrDts(this), include: ts.emptyArray, exclude: ts.emptyArray @@ -152472,10 +149195,6 @@ var ts; } return new AutoImportProviderProject(hostProject, rootNames, documentRegistry, compilerOptions); }; - /*@internal*/ - AutoImportProviderProject.prototype.isEmpty = function () { - return !ts.some(this.rootFileNames); - }; AutoImportProviderProject.prototype.isOrphan = function () { return true; }; @@ -152641,11 +149360,6 @@ var ts; return program && program.getResolvedProjectReferenceToRedirect(fileName); }; /*@internal*/ - ConfiguredProject.prototype.forEachResolvedProjectReference = function (cb) { - var _a; - return (_a = this.getCurrentProgram()) === null || _a === void 0 ? void 0 : _a.forEachResolvedProjectReference(cb); - }; - /*@internal*/ ConfiguredProject.prototype.enablePluginsWithOptions = function (options, pluginConfigOverrides) { var host = this.projectService.host; if (!host.require) { @@ -152684,6 +149398,12 @@ var ts; ConfiguredProject.prototype.setProjectErrors = function (projectErrors) { this.projectErrors = projectErrors; }; + ConfiguredProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { + this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition); + }; + ConfiguredProject.prototype.getTypeAcquisition = function () { + return this.typeAcquisition || {}; + }; /*@internal*/ ConfiguredProject.prototype.watchWildcards = function (wildcardDirectories) { var _this = this; @@ -152726,7 +149446,7 @@ var ts; /* @internal */ /** Find the configured project from the project references in project which contains the info directly */ ConfiguredProject.prototype.getDefaultChildProjectFromProjectWithReferences = function (info) { - return server.forEachResolvedProjectReferenceProject(this, info.path, function (child) { return server.projectContainsInfoDirectly(child, info) ? + return server.forEachResolvedProjectReferenceProject(this, function (child) { return server.projectContainsInfoDirectly(child, info) ? child : undefined; }, server.ProjectReferenceProjectLoadKind.Find); }; @@ -152754,7 +149474,7 @@ var ts; return ts.forEachEntry(configFileExistenceInfo.openFilesImpactedByConfigFile, function (_value, infoPath) { var info = _this.projectService.getScriptInfoForPath(infoPath); return _this.containsScriptInfo(info) || - !!server.forEachResolvedProjectReferenceProject(_this, info.path, function (child) { return child.containsScriptInfo(info); }, server.ProjectReferenceProjectLoadKind.Find); + !!server.forEachResolvedProjectReferenceProject(_this, function (child) { return child.containsScriptInfo(info); }, server.ProjectReferenceProjectLoadKind.Find); }) || false; }; /*@internal*/ @@ -152795,6 +149515,16 @@ var ts; ExternalProject.prototype.getExcludedFiles = function () { return this.excludedFiles; }; + ExternalProject.prototype.getTypeAcquisition = function () { + return this.typeAcquisition || {}; + }; + ExternalProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { + ts.Debug.assert(!!newTypeAcquisition, "newTypeAcquisition may not be null/undefined"); + ts.Debug.assert(!!newTypeAcquisition.include, "newTypeAcquisition.include may not be null/undefined"); + ts.Debug.assert(!!newTypeAcquisition.exclude, "newTypeAcquisition.exclude may not be null/undefined"); + ts.Debug.assert(typeof newTypeAcquisition.enable === "boolean", "newTypeAcquisition.enable may not be null/undefined"); + this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition); + }; return ExternalProject; }(Project)); server.ExternalProject = ExternalProject; @@ -152930,17 +149660,6 @@ var ts; return result; } server.convertWatchOptions = convertWatchOptions; - function convertTypeAcquisition(protocolOptions) { - var result; - ts.typeAcquisitionDeclarations.forEach(function (option) { - var propertyValue = protocolOptions[option.name]; - if (propertyValue === undefined) - return; - (result || (result = {}))[option.name] = propertyValue; - }); - return result; - } - server.convertTypeAcquisition = convertTypeAcquisition; function tryConvertScriptKindName(scriptKindName) { return ts.isString(scriptKindName) ? convertScriptKindName(scriptKindName) : scriptKindName; } @@ -153026,72 +149745,51 @@ var ts; /** Find existing project or create and load it for the project reference */ ProjectReferenceProjectLoadKind[ProjectReferenceProjectLoadKind["FindCreateLoad"] = 2] = "FindCreateLoad"; })(ProjectReferenceProjectLoadKind = server.ProjectReferenceProjectLoadKind || (server.ProjectReferenceProjectLoadKind = {})); - function forEachResolvedProjectReferenceProject(project, fileName, cb, projectReferenceProjectLoadKind, reason) { + function forEachResolvedProjectReferenceProject(project, cb, projectReferenceProjectLoadKind, reason) { var _a; - var resolvedRefs = (_a = project.getCurrentProgram()) === null || _a === void 0 ? void 0 : _a.getResolvedProjectReferences(); - if (!resolvedRefs) - return undefined; var seenResolvedRefs; - var possibleDefaultRef = fileName ? project.getResolvedProjectReferenceToRedirect(fileName) : undefined; - if (possibleDefaultRef) { - // Try to find the name of the file directly through resolved project references - var configFileName = server.toNormalizedPath(possibleDefaultRef.sourceFile.fileName); - var child = project.projectService.findConfiguredProjectByProjectName(configFileName); - if (child) { - var result = cb(child); - if (result) + return worker((_a = project.getCurrentProgram()) === null || _a === void 0 ? void 0 : _a.getResolvedProjectReferences(), project.getCompilerOptions()); + function worker(resolvedProjectReferences, parentOptions) { + var loadKind = parentOptions.disableReferencedProjectLoad ? ProjectReferenceProjectLoadKind.Find : projectReferenceProjectLoadKind; + return ts.forEach(resolvedProjectReferences, function (ref) { + if (!ref) + return undefined; + var configFileName = server.toNormalizedPath(ref.sourceFile.fileName); + var canonicalPath = project.projectService.toCanonicalFileName(configFileName); + var seenValue = seenResolvedRefs === null || seenResolvedRefs === void 0 ? void 0 : seenResolvedRefs.get(canonicalPath); + if (seenValue !== undefined && seenValue >= loadKind) { + return undefined; + } + var child = project.projectService.findConfiguredProjectByProjectName(configFileName) || (loadKind === ProjectReferenceProjectLoadKind.Find ? + undefined : + loadKind === ProjectReferenceProjectLoadKind.FindCreate ? + project.projectService.createConfiguredProject(configFileName) : + loadKind === ProjectReferenceProjectLoadKind.FindCreateLoad ? + project.projectService.createAndLoadConfiguredProject(configFileName, reason) : + ts.Debug.assertNever(loadKind)); + var result = child && cb(child); + if (result) { return result; - } - else if (projectReferenceProjectLoadKind !== ProjectReferenceProjectLoadKind.Find) { - seenResolvedRefs = new ts.Map(); - // Try to see if this project can be loaded - var result = forEachResolvedProjectReferenceProjectWorker(resolvedRefs, project.getCompilerOptions(), function (ref, loadKind) { return possibleDefaultRef === ref ? callback(ref, loadKind) : undefined; }, projectReferenceProjectLoadKind, project.projectService, seenResolvedRefs); - if (result) - return result; - // Cleanup seenResolvedRefs - seenResolvedRefs.clear(); - } - } - return forEachResolvedProjectReferenceProjectWorker(resolvedRefs, project.getCompilerOptions(), function (ref, loadKind) { return possibleDefaultRef !== ref ? callback(ref, loadKind) : undefined; }, projectReferenceProjectLoadKind, project.projectService, seenResolvedRefs); - function callback(ref, loadKind) { - var configFileName = server.toNormalizedPath(ref.sourceFile.fileName); - var child = project.projectService.findConfiguredProjectByProjectName(configFileName) || (loadKind === ProjectReferenceProjectLoadKind.Find ? - undefined : - loadKind === ProjectReferenceProjectLoadKind.FindCreate ? - project.projectService.createConfiguredProject(configFileName) : - loadKind === ProjectReferenceProjectLoadKind.FindCreateLoad ? - project.projectService.createAndLoadConfiguredProject(configFileName, reason) : - ts.Debug.assertNever(loadKind)); - return child && cb(child); + } + (seenResolvedRefs || (seenResolvedRefs = new ts.Map())).set(canonicalPath, loadKind); + return worker(ref.references, ref.commandLine.options); + }); } } server.forEachResolvedProjectReferenceProject = forEachResolvedProjectReferenceProject; - function forEachResolvedProjectReferenceProjectWorker(resolvedProjectReferences, parentOptions, cb, projectReferenceProjectLoadKind, projectService, seenResolvedRefs) { - var loadKind = parentOptions.disableReferencedProjectLoad ? ProjectReferenceProjectLoadKind.Find : projectReferenceProjectLoadKind; - return ts.forEach(resolvedProjectReferences, function (ref) { - if (!ref) - return undefined; - var configFileName = server.toNormalizedPath(ref.sourceFile.fileName); - var canonicalPath = projectService.toCanonicalFileName(configFileName); - var seenValue = seenResolvedRefs === null || seenResolvedRefs === void 0 ? void 0 : seenResolvedRefs.get(canonicalPath); - if (seenValue !== undefined && seenValue >= loadKind) { - return undefined; - } - var result = cb(ref, loadKind); - if (result) { - return result; - } - (seenResolvedRefs || (seenResolvedRefs = new ts.Map())).set(canonicalPath, loadKind); - return ref.references && forEachResolvedProjectReferenceProjectWorker(ref.references, ref.commandLine.options, cb, loadKind, projectService, seenResolvedRefs); - }); + /*@internal*/ + function forEachResolvedProjectReference(project, cb) { + var program = project.getCurrentProgram(); + return program && program.forEachResolvedProjectReference(cb); } + server.forEachResolvedProjectReference = forEachResolvedProjectReference; function forEachPotentialProjectReference(project, cb) { return project.potentialProjectReferences && ts.forEachKey(project.potentialProjectReferences, cb); } function forEachAnyProjectReferenceKind(project, cb, cbProjectRef, cbPotentialProjectRef) { return project.getCurrentProgram() ? - project.forEachResolvedProjectReference(cb) : + forEachResolvedProjectReference(project, cb) : project.isInitialLoadPending() ? forEachPotentialProjectReference(project, cbPotentialProjectRef) : ts.forEach(project.getProjectReferences(), cbProjectRef); @@ -153101,7 +149799,7 @@ var ts; return refProject && cb(refProject); } function forEachReferencedProject(project, cb) { - return forEachAnyProjectReferenceKind(project, function (resolvedRef) { return callbackRefProject(project, cb, resolvedRef.sourceFile.path); }, function (projectRef) { return callbackRefProject(project, cb, project.toPath(ts.resolveProjectReferencePath(projectRef))); }, function (potentialProjectRef) { return callbackRefProject(project, cb, potentialProjectRef); }); + return forEachAnyProjectReferenceKind(project, function (resolvedRef) { return callbackRefProject(project, cb, resolvedRef && resolvedRef.sourceFile.path); }, function (projectRef) { return callbackRefProject(project, cb, project.toPath(projectRef.path)); }, function (potentialProjectRef) { return callbackRefProject(project, cb, potentialProjectRef); }); } function getDetailWatchInfo(watchType, project) { return "Project: " + (project ? project.getProjectName() : "") + " WatchType: " + watchType; @@ -153172,7 +149870,6 @@ var ts; this.openFilesWithNonRootedDiskPath = new ts.Map(); this.compilerOptionsForInferredProjectsPerProjectRoot = new ts.Map(); this.watchOptionsForInferredProjectsPerProjectRoot = new ts.Map(); - this.typeAcquisitionForInferredProjectsPerProjectRoot = new ts.Map(); /** * Project size for configured or external projects */ @@ -153217,6 +149914,7 @@ var ts; this.serverMode = ts.LanguageServiceMode.Semantic; this.syntaxOnly = false; } + ts.Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService"); if (this.host.realpath) { this.realpathToScriptInfos = ts.createMultiMap(); } @@ -153446,7 +150144,6 @@ var ts; ts.Debug.assert(projectRootPath === undefined || this.useInferredProjectPerProjectRoot, "Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled"); var compilerOptions = convertCompilerOptions(projectCompilerOptions); var watchOptions = convertWatchOptions(projectCompilerOptions); - var typeAcquisition = convertTypeAcquisition(projectCompilerOptions); // always set 'allowNonTsExtensions' for inferred projects since user cannot configure it from the outside // previously we did not expose a way for user to change these settings and this option was enabled by default compilerOptions.allowNonTsExtensions = true; @@ -153454,12 +150151,10 @@ var ts; if (canonicalProjectRootPath) { this.compilerOptionsForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, compilerOptions); this.watchOptionsForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, watchOptions || false); - this.typeAcquisitionForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, typeAcquisition); } else { this.compilerOptionsForInferredProjects = compilerOptions; this.watchOptionsForInferredProjects = watchOptions; - this.typeAcquisitionForInferredProjects = typeAcquisition; } for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { var project = _a[_i]; @@ -153476,7 +150171,6 @@ var ts; !project.projectRootPath || !this.compilerOptionsForInferredProjectsPerProjectRoot.has(project.projectRootPath)) { project.setCompilerOptions(compilerOptions); project.setWatchOptions(watchOptions); - project.setTypeAcquisition(typeAcquisition); project.compileOnSaveEnabled = compilerOptions.compileOnSave; project.markAsDirty(); this.delayUpdateProjectGraph(project); @@ -154585,18 +151279,13 @@ var ts; ProjectService.prototype.createInferredProject = function (currentDirectory, isSingleInferredProject, projectRootPath) { var compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects; // TODO: GH#18217 var watchOptions; - var typeAcquisition; if (projectRootPath) { watchOptions = this.watchOptionsForInferredProjectsPerProjectRoot.get(projectRootPath); - typeAcquisition = this.typeAcquisitionForInferredProjectsPerProjectRoot.get(projectRootPath); } if (watchOptions === undefined) { watchOptions = this.watchOptionsForInferredProjects; } - if (typeAcquisition === undefined) { - typeAcquisition = this.typeAcquisitionForInferredProjects; - } - var project = new server.InferredProject(this, this.documentRegistry, compilerOptions, watchOptions || undefined, projectRootPath, currentDirectory, this.currentPluginConfigOverrides, typeAcquisition); + var project = new server.InferredProject(this, this.documentRegistry, compilerOptions, watchOptions || undefined, projectRootPath, currentDirectory, this.currentPluginConfigOverrides); if (isSingleInferredProject) { this.inferredProjects.unshift(project); } @@ -155085,14 +151774,13 @@ var ts; _this.reloadConfiguredProject(project, reason, /*isInitialLoad*/ false); // If this project does not contain this file directly, reload the project till the reloaded project contains the script info directly if (!projectContainsInfoDirectly(project, info)) { - var referencedProject = forEachResolvedProjectReferenceProject(project, info.path, function (child) { + var referencedProject = forEachResolvedProjectReferenceProject(project, function (child) { reloadChildProject(child); return projectContainsInfoDirectly(child, info); }, ProjectReferenceProjectLoadKind.FindCreate); if (referencedProject) { // Reload the project's tree that is already present - forEachResolvedProjectReferenceProject(project, - /*fileName*/ undefined, reloadChildProject, ProjectReferenceProjectLoadKind.Find); + forEachResolvedProjectReferenceProject(project, reloadChildProject, ProjectReferenceProjectLoadKind.Find); } } } @@ -155185,10 +151873,10 @@ var ts; }; if (configuredProject.isSolution() || !projectContainsOriginalInfo(configuredProject)) { // Find the project that is referenced from this solution that contains the script info directly - configuredProject = forEachResolvedProjectReferenceProject(configuredProject, fileName, function (child) { + configuredProject = forEachResolvedProjectReferenceProject(configuredProject, function (child) { updateProjectIfDirty(child); return projectContainsOriginalInfo(child) ? child : undefined; - }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution " + configuredProject.projectName + " to find possible configured project for original file: " + originalFileInfo.fileName + (location !== originalLocation ? " for location: " + location.fileName : "")); + }, configuredProject.getCompilerOptions().disableReferencedProjectLoad ? ProjectReferenceProjectLoadKind.Find : ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution " + configuredProject.projectName + " to find possible configured project for original file: " + originalFileInfo.fileName + (location !== originalLocation ? " for location: " + location.fileName : "")); if (!configuredProject) return undefined; if (configuredProject === project) @@ -155254,7 +151942,7 @@ var ts; // If this configured project doesnt contain script info but // it is solution with project references, try those project references if (!projectContainsInfoDirectly(project, info)) { - forEachResolvedProjectReferenceProject(project, info.path, function (child) { + forEachResolvedProjectReferenceProject(project, function (child) { updateProjectIfDirty(child); // Retain these projects if (!ts.isArray(retainProjects)) { @@ -155350,38 +152038,21 @@ var ts; for (var _i = 0, _a = ts.arrayFrom(this.configuredProjects.values()); _i < _a.length; _i++) { var project = _a[_i]; // If this project has potential project reference for any of the project we are loading ancestor tree for - // load this project first - if (forEachPotentialProjectReference(project, function (potentialRefPath) { return forProjects.has(potentialRefPath); })) { - updateProjectIfDirty(project); + // we need to load this project tree + if (forEachPotentialProjectReference(project, function (potentialRefPath) { return forProjects.has(potentialRefPath); }) || forEachResolvedProjectReference(project, function (_ref, resolvedPath) { return forProjects.has(resolvedPath); })) { + // Load children + this.ensureProjectChildren(project, seenProjects); } - this.ensureProjectChildren(project, forProjects, seenProjects); } }; - ProjectService.prototype.ensureProjectChildren = function (project, forProjects, seenProjects) { - var _a; + ProjectService.prototype.ensureProjectChildren = function (project, seenProjects) { + var _this = this; if (!ts.tryAddToSet(seenProjects, project.canonicalConfigFilePath)) return; - // If this project disables child load ignore it - if (project.getCompilerOptions().disableReferencedProjectLoad) - return; - var children = (_a = project.getCurrentProgram()) === null || _a === void 0 ? void 0 : _a.getResolvedProjectReferences(); - if (!children) - return; - for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { - var child = children_1[_i]; - if (!child) - continue; - var referencedProject = ts.forEachResolvedProjectReference(child.references, function (ref) { return forProjects.has(ref.sourceFile.path) ? ref : undefined; }); - if (!referencedProject) - continue; - // Load this project, - var configFileName = server.toNormalizedPath(child.sourceFile.fileName); - var childProject = project.projectService.findConfiguredProjectByProjectName(configFileName) || - project.projectService.createAndLoadConfiguredProject(configFileName, "Creating project referenced by : " + project.projectName + " as it references project " + referencedProject.sourceFile.fileName); - updateProjectIfDirty(childProject); - // Ensure children for this project - this.ensureProjectChildren(childProject, forProjects, seenProjects); - } + // Update the project + updateProjectIfDirty(project); + // Create tree because project is uptodate we only care of resolved references + forEachResolvedProjectReferenceProject(project, function (child) { return _this.ensureProjectChildren(child, seenProjects); }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project for reference of project: " + project.projectName); }; ProjectService.prototype.cleanupAfterOpeningFile = function (toRetainConfigProjects) { // This was postponed from closeOpenFile to after opening next file, @@ -155666,7 +152337,8 @@ var ts; var rootFiles = proj.rootFiles; var typeAcquisition = proj.typeAcquisition; ts.Debug.assert(!!typeAcquisition, "proj.typeAcquisition should be set by now"); - if (typeAcquisition.enable === false || typeAcquisition.disableFilenameBasedTypeAcquisition) { + // If type acquisition has been explicitly disabled, do not exclude anything from the project + if (typeAcquisition.enable === false) { return []; } var typeAcqInclude = typeAcquisition.include || (typeAcquisition.include = []); @@ -155925,7 +152597,7 @@ var ts; var processDirectory = function (directory) { switch (packageJsonCache.directoryHasPackageJson(directory)) { // Sync and check same directory again - case 3 /* Maybe */: + case 1 /* Maybe */: packageJsonCache.searchDirectoryAndAncestors(directory); return processDirectory(directory); // Check package.json @@ -156031,7 +152703,7 @@ var ts; directoryHasPackageJson: directoryHasPackageJson, searchDirectoryAndAncestors: function (directory) { ts.forEachAncestorDirectory(directory, function (ancestor) { - if (directoryHasPackageJson(ancestor) !== 3 /* Maybe */) { + if (directoryHasPackageJson(ancestor) !== 1 /* Maybe */) { return true; } var packageJsonFileName = host.toPath(ts.combinePaths(ancestor, "package.json")); @@ -156052,7 +152724,7 @@ var ts; function directoryHasPackageJson(directory) { return packageJsons.has(ts.combinePaths(directory, "package.json")) ? -1 /* True */ : directoriesWithoutPackageJson.has(directory) ? 0 /* False */ : - 3 /* Maybe */; + 1 /* Maybe */; } } server.createPackageJsonCache = createPackageJsonCache; @@ -157278,7 +153950,7 @@ var ts; }; Session.prototype.getEncodedSemanticClassifications = function (args) { var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; - return project.getLanguageService().getEncodedSemanticClassifications(file, args, args.format); + return project.getLanguageService().getEncodedSemanticClassifications(file, args); }; Session.prototype.getProject = function (projectFileName) { return projectFileName === undefined ? undefined : this.projectService.findProject(projectFileName); @@ -157858,7 +154530,7 @@ var ts; entries.metadata = completions.metadata; return entries; } - var res = __assign(__assign({}, completions), { optionalReplacementSpan: completions.optionalReplacementSpan && toProtocolTextSpan(completions.optionalReplacementSpan, scriptInfo), entries: entries }); + var res = __assign(__assign({}, completions), { entries: entries }); return res; }; Session.prototype.getCompletionEntryDetails = function (args, simplifiedResult) { @@ -158391,7 +155063,6 @@ var ts; kind: item.kind, kindModifiers: item.kindModifiers, file: item.file, - containerName: item.containerName, span: toProtocolTextSpan(item.span, scriptInfo), selectionSpan: toProtocolTextSpan(item.selectionSpan, scriptInfo) }; @@ -160039,7 +156710,7 @@ var ts; } else { type = operatorOrType; - operator = 138 /* KeyOfKeyword */; + operator = 137 /* KeyOfKeyword */; } return ts.factory.createTypeOperatorNode(operator, type); }, factoryDeprecation); @@ -160217,7 +156888,7 @@ var ts; ts.createNode = ts.Debug.deprecate(function createNode(kind, pos, end) { if (pos === void 0) { pos = 0; } if (end === void 0) { end = 0; } - return ts.setTextRangePosEnd(kind === 297 /* SourceFile */ ? ts.parseBaseNodeFactory.createBaseSourceFileNode(kind) : + return ts.setTextRangePosEnd(kind === 294 /* SourceFile */ ? ts.parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 78 /* Identifier */ ? ts.parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 79 /* PrivateIdentifier */ ? ts.parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !ts.isNodeKind(kind) ? ts.parseBaseNodeFactory.createBaseTokenNode(kind) : @@ -160246,7 +156917,7 @@ var ts; // #region Renamed node Tests /** @deprecated Use `isTypeAssertionExpression` instead. */ ts.isTypeAssertion = ts.Debug.deprecate(function isTypeAssertion(node) { - return node.kind === 206 /* TypeAssertionExpression */; + return node.kind === 203 /* TypeAssertionExpression */; }, { since: "4.0", warnAfter: "4.1", diff --git a/node_modules/typescript/lib/typescript.d.ts b/node_modules/typescript/lib/typescript.d.ts index 7c6c630..67e3522 100644 --- a/node_modules/typescript/lib/typescript.d.ts +++ b/node_modules/typescript/lib/typescript.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "4.1"; + const versionMajorMinor = "4.0"; /** The version of the TypeScript compiler release */ const version: string; /** @@ -240,212 +240,207 @@ declare namespace ts { DeclareKeyword = 133, GetKeyword = 134, InferKeyword = 135, - IntrinsicKeyword = 136, - IsKeyword = 137, - KeyOfKeyword = 138, - ModuleKeyword = 139, - NamespaceKeyword = 140, - NeverKeyword = 141, - ReadonlyKeyword = 142, - RequireKeyword = 143, - NumberKeyword = 144, - ObjectKeyword = 145, - SetKeyword = 146, - StringKeyword = 147, - SymbolKeyword = 148, - TypeKeyword = 149, - UndefinedKeyword = 150, - UniqueKeyword = 151, - UnknownKeyword = 152, - FromKeyword = 153, - GlobalKeyword = 154, - BigIntKeyword = 155, - OfKeyword = 156, - QualifiedName = 157, - ComputedPropertyName = 158, - TypeParameter = 159, - Parameter = 160, - Decorator = 161, - PropertySignature = 162, - PropertyDeclaration = 163, - MethodSignature = 164, - MethodDeclaration = 165, - Constructor = 166, - GetAccessor = 167, - SetAccessor = 168, - CallSignature = 169, - ConstructSignature = 170, - IndexSignature = 171, - TypePredicate = 172, - TypeReference = 173, - FunctionType = 174, - ConstructorType = 175, - TypeQuery = 176, - TypeLiteral = 177, - ArrayType = 178, - TupleType = 179, - OptionalType = 180, - RestType = 181, - UnionType = 182, - IntersectionType = 183, - ConditionalType = 184, - InferType = 185, - ParenthesizedType = 186, - ThisType = 187, - TypeOperator = 188, - IndexedAccessType = 189, - MappedType = 190, - LiteralType = 191, - NamedTupleMember = 192, - TemplateLiteralType = 193, - TemplateLiteralTypeSpan = 194, - ImportType = 195, - ObjectBindingPattern = 196, - ArrayBindingPattern = 197, - BindingElement = 198, - ArrayLiteralExpression = 199, - ObjectLiteralExpression = 200, - PropertyAccessExpression = 201, - ElementAccessExpression = 202, - CallExpression = 203, - NewExpression = 204, - TaggedTemplateExpression = 205, - TypeAssertionExpression = 206, - ParenthesizedExpression = 207, - FunctionExpression = 208, - ArrowFunction = 209, - DeleteExpression = 210, - TypeOfExpression = 211, - VoidExpression = 212, - AwaitExpression = 213, - PrefixUnaryExpression = 214, - PostfixUnaryExpression = 215, - BinaryExpression = 216, - ConditionalExpression = 217, - TemplateExpression = 218, - YieldExpression = 219, - SpreadElement = 220, - ClassExpression = 221, - OmittedExpression = 222, - ExpressionWithTypeArguments = 223, - AsExpression = 224, - NonNullExpression = 225, - MetaProperty = 226, - SyntheticExpression = 227, - TemplateSpan = 228, - SemicolonClassElement = 229, - Block = 230, - EmptyStatement = 231, - VariableStatement = 232, - ExpressionStatement = 233, - IfStatement = 234, - DoStatement = 235, - WhileStatement = 236, - ForStatement = 237, - ForInStatement = 238, - ForOfStatement = 239, - ContinueStatement = 240, - BreakStatement = 241, - ReturnStatement = 242, - WithStatement = 243, - SwitchStatement = 244, - LabeledStatement = 245, - ThrowStatement = 246, - TryStatement = 247, - DebuggerStatement = 248, - VariableDeclaration = 249, - VariableDeclarationList = 250, - FunctionDeclaration = 251, - ClassDeclaration = 252, - InterfaceDeclaration = 253, - TypeAliasDeclaration = 254, - EnumDeclaration = 255, - ModuleDeclaration = 256, - ModuleBlock = 257, - CaseBlock = 258, - NamespaceExportDeclaration = 259, - ImportEqualsDeclaration = 260, - ImportDeclaration = 261, - ImportClause = 262, - NamespaceImport = 263, - NamedImports = 264, - ImportSpecifier = 265, - ExportAssignment = 266, - ExportDeclaration = 267, - NamedExports = 268, - NamespaceExport = 269, - ExportSpecifier = 270, - MissingDeclaration = 271, - ExternalModuleReference = 272, - JsxElement = 273, - JsxSelfClosingElement = 274, - JsxOpeningElement = 275, - JsxClosingElement = 276, - JsxFragment = 277, - JsxOpeningFragment = 278, - JsxClosingFragment = 279, - JsxAttribute = 280, - JsxAttributes = 281, - JsxSpreadAttribute = 282, - JsxExpression = 283, - CaseClause = 284, - DefaultClause = 285, - HeritageClause = 286, - CatchClause = 287, - PropertyAssignment = 288, - ShorthandPropertyAssignment = 289, - SpreadAssignment = 290, - EnumMember = 291, - UnparsedPrologue = 292, - UnparsedPrepend = 293, - UnparsedText = 294, - UnparsedInternalText = 295, - UnparsedSyntheticReference = 296, - SourceFile = 297, - Bundle = 298, - UnparsedSource = 299, - InputFiles = 300, - JSDocTypeExpression = 301, - JSDocNameReference = 302, - JSDocAllType = 303, - JSDocUnknownType = 304, - JSDocNullableType = 305, - JSDocNonNullableType = 306, - JSDocOptionalType = 307, - JSDocFunctionType = 308, - JSDocVariadicType = 309, - JSDocNamepathType = 310, - JSDocComment = 311, - JSDocTypeLiteral = 312, - JSDocSignature = 313, - JSDocTag = 314, - JSDocAugmentsTag = 315, - JSDocImplementsTag = 316, - JSDocAuthorTag = 317, - JSDocDeprecatedTag = 318, - JSDocClassTag = 319, - JSDocPublicTag = 320, - JSDocPrivateTag = 321, - JSDocProtectedTag = 322, - JSDocReadonlyTag = 323, - JSDocCallbackTag = 324, - JSDocEnumTag = 325, - JSDocParameterTag = 326, - JSDocReturnTag = 327, - JSDocThisTag = 328, - JSDocTypeTag = 329, - JSDocTemplateTag = 330, - JSDocTypedefTag = 331, - JSDocSeeTag = 332, - JSDocPropertyTag = 333, - SyntaxList = 334, - NotEmittedStatement = 335, - PartiallyEmittedExpression = 336, - CommaListExpression = 337, - MergeDeclarationMarker = 338, - EndOfDeclarationMarker = 339, - SyntheticReferenceExpression = 340, - Count = 341, + IsKeyword = 136, + KeyOfKeyword = 137, + ModuleKeyword = 138, + NamespaceKeyword = 139, + NeverKeyword = 140, + ReadonlyKeyword = 141, + RequireKeyword = 142, + NumberKeyword = 143, + ObjectKeyword = 144, + SetKeyword = 145, + StringKeyword = 146, + SymbolKeyword = 147, + TypeKeyword = 148, + UndefinedKeyword = 149, + UniqueKeyword = 150, + UnknownKeyword = 151, + FromKeyword = 152, + GlobalKeyword = 153, + BigIntKeyword = 154, + OfKeyword = 155, + QualifiedName = 156, + ComputedPropertyName = 157, + TypeParameter = 158, + Parameter = 159, + Decorator = 160, + PropertySignature = 161, + PropertyDeclaration = 162, + MethodSignature = 163, + MethodDeclaration = 164, + Constructor = 165, + GetAccessor = 166, + SetAccessor = 167, + CallSignature = 168, + ConstructSignature = 169, + IndexSignature = 170, + TypePredicate = 171, + TypeReference = 172, + FunctionType = 173, + ConstructorType = 174, + TypeQuery = 175, + TypeLiteral = 176, + ArrayType = 177, + TupleType = 178, + OptionalType = 179, + RestType = 180, + UnionType = 181, + IntersectionType = 182, + ConditionalType = 183, + InferType = 184, + ParenthesizedType = 185, + ThisType = 186, + TypeOperator = 187, + IndexedAccessType = 188, + MappedType = 189, + LiteralType = 190, + NamedTupleMember = 191, + ImportType = 192, + ObjectBindingPattern = 193, + ArrayBindingPattern = 194, + BindingElement = 195, + ArrayLiteralExpression = 196, + ObjectLiteralExpression = 197, + PropertyAccessExpression = 198, + ElementAccessExpression = 199, + CallExpression = 200, + NewExpression = 201, + TaggedTemplateExpression = 202, + TypeAssertionExpression = 203, + ParenthesizedExpression = 204, + FunctionExpression = 205, + ArrowFunction = 206, + DeleteExpression = 207, + TypeOfExpression = 208, + VoidExpression = 209, + AwaitExpression = 210, + PrefixUnaryExpression = 211, + PostfixUnaryExpression = 212, + BinaryExpression = 213, + ConditionalExpression = 214, + TemplateExpression = 215, + YieldExpression = 216, + SpreadElement = 217, + ClassExpression = 218, + OmittedExpression = 219, + ExpressionWithTypeArguments = 220, + AsExpression = 221, + NonNullExpression = 222, + MetaProperty = 223, + SyntheticExpression = 224, + TemplateSpan = 225, + SemicolonClassElement = 226, + Block = 227, + EmptyStatement = 228, + VariableStatement = 229, + ExpressionStatement = 230, + IfStatement = 231, + DoStatement = 232, + WhileStatement = 233, + ForStatement = 234, + ForInStatement = 235, + ForOfStatement = 236, + ContinueStatement = 237, + BreakStatement = 238, + ReturnStatement = 239, + WithStatement = 240, + SwitchStatement = 241, + LabeledStatement = 242, + ThrowStatement = 243, + TryStatement = 244, + DebuggerStatement = 245, + VariableDeclaration = 246, + VariableDeclarationList = 247, + FunctionDeclaration = 248, + ClassDeclaration = 249, + InterfaceDeclaration = 250, + TypeAliasDeclaration = 251, + EnumDeclaration = 252, + ModuleDeclaration = 253, + ModuleBlock = 254, + CaseBlock = 255, + NamespaceExportDeclaration = 256, + ImportEqualsDeclaration = 257, + ImportDeclaration = 258, + ImportClause = 259, + NamespaceImport = 260, + NamedImports = 261, + ImportSpecifier = 262, + ExportAssignment = 263, + ExportDeclaration = 264, + NamedExports = 265, + NamespaceExport = 266, + ExportSpecifier = 267, + MissingDeclaration = 268, + ExternalModuleReference = 269, + JsxElement = 270, + JsxSelfClosingElement = 271, + JsxOpeningElement = 272, + JsxClosingElement = 273, + JsxFragment = 274, + JsxOpeningFragment = 275, + JsxClosingFragment = 276, + JsxAttribute = 277, + JsxAttributes = 278, + JsxSpreadAttribute = 279, + JsxExpression = 280, + CaseClause = 281, + DefaultClause = 282, + HeritageClause = 283, + CatchClause = 284, + PropertyAssignment = 285, + ShorthandPropertyAssignment = 286, + SpreadAssignment = 287, + EnumMember = 288, + UnparsedPrologue = 289, + UnparsedPrepend = 290, + UnparsedText = 291, + UnparsedInternalText = 292, + UnparsedSyntheticReference = 293, + SourceFile = 294, + Bundle = 295, + UnparsedSource = 296, + InputFiles = 297, + JSDocTypeExpression = 298, + JSDocAllType = 299, + JSDocUnknownType = 300, + JSDocNullableType = 301, + JSDocNonNullableType = 302, + JSDocOptionalType = 303, + JSDocFunctionType = 304, + JSDocVariadicType = 305, + JSDocNamepathType = 306, + JSDocComment = 307, + JSDocTypeLiteral = 308, + JSDocSignature = 309, + JSDocTag = 310, + JSDocAugmentsTag = 311, + JSDocImplementsTag = 312, + JSDocAuthorTag = 313, + JSDocDeprecatedTag = 314, + JSDocClassTag = 315, + JSDocPublicTag = 316, + JSDocPrivateTag = 317, + JSDocProtectedTag = 318, + JSDocReadonlyTag = 319, + JSDocCallbackTag = 320, + JSDocEnumTag = 321, + JSDocParameterTag = 322, + JSDocReturnTag = 323, + JSDocThisTag = 324, + JSDocTypeTag = 325, + JSDocTemplateTag = 326, + JSDocTypedefTag = 327, + JSDocPropertyTag = 328, + SyntaxList = 329, + NotEmittedStatement = 330, + PartiallyEmittedExpression = 331, + CommaListExpression = 332, + MergeDeclarationMarker = 333, + EndOfDeclarationMarker = 334, + SyntheticReferenceExpression = 335, + Count = 336, FirstAssignment = 62, LastAssignment = 77, FirstCompoundAssignment = 63, @@ -453,15 +448,15 @@ declare namespace ts { FirstReservedWord = 80, LastReservedWord = 115, FirstKeyword = 80, - LastKeyword = 156, + LastKeyword = 155, FirstFutureReservedWord = 116, LastFutureReservedWord = 124, - FirstTypeNode = 172, - LastTypeNode = 195, + FirstTypeNode = 171, + LastTypeNode = 192, FirstPunctuation = 18, LastPunctuation = 77, FirstToken = 0, - LastToken = 156, + LastToken = 155, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -470,21 +465,21 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 77, - FirstStatement = 232, - LastStatement = 248, - FirstNode = 157, - FirstJSDocNode = 301, - LastJSDocNode = 333, - FirstJSDocTagNode = 314, - LastJSDocTagNode = 333, + FirstStatement = 229, + LastStatement = 245, + FirstNode = 156, + FirstJSDocNode = 298, + LastJSDocNode = 328, + FirstJSDocTagNode = 310, + LastJSDocTagNode = 328, } export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail; export type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | 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; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.StaticKeyword; - export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; + export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind; export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; @@ -615,8 +610,7 @@ declare namespace ts { None = 0, ReservedInNestedScopes = 8, Optimistic = 16, - FileLevel = 32, - AllowNameSubstitution = 64 + FileLevel = 32 } export interface Identifier extends PrimaryExpression, Declaration { readonly kind: SyntaxKind.Identifier; @@ -948,7 +942,6 @@ declare namespace ts { readonly kind: SyntaxKind.MappedType; readonly readonlyToken?: ReadonlyToken | PlusToken | MinusToken; readonly typeParameter: TypeParameterDeclaration; - readonly nameType?: TypeNode; readonly questionToken?: QuestionToken | PlusToken | MinusToken; readonly type?: TypeNode; } @@ -961,17 +954,6 @@ declare namespace ts { } export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; export type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral; - export interface TemplateLiteralTypeNode extends TypeNode { - kind: SyntaxKind.TemplateLiteralType; - readonly head: TemplateHead; - readonly templateSpans: NodeArray; - } - export interface TemplateLiteralTypeSpan extends TypeNode { - readonly kind: SyntaxKind.TemplateLiteralTypeSpan; - readonly parent: TemplateLiteralTypeNode; - readonly type: TypeNode; - readonly literal: TemplateMiddle | TemplateTail; - } export interface Expression extends Node { _expressionBrand: any; } @@ -1160,15 +1142,15 @@ declare namespace ts { export type LiteralToken = NumericLiteral | BigIntLiteral | StringLiteral | JsxText | RegularExpressionLiteral | NoSubstitutionTemplateLiteral; export interface TemplateHead extends TemplateLiteralLikeNode { readonly kind: SyntaxKind.TemplateHead; - readonly parent: TemplateExpression | TemplateLiteralTypeNode; + readonly parent: TemplateExpression; } export interface TemplateMiddle extends TemplateLiteralLikeNode { readonly kind: SyntaxKind.TemplateMiddle; - readonly parent: TemplateSpan | TemplateLiteralTypeSpan; + readonly parent: TemplateSpan; } export interface TemplateTail extends TemplateLiteralLikeNode { readonly kind: SyntaxKind.TemplateTail; - readonly parent: TemplateSpan | TemplateLiteralTypeSpan; + readonly parent: TemplateSpan; } export type PseudoLiteralToken = TemplateHead | TemplateMiddle | TemplateTail; export type TemplateLiteralToken = NoSubstitutionTemplateLiteral | PseudoLiteralToken; @@ -1700,10 +1682,6 @@ declare namespace ts { readonly kind: SyntaxKind.JSDocTypeExpression; readonly type: TypeNode; } - export interface JSDocNameReference extends Node { - readonly kind: SyntaxKind.JSDocNameReference; - readonly name: EntityName; - } export interface JSDocType extends TypeNode { _jsDocTypeBrand: any; } @@ -1802,10 +1780,6 @@ declare namespace ts { readonly constraint: JSDocTypeExpression | undefined; readonly typeParameters: NodeArray; } - export interface JSDocSeeTag extends JSDocTag { - readonly kind: SyntaxKind.JSDocSeeTag; - readonly name?: JSDocNameReference; - } export interface JSDocReturnTag extends JSDocTag { readonly kind: SyntaxKind.JSDocReturnTag; readonly typeExpression?: JSDocTypeExpression; @@ -2079,7 +2053,6 @@ declare namespace ts { * Gets a type checker that can be used to semantically analyze source files in the program. */ getTypeChecker(): TypeChecker; - getTypeCatalog(): readonly Type[]; getNodeCount(): number; getIdentifierCount(): number; getSymbolCount(): number; @@ -2186,7 +2159,7 @@ declare namespace ts { * This is necessary as an identifier in short-hand property assignment can contains two meaning: property name and property value. */ getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined; - getExportSpecifierLocalTargetSymbol(location: ExportSpecifier | Identifier): Symbol | undefined; + getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol | undefined; /** * If a symbol is a local symbol with an associated exported symbol, returns the exported symbol. * Otherwise returns its input. @@ -2207,7 +2180,6 @@ declare namespace ts { getFullyQualifiedName(symbol: Symbol): string; getAugmentedPropertiesOfType(type: Type): Symbol[]; getRootSymbols(symbol: Symbol): readonly Symbol[]; - getSymbolOfExpando(node: Node, allowDeclaration: boolean): Symbol | undefined; getContextualType(node: Expression): Type | undefined; /** * returns unknownSignature in the case of an error. @@ -2478,13 +2450,11 @@ declare namespace ts { Conditional = 16777216, Substitution = 33554432, NonPrimitive = 67108864, - TemplateLiteral = 134217728, - StringMapping = 268435456, Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, PossiblyFalsy = 117724, - StringLike = 402653316, + StringLike = 132, NumberLike = 296, BigIntLike = 2112, BooleanLike = 528, @@ -2495,10 +2465,10 @@ declare namespace ts { StructuredType = 3670016, TypeVariable = 8650752, InstantiableNonPrimitive = 58982400, - InstantiablePrimitive = 406847488, - Instantiable = 465829888, - StructuredOrInstantiable = 469499904, - Narrowable = 536624127, + InstantiablePrimitive = 4194304, + Instantiable = 63176704, + StructuredOrInstantiable = 66846720, + Narrowable = 133970943, } export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; export interface Type { @@ -2635,6 +2605,8 @@ declare namespace ts { node: ConditionalTypeNode; checkType: Type; extendsType: Type; + trueType: Type; + falseType: Type; isDistributive: boolean; inferTypeParameters?: TypeParameter[]; outerTypeParameters?: TypeParameter[]; @@ -2649,14 +2621,6 @@ declare namespace ts { resolvedTrueType: Type; resolvedFalseType: Type; } - export interface TemplateLiteralType extends InstantiableType { - texts: readonly string[]; - types: readonly Type[]; - } - export interface StringMappingType extends InstantiableType { - symbol: Symbol; - type: Type; - } export interface SubstitutionType extends InstantiableType { baseType: Type; substitute: Type; @@ -2834,7 +2798,6 @@ declare namespace ts { assumeChangesOnlyAffectDirectDependencies?: boolean; noLib?: boolean; noResolve?: boolean; - noUncheckedIndexedAccess?: boolean; out?: string; outDir?: string; outFile?: string; @@ -2845,7 +2808,6 @@ declare namespace ts { reactNamespace?: string; jsxFactory?: string; jsxFragmentFactory?: string; - jsxImportSource?: string; composite?: boolean; incremental?: boolean; tsBuildInfoFile?: string; @@ -2890,8 +2852,7 @@ declare namespace ts { enable?: boolean; include?: string[]; exclude?: string[]; - disableFilenameBasedTypeAcquisition?: boolean; - [option: string]: CompilerOptionsValue | undefined; + [option: string]: string[] | boolean | undefined; } export enum ModuleKind { None = 0, @@ -2907,9 +2868,7 @@ declare namespace ts { None = 0, Preserve = 1, React = 2, - ReactNative = 3, - ReactJSX = 4, - ReactJSXDev = 5 + ReactNative = 3 } export enum ImportsNotUsedAsValues { Remove = 0, @@ -3219,8 +3178,6 @@ declare namespace ts { updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructSignatureDeclaration; createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; - createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; - updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; createKeywordTypeNode(kind: TKind): KeywordTypeNode; createTypePredicateNode(assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode | string, type: TypeNode | undefined): TypePredicateNode; updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode; @@ -3261,12 +3218,10 @@ declare namespace ts { updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; - createMappedTypeNode(readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; - updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; + createMappedTypeNode(readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; + updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode; updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode; - createTemplateLiteralType(head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode; - updateTemplateLiteralType(node: TemplateLiteralTypeNode, head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode; createObjectBindingPattern(elements: readonly BindingElement[]): ObjectBindingPattern; updateObjectBindingPattern(node: ObjectBindingPattern, elements: readonly BindingElement[]): ObjectBindingPattern; createArrayBindingPattern(elements: readonly ArrayBindingElement[]): ArrayBindingPattern; @@ -3446,8 +3401,6 @@ declare namespace ts { updateJSDocNamepathType(node: JSDocNamepathType, type: TypeNode): JSDocNamepathType; createJSDocTypeExpression(type: TypeNode): JSDocTypeExpression; updateJSDocTypeExpression(node: JSDocTypeExpression, type: TypeNode): JSDocTypeExpression; - createJSDocNameReference(name: EntityName): JSDocNameReference; - updateJSDocNameReference(node: JSDocNameReference, name: EntityName): JSDocNameReference; createJSDocTypeLiteral(jsDocPropertyTags?: readonly JSDocPropertyLikeTag[], isArrayType?: boolean): JSDocTypeLiteral; updateJSDocTypeLiteral(node: JSDocTypeLiteral, jsDocPropertyTags: readonly JSDocPropertyLikeTag[] | undefined, isArrayType: boolean | undefined): JSDocTypeLiteral; createJSDocSignature(typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag): JSDocSignature; @@ -3462,8 +3415,6 @@ declare namespace ts { updateJSDocPropertyTag(node: JSDocPropertyTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | undefined): JSDocPropertyTag; createJSDocTypeTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocTypeTag; updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocTypeTag; - createJSDocSeeTag(tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string): JSDocSeeTag; - updateJSDocSeeTag(node: JSDocSeeTag, tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string): JSDocSeeTag; createJSDocReturnTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocReturnTag; updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocReturnTag; createJSDocThisTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocThisTag; @@ -4051,14 +4002,6 @@ declare namespace ts { function getOriginalNode(node: Node, nodeTest: (node: Node) => node is T): T; function getOriginalNode(node: Node | undefined): Node | undefined; function getOriginalNode(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined; - /** - * Iterates through the parent chain of a node and performs the callback on each parent until the callback - * returns a truthy value, then returns that value. - * If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit" - * At that point findAncestor returns undefined. - */ - function findAncestor(node: Node | undefined, callback: (element: Node) => element is T): T | undefined; - function findAncestor(node: Node | undefined, callback: (element: Node) => boolean | "quit"): Node | undefined; /** * Gets a value indicating whether a node originated in the parse tree. * @@ -4377,8 +4320,6 @@ declare namespace ts { function isMappedTypeNode(node: Node): node is MappedTypeNode; function isLiteralTypeNode(node: Node): node is LiteralTypeNode; function isImportTypeNode(node: Node): node is ImportTypeNode; - function isTemplateLiteralTypeSpan(node: Node): node is TemplateLiteralTypeSpan; - function isTemplateLiteralTypeNode(node: Node): node is TemplateLiteralTypeNode; function isObjectBindingPattern(node: Node): node is ObjectBindingPattern; function isArrayBindingPattern(node: Node): node is ArrayBindingPattern; function isBindingElement(node: Node): node is BindingElement; @@ -4483,7 +4424,6 @@ declare namespace ts { function isBundle(node: Node): node is Bundle; function isUnparsedSource(node: Node): node is UnparsedSource; function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression; - function isJSDocNameReference(node: Node): node is JSDocNameReference; function isJSDocAllType(node: Node): node is JSDocAllType; function isJSDocUnknownType(node: Node): node is JSDocUnknownType; function isJSDocNullableType(node: Node): node is JSDocNullableType; @@ -5417,10 +5357,6 @@ declare namespace ts { type WithMetadata = T & { metadata?: unknown; }; - enum SemanticClassificationFormat { - Original = "original", - TwentyTwenty = "2020" - } interface LanguageService { /** This is used as a part of restarting the language service. */ cleanupSemanticCache(): void; @@ -5472,22 +5408,10 @@ declare namespace ts { getCompilerOptionsDiagnostics(): Diagnostic[]; /** @deprecated Use getEncodedSyntacticClassifications instead. */ getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSyntacticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[]; /** @deprecated Use getEncodedSemanticClassifications instead. */ getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSemanticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[]; - /** Encoded as triples of [start, length, ClassificationType]. */ getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications; - /** - * Gets semantic highlights information for a particular file. Has two formats, an older - * version used by VS and a format used by VS Code. - * - * @param fileName The path to the file - * @param position A text span to return results within - * @param format Which format to use, defaults to "original" - * @returns a number array encoded as triples of [start, length, ClassificationType, ...]. - */ - getEncodedSemanticClassifications(fileName: string, span: TextSpan, format?: SemanticClassificationFormat): Classifications; + getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications; /** * Gets completion entries at a particular position in a file. * @@ -5646,10 +5570,6 @@ declare namespace ts { textSpan: TextSpan; classificationType: ClassificationTypeNames; } - interface ClassifiedSpan2020 { - textSpan: TextSpan; - classificationType: number; - } /** * Navigation bar interface designed for visual studio's dual-column layout. * This does not form a proper tree. @@ -6046,12 +5966,6 @@ declare namespace ts { /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; - /** - * In the absence of `CompletionEntry["replacementSpan"], the editor may choose whether to use - * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span - * must be used to commit that completion entry. - */ - optionalReplacementSpan?: TextSpan; /** * true when the current location also allows for a new identifier */ @@ -6595,9 +6509,9 @@ declare namespace ts { /** @deprecated Use `factory.updateIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */ const updateIndexedAccessTypeNode: (node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode; /** @deprecated Use `factory.createMappedTypeNode` or the factory supplied by your transformation context instead. */ - const createMappedTypeNode: (readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; + const createMappedTypeNode: (readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; /** @deprecated Use `factory.updateMappedTypeNode` or the factory supplied by your transformation context instead. */ - const updateMappedTypeNode: (node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; + const updateMappedTypeNode: (node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; /** @deprecated Use `factory.createLiteralTypeNode` or the factory supplied by your transformation context instead. */ const createLiteralTypeNode: (literal: LiteralExpression | TrueLiteral | FalseLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode; /** @deprecated Use `factory.updateLiteralTypeNode` or the factory supplied by your transformation context instead. */ diff --git a/node_modules/typescript/lib/typescript.js b/node_modules/typescript/lib/typescript.js index ea89c6a..70d7dd8 100644 --- a/node_modules/typescript/lib/typescript.js +++ b/node_modules/typescript/lib/typescript.js @@ -286,9 +286,9 @@ var ts; (function (ts) { // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configurePrerelease` too. - ts.versionMajorMinor = "4.1"; + ts.versionMajorMinor = "4.0"; /** The version of the TypeScript compiler release */ - ts.version = "4.1.3"; + ts.version = "4.0.2"; /* @internal */ var Comparison; (function (Comparison) { @@ -1381,7 +1381,7 @@ var ts; var high = array.length - 1; while (low <= high) { var middle = low + ((high - low) >> 1); - var midKey = keySelector(array[middle], middle); + var midKey = keySelector(array[middle]); switch (keyComparer(midKey, key)) { case -1 /* LessThan */: low = middle + 1; @@ -1476,14 +1476,15 @@ var ts; return values; } ts.getOwnValues = getOwnValues; - var _entries = Object.entries || (function (obj) { + var _entries = Object.entries ? Object.entries : function (obj) { var keys = getOwnKeys(obj); var result = Array(keys.length); - for (var i = 0; i < keys.length; i++) { - result[i] = [keys[i], obj[keys[i]]]; + for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { + var key = keys_1[_i]; + result.push([key, obj[key]]); } return result; - }); + }; function getEntries(obj) { return obj ? _entries(obj) : []; } @@ -2355,39 +2356,20 @@ var ts; } } } - /** - * Returns string left-padded with spaces or zeros until it reaches the given length. - * - * @param s String to pad. - * @param length Final padded length. If less than or equal to 's.length', returns 's' unchanged. - * @param padString Character to use as padding (default " "). - */ - function padLeft(s, length, padString) { - if (padString === void 0) { padString = " "; } - return length <= s.length ? s : padString.repeat(length - s.length) + s; + function padLeft(s, length) { + while (s.length < length) { + s = " " + s; + } + return s; } ts.padLeft = padLeft; - /** - * Returns string right-padded with spaces until it reaches the given length. - * - * @param s String to pad. - * @param length Final padded length. If less than or equal to 's.length', returns 's' unchanged. - * @param padString Character to use as padding (default " "). - */ - function padRight(s, length, padString) { - if (padString === void 0) { padString = " "; } - return length <= s.length ? s : s + padString.repeat(length - s.length); + function padRight(s, length) { + while (s.length < length) { + s = s + " "; + } + return s; } ts.padRight = padRight; - function takeWhile(array, predicate) { - var len = array.length; - var index = 0; - while (index < len && predicate(array[index])) { - index++; - } - return array.slice(0, index); - } - ts.takeWhile = takeWhile; })(ts || (ts = {})); /* @internal */ var ts; @@ -2702,10 +2684,6 @@ var ts; return formatEnum(flags, ts.ObjectFlags, /*isFlags*/ true); } Debug.formatObjectFlags = formatObjectFlags; - function formatFlowFlags(flags) { - return formatEnum(flags, ts.FlowFlags, /*isFlags*/ true); - } - Debug.formatFlowFlags = formatFlowFlags; var isDebugInfoEnabled = false; var extendedDebugModule; function extendedDebug() { @@ -2723,167 +2701,31 @@ var ts; return extendedDebug().formatControlFlowGraph(flowNode); } Debug.formatControlFlowGraph = formatControlFlowGraph; - var flowNodeProto; - function attachFlowNodeDebugInfoWorker(flowNode) { - if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line no-in-operator - Object.defineProperties(flowNode, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var flowHeader = this.flags & 2 /* Start */ ? "FlowStart" : - this.flags & 4 /* BranchLabel */ ? "FlowBranchLabel" : - this.flags & 8 /* LoopLabel */ ? "FlowLoopLabel" : - this.flags & 16 /* Assignment */ ? "FlowAssignment" : - this.flags & 32 /* TrueCondition */ ? "FlowTrueCondition" : - this.flags & 64 /* FalseCondition */ ? "FlowFalseCondition" : - this.flags & 128 /* SwitchClause */ ? "FlowSwitchClause" : - this.flags & 256 /* ArrayMutation */ ? "FlowArrayMutation" : - this.flags & 512 /* Call */ ? "FlowCall" : - this.flags & 1024 /* ReduceLabel */ ? "FlowReduceLabel" : - this.flags & 1 /* Unreachable */ ? "FlowUnreachable" : - "UnknownFlow"; - var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1); - return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : ""); - } - }, - __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } }, - __debugToString: { value: function () { return formatControlFlowGraph(this); } } - }); - } - } function attachFlowNodeDebugInfo(flowNode) { if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - // if we're in es2015, attach the method to a shared prototype for `FlowNode` - // so the method doesn't show up in the watch window. - if (!flowNodeProto) { - flowNodeProto = Object.create(Object.prototype); - attachFlowNodeDebugInfoWorker(flowNodeProto); - } - Object.setPrototypeOf(flowNode, flowNodeProto); - } - else { - // not running in an es2015 environment, attach the method directly. - attachFlowNodeDebugInfoWorker(flowNode); + if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line no-in-operator + Object.defineProperties(flowNode, { + __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } }, + __debugToString: { value: function () { return formatControlFlowGraph(this); } } + }); } } } Debug.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo; - var nodeArrayProto; - function attachNodeArrayDebugInfoWorker(array) { - if (!("__tsDebuggerDisplay" in array)) { // eslint-disable-line no-in-operator - Object.defineProperties(array, { - __tsDebuggerDisplay: { - value: function (defaultValue) { - // An `Array` with extra properties is rendered as `[A, B, prop1: 1, prop2: 2]`. Most of - // these aren't immediately useful so we trim off the `prop1: ..., prop2: ...` part from the - // formatted string. - defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]"); - return "NodeArray " + defaultValue; - } - } - }); - } - } - function attachNodeArrayDebugInfo(array) { - if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - // if we're in es2015, attach the method to a shared prototype for `NodeArray` - // so the method doesn't show up in the watch window. - if (!nodeArrayProto) { - nodeArrayProto = Object.create(Array.prototype); - attachNodeArrayDebugInfoWorker(nodeArrayProto); - } - Object.setPrototypeOf(array, nodeArrayProto); - } - else { - // not running in an es2015 environment, attach the method directly. - attachNodeArrayDebugInfoWorker(array); - } - } - } - Debug.attachNodeArrayDebugInfo = attachNodeArrayDebugInfo; /** * Injects debug information into frequently used types. */ function enableDebugInfo() { if (isDebugInfoEnabled) return; - // avoid recomputing - var weakTypeTextMap; - var weakNodeTextMap; - function getWeakTypeTextMap() { - if (weakTypeTextMap === undefined) { - if (typeof WeakMap === "function") - weakTypeTextMap = new WeakMap(); - } - return weakTypeTextMap; - } - function getWeakNodeTextMap() { - if (weakNodeTextMap === undefined) { - if (typeof WeakMap === "function") - weakNodeTextMap = new WeakMap(); - } - return weakNodeTextMap; - } // Add additional properties in debug mode to assist with debugging. Object.defineProperties(ts.objectAllocator.getSymbolConstructor().prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" : - "Symbol"; - var remainingSymbolFlags = this.flags & ~33554432 /* Transient */; - return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : ""); - } - }, __debugFlags: { get: function () { return formatSymbolFlags(this.flags); } } }); Object.defineProperties(ts.objectAllocator.getTypeConstructor().prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" : - this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType " + JSON.stringify(this.value) : - this.flags & 2048 /* BigIntLiteral */ ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" : - this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : - this.flags & 32 /* Enum */ ? "EnumType" : - this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType " + this.intrinsicName : - this.flags & 1048576 /* Union */ ? "UnionType" : - this.flags & 2097152 /* Intersection */ ? "IntersectionType" : - this.flags & 4194304 /* Index */ ? "IndexType" : - this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : - this.flags & 16777216 /* Conditional */ ? "ConditionalType" : - this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : - this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : - this.flags & 524288 /* Object */ ? - this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : - this.objectFlags & 4 /* Reference */ ? "TypeReference" : - this.objectFlags & 8 /* Tuple */ ? "TupleType" : - this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : - this.objectFlags & 32 /* Mapped */ ? "MappedType" : - this.objectFlags & 2048 /* ReverseMapped */ ? "ReverseMappedType" : - this.objectFlags & 256 /* EvolvingArray */ ? "EvolvingArrayType" : - "ObjectType" : - "Type"; - var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~2367 /* ObjectTypeKindMask */ : 0; - return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : ""); - } - }, __debugFlags: { get: function () { return formatTypeFlags(this.flags); } }, __debugObjectFlags: { get: function () { return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : ""; } }, - __debugTypeToString: { - value: function () { - // avoid recomputing - var map = getWeakTypeTextMap(); - var text = map === null || map === void 0 ? void 0 : map.get(this); - if (text === undefined) { - text = this.checker.typeToString(this); - map === null || map === void 0 ? void 0 : map.set(this, text); - } - return text; - } - }, + __debugTypeToString: { value: function () { return this.checker.typeToString(this); } }, }); var nodeConstructors = [ ts.objectAllocator.getNodeConstructor(), @@ -2895,49 +2737,6 @@ var ts; var ctor = nodeConstructors_1[_i]; if (!ctor.prototype.hasOwnProperty("__debugKind")) { Object.defineProperties(ctor.prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" : - ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" : - ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" : - ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") : - ts.isNumericLiteral(this) ? "NumericLiteral " + this.text : - ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" : - ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" : - ts.isParameter(this) ? "ParameterDeclaration" : - ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" : - ts.isGetAccessorDeclaration(this) ? "GetAccessorDeclaration" : - ts.isSetAccessorDeclaration(this) ? "SetAccessorDeclaration" : - ts.isCallSignatureDeclaration(this) ? "CallSignatureDeclaration" : - ts.isConstructSignatureDeclaration(this) ? "ConstructSignatureDeclaration" : - ts.isIndexSignatureDeclaration(this) ? "IndexSignatureDeclaration" : - ts.isTypePredicateNode(this) ? "TypePredicateNode" : - ts.isTypeReferenceNode(this) ? "TypeReferenceNode" : - ts.isFunctionTypeNode(this) ? "FunctionTypeNode" : - ts.isConstructorTypeNode(this) ? "ConstructorTypeNode" : - ts.isTypeQueryNode(this) ? "TypeQueryNode" : - ts.isTypeLiteralNode(this) ? "TypeLiteralNode" : - ts.isArrayTypeNode(this) ? "ArrayTypeNode" : - ts.isTupleTypeNode(this) ? "TupleTypeNode" : - ts.isOptionalTypeNode(this) ? "OptionalTypeNode" : - ts.isRestTypeNode(this) ? "RestTypeNode" : - ts.isUnionTypeNode(this) ? "UnionTypeNode" : - ts.isIntersectionTypeNode(this) ? "IntersectionTypeNode" : - ts.isConditionalTypeNode(this) ? "ConditionalTypeNode" : - ts.isInferTypeNode(this) ? "InferTypeNode" : - ts.isParenthesizedTypeNode(this) ? "ParenthesizedTypeNode" : - ts.isThisTypeNode(this) ? "ThisTypeNode" : - ts.isTypeOperatorNode(this) ? "TypeOperatorNode" : - ts.isIndexedAccessTypeNode(this) ? "IndexedAccessTypeNode" : - ts.isMappedTypeNode(this) ? "MappedTypeNode" : - ts.isLiteralTypeNode(this) ? "LiteralTypeNode" : - ts.isNamedTupleMember(this) ? "NamedTupleMember" : - ts.isImportTypeNode(this) ? "ImportTypeNode" : - formatSyntaxKind(this.kind); - return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : ""); - } - }, __debugKind: { get: function () { return formatSyntaxKind(this.kind); } }, __debugNodeFlags: { get: function () { return formatNodeFlags(this.flags); } }, __debugModifierFlags: { get: function () { return formatModifierFlags(ts.getEffectiveModifierFlagsNoCache(this)); } }, @@ -2948,16 +2747,9 @@ var ts; value: function (includeTrivia) { if (ts.nodeIsSynthesized(this)) return ""; - // avoid recomputing - var map = getWeakNodeTextMap(); - var text = map === null || map === void 0 ? void 0 : map.get(this); - if (text === undefined) { - var parseNode = ts.getParseTreeNode(this); - var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); - text = sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; - map === null || map === void 0 ? void 0 : map.set(this, text); - } - return text; + var parseNode = ts.getParseTreeNode(this); + var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); + return sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; } } }); @@ -3029,6 +2821,168 @@ var ts; Debug.deprecate = deprecate; })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); +/*@internal*/ +var ts; +(function (ts) { + /** Gets a timestamp with (at least) ms resolution */ + ts.timestamp = typeof performance !== "undefined" && performance.now ? function () { return performance.now(); } : Date.now ? Date.now : function () { return +(new Date()); }; +})(ts || (ts = {})); +/*@internal*/ +/** Performance measurements for the compiler. */ +var ts; +(function (ts) { + var performance; + (function (performance) { + // NOTE: cannot use ts.noop as core.ts loads after this + var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : function () { }; + var enabled = false; + var profilerStart = 0; + var counts; + var marks; + var measures; + function createTimerIf(condition, measureName, startMarkName, endMarkName) { + return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer; + } + performance.createTimerIf = createTimerIf; + function createTimer(measureName, startMarkName, endMarkName) { + var enterCount = 0; + return { + enter: enter, + exit: exit + }; + function enter() { + if (++enterCount === 1) { + mark(startMarkName); + } + } + function exit() { + if (--enterCount === 0) { + mark(endMarkName); + measure(measureName, startMarkName, endMarkName); + } + else if (enterCount < 0) { + ts.Debug.fail("enter/exit count does not match."); + } + } + } + performance.createTimer = createTimer; + performance.nullTimer = { enter: ts.noop, exit: ts.noop }; + /** + * Marks a performance event. + * + * @param markName The name of the mark. + */ + function mark(markName) { + if (enabled) { + marks.set(markName, ts.timestamp()); + counts.set(markName, (counts.get(markName) || 0) + 1); + profilerEvent(markName); + } + } + performance.mark = mark; + /** + * Adds a performance measurement with the specified name. + * + * @param measureName The name of the performance measurement. + * @param startMarkName The name of the starting mark. If not supplied, the point at which the + * profiler was enabled is used. + * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is + * used. + */ + function measure(measureName, startMarkName, endMarkName) { + if (enabled) { + var end = endMarkName && marks.get(endMarkName) || ts.timestamp(); + var start = startMarkName && marks.get(startMarkName) || profilerStart; + measures.set(measureName, (measures.get(measureName) || 0) + (end - start)); + } + } + performance.measure = measure; + /** + * Gets the number of times a marker was encountered. + * + * @param markName The name of the mark. + */ + function getCount(markName) { + return counts && counts.get(markName) || 0; + } + performance.getCount = getCount; + /** + * Gets the total duration of all measurements with the supplied name. + * + * @param measureName The name of the measure whose durations should be accumulated. + */ + function getDuration(measureName) { + return measures && measures.get(measureName) || 0; + } + performance.getDuration = getDuration; + /** + * Iterate over each measure, performing some action + * + * @param cb The action to perform for each measure + */ + function forEachMeasure(cb) { + measures.forEach(function (measure, key) { + cb(key, measure); + }); + } + performance.forEachMeasure = forEachMeasure; + /** Enables (and resets) performance measurements for the compiler. */ + function enable() { + counts = new ts.Map(); + marks = new ts.Map(); + measures = new ts.Map(); + enabled = true; + profilerStart = ts.timestamp(); + } + performance.enable = enable; + /** Disables performance measurements for the compiler. */ + function disable() { + enabled = false; + } + performance.disable = disable; + })(performance = ts.performance || (ts.performance = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var _a; + var nullLogger = { + logEvent: ts.noop, + logErrEvent: ts.noop, + logPerfEvent: ts.noop, + logInfoEvent: ts.noop, + logStartCommand: ts.noop, + logStopCommand: ts.noop, + logStartUpdateProgram: ts.noop, + logStopUpdateProgram: ts.noop, + logStartUpdateGraph: ts.noop, + logStopUpdateGraph: ts.noop, + logStartResolveModule: ts.noop, + logStopResolveModule: ts.noop, + logStartParseSourceFile: ts.noop, + logStopParseSourceFile: ts.noop, + logStartReadFile: ts.noop, + logStopReadFile: ts.noop, + logStartBindFile: ts.noop, + logStopBindFile: ts.noop, + logStartScheduledOperation: ts.noop, + logStopScheduledOperation: ts.noop, + }; + // Load optional module to enable Event Tracing for Windows + // See https://github.com/microsoft/typescript-etw for more information + var etwModule; + try { + var etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) !== null && _a !== void 0 ? _a : "./node_modules/@microsoft/typescript-etw"; + // require() will throw an exception if the module is not found + // It may also return undefined if not installed properly + etwModule = require(etwModulePath); + } + catch (e) { + etwModule = undefined; + } + /** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */ + ts.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; +})(ts || (ts = {})); /* @internal */ var ts; (function (ts) { @@ -3105,7 +3059,7 @@ var ts; return ts.compareValues(this.major, other.major) || ts.compareValues(this.minor, other.minor) || ts.compareValues(this.patch, other.patch) - || comparePrereleaseIdentifiers(this.prerelease, other.prerelease); + || comparePrerelaseIdentifiers(this.prerelease, other.prerelease); }; Version.prototype.increment = function (field) { switch (field) { @@ -3144,7 +3098,7 @@ var ts; build: build }; } - function comparePrereleaseIdentifiers(left, right) { + function comparePrerelaseIdentifiers(left, right) { // https://semver.org/#spec-item-11 // > When major, minor, and patch are equal, a pre-release version has lower precedence // > than a normal version. @@ -3389,485 +3343,6 @@ var ts; return "" + comparator.operator + comparator.operand; } })(ts || (ts = {})); -/*@internal*/ -var ts; -(function (ts) { - // The following definitions provide the minimum compatible support for the Web Performance User Timings API - // between browsers and NodeJS: - // eslint-disable-next-line @typescript-eslint/naming-convention - function hasRequiredAPI(performance, PerformanceObserver) { - return typeof performance === "object" && - typeof performance.timeOrigin === "number" && - typeof performance.mark === "function" && - typeof performance.measure === "function" && - typeof performance.now === "function" && - typeof PerformanceObserver === "function"; - } - function tryGetWebPerformanceHooks() { - if (typeof performance === "object" && - typeof PerformanceObserver === "function" && - hasRequiredAPI(performance, PerformanceObserver)) { - return { - performance: performance, - PerformanceObserver: PerformanceObserver - }; - } - } - function tryGetNodePerformanceHooks() { - if (typeof module === "object" && typeof require === "function") { - try { - var _a = require("perf_hooks"), performance_1 = _a.performance, PerformanceObserver_1 = _a.PerformanceObserver; - if (hasRequiredAPI(performance_1, PerformanceObserver_1)) { - // There is a bug in Node's performance.measure prior to 12.16.3/13.13.0 that does not - // match the Web Performance API specification. Node's implementation did not allow - // optional `start` and `end` arguments for `performance.measure`. - // See https://github.com/nodejs/node/pull/32651 for more information. - var version_1 = new ts.Version(process.versions.node); - var range = new ts.VersionRange("<12.16.3 || 13 <13.13"); - if (range.test(version_1)) { - return { - performance: { - get timeOrigin() { return performance_1.timeOrigin; }, - now: function () { return performance_1.now(); }, - mark: function (name) { return performance_1.mark(name); }, - measure: function (name, start, end) { - if (start === void 0) { start = "nodeStart"; } - if (end === undefined) { - end = "__performance.measure-fix__"; - performance_1.mark(end); - } - performance_1.measure(name, start, end); - if (end === "__performance.measure-fix__") { - performance_1.clearMarks("__performance.measure-fix__"); - } - } - }, - PerformanceObserver: PerformanceObserver_1 - }; - } - return { - performance: performance_1, - PerformanceObserver: PerformanceObserver_1 - }; - } - } - catch (_b) { - // ignore errors - } - } - } - // Unlike with the native Map/Set 'tryGet' functions in corePublic.ts, we eagerly evaluate these - // since we will need them for `timestamp`, below. - var nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks(); - var nativePerformance = nativePerformanceHooks === null || nativePerformanceHooks === void 0 ? void 0 : nativePerformanceHooks.performance; - function tryGetNativePerformanceHooks() { - return nativePerformanceHooks; - } - ts.tryGetNativePerformanceHooks = tryGetNativePerformanceHooks; - /** Gets a timestamp with (at least) ms resolution */ - ts.timestamp = nativePerformance ? function () { return nativePerformance.now(); } : - Date.now ? Date.now : - function () { return +(new Date()); }; -})(ts || (ts = {})); -/*@internal*/ -/** Performance measurements for the compiler. */ -var ts; -(function (ts) { - var performance; - (function (performance) { - var perfHooks; - var perfObserver; - // when set, indicates the implementation of `Performance` to use for user timing. - // when unset, indicates user timing is unavailable or disabled. - var performanceImpl; - function createTimerIf(condition, measureName, startMarkName, endMarkName) { - return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer; - } - performance.createTimerIf = createTimerIf; - function createTimer(measureName, startMarkName, endMarkName) { - var enterCount = 0; - return { - enter: enter, - exit: exit - }; - function enter() { - if (++enterCount === 1) { - mark(startMarkName); - } - } - function exit() { - if (--enterCount === 0) { - mark(endMarkName); - measure(measureName, startMarkName, endMarkName); - } - else if (enterCount < 0) { - ts.Debug.fail("enter/exit count does not match."); - } - } - } - performance.createTimer = createTimer; - performance.nullTimer = { enter: ts.noop, exit: ts.noop }; - var counts = new ts.Map(); - var durations = new ts.Map(); - /** - * Marks a performance event. - * - * @param markName The name of the mark. - */ - function mark(markName) { - performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.mark(markName); - } - performance.mark = mark; - /** - * Adds a performance measurement with the specified name. - * - * @param measureName The name of the performance measurement. - * @param startMarkName The name of the starting mark. If not supplied, the point at which the - * profiler was enabled is used. - * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is - * used. - */ - function measure(measureName, startMarkName, endMarkName) { - performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName); - } - performance.measure = measure; - /** - * Gets the number of times a marker was encountered. - * - * @param markName The name of the mark. - */ - function getCount(markName) { - return counts.get(markName) || 0; - } - performance.getCount = getCount; - /** - * Gets the total duration of all measurements with the supplied name. - * - * @param measureName The name of the measure whose durations should be accumulated. - */ - function getDuration(measureName) { - return durations.get(measureName) || 0; - } - performance.getDuration = getDuration; - /** - * Iterate over each measure, performing some action - * - * @param cb The action to perform for each measure - */ - function forEachMeasure(cb) { - durations.forEach(function (duration, measureName) { return cb(measureName, duration); }); - } - performance.forEachMeasure = forEachMeasure; - /** - * Indicates whether the performance API is enabled. - */ - function isEnabled() { - return !!performanceImpl; - } - performance.isEnabled = isEnabled; - /** Enables (and resets) performance measurements for the compiler. */ - function enable() { - if (!performanceImpl) { - perfHooks || (perfHooks = ts.tryGetNativePerformanceHooks()); - if (!perfHooks) - return false; - perfObserver || (perfObserver = new perfHooks.PerformanceObserver(updateStatisticsFromList)); - perfObserver.observe({ entryTypes: ["mark", "measure"] }); - performanceImpl = perfHooks.performance; - } - return true; - } - performance.enable = enable; - /** Disables performance measurements for the compiler. */ - function disable() { - perfObserver === null || perfObserver === void 0 ? void 0 : perfObserver.disconnect(); - performanceImpl = undefined; - counts.clear(); - durations.clear(); - } - performance.disable = disable; - function updateStatisticsFromList(list) { - for (var _i = 0, _a = list.getEntriesByType("mark"); _i < _a.length; _i++) { - var mark_1 = _a[_i]; - counts.set(mark_1.name, (counts.get(mark_1.name) || 0) + 1); - } - for (var _b = 0, _c = list.getEntriesByType("measure"); _b < _c.length; _b++) { - var measure_1 = _c[_b]; - durations.set(measure_1.name, (durations.get(measure_1.name) || 0) + measure_1.duration); - } - } - })(performance = ts.performance || (ts.performance = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var _a; - var nullLogger = { - logEvent: ts.noop, - logErrEvent: ts.noop, - logPerfEvent: ts.noop, - logInfoEvent: ts.noop, - logStartCommand: ts.noop, - logStopCommand: ts.noop, - logStartUpdateProgram: ts.noop, - logStopUpdateProgram: ts.noop, - logStartUpdateGraph: ts.noop, - logStopUpdateGraph: ts.noop, - logStartResolveModule: ts.noop, - logStopResolveModule: ts.noop, - logStartParseSourceFile: ts.noop, - logStopParseSourceFile: ts.noop, - logStartReadFile: ts.noop, - logStopReadFile: ts.noop, - logStartBindFile: ts.noop, - logStopBindFile: ts.noop, - logStartScheduledOperation: ts.noop, - logStopScheduledOperation: ts.noop, - }; - // Load optional module to enable Event Tracing for Windows - // See https://github.com/microsoft/typescript-etw for more information - var etwModule; - try { - var etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) !== null && _a !== void 0 ? _a : "./node_modules/@microsoft/typescript-etw"; - // require() will throw an exception if the module is not found - // It may also return undefined if not installed properly - etwModule = require(etwModulePath); - } - catch (e) { - etwModule = undefined; - } - /** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */ - ts.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; -})(ts || (ts = {})); -/*@internal*/ -/** Tracing events for the compiler. */ -var ts; -(function (ts) { - var tracing; - (function (tracing) { - var fs; - var traceCount = 0; - var traceFd; - var legendPath; - var legend = []; - /** Starts tracing for the given project (unless the `fs` module is unavailable). */ - function startTracing(configFilePath, traceDir, isBuildMode) { - ts.Debug.assert(!traceFd, "Tracing already started"); - if (fs === undefined) { - try { - fs = require("fs"); - } - catch (_a) { - fs = false; - } - } - if (!fs) { - return; - } - if (legendPath === undefined) { - legendPath = ts.combinePaths(traceDir, "legend.json"); - } - // Note that writing will fail later on if it exists and is not a directory - if (!fs.existsSync(traceDir)) { - fs.mkdirSync(traceDir, { recursive: true }); - } - var countPart = isBuildMode ? "." + ++traceCount : ""; - var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json"); - var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json"); - legend.push({ - configFilePath: configFilePath, - tracePath: tracePath, - typesPath: typesPath, - }); - traceFd = fs.openSync(tracePath, "w"); - // Start with a prefix that contains some metadata that the devtools profiler expects (also avoids a warning on import) - var meta = { cat: "__metadata", ph: "M", ts: 1000 * ts.timestamp(), pid: 1, tid: 1 }; - fs.writeSync(traceFd, "[\n" - + [__assign({ name: "process_name", args: { name: "tsc" } }, meta), __assign({ name: "thread_name", args: { name: "Main" } }, meta), __assign(__assign({ name: "TracingStartedInBrowser" }, meta), { cat: "disabled-by-default-devtools.timeline" })] - .map(function (v) { return JSON.stringify(v); }).join(",\n")); - } - tracing.startTracing = startTracing; - /** Stops tracing for the in-progress project and dumps the type catalog (unless the `fs` module is unavailable). */ - function stopTracing(typeCatalog) { - if (!traceFd) { - ts.Debug.assert(!fs, "Tracing is not in progress"); - return; - } - ts.Debug.assert(fs); - fs.writeSync(traceFd, "\n]\n"); - fs.closeSync(traceFd); - traceFd = undefined; - if (typeCatalog) { - dumpTypes(typeCatalog); - } - else { - // We pre-computed this path for convenience, but clear it - // now that the file won't be created. - legend[legend.length - 1].typesPath = undefined; - } - } - tracing.stopTracing = stopTracing; - function isTracing() { - return !!traceFd; - } - tracing.isTracing = isTracing; - var Phase; - (function (Phase) { - Phase["Parse"] = "parse"; - Phase["Program"] = "program"; - Phase["Bind"] = "bind"; - Phase["Check"] = "check"; - Phase["Emit"] = "emit"; - })(Phase = tracing.Phase || (tracing.Phase = {})); - /** Note: `push`/`pop` should be used by default. - * `begin`/`end` are for special cases where we need the data point even if the event never - * terminates (typically for reducing a scenario too big to trace to one that can be completed). - * In the future we might implement an exit handler to dump unfinished events which would - * deprecate these operations. - */ - function begin(phase, name, args) { - if (!traceFd) - return; - writeEvent("B", phase, name, args); - } - tracing.begin = begin; - function end(phase, name, args) { - if (!traceFd) - return; - writeEvent("E", phase, name, args); - } - tracing.end = end; - function instant(phase, name, args) { - if (!traceFd) - return; - writeEvent("I", phase, name, args, "\"s\":\"g\""); - } - tracing.instant = instant; - // Used for "Complete" (ph:"X") events - var completeEvents = []; - function push(phase, name, args) { - if (!traceFd) - return; - completeEvents.push({ phase: phase, name: name, args: args, time: 1000 * ts.timestamp() }); - } - tracing.push = push; - function pop() { - if (!traceFd) - return; - ts.Debug.assert(completeEvents.length > 0); - var _a = completeEvents.pop(), phase = _a.phase, name = _a.name, args = _a.args, time = _a.time; - var dur = 1000 * ts.timestamp() - time; - writeEvent("X", phase, name, args, "\"dur\":" + dur, time); - } - tracing.pop = pop; - function writeEvent(eventType, phase, name, args, extras, time) { - if (time === void 0) { time = 1000 * ts.timestamp(); } - ts.Debug.assert(traceFd); - ts.Debug.assert(fs); - ts.performance.mark("beginTracing"); - fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\""); - if (extras) - fs.writeSync(traceFd, "," + extras); - if (args) - fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args)); - fs.writeSync(traceFd, "}"); - ts.performance.mark("endTracing"); - ts.performance.measure("Tracing", "beginTracing", "endTracing"); - } - function indexFromOne(lc) { - return { - line: lc.line + 1, - character: lc.character + 1, - }; - } - function dumpTypes(types) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r; - ts.Debug.assert(fs); - ts.performance.mark("beginDumpTypes"); - var typesPath = legend[legend.length - 1].typesPath; - var typesFd = fs.openSync(typesPath, "w"); - var recursionIdentityMap = new ts.Map(); - // Cleverness: no line break here so that the type ID will match the line number - fs.writeSync(typesFd, "["); - var numTypes = types.length; - for (var i = 0; i < numTypes; i++) { - var type = types[i]; - var objectFlags = type.objectFlags; - var symbol = (_a = type.aliasSymbol) !== null && _a !== void 0 ? _a : type.symbol; - var firstDeclaration = (_b = symbol === null || symbol === void 0 ? void 0 : symbol.declarations) === null || _b === void 0 ? void 0 : _b[0]; - var firstFile = firstDeclaration && ts.getSourceFileOfNode(firstDeclaration); - // It's slow to compute the display text, so skip it unless it's really valuable (or cheap) - var display = void 0; - if ((objectFlags & 16 /* Anonymous */) | (type.flags & 2944 /* Literal */)) { - try { - display = (_c = type.checker) === null || _c === void 0 ? void 0 : _c.typeToString(type); - } - catch (_s) { - display = undefined; - } - } - var indexedAccessProperties = {}; - if (type.flags & 8388608 /* IndexedAccess */) { - var indexedAccessType = type; - indexedAccessProperties = { - indexedAccessObjectType: (_d = indexedAccessType.objectType) === null || _d === void 0 ? void 0 : _d.id, - indexedAccessIndexType: (_e = indexedAccessType.indexType) === null || _e === void 0 ? void 0 : _e.id, - }; - } - var referenceProperties = {}; - if (objectFlags & 4 /* Reference */) { - var referenceType = type; - referenceProperties = { - instantiatedType: (_f = referenceType.target) === null || _f === void 0 ? void 0 : _f.id, - typeArguments: (_g = referenceType.resolvedTypeArguments) === null || _g === void 0 ? void 0 : _g.map(function (t) { return t.id; }), - }; - } - var conditionalProperties = {}; - if (type.flags & 16777216 /* Conditional */) { - var conditionalType = type; - conditionalProperties = { - conditionalCheckType: (_h = conditionalType.checkType) === null || _h === void 0 ? void 0 : _h.id, - conditionalExtendsType: (_j = conditionalType.extendsType) === null || _j === void 0 ? void 0 : _j.id, - conditionalTrueType: (_l = (_k = conditionalType.resolvedTrueType) === null || _k === void 0 ? void 0 : _k.id) !== null && _l !== void 0 ? _l : -1, - conditionalFalseType: (_o = (_m = conditionalType.resolvedFalseType) === null || _m === void 0 ? void 0 : _m.id) !== null && _o !== void 0 ? _o : -1, - }; - } - // We can't print out an arbitrary object, so just assign each one a unique number. - // Don't call it an "id" so people don't treat it as a type id. - var recursionToken = void 0; - var recursionIdentity = type.checker.getRecursionIdentity(type); - if (recursionIdentity) { - recursionToken = recursionIdentityMap.get(recursionIdentity); - if (!recursionToken) { - recursionToken = recursionIdentityMap.size; - recursionIdentityMap.set(recursionIdentity, recursionToken); - } - } - var descriptor = __assign(__assign(__assign(__assign({ id: type.id, intrinsicName: type.intrinsicName, symbolName: (symbol === null || symbol === void 0 ? void 0 : symbol.escapedName) && ts.unescapeLeadingUnderscores(symbol.escapedName), recursionId: recursionToken, unionTypes: (type.flags & 1048576 /* Union */) ? (_p = type.types) === null || _p === void 0 ? void 0 : _p.map(function (t) { return t.id; }) : undefined, intersectionTypes: (type.flags & 2097152 /* Intersection */) ? type.types.map(function (t) { return t.id; }) : undefined, aliasTypeArguments: (_q = type.aliasTypeArguments) === null || _q === void 0 ? void 0 : _q.map(function (t) { return t.id; }), keyofType: (type.flags & 4194304 /* Index */) ? (_r = type.type) === null || _r === void 0 ? void 0 : _r.id : undefined }, indexedAccessProperties), referenceProperties), conditionalProperties), { firstDeclaration: firstDeclaration && { - path: firstFile.path, - start: indexFromOne(ts.getLineAndCharacterOfPosition(firstFile, firstDeclaration.pos)), - end: indexFromOne(ts.getLineAndCharacterOfPosition(ts.getSourceFileOfNode(firstDeclaration), firstDeclaration.end)), - }, flags: ts.Debug.formatTypeFlags(type.flags).split("|"), display: display }); - fs.writeSync(typesFd, JSON.stringify(descriptor)); - if (i < numTypes - 1) { - fs.writeSync(typesFd, ",\n"); - } - } - fs.writeSync(typesFd, "]\n"); - fs.closeSync(typesFd); - ts.performance.mark("endDumpTypes"); - ts.performance.measure("Dump types", "beginDumpTypes", "endDumpTypes"); - } - function dumpLegend() { - if (!legendPath) { - return; - } - ts.Debug.assert(fs); - fs.writeFileSync(legendPath, JSON.stringify(legend)); - } - tracing.dumpLegend = dumpLegend; - })(tracing = ts.tracing || (ts.tracing = {})); -})(ts || (ts = {})); var ts; (function (ts) { // token > SyntaxKind.Identifier => token is a keyword @@ -4022,235 +3497,230 @@ var ts; SyntaxKind[SyntaxKind["DeclareKeyword"] = 133] = "DeclareKeyword"; SyntaxKind[SyntaxKind["GetKeyword"] = 134] = "GetKeyword"; SyntaxKind[SyntaxKind["InferKeyword"] = 135] = "InferKeyword"; - SyntaxKind[SyntaxKind["IntrinsicKeyword"] = 136] = "IntrinsicKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 137] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 138] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 139] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 140] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 141] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 142] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 143] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 144] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 145] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 146] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 147] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 148] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 149] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 150] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 151] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 152] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 153] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 154] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 155] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 156] = "OfKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 136] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 137] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 138] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 139] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 140] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 141] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 142] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 143] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 144] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 145] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 146] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 147] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 148] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 149] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 150] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 151] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 152] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 153] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 154] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 155] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 157] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 158] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 156] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 157] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 159] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 160] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 161] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 158] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 159] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 160] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 162] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 163] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 164] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 165] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 166] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 167] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 168] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 169] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 170] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 171] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 161] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 162] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 163] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 164] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 165] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 166] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 167] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 168] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 169] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 170] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 172] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 173] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 174] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 175] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 176] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 177] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 178] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 179] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 180] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 181] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 182] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 183] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 184] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 185] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 186] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 187] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 188] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 189] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 190] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 191] = "LiteralType"; - SyntaxKind[SyntaxKind["NamedTupleMember"] = 192] = "NamedTupleMember"; - SyntaxKind[SyntaxKind["TemplateLiteralType"] = 193] = "TemplateLiteralType"; - SyntaxKind[SyntaxKind["TemplateLiteralTypeSpan"] = 194] = "TemplateLiteralTypeSpan"; - SyntaxKind[SyntaxKind["ImportType"] = 195] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 171] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 172] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 173] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 174] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 175] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 176] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 177] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 178] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 179] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 180] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 181] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 182] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 183] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 184] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 185] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 186] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 187] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 188] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 189] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 190] = "LiteralType"; + SyntaxKind[SyntaxKind["NamedTupleMember"] = 191] = "NamedTupleMember"; + SyntaxKind[SyntaxKind["ImportType"] = 192] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 196] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 197] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 198] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 193] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 194] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 195] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 199] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 200] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 201] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 202] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 203] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 204] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 205] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 206] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 207] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 208] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 209] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 210] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 211] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 212] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 213] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 214] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 215] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 216] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 217] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 218] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 219] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 220] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 221] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 222] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 223] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 224] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 225] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 226] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 227] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 196] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 197] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 198] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 199] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 200] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 201] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 202] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 203] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 204] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 205] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 206] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 207] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 208] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 209] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 210] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 211] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 212] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 213] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 214] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 215] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 216] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 217] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 218] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 219] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 220] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 221] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 222] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 223] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 224] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 228] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 229] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 225] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 226] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 230] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 231] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 232] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 233] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 234] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 235] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 236] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 237] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 238] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 239] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 240] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 241] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 242] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 243] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 244] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 245] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 246] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 247] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 248] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 249] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 250] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 251] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 252] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 253] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 254] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 255] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 256] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 257] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 258] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 259] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 260] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 261] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 262] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 263] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 264] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 265] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 266] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 267] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 268] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 269] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 270] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 271] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 227] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 228] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 229] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 230] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 231] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 232] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 233] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 234] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 235] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 236] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 237] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 238] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 239] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 240] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 241] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 242] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 243] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 244] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 245] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 246] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 247] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 248] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 249] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 250] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 251] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 252] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 253] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 254] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 255] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 256] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 257] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 258] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 259] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 260] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 261] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 262] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 263] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 264] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 265] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 266] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 267] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 268] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 272] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 269] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 273] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 274] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 275] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 276] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 277] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 278] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 279] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 280] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 281] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 282] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 283] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 270] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 271] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 272] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 273] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 274] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 275] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 276] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 277] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 278] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 279] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 280] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 284] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 285] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 286] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 287] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 281] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 282] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 283] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 284] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 288] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 289] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 290] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 285] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 286] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 287] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 291] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 288] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 292] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 293] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 294] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 295] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 296] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 289] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 290] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 291] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 292] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 293] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 297] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 298] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 299] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 300] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 294] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 295] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 296] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 297] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 301] = "JSDocTypeExpression"; - SyntaxKind[SyntaxKind["JSDocNameReference"] = 302] = "JSDocNameReference"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 298] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 303] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 299] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 304] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 305] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 306] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 307] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 308] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 309] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 300] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 301] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 302] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 303] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 304] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 305] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 310] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 311] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 312] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 313] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 314] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 315] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 316] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 317] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 318] = "JSDocDeprecatedTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 319] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 320] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 321] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 322] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 323] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 324] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 325] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 326] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 327] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 328] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 329] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 330] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 331] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocSeeTag"] = 332] = "JSDocSeeTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 333] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 306] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 307] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 308] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 309] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 310] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 311] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 312] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 313] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 314] = "JSDocDeprecatedTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 315] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 316] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 317] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 318] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 319] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 320] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 321] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 322] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 323] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 324] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 325] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 326] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 327] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 328] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 334] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 329] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 335] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 336] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 337] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 338] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 339] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 340] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 330] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 331] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 332] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 333] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 334] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 335] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 341] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 336] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 77] = "LastAssignment"; @@ -4259,15 +3729,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 80] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 115] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 80] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 156] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 155] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 116] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 124] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 172] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 195] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 171] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 192] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 77] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 156] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 155] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -4276,15 +3746,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 77] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 232] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 248] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 157] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 301] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 333] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 314] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 333] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 229] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 245] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 156] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 298] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 328] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 310] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 328] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 125] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 156] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 155] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -4395,7 +3865,6 @@ var ts; GeneratedIdentifierFlags[GeneratedIdentifierFlags["ReservedInNestedScopes"] = 8] = "ReservedInNestedScopes"; GeneratedIdentifierFlags[GeneratedIdentifierFlags["Optimistic"] = 16] = "Optimistic"; GeneratedIdentifierFlags[GeneratedIdentifierFlags["FileLevel"] = 32] = "FileLevel"; - GeneratedIdentifierFlags[GeneratedIdentifierFlags["AllowNameSubstitution"] = 64] = "AllowNameSubstitution"; })(GeneratedIdentifierFlags = ts.GeneratedIdentifierFlags || (ts.GeneratedIdentifierFlags = {})); var TokenFlags; (function (TokenFlags) { @@ -4839,8 +4308,6 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; - TypeFlags[TypeFlags["TemplateLiteral"] = 134217728] = "TemplateLiteral"; - TypeFlags[TypeFlags["StringMapping"] = 268435456] = "StringMapping"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -4857,7 +4324,7 @@ var ts; TypeFlags[TypeFlags["Intrinsic"] = 67359327] = "Intrinsic"; /* @internal */ TypeFlags[TypeFlags["Primitive"] = 131068] = "Primitive"; - TypeFlags[TypeFlags["StringLike"] = 402653316] = "StringLike"; + TypeFlags[TypeFlags["StringLike"] = 132] = "StringLike"; TypeFlags[TypeFlags["NumberLike"] = 296] = "NumberLike"; TypeFlags[TypeFlags["BigIntLike"] = 2112] = "BigIntLike"; TypeFlags[TypeFlags["BooleanLike"] = 528] = "BooleanLike"; @@ -4865,28 +4332,28 @@ var ts; TypeFlags[TypeFlags["ESSymbolLike"] = 12288] = "ESSymbolLike"; TypeFlags[TypeFlags["VoidLike"] = 49152] = "VoidLike"; /* @internal */ - TypeFlags[TypeFlags["DisjointDomains"] = 469892092] = "DisjointDomains"; + TypeFlags[TypeFlags["DisjointDomains"] = 67238908] = "DisjointDomains"; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; - TypeFlags[TypeFlags["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 465829888] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; + TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ TypeFlags[TypeFlags["Simplifiable"] = 25165824] = "Simplifiable"; /* @internal */ - TypeFlags[TypeFlags["Substructure"] = 469237760] = "Substructure"; + TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 536624127] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 469647395] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ - TypeFlags[TypeFlags["IncludesMask"] = 205258751] = "IncludesMask"; + TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; // The following flags are used for different purposes during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesStructuredOrInstantiable"] = 262144] = "IncludesStructuredOrInstantiable"; @@ -4943,16 +4410,11 @@ var ts; ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] = 268435456] = "IsNeverIntersectionComputed"; /* @internal */ ObjectFlags[ObjectFlags["IsNeverIntersection"] = 536870912] = "IsNeverIntersection"; - /* @internal */ - ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 1073741824] = "IsClassInstanceClone"; ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; /* @internal */ ObjectFlags[ObjectFlags["RequiresWidening"] = 1572864] = "RequiresWidening"; /* @internal */ ObjectFlags[ObjectFlags["PropagatingFlags"] = 3670016] = "PropagatingFlags"; - // Object flags that uniquely identify the kind of ObjectType - /* @internal */ - ObjectFlags[ObjectFlags["ObjectTypeKindMask"] = 2367] = "ObjectTypeKindMask"; })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); /* @internal */ var VarianceFlags; @@ -5042,18 +4504,18 @@ var ts; })(InferenceFlags = ts.InferenceFlags || (ts.InferenceFlags = {})); /** * Ternary values are defined such that - * x & y picks the lesser in the order False < Unknown < Maybe < True, and - * x | y picks the greater in the order False < Unknown < Maybe < True. - * Generally, Ternary.Maybe is used as the result of a relation that depends on itself, and - * Ternary.Unknown is used as the result of a variance check that depends on itself. We make - * a distinction because we don't want to cache circular variance check results. + * x & y is False if either x or y is False. + * x & y is Maybe if either x or y is Maybe, but neither x or y is False. + * x & y is True if both x and y are True. + * x | y is False if both x and y are False. + * x | y is Maybe if either x or y is Maybe, but neither x or y is True. + * x | y is True if either x or y is True. */ /* @internal */ var Ternary; (function (Ternary) { Ternary[Ternary["False"] = 0] = "False"; - Ternary[Ternary["Unknown"] = 1] = "Unknown"; - Ternary[Ternary["Maybe"] = 3] = "Maybe"; + Ternary[Ternary["Maybe"] = 1] = "Maybe"; Ternary[Ternary["True"] = -1] = "True"; })(Ternary = ts.Ternary || (ts.Ternary = {})); /* @internal */ @@ -5061,7 +4523,6 @@ var ts; (function (AssignmentDeclarationKind) { AssignmentDeclarationKind[AssignmentDeclarationKind["None"] = 0] = "None"; /// exports.name = expr - /// module.exports.name = expr AssignmentDeclarationKind[AssignmentDeclarationKind["ExportsProperty"] = 1] = "ExportsProperty"; /// module.exports = expr AssignmentDeclarationKind[AssignmentDeclarationKind["ModuleExports"] = 2] = "ModuleExports"; @@ -5142,8 +4603,6 @@ var ts; JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve"; JsxEmit[JsxEmit["React"] = 2] = "React"; JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative"; - JsxEmit[JsxEmit["ReactJSX"] = 4] = "ReactJSX"; - JsxEmit[JsxEmit["ReactJSXDev"] = 5] = "ReactJSXDev"; })(JsxEmit = ts.JsxEmit || (ts.JsxEmit = {})); var ImportsNotUsedAsValues; (function (ImportsNotUsedAsValues) { @@ -5662,696 +5121,8 @@ var ts; args: [{ name: "factory" }], kind: 4 /* MultiLine */ }, - "jsximportsource": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - }, - "jsxruntime": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - }, }; })(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - /** - * Internally, we represent paths as strings with '/' as the directory separator. - * When we make system calls (eg: LanguageServiceHost.getDirectory()), - * we expect the host to correctly handle paths in our specified format. - */ - ts.directorySeparator = "/"; - var altDirectorySeparator = "\\"; - var urlSchemeSeparator = "://"; - var backslashRegExp = /\\/g; - //// Path Tests - /** - * Determines whether a charCode corresponds to `/` or `\`. - */ - function isAnyDirectorySeparator(charCode) { - return charCode === 47 /* slash */ || charCode === 92 /* backslash */; - } - ts.isAnyDirectorySeparator = isAnyDirectorySeparator; - /** - * Determines whether a path starts with a URL scheme (e.g. starts with `http://`, `ftp://`, `file://`, etc.). - */ - function isUrl(path) { - return getEncodedRootLength(path) < 0; - } - ts.isUrl = isUrl; - /** - * Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path - * like `c:`, `c:\` or `c:/`). - */ - function isRootedDiskPath(path) { - return getEncodedRootLength(path) > 0; - } - ts.isRootedDiskPath = isRootedDiskPath; - /** - * Determines whether a path consists only of a path root. - */ - function isDiskPathRoot(path) { - var rootLength = getEncodedRootLength(path); - return rootLength > 0 && rootLength === path.length; - } - ts.isDiskPathRoot = isDiskPathRoot; - /** - * Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.). - * - * ```ts - * // POSIX - * pathIsAbsolute("/path/to/file.ext") === true - * // DOS - * pathIsAbsolute("c:/path/to/file.ext") === true - * // URL - * pathIsAbsolute("file:///path/to/file.ext") === true - * // Non-absolute - * pathIsAbsolute("path/to/file.ext") === false - * pathIsAbsolute("./path/to/file.ext") === false - * ``` - */ - function pathIsAbsolute(path) { - return getEncodedRootLength(path) !== 0; - } - ts.pathIsAbsolute = pathIsAbsolute; - /** - * Determines whether a path starts with a relative path component (i.e. `.` or `..`). - */ - function pathIsRelative(path) { - return /^\.\.?($|[\\/])/.test(path); - } - ts.pathIsRelative = pathIsRelative; - /** - * Determines whether a path is neither relative nor absolute, e.g. "path/to/file". - * Also known misleadingly as "non-relative". - */ - function pathIsBareSpecifier(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path); - } - ts.pathIsBareSpecifier = pathIsBareSpecifier; - function hasExtension(fileName) { - return ts.stringContains(getBaseFileName(fileName), "."); - } - ts.hasExtension = hasExtension; - function fileExtensionIs(path, extension) { - return path.length > extension.length && ts.endsWith(path, extension); - } - ts.fileExtensionIs = fileExtensionIs; - function fileExtensionIsOneOf(path, extensions) { - for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { - var extension = extensions_1[_i]; - if (fileExtensionIs(path, extension)) { - return true; - } - } - return false; - } - ts.fileExtensionIsOneOf = fileExtensionIsOneOf; - /** - * Determines whether a path has a trailing separator (`/` or `\\`). - */ - function hasTrailingDirectorySeparator(path) { - return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); - } - ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator; - //// Path Parsing - function isVolumeCharacter(charCode) { - return (charCode >= 97 /* a */ && charCode <= 122 /* z */) || - (charCode >= 65 /* A */ && charCode <= 90 /* Z */); - } - function getFileUrlVolumeSeparatorEnd(url, start) { - var ch0 = url.charCodeAt(start); - if (ch0 === 58 /* colon */) - return start + 1; - if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { - var ch2 = url.charCodeAt(start + 2); - if (ch2 === 97 /* a */ || ch2 === 65 /* A */) - return start + 3; - } - return -1; - } - /** - * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). - * If the root is part of a URL, the twos-complement of the root length is returned. - */ - function getEncodedRootLength(path) { - if (!path) - return 0; - var ch0 = path.charCodeAt(0); - // POSIX or UNC - if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { - if (path.charCodeAt(1) !== ch0) - return 1; // POSIX: "/" (or non-normalized "\") - var p1 = path.indexOf(ch0 === 47 /* slash */ ? ts.directorySeparator : altDirectorySeparator, 2); - if (p1 < 0) - return path.length; // UNC: "//server" or "\\server" - return p1 + 1; // UNC: "//server/" or "\\server\" - } - // DOS - if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) { - var ch2 = path.charCodeAt(2); - if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) - return 3; // DOS: "c:/" or "c:\" - if (path.length === 2) - return 2; // DOS: "c:" (but not "c:d") - } - // URL - var schemeEnd = path.indexOf(urlSchemeSeparator); - if (schemeEnd !== -1) { - var authorityStart = schemeEnd + urlSchemeSeparator.length; - var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart); - if (authorityEnd !== -1) { // URL: "file:///", "file://server/", "file://server/path" - // For local "file" URLs, include the leading DOS volume (if present). - // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a - // special case interpreted as "the machine from which the URL is being interpreted". - var scheme = path.slice(0, schemeEnd); - var authority = path.slice(authorityStart, authorityEnd); - if (scheme === "file" && (authority === "" || authority === "localhost") && - isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { - var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); - if (volumeSeparatorEnd !== -1) { - if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { - // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/" - return ~(volumeSeparatorEnd + 1); - } - if (volumeSeparatorEnd === path.length) { - // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a" - // but not "file:///c:d" or "file:///c%3ad" - return ~volumeSeparatorEnd; - } - } - } - return ~(authorityEnd + 1); // URL: "file://server/", "http://server/" - } - return ~path.length; // URL: "file://server", "http://server" - } - // relative - return 0; - } - /** - * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). - * - * For example: - * ```ts - * getRootLength("a") === 0 // "" - * getRootLength("/") === 1 // "/" - * getRootLength("c:") === 2 // "c:" - * getRootLength("c:d") === 0 // "" - * getRootLength("c:/") === 3 // "c:/" - * getRootLength("c:\\") === 3 // "c:\\" - * getRootLength("//server") === 7 // "//server" - * getRootLength("//server/share") === 8 // "//server/" - * getRootLength("\\\\server") === 7 // "\\\\server" - * getRootLength("\\\\server\\share") === 8 // "\\\\server\\" - * getRootLength("file:///path") === 8 // "file:///" - * getRootLength("file:///c:") === 10 // "file:///c:" - * getRootLength("file:///c:d") === 8 // "file:///" - * getRootLength("file:///c:/path") === 11 // "file:///c:/" - * getRootLength("file://server") === 13 // "file://server" - * getRootLength("file://server/path") === 14 // "file://server/" - * getRootLength("http://server") === 13 // "http://server" - * getRootLength("http://server/path") === 14 // "http://server/" - * ``` - */ - function getRootLength(path) { - var rootLength = getEncodedRootLength(path); - return rootLength < 0 ? ~rootLength : rootLength; - } - ts.getRootLength = getRootLength; - function getDirectoryPath(path) { - path = normalizeSlashes(path); - // If the path provided is itself the root, then return it. - var rootLength = getRootLength(path); - if (rootLength === path.length) - return path; - // return the leading portion of the path up to the last (non-terminal) directory separator - // but not including any trailing directory separator. - path = removeTrailingDirectorySeparator(path); - return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator))); - } - ts.getDirectoryPath = getDirectoryPath; - function getBaseFileName(path, extensions, ignoreCase) { - path = normalizeSlashes(path); - // if the path provided is itself the root, then it has not file name. - var rootLength = getRootLength(path); - if (rootLength === path.length) - return ""; - // return the trailing portion of the path starting after the last (non-terminal) directory - // separator but not including any trailing directory separator. - path = removeTrailingDirectorySeparator(path); - var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1)); - var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined; - return extension ? name.slice(0, name.length - extension.length) : name; - } - ts.getBaseFileName = getBaseFileName; - function tryGetExtensionFromPath(path, extension, stringEqualityComparer) { - if (!ts.startsWith(extension, ".")) - extension = "." + extension; - if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46 /* dot */) { - var pathExtension = path.slice(path.length - extension.length); - if (stringEqualityComparer(pathExtension, extension)) { - return pathExtension; - } - } - } - function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) { - if (typeof extensions === "string") { - return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || ""; - } - for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) { - var extension = extensions_2[_i]; - var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer); - if (result) - return result; - } - return ""; - } - function getAnyExtensionFromPath(path, extensions, ignoreCase) { - // Retrieves any string from the final "." onwards from a base file name. - // Unlike extensionFromPath, which throws an exception on unrecognized extensions. - if (extensions) { - return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive); - } - var baseFileName = getBaseFileName(path); - var extensionIndex = baseFileName.lastIndexOf("."); - if (extensionIndex >= 0) { - return baseFileName.substring(extensionIndex); - } - return ""; - } - ts.getAnyExtensionFromPath = getAnyExtensionFromPath; - function pathComponents(path, rootLength) { - var root = path.substring(0, rootLength); - var rest = path.substring(rootLength).split(ts.directorySeparator); - if (rest.length && !ts.lastOrUndefined(rest)) - rest.pop(); - return __spreadArrays([root], rest); - } - /** - * Parse a path into an array containing a root component (at index 0) and zero or more path - * components (at indices > 0). The result is not normalized. - * If the path is relative, the root component is `""`. - * If the path is absolute, the root component includes the first path separator (`/`). - * - * ```ts - * // POSIX - * getPathComponents("/path/to/file.ext") === ["/", "path", "to", "file.ext"] - * getPathComponents("/path/to/") === ["/", "path", "to"] - * getPathComponents("/") === ["/"] - * // DOS - * getPathComponents("c:/path/to/file.ext") === ["c:/", "path", "to", "file.ext"] - * getPathComponents("c:/path/to/") === ["c:/", "path", "to"] - * getPathComponents("c:/") === ["c:/"] - * getPathComponents("c:") === ["c:"] - * // URL - * getPathComponents("http://typescriptlang.org/path/to/file.ext") === ["http://typescriptlang.org/", "path", "to", "file.ext"] - * getPathComponents("http://typescriptlang.org/path/to/") === ["http://typescriptlang.org/", "path", "to"] - * getPathComponents("http://typescriptlang.org/") === ["http://typescriptlang.org/"] - * getPathComponents("http://typescriptlang.org") === ["http://typescriptlang.org"] - * getPathComponents("file://server/path/to/file.ext") === ["file://server/", "path", "to", "file.ext"] - * getPathComponents("file://server/path/to/") === ["file://server/", "path", "to"] - * getPathComponents("file://server/") === ["file://server/"] - * getPathComponents("file://server") === ["file://server"] - * getPathComponents("file:///path/to/file.ext") === ["file:///", "path", "to", "file.ext"] - * getPathComponents("file:///path/to/") === ["file:///", "path", "to"] - * getPathComponents("file:///") === ["file:///"] - * getPathComponents("file://") === ["file://"] - */ - function getPathComponents(path, currentDirectory) { - if (currentDirectory === void 0) { currentDirectory = ""; } - path = combinePaths(currentDirectory, path); - return pathComponents(path, getRootLength(path)); - } - ts.getPathComponents = getPathComponents; - //// Path Formatting - /** - * Formats a parsed path consisting of a root component (at index 0) and zero or more path - * segments (at indices > 0). - * - * ```ts - * getPathFromPathComponents(["/", "path", "to", "file.ext"]) === "/path/to/file.ext" - * ``` - */ - function getPathFromPathComponents(pathComponents) { - if (pathComponents.length === 0) - return ""; - var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]); - return root + pathComponents.slice(1).join(ts.directorySeparator); - } - ts.getPathFromPathComponents = getPathFromPathComponents; - //// Path Normalization - /** - * Normalize path separators, converting `\` into `/`. - */ - function normalizeSlashes(path) { - return path.replace(backslashRegExp, ts.directorySeparator); - } - ts.normalizeSlashes = normalizeSlashes; - /** - * Reduce an array of path components to a more simplified path by navigating any - * `"."` or `".."` entries in the path. - */ - function reducePathComponents(components) { - if (!ts.some(components)) - return []; - var reduced = [components[0]]; - for (var i = 1; i < components.length; i++) { - var component = components[i]; - if (!component) - continue; - if (component === ".") - continue; - if (component === "..") { - if (reduced.length > 1) { - if (reduced[reduced.length - 1] !== "..") { - reduced.pop(); - continue; - } - } - else if (reduced[0]) - continue; - } - reduced.push(component); - } - return reduced; - } - ts.reducePathComponents = reducePathComponents; - /** - * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. - * - * ```ts - * // Non-rooted - * combinePaths("path", "to", "file.ext") === "path/to/file.ext" - * combinePaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file.ext" - * // POSIX - * combinePaths("/path", "to", "file.ext") === "/path/to/file.ext" - * combinePaths("/path", "/to", "file.ext") === "/to/file.ext" - * // DOS - * combinePaths("c:/path", "to", "file.ext") === "c:/path/to/file.ext" - * combinePaths("c:/path", "c:/to", "file.ext") === "c:/to/file.ext" - * // URL - * combinePaths("file:///path", "to", "file.ext") === "file:///path/to/file.ext" - * combinePaths("file:///path", "file:///to", "file.ext") === "file:///to/file.ext" - * ``` - */ - function combinePaths(path) { - var paths = []; - for (var _i = 1; _i < arguments.length; _i++) { - paths[_i - 1] = arguments[_i]; - } - if (path) - path = normalizeSlashes(path); - for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { - var relativePath = paths_1[_a]; - if (!relativePath) - continue; - relativePath = normalizeSlashes(relativePath); - if (!path || getRootLength(relativePath) !== 0) { - path = relativePath; - } - else { - path = ensureTrailingDirectorySeparator(path) + relativePath; - } - } - return path; - } - ts.combinePaths = combinePaths; - /** - * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any - * `.` and `..` path components are resolved. Trailing directory separators are preserved. - * - * ```ts - * resolvePath("/path", "to", "file.ext") === "path/to/file.ext" - * resolvePath("/path", "to", "file.ext/") === "path/to/file.ext/" - * resolvePath("/path", "dir", "..", "to", "file.ext") === "path/to/file.ext" - * ``` - */ - function resolvePath(path) { - var paths = []; - for (var _i = 1; _i < arguments.length; _i++) { - paths[_i - 1] = arguments[_i]; - } - return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : normalizeSlashes(path)); - } - ts.resolvePath = resolvePath; - /** - * Parse a path into an array containing a root component (at index 0) and zero or more path - * components (at indices > 0). The result is normalized. - * If the path is relative, the root component is `""`. - * If the path is absolute, the root component includes the first path separator (`/`). - * - * ```ts - * getNormalizedPathComponents("to/dir/../file.ext", "/path/") === ["/", "path", "to", "file.ext"] - * ``` - */ - function getNormalizedPathComponents(path, currentDirectory) { - return reducePathComponents(getPathComponents(path, currentDirectory)); - } - ts.getNormalizedPathComponents = getNormalizedPathComponents; - function getNormalizedAbsolutePath(fileName, currentDirectory) { - return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); - } - ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; - function normalizePath(path) { - path = normalizeSlashes(path); - var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); - return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; - } - ts.normalizePath = normalizePath; - function getPathWithoutRoot(pathComponents) { - if (pathComponents.length === 0) - return ""; - return pathComponents.slice(1).join(ts.directorySeparator); - } - function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { - return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); - } - ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; - function toPath(fileName, basePath, getCanonicalFileName) { - var nonCanonicalizedPath = isRootedDiskPath(fileName) - ? normalizePath(fileName) - : getNormalizedAbsolutePath(fileName, basePath); - return getCanonicalFileName(nonCanonicalizedPath); - } - ts.toPath = toPath; - function normalizePathAndParts(path) { - path = normalizeSlashes(path); - var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1); - if (parts.length) { - var joinedParts = root + parts.join(ts.directorySeparator); - return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts }; - } - else { - return { path: root, parts: parts }; - } - } - ts.normalizePathAndParts = normalizePathAndParts; - function removeTrailingDirectorySeparator(path) { - if (hasTrailingDirectorySeparator(path)) { - return path.substr(0, path.length - 1); - } - return path; - } - ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator; - function ensureTrailingDirectorySeparator(path) { - if (!hasTrailingDirectorySeparator(path)) { - return path + ts.directorySeparator; - } - return path; - } - ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; - /** - * Ensures a path is either absolute (prefixed with `/` or `c:`) or dot-relative (prefixed - * with `./` or `../`) so as not to be confused with an unprefixed module name. - * - * ```ts - * ensurePathIsNonModuleName("/path/to/file.ext") === "/path/to/file.ext" - * ensurePathIsNonModuleName("./path/to/file.ext") === "./path/to/file.ext" - * ensurePathIsNonModuleName("../path/to/file.ext") === "../path/to/file.ext" - * ensurePathIsNonModuleName("path/to/file.ext") === "./path/to/file.ext" - * ``` - */ - function ensurePathIsNonModuleName(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; - } - ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName; - function changeAnyExtension(path, ext, extensions, ignoreCase) { - var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path); - return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path; - } - ts.changeAnyExtension = changeAnyExtension; - //// Path Comparisons - // check path for these segments: '', '.'. '..' - var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; - function comparePathsWorker(a, b, componentComparer) { - if (a === b) - return 0 /* EqualTo */; - if (a === undefined) - return -1 /* LessThan */; - if (b === undefined) - return 1 /* GreaterThan */; - // NOTE: Performance optimization - shortcut if the root segments differ as there would be no - // need to perform path reduction. - var aRoot = a.substring(0, getRootLength(a)); - var bRoot = b.substring(0, getRootLength(b)); - var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); - if (result !== 0 /* EqualTo */) { - return result; - } - // NOTE: Performance optimization - shortcut if there are no relative path segments in - // the non-root portion of the path - var aRest = a.substring(aRoot.length); - var bRest = b.substring(bRoot.length); - if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { - return componentComparer(aRest, bRest); - } - // The path contains a relative path segment. Normalize the paths and perform a slower component - // by component comparison. - var aComponents = reducePathComponents(getPathComponents(a)); - var bComponents = reducePathComponents(getPathComponents(b)); - var sharedLength = Math.min(aComponents.length, bComponents.length); - for (var i = 1; i < sharedLength; i++) { - var result_2 = componentComparer(aComponents[i], bComponents[i]); - if (result_2 !== 0 /* EqualTo */) { - return result_2; - } - } - return ts.compareValues(aComponents.length, bComponents.length); - } - /** - * Performs a case-sensitive comparison of two paths. Path roots are always compared case-insensitively. - */ - function comparePathsCaseSensitive(a, b) { - return comparePathsWorker(a, b, ts.compareStringsCaseSensitive); - } - ts.comparePathsCaseSensitive = comparePathsCaseSensitive; - /** - * Performs a case-insensitive comparison of two paths. - */ - function comparePathsCaseInsensitive(a, b) { - return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive); - } - ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive; - function comparePaths(a, b, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - a = combinePaths(currentDirectory, a); - b = combinePaths(currentDirectory, b); - } - else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase)); - } - ts.comparePaths = comparePaths; - function containsPath(parent, child, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - parent = combinePaths(currentDirectory, parent); - child = combinePaths(currentDirectory, child); - } - else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - if (parent === undefined || child === undefined) - return false; - if (parent === child) - return true; - var parentComponents = reducePathComponents(getPathComponents(parent)); - var childComponents = reducePathComponents(getPathComponents(child)); - if (childComponents.length < parentComponents.length) { - return false; - } - var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive; - for (var i = 0; i < parentComponents.length; i++) { - var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer; - if (!equalityComparer(parentComponents[i], childComponents[i])) { - return false; - } - } - return true; - } - ts.containsPath = containsPath; - /** - * Determines whether `fileName` starts with the specified `directoryName` using the provided path canonicalization callback. - * Comparison is case-sensitive between the canonical paths. - * - * @deprecated Use `containsPath` if possible. - */ - function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { - var canonicalFileName = getCanonicalFileName(fileName); - var canonicalDirectoryName = getCanonicalFileName(directoryName); - return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\"); - } - ts.startsWithDirectory = startsWithDirectory; - //// Relative Paths - function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { - var fromComponents = reducePathComponents(getPathComponents(from)); - var toComponents = reducePathComponents(getPathComponents(to)); - var start; - for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { - var fromComponent = getCanonicalFileName(fromComponents[start]); - var toComponent = getCanonicalFileName(toComponents[start]); - var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer; - if (!comparer(fromComponent, toComponent)) - break; - } - if (start === 0) { - return toComponents; - } - var components = toComponents.slice(start); - var relative = []; - for (; start < fromComponents.length; start++) { - relative.push(".."); - } - return __spreadArrays([""], relative, components); - } - ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo; - function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { - ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative"); - var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity; - var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; - var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName); - return getPathFromPathComponents(pathComponents); - } - ts.getRelativePathFromDirectory = getRelativePathFromDirectory; - function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { - return !isRootedDiskPath(absoluteOrRelativePath) - ? absoluteOrRelativePath - : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); - } - ts.convertToRelativePath = convertToRelativePath; - function getRelativePathFromFile(from, to, getCanonicalFileName) { - return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); - } - ts.getRelativePathFromFile = getRelativePathFromFile; - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { - var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName); - var firstComponent = pathComponents[0]; - if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { - var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///"; - pathComponents[0] = prefix + firstComponent; - } - return getPathFromPathComponents(pathComponents); - } - ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; - function forEachAncestorDirectory(directory, callback) { - while (true) { - var result = callback(directory); - if (result !== undefined) { - return result; - } - var parentPath = getDirectoryPath(directory); - if (parentPath === directory) { - return undefined; - } - directory = parentPath; - } - } - ts.forEachAncestorDirectory = forEachAncestorDirectory; - function isNodeModulesDirectory(dirPath) { - return ts.endsWith(dirPath, "/node_modules"); - } - ts.isNodeModulesDirectory = isNodeModulesDirectory; -})(ts || (ts = {})); var ts; (function (ts) { /** @@ -7597,10 +6368,6 @@ var ts; return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath); } function fileSystemEntryExists(path, entryKind) { - // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve - // the CPU time performance. - var originalStackTraceLimit = Error.stackTraceLimit; - Error.stackTraceLimit = 0; try { var stat = _fs.statSync(path); switch (entryKind) { @@ -7612,9 +6379,6 @@ var ts; catch (e) { return false; } - finally { - Error.stackTraceLimit = originalStackTraceLimit; - } } function fileExists(path) { return fileSystemEntryExists(path, 0 /* File */); @@ -7685,6 +6449,678 @@ var ts; ts.Debug.isDebugging = true; } })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + /** + * Internally, we represent paths as strings with '/' as the directory separator. + * When we make system calls (eg: LanguageServiceHost.getDirectory()), + * we expect the host to correctly handle paths in our specified format. + */ + ts.directorySeparator = "/"; + var altDirectorySeparator = "\\"; + var urlSchemeSeparator = "://"; + var backslashRegExp = /\\/g; + //// Path Tests + /** + * Determines whether a charCode corresponds to `/` or `\`. + */ + function isAnyDirectorySeparator(charCode) { + return charCode === 47 /* slash */ || charCode === 92 /* backslash */; + } + ts.isAnyDirectorySeparator = isAnyDirectorySeparator; + /** + * Determines whether a path starts with a URL scheme (e.g. starts with `http://`, `ftp://`, `file://`, etc.). + */ + function isUrl(path) { + return getEncodedRootLength(path) < 0; + } + ts.isUrl = isUrl; + /** + * Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path + * like `c:`, `c:\` or `c:/`). + */ + function isRootedDiskPath(path) { + return getEncodedRootLength(path) > 0; + } + ts.isRootedDiskPath = isRootedDiskPath; + /** + * Determines whether a path consists only of a path root. + */ + function isDiskPathRoot(path) { + var rootLength = getEncodedRootLength(path); + return rootLength > 0 && rootLength === path.length; + } + ts.isDiskPathRoot = isDiskPathRoot; + /** + * Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.). + * + * ```ts + * // POSIX + * pathIsAbsolute("/path/to/file.ext") === true + * // DOS + * pathIsAbsolute("c:/path/to/file.ext") === true + * // URL + * pathIsAbsolute("file:///path/to/file.ext") === true + * // Non-absolute + * pathIsAbsolute("path/to/file.ext") === false + * pathIsAbsolute("./path/to/file.ext") === false + * ``` + */ + function pathIsAbsolute(path) { + return getEncodedRootLength(path) !== 0; + } + ts.pathIsAbsolute = pathIsAbsolute; + /** + * Determines whether a path starts with a relative path component (i.e. `.` or `..`). + */ + function pathIsRelative(path) { + return /^\.\.?($|[\\/])/.test(path); + } + ts.pathIsRelative = pathIsRelative; + function hasExtension(fileName) { + return ts.stringContains(getBaseFileName(fileName), "."); + } + ts.hasExtension = hasExtension; + function fileExtensionIs(path, extension) { + return path.length > extension.length && ts.endsWith(path, extension); + } + ts.fileExtensionIs = fileExtensionIs; + function fileExtensionIsOneOf(path, extensions) { + for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { + var extension = extensions_1[_i]; + if (fileExtensionIs(path, extension)) { + return true; + } + } + return false; + } + ts.fileExtensionIsOneOf = fileExtensionIsOneOf; + /** + * Determines whether a path has a trailing separator (`/` or `\\`). + */ + function hasTrailingDirectorySeparator(path) { + return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); + } + ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator; + //// Path Parsing + function isVolumeCharacter(charCode) { + return (charCode >= 97 /* a */ && charCode <= 122 /* z */) || + (charCode >= 65 /* A */ && charCode <= 90 /* Z */); + } + function getFileUrlVolumeSeparatorEnd(url, start) { + var ch0 = url.charCodeAt(start); + if (ch0 === 58 /* colon */) + return start + 1; + if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { + var ch2 = url.charCodeAt(start + 2); + if (ch2 === 97 /* a */ || ch2 === 65 /* A */) + return start + 3; + } + return -1; + } + /** + * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). + * If the root is part of a URL, the twos-complement of the root length is returned. + */ + function getEncodedRootLength(path) { + if (!path) + return 0; + var ch0 = path.charCodeAt(0); + // POSIX or UNC + if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { + if (path.charCodeAt(1) !== ch0) + return 1; // POSIX: "/" (or non-normalized "\") + var p1 = path.indexOf(ch0 === 47 /* slash */ ? ts.directorySeparator : altDirectorySeparator, 2); + if (p1 < 0) + return path.length; // UNC: "//server" or "\\server" + return p1 + 1; // UNC: "//server/" or "\\server\" + } + // DOS + if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) { + var ch2 = path.charCodeAt(2); + if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) + return 3; // DOS: "c:/" or "c:\" + if (path.length === 2) + return 2; // DOS: "c:" (but not "c:d") + } + // URL + var schemeEnd = path.indexOf(urlSchemeSeparator); + if (schemeEnd !== -1) { + var authorityStart = schemeEnd + urlSchemeSeparator.length; + var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart); + if (authorityEnd !== -1) { // URL: "file:///", "file://server/", "file://server/path" + // For local "file" URLs, include the leading DOS volume (if present). + // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a + // special case interpreted as "the machine from which the URL is being interpreted". + var scheme = path.slice(0, schemeEnd); + var authority = path.slice(authorityStart, authorityEnd); + if (scheme === "file" && (authority === "" || authority === "localhost") && + isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { + var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); + if (volumeSeparatorEnd !== -1) { + if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { + // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/" + return ~(volumeSeparatorEnd + 1); + } + if (volumeSeparatorEnd === path.length) { + // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a" + // but not "file:///c:d" or "file:///c%3ad" + return ~volumeSeparatorEnd; + } + } + } + return ~(authorityEnd + 1); // URL: "file://server/", "http://server/" + } + return ~path.length; // URL: "file://server", "http://server" + } + // relative + return 0; + } + /** + * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). + * + * For example: + * ```ts + * getRootLength("a") === 0 // "" + * getRootLength("/") === 1 // "/" + * getRootLength("c:") === 2 // "c:" + * getRootLength("c:d") === 0 // "" + * getRootLength("c:/") === 3 // "c:/" + * getRootLength("c:\\") === 3 // "c:\\" + * getRootLength("//server") === 7 // "//server" + * getRootLength("//server/share") === 8 // "//server/" + * getRootLength("\\\\server") === 7 // "\\\\server" + * getRootLength("\\\\server\\share") === 8 // "\\\\server\\" + * getRootLength("file:///path") === 8 // "file:///" + * getRootLength("file:///c:") === 10 // "file:///c:" + * getRootLength("file:///c:d") === 8 // "file:///" + * getRootLength("file:///c:/path") === 11 // "file:///c:/" + * getRootLength("file://server") === 13 // "file://server" + * getRootLength("file://server/path") === 14 // "file://server/" + * getRootLength("http://server") === 13 // "http://server" + * getRootLength("http://server/path") === 14 // "http://server/" + * ``` + */ + function getRootLength(path) { + var rootLength = getEncodedRootLength(path); + return rootLength < 0 ? ~rootLength : rootLength; + } + ts.getRootLength = getRootLength; + function getDirectoryPath(path) { + path = normalizeSlashes(path); + // If the path provided is itself the root, then return it. + var rootLength = getRootLength(path); + if (rootLength === path.length) + return path; + // return the leading portion of the path up to the last (non-terminal) directory separator + // but not including any trailing directory separator. + path = removeTrailingDirectorySeparator(path); + return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator))); + } + ts.getDirectoryPath = getDirectoryPath; + function getBaseFileName(path, extensions, ignoreCase) { + path = normalizeSlashes(path); + // if the path provided is itself the root, then it has not file name. + var rootLength = getRootLength(path); + if (rootLength === path.length) + return ""; + // return the trailing portion of the path starting after the last (non-terminal) directory + // separator but not including any trailing directory separator. + path = removeTrailingDirectorySeparator(path); + var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1)); + var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined; + return extension ? name.slice(0, name.length - extension.length) : name; + } + ts.getBaseFileName = getBaseFileName; + function tryGetExtensionFromPath(path, extension, stringEqualityComparer) { + if (!ts.startsWith(extension, ".")) + extension = "." + extension; + if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46 /* dot */) { + var pathExtension = path.slice(path.length - extension.length); + if (stringEqualityComparer(pathExtension, extension)) { + return pathExtension; + } + } + } + function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) { + if (typeof extensions === "string") { + return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || ""; + } + for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) { + var extension = extensions_2[_i]; + var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer); + if (result) + return result; + } + return ""; + } + function getAnyExtensionFromPath(path, extensions, ignoreCase) { + // Retrieves any string from the final "." onwards from a base file name. + // Unlike extensionFromPath, which throws an exception on unrecognized extensions. + if (extensions) { + return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive); + } + var baseFileName = getBaseFileName(path); + var extensionIndex = baseFileName.lastIndexOf("."); + if (extensionIndex >= 0) { + return baseFileName.substring(extensionIndex); + } + return ""; + } + ts.getAnyExtensionFromPath = getAnyExtensionFromPath; + function pathComponents(path, rootLength) { + var root = path.substring(0, rootLength); + var rest = path.substring(rootLength).split(ts.directorySeparator); + if (rest.length && !ts.lastOrUndefined(rest)) + rest.pop(); + return __spreadArrays([root], rest); + } + /** + * Parse a path into an array containing a root component (at index 0) and zero or more path + * components (at indices > 0). The result is not normalized. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + * + * ```ts + * // POSIX + * getPathComponents("/path/to/file.ext") === ["/", "path", "to", "file.ext"] + * getPathComponents("/path/to/") === ["/", "path", "to"] + * getPathComponents("/") === ["/"] + * // DOS + * getPathComponents("c:/path/to/file.ext") === ["c:/", "path", "to", "file.ext"] + * getPathComponents("c:/path/to/") === ["c:/", "path", "to"] + * getPathComponents("c:/") === ["c:/"] + * getPathComponents("c:") === ["c:"] + * // URL + * getPathComponents("http://typescriptlang.org/path/to/file.ext") === ["http://typescriptlang.org/", "path", "to", "file.ext"] + * getPathComponents("http://typescriptlang.org/path/to/") === ["http://typescriptlang.org/", "path", "to"] + * getPathComponents("http://typescriptlang.org/") === ["http://typescriptlang.org/"] + * getPathComponents("http://typescriptlang.org") === ["http://typescriptlang.org"] + * getPathComponents("file://server/path/to/file.ext") === ["file://server/", "path", "to", "file.ext"] + * getPathComponents("file://server/path/to/") === ["file://server/", "path", "to"] + * getPathComponents("file://server/") === ["file://server/"] + * getPathComponents("file://server") === ["file://server"] + * getPathComponents("file:///path/to/file.ext") === ["file:///", "path", "to", "file.ext"] + * getPathComponents("file:///path/to/") === ["file:///", "path", "to"] + * getPathComponents("file:///") === ["file:///"] + * getPathComponents("file://") === ["file://"] + */ + function getPathComponents(path, currentDirectory) { + if (currentDirectory === void 0) { currentDirectory = ""; } + path = combinePaths(currentDirectory, path); + return pathComponents(path, getRootLength(path)); + } + ts.getPathComponents = getPathComponents; + //// Path Formatting + /** + * Formats a parsed path consisting of a root component (at index 0) and zero or more path + * segments (at indices > 0). + * + * ```ts + * getPathFromPathComponents(["/", "path", "to", "file.ext"]) === "/path/to/file.ext" + * ``` + */ + function getPathFromPathComponents(pathComponents) { + if (pathComponents.length === 0) + return ""; + var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]); + return root + pathComponents.slice(1).join(ts.directorySeparator); + } + ts.getPathFromPathComponents = getPathFromPathComponents; + //// Path Normalization + /** + * Normalize path separators, converting `\` into `/`. + */ + function normalizeSlashes(path) { + return path.replace(backslashRegExp, ts.directorySeparator); + } + ts.normalizeSlashes = normalizeSlashes; + /** + * Reduce an array of path components to a more simplified path by navigating any + * `"."` or `".."` entries in the path. + */ + function reducePathComponents(components) { + if (!ts.some(components)) + return []; + var reduced = [components[0]]; + for (var i = 1; i < components.length; i++) { + var component = components[i]; + if (!component) + continue; + if (component === ".") + continue; + if (component === "..") { + if (reduced.length > 1) { + if (reduced[reduced.length - 1] !== "..") { + reduced.pop(); + continue; + } + } + else if (reduced[0]) + continue; + } + reduced.push(component); + } + return reduced; + } + ts.reducePathComponents = reducePathComponents; + /** + * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. + * + * ```ts + * // Non-rooted + * combinePaths("path", "to", "file.ext") === "path/to/file.ext" + * combinePaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file.ext" + * // POSIX + * combinePaths("/path", "to", "file.ext") === "/path/to/file.ext" + * combinePaths("/path", "/to", "file.ext") === "/to/file.ext" + * // DOS + * combinePaths("c:/path", "to", "file.ext") === "c:/path/to/file.ext" + * combinePaths("c:/path", "c:/to", "file.ext") === "c:/to/file.ext" + * // URL + * combinePaths("file:///path", "to", "file.ext") === "file:///path/to/file.ext" + * combinePaths("file:///path", "file:///to", "file.ext") === "file:///to/file.ext" + * ``` + */ + function combinePaths(path) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + if (path) + path = normalizeSlashes(path); + for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { + var relativePath = paths_1[_a]; + if (!relativePath) + continue; + relativePath = normalizeSlashes(relativePath); + if (!path || getRootLength(relativePath) !== 0) { + path = relativePath; + } + else { + path = ensureTrailingDirectorySeparator(path) + relativePath; + } + } + return path; + } + ts.combinePaths = combinePaths; + /** + * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any + * `.` and `..` path components are resolved. Trailing directory separators are preserved. + * + * ```ts + * resolvePath("/path", "to", "file.ext") === "path/to/file.ext" + * resolvePath("/path", "to", "file.ext/") === "path/to/file.ext/" + * resolvePath("/path", "dir", "..", "to", "file.ext") === "path/to/file.ext" + * ``` + */ + function resolvePath(path) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : normalizeSlashes(path)); + } + ts.resolvePath = resolvePath; + /** + * Parse a path into an array containing a root component (at index 0) and zero or more path + * components (at indices > 0). The result is normalized. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + * + * ```ts + * getNormalizedPathComponents("to/dir/../file.ext", "/path/") === ["/", "path", "to", "file.ext"] + * ``` + */ + function getNormalizedPathComponents(path, currentDirectory) { + return reducePathComponents(getPathComponents(path, currentDirectory)); + } + ts.getNormalizedPathComponents = getNormalizedPathComponents; + function getNormalizedAbsolutePath(fileName, currentDirectory) { + return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; + function normalizePath(path) { + path = normalizeSlashes(path); + var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); + return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; + } + ts.normalizePath = normalizePath; + function getPathWithoutRoot(pathComponents) { + if (pathComponents.length === 0) + return ""; + return pathComponents.slice(1).join(ts.directorySeparator); + } + function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { + return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; + function toPath(fileName, basePath, getCanonicalFileName) { + var nonCanonicalizedPath = isRootedDiskPath(fileName) + ? normalizePath(fileName) + : getNormalizedAbsolutePath(fileName, basePath); + return getCanonicalFileName(nonCanonicalizedPath); + } + ts.toPath = toPath; + function normalizePathAndParts(path) { + path = normalizeSlashes(path); + var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1); + if (parts.length) { + var joinedParts = root + parts.join(ts.directorySeparator); + return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts }; + } + else { + return { path: root, parts: parts }; + } + } + ts.normalizePathAndParts = normalizePathAndParts; + function removeTrailingDirectorySeparator(path) { + if (hasTrailingDirectorySeparator(path)) { + return path.substr(0, path.length - 1); + } + return path; + } + ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator; + function ensureTrailingDirectorySeparator(path) { + if (!hasTrailingDirectorySeparator(path)) { + return path + ts.directorySeparator; + } + return path; + } + ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; + /** + * Ensures a path is either absolute (prefixed with `/` or `c:`) or dot-relative (prefixed + * with `./` or `../`) so as not to be confused with an unprefixed module name. + * + * ```ts + * ensurePathIsNonModuleName("/path/to/file.ext") === "/path/to/file.ext" + * ensurePathIsNonModuleName("./path/to/file.ext") === "./path/to/file.ext" + * ensurePathIsNonModuleName("../path/to/file.ext") === "../path/to/file.ext" + * ensurePathIsNonModuleName("path/to/file.ext") === "./path/to/file.ext" + * ``` + */ + function ensurePathIsNonModuleName(path) { + return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; + } + ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName; + function changeAnyExtension(path, ext, extensions, ignoreCase) { + var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path); + return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path; + } + ts.changeAnyExtension = changeAnyExtension; + //// Path Comparisons + // check path for these segments: '', '.'. '..' + var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; + function comparePathsWorker(a, b, componentComparer) { + if (a === b) + return 0 /* EqualTo */; + if (a === undefined) + return -1 /* LessThan */; + if (b === undefined) + return 1 /* GreaterThan */; + // NOTE: Performance optimization - shortcut if the root segments differ as there would be no + // need to perform path reduction. + var aRoot = a.substring(0, getRootLength(a)); + var bRoot = b.substring(0, getRootLength(b)); + var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); + if (result !== 0 /* EqualTo */) { + return result; + } + // NOTE: Performance optimization - shortcut if there are no relative path segments in + // the non-root portion of the path + var aRest = a.substring(aRoot.length); + var bRest = b.substring(bRoot.length); + if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { + return componentComparer(aRest, bRest); + } + // The path contains a relative path segment. Normalize the paths and perform a slower component + // by component comparison. + var aComponents = reducePathComponents(getPathComponents(a)); + var bComponents = reducePathComponents(getPathComponents(b)); + var sharedLength = Math.min(aComponents.length, bComponents.length); + for (var i = 1; i < sharedLength; i++) { + var result_2 = componentComparer(aComponents[i], bComponents[i]); + if (result_2 !== 0 /* EqualTo */) { + return result_2; + } + } + return ts.compareValues(aComponents.length, bComponents.length); + } + /** + * Performs a case-sensitive comparison of two paths. Path roots are always compared case-insensitively. + */ + function comparePathsCaseSensitive(a, b) { + return comparePathsWorker(a, b, ts.compareStringsCaseSensitive); + } + ts.comparePathsCaseSensitive = comparePathsCaseSensitive; + /** + * Performs a case-insensitive comparison of two paths. + */ + function comparePathsCaseInsensitive(a, b) { + return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive); + } + ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive; + function comparePaths(a, b, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + a = combinePaths(currentDirectory, a); + b = combinePaths(currentDirectory, b); + } + else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase)); + } + ts.comparePaths = comparePaths; + function containsPath(parent, child, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + parent = combinePaths(currentDirectory, parent); + child = combinePaths(currentDirectory, child); + } + else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + if (parent === undefined || child === undefined) + return false; + if (parent === child) + return true; + var parentComponents = reducePathComponents(getPathComponents(parent)); + var childComponents = reducePathComponents(getPathComponents(child)); + if (childComponents.length < parentComponents.length) { + return false; + } + var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive; + for (var i = 0; i < parentComponents.length; i++) { + var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer; + if (!equalityComparer(parentComponents[i], childComponents[i])) { + return false; + } + } + return true; + } + ts.containsPath = containsPath; + /** + * Determines whether `fileName` starts with the specified `directoryName` using the provided path canonicalization callback. + * Comparison is case-sensitive between the canonical paths. + * + * @deprecated Use `containsPath` if possible. + */ + function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { + var canonicalFileName = getCanonicalFileName(fileName); + var canonicalDirectoryName = getCanonicalFileName(directoryName); + return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\"); + } + ts.startsWithDirectory = startsWithDirectory; + //// Relative Paths + function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { + var fromComponents = reducePathComponents(getPathComponents(from)); + var toComponents = reducePathComponents(getPathComponents(to)); + var start; + for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { + var fromComponent = getCanonicalFileName(fromComponents[start]); + var toComponent = getCanonicalFileName(toComponents[start]); + var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer; + if (!comparer(fromComponent, toComponent)) + break; + } + if (start === 0) { + return toComponents; + } + var components = toComponents.slice(start); + var relative = []; + for (; start < fromComponents.length; start++) { + relative.push(".."); + } + return __spreadArrays([""], relative, components); + } + ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo; + function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { + ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative"); + var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity; + var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; + var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName); + return getPathFromPathComponents(pathComponents); + } + ts.getRelativePathFromDirectory = getRelativePathFromDirectory; + function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { + return !isRootedDiskPath(absoluteOrRelativePath) + ? absoluteOrRelativePath + : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); + } + ts.convertToRelativePath = convertToRelativePath; + function getRelativePathFromFile(from, to, getCanonicalFileName) { + return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); + } + ts.getRelativePathFromFile = getRelativePathFromFile; + function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { + var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName); + var firstComponent = pathComponents[0]; + if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { + var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///"; + pathComponents[0] = prefix + firstComponent; + } + return getPathFromPathComponents(pathComponents); + } + ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; + function forEachAncestorDirectory(directory, callback) { + while (true) { + var result = callback(directory); + if (result !== undefined) { + return result; + } + var parentPath = getDirectoryPath(directory); + if (parentPath === directory) { + return undefined; + } + directory = parentPath; + } + } + ts.forEachAncestorDirectory = forEachAncestorDirectory; + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + ts.isNodeModulesDirectory = isNodeModulesDirectory; +})(ts || (ts = {})); // // generated from './diagnosticInformationMap.generated.ts' by 'src/compiler' /* @internal */ @@ -7719,7 +7155,7 @@ var ts; Accessibility_modifier_already_seen: diag(1028, ts.DiagnosticCategory.Error, "Accessibility_modifier_already_seen_1028", "Accessibility modifier already seen."), _0_modifier_must_precede_1_modifier: diag(1029, ts.DiagnosticCategory.Error, "_0_modifier_must_precede_1_modifier_1029", "'{0}' modifier must precede '{1}' modifier."), _0_modifier_already_seen: diag(1030, ts.DiagnosticCategory.Error, "_0_modifier_already_seen_1030", "'{0}' modifier already seen."), - _0_modifier_cannot_appear_on_class_elements_of_this_kind: diag(1031, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031", "'{0}' modifier cannot appear on class elements of this kind."), + _0_modifier_cannot_appear_on_a_class_element: diag(1031, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_class_element_1031", "'{0}' modifier cannot appear on a class element."), super_must_be_followed_by_an_argument_list_or_member_access: diag(1034, ts.DiagnosticCategory.Error, "super_must_be_followed_by_an_argument_list_or_member_access_1034", "'super' must be followed by an argument list or member access."), Only_ambient_modules_can_use_quoted_names: diag(1035, ts.DiagnosticCategory.Error, "Only_ambient_modules_can_use_quoted_names_1035", "Only ambient modules can use quoted names."), Statements_are_not_allowed_in_ambient_contexts: diag(1036, ts.DiagnosticCategory.Error, "Statements_are_not_allowed_in_ambient_contexts_1036", "Statements are not allowed in ambient contexts."), @@ -7859,7 +7295,7 @@ var ts; Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, ts.DiagnosticCategory.Error, "Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205", "Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."), Decorators_are_not_valid_here: diag(1206, ts.DiagnosticCategory.Error, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, ts.DiagnosticCategory.Error, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), - _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, ts.DiagnosticCategory.Error, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."), + All_files_must_be_modules_when_the_isolatedModules_flag_is_provided: diag(1208, ts.DiagnosticCategory.Error, "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208", "All files must be modules when the '--isolatedModules' flag is provided."), Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: diag(1210, ts.DiagnosticCategory.Error, "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", "Invalid use of '{0}'. Class definitions are automatically in strict mode."), A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, ts.DiagnosticCategory.Error, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), Identifier_expected_0_is_a_reserved_word_in_strict_mode: diag(1212, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", "Identifier expected. '{0}' is a reserved word in strict mode."), @@ -7907,12 +7343,11 @@ var ts; A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, ts.DiagnosticCategory.Error, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."), A_rest_element_must_be_last_in_a_tuple_type: diag(1256, ts.DiagnosticCategory.Error, "A_rest_element_must_be_last_in_a_tuple_type_1256", "A rest element must be last in a tuple type."), A_required_element_cannot_follow_an_optional_element: diag(1257, ts.DiagnosticCategory.Error, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."), + Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation: diag(1258, ts.DiagnosticCategory.Error, "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258", "Definite assignment assertions can only be used along with a type annotation."), Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, ts.DiagnosticCategory.Error, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"), Keywords_cannot_contain_escape_characters: diag(1260, ts.DiagnosticCategory.Error, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."), Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, ts.DiagnosticCategory.Error, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."), Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."), - Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, ts.DiagnosticCategory.Error, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."), - Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, ts.DiagnosticCategory.Error, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."), with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."), @@ -7929,7 +7364,7 @@ var ts; Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_or_umd: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'esnext', 'commonjs', 'amd', 'system', or 'umd'."), Dynamic_import_must_have_one_specifier_as_an_argument: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_import_must_have_one_specifier_as_an_argument_1324", "Dynamic import must have one specifier as an argument."), Specifier_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Specifier_of_dynamic_import_cannot_be_spread_element_1325", "Specifier of dynamic import cannot be spread element."), - Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments."), + Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments"), String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."), Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: diag(1328, ts.DiagnosticCategory.Error, "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328", "Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."), _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: diag(1329, ts.DiagnosticCategory.Error, "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329", "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"), @@ -7945,9 +7380,9 @@ var ts; Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."), - The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system_1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'."), + The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system_1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'esnext' or 'system'."), A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), - An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), + An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness"), This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."), use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, ts.DiagnosticCategory.Error, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."), Non_simple_parameter_declared_here: diag(1348, ts.DiagnosticCategory.Error, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."), @@ -7990,7 +7425,6 @@ var ts; Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."), - _0_is_not_allowed_as_a_variable_declaration_name: diag(1389, ts.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."), The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true), @@ -8116,7 +7550,6 @@ var ts; Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts.DiagnosticCategory.Error, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), - Types_of_construct_signatures_are_incompatible: diag(2419, ts.DiagnosticCategory.Error, "Types_of_construct_signatures_are_incompatible_2419", "Types of construct signatures are incompatible."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), @@ -8240,7 +7673,6 @@ var ts; The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: diag(2547, ts.DiagnosticCategory.Error, "The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547", "The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."), Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2548, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."), Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2549, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."), - Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later: diag(2550, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550", "Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later."), Property_0_does_not_exist_on_type_1_Did_you_mean_2: diag(2551, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", "Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"), Cannot_find_name_0_Did_you_mean_1: diag(2552, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Did_you_mean_1_2552", "Cannot find name '{0}'. Did you mean '{1}'?"), Computed_values_are_not_permitted_in_an_enum_with_string_valued_members: diag(2553, ts.DiagnosticCategory.Error, "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553", "Computed values are not permitted in an enum with string valued members."), @@ -8264,13 +7696,13 @@ var ts; Property_0_is_incompatible_with_rest_element_type: diag(2573, ts.DiagnosticCategory.Error, "Property_0_is_incompatible_with_rest_element_type_2573", "Property '{0}' is incompatible with rest element type."), A_rest_element_type_must_be_an_array_type: diag(2574, ts.DiagnosticCategory.Error, "A_rest_element_type_must_be_an_array_type_2574", "A rest element type must be an array type."), No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), - Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'."), + Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"), Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), Unused_ts_expect_error_directive: diag(2578, ts.DiagnosticCategory.Error, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."), - Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."), + Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."), @@ -8278,9 +7710,9 @@ var ts; Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), Type_instantiation_is_excessively_deep_and_possibly_infinite: diag(2589, ts.DiagnosticCategory.Error, "Type_instantiation_is_excessively_deep_and_possibly_infinite_2589", "Type instantiation is excessively deep and possibly infinite."), Expression_produces_a_union_type_that_is_too_complex_to_represent: diag(2590, ts.DiagnosticCategory.Error, "Expression_produces_a_union_type_that_is_too_complex_to_represent_2590", "Expression produces a union type that is too complex to represent."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."), This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, ts.DiagnosticCategory.Error, "This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594", "This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag."), _0_can_only_be_imported_by_using_a_default_import: diag(2595, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."), _0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."), @@ -8348,7 +7780,6 @@ var ts; All_declarations_of_0_must_have_identical_modifiers: diag(2687, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_modifiers_2687", "All declarations of '{0}' must have identical modifiers."), Cannot_find_type_definition_file_for_0: diag(2688, ts.DiagnosticCategory.Error, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, ts.DiagnosticCategory.Error, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), - _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, ts.DiagnosticCategory.Error, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."), _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, ts.DiagnosticCategory.Error, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), @@ -8382,7 +7813,7 @@ var ts; Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), - _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"), + Module_0_has_no_exported_member_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_2_2724", "Module '{0}' has no exported member '{1}'. Did you mean '{2}'?"), Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, ts.DiagnosticCategory.Error, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."), Cannot_find_lib_definition_for_0: diag(2726, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."), Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"), @@ -8390,7 +7821,7 @@ var ts; Property_0_is_used_before_its_initialization: diag(2729, ts.DiagnosticCategory.Error, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."), An_arrow_function_cannot_have_a_this_parameter: diag(2730, ts.DiagnosticCategory.Error, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."), Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."), - Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."), + Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension"), Property_0_was_also_declared_here: diag(2733, ts.DiagnosticCategory.Error, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."), Are_you_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"), Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"), @@ -8451,10 +7882,6 @@ var ts; The_operand_of_a_delete_operator_must_be_optional: diag(2790, ts.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_must_be_optional_2790", "The operand of a 'delete' operator must be optional."), Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: diag(2791, ts.DiagnosticCategory.Error, "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791", "Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."), Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option: diag(2792, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792", "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"), - The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: diag(2793, ts.DiagnosticCategory.Error, "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793", "The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."), - Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: diag(2794, ts.DiagnosticCategory.Error, "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794", "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"), - The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, ts.DiagnosticCategory.Error, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."), - It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked: diag(2796, ts.DiagnosticCategory.Error, "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796", "It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -8568,6 +7995,7 @@ var ts; Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: diag(5057, ts.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", "Cannot find a tsconfig.json file at the specified directory: '{0}'."), The_specified_path_does_not_exist_Colon_0: diag(5058, ts.DiagnosticCategory.Error, "The_specified_path_does_not_exist_Colon_0_5058", "The specified path does not exist: '{0}'."), Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, ts.DiagnosticCategory.Error, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."), + Option_paths_cannot_be_used_without_specifying_baseUrl_option: diag(5060, ts.DiagnosticCategory.Error, "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", "Option 'paths' cannot be used without specifying '--baseUrl' option."), Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, ts.DiagnosticCategory.Error, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."), Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: diag(5062, ts.DiagnosticCategory.Error, "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' can have at most one '*' character."), Substitutions_for_pattern_0_should_be_an_array: diag(5063, ts.DiagnosticCategory.Error, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."), @@ -8596,8 +8024,6 @@ var ts; A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: diag(5086, ts.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086", "A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."), A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, ts.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087", "A labeled tuple element is declared as rest with a `...` before the name, rather than before the type."), The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), - Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, ts.DiagnosticCategory.Error, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), - Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, ts.DiagnosticCategory.Error, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -8788,7 +8214,7 @@ var ts; Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"), _0_was_also_declared_here: diag(6203, ts.DiagnosticCategory.Message, "_0_was_also_declared_here_6203", "'{0}' was also declared here."), and_here: diag(6204, ts.DiagnosticCategory.Message, "and_here_6204", "and here."), - All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused."), + All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused"), package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."), package_json_does_not_have_a_typesVersions_entry_that_matches_version_0: diag(6207, ts.DiagnosticCategory.Message, "package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207", "'package.json' does not have a 'typesVersions' entry that matches version '{0}'."), package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2: diag(6208, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208", "'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."), @@ -8820,8 +8246,6 @@ var ts; This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without: diag(6234, ts.DiagnosticCategory.Error, "This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234", "This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"), Disable_loading_referenced_projects: diag(6235, ts.DiagnosticCategory.Message, "Disable_loading_referenced_projects_6235", "Disable loading referenced projects."), Arguments_for_the_rest_parameter_0_were_not_provided: diag(6236, ts.DiagnosticCategory.Error, "Arguments_for_the_rest_parameter_0_were_not_provided_6236", "Arguments for the rest parameter '{0}' were not provided."), - Generates_an_event_trace_and_a_list_of_types: diag(6237, ts.DiagnosticCategory.Message, "Generates_an_event_trace_and_a_list_of_types_6237", "Generates an event trace and a list of types."), - Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react: diag(6238, ts.DiagnosticCategory.Error, "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238", "Specify the module specifier to be used to import the `jsx` and `jsxs` factory functions from. eg, react"), Projects_to_reference: diag(6300, ts.DiagnosticCategory.Message, "Projects_to_reference_6300", "Projects to reference"), Enable_project_compilation: diag(6302, ts.DiagnosticCategory.Message, "Enable_project_compilation_6302", "Enable project compilation"), Composite_projects_may_not_disable_declaration_emit: diag(6304, ts.DiagnosticCategory.Error, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), @@ -8867,13 +8291,11 @@ var ts; Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, ts.DiagnosticCategory.Message, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"), Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, ts.DiagnosticCategory.Message, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."), _0_is_deprecated: diag(6385, ts.DiagnosticCategory.Suggestion, "_0_is_deprecated_6385", "'{0}' is deprecated", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ undefined, /*reportsDeprecated*/ true), - Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, ts.DiagnosticCategory.Message, "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386", "Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing: diag(6503, ts.DiagnosticCategory.Message, "Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503", "Print names of files that are part of the compilation and then stop processing."), File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, ts.DiagnosticCategory.Error, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"), - Include_undefined_in_index_signature_results: diag(6800, ts.DiagnosticCategory.Message, "Include_undefined_in_index_signature_results_6800", "Include 'undefined' in index signature results"), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -8901,7 +8323,7 @@ var ts; Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: diag(7032, ts.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."), Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: diag(7033, ts.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."), Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), - Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035", "Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), + Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035", "Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts.DiagnosticCategory.Error, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead: diag(7038, ts.DiagnosticCategory.Message, "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038", "Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."), @@ -8922,7 +8344,6 @@ var ts; Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: diag(7053, ts.DiagnosticCategory.Error, "Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053", "Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."), No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1: diag(7054, ts.DiagnosticCategory.Error, "No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054", "No index signature with a parameter of type '{0}' was found on type '{1}'."), _0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type: diag(7055, ts.DiagnosticCategory.Error, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055", "'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."), - The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed: diag(7056, ts.DiagnosticCategory.Error, "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056", "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."), @@ -9033,7 +8454,6 @@ var ts; Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), - Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), Extract_function: diag(95005, ts.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"), Extract_constant: diag(95006, ts.DiagnosticCategory.Message, "Extract_constant_95006", "Extract constant"), @@ -9051,7 +8471,6 @@ var ts; Add_undefined_type_to_property_0: diag(95018, ts.DiagnosticCategory.Message, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"), Add_initializer_to_property_0: diag(95019, ts.DiagnosticCategory.Message, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"), Add_definite_assignment_assertion_to_property_0: diag(95020, ts.DiagnosticCategory.Message, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"), - Convert_all_type_literals_to_mapped_type: diag(95021, ts.DiagnosticCategory.Message, "Convert_all_type_literals_to_mapped_type_95021", "Convert all type literals to mapped type"), Add_all_missing_members: diag(95022, ts.DiagnosticCategory.Message, "Add_all_missing_members_95022", "Add all missing members"), Infer_all_types_from_usage: diag(95023, ts.DiagnosticCategory.Message, "Infer_all_types_from_usage_95023", "Infer all types from usage"), Delete_all_unused_declarations: diag(95024, ts.DiagnosticCategory.Message, "Delete_all_unused_declarations_95024", "Delete all unused declarations"), @@ -9173,12 +8592,10 @@ var ts; Could_not_find_convertible_access_expression: diag(95140, ts.DiagnosticCategory.Message, "Could_not_find_convertible_access_expression_95140", "Could not find convertible access expression"), Could_not_find_matching_access_expressions: diag(95141, ts.DiagnosticCategory.Message, "Could_not_find_matching_access_expressions_95141", "Could not find matching access expressions"), Can_only_convert_logical_AND_access_chains: diag(95142, ts.DiagnosticCategory.Message, "Can_only_convert_logical_AND_access_chains_95142", "Can only convert logical AND access chains"), - Add_void_to_Promise_resolved_without_a_value: diag(95143, ts.DiagnosticCategory.Message, "Add_void_to_Promise_resolved_without_a_value_95143", "Add 'void' to Promise resolved without a value"), - Add_void_to_all_Promises_resolved_without_a_value: diag(95144, ts.DiagnosticCategory.Message, "Add_void_to_all_Promises_resolved_without_a_value_95144", "Add 'void' to all Promises resolved without a value"), No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."), Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."), JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"), - Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts.DiagnosticCategory.Error, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters."), + Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts.DiagnosticCategory.Error, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters"), An_accessibility_modifier_cannot_be_used_with_a_private_identifier: diag(18010, ts.DiagnosticCategory.Error, "An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010", "An accessibility modifier cannot be used with a private identifier."), The_operand_of_a_delete_operator_cannot_be_a_private_identifier: diag(18011, ts.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011", "The operand of a 'delete' operator cannot be a private identifier."), constructor_is_a_reserved_word: diag(18012, ts.DiagnosticCategory.Error, "constructor_is_a_reserved_word_18012", "'#constructor' is a reserved word."), @@ -9188,7 +8605,7 @@ var ts; Private_identifiers_are_not_allowed_outside_class_bodies: diag(18016, ts.DiagnosticCategory.Error, "Private_identifiers_are_not_allowed_outside_class_bodies_18016", "Private identifiers are not allowed outside class bodies."), The_shadowing_declaration_of_0_is_defined_here: diag(18017, ts.DiagnosticCategory.Error, "The_shadowing_declaration_of_0_is_defined_here_18017", "The shadowing declaration of '{0}' is defined here"), The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here: diag(18018, ts.DiagnosticCategory.Error, "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018", "The declaration of '{0}' that you probably intended to use is defined here"), - _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier."), + _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier"), A_method_cannot_be_named_with_a_private_identifier: diag(18022, ts.DiagnosticCategory.Error, "A_method_cannot_be_named_with_a_private_identifier_18022", "A method cannot be named with a private identifier."), An_accessor_cannot_be_named_with_a_private_identifier: diag(18023, ts.DiagnosticCategory.Error, "An_accessor_cannot_be_named_with_a_private_identifier_18023", "An accessor cannot be named with a private identifier."), An_enum_member_cannot_be_named_with_a_private_identifier: diag(18024, ts.DiagnosticCategory.Error, "An_enum_member_cannot_be_named_with_a_private_identifier_18024", "An enum member cannot be named with a private identifier."), @@ -9222,7 +8639,7 @@ var ts; any: 128 /* AnyKeyword */, as: 126 /* AsKeyword */, asserts: 127 /* AssertsKeyword */, - bigint: 155 /* BigIntKeyword */, + bigint: 154 /* BigIntKeyword */, boolean: 131 /* BooleanKeyword */, break: 80 /* BreakKeyword */, case: 81 /* CaseKeyword */, @@ -9244,7 +8661,7 @@ var ts; _a.false = 94 /* FalseKeyword */, _a.finally = 95 /* FinallyKeyword */, _a.for = 96 /* ForKeyword */, - _a.from = 153 /* FromKeyword */, + _a.from = 152 /* FromKeyword */, _a.function = 97 /* FunctionKeyword */, _a.get = 134 /* GetKeyword */, _a.if = 98 /* IfKeyword */, @@ -9254,40 +8671,39 @@ var ts; _a.infer = 135 /* InferKeyword */, _a.instanceof = 101 /* InstanceOfKeyword */, _a.interface = 117 /* InterfaceKeyword */, - _a.intrinsic = 136 /* IntrinsicKeyword */, - _a.is = 137 /* IsKeyword */, - _a.keyof = 138 /* KeyOfKeyword */, + _a.is = 136 /* IsKeyword */, + _a.keyof = 137 /* KeyOfKeyword */, _a.let = 118 /* LetKeyword */, - _a.module = 139 /* ModuleKeyword */, - _a.namespace = 140 /* NamespaceKeyword */, - _a.never = 141 /* NeverKeyword */, + _a.module = 138 /* ModuleKeyword */, + _a.namespace = 139 /* NamespaceKeyword */, + _a.never = 140 /* NeverKeyword */, _a.new = 102 /* NewKeyword */, _a.null = 103 /* NullKeyword */, - _a.number = 144 /* NumberKeyword */, - _a.object = 145 /* ObjectKeyword */, + _a.number = 143 /* NumberKeyword */, + _a.object = 144 /* ObjectKeyword */, _a.package = 119 /* PackageKeyword */, _a.private = 120 /* PrivateKeyword */, _a.protected = 121 /* ProtectedKeyword */, _a.public = 122 /* PublicKeyword */, - _a.readonly = 142 /* ReadonlyKeyword */, - _a.require = 143 /* RequireKeyword */, - _a.global = 154 /* GlobalKeyword */, + _a.readonly = 141 /* ReadonlyKeyword */, + _a.require = 142 /* RequireKeyword */, + _a.global = 153 /* GlobalKeyword */, _a.return = 104 /* ReturnKeyword */, - _a.set = 146 /* SetKeyword */, + _a.set = 145 /* SetKeyword */, _a.static = 123 /* StaticKeyword */, - _a.string = 147 /* StringKeyword */, + _a.string = 146 /* StringKeyword */, _a.super = 105 /* SuperKeyword */, _a.switch = 106 /* SwitchKeyword */, - _a.symbol = 148 /* SymbolKeyword */, + _a.symbol = 147 /* SymbolKeyword */, _a.this = 107 /* ThisKeyword */, _a.throw = 108 /* ThrowKeyword */, _a.true = 109 /* TrueKeyword */, _a.try = 110 /* TryKeyword */, - _a.type = 149 /* TypeKeyword */, + _a.type = 148 /* TypeKeyword */, _a.typeof = 111 /* TypeOfKeyword */, - _a.undefined = 150 /* UndefinedKeyword */, - _a.unique = 151 /* UniqueKeyword */, - _a.unknown = 152 /* UnknownKeyword */, + _a.undefined = 149 /* UndefinedKeyword */, + _a.unique = 150 /* UniqueKeyword */, + _a.unknown = 151 /* UnknownKeyword */, _a.var = 112 /* VarKeyword */, _a.void = 113 /* VoidKeyword */, _a.while = 114 /* WhileKeyword */, @@ -9295,7 +8711,7 @@ var ts; _a.yield = 124 /* YieldKeyword */, _a.async = 129 /* AsyncKeyword */, _a.await = 130 /* AwaitKeyword */, - _a.of = 156 /* OfKeyword */, + _a.of = 155 /* OfKeyword */, _a); var textToKeyword = new ts.Map(ts.getEntries(textToKeywordObj)); var textToToken = new ts.Map(ts.getEntries(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 77 /* CaretEqualsToken */, "||=": 74 /* BarBarEqualsToken */, "&&=": 75 /* AmpersandAmpersandEqualsToken */, "??=": 76 /* QuestionQuestionEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ }))); @@ -10476,9 +9892,9 @@ var ts; return result; } function getIdentifierToken() { - // Reserved words are between 2 and 12 characters long and start with a lowercase letter + // Reserved words are between 2 and 11 characters long and start with a lowercase letter var len = tokenValue.length; - if (len >= 2 && len <= 12) { + if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 /* a */ && ch <= 122 /* z */) { var keyword = textToKeyword.get(tokenValue); @@ -11681,9 +11097,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 159 /* TypeParameter */) { + if (d && d.kind === 158 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 253 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 250 /* InterfaceDeclaration */) { return current; } } @@ -11691,7 +11107,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 166 /* Constructor */; + return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 165 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -11721,14 +11137,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 249 /* VariableDeclaration */) { + if (node.kind === 246 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 250 /* VariableDeclarationList */) { + if (node && node.kind === 247 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 232 /* VariableStatement */) { + if (node && node.kind === 229 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -11819,20 +11235,6 @@ var ts; return !nodeTest || nodeTest(node) ? node : undefined; } ts.getOriginalNode = getOriginalNode; - function findAncestor(node, callback) { - while (node) { - var result = callback(node); - if (result === "quit") { - return undefined; - } - else if (result) { - return node; - } - node = node.parent; - } - return undefined; - } - ts.findAncestor = findAncestor; /** * Gets a value indicating whether a node originated in the parse tree. * @@ -11898,30 +11300,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 216 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 213 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return expr.name; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; } } break; - case 207 /* ParenthesizedExpression */: { + case 204 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 245 /* LabeledStatement */: { + case 242 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -11958,16 +11360,16 @@ var ts; switch (declaration.kind) { case 78 /* Identifier */: return declaration; - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: { + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 157 /* QualifiedName */) { + if (name.kind === 156 /* QualifiedName */) { return name.right; } break; } - case 203 /* CallExpression */: - case 216 /* BinaryExpression */: { + case 200 /* CallExpression */: + case 213 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -11983,15 +11385,15 @@ var ts; return undefined; } } - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 325 /* JSDocEnumTag */: + case 321 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -12286,7 +11688,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 311 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 307 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -12318,7 +11720,7 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 168 /* SetAccessor */ || node.kind === 167 /* GetAccessor */; + return node.kind === 167 /* SetAccessor */ || node.kind === 166 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; function isPropertyAccessChain(node) { @@ -12336,10 +11738,10 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 201 /* PropertyAccessExpression */ - || kind === 202 /* ElementAccessExpression */ - || kind === 203 /* CallExpression */ - || kind === 225 /* NonNullExpression */); + (kind === 198 /* PropertyAccessExpression */ + || kind === 199 /* ElementAccessExpression */ + || kind === 200 /* CallExpression */ + || kind === 222 /* NonNullExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ @@ -12374,7 +11776,7 @@ var ts; } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isConstTypeReference(node) { @@ -12391,17 +11793,17 @@ var ts; } ts.isNonNullChain = isNonNullChain; function isBreakOrContinueStatement(node) { - return node.kind === 241 /* BreakStatement */ || node.kind === 240 /* ContinueStatement */; + return node.kind === 238 /* BreakStatement */ || node.kind === 237 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isNamedExportBindings(node) { - return node.kind === 269 /* NamespaceExport */ || node.kind === 268 /* NamedExports */; + return node.kind === 266 /* NamespaceExport */ || node.kind === 265 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isUnparsedTextLike(node) { switch (node.kind) { - case 294 /* UnparsedText */: - case 295 /* UnparsedInternalText */: + case 291 /* UnparsedText */: + case 292 /* UnparsedInternalText */: return true; default: return false; @@ -12410,12 +11812,12 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 292 /* UnparsedPrologue */ || - node.kind === 296 /* UnparsedSyntheticReference */; + node.kind === 289 /* UnparsedPrologue */ || + node.kind === 293 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; function isJSDocPropertyLikeTag(node) { - return node.kind === 333 /* JSDocPropertyTag */ || node.kind === 326 /* JSDocParameterTag */; + return node.kind === 328 /* JSDocPropertyTag */ || node.kind === 322 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; // #endregion @@ -12431,7 +11833,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 157 /* FirstNode */; + return kind >= 156 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -12440,7 +11842,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 156 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 155 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -12481,12 +11883,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return node.parent.isTypeOnly; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -12527,7 +11929,7 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 123 /* StaticKeyword */: return true; } @@ -12550,7 +11952,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 157 /* QualifiedName */ + return kind === 156 /* QualifiedName */ || kind === 78 /* Identifier */; } ts.isEntityName = isEntityName; @@ -12560,14 +11962,14 @@ var ts; || kind === 79 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 158 /* ComputedPropertyName */; + || kind === 157 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 78 /* Identifier */ - || kind === 196 /* ObjectBindingPattern */ - || kind === 197 /* ArrayBindingPattern */; + || kind === 193 /* ObjectBindingPattern */ + || kind === 194 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12582,13 +11984,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; default: return false; @@ -12597,14 +11999,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 174 /* FunctionType */: - case 308 /* JSDocFunctionType */: - case 175 /* ConstructorType */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 173 /* FunctionType */: + case 304 /* JSDocFunctionType */: + case 174 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12619,29 +12021,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 166 /* Constructor */ - || kind === 163 /* PropertyDeclaration */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 171 /* IndexSignature */ - || kind === 229 /* SemicolonClassElement */; + return kind === 165 /* Constructor */ + || kind === 162 /* PropertyDeclaration */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 170 /* IndexSignature */ + || kind === 226 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */); + return node && (node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */); + return node && (node.kind === 166 /* GetAccessor */ || node.kind === 167 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return true; default: return false; @@ -12651,11 +12053,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 170 /* ConstructSignature */ - || kind === 169 /* CallSignature */ - || kind === 162 /* PropertySignature */ - || kind === 164 /* MethodSignature */ - || kind === 171 /* IndexSignature */; + return kind === 169 /* ConstructSignature */ + || kind === 168 /* CallSignature */ + || kind === 161 /* PropertySignature */ + || kind === 163 /* MethodSignature */ + || kind === 170 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12664,12 +12066,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 288 /* PropertyAssignment */ - || kind === 289 /* ShorthandPropertyAssignment */ - || kind === 290 /* SpreadAssignment */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 285 /* PropertyAssignment */ + || kind === 286 /* ShorthandPropertyAssignment */ + || kind === 287 /* SpreadAssignment */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12684,8 +12086,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return true; } return false; @@ -12696,8 +12098,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 197 /* ArrayBindingPattern */ - || kind === 196 /* ObjectBindingPattern */; + return kind === 194 /* ArrayBindingPattern */ + || kind === 193 /* ObjectBindingPattern */; } return false; } @@ -12705,15 +12107,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 199 /* ArrayLiteralExpression */ - || kind === 200 /* ObjectLiteralExpression */; + return kind === 196 /* ArrayLiteralExpression */ + || kind === 197 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 198 /* BindingElement */ - || kind === 222 /* OmittedExpression */; + return kind === 195 /* BindingElement */ + || kind === 219 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12722,9 +12124,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: return true; } return false; @@ -12745,8 +12147,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 196 /* ObjectBindingPattern */: - case 200 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 197 /* ObjectLiteralExpression */: return true; } return false; @@ -12758,8 +12160,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: return true; } return false; @@ -12768,26 +12170,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 201 /* PropertyAccessExpression */ - || kind === 157 /* QualifiedName */ - || kind === 195 /* ImportType */; + return kind === 198 /* PropertyAccessExpression */ + || kind === 156 /* QualifiedName */ + || kind === 192 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 201 /* PropertyAccessExpression */ - || kind === 157 /* QualifiedName */; + return kind === 198 /* PropertyAccessExpression */ + || kind === 156 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 161 /* Decorator */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 160 /* Decorator */: return true; default: return false; @@ -12795,12 +12197,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 203 /* CallExpression */ || node.kind === 204 /* NewExpression */; + return node.kind === 200 /* CallExpression */ || node.kind === 201 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 218 /* TemplateExpression */ + return kind === 215 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12811,33 +12213,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 204 /* NewExpression */: - case 203 /* CallExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: - case 205 /* TaggedTemplateExpression */: - case 199 /* ArrayLiteralExpression */: - case 207 /* ParenthesizedExpression */: - case 200 /* ObjectLiteralExpression */: - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 201 /* NewExpression */: + case 200 /* CallExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: + case 202 /* TaggedTemplateExpression */: + case 196 /* ArrayLiteralExpression */: + case 204 /* ParenthesizedExpression */: + case 197 /* ObjectLiteralExpression */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: case 78 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: case 94 /* FalseKeyword */: case 103 /* NullKeyword */: case 107 /* ThisKeyword */: case 109 /* TrueKeyword */: case 105 /* SuperKeyword */: - case 225 /* NonNullExpression */: - case 226 /* MetaProperty */: + case 222 /* NonNullExpression */: + case 223 /* MetaProperty */: case 99 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12851,13 +12253,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: - case 210 /* DeleteExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 213 /* AwaitExpression */: - case 206 /* TypeAssertionExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 207 /* DeleteExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 210 /* AwaitExpression */: + case 203 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12866,9 +12268,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return true; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12887,15 +12289,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 217 /* ConditionalExpression */: - case 219 /* YieldExpression */: - case 209 /* ArrowFunction */: - case 216 /* BinaryExpression */: - case 220 /* SpreadElement */: - case 224 /* AsExpression */: - case 222 /* OmittedExpression */: - case 337 /* CommaListExpression */: - case 336 /* PartiallyEmittedExpression */: + case 214 /* ConditionalExpression */: + case 216 /* YieldExpression */: + case 206 /* ArrowFunction */: + case 213 /* BinaryExpression */: + case 217 /* SpreadElement */: + case 221 /* AsExpression */: + case 219 /* OmittedExpression */: + case 332 /* CommaListExpression */: + case 331 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12903,8 +12305,8 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 206 /* TypeAssertionExpression */ - || kind === 224 /* AsExpression */; + return kind === 203 /* TypeAssertionExpression */ + || kind === 221 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ @@ -12915,13 +12317,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return true; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12950,7 +12352,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 238 /* ForInStatement */ || node.kind === 239 /* ForOfStatement */; + return node.kind === 235 /* ForInStatement */ || node.kind === 236 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12974,114 +12376,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 257 /* ModuleBlock */ - || kind === 256 /* ModuleDeclaration */ + return kind === 254 /* ModuleBlock */ + || kind === 253 /* ModuleDeclaration */ || kind === 78 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 257 /* ModuleBlock */ - || kind === 256 /* ModuleDeclaration */; + return kind === 254 /* ModuleBlock */ + || kind === 253 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 78 /* Identifier */ - || kind === 256 /* ModuleDeclaration */; + || kind === 253 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 264 /* NamedImports */ - || kind === 263 /* NamespaceImport */; + return kind === 261 /* NamedImports */ + || kind === 260 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */ || node.kind === 255 /* EnumDeclaration */; + return node.kind === 253 /* ModuleDeclaration */ || node.kind === 252 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 209 /* ArrowFunction */ - || kind === 198 /* BindingElement */ - || kind === 252 /* ClassDeclaration */ - || kind === 221 /* ClassExpression */ - || kind === 166 /* Constructor */ - || kind === 255 /* EnumDeclaration */ - || kind === 291 /* EnumMember */ - || kind === 270 /* ExportSpecifier */ - || kind === 251 /* FunctionDeclaration */ - || kind === 208 /* FunctionExpression */ - || kind === 167 /* GetAccessor */ - || kind === 262 /* ImportClause */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 265 /* ImportSpecifier */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 280 /* JsxAttribute */ - || kind === 165 /* MethodDeclaration */ - || kind === 164 /* MethodSignature */ - || kind === 256 /* ModuleDeclaration */ - || kind === 259 /* NamespaceExportDeclaration */ - || kind === 263 /* NamespaceImport */ - || kind === 269 /* NamespaceExport */ - || kind === 160 /* Parameter */ - || kind === 288 /* PropertyAssignment */ - || kind === 163 /* PropertyDeclaration */ - || kind === 162 /* PropertySignature */ - || kind === 168 /* SetAccessor */ - || kind === 289 /* ShorthandPropertyAssignment */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 159 /* TypeParameter */ - || kind === 249 /* VariableDeclaration */ - || kind === 331 /* JSDocTypedefTag */ - || kind === 324 /* JSDocCallbackTag */ - || kind === 333 /* JSDocPropertyTag */; + return kind === 206 /* ArrowFunction */ + || kind === 195 /* BindingElement */ + || kind === 249 /* ClassDeclaration */ + || kind === 218 /* ClassExpression */ + || kind === 165 /* Constructor */ + || kind === 252 /* EnumDeclaration */ + || kind === 288 /* EnumMember */ + || kind === 267 /* ExportSpecifier */ + || kind === 248 /* FunctionDeclaration */ + || kind === 205 /* FunctionExpression */ + || kind === 166 /* GetAccessor */ + || kind === 259 /* ImportClause */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 262 /* ImportSpecifier */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 277 /* JsxAttribute */ + || kind === 164 /* MethodDeclaration */ + || kind === 163 /* MethodSignature */ + || kind === 253 /* ModuleDeclaration */ + || kind === 256 /* NamespaceExportDeclaration */ + || kind === 260 /* NamespaceImport */ + || kind === 266 /* NamespaceExport */ + || kind === 159 /* Parameter */ + || kind === 285 /* PropertyAssignment */ + || kind === 162 /* PropertyDeclaration */ + || kind === 161 /* PropertySignature */ + || kind === 167 /* SetAccessor */ + || kind === 286 /* ShorthandPropertyAssignment */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 158 /* TypeParameter */ + || kind === 246 /* VariableDeclaration */ + || kind === 327 /* JSDocTypedefTag */ + || kind === 320 /* JSDocCallbackTag */ + || kind === 328 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 251 /* FunctionDeclaration */ - || kind === 271 /* MissingDeclaration */ - || kind === 252 /* ClassDeclaration */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 255 /* EnumDeclaration */ - || kind === 256 /* ModuleDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 267 /* ExportDeclaration */ - || kind === 266 /* ExportAssignment */ - || kind === 259 /* NamespaceExportDeclaration */; + return kind === 248 /* FunctionDeclaration */ + || kind === 268 /* MissingDeclaration */ + || kind === 249 /* ClassDeclaration */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 252 /* EnumDeclaration */ + || kind === 253 /* ModuleDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 264 /* ExportDeclaration */ + || kind === 263 /* ExportAssignment */ + || kind === 256 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 241 /* BreakStatement */ - || kind === 240 /* ContinueStatement */ - || kind === 248 /* DebuggerStatement */ - || kind === 235 /* DoStatement */ - || kind === 233 /* ExpressionStatement */ - || kind === 231 /* EmptyStatement */ - || kind === 238 /* ForInStatement */ - || kind === 239 /* ForOfStatement */ - || kind === 237 /* ForStatement */ - || kind === 234 /* IfStatement */ - || kind === 245 /* LabeledStatement */ - || kind === 242 /* ReturnStatement */ - || kind === 244 /* SwitchStatement */ - || kind === 246 /* ThrowStatement */ - || kind === 247 /* TryStatement */ - || kind === 232 /* VariableStatement */ - || kind === 236 /* WhileStatement */ - || kind === 243 /* WithStatement */ - || kind === 335 /* NotEmittedStatement */ - || kind === 339 /* EndOfDeclarationMarker */ - || kind === 338 /* MergeDeclarationMarker */; + return kind === 238 /* BreakStatement */ + || kind === 237 /* ContinueStatement */ + || kind === 245 /* DebuggerStatement */ + || kind === 232 /* DoStatement */ + || kind === 230 /* ExpressionStatement */ + || kind === 228 /* EmptyStatement */ + || kind === 235 /* ForInStatement */ + || kind === 236 /* ForOfStatement */ + || kind === 234 /* ForStatement */ + || kind === 231 /* IfStatement */ + || kind === 242 /* LabeledStatement */ + || kind === 239 /* ReturnStatement */ + || kind === 241 /* SwitchStatement */ + || kind === 243 /* ThrowStatement */ + || kind === 244 /* TryStatement */ + || kind === 229 /* VariableStatement */ + || kind === 233 /* WhileStatement */ + || kind === 240 /* WithStatement */ + || kind === 330 /* NotEmittedStatement */ + || kind === 334 /* EndOfDeclarationMarker */ + || kind === 333 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 159 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 330 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 158 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 326 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -13108,10 +12510,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 230 /* Block */) + if (node.kind !== 227 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 247 /* TryStatement */ || node.parent.kind === 287 /* CatchClause */) { + if (node.parent.kind === 244 /* TryStatement */ || node.parent.kind === 284 /* CatchClause */) { return false; } } @@ -13125,15 +12527,15 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 230 /* Block */; + || kind === 227 /* Block */; } ts.isStatementOrBlock = isStatementOrBlock; // Module references /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 272 /* ExternalModuleReference */ - || kind === 157 /* QualifiedName */ + return kind === 269 /* ExternalModuleReference */ + || kind === 156 /* QualifiedName */ || kind === 78 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -13143,70 +12545,70 @@ var ts; var kind = node.kind; return kind === 107 /* ThisKeyword */ || kind === 78 /* Identifier */ - || kind === 201 /* PropertyAccessExpression */; + || kind === 198 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 273 /* JsxElement */ - || kind === 283 /* JsxExpression */ - || kind === 274 /* JsxSelfClosingElement */ + return kind === 270 /* JsxElement */ + || kind === 280 /* JsxExpression */ + || kind === 271 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 277 /* JsxFragment */; + || kind === 274 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 280 /* JsxAttribute */ - || kind === 282 /* JsxSpreadAttribute */; + return kind === 277 /* JsxAttribute */ + || kind === 279 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 283 /* JsxExpression */; + || kind === 280 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 275 /* JsxOpeningElement */ - || kind === 274 /* JsxSelfClosingElement */; + return kind === 272 /* JsxOpeningElement */ + || kind === 271 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 284 /* CaseClause */ - || kind === 285 /* DefaultClause */; + return kind === 281 /* CaseClause */ + || kind === 282 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 301 /* FirstJSDocNode */ && node.kind <= 333 /* LastJSDocNode */; + return node.kind >= 298 /* FirstJSDocNode */ && node.kind <= 328 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 311 /* JSDocComment */ || node.kind === 310 /* JSDocNamepathType */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node); + return node.kind === 307 /* JSDocComment */ || node.kind === 306 /* JSDocNamepathType */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 314 /* FirstJSDocTagNode */ && node.kind <= 333 /* LastJSDocTagNode */; + return node.kind >= 310 /* FirstJSDocTagNode */ && node.kind <= 328 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 168 /* SetAccessor */; + return node.kind === 167 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 167 /* GetAccessor */; + return node.kind === 166 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -13232,13 +12634,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 162 /* PropertySignature */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: - case 291 /* EnumMember */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 161 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: + case 288 /* EnumMember */: return true; default: return false; @@ -13246,12 +12648,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 280 /* JsxAttribute */ || node.kind === 282 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 277 /* JsxAttribute */ || node.kind === 279 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 173 /* TypeReference */ || node.kind === 223 /* ExpressionWithTypeArguments */; + return node.kind === 172 /* TypeReference */ || node.kind === 220 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -13384,6 +12786,20 @@ var ts; }); } ts.optionsHaveModuleResolutionChanges = optionsHaveModuleResolutionChanges; + function findAncestor(node, callback) { + while (node) { + var result = callback(node); + if (result === "quit") { + return undefined; + } + else if (result) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.findAncestor = findAncestor; function forEachAncestor(node, callback) { while (true) { var res = callback(node); @@ -13532,7 +12948,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 297 /* SourceFile */) { + while (node && node.kind !== 294 /* SourceFile */) { node = node.parent; } return node; @@ -13540,11 +12956,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 230 /* Block */: - case 258 /* CaseBlock */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return true; } return false; @@ -13740,7 +13156,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 334 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 329 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13759,12 +13175,8 @@ var ts; } ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile; function isJSDocTypeExpressionOrChild(node) { - return !!ts.findAncestor(node, ts.isJSDocTypeExpression); + return !!findAncestor(node, ts.isJSDocTypeExpression); } - function isExportNamespaceAsDefaultDeclaration(node) { - return !!(ts.isExportDeclaration(node) && node.exportClause && ts.isNamespaceExport(node.exportClause) && node.exportClause.name.escapedText === "default"); - } - ts.isExportNamespaceAsDefaultDeclaration = isExportNamespaceAsDefaultDeclaration; function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) { if (includeTrivia === void 0) { includeTrivia = false; } if (nodeIsMissing(node)) { @@ -13802,85 +13214,10 @@ var ts; return emitNode && emitNode.flags || 0; } ts.getEmitFlags = getEmitFlags; - ; - function getScriptTargetFeatures() { - return { - es2015: { - Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"], - RegExp: ["flags", "sticky", "unicode"], - Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"], - ArrayConstructor: ["from", "of"], - ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"], - NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"], - Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"], - Map: ["entries", "keys", "values"], - Set: ["entries", "keys", "values"], - Promise: ts.emptyArray, - PromiseConstructor: ["all", "race", "reject", "resolve"], - Symbol: ["for", "keyFor"], - WeakMap: ["entries", "keys", "values"], - WeakSet: ["entries", "keys", "values"], - Iterator: ts.emptyArray, - AsyncIterator: ts.emptyArray, - String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"], - StringConstructor: ["fromCodePoint", "raw"] - }, - es2016: { - Array: ["includes"] - }, - es2017: { - Atomics: ts.emptyArray, - SharedArrayBuffer: ts.emptyArray, - String: ["padStart", "padEnd"], - ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"], - DateTimeFormat: ["formatToParts"] - }, - es2018: { - Promise: ["finally"], - RegExpMatchArray: ["groups"], - RegExpExecArray: ["groups"], - RegExp: ["dotAll"], - Intl: ["PluralRules"], - AsyncIterable: ts.emptyArray, - AsyncIterableIterator: ts.emptyArray, - AsyncGenerator: ts.emptyArray, - AsyncGeneratorFunction: ts.emptyArray, - }, - es2019: { - Array: ["flat", "flatMap"], - ObjectConstructor: ["fromEntries"], - String: ["trimStart", "trimEnd", "trimLeft", "trimRight"], - Symbol: ["description"] - }, - es2020: { - BigInt: ts.emptyArray, - BigInt64Array: ts.emptyArray, - BigUint64Array: ts.emptyArray, - PromiseConstructor: ["allSettled"], - SymbolConstructor: ["matchAll"], - String: ["matchAll"], - DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"], - RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"] - }, - esnext: { - PromiseConstructor: ["any"], - String: ["replaceAll"], - NumberFormat: ["formatToParts"] - } - }; - } - ts.getScriptTargetFeatures = getScriptTargetFeatures; - var GetLiteralTextFlags; - (function (GetLiteralTextFlags) { - GetLiteralTextFlags[GetLiteralTextFlags["None"] = 0] = "None"; - GetLiteralTextFlags[GetLiteralTextFlags["NeverAsciiEscape"] = 1] = "NeverAsciiEscape"; - GetLiteralTextFlags[GetLiteralTextFlags["JsxAttributeEscape"] = 2] = "JsxAttributeEscape"; - GetLiteralTextFlags[GetLiteralTextFlags["TerminateUnterminatedLiterals"] = 4] = "TerminateUnterminatedLiterals"; - })(GetLiteralTextFlags = ts.GetLiteralTextFlags || (ts.GetLiteralTextFlags = {})); - function getLiteralText(node, sourceFile, flags) { + function getLiteralText(node, sourceFile, neverAsciiEscape, jsxAttributeEscape) { // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. - if (!nodeIsSynthesized(node) && node.parent && !(flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) || + if (!nodeIsSynthesized(node) && node.parent && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) || ts.isBigIntLiteral(node))) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); } @@ -13888,8 +13225,8 @@ var ts; // or a (possibly escaped) quoted form of the original text if it's string-like. switch (node.kind) { case 10 /* StringLiteral */: { - var escapeText = flags & 2 /* JsxAttributeEscape */ ? escapeJsxAttributeString : - flags & 1 /* NeverAsciiEscape */ || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : + var escapeText = jsxAttributeEscape ? escapeJsxAttributeString : + neverAsciiEscape || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : escapeNonAsciiString; if (node.singleQuote) { return "'" + escapeText(node.text, 39 /* singleQuote */) + "'"; @@ -13904,7 +13241,7 @@ var ts; case 17 /* TemplateTail */: { // If a NoSubstitutionTemplateLiteral appears to have a substitution in it, the original text // had to include a backslash: `not \${a} substitution`. - var escapeText = flags & 1 /* NeverAsciiEscape */ || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : + var escapeText = neverAsciiEscape || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : escapeNonAsciiString; var rawText = node.rawText || escapeTemplateSubstitution(escapeText(node.text, 96 /* backtick */)); switch (node.kind) { @@ -13921,11 +13258,7 @@ var ts; } case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: - return node.text; case 13 /* RegularExpressionLiteral */: - if (flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) { - return node.text + (node.text.charCodeAt(node.text.length - 1) === 92 /* backslash */ ? " /" : "/"); - } return node.text; } return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); @@ -13948,7 +13281,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 249 /* VariableDeclaration */ && node.parent.kind === 287 /* CatchClause */; + return node.kind === 246 /* VariableDeclaration */ && node.parent.kind === 284 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13980,11 +13313,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 256 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 253 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 297 /* SourceFile */ || - node.kind === 256 /* ModuleDeclaration */ || + return node.kind === 294 /* SourceFile */ || + node.kind === 253 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -14001,9 +13334,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: return ts.isExternalModule(node.parent); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -14056,22 +13389,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 297 /* SourceFile */: - case 258 /* CaseBlock */: - case 287 /* CatchClause */: - case 256 /* ModuleDeclaration */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 294 /* SourceFile */: + case 255 /* CaseBlock */: + case 284 /* CatchClause */: + case 253 /* ModuleDeclaration */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; - case 230 /* Block */: + case 227 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -14081,9 +13414,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 313 /* JSDocSignature */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 309 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -14093,25 +13426,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 308 /* JSDocFunctionType */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 304 /* JSDocFunctionType */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -14121,8 +13454,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: return true; default: return false; @@ -14131,15 +13464,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 232 /* VariableStatement */: - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 229 /* VariableStatement */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: return true; default: return false; @@ -14153,7 +13486,7 @@ var ts; // Gets the nearest enclosing block scope container that has the provided node // as a descendant, that is not the provided node. function getEnclosingBlockScopeContainer(node) { - return ts.findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); }); + return findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); }); } ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; // Return display name of an identifier @@ -14168,7 +13501,7 @@ var ts; } ts.getNameFromIndexInfo = getNameFromIndexInfo; function isComputedNonLiteralName(name) { - return name.kind === 158 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); + return name.kind === 157 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); } ts.isComputedNonLiteralName = isComputedNonLiteralName; function getTextOfPropertyName(name) { @@ -14180,7 +13513,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -14196,9 +13529,9 @@ var ts; case 79 /* PrivateIdentifier */: case 78 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -14239,18 +13572,6 @@ var ts; }; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; - function createDiagnosticForFileFromMessageChain(sourceFile, messageChain, relatedInformation) { - return { - file: sourceFile, - start: 0, - length: 0, - code: messageChain.code, - category: messageChain.category, - messageText: messageChain.next ? messageChain : messageChain.messageText, - relatedInformation: relatedInformation - }; - } - ts.createDiagnosticForFileFromMessageChain = createDiagnosticForFileFromMessageChain; function createDiagnosticForRange(sourceFile, range, message) { return { file: sourceFile, @@ -14271,7 +13592,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 230 /* Block */) { + if (node.body && node.body.kind === 227 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -14285,7 +13606,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -14294,28 +13615,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 254 /* TypeAliasDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 251 /* TypeAliasDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: errorNode = node.name; break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -14367,11 +13688,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 203 /* CallExpression */ && n.expression.kind === 105 /* SuperKeyword */; + return n.kind === 200 /* CallExpression */ && n.expression.kind === 105 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 203 /* CallExpression */ && n.expression.kind === 99 /* ImportKeyword */; + return n.kind === 200 /* CallExpression */ && n.expression.kind === 99 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -14385,7 +13706,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 233 /* ExpressionStatement */ + return node.kind === 230 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -14413,11 +13734,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 160 /* Parameter */ || - node.kind === 159 /* TypeParameter */ || - node.kind === 208 /* FunctionExpression */ || - node.kind === 209 /* ArrowFunction */ || - node.kind === 207 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 159 /* Parameter */ || + node.kind === 158 /* TypeParameter */ || + node.kind === 205 /* FunctionExpression */ || + node.kind === 206 /* ArrowFunction */ || + node.kind === 204 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -14433,48 +13754,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (172 /* FirstTypeNode */ <= node.kind && node.kind <= 195 /* LastTypeNode */) { + if (171 /* FirstTypeNode */ <= node.kind && node.kind <= 192 /* LastTypeNode */) { return true; } switch (node.kind) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 147 /* StringKeyword */: + case 151 /* UnknownKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 146 /* StringKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: - case 145 /* ObjectKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: + case 147 /* SymbolKeyword */: + case 144 /* ObjectKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: return true; case 113 /* VoidKeyword */: - return node.parent.kind !== 212 /* VoidExpression */; - case 223 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 209 /* VoidExpression */; + case 220 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 159 /* TypeParameter */: - return node.parent.kind === 190 /* MappedType */ || node.parent.kind === 185 /* InferType */; + case 158 /* TypeParameter */: + return node.parent.kind === 189 /* MappedType */ || node.parent.kind === 184 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 78 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 156 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */ || node.kind === 201 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 78 /* Identifier */ || node.kind === 156 /* QualifiedName */ || node.kind === 198 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 157 /* QualifiedName */: - case 201 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: case 107 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 176 /* TypeQuery */) { + if (parent.kind === 175 /* TypeQuery */) { return false; } - if (parent.kind === 195 /* ImportType */) { + if (parent.kind === 192 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -14483,40 +13804,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (172 /* FirstTypeNode */ <= parent.kind && parent.kind <= 195 /* LastTypeNode */) { + if (171 /* FirstTypeNode */ <= parent.kind && parent.kind <= 192 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return node === parent.constraint; - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return node === parent.constraint; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 160 /* Parameter */: - case 249 /* VariableDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 159 /* Parameter */: + case 246 /* VariableDeclaration */: return node === parent.type; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return node === parent.type; - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return node === parent.type; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return node === parent.type; - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -14541,23 +13862,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitor(node); - case 258 /* CaseBlock */: - case 230 /* Block */: - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 243 /* WithStatement */: - case 244 /* SwitchStatement */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 245 /* LabeledStatement */: - case 247 /* TryStatement */: - case 287 /* CatchClause */: + case 255 /* CaseBlock */: + case 227 /* Block */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 240 /* WithStatement */: + case 241 /* SwitchStatement */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 242 /* LabeledStatement */: + case 244 /* TryStatement */: + case 284 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -14567,23 +13888,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 255 /* EnumDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 157 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. traverse(node.name.expression); @@ -14606,10 +13927,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 178 /* ArrayType */) { + if (node && node.kind === 177 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 173 /* TypeReference */) { + else if (node && node.kind === 172 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -14619,12 +13940,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 177 /* TypeLiteral */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 176 /* TypeLiteral */: return node.members; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return node.properties; } } @@ -14632,14 +13953,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 198 /* BindingElement */: - case 291 /* EnumMember */: - case 160 /* Parameter */: - case 288 /* PropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 289 /* ShorthandPropertyAssignment */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 288 /* EnumMember */: + case 159 /* Parameter */: + case 285 /* PropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 286 /* ShorthandPropertyAssignment */: + case 246 /* VariableDeclaration */: return true; } } @@ -14651,8 +13972,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 250 /* VariableDeclarationList */ - && node.parent.parent.kind === 232 /* VariableStatement */; + return node.parent.kind === 247 /* VariableDeclarationList */ + && node.parent.parent.kind === 229 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -14663,13 +13984,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return true; } return false; @@ -14680,7 +14001,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 245 /* LabeledStatement */) { + if (node.statement.kind !== 242 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -14688,17 +14009,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 230 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 227 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 165 /* MethodDeclaration */ && node.parent.kind === 200 /* ObjectLiteralExpression */; + return node && node.kind === 164 /* MethodDeclaration */ && node.parent.kind === 197 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 165 /* MethodDeclaration */ && - (node.parent.kind === 200 /* ObjectLiteralExpression */ || - node.parent.kind === 221 /* ClassExpression */); + return node.kind === 164 /* MethodDeclaration */ && + (node.parent.kind === 197 /* ObjectLiteralExpression */ || + node.parent.kind === 218 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -14711,7 +14032,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 288 /* PropertyAssignment */) { + if (property.kind === 285 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -14740,26 +14061,26 @@ var ts; } ts.getTsConfigPropArray = getTsConfigPropArray; function getContainingFunction(node) { - return ts.findAncestor(node.parent, ts.isFunctionLike); + return findAncestor(node.parent, ts.isFunctionLike); } ts.getContainingFunction = getContainingFunction; function getContainingFunctionDeclaration(node) { - return ts.findAncestor(node.parent, ts.isFunctionLikeDeclaration); + return findAncestor(node.parent, ts.isFunctionLikeDeclaration); } ts.getContainingFunctionDeclaration = getContainingFunctionDeclaration; function getContainingClass(node) { - return ts.findAncestor(node.parent, ts.isClassLike); + return findAncestor(node.parent, ts.isClassLike); } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 297 /* SourceFile */); + ts.Debug.assert(node.kind !== 294 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -14774,9 +14095,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 159 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14787,26 +14108,26 @@ var ts; node = node.parent; } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 256 /* ModuleDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 255 /* EnumDeclaration */: - case 297 /* SourceFile */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 253 /* ModuleDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 252 /* EnumDeclaration */: + case 294 /* SourceFile */: return node; } } @@ -14825,9 +14146,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return container; } } @@ -14849,27 +14170,27 @@ var ts; return node; } switch (node.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: node = node.parent; break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return node; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 159 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14885,14 +14206,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 208 /* FunctionExpression */ || func.kind === 209 /* ArrowFunction */) { + if (func.kind === 205 /* FunctionExpression */ || func.kind === 206 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 207 /* ParenthesizedExpression */) { + while (parent.kind === 204 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 203 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 200 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14908,7 +14229,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */) + return (kind === 198 /* PropertyAccessExpression */ || kind === 199 /* ElementAccessExpression */) && node.expression.kind === 105 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14917,26 +14238,21 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */) + return (kind === 198 /* PropertyAccessExpression */ || kind === 199 /* ElementAccessExpression */) && node.expression.kind === 107 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; - function isThisInitializedDeclaration(node) { - var _a; - return !!node && ts.isVariableDeclaration(node) && ((_a = node.initializer) === null || _a === void 0 ? void 0 : _a.kind) === 107 /* ThisKeyword */; - } - ts.isThisInitializedDeclaration = isThisInitializedDeclaration; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 78 /* Identifier */: - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return node; } return undefined; @@ -14944,10 +14260,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return node.tag; - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14960,25 +14276,25 @@ var ts; return false; } switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: // classes are valid targets return true; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 252 /* ClassDeclaration */; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + return parent.kind === 249 /* ClassDeclaration */; + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 252 /* ClassDeclaration */; - case 160 /* Parameter */: + && parent.kind === 249 /* ClassDeclaration */; + case 159 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 166 /* Constructor */ - || parent.kind === 165 /* MethodDeclaration */ - || parent.kind === 168 /* SetAccessor */) - && grandparent.kind === 252 /* ClassDeclaration */; + && (parent.kind === 165 /* Constructor */ + || parent.kind === 164 /* MethodDeclaration */ + || parent.kind === 167 /* SetAccessor */) + && grandparent.kind === 249 /* ClassDeclaration */; } return false; } @@ -14994,10 +14310,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 165 /* MethodDeclaration */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 167 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -15006,9 +14322,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 275 /* JsxOpeningElement */ || - parent.kind === 274 /* JsxSelfClosingElement */ || - parent.kind === 276 /* JsxClosingElement */) { + if (parent.kind === 272 /* JsxOpeningElement */ || + parent.kind === 271 /* JsxSelfClosingElement */ || + parent.kind === 273 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -15021,44 +14337,44 @@ var ts; case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 224 /* AsExpression */: - case 206 /* TypeAssertionExpression */: - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: - case 209 /* ArrowFunction */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 211 /* TypeOfExpression */: - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: - case 216 /* BinaryExpression */: - case 217 /* ConditionalExpression */: - case 220 /* SpreadElement */: - case 218 /* TemplateExpression */: - case 222 /* OmittedExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: - case 219 /* YieldExpression */: - case 213 /* AwaitExpression */: - case 226 /* MetaProperty */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 221 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 208 /* TypeOfExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 213 /* BinaryExpression */: + case 214 /* ConditionalExpression */: + case 217 /* SpreadElement */: + case 215 /* TemplateExpression */: + case 219 /* OmittedExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: + case 216 /* YieldExpression */: + case 210 /* AwaitExpression */: + case 223 /* MetaProperty */: return true; - case 157 /* QualifiedName */: - while (node.parent.kind === 157 /* QualifiedName */) { + case 156 /* QualifiedName */: + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 175 /* TypeQuery */ || isJSXTagName(node); case 78 /* Identifier */: - if (node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 175 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -15076,49 +14392,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 291 /* EnumMember */: - case 288 /* PropertyAssignment */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 288 /* EnumMember */: + case 285 /* PropertyAssignment */: + case 195 /* BindingElement */: return parent.initializer === node; - case 233 /* ExpressionStatement */: - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 242 /* ReturnStatement */: - case 243 /* WithStatement */: - case 244 /* SwitchStatement */: - case 284 /* CaseClause */: - case 246 /* ThrowStatement */: + case 230 /* ExpressionStatement */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 239 /* ReturnStatement */: + case 240 /* WithStatement */: + case 241 /* SwitchStatement */: + case 281 /* CaseClause */: + case 243 /* ThrowStatement */: return parent.expression === node; - case 237 /* ForStatement */: + case 234 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 250 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 247 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 250 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 247 /* VariableDeclarationList */) || forInStatement.expression === node; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return node === parent.expression; - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return node === parent.expression; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return node === parent.expression; - case 161 /* Decorator */: - case 283 /* JsxExpression */: - case 282 /* JsxSpreadAttribute */: - case 290 /* SpreadAssignment */: + case 160 /* Decorator */: + case 280 /* JsxExpression */: + case 279 /* JsxSpreadAttribute */: + case 287 /* SpreadAssignment */: return true; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -15126,14 +14442,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 157 /* QualifiedName */ || node.kind === 78 /* Identifier */) { + while (node.kind === 156 /* QualifiedName */ || node.kind === 78 /* Identifier */) { node = node.parent; } - return node.kind === 176 /* TypeQuery */; + return node.kind === 175 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 272 /* ExternalModuleReference */; + return node.kind === 257 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 269 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -15141,13 +14457,8 @@ var ts; return node.moduleReference.expression; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; - function getExternalModuleRequireArgument(node) { - return isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true) - && getLeftmostAccessExpression(node.initializer).arguments[0]; - } - ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 272 /* ExternalModuleReference */; + return node.kind === 257 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 269 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -15179,11 +14490,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 147 /* StringKeyword */ || node.typeArguments[0].kind === 144 /* NumberKeyword */); + (node.typeArguments[0].kind === 146 /* StringKeyword */ || node.typeArguments[0].kind === 143 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 203 /* CallExpression */) { + if (callExpression.kind !== 200 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -15198,10 +14509,7 @@ var ts; } ts.isRequireCall = isRequireCall; function isRequireVariableDeclaration(node, requireStringLiteralLikeArgument) { - if (node.kind === 198 /* BindingElement */) { - node = node.parent.parent; - } - return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(getLeftmostAccessExpression(node.initializer), requireStringLiteralLikeArgument); + return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(node.initializer, requireStringLiteralLikeArgument); } ts.isRequireVariableDeclaration = isRequireVariableDeclaration; function isRequireVariableStatement(node, requireStringLiteralLikeArgument) { @@ -15219,6 +14527,46 @@ var ts; return getSourceTextOfNodeFromSourceFile(sourceFile, str).charCodeAt(0) === 34 /* doubleQuote */; } ts.isStringDoubleQuoted = isStringDoubleQuoted; + function getDeclarationOfExpando(node) { + if (!node.parent) { + return undefined; + } + var name; + var decl; + if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) { + if (!isInJSFile(node) && !isVarConst(node.parent)) { + return undefined; + } + name = node.parent.name; + decl = node.parent; + } + else if (ts.isBinaryExpression(node.parent)) { + var parentNode = node.parent; + var parentNodeOperator = node.parent.operatorToken.kind; + if (parentNodeOperator === 62 /* EqualsToken */ && parentNode.right === node) { + name = parentNode.left; + decl = name; + } + else if (parentNodeOperator === 56 /* BarBarToken */ || parentNodeOperator === 60 /* QuestionQuestionToken */) { + if (ts.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { + name = parentNode.parent.name; + decl = parentNode.parent; + } + else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 /* EqualsToken */ && parentNode.parent.right === parentNode) { + name = parentNode.parent.left; + decl = name; + } + if (!name || !isBindableStaticNameExpression(name) || !isSameEntityName(name, parentNode.left)) { + return undefined; + } + } + } + if (!name || !getExpandoInitializer(node, isPrototypeAccess(name))) { + return undefined; + } + return decl; + } + ts.getDeclarationOfExpando = getDeclarationOfExpando; function isAssignmentDeclaration(decl) { return ts.isBinaryExpression(decl) || isAccessExpression(decl) || ts.isIdentifier(decl) || ts.isCallExpression(decl); } @@ -15280,11 +14628,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 208 /* FunctionExpression */ || e.kind === 209 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 205 /* FunctionExpression */ || e.kind === 206 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 208 /* FunctionExpression */ || - initializer.kind === 221 /* ClassExpression */ || - initializer.kind === 209 /* ArrowFunction */) { + if (initializer.kind === 205 /* FunctionExpression */ || + initializer.kind === 218 /* ClassExpression */ || + initializer.kind === 206 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -15359,7 +14707,6 @@ var ts; } return false; } - ts.isSameEntityName = isSameEntityName; function getRightMostAssignedExpression(node) { while (isAssignmentExpression(node, /*excludeCompoundAssignments*/ true)) { node = node.right; @@ -15538,7 +14885,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 233 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 230 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -15559,7 +14906,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 251 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 248 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -15568,14 +14915,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return node.parent; - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return node.parent.parent; - case 203 /* CallExpression */: + case 200 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 191 /* LiteralType */: + case 190 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -15585,12 +14932,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return node.moduleSpecifier; - case 260 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 272 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 195 /* ImportType */: + case 257 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 269 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 192 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -15599,11 +14946,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -15611,7 +14958,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 261 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 258 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -15632,13 +14979,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 160 /* Parameter */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 289 /* ShorthandPropertyAssignment */: - case 288 /* PropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 159 /* Parameter */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 286 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -15652,7 +14999,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 331 /* JSDocTypedefTag */ || node.kind === 324 /* JSDocCallbackTag */ || node.kind === 325 /* JSDocEnumTag */; + return node.kind === 327 /* JSDocTypedefTag */ || node.kind === 320 /* JSDocCallbackTag */ || node.kind === 321 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -15677,12 +15024,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return node.initializer; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return node.initializer; } } @@ -15694,7 +15041,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 256 /* ModuleDeclaration */ + node.body.kind === 253 /* ModuleDeclaration */ ? node.body : undefined; } @@ -15709,11 +15056,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 160 /* Parameter */) { + if (node.kind === 159 /* Parameter */) { result = ts.addRange(result, (noCache ? ts.getJSDocParameterTagsNoCache : ts.getJSDocParameterTags)(node)); break; } - if (node.kind === 159 /* TypeParameter */) { + if (node.kind === 158 /* TypeParameter */) { result = ts.addRange(result, (noCache ? ts.getJSDocTypeParameterTagsNoCache : ts.getJSDocTypeParameterTags)(node)); break; } @@ -15724,10 +15071,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 288 /* PropertyAssignment */ || - parent.kind === 266 /* ExportAssignment */ || - parent.kind === 163 /* PropertyDeclaration */ || - parent.kind === 233 /* ExpressionStatement */ && node.kind === 201 /* PropertyAccessExpression */ || + if (parent.kind === 285 /* PropertyAssignment */ || + parent.kind === 263 /* ExportAssignment */ || + parent.kind === 162 /* PropertyDeclaration */ || + parent.kind === 230 /* ExpressionStatement */ && node.kind === 198 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -15785,7 +15132,7 @@ var ts; ts.getEffectiveJSDocHost = getEffectiveJSDocHost; /** Use getEffectiveJSDocHost if you additionally need to look for jsdoc on parent nodes, like assignments. */ function getJSDocHost(node) { - return ts.Debug.checkDefined(ts.findAncestor(node.parent, ts.isJSDoc)).parent; + return ts.Debug.checkDefined(findAncestor(node.parent, ts.isJSDoc)).parent; } ts.getJSDocHost = getJSDocHost; function getTypeParameterFromJsDoc(node) { @@ -15801,7 +15148,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 309 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 305 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15818,31 +15165,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 207 /* ParenthesizedExpression */: - case 199 /* ArrayLiteralExpression */: - case 220 /* SpreadElement */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 196 /* ArrayLiteralExpression */: + case 217 /* SpreadElement */: + case 222 /* NonNullExpression */: node = parent; break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15869,22 +15216,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 230 /* Block */: - case 232 /* VariableStatement */: - case 243 /* WithStatement */: - case 234 /* IfStatement */: - case 244 /* SwitchStatement */: - case 258 /* CaseBlock */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 245 /* LabeledStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 247 /* TryStatement */: - case 287 /* CatchClause */: + case 227 /* Block */: + case 229 /* VariableStatement */: + case 240 /* WithStatement */: + case 231 /* IfStatement */: + case 241 /* SwitchStatement */: + case 255 /* CaseBlock */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 242 /* LabeledStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 244 /* TryStatement */: + case 284 /* CatchClause */: return true; } return false; @@ -15901,44 +15248,30 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 186 /* ParenthesizedType */); + return walkUp(node, 185 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 207 /* ParenthesizedExpression */); + return walkUp(node, 204 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; - /** - * Walks up parenthesized types. - * It returns both the outermost parenthesized type and its parent. - * If given node is not a parenthesiezd type, undefined is return as the former. - */ - function walkUpParenthesizedTypesAndGetParentAndChild(node) { - var child; - while (node && node.kind === 186 /* ParenthesizedType */) { - child = node; - node = node.parent; - } - return [child, node]; - } - ts.walkUpParenthesizedTypesAndGetParentAndChild = walkUpParenthesizedTypesAndGetParentAndChild; function skipParentheses(node) { return ts.skipOuterExpressions(node, 1 /* Parentheses */); } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 207 /* ParenthesizedExpression */) { + while (node.kind === 204 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 201 /* PropertyAccessExpression */ && node.kind !== 202 /* ElementAccessExpression */) { + if (node.kind !== 198 /* PropertyAccessExpression */ && node.kind !== 199 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 210 /* DeleteExpression */; + return node && node.kind === 207 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15991,7 +15324,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 158 /* ComputedPropertyName */ && + node.parent.kind === 157 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15999,26 +15332,26 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 291 /* EnumMember */: - case 288 /* PropertyAssignment */: - case 201 /* PropertyAccessExpression */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 288 /* EnumMember */: + case 285 /* PropertyAssignment */: + case 198 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference return parent.right === node; - case 198 /* BindingElement */: - case 265 /* ImportSpecifier */: + case 195 /* BindingElement */: + case 262 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 270 /* ExportSpecifier */: - case 280 /* JsxAttribute */: + case 267 /* ExportSpecifier */: + case 277 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -16038,33 +15371,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ || - node.kind === 259 /* NamespaceExportDeclaration */ || - node.kind === 262 /* ImportClause */ && !!node.name || - node.kind === 263 /* NamespaceImport */ || - node.kind === 269 /* NamespaceExport */ || - node.kind === 265 /* ImportSpecifier */ || - node.kind === 270 /* ExportSpecifier */ || - node.kind === 266 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 256 /* NamespaceExportDeclaration */ || + node.kind === 259 /* ImportClause */ && !!node.name || + node.kind === 260 /* NamespaceImport */ || + node.kind === 266 /* NamespaceExport */ || + node.kind === 262 /* ImportSpecifier */ || + node.kind === 267 /* ExportSpecifier */ || + node.kind === 263 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 289 /* ShorthandPropertyAssignment */ || - node.kind === 288 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 286 /* ShorthandPropertyAssignment */ || + node.kind === 285 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 262 /* ImportClause */: - case 265 /* ImportSpecifier */: - case 263 /* NamespaceImport */: - case 270 /* ExportSpecifier */: - case 266 /* ExportAssignment */: - case 260 /* ImportEqualsDeclaration */: + case 259 /* ImportClause */: + case 262 /* ImportSpecifier */: + case 260 /* NamespaceImport */: + case 267 /* ExportSpecifier */: + case 263 /* ExportAssignment */: + case 257 /* ImportEqualsDeclaration */: return node.parent; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 157 /* QualifiedName */); + } while (node.parent.kind === 156 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -16083,7 +15416,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 289 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 288 /* PropertyAssignment */ ? node.initializer : + return node.kind === 286 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 285 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -16149,11 +15482,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 80 /* FirstKeyword */ <= token && token <= 156 /* LastKeyword */; + return 80 /* FirstKeyword */ <= token && token <= 155 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 125 /* FirstContextualKeyword */ <= token && token <= 156 /* LastContextualKeyword */; + return 125 /* FirstContextualKeyword */ <= token && token <= 155 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -16197,14 +15530,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (hasSyntacticModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -16218,10 +15551,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasSyntacticModifier(node, 256 /* Async */); @@ -16254,7 +15587,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 158 /* ComputedPropertyName */ || name.kind === 202 /* ElementAccessExpression */)) { + if (!(name.kind === 157 /* ComputedPropertyName */ || name.kind === 199 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression; @@ -16280,7 +15613,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -16349,11 +15682,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 160 /* Parameter */; + return root.kind === 159 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 198 /* BindingElement */) { + while (node.kind === 195 /* BindingElement */) { node = node.parent.parent; } return node; @@ -16361,15 +15694,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 166 /* Constructor */ - || kind === 208 /* FunctionExpression */ - || kind === 251 /* FunctionDeclaration */ - || kind === 209 /* ArrowFunction */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 256 /* ModuleDeclaration */ - || kind === 297 /* SourceFile */; + return kind === 165 /* Constructor */ + || kind === 205 /* FunctionExpression */ + || kind === 248 /* FunctionDeclaration */ + || kind === 206 /* ArrowFunction */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 253 /* ModuleDeclaration */ + || kind === 294 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -16388,23 +15721,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 201 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 204 /* NewExpression */: + case 201 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 214 /* PrefixUnaryExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 213 /* AwaitExpression */: - case 217 /* ConditionalExpression */: - case 219 /* YieldExpression */: + case 211 /* PrefixUnaryExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 210 /* AwaitExpression */: + case 214 /* ConditionalExpression */: + case 216 /* YieldExpression */: return 1 /* Right */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -16431,15 +15764,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 201 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 216 /* BinaryExpression */) { + if (expression.kind === 213 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 214 /* PrefixUnaryExpression */ || expression.kind === 215 /* PostfixUnaryExpression */) { + else if (expression.kind === 211 /* PrefixUnaryExpression */ || expression.kind === 212 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -16618,15 +15951,15 @@ var ts; })(OperatorPrecedence = ts.OperatorPrecedence || (ts.OperatorPrecedence = {})); function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return 0 /* Comma */; - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return 1 /* Spread */; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return 2 /* Yield */; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return 4 /* Conditional */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0 /* Comma */; @@ -16652,21 +15985,21 @@ var ts; } // TODO: Should prefix `++` and `--` be moved to the `Update` precedence? // TODO: We are missing `TypeAssertionExpression` - case 214 /* PrefixUnaryExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 213 /* AwaitExpression */: + case 211 /* PrefixUnaryExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 210 /* AwaitExpression */: return 16 /* Unary */; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return 17 /* Update */; - case 203 /* CallExpression */: + case 200 /* CallExpression */: return 18 /* LeftHandSide */; - case 204 /* NewExpression */: + case 201 /* NewExpression */: return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */; - case 205 /* TaggedTemplateExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 202 /* TaggedTemplateExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return 19 /* Member */; case 107 /* ThisKeyword */: case 105 /* SuperKeyword */: @@ -16677,19 +16010,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 221 /* ClassExpression */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 218 /* ClassExpression */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: - case 207 /* ParenthesizedExpression */: - case 222 /* OmittedExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: + case 215 /* TemplateExpression */: + case 204 /* ParenthesizedExpression */: + case 219 /* OmittedExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: return 20 /* Primary */; default: return -1 /* Invalid */; @@ -16742,19 +16075,6 @@ var ts; return -1; } ts.getBinaryOperatorPrecedence = getBinaryOperatorPrecedence; - function getSemanticJsxChildren(children) { - return ts.filter(children, function (i) { - switch (i.kind) { - case 283 /* JsxExpression */: - return !!i.expression; - case 11 /* JsxText */: - return !i.containsOnlyTriviaWhiteSpaces; - default: - return true; - } - }); - } - ts.getSemanticJsxChildren = getSemanticJsxChildren; function createDiagnosticCollection() { var nonFileDiagnostics = []; // See GH#19873 var filesWithDiagnostics = []; @@ -16949,10 +16269,8 @@ var ts; ts.isIntrinsicJsxName = isIntrinsicJsxName; var indentStrings = ["", " "]; function getIndentString(level) { - // prepopulate cache - var singleLevel = indentStrings[1]; - for (var current = indentStrings.length; current <= level; current++) { - indentStrings.push(indentStrings[current - 1] + singleLevel); + if (indentStrings[level] === undefined) { + indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; } return indentStrings[level]; } @@ -17191,14 +16509,6 @@ var ts; return options.outFile || options.out; } ts.outFile = outFile; - /** Returns 'undefined' if and only if 'options.paths' is undefined. */ - function getPathsBasePath(options, host) { - var _a, _b; - if (!options.paths) - return undefined; - return (_a = options.baseUrl) !== null && _a !== void 0 ? _a : ts.Debug.checkDefined(options.pathsBasePath || ((_b = host.getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(host)), "Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'."); - } - ts.getPathsBasePath = getPathsBasePath; /** * Gets the source files that are expected to have an emit output. * @@ -17327,10 +16637,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 167 /* GetAccessor */) { + if (accessor.kind === 166 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 168 /* SetAccessor */) { + else if (accessor.kind === 167 /* SetAccessor */) { setAccessor = accessor; } else { @@ -17350,10 +16660,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 167 /* GetAccessor */ && !getAccessor) { + if (member.kind === 166 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 168 /* SetAccessor */ && !setAccessor) { + if (member.kind === 167 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -17402,7 +16712,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 311 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 307 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -17638,7 +16948,7 @@ var ts; } ts.getSelectedSyntacticModifierFlags = getSelectedSyntacticModifierFlags; function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 156 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 155 /* LastToken */) { return 0 /* None */; } if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) { @@ -17734,7 +17044,7 @@ var ts; case 84 /* ConstKeyword */: return 2048 /* Const */; case 87 /* DefaultKeyword */: return 512 /* Default */; case 129 /* AsyncKeyword */: return 256 /* Async */; - case 142 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 141 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -17784,8 +17094,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 200 /* ObjectLiteralExpression */ - || kind === 199 /* ArrayLiteralExpression */; + return kind === 197 /* ObjectLiteralExpression */ + || kind === 196 /* ArrayLiteralExpression */; } return false; } @@ -17802,12 +17112,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.left; } while (node.kind !== 78 /* Identifier */); return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 78 /* Identifier */); @@ -17817,8 +17127,8 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 78 /* Identifier */ || node.kind === 107 /* ThisKeyword */ || node.kind === 105 /* SuperKeyword */ || - node.kind === 201 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 207 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 198 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 204 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { @@ -17843,17 +17153,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 156 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 200 /* ObjectLiteralExpression */ && + return expression.kind === 197 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 199 /* ArrayLiteralExpression */ && + return expression.kind === 196 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -18185,8 +17495,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 255 /* EnumDeclaration */: - case 256 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -18263,35 +17573,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return accessKind(parent); - case 215 /* PostfixUnaryExpression */: - case 214 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 288 /* PropertyAssignment */: { + case 285 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 233 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 230 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -18440,37 +17750,37 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */) + return (kind >= 171 /* FirstTypeNode */ && kind <= 192 /* LastTypeNode */) || kind === 128 /* AnyKeyword */ - || kind === 152 /* UnknownKeyword */ - || kind === 144 /* NumberKeyword */ - || kind === 155 /* BigIntKeyword */ - || kind === 145 /* ObjectKeyword */ + || kind === 151 /* UnknownKeyword */ + || kind === 143 /* NumberKeyword */ + || kind === 154 /* BigIntKeyword */ + || kind === 144 /* ObjectKeyword */ || kind === 131 /* BooleanKeyword */ - || kind === 147 /* StringKeyword */ - || kind === 148 /* SymbolKeyword */ + || kind === 146 /* StringKeyword */ + || kind === 147 /* SymbolKeyword */ || kind === 113 /* VoidKeyword */ - || kind === 150 /* UndefinedKeyword */ - || kind === 141 /* NeverKeyword */ - || kind === 223 /* ExpressionWithTypeArguments */ - || kind === 303 /* JSDocAllType */ - || kind === 304 /* JSDocUnknownType */ - || kind === 305 /* JSDocNullableType */ - || kind === 306 /* JSDocNonNullableType */ - || kind === 307 /* JSDocOptionalType */ - || kind === 308 /* JSDocFunctionType */ - || kind === 309 /* JSDocVariadicType */; + || kind === 149 /* UndefinedKeyword */ + || kind === 140 /* NeverKeyword */ + || kind === 220 /* ExpressionWithTypeArguments */ + || kind === 299 /* JSDocAllType */ + || kind === 300 /* JSDocUnknownType */ + || kind === 301 /* JSDocNullableType */ + || kind === 302 /* JSDocNonNullableType */ + || kind === 303 /* JSDocOptionalType */ + || kind === 304 /* JSDocFunctionType */ + || kind === 305 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 201 /* PropertyAccessExpression */ || node.kind === 202 /* ElementAccessExpression */; + return node.kind === 198 /* PropertyAccessExpression */ || node.kind === 199 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 201 /* PropertyAccessExpression */) { + if (node.kind === 198 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 202 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 199 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -18485,41 +17795,34 @@ var ts; } ts.isBundleFileTextLike = isBundleFileTextLike; function isNamedImportsOrExports(node) { - return node.kind === 264 /* NamedImports */ || node.kind === 268 /* NamedExports */; + return node.kind === 261 /* NamedImports */ || node.kind === 265 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; - function getLeftmostAccessExpression(expr) { - while (isAccessExpression(expr)) { - expr = expr.expression; - } - return expr; - } - ts.getLeftmostAccessExpression = getLeftmostAccessExpression; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: node = node.operand; continue; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: node = node.left; continue; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: node = node.condition; continue; - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: node = node.tag; continue; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 224 /* AsExpression */: - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: - case 225 /* NonNullExpression */: - case 336 /* PartiallyEmittedExpression */: + case 221 /* AsExpression */: + case 199 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 222 /* NonNullExpression */: + case 331 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -18538,7 +17841,7 @@ var ts; } function Type(checker, flags) { this.flags = flags; - if (ts.Debug.isDebugging || ts.tracing.isTracing()) { + if (ts.Debug.isDebugging) { this.checker = checker; } } @@ -18895,10 +18198,6 @@ var ts; return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag]; } ts.getStrictOptionValue = getStrictOptionValue; - function getAllowJSCompilerOption(compilerOptions) { - return compilerOptions.allowJs === undefined ? !!compilerOptions.checkJs : compilerOptions.allowJs; - } - ts.getAllowJSCompilerOption = getAllowJSCompilerOption; function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) { return oldOptions !== newOptions && ts.semanticDiagnosticsOptionDeclarations.some(function (option) { return !isJsonEqual(getCompilerOptionValue(oldOptions, option), getCompilerOptionValue(newOptions, option)); }); @@ -18913,26 +18212,6 @@ var ts; return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name]; } ts.getCompilerOptionValue = getCompilerOptionValue; - function getJSXTransformEnabled(options) { - var jsx = options.jsx; - return jsx === 2 /* React */ || jsx === 4 /* ReactJSX */ || jsx === 5 /* ReactJSXDev */; - } - ts.getJSXTransformEnabled = getJSXTransformEnabled; - function getJSXImplicitImportBase(compilerOptions, file) { - var jsxImportSourcePragmas = file === null || file === void 0 ? void 0 : file.pragmas.get("jsximportsource"); - var jsxImportSourcePragma = ts.isArray(jsxImportSourcePragmas) ? jsxImportSourcePragmas[0] : jsxImportSourcePragmas; - return compilerOptions.jsx === 4 /* ReactJSX */ || - compilerOptions.jsx === 5 /* ReactJSXDev */ || - compilerOptions.jsxImportSource || - jsxImportSourcePragma ? - (jsxImportSourcePragma === null || jsxImportSourcePragma === void 0 ? void 0 : jsxImportSourcePragma.arguments.factory) || compilerOptions.jsxImportSource || "react" : - undefined; - } - ts.getJSXImplicitImportBase = getJSXImplicitImportBase; - function getJSXRuntimeImport(base, options) { - return base ? base + "/" + (options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined; - } - ts.getJSXRuntimeImport = getJSXRuntimeImport; function hasZeroOrOneAsteriskCharacter(str) { var seenAsterisk = false; for (var i = 0; i < str.length; i++) { @@ -19312,7 +18591,7 @@ var ts; var allSupportedExtensions = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions); var allSupportedExtensionsWithJson = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions, [".json" /* Json */]); function getSupportedExtensions(options, extraFileExtensions) { - var needJsExtensions = options && getAllowJSCompilerOption(options); + var needJsExtensions = options && options.allowJs; if (!extraFileExtensions || extraFileExtensions.length === 0) { return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions; } @@ -19523,7 +18802,6 @@ var ts; if (!diagnostic.relatedInformation) { diagnostic.relatedInformation = []; } - ts.Debug.assert(diagnostic.relatedInformation !== ts.emptyArray, "Diagnostic had empty array singleton for related info, but is still being constructed!"); (_a = diagnostic.relatedInformation).push.apply(_a, relatedInformation); return diagnostic; } @@ -19652,38 +18930,38 @@ var ts; } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 270 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 267 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 78 /* Identifier */ || node.kind === 201 /* PropertyAccessExpression */) { + while (node.kind === 78 /* Identifier */ || node.kind === 198 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 158 /* ComputedPropertyName */) { + if (node.kind !== 157 /* ComputedPropertyName */) { return false; } if (hasSyntacticModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 253 /* InterfaceDeclaration */ || containerKind === 177 /* TypeLiteral */; + return containerKind === 250 /* InterfaceDeclaration */ || containerKind === 176 /* TypeLiteral */; } /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ function isIdentifierInNonEmittingHeritageClause(node) { if (node.kind !== 78 /* Identifier */) return false; - var heritageClause = ts.findAncestor(node.parent, function (parent) { + var heritageClause = findAncestor(node.parent, function (parent) { switch (parent.kind) { - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return true; - case 201 /* PropertyAccessExpression */: - case 223 /* ExpressionWithTypeArguments */: + case 198 /* PropertyAccessExpression */: + case 220 /* ExpressionWithTypeArguments */: return false; default: return "quit"; } }); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 253 /* InterfaceDeclaration */; + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 250 /* InterfaceDeclaration */; } function isIdentifierTypeReference(node) { return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName); @@ -19877,10 +19155,10 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(216 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(213 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(213 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 209 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { + if (!isLeftSideOfBinary && operand.kind === 206 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -19892,7 +19170,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 219 /* YieldExpression */) { + && operand.kind === 216 /* YieldExpression */) { return false; } return true; @@ -19980,7 +19258,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -20006,7 +19284,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 207 /* ParenthesizedExpression */) { + if (skipped.kind === 204 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -20023,7 +19301,7 @@ var ts; return ts.isCommaSequence(expression) ? factory.createParenthesizedExpression(expression) : expression; } function parenthesizeConditionOfConditionalExpression(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(217 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(214 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -20056,8 +19334,8 @@ var ts; var needsParens = ts.isCommaSequence(check); if (!needsParens) { switch (ts.getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: needsParens = true; } } @@ -20070,9 +19348,9 @@ var ts; function parenthesizeExpressionOfNew(expression) { var leftmostExpr = ts.getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: return factory.createParenthesizedExpression(expression); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return !leftmostExpr.arguments ? factory.createParenthesizedExpression(expression) : expression; // TODO(rbuckton): Verify this assertion holds @@ -20092,7 +19370,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 204 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 201 /* NewExpression */ || emittedExpression.arguments)) { // TODO(rbuckton): Verify whether this assertion holds. return expression; } @@ -20114,7 +19392,7 @@ var ts; function parenthesizeExpressionForDisallowedComma(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(213 /* BinaryExpression */, 27 /* CommaToken */); // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(factory.createParenthesizedExpression(expression), expression); } @@ -20123,44 +19401,44 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 208 /* FunctionExpression */ || kind === 209 /* ArrowFunction */) { + if (kind === 205 /* FunctionExpression */ || kind === 206 /* ArrowFunction */) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. var updated = factory.updateCallExpression(emittedExpression, ts.setTextRange(factory.createParenthesizedExpression(callee), callee), emittedExpression.typeArguments, emittedExpression.arguments); return factory.restoreOuterExpressions(expression, updated, 8 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = ts.getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 200 /* ObjectLiteralExpression */ || leftmostExpressionKind === 208 /* FunctionExpression */) { + if (leftmostExpressionKind === 197 /* ObjectLiteralExpression */ || leftmostExpressionKind === 205 /* FunctionExpression */) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return ts.setTextRange(factory.createParenthesizedExpression(expression), expression); } return expression; } function parenthesizeConciseBodyOfArrowFunction(body) { - if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 200 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 197 /* ObjectLiteralExpression */)) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return ts.setTextRange(factory.createParenthesizedExpression(body), body); } return body; } function parenthesizeMemberOfConditionalType(member) { - return member.kind === 184 /* ConditionalType */ ? factory.createParenthesizedType(member) : member; + return member.kind === 183 /* ConditionalType */ ? factory.createParenthesizedType(member) : member; } function parenthesizeMemberOfElementType(member) { switch (member.kind) { - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return factory.createParenthesizedType(member); } return parenthesizeMemberOfConditionalType(member); } function parenthesizeElementTypeOfArrayType(member) { switch (member.kind) { - case 176 /* TypeQuery */: - case 188 /* TypeOperator */: - case 185 /* InferType */: + case 175 /* TypeQuery */: + case 187 /* TypeOperator */: + case 184 /* InferType */: return factory.createParenthesizedType(member); } return parenthesizeMemberOfElementType(member); @@ -20264,11 +19542,11 @@ var ts; } function convertToAssignmentPattern(node) { switch (node.kind) { - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 196 /* ObjectBindingPattern */: - case 200 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 197 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -20396,8 +19674,6 @@ var ts; updateConstructSignature: updateConstructSignature, createIndexSignature: createIndexSignature, updateIndexSignature: updateIndexSignature, - createTemplateLiteralTypeSpan: createTemplateLiteralTypeSpan, - updateTemplateLiteralTypeSpan: updateTemplateLiteralTypeSpan, createKeywordTypeNode: createKeywordTypeNode, createTypePredicateNode: createTypePredicateNode, updateTypePredicateNode: updateTypePredicateNode, @@ -20442,8 +19718,6 @@ var ts; updateMappedTypeNode: updateMappedTypeNode, createLiteralTypeNode: createLiteralTypeNode, updateLiteralTypeNode: updateLiteralTypeNode, - createTemplateLiteralType: createTemplateLiteralType, - updateTemplateLiteralType: updateTemplateLiteralType, createObjectBindingPattern: createObjectBindingPattern, updateObjectBindingPattern: updateObjectBindingPattern, createArrayBindingPattern: createArrayBindingPattern, @@ -20609,18 +19883,18 @@ var ts; createExternalModuleReference: createExternalModuleReference, updateExternalModuleReference: updateExternalModuleReference, // lazily load factory members for JSDoc types with similar structure - get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(303 /* JSDocAllType */); }, - get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(304 /* JSDocUnknownType */); }, - get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(306 /* JSDocNonNullableType */); }, - get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(306 /* JSDocNonNullableType */); }, - get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(305 /* JSDocNullableType */); }, - get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(305 /* JSDocNullableType */); }, - get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(307 /* JSDocOptionalType */); }, - get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(307 /* JSDocOptionalType */); }, - get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(309 /* JSDocVariadicType */); }, - get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(309 /* JSDocVariadicType */); }, - get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(310 /* JSDocNamepathType */); }, - get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(310 /* JSDocNamepathType */); }, + get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(299 /* JSDocAllType */); }, + get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(300 /* JSDocUnknownType */); }, + get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(302 /* JSDocNonNullableType */); }, + get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(302 /* JSDocNonNullableType */); }, + get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(301 /* JSDocNullableType */); }, + get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(301 /* JSDocNullableType */); }, + get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(303 /* JSDocOptionalType */); }, + get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(303 /* JSDocOptionalType */); }, + get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(305 /* JSDocVariadicType */); }, + get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(305 /* JSDocVariadicType */); }, + get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(306 /* JSDocNamepathType */); }, + get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(306 /* JSDocNamepathType */); }, createJSDocFunctionType: createJSDocFunctionType, updateJSDocFunctionType: updateJSDocFunctionType, createJSDocTypeLiteral: createJSDocTypeLiteral, @@ -20643,33 +19917,29 @@ var ts; updateJSDocAugmentsTag: updateJSDocAugmentsTag, createJSDocImplementsTag: createJSDocImplementsTag, updateJSDocImplementsTag: updateJSDocImplementsTag, - createJSDocSeeTag: createJSDocSeeTag, - updateJSDocSeeTag: updateJSDocSeeTag, - createJSDocNameReference: createJSDocNameReference, - updateJSDocNameReference: updateJSDocNameReference, // lazily load factory members for JSDoc tags with similar structure - get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(329 /* JSDocTypeTag */); }, - get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(329 /* JSDocTypeTag */); }, - get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(327 /* JSDocReturnTag */); }, - get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(327 /* JSDocReturnTag */); }, - get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(328 /* JSDocThisTag */); }, - get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(328 /* JSDocThisTag */); }, - get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(325 /* JSDocEnumTag */); }, - get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(325 /* JSDocEnumTag */); }, - get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(317 /* JSDocAuthorTag */); }, - get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(317 /* JSDocAuthorTag */); }, - get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(319 /* JSDocClassTag */); }, - get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(319 /* JSDocClassTag */); }, - get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(320 /* JSDocPublicTag */); }, - get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(320 /* JSDocPublicTag */); }, - get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(321 /* JSDocPrivateTag */); }, - get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(321 /* JSDocPrivateTag */); }, - get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(322 /* JSDocProtectedTag */); }, - get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(322 /* JSDocProtectedTag */); }, - get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(323 /* JSDocReadonlyTag */); }, - get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(323 /* JSDocReadonlyTag */); }, - get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(318 /* JSDocDeprecatedTag */); }, - get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(318 /* JSDocDeprecatedTag */); }, + get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(325 /* JSDocTypeTag */); }, + get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(325 /* JSDocTypeTag */); }, + get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(323 /* JSDocReturnTag */); }, + get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(323 /* JSDocReturnTag */); }, + get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(324 /* JSDocThisTag */); }, + get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(324 /* JSDocThisTag */); }, + get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(321 /* JSDocEnumTag */); }, + get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(321 /* JSDocEnumTag */); }, + get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(313 /* JSDocAuthorTag */); }, + get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(313 /* JSDocAuthorTag */); }, + get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(315 /* JSDocClassTag */); }, + get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(315 /* JSDocClassTag */); }, + get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(316 /* JSDocPublicTag */); }, + get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(316 /* JSDocPublicTag */); }, + get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(317 /* JSDocPrivateTag */); }, + get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(317 /* JSDocPrivateTag */); }, + get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(318 /* JSDocProtectedTag */); }, + get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(318 /* JSDocProtectedTag */); }, + get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(319 /* JSDocReadonlyTag */); }, + get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(319 /* JSDocReadonlyTag */); }, + get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(314 /* JSDocDeprecatedTag */); }, + get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(314 /* JSDocDeprecatedTag */); }, createJSDocUnknownTag: createJSDocUnknownTag, updateJSDocUnknownTag: updateJSDocUnknownTag, createJSDocComment: createJSDocComment, @@ -20814,7 +20084,6 @@ var ts; if (elements.transformFlags === undefined) { aggregateChildrenFlags(elements); } - ts.Debug.attachNodeArrayDebugInfo(elements); return elements; } // Since the element list of a node array is typically created by starting with an empty array and @@ -20825,7 +20094,6 @@ var ts; ts.setTextRangePosEnd(array, -1, -1); array.hasTrailingComma = !!hasTrailingComma; aggregateChildrenFlags(array); - ts.Debug.attachNodeArrayDebugInfo(array); return array; } function createBaseNode(kind) { @@ -20855,11 +20123,11 @@ var ts; // don't propagate child flags. if (name) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: if (ts.isIdentifier(name)) { node.transformFlags |= propagateIdentifierNameFlags(name); break; @@ -21087,7 +20355,7 @@ var ts; return baseFactory.createBaseTokenNode(kind); } function createToken(token) { - ts.Debug.assert(token >= 0 /* FirstToken */ && token <= 156 /* LastToken */, "Invalid token"); + ts.Debug.assert(token >= 0 /* FirstToken */ && token <= 155 /* LastToken */, "Invalid token"); ts.Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); ts.Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals."); ts.Debug.assert(token !== 78 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers"); @@ -21103,21 +20371,21 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 125 /* AbstractKeyword */: case 133 /* DeclareKeyword */: case 84 /* ConstKeyword */: case 128 /* AnyKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 141 /* NeverKeyword */: - case 145 /* ObjectKeyword */: - case 147 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 140 /* NeverKeyword */: + case 144 /* ObjectKeyword */: + case 146 /* StringKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: case 113 /* VoidKeyword */: - case 152 /* UnknownKeyword */: - case 150 /* UndefinedKeyword */: // `undefined` is an Identifier in the expression case. + case 151 /* UnknownKeyword */: + case 149 /* UndefinedKeyword */: // `undefined` is an Identifier in the expression case. transformFlags = 1 /* ContainsTypeScript */; break; case 123 /* StaticKeyword */: @@ -21195,7 +20463,7 @@ var ts; result.push(createModifier(123 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(142 /* ReadonlyKeyword */)); + result.push(createModifier(141 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(129 /* AsyncKeyword */)); @@ -21207,7 +20475,7 @@ var ts; // // @api function createQualifiedName(left, right) { - var node = createBaseNode(157 /* QualifiedName */); + var node = createBaseNode(156 /* QualifiedName */); node.left = left; node.right = asName(right); node.transformFlags |= @@ -21224,7 +20492,7 @@ var ts; } // @api function createComputedPropertyName(expression) { - var node = createBaseNode(158 /* ComputedPropertyName */); + var node = createBaseNode(157 /* ComputedPropertyName */); node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -21243,7 +20511,7 @@ var ts; // // @api function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createBaseNamedDeclaration(159 /* TypeParameter */, + var node = createBaseNamedDeclaration(158 /* TypeParameter */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.constraint = constraint; @@ -21261,7 +20529,7 @@ var ts; } // @api function createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(160 /* Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); + var node = createBaseVariableLikeDeclaration(159 /* Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); node.dotDotDotToken = dotDotDotToken; node.questionToken = questionToken; if (ts.isThisIdentifier(node.name)) { @@ -21294,7 +20562,7 @@ var ts; } // @api function createDecorator(expression) { - var node = createBaseNode(161 /* Decorator */); + var node = createBaseNode(160 /* Decorator */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -21313,7 +20581,7 @@ var ts; // // @api function createPropertySignature(modifiers, name, questionToken, type) { - var node = createBaseNamedDeclaration(162 /* PropertySignature */, + var node = createBaseNamedDeclaration(161 /* PropertySignature */, /*decorators*/ undefined, modifiers, name); node.type = type; node.questionToken = questionToken; @@ -21331,7 +20599,7 @@ var ts; } // @api function createPropertyDeclaration(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(163 /* PropertyDeclaration */, decorators, modifiers, name, type, initializer); + var node = createBaseVariableLikeDeclaration(162 /* PropertyDeclaration */, decorators, modifiers, name, type, initializer); node.questionToken = questionOrExclamationToken && ts.isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined; node.exclamationToken = questionOrExclamationToken && ts.isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined; node.transformFlags |= @@ -21360,7 +20628,7 @@ var ts; } // @api function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(164 /* MethodSignature */, + var node = createBaseSignatureDeclaration(163 /* MethodSignature */, /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type); node.questionToken = questionToken; node.transformFlags = 1 /* ContainsTypeScript */; @@ -21379,7 +20647,7 @@ var ts; } // @api function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(165 /* MethodDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); + var node = createBaseFunctionLikeDeclaration(164 /* MethodDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; node.questionToken = questionToken; node.transformFlags |= @@ -21418,7 +20686,7 @@ var ts; } // @api function createConstructorDeclaration(decorators, modifiers, parameters, body) { - var node = createBaseFunctionLikeDeclaration(166 /* Constructor */, decorators, modifiers, + var node = createBaseFunctionLikeDeclaration(165 /* Constructor */, decorators, modifiers, /*name*/ undefined, /*typeParameters*/ undefined, parameters, /*type*/ undefined, body); @@ -21436,7 +20704,7 @@ var ts; } // @api function createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) { - return createBaseFunctionLikeDeclaration(167 /* GetAccessor */, decorators, modifiers, name, + return createBaseFunctionLikeDeclaration(166 /* GetAccessor */, decorators, modifiers, name, /*typeParameters*/ undefined, parameters, type, body); } // @api @@ -21452,7 +20720,7 @@ var ts; } // @api function createSetAccessorDeclaration(decorators, modifiers, name, parameters, body) { - return createBaseFunctionLikeDeclaration(168 /* SetAccessor */, decorators, modifiers, name, + return createBaseFunctionLikeDeclaration(167 /* SetAccessor */, decorators, modifiers, name, /*typeParameters*/ undefined, parameters, /*type*/ undefined, body); } @@ -21468,7 +20736,7 @@ var ts; } // @api function createCallSignature(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(169 /* CallSignature */, + var node = createBaseSignatureDeclaration(168 /* CallSignature */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21485,7 +20753,7 @@ var ts; } // @api function createConstructSignature(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(170 /* ConstructSignature */, + var node = createBaseSignatureDeclaration(169 /* ConstructSignature */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21502,7 +20770,7 @@ var ts; } // @api function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createBaseSignatureDeclaration(171 /* IndexSignature */, decorators, modifiers, + var node = createBaseSignatureDeclaration(170 /* IndexSignature */, decorators, modifiers, /*name*/ undefined, /*typeParameters*/ undefined, parameters, type); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21517,21 +20785,6 @@ var ts; ? updateBaseSignatureDeclaration(createIndexSignature(decorators, modifiers, parameters, type), node) : node; } - // @api - function createTemplateLiteralTypeSpan(type, literal) { - var node = createBaseNode(194 /* TemplateLiteralTypeSpan */); - node.type = type; - node.literal = literal; - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - // @api - function updateTemplateLiteralTypeSpan(node, type, literal) { - return node.type !== type - || node.literal !== literal - ? update(createTemplateLiteralTypeSpan(type, literal), node) - : node; - } // // Types // @@ -21541,7 +20794,7 @@ var ts; } // @api function createTypePredicateNode(assertsModifier, parameterName, type) { - var node = createBaseNode(172 /* TypePredicate */); + var node = createBaseNode(171 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -21558,7 +20811,7 @@ var ts; } // @api function createTypeReferenceNode(typeName, typeArguments) { - var node = createBaseNode(173 /* TypeReference */); + var node = createBaseNode(172 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21573,7 +20826,7 @@ var ts; } // @api function createFunctionTypeNode(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(174 /* FunctionType */, + var node = createBaseSignatureDeclaration(173 /* FunctionType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21590,7 +20843,7 @@ var ts; } // @api function createConstructorTypeNode(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(175 /* ConstructorType */, + var node = createBaseSignatureDeclaration(174 /* ConstructorType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21607,7 +20860,7 @@ var ts; } // @api function createTypeQueryNode(exprName) { - var node = createBaseNode(176 /* TypeQuery */); + var node = createBaseNode(175 /* TypeQuery */); node.exprName = exprName; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21620,7 +20873,7 @@ var ts; } // @api function createTypeLiteralNode(members) { - var node = createBaseNode(177 /* TypeLiteral */); + var node = createBaseNode(176 /* TypeLiteral */); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21633,7 +20886,7 @@ var ts; } // @api function createArrayTypeNode(elementType) { - var node = createBaseNode(178 /* ArrayType */); + var node = createBaseNode(177 /* ArrayType */); node.elementType = parenthesizerRules().parenthesizeElementTypeOfArrayType(elementType); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21646,7 +20899,7 @@ var ts; } // @api function createTupleTypeNode(elements) { - var node = createBaseNode(179 /* TupleType */); + var node = createBaseNode(178 /* TupleType */); node.elements = createNodeArray(elements); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21659,7 +20912,7 @@ var ts; } // @api function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { - var node = createBaseNode(192 /* NamedTupleMember */); + var node = createBaseNode(191 /* NamedTupleMember */); node.dotDotDotToken = dotDotDotToken; node.name = name; node.questionToken = questionToken; @@ -21678,7 +20931,7 @@ var ts; } // @api function createOptionalTypeNode(type) { - var node = createBaseNode(180 /* OptionalType */); + var node = createBaseNode(179 /* OptionalType */); node.type = parenthesizerRules().parenthesizeElementTypeOfArrayType(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21691,7 +20944,7 @@ var ts; } // @api function createRestTypeNode(type) { - var node = createBaseNode(181 /* RestType */); + var node = createBaseNode(180 /* RestType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21715,7 +20968,7 @@ var ts; } // @api function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(182 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(181 /* UnionType */, types); } // @api function updateUnionTypeNode(node, types) { @@ -21723,7 +20976,7 @@ var ts; } // @api function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(183 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(182 /* IntersectionType */, types); } // @api function updateIntersectionTypeNode(node, types) { @@ -21731,7 +20984,7 @@ var ts; } // @api function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createBaseNode(184 /* ConditionalType */); + var node = createBaseNode(183 /* ConditionalType */); node.checkType = parenthesizerRules().parenthesizeMemberOfConditionalType(checkType); node.extendsType = parenthesizerRules().parenthesizeMemberOfConditionalType(extendsType); node.trueType = trueType; @@ -21750,7 +21003,7 @@ var ts; } // @api function createInferTypeNode(typeParameter) { - var node = createBaseNode(185 /* InferType */); + var node = createBaseNode(184 /* InferType */); node.typeParameter = typeParameter; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21762,24 +21015,9 @@ var ts; : node; } // @api - function createTemplateLiteralType(head, templateSpans) { - var node = createBaseNode(193 /* TemplateLiteralType */); - node.head = head; - node.templateSpans = createNodeArray(templateSpans); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - // @api - function updateTemplateLiteralType(node, head, templateSpans) { - return node.head !== head - || node.templateSpans !== templateSpans - ? update(createTemplateLiteralType(head, templateSpans), node) - : node; - } - // @api function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { if (isTypeOf === void 0) { isTypeOf = false; } - var node = createBaseNode(195 /* ImportType */); + var node = createBaseNode(192 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); @@ -21799,7 +21037,7 @@ var ts; } // @api function createParenthesizedType(type) { - var node = createBaseNode(186 /* ParenthesizedType */); + var node = createBaseNode(185 /* ParenthesizedType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21812,13 +21050,13 @@ var ts; } // @api function createThisTypeNode() { - var node = createBaseNode(187 /* ThisType */); + var node = createBaseNode(186 /* ThisType */); node.transformFlags = 1 /* ContainsTypeScript */; return node; } // @api function createTypeOperatorNode(operator, type) { - var node = createBaseNode(188 /* TypeOperator */); + var node = createBaseNode(187 /* TypeOperator */); node.operator = operator; node.type = parenthesizerRules().parenthesizeMemberOfElementType(type); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21832,7 +21070,7 @@ var ts; } // @api function createIndexedAccessTypeNode(objectType, indexType) { - var node = createBaseNode(189 /* IndexedAccessType */); + var node = createBaseNode(188 /* IndexedAccessType */); node.objectType = parenthesizerRules().parenthesizeMemberOfElementType(objectType); node.indexType = indexType; node.transformFlags = 1 /* ContainsTypeScript */; @@ -21846,29 +21084,27 @@ var ts; : node; } // @api - function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type) { - var node = createBaseNode(190 /* MappedType */); + function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { + var node = createBaseNode(189 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; - node.nameType = nameType; node.questionToken = questionToken; node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; } // @api - function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type) { + function updateMappedTypeNode(node, readonlyToken, typeParameter, questionToken, type) { return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter - || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type - ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), node) + ? update(createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), node) : node; } // @api function createLiteralTypeNode(literal) { - var node = createBaseNode(191 /* LiteralType */); + var node = createBaseNode(190 /* LiteralType */); node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21884,7 +21120,7 @@ var ts; // // @api function createObjectBindingPattern(elements) { - var node = createBaseNode(196 /* ObjectBindingPattern */); + var node = createBaseNode(193 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | @@ -21905,7 +21141,7 @@ var ts; } // @api function createArrayBindingPattern(elements) { - var node = createBaseNode(197 /* ArrayBindingPattern */); + var node = createBaseNode(194 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | @@ -21921,7 +21157,7 @@ var ts; } // @api function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createBaseBindingLikeDeclaration(198 /* BindingElement */, + var node = createBaseBindingLikeDeclaration(195 /* BindingElement */, /*decorators*/ undefined, /*modifiers*/ undefined, name, initializer); node.propertyName = asName(propertyName); @@ -21957,7 +21193,7 @@ var ts; } // @api function createArrayLiteralExpression(elements, multiLine) { - var node = createBaseExpression(199 /* ArrayLiteralExpression */); + var node = createBaseExpression(196 /* ArrayLiteralExpression */); node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(elements)); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.elements); @@ -21971,7 +21207,7 @@ var ts; } // @api function createObjectLiteralExpression(properties, multiLine) { - var node = createBaseExpression(200 /* ObjectLiteralExpression */); + var node = createBaseExpression(197 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); @@ -21985,7 +21221,7 @@ var ts; } // @api function createPropertyAccessExpression(expression, name) { - var node = createBaseExpression(201 /* PropertyAccessExpression */); + var node = createBaseExpression(198 /* PropertyAccessExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.name = asName(name); node.transformFlags = @@ -22014,7 +21250,7 @@ var ts; } // @api function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createBaseExpression(201 /* PropertyAccessExpression */); + var node = createBaseExpression(198 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -22041,7 +21277,7 @@ var ts; } // @api function createElementAccessExpression(expression, index) { - var node = createBaseExpression(202 /* ElementAccessExpression */); + var node = createBaseExpression(199 /* ElementAccessExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.argumentExpression = asExpression(index); node.transformFlags |= @@ -22068,7 +21304,7 @@ var ts; } // @api function createElementAccessChain(expression, questionDotToken, index) { - var node = createBaseExpression(202 /* ElementAccessExpression */); + var node = createBaseExpression(199 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -22093,7 +21329,7 @@ var ts; } // @api function createCallExpression(expression, typeArguments, argumentsArray) { - var node = createBaseExpression(203 /* CallExpression */); + var node = createBaseExpression(200 /* CallExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)); @@ -22125,7 +21361,7 @@ var ts; } // @api function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createBaseExpression(203 /* CallExpression */); + var node = createBaseExpression(200 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -22157,7 +21393,7 @@ var ts; } // @api function createNewExpression(expression, typeArguments, argumentsArray) { - var node = createBaseExpression(204 /* NewExpression */); + var node = createBaseExpression(201 /* NewExpression */); node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : undefined; @@ -22181,7 +21417,7 @@ var ts; } // @api function createTaggedTemplateExpression(tag, typeArguments, template) { - var node = createBaseExpression(205 /* TaggedTemplateExpression */); + var node = createBaseExpression(202 /* TaggedTemplateExpression */); node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag); node.typeArguments = asNodeArray(typeArguments); node.template = template; @@ -22208,7 +21444,7 @@ var ts; } // @api function createTypeAssertion(type, expression) { - var node = createBaseExpression(206 /* TypeAssertionExpression */); + var node = createBaseExpression(203 /* TypeAssertionExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.type = type; node.transformFlags |= @@ -22226,7 +21462,7 @@ var ts; } // @api function createParenthesizedExpression(expression) { - var node = createBaseExpression(207 /* ParenthesizedExpression */); + var node = createBaseExpression(204 /* ParenthesizedExpression */); node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); return node; @@ -22239,7 +21475,7 @@ var ts; } // @api function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(208 /* FunctionExpression */, + var node = createBaseFunctionLikeDeclaration(205 /* FunctionExpression */, /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; node.transformFlags |= propagateChildFlags(node.asteriskToken); @@ -22273,7 +21509,7 @@ var ts; } // @api function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createBaseFunctionLikeDeclaration(209 /* ArrowFunction */, + var node = createBaseFunctionLikeDeclaration(206 /* ArrowFunction */, /*decorators*/ undefined, modifiers, /*name*/ undefined, typeParameters, parameters, type, parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body)); node.equalsGreaterThanToken = equalsGreaterThanToken !== null && equalsGreaterThanToken !== void 0 ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */); @@ -22298,7 +21534,7 @@ var ts; } // @api function createDeleteExpression(expression) { - var node = createBaseExpression(210 /* DeleteExpression */); + var node = createBaseExpression(207 /* DeleteExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22311,7 +21547,7 @@ var ts; } // @api function createTypeOfExpression(expression) { - var node = createBaseExpression(211 /* TypeOfExpression */); + var node = createBaseExpression(208 /* TypeOfExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22324,7 +21560,7 @@ var ts; } // @api function createVoidExpression(expression) { - var node = createBaseExpression(212 /* VoidExpression */); + var node = createBaseExpression(209 /* VoidExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22337,7 +21573,7 @@ var ts; } // @api function createAwaitExpression(expression) { - var node = createBaseExpression(213 /* AwaitExpression */); + var node = createBaseExpression(210 /* AwaitExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22354,7 +21590,7 @@ var ts; } // @api function createPrefixUnaryExpression(operator, operand) { - var node = createBaseExpression(214 /* PrefixUnaryExpression */); + var node = createBaseExpression(211 /* PrefixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand); node.transformFlags |= propagateChildFlags(node.operand); @@ -22368,7 +21604,7 @@ var ts; } // @api function createPostfixUnaryExpression(operand, operator) { - var node = createBaseExpression(215 /* PostfixUnaryExpression */); + var node = createBaseExpression(212 /* PostfixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand); node.transformFlags = propagateChildFlags(node.operand); @@ -22382,7 +21618,7 @@ var ts; } // @api function createBinaryExpression(left, operator, right) { - var node = createBaseExpression(216 /* BinaryExpression */); + var node = createBaseExpression(213 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left); @@ -22400,14 +21636,12 @@ var ts; node.transformFlags |= 256 /* ContainsES2015 */ | 32 /* ContainsES2018 */ | - 1024 /* ContainsDestructuringAssignment */ | - propagateAssignmentPatternFlags(node.left); + 1024 /* ContainsDestructuringAssignment */; } else if (ts.isArrayLiteralExpression(node.left)) { node.transformFlags |= 256 /* ContainsES2015 */ | - 1024 /* ContainsDestructuringAssignment */ | - propagateAssignmentPatternFlags(node.left); + 1024 /* ContainsDestructuringAssignment */; } } else if (operatorKind === 42 /* AsteriskAsteriskToken */ || operatorKind === 66 /* AsteriskAsteriskEqualsToken */) { @@ -22418,29 +21652,6 @@ var ts; } return node; } - function propagateAssignmentPatternFlags(node) { - if (node.transformFlags & 16384 /* ContainsObjectRestOrSpread */) - return 16384 /* ContainsObjectRestOrSpread */; - if (node.transformFlags & 32 /* ContainsES2018 */) { - // check for nested spread assignments, otherwise '{ x: { a, ...b } = foo } = c' - // will not be correctly interpreted by the ES2018 transformer - for (var _i = 0, _a = ts.getElementsOfBindingOrAssignmentPattern(node); _i < _a.length; _i++) { - var element = _a[_i]; - var target = ts.getTargetOfBindingOrAssignmentElement(element); - if (target && ts.isAssignmentPattern(target)) { - if (target.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { - return 16384 /* ContainsObjectRestOrSpread */; - } - if (target.transformFlags & 32 /* ContainsES2018 */) { - var flags_1 = propagateAssignmentPatternFlags(target); - if (flags_1) - return flags_1; - } - } - } - } - return 0 /* None */; - } // @api function updateBinaryExpression(node, left, operator, right) { return node.left !== left @@ -22451,7 +21662,7 @@ var ts; } // @api function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { - var node = createBaseExpression(217 /* ConditionalExpression */); + var node = createBaseExpression(214 /* ConditionalExpression */); node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); node.questionToken = questionToken !== null && questionToken !== void 0 ? questionToken : createToken(57 /* QuestionToken */); node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); @@ -22477,7 +21688,7 @@ var ts; } // @api function createTemplateExpression(head, templateSpans) { - var node = createBaseExpression(218 /* TemplateExpression */); + var node = createBaseExpression(215 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); node.transformFlags |= @@ -22547,7 +21758,7 @@ var ts; // @api function createYieldExpression(asteriskToken, expression) { ts.Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression."); - var node = createBaseExpression(219 /* YieldExpression */); + var node = createBaseExpression(216 /* YieldExpression */); node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.asteriskToken = asteriskToken; node.transformFlags |= @@ -22567,7 +21778,7 @@ var ts; } // @api function createSpreadElement(expression) { - var node = createBaseExpression(220 /* SpreadElement */); + var node = createBaseExpression(217 /* SpreadElement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22583,7 +21794,7 @@ var ts; } // @api function createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseClassLikeDeclaration(221 /* ClassExpression */, decorators, modifiers, name, typeParameters, heritageClauses, members); + var node = createBaseClassLikeDeclaration(218 /* ClassExpression */, decorators, modifiers, name, typeParameters, heritageClauses, members); node.transformFlags |= 256 /* ContainsES2015 */; return node; } @@ -22600,11 +21811,11 @@ var ts; } // @api function createOmittedExpression() { - return createBaseExpression(222 /* OmittedExpression */); + return createBaseExpression(219 /* OmittedExpression */); } // @api function createExpressionWithTypeArguments(expression, typeArguments) { - var node = createBaseNode(223 /* ExpressionWithTypeArguments */); + var node = createBaseNode(220 /* ExpressionWithTypeArguments */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.transformFlags |= @@ -22622,7 +21833,7 @@ var ts; } // @api function createAsExpression(expression, type) { - var node = createBaseExpression(224 /* AsExpression */); + var node = createBaseExpression(221 /* AsExpression */); node.expression = expression; node.type = type; node.transformFlags |= @@ -22640,7 +21851,7 @@ var ts; } // @api function createNonNullExpression(expression) { - var node = createBaseExpression(225 /* NonNullExpression */); + var node = createBaseExpression(222 /* NonNullExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22658,7 +21869,7 @@ var ts; } // @api function createNonNullChain(expression) { - var node = createBaseExpression(225 /* NonNullExpression */); + var node = createBaseExpression(222 /* NonNullExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= @@ -22675,7 +21886,7 @@ var ts; } // @api function createMetaProperty(keywordToken, name) { - var node = createBaseExpression(226 /* MetaProperty */); + var node = createBaseExpression(223 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; node.transformFlags |= propagateChildFlags(node.name); @@ -22702,7 +21913,7 @@ var ts; // // @api function createTemplateSpan(expression, literal) { - var node = createBaseNode(228 /* TemplateSpan */); + var node = createBaseNode(225 /* TemplateSpan */); node.expression = expression; node.literal = literal; node.transformFlags |= @@ -22720,7 +21931,7 @@ var ts; } // @api function createSemicolonClassElement() { - var node = createBaseNode(229 /* SemicolonClassElement */); + var node = createBaseNode(226 /* SemicolonClassElement */); node.transformFlags |= 256 /* ContainsES2015 */; return node; } @@ -22729,7 +21940,7 @@ var ts; // // @api function createBlock(statements, multiLine) { - var node = createBaseNode(230 /* Block */); + var node = createBaseNode(227 /* Block */); node.statements = createNodeArray(statements); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); @@ -22743,7 +21954,7 @@ var ts; } // @api function createVariableStatement(modifiers, declarationList) { - var node = createBaseDeclaration(232 /* VariableStatement */, /*decorators*/ undefined, modifiers); + var node = createBaseDeclaration(229 /* VariableStatement */, /*decorators*/ undefined, modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; node.transformFlags |= propagateChildFlags(node.declarationList); @@ -22761,11 +21972,11 @@ var ts; } // @api function createEmptyStatement() { - return createBaseNode(231 /* EmptyStatement */); + return createBaseNode(228 /* EmptyStatement */); } // @api function createExpressionStatement(expression) { - var node = createBaseNode(233 /* ExpressionStatement */); + var node = createBaseNode(230 /* ExpressionStatement */); node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22778,7 +21989,7 @@ var ts; } // @api function createIfStatement(expression, thenStatement, elseStatement) { - var node = createBaseNode(234 /* IfStatement */); + var node = createBaseNode(231 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -22798,7 +22009,7 @@ var ts; } // @api function createDoStatement(statement, expression) { - var node = createBaseNode(235 /* DoStatement */); + var node = createBaseNode(232 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; node.transformFlags |= @@ -22815,7 +22026,7 @@ var ts; } // @api function createWhileStatement(expression, statement) { - var node = createBaseNode(236 /* WhileStatement */); + var node = createBaseNode(233 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22832,7 +22043,7 @@ var ts; } // @api function createForStatement(initializer, condition, incrementor, statement) { - var node = createBaseNode(237 /* ForStatement */); + var node = createBaseNode(234 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -22855,7 +22066,7 @@ var ts; } // @api function createForInStatement(initializer, expression, statement) { - var node = createBaseNode(238 /* ForInStatement */); + var node = createBaseNode(235 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -22875,7 +22086,7 @@ var ts; } // @api function createForOfStatement(awaitModifier, initializer, expression, statement) { - var node = createBaseNode(239 /* ForOfStatement */); + var node = createBaseNode(236 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); @@ -22901,7 +22112,7 @@ var ts; } // @api function createContinueStatement(label) { - var node = createBaseNode(240 /* ContinueStatement */); + var node = createBaseNode(237 /* ContinueStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | @@ -22916,7 +22127,7 @@ var ts; } // @api function createBreakStatement(label) { - var node = createBaseNode(241 /* BreakStatement */); + var node = createBaseNode(238 /* BreakStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | @@ -22931,7 +22142,7 @@ var ts; } // @api function createReturnStatement(expression) { - var node = createBaseNode(242 /* ReturnStatement */); + var node = createBaseNode(239 /* ReturnStatement */); node.expression = expression; // return in an ES2018 async generator must be awaited node.transformFlags |= @@ -22948,7 +22159,7 @@ var ts; } // @api function createWithStatement(expression, statement) { - var node = createBaseNode(243 /* WithStatement */); + var node = createBaseNode(240 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22965,7 +22176,7 @@ var ts; } // @api function createSwitchStatement(expression, caseBlock) { - var node = createBaseNode(244 /* SwitchStatement */); + var node = createBaseNode(241 /* SwitchStatement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.caseBlock = caseBlock; node.transformFlags |= @@ -22982,7 +22193,7 @@ var ts; } // @api function createLabeledStatement(label, statement) { - var node = createBaseNode(245 /* LabeledStatement */); + var node = createBaseNode(242 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22999,7 +22210,7 @@ var ts; } // @api function createThrowStatement(expression) { - var node = createBaseNode(246 /* ThrowStatement */); + var node = createBaseNode(243 /* ThrowStatement */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -23012,7 +22223,7 @@ var ts; } // @api function createTryStatement(tryBlock, catchClause, finallyBlock) { - var node = createBaseNode(247 /* TryStatement */); + var node = createBaseNode(244 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -23032,11 +22243,11 @@ var ts; } // @api function createDebuggerStatement() { - return createBaseNode(248 /* DebuggerStatement */); + return createBaseNode(245 /* DebuggerStatement */); } // @api function createVariableDeclaration(name, exclamationToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(249 /* VariableDeclaration */, + var node = createBaseVariableLikeDeclaration(246 /* VariableDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); node.exclamationToken = exclamationToken; @@ -23058,7 +22269,7 @@ var ts; // @api function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createBaseNode(250 /* VariableDeclarationList */); + var node = createBaseNode(247 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); node.transformFlags |= @@ -23079,7 +22290,7 @@ var ts; } // @api function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(251 /* FunctionDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); + var node = createBaseFunctionLikeDeclaration(248 /* FunctionDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; if (!node.body || ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; @@ -23117,7 +22328,7 @@ var ts; } // @api function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseClassLikeDeclaration(252 /* ClassDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses, members); + var node = createBaseClassLikeDeclaration(249 /* ClassDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses, members); if (ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } @@ -23142,7 +22353,7 @@ var ts; } // @api function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseInterfaceOrClassLikeDeclaration(253 /* InterfaceDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses); + var node = createBaseInterfaceOrClassLikeDeclaration(250 /* InterfaceDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -23160,7 +22371,7 @@ var ts; } // @api function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createBaseGenericNamedDeclaration(254 /* TypeAliasDeclaration */, decorators, modifiers, name, typeParameters); + var node = createBaseGenericNamedDeclaration(251 /* TypeAliasDeclaration */, decorators, modifiers, name, typeParameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -23177,7 +22388,7 @@ var ts; } // @api function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createBaseNamedDeclaration(255 /* EnumDeclaration */, decorators, modifiers, name); + var node = createBaseNamedDeclaration(252 /* EnumDeclaration */, decorators, modifiers, name); node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.members) | @@ -23197,7 +22408,7 @@ var ts; // @api function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createBaseDeclaration(256 /* ModuleDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(253 /* ModuleDeclaration */, decorators, modifiers); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.name = name; node.body = body; @@ -23224,7 +22435,7 @@ var ts; } // @api function createModuleBlock(statements) { - var node = createBaseNode(257 /* ModuleBlock */); + var node = createBaseNode(254 /* ModuleBlock */); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); return node; @@ -23237,7 +22448,7 @@ var ts; } // @api function createCaseBlock(clauses) { - var node = createBaseNode(258 /* CaseBlock */); + var node = createBaseNode(255 /* CaseBlock */); node.clauses = createNodeArray(clauses); node.transformFlags |= propagateChildrenFlags(node.clauses); return node; @@ -23250,7 +22461,7 @@ var ts; } // @api function createNamespaceExportDeclaration(name) { - var node = createBaseNamedDeclaration(259 /* NamespaceExportDeclaration */, + var node = createBaseNamedDeclaration(256 /* NamespaceExportDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.transformFlags = 1 /* ContainsTypeScript */; @@ -23264,7 +22475,7 @@ var ts; } // @api function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createBaseNamedDeclaration(260 /* ImportEqualsDeclaration */, decorators, modifiers, name); + var node = createBaseNamedDeclaration(257 /* ImportEqualsDeclaration */, decorators, modifiers, name); node.moduleReference = moduleReference; node.transformFlags |= propagateChildFlags(node.moduleReference); if (!ts.isExternalModuleReference(node.moduleReference)) @@ -23283,7 +22494,7 @@ var ts; } // @api function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createBaseDeclaration(261 /* ImportDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(258 /* ImportDeclaration */, decorators, modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; node.transformFlags |= @@ -23303,7 +22514,7 @@ var ts; } // @api function createImportClause(isTypeOnly, name, namedBindings) { - var node = createBaseNode(262 /* ImportClause */); + var node = createBaseNode(259 /* ImportClause */); node.isTypeOnly = isTypeOnly; node.name = name; node.namedBindings = namedBindings; @@ -23326,7 +22537,7 @@ var ts; } // @api function createNamespaceImport(name) { - var node = createBaseNode(263 /* NamespaceImport */); + var node = createBaseNode(260 /* NamespaceImport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23340,7 +22551,7 @@ var ts; } // @api function createNamespaceExport(name) { - var node = createBaseNode(269 /* NamespaceExport */); + var node = createBaseNode(266 /* NamespaceExport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name) | @@ -23356,7 +22567,7 @@ var ts; } // @api function createNamedImports(elements) { - var node = createBaseNode(264 /* NamedImports */); + var node = createBaseNode(261 /* NamedImports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23370,7 +22581,7 @@ var ts; } // @api function createImportSpecifier(propertyName, name) { - var node = createBaseNode(265 /* ImportSpecifier */); + var node = createBaseNode(262 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; node.transformFlags |= @@ -23388,7 +22599,7 @@ var ts; } // @api function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createBaseDeclaration(266 /* ExportAssignment */, decorators, modifiers); + var node = createBaseDeclaration(263 /* ExportAssignment */, decorators, modifiers); node.isExportEquals = isExportEquals; node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary(62 /* EqualsToken */, /*leftSide*/ undefined, expression) @@ -23407,7 +22618,7 @@ var ts; } // @api function createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier) { - var node = createBaseDeclaration(267 /* ExportDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(264 /* ExportDeclaration */, decorators, modifiers); node.isTypeOnly = isTypeOnly; node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; @@ -23429,7 +22640,7 @@ var ts; } // @api function createNamedExports(elements) { - var node = createBaseNode(268 /* NamedExports */); + var node = createBaseNode(265 /* NamedExports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23443,7 +22654,7 @@ var ts; } // @api function createExportSpecifier(propertyName, name) { - var node = createBaseNode(270 /* ExportSpecifier */); + var node = createBaseNode(267 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); node.transformFlags |= @@ -23461,7 +22672,7 @@ var ts; } // @api function createMissingDeclaration() { - var node = createBaseDeclaration(271 /* MissingDeclaration */, + var node = createBaseDeclaration(268 /* MissingDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined); return node; @@ -23471,7 +22682,7 @@ var ts; // // @api function createExternalModuleReference(expression) { - var node = createBaseNode(272 /* ExternalModuleReference */); + var node = createBaseNode(269 /* ExternalModuleReference */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23516,7 +22727,7 @@ var ts; } // @api function createJSDocFunctionType(parameters, type) { - var node = createBaseSignatureDeclaration(308 /* JSDocFunctionType */, + var node = createBaseSignatureDeclaration(304 /* JSDocFunctionType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, @@ -23533,7 +22744,7 @@ var ts; // @api function createJSDocTypeLiteral(propertyTags, isArrayType) { if (isArrayType === void 0) { isArrayType = false; } - var node = createBaseNode(312 /* JSDocTypeLiteral */); + var node = createBaseNode(308 /* JSDocTypeLiteral */); node.jsDocPropertyTags = asNodeArray(propertyTags); node.isArrayType = isArrayType; return node; @@ -23547,7 +22758,7 @@ var ts; } // @api function createJSDocTypeExpression(type) { - var node = createBaseNode(301 /* JSDocTypeExpression */); + var node = createBaseNode(298 /* JSDocTypeExpression */); node.type = type; return node; } @@ -23559,7 +22770,7 @@ var ts; } // @api function createJSDocSignature(typeParameters, parameters, type) { - var node = createBaseNode(313 /* JSDocSignature */); + var node = createBaseNode(309 /* JSDocSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; @@ -23588,7 +22799,7 @@ var ts; } // @api function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { - var node = createBaseJSDocTag(330 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment); + var node = createBaseJSDocTag(326 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment); node.constraint = constraint; node.typeParameters = createNodeArray(typeParameters); return node; @@ -23605,7 +22816,7 @@ var ts; } // @api function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { - var node = createBaseJSDocTag(331 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment); + var node = createBaseJSDocTag(327 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = ts.getJSDocTypeAliasName(fullName); @@ -23623,7 +22834,7 @@ var ts; } // @api function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - var node = createBaseJSDocTag(326 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment); + var node = createBaseJSDocTag(322 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -23644,7 +22855,7 @@ var ts; } // @api function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - var node = createBaseJSDocTag(333 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment); + var node = createBaseJSDocTag(328 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -23665,7 +22876,7 @@ var ts; } // @api function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { - var node = createBaseJSDocTag(324 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment); + var node = createBaseJSDocTag(320 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = ts.getJSDocTypeAliasName(fullName); @@ -23683,7 +22894,7 @@ var ts; } // @api function createJSDocAugmentsTag(tagName, className, comment) { - var node = createBaseJSDocTag(315 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment); + var node = createBaseJSDocTag(311 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment); node.class = className; return node; } @@ -23698,37 +22909,11 @@ var ts; } // @api function createJSDocImplementsTag(tagName, className, comment) { - var node = createBaseJSDocTag(316 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment); + var node = createBaseJSDocTag(312 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment); node.class = className; return node; } // @api - function createJSDocSeeTag(tagName, name, comment) { - var node = createBaseJSDocTag(332 /* JSDocSeeTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("see"), comment); - node.name = name; - return node; - } - // @api - function updateJSDocSeeTag(node, tagName, name, comment) { - return node.tagName !== tagName - || node.name !== name - || node.comment !== comment - ? update(createJSDocSeeTag(tagName, name, comment), node) - : node; - } - // @api - function createJSDocNameReference(name) { - var node = createBaseNode(302 /* JSDocNameReference */); - node.name = name; - return node; - } - // @api - function updateJSDocNameReference(node, name) { - return node.name !== name - ? update(createJSDocNameReference(name), node) - : node; - } - // @api function updateJSDocImplementsTag(node, tagName, className, comment) { if (tagName === void 0) { tagName = getDefaultTagName(node); } return node.tagName !== tagName @@ -23789,7 +22974,7 @@ var ts; } // @api function createJSDocUnknownTag(tagName, comment) { - var node = createBaseJSDocTag(314 /* JSDocTag */, tagName, comment); + var node = createBaseJSDocTag(310 /* JSDocTag */, tagName, comment); return node; } // @api @@ -23801,7 +22986,7 @@ var ts; } // @api function createJSDocComment(comment, tags) { - var node = createBaseNode(311 /* JSDocComment */); + var node = createBaseNode(307 /* JSDocComment */); node.comment = comment; node.tags = asNodeArray(tags); return node; @@ -23818,7 +23003,7 @@ var ts; // // @api function createJsxElement(openingElement, children, closingElement) { - var node = createBaseNode(273 /* JsxElement */); + var node = createBaseNode(270 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -23839,7 +23024,7 @@ var ts; } // @api function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createBaseNode(274 /* JsxSelfClosingElement */); + var node = createBaseNode(271 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -23863,7 +23048,7 @@ var ts; } // @api function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createBaseNode(275 /* JsxOpeningElement */); + var node = createBaseNode(272 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -23887,7 +23072,7 @@ var ts; } // @api function createJsxClosingElement(tagName) { - var node = createBaseNode(276 /* JsxClosingElement */); + var node = createBaseNode(273 /* JsxClosingElement */); node.tagName = tagName; node.transformFlags |= propagateChildFlags(node.tagName) | @@ -23902,7 +23087,7 @@ var ts; } // @api function createJsxFragment(openingFragment, children, closingFragment) { - var node = createBaseNode(277 /* JsxFragment */); + var node = createBaseNode(274 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -23938,19 +23123,19 @@ var ts; } // @api function createJsxOpeningFragment() { - var node = createBaseNode(278 /* JsxOpeningFragment */); + var node = createBaseNode(275 /* JsxOpeningFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } // @api function createJsxJsxClosingFragment() { - var node = createBaseNode(279 /* JsxClosingFragment */); + var node = createBaseNode(276 /* JsxClosingFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } // @api function createJsxAttribute(name, initializer) { - var node = createBaseNode(280 /* JsxAttribute */); + var node = createBaseNode(277 /* JsxAttribute */); node.name = name; node.initializer = initializer; node.transformFlags |= @@ -23968,7 +23153,7 @@ var ts; } // @api function createJsxAttributes(properties) { - var node = createBaseNode(281 /* JsxAttributes */); + var node = createBaseNode(278 /* JsxAttributes */); node.properties = createNodeArray(properties); node.transformFlags |= propagateChildrenFlags(node.properties) | @@ -23983,7 +23168,7 @@ var ts; } // @api function createJsxSpreadAttribute(expression) { - var node = createBaseNode(282 /* JsxSpreadAttribute */); + var node = createBaseNode(279 /* JsxSpreadAttribute */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | @@ -23998,7 +23183,7 @@ var ts; } // @api function createJsxExpression(dotDotDotToken, expression) { - var node = createBaseNode(283 /* JsxExpression */); + var node = createBaseNode(280 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; node.transformFlags |= @@ -24018,7 +23203,7 @@ var ts; // // @api function createCaseClause(expression, statements) { - var node = createBaseNode(284 /* CaseClause */); + var node = createBaseNode(281 /* CaseClause */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.statements = createNodeArray(statements); node.transformFlags |= @@ -24035,7 +23220,7 @@ var ts; } // @api function createDefaultClause(statements) { - var node = createBaseNode(285 /* DefaultClause */); + var node = createBaseNode(282 /* DefaultClause */); node.statements = createNodeArray(statements); node.transformFlags = propagateChildrenFlags(node.statements); return node; @@ -24048,7 +23233,7 @@ var ts; } // @api function createHeritageClause(token, types) { - var node = createBaseNode(286 /* HeritageClause */); + var node = createBaseNode(283 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); node.transformFlags |= propagateChildrenFlags(node.types); @@ -24072,7 +23257,7 @@ var ts; } // @api function createCatchClause(variableDeclaration, block) { - var node = createBaseNode(287 /* CatchClause */); + var node = createBaseNode(284 /* CatchClause */); variableDeclaration = !ts.isString(variableDeclaration) ? variableDeclaration : createVariableDeclaration(variableDeclaration, /*exclamationToken*/ undefined, /*type*/ undefined, @@ -24098,7 +23283,7 @@ var ts; // // @api function createPropertyAssignment(name, initializer) { - var node = createBaseNamedDeclaration(288 /* PropertyAssignment */, + var node = createBaseNamedDeclaration(285 /* PropertyAssignment */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); @@ -24128,7 +23313,7 @@ var ts; } // @api function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createBaseNamedDeclaration(289 /* ShorthandPropertyAssignment */, + var node = createBaseNamedDeclaration(286 /* ShorthandPropertyAssignment */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); @@ -24160,7 +23345,7 @@ var ts; } // @api function createSpreadAssignment(expression) { - var node = createBaseNode(290 /* SpreadAssignment */); + var node = createBaseNode(287 /* SpreadAssignment */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -24179,7 +23364,7 @@ var ts; // // @api function createEnumMember(name, initializer) { - var node = createBaseNode(291 /* EnumMember */); + var node = createBaseNode(288 /* EnumMember */); node.name = asName(name); node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= @@ -24200,7 +23385,7 @@ var ts; // // @api function createSourceFile(statements, endOfFileToken, flags) { - var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */); + var node = baseFactory.createBaseSourceFileNode(294 /* SourceFile */); node.statements = createNodeArray(statements); node.endOfFileToken = endOfFileToken; node.flags |= flags; @@ -24217,7 +23402,7 @@ var ts; return node; } function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) { - var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */); + var node = baseFactory.createBaseSourceFileNode(294 /* SourceFile */); for (var p in source) { if (p === "emitNode" || ts.hasProperty(node, p) || !ts.hasProperty(source, p)) continue; @@ -24255,7 +23440,7 @@ var ts; // @api function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = createBaseNode(298 /* Bundle */); + var node = createBaseNode(295 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -24270,7 +23455,7 @@ var ts; } // @api function createUnparsedSource(prologues, syntheticReferences, texts) { - var node = createBaseNode(299 /* UnparsedSource */); + var node = createBaseNode(296 /* UnparsedSource */); node.prologues = prologues; node.syntheticReferences = syntheticReferences; node.texts = texts; @@ -24288,28 +23473,28 @@ var ts; } // @api function createUnparsedPrologue(data) { - return createBaseUnparsedNode(292 /* UnparsedPrologue */, data); + return createBaseUnparsedNode(289 /* UnparsedPrologue */, data); } // @api function createUnparsedPrepend(data, texts) { - var node = createBaseUnparsedNode(293 /* UnparsedPrepend */, data); + var node = createBaseUnparsedNode(290 /* UnparsedPrepend */, data); node.texts = texts; return node; } // @api function createUnparsedTextLike(data, internal) { - return createBaseUnparsedNode(internal ? 295 /* UnparsedInternalText */ : 294 /* UnparsedText */, data); + return createBaseUnparsedNode(internal ? 292 /* UnparsedInternalText */ : 291 /* UnparsedText */, data); } // @api function createUnparsedSyntheticReference(section) { - var node = createBaseNode(296 /* UnparsedSyntheticReference */); + var node = createBaseNode(293 /* UnparsedSyntheticReference */); node.data = section.data; node.section = section; return node; } // @api function createInputFiles() { - var node = createBaseNode(300 /* InputFiles */); + var node = createBaseNode(297 /* InputFiles */); node.javascriptText = ""; node.declarationText = ""; return node; @@ -24320,7 +23505,7 @@ var ts; // @api function createSyntheticExpression(type, isSpread, tupleNameSource) { if (isSpread === void 0) { isSpread = false; } - var node = createBaseNode(227 /* SyntheticExpression */); + var node = createBaseNode(224 /* SyntheticExpression */); node.type = type; node.isSpread = isSpread; node.tupleNameSource = tupleNameSource; @@ -24328,7 +23513,7 @@ var ts; } // @api function createSyntaxList(children) { - var node = createBaseNode(334 /* SyntaxList */); + var node = createBaseNode(329 /* SyntaxList */); node._children = children; return node; } @@ -24343,7 +23528,7 @@ var ts; */ // @api function createNotEmittedStatement(original) { - var node = createBaseNode(335 /* NotEmittedStatement */); + var node = createBaseNode(330 /* NotEmittedStatement */); node.original = original; ts.setTextRange(node, original); return node; @@ -24357,7 +23542,7 @@ var ts; */ // @api function createPartiallyEmittedExpression(expression, original) { - var node = createBaseNode(336 /* PartiallyEmittedExpression */); + var node = createBaseNode(331 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; node.transformFlags |= @@ -24385,7 +23570,7 @@ var ts; } // @api function createCommaListExpression(elements) { - var node = createBaseNode(337 /* CommaListExpression */); + var node = createBaseNode(332 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; @@ -24402,7 +23587,7 @@ var ts; */ // @api function createEndOfDeclarationMarker(original) { - var node = createBaseNode(339 /* EndOfDeclarationMarker */); + var node = createBaseNode(334 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -24413,14 +23598,14 @@ var ts; */ // @api function createMergeDeclarationMarker(original) { - var node = createBaseNode(338 /* MergeDeclarationMarker */); + var node = createBaseNode(333 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } // @api function createSyntheticReferenceExpression(expression, thisArg) { - var node = createBaseNode(340 /* SyntheticReferenceExpression */); + var node = createBaseNode(335 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= @@ -24442,7 +23627,7 @@ var ts; if (node === undefined) { return node; } - var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(297 /* SourceFile */) : + var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(294 /* SourceFile */) : ts.isIdentifier(node) ? baseFactory.createBaseIdentifierNode(78 /* Identifier */) : ts.isPrivateIdentifier(node) ? baseFactory.createBasePrivateIdentifierNode(79 /* PrivateIdentifier */) : !ts.isNodeKind(node.kind) ? baseFactory.createBaseTokenNode(node.kind) : @@ -24549,11 +23734,11 @@ var ts; } function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 207 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); - case 206 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 224 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type); - case 225 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); - case 336 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); + case 204 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); + case 203 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 221 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type); + case 222 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); + case 331 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -24607,13 +23792,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -25016,23 +24201,23 @@ var ts; } function getDefaultTagNameForKind(kind) { switch (kind) { - case 329 /* JSDocTypeTag */: return "type"; - case 327 /* JSDocReturnTag */: return "returns"; - case 328 /* JSDocThisTag */: return "this"; - case 325 /* JSDocEnumTag */: return "enum"; - case 317 /* JSDocAuthorTag */: return "author"; - case 319 /* JSDocClassTag */: return "class"; - case 320 /* JSDocPublicTag */: return "public"; - case 321 /* JSDocPrivateTag */: return "private"; - case 322 /* JSDocProtectedTag */: return "protected"; - case 323 /* JSDocReadonlyTag */: return "readonly"; - case 330 /* JSDocTemplateTag */: return "template"; - case 331 /* JSDocTypedefTag */: return "typedef"; - case 326 /* JSDocParameterTag */: return "param"; - case 333 /* JSDocPropertyTag */: return "prop"; - case 324 /* JSDocCallbackTag */: return "callback"; - case 315 /* JSDocAugmentsTag */: return "augments"; - case 316 /* JSDocImplementsTag */: return "implements"; + case 325 /* JSDocTypeTag */: return "type"; + case 323 /* JSDocReturnTag */: return "returns"; + case 324 /* JSDocThisTag */: return "this"; + case 321 /* JSDocEnumTag */: return "enum"; + case 313 /* JSDocAuthorTag */: return "author"; + case 315 /* JSDocClassTag */: return "class"; + case 316 /* JSDocPublicTag */: return "public"; + case 317 /* JSDocPrivateTag */: return "private"; + case 318 /* JSDocProtectedTag */: return "protected"; + case 319 /* JSDocReadonlyTag */: return "readonly"; + case 326 /* JSDocTemplateTag */: return "template"; + case 327 /* JSDocTypedefTag */: return "typedef"; + case 322 /* JSDocParameterTag */: return "param"; + case 328 /* JSDocPropertyTag */: return "prop"; + case 320 /* JSDocCallbackTag */: return "callback"; + case 311 /* JSDocAugmentsTag */: return "augments"; + case 312 /* JSDocImplementsTag */: return "implements"; default: return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind)); } @@ -25112,69 +24297,69 @@ var ts; */ /* @internal */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */) { + if (kind >= 171 /* FirstTypeNode */ && kind <= 192 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 199 /* ArrayLiteralExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 196 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return 546379776 /* ModuleExcludes */; - case 160 /* Parameter */: + case 159 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return 547309568 /* ArrowFunctionExcludes */; - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: return 547313664 /* FunctionExcludes */; - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 166 /* Constructor */: + case 165 /* Constructor */: return 547311616 /* ConstructorExcludes */; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return 536875008 /* PropertyExcludes */; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 128 /* AnyKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 141 /* NeverKeyword */: - case 147 /* StringKeyword */: - case 145 /* ObjectKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 140 /* NeverKeyword */: + case 146 /* StringKeyword */: + case 144 /* ObjectKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: case 113 /* VoidKeyword */: - case 159 /* TypeParameter */: - case 162 /* PropertySignature */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 158 /* TypeParameter */: + case 161 /* PropertySignature */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 287 /* CatchClause */: + case 284 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: - case 336 /* PartiallyEmittedExpression */: - case 207 /* ParenthesizedExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: + case 331 /* PartiallyEmittedExpression */: + case 204 /* ParenthesizedExpression */: case 105 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -25473,7 +24658,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = (_a = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node)))) !== null && _a !== void 0 ? _a : ts.Debug.fail("Could not determine parsed source file."); @@ -26330,11 +25515,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 157 /* QualifiedName */; + return node.kind === 156 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 158 /* ComputedPropertyName */; + return node.kind === 157 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -26369,580 +25554,572 @@ var ts; ts.isExclamationToken = isExclamationToken; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 159 /* TypeParameter */; + return node.kind === 158 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; // TODO(rbuckton): Rename to 'isParameterDeclaration' function isParameter(node) { - return node.kind === 160 /* Parameter */; + return node.kind === 159 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 161 /* Decorator */; + return node.kind === 160 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 162 /* PropertySignature */; + return node.kind === 161 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 163 /* PropertyDeclaration */; + return node.kind === 162 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 164 /* MethodSignature */; + return node.kind === 163 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 165 /* MethodDeclaration */; + return node.kind === 164 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 166 /* Constructor */; + return node.kind === 165 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 167 /* GetAccessor */; + return node.kind === 166 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 168 /* SetAccessor */; + return node.kind === 167 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 169 /* CallSignature */; + return node.kind === 168 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 170 /* ConstructSignature */; + return node.kind === 169 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 171 /* IndexSignature */; + return node.kind === 170 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 172 /* TypePredicate */; + return node.kind === 171 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 173 /* TypeReference */; + return node.kind === 172 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 174 /* FunctionType */; + return node.kind === 173 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 175 /* ConstructorType */; + return node.kind === 174 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 176 /* TypeQuery */; + return node.kind === 175 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 177 /* TypeLiteral */; + return node.kind === 176 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 178 /* ArrayType */; + return node.kind === 177 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 179 /* TupleType */; + return node.kind === 178 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isNamedTupleMember(node) { - return node.kind === 192 /* NamedTupleMember */; + return node.kind === 191 /* NamedTupleMember */; } ts.isNamedTupleMember = isNamedTupleMember; function isOptionalTypeNode(node) { - return node.kind === 180 /* OptionalType */; + return node.kind === 179 /* OptionalType */; } ts.isOptionalTypeNode = isOptionalTypeNode; function isRestTypeNode(node) { - return node.kind === 181 /* RestType */; + return node.kind === 180 /* RestType */; } ts.isRestTypeNode = isRestTypeNode; function isUnionTypeNode(node) { - return node.kind === 182 /* UnionType */; + return node.kind === 181 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 183 /* IntersectionType */; + return node.kind === 182 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 184 /* ConditionalType */; + return node.kind === 183 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 185 /* InferType */; + return node.kind === 184 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 186 /* ParenthesizedType */; + return node.kind === 185 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 187 /* ThisType */; + return node.kind === 186 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 188 /* TypeOperator */; + return node.kind === 187 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 189 /* IndexedAccessType */; + return node.kind === 188 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 190 /* MappedType */; + return node.kind === 189 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 191 /* LiteralType */; + return node.kind === 190 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 195 /* ImportType */; + return node.kind === 192 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; - function isTemplateLiteralTypeSpan(node) { - return node.kind === 194 /* TemplateLiteralTypeSpan */; - } - ts.isTemplateLiteralTypeSpan = isTemplateLiteralTypeSpan; - function isTemplateLiteralTypeNode(node) { - return node.kind === 193 /* TemplateLiteralType */; - } - ts.isTemplateLiteralTypeNode = isTemplateLiteralTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 196 /* ObjectBindingPattern */; + return node.kind === 193 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 197 /* ArrayBindingPattern */; + return node.kind === 194 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 198 /* BindingElement */; + return node.kind === 195 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 199 /* ArrayLiteralExpression */; + return node.kind === 196 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 200 /* ObjectLiteralExpression */; + return node.kind === 197 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 201 /* PropertyAccessExpression */; + return node.kind === 198 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 202 /* ElementAccessExpression */; + return node.kind === 199 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 203 /* CallExpression */; + return node.kind === 200 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 204 /* NewExpression */; + return node.kind === 201 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 205 /* TaggedTemplateExpression */; + return node.kind === 202 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertionExpression(node) { - return node.kind === 206 /* TypeAssertionExpression */; + return node.kind === 203 /* TypeAssertionExpression */; } ts.isTypeAssertionExpression = isTypeAssertionExpression; function isParenthesizedExpression(node) { - return node.kind === 207 /* ParenthesizedExpression */; + return node.kind === 204 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function isFunctionExpression(node) { - return node.kind === 208 /* FunctionExpression */; + return node.kind === 205 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 209 /* ArrowFunction */; + return node.kind === 206 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 210 /* DeleteExpression */; + return node.kind === 207 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 211 /* TypeOfExpression */; + return node.kind === 208 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 212 /* VoidExpression */; + return node.kind === 209 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 213 /* AwaitExpression */; + return node.kind === 210 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 214 /* PrefixUnaryExpression */; + return node.kind === 211 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 215 /* PostfixUnaryExpression */; + return node.kind === 212 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 216 /* BinaryExpression */; + return node.kind === 213 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 217 /* ConditionalExpression */; + return node.kind === 214 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 218 /* TemplateExpression */; + return node.kind === 215 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 219 /* YieldExpression */; + return node.kind === 216 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 220 /* SpreadElement */; + return node.kind === 217 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 221 /* ClassExpression */; + return node.kind === 218 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 222 /* OmittedExpression */; + return node.kind === 219 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 223 /* ExpressionWithTypeArguments */; + return node.kind === 220 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 224 /* AsExpression */; + return node.kind === 221 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 225 /* NonNullExpression */; + return node.kind === 222 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 226 /* MetaProperty */; + return node.kind === 223 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; function isSyntheticExpression(node) { - return node.kind === 227 /* SyntheticExpression */; + return node.kind === 224 /* SyntheticExpression */; } ts.isSyntheticExpression = isSyntheticExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 336 /* PartiallyEmittedExpression */; + return node.kind === 331 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isCommaListExpression(node) { - return node.kind === 337 /* CommaListExpression */; + return node.kind === 332 /* CommaListExpression */; } ts.isCommaListExpression = isCommaListExpression; // Misc function isTemplateSpan(node) { - return node.kind === 228 /* TemplateSpan */; + return node.kind === 225 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 229 /* SemicolonClassElement */; + return node.kind === 226 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Elements function isBlock(node) { - return node.kind === 230 /* Block */; + return node.kind === 227 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 232 /* VariableStatement */; + return node.kind === 229 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 231 /* EmptyStatement */; + return node.kind === 228 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 233 /* ExpressionStatement */; + return node.kind === 230 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 234 /* IfStatement */; + return node.kind === 231 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 235 /* DoStatement */; + return node.kind === 232 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 236 /* WhileStatement */; + return node.kind === 233 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 237 /* ForStatement */; + return node.kind === 234 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 238 /* ForInStatement */; + return node.kind === 235 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 239 /* ForOfStatement */; + return node.kind === 236 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 240 /* ContinueStatement */; + return node.kind === 237 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 241 /* BreakStatement */; + return node.kind === 238 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isReturnStatement(node) { - return node.kind === 242 /* ReturnStatement */; + return node.kind === 239 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 243 /* WithStatement */; + return node.kind === 240 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 244 /* SwitchStatement */; + return node.kind === 241 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 245 /* LabeledStatement */; + return node.kind === 242 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 246 /* ThrowStatement */; + return node.kind === 243 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 247 /* TryStatement */; + return node.kind === 244 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 248 /* DebuggerStatement */; + return node.kind === 245 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 249 /* VariableDeclaration */; + return node.kind === 246 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 250 /* VariableDeclarationList */; + return node.kind === 247 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 251 /* FunctionDeclaration */; + return node.kind === 248 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 252 /* ClassDeclaration */; + return node.kind === 249 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 253 /* InterfaceDeclaration */; + return node.kind === 250 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 254 /* TypeAliasDeclaration */; + return node.kind === 251 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 255 /* EnumDeclaration */; + return node.kind === 252 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */; + return node.kind === 253 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 257 /* ModuleBlock */; + return node.kind === 254 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 258 /* CaseBlock */; + return node.kind === 255 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 259 /* NamespaceExportDeclaration */; + return node.kind === 256 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */; + return node.kind === 257 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 261 /* ImportDeclaration */; + return node.kind === 258 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 262 /* ImportClause */; + return node.kind === 259 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 263 /* NamespaceImport */; + return node.kind === 260 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 269 /* NamespaceExport */; + return node.kind === 266 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedImports(node) { - return node.kind === 264 /* NamedImports */; + return node.kind === 261 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 265 /* ImportSpecifier */; + return node.kind === 262 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 266 /* ExportAssignment */; + return node.kind === 263 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 267 /* ExportDeclaration */; + return node.kind === 264 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 268 /* NamedExports */; + return node.kind === 265 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 270 /* ExportSpecifier */; + return node.kind === 267 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 271 /* MissingDeclaration */; + return node.kind === 268 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; function isNotEmittedStatement(node) { - return node.kind === 335 /* NotEmittedStatement */; + return node.kind === 330 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 340 /* SyntheticReferenceExpression */; + return node.kind === 335 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ function isMergeDeclarationMarker(node) { - return node.kind === 338 /* MergeDeclarationMarker */; + return node.kind === 333 /* MergeDeclarationMarker */; } ts.isMergeDeclarationMarker = isMergeDeclarationMarker; /* @internal */ function isEndOfDeclarationMarker(node) { - return node.kind === 339 /* EndOfDeclarationMarker */; + return node.kind === 334 /* EndOfDeclarationMarker */; } ts.isEndOfDeclarationMarker = isEndOfDeclarationMarker; // Module References function isExternalModuleReference(node) { - return node.kind === 272 /* ExternalModuleReference */; + return node.kind === 269 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 273 /* JsxElement */; + return node.kind === 270 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 274 /* JsxSelfClosingElement */; + return node.kind === 271 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 275 /* JsxOpeningElement */; + return node.kind === 272 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 276 /* JsxClosingElement */; + return node.kind === 273 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 277 /* JsxFragment */; + return node.kind === 274 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 278 /* JsxOpeningFragment */; + return node.kind === 275 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 279 /* JsxClosingFragment */; + return node.kind === 276 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 280 /* JsxAttribute */; + return node.kind === 277 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 281 /* JsxAttributes */; + return node.kind === 278 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 282 /* JsxSpreadAttribute */; + return node.kind === 279 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 283 /* JsxExpression */; + return node.kind === 280 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 284 /* CaseClause */; + return node.kind === 281 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 285 /* DefaultClause */; + return node.kind === 282 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 286 /* HeritageClause */; + return node.kind === 283 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 287 /* CatchClause */; + return node.kind === 284 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 288 /* PropertyAssignment */; + return node.kind === 285 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 289 /* ShorthandPropertyAssignment */; + return node.kind === 286 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 290 /* SpreadAssignment */; + return node.kind === 287 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 291 /* EnumMember */; + return node.kind === 288 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Unparsed // TODO(rbuckton): isUnparsedPrologue function isUnparsedPrepend(node) { - return node.kind === 293 /* UnparsedPrepend */; + return node.kind === 290 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; // TODO(rbuckton): isUnparsedText @@ -26950,152 +26127,148 @@ var ts; // TODO(rbuckton): isUnparsedSyntheticReference // Top-level nodes function isSourceFile(node) { - return node.kind === 297 /* SourceFile */; + return node.kind === 294 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 298 /* Bundle */; + return node.kind === 295 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 299 /* UnparsedSource */; + return node.kind === 296 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; // TODO(rbuckton): isInputFiles // JSDoc Elements function isJSDocTypeExpression(node) { - return node.kind === 301 /* JSDocTypeExpression */; + return node.kind === 298 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; - function isJSDocNameReference(node) { - return node.kind === 302 /* JSDocNameReference */; - } - ts.isJSDocNameReference = isJSDocNameReference; function isJSDocAllType(node) { - return node.kind === 303 /* JSDocAllType */; + return node.kind === 299 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 304 /* JSDocUnknownType */; + return node.kind === 300 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 305 /* JSDocNullableType */; + return node.kind === 301 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 306 /* JSDocNonNullableType */; + return node.kind === 302 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 307 /* JSDocOptionalType */; + return node.kind === 303 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 308 /* JSDocFunctionType */; + return node.kind === 304 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 309 /* JSDocVariadicType */; + return node.kind === 305 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDocNamepathType(node) { - return node.kind === 310 /* JSDocNamepathType */; + return node.kind === 306 /* JSDocNamepathType */; } ts.isJSDocNamepathType = isJSDocNamepathType; function isJSDoc(node) { - return node.kind === 311 /* JSDocComment */; + return node.kind === 307 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocTypeLiteral(node) { - return node.kind === 312 /* JSDocTypeLiteral */; + return node.kind === 308 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocSignature(node) { - return node.kind === 313 /* JSDocSignature */; + return node.kind === 309 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // JSDoc Tags function isJSDocAugmentsTag(node) { - return node.kind === 315 /* JSDocAugmentsTag */; + return node.kind === 311 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocAuthorTag(node) { - return node.kind === 317 /* JSDocAuthorTag */; + return node.kind === 313 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocClassTag(node) { - return node.kind === 319 /* JSDocClassTag */; + return node.kind === 315 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocCallbackTag(node) { - return node.kind === 324 /* JSDocCallbackTag */; + return node.kind === 320 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocPublicTag(node) { - return node.kind === 320 /* JSDocPublicTag */; + return node.kind === 316 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 321 /* JSDocPrivateTag */; + return node.kind === 317 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 322 /* JSDocProtectedTag */; + return node.kind === 318 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 323 /* JSDocReadonlyTag */; + return node.kind === 319 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocDeprecatedTag(node) { - return node.kind === 318 /* JSDocDeprecatedTag */; + return node.kind === 314 /* JSDocDeprecatedTag */; } ts.isJSDocDeprecatedTag = isJSDocDeprecatedTag; function isJSDocEnumTag(node) { - return node.kind === 325 /* JSDocEnumTag */; + return node.kind === 321 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocParameterTag(node) { - return node.kind === 326 /* JSDocParameterTag */; + return node.kind === 322 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 327 /* JSDocReturnTag */; + return node.kind === 323 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocThisTag(node) { - return node.kind === 328 /* JSDocThisTag */; + return node.kind === 324 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocTypeTag(node) { - return node.kind === 329 /* JSDocTypeTag */; + return node.kind === 325 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 330 /* JSDocTemplateTag */; + return node.kind === 326 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 331 /* JSDocTypedefTag */; + return node.kind === 327 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocUnknownTag(node) { - return node.kind === 314 /* JSDocTag */; + return node.kind === 310 /* JSDocTag */; } ts.isJSDocUnknownTag = isJSDocUnknownTag; function isJSDocPropertyTag(node) { - return node.kind === 333 /* JSDocPropertyTag */; + return node.kind === 328 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocImplementsTag(node) { - return node.kind === 316 /* JSDocImplementsTag */; + return node.kind === 312 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; // Synthesized list /* @internal */ function isSyntaxList(n) { - return n.kind === 334 /* SyntaxList */; + return n.kind === 329 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; })(ts || (ts = {})); @@ -27146,13 +26319,12 @@ var ts; createJsxFactoryExpressionFromEntityName(factory, jsxFactoryEntity, parent) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), "createElement"); } - ts.createJsxFactoryExpression = createJsxFactoryExpression; function createJsxFragmentFactoryExpression(factory, jsxFragmentFactoryEntity, reactNamespace, parent) { return jsxFragmentFactoryEntity ? createJsxFactoryExpressionFromEntityName(factory, jsxFragmentFactoryEntity, parent) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), "Fragment"); } - function createExpressionForJsxElement(factory, callee, tagName, props, children, location) { + function createExpressionForJsxElement(factory, jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { var argumentsList = [tagName]; if (props) { argumentsList.push(props); @@ -27172,7 +26344,7 @@ var ts; argumentsList.push(children[0]); } } - return ts.setTextRange(factory.createCallExpression(callee, + return ts.setTextRange(factory.createCallExpression(createJsxFactoryExpression(factory, jsxFactoryEntity, reactNamespace, parentElement), /*typeArguments*/ undefined, argumentsList), location); } ts.createExpressionForJsxElement = createExpressionForJsxElement; @@ -27294,14 +26466,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return createExpressionForAccessorDeclaration(factory, node.properties, property, receiver, !!node.multiLine); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return createExpressionForPropertyAssignment(factory, property, receiver); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(factory, property, receiver); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return createExpressionForMethodDeclaration(factory, property, receiver); } } @@ -27354,21 +26526,21 @@ var ts; } ts.startsWithUseStrict = startsWithUseStrict; function isCommaSequence(node) { - return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 337 /* CommaListExpression */; + return node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 332 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 15 /* All */; } switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return (kinds & 2 /* TypeAssertions */) !== 0; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return (kinds & 4 /* NonNullAssertions */) !== 0; - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -27485,14 +26657,14 @@ var ts; */ function getLocalNameForExternalImport(factory, node, sourceFile) { var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); - if (namespaceDeclaration && !ts.isDefaultImport(node) && !ts.isExportNamespaceAsDefaultDeclaration(node)) { + if (namespaceDeclaration && !ts.isDefaultImport(node)) { var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : factory.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 261 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 258 /* ImportDeclaration */ && node.importClause) { return factory.getGeneratedNameForNode(node); } - if (node.kind === 267 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 264 /* ExportDeclaration */ && node.moduleSpecifier) { return factory.getGeneratedNameForNode(node); } return undefined; @@ -27611,7 +26783,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -27623,11 +26795,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -27659,12 +26831,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 160 /* Parameter */: - case 198 /* BindingElement */: + case 159 /* Parameter */: + case 195 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 220 /* SpreadElement */: - case 290 /* SpreadAssignment */: + case 217 /* SpreadElement */: + case 287 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -27682,7 +26854,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 198 /* BindingElement */: + case 195 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -27697,7 +26869,7 @@ var ts; : propertyName; } break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -27712,7 +26884,7 @@ var ts; : propertyName; } break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -27735,13 +26907,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -27762,29 +26934,29 @@ var ts; ts.getJSDocTypeAliasName = getJSDocTypeAliasName; function canHaveModifiers(node) { var kind = node.kind; - return kind === 160 /* Parameter */ - || kind === 162 /* PropertySignature */ - || kind === 163 /* PropertyDeclaration */ - || kind === 164 /* MethodSignature */ - || kind === 165 /* MethodDeclaration */ - || kind === 166 /* Constructor */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 171 /* IndexSignature */ - || kind === 208 /* FunctionExpression */ - || kind === 209 /* ArrowFunction */ - || kind === 221 /* ClassExpression */ - || kind === 232 /* VariableStatement */ - || kind === 251 /* FunctionDeclaration */ - || kind === 252 /* ClassDeclaration */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 255 /* EnumDeclaration */ - || kind === 256 /* ModuleDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 266 /* ExportAssignment */ - || kind === 267 /* ExportDeclaration */; + return kind === 159 /* Parameter */ + || kind === 161 /* PropertySignature */ + || kind === 162 /* PropertyDeclaration */ + || kind === 163 /* MethodSignature */ + || kind === 164 /* MethodDeclaration */ + || kind === 165 /* Constructor */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 170 /* IndexSignature */ + || kind === 205 /* FunctionExpression */ + || kind === 206 /* ArrowFunction */ + || kind === 218 /* ClassExpression */ + || kind === 229 /* VariableStatement */ + || kind === 248 /* FunctionDeclaration */ + || kind === 249 /* ClassDeclaration */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 252 /* EnumDeclaration */ + || kind === 253 /* ModuleDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 263 /* ExportAssignment */ + || kind === 264 /* ExportDeclaration */; } ts.canHaveModifiers = canHaveModifiers; /* @internal */ @@ -27883,19 +27055,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 156 /* LastToken */) { + if (!node || node.kind <= 155 /* LastToken */) { return; } switch (node.kind) { - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -27903,9 +27075,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -27913,7 +27085,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -27921,51 +27093,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -27977,374 +27149,364 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 179 /* TupleType */: + case 178 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elements); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 185 /* InferType */: + case 184 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 195 /* ImportType */: + case 192 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 186 /* ParenthesizedType */: - case 188 /* TypeOperator */: + case 185 /* ParenthesizedType */: + case 187 /* TypeOperator */: return visitNode(cbNode, node.type); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 190 /* MappedType */: + case 189 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || - visitNode(cbNode, node.nameType) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return visitNode(cbNode, node.literal); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 224 /* AsExpression */: + case 221 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return visitNode(cbNode, node.name); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 297 /* SourceFile */: + case 294 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: return visitNode(cbNode, node.label); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 284 /* CaseClause */: + case 281 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 161 /* Decorator */: + case 160 /* Decorator */: return visitNode(cbNode, node.expression); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 291 /* EnumMember */: + case 288 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 264 /* NamedImports */: - case 268 /* NamedExports */: + case 261 /* NamedImports */: + case 265 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 193 /* TemplateLiteralType */: - return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 194 /* TemplateLiteralTypeSpan */: - return visitNode(cbNode, node.type) || visitNode(cbNode, node.literal); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 180 /* OptionalType */: - case 181 /* RestType */: - case 301 /* JSDocTypeExpression */: - case 306 /* JSDocNonNullableType */: - case 305 /* JSDocNullableType */: - case 307 /* JSDocOptionalType */: - case 309 /* JSDocVariadicType */: + case 179 /* OptionalType */: + case 180 /* RestType */: + case 298 /* JSDocTypeExpression */: + case 302 /* JSDocNonNullableType */: + case 301 /* JSDocNullableType */: + case 303 /* JSDocOptionalType */: + case 305 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 311 /* JSDocComment */: + case 307 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 332 /* JSDocSeeTag */: - return visitNode(cbNode, node.tagName) || - visitNode(cbNode, node.name); - case 302 /* JSDocNameReference */: - return visitNode(cbNode, node.name); - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 317 /* JSDocAuthorTag */: + case 313 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 301 /* JSDocTypeExpression */ + node.typeExpression.kind === 298 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 324 /* JSDocCallbackTag */: + case 320 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 328 /* JSDocThisTag */: - case 325 /* JSDocEnumTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 324 /* JSDocThisTag */: + case 321 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 313 /* JSDocSignature */: + case 309 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 312 /* JSDocTypeLiteral */: + case 308 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 314 /* JSDocTag */: - case 319 /* JSDocClassTag */: - case 320 /* JSDocPublicTag */: - case 321 /* JSDocPrivateTag */: - case 322 /* JSDocProtectedTag */: - case 323 /* JSDocReadonlyTag */: + case 310 /* JSDocTag */: + case 315 /* JSDocClassTag */: + case 316 /* JSDocPublicTag */: + case 317 /* JSDocPrivateTag */: + case 318 /* JSDocProtectedTag */: + case 319 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -28419,8 +27581,6 @@ var ts; ts.forEachChildRecursively = forEachChildRecursively; function createSourceFile(fileName, sourceText, languageVersion, setParentNodes, scriptKind) { if (setParentNodes === void 0) { setParentNodes = false; } - var tracingData = ["parse" /* Parse */, "createSourceFile", { path: fileName }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeParse"); var result; ts.perfLogger.logStartParseSourceFile(fileName); @@ -28433,7 +27593,6 @@ var ts; ts.perfLogger.logStopParseSourceFile(); ts.performance.mark("afterParse"); ts.performance.measure("Parse", "beforeParse", "afterParse"); - ts.tracing.end.apply(ts.tracing, tracingData); return result; } ts.createSourceFile = createSourceFile; @@ -29294,7 +28453,7 @@ var ts; ts.isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode(kind, "", "", /*templateFlags*/ undefined) : kind === 8 /* NumericLiteral */ ? factory.createNumericLiteral("", /*numericLiteralFlags*/ undefined) : kind === 10 /* StringLiteral */ ? factory.createStringLiteral("", /*isSingleQuote*/ undefined) : - kind === 271 /* MissingDeclaration */ ? factory.createMissingDeclaration() : + kind === 268 /* MissingDeclaration */ ? factory.createMissingDeclaration() : factory.createToken(kind); return finishNode(result, pos); } @@ -29408,7 +28567,7 @@ var ts; if (token() === 87 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 149 /* TypeKeyword */) { + if (token() === 148 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); @@ -29416,7 +28575,7 @@ var ts; return nextTokenCanFollowDefaultKeyword(); case 123 /* StaticKeyword */: case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -29826,14 +28985,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 166 /* Constructor */: - case 171 /* IndexSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 229 /* SemicolonClassElement */: + case 165 /* Constructor */: + case 170 /* IndexSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 226 /* SemicolonClassElement */: return true; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -29848,8 +29007,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: return true; } } @@ -29858,58 +29017,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 232 /* VariableStatement */: - case 230 /* Block */: - case 234 /* IfStatement */: - case 233 /* ExpressionStatement */: - case 246 /* ThrowStatement */: - case 242 /* ReturnStatement */: - case 244 /* SwitchStatement */: - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 237 /* ForStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 231 /* EmptyStatement */: - case 247 /* TryStatement */: - case 245 /* LabeledStatement */: - case 235 /* DoStatement */: - case 248 /* DebuggerStatement */: - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 248 /* FunctionDeclaration */: + case 229 /* VariableStatement */: + case 227 /* Block */: + case 231 /* IfStatement */: + case 230 /* ExpressionStatement */: + case 243 /* ThrowStatement */: + case 239 /* ReturnStatement */: + case 241 /* SwitchStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 234 /* ForStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 228 /* EmptyStatement */: + case 244 /* TryStatement */: + case 242 /* LabeledStatement */: + case 232 /* DoStatement */: + case 245 /* DebuggerStatement */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 291 /* EnumMember */; + return node.kind === 288 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 162 /* PropertySignature */: - case 169 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 161 /* PropertySignature */: + case 168 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 249 /* VariableDeclaration */) { + if (node.kind !== 246 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -29930,7 +29089,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 160 /* Parameter */) { + if (node.kind !== 159 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -29939,7 +29098,7 @@ var ts; } // Returns true if we should abort parsing. function abortParsingListOrMoveToNextToken(kind) { - parsingContextErrors(kind); + parseErrorAtCurrentToken(parsingContextErrors(kind)); if (isInSomeParsingContext()) { return true; } @@ -29948,34 +29107,31 @@ var ts; } function parsingContextErrors(context) { switch (context) { - case 0 /* SourceElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); - case 1 /* BlockStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); - case 2 /* SwitchClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.case_or_default_expected); - case 3 /* SwitchClauseStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Statement_expected); + case 0 /* SourceElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 1 /* BlockStatements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 2 /* SwitchClauses */: return ts.Diagnostics.case_or_default_expected; + case 3 /* SwitchClauseStatements */: return ts.Diagnostics.Statement_expected; case 18 /* RestProperties */: // fallthrough - case 4 /* TypeMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_or_signature_expected); - case 5 /* ClassMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); - case 6 /* EnumMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Enum_member_expected); - case 7 /* HeritageClauseElement */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_expected); - case 8 /* VariableDeclarations */: - return ts.isKeyword(token()) - ? parseErrorAtCurrentToken(ts.Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, ts.tokenToString(token())) - : parseErrorAtCurrentToken(ts.Diagnostics.Variable_declaration_expected); - case 9 /* ObjectBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_destructuring_pattern_expected); - case 10 /* ArrayBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Array_element_destructuring_pattern_expected); - case 11 /* ArgumentExpressions */: return parseErrorAtCurrentToken(ts.Diagnostics.Argument_expression_expected); - case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_assignment_expected); - case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_or_comma_expected); - case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); - case 16 /* Parameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); - case 19 /* TypeParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_parameter_declaration_expected); - case 20 /* TypeArguments */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_argument_expected); - case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_expected); - case 22 /* HeritageClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_expected); - case 23 /* ImportOrExportSpecifiers */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - case 13 /* JsxAttributes */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - case 14 /* JsxChildren */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - default: return [undefined]; // TODO: GH#18217 `default: Debug.assertNever(context);` + case 4 /* TypeMembers */: return ts.Diagnostics.Property_or_signature_expected; + case 5 /* ClassMembers */: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 6 /* EnumMembers */: return ts.Diagnostics.Enum_member_expected; + case 7 /* HeritageClauseElement */: return ts.Diagnostics.Expression_expected; + case 8 /* VariableDeclarations */: return ts.Diagnostics.Variable_declaration_expected; + case 9 /* ObjectBindingElements */: return ts.Diagnostics.Property_destructuring_pattern_expected; + case 10 /* ArrayBindingElements */: return ts.Diagnostics.Array_element_destructuring_pattern_expected; + case 11 /* ArgumentExpressions */: return ts.Diagnostics.Argument_expression_expected; + case 12 /* ObjectLiteralMembers */: return ts.Diagnostics.Property_assignment_expected; + case 15 /* ArrayLiteralMembers */: return ts.Diagnostics.Expression_or_comma_expected; + case 17 /* JSDocParameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 16 /* Parameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 19 /* TypeParameters */: return ts.Diagnostics.Type_parameter_declaration_expected; + case 20 /* TypeArguments */: return ts.Diagnostics.Type_argument_expected; + case 21 /* TupleElementTypes */: return ts.Diagnostics.Type_expected; + case 22 /* HeritageClauses */: return ts.Diagnostics.Unexpected_token_expected; + case 23 /* ImportOrExportSpecifiers */: return ts.Diagnostics.Identifier_expected; + case 13 /* JsxAttributes */: return ts.Diagnostics.Identifier_expected; + case 14 /* JsxChildren */: return ts.Diagnostics.Identifier_expected; + default: return undefined; // TODO: GH#18217 `default: Debug.assertNever(context);` } } // Parses a comma-delimited list of elements @@ -30120,24 +29276,6 @@ var ts; var pos = getNodePos(); return finishNode(factory.createTemplateExpression(parseTemplateHead(isTaggedTemplate), parseTemplateSpans(isTaggedTemplate)), pos); } - function parseTemplateType() { - var pos = getNodePos(); - return finishNode(factory.createTemplateLiteralType(parseTemplateHead(/*isTaggedTemplate*/ false), parseTemplateTypeSpans()), pos); - } - function parseTemplateTypeSpans() { - var pos = getNodePos(); - var list = []; - var node; - do { - node = parseTemplateTypeSpan(); - list.push(node); - } while (node.literal.kind === 16 /* TemplateMiddle */); - return createNodeArray(list, pos); - } - function parseTemplateTypeSpan() { - var pos = getNodePos(); - return finishNode(factory.createTemplateLiteralTypeSpan(parseType(), parseLiteralOfTemplateSpan(/*isTaggedTemplate*/ false)), pos); - } function parseLiteralOfTemplateSpan(isTaggedTemplate) { if (token() === 19 /* CloseBraceToken */) { reScanTemplateToken(isTaggedTemplate); @@ -30211,14 +29349,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: { + case 173 /* FunctionType */: + case 174 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -30298,7 +29436,7 @@ var ts; function parseJSDocType() { scanner.setInJSDocType(true); var pos = getNodePos(); - if (parseOptional(139 /* ModuleKeyword */)) { + if (parseOptional(138 /* ModuleKeyword */)) { // TODO(rbuckton): We never set the type for a JSDocNamepathType. What should we put here? var moduleTag = factory.createJSDocNamepathType(/*type*/ undefined); terminate: while (true) { @@ -30498,14 +29636,14 @@ var ts; function parseSignatureMember(kind) { var pos = getNodePos(); var hasJSDoc = hasPrecedingJSDocComment(); - if (kind === 170 /* ConstructSignature */) { + if (kind === 169 /* ConstructSignature */) { parseExpected(102 /* NewKeyword */); } var typeParameters = parseTypeParameters(); var parameters = parseParameters(4 /* Type */); var type = parseReturnType(58 /* ColonToken */, /*isType*/ true); parseTypeMemberSemicolon(); - var node = kind === 169 /* CallSignature */ + var node = kind === 168 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, type) : factory.createConstructSignature(typeParameters, parameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -30628,10 +29766,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(169 /* CallSignature */); + return parseSignatureMember(168 /* CallSignature */); } if (token() === 102 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(170 /* ConstructSignature */); + return parseSignatureMember(169 /* ConstructSignature */); } var pos = getNodePos(); var hasJSDoc = hasPrecedingJSDocComment(); @@ -30675,9 +29813,9 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 142 /* ReadonlyKeyword */; + return nextToken() === 141 /* ReadonlyKeyword */; } - if (token() === 142 /* ReadonlyKeyword */) { + if (token() === 141 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 100 /* InKeyword */; @@ -30693,15 +29831,14 @@ var ts; var pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); var readonlyToken; - if (token() === 142 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 141 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { readonlyToken = parseTokenNode(); - if (readonlyToken.kind !== 142 /* ReadonlyKeyword */) { - parseExpected(142 /* ReadonlyKeyword */); + if (readonlyToken.kind !== 141 /* ReadonlyKeyword */) { + parseExpected(141 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); var typeParameter = parseMappedTypeParameter(); - var nameType = parseOptional(126 /* AsKeyword */) ? parseType() : undefined; parseExpected(23 /* CloseBracketToken */); var questionToken; if (token() === 57 /* QuestionToken */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { @@ -30713,7 +29850,7 @@ var ts; var type = parseTypeAnnotation(); parseSemicolon(); parseExpected(19 /* CloseBraceToken */); - return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), pos); + return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), pos); } function parseTupleElementType() { var pos = getNodePos(); @@ -30815,15 +29952,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 148 /* SymbolKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 147 /* SymbolKeyword */: case 131 /* BooleanKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: - case 145 /* ObjectKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: + case 144 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 65 /* AsteriskEqualsToken */: @@ -30856,7 +29993,7 @@ var ts; return parseTokenNode(); case 107 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 136 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -30875,8 +30012,6 @@ var ts; return parseImportType(); case 127 /* AssertsKeyword */: return lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine) ? parseAssertsTypePredicate() : parseTypeReference(); - case 15 /* TemplateHead */: - return parseTemplateType(); default: return parseTypeReference(); } @@ -30884,20 +30019,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: - case 142 /* ReadonlyKeyword */: - case 148 /* SymbolKeyword */: - case 151 /* UniqueKeyword */: + case 141 /* ReadonlyKeyword */: + case 147 /* SymbolKeyword */: + case 150 /* UniqueKeyword */: case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: case 103 /* NullKeyword */: case 107 /* ThisKeyword */: case 111 /* TypeOfKeyword */: - case 141 /* NeverKeyword */: + case 140 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -30909,7 +30044,7 @@ var ts; case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: @@ -30917,8 +30052,6 @@ var ts; case 135 /* InferKeyword */: case 99 /* ImportKeyword */: case 127 /* AssertsKeyword */: - case 14 /* NoSubstitutionTemplateLiteral */: - case 15 /* TemplateHead */: return true; case 97 /* FunctionKeyword */: return !inStartOfParameter; @@ -30990,9 +30123,9 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 138 /* KeyOfKeyword */: - case 151 /* UniqueKeyword */: - case 142 /* ReadonlyKeyword */: + case 137 /* KeyOfKeyword */: + case 150 /* UniqueKeyword */: + case 141 /* ReadonlyKeyword */: return parseTypeOperator(operator); case 135 /* InferKeyword */: return parseInferType(); @@ -31109,7 +30242,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 136 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -31118,7 +30251,7 @@ var ts; var pos = getNodePos(); var assertsModifier = parseExpectedToken(127 /* AssertsKeyword */); var parameterName = token() === 107 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - var type = parseOptional(137 /* IsKeyword */) ? parseType() : undefined; + var type = parseOptional(136 /* IsKeyword */) ? parseType() : undefined; return finishNode(factory.createTypePredicateNode(assertsModifier, parameterName, type), pos); } function parseType() { @@ -31650,7 +30783,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand, pos); } function isInOrOfKeyword(t) { - return t === 100 /* InKeyword */ || t === 156 /* OfKeyword */; + return t === 100 /* InKeyword */ || t === 155 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand, pos) { while (true) { @@ -31790,7 +30923,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 206 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 203 /* TypeAssertionExpression */) { parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -32041,7 +31174,7 @@ var ts; var pos = getNodePos(); var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 275 /* JsxOpeningElement */) { + if (opening.kind === 272 /* JsxOpeningElement */) { var children = parseJsxChildren(opening); var closingElement = parseJsxClosingElement(inExpressionContext); if (!tagNamesAreEquivalent(opening.tagName, closingElement.tagName)) { @@ -32049,11 +31182,11 @@ var ts; } result = finishNode(factory.createJsxElement(opening, children, closingElement), pos); } - else if (opening.kind === 278 /* JsxOpeningFragment */) { + else if (opening.kind === 275 /* JsxOpeningFragment */) { result = finishNode(factory.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos); } else { - ts.Debug.assert(opening.kind === 274 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 271 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -32548,10 +31681,10 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(); if (parseContextualModifier(134 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */); + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 166 /* GetAccessor */); } - if (parseContextualModifier(146 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */); + if (parseContextualModifier(145 /* SetKeyword */)) { + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -32762,7 +31895,7 @@ var ts; } } var node; - if (awaitToken ? parseExpected(156 /* OfKeyword */) : parseOptional(156 /* OfKeyword */)) { + if (awaitToken ? parseExpected(155 /* OfKeyword */) : parseOptional(155 /* OfKeyword */)) { var expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(21 /* CloseParenToken */); node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement()); @@ -32788,10 +31921,10 @@ var ts; } function parseBreakOrContinueStatement(kind) { var pos = getNodePos(); - parseExpected(kind === 241 /* BreakStatement */ ? 80 /* BreakKeyword */ : 85 /* ContinueKeyword */); + parseExpected(kind === 238 /* BreakStatement */ ? 80 /* BreakKeyword */ : 85 /* ContinueKeyword */); var label = canParseSemicolon() ? undefined : parseIdentifier(); parseSemicolon(); - var node = kind === 241 /* BreakStatement */ + var node = kind === 238 /* BreakStatement */ ? factory.createBreakStatement(label) : factory.createContinueStatement(label); return finishNode(node, pos); @@ -32970,10 +32103,10 @@ var ts; // // could be legal, it would add complexity for very little gain. case 117 /* InterfaceKeyword */: - case 149 /* TypeKeyword */: + case 148 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 125 /* AbstractKeyword */: case 129 /* AsyncKeyword */: @@ -32981,14 +32114,14 @@ var ts; case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 122 /* PublicKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 154 /* GlobalKeyword */: + case 153 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 78 /* Identifier */ || token() === 92 /* ExportKeyword */; case 99 /* ImportKeyword */: @@ -32997,7 +32130,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 92 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 149 /* TypeKeyword */) { + if (currentToken_1 === 148 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -33053,17 +32186,17 @@ var ts; case 129 /* AsyncKeyword */: case 133 /* DeclareKeyword */: case 117 /* InterfaceKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: - case 149 /* TypeKeyword */: - case 154 /* GlobalKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: + case 148 /* TypeKeyword */: + case 153 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 123 /* StaticKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -33106,9 +32239,9 @@ var ts; case 96 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 85 /* ContinueKeyword */: - return parseBreakOrContinueStatement(240 /* ContinueStatement */); + return parseBreakOrContinueStatement(237 /* ContinueStatement */); case 80 /* BreakKeyword */: - return parseBreakOrContinueStatement(241 /* BreakStatement */); + return parseBreakOrContinueStatement(238 /* BreakStatement */); case 104 /* ReturnKeyword */: return parseReturnStatement(); case 115 /* WithKeyword */: @@ -33129,9 +32262,9 @@ var ts; return parseDeclaration(); case 129 /* AsyncKeyword */: case 117 /* InterfaceKeyword */: - case 149 /* TypeKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 148 /* TypeKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: case 133 /* DeclareKeyword */: case 84 /* ConstKeyword */: case 91 /* EnumKeyword */: @@ -33142,8 +32275,8 @@ var ts; case 122 /* PublicKeyword */: case 125 /* AbstractKeyword */: case 123 /* StaticKeyword */: - case 142 /* ReadonlyKeyword */: - case 154 /* GlobalKeyword */: + case 141 /* ReadonlyKeyword */: + case 153 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -33203,13 +32336,13 @@ var ts; return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers); case 117 /* InterfaceKeyword */: return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers); - case 149 /* TypeKeyword */: + case 148 /* TypeKeyword */: return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers); case 91 /* EnumKeyword */: return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers); - case 154 /* GlobalKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 153 /* GlobalKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers); case 99 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers); @@ -33228,7 +32361,7 @@ var ts; if (decorators || modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(271 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(268 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); ts.setTextRangePos(missing, pos); missing.decorators = decorators; missing.modifiers = modifiers; @@ -33347,7 +32480,7 @@ var ts; // this context. // The checker will then give an error that there is an empty declaration list. var declarations; - if (token() === 156 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 155 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { declarations = createMissingList(); } else { @@ -33451,12 +32584,12 @@ var ts; var parameters = parseParameters(0 /* None */); var type = parseReturnType(58 /* ColonToken */, /*isType*/ false); var body = parseFunctionBlockOrSemicolon(0 /* None */); - var node = kind === 167 /* GetAccessor */ + var node = kind === 166 /* GetAccessor */ ? factory.createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) : factory.createSetAccessorDeclaration(decorators, modifiers, name, parameters, body); // Keep track of `typeParameters` (for both) and `type` (for setters) if they were parsed those indicate grammar errors node.typeParameters = typeParameters; - if (type && node.kind === 168 /* SetAccessor */) + if (type && node.kind === 167 /* SetAccessor */) node.type = type; return withJSDoc(finishNode(node, pos), hasJSDoc); } @@ -33495,7 +32628,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 146 /* SetKeyword */ || idToken === 134 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 145 /* SetKeyword */ || idToken === 134 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -33599,10 +32732,10 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); if (parseContextualModifier(134 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */); + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 166 /* GetAccessor */); } - if (parseContextualModifier(146 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */); + if (parseContextualModifier(145 /* SetKeyword */)) { + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* SetAccessor */); } if (token() === 132 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers); @@ -33641,10 +32774,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, 221 /* ClassExpression */); + return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, 218 /* ClassExpression */); } function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 252 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 249 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) { var savedAwaitContext = inAwaitContext(); @@ -33666,7 +32799,7 @@ var ts; members = createMissingList(); } setAwaitContext(savedAwaitContext); - var node = kind === 252 /* ClassDeclaration */ + var node = kind === 249 /* ClassDeclaration */ ? factory.createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) : factory.createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -33726,11 +32859,11 @@ var ts; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) { - parseExpected(149 /* TypeKeyword */); + parseExpected(148 /* TypeKeyword */); var name = parseIdentifier(); var typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); - var type = token() === 136 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType(); + var type = parseType(); parseSemicolon(); var node = factory.createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -33786,7 +32919,7 @@ var ts; function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { var flags = 0; var name; - if (token() === 154 /* GlobalKeyword */) { + if (token() === 153 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation name = parseIdentifier(); flags |= 1024 /* GlobalAugmentation */; @@ -33807,15 +32940,15 @@ var ts; } function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { var flags = 0; - if (token() === 154 /* GlobalKeyword */) { + if (token() === 153 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); } - else if (parseOptional(140 /* NamespaceKeyword */)) { + else if (parseOptional(139 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(139 /* ModuleKeyword */); + parseExpected(138 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); } @@ -33823,7 +32956,7 @@ var ts; return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags); } function isExternalModuleReference() { - return token() === 143 /* RequireKeyword */ && + return token() === 142 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -33834,7 +32967,7 @@ var ts; } function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) { parseExpected(126 /* AsKeyword */); - parseExpected(140 /* NamespaceKeyword */); + parseExpected(139 /* NamespaceKeyword */); var name = parseIdentifier(); parseSemicolon(); var node = factory.createNamespaceExportDeclaration(name); @@ -33852,7 +32985,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 153 /* FromKeyword */ && + if (token() !== 152 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -33870,7 +33003,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(153 /* FromKeyword */); + parseExpected(152 /* FromKeyword */); } var moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -33883,7 +33016,7 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 153 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 152 /* FromKeyword */; } function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) { parseExpected(62 /* EqualsToken */); @@ -33908,7 +33041,7 @@ var ts; var namedBindings; if (!identifier || parseOptional(27 /* CommaToken */)) { - namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(264 /* NamedImports */); + namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(261 /* NamedImports */); } return finishNode(factory.createImportClause(isTypeOnly, identifier, namedBindings), pos); } @@ -33919,7 +33052,7 @@ var ts; } function parseExternalModuleReference() { var pos = getNodePos(); - parseExpected(143 /* RequireKeyword */); + parseExpected(142 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); var expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -33956,16 +33089,16 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - var node = kind === 264 /* NamedImports */ + var node = kind === 261 /* NamedImports */ ? factory.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); return finishNode(node, pos); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(270 /* ExportSpecifier */); + return parseImportOrExportSpecifier(267 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(265 /* ImportSpecifier */); + return parseImportOrExportSpecifier(262 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var pos = getNodePos(); @@ -33992,38 +33125,38 @@ var ts; else { name = identifierName; } - if (kind === 265 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 262 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } - var node = kind === 265 /* ImportSpecifier */ + var node = kind === 262 /* ImportSpecifier */ ? factory.createImportSpecifier(propertyName, name) : factory.createExportSpecifier(propertyName, name); return finishNode(node, pos); } function parseNamespaceExport(pos) { - return finishNode(factory.createNamespaceExport(parseIdentifierName()), pos); + return finishNode(factory.createNamespaceExport(parseIdentifier()), pos); } function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) { var savedAwaitContext = inAwaitContext(); setAwaitContext(/*value*/ true); var exportClause; var moduleSpecifier; - var isTypeOnly = parseOptional(149 /* TypeKeyword */); + var isTypeOnly = parseOptional(148 /* TypeKeyword */); var namespaceExportPos = getNodePos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(126 /* AsKeyword */)) { exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(153 /* FromKeyword */); + parseExpected(152 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } else { - exportClause = parseNamedImportsOrExports(268 /* NamedExports */); + exportClause = parseNamedImportsOrExports(265 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 153 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(153 /* FromKeyword */); + if (token() === 152 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(152 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } } @@ -34140,18 +33273,6 @@ var ts; return finishNode(result, pos); } JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression; - function parseJSDocNameReference() { - var pos = getNodePos(); - var hasBrace = parseOptional(18 /* OpenBraceToken */); - var entityName = parseEntityName(/* allowReservedWords*/ false); - if (hasBrace) { - parseExpectedJSDoc(19 /* CloseBraceToken */); - } - var result = factory.createJSDocNameReference(entityName); - fixupParentReferences(result); - return finishNode(result, pos); - } - JSDocParser.parseJSDocNameReference = parseJSDocNameReference; function parseIsolatedJSDocComment(content, start, length) { initializeState("", content, 99 /* Latest */, /*_syntaxCursor:*/ undefined, 1 /* JS */); var jsDoc = doInsideOfContext(4194304 /* JSDoc */, function () { return parseJSDocCommentWorker(start, length); }); @@ -34215,8 +33336,7 @@ var ts; var state = 1 /* SawAsterisk */; var margin; // + 4 for leading '/** ' - // + 1 because the last index of \n is always one index before the first character in the line and coincidentally, if there is no \n before start, it is -1, which is also one index before the first character - var indent = start - (content.lastIndexOf("\n", start) + 1) + 4; + var indent = start - Math.max(content.lastIndexOf("\n", start), 0) + 4; function pushComment(text) { if (!margin) { margin = indent; @@ -34272,7 +33392,7 @@ var ts; comments.push(whitespace); } else if (margin !== undefined && indent + whitespace.length > margin) { - comments.push(whitespace.slice(margin - indent)); + comments.push(whitespace.slice(margin - indent - 1)); } indent += whitespace.length; break; @@ -34416,9 +33536,6 @@ var ts; case "callback": tag = parseCallbackTag(start, tagName, margin, indentText); break; - case "see": - tag = parseSeeTag(start, tagName, margin, indentText); - break; default: tag = parseUnknownTag(start, tagName, margin, indentText); break; @@ -34568,9 +33685,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return true; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -34602,12 +33719,12 @@ var ts; var child = void 0; var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) { + if (child.kind === 322 /* JSDocParameterTag */ || child.kind === 328 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 178 /* ArrayType */), pos); + var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 177 /* ArrayType */), pos); return finishNode(factory.createJSDocTypeExpression(literal), pos); } } @@ -34629,12 +33746,6 @@ var ts; var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined; return finishNode(factory.createJSDocTypeTag(tagName, typeExpression, comments), start, end); } - function parseSeeTag(start, tagName, indent, indentText) { - var nameExpression = parseJSDocNameReference(); - var end = getNodePos(); - var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined; - return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start, end); - } function parseAuthorTag(start, tagName, indent, indentText) { var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -34750,7 +33861,7 @@ var ts; var hasChildren = false; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { hasChildren = true; - if (child.kind === 329 /* JSDocTypeTag */) { + if (child.kind === 325 /* JSDocTypeTag */) { if (childTypeTag) { parseErrorAtCurrentToken(ts.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); var lastError = ts.lastOrUndefined(parseDiagnostics); @@ -34768,7 +33879,7 @@ var ts; } } if (hasChildren) { - var isArrayType = typeExpression && typeExpression.type.kind === 178 /* ArrayType */; + var isArrayType = typeExpression && typeExpression.type.kind === 177 /* ArrayType */; var jsdocTypeLiteral = factory.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType); typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : @@ -34821,7 +33932,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 327 /* JSDocReturnTag */) { + if (tag && tag.kind === 323 /* JSDocReturnTag */) { return tag; } } @@ -34856,7 +33967,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) && + if (child && (child.kind === 322 /* JSDocParameterTag */ || child.kind === 328 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -35602,8 +34713,6 @@ var ts; } case "jsx": case "jsxfrag": - case "jsximportsource": - case "jsxruntime": return; // Accessed directly default: ts.Debug.fail("Unhandled pragma kind"); // Can this be made into an assertNever in the future? } @@ -35728,18 +34837,6 @@ var ts; (function (ts) { /* @internal */ ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; - var jsxOptionMap = new ts.Map(ts.getEntries({ - "preserve": 1 /* Preserve */, - "react-native": 3 /* ReactNative */, - "react": 2 /* React */, - "react-jsx": 4 /* ReactJSX */, - "react-jsxdev": 5 /* ReactJSXDev */, - })); - /* @internal */ - ts.inverseJsxOptionMap = new ts.Map(ts.arrayFrom(ts.mapIterator(jsxOptionMap.entries(), function (_a) { - var key = _a[0], value = _a[1]; - return ["" + value, key]; - }))); // NOTE: The order here is important to default lib ordering as entries will have the same // order in the generated program (see `getDefaultLibPriority` in program.ts). This // order also affects overload resolution when a type declared in one lib is @@ -35761,7 +34858,6 @@ var ts; ["dom.iterable", "lib.dom.iterable.d.ts"], ["webworker", "lib.webworker.d.ts"], ["webworker.importscripts", "lib.webworker.importscripts.d.ts"], - ["webworker.iterable", "lib.webworker.iterable.d.ts"], ["scripthost", "lib.scripthost.d.ts"], // ES2015 Or ESNext By-feature options ["es2015.core", "lib.es2015.core.d.ts"], @@ -35790,7 +34886,6 @@ var ts; ["es2019.symbol", "lib.es2019.symbol.d.ts"], ["es2020.bigint", "lib.es2020.bigint.d.ts"], ["es2020.promise", "lib.es2020.promise.d.ts"], - ["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"], ["es2020.string", "lib.es2020.string.d.ts"], ["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"], ["es2020.intl", "lib.es2020.intl.d.ts"], @@ -35800,8 +34895,7 @@ var ts; ["esnext.intl", "lib.esnext.intl.d.ts"], ["esnext.bigint", "lib.es2020.bigint.d.ts"], ["esnext.string", "lib.esnext.string.d.ts"], - ["esnext.promise", "lib.esnext.promise.d.ts"], - ["esnext.weakref", "lib.esnext.weakref.d.ts"] + ["esnext.promise", "lib.esnext.promise.d.ts"] ]; /** * An array of supported "lib" reference file names used to determine the order for inclusion @@ -35933,15 +35027,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Generates_a_CPU_profile }, - { - name: "generateTrace", - type: "string", - isFilePath: true, - isCommandLineOnly: true, - paramType: ts.Diagnostics.DIRECTORY, - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Generates_an_event_trace_and_a_list_of_types - }, { name: "incremental", shortName: "i", @@ -36097,10 +35182,12 @@ var ts; }, { name: "jsx", - type: jsxOptionMap, + type: new ts.Map(ts.getEntries({ + "preserve": 1 /* Preserve */, + "react-native": 3 /* ReactNative */, + "react": 2 /* React */ + })), affectsSourceFile: true, - affectsEmit: true, - affectsModuleResolution: true, paramType: ts.Diagnostics.KIND, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, @@ -36343,14 +35430,6 @@ var ts; category: ts.Diagnostics.Additional_Checks, description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement }, - { - name: "noUncheckedIndexedAccess", - type: "boolean", - affectsSemanticDiagnostics: true, - showInSimplifiedHelpView: false, - category: ts.Diagnostics.Additional_Checks, - description: ts.Diagnostics.Include_undefined_in_index_signature_results - }, // Module Resolution { name: "moduleResolution", @@ -36512,15 +35591,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment }, - { - name: "jsxImportSource", - type: "string", - affectsSemanticDiagnostics: true, - affectsEmit: true, - affectsModuleResolution: true, - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react - }, { name: "resolveJsonModule", type: "boolean", @@ -36832,11 +35902,7 @@ var ts; name: "exclude", type: "string" } - }, - { - name: "disableFilenameBasedTypeAcquisition", - type: "boolean", - }, + } ]; /*@internal*/ function createOptionNameMap(optionDeclarations) { @@ -37191,7 +36257,7 @@ var ts; */ function readJsonConfigFile(fileName, readFile) { var textOrDiagnostic = tryReadFile(fileName, readFile); - return ts.isString(textOrDiagnostic) ? ts.parseJsonText(fileName, textOrDiagnostic) : { fileName: fileName, parseDiagnostics: [textOrDiagnostic] }; + return ts.isString(textOrDiagnostic) ? ts.parseJsonText(fileName, textOrDiagnostic) : { parseDiagnostics: [textOrDiagnostic] }; } ts.readJsonConfigFile = readJsonConfigFile; /*@internal*/ @@ -37334,7 +36400,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_4 = function (element) { - if (element.kind !== 288 /* PropertyAssignment */) { + if (element.kind !== 285 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -37425,13 +36491,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -37448,7 +36514,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -37933,7 +36999,6 @@ var ts; * It does *not* resolve the included files. */ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache) { - var _a; basePath = ts.normalizeSlashes(basePath); var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { @@ -37943,13 +37008,6 @@ var ts; var ownConfig = json ? parseOwnConfigOfJson(json, host, basePath, configFileName, errors) : parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); - if ((_a = ownConfig.options) === null || _a === void 0 ? void 0 : _a.paths) { - // If we end up needing to resolve relative paths from 'paths' relative to - // the config file location, we'll need to know where that config file was. - // Since 'paths' can be inherited from an extended config in another directory, - // we wouldn't know which directory to use unless we store it here. - ownConfig.options.pathsBasePath = basePath; - } if (ownConfig.extendedConfigPath) { // copy the resolution stack so it is never reused between branches in potential diamond-problem scenarios. resolutionStack = resolutionStack.concat([resolvedPath]); @@ -39249,15 +38307,12 @@ var ts; } function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) { var _a = state.compilerOptions, baseUrl = _a.baseUrl, paths = _a.paths; - if (paths && !ts.pathIsRelative(moduleName)) { + if (baseUrl && paths && !ts.pathIsRelative(moduleName)) { if (state.traceEnabled) { - if (baseUrl) { - trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); - } + trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName); } - var baseDirectory = ts.getPathsBasePath(state.compilerOptions, state.host); // Always defined when 'paths' is defined - return tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, loader, /*onlyRecordFailures*/ false, state); + return tryLoadModuleUsingPaths(extensions, moduleName, baseUrl, paths, loader, /*onlyRecordFailures*/ false, state); } } function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state) { @@ -39756,7 +38811,6 @@ var ts; } var resolved = ts.forEach(paths[matchedPatternText], function (subst) { var path = matchedStar_1 ? subst.replace("*", matchedStar_1) : subst; - // When baseUrl is not specified, the command line parser resolves relative paths to the config file location. var candidate = ts.normalizePath(ts.combinePaths(baseDirectory, path)); if (state.traceEnabled) { trace(state.host, ts.Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path); @@ -39922,26 +38976,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: if (!(ts.hasSyntacticModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 268 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 265 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -39957,7 +39011,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 257 /* ModuleBlock */: { + case 254 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -39979,7 +39033,7 @@ var ts; }); return state_1; } - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 78 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -40051,15 +39105,12 @@ var ts; } var binder = createBinder(); function bindSourceFile(file, options) { - var tracingData = ["bind" /* Bind */, "bindSourceFile", { path: file.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeBind"); ts.perfLogger.logStartBindFile("" + file.fileName); binder(file, options); ts.perfLogger.logStopBindFile(); ts.performance.mark("afterBind"); ts.performance.measure("Bind", "beforeBind", "afterBind"); - ts.tracing.end.apply(ts.tracing, tracingData); } ts.bindSourceFile = bindSourceFile; function createBinder() { @@ -40091,8 +39142,6 @@ var ts; // not depending on if we see "use strict" in certain places or if we hit a class/namespace // or if compiler options contain alwaysStrict. var inStrictMode; - // If we are binding an assignment pattern, we will bind certain expressions differently. - var inAssignmentPattern = false; var symbolCount = 0; var Symbol; var classifiableNames; @@ -40142,7 +39191,6 @@ var ts; currentExceptionTarget = undefined; activeLabelList = undefined; hasExplicitReturn = false; - inAssignmentPattern = false; emitFlags = 0 /* None */; } return bindSourceFile; @@ -40180,7 +39228,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 266 /* ExportAssignment */) { + if (node.kind === 263 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -40189,7 +39237,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 158 /* ComputedPropertyName */) { + if (name.kind === 157 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -40217,36 +39265,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return "__constructor" /* Constructor */; - case 174 /* FunctionType */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: + case 173 /* FunctionType */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: return "__call" /* Call */; - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: return "__new" /* New */; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return "__index" /* Index */; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 160 /* Parameter */: + case 159 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 308 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 304 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -40346,7 +39394,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 266 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 263 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -40383,9 +39431,9 @@ var ts; return symbol; } function declareModuleMember(node, symbolFlags, symbolExcludes) { - var hasExportModifier = !!(ts.getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node); + var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 270 /* ExportSpecifier */ || (node.kind === 260 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 267 /* ExportSpecifier */ || (node.kind === 257 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -40409,7 +39457,7 @@ var ts; // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. if (ts.isJSDocTypeAlias(node)) ts.Debug.assert(ts.isInJSFile(node)); // We shouldn't add symbols for JSDoc nodes if not in a JS file. - if (!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) { + if ((!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) || ts.isJSDocTypeAlias(node)) { if (!container.locals || (ts.hasSyntacticModifier(node, 512 /* Default */) && !getDeclarationName(node))) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); // No local symbol for an unnamed default! } @@ -40424,28 +39472,6 @@ var ts; } } } - function jsdocTreatAsExported(node) { - if (node.parent && ts.isModuleDeclaration(node)) { - node = node.parent; - } - if (!ts.isJSDocTypeAlias(node)) - return false; - // jsdoc typedef handling is a bit of a doozy, but to summarize, treat the typedef as exported if: - // 1. It has an explicit name (since by default typedefs are always directly exported, either at the top level or in a container), or - if (!ts.isJSDocEnumTag(node) && !!node.fullName) - return true; - // 2. The thing a nameless typedef pulls its name from is implicitly a direct export (either by assignment or actual export flag). - var declName = ts.getNameOfDeclaration(node); - if (!declName) - return false; - if (ts.isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent)) - return true; - if (ts.isDeclaration(declName.parent) && ts.getCombinedModifierFlags(declName.parent) & 1 /* Export */) - return true; - // This could potentially be simplified by having `delayedBindJSDocTypedefTag` pass in an override for `hasExportModifier`, since it should - // already have calculated and branched on most of this. - return false; - } // All container nodes are kept on a linked list in declaration order. This list is used by // the getLocalNameOfContainer function in the type checker to validate that the local name // used for a container is unique. @@ -40474,7 +39500,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 209 /* ArrowFunction */) { + if (node.kind !== 206 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -40507,7 +39533,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 166 /* Constructor */ || (ts.isInJSFile && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 165 /* Constructor */ || (ts.isInJSFile && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */)) ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -40522,13 +39548,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 166 /* Constructor */ || (ts.isInJSFile && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */))) { + if (node.kind === 165 /* Constructor */ || (ts.isInJSFile && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */))) { node.returnFlowNode = currentFlow; } } @@ -40555,8 +39581,8 @@ var ts; blockScopeContainer = savedBlockScopeContainer; } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 251 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 251 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 248 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 248 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -40569,156 +39595,129 @@ var ts; ts.forEachChild(node, bind, bindEach); } function bindChildren(node) { - var saveInAssignmentPattern = inAssignmentPattern; - // Most nodes aren't valid in an assignment pattern, so we clear the value here - // and set it before we descend into nodes that could actually be part of an assignment pattern. - inAssignmentPattern = false; if (checkUnreachable(node)) { bindEachChild(node); bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; return; } - if (node.kind >= 232 /* FirstStatement */ && node.kind <= 248 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 229 /* FirstStatement */ && node.kind <= 245 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: bindWhileStatement(node); break; - case 235 /* DoStatement */: + case 232 /* DoStatement */: bindDoStatement(node); break; - case 237 /* ForStatement */: + case 234 /* ForStatement */: bindForStatement(node); break; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 234 /* IfStatement */: + case 231 /* IfStatement */: bindIfStatement(node); break; - case 242 /* ReturnStatement */: - case 246 /* ThrowStatement */: + case 239 /* ReturnStatement */: + case 243 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: bindTryStatement(node); break; - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: bindSwitchStatement(node); break; - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: bindCaseBlock(node); break; - case 284 /* CaseClause */: + case 281 /* CaseClause */: bindCaseClause(node); break; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: bindLabeledStatement(node); break; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 216 /* BinaryExpression */: - if (ts.isDestructuringAssignment(node)) { - // Carry over whether we are in an assignment pattern to - // binary expressions that could actually be an initializer - inAssignmentPattern = saveInAssignmentPattern; - bindDestructuringAssignmentFlow(node); - return; - } + case 213 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: bindCallExpressionFlow(node); break; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: bindNonNullExpressionFlow(node); break; - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 297 /* SourceFile */: { + case 294 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; - case 198 /* BindingElement */: - bindBindingElementFlow(node); - break; - case 200 /* ObjectLiteralExpression */: - case 199 /* ArrayLiteralExpression */: - case 288 /* PropertyAssignment */: - case 220 /* SpreadElement */: - // Carry over whether we are in an assignment pattern of Object and Array literals - // as well as their children that are valid assignment targets. - inAssignmentPattern = saveInAssignmentPattern; - // falls through default: bindEachChild(node); break; } bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; } function isNarrowingExpression(expr) { switch (expr.kind) { case 78 /* Identifier */: - case 79 /* PrivateIdentifier */: case 107 /* ThisKeyword */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return hasNarrowableArgument(expr); - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; } function isNarrowableReference(expr) { - return expr.kind === 78 /* Identifier */ || expr.kind === 79 /* PrivateIdentifier */ || expr.kind === 107 /* ThisKeyword */ || expr.kind === 105 /* SuperKeyword */ || + return expr.kind === 78 /* Identifier */ || expr.kind === 107 /* ThisKeyword */ || expr.kind === 105 /* SuperKeyword */ || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) || - ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right) || ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression) || ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left); } @@ -40734,7 +39733,7 @@ var ts; } } } - if (expr.expression.kind === 201 /* PropertyAccessExpression */ && + if (expr.expression.kind === 198 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -40770,9 +39769,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -40848,26 +39847,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 234 /* IfStatement */: - case 236 /* WhileStatement */: - case 235 /* DoStatement */: + case 231 /* IfStatement */: + case 233 /* WhileStatement */: + case 232 /* DoStatement */: return parent.expression === node; - case 237 /* ForStatement */: - case 217 /* ConditionalExpression */: + case 234 /* ForStatement */: + case 214 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 207 /* ParenthesizedExpression */) { + if (node.kind === 204 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 214 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 211 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 213 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -40914,7 +39913,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 245 /* LabeledStatement */) { + while (label && node.parent.kind === 242 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -40965,12 +39964,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 239 /* ForOfStatement */) { + if (node.kind === 236 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 250 /* VariableDeclarationList */) { + if (node.initializer.kind !== 247 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -40992,7 +39991,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 242 /* ReturnStatement */) { + if (node.kind === 239 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -41009,7 +40008,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 241 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 238 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -41114,7 +40113,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 285 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 282 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -41157,13 +40156,10 @@ var ts; } function bindExpressionStatement(node) { bind(node.expression); - maybeBindExpressionFlowIfCall(node.expression); - } - function maybeBindExpressionFlowIfCall(node) { - // A top level or LHS of comma expression call expression with a dotted function name and at least one argument + // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.kind === 203 /* CallExpression */) { - var call = node; + if (node.expression.kind === 200 /* CallExpression */) { + var call = node.expression; if (ts.isDottedName(call.expression) && call.expression.kind !== 105 /* SuperKeyword */) { currentFlow = createFlowCall(currentFlow, call); } @@ -41188,7 +40184,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -41199,10 +40195,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 199 /* ArrayLiteralExpression */) { + else if (node.kind === 196 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 220 /* SpreadElement */) { + if (e.kind === 217 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -41210,16 +40206,16 @@ var ts; } } } - else if (node.kind === 200 /* ObjectLiteralExpression */) { + else if (node.kind === 197 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 288 /* PropertyAssignment */) { + if (p.kind === 285 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 289 /* ShorthandPropertyAssignment */) { + else if (p.kind === 286 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 290 /* SpreadAssignment */) { + else if (p.kind === 287 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -41267,23 +40263,6 @@ var ts; bindAssignmentTargetFlow(node.operand); } } - function bindDestructuringAssignmentFlow(node) { - if (inAssignmentPattern) { - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - inAssignmentPattern = true; - bind(node.left); - } - else { - inAssignmentPattern = true; - bind(node.left); - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - } - bindAssignmentTargetFlow(node.left); - } var BindBinaryExpressionFlowState; (function (BindBinaryExpressionFlowState) { BindBinaryExpressionFlowState[BindBinaryExpressionFlowState["BindThenBindChildren"] = 0] = "BindThenBindChildren"; @@ -41338,9 +40317,6 @@ var ts; break; } case 2 /* BindToken */: { - if (node.operatorToken.kind === 27 /* CommaToken */) { - maybeBindExpressionFlowIfCall(node.left); - } advanceState(3 /* BindRight */); maybeBind(node.operatorToken); break; @@ -41354,7 +40330,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 202 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 199 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -41391,7 +40367,7 @@ var ts; * If `node` is a BinaryExpression, adds it to the local work stack, otherwise recursively binds it */ function maybeBind(node) { - if (node && ts.isBinaryExpression(node) && !ts.isDestructuringAssignment(node)) { + if (node && ts.isBinaryExpression(node)) { stackIndex++; workStacks.expr[stackIndex] = node; workStacks.state[stackIndex] = 0 /* BindThenBindChildren */; @@ -41405,7 +40381,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 201 /* PropertyAccessExpression */) { + if (node.expression.kind === 198 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -41442,27 +40418,9 @@ var ts; bindInitializedVariableFlow(node); } } - function bindBindingElementFlow(node) { - if (ts.isBindingPattern(node.name)) { - // When evaluating a binding pattern, the initializer is evaluated before the binding pattern, per: - // - https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-iteratorbindinginitialization - // - `BindingElement: BindingPattern Initializer?` - // - https://tc39.es/ecma262/#sec-runtime-semantics-keyedbindinginitialization - // - `BindingElement: BindingPattern Initializer?` - bindEach(node.decorators); - bindEach(node.modifiers); - bind(node.dotDotDotToken); - bind(node.propertyName); - bind(node.initializer); - bind(node.name); - } - else { - bindEachChild(node); - } - } function bindJSDocTypeAlias(node) { ts.setParent(node.tagName, node); - if (node.kind !== 325 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 321 /* JSDocEnumTag */ && node.fullName) { ts.setParent(node.fullName, node); ts.setParentRecursive(node.fullName, /*incremental*/ false); } @@ -41470,7 +40428,7 @@ var ts; function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 165 /* MethodDeclaration */) { + if (host && host.kind !== 164 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -41483,15 +40441,15 @@ var ts; } function bindOptionalChainRest(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: bind(node.questionDotToken); bind(node.name); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: bind(node.questionDotToken); bind(node.argumentExpression); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); @@ -41556,7 +40514,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 208 /* FunctionExpression */ || expr.kind === 209 /* ArrowFunction */) { + if (expr.kind === 205 /* FunctionExpression */ || expr.kind === 206 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -41568,7 +40526,7 @@ var ts; } } } - if (node.expression.kind === 201 /* PropertyAccessExpression */) { + if (node.expression.kind === 198 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -41577,54 +40535,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 200 /* ObjectLiteralExpression */: - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 281 /* JsxAttributes */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 197 /* ObjectLiteralExpression */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 278 /* JsxAttributes */: return 1 /* IsContainer */; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 190 /* MappedType */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 189 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: - case 308 /* JSDocFunctionType */: - case 174 /* FunctionType */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 175 /* ConstructorType */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: + case 304 /* JSDocFunctionType */: + case 173 /* FunctionType */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 174 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 287 /* CatchClause */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 258 /* CaseBlock */: + case 284 /* CatchClause */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 255 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 230 /* Block */: + case 227 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -41657,45 +40615,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 297 /* SourceFile */: + case 294 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 200 /* ObjectLiteralExpression */: - case 253 /* InterfaceDeclaration */: - case 281 /* JsxAttributes */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 197 /* ObjectLiteralExpression */: + case 250 /* InterfaceDeclaration */: + case 278 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 313 /* JSDocSignature */: - case 171 /* IndexSignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 308 /* JSDocFunctionType */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 254 /* TypeAliasDeclaration */: - case 190 /* MappedType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 309 /* JSDocSignature */: + case 170 /* IndexSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 304 /* JSDocFunctionType */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 251 /* TypeAliasDeclaration */: + case 189 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -41796,7 +40754,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 290 /* SpreadAssignment */ || prop.name.kind !== 78 /* Identifier */) { + if (prop.kind === 287 /* SpreadAssignment */ || prop.name.kind !== 78 /* Identifier */) { continue; } var identifier = prop.name; @@ -41808,7 +40766,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 288 /* PropertyAssignment */ || prop.kind === 289 /* ShorthandPropertyAssignment */ || prop.kind === 165 /* MethodDeclaration */ + var currentKind = prop.kind === 285 /* PropertyAssignment */ || prop.kind === 286 /* ShorthandPropertyAssignment */ || prop.kind === 164 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -41840,10 +40798,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -42042,8 +41000,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 297 /* SourceFile */ && - blockScopeContainer.kind !== 256 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 294 /* SourceFile */ && + blockScopeContainer.kind !== 253 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -42138,7 +41096,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 156 /* LastToken */) { + if (node.kind > 155 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -42214,7 +41172,7 @@ var ts; } // falls through case 107 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 289 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 286 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkContextualIdentifier(node); @@ -42223,8 +41181,8 @@ var ts; break; case 79 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -42235,11 +41193,11 @@ var ts; if (ts.isInJSFile(expr) && file.commonJsModuleIndicator && ts.isModuleExportsAccessExpression(expr) && - !lookupSymbolForName(blockScopeContainer, "module")) { + !lookupSymbolForNameWorker(blockScopeContainer, "module")) { declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -42258,14 +41216,6 @@ var ts; bindThisPropertyAssignment(node); break; case 5 /* Property */: - var expression = node.left.expression; - if (ts.isInJSFile(node) && ts.isIdentifier(expression)) { - var symbol = lookupSymbolForName(blockScopeContainer, expression.escapedText); - if (ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration)) { - bindThisPropertyAssignment(node); - break; - } - } bindSpecialPropertyAssignment(node); break; case 0 /* None */: @@ -42275,78 +41225,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return checkStrictModeCatchClause(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return checkStrictModeWithStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 187 /* ThisType */: + case 186 /* ThisType */: seenThisKeyword = true; return; - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: break; // Binding the children will handle everything - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return bindTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return bindParameter(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return bindPropertyWorker(node); - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 291 /* EnumMember */: + case 288 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 174 /* FunctionType */: - case 308 /* JSDocFunctionType */: - case 313 /* JSDocSignature */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 304 /* JSDocFunctionType */: + case 309 /* JSDocSignature */: + case 174 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 190 /* MappedType */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 189 /* MappedType */: return bindAnonymousTypeWorker(node); - case 319 /* JSDocClassTag */: + case 315 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return bindFunctionExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -42365,65 +41315,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return bindJsxAttributes(node); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return bindImportClause(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return bindExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return bindExportAssignment(node); - case 297 /* SourceFile */: + case 294 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 230 /* Block */: + case 227 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 326 /* JSDocParameterTag */: - if (node.parent.kind === 313 /* JSDocSignature */) { + case 322 /* JSDocParameterTag */: + if (node.parent.kind === 309 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 312 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 308 /* JSDocTypeLiteral */) { break; } // falls through - case 333 /* JSDocPropertyTag */: + case 328 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 307 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 303 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -42544,9 +41494,9 @@ var ts; return symbol; }); if (symbol) { - var isAlias = ts.isAliasableExpression(node.right) && (ts.isExportsIdentifier(node.left.expression) || ts.isModuleExportsAccessExpression(node.left.expression)); - var flags = isAlias ? 2097152 /* Alias */ : 4 /* Property */ | 1048576 /* ExportValue */; - ts.setParent(node.left, node); + var flags = ts.isClassExpression(node.right) ? + 4 /* Property */ | 1048576 /* ExportValue */ | 32 /* Class */ : + 4 /* Property */ | 1048576 /* ExportValue */; declareSymbol(symbol.exports, symbol, node.left, flags, 0 /* None */); } } @@ -42562,10 +41512,6 @@ var ts; if (ts.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { return; } - if (ts.isObjectLiteralExpression(assignedExpression) && ts.every(assignedExpression.properties, ts.isShorthandPropertyAssignment)) { - ts.forEach(assignedExpression.properties, bindExportAssignedObjectMemberAlias); - return; - } // 'module.exports = expr' assignment var flags = ts.exportAssignmentIsAlias(node) ? 2097152 /* Alias */ @@ -42573,9 +41519,6 @@ var ts; var symbol = declareSymbol(file.symbol.exports, file.symbol, node, flags | 67108864 /* Assignment */, 0 /* None */); ts.setValueDeclaration(symbol, node); } - function bindExportAssignedObjectMemberAlias(node) { - declareSymbol(file.symbol.exports, file.symbol, node, 2097152 /* Alias */ | 67108864 /* Assignment */, 0 /* None */); - } function bindThisPropertyAssignment(node) { ts.Debug.assert(ts.isInJSFile(node)); // private identifiers *must* be declared (even in JS files) @@ -42586,8 +41529,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -42609,11 +41552,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 166 /* Constructor */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 165 /* Constructor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -42625,7 +41568,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -42654,7 +41597,7 @@ var ts; if (node.expression.kind === 107 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 297 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 294 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -42694,21 +41637,16 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 297 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 294 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } function bindSpecialPropertyAssignment(node) { - var _a; // Class declarations in Typescript do not allow property declarations var parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, container) || lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer); if (!ts.isInJSFile(node) && !ts.isFunctionSymbol(parentSymbol)) { return; } - var rootExpr = ts.getLeftmostAccessExpression(node.left); - if (ts.isIdentifier(rootExpr) && ((_a = lookupSymbolForName(container, rootExpr.escapedText)) === null || _a === void 0 ? void 0 : _a.flags) & 2097152 /* Alias */) { - return; - } // Fix up parent pointers since we're going to use these nodes before we bind into them ts.setParent(node.left, node); ts.setParent(node.right, node); @@ -42742,17 +41680,17 @@ var ts; } if (isToplevel && !isPrototypeProperty) { // make symbols or add declarations for intermediate containers - var flags_2 = 1536 /* Module */ | 67108864 /* Assignment */; + var flags_1 = 1536 /* Module */ | 67108864 /* Assignment */; var excludeFlags_1 = 110735 /* ValueModuleExcludes */ & ~67108864 /* Assignment */; namespaceSymbol = forEachIdentifierInEntityName(entityName, namespaceSymbol, function (id, symbol, parent) { if (symbol) { - addDeclarationToSymbol(symbol, id, flags_2); + addDeclarationToSymbol(symbol, id, flags_1); return symbol; } else { var table = parent ? parent.exports : file.jsGlobalAugmentations || (file.jsGlobalAugmentations = ts.createSymbolTable()); - return declareSymbol(table, parent, id, flags_2, excludeFlags_1); + return declareSymbol(table, parent, id, flags_1, excludeFlags_1); } }); } @@ -42803,8 +41741,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 297 /* SourceFile */ - : propertyAccess.parent.parent.kind === 297 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 294 /* SourceFile */ + : propertyAccess.parent.parent.kind === 294 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer); @@ -42851,7 +41789,7 @@ var ts; function lookupSymbolForPropertyAccess(node, lookupContainer) { if (lookupContainer === void 0) { lookupContainer = container; } if (ts.isIdentifier(node)) { - return lookupSymbolForName(lookupContainer, node.escapedText); + return lookupSymbolForNameWorker(lookupContainer, node.escapedText); } else { var symbol = lookupSymbolForPropertyAccess(node.expression); @@ -42883,7 +41821,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 252 /* ClassDeclaration */) { + if (node.kind === 249 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -42925,10 +41863,7 @@ var ts; checkStrictModeEvalOrArguments(node, node.name); } if (!ts.isBindingPattern(node.name)) { - if (ts.isInJSFile(node) && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true) && !ts.getJSDocTypeTag(node)) { - declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - } - else if (ts.isBlockOrCatchScoped(node)) { + if (ts.isBlockOrCatchScoped(node)) { bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */); } else if (ts.isParameterDeclaration(node)) { @@ -42949,7 +41884,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 326 /* JSDocParameterTag */ && container.kind !== 313 /* JSDocSignature */) { + if (node.kind === 322 /* JSDocParameterTag */ && container.kind !== 309 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -43026,7 +41961,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 185 /* InferType */) { + else if (node.parent.kind === 184 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -43054,11 +41989,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 231 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 228 /* EmptyStatement */) || // report error on class declarations - node.kind === 252 /* ClassDeclaration */ || + node.kind === 249 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 256 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 253 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -43102,12 +42037,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return ts.hasSyntacticModifier(s, 2048 /* Const */); default: return false; @@ -43123,7 +42058,7 @@ var ts; return true; } else if (ts.isIdentifier(node)) { - var symbol = lookupSymbolForName(sourceFile, node.escapedText); + var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText); if (!!symbol && !!symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) { var init = symbol.valueDeclaration.initializer; q.push(init); @@ -43137,7 +42072,7 @@ var ts; return false; } ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias; - function lookupSymbolForName(container, name) { + function lookupSymbolForNameWorker(container, name) { var local = container.locals && container.locals.get(name); if (local) { return local.exportSymbol || local; @@ -43307,7 +42242,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 176 /* TypeQuery */) { + if (d.type && d.type.kind === 175 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -43337,7 +42272,6 @@ var ts; IterationUse[IterationUse["YieldStarFlag"] = 16] = "YieldStarFlag"; IterationUse[IterationUse["SpreadFlag"] = 32] = "SpreadFlag"; IterationUse[IterationUse["DestructuringFlag"] = 64] = "DestructuringFlag"; - IterationUse[IterationUse["PossiblyOutOfBounds"] = 128] = "PossiblyOutOfBounds"; // Spread, Destructuring, Array element assignment IterationUse[IterationUse["Element"] = 1] = "Element"; IterationUse[IterationUse["Spread"] = 33] = "Spread"; @@ -43484,7 +42418,6 @@ var ts; AccessFlags[AccessFlags["Writing"] = 2] = "Writing"; AccessFlags[AccessFlags["CacheSymbol"] = 4] = "CacheSymbol"; AccessFlags[AccessFlags["NoTupleBoundsCheck"] = 8] = "NoTupleBoundsCheck"; - AccessFlags[AccessFlags["ExpressionPosition"] = 16] = "ExpressionPosition"; })(AccessFlags || (AccessFlags = {})); var SignatureCheckMode; (function (SignatureCheckMode) { @@ -43543,25 +42476,6 @@ var ts; DeclarationSpaces[DeclarationSpaces["ExportType"] = 2] = "ExportType"; DeclarationSpaces[DeclarationSpaces["ExportNamespace"] = 4] = "ExportNamespace"; })(DeclarationSpaces || (DeclarationSpaces = {})); - var MinArgumentCountFlags; - (function (MinArgumentCountFlags) { - MinArgumentCountFlags[MinArgumentCountFlags["None"] = 0] = "None"; - MinArgumentCountFlags[MinArgumentCountFlags["StrongArityForUntypedJS"] = 1] = "StrongArityForUntypedJS"; - MinArgumentCountFlags[MinArgumentCountFlags["VoidIsNonOptional"] = 2] = "VoidIsNonOptional"; - })(MinArgumentCountFlags || (MinArgumentCountFlags = {})); - var IntrinsicTypeKind; - (function (IntrinsicTypeKind) { - IntrinsicTypeKind[IntrinsicTypeKind["Uppercase"] = 0] = "Uppercase"; - IntrinsicTypeKind[IntrinsicTypeKind["Lowercase"] = 1] = "Lowercase"; - IntrinsicTypeKind[IntrinsicTypeKind["Capitalize"] = 2] = "Capitalize"; - IntrinsicTypeKind[IntrinsicTypeKind["Uncapitalize"] = 3] = "Uncapitalize"; - })(IntrinsicTypeKind || (IntrinsicTypeKind = {})); - var intrinsicTypeKinds = new ts.Map(ts.getEntries({ - Uppercase: 0 /* Uppercase */, - Lowercase: 1 /* Lowercase */, - Capitalize: 2 /* Capitalize */, - Uncapitalize: 3 /* Uncapitalize */ - })); function SymbolLinks() { } function NodeLinks() { @@ -43625,7 +42539,6 @@ var ts; var instantiationDepth = 0; var constraintDepth = 0; var currentNode; - var typeCatalog = []; // NB: id is index + 1 var emptySymbols = ts.createSymbolTable(); var arrayVariances = [1 /* Covariant */]; var compilerOptions = host.getCompilerOptions(); @@ -43662,7 +42575,6 @@ var ts; getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount") + symbolCount; }, - getTypeCatalog: function () { return typeCatalog; }, getTypeCount: function () { return typeCount; }, getInstantiationCount: function () { return totalInstantiationCount; }, getRelationCacheSizes: function () { return ({ @@ -43677,7 +42589,6 @@ var ts; getMergedSymbol: getMergedSymbol, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getRecursionIdentity: getRecursionIdentity, getTypeOfSymbolAtLocation: function (symbol, locationIn) { var location = ts.getParseTreeNode(locationIn); return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType; @@ -43786,7 +42697,6 @@ var ts; }, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getSymbolOfExpando: getSymbolOfExpando, getContextualType: function (nodeIn, contextFlags) { var node = ts.getParseTreeNode(nodeIn, ts.isExpression); if (!node) { @@ -43980,8 +42890,6 @@ var ts; var intersectionTypes = new ts.Map(); var literalTypes = new ts.Map(); var indexedAccessTypes = new ts.Map(); - var templateLiteralTypes = new ts.Map(); - var stringMappingTypes = new ts.Map(); var substitutionTypes = new ts.Map(); var evolvingArrayTypes = []; var undefinedProperties = new ts.Map(); @@ -43992,7 +42900,6 @@ var ts; var wildcardType = createIntrinsicType(1 /* Any */, "any"); var errorType = createIntrinsicType(1 /* Any */, "error"); var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 524288 /* ContainsWideningType */); - var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); var unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 524288 /* ContainsWideningType */); @@ -44031,7 +42938,6 @@ var ts; var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; var numberOrBigIntType = getUnionType([numberType, bigintType]); - var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; }); var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; }); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -44303,16 +43209,6 @@ var ts; } } function errorOrSuggestion(isError, location, message, arg0, arg1, arg2, arg3) { - // Pseudo-synthesized input node - if (location.pos < 0 || location.end < 0) { - if (!isError) { - return; // Drop suggestions (we have no span to suggest on) - } - // Issue errors globally - var file = ts.getSourceFileOfNode(location); - addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message)); // eslint-disable-line no-in-operator - return; - } addErrorOrSuggestion(isError, "message" in message ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForNodeFromMessageChain(location, message)); // eslint-disable-line no-in-operator } function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) { @@ -44602,7 +43498,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 297 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 294 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -44661,17 +43557,17 @@ var ts; } if (declaration.pos <= usage.pos && !(ts.isPropertyDeclaration(declaration) && ts.isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) { // declaration is before usage - if (declaration.kind === 198 /* BindingElement */) { + if (declaration.kind === 195 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 198 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 195 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 249 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 246 /* VariableDeclaration */), usage); } - else if (declaration.kind === 249 /* VariableDeclaration */) { + else if (declaration.kind === 246 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -44701,12 +43597,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 270 /* ExportSpecifier */ || (usage.parent.kind === 266 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 267 /* ExportSpecifier */ || (usage.parent.kind === 263 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 266 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 263 /* ExportAssignment */ && usage.isExportEquals) { return true; } if (!!(usage.flags & 4194304 /* JSDoc */) || isInTypeQuery(usage) || usageInTypeDeclaration()) { @@ -44728,9 +43624,9 @@ var ts; } function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { switch (declaration.parent.parent.kind) { - case 232 /* VariableStatement */: - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: + case 229 /* VariableStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, declContainer)) { @@ -44751,16 +43647,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 163 /* PropertyDeclaration */ && + current.parent.kind === 162 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasSyntacticModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 165 /* MethodDeclaration */) { + if (declaration.kind === 164 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -44782,19 +43678,19 @@ var ts; return "quit"; } switch (node.kind) { - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return true; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 230 /* Block */: + case 227 /* Block */: switch (node.parent.kind) { - case 167 /* GetAccessor */: - case 165 /* MethodDeclaration */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 164 /* MethodDeclaration */: + case 167 /* SetAccessor */: return true; default: return false; @@ -44830,18 +43726,18 @@ var ts; } function requiresScopeChangeWorker(node) { switch (node.kind) { - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 166 /* Constructor */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 165 /* Constructor */: // do not descend into these return false; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 288 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 285 /* PropertyAssignment */: return requiresScopeChangeWorker(node.name); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // static properties in classes introduce temporary variables if (ts.hasStaticModifier(node)) { return target < 99 /* ESNext */ || !compilerOptions.useDefineForClassFields; @@ -44895,12 +43791,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 311 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 307 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 160 /* Parameter */ || - lastLocation.kind === 159 /* TypeParameter */ + lastLocation.kind === 159 /* Parameter */ || + lastLocation.kind === 158 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -44915,13 +43811,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 160 /* Parameter */ || + lastLocation.kind === 159 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 184 /* ConditionalType */) { + else if (location.kind === 183 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -44936,14 +43832,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 297 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 294 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -44967,7 +43863,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 270 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 269 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 267 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 266 /* NamespaceExport */))) { break; } } @@ -44981,12 +43877,12 @@ var ts; } } break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -45003,9 +43899,9 @@ var ts; } } break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -45024,7 +43920,7 @@ var ts; } break loop; } - if (location.kind === 221 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 218 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -45032,7 +43928,7 @@ var ts; } } break; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 93 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -45052,9 +43948,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 253 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 250 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -45062,24 +43958,24 @@ var ts; } } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -45092,7 +43988,7 @@ var ts; } } break; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -45101,7 +43997,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 160 /* Parameter */) { + if (location.parent && location.parent.kind === 159 /* Parameter */) { location = location.parent; } // @@ -45116,17 +44012,17 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 252 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 249 /* ClassDeclaration */)) { location = location.parent; } break; - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 160 /* Parameter */: + case 159 /* Parameter */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && ts.isBindingPattern(lastLocation))) { if (!associatedDeclarationForContainingInitializerOrBindingName) { @@ -45134,20 +44030,14 @@ var ts; } } break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && ts.isBindingPattern(lastLocation))) { - if (ts.isParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) { - associatedDeclarationForContainingInitializerOrBindingName = location; - } - } - break; - case 185 /* InferType */: - if (meaning & 262144 /* TypeParameter */) { - var parameterName = location.typeParameter.name; - if (parameterName && name === parameterName.escapedText) { - result = location.typeParameter.symbol; - break loop; + var root = ts.getRootDeclaration(location); + if (root.kind === 159 /* Parameter */) { + if (!associatedDeclarationForContainingInitializerOrBindingName) { + associatedDeclarationForContainingInitializerOrBindingName = location; + } } } break; @@ -45166,7 +44056,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 297 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 294 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -45204,15 +44094,7 @@ var ts; } } if (!suggestion) { - if (nameArg) { - var lib = getSuggestedLibForNonExistentName(nameArg); - if (lib) { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg), lib); - } - else { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); - } - } + error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); } suggestionCount++; } @@ -45291,10 +44173,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 209 /* ArrowFunction */ && location.kind !== 208 /* FunctionExpression */) { + if (location.kind !== 206 /* ArrowFunction */ && location.kind !== 205 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -45307,12 +44189,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 256 /* ModuleDeclaration */: // For `namespace N { N; }` + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 253 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -45324,7 +44206,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 159 /* TypeParameter */) { + if (decl.kind === 158 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -45380,9 +44262,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 78 /* Identifier */: - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -45426,7 +44308,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 270 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 267 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -45440,31 +44322,15 @@ var ts; } var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* Type */ & ~111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol && !(symbol.flags & 1024 /* NamespaceModule */)) { - var rawName = ts.unescapeLeadingUnderscores(name); - if (isES2015OrLaterConstructorName(name)) { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName); - } - else if (maybeMappedType(errorLocation, symbol)) { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0, rawName, rawName === "K" ? "P" : "K"); - } - else { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, rawName); - } + var message = isES2015OrLaterConstructorName(name) + ? ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later + : ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here; + error(errorLocation, message, ts.unescapeLeadingUnderscores(name)); return true; } } return false; } - function maybeMappedType(node, symbol) { - var container = ts.findAncestor(node.parent, function (n) { - return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit"; - }); - if (container && container.members.length === 1) { - var type = getDeclaredTypeOfSymbol(symbol); - return !!(type.flags & 1048576 /* Union */) && allTypesAssignableToKind(type, 384 /* StringOrNumberLiteral */, /*strict*/ true); - } - return false; - } function isES2015OrLaterConstructorName(n) { switch (n) { case "Promise": @@ -45501,7 +44367,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 255 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 252 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -45536,13 +44402,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.parent; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return node.parent.parent; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -45566,37 +44432,29 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ - || node.kind === 259 /* NamespaceExportDeclaration */ - || node.kind === 262 /* ImportClause */ && !!node.name - || node.kind === 263 /* NamespaceImport */ - || node.kind === 269 /* NamespaceExport */ - || node.kind === 265 /* ImportSpecifier */ - || node.kind === 270 /* ExportSpecifier */ - || node.kind === 266 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) - || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) - || ts.isAccessExpression(node) + return node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 256 /* NamespaceExportDeclaration */ || + node.kind === 259 /* ImportClause */ && !!node.name || + node.kind === 260 /* NamespaceImport */ || + node.kind === 266 /* NamespaceExport */ || + node.kind === 262 /* ImportSpecifier */ || + node.kind === 267 /* ExportSpecifier */ || + node.kind === 263 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || + ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ - && isAliasableOrJsExpression(node.parent.right) - || node.kind === 289 /* ShorthandPropertyAssignment */ - || node.kind === 288 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) - || ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true); + && isAliasableOrJsExpression(node.parent.right) || + node.kind === 286 /* ShorthandPropertyAssignment */ || + node.kind === 285 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - var commonJSPropertyAccess = getCommonJSPropertyAccess(node); - if (commonJSPropertyAccess) { - var name = ts.getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0]; - return ts.isIdentifier(commonJSPropertyAccess.name) - ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText)) - : undefined; - } - if (ts.isVariableDeclaration(node) || node.moduleReference.kind === 272 /* ExternalModuleReference */) { - var immediate = resolveExternalModuleName(node, ts.getExternalModuleRequireArgument(node) || ts.getExternalModuleImportEqualsDeclarationExpression(node)); + if (node.moduleReference.kind === 269 /* ExternalModuleReference */) { + var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); return resolved_4; @@ -45623,7 +44481,10 @@ var ts; } function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) { var exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */); - var exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports.get(name); + if (exportValue) { + return getPropertyOfType(getTypeOfSymbol(exportValue), name); + } + var exportSymbol = moduleSymbol.exports.get(name); var resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(sourceNode, exportSymbol, resolved, /*overwriteEmpty*/ false); return resolved; @@ -45764,9 +44625,11 @@ var ts; result.exports = new ts.Map(valueSymbol.exports); return result; } - function getExportOfModule(symbol, name, specifier, dontResolveAlias) { + function getExportOfModule(symbol, specifier, dontResolveAlias) { + var _a; if (symbol.flags & 1536 /* Module */) { - var exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText); + var name = ((_a = specifier.propertyName) !== null && _a !== void 0 ? _a : specifier.name).escapedText; + var exportSymbol = getExportsOfSymbol(symbol).get(name); var resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(specifier, exportSymbol, resolved, /*overwriteEmpty*/ false); return resolved; @@ -45783,14 +44646,10 @@ var ts; function getExternalModuleMember(node, specifier, dontResolveAlias) { var _a; if (dontResolveAlias === void 0) { dontResolveAlias = false; } - var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier; - var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); // TODO: GH#18217 - var name = !ts.isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name; - if (!ts.isIdentifier(name)) { - return undefined; - } + var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); + var name = specifier.propertyName || specifier.name; var suppressInteropError = name.escapedText === "default" /* Default */ && !!(compilerOptions.allowSyntheticDefaultImports || compilerOptions.esModuleInterop); - var targetSymbol = resolveESModuleSymbol(moduleSymbol, moduleSpecifier, dontResolveAlias, suppressInteropError); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias, suppressInteropError); if (targetSymbol) { if (name.escapedText) { if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { @@ -45806,7 +44665,7 @@ var ts; } // if symbolFromVariable is export - get its final target symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); - var symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias); + var symbolFromModule = getExportOfModule(targetSymbol, specifier, dontResolveAlias); if (symbolFromModule === undefined && name.escapedText === "default" /* Default */) { var file = ts.find(moduleSymbol.declarations, ts.isSourceFile); if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias)) { @@ -45822,7 +44681,7 @@ var ts; var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol); if (suggestion !== undefined) { var suggestionName = symbolToString(suggestion); - var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName); + var diagnostic = error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2, moduleName, declarationName, suggestionName); if (suggestion.valueDeclaration) { ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName)); } @@ -45883,21 +44742,10 @@ var ts; } } function getTargetOfImportSpecifier(node, dontResolveAlias) { - var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent; - var commonJSPropertyAccess = getCommonJSPropertyAccess(root); - var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias); - var name = node.propertyName || node.name; - if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) { - return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias); - } + var resolved = getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false); return resolved; } - function getCommonJSPropertyAccess(node) { - if (ts.isVariableDeclaration(node) && node.initializer && ts.isPropertyAccessExpression(node.initializer)) { - return node.initializer; - } - } function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { var resolved = resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false); @@ -45934,7 +44782,7 @@ var ts; var expression = node.initializer; return getTargetOfAliasLikeExpression(expression, dontRecursivelyResolve); } - function getTargetOfAccessExpression(node, dontRecursivelyResolve) { + function getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve) { if (!(ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */)) { return undefined; } @@ -45943,32 +44791,29 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: - case 249 /* VariableDeclaration */: + case 257 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 265 /* ImportSpecifier */: - case 198 /* BindingElement */: + case 262 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 266 /* ExportAssignment */: - case 216 /* BinaryExpression */: + case 263 /* ExportAssignment */: + case 213 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: - return getTargetOfAccessExpression(node, dontRecursivelyResolve); + case 198 /* PropertyAccessExpression */: + return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); } @@ -46035,7 +44880,7 @@ var ts; * @param overwriteEmpty Checks `resolvesToSymbol` for type-only declarations even if `aliasDeclaration` */ function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) { - if (!aliasDeclaration || ts.isPropertyAccessExpression(aliasDeclaration)) + if (!aliasDeclaration) return false; // If the declaration itself is type-only, mark it and return. // No need to check what it resolves to. @@ -46119,13 +44964,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 78 /* Identifier */ || entityName.parent.kind === 157 /* QualifiedName */) { + if (entityName.kind === 78 /* Identifier */ || entityName.parent.kind === 156 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 260 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 257 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -46149,9 +44994,9 @@ var ts; return getMergedSymbol(symbolFromJSPrototype); } } - else if (name.kind === 157 /* QualifiedName */ || name.kind === 201 /* PropertyAccessExpression */) { - var left = name.kind === 157 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 157 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 156 /* QualifiedName */ || name.kind === 198 /* PropertyAccessExpression */) { + var left = name.kind === 156 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 156 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -46177,12 +45022,7 @@ var ts; symbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, meaning)); if (!symbol) { if (!ignoreErrors) { - var namespaceName = getFullyQualifiedName(namespace); - var declarationName = ts.declarationNameToString(right); - var suggestion = getSuggestedSymbolForNonexistentModule(right, namespace); - suggestion ? - error(right, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestion)) : - error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName); + error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); } return undefined; } @@ -46191,7 +45031,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 266 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 263 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -46375,7 +45215,7 @@ var ts; ? ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, packageId.name, ts.mangleScopedPackageName(packageId.name)) : ts.chainDiagnosticMessages( - /*details*/ undefined, ts.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name)) + /*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name)) : undefined; errorOrSuggestion(isError, errorNode, ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedFileName)); } @@ -46417,7 +45257,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 297 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 294 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -46719,7 +45559,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 166 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 165 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -46728,7 +45568,6 @@ var ts; var result = new Type(checker, flags); typeCount++; result.id = typeCount; - typeCatalog.push(result); return result; } function createIntrinsicType(kind, intrinsicName, objectFlags) { @@ -46807,12 +45646,12 @@ var ts; } } switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -46821,9 +45660,9 @@ var ts; return { value: result }; } break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -46906,7 +45745,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 267 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -46950,7 +45789,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 267 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -46965,10 +45804,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: continue; default: return false; @@ -47097,10 +45936,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -47109,7 +45948,6 @@ var ts; } return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { - var _a, _b; if (!isDeclarationVisible(declaration)) { // Mark the unexported alias as visible if its parent is visible // because these kind of aliases can be used to name types in declaration file @@ -47129,14 +45967,6 @@ var ts; && isDeclarationVisible(declaration.parent)) { return addVisibleAlias(declaration, declaration); } - else if (symbol.flags & 2097152 /* Alias */ && ts.isBindingElement(declaration) && ts.isInJSFile(declaration) && ((_a = declaration.parent) === null || _a === void 0 ? void 0 : _a.parent) // exported import-like top-level JS require statement - && ts.isVariableDeclaration(declaration.parent.parent) - && ((_b = declaration.parent.parent.parent) === null || _b === void 0 ? void 0 : _b.parent) && ts.isVariableStatement(declaration.parent.parent.parent.parent) - && !ts.hasSyntacticModifier(declaration.parent.parent.parent.parent, 1 /* Export */) - && declaration.parent.parent.parent.parent.parent // check if the thing containing the variable statement is visible (ie, the file) - && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) { - return addVisibleAlias(declaration, declaration.parent.parent.parent.parent); - } // Declaration is not visible return false; } @@ -47156,14 +45986,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 176 /* TypeQuery */ || + if (entityName.parent.kind === 175 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 158 /* ComputedPropertyName */) { + entityName.parent.kind === 157 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 157 /* QualifiedName */ || entityName.kind === 201 /* PropertyAccessExpression */ || - entityName.parent.kind === 260 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 156 /* QualifiedName */ || entityName.kind === 198 /* PropertyAccessExpression */ || + entityName.parent.kind === 257 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -47204,7 +46034,7 @@ var ts; function symbolToStringWorker(writer) { var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217 // add neverAsciiEscape for GH#39027 - var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 297 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true }); + var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 294 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, entity, /*sourceFile*/ sourceFile, writer); return writer; @@ -47216,10 +46046,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 175 /* ConstructorType */ : 174 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 174 /* ConstructorType */ : 173 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 170 /* ConstructSignature */ : 169 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 169 /* ConstructSignature */ : 168 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -47265,9 +46095,6 @@ var ts; if (flags === void 0) { flags = 0 /* None */; } return flags & 814775659 /* NodeBuilderFlagsMask */; } - function isClassInstanceSide(type) { - return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(ts.getObjectFlags(type) & 1073741824 /* IsClassInstanceClone */)); - } function createNodeBuilder() { return { typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) { @@ -47299,7 +46126,6 @@ var ts; }, }; function withContext(enclosingDeclaration, flags, tracker, cb) { - var _a, _b; ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); var context = { enclosingDeclaration: enclosingDeclaration, @@ -47323,9 +46149,6 @@ var ts; approximateLength: 0 }; var resultingNode = cb(context); - if (context.truncating && context.flags & 1 /* NoTruncation */) { - (_b = (_a = context.tracker) === null || _a === void 0 ? void 0 : _a.reportTruncationError) === null || _b === void 0 ? void 0 : _b.call(_a); - } return context.encounteredError ? undefined : resultingNode; } function checkTruncationLength(context) { @@ -47352,22 +46175,22 @@ var ts; } if (type.flags & 1 /* Any */) { context.approximateLength += 3; - return ts.factory.createKeywordTypeNode(type === intrinsicMarkerType ? 136 /* IntrinsicKeyword */ : 128 /* AnyKeyword */); + return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */); + return ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(147 /* StringKeyword */); + return ts.factory.createKeywordTypeNode(146 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(144 /* NumberKeyword */); + return ts.factory.createKeywordTypeNode(143 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(155 /* BigIntKeyword */); + return ts.factory.createKeywordTypeNode(154 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; @@ -47376,23 +46199,10 @@ var ts; if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); var parentName = symbolToTypeNode(parentSymbol, context, 788968 /* Type */); - if (getDeclaredTypeOfSymbol(parentSymbol) === type) { - return parentName; - } - var memberName = ts.symbolName(type.symbol); - if (ts.isIdentifierText(memberName, 0 /* ES3 */)) { - return appendReferenceToType(parentName, ts.factory.createTypeReferenceNode(memberName, /*typeArguments*/ undefined)); - } - if (ts.isImportTypeNode(parentName)) { - parentName.isTypeOf = true; // mutably update, node is freshly manufactured anyhow - return ts.factory.createIndexedAccessTypeNode(parentName, ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName))); - } - else if (ts.isTypeReferenceNode(parentName)) { - return ts.factory.createIndexedAccessTypeNode(ts.factory.createTypeQueryNode(parentName.typeName), ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName))); - } - else { - return ts.Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`."); - } + var enumLiteralName = getDeclaredTypeOfSymbol(parentSymbol) === type + ? parentName + : appendReferenceToType(parentName, ts.factory.createTypeReferenceNode(ts.symbolName(type.symbol), /*typeArguments*/ undefined)); + return enumLiteralName; } if (type.flags & 1056 /* EnumLike */) { return symbolToTypeNode(type.symbol, context, 788968 /* Type */); @@ -47425,7 +46235,7 @@ var ts; } } context.approximateLength += 13; - return ts.factory.createTypeOperatorNode(151 /* UniqueKeyword */, ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */)); + return ts.factory.createTypeOperatorNode(150 /* UniqueKeyword */, ts.factory.createKeywordTypeNode(147 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -47433,7 +46243,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */); + return ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -47441,15 +46251,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.factory.createKeywordTypeNode(141 /* NeverKeyword */); + return ts.factory.createKeywordTypeNode(140 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */); + return ts.factory.createKeywordTypeNode(147 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(145 /* ObjectKeyword */); + return ts.factory.createKeywordTypeNode(144 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -47517,19 +46327,7 @@ var ts; var indexedType = type.type; context.approximateLength += 6; var indexTypeNode = typeToTypeNodeHelper(indexedType, context); - return ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, indexTypeNode); - } - if (type.flags & 134217728 /* TemplateLiteral */) { - var texts_1 = type.texts; - var types_1 = type.types; - var templateHead = ts.factory.createTemplateHead(texts_1[0]); - var templateSpans = ts.factory.createNodeArray(ts.map(types_1, function (t, i) { return ts.factory.createTemplateLiteralTypeSpan(typeToTypeNodeHelper(t, context), (i < types_1.length - 1 ? ts.factory.createTemplateMiddle : ts.factory.createTemplateTail)(texts_1[i + 1])); })); - context.approximateLength += 2; - return ts.factory.createTemplateLiteralType(templateHead, templateSpans); - } - if (type.flags & 268435456 /* StringMapping */) { - var typeNode = typeToTypeNodeHelper(type.type, context); - return symbolToTypeNode(type.symbol, context, 788968 /* Type */, [typeNode]); + return ts.factory.createTypeOperatorNode(137 /* KeyOfKeyword */, indexTypeNode); } if (type.flags & 8388608 /* IndexedAccess */) { var objectTypeNode = typeToTypeNodeHelper(type.objectType, context); @@ -47574,15 +46372,14 @@ var ts; if (isMappedTypeWithKeyofConstraintDeclaration(type)) { // We have a { [P in keyof T]: X } // We do this to ensure we retain the toplevel keyof-ness of the type which may be lost due to keyof distribution during `getConstraintTypeFromMappedType` - appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context)); + appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(137 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context)); } else { appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type), context); } var typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type), context, appropriateConstraintTypeNode); - var nameTypeNode = type.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type), context) : undefined; var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); - var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode); + var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); context.approximateLength += 10; return ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */); } @@ -47591,16 +46388,16 @@ var ts; var typeId = type.id; var symbol = type.symbol; if (symbol) { - var isInstanceType = isClassInstanceSide(type) ? 788968 /* Type */ : 111551 /* Value */; if (isJSConstructor(symbol.valueDeclaration)) { // Instance and static types share the same symbol; only add 'typeof' for the static side. + var isInstanceType = type === getDeclaredTypeOfClassOrInterface(symbol) ? 788968 /* Type */ : 111551 /* Value */; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 221 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 218 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { - return symbolToTypeNode(symbol, context, isInstanceType); + return symbolToTypeNode(symbol, context, 111551 /* Value */); } else if ((_a = context.visitedTypes) === null || _a === void 0 ? void 0 : _a.has(typeId)) { // If type is an anonymous type literal in a type alias declaration, use type alias name @@ -47628,7 +46425,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 297 /* SourceFile */ || declaration.parent.kind === 257 /* ModuleBlock */; + return declaration.parent.kind === 294 /* SourceFile */ || declaration.parent.kind === 254 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -47679,12 +46476,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 174 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 173 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 175 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 174 /* ConstructorType */, context); return signatureNode; } } @@ -47705,7 +46502,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.factory.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -47729,12 +46526,12 @@ var ts; } } var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode(tupleConstituentNodes), 1 /* SingleLine */); - return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode([]), 1 /* SingleLine */); - return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -47762,10 +46559,10 @@ var ts; // the default outer type arguments), we don't show the group. if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { var typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start, i), context); - var flags_3 = context.flags; + var flags_2 = context.flags; context.flags |= 16 /* ForbidIndexedAccessSymbolReferences */; var ref = symbolToTypeNode(parent, context, 788968 /* Type */, typeArgumentSlice); - context.flags = flags_3; + context.flags = flags_2; resultType = !resultType ? ref : appendReferenceToType(resultType, ref); } } @@ -47841,11 +46638,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 169 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 168 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 170 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 169 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -47921,7 +46718,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 164 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 163 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); typeElements.push(preserveCommentsOn(methodDeclaration)); } } @@ -47936,7 +46733,7 @@ var ts; propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(141 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -47944,8 +46741,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 328 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 328 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -47977,8 +46774,8 @@ var ts; var seenNames = mayHaveNameCollisions ? ts.createUnderscoreEscapedMultiMap() : undefined; var result_4 = []; var i = 0; - for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { - var type = types_2[_i]; + for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { + var type = types_1[_i]; i++; if (checkTruncationLength(context) && (i + 2 < types.length - 1)) { result_4.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", /*typeArguments*/ undefined)); @@ -48013,8 +46810,8 @@ var ts; var b = _b[0]; return typesAreSameReference(a, b); })) { - for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { - var _a = types_3[_i], type = _a[0], resultIndex = _a[1]; + for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { + var _a = types_2[_i], type = _a[0], resultIndex = _a[1]; result_4[resultIndex] = typeToTypeNodeHelper(type, context); } } @@ -48031,7 +46828,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context, typeNode) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 /* String */ ? 147 /* StringKeyword */ : 144 /* NumberKeyword */); + var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 /* String */ ? 146 /* StringKeyword */ : 143 /* NumberKeyword */); var indexingParameter = ts.factory.createParameterDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -48046,7 +46843,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.factory.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.factory.createToken(141 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context, options) { var _a, _b, _c, _d; @@ -48061,9 +46858,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var expandedParams = getExpandedParameters(signature, /*skipUnionExpanding*/ true)[0]; - // If the expanded parameter list had a variadic in a non-trailing position, don't expand it - var parameters = (ts.some(expandedParams, function (p) { return p !== expandedParams[expandedParams.length - 1] && !!(ts.getCheckFlags(p) & 32768 /* RestParameter */); }) ? signature.parameters : expandedParams).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 166 /* Constructor */, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); }); + var parameters = getExpandedParameters(signature, /*skipUnionExpanding*/ true)[0].map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 165 /* Constructor */, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -48090,20 +46885,20 @@ var ts; } } context.approximateLength += 3; // Usually a signature contributes a few more characters than this, but 3 is the minimum - var node = kind === 169 /* CallSignature */ ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) : - kind === 170 /* ConstructSignature */ ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : - kind === 164 /* MethodSignature */ ? ts.factory.createMethodSignature(options === null || options === void 0 ? void 0 : options.modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : - kind === 165 /* MethodDeclaration */ ? ts.factory.createMethodDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) : - kind === 166 /* Constructor */ ? ts.factory.createConstructorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, /*body*/ undefined) : - kind === 167 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) : - kind === 168 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, /*body*/ undefined) : - kind === 171 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, returnTypeNode) : - kind === 308 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) : - kind === 174 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : - kind === 175 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : - kind === 251 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) : - kind === 208 /* FunctionExpression */ ? ts.factory.createFunctionExpression(options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) : - kind === 209 /* ArrowFunction */ ? ts.factory.createArrowFunction(options === null || options === void 0 ? void 0 : options.modifiers, typeParameters, parameters, returnTypeNode, /*equalsGreaterThanToken*/ undefined, ts.factory.createBlock([])) : + var node = kind === 168 /* CallSignature */ ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) : + kind === 169 /* ConstructSignature */ ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : + kind === 163 /* MethodSignature */ ? ts.factory.createMethodSignature(options === null || options === void 0 ? void 0 : options.modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : + kind === 164 /* MethodDeclaration */ ? ts.factory.createMethodDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) : + kind === 165 /* Constructor */ ? ts.factory.createConstructorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, /*body*/ undefined) : + kind === 166 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) : + kind === 167 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, /*body*/ undefined) : + kind === 170 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, returnTypeNode) : + kind === 304 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) : + kind === 173 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : + kind === 174 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : + kind === 248 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) : + kind === 205 /* FunctionExpression */ ? ts.factory.createFunctionExpression(options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) : + kind === 206 /* ArrowFunction */ ? ts.factory.createArrowFunction(options === null || options === void 0 ? void 0 : options.modifiers, typeParameters, parameters, returnTypeNode, /*equalsGreaterThanToken*/ undefined, ts.factory.createBlock([])) : ts.Debug.assertNever(kind); if (typeArguments) { node.typeArguments = ts.factory.createNodeArray(typeArguments); @@ -48125,9 +46920,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 160 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 159 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 326 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 322 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -48142,7 +46937,7 @@ var ts; var dotDotDotToken = isRest ? ts.factory.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 78 /* Identifier */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 157 /* QualifiedName */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 156 /* QualifiedName */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -48307,11 +47102,11 @@ var ts; } function getSpecifierForModuleSymbol(symbol, context) { var _a; - var file = ts.getDeclarationOfKind(symbol, 297 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 294 /* SourceFile */); if (!file) { var equivalentFileSymbol = ts.firstDefined(symbol.declarations, function (d) { return getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol); }); if (equivalentFileSymbol) { - file = ts.getDeclarationOfKind(equivalentFileSymbol, 297 /* SourceFile */); + file = ts.getDeclarationOfKind(equivalentFileSymbol, 294 /* SourceFile */); } } if (file && file.moduleName !== undefined) { @@ -48350,7 +47145,7 @@ var ts; // specifier preference var moduleResolverHost = context.tracker.moduleResolverHost; var specifierCompilerOptions = isBundle_1 ? __assign(__assign({}, compilerOptions), { baseUrl: moduleResolverHost.getCommonSourceDirectory() }) : compilerOptions; - specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative", importModuleSpecifierEnding: isBundle_1 ? "minimal" : undefined })); + specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative" })); (_a = links.specifierCache) !== null && _a !== void 0 ? _a : (links.specifierCache = new ts.Map()); links.specifierCache.set(contextFile.path, specifier); } @@ -48656,7 +47451,7 @@ var ts; } var oldFlags = context.flags; if (type.flags & 8192 /* UniqueESSymbol */ && - type.symbol === symbol && (!context.enclosingDeclaration || ts.some(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === ts.getSourceFileOfNode(context.enclosingDeclaration); }))) { + type.symbol === symbol) { context.flags |= 1048576 /* AllowUniqueESSymbolType */; } var result = typeToTypeNodeHelper(type, context); @@ -48689,17 +47484,17 @@ var ts; function visitExistingNodeTreeSymbols(node) { var _a, _b; // We don't _actually_ support jsdoc namepath types, emit `any` instead - if (ts.isJSDocAllType(node) || node.kind === 310 /* JSDocNamepathType */) { + if (ts.isJSDocAllType(node) || node.kind === 306 /* JSDocNamepathType */) { return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */); + return ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createLiteralTypeNode(ts.factory.createNull())]); } if (ts.isJSDocOptionalType(node)) { - return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)]); + return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -48813,8 +47608,8 @@ var ts; } } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 165 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 164 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 164 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 163 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -49093,50 +47888,38 @@ var ts; if (textRange && ts.isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) { textRange = textRange.parent.parent; } - var propertyAccessRequire = ts.find(symbol.declarations, ts.isPropertyAccessExpression); - if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right) - && type.symbol && ts.isSourceFile(type.symbol.valueDeclaration)) { - var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right; + var statement = ts.setTextRange(ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ + ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) + ], flags)), textRange); + addResult(statement, name !== localName ? modifierFlags & ~1 /* Export */ : modifierFlags); + if (name !== localName && !isPrivate) { + // We rename the variable declaration we generate for Property symbols since they may have a name which + // conflicts with a local declaration. For example, given input: + // ``` + // function g() {} + // module.exports.g = g + // ``` + // In such a situation, we have a local variable named `g`, and a separate exported variable named `g`. + // Naively, we would emit + // ``` + // function g() {} + // export const g: typeof g; + // ``` + // That's obviously incorrect - the `g` in the type annotation needs to refer to the local `g`, but + // the export declaration shadows it. + // To work around that, we instead write + // ``` + // function g() {} + // const g_1: typeof g; + // export { g_1 as g }; + // ``` + // To create an export named `g` that does _not_ shadow the local `g` addResult(ts.factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(alias, localName)])), 0 /* None */); - context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551 /* Value */); - } - else { - var statement = ts.setTextRange(ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ - ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) - ], flags)), textRange); - addResult(statement, name !== localName ? modifierFlags & ~1 /* Export */ : modifierFlags); - if (name !== localName && !isPrivate) { - // We rename the variable declaration we generate for Property symbols since they may have a name which - // conflicts with a local declaration. For example, given input: - // ``` - // function g() {} - // module.exports.g = g - // ``` - // In such a situation, we have a local variable named `g`, and a separate exported variable named `g`. - // Naively, we would emit - // ``` - // function g() {} - // export const g: typeof g; - // ``` - // That's obviously incorrect - the `g` in the type annotation needs to refer to the local `g`, but - // the export declaration shadows it. - // To work around that, we instead write - // ``` - // function g() {} - // const g_1: typeof g; - // export { g_1 as g }; - // ``` - // To create an export named `g` that does _not_ shadow the local `g` - addResult(ts.factory.createExportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, - /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0 /* None */); - needsExportDeclaration = false; - needsPostExportDefault = false; - } + /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0 /* None */); + needsExportDeclaration = false; + needsPostExportDefault = false; } } } @@ -49158,8 +47941,7 @@ var ts; if ((symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && (!isConstMergedWithNS || isTypeOnlyNamespace(symbol))) || isConstMergedWithNSPrintableAsSignatureMerge) { serializeModule(symbol, symbolName, modifierFlags); } - // The class meaning serialization should handle serializing all interface members - if (symbol.flags & 64 /* Interface */ && !(symbol.flags & 32 /* Class */)) { + if (symbol.flags & 64 /* Interface */) { serializeInterface(symbol, symbolName, modifierFlags); } if (symbol.flags & 2097152 /* Alias */) { @@ -49254,8 +48036,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 169 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 170 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 168 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 169 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.factory.createHeritageClause(93 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b, 111551 /* Value */); }))]; addResult(ts.factory.createInterfaceDeclaration( @@ -49324,7 +48106,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 251 /* FunctionDeclaration */, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); + var decl = signatureToSignatureDeclarationHelper(sig, 248 /* FunctionDeclaration */, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); // for expressions assigned to `var`s, use the `var` as the text range addResult(ts.setTextRange(decl, sig.declaration && ts.isVariableDeclaration(sig.declaration.parent) && sig.declaration.parent.parent || sig.declaration), modifierFlags); } @@ -49387,7 +48169,7 @@ var ts; } function isNamespaceMember(p) { return !!(p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) || - !(p.flags & 4194304 /* Prototype */ || p.escapedName === "prototype" || p.valueDeclaration && ts.getEffectiveModifierFlags(p.valueDeclaration) & 32 /* Static */ && ts.isClassLike(p.valueDeclaration.parent)); + !(p.flags & 4194304 /* Prototype */ || p.escapedName === "prototype" || p.valueDeclaration && ts.isClassLike(p.valueDeclaration.parent)); } function serializeAsClass(symbol, localName, modifierFlags) { var _a; @@ -49438,14 +48220,13 @@ var ts; !ts.some(getSignaturesOfType(staticType, 1 /* Construct */)); var constructors = isNonConstructableClassLikeInJsFile ? [ts.factory.createConstructorDeclaration(/*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags(8 /* Private */), [], /*body*/ undefined)] : - serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 166 /* Constructor */); + serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 165 /* Constructor */); var indexSignatures = serializeIndexSignatures(classType, baseTypes[0]); addResult(ts.setTextRange(ts.factory.createClassDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, localName, typeParamDecls, heritageClauses, __spreadArrays(indexSignatures, staticMembers, constructors, publicProperties, privateProperties)), symbol.declarations && ts.filter(symbol.declarations, function (d) { return ts.isClassDeclaration(d) || ts.isClassExpression(d); })[0]), modifierFlags); } function serializeAsAlias(symbol, localName, modifierFlags) { - var _a, _b, _c, _d, _e; // synthesize an alias, eg `export { symbolName as Name }` // need to mark the alias `symbol` points at // as something we need to serialize as a private declaration as well @@ -49464,66 +48245,23 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 198 /* BindingElement */: - if (((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.kind) === 249 /* VariableDeclaration */) { - // const { SomeClass } = require('./lib'); - var specifier_1 = getSpecifierForModuleSymbol(target.parent || target, context); // './lib' - var propertyName = node.propertyName; - addResult(ts.factory.createImportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1)), 0 /* None */); - break; - } - // We don't know how to serialize this (nested?) binding element - ts.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization"); - break; - case 289 /* ShorthandPropertyAssignment */: - if (((_e = (_d = node.parent) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.kind) === 216 /* BinaryExpression */) { - // module.exports = { SomeClass } - serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), targetName); - } - break; - case 249 /* VariableDeclaration */: - // commonjs require: const x = require('y') - if (ts.isPropertyAccessExpression(node.initializer)) { - // const x = require('y').z - var initializer = node.initializer; // require('y').z - var uniqueName = ts.factory.createUniqueName(localName); // _x - var specifier_2 = getSpecifierForModuleSymbol(target.parent || target, context); // 'y' - // import _x = require('y'); - addResult(ts.factory.createImportEqualsDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, uniqueName, ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(specifier_2))), 0 /* None */); - // import x = _x.z - addResult(ts.factory.createImportEqualsDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.factory.createIdentifier(localName), ts.factory.createQualifiedName(uniqueName, initializer.name)), modifierFlags); - break; - } - // else fall through and treat commonjs require just like import= - case 260 /* ImportEqualsDeclaration */: - // This _specifically_ only exists to handle json declarations - where we make aliases, but since - // we emit no declarations for the json document, must not refer to it in the declarations - if (target.escapedName === "export=" /* ExportEquals */ && ts.some(target.declarations, ts.isJsonSourceFile)) { - serializeMaybeAliasAssignment(symbol); - break; - } + case 257 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` - var isLocalImport = !(target.flags & 512 /* ValueModule */) && !ts.isVariableDeclaration(node); + var isLocalImport = !(target.flags & 512 /* ValueModule */); addResult(ts.factory.createImportEqualsDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createIdentifier(localName), isLocalImport ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) - : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))), isLocalImport ? modifierFlags : 0 /* None */); + : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.factory.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, ts.factory.createIdentifier(localName), /*namedBindings*/ undefined), @@ -49532,18 +48270,18 @@ var ts; // In such cases, the `target` refers to the module itself already ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*importClause*/ undefined, ts.factory.createNamespaceImport(ts.factory.createIdentifier(localName))), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: addResult(ts.factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, ts.factory.createNamespaceExport(ts.factory.createIdentifier(localName)), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause( @@ -49552,7 +48290,7 @@ var ts; ts.factory.createImportSpecifier(localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName)) ])), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -49560,12 +48298,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.factory.createStringLiteral(specifier.text) : undefined); break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 216 /* BinaryExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 213 /* BinaryExpression */: + case 198 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -49596,7 +48333,7 @@ var ts; var name = ts.unescapeLeadingUnderscores(symbol.escapedName); var isExportEquals = name === "export=" /* ExportEquals */; var isDefault = name === "default" /* Default */; - var isExportAssignmentCompatibleSymbolName = isExportEquals || isDefault; + var isExportAssignment = isExportEquals || isDefault; // synthesize export = ref // ref should refer to either be a locally scoped symbol which we need to emit, or // a reference to another namespace/module which we may need to emit an `import` statement for @@ -49608,8 +48345,8 @@ var ts; // In case `target` refers to a namespace member, look at the declaration and serialize the leftmost symbol in it // eg, `namespace A { export class B {} }; exports = A.B;` // Technically, this is all that's required in the case where the assignment is an entity name expression - var expr = aliasDecl && ((ts.isExportAssignment(aliasDecl) || ts.isBinaryExpression(aliasDecl)) ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl)); - var first_1 = expr && ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; + var expr = isExportAssignment ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl); + var first_1 = ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; var referenced = first_1 && resolveEntityName(first_1, 67108863 /* All */, /*ignoreErrors*/ true, /*dontResolveAlias*/ true, enclosingDeclaration); if (referenced || target) { includePrivateSymbol(referenced || target); @@ -49621,17 +48358,17 @@ var ts; // into the containing scope anyway, so we want to skip the visibility checks. var oldTrack = context.tracker.trackSymbol; context.tracker.trackSymbol = ts.noop; - if (isExportAssignmentCompatibleSymbolName) { + if (isExportAssignment) { results.push(ts.factory.createExportAssignment( /*decorators*/ undefined, /*modifiers*/ undefined, isExportEquals, symbolToExpression(target, context, 67108863 /* All */))); } else { - if (first_1 === expr && first_1) { + if (first_1 === expr) { // serialize as `export {target as name}` serializeExportSpecifier(name, ts.idText(first_1)); } - else if (expr && ts.isClassExpression(expr)) { + else if (ts.isClassExpression(expr)) { serializeExportSpecifier(name, getInternalSymbolName(target, ts.symbolName(target))); } else { @@ -49654,19 +48391,15 @@ var ts; var typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol))); if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) { // If there are no index signatures and `typeToSerialize` is an object type, emit as a namespace instead of a const - serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 1 /* Export */); + serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignment ? 0 /* None */ : 1 /* Export */); } else { var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ ts.factory.createVariableDeclaration(varName, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) ], 2 /* Const */)); - // Inlined JSON types exported with [module.]exports= will already emit an export=, so should use `declare`. - // Otherwise, the type itself should be exported. - addResult(statement, target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ? 2 /* Ambient */ - : name === varName ? 1 /* Export */ - : 0 /* None */); + addResult(statement, name === varName ? 1 /* Export */ : 0 /* None */); } - if (isExportAssignmentCompatibleSymbolName) { + if (isExportAssignment) { results.push(ts.factory.createExportAssignment( /*decorators*/ undefined, /*modifiers*/ undefined, isExportEquals, ts.factory.createIdentifier(varName))); @@ -49687,8 +48420,7 @@ var ts; return ts.getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !getIndexInfoOfType(typeToSerialize, 0 /* String */) && !getIndexInfoOfType(typeToSerialize, 1 /* Number */) && - !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class - !!(ts.length(ts.filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || ts.length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && + !!(ts.length(getPropertiesOfType(typeToSerialize)) || ts.length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !ts.length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && ts.some(typeToSerialize.symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== ctxSrc; })) && @@ -49736,7 +48468,7 @@ var ts; } // This is an else/if as accessors and properties can't merge in TS, but might in JS // If this happens, we assume the accessor takes priority, as it imposes more constraints - else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) { + else if (p.flags & (4 /* Property */ | 3 /* Variable */)) { return ts.setTextRange(createProperty( /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined, isPrivate ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357 @@ -49979,7 +48711,7 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = ts.walkUpParenthesizedTypes(type.symbol.declarations[0].parent); - if (node.kind === 254 /* TypeAliasDeclaration */) { + if (node.kind === 251 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -49987,11 +48719,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 257 /* ModuleBlock */ && + node.parent.kind === 254 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 297 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 294 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -50050,17 +48782,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 249 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 246 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 221 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 218 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -50077,28 +48809,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 325 /* JSDocEnumTag */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 321 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 251 /* FunctionDeclaration */: - case 255 /* EnumDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 248 /* FunctionDeclaration */: + case 252 /* EnumDeclaration */: + case 257 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -50106,55 +48838,55 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 260 /* ImportEqualsDeclaration */ && parent.kind !== 297 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 257 /* ImportEqualsDeclaration */ && parent.kind !== 294 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasEffectiveModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 166 /* Constructor */: - case 170 /* ConstructSignature */: - case 169 /* CallSignature */: - case 171 /* IndexSignature */: - case 160 /* Parameter */: - case 257 /* ModuleBlock */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 177 /* TypeLiteral */: - case 173 /* TypeReference */: - case 178 /* ArrayType */: - case 179 /* TupleType */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: + case 165 /* Constructor */: + case 169 /* ConstructSignature */: + case 168 /* CallSignature */: + case 170 /* IndexSignature */: + case 159 /* Parameter */: + case 254 /* ModuleBlock */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 176 /* TypeLiteral */: + case 172 /* TypeReference */: + case 177 /* ArrayType */: + case 178 /* TupleType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: return false; // Type parameters are always visible - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 297 /* SourceFile */: - case 259 /* NamespaceExportDeclaration */: + case 294 /* SourceFile */: + case 256 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return false; default: return false; @@ -50163,10 +48895,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 266 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 263 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 270 /* ExportSpecifier */) { + else if (node.parent.kind === 267 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -50271,12 +49003,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 249 /* VariableDeclaration */: - case 250 /* VariableDeclarationList */: - case 265 /* ImportSpecifier */: - case 264 /* NamedImports */: - case 263 /* NamespaceImport */: - case 262 /* ImportClause */: + case 246 /* VariableDeclaration */: + case 247 /* VariableDeclarationList */: + case 262 /* ImportSpecifier */: + case 261 /* NamedImports */: + case 260 /* NamespaceImport */: + case 259 /* ImportClause */: return false; default: return true; @@ -50361,13 +49093,9 @@ var ts; var propName = getDestructuringPropertyName(node); if (propName) { var literal = ts.setTextRange(ts.parseNodeFactory.createStringLiteral(propName), node); - var lhsExpr = ts.isLeftHandSideExpression(parentAccess) ? parentAccess : ts.parseNodeFactory.createParenthesizedExpression(parentAccess); - var result = ts.setTextRange(ts.parseNodeFactory.createElementAccessExpression(lhsExpr, literal), node); + var result = ts.setTextRange(ts.parseNodeFactory.createElementAccessExpression(parentAccess, literal), node); ts.setParent(literal, result); ts.setParent(result, node); - if (lhsExpr !== parentAccess) { - ts.setParent(lhsExpr, result); - } result.flowNode = parentAccess.flowNode; return result; } @@ -50376,23 +49104,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 198 /* BindingElement */: - case 288 /* PropertyAssignment */: + case 195 /* BindingElement */: + case 285 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ancestor.initializer; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 198 /* BindingElement */ && parent.kind === 196 /* ObjectBindingPattern */) { + if (node.kind === 195 /* BindingElement */ && parent.kind === 193 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 288 /* PropertyAssignment */ || node.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.kind === 285 /* PropertyAssignment */ || node.kind === 286 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -50418,7 +49146,7 @@ var ts; parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); } var type; - if (pattern.kind === 196 /* ObjectBindingPattern */) { + if (pattern.kind === 193 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -50438,7 +49166,7 @@ var ts; // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name = declaration.propertyName || declaration.name; var indexType = getLiteralTypeFromPropertyName(name); - var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */), declaration.name); + var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, name), declaration.name); type = getFlowTypeOfDestructuring(declaration, declaredType); } } @@ -50446,7 +49174,7 @@ var ts; // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern); + var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */, parentType, undefinedType, pattern); var index_2 = pattern.elements.indexOf(declaration); if (declaration.dotDotDotToken) { // If the parent is a tuple type, the rest element has a tuple type of the @@ -50459,7 +49187,7 @@ var ts; else if (isArrayLikeType(parentType)) { var indexType = getLiteralType(index_2); var accessFlags = hasDefaultValue(declaration) ? 8 /* NoTupleBoundsCheck */ : 0; - var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, declaration.name, accessFlags | 16 /* ExpressionPosition */) || errorType, declaration.name); + var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, declaration.name, accessFlags) || errorType, declaration.name); type = getFlowTypeOfDestructuring(declaration, declaredType); } else { @@ -50491,7 +49219,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 199 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 196 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -50501,11 +49229,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 238 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 235 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 236 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -50542,8 +49270,8 @@ var ts; if (ts.isParameter(declaration)) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 168 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 167 /* GetAccessor */); + if (func.kind === 167 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 166 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -50610,11 +49338,10 @@ var ts; if (symbol.valueDeclaration && ts.isBinaryExpression(symbol.valueDeclaration)) { var links = getSymbolLinks(symbol); if (links.isConstructorDeclaredProperty === undefined) { - links.isConstructorDeclaredProperty = false; links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && ts.every(symbol.declarations, function (declaration) { return ts.isBinaryExpression(declaration) && - isPossiblyAliasedThisProperty(declaration) && - (declaration.left.kind !== 202 /* ElementAccessExpression */ || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && + ts.getAssignmentDeclarationKind(declaration) === 4 /* ThisProperty */ && + (declaration.left.kind !== 199 /* ElementAccessExpression */ || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(/*declaredType*/ undefined, declaration, symbol, declaration); }); } @@ -50633,16 +49360,13 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; var container = ts.getThisContainer(declaration, /*includeArrowFunctions*/ false); - if (container && (container.kind === 166 /* Constructor */ || isJSConstructor(container))) { + if (container && (container.kind === 165 /* Constructor */ || isJSConstructor(container))) { return container; } } } function getFlowTypeInConstructor(symbol, constructor) { - var accessName = ts.startsWith(symbol.escapedName, "__#") - ? ts.factory.createPrivateIdentifier(symbol.escapedName.split("@")[1]) - : ts.unescapeLeadingUnderscores(symbol.escapedName); - var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), accessName); + var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), ts.unescapeLeadingUnderscores(symbol.escapedName)); ts.setParent(reference.expression, reference); ts.setParent(reference, constructor); reference.flowNode = constructor.returnFlowNode; @@ -50690,7 +49414,7 @@ var ts; var kind = ts.isAccessExpression(expression) ? ts.getAssignmentDeclarationPropertyAccessKind(expression) : ts.getAssignmentDeclarationKind(expression); - if (kind === 4 /* ThisProperty */ || ts.isBinaryExpression(expression) && isPossiblyAliasedThisProperty(expression, kind)) { + if (kind === 4 /* ThisProperty */) { if (isDeclarationInConstructor(expression)) { definedInConstructor = true; } @@ -50807,7 +49531,6 @@ var ts; var exportedType = resolveStructuredTypeMembers(type); var members_4 = ts.createSymbolTable(); ts.copyEntries(exportedType.members, members_4); - var initialSize = members_4.size; if (resolvedSymbol && !resolvedSymbol.exports) { resolvedSymbol.exports = ts.createSymbolTable(); } @@ -50846,12 +49569,8 @@ var ts; members_4.set(name, s); } }); - var result = createAnonymousType(initialSize !== members_4.size ? undefined : exportedType.symbol, // Only set the type's symbol if it looks to be the same as the original type - members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo); + var result = createAnonymousType(exportedType.symbol, members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo); result.objectFlags |= (ts.getObjectFlags(type) & 16384 /* JSLiteral */); // Propagate JSLiteral flag - if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) { - result.objectFlags |= 1073741824 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type - } return result; } if (isEmptyArrayLiteralType(type)) { @@ -50869,9 +49588,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 166 /* Constructor */ || - thisContainer.kind === 251 /* FunctionDeclaration */ || - (thisContainer.kind === 208 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 165 /* Constructor */ || + thisContainer.kind === 248 /* FunctionDeclaration */ || + (thisContainer.kind === 205 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -50941,7 +49660,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var restElement = lastElement && lastElement.kind === 198 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : undefined; + var restElement = lastElement && lastElement.kind === 195 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : undefined; if (elements.length === 0 || elements.length === 1 && restElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -50966,7 +49685,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 196 /* ObjectBindingPattern */ + return pattern.kind === 193 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -51005,7 +49724,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 160 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 159 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -51068,7 +49787,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 266 /* ExportAssignment */) { + if (declaration.kind === 263 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -51139,7 +49858,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 167 /* GetAccessor */) { + if (accessor.kind === 166 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -51173,15 +49892,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 166 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 168 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 166 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 167 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -51232,9 +49951,9 @@ var ts; var links = getSymbolLinks(symbol); var originalLinks = links; if (!links.type) { - var expando = symbol.valueDeclaration && getSymbolOfExpando(symbol.valueDeclaration, /*allowDeclaration*/ false); - if (expando) { - var merged = mergeJSSymbols(symbol, expando); + var jsDeclaration = symbol.valueDeclaration && ts.getDeclarationOfExpando(symbol.valueDeclaration); + if (jsDeclaration) { + var merged = mergeJSSymbols(symbol, getSymbolOfNode(jsDeclaration)); if (merged) { // note:we overwrite links because we just cloned the symbol symbol = links = merged; @@ -51249,9 +49968,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration && (declaration.kind === 216 /* BinaryExpression */ || + else if (declaration && (declaration.kind === 213 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 216 /* BinaryExpression */)) { + declaration.parent.kind === 213 /* BinaryExpression */)) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -51318,7 +50037,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 160 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 159 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -51417,43 +50136,43 @@ var ts; return undefined; } switch (node.kind) { - case 232 /* VariableStatement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 308 /* JSDocFunctionType */: - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: - case 331 /* JSDocTypedefTag */: - case 325 /* JSDocEnumTag */: - case 324 /* JSDocCallbackTag */: - case 190 /* MappedType */: - case 184 /* ConditionalType */: + case 229 /* VariableStatement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 304 /* JSDocFunctionType */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: + case 327 /* JSDocTypedefTag */: + case 321 /* JSDocEnumTag */: + case 320 /* JSDocCallbackTag */: + case 189 /* MappedType */: + case 183 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 190 /* MappedType */) { + if (node.kind === 189 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 184 /* ConditionalType */) { + else if (node.kind === 183 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } - else if (node.kind === 232 /* VariableStatement */ && !ts.isInJSFile(node)) { + else if (node.kind === 229 /* VariableStatement */ && !ts.isInJSFile(node)) { break; } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */ || node.kind === 253 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */ || node.kind === 250 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: var paramSymbol = ts.getParameterSymbolFromJSDoc(node); if (paramSymbol) { node = paramSymbol.valueDeclaration; @@ -51464,7 +50183,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 250 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -51474,9 +50193,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 253 /* InterfaceDeclaration */ || - node.kind === 252 /* ClassDeclaration */ || - node.kind === 221 /* ClassExpression */ || + if (node.kind === 250 /* InterfaceDeclaration */ || + node.kind === 249 /* ClassDeclaration */ || + node.kind === 218 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -51620,7 +50339,7 @@ var ts; if (!popTypeResolution()) { for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 252 /* ClassDeclaration */ || declaration.kind === 253 /* InterfaceDeclaration */) { + if (declaration.kind === 249 /* ClassDeclaration */ || declaration.kind === 250 /* InterfaceDeclaration */) { reportCircularBaseType(declaration, type); } } @@ -51715,7 +50434,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 253 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 250 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -51751,7 +50470,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 253 /* InterfaceDeclaration */) { + if (declaration.kind === 250 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -51839,7 +50558,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 216 /* BinaryExpression */) { + else if (expr.kind === 213 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -51854,12 +50573,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 78 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -51873,7 +50592,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 255 /* EnumDeclaration */) { + if (declaration.kind === 252 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -51900,7 +50619,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 255 /* EnumDeclaration */) { + if (declaration.kind === 252 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -51973,21 +50692,21 @@ var ts; function isThislessType(node) { switch (node.kind) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: - case 145 /* ObjectKeyword */: + case 147 /* SymbolKeyword */: + case 144 /* ObjectKeyword */: case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: - case 191 /* LiteralType */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: + case 190 /* LiteralType */: return true; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return isThislessType(node.elementType); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -52013,7 +50732,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 166 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 165 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -52029,14 +50748,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -52241,7 +50960,7 @@ var ts; links[resolutionKind] = earlySymbols || emptySymbols; // fill in any as-yet-unresolved late-bound members. var lateSymbols = ts.createSymbolTable(); - for (var _i = 0, _a = symbol.declarations || ts.emptyArray; _i < _a.length; _i++) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var members = ts.getMembersOfDeclaration(decl); if (members) { @@ -52260,7 +50979,7 @@ var ts; var member = decls_1[_c]; var assignmentKind = ts.getAssignmentDeclarationKind(member); var isInstanceMember = assignmentKind === 3 /* PrototypeProperty */ - || ts.isBinaryExpression(member) && isPossiblyAliasedThisProperty(member, assignmentKind) + || assignmentKind === 4 /* ThisProperty */ || assignmentKind === 9 /* ObjectDefinePrototypeProperty */ || assignmentKind === 6 /* Prototype */; // A straight `Prototype` assignment probably can never have a computed name if (isStatic === !isInstanceMember && hasLateBindableName(member)) { @@ -52383,7 +51102,6 @@ var ts; sig.resolvedReturnType = resolvedReturnType; sig.resolvedTypePredicate = resolvedTypePredicate; sig.minArgumentCount = minArgumentCount; - sig.resolvedMinArgumentCount = undefined; sig.target = undefined; sig.mapper = undefined; sig.unionSignatures = undefined; @@ -52627,8 +51345,8 @@ var ts; function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; - for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { - var type = types_4[_i]; + for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { + var type = types_3[_i]; var indexInfo = getIndexInfoOfType(getApparentType(type), kind); if (!indexInfo) { return undefined; @@ -52827,6 +51545,9 @@ var ts; // bound includes those keys that are known to always be present, for example because // because of constraints on type parameters (e.g. 'keyof T' for a constrained T). function getLowerBoundOfKeyType(type) { + if (type.flags & (1 /* Any */ | 131068 /* Primitive */)) { + return type; + } if (type.flags & 4194304 /* Index */) { var t = getApparentType(type.type); return isGenericTupleType(t) ? getKnownKeysOfTupleType(t) : getIndexType(t); @@ -52847,7 +51568,7 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return getIntersectionType(ts.sameMap(type.types, getLowerBoundOfKeyType)); } - return type; + return neverType; } /** Resolve the members of a mapped type { [P in K]: T } */ function resolveMappedTypeMembers(type) { @@ -52860,7 +51581,6 @@ var ts; // and T as the template type. var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); - var nameType = getNameTypeFromMappedType(type.target || type); var templateType = getTemplateTypeFromMappedType(type.target || type); var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' var templateModifiers = getMappedTypeModifiers(type); @@ -52882,25 +51602,25 @@ var ts; forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType); } setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); - function addMemberForKeyType(keyType) { - var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType; - forEachType(propNameType, function (t) { return addMemberForKeyTypeWorker(keyType, t); }); - } - function addMemberForKeyTypeWorker(keyType, propNameType) { + function addMemberForKeyType(t) { + // Create a mapper from T to the current iteration type constituent. Then, if the + // mapped type is itself an instantiated type, combine the iteration mapper with the + // instantiation mapper. + var templateMapper = appendTypeMapping(type.mapper, typeParameter, t); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. - if (isTypeUsableAsPropertyName(propNameType)) { - var propName = getPropertyNameFromType(propNameType); + if (isTypeUsableAsPropertyName(t)) { + var propName = getPropertyNameFromType(t); // String enum members from separate enums with identical values // are distinct types with the same property name. Make the resulting // property symbol's name type be the union of those enum member types. var existingProp = members.get(propName); if (existingProp) { - existingProp.nameType = getUnionType([existingProp.nameType, propNameType]); - existingProp.keyType = getUnionType([existingProp.keyType, keyType]); + existingProp.nameType = getUnionType([existingProp.nameType, t]); + existingProp.mapper = appendTypeMapping(type.mapper, typeParameter, existingProp.nameType); } else { - var modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : undefined; + var modifiersProp = getPropertyOfType(modifiersType, propName); var isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */); var isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || @@ -52908,19 +51628,19 @@ var ts; var stripOptional = strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */; var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0)); prop.mappedType = type; - prop.nameType = propNameType; - prop.keyType = keyType; if (modifiersProp) { prop.syntheticOrigin = modifiersProp; prop.declarations = modifiersProp.declarations; } + prop.nameType = t; + prop.mapper = templateMapper; members.set(propName, prop); } } - else if (propNameType.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 32 /* Enum */)) { - var propType = instantiateType(templateType, appendTypeMapping(type.mapper, typeParameter, keyType)); - if (propNameType.flags & (1 /* Any */ | 4 /* String */)) { - stringIndexInfo = createIndexInfo(stringIndexInfo ? getUnionType([stringIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */)); + else if (t.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 32 /* Enum */)) { + var propType = instantiateType(templateType, templateMapper); + if (t.flags & (1 /* Any */ | 4 /* String */)) { + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1 /* IncludeReadonly */)); } else { numberIndexInfo = createIndexInfo(numberIndexInfo ? getUnionType([numberIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */)); @@ -52930,14 +51650,12 @@ var ts; } function getTypeOfMappedSymbol(symbol) { if (!symbol.type) { - var mappedType = symbol.mappedType; if (!pushTypeResolution(symbol, 0 /* Type */)) { - mappedType.containsError = true; + symbol.mappedType.containsError = true; return errorType; } - var templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType); - var mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.keyType); - var propType = instantiateType(templateType, mapper); + var templateType = getTemplateTypeFromMappedType(symbol.mappedType.target || symbol.mappedType); + var propType = instantiateType(templateType, symbol.mapper); // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks // mode, if the underlying property is optional we remove 'undefined' from the type. @@ -52945,10 +51663,11 @@ var ts; symbol.checkFlags & 524288 /* StripOptional */ ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType; if (!popTypeResolution()) { - error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType)); + error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(symbol.mappedType)); type = errorType; } symbol.type = type; + symbol.mapper = undefined; } return symbol.type; } @@ -52960,11 +51679,6 @@ var ts; return type.constraintType || (type.constraintType = getConstraintOfTypeParameter(getTypeParameterFromMappedType(type)) || errorType); } - function getNameTypeFromMappedType(type) { - return type.declaration.nameType ? - type.nameType || (type.nameType = instantiateType(getTypeFromTypeNode(type.declaration.nameType), type.mapper)) : - undefined; - } function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? @@ -52976,8 +51690,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 188 /* TypeOperator */ && - constraintDeclaration.operator === 138 /* KeyOfKeyword */; + return constraintDeclaration.kind === 187 /* TypeOperator */ && + constraintDeclaration.operator === 137 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -53111,8 +51825,8 @@ var ts; return getAugmentedPropertiesOfType(unionType); } var props = ts.createSymbolTable(); - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var memberType = types_5[_i]; + for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { + var memberType = types_4[_i]; for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) { var escapedName = _b[_a].escapedName; if (!props.has(escapedName)) { @@ -53144,14 +51858,14 @@ var ts; function getConstraintFromIndexedAccess(type) { var indexConstraint = getSimplifiedTypeOrConstraint(type.indexType); if (indexConstraint && indexConstraint !== type.indexType) { - var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.noUncheckedIndexedAccessCandidate); + var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint); if (indexedAccess) { return indexedAccess; } } var objectConstraint = getSimplifiedTypeOrConstraint(type.objectType); if (objectConstraint && objectConstraint !== type.objectType) { - return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType, type.noUncheckedIndexedAccessCandidate); + return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType); } return undefined; } @@ -53200,9 +51914,9 @@ var ts; function getEffectiveConstraintOfIntersection(types, targetIsUnion) { var constraints; var hasDisjointDomainType = false; - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var t = types_6[_i]; - if (t.flags & 465829888 /* Instantiable */) { + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var t = types_5[_i]; + if (t.flags & 63176704 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -53216,7 +51930,7 @@ var ts; } } } - else if (t.flags & 469892092 /* DisjointDomains */) { + else if (t.flags & 67238908 /* DisjointDomains */) { hasDisjointDomainType = true; } } @@ -53226,9 +51940,9 @@ var ts; if (hasDisjointDomainType) { // We add any types belong to one of the disjoint domains because they might cause the final // intersection operation to reduce the union constraints. - for (var _a = 0, types_7 = types; _a < types_7.length; _a++) { - var t = types_7[_a]; - if (t.flags & 469892092 /* DisjointDomains */) { + for (var _a = 0, types_6 = types; _a < types_6.length; _a++) { + var t = types_6[_a]; + if (t.flags & 67238908 /* DisjointDomains */) { constraints = ts.append(constraints, t); } } @@ -53238,7 +51952,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) { + if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -53260,12 +51974,9 @@ var ts; * circularly references the type variable. */ function getResolvedBaseConstraint(type) { - if (type.resolvedBaseConstraint) { - return type.resolvedBaseConstraint; - } var nonTerminating = false; - var stack = []; - return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type); + return type.resolvedBaseConstraint || + (type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type)); function getImmediateBaseConstraint(t) { if (!t.immediateBaseConstraint) { if (!pushTypeResolution(t, 4 /* ImmediateBaseConstraint */)) { @@ -53276,19 +51987,13 @@ var ts; // very high likelihood we're dealing with an infinite generic type that perpetually generates // new type identities as we descend into it. We stop the recursion here and mark this type // and the outer types as having circular constraints. - ts.tracing.instant("check" /* Check */, "getImmediateBaseConstraint_DepthLimit", { typeId: t.id, originalTypeId: type.id, depth: constraintDepth }); error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); nonTerminating = true; return t.immediateBaseConstraint = noConstraintType; } - var result = void 0; - if (!isDeeplyNestedType(t, stack, stack.length)) { - stack.push(t); - constraintDepth++; - result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false)); - constraintDepth--; - stack.pop(); - } + constraintDepth++; + var result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false)); + constraintDepth--; if (!popTypeResolution()) { if (t.flags & 262144 /* TypeParameter */) { var errorNode = getConstraintDeclaration(t); @@ -53322,8 +52027,8 @@ var ts; if (t.flags & 3145728 /* UnionOrIntersection */) { var types = t.types; var baseTypes = []; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var type_3 = types_8[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var type_3 = types_7[_i]; var baseType = getBaseConstraint(type_3); if (baseType) { baseTypes.push(baseType); @@ -53336,19 +52041,10 @@ var ts; if (t.flags & 4194304 /* Index */) { return keyofConstraintType; } - if (t.flags & 134217728 /* TemplateLiteral */) { - var types = t.types; - var constraints = ts.mapDefined(types, getBaseConstraint); - return constraints.length === types.length ? getTemplateLiteralType(t.texts, constraints) : stringType; - } - if (t.flags & 268435456 /* StringMapping */) { - var constraint = getBaseConstraint(t.type); - return constraint ? getStringMappingType(t.symbol, constraint) : stringType; - } if (t.flags & 8388608 /* IndexedAccess */) { var baseObjectType = getBaseConstraint(t.objectType); var baseIndexType = getBaseConstraint(t.indexType); - var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t.noUncheckedIndexedAccessCandidate); + var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType); return baseIndexedAccess && getBaseConstraint(baseIndexedAccess); } if (t.flags & 16777216 /* Conditional */) { @@ -53415,7 +52111,7 @@ var ts; } function getResolvedApparentTypeOfMappedType(type) { var typeVariable = getHomomorphicTypeVariable(type); - if (typeVariable && !type.declaration.nameType) { + if (typeVariable) { var constraint = getConstraintOfTypeParameter(typeVariable); if (constraint && (isArrayType(constraint) || isTupleType(constraint))) { return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper)); @@ -53429,10 +52125,10 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : - t.flags & 402653316 /* StringLike */ ? globalStringType : + t.flags & 132 /* StringLike */ ? globalStringType : t.flags & 296 /* NumberLike */ ? globalNumberType : t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType(/*reportErrors*/ languageVersion >= 7 /* ES2020 */) : t.flags & 528 /* BooleanLike */ ? globalBooleanType : @@ -53757,10 +52453,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 307 /* JSDocOptionalType */ + node.type && node.type.kind === 303 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 303 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -53779,10 +52475,7 @@ var ts; var signature = getSignatureFromDeclaration(node.parent); var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); - // Only consider syntactic or instantiated parameters as optional, not `void` parameters as this function is used - // in grammar checks and checking for `void` too early results in parameter types widening too early - // and causes some noImplicitAny errors to be lost. - return parameterIndex >= getMinArgumentCount(signature, 1 /* StrongArityForUntypedJS */ | 2 /* VoidIsNonOptional */); + return parameterIndex >= getMinArgumentCount(signature, /*strongArityForUntypedJS*/ true); } var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); if (iife) { @@ -53797,7 +52490,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 303 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -53879,7 +52572,7 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 191 /* LiteralType */) { + if (type && type.kind === 190 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter @@ -53892,16 +52585,16 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 167 /* GetAccessor */ || declaration.kind === 168 /* SetAccessor */) && + if ((declaration.kind === 166 /* GetAccessor */ || declaration.kind === 167 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + var otherKind = declaration.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 166 /* Constructor */ ? + var classType = declaration.kind === 165 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -53966,11 +52659,11 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - return node.name.kind === 158 /* ComputedPropertyName */ + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + return node.name.kind === 157 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -54042,7 +52735,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 187 /* ThisType */ ? + return parameterName.kind === 186 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -54085,7 +52778,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 166 /* Constructor */) { + if (declaration.kind === 165 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -54095,12 +52788,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 167 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 166 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 168 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 167 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -54190,7 +52883,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 166 /* Constructor */ || kind === 170 /* ConstructSignature */ || kind === 175 /* ConstructorType */; + var isConstructor = kind === 165 /* Constructor */ || kind === 169 /* ConstructSignature */ || kind === 174 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -54204,7 +52897,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 144 /* NumberKeyword */ : 147 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 143 /* NumberKeyword */ : 146 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -54238,17 +52931,17 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 185 /* InferType */) { + if (declaration.parent.kind === 184 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. - var _b = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _c = _b[0], childTypeParameter = _c === void 0 ? declaration.parent : _c, grandParent = _b[1]; - if (grandParent.kind === 173 /* TypeReference */) { + var grandParent = declaration.parent.parent; + if (grandParent.kind === 172 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { - var index = typeReference.typeArguments.indexOf(childTypeParameter); + var index = typeReference.typeArguments.indexOf(declaration.parent); if (index < typeParameters.length) { var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); if (declaredConstraint) { @@ -54269,16 +52962,11 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter declaration, a rest type // or a named rest tuple element, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 160 /* Parameter */ && grandParent.dotDotDotToken || - grandParent.kind === 181 /* RestType */ || - grandParent.kind === 192 /* NamedTupleMember */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 159 /* Parameter */ && grandParent.dotDotDotToken || + grandParent.kind === 180 /* RestType */ || + grandParent.kind === 191 /* NamedTupleMember */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } - // When an 'infer T' declaration is immediately contained in a string template type, we infer a 'string' - // constraint. - else if (grandParent.kind === 194 /* TemplateLiteralTypeSpan */) { - inferences = ts.append(inferences, stringType); - } } } } @@ -54301,7 +52989,7 @@ var ts; if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), // use unknown otherwise - type = constraintDeclaration.parent.parent.kind === 190 /* MappedType */ ? keyofConstraintType : unknownType; + type = constraintDeclaration.parent.parent.kind === 189 /* MappedType */ ? keyofConstraintType : unknownType; } typeParameter.constraint = type; } @@ -54310,7 +52998,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 159 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 158 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -54343,8 +53031,8 @@ var ts; // that care about the presence of such types at arbitrary depth in a containing type. function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var type = types_9[_i]; + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; if (!(type.flags & excludeKinds)) { result |= ts.getObjectFlags(type); } @@ -54390,8 +53078,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 173 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 172 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 177 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -54433,7 +53121,7 @@ var ts; return errorType; } } - if (node.kind === 173 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 172 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -54446,9 +53134,6 @@ var ts; } function getTypeAliasInstantiation(symbol, typeArguments) { var type = getDeclaredTypeOfSymbol(symbol); - if (type === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName) && typeArguments && typeArguments.length === 1) { - return getStringMappingType(symbol, typeArguments[0]); - } var links = getSymbolLinks(symbol); var typeParameters = links.typeParameters; var id = getTypeListId(typeArguments); @@ -54481,9 +53166,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -54531,7 +53216,8 @@ var ts; } /** * A JSdoc TypeReference may be to a value, but resolve it as a type anyway. - * Example: import('./b').ConstructorFunction + * Note: If the value is imported from commonjs, it should really be an alias, + * but this function's special-case code fakes alias resolution as well. */ function getTypeFromJSDocValueReference(node, symbol) { var links = getNodeLinks(node); @@ -54539,9 +53225,19 @@ var ts; var valueType = getTypeOfSymbol(symbol); var typeType = valueType; if (symbol.valueDeclaration) { - var isImportTypeWithQualifier = node.kind === 195 /* ImportType */ && node.qualifier; + var decl = ts.getRootDeclaration(symbol.valueDeclaration); + var isRequireAlias = false; + if (ts.isVariableDeclaration(decl) && decl.initializer) { + var expr = decl.initializer; + // skip past entity names, eg `require("x").a.b.c` + while (ts.isPropertyAccessExpression(expr)) { + expr = expr.expression; + } + isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; + } + var isImportTypeWithQualifier = node.kind === 192 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} - if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) { + if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); } } @@ -54565,7 +53261,7 @@ var ts; return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 179 /* TupleType */ && node.elements.length === 1; + return node.kind === 178 /* TupleType */ && node.elements.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) : @@ -54574,9 +53270,9 @@ var ts; } function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 311 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 307 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 184 /* ConditionalType */ && node === parent.trueType) { + if (parent.kind === 183 /* ConditionalType */ && node === parent.trueType) { var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); @@ -54587,7 +53283,7 @@ var ts; return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 173 /* TypeReference */ || node.kind === 195 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 172 /* TypeReference */ || node.kind === 192 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -54700,9 +53396,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: return declaration; } } @@ -54823,11 +53519,11 @@ var ts; } function getTupleElementFlags(node) { switch (node.kind) { - case 180 /* OptionalType */: + case 179 /* OptionalType */: return 2 /* Optional */; - case 181 /* RestType */: + case 180 /* RestType */: return getRestTypeElementFlags(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return node.questionToken ? 2 /* Optional */ : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1 /* Required */; @@ -54845,14 +53541,14 @@ var ts; return readonly ? globalReadonlyArrayType : globalArrayType; } var elementFlags = ts.map(node.elements, getTupleElementFlags); - var missingName = ts.some(node.elements, function (e) { return e.kind !== 192 /* NamedTupleMember */; }); + var missingName = ts.some(node.elements, function (e) { return e.kind !== 191 /* NamedTupleMember */; }); return getTupleTargetType(elementFlags, readonly, /*associatedNames*/ missingName ? undefined : node.elements); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 178 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 179 /* TupleType */ ? ts.some(node.elements, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 177 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 178 /* TupleType */ ? ts.some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -54861,18 +53557,18 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: - case 173 /* TypeReference */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 189 /* IndexedAccessType */: - case 184 /* ConditionalType */: - case 188 /* TypeOperator */: - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: + case 172 /* TypeReference */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 188 /* IndexedAccessType */: + case 183 /* ConditionalType */: + case 187 /* TypeOperator */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return isResolvedByTypeAlias(parent); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; } return false; @@ -54881,28 +53577,28 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return true; - case 188 /* TypeOperator */: - return node.operator !== 151 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 186 /* ParenthesizedType */: - case 180 /* OptionalType */: - case 192 /* NamedTupleMember */: - case 307 /* JSDocOptionalType */: - case 305 /* JSDocNullableType */: - case 306 /* JSDocNonNullableType */: - case 301 /* JSDocTypeExpression */: + case 187 /* TypeOperator */: + return node.operator !== 150 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 185 /* ParenthesizedType */: + case 179 /* OptionalType */: + case 191 /* NamedTupleMember */: + case 303 /* JSDocOptionalType */: + case 301 /* JSDocNullableType */: + case 302 /* JSDocNonNullableType */: + case 298 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 181 /* RestType */: - return node.type.kind !== 178 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 180 /* RestType */: + return node.type.kind !== 177 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 181 /* UnionType */: + case 182 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -54915,19 +53611,19 @@ var ts; if (target === emptyGenericType) { links.resolvedType = emptyObjectType; } - else if (!(node.kind === 179 /* TupleType */ && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8 /* Variadic */); })) && isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 179 /* TupleType */ && node.elements.length === 0 ? target : + else if (!(node.kind === 178 /* TupleType */ && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8 /* Variadic */); })) && isDeferredTypeReferenceNode(node)) { + links.resolvedType = node.kind === 178 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); + var elementTypes = node.kind === 177 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); links.resolvedType = createNormalizedTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 142 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 141 /* ReadonlyKeyword */; } function createTupleType(elementTypes, elementFlags, readonly, namedMemberDeclarations) { if (readonly === void 0) { readonly = false; } @@ -55024,9 +53720,7 @@ var ts; // Transform [A, ...(X | Y | Z)] into [A, ...X] | [A, ...Y] | [A, ...Z] var unionIndex = ts.findIndex(elementTypes, function (t, i) { return !!(target.elementFlags[i] & 8 /* Variadic */ && t.flags & (131072 /* Never */ | 1048576 /* Union */)); }); if (unionIndex >= 0) { - return checkCrossProductUnion(ts.map(elementTypes, function (t, i) { return target.elementFlags[i] & 8 /* Variadic */ ? t : unknownType; })) ? - mapType(elementTypes[unionIndex], function (t) { return createNormalizedTupleType(target, ts.replaceElement(elementTypes, unionIndex, t)); }) : - errorType; + return mapType(elementTypes[unionIndex], function (t) { return createNormalizedTupleType(target, ts.replaceElement(elementTypes, unionIndex, t)); }); } // If there are no variadic elements with non-generic types, just create a type reference with the same target type. var spreadIndex = ts.findIndex(elementTypes, function (t, i) { return !!(target.elementFlags[i] & 8 /* Variadic */) && !(t.flags & 58982400 /* InstantiableNonPrimitive */) && !isGenericMappedType(t); }); @@ -55140,8 +53834,8 @@ var ts; } // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { - includes |= flags & 205258751 /* IncludesMask */; - if (flags & 469499904 /* StructuredOrInstantiable */) + includes |= flags & 71041023 /* IncludesMask */; + if (flags & 66846720 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -55162,8 +53856,8 @@ var ts; // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. function addTypesToUnion(typeSet, includes, types) { - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var type = types_10[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var type = types_9[_i]; includes = addTypeToUnion(typeSet, includes, type); } return includes; @@ -55192,8 +53886,8 @@ var ts; while (i > 0) { i--; var source = types[i]; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var target = types_11[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var target = types_10[_i]; if (source !== target) { if (count === 100000) { // After 100000 subtype checks we estimate the remaining amount of work by assuming the @@ -55203,7 +53897,6 @@ var ts; // caps union types at 5000 unique literal types and 1000 unique object types. var estimatedCount = (count / (len - i)) * len; if (estimatedCount > (primitivesOnly ? 25000000 : 1000000)) { - ts.tracing.instant("check" /* Check */, "removeSubtypes_DepthLimit", { typeIds: types.map(function (t) { return t.id; }) }); error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return false; } @@ -55235,22 +53928,6 @@ var ts; } } } - function removeStringLiteralsMatchedByTemplateLiterals(types) { - var templates = ts.filter(types, isPatternLiteralType); - if (templates.length) { - var i = types.length; - var _loop_14 = function () { - i--; - var t = types[i]; - if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeSubtypeOf(t, template); })) { - ts.orderedRemoveItemAt(types, i); - } - }; - while (i > 0) { - _loop_14(); - } - } - } // We sort and deduplicate the constituent types based on object identity. If the subtypeReduction // flag is specified we also reduce the constituent type set to only include types that aren't subtypes // of other types. Subtype reduction is expensive for large union types and is possible only when union @@ -55277,9 +53954,6 @@ var ts; if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */)) { removeRedundantLiteralTypes(typeSet, includes); } - if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) { - removeStringLiteralsMatchedByTemplateLiterals(typeSet); - } break; case 2 /* Subtype */: if (!removeSubtypes(typeSet, !(includes & 262144 /* IncludesStructuredOrInstantiable */))) { @@ -55293,7 +53967,7 @@ var ts; neverType; } } - var objectFlags = (includes & 469647395 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -55385,15 +54059,15 @@ var ts; } typeSet.set(type.id.toString(), type); } - includes |= flags & 205258751 /* IncludesMask */; + includes |= flags & 71041023 /* IncludesMask */; } return includes; } // Add the given types to the given type set. Order is preserved, freshness is removed from literal // types, duplicates are removed, and nested types of the given kind are flattened into the set. function addTypesToIntersection(typeSet, includes, types) { - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var type = types_12[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var type = types_11[_i]; includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); } return includes; @@ -55431,31 +54105,6 @@ var ts; } return true; } - /** - * Returns `true` if the intersection of the template literals and string literals is the empty set, eg `get${string}` & "setX", and should reduce to `never` - */ - function extractRedundantTemplateLiterals(types) { - var i = types.length; - var literals = ts.filter(types, function (t) { return !!(t.flags & 128 /* StringLiteral */); }); - while (i > 0) { - i--; - var t = types[i]; - if (!(t.flags & 134217728 /* TemplateLiteral */)) - continue; - for (var _i = 0, literals_1 = literals; _i < literals_1.length; _i++) { - var t2 = literals_1[_i]; - if (isTypeSubtypeOf(t2, t)) { - // eg, ``get${T}` & "getX"` is just `"getX"` - ts.orderedRemoveItemAt(types, i); - break; - } - else if (isPatternLiteralType(t)) { - return true; - } - } - } - return false; - } function extractIrreducible(types, flag) { if (ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) { for (var i = 0; i < types.length; i++) { @@ -55544,15 +54193,12 @@ var ts; // a non-primitive type and a type known to be primitive. if (includes & 131072 /* Never */ || strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) || - includes & 67108864 /* NonPrimitive */ && includes & (469892092 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || - includes & 402653316 /* StringLike */ && includes & (469892092 /* DisjointDomains */ & ~402653316 /* StringLike */) || - includes & 296 /* NumberLike */ && includes & (469892092 /* DisjointDomains */ & ~296 /* NumberLike */) || - includes & 2112 /* BigIntLike */ && includes & (469892092 /* DisjointDomains */ & ~2112 /* BigIntLike */) || - includes & 12288 /* ESSymbolLike */ && includes & (469892092 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || - includes & 49152 /* VoidLike */ && includes & (469892092 /* DisjointDomains */ & ~49152 /* VoidLike */)) { - return neverType; - } - if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) { + includes & 67108864 /* NonPrimitive */ && includes & (67238908 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || + includes & 132 /* StringLike */ && includes & (67238908 /* DisjointDomains */ & ~132 /* StringLike */) || + includes & 296 /* NumberLike */ && includes & (67238908 /* DisjointDomains */ & ~296 /* NumberLike */) || + includes & 2112 /* BigIntLike */ && includes & (67238908 /* DisjointDomains */ & ~2112 /* BigIntLike */) || + includes & 12288 /* ESSymbolLike */ && includes & (67238908 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || + includes & 49152 /* VoidLike */ && includes & (67238908 /* DisjointDomains */ & ~49152 /* VoidLike */)) { return neverType; } if (includes & 1 /* Any */) { @@ -55596,7 +54242,9 @@ var ts; // We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of // the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain. // If the estimated size of the resulting union type exceeds 100000 constituents, report an error. - if (!checkCrossProductUnion(typeSet)) { + var size = ts.reduceLeft(typeSet, function (n, t) { return n * (t.flags & 1048576 /* Union */ ? t.types.length : 1); }, 1); + if (size >= 100000) { + error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return errorType; } var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 1048576 /* Union */) !== 0; }); @@ -55611,15 +54259,6 @@ var ts; } return result; } - function checkCrossProductUnion(types) { - var size = ts.reduceLeft(types, function (n, t) { return n * (t.flags & 1048576 /* Union */ ? t.types.length : t.flags & 131072 /* Never */ ? 0 : 1); }, 1); - if (size >= 100000) { - ts.tracing.instant("check" /* Check */, "checkCrossProductUnion_DepthLimit", { typeIds: types.map(function (t) { return t.id; }), size: size }); - error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); - return false; - } - return true; - } function getTypeFromIntersectionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -55639,24 +54278,6 @@ var ts; type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, /*stringsOnly*/ true)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, /*stringsOnly*/ false)); } - function getIndexTypeForMappedType(type, noIndexSignatures) { - var constraint = filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }); - var nameType = type.declaration.nameType && getTypeFromTypeNode(type.declaration.nameType); - return nameType ? - mapType(constraint, function (t) { return instantiateType(nameType, appendTypeMapping(type.mapper, getTypeParameterFromMappedType(type), t)); }) : - constraint; - } - // Ordinarily we reduce a keyof M where M is a mapped type { [P in K as N

]: X } to simply N. This however presumes - // that N distributes over union types, i.e. that N is equivalent to N | N | N. That presumption is - // generally true, except when N is a non-distributive conditional type or an instantiable type with non-distributive - // conditional type as a constituent. In those cases, we cannot reduce keyof M and need to preserve it as is. - function isNonDistributiveNameType(type) { - return !!(type && (type.flags & 16777216 /* Conditional */ && !type.root.isDistributive || - type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && ts.some(type.types, isNonDistributiveNameType) || - type.flags & (4194304 /* Index */ | 268435456 /* StringMapping */) && isNonDistributiveNameType(type.type) || - type.flags & 8388608 /* IndexedAccess */ && isNonDistributiveNameType(type.indexType) || - type.flags & 33554432 /* Substitution */ && isNonDistributiveNameType(type.substitute))); - } function getLiteralTypeFromPropertyName(name) { if (ts.isPrivateIdentifier(name)) { return neverType; @@ -55700,8 +54321,8 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && isNonDistributiveNameType(getNameTypeFromMappedType(type)) ? getIndexTypeForGenericType(type, stringsOnly) : - ts.getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, noIndexSignatures) : + type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) ? getIndexTypeForGenericType(type, stringsOnly) : + ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : @@ -55725,15 +54346,15 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 138 /* KeyOfKeyword */: + case 137 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 151 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 148 /* SymbolKeyword */ + case 150 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 147 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; default: @@ -55742,115 +54363,12 @@ var ts; } return links.resolvedType; } - function getTypeFromTemplateTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getTemplateLiteralType(__spreadArrays([node.head.text], ts.map(node.templateSpans, function (span) { return span.literal.text; })), ts.map(node.templateSpans, function (span) { return getTypeFromTypeNode(span.type); })); - } - return links.resolvedType; - } - function getTemplateLiteralType(texts, types) { - var unionIndex = ts.findIndex(types, function (t) { return !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)); }); - if (unionIndex >= 0) { - return checkCrossProductUnion(types) ? - mapType(types[unionIndex], function (t) { return getTemplateLiteralType(texts, ts.replaceElement(types, unionIndex, t)); }) : - errorType; - } - if (ts.contains(types, wildcardType)) { - return wildcardType; - } - var newTypes = []; - var newTexts = []; - var text = texts[0]; - if (!addSpans(texts, types)) { - return stringType; - } - if (newTypes.length === 0) { - return getLiteralType(text); - } - newTexts.push(text); - var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join(""); - var type = templateLiteralTypes.get(id); - if (!type) { - templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes)); - } - return type; - function addSpans(texts, types) { - for (var i = 0; i < types.length; i++) { - var t = types[i]; - if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) { - text += getTemplateStringForType(t) || ""; - text += texts[i + 1]; - } - else if (t.flags & 134217728 /* TemplateLiteral */) { - text += t.texts[0]; - if (!addSpans(t.texts, t.types)) - return false; - text += texts[i + 1]; - } - else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) { - newTypes.push(t); - newTexts.push(text); - text = texts[i + 1]; - } - else { - return false; - } - } - return true; - } - } - function getTemplateStringForType(type) { - return type.flags & 128 /* StringLiteral */ ? type.value : - type.flags & 256 /* NumberLiteral */ ? "" + type.value : - type.flags & 2048 /* BigIntLiteral */ ? ts.pseudoBigIntToString(type.value) : - type.flags & 512 /* BooleanLiteral */ ? type.intrinsicName : - type.flags & 65536 /* Null */ ? "null" : - type.flags & 32768 /* Undefined */ ? "undefined" : - undefined; - } - function createTemplateLiteralType(texts, types) { - var type = createType(134217728 /* TemplateLiteral */); - type.texts = texts; - type.types = types; - return type; - } - function getStringMappingType(symbol, type) { - return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) : - isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) : - type.flags & 128 /* StringLiteral */ ? getLiteralType(applyStringMapping(symbol, type.value)) : - type; - } - function applyStringMapping(symbol, str) { - switch (intrinsicTypeKinds.get(symbol.escapedName)) { - case 0 /* Uppercase */: return str.toUpperCase(); - case 1 /* Lowercase */: return str.toLowerCase(); - case 2 /* Capitalize */: return str.charAt(0).toUpperCase() + str.slice(1); - case 3 /* Uncapitalize */: return str.charAt(0).toLowerCase() + str.slice(1); - } - return str; - } - function getStringMappingTypeForGenericType(symbol, type) { - var id = getSymbolId(symbol) + "," + getTypeId(type); - var result = stringMappingTypes.get(id); - if (!result) { - stringMappingTypes.set(id, result = createStringMappingType(symbol, type)); - } - return result; - } - function createStringMappingType(symbol, type) { - var result = createType(268435456 /* StringMapping */); - result.symbol = symbol; - result.type = type; - return result; - } - function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined) { + function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments) { var type = createType(8388608 /* IndexedAccess */); type.objectType = objectType; type.indexType = indexType; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; - type.noUncheckedIndexedAccessCandidate = shouldIncludeUndefined; return type; } /** @@ -55875,13 +54393,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -55896,15 +54414,15 @@ var ts; || !ts.isCallLikeExpression(ts.findAncestor(node, function (n) { return !ts.isAccessExpression(n); }) || node.parent) && ts.every(symbol.declarations, function (d) { return !ts.isFunctionLike(d) || !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }); } - function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, noUncheckedIndexedAccessCandidate, reportDeprecated) { - var _a; - var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined; + function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, reportDeprecated) { + var _a, _b; + var accessExpression = accessNode && accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); if (prop) { - if (reportDeprecated && accessNode && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) { - var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); + if (reportDeprecated && accessNode && ((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.flags) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) { + var deprecatedNode = (_b = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _b !== void 0 ? _b : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); errorOrSuggestion(/* isError */ false, deprecatedNode, ts.Diagnostics._0_is_deprecated, propName); } if (accessExpression) { @@ -55936,13 +54454,10 @@ var ts; } } errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, 1 /* Number */)); - return mapType(objectType, function (t) { - var restType = getRestTypeOfTupleType(t) || undefinedType; - return noUncheckedIndexedAccessCandidate ? getUnionType([restType, undefinedType]) : restType; - }); + return mapType(objectType, function (t) { return getRestTypeOfTupleType(t) || undefinedType; }); } } - if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) { + if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) { if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) { return objectType; } @@ -55958,10 +54473,10 @@ var ts; if (accessNode && !isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) { var indexNode = getIndexNodeForAccessExpression(accessNode); error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); - return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + return indexInfo.type; } errorIfWritingToReadonlyIndex(indexInfo); - return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + return indexInfo.type; } if (indexType.flags & 131072 /* Never */) { return neverType; @@ -56045,17 +54560,11 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 189 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 158 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 188 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 157 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } - function isPatternLiteralPlaceholderType(type) { - return templateConstraintType.types.indexOf(type) !== -1 || !!(type.flags & 1 /* Any */); - } - function isPatternLiteralType(type) { - return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType); - } function isGenericObjectType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { if (!(type.objectFlags & 4194304 /* IsGenericObjectTypeComputed */)) { @@ -56074,7 +54583,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) && !isPatternLiteralType(type); + return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -56127,7 +54636,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 465829888 /* Instantiable */)) { + if (!(indexType.flags & 63176704 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -56190,9 +54699,8 @@ var ts; var templateMapper = combineTypeMappers(objectType.mapper, mapper); return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); } - function getIndexedAccessType(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, aliasSymbol, aliasTypeArguments, accessFlags) { - if (accessFlags === void 0) { accessFlags = 0 /* None */; } - return getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType); + function getIndexedAccessType(objectType, indexType, accessNode, aliasSymbol, aliasTypeArguments) { + return getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, 0 /* None */, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType); } function indexTypeLessThan(indexType, limit) { return everyType(indexType, function (t) { @@ -56206,14 +54714,11 @@ var ts; return false; }); } - function getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) { + function getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) { if (accessFlags === void 0) { accessFlags = 0 /* None */; } if (objectType === wildcardType || indexType === wildcardType) { return wildcardType; } - var shouldIncludeUndefined = noUncheckedIndexedAccessCandidate || - (!!compilerOptions.noUncheckedIndexedAccess && - (accessFlags & (2 /* Writing */ | 16 /* ExpressionPosition */)) === 16 /* ExpressionPosition */); // If the object type has a string index signature and no other members we know that the result will // always be the type of that index signature and we can simplify accordingly. if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) { @@ -56225,17 +54730,17 @@ var ts; // for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in an expression. This is to // preserve backwards compatibility. For example, an element access 'this["foo"]' has always been resolved // eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 189 /* IndexedAccessType */ ? + if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 188 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } // Defer the operation by creating an indexed access type. - var id = objectType.id + "," + indexType.id + (shouldIncludeUndefined ? "?" : ""); + var id = objectType.id + "," + indexType.id; var type = indexedAccessTypes.get(id); if (!type) { - indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined)); + indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments)); } return type; } @@ -56248,7 +54753,7 @@ var ts; var wasMissingProp = false; for (var _i = 0, _a = indexType.types; _i < _a.length; _i++) { var t = _a[_i]; - var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags, shouldIncludeUndefined); + var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags); if (propType) { propTypes.push(propType); } @@ -56264,11 +54769,9 @@ var ts; if (wasMissingProp) { return undefined; } - return accessFlags & 2 /* Writing */ - ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) - : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments); + return accessFlags & 2 /* Writing */ ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments); } - return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, /* supressNoImplicitAnyError */ false, accessNode, accessFlags | 4 /* CacheSymbol */, shouldIncludeUndefined, /* reportDeprecated */ true); + return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, /* supressNoImplicitAnyError */ false, accessNode, accessFlags | 4 /* CacheSymbol */, /* reportDeprecated */ true); } function getTypeFromIndexedAccessTypeNode(node) { var links = getNodeLinks(node); @@ -56276,7 +54779,7 @@ var ts; var objectType = getTypeFromTypeNode(node.objectType); var indexType = getTypeFromTypeNode(node.indexType); var potentialAlias = getAliasSymbolForTypeNode(node); - var resolved = getIndexedAccessType(objectType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); + var resolved = getIndexedAccessType(objectType, indexType, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); links.resolvedType = resolved.flags & 8388608 /* IndexedAccess */ && resolved.objectType === objectType && resolved.indexType === indexType ? @@ -56311,7 +54814,7 @@ var ts; function getConditionalType(root, mapper) { var result; var extraTypes; - var _loop_15 = function () { + var _loop_14 = function () { var checkType = instantiateType(root.checkType, mapper); var checkTypeInstantiable = isGenericObjectType(checkType) || isGenericIndexType(checkType); var extendsType = instantiateType(root.extendsType, mapper); @@ -56344,11 +54847,11 @@ var ts; if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) { // Return union of trueType and falseType for 'any' since it matches anything if (checkType.flags & 1 /* Any */) { - (extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper)); + (extraTypes || (extraTypes = [])).push(instantiateTypeWithoutDepthIncrease(root.trueType, combinedMapper || mapper)); } // If falseType is an immediately nested conditional type that isn't distributive or has an // identical checkType, switch to that type and loop. - var falseType_1 = getTypeFromTypeNode(root.node.falseType); + var falseType_1 = root.falseType; if (falseType_1.flags & 16777216 /* Conditional */) { var newRoot = falseType_1.root; if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) { @@ -56356,7 +54859,7 @@ var ts; return "continue"; } } - result = instantiateType(falseType_1, mapper); + result = instantiateTypeWithoutDepthIncrease(falseType_1, mapper); return "break"; } // Return trueType for a definitely true extends check. We check instantiations of the two @@ -56365,7 +54868,7 @@ var ts; // type Foo = T extends { x: string } ? string : number // doesn't immediately resolve to 'string' instead of being deferred. if (inferredExtendsType.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) { - result = instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper); + result = instantiateTypeWithoutDepthIncrease(root.trueType, combinedMapper || mapper); return "break"; } } @@ -56385,7 +54888,7 @@ var ts; // types of the form 'A extends B ? X : C extends D ? Y : E extends F ? Z : ...' as a single construct for // purposes of resolution. This means such types aren't subject to the instatiation depth limiter. while (true) { - var state_4 = _loop_15(); + var state_4 = _loop_14(); if (typeof state_4 === "object") return state_4.value; if (state_4 === "break") @@ -56394,13 +54897,13 @@ var ts; return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result; } function getTrueTypeFromConditionalType(type) { - return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.mapper)); + return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(type.root.trueType, type.mapper)); } function getFalseTypeFromConditionalType(type) { - return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(getTypeFromTypeNode(type.root.node.falseType), type.mapper)); + return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(type.root.falseType, type.mapper)); } function getInferredTrueTypeFromConditionalType(type) { - return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.combinedMapper) : getTrueTypeFromConditionalType(type)); + return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(type.root.trueType, type.combinedMapper) : getTrueTypeFromConditionalType(type)); } function getInferTypeParameters(node) { var result; @@ -56425,6 +54928,8 @@ var ts; node: node, checkType: checkType, extendsType: getTypeFromTypeNode(node.extendsType), + trueType: getTypeFromTypeNode(node.trueType), + falseType: getTypeFromTypeNode(node.falseType), isDistributive: !!(checkType.flags & 262144 /* TypeParameter */), inferTypeParameters: getInferTypeParameters(node), outerTypeParameters: outerTypeParameters, @@ -56482,13 +54987,7 @@ var ts; var current = void 0; while (current = nameStack.shift()) { var meaning = nameStack.length ? 1920 /* Namespace */ : targetMeaning; - // typeof a.b.c is normally resolved using `checkExpression` which in turn defers to `checkQualifiedName` - // That, in turn, ultimately uses `getPropertyOfType` on the type of the symbol, which differs slightly from - // the `exports` lookup process that only looks up namespace members which is used for most type references - var mergedResolvedSymbol = getMergedSymbol(resolveSymbol(currentNamespace)); - var next = node.isTypeOf - ? getPropertyOfType(getTypeOfSymbol(mergedResolvedSymbol), current.escapedText) - : getSymbol(getExportsOfSymbol(mergedResolvedSymbol), current.escapedText, meaning); + var next = getSymbol(getExportsOfSymbol(getMergedSymbol(resolveSymbol(currentNamespace))), current.escapedText, meaning); if (!next) { error(current, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), ts.declarationNameToString(current)); return links.resolvedType = errorType; @@ -56547,7 +55046,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isJSDocTypeExpression(host) || ts.isTypeOperatorNode(host) && host.operator === 142 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 141 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -56559,7 +55058,12 @@ var ts; return !!(type.flags & 524288 /* Object */) && !isGenericMappedType(type); } function isEmptyObjectTypeOrSpreadsIntoEmptyObject(type) { - return isEmptyObjectType(type) || !!(type.flags & (65536 /* Null */ | 32768 /* Undefined */ | 528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)); + return isEmptyObjectType(type) || !!(type.flags & (65536 /* Null */ | 32768 /* Undefined */ | 528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)); + } + function isSinglePropertyAnonymousObjectType(type) { + return !!(type.flags & 524288 /* Object */) && + !!(ts.getObjectFlags(type) & 16 /* Anonymous */) && + (ts.length(getPropertiesOfType(type)) === 1 || ts.every(getPropertiesOfType(type), function (p) { return !!(p.flags & 16777216 /* Optional */); })); } function tryMergeUnionOfObjectTypeAndEmptyObject(type, readonly) { if (type.types.length === 2) { @@ -56568,10 +55072,10 @@ var ts; if (ts.every(type.types, isEmptyObjectTypeOrSpreadsIntoEmptyObject)) { return isEmptyObjectType(firstType) ? firstType : isEmptyObjectType(secondType) ? secondType : emptyObjectType; } - if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(firstType)) { + if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(firstType) && isSinglePropertyAnonymousObjectType(secondType)) { return getAnonymousPartialType(secondType); } - if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(secondType)) { + if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(secondType) && isSinglePropertyAnonymousObjectType(firstType)) { return getAnonymousPartialType(firstType); } } @@ -56622,20 +55126,16 @@ var ts; if (merged) { return getSpreadType(merged, right, symbol, objectFlags, readonly); } - return checkCrossProductUnion([left, right]) - ? mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }) - : errorType; + return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }); } if (right.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); if (merged) { return getSpreadType(left, merged, symbol, objectFlags, readonly); } - return checkCrossProductUnion([left, right]) - ? mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }) - : errorType; + return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }); } - if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { + if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { return left; } if (isGenericObjectType(left) || isGenericObjectType(right)) { @@ -56796,7 +55296,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 253 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 250 /* InterfaceDeclaration */)) { if (!ts.hasSyntacticModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -56831,17 +55331,17 @@ var ts; } function getArrayElementTypeNode(node) { switch (node.kind) { - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return getArrayElementTypeNode(node.type); - case 179 /* TupleType */: + case 178 /* TupleType */: if (node.elements.length === 1) { node = node.elements[0]; - if (node.kind === 181 /* RestType */ || node.kind === 192 /* NamedTupleMember */ && node.dotDotDotToken) { + if (node.kind === 180 /* RestType */ || node.kind === 191 /* NamedTupleMember */ && node.dotDotDotToken) { return getArrayElementTypeNode(node.type); } } break; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return node.elementType; } return undefined; @@ -56859,98 +55359,94 @@ var ts; function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 128 /* AnyKeyword */: - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: return anyType; - case 152 /* UnknownKeyword */: + case 151 /* UnknownKeyword */: return unknownType; - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: return stringType; - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: return numberType; - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: return bigintType; case 131 /* BooleanKeyword */: return booleanType; - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: return esSymbolType; case 113 /* VoidKeyword */: return voidType; - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: return undefinedType; case 103 /* NullKeyword */: // TODO(rbuckton): `NullKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service. return nullType; - case 141 /* NeverKeyword */: + case 140 /* NeverKeyword */: return neverType; - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 136 /* IntrinsicKeyword */: - return intrinsicMarkerType; - case 187 /* ThisType */: + case 186 /* ThisType */: case 107 /* ThisKeyword */: // TODO(rbuckton): `ThisKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service and because of `isPartOfTypeNode`. return getTypeFromThisTypeNode(node); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return getTypeFromTypeReference(node); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 182 /* UnionType */: + case 181 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return getTypeFromNamedTupleTypeNode(node); - case 186 /* ParenthesizedType */: - case 306 /* JSDocNonNullableType */: - case 301 /* JSDocTypeExpression */: + case 185 /* ParenthesizedType */: + case 302 /* JSDocNonNullableType */: + case 298 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 181 /* RestType */: + case 180 /* RestType */: return getTypeFromRestTypeNode(node); - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 308 /* JSDocFunctionType */: - case 313 /* JSDocSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 304 /* JSDocFunctionType */: + case 309 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 185 /* InferType */: + case 184 /* InferType */: return getTypeFromInferTypeNode(node); - case 193 /* TemplateLiteralType */: - return getTypeFromTemplateTypeNode(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier, qualified name, or property access expression is a type expression // Callers should first ensure this by calling `isPartOfTypeNode` // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 78 /* Identifier */: - case 157 /* QualifiedName */: - case 201 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -57104,10 +55600,9 @@ var ts; return result; } function getObjectTypeInstantiation(type, mapper) { + var target = type.objectFlags & 64 /* Instantiated */ ? type.target : type; var declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.symbol.declarations[0]; var links = getNodeLinks(declaration); - var target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : - type.objectFlags & 64 /* Instantiated */ ? type.target : type; var typeParameters = links.outerTypeParameters; if (!typeParameters) { // The first time an anonymous type is instantiated we compute and store a list of the type @@ -57124,6 +55619,10 @@ var ts; ts.filter(typeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration); }) : typeParameters; links.outerTypeParameters = typeParameters; + if (typeParameters.length) { + links.instantiations = new ts.Map(); + links.instantiations.set(getTypeListId(typeParameters), target); + } } if (typeParameters.length) { // We are instantiating an anonymous type that has one or more type parameters in scope. Apply the @@ -57132,26 +55631,22 @@ var ts; var combinedMapper_1 = combineTypeMappers(type.mapper, mapper); var typeArguments = ts.map(typeParameters, function (t) { return getMappedType(t, combinedMapper_1); }); var id = getTypeListId(typeArguments); - if (!target.instantiations) { - target.instantiations = new ts.Map(); - target.instantiations.set(getTypeListId(typeParameters), target); - } - var result = target.instantiations.get(id); + var result = links.instantiations.get(id); if (!result) { var newMapper = createTypeMapper(typeParameters, typeArguments); result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper) : instantiateAnonymousType(target, newMapper); - target.instantiations.set(id, result); + links.instantiations.set(id, result); } return result; } return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 157 /* QualifiedName */ || - node.parent.kind === 173 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 195 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 156 /* QualifiedName */ || + node.parent.kind === 172 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 192 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -57160,7 +55655,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 230 /* Block */ || n.kind === 184 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 227 /* Block */ || n.kind === 183 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -57169,12 +55664,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 187 /* ThisType */: + case 186 /* ThisType */: return !!tp.isThisType; case 78 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -57207,18 +55702,13 @@ var ts; if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { - if (!type.declaration.nameType) { - if (isArrayType(t)) { - return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper)); - } - if (isGenericTupleType(t)) { - return instantiateMappedGenericTupleType(t, type, typeVariable, mapper); - } - if (isTupleType(t)) { - return instantiateMappedTupleType(t, type, prependTypeMapping(typeVariable, t, mapper)); - } + if (isGenericTupleType(t)) { + return instantiateMappedGenericTupleType(t, type, typeVariable, mapper); } - return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper)); + var replacementMapper = prependTypeMapping(typeVariable, t, mapper); + return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : + isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : + instantiateAnonymousType(type, replacementMapper); } return t; }); @@ -57327,7 +55817,6 @@ var ts; // We have reached 50 recursive type instantiations and there is a very high likelyhood we're dealing // with a combination of infinite generic types that perpetually generate new type identities. We stop // the recursion here by yielding the error type. - ts.tracing.instant("check" /* Check */, "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth: instantiationDepth, instantiationCount: instantiationCount }); error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); return errorType; } @@ -57338,6 +55827,16 @@ var ts; instantiationDepth--; return result; } + /** + * This can be used to avoid the penalty on instantiation depth for types which result from immediate + * simplification. It essentially removes the depth increase done in `instantiateType`. + */ + function instantiateTypeWithoutDepthIncrease(type, mapper) { + instantiationDepth--; + var result = instantiateType(type, mapper); + instantiationDepth++; + return result; + } function instantiateTypeWorker(type, mapper) { var flags = type.flags; if (flags & 262144 /* TypeParameter */) { @@ -57366,14 +55865,8 @@ var ts; if (flags & 4194304 /* Index */) { return getIndexType(instantiateType(type.type, mapper)); } - if (flags & 134217728 /* TemplateLiteral */) { - return getTemplateLiteralType(type.texts, instantiateTypes(type.types, mapper)); - } - if (flags & 268435456 /* StringMapping */) { - return getStringMappingType(type.symbol, instantiateType(type.type, mapper)); - } if (flags & 8388608 /* IndexedAccess */) { - return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), type.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), /*accessNode*/ undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); } if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); @@ -57419,35 +55912,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 280 /* JsxAttribute */: { + case 277 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 283 /* JsxExpression */: { + case 280 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g

) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -57466,7 +55959,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 209 /* ArrowFunction */) { + if (node.kind !== 206 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -57479,7 +55972,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 230 /* Block */ && isContextSensitive(node.body); + return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 227 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -57535,7 +56028,7 @@ var ts; source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : - hasBaseType(source, getTargetType(target)) || (isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType)); + hasBaseType(source, getTargetType(target)); } /** * This is *not* a bi-directional relationship. @@ -57582,23 +56075,23 @@ var ts; return true; } switch (node.kind) { - case 283 /* JsxExpression */: - case 207 /* ParenthesizedExpression */: + case 280 /* JsxExpression */: + case 204 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -57798,7 +56291,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -57807,15 +56300,18 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: return ts.Debug.assertNever(child, "Found invalid jsx child"); } } + function getSemanticJsxChildren(children) { + return ts.filter(children, function (i) { return !ts.isJsxText(i) || !i.containsOnlyTriviaWhiteSpaces; }); + } function elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer) { var result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer); var invalidTextDiagnostic; @@ -57825,7 +56321,7 @@ var ts; var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName); var childrenNameType = getLiteralType(childrenPropName); var childrenTargetType = getIndexedAccessType(target, childrenNameType); - var validChildren = ts.getSemanticJsxChildren(containingElement.children); + var validChildren = getSemanticJsxChildren(containingElement.children); if (!ts.length(validChildren)) { return result; } @@ -57957,11 +56453,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 168 /* SetAccessor */: return [3 /*break*/, 2]; - case 167 /* GetAccessor */: return [3 /*break*/, 2]; - case 165 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 289 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 288 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 167 /* SetAccessor */: return [3 /*break*/, 2]; + case 166 /* GetAccessor */: return [3 /*break*/, 2]; + case 164 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 286 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 285 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -58038,8 +56534,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 165 /* MethodDeclaration */ && - kind !== 164 /* MethodSignature */ && kind !== 166 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 164 /* MethodDeclaration */ && + kind !== 163 /* MethodSignature */ && kind !== 165 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -58060,36 +56556,34 @@ var ts; var paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount); var restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1; for (var i = 0; i < paramCount; i++) { - var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i); - var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i); - if (sourceType && targetType) { - // In order to ensure that any generic type Foo is at least co-variant with respect to T no matter - // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions, - // they naturally relate only contra-variantly). However, if the source and target parameters both have - // function types with a single call signature, we know we are relating two callback parameters. In - // that case it is sufficient to only relate the parameters of the signatures co-variantly because, - // similar to return values, callback parameters are output positions. This means that a Promise, - // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) - // with respect to T. - var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); - var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType)); - var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && - (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */); - var related = callbacks ? - compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : - !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); - // With strict arity, (x: number | undefined) => void is a subtype of (x?: number | undefined) => void - if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, /*reportErrors*/ false)) { - related = 0 /* False */; - } - if (!related) { - if (reportErrors) { - errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), ts.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); - } - return 0 /* False */; - } - result &= related; + var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : getTypeAtPosition(source, i); + var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : getTypeAtPosition(target, i); + // In order to ensure that any generic type Foo is at least co-variant with respect to T no matter + // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions, + // they naturally relate only contra-variantly). However, if the source and target parameters both have + // function types with a single call signature, we know we are relating two callback parameters. In + // that case it is sufficient to only relate the parameters of the signatures co-variantly because, + // similar to return values, callback parameters are output positions. This means that a Promise, + // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) + // with respect to T. + var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); + var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType)); + var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && + (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */); + var related = callbacks ? + compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : + !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); + // With strict arity, (x: number | undefined) => void is a subtype of (x?: number | undefined) => void + if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, /*reportErrors*/ false)) { + related = 0 /* False */; } + if (!related) { + if (reportErrors) { + errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), ts.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); + } + return 0 /* False */; + } + result &= related; } if (!(checkMode & 4 /* IgnoreReturnTypes */)) { // If a signature resolution is already in-flight, skip issuing a circularity error @@ -58232,7 +56726,7 @@ var ts; return true; if (t & 131072 /* Never */) return false; - if (s & 402653316 /* StringLike */ && t & 4 /* String */) + if (s & 132 /* StringLike */ && t & 4 /* String */) return true; if (s & 128 /* StringLiteral */ && s & 1024 /* EnumLiteral */ && t & 128 /* StringLiteral */ && !(t & 1024 /* EnumLiteral */) && @@ -58294,7 +56788,7 @@ var ts; } else { if (!(source.flags & 3145728 /* UnionOrIntersection */) && !(target.flags & 3145728 /* UnionOrIntersection */) && - source.flags !== target.flags && !(source.flags & 469237760 /* Substructure */)) + source.flags !== target.flags && !(source.flags & 66584576 /* Substructure */)) return false; } if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) { @@ -58303,7 +56797,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) { + if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -58356,7 +56850,6 @@ var ts; reportIncompatibleStack(); } if (overflow) { - ts.tracing.instant("check" /* Check */, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: depth }); var diag = error(errorNode || currentNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); if (errorOutputContainer) { (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); @@ -58731,7 +57224,7 @@ var ts; // breaking the intersection apart. result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); } - if (!result && (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -58829,7 +57322,7 @@ var ts; } function isIdenticalTo(source, target) { var flags = source.flags & target.flags; - if (!(flags & 469237760 /* Substructure */)) { + if (!(flags & 66584576 /* Substructure */)) { return 0 /* False */; } if (flags & 3145728 /* UnionOrIntersection */) { @@ -58865,7 +57358,7 @@ var ts; reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target); checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget]; } - var _loop_16 = function (prop) { + var _loop_15 = function (prop) { if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) { if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) { if (reportErrors) { @@ -58928,7 +57421,7 @@ var ts; }; for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; - var state_5 = _loop_16(prop); + var state_5 = _loop_15(prop); if (typeof state_5 === "object") return state_5.value; } @@ -59114,7 +57607,7 @@ var ts; for (var i = 0; i < maybeCount; i++) { // If source and target are already being compared, consider them related with assumptions if (id === maybeKeys[i]) { - return 3 /* Maybe */; + return 1 /* Maybe */; } } if (depth === 100) { @@ -59142,16 +57635,7 @@ var ts; return originalHandler(onlyUnreliable); }; } - if (expandingFlags === 3 /* Both */) { - ts.tracing.instant("check" /* Check */, "recursiveTypeRelatedTo_DepthLimit", { - sourceId: source.id, - sourceIdStack: sourceStack.map(function (t) { return t.id; }), - targetId: target.id, - targetIdStack: targetStack.map(function (t) { return t.id; }), - depth: depth, - }); - } - var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3 /* Maybe */; + var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 1 /* Maybe */; if (outofbandVarianceMarkerHandler) { outofbandVarianceMarkerHandler = originalHandler; } @@ -59159,12 +57643,9 @@ var ts; depth--; if (result) { if (result === -1 /* True */ || depth === 0) { - if (result === -1 /* True */ || result === 3 /* Maybe */) { - // If result is definitely true, record all maybe keys as having succeeded. Also, record Ternary.Maybe - // results as having succeeded once we reach depth 0, but never record Ternary.Unknown results. - for (var i = maybeStart; i < maybeCount; i++) { - relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags); - } + // If result is definitely true, record all maybe keys as having succeeded + for (var i = maybeStart; i < maybeCount; i++) { + relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags); } maybeCount = maybeStart; } @@ -59178,12 +57659,6 @@ var ts; return result; } function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) { - ts.tracing.push("check" /* Check */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id }); - var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState); - ts.tracing.pop(); - return result; - } - function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) { if (intersectionState & 4 /* PropertyCheck */) { return propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */); } @@ -59230,7 +57705,7 @@ var ts; !(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) { var variances = getAliasVariances(source.aliasSymbol); if (variances === ts.emptyArray) { - return 1 /* Unknown */; + return 1 /* Maybe */; } var varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances, intersectionState); if (varianceResult !== undefined) { @@ -59245,7 +57720,7 @@ var ts; } if (target.flags & 262144 /* TypeParameter */) { // A source type { [P in Q]: X } is related to a target type T if keyof T is related to Q and X is related to T[Q]. - if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) { + if (ts.getObjectFlags(source) & 32 /* Mapped */ && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) { if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) { var templateType = getTemplateTypeFromMappedType(source); var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); @@ -59295,14 +57770,14 @@ var ts; var baseIndexType = getBaseConstraintOfType(indexType) || indexType; if (!isGenericObjectType(baseObjectType) && !isGenericIndexType(baseIndexType)) { var accessFlags = 2 /* Writing */ | (baseObjectType !== objectType ? 1 /* NoIndexSignatures */ : 0); - var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, target.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, accessFlags); + var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, /*accessNode*/ undefined, accessFlags); if (constraint && (result = isRelatedTo(source, constraint, reportErrors))) { return result; } } } } - else if (isGenericMappedType(target) && !target.declaration.nameType) { + else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); var modifiers = getMappedTypeModifiers(target); @@ -59344,15 +57819,6 @@ var ts; } } } - else if (target.flags & 134217728 /* TemplateLiteral */ && source.flags & 128 /* StringLiteral */) { - if (isPatternLiteralType(target)) { - // match all non-`string` segments - var result_8 = inferLiteralsFromTemplateLiteralType(source, target); - if (result_8 && ts.every(result_8, function (r, i) { return isStringLiteralTypeValueParsableAsType(r, target.types[i]); })) { - return -1 /* True */; - } - } - } if (source.flags & 8650752 /* TypeVariable */) { if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) { // A type S[K] is related to a type T[J] if S is related to T and K is related to J. @@ -59391,35 +57857,6 @@ var ts; return result; } } - else if (source.flags & 134217728 /* TemplateLiteral */) { - if (target.flags & 134217728 /* TemplateLiteral */ && - source.texts.length === target.texts.length && - source.types.length === target.types.length && - ts.every(source.texts, function (t, i) { return t === target.texts[i]; }) && - ts.every(instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)).types, function (t, i) { return !!(target.types[i].flags & (1 /* Any */ | 4 /* String */)) || !!isRelatedTo(t, target.types[i], /*reportErrors*/ false); })) { - return -1 /* True */; - } - var constraint = getBaseConstraintOfType(source); - if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, reportErrors))) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - else if (source.flags & 268435456 /* StringMapping */) { - if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) { - if (result = isRelatedTo(source.type, target.type, reportErrors)) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - else { - var constraint = getBaseConstraintOfType(source); - if (constraint && (result = isRelatedTo(constraint, target, reportErrors))) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - } else if (source.flags & 16777216 /* Conditional */) { if (target.flags & 16777216 /* Conditional */) { // Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if @@ -59498,7 +57935,7 @@ var ts; // effectively means we measure variance only from type parameter occurrences that aren't nested in // recursive instantiations of the generic type. if (variances === ts.emptyArray) { - return 1 /* Unknown */; + return 1 /* Maybe */; } var varianceResult = relateVariances(getTypeArguments(source), getTypeArguments(target), variances, intersectionState); if (varianceResult !== undefined) { @@ -59555,9 +57992,9 @@ var ts; if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) { var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */); if (objectOnlyTarget.flags & 1048576 /* Union */) { - var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget); - if (result_9) { - return result_9; + var result_8 = typeRelatedToDiscriminatedType(source, objectOnlyTarget); + if (result_8) { + return result_8; } } } @@ -59624,14 +58061,12 @@ var ts; var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { - var result_10; + var result_9; var targetConstraint = getConstraintTypeFromMappedType(target); var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers)); - if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { + if (result_9 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); - if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) { - return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); - } + return result_9 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); } } return 0 /* False */; @@ -59661,7 +58096,6 @@ var ts; numCombinations *= countTypes(getTypeOfSymbol(sourceProperty)); if (numCombinations > 25) { // We've reached the complexity limit. - ts.tracing.instant("check" /* Check */, "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source.id, targetId: target.id, numCombinations: numCombinations }); return 0 /* False */; } } @@ -59680,11 +58114,11 @@ var ts; // constituents of 'target'. If any combination does not have a match then 'source' is not relatable. var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes); var matchingTypes = []; - var _loop_17 = function (combination) { + var _loop_16 = function (combination) { var hasMatch = false; outer: for (var _i = 0, _a = target.types; _i < _a.length; _i++) { var type = _a[_i]; - var _loop_18 = function (i) { + var _loop_17 = function (i) { var sourceProperty = sourcePropertiesFiltered[i]; var targetProperty = getPropertyOfType(type, sourceProperty.escapedName); if (!targetProperty) @@ -59700,7 +58134,7 @@ var ts; } }; for (var i = 0; i < sourcePropertiesFiltered.length; i++) { - var state_7 = _loop_18(i); + var state_7 = _loop_17(i); switch (state_7) { case "continue-outer": continue outer; } @@ -59714,7 +58148,7 @@ var ts; }; for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) { var combination = discriminantCombinations_1[_a]; - var state_6 = _loop_17(combination); + var state_6 = _loop_16(combination); if (typeof state_6 === "object") return state_6.value; } @@ -59770,7 +58204,7 @@ var ts; ts.Debug.assertIsDefined(links.deferralParent); ts.Debug.assertIsDefined(links.deferralConstituents); var unionParent = !!(links.deferralParent.flags & 1048576 /* Union */); - var result_11 = unionParent ? 0 /* False */ : -1 /* True */; + var result_10 = unionParent ? 0 /* False */ : -1 /* True */; var targetTypes = links.deferralConstituents; for (var _i = 0, targetTypes_3 = targetTypes; _i < targetTypes_3.length; _i++) { var targetType = targetTypes_3[_i]; @@ -59780,7 +58214,7 @@ var ts; // Can't assign to a target individually - have to fallback to assigning to the _whole_ intersection (which forces normalization) return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors); } - result_11 &= related; + result_10 &= related; } else { if (related) { @@ -59788,17 +58222,17 @@ var ts; } } } - if (unionParent && !result_11 && targetIsOptional) { - result_11 = isRelatedTo(source, undefinedType); + if (unionParent && !result_10 && targetIsOptional) { + result_10 = isRelatedTo(source, undefinedType); } - if (unionParent && !result_11 && reportErrors) { + if (unionParent && !result_10 && reportErrors) { // The easiest way to get the right errors here is to un-defer (which may be costly) // If it turns out this is too costly too often, we can replicate the error handling logic within // typeRelatedToSomeType without the discriminatable type branch (as that requires a manifest union // type on which to hand discriminable properties, which we are expressly trying to avoid here) return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors); } - return result_11; + return result_10; } else { return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors, /*headMessage*/ undefined, intersectionState); @@ -60058,7 +58492,6 @@ var ts; return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { - var _a, _b; if (relation === identityRelation) { return signaturesIdenticalTo(source, target, kind); } @@ -60089,9 +58522,7 @@ var ts; var result = -1 /* True */; var saveErrorInfo = captureErrorCalculationState(); var incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn; - var sourceObjectFlags = ts.getObjectFlags(source); - var targetObjectFlags = ts.getObjectFlags(target); - if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source.symbol === target.symbol) { + if (ts.getObjectFlags(source) & 64 /* Instantiated */ && ts.getObjectFlags(target) & 64 /* Instantiated */ && source.symbol === target.symbol) { // We have instantiations of the same anonymous type (which typically will be the type of a // method). Simply do a pairwise comparison of the signatures in the two signature lists instead // of the much more expensive N * M comparison matrix we explore below. We erase type parameters @@ -60111,26 +58542,15 @@ var ts; // this regardless of the number of signatures, but the potential costs are prohibitive due // to the quadratic nature of the logic below. var eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; - var sourceSignature = ts.first(sourceSignatures); - var targetSignature = ts.first(targetSignatures); - result = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors, incompatibleReporter(sourceSignature, targetSignature)); - if (!result && reportErrors && kind === 1 /* Construct */ && (sourceObjectFlags & targetObjectFlags) && - (((_a = targetSignature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 166 /* Constructor */ || ((_b = sourceSignature.declaration) === null || _b === void 0 ? void 0 : _b.kind) === 166 /* Constructor */)) { - var constructSignatureToString = function (signature) { - return signatureToString(signature, /*enclosingDeclaration*/ undefined, 262144 /* WriteArrowStyleSignature */, kind); - }; - reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature)); - reportError(ts.Diagnostics.Types_of_construct_signatures_are_incompatible); - return result; - } + result = signatureRelatedTo(sourceSignatures[0], targetSignatures[0], eraseGenerics, reportErrors, incompatibleReporter(sourceSignatures[0], targetSignatures[0])); } else { outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) { var t = targetSignatures_1[_i]; // Only elaborate errors from the first failure var shouldElaborateErrors = reportErrors; - for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) { - var s = sourceSignatures_1[_c]; + for (var _a = 0, sourceSignatures_1 = sourceSignatures; _a < sourceSignatures_1.length; _a++) { + var s = sourceSignatures_1[_a]; var related = signatureRelatedTo(s, t, /*erase*/ true, shouldElaborateErrors, incompatibleReporter(s, t)); if (related) { result &= related; @@ -60294,13 +58714,13 @@ var ts; if (type.flags & 3145728 /* UnionOrIntersection */) { return !!ts.forEach(type.types, typeCouldHaveTopLevelSingletonTypes); } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getConstraintOfType(type); - if (constraint && constraint !== type) { + if (constraint) { return typeCouldHaveTopLevelSingletonTypes(constraint); } } - return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */); + return isUnitType(type); } function getBestMatchingType(source, target, isRelatedTo) { if (isRelatedTo === void 0) { isRelatedTo = compareTypesAssignable; } @@ -60334,18 +58754,8 @@ var ts; } } var match = discriminable.indexOf(/*searchElement*/ true); - if (match === -1) { - return defaultValue; - } // make sure exactly 1 matches before returning it - var nextMatch = discriminable.indexOf(/*searchElement*/ true, match + 1); - while (nextMatch !== -1) { - if (!isTypeIdenticalTo(target.types[match], target.types[nextMatch])) { - return defaultValue; - } - nextMatch = discriminable.indexOf(/*searchElement*/ true, nextMatch + 1); - } - return target.types[match]; + return match === -1 || discriminable.indexOf(/*searchElement*/ true, match + 1) !== -1 ? defaultValue : target.types[match]; } /** * A type is 'weak' if it is an object type with at least one optional property @@ -60394,15 +58804,13 @@ var ts; // instantiations of the generic type for type arguments with known relations. The function // returns the emptyArray singleton when invoked recursively for the given generic type. function getVariancesWorker(typeParameters, cache, createMarkerType) { - var _a, _b, _c; if (typeParameters === void 0) { typeParameters = ts.emptyArray; } var variances = cache.variances; if (!variances) { - ts.tracing.push("check" /* Check */, "getVariancesWorker", { arity: typeParameters.length, id: (_c = (_a = cache.id) !== null && _a !== void 0 ? _a : (_b = cache.declaredType) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : -1 }); // The emptyArray singleton is used to signal a recursive invocation. cache.variances = ts.emptyArray; variances = []; - var _loop_19 = function (tp) { + var _loop_18 = function (tp) { var unmeasurable = false; var unreliable = false; var oldHandler = outofbandVarianceMarkerHandler; @@ -60434,10 +58842,9 @@ var ts; }; for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) { var tp = typeParameters_1[_i]; - _loop_19(tp); + _loop_18(tp); } cache.variances = variances; - ts.tracing.pop(); } return variances; } @@ -60568,54 +58975,58 @@ var ts; // has expanded into `[A>>>>>]` // in such cases we need to terminate the expansion, and we do so here. function isDeeplyNestedType(type, stack, depth) { - if (depth >= 5) { - var identity_1 = getRecursionIdentity(type); - if (identity_1) { - var count = 0; - for (var i = 0; i < depth; i++) { - if (getRecursionIdentity(stack[i]) === identity_1) { - count++; - if (count >= 5) { - return true; + // We track all object types that have an associated symbol (representing the origin of the type) + if (depth >= 5 && type.flags & 524288 /* Object */) { + if (!isObjectOrArrayLiteralType(type)) { + var symbol = type.symbol; + if (symbol) { + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 524288 /* Object */ && t.symbol === symbol) { + count++; + if (count >= 5) + return true; } } } } + if (ts.getObjectFlags(type) && 4 /* Reference */ && !!type.node) { + var root = type.target; + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (ts.getObjectFlags(t) && 4 /* Reference */ && !!t.node && t.target === root) { + count++; + if (count >= 5) + return true; + } + } + } + } + if (depth >= 5 && type.flags & 8388608 /* IndexedAccess */) { + var root = getRootObjectTypeFromIndexedAccessChain(type); + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (getRootObjectTypeFromIndexedAccessChain(t) === root) { + count++; + if (count >= 5) + return true; + } + } } return false; } - // Types with constituents that could circularly reference the type have a recursion identity. The recursion - // identity is some object that is common to instantiations of the type with the same origin. - function getRecursionIdentity(type) { - if (type.flags & 524288 /* Object */ && !isObjectOrArrayLiteralType(type)) { - if (ts.getObjectFlags(type) && 4 /* Reference */ && type.node) { - // Deferred type references are tracked through their associated AST node. This gives us finer - // granularity than using their associated target because each manifest type reference has a - // unique AST node. - return type.node; - } - if (type.symbol && !(ts.getObjectFlags(type) & 16 /* Anonymous */ && type.symbol.flags & 32 /* Class */)) { - // We track all object types that have an associated symbol (representing the origin of the type), but - // exclude the static side of classes from this check since it shares its symbol with the instance side. - return type.symbol; - } - if (isTupleType(type)) { - // Tuple types are tracked through their target type - return type.target; - } + /** + * Gets the leftmost object type in a chain of indexed accesses, eg, in A[P][Q], returns A + */ + function getRootObjectTypeFromIndexedAccessChain(type) { + var t = type; + while (t.flags & 8388608 /* IndexedAccess */) { + t = t.objectType; } - if (type.flags & 8388608 /* IndexedAccess */) { - // Identity is the leftmost object type in a chain of indexed accesses, eg, in A[P][Q] it is A - do { - type = type.objectType; - } while (type.flags & 8388608 /* IndexedAccess */); - return type; - } - if (type.flags & 16777216 /* Conditional */) { - // The root object represents the origin of the conditional type - return type.root; - } - return undefined; + return t; } function isPropertyIdenticalTo(sourceProp, targetProp) { return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0 /* False */; @@ -60738,8 +59149,8 @@ var ts; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var t = types_13[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -60913,8 +59324,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var t = types_14[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var t = types_13[_i]; result |= getFalsyFlags(t); } return result; @@ -60944,7 +59355,7 @@ var ts; type.flags & 64 /* BigInt */ ? zeroBigIntType : type === regularFalseType || type === falseType || - type.flags & (16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */ | 3 /* AnyOrUnknown */) || + type.flags & (16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */) || type.flags & 128 /* StringLiteral */ && type.value === "" || type.flags & 256 /* NumberLiteral */ && type.value === 0 || type.flags & 2048 /* BigIntLiteral */ && isZeroBigInt(type) ? type : @@ -61247,12 +59658,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 216 /* BinaryExpression */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 213 /* BinaryExpression */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 160 /* Parameter */: + case 159 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -61267,23 +59678,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 3 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -61297,7 +59708,7 @@ var ts; wideningKind === 3 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 190 /* MappedType */: + case 189 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -61427,7 +59838,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 465829888 /* Instantiable */ || + var result = !!(type.flags & 63176704 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */)) || @@ -61439,15 +59850,16 @@ var ts; } function isNonGenericTopLevelType(type) { if (type.aliasSymbol && !type.aliasTypeArguments) { - var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 254 /* TypeAliasDeclaration */); - return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 297 /* SourceFile */ ? true : n.kind === 256 /* ModuleDeclaration */ ? false : "quit"; })); + var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 251 /* TypeAliasDeclaration */); + return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 294 /* SourceFile */ ? true : n.kind === 253 /* ModuleDeclaration */ ? false : "quit"; })); } return false; } function isTypeParameterAtTopLevel(type, typeParameter) { return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && ts.some(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }) || - type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); + type.flags & 16777216 /* Conditional */ && (isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type), typeParameter) || + isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type), typeParameter))); } /** Create an object with properties named in the string literal type. Every property has type `any` */ function createEmptyObjectTypeFromStringLiteral(type) { @@ -61494,8 +59906,7 @@ var ts; // arrow function, but is considered partially inferable because property 'a' has an inferable type. function isPartiallyInferableType(type) { return !(ts.getObjectFlags(type) & 2097152 /* NonInferrableType */) || - isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }) || - isTupleType(type) && ts.some(getTypeArguments(type), isPartiallyInferableType); + isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }); } function createReverseMappedType(source, target, constraint) { // We consider a source type reverse mappable if it has a string index signature or if @@ -61599,73 +60010,17 @@ var ts; function isFromInferenceBlockedSource(type) { return !!(type.symbol && ts.some(type.symbol.declarations, hasSkipDirectInferenceFlag)); } - function isValidBigIntString(s) { - var scanner = ts.createScanner(99 /* ESNext */, /*skipTrivia*/ false); - var success = true; - scanner.setOnError(function () { return success = false; }); - scanner.setText(s + "n"); - var result = scanner.scan(); - if (result === 40 /* MinusToken */) { - result = scanner.scan(); - } - var flags = scanner.getTokenFlags(); - // validate that - // * scanning proceeded without error - // * a bigint can be scanned, and that when it is scanned, it is - // * the full length of the input string (so the scanner is one character beyond the augmented input length) - // * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input) - return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === (s.length + 1) && !(flags & 512 /* ContainsSeparator */); - } - function isStringLiteralTypeValueParsableAsType(s, target) { - if (target.flags & 1048576 /* Union */) { - return !!forEachType(target, function (t) { return isStringLiteralTypeValueParsableAsType(s, t); }); - } - switch (target) { - case stringType: return true; - case numberType: return s.value !== "" && isFinite(+(s.value)); - case bigintType: return s.value !== "" && isValidBigIntString(s.value); - // the next 4 should be handled in `getTemplateLiteralType`, as they are all exactly one value, but are here for completeness, just in case - // this function is ever used on types which don't come from template literal holes - case trueType: return s.value === "true"; - case falseType: return s.value === "false"; - case undefinedType: return s.value === "undefined"; - case nullType: return s.value === "null"; - default: return !!(target.flags & 1 /* Any */); - } - } - function inferLiteralsFromTemplateLiteralType(source, target) { - var value = source.value; - var texts = target.texts; - var lastIndex = texts.length - 1; - var startText = texts[0]; - var endText = texts[lastIndex]; - if (!(value.startsWith(startText) && value.slice(startText.length).endsWith(endText))) - return undefined; - var matches = []; - var str = value.slice(startText.length, value.length - endText.length); - var pos = 0; - for (var i = 1; i < lastIndex; i++) { - var delim = texts[i]; - var delimPos = delim.length > 0 ? str.indexOf(delim, pos) : pos < str.length ? pos + 1 : -1; - if (delimPos < 0) - return undefined; - matches.push(getLiteralType(str.slice(pos, delimPos))); - pos = delimPos + delim.length; - } - matches.push(getLiteralType(str.slice(pos))); - return matches; - } function inferTypes(inferences, originalSource, originalTarget, priority, contravariant) { if (priority === void 0) { priority = 0; } if (contravariant === void 0) { contravariant = false; } + var symbolOrTypeStack; + var visited; var bivariant = false; var propagationType; var inferencePriority = 1024 /* MaxValue */; var allowComplexConstraintInference = true; - var visited; - var sourceStack; - var targetStack; - var expandingFlags = 0 /* None */; + var objectTypeComparisonDepth = 0; + var targetStack = []; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { if (!couldContainTypeVariables(target)) { @@ -61793,7 +60148,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 465829888 /* Instantiable */) { + if (indexType.flags & 63176704 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -61822,13 +60177,18 @@ var ts; inferFromTypes(source.objectType, target.objectType); inferFromTypes(source.indexType, target.indexType); } - else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) { - if (source.symbol === target.symbol) { - inferFromTypes(source.type, target.type); - } + else if (source.flags & 16777216 /* Conditional */ && target.flags & 16777216 /* Conditional */) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); + inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } else if (target.flags & 16777216 /* Conditional */) { - invokeOnce(source, target, inferToConditionalType); + var savePriority = priority; + priority |= contravariant ? 32 /* ContravariantConditional */ : 0; + var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; + inferToMultipleTypes(source, targetTypes, target.flags); + priority = savePriority; } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); @@ -61841,12 +60201,9 @@ var ts; inferFromTypes(sourceType, target); } } - else if (target.flags & 134217728 /* TemplateLiteral */) { - inferToTemplateLiteralType(source, target); - } else { source = getReducedType(source); - if (!(priority & 256 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) { + if (!(priority & 256 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -61891,30 +60248,7 @@ var ts; (visited || (visited = new ts.Map())).set(key, -1 /* Circularity */); var saveInferencePriority = inferencePriority; inferencePriority = 1024 /* MaxValue */; - // We stop inferring and report a circularity if we encounter duplicate recursion identities on both - // the source side and the target side. - var saveExpandingFlags = expandingFlags; - var sourceIdentity = getRecursionIdentity(source) || source; - var targetIdentity = getRecursionIdentity(target) || target; - if (sourceIdentity && ts.contains(sourceStack, sourceIdentity)) - expandingFlags |= 1 /* Source */; - if (targetIdentity && ts.contains(targetStack, targetIdentity)) - expandingFlags |= 2 /* Target */; - if (expandingFlags !== 3 /* Both */) { - if (sourceIdentity) - (sourceStack || (sourceStack = [])).push(sourceIdentity); - if (targetIdentity) - (targetStack || (targetStack = [])).push(targetIdentity); - action(source, target); - if (targetIdentity) - targetStack.pop(); - if (sourceIdentity) - sourceStack.pop(); - } - else { - inferencePriority = -1 /* Circularity */; - } - expandingFlags = saveExpandingFlags; + action(source, target); visited.set(key, inferencePriority); inferencePriority = Math.min(inferencePriority, saveInferencePriority); } @@ -61971,8 +60305,8 @@ var ts; } function getSingleTypeVariableFromIntersectionTypes(types) { var typeVariable; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var type = types_15[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var type = types_14[_i]; var t = type.flags & 2097152 /* Intersection */ && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); }); if (!t || typeVariable && t !== typeVariable) { return undefined; @@ -62110,31 +60444,40 @@ var ts; } return false; } - function inferToConditionalType(source, target) { - if (source.flags & 16777216 /* Conditional */) { - inferFromTypes(source.checkType, target.checkType); - inferFromTypes(source.extendsType, target.extendsType); - inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); - inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); + function inferFromObjectTypes(source, target) { + // If we are already processing another target type with the same associated symbol (such as + // an instantiation of the same generic type), we do not explore this target as it would yield + // no further inferences. We exclude the static side of classes from this check since it shares + // its symbol with the instance side which would lead to false positives. + var isNonConstructorObject = target.flags & 524288 /* Object */ && + !(ts.getObjectFlags(target) & 16 /* Anonymous */ && target.symbol && target.symbol.flags & 32 /* Class */); + var symbolOrType = ts.getObjectFlags(target) & 4 /* Reference */ && target.node ? getNormalizedType(target, /*writing*/ false) : isNonConstructorObject ? isTupleType(target) ? target.target : target.symbol : undefined; + if (symbolOrType) { + if (ts.contains(symbolOrTypeStack, symbolOrType)) { + if (ts.getObjectFlags(target) & 4 /* Reference */ && target.node) { + // Don't set the circularity flag for re-encountered recursive type references just because we're already exploring them + return; + } + inferencePriority = -1 /* Circularity */; + return; + } + targetStack[objectTypeComparisonDepth] = target; + objectTypeComparisonDepth++; + if (isDeeplyNestedType(target, targetStack, objectTypeComparisonDepth)) { + inferencePriority = -1 /* Circularity */; + objectTypeComparisonDepth--; + return; + } + (symbolOrTypeStack || (symbolOrTypeStack = [])).push(symbolOrType); + inferFromObjectTypesWorker(source, target); + symbolOrTypeStack.pop(); + objectTypeComparisonDepth--; } else { - var savePriority = priority; - priority |= contravariant ? 32 /* ContravariantConditional */ : 0; - var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; - inferToMultipleTypes(source, targetTypes, target.flags); - priority = savePriority; + inferFromObjectTypesWorker(source, target); } } - function inferToTemplateLiteralType(source, target) { - var matches = source.flags & 128 /* StringLiteral */ ? inferLiteralsFromTemplateLiteralType(source, target) : - source.flags & 134217728 /* TemplateLiteral */ && ts.arraysEqual(source.texts, target.texts) ? source.types : - undefined; - var types = target.types; - for (var i = 0; i < types.length; i++) { - inferFromTypes(matches ? matches[i] : neverType, types[i]); - } - } - function inferFromObjectTypes(source, target) { + function inferFromObjectTypesWorker(source, target) { if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) { // If source and target are references to the same generic type, infer from type arguments inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target)); @@ -62145,12 +60488,8 @@ var ts; // from S to T and from X to Y. inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target)); inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); - var sourceNameType = getNameTypeFromMappedType(source); - var targetNameType = getNameTypeFromMappedType(target); - if (sourceNameType && targetNameType) - inferFromTypes(sourceNameType, targetNameType); } - if (ts.getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) { + if (ts.getObjectFlags(target) & 32 /* Mapped */) { var constraintType = getConstraintTypeFromMappedType(target); if (inferToMappedType(source, target, constraintType)) { return; @@ -62258,7 +60597,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 165 /* MethodDeclaration */ || kind === 164 /* MethodSignature */ || kind === 166 /* Constructor */; + bivariant = bivariant || kind === 164 /* MethodDeclaration */ || kind === 163 /* MethodSignature */ || kind === 165 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -62293,7 +60632,7 @@ var ts; } function hasPrimitiveConstraint(type) { var constraint = getConstraintOfTypeParameter(type); - return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */); } function isObjectLiteralType(type) { return !!(ts.getObjectFlags(type) & 128 /* ObjectLiteral */); @@ -62402,22 +60741,22 @@ var ts; return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom; case "$": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery; case "describe": case "suite": case "it": case "test": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha; case "process": case "require": case "Buffer": case "module": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode; case "Map": case "Set": case "Promise": @@ -62426,19 +60765,9 @@ var ts; case "WeakSet": case "Iterator": case "AsyncIterator": - case "SharedArrayBuffer": - case "Atomics": - case "AsyncIterable": - case "AsyncIterableIterator": - case "AsyncGenerator": - case "AsyncGeneratorFunction": - case "BigInt": - case "Reflect": - case "BigInt64Array": - case "BigUint64Array": - return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later; + return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 286 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -62459,7 +60788,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 176 /* TypeQuery */ ? true : n.kind === 78 /* Identifier */ || n.kind === 157 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 175 /* TypeQuery */ ? true : n.kind === 78 /* Identifier */ || n.kind === 156 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -62474,11 +60803,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 107 /* ThisKeyword */: return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType); - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -62489,28 +60818,26 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: return isMatchingReference(source, target.expression); - case 216 /* BinaryExpression */: - return (ts.isAssignmentExpression(target) && isMatchingReference(source, target.left)) || - (ts.isBinaryExpression(target) && target.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source, target.right)); + case 213 /* BinaryExpression */: + return ts.isAssignmentExpression(target) && isMatchingReference(source, target.left); } switch (source.kind) { case 78 /* Identifier */: - case 79 /* PrivateIdentifier */: return target.kind === 78 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 249 /* VariableDeclaration */ || target.kind === 198 /* BindingElement */) && + (target.kind === 246 /* VariableDeclaration */ || target.kind === 195 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 107 /* ThisKeyword */: return target.kind === 107 /* ThisKeyword */; case 105 /* SuperKeyword */: return target.kind === 105 /* SuperKeyword */; - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -62520,11 +60847,11 @@ var ts; // Given a source x, check if target matches x or is an && operation with an operand that matches x. function containsTruthyCheck(source, target) { return isMatchingReference(source, target) || - (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && + (target.kind === 213 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right))); } function getAccessedPropertyName(access) { - return access.kind === 201 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 198 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -62553,7 +60880,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 465829888 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -62586,7 +60913,7 @@ var ts; } } } - if (callExpression.expression.kind === 201 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 198 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -62635,8 +60962,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0 /* None */; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var t = types_16[_i]; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var t = types_15[_i]; result |= getTypeFacts(t); } return result; @@ -62707,7 +61034,7 @@ var ts; if (flags & 131072 /* Never */) { return 0 /* None */; } - if (flags & 465829888 /* Instantiable */) { + if (flags & 63176704 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -62731,35 +61058,28 @@ var ts; return errorType; var text = getPropertyNameFromType(nameType); return getConstraintForLocation(getTypeOfPropertyOfType(type, text), name) || - isNumericLiteralName(text) && includeUndefinedInIndexSignature(getIndexTypeOfType(type, 1 /* Number */)) || - includeUndefinedInIndexSignature(getIndexTypeOfType(type, 0 /* String */)) || + isNumericLiteralName(text) && getIndexTypeOfType(type, 1 /* Number */) || + getIndexTypeOfType(type, 0 /* String */) || errorType; } function getTypeOfDestructuredArrayElement(type, index) { return everyType(type, isTupleLikeType) && getTupleElementType(type, index) || - includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined)) || + checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType; } - function includeUndefinedInIndexSignature(type) { - if (!type) - return type; - return compilerOptions.noUncheckedIndexedAccess ? - getUnionType([type, undefinedType]) : - type; - } function getTypeOfDestructuredSpreadExpression(type) { return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 199 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 288 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 196 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 285 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 216 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 239 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 213 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 236 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -62776,21 +61096,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return stringType; - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return checkRightHandSideOfForOf(parent) || errorType; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return undefinedType; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -62798,7 +61118,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 196 /* ObjectBindingPattern */ ? + var type = pattern.kind === 193 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -62816,30 +61136,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 238 /* ForInStatement */) { + if (node.parent.parent.kind === 235 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 239 /* ForOfStatement */) { + if (node.parent.parent.kind === 236 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 249 /* VariableDeclaration */ ? + return node.kind === 246 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 249 /* VariableDeclaration */ && node.initializer && + return node.kind === 246 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 198 /* BindingElement */ && node.parent.kind === 216 /* BinaryExpression */ && + node.kind !== 195 /* BindingElement */ && node.parent.kind === 213 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 74 /* BarBarEqualsToken */: @@ -62854,13 +61174,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 207 /* ParenthesizedExpression */ || - parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 204 /* ParenthesizedExpression */ || + parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -62880,7 +61200,7 @@ var ts; var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; @@ -63017,8 +61337,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { - var t = types_17[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var t = types_16[_i]; if (!(t.flags & 131072 /* Never */)) { if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) { return false; @@ -63042,12 +61362,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 203 /* CallExpression */ + parent.parent.kind === 200 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 202 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 199 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 216 /* BinaryExpression */ && + parent.parent.kind === 213 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -63055,8 +61375,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return (declaration.kind === 249 /* VariableDeclaration */ || declaration.kind === 160 /* Parameter */ || - declaration.kind === 163 /* PropertyDeclaration */ || declaration.kind === 162 /* PropertySignature */) && + return (declaration.kind === 246 /* VariableDeclaration */ || declaration.kind === 159 /* Parameter */ || + declaration.kind === 162 /* PropertyDeclaration */ || declaration.kind === 161 /* PropertySignature */) && !!ts.getEffectiveTypeAnnotationNode(declaration); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -63064,18 +61384,12 @@ var ts; return getTypeOfSymbol(symbol); } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { - if (ts.getCheckFlags(symbol) & 262144 /* Mapped */) { - var origin = symbol.syntheticOrigin; - if (origin && getExplicitTypeOfSymbol(origin)) { - return getTypeOfSymbol(symbol); - } - } var declaration = symbol.valueDeclaration; if (declaration) { if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 236 /* ForOfStatement */) { var statement = declaration.parent.parent; var expressionType = getTypeOfDottedName(statement.expression, /*diagnostic*/ undefined); if (expressionType) { @@ -63103,11 +61417,11 @@ var ts; return getExplicitThisType(node); case 105 /* SuperKeyword */: return checkSuperExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -63121,7 +61435,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 233 /* ExpressionStatement */) { + if (node.parent.kind === 230 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 105 /* SuperKeyword */) { @@ -63165,7 +61479,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 94 /* FalseKeyword */ || node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 94 /* FalseKeyword */ || node.kind === 213 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -63284,7 +61598,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 536624127 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -63296,7 +61610,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 225 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 222 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -63311,13 +61625,11 @@ var ts; if (flowDepth === 2000) { // We have made 2000 recursive invocations. To avoid overflowing the call stack we report an error // and disable further control flow analysis in the containing function or module body. - ts.tracing.instant("check" /* Check */, "getTypeAtFlowNode_DepthLimit", { flowId: flow.id }); flowAnalysisDisabled = true; reportFlowControlError(reference); return errorType; } flowDepth++; - var sharedFlow; while (true) { var flags = flow.flags; if (flags & 4096 /* Shared */) { @@ -63330,7 +61642,6 @@ var ts; return sharedFlowTypes[i]; } } - sharedFlow = flow; } var type = void 0; if (flags & 16 /* Assignment */) { @@ -63380,8 +61691,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 201 /* PropertyAccessExpression */ && - reference.kind !== 202 /* ElementAccessExpression */ && + reference.kind !== 198 /* PropertyAccessExpression */ && + reference.kind !== 199 /* ElementAccessExpression */ && reference.kind !== 107 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -63394,9 +61705,9 @@ var ts; // simply return the non-auto declared type to reduce follow-on errors. type = convertAutoToAny(declaredType); } - if (sharedFlow) { + if (flags & 4096 /* Shared */) { // Record visited node and the associated type in the cache. - sharedFlowNodes[sharedFlowCount] = sharedFlow; + sharedFlowNodes[sharedFlowCount] = flow; sharedFlowTypes[sharedFlowCount] = type; sharedFlowCount++; } @@ -63406,7 +61717,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -63446,14 +61757,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 208 /* FunctionExpression */ || init.kind === 209 /* ArrowFunction */)) { + if (init && (init.kind === 205 /* FunctionExpression */ || init.kind === 206 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 238 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 235 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -63464,7 +61775,7 @@ var ts; if (node.kind === 94 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 216 /* BinaryExpression */) { + if (node.kind === 213 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -63495,7 +61806,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 203 /* CallExpression */ ? + var expr = node.kind === 200 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -63503,7 +61814,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -63551,7 +61862,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 211 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 208 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -63559,7 +61870,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 211 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 208 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -63777,10 +62088,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 208 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 208 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -63900,7 +62211,7 @@ var ts; if (assumeTrue && type.flags & 2 /* Unknown */ && literal.text === "object") { // The pattern x && typeof x === 'object', where x is of type unknown, narrows x to type object. We don't // need to check for the reverse typeof x === 'object' && x since that already narrows correctly. - if (typeOfExpr.parent.parent.kind === 216 /* BinaryExpression */) { + if (typeOfExpr.parent.parent.kind === 213 /* BinaryExpression */) { var expr = typeOfExpr.parent.parent; if (expr.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) { return nonPrimitiveType; @@ -63983,7 +62294,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -64148,10 +62459,15 @@ var ts; return assignableType; } } - // If the candidate type is a subtype of the target type, narrow to the candidate type, - // if the target type is a subtype of the candidate type, narrow to the target type, - // otherwise, narrow to an intersection of the two types. - return isTypeSubtypeOf(candidate, type) ? candidate : isTypeSubtypeOf(type, candidate) ? type : getIntersectionType([type, candidate]); + // If the candidate type is a subtype of the target type, narrow to the candidate type. + // Otherwise, if the target type is assignable to the candidate type, keep the target type. + // Otherwise, if the candidate type is assignable to the target type, narrow to the candidate + // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the + // two types. + return isTypeSubtypeOf(candidate, type) ? candidate : + isTypeAssignableTo(type, candidate) ? type : + isTypeAssignableTo(candidate, type) ? candidate : + getIntersectionType([type, candidate]); } function narrowTypeByCallExpression(type, callExpression, assumeTrue) { if (hasMatchingArgument(callExpression, reference)) { @@ -64194,17 +62510,16 @@ var ts; case 78 /* Identifier */: case 107 /* ThisKeyword */: case 105 /* SuperKeyword */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -64249,9 +62564,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 257 /* ModuleBlock */ || - node.kind === 297 /* SourceFile */ || - node.kind === 163 /* PropertyDeclaration */; + node.kind === 254 /* ModuleBlock */ || + node.kind === 294 /* SourceFile */ || + node.kind === 162 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -64273,7 +62588,7 @@ var ts; if (node.kind === 78 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 160 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 159 /* Parameter */) { symbol.isAssigned = true; } } @@ -64289,7 +62604,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 160 /* Parameter */ && + declaration.kind === 159 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -64303,10 +62618,10 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 201 /* PropertyAccessExpression */ || - parent.kind === 203 /* CallExpression */ && parent.expression === node || - parent.kind === 202 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 198 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 198 /* PropertyAccessExpression */ || + parent.kind === 200 /* CallExpression */ && parent.expression === node || + parent.kind === 199 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 195 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); @@ -64348,7 +62663,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 209 /* ArrowFunction */) { + if (container.kind === 206 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasSyntacticModifier(container, 256 /* Async */)) { @@ -64364,16 +62679,16 @@ var ts; markAliasReferenced(symbol, node); } var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - var sourceSymbol = localOrExportSymbol.flags & 2097152 /* Alias */ ? resolveAlias(localOrExportSymbol) : localOrExportSymbol; - if (getDeclarationNodeFlagsFromSymbol(sourceSymbol) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node.parent, sourceSymbol)) { - errorOrSuggestion(/* isError */ false, node, ts.Diagnostics._0_is_deprecated, node.escapedText); - } var declaration = localOrExportSymbol.valueDeclaration; + if (declaration && ts.getCombinedNodeFlags(declaration) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node.parent, localOrExportSymbol)) { + errorOrSuggestion(/* isError */ false, node, ts.Diagnostics._0_is_deprecated, node.escapedText); + ; + } if (localOrExportSymbol.flags & 32 /* Class */) { // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 252 /* ClassDeclaration */ + if (declaration.kind === 249 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -64385,14 +62700,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 221 /* ClassExpression */) { + else if (declaration.kind === 218 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 297 /* SourceFile */) { + while (container.kind !== 294 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 163 /* PropertyDeclaration */ && ts.hasSyntacticModifier(container, 32 /* Static */)) { + if (container.kind === 162 /* PropertyDeclaration */ && ts.hasSyntacticModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -64441,7 +62756,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 160 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 159 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -64450,8 +62765,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 208 /* FunctionExpression */ || - flowContainer.kind === 209 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 205 /* FunctionExpression */ || + flowContainer.kind === 206 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -64460,9 +62775,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 270 /* ExportSpecifier */) || - node.parent.kind === 225 /* NonNullExpression */ || - declaration.kind === 249 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 267 /* ExportSpecifier */) || + node.parent.kind === 222 /* NonNullExpression */ || + declaration.kind === 246 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -64497,7 +62812,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 287 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 284 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -64520,7 +62835,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 247 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -64541,7 +62856,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 247 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -64560,7 +62875,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 207 /* ParenthesizedExpression */) { + while (current.parent.kind === 204 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -64568,7 +62883,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 214 /* PrefixUnaryExpression */ || current.parent.kind === 215 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 211 /* PrefixUnaryExpression */ || current.parent.kind === 212 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -64581,7 +62896,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 163 /* PropertyDeclaration */ || container.kind === 166 /* Constructor */) { + if (container.kind === 162 /* PropertyDeclaration */ || container.kind === 165 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -64621,37 +62936,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 166 /* Constructor */) { + if (container.kind === 165 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 209 /* ArrowFunction */) { + if (container.kind === 206 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 166 /* Constructor */: + case 165 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: if (ts.hasSyntacticModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -64739,7 +63054,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 208 /* FunctionExpression */ && + if (container.kind === 205 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -64749,16 +63064,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 165 /* MethodDeclaration */ && - container.parent.kind === 200 /* ObjectLiteralExpression */ && + else if (container.kind === 164 /* MethodDeclaration */ && + container.parent.kind === 197 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 208 /* FunctionExpression */ && - container.parent.kind === 288 /* PropertyAssignment */ && - container.parent.parent.kind === 200 /* ObjectLiteralExpression */ && + else if (container.kind === 205 /* FunctionExpression */ && + container.parent.kind === 285 /* PropertyAssignment */ && + container.parent.parent.kind === 197 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -64766,7 +63081,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 208 /* FunctionExpression */ && + else if (container.kind === 205 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -64791,7 +63106,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 308 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 304 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -64805,16 +63120,16 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 160 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 159 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 203 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 200 /* CallExpression */ && node.parent.expression === node; var immediateContainer = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var container = immediateContainer; var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 209 /* ArrowFunction */) { + while (container && container.kind === 206 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -64827,14 +63142,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 158 /* ComputedPropertyName */; }); - if (current && current.kind === 158 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 157 /* ComputedPropertyName */; }); + if (current && current.kind === 157 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 197 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -64842,7 +63157,7 @@ var ts; } return errorType; } - if (!isCallExpression && immediateContainer.kind === 166 /* Constructor */) { + if (!isCallExpression && immediateContainer.kind === 165 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasSyntacticModifier(container, 32 /* Static */) || isCallExpression) { @@ -64911,7 +63226,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 165 /* MethodDeclaration */ && ts.hasSyntacticModifier(container, 256 /* Async */)) { + if (container.kind === 164 /* MethodDeclaration */ && ts.hasSyntacticModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -64925,7 +63240,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 200 /* ObjectLiteralExpression */) { + if (container.parent.kind === 197 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -64946,7 +63261,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 166 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 165 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -64961,7 +63276,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 166 /* Constructor */; + return container.kind === 165 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -64969,21 +63284,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 197 /* ObjectLiteralExpression */) { if (ts.hasSyntacticModifier(container, 32 /* Static */)) { - return container.kind === 165 /* MethodDeclaration */ || - container.kind === 164 /* MethodSignature */ || - container.kind === 167 /* GetAccessor */ || - container.kind === 168 /* SetAccessor */; + return container.kind === 164 /* MethodDeclaration */ || + container.kind === 163 /* MethodSignature */ || + container.kind === 166 /* GetAccessor */ || + container.kind === 167 /* SetAccessor */; } else { - return container.kind === 165 /* MethodDeclaration */ || - container.kind === 164 /* MethodSignature */ || - container.kind === 167 /* GetAccessor */ || - container.kind === 168 /* SetAccessor */ || - container.kind === 163 /* PropertyDeclaration */ || - container.kind === 162 /* PropertySignature */ || - container.kind === 166 /* Constructor */; + return container.kind === 164 /* MethodDeclaration */ || + container.kind === 163 /* MethodSignature */ || + container.kind === 166 /* GetAccessor */ || + container.kind === 167 /* SetAccessor */ || + container.kind === 162 /* PropertyDeclaration */ || + container.kind === 161 /* PropertySignature */ || + container.kind === 165 /* Constructor */; } } } @@ -64991,10 +63306,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 165 /* MethodDeclaration */ || - func.kind === 167 /* GetAccessor */ || - func.kind === 168 /* SetAccessor */) && func.parent.kind === 200 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 208 /* FunctionExpression */ && func.parent.kind === 288 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 164 /* MethodDeclaration */ || + func.kind === 166 /* GetAccessor */ || + func.kind === 167 /* SetAccessor */) && func.parent.kind === 197 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 205 /* FunctionExpression */ && func.parent.kind === 285 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -65006,7 +63321,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 209 /* ArrowFunction */) { + if (func.kind === 206 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -65033,7 +63348,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 288 /* PropertyAssignment */) { + if (literal.parent.kind !== 285 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -65047,7 +63362,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -65100,41 +63415,25 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 160 /* Parameter */: + case 159 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getContextualTypeForBindingElement(declaration); - case 163 /* PropertyDeclaration */: - if (ts.hasSyntacticModifier(declaration, 32 /* Static */)) { - return getContextualTypeForStaticPropertyDeclaration(declaration); - } - // By default, do nothing and return undefined - only the above cases have context implied by a parent + // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } } function getContextualTypeForBindingElement(declaration) { var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 198 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); - if (!parentType || ts.isBindingPattern(name) || ts.isComputedNonLiteralName(name)) - return undefined; - if (parent.name.kind === 197 /* ArrayBindingPattern */) { - var index = ts.indexOfNode(declaration.parent.elements, declaration); - if (index < 0) - return undefined; - return getContextualTypeForElementExpression(parentType, index); + parent.kind !== 195 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + if (parentType && !ts.isBindingPattern(name) && !ts.isComputedNonLiteralName(name)) { + var nameType = getLiteralTypeFromPropertyName(name); + if (isTypeUsableAsPropertyName(nameType)) { + var text = getPropertyNameFromType(nameType); + return getTypeOfPropertyOfType(parentType, text); + } } - var nameType = getLiteralTypeFromPropertyName(name); - if (isTypeUsableAsPropertyName(nameType)) { - var text = getPropertyNameFromType(nameType); - return getTypeOfPropertyOfType(parentType, text); - } - } - function getContextualTypeForStaticPropertyDeclaration(declaration) { - var parentType = ts.isExpression(declaration.parent) && getContextualType(declaration.parent); - if (!parentType) - return undefined; - return getTypeOfPropertyOfContextualType(parentType, getSymbolOfNode(declaration).escapedName); } // In a variable, parameter or property declaration with a type annotation, // the contextual type of an initializer expression is the type of the variable, parameter or property. @@ -65255,7 +63554,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 205 /* TaggedTemplateExpression */) { + if (template.parent.kind === 202 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -65268,7 +63567,14 @@ var ts; case 75 /* AmpersandAmpersandEqualsToken */: case 74 /* BarBarEqualsToken */: case 76 /* QuestionQuestionEqualsToken */: - return node === right ? getContextualTypeForAssignmentDeclaration(binaryExpression) : undefined; + if (node !== right) { + return undefined; + } + var contextSensitive = getIsContextSensitiveAssignmentOrContextType(binaryExpression); + if (!contextSensitive) { + return undefined; + } + return contextSensitive === true ? getTypeOfExpression(left) : contextSensitive; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: // When an || expression has a contextual type, the operands are contextually typed by that type, except @@ -65288,27 +63594,24 @@ var ts; } // In an assignment expression, the right operand is contextually typed by the type of the left operand. // Don't do this for assignment declarations unless there is a type tag on the assignment, to avoid circularity from checking the right operand. - function getContextualTypeForAssignmentDeclaration(binaryExpression) { + function getIsContextSensitiveAssignmentOrContextType(binaryExpression) { var kind = ts.getAssignmentDeclarationKind(binaryExpression); switch (kind) { case 0 /* None */: - return getTypeOfExpression(binaryExpression.left); + return true; case 5 /* Property */: case 1 /* ExportsProperty */: case 6 /* Prototype */: case 3 /* PrototypeProperty */: - if (isPossiblyAliasedThisProperty(binaryExpression, kind)) { - return getContextualTypeForThisPropertyAssignment(binaryExpression, kind); - } // If `binaryExpression.left` was assigned a symbol, then this is a new declaration; otherwise it is an assignment to an existing declaration. // See `bindStaticPropertyAssignment` in `binder.ts`. - else if (!binaryExpression.left.symbol) { - return getTypeOfExpression(binaryExpression.left); + if (!binaryExpression.left.symbol) { + return true; } else { var decl = binaryExpression.left.symbol.valueDeclaration; if (!decl) { - return undefined; + return false; } var lhs = ts.cast(binaryExpression.left, ts.isAccessExpression); var overallAnnotation = ts.getEffectiveTypeAnnotationNode(decl); @@ -65321,19 +63624,39 @@ var ts; if (parentSymbol) { var annotated = parentSymbol.valueDeclaration && ts.getEffectiveTypeAnnotationNode(parentSymbol.valueDeclaration); if (annotated) { - var nameStr = ts.getElementOrPropertyAccessName(lhs); - if (nameStr !== undefined) { - return getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr); + var nameStr_1 = ts.getElementOrPropertyAccessName(lhs); + if (nameStr_1 !== undefined) { + var type = getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr_1); + return type || false; } } - return undefined; + return false; } } - return ts.isInJSFile(decl) ? undefined : getTypeOfExpression(binaryExpression.left); + return !ts.isInJSFile(decl); } case 2 /* ModuleExports */: case 4 /* ThisProperty */: - return getContextualTypeForThisPropertyAssignment(binaryExpression, kind); + if (!binaryExpression.symbol) + return true; + if (binaryExpression.symbol.valueDeclaration) { + var annotated = ts.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); + if (annotated) { + var type = getTypeFromTypeNode(annotated); + if (type) { + return type; + } + } + } + if (kind === 2 /* ModuleExports */) + return false; + var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression); + if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, /*includeArrowFunctions*/ false))) { + return false; + } + var thisType = checkThisExpression(thisAccess.expression); + var nameStr = ts.getElementOrPropertyAccessName(thisAccess); + return nameStr !== undefined && thisType && getTypeOfPropertyOfContextualType(thisType, nameStr) || false; case 7 /* ObjectDefinePropertyValue */: case 8 /* ObjectDefinePropertyExports */: case 9 /* ObjectDefinePrototypeProperty */: @@ -65342,40 +63665,6 @@ var ts; return ts.Debug.assertNever(kind); } } - function isPossiblyAliasedThisProperty(declaration, kind) { - if (kind === void 0) { kind = ts.getAssignmentDeclarationKind(declaration); } - if (kind === 4 /* ThisProperty */) { - return true; - } - if (!ts.isInJSFile(declaration) || kind !== 5 /* Property */ || !ts.isIdentifier(declaration.left.expression)) { - return false; - } - var name = declaration.left.expression.escapedText; - var symbol = resolveName(declaration.left, name, 111551 /* Value */, undefined, undefined, /*isUse*/ true, /*excludeGlobals*/ true); - return ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration); - } - function getContextualTypeForThisPropertyAssignment(binaryExpression, kind) { - if (!binaryExpression.symbol) - return getTypeOfExpression(binaryExpression.left); - if (binaryExpression.symbol.valueDeclaration) { - var annotated = ts.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); - if (annotated) { - var type = getTypeFromTypeNode(annotated); - if (type) { - return type; - } - } - } - if (kind === 2 /* ModuleExports */) - return undefined; - var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression); - if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, /*includeArrowFunctions*/ false))) { - return undefined; - } - var thisType = checkThisExpression(thisAccess.expression); - var nameStr = ts.getElementOrPropertyAccessName(thisAccess); - return nameStr !== undefined && getTypeOfPropertyOfContextualType(thisType, nameStr) || undefined; - } function isCircularMappedProperty(symbol) { return !!(ts.getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0); } @@ -65445,8 +63734,7 @@ var ts; // type of T. function getContextualTypeForElementExpression(arrayContextualType, index) { return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) - || mapType(arrayContextualType, function (t) { return getIteratedTypeOrElementType(1 /* Element */, t, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false); }, - /*noReductions*/ true)); + || getIteratedTypeOrElementType(1 /* Element */, arrayContextualType, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false)); } // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type. function getContextualTypeForConditionalOperand(node, contextFlags) { @@ -65460,7 +63748,7 @@ var ts; if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) { return undefined; } - var realChildren = ts.getSemanticJsxChildren(node.children); + var realChildren = getSemanticJsxChildren(node.children); var childIndex = realChildren.indexOf(child); var childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName); return childFieldType && (realChildren.length === 1 ? childFieldType : mapType(childFieldType, function (t) { @@ -65508,21 +63796,21 @@ var ts; case 94 /* FalseKeyword */: case 103 /* NullKeyword */: case 78 /* Identifier */: - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: return true; - case 201 /* PropertyAccessExpression */: - case 207 /* ParenthesizedExpression */: + case 198 /* PropertyAccessExpression */: + case 204 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 288 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 285 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 280 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 277 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -65547,7 +63835,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -65570,7 +63858,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -65608,58 +63896,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 195 /* BindingElement */: return getContextualTypeForInitializerExpression(node, contextFlags); - case 209 /* ArrowFunction */: - case 242 /* ReturnStatement */: + case 206 /* ArrowFunction */: + case 239 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent, contextFlags); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (parent.expression.kind === 99 /* ImportKeyword */) { return stringType; } /* falls through */ - case 204 /* NewExpression */: + case 201 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(parent.type); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 199 /* ArrayLiteralExpression */: { + case 196 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 228 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 218 /* TemplateExpression */); + case 225 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 215 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 207 /* ParenthesizedExpression */: { + case 204 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 280 /* JsxAttribute */: - case 282 /* JsxSpreadAttribute */: + case 277 /* JsxAttribute */: + case 279 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -65822,7 +64110,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 208 /* FunctionExpression */ || node.kind === 209 /* ArrowFunction */; + return node.kind === 205 /* FunctionExpression */ || node.kind === 206 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -65836,7 +64124,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -65850,8 +64138,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var current = types_18[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var current = types_17[_i]; var signature = getContextualCallSignature(current, node); if (signature) { if (!signatureList) { @@ -65884,8 +64172,8 @@ var ts; return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type; } function hasDefaultValue(node) { - return (node.kind === 198 /* BindingElement */ && !!node.initializer) || - (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 195 /* BindingElement */ && !!node.initializer) || + (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -65897,7 +64185,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - if (e.kind === 220 /* SpreadElement */) { + if (e.kind === 217 /* SpreadElement */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 2048 /* SpreadArrays */); } @@ -65960,7 +64248,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return isNumericComputedName(name); case 78 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -66010,7 +64298,7 @@ var ts; // This will allow types number, string, symbol or any. It will also allow enums, the unknown // type, and any union of these types (like string | number). if (links.resolvedType.flags & 98304 /* Nullable */ || - !isTypeAssignableToKind(links.resolvedType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && + !isTypeAssignableToKind(links.resolvedType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) { error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } @@ -66056,7 +64344,7 @@ var ts; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 196 /* ObjectBindingPattern */ || contextualType.pattern.kind === 200 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 193 /* ObjectBindingPattern */ || contextualType.pattern.kind === 197 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -66079,16 +64367,16 @@ var ts; for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var memberDecl = _c[_b]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 158 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 157 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 288 /* PropertyAssignment */ || - memberDecl.kind === 289 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 285 /* PropertyAssignment */ || + memberDecl.kind === 286 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 288 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + var type = memberDecl.kind === 285 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`. // we don't want to say "could not find 'a'". - memberDecl.kind === 289 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : + memberDecl.kind === 286 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -66111,8 +64399,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 288 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 289 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 285 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 286 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -66138,7 +64426,7 @@ var ts; member = prop; allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 290 /* SpreadAssignment */) { + else if (memberDecl.kind === 287 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -66167,7 +64455,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 167 /* GetAccessor */ || memberDecl.kind === 168 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 166 /* GetAccessor */ || memberDecl.kind === 167 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -66192,7 +64480,7 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 290 /* SpreadAssignment */) { + if (contextualTypeHasPattern && node.parent.kind !== 287 /* SpreadAssignment */) { for (var _d = 0, _e = getPropertiesOfType(contextualType); _d < _e.length; _d++) { var prop = _e[_d]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { @@ -66234,7 +64522,7 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); @@ -66246,6 +64534,7 @@ var ts; } function checkJsxSelfClosingElementDeferred(node) { checkJsxOpeningLikeElementOrOpeningFragment(node); + resolveUntypedCall(node); // ensure type arguments and parameters are typechecked, even if there is an arity error } function checkJsxSelfClosingElement(node, _checkMode) { checkNodeDeferred(node); @@ -66272,7 +64561,7 @@ var ts; // by default, jsx:'react' will use jsxFactory = React.createElement and jsxFragmentFactory = React.Fragment // if jsxFactory compiler option is provided, ensure jsxFragmentFactory compiler option or @jsxFrag pragma is provided too var nodeSourceFile = ts.getSourceFileOfNode(node); - if (ts.getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) + if (compilerOptions.jsx === 2 /* React */ && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) && !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) { error(node, compilerOptions.jsxFactory ? ts.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option @@ -66324,7 +64613,7 @@ var ts; if (ts.isJsxAttribute(attributeDecl)) { var exprType = checkJsxAttribute(attributeDecl, checkMode); objectFlags |= ts.getObjectFlags(exprType) & 3670016 /* PropagatingFlags */; - var attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName); + var attributeSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */ | member.flags, member.escapedName); attributeSymbol.declarations = member.declarations; attributeSymbol.parent = member.parent; if (member.valueDeclaration) { @@ -66339,7 +64628,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 282 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 279 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -66365,7 +64654,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 273 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 270 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -66379,7 +64668,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(openingLikeElement.attributes); var childrenContextualType = contextualType && getTypeOfPropertyOfContextualType(contextualType, jsxChildrenPropertyName); // If there are children in the body of JSX element, create dummy attribute "children" with the union of children types so that it will pass the attribute checking process - var childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName); + var childrenPropSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */, jsxChildrenPropertyName); childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && forEachType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes)); @@ -66422,9 +64711,6 @@ var ts; childrenTypes.push(stringType); } } - else if (child.kind === 283 /* JsxExpression */ && !child.expression) { - continue; // empty jsx expressions don't *really* count as present children - } else { childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); } @@ -66494,60 +64780,29 @@ var ts; } return links.resolvedSymbol; } - function getJsxNamespaceContainerForImplicitImport(location) { - var file = location && ts.getSourceFileOfNode(location); - var links = file && getNodeLinks(file); - if (links && links.jsxImplicitImportContainer === false) { - return undefined; - } - if (links && links.jsxImplicitImportContainer) { - return links.jsxImplicitImportContainer; - } - var runtimeImportSpecifier = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(compilerOptions, file), compilerOptions); - if (!runtimeImportSpecifier) { - return undefined; - } - var isClassic = ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Classic; - var errorMessage = isClassic - ? ts.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option - : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations; - var mod = resolveExternalModule(location, runtimeImportSpecifier, errorMessage, location); - var result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : undefined; - if (links) { - links.jsxImplicitImportContainer = result || false; - } - return result; - } function getJsxNamespaceAt(location) { var links = location && getNodeLinks(location); if (links && links.jsxNamespace) { return links.jsxNamespace; } if (!links || links.jsxNamespace !== false) { - var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); - if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { - var namespaceName = getJsxNamespace(location); - resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); - } + var namespaceName = getJsxNamespace(location); + var resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); if (resolvedNamespace) { var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */)); - if (candidate && candidate !== unknownSymbol) { + if (candidate) { if (links) { links.jsxNamespace = candidate; } return candidate; } - } - if (links) { - links.jsxNamespace = false; + if (links) { + links.jsxNamespace = false; + } } } // JSX global fallback - var s = resolveSymbol(getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined)); - if (s === unknownSymbol) { - return undefined; // TODO: GH#18217 - } - return s; // TODO: GH#18217 + return getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined); // TODO: GH#18217 } /** * Look into JSX namespace and then look for container with matching name as nameOfAttribPropContainer. @@ -66734,25 +64989,23 @@ var ts; checkGrammarJsxElement(node); } checkJsxPreconditions(node); - if (!getJsxNamespaceContainerForImplicitImport(node)) { - // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. - // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. - var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var jsxFactoryNamespace = getJsxNamespace(node); - var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; - // allow null as jsxFragmentFactory - var jsxFactorySym = void 0; - if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); - } - if (jsxFactorySym) { - // Mark local symbol as referenced here because it might not have been marked - // if jsx emit was not jsxFactory as there wont be error being emitted - jsxFactorySym.isReferenced = 67108863 /* All */; - // If react/jsxFactory symbol is alias, mark it as refereced - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { - markAliasSymbolAsReferenced(jsxFactorySym); - } + // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. + // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. + var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var jsxFactoryNamespace = getJsxNamespace(node); + var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + // allow null as jsxFragmentFactory + var jsxFactorySym; + if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); + } + if (jsxFactorySym) { + // Mark local symbol as referenced here because it might not have been marked + // if jsx emit was not jsxFactory as there wont be error being emitted + jsxFactorySym.isReferenced = 67108863 /* All */; + // If react/jsxFactory symbol is alias, mark it as refereced + if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); } } if (isNodeOpeningLikeElement) { @@ -66842,7 +65095,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 157 /* QualifiedName */ ? node.right : node.kind === 195 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 156 /* QualifiedName */ ? node.right : node.kind === 192 /* ImportType */ ? node : node.name; if (isSuper) { // TS 1.0 spec (April 2014): 4.8.2 // - In a constructor, instance member function, instance member accessor, or @@ -66996,7 +65249,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 207 /* ParenthesizedExpression */) { + while (node.parent.kind === 204 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -67054,10 +65307,10 @@ var ts; return false; } function isThisPropertyAccessInConstructor(node, prop) { - return (isConstructorDeclaredProperty(prop) || ts.isThisProperty(node) && isAutoTypedProperty(prop)) - && ts.getThisContainer(node, /*includeArrowFunctions*/ true) === getDeclaringConstructor(prop); + return ts.isThisProperty(node) && (isAutoTypedProperty(prop) || isConstructorDeclaredProperty(prop)) && ts.getThisContainer(node, /*includeArrowFunctions*/ true) === getDeclaringConstructor(prop); } function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right) { + var _a; var parentSymbol = getNodeLinks(left).resolvedSymbol; var assignmentKind = ts.getAssignmentTargetKind(node); var apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType); @@ -67119,10 +65372,10 @@ var ts; if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) { error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); } - propType = (compilerOptions.noUncheckedIndexedAccess && !ts.isAssignmentTarget(node)) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + propType = indexInfo.type; } else { - if (getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) { + if (((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.flags) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) { errorOrSuggestion(/* isError */ false, right, ts.Diagnostics._0_is_deprecated, right.escapedText); } checkPropertyNotUsedBeforeDeclaration(prop, node, right); @@ -67159,7 +65412,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 166 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 165 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -67191,8 +65444,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 252 /* ClassDeclaration */ && - node.parent.kind !== 173 /* TypeReference */ && + else if (valueDeclaration.kind === 249 /* ClassDeclaration */ && + node.parent.kind !== 172 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -67204,22 +65457,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return true; - case 288 /* PropertyAssignment */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 290 /* SpreadAssignment */: - case 158 /* ComputedPropertyName */: - case 228 /* TemplateSpan */: - case 283 /* JsxExpression */: - case 280 /* JsxAttribute */: - case 281 /* JsxAttributes */: - case 282 /* JsxSpreadAttribute */: - case 275 /* JsxOpeningElement */: - case 223 /* ExpressionWithTypeArguments */: - case 286 /* HeritageClause */: + case 285 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 287 /* SpreadAssignment */: + case 157 /* ComputedPropertyName */: + case 225 /* TemplateSpan */: + case 280 /* JsxExpression */: + case 277 /* JsxAttribute */: + case 278 /* JsxAttributes */: + case 279 /* JsxSpreadAttribute */: + case 272 /* JsxOpeningElement */: + case 220 /* ExpressionWithTypeArguments */: + case 283 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -67275,22 +65528,14 @@ var ts; relatedInfo = ts.createDiagnosticForNode(propNode, ts.Diagnostics.Did_you_forget_to_use_await); } else { - var missingProperty = ts.declarationNameToString(propNode); - var container = typeToString(containingType); - var libSuggestion = getSuggestedLibForNonExistentProperty(missingProperty, containingType); - if (libSuggestion !== undefined) { - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later, missingProperty, container, libSuggestion); + var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); + if (suggestion !== undefined) { + var suggestedName = ts.symbolName(suggestion); + errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, ts.declarationNameToString(propNode), typeToString(containingType), suggestedName); + relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName); } else { - var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); - if (suggestion !== undefined) { - var suggestedName = ts.symbolName(suggestion); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, missingProperty, container, suggestedName); - relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName); - } - else { - errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, missingProperty, container); - } + errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(propNode), typeToString(containingType)); } } } @@ -67304,34 +65549,6 @@ var ts; var prop = containingType.symbol && getPropertyOfType(getTypeOfSymbol(containingType.symbol), propName); return prop !== undefined && prop.valueDeclaration && ts.hasSyntacticModifier(prop.valueDeclaration, 32 /* Static */); } - function getSuggestedLibForNonExistentName(name) { - var missingName = diagnosticName(name); - var allFeatures = ts.getScriptTargetFeatures(); - var libTargets = ts.getOwnKeys(allFeatures); - for (var _i = 0, libTargets_1 = libTargets; _i < libTargets_1.length; _i++) { - var libTarget = libTargets_1[_i]; - var containingTypes = ts.getOwnKeys(allFeatures[libTarget]); - if (containingTypes !== undefined && ts.contains(containingTypes, missingName)) { - return libTarget; - } - } - } - function getSuggestedLibForNonExistentProperty(missingProperty, containingType) { - var container = getApparentType(containingType).symbol; - if (!container) { - return undefined; - } - var allFeatures = ts.getScriptTargetFeatures(); - var libTargets = ts.getOwnKeys(allFeatures); - for (var _i = 0, libTargets_2 = libTargets; _i < libTargets_2.length; _i++) { - var libTarget = libTargets_2[_i]; - var featuresOfLib = allFeatures[libTarget]; - var featuresOfContainingType = featuresOfLib[ts.symbolName(container)]; - if (featuresOfContainingType !== undefined && ts.contains(featuresOfContainingType, missingProperty)) { - return libTarget; - } - } - } function getSuggestedSymbolForNonexistentProperty(name, containingType) { return getSpellingSuggestionForName(ts.isString(name) ? name : ts.idText(name), getPropertiesOfType(containingType), 111551 /* Value */); } @@ -67452,16 +65669,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 105 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 195 /* ImportType */: + case 192 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 201 /* PropertyAccessExpression */ && node.expression.kind === 105 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 198 /* PropertyAccessExpression */ && node.expression.kind === 105 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -67484,7 +65701,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 250 /* VariableDeclarationList */) { + if (initializer.kind === 247 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -67513,7 +65730,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 238 /* ForInStatement */ && + if (node.kind === 235 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -67550,7 +65767,7 @@ var ts; var accessFlags = ts.isAssignmentTarget(node) ? 2 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 /* NoIndexSignatures */ : 0) : 0 /* None */; - var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, accessFlags | 16 /* ExpressionPosition */) || errorType; + var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType; return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node); } function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { @@ -67597,13 +65814,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 161 /* Decorator */) { + else if (node.kind !== 160 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -67667,7 +65884,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 220 /* SpreadElement */ || arg.kind === 227 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 217 /* SpreadElement */ || arg.kind === 224 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -67675,18 +65892,15 @@ var ts; function acceptsVoid(t) { return !!(t.flags & 16384 /* Void */); } - function acceptsVoidUndefinedUnknownOrAny(t) { - return !!(t.flags & (16384 /* Void */ | 32768 /* Undefined */ | 2 /* Unknown */ | 1 /* Any */)); - } function hasCorrectArity(node, args, signature, signatureHelpTrailingComma) { if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } var argCount; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 218 /* TemplateExpression */) { + if (node.template.kind === 215 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -67701,7 +65915,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 161 /* Decorator */) { + else if (node.kind === 160 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -67715,7 +65929,7 @@ var ts; } else if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 204 /* NewExpression */); + ts.Debug.assert(node.kind === 201 /* NewExpression */); return getMinArgumentCount(signature) === 0; } else { @@ -67739,7 +65953,7 @@ var ts; } for (var i = argCount; i < effectiveMinimumArguments; i++) { var type = getTypeAtPosition(signature, i); - if (filterType(type, ts.isInJSFile(node) && !strictNullChecks ? acceptsVoidUndefinedUnknownOrAny : acceptsVoid).flags & 131072 /* Never */) { + if (filterType(type, acceptsVoid).flags & 131072 /* Never */) { return false; } } @@ -67809,7 +66023,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 161 /* Decorator */) { + if (node.kind !== 160 /* Decorator */) { var contextualType = getContextualType(node, ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); }) ? 8 /* SkipBindingPatterns */ : 0 /* None */); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -67858,7 +66072,7 @@ var ts; } for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 222 /* OmittedExpression */) { + if (arg.kind !== 219 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -67882,7 +66096,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return getMutableArrayOrTupleType(arg.kind === 227 /* SyntheticExpression */ ? arg.type : + return getMutableArrayOrTupleType(arg.kind === 224 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode)); } } @@ -67892,24 +66106,24 @@ var ts; for (var i = index; i < argCount; i++) { var arg = args[i]; if (isSpreadArgument(arg)) { - var spreadType = arg.kind === 227 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); + var spreadType = arg.kind === 224 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); if (isArrayLikeType(spreadType)) { types.push(spreadType); flags.push(8 /* Variadic */); } else { - types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 220 /* SpreadElement */ ? arg.expression : arg)); + types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 217 /* SpreadElement */ ? arg.expression : arg)); flags.push(4 /* Rest */); } } else { var contextualType = getIndexedAccessType(restType, getLiteralType(i - index)); var argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode); - var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */); types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(1 /* Required */); } - if (arg.kind === 227 /* SyntheticExpression */ && arg.tupleNameSource) { + if (arg.kind === 224 /* SyntheticExpression */ && arg.tupleNameSource) { names.push(arg.tupleNameSource); } } @@ -68050,7 +66264,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 204 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 201 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -68080,7 +66294,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 222 /* OmittedExpression */) { + if (arg.kind !== 219 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -68121,7 +66335,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -68138,17 +66352,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 218 /* TemplateExpression */) { + if (template.kind === 215 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 161 /* Decorator */) { + if (node.kind === 160 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -68159,10 +66373,10 @@ var ts; if (spreadIndex >= 0) { // Create synthetic arguments from spreads of tuple types. var effectiveArgs_1 = args.slice(0, spreadIndex); - var _loop_20 = function (i) { + var _loop_19 = function (i) { var arg = args[i]; // We can call checkExpressionCached because spread expressions never have a contextual type. - var spreadType = arg.kind === 220 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); + var spreadType = arg.kind === 217 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); if (spreadType && isTupleType(spreadType)) { ts.forEach(getTypeArguments(spreadType), function (t, i) { var _a; @@ -68176,7 +66390,7 @@ var ts; } }; for (var i = spreadIndex; i < args.length; i++) { - _loop_20(i); + _loop_19(i); } return effectiveArgs_1; } @@ -68189,30 +66403,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 160 /* Parameter */: + case 159 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 166 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 165 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 163 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 162 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -68226,17 +66440,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return 1; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return 2; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 160 /* Parameter */: + case 159 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -68267,20 +66481,6 @@ var ts; return ts.createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); } } - function isPromiseResolveArityError(node) { - if (!ts.isCallExpression(node) || !ts.isIdentifier(node.expression)) - return false; - var symbol = resolveName(node.expression, node.expression.escapedText, 111551 /* Value */, undefined, undefined, false); - var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration; - if (!decl || !ts.isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !ts.isNewExpression(decl.parent.parent) || !ts.isIdentifier(decl.parent.parent.expression)) { - return false; - } - var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(/*reportErrors*/ false); - if (!globalPromiseSymbol) - return false; - var constructorSymbol = getSymbolAtLocation(decl.parent.parent.expression, /*ignoreErrors*/ true); - return constructorSymbol === globalPromiseSymbol; - } function getArgumentArityError(node, signatures, args) { var min = Number.POSITIVE_INFINITY; var max = Number.NEGATIVE_INFINITY; @@ -68312,15 +66512,9 @@ var ts; } var spanArray; var related; - var error = hasRestParameter || hasSpreadArgument ? - hasRestParameter && hasSpreadArgument ? - ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more : - hasRestParameter ? - ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 : - ts.Diagnostics.Expected_0_arguments_but_got_1_or_more : - paramRange === 1 && argCount === 0 && isPromiseResolveArityError(node) ? - ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : - ts.Diagnostics.Expected_0_arguments_but_got_1; + var error = hasRestParameter || hasSpreadArgument ? hasRestParameter && hasSpreadArgument ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more : + hasRestParameter ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 : + ts.Diagnostics.Expected_0_arguments_but_got_1_or_more : ts.Diagnostics.Expected_0_arguments_but_got_1; if (closestSignature && getMinArgumentCount(closestSignature) > argCount && closestSignature.declaration) { var paramDecl = closestSignature.declaration.parameters[closestSignature.thisParameter ? argCount + 1 : argCount]; if (paramDecl) { @@ -68383,8 +66577,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 205 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 161 /* Decorator */; + var isTaggedTemplate = node.kind === 202 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 160 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray && produceDiagnostics; var typeArguments; @@ -68446,7 +66640,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 203 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 200 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -68458,10 +66652,10 @@ var ts; // is just important for choosing the best signature. So in the case where there is only one // signature, the subtype pass is useless. So skipping it is an optimization. if (candidates.length > 1) { - result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma); } if (!result) { - result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + result = chooseOverload(candidates, assignableRelation, signatureHelpTrailingComma); } if (result) { return result; @@ -68486,7 +66680,6 @@ var ts; if (last_2.declaration && candidatesForArgumentError.length > 3) { ts.addRelatedInfo(d, ts.createDiagnosticForNode(last_2.declaration, ts.Diagnostics.The_last_overload_is_declared_here)); } - addImplementationSuccessElaboration(last_2, d); diagnostics.add(d); } } @@ -68500,7 +66693,7 @@ var ts; var min_3 = Number.MAX_VALUE; var minIndex = 0; var i_1 = 0; - var _loop_21 = function (c) { + var _loop_20 = function (c) { var chain_2 = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); }; var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* Normal */, /*reportErrors*/ true, chain_2); if (diags_2) { @@ -68518,24 +66711,19 @@ var ts; }; for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) { var c = candidatesForArgumentError_1[_a]; - _loop_21(c); + _loop_20(c); } var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics); ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures"); var chain = ts.chainDiagnosticMessages(ts.map(diags_3, function (d) { return typeof d.messageText === "string" ? d : d.messageText; }), ts.Diagnostics.No_overload_matches_this_call); - // The below is a spread to guarantee we get a new (mutable) array - our `flatMap` helper tries to do "smart" optimizations where it reuses input - // arrays and the emptyArray singleton where possible, which is decidedly not what we want while we're still constructing this diagnostic - var related = __spreadArrays(ts.flatMap(diags_3, function (d) { return d.relatedInformation; })); - var diag = void 0; + var related = ts.flatMap(diags_3, function (d) { return d.relatedInformation; }); if (ts.every(diags_3, function (d) { return d.start === diags_3[0].start && d.length === diags_3[0].length && d.file === diags_3[0].file; })) { var _b = diags_3[0], file = _b.file, start = _b.start, length_6 = _b.length; - diag = { file: file, start: start, length: length_6, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }; + diagnostics.add({ file: file, start: start, length: length_6, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }); } else { - diag = ts.createDiagnosticForNodeFromMessageChain(node, chain, related); + diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(node, chain, related)); } - addImplementationSuccessElaboration(candidatesForArgumentError[0], diag); - diagnostics.add(diag); } } else if (candidateForArgumentArityError) { @@ -68558,26 +66746,7 @@ var ts; } } return getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray); - function addImplementationSuccessElaboration(failed, diagnostic) { - var _a, _b; - var oldCandidatesForArgumentError = candidatesForArgumentError; - var oldCandidateForArgumentArityError = candidateForArgumentArityError; - var oldCandidateForTypeArgumentError = candidateForTypeArgumentError; - var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray; - var isOverload = failedSignatureDeclarations.length > 1; - var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined; - if (implDecl) { - var candidate = getSignatureFromDeclaration(implDecl); - var isSingleNonGenericCandidate_1 = !candidate.typeParameters; - if (chooseOverload([candidate], assignableRelation, isSingleNonGenericCandidate_1)) { - ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(implDecl, ts.Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible)); - } - } - candidatesForArgumentError = oldCandidatesForArgumentError; - candidateForArgumentArityError = oldCandidateForArgumentArityError; - candidateForTypeArgumentError = oldCandidateForTypeArgumentError; - } - function chooseOverload(candidates, relation, isSingleNonGenericCandidate, signatureHelpTrailingComma) { + function chooseOverload(candidates, relation, signatureHelpTrailingComma) { if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } candidatesForArgumentError = undefined; candidateForArgumentArityError = undefined; @@ -68676,7 +66845,7 @@ var ts; } var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max; var parameters = []; - var _loop_22 = function (i) { + var _loop_21 = function (i) { var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ? i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) : i < s.parameters.length ? s.parameters[i] : undefined; }); @@ -68684,7 +66853,7 @@ var ts; parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); }))); }; for (var i = 0; i < maxNonRestParam; i++) { - _loop_22(i); + _loop_21(i); } var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; }); var flags = 0 /* None */; @@ -68987,7 +67156,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedEffectiveModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 166 /* Constructor */) { + if (!modifiers || declaration.kind !== 165 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -69019,8 +67188,8 @@ var ts; if (apparentType.flags & 1048576 /* Union */) { var types = apparentType.types; var hasSignatures = false; - for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { - var constituent = types_19[_i]; + for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { + var constituent = types_18[_i]; var signatures = getSignaturesOfType(constituent, kind); if (signatures.length !== 0) { hasSignatures = true; @@ -69116,11 +67285,6 @@ var ts; return resolveUntypedCall(node); } if (!callSignatures.length) { - if (ts.isArrayLiteralExpression(node.parent)) { - var diagnostic = ts.createDiagnosticForNode(node.tag, ts.Diagnostics.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked); - diagnostics.add(diagnostic); - return resolveErrorCall(node); - } invocationError(node.tag, apparentType, 0 /* Call */); return resolveErrorCall(node); } @@ -69131,16 +67295,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 160 /* Parameter */: + case 159 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -69199,10 +67363,6 @@ var ts; var result = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); var fakeSignature = createSignatureForJSXIntrinsic(node, result); checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), /*mapper*/ undefined, 0 /* Normal */), result, node.tagName, node.attributes); - if (ts.length(node.typeArguments)) { - ts.forEach(node.typeArguments, checkSourceElement); - diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), node.typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, 0, ts.length(node.typeArguments))); - } return fakeSignature; } var exprTypes = checkExpression(node.tagName); @@ -69235,16 +67395,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 161 /* Decorator */: + case 160 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -69322,61 +67482,20 @@ var ts; } } function getAssignedClassSymbol(decl) { - var _a; - var assignmentSymbol = decl && getSymbolOfExpando(decl, /*allowDeclaration*/ true); - var prototype = (_a = assignmentSymbol === null || assignmentSymbol === void 0 ? void 0 : assignmentSymbol.exports) === null || _a === void 0 ? void 0 : _a.get("prototype"); - var init = (prototype === null || prototype === void 0 ? void 0 : prototype.valueDeclaration) && getAssignedJSPrototype(prototype.valueDeclaration); + var assignmentSymbol = decl && decl.parent && + (ts.isFunctionDeclaration(decl) && getSymbolOfNode(decl) || + ts.isBinaryExpression(decl.parent) && getSymbolOfNode(decl.parent.left) || + ts.isVariableDeclaration(decl.parent) && getSymbolOfNode(decl.parent)); + var prototype = assignmentSymbol && assignmentSymbol.exports && assignmentSymbol.exports.get("prototype"); + var init = prototype && prototype.valueDeclaration && getAssignedJSPrototype(prototype.valueDeclaration); return init ? getSymbolOfNode(init) : undefined; } - function getSymbolOfExpando(node, allowDeclaration) { - if (!node.parent) { - return undefined; - } - var name; - var decl; - if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) { - if (!ts.isInJSFile(node) && !(ts.isVarConst(node.parent) && ts.isFunctionLikeDeclaration(node))) { - return undefined; - } - name = node.parent.name; - decl = node.parent; - } - else if (ts.isBinaryExpression(node.parent)) { - var parentNode = node.parent; - var parentNodeOperator = node.parent.operatorToken.kind; - if (parentNodeOperator === 62 /* EqualsToken */ && (allowDeclaration || parentNode.right === node)) { - name = parentNode.left; - decl = name; - } - else if (parentNodeOperator === 56 /* BarBarToken */ || parentNodeOperator === 60 /* QuestionQuestionToken */) { - if (ts.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { - name = parentNode.parent.name; - decl = parentNode.parent; - } - else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 /* EqualsToken */ && (allowDeclaration || parentNode.parent.right === parentNode)) { - name = parentNode.parent.left; - decl = name; - } - if (!name || !ts.isBindableStaticNameExpression(name) || !ts.isSameEntityName(name, parentNode.left)) { - return undefined; - } - } - } - else if (allowDeclaration && ts.isFunctionDeclaration(node)) { - name = node.name; - decl = node; - } - if (!decl || !name || (!allowDeclaration && !ts.getExpandoInitializer(node, ts.isPrototypeAccess(name)))) { - return undefined; - } - return getSymbolOfNode(decl); - } function getAssignedJSPrototype(node) { if (!node.parent) { return false; } var parent = node.parent; - while (parent && parent.kind === 201 /* PropertyAccessExpression */) { + while (parent && parent.kind === 198 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -69403,12 +67522,12 @@ var ts; if (node.expression.kind === 105 /* SuperKeyword */) { return voidType; } - if (node.kind === 204 /* NewExpression */) { + if (node.kind === 201 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 166 /* Constructor */ && - declaration.kind !== 170 /* ConstructSignature */ && - declaration.kind !== 175 /* ConstructorType */ && + declaration.kind !== 165 /* Constructor */ && + declaration.kind !== 169 /* ConstructSignature */ && + declaration.kind !== 174 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -69428,7 +67547,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 203 /* CallExpression */ && node.parent.kind === 233 /* ExpressionStatement */ && + if (node.kind === 200 /* CallExpression */ && node.parent.kind === 230 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -69439,11 +67558,14 @@ var ts; } } if (ts.isInJSFile(node)) { - var jsSymbol = getSymbolOfExpando(node, /*allowDeclaration*/ false); - if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) { - var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined); - jsAssignmentType.objectFlags |= 16384 /* JSLiteral */; - return getIntersectionType([returnType, jsAssignmentType]); + var decl = ts.getDeclarationOfExpando(node); + if (decl) { + var jsSymbol = getSymbolOfNode(decl); + if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) { + var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined); + jsAssignmentType.objectFlags |= 16384 /* JSLiteral */; + return getIntersectionType([returnType, jsAssignmentType]); + } } } return returnType; @@ -69457,20 +67579,20 @@ var ts; function getDeprecatedSuggestionNode(node) { node = ts.skipParentheses(node); switch (node.kind) { - case 203 /* CallExpression */: - case 161 /* Decorator */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 160 /* Decorator */: + case 201 /* NewExpression */: return getDeprecatedSuggestionNode(node.expression); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return getDeprecatedSuggestionNode(node.tag); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return getDeprecatedSuggestionNode(node.tagName); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return node.argumentExpression; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.name; - case 173 /* TypeReference */: + case 172 /* TypeReference */: var typeReference = node; return ts.isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference; default: @@ -69529,7 +67651,6 @@ var ts; if (hasSyntheticDefault) { var memberTable = ts.createSymbolTable(); var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */); - newSymbol.parent = originalSymbol; newSymbol.nameType = getLiteralType("default"); newSymbol.target = resolveSymbol(symbol); memberTable.set("default" /* Default */, newSymbol); @@ -69562,9 +67683,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 251 /* FunctionDeclaration */ + ? 248 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 249 /* VariableDeclaration */ + ? 246 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -69594,19 +67715,18 @@ var ts; case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 218 /* TemplateExpression */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return true; - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -69662,7 +67782,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 166 /* Constructor */) { + else if (container.kind === 165 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -69672,8 +67792,8 @@ var ts; } } function checkImportMetaProperty(node) { - if (moduleKind !== ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) { - error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system); + if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) { + error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system); } var file = ts.getSourceFileOfNode(node); ts.Debug.assert(!!(file.flags & 2097152 /* PossiblyContainsImportMeta */), "Containing file is missing import meta node flag."); @@ -69709,7 +67829,7 @@ var ts; return restParameter.escapedName; } function isValidDeclarationForTupleLabel(d) { - return d.kind === 192 /* NamedTupleMember */ || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name)); + return d.kind === 191 /* NamedTupleMember */ || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name)); } function getNameableDeclarationAtPosition(signature, pos) { var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); @@ -69782,40 +67902,21 @@ var ts; } return length; } - function getMinArgumentCount(signature, flags) { - var strongArityForUntypedJS = flags & 1 /* StrongArityForUntypedJS */; - var voidIsNonOptional = flags & 2 /* VoidIsNonOptional */; - if (voidIsNonOptional || signature.resolvedMinArgumentCount === undefined) { - var minArgumentCount = void 0; - if (signatureHasRestParameter(signature)) { - var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - if (isTupleType(restType)) { - var firstOptionalIndex = ts.findIndex(restType.target.elementFlags, function (f) { return !(f & 1 /* Required */); }); - var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; - if (requiredCount > 0) { - minArgumentCount = signature.parameters.length - 1 + requiredCount; - } + function getMinArgumentCount(signature, strongArityForUntypedJS) { + if (signatureHasRestParameter(signature)) { + var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + if (isTupleType(restType)) { + var firstOptionalIndex = ts.findIndex(restType.target.elementFlags, function (f) { return !(f & 1 /* Required */); }); + var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; + if (requiredCount > 0) { + return signature.parameters.length - 1 + requiredCount; } } - if (minArgumentCount === undefined) { - if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { - return 0; - } - minArgumentCount = signature.minArgumentCount; - } - if (voidIsNonOptional) { - return minArgumentCount; - } - for (var i = minArgumentCount - 1; i >= 0; i--) { - var type = getTypeAtPosition(signature, i); - if (filterType(type, acceptsVoid).flags & 131072 /* Never */) { - break; - } - minArgumentCount = i; - } - signature.resolvedMinArgumentCount = minArgumentCount; } - return signature.resolvedMinArgumentCount; + if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { + return 0; + } + return signature.minArgumentCount; } function hasEffectiveRestParameter(signature) { if (signatureHasRestParameter(signature)) { @@ -69981,7 +68082,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 230 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 227 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -70166,7 +68267,7 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 211 /* TypeOfExpression */) { + if (node.expression.kind === 208 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. @@ -70229,11 +68330,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; - case 165 /* MethodDeclaration */: - return func.parent.kind === 200 /* ObjectLiteralExpression */; + case 164 /* MethodDeclaration */: + return func.parent.kind === 197 /* ObjectLiteralExpression */; default: return false; } @@ -70259,7 +68360,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 164 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 230 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 163 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 227 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -70292,7 +68393,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -70316,7 +68417,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 208 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 205 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -70362,7 +68463,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -70375,7 +68476,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 230 /* Block */) { + if (node.body.kind === 227 /* Block */) { checkSourceElement(node.body); } else { @@ -70465,7 +68566,7 @@ var ts; expr.expression.kind === 107 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && (ctor.kind === 166 /* Constructor */ || isJSConstructor(ctor)))) { + if (!(ctor && (ctor.kind === 165 /* Constructor */ || isJSConstructor(ctor)))) { return true; } if (symbol.valueDeclaration) { @@ -70490,7 +68591,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 263 /* NamespaceImport */; + return !!declaration && declaration.kind === 260 /* NamespaceImport */; } } } @@ -70571,7 +68672,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 166 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 165 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -70673,8 +68774,8 @@ var ts; } if (type.flags & 3145728 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { - var t = types_20[_i]; + for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { + var t = types_19[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -70691,7 +68792,7 @@ var ts; } return !!(kind & 296 /* NumberLike */) && isTypeAssignableTo(source, numberType) || !!(kind & 2112 /* BigIntLike */) && isTypeAssignableTo(source, bigintType) || - !!(kind & 402653316 /* StringLike */) && isTypeAssignableTo(source, stringType) || + !!(kind & 132 /* StringLike */) && isTypeAssignableTo(source, stringType) || !!(kind & 528 /* BooleanLike */) && isTypeAssignableTo(source, booleanType) || !!(kind & 16384 /* Void */) && isTypeAssignableTo(source, voidType) || !!(kind & 131072 /* Never */) && isTypeAssignableTo(source, neverType) || @@ -70740,8 +68841,8 @@ var ts; // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, // and the right operand to be of type Any, an object type, or a type parameter type. // The result is always of the Boolean primitive type. - if (!(allTypesAssignableToKind(leftType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) || - isTypeAssignableToKind(leftType, 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */ | 262144 /* TypeParameter */))) { + if (!(allTypesAssignableToKind(leftType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) || + isTypeAssignableToKind(leftType, 4194304 /* Index */ | 262144 /* TypeParameter */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { @@ -70764,7 +68865,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 288 /* PropertyAssignment */ || property.kind === 289 /* ShorthandPropertyAssignment */) { + if (property.kind === 285 /* PropertyAssignment */ || property.kind === 286 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -70775,11 +68876,11 @@ var ts; checkPropertyAccessibility(property, /*isSuper*/ false, objectLiteralType, prop); } } - var elementType = getIndexedAccessType(objectLiteralType, exprType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */); + var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 289 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 286 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 290 /* SpreadAssignment */) { + else if (property.kind === 287 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -70813,28 +68914,23 @@ var ts; // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType; - var inBoundsType = compilerOptions.noUncheckedIndexedAccess ? undefined : possiblyOutOfBoundsType; + var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType; for (var i = 0; i < elements.length; i++) { - var type = possiblyOutOfBoundsType; - if (node.elements[i].kind === 220 /* SpreadElement */) { - type = inBoundsType = inBoundsType !== null && inBoundsType !== void 0 ? inBoundsType : (checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType); - } - checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode); + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode); } return sourceType; } function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 222 /* OmittedExpression */) { - if (element.kind !== 220 /* SpreadElement */) { + if (element.kind !== 219 /* OmittedExpression */) { + if (element.kind !== 217 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused // when the element is a SyntaxKind.ElementAccessExpression. - var accessFlags = 16 /* ExpressionPosition */ | (hasDefaultValue(element) ? 8 /* NoTupleBoundsCheck */ : 0); - var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, createSyntheticExpression(element, indexType), accessFlags) || errorType; + var accessFlags = hasDefaultValue(element) ? 8 /* NoTupleBoundsCheck */ : 0; + var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, createSyntheticExpression(element, indexType), accessFlags) || errorType; var assignedType = hasDefaultValue(element) ? getTypeWithFacts(elementType_2, 524288 /* NEUndefined */) : elementType_2; var type = getFlowTypeOfDestructuring(element, assignedType); return checkDestructuringAssignment(element, type, checkMode); @@ -70846,7 +68942,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 216 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 213 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -70862,7 +68958,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 289 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 286 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -70878,24 +68974,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 213 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 200 /* ObjectLiteralExpression */) { + if (target.kind === 197 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 199 /* ArrayLiteralExpression */) { + if (target.kind === 196 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 290 /* SpreadAssignment */ ? + var error = target.parent.kind === 287 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 290 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 287 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -70920,36 +69016,36 @@ var ts; case 78 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 205 /* TaggedTemplateExpression */: - case 218 /* TemplateExpression */: + case 202 /* TaggedTemplateExpression */: + case 215 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: case 103 /* NullKeyword */: - case 150 /* UndefinedKeyword */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: - case 209 /* ArrowFunction */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 211 /* TypeOfExpression */: - case 225 /* NonNullExpression */: - case 274 /* JsxSelfClosingElement */: - case 273 /* JsxElement */: + case 149 /* UndefinedKeyword */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 208 /* TypeOfExpression */: + case 222 /* NonNullExpression */: + case 271 /* JsxSelfClosingElement */: + case 270 /* JsxElement */: return true; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -70961,9 +69057,9 @@ var ts; } return false; // Some forms listed here for clarity - case 212 /* VoidExpression */: // Explicit opt-out - case 206 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 224 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 209 /* VoidExpression */: // Explicit opt-out + case 203 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 221 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -70995,7 +69091,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 200 /* ObjectLiteralExpression */ || node.left.kind === 199 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 197 /* ObjectLiteralExpression */ || node.left.kind === 196 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 107 /* ThisKeyword */)); break; } @@ -71062,7 +69158,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 200 /* ObjectLiteralExpression */ || left.kind === 199 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 197 /* ObjectLiteralExpression */ || left.kind === 196 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 107 /* ThisKeyword */); } var leftType; @@ -71155,7 +69251,7 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeAssignableToKind(leftType, 402653316 /* StringLike */) && !isTypeAssignableToKind(rightType, 402653316 /* StringLike */)) { + if (!isTypeAssignableToKind(leftType, 132 /* StringLike */) && !isTypeAssignableToKind(rightType, 132 /* StringLike */)) { leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); } @@ -71169,7 +69265,7 @@ var ts; // If both operands are of the BigInt primitive type, the result is of the BigInt primitive type. resultType = bigintType; } - else if (isTypeAssignableToKind(leftType, 402653316 /* StringLike */, /*strict*/ true) || isTypeAssignableToKind(rightType, 402653316 /* StringLike */, /*strict*/ true)) { + else if (isTypeAssignableToKind(leftType, 132 /* StringLike */, /*strict*/ true) || isTypeAssignableToKind(rightType, 132 /* StringLike */, /*strict*/ true)) { // If one or both operands are of the String primitive type, the result is of the String primitive type. resultType = stringType; } @@ -71187,7 +69283,7 @@ var ts; // If both types have an awaited type of one of these, we'll assume the user // might be missing an await without doing an exhaustive check that inserting // await(s) will actually be a completely valid binary expression. - var closeEnoughKind_1 = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 3 /* AnyOrUnknown */; + var closeEnoughKind_1 = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 3 /* AnyOrUnknown */; reportOperatorError(function (left, right) { return isTypeAssignableToKind(left, closeEnoughKind_1) && isTypeAssignableToKind(right, closeEnoughKind_1); @@ -71488,21 +69584,20 @@ var ts; return getUnionType([type1, type2], 2 /* Subtype */); } function checkTemplateExpression(node) { - var texts = [node.head.text]; - var types = []; - for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) { - var span = _a[_i]; - var type = checkExpression(span.expression); - if (maybeTypeOfKind(type, 12288 /* ESSymbolLike */)) { - error(span.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); + // We just want to check each expressions, but we are unconcerned with + // the type of each expression, as any value may be coerced into a string. + // It is worth asking whether this is what we really want though. + // A place where we actually *are* concerned with the expressions' types are + // in tagged templates. + ts.forEach(node.templateSpans, function (templateSpan) { + if (maybeTypeOfKind(checkExpression(templateSpan.expression), 12288 /* ESSymbolLike */)) { + error(templateSpan.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); } - texts.push(span.literal.text); - types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType); - } - return isConstContext(node) ? getTemplateLiteralType(texts, types) : stringType; + }); + return stringType; } function getContextNode(node) { - if (node.kind === 281 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 278 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -71551,13 +69646,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 206 /* TypeAssertionExpression */ || node.kind === 224 /* AsExpression */; + return node.kind === 203 /* TypeAssertionExpression */ || node.kind === 221 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 197 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 194 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -71567,7 +69662,7 @@ var ts; var elementFlags = type.target.elementFlags.slice(); for (var i = getTypeReferenceArity(type); i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 198 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 195 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); elementFlags.push(2 /* Optional */); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { @@ -71610,7 +69705,7 @@ var ts; } // If the contextual type is a literal of a particular primitive type, we consider this a // literal context for all literals of that primitive type. - return !!(contextualType.flags & (128 /* StringLiteral */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || + return !!(contextualType.flags & (128 /* StringLiteral */ | 4194304 /* Index */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || contextualType.flags & 256 /* NumberLiteral */ && maybeTypeOfKind(candidateType, 256 /* NumberLiteral */) || contextualType.flags & 2048 /* BigIntLiteral */ && maybeTypeOfKind(candidateType, 2048 /* BigIntLiteral */) || contextualType.flags & 512 /* BooleanLiteral */ && maybeTypeOfKind(candidateType, 512 /* BooleanLiteral */) || @@ -71622,7 +69717,7 @@ var ts; var parent = node.parent; return ts.isAssertionExpression(parent) && ts.isConstTypeReference(parent.type) || (ts.isParenthesizedExpression(parent) || ts.isArrayLiteralExpression(parent) || ts.isSpreadElement(parent)) && isConstContext(parent) || - (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent) || ts.isTemplateSpan(parent)) && isConstContext(parent.parent); + (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent)) && isConstContext(parent.parent); } function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) { var type = checkExpression(node, checkMode, forceTuple); @@ -71634,7 +69729,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -71645,7 +69740,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -71863,7 +69958,6 @@ var ts; } } function checkExpression(node, checkMode, forceTuple) { - ts.tracing.push("check" /* Check */, "checkExpression", { kind: node.kind, pos: node.pos, end: node.end }); var saveCurrentNode = currentNode; currentNode = node; instantiationCount = 0; @@ -71873,7 +69967,6 @@ var ts; checkConstEnumAccess(node, type); } currentNode = saveCurrentNode; - ts.tracing.pop(); return type; } function checkConstEnumAccess(node, type) { @@ -71881,11 +69974,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 202 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 176 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 270 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 199 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 78 /* Identifier */ || node.kind === 156 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 175 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 267 /* ExportSpecifier */); // We allow reexporting const enums if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -71910,9 +70003,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -71938,78 +70031,78 @@ var ts; return trueType; case 94 /* FalseKeyword */: return falseType; - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return checkQualifiedName(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (node.expression.kind === 99 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 204 /* NewExpression */: + case 201 /* NewExpression */: return checkCallExpression(node, checkMode); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return checkClassExpression(node); - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return checkAssertion(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return checkNonNullAssertion(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return checkMetaProperty(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return checkDeleteExpression(node); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return checkVoidExpression(node); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return checkAwaitExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 222 /* OmittedExpression */: + case 219 /* OmittedExpression */: return undefinedWideningType; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return checkYieldExpression(node); - case 227 /* SyntheticExpression */: + case 224 /* SyntheticExpression */: return checkSyntheticExpression(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return checkJsxElement(node, checkMode); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return checkJsxFragment(node); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -72046,10 +70139,10 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 166 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 165 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 166 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 165 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -72060,13 +70153,13 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 166 /* Constructor */ || func.kind === 170 /* ConstructSignature */ || func.kind === 175 /* ConstructorType */) { + if (func.kind === 165 /* Constructor */ || func.kind === 169 /* ConstructSignature */ || func.kind === 174 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 209 /* ArrowFunction */) { + if (func.kind === 206 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 167 /* GetAccessor */ || func.kind === 168 /* SetAccessor */) { + if (func.kind === 166 /* GetAccessor */ || func.kind === 167 /* SetAccessor */) { error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -72124,13 +70217,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 209 /* ArrowFunction */: - case 169 /* CallSignature */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 174 /* FunctionType */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 206 /* ArrowFunction */: + case 168 /* CallSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 173 /* FunctionType */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -72148,7 +70241,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 197 /* ArrayBindingPattern */ || name.kind === 196 /* ObjectBindingPattern */) { + else if (name.kind === 194 /* ArrayBindingPattern */ || name.kind === 193 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -72157,13 +70250,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 171 /* IndexSignature */) { + if (node.kind === 170 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 174 /* FunctionType */ || node.kind === 251 /* FunctionDeclaration */ || node.kind === 175 /* ConstructorType */ || - node.kind === 169 /* CallSignature */ || node.kind === 166 /* Constructor */ || - node.kind === 170 /* ConstructSignature */) { + else if (node.kind === 173 /* FunctionType */ || node.kind === 248 /* FunctionDeclaration */ || node.kind === 174 /* ConstructorType */ || + node.kind === 168 /* CallSignature */ || node.kind === 165 /* Constructor */ || + node.kind === 169 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -72193,10 +70286,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -72226,7 +70319,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 171 /* IndexSignature */ && node.kind !== 308 /* JSDocFunctionType */) { + if (node.kind !== 170 /* IndexSignature */ && node.kind !== 304 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -72238,7 +70331,7 @@ var ts; var privateIdentifiers = new ts.Map(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 166 /* Constructor */) { + if (member.kind === 165 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -72258,16 +70351,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -72330,7 +70423,7 @@ var ts; var names = new ts.Map(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 162 /* PropertySignature */) { + if (member.kind === 161 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -72355,7 +70448,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 253 /* InterfaceDeclaration */) { + if (node.kind === 250 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -72375,7 +70468,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -72383,7 +70476,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -72425,7 +70518,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 165 /* MethodDeclaration */ && node.body) { + if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 164 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -72453,7 +70546,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 163 /* PropertyDeclaration */ && + return n.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(n, 32 /* Static */) && !!n.initializer; } @@ -72484,7 +70577,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_4 = statements; _i < statements_4.length; _i++) { var statement = statements_4[_i]; - if (statement.kind === 233 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 230 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -72509,7 +70602,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -72519,7 +70612,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -72528,7 +70621,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + var otherKind = node.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getEffectiveModifierFlags(node); @@ -72546,7 +70639,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -72594,7 +70687,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 173 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 172 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -72643,27 +70736,28 @@ var ts; function checkTupleType(node) { var elementTypes = node.elements; var seenOptionalElement = false; - var seenRestElement = false; - var hasNamedElement = ts.some(elementTypes, ts.isNamedTupleMember); + var seenNamedElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind !== 192 /* NamedTupleMember */ && hasNamedElement) { + if (e.kind === 191 /* NamedTupleMember */) { + seenNamedElement = true; + } + else if (seenNamedElement) { grammarErrorOnNode(e, ts.Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names); break; } var flags = getTupleElementFlags(e); if (flags & 8 /* Variadic */) { - var type = getTypeFromTypeNode(e.type); - if (!isArrayLikeType(type)) { + if (!isArrayLikeType(getTypeFromTypeNode(e.type))) { error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); break; } - if (isArrayType(type) || isTupleType(type) && type.target.combinedFlags & 4 /* Rest */) { - seenRestElement = true; - } } else if (flags & 4 /* Rest */) { - seenRestElement = true; + if (i !== elementTypes.length - 1) { + grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); + break; + } } else if (flags & 2 /* Optional */) { seenOptionalElement = true; @@ -72672,17 +70766,11 @@ var ts; grammarErrorOnNode(e, ts.Diagnostics.A_required_element_cannot_follow_an_optional_element); break; } - if (seenRestElement && i !== elementTypes.length - 1) { - grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); - break; - } } ts.forEach(node.elements, checkSourceElement); - getTypeFromTypeNode(node); } function checkUnionOrIntersectionType(node) { ts.forEach(node.types, checkSourceElement); - getTypeFromTypeNode(node); } function checkIndexedAccessIndexType(type, accessNode) { if (!(type.flags & 8388608 /* IndexedAccess */)) { @@ -72692,7 +70780,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 202 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 199 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -72724,20 +70812,13 @@ var ts; } function checkMappedType(node) { checkSourceElement(node.typeParameter); - checkSourceElement(node.nameType); checkSourceElement(node.type); if (!node.type) { reportImplicitAny(node, anyType); } var type = getTypeFromMappedTypeNode(node); - var nameType = getNameTypeFromMappedType(type); - if (nameType) { - checkTypeAssignableTo(nameType, keyofConstraintType, node.nameType); - } - else { - var constraintType = getConstraintTypeFromMappedType(type); - checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter)); - } + var constraintType = getConstraintTypeFromMappedType(type); + checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter)); } function checkThisType(node) { getTypeFromThisTypeNode(node); @@ -72750,21 +70831,12 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 184 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 183 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); registerForUnusedIdentifiersCheck(node); } - function checkTemplateLiteralType(node) { - for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) { - var span = _a[_i]; - checkSourceElement(span.type); - var type = getTypeFromTypeNode(span.type); - checkTypeAssignableTo(type, templateConstraintType, span.type); - } - getTypeFromTypeNode(node); - } function checkImportType(node) { checkSourceElement(node.argument); getTypeFromTypeNode(node); @@ -72773,10 +70845,10 @@ var ts; if (node.dotDotDotToken && node.questionToken) { grammarErrorOnNode(node, ts.Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest); } - if (node.type.kind === 180 /* OptionalType */) { + if (node.type.kind === 179 /* OptionalType */) { grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type); } - if (node.type.kind === 181 /* RestType */) { + if (node.type.kind === 180 /* RestType */) { grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type); } checkSourceElement(node.type); @@ -72789,9 +70861,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 253 /* InterfaceDeclaration */ && - n.parent.kind !== 252 /* ClassDeclaration */ && - n.parent.kind !== 221 /* ClassExpression */ && + if (n.parent.kind !== 250 /* InterfaceDeclaration */ && + n.parent.kind !== 249 /* ClassDeclaration */ && + n.parent.kind !== 218 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -72887,7 +70959,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */) && + var reportError = (node.kind === 164 /* MethodDeclaration */ || node.kind === 163 /* MethodSignature */) && ts.hasSyntacticModifier(node, 32 /* Static */) !== ts.hasSyntacticModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -72928,7 +71000,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent && (node.parent.kind === 253 /* InterfaceDeclaration */ || node.parent.kind === 177 /* TypeLiteral */) || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 250 /* InterfaceDeclaration */ || node.parent.kind === 176 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -72939,10 +71011,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 251 /* FunctionDeclaration */ || node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */ || node.kind === 166 /* Constructor */) { + if (node.kind === 248 /* FunctionDeclaration */ || node.kind === 164 /* MethodDeclaration */ || node.kind === 163 /* MethodSignature */ || node.kind === 165 /* Constructor */) { functionDeclarations.push(node); var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; @@ -73075,25 +71147,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return 2 /* ExportType */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -73101,17 +71173,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 262 /* ImportClause */: - var result_12 = 0 /* None */; + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 259 /* ImportClause */: + var result_11 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result_12 |= getDeclarationSpaces(d); }); - return result_12; - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: - case 251 /* FunctionDeclaration */: - case 265 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + ts.forEach(target.declarations, function (d) { result_11 |= getDeclarationSpaces(d); }); + return result_11; + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 248 /* FunctionDeclaration */: + case 262 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 78 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -73404,24 +71476,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 160 /* Parameter */: + case 159 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -73468,30 +71540,30 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 183 /* IntersectionType */: - case 182 /* UnionType */: + case 182 /* IntersectionType */: + case 181 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: return getEntityNameForDecoratorMetadata(node.type); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; } } } function getEntityNameForDecoratorMetadataFromTypeList(types) { var commonEntityName; - for (var _i = 0, types_21 = types; _i < types_21.length; _i++) { - var typeNode = types_21[_i]; - while (typeNode.kind === 186 /* ParenthesizedType */ || typeNode.kind === 192 /* NamedTupleMember */) { + for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { + var typeNode = types_20[_i]; + while (typeNode.kind === 185 /* ParenthesizedType */ || typeNode.kind === 191 /* NamedTupleMember */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 141 /* NeverKeyword */) { + if (typeNode.kind === 140 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 190 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 149 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -73537,14 +71609,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 160 /* Parameter */) { + if (node.kind === 159 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -73553,23 +71625,23 @@ var ts; } } break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + var otherKind = node.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 160 /* Parameter */: + case 159 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -73632,7 +71704,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 157 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 156 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -73676,7 +71748,7 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -73689,7 +71761,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 157 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -73711,11 +71783,14 @@ var ts; checkFunctionOrConstructorSymbol(localSymbol); } if (symbol.parent) { - // run check on export symbol to check that modifiers agree across all exported declarations - checkFunctionOrConstructorSymbol(symbol); + // run check once for the first declaration + if (ts.getDeclarationOfKind(symbol, node.kind) === node) { + // run check on export symbol to check that modifiers agree across all exported declarations + checkFunctionOrConstructorSymbol(symbol); + } } } - var body = node.kind === 164 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 163 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -73757,42 +71832,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 297 /* SourceFile */: - case 256 /* ModuleDeclaration */: - case 230 /* Block */: - case 258 /* CaseBlock */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 294 /* SourceFile */: + case 253 /* ModuleDeclaration */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 166 /* Constructor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 165 /* Constructor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 185 /* InferType */: + case 184 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -73812,11 +71887,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 165 /* MethodDeclaration */: - case 163 /* PropertyDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - if (member.kind === 168 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 164 /* MethodDeclaration */: + case 162 /* PropertyDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + if (member.kind === 167 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -73827,7 +71902,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 166 /* Constructor */: + case 165 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasSyntacticModifier(parameter, 8 /* Private */)) { @@ -73835,8 +71910,8 @@ var ts; } } break; - case 171 /* IndexSignature */: - case 229 /* SemicolonClassElement */: + case 170 /* IndexSignature */: + case 226 /* SemicolonClassElement */: // Can't be private break; default: @@ -73863,7 +71938,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 185 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 184 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (ts.tryAddToSet(seenParentsWithEveryUnused, parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -73955,7 +72030,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 263 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 260 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -73973,7 +72048,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 249 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 250 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 246 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 247 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -73994,7 +72069,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 232 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 229 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -74008,22 +72083,22 @@ var ts; switch (name.kind) { case 78 /* Identifier */: return ts.idText(name); - case 197 /* ArrayBindingPattern */: - case 196 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 262 /* ImportClause */ || node.kind === 265 /* ImportSpecifier */ || node.kind === 263 /* NamespaceImport */; + return node.kind === 259 /* ImportClause */ || node.kind === 262 /* ImportSpecifier */ || node.kind === 260 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 262 /* ImportClause */ ? decl : decl.kind === 263 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 259 /* ImportClause */ ? decl : decl.kind === 260 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 230 /* Block */) { + if (node.kind === 227 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -74053,12 +72128,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 163 /* PropertyDeclaration */ || - node.kind === 162 /* PropertySignature */ || - node.kind === 165 /* MethodDeclaration */ || - node.kind === 164 /* MethodSignature */ || - node.kind === 167 /* GetAccessor */ || - node.kind === 168 /* SetAccessor */) { + if (node.kind === 162 /* PropertyDeclaration */ || + node.kind === 161 /* PropertySignature */ || + node.kind === 164 /* MethodDeclaration */ || + node.kind === 163 /* MethodSignature */ || + node.kind === 166 /* GetAccessor */ || + node.kind === 167 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -74067,7 +72142,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 160 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 159 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -74124,7 +72199,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -74139,7 +72214,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -74174,7 +72249,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 249 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 246 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -74186,17 +72261,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 250 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 232 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 247 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 229 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 230 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 257 /* ModuleBlock */ || - container.kind === 256 /* ModuleDeclaration */ || - container.kind === 297 /* SourceFile */); + (container.kind === 227 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 254 /* ModuleBlock */ || + container.kind === 253 /* ModuleDeclaration */ || + container.kind === 294 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -74227,18 +72302,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 198 /* BindingElement */) { - if (node.parent.kind === 196 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 195 /* BindingElement */) { + if (node.parent.kind === 193 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 158 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -74259,19 +72334,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 197 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 194 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.isParameterDeclaration(node) && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 159 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 238 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 235 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -74297,12 +72372,7 @@ var ts; } return; } - // For a commonjs `const x = require`, validate the alias and exit var symbol = getSymbolOfNode(node); - if (symbol.flags & 2097152 /* Alias */ && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true)) { - checkAliasSymbol(node); - return; - } var type = convertAutoToAny(getTypeOfSymbol(symbol)); if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer @@ -74313,7 +72383,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && !!((_a = symbol.exports) === null || _a === void 0 ? void 0 : _a.size); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 238 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 235 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -74339,10 +72409,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */) { + if (node.kind !== 162 /* PropertyDeclaration */ && node.kind !== 161 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -74354,7 +72424,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 163 /* PropertyDeclaration */ || nextDeclaration.kind === 162 /* PropertySignature */ + var message = nextDeclaration.kind === 162 /* PropertyDeclaration */ || nextDeclaration.kind === 161 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -74364,8 +72434,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 160 /* Parameter */ && right.kind === 249 /* VariableDeclaration */) || - (left.kind === 249 /* VariableDeclaration */ && right.kind === 160 /* Parameter */)) { + if ((left.kind === 159 /* Parameter */ && right.kind === 246 /* VariableDeclaration */) || + (left.kind === 246 /* VariableDeclaration */ && right.kind === 159 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -74381,10 +72451,8 @@ var ts; return ts.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts.getSelectedEffectiveModifierFlags(right, interestingFlags); } function checkVariableDeclaration(node) { - ts.tracing.push("check" /* Check */, "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end }); checkGrammarVariableDeclaration(node); - checkVariableLikeDeclaration(node); - ts.tracing.pop(); + return checkVariableLikeDeclaration(node); } function checkBindingElement(node) { checkGrammarBindingElement(node); @@ -74407,7 +72475,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 231 /* EmptyStatement */) { + if (node.thenStatement.kind === 228 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -74500,12 +72568,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 247 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -74539,14 +72607,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node); // There may be a destructuring assignment on the left side - if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) { + if (varExpr.kind === 196 /* ArrayLiteralExpression */ || varExpr.kind === 197 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -74578,7 +72646,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -74592,7 +72660,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) { + if (varExpr.kind === 196 /* ArrayLiteralExpression */ || varExpr.kind === 197 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -74644,7 +72712,6 @@ var ts; } var uplevelIteration = languageVersion >= 2 /* ES2015 */; var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; - var possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & 128 /* PossiblyOutOfBounds */); // Get the iterated type of an `Iterable` or `IterableIterator` only in ES2015 // or higher, when inside of an async generator or for-await-if, or when // downlevelIteration is requested. @@ -74664,7 +72731,7 @@ var ts; } } if (iterationTypes || uplevelIteration) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType) : (iterationTypes && iterationTypes.yieldType); + return iterationTypes && iterationTypes.yieldType; } } var arrayType = inputType; @@ -74678,12 +72745,12 @@ var ts; // After we remove all types that are StringLike, we will know if there was a string constituent // based on whether the result of filter is a new array. var arrayTypes = inputType.types; - var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 402653316 /* StringLike */); }); + var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 132 /* StringLike */); }); if (filteredTypes !== arrayTypes) { arrayType = getUnionType(filteredTypes, 2 /* Subtype */); } } - else if (arrayType.flags & 402653316 /* StringLike */) { + else if (arrayType.flags & 132 /* StringLike */) { arrayType = neverType; } hasStringConstituent = arrayType !== inputType; @@ -74697,7 +72764,7 @@ var ts; // Now that we've removed all the StringLike types, if no constituents remain, then the entire // arrayOrStringType was a string. if (arrayType.flags & 131072 /* Never */) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType; + return stringType; } } } @@ -74722,17 +72789,17 @@ var ts; : [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true], defaultDiagnostic = _a[0], maybeMissingAwait = _a[1]; errorAndMaybeSuggestAwait(errorNode, maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType), defaultDiagnostic, typeToString(arrayType)); } - return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType : undefined; + return hasStringConstituent ? stringType : undefined; } var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */); if (hasStringConstituent && arrayElementType) { // This is just an optimization for the case where arrayOrStringType is string | string[] - if (arrayElementType.flags & 402653316 /* StringLike */ && !compilerOptions.noUncheckedIndexedAccess) { + if (arrayElementType.flags & 132 /* StringLike */) { return stringType; } - return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2 /* Subtype */); + return getUnionType([arrayElementType, stringType], 2 /* Subtype */); } - return (use & 128 /* PossiblyOutOfBounds */) ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType; + return arrayElementType; } /** * Gets the requested "iteration type" from an `Iterable`-like or `AsyncIterable`-like type. @@ -74848,9 +72915,8 @@ var ts; if (iterationTypes_2 === noIterationTypes) { if (errorNode) { reportTypeNotIterableError(errorNode, type, !!(use & 2 /* AllowsAsyncIterablesFlag */)); + errorNode = undefined; } - setCachedIterationTypes(type, cacheKey, noIterationTypes); - return undefined; } else { allIterationTypes = ts.append(allIterationTypes, iterationTypes_2); @@ -75128,7 +73194,6 @@ var ts; * record is returned. Otherwise, we return `undefined`. */ function getIterationTypesOfMethod(type, resolver, methodName, errorNode) { - var _a, _b, _c, _d; var method = getPropertyOfType(type, methodName); // Ignore 'return' or 'throw' if they are missing. if (!method && methodName !== "next") { @@ -75152,24 +73217,6 @@ var ts; } return methodName === "next" ? anyIterationTypes : undefined; } - // If the method signature comes exclusively from the global iterator or generator type, - // create iteration types from its type arguments like `getIterationTypesOfIteratorFast` - // does (so as to remove `undefined` from the next and return types). We arrive here when - // a contextual type for a generator was not a direct reference to one of those global types, - // but looking up `methodType` referred to one of them (and nothing else). E.g., in - // `interface SpecialIterator extends Iterator {}`, `SpecialIterator` is not a - // reference to `Iterator`, but its `next` member derives exclusively from `Iterator`. - if ((methodType === null || methodType === void 0 ? void 0 : methodType.symbol) && methodSignatures.length === 1) { - var globalGeneratorType = resolver.getGlobalGeneratorType(/*reportErrors*/ false); - var globalIteratorType = resolver.getGlobalIteratorType(/*reportErrors*/ false); - var isGeneratorMethod = ((_b = (_a = globalGeneratorType.symbol) === null || _a === void 0 ? void 0 : _a.members) === null || _b === void 0 ? void 0 : _b.get(methodName)) === methodType.symbol; - var isIteratorMethod = !isGeneratorMethod && ((_d = (_c = globalIteratorType.symbol) === null || _c === void 0 ? void 0 : _c.members) === null || _d === void 0 ? void 0 : _d.get(methodName)) === methodType.symbol; - if (isGeneratorMethod || isIteratorMethod) { - var globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType; - var mapper = methodType.mapper; - return createIterationTypes(getMappedType(globalType.typeParameters[0], mapper), getMappedType(globalType.typeParameters[1], mapper), methodName === "next" ? getMappedType(globalType.typeParameters[2], mapper) : undefined); - } - } // Extract the first parameter and return type of each signature. var methodParameterTypes; var methodReturnTypes; @@ -75287,12 +73334,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 168 /* SetAccessor */) { + if (func.kind === 167 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 166 /* Constructor */) { + else if (func.kind === 165 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -75310,7 +73357,7 @@ var ts; } } } - else if (func.kind !== 166 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 165 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -75339,7 +73386,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 285 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 282 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -75348,7 +73395,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 284 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 281 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -75380,7 +73427,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 245 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 242 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -75409,15 +73456,11 @@ var ts; if (catchClause) { // Grammar checking if (catchClause.variableDeclaration) { - var declaration = catchClause.variableDeclaration; - if (declaration.type) { - var type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ false); - if (type && !(type.flags & 3 /* AnyOrUnknown */)) { - grammarErrorOnFirstToken(declaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); - } + if (catchClause.variableDeclaration.type && getTypeOfNode(catchClause.variableDeclaration) === errorType) { + grammarErrorOnFirstToken(catchClause.variableDeclaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); } - else if (declaration.initializer) { - grammarErrorOnFirstToken(declaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); + else if (catchClause.variableDeclaration.initializer) { + grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); } else { var blockLocals_1 = catchClause.block.locals; @@ -75494,8 +73537,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 216 /* BinaryExpression */ || - name.kind === 158 /* ComputedPropertyName */ || + (propDeclaration.kind === 213 /* BinaryExpression */ || + name.kind === 157 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -75572,7 +73615,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 173 /* TypeReference */) { + if (node.kind === 172 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -75683,7 +73726,6 @@ var ts; var typeWithThis = getTypeWithThisArgument(type); var staticType = getTypeOfSymbol(symbol); checkTypeParameterListsIdentical(symbol); - checkFunctionOrConstructorSymbol(symbol); checkClassForDuplicateDeclarations(node); // Only check for reserved static identifiers on non-ambient context. if (!(node.flags & 8388608 /* Ambient */)) { @@ -75774,7 +73816,7 @@ var ts; function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible var issuedMemberError = false; - var _loop_23 = function (member) { + var _loop_22 = function (member) { if (ts.hasStaticModifier(member)) { return "continue"; } @@ -75793,7 +73835,7 @@ var ts; }; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - _loop_23(member); + _loop_22(member); } if (!issuedMemberError) { // check again with diagnostics to generate a less-specific error @@ -75819,7 +73861,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 252 /* ClassDeclaration */ || d.kind === 253 /* InterfaceDeclaration */; + return d.kind === 249 /* ClassDeclaration */ || d.kind === 250 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -75874,7 +73916,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 221 /* ClassExpression */) { + if (derivedClassDecl.kind === 218 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -75895,7 +73937,7 @@ var ts; if (basePropertyFlags && derivedPropertyFlags) { // property/accessor is overridden with property/accessor if (baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 253 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 250 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -75910,7 +73952,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else if (compilerOptions.useDefineForClassFields) { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 163 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 162 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -76026,7 +74068,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 163 /* PropertyDeclaration */ && + return node.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -76050,7 +74092,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 250 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -76083,15 +74125,8 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); checkExportsOnMergedDeclarations(node); checkTypeParameters(node.typeParameters); - if (node.type.kind === 136 /* IntrinsicKeyword */) { - if (!intrinsicTypeKinds.has(node.name.escapedText) || ts.length(node.typeParameters) !== 1) { - error(node.type, ts.Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types); - } - } - else { - checkSourceElement(node.type); - registerForUnusedIdentifiersCheck(node); - } + checkSourceElement(node.type); + registerForUnusedIdentifiersCheck(node); } function computeEnumMemberValues(node) { var nodeLinks = getNodeLinks(node); @@ -76169,7 +74204,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -76179,7 +74214,7 @@ var ts; } } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -76208,7 +74243,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return evaluate(expr.expression); case 78 /* Identifier */: var identifier = expr; @@ -76216,14 +74251,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 201 /* PropertyAccessExpression */) { + if (ex.kind === 198 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -76256,8 +74291,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 78 /* Identifier */ || - node.kind === 201 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 202 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 198 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 199 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -76293,7 +74328,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 255 /* EnumDeclaration */) { + if (declaration.kind !== 252 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -76321,8 +74356,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 252 /* ClassDeclaration */ || - (declaration.kind === 251 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 249 /* ClassDeclaration */ || + (declaration.kind === 248 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -76385,7 +74420,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 252 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 249 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -76435,23 +74470,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 198 /* BindingElement */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 246 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -76462,12 +74497,12 @@ var ts; break; } // falls through - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 251 /* FunctionDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 248 /* FunctionDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -76490,12 +74525,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.left; } while (node.kind !== 78 /* Identifier */); return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -76515,9 +74550,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 267 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 254 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 294 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 264 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -76551,14 +74586,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 270 /* ExportSpecifier */ ? + var message = node.kind === 267 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 270 /* ExportSpecifier */ + && node.kind === 267 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -76573,7 +74608,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); checkAliasSymbol(node); - if (node.kind === 265 /* ImportSpecifier */ && + if (node.kind === 262 /* ImportSpecifier */ && ts.idText(node.propertyName || node.name) === "default" && compilerOptions.esModuleInterop && moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015) { @@ -76595,7 +74630,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 260 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); if (moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015 && compilerOptions.esModuleInterop) { // import * as ns from "foo"; @@ -76623,7 +74658,7 @@ var ts; if (ts.hasSyntacticModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 272 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 269 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -76663,10 +74698,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 257 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 254 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 254 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 294 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -76699,14 +74734,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 268 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 265 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 297 /* SourceFile */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 256 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 294 /* SourceFile */ || node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 253 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -76770,8 +74805,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 294 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 253 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -76796,9 +74831,6 @@ var ts; checkExpressionCached(node.expression); } } - else { - checkExpressionCached(node.expression); // doesn't resolve, check as expression to mark as error - } if (ts.getEmitDeclarations(compilerOptions)) { collectLinkedAliases(node.expression, /*setVisibility*/ true); } @@ -76888,171 +74920,169 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 232 /* FirstStatement */ && kind <= 248 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 229 /* FirstStatement */ && kind <= 245 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return checkTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return checkParameter(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return checkPropertySignature(node); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return checkSignatureDeclaration(node); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: return checkMethodDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return checkConstructorDeclaration(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return checkAccessorDeclaration(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return checkTypeReferenceNode(node); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return checkTypePredicate(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return checkTypeQuery(node); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return checkTypeLiteral(node); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return checkArrayType(node); - case 179 /* TupleType */: + case 178 /* TupleType */: return checkTupleType(node); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 186 /* ParenthesizedType */: - case 180 /* OptionalType */: - case 181 /* RestType */: + case 185 /* ParenthesizedType */: + case 179 /* OptionalType */: + case 180 /* RestType */: return checkSourceElement(node.type); - case 187 /* ThisType */: + case 186 /* ThisType */: return checkThisType(node); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return checkTypeOperator(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return checkConditionalType(node); - case 185 /* InferType */: + case 184 /* InferType */: return checkInferType(node); - case 193 /* TemplateLiteralType */: - return checkTemplateLiteralType(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return checkImportType(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return checkNamedTupleMember(node); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 329 /* JSDocTypeTag */: + case 325 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 333 /* JSDocPropertyTag */: + case 328 /* JSDocPropertyTag */: return checkJSDocPropertyTag(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 306 /* JSDocNonNullableType */: - case 305 /* JSDocNullableType */: - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: - case 312 /* JSDocTypeLiteral */: + case 302 /* JSDocNonNullableType */: + case 301 /* JSDocNullableType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: + case 308 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 301 /* JSDocTypeExpression */: + case 298 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return checkMappedType(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return checkBlock(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return checkVariableStatement(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return checkExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return checkIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return checkDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return checkWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return checkForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return checkForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return checkForOfStatement(node); - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return checkReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return checkWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return checkSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return checkLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return checkThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return checkTryStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return checkBindingElement(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return checkClassDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return checkImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return checkExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return checkExportAssignment(node); - case 231 /* EmptyStatement */: - case 248 /* DebuggerStatement */: + case 228 /* EmptyStatement */: + case 245 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -77147,46 +75177,43 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 161 /* Decorator */: - case 275 /* JsxOpeningElement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 160 /* Decorator */: + case 272 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 273 /* JsxElement */: + case 270 /* JsxElement */: checkJsxElementDeferred(node); break; } currentNode = saveCurrentNode; } function checkSourceFile(node) { - var tracingData = ["check" /* Check */, "checkSourceFile", { path: node.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeCheck"); checkSourceFileWorker(node); ts.performance.mark("afterCheck"); ts.performance.measure("Check", "beforeCheck", "afterCheck"); - ts.tracing.end.apply(ts.tracing, tracingData); } function unusedIsError(kind, isAmbient) { if (isAmbient) { @@ -77319,17 +75346,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -77337,8 +75364,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -77347,7 +75374,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -77395,19 +75422,19 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 159 /* TypeParameter */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 158 /* TypeParameter */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return true; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.isTypeOnly; - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -77415,25 +75442,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 157 /* QualifiedName */) { + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 173 /* TypeReference */; + return node.parent.kind === 172 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 201 /* PropertyAccessExpression */) { + while (node.parent.kind === 198 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 223 /* ExpressionWithTypeArguments */; - } - function isJSDocEntryNameReference(node) { - while (node.parent.kind === 157 /* QualifiedName */) { - node = node.parent; - } - while (node.parent.kind === 201 /* PropertyAccessExpression */) { - node = node.parent; - } - return node.parent.kind === 302 /* JSDocNameReference */; + return node.parent.kind === 220 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -77461,13 +75479,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 157 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 156 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 260 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 257 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 266 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 263 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -77493,7 +75511,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 195 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 192 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -77503,7 +75521,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 201 /* PropertyAccessExpression */ && + name.parent.kind === 198 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -77513,7 +75531,7 @@ var ts; } } } - if (name.parent.kind === 266 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 263 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -77523,7 +75541,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 260 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 257 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -77541,7 +75559,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 223 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 220 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -77557,10 +75575,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 326 /* JSDocParameterTag */) { + if (name.parent.kind === 322 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 159 /* TypeParameter */ && name.parent.parent.kind === 330 /* JSDocTemplateTag */) { + if (name.parent.kind === 158 /* TypeParameter */ && name.parent.parent.kind === 326 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -77577,12 +75595,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 201 /* PropertyAccessExpression */ || name.kind === 157 /* QualifiedName */) { + else if (name.kind === 198 /* PropertyAccessExpression */ || name.kind === 156 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 201 /* PropertyAccessExpression */) { + if (name.kind === 198 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -77592,21 +75610,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 173 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 172 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (isJSDocEntryNameReference(name)) { - var meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */; - return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true, ts.getHostSignatureFromJSDoc(name)); - } - if (name.parent.kind === 172 /* TypePredicate */) { + if (name.parent.kind === 171 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -77629,8 +75643,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 198 /* BindingElement */ && - grandParent.kind === 196 /* ObjectBindingPattern */ && + else if (parent.kind === 195 /* BindingElement */ && + grandParent.kind === 193 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -77642,8 +75656,8 @@ var ts; switch (node.kind) { case 78 /* Identifier */: case 79 /* PrivateIdentifier */: - case 201 /* PropertyAccessExpression */: - case 157 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 107 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -77657,14 +75671,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 187 /* ThisType */: + case 186 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 105 /* SuperKeyword */: return checkExpression(node).symbol; case 132 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 166 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 165 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -77675,7 +75689,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 261 /* ImportDeclaration */ || node.parent.kind === 267 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 258 /* ImportDeclaration */ || node.parent.kind === 264 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -77697,7 +75711,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 83 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 195 /* ImportType */: + case 192 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 92 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -77706,26 +75720,18 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 289 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 286 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; } /** Returns the target of an export specifier without following aliases */ function getExportSpecifierLocalTargetSymbol(node) { - if (ts.isExportSpecifier(node)) { - return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); - } - else { - return resolveEntityName(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); - } + return node.parent.parent.moduleSpecifier ? + getExternalModuleMember(node.parent.parent, node) : + resolveEntityName(node.propertyName || node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } function getTypeOfNode(node) { - if (ts.isSourceFile(node) && !ts.isExternalModule(node)) { - return errorType; - } if (node.flags & 16777216 /* InWithStatement */) { // We cannot answer semantic questions within a with block, do not proceed any further return errorType; @@ -77785,23 +75791,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 200 /* ObjectLiteralExpression */ || expr.kind === 199 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 197 /* ObjectLiteralExpression */ || expr.kind === 196 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 239 /* ForOfStatement */) { + if (expr.parent.kind === 236 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 216 /* BinaryExpression */) { + if (expr.parent.kind === 213 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 288 /* PropertyAssignment */) { + if (expr.parent.kind === 285 /* PropertyAssignment */) { var node_2 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_2) || errorType; var propertyIndex = ts.indexOfNode(node_2.properties, expr.parent); @@ -77849,7 +75855,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -77966,7 +75972,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 297 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 294 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -77981,9 +75987,6 @@ var ts; // When resolved as an expression identifier, if the given node references an import, return the declaration of // that import. Otherwise, return undefined. function getReferencedImportDeclaration(nodeIn) { - if (nodeIn.generatedImportReference) { - return nodeIn.generatedImportReference; - } var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { var symbol = getReferencedValueSymbol(node); @@ -77997,7 +76000,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 287 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 284 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -78028,7 +76031,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 230 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 227 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -78069,19 +76072,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return node.expression && node.expression.kind === 78 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -78090,7 +76093,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 297 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 294 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -78197,15 +76200,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 291 /* EnumMember */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 288 /* EnumMember */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 291 /* EnumMember */) { + if (node.kind === 288 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -78271,7 +76274,7 @@ var ts; else if (isTypeAssignableToKind(type, 2112 /* BigIntLike */)) { return ts.TypeReferenceSerializationKind.BigIntLikeType; } - else if (isTypeAssignableToKind(type, 402653316 /* StringLike */)) { + else if (isTypeAssignableToKind(type, 132 /* StringLike */)) { return ts.TypeReferenceSerializationKind.StringLikeType; } else if (isTupleType(type)) { @@ -78474,12 +76477,12 @@ var ts; getJsxFragmentFactoryEntity: getJsxFragmentFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 168 /* SetAccessor */ ? 167 /* GetAccessor */ : 168 /* SetAccessor */; + var otherKind = accessor.kind === 167 /* SetAccessor */ ? 166 /* GetAccessor */ : 167 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 168 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 167 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 167 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 166 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -78495,7 +76498,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 297 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 294 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -78530,7 +76533,7 @@ var ts; return false; } function isInHeritageClause(node) { - return node.parent && node.parent.kind === 223 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 286 /* HeritageClause */; + return node.parent && node.parent.kind === 220 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 283 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -78542,7 +76545,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 78 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 201 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 78 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 198 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -78593,7 +76596,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 297 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 294 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -78621,12 +76624,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 256 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 253 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 297 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 294 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -78820,14 +76823,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 165 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 164 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */) { + else if (node.kind === 166 /* GetAccessor */ || node.kind === 167 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -78844,17 +76847,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 142 /* ReadonlyKeyword */) { - if (node.kind === 162 /* PropertySignature */ || node.kind === 164 /* MethodSignature */) { + if (modifier.kind !== 141 /* ReadonlyKeyword */) { + if (node.kind === 161 /* PropertySignature */ || node.kind === 163 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 171 /* IndexSignature */) { + if (node.kind === 170 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 84 /* ConstKeyword */: - if (node.kind !== 255 /* EnumDeclaration */) { + if (node.kind !== 252 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(84 /* ConstKeyword */)); } break; @@ -78874,7 +76877,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + else if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -78900,10 +76903,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + else if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -78915,11 +76918,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */ && node.kind !== 171 /* IndexSignature */ && node.kind !== 160 /* Parameter */) { + else if (node.kind !== 162 /* PropertyDeclaration */ && node.kind !== 161 /* PropertySignature */ && node.kind !== 170 /* IndexSignature */ && node.kind !== 159 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -78940,16 +76943,16 @@ var ts; return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } else if (ts.isClassLike(node.parent)) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 87 /* DefaultKeyword */: - var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 294 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 253 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; @@ -78962,12 +76965,12 @@ var ts; return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 257 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 254 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -78980,14 +76983,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 252 /* ClassDeclaration */) { - if (node.kind !== 165 /* MethodDeclaration */ && - node.kind !== 163 /* PropertyDeclaration */ && - node.kind !== 167 /* GetAccessor */ && - node.kind !== 168 /* SetAccessor */) { + if (node.kind !== 249 /* ClassDeclaration */) { + if (node.kind !== 164 /* MethodDeclaration */ && + node.kind !== 162 /* PropertyDeclaration */ && + node.kind !== 166 /* GetAccessor */ && + node.kind !== 167 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 252 /* ClassDeclaration */ && ts.hasSyntacticModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 249 /* ClassDeclaration */ && ts.hasSyntacticModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -78996,9 +76999,6 @@ var ts; if (flags & 8 /* Private */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); } - if (flags & 256 /* Async */ && lastAsync) { - return grammarErrorOnNode(lastAsync, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } } if (ts.isNamedDeclaration(node) && node.name.kind === 79 /* PrivateIdentifier */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); @@ -79012,18 +77012,15 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } - if (flags & 128 /* Abstract */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } flags |= 256 /* Async */; lastAsync = modifier; break; } } - if (node.kind === 166 /* Constructor */) { + if (node.kind === 165 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -79038,13 +77035,13 @@ var ts; } return false; } - else if ((node.kind === 261 /* ImportDeclaration */ || node.kind === 260 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 258 /* ImportDeclaration */ || node.kind === 257 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 159 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 159 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -79065,37 +77062,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 256 /* ModuleDeclaration */: - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 160 /* Parameter */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 253 /* ModuleDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 159 /* Parameter */: return false; default: - if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return false; } switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 129 /* AsyncKeyword */); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 125 /* AbstractKeyword */); - case 253 /* InterfaceDeclaration */: - case 232 /* VariableStatement */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 229 /* VariableStatement */: + case 251 /* TypeAliasDeclaration */: return true; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 84 /* ConstKeyword */); default: ts.Debug.fail(); @@ -79108,10 +77105,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -79230,7 +77227,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 147 /* StringKeyword */ && parameter.type.kind !== 144 /* NumberKeyword */) { + if (parameter.type.kind !== 146 /* StringKeyword */ && parameter.type.kind !== 143 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -79272,7 +77269,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 222 /* OmittedExpression */) { + if (arg.kind === 219 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -79349,20 +77346,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 158 /* ComputedPropertyName */) { + if (node.kind !== 157 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 216 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 213 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 251 /* FunctionDeclaration */ || - node.kind === 208 /* FunctionExpression */ || - node.kind === 165 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 248 /* FunctionDeclaration */ || + node.kind === 205 /* FunctionExpression */ || + node.kind === 164 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -79381,7 +77378,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 290 /* SpreadAssignment */) { + if (prop.kind === 287 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -79392,11 +77389,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 158 /* ComputedPropertyName */) { + if (name.kind === 157 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 289 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 286 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern); @@ -79409,7 +77406,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 129 /* AsyncKeyword */ || prop.kind !== 165 /* MethodDeclaration */) { + if (mod.kind !== 129 /* AsyncKeyword */ || prop.kind !== 164 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -79424,10 +77421,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -79435,13 +77432,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -79480,7 +77477,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 282 /* JsxSpreadAttribute */) { + if (attr.kind === 279 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -79490,7 +77487,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 283 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 280 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -79504,14 +77501,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 239 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 236 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 166 /* Constructor */) { + if (func && func.kind !== 165 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -79522,7 +77519,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 250 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 247 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -79537,20 +77534,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -79575,11 +77572,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 167 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 166 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 168 /* SetAccessor */) { + if (accessor.kind === 167 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -79601,17 +77598,17 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 166 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 166 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 151 /* UniqueKeyword */) { - if (node.type.kind !== 148 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(148 /* SymbolKeyword */)); + if (node.operator === 150 /* UniqueKeyword */) { + if (node.type.kind !== 147 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(147 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) { @@ -79622,7 +77619,7 @@ var ts; } } switch (parent.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 78 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -79634,13 +77631,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: if (!ts.hasSyntacticModifier(parent, 32 /* Static */) || !ts.hasEffectiveModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: if (!ts.hasSyntacticModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -79649,9 +77646,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 142 /* ReadonlyKeyword */) { - if (node.type.kind !== 178 /* ArrayType */ && node.type.kind !== 179 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(148 /* SymbolKeyword */)); + else if (node.operator === 141 /* ReadonlyKeyword */) { + if (node.type.kind !== 177 /* ArrayType */ && node.type.kind !== 178 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(147 /* SymbolKeyword */)); } } } @@ -79664,8 +77661,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 165 /* MethodDeclaration */) { - if (node.parent.kind === 200 /* ObjectLiteralExpression */) { + if (node.kind === 164 /* MethodDeclaration */) { + if (node.parent.kind === 197 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 129 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -79693,14 +77690,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 165 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 164 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 253 /* InterfaceDeclaration */) { + else if (node.parent.kind === 250 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 177 /* TypeLiteral */) { + else if (node.parent.kind === 176 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -79711,11 +77708,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 240 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 237 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -79723,8 +77720,8 @@ var ts; return false; } break; - case 244 /* SwitchStatement */: - if (node.kind === 241 /* BreakStatement */ && !node.label) { + case 241 /* SwitchStatement */: + if (node.kind === 238 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -79739,13 +77736,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 241 /* BreakStatement */ + var message = node.kind === 238 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 241 /* BreakStatement */ + var message = node.kind === 238 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -79769,12 +77766,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 211 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 211 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -79805,7 +77802,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 238 /* ForInStatement */ && node.parent.parent.kind !== 239 /* ForOfStatement */) { + if (node.parent.parent.kind !== 235 /* ForInStatement */ && node.parent.parent.kind !== 236 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -79818,11 +77815,8 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 232 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { - var message = node.initializer - ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions - : ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations; - return grammarErrorOnNode(node.exclamationToken, message); + if (node.exclamationToken && (node.parent.parent.kind !== 229 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); if (moduleKind < ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.System && @@ -79884,15 +77878,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return false; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -79984,7 +77978,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 253 /* InterfaceDeclaration */) { + else if (node.parent.kind === 250 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -79992,7 +77986,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 177 /* TypeLiteral */) { + else if (node.parent.kind === 176 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -80005,12 +77999,7 @@ var ts; } if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || node.flags & 8388608 /* Ambient */ || ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */))) { - var message = node.initializer - ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions - : !node.type - ? ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations - : ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; - return grammarErrorOnNode(node.exclamationToken, message); + return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { @@ -80026,13 +78015,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 253 /* InterfaceDeclaration */ || - node.kind === 254 /* TypeAliasDeclaration */ || - node.kind === 261 /* ImportDeclaration */ || - node.kind === 260 /* ImportEqualsDeclaration */ || - node.kind === 267 /* ExportDeclaration */ || - node.kind === 266 /* ExportAssignment */ || - node.kind === 259 /* NamespaceExportDeclaration */ || + if (node.kind === 250 /* InterfaceDeclaration */ || + node.kind === 251 /* TypeAliasDeclaration */ || + node.kind === 258 /* ImportDeclaration */ || + node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 264 /* ExportDeclaration */ || + node.kind === 263 /* ExportAssignment */ || + node.kind === 256 /* NamespaceExportDeclaration */ || ts.hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -80041,7 +78030,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 232 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 229 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -80064,7 +78053,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 230 /* Block */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + if (node.parent.kind === 227 /* Block */ || node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -80086,10 +78075,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 191 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 190 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 291 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 288 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -80264,14 +78253,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 251 /* FunctionDeclaration */ && declaration.kind !== 165 /* MethodDeclaration */) || + return (declaration.kind !== 248 /* FunctionDeclaration */ && declaration.kind !== 164 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -80279,14 +78268,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 262 /* ImportClause */: // For default import - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: // For rename import `x as y` + case 259 /* ImportClause */: // For default import + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: // For rename import `x as y` return true; case 78 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 265 /* ImportSpecifier */; + return decl.parent.kind === 262 /* ImportSpecifier */; default: return false; } @@ -80518,7 +78507,7 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 156 /* LastToken */) || kind === 187 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 155 /* LastToken */) || kind === 186 /* ThisType */) { return node; } var factory = context.factory; @@ -80526,291 +78515,287 @@ var ts; // Names case 78 /* Identifier */: return factory.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return factory.updateQualifiedName(node, nodeVisitor(node.left, visitor, ts.isEntityName), nodeVisitor(node.right, visitor, ts.isIdentifier)); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return factory.updateComputedPropertyName(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Signature elements - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return factory.updateTypeParameterDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.constraint, visitor, ts.isTypeNode), nodeVisitor(node.default, visitor, ts.isTypeNode)); - case 160 /* Parameter */: + case 159 /* Parameter */: return factory.updateParameterDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 161 /* Decorator */: + case 160 /* Decorator */: return factory.updateDecorator(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Type elements - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return factory.updatePropertyDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too nodeVisitor(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 164 /* MethodSignature */: + case 163 /* MethodSignature */: return factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return factory.updateMethodDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 166 /* Constructor */: + case 165 /* Constructor */: return factory.updateConstructorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return factory.updateGetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return factory.updateSetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 169 /* CallSignature */: + case 168 /* CallSignature */: return factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return factory.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); // Types - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return factory.updateTypePredicateNode(node, nodeVisitor(node.assertsModifier, visitor), nodeVisitor(node.parameterName, visitor), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return factory.updateTypeReferenceNode(node, nodeVisitor(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 174 /* FunctionType */: + case 173 /* FunctionType */: return factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 175 /* ConstructorType */: + case 174 /* ConstructorType */: return factory.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName)); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return factory.updateArrayTypeNode(node, nodeVisitor(node.elementType, visitor, ts.isTypeNode)); - case 179 /* TupleType */: + case 178 /* TupleType */: return factory.updateTupleTypeNode(node, nodesVisitor(node.elements, visitor, ts.isTypeNode)); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return factory.updateOptionalTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 181 /* RestType */: + case 180 /* RestType */: return factory.updateRestTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 182 /* UnionType */: + case 181 /* UnionType */: return factory.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return factory.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return factory.updateConditionalTypeNode(node, nodeVisitor(node.checkType, visitor, ts.isTypeNode), nodeVisitor(node.extendsType, visitor, ts.isTypeNode), nodeVisitor(node.trueType, visitor, ts.isTypeNode), nodeVisitor(node.falseType, visitor, ts.isTypeNode)); - case 185 /* InferType */: + case 184 /* InferType */: return factory.updateInferTypeNode(node, nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 195 /* ImportType */: + case 192 /* ImportType */: return factory.updateImportTypeNode(node, nodeVisitor(node.argument, visitor, ts.isTypeNode), nodeVisitor(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return factory.updateNamedTupleMember(node, visitNode(node.dotDotDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return factory.updateParenthesizedType(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return factory.updateTypeOperatorNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return factory.updateIndexedAccessTypeNode(node, nodeVisitor(node.objectType, visitor, ts.isTypeNode), nodeVisitor(node.indexType, visitor, ts.isTypeNode)); - case 190 /* MappedType */: - return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.nameType, visitor, ts.isTypeNode), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 191 /* LiteralType */: + case 189 /* MappedType */: + return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); + case 190 /* LiteralType */: return factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.isExpression)); - case 193 /* TemplateLiteralType */: - return factory.updateTemplateLiteralType(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateLiteralTypeSpan)); - case 194 /* TemplateLiteralTypeSpan */: - return factory.updateTemplateLiteralTypeSpan(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Binding patterns - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: return factory.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return factory.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return factory.updateBindingElement(node, nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.propertyName, visitor, ts.isPropertyName), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.initializer, visitor, ts.isExpression)); // Expression - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return factory.updateArrayLiteralExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return factory.updateObjectLiteralExpression(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updatePropertyAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier)); } return factory.updatePropertyAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateElementAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.argumentExpression, visitor, ts.isExpression)); } return factory.updateElementAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.argumentExpression, visitor, ts.isExpression)); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateCallChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return factory.updateCallExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return factory.updateNewExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return factory.updateTaggedTemplateExpression(node, nodeVisitor(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), nodeVisitor(node.template, visitor, ts.isTemplateLiteral)); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return factory.updateTypeAssertion(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return factory.updateParenthesizedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return factory.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return factory.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return factory.updateDeleteExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return factory.updateTypeOfExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return factory.updateVoidExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return factory.updateAwaitExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return factory.updatePrefixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression)); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return factory.updatePostfixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression)); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return factory.updateBinaryExpression(node, nodeVisitor(node.left, visitor, ts.isExpression), nodeVisitor(node.operatorToken, tokenVisitor, ts.isToken), nodeVisitor(node.right, visitor, ts.isExpression)); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return factory.updateConditionalExpression(node, nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenTrue, visitor, ts.isExpression), nodeVisitor(node.colonToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenFalse, visitor, ts.isExpression)); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return factory.updateTemplateExpression(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return factory.updateYieldExpression(node, nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return factory.updateSpreadElement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return factory.updateClassExpression(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return factory.updateExpressionWithTypeArguments(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 224 /* AsExpression */: + case 221 /* AsExpression */: return factory.updateAsExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateNonNullChain(node, nodeVisitor(node.expression, visitor, ts.isExpression)); } return factory.updateNonNullExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return factory.updateMetaProperty(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); // Misc - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return factory.updateTemplateSpan(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 230 /* Block */: + case 227 /* Block */: return factory.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return factory.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return factory.updateExpressionStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return factory.updateIfStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.thenStatement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.elseStatement, visitor, ts.isStatement, factory.liftToBlock)); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return factory.updateDoStatement(node, nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return factory.updateWhileStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return factory.updateForStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.incrementor, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return factory.updateForInStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return factory.updateForOfStatement(node, nodeVisitor(node.awaitModifier, tokenVisitor, ts.isToken), nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return factory.updateContinueStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier)); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return factory.updateBreakStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier)); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return factory.updateReturnStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return factory.updateWithStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return factory.updateSwitchStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.caseBlock, visitor, ts.isCaseBlock)); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return factory.updateLabeledStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return factory.updateThrowStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return factory.updateTryStatement(node, nodeVisitor(node.tryBlock, visitor, ts.isBlock), nodeVisitor(node.catchClause, visitor, ts.isCatchClause), nodeVisitor(node.finallyBlock, visitor, ts.isBlock)); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return factory.updateVariableDeclaration(node, nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return factory.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return factory.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return factory.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return factory.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return factory.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return factory.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return factory.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.body, visitor, ts.isModuleBody)); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return factory.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return factory.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return factory.updateNamespaceExportDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return factory.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.moduleReference, visitor, ts.isModuleReference)); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return factory.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.importClause, visitor, ts.isImportClause), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression)); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts.isNamedImportBindings)); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return factory.updateNamespaceImport(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return factory.updateNamespaceExport(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 264 /* NamedImports */: + case 261 /* NamedImports */: return factory.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return factory.updateImportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return factory.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return factory.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, ts.isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression)); - case 268 /* NamedExports */: + case 265 /* NamedExports */: return factory.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return factory.updateExportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier)); // Module references - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return factory.updateExternalModuleReference(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // JSX - case 273 /* JsxElement */: + case 270 /* JsxElement */: return factory.updateJsxElement(node, nodeVisitor(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingElement, visitor, ts.isJsxClosingElement)); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return factory.updateJsxSelfClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes)); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: return factory.updateJsxOpeningElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes)); - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: return factory.updateJsxClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return factory.updateJsxFragment(node, nodeVisitor(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return factory.updateJsxAttribute(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return factory.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return factory.updateJsxSpreadAttribute(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return factory.updateJsxExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Clauses - case 284 /* CaseClause */: + case 281 /* CaseClause */: return factory.updateCaseClause(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return factory.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return factory.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return factory.updateCatchClause(node, nodeVisitor(node.variableDeclaration, visitor, ts.isVariableDeclaration), nodeVisitor(node.block, visitor, ts.isBlock)); // Property assignments - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return factory.updatePropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return factory.updateShorthandPropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return factory.updateSpreadAssignment(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Enum - case 291 /* EnumMember */: + case 288 /* EnumMember */: return factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 297 /* SourceFile */: + case 294 /* SourceFile */: return factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return factory.updateCommaListExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -81485,7 +79470,7 @@ var ts; function chainBundle(context, transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 297 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 294 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -81536,7 +79521,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -81549,13 +79534,13 @@ var ts; hasImportDefault = true; } break; - case 260 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 272 /* ExternalModuleReference */) { + case 257 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 269 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -81586,13 +79571,13 @@ var ts; addExportedNamesForExportDeclaration(node); } break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { for (var _b = 0, _c = node.declarationList.declarations; _b < _c.length; _b++) { var decl = _c[_b]; @@ -81600,7 +79585,7 @@ var ts; } } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { if (ts.hasSyntacticModifier(node, 512 /* Default */)) { // export default function() { } @@ -81620,7 +79605,7 @@ var ts; } } break; - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { if (ts.hasSyntacticModifier(node, 512 /* Default */)) { // export default class { } @@ -81794,7 +79779,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 163 /* PropertyDeclaration */ + return member.kind === 162 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -82013,27 +79998,18 @@ var ts; * for the element. */ function flattenBindingOrAssignmentElement(flattenContext, element, value, location, skipInitializer) { - var bindingTarget = ts.getTargetOfBindingOrAssignmentElement(element); // TODO: GH#18217 if (!skipInitializer) { var initializer = ts.visitNode(ts.getInitializerOfBindingOrAssignmentElement(element), flattenContext.visitor, ts.isExpression); if (initializer) { // Combine value and initializer - if (value) { - value = createDefaultValueCheck(flattenContext, value, initializer, location); - // If 'value' is not a simple expression, it could contain side-effecting code that should evaluate before an object or array binding pattern. - if (!ts.isSimpleInlineableExpression(initializer) && ts.isBindingOrAssignmentPattern(bindingTarget)) { - value = ensureIdentifier(flattenContext, value, /*reuseIdentifierExpressions*/ true, location); - } - } - else { - value = initializer; - } + value = value ? createDefaultValueCheck(flattenContext, value, initializer, location) : initializer; } else if (!value) { // Use 'void 0' in absence of value and initializer value = flattenContext.context.factory.createVoidZero(); } } + var bindingTarget = ts.getTargetOfBindingOrAssignmentElement(element); // TODO: GH#18217 if (ts.isObjectBindingOrAssignmentPattern(bindingTarget)) { flattenObjectBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value, location); } @@ -82138,8 +80114,7 @@ var ts; if (flattenContext.level >= 1 /* ObjectRest */) { // If an array pattern contains an ObjectRest, we must cache the result so that we // can perform the ObjectRest destructuring in a different declaration - if (element.transformFlags & 16384 /* ContainsObjectRestOrSpread */ || flattenContext.hasTransformedPriorElement && !isSimpleBindingOrAssignmentElement(element)) { - flattenContext.hasTransformedPriorElement = true; + if (element.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { var temp = flattenContext.context.factory.createTempVariable(/*recordTempVariable*/ undefined); if (flattenContext.hoistTempVariables) { flattenContext.context.hoistVariableDeclaration(temp); @@ -82173,20 +80148,6 @@ var ts; } } } - function isSimpleBindingOrAssignmentElement(element) { - var target = ts.getTargetOfBindingOrAssignmentElement(element); - if (!target || ts.isOmittedExpression(target)) - return true; - var propertyName = ts.tryGetPropertyNameOfBindingOrAssignmentElement(element); - if (propertyName && !ts.isPropertyNameLiteral(propertyName)) - return false; - var initializer = ts.getInitializerOfBindingOrAssignmentElement(element); - if (initializer && !ts.isSimpleInlineableExpression(initializer)) - return false; - if (ts.isBindingOrAssignmentPattern(target)) - return ts.every(ts.getElementsOfBindingOrAssignmentPattern(target), isSimpleBindingOrAssignmentElement); - return ts.isIdentifier(target); - } /** * Creates an expression used to provide a default value if a value is `undefined` at runtime. * @@ -82396,8 +80357,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -82423,14 +80384,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 298 /* Bundle */) { + if (node.kind === 295 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return factory.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 300 /* InputFiles */) { + if (prepend.kind === 297 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -82481,16 +80442,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 297 /* SourceFile */: - case 258 /* CaseBlock */: - case 257 /* ModuleBlock */: - case 230 /* Block */: + case 294 /* SourceFile */: + case 255 /* CaseBlock */: + case 254 /* ModuleBlock */: + case 227 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.hasSyntacticModifier(node, 2 /* Ambient */)) { break; } @@ -82502,7 +80463,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 252 /* ClassDeclaration */ || ts.hasSyntacticModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 249 /* ClassDeclaration */ || ts.hasSyntacticModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -82545,10 +80506,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: return visitElidableStatement(node); default: return visitorWorker(node); @@ -82569,13 +80530,13 @@ var ts; return node; } switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -82595,11 +80556,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 267 /* ExportDeclaration */ || - node.kind === 261 /* ImportDeclaration */ || - node.kind === 262 /* ImportClause */ || - (node.kind === 260 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 272 /* ExternalModuleReference */)) { + if (node.kind === 264 /* ExportDeclaration */ || + node.kind === 258 /* ImportDeclaration */ || + node.kind === 259 /* ImportClause */ || + (node.kind === 257 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 269 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -82623,19 +80584,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return visitConstructor(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 171 /* IndexSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + case 170 /* IndexSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -82672,61 +80633,61 @@ var ts; case 125 /* AbstractKeyword */: case 84 /* ConstKeyword */: case 133 /* DeclareKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 178 /* ArrayType */: - case 179 /* TupleType */: - case 180 /* OptionalType */: - case 181 /* RestType */: - case 177 /* TypeLiteral */: - case 172 /* TypePredicate */: - case 159 /* TypeParameter */: + case 177 /* ArrayType */: + case 178 /* TupleType */: + case 179 /* OptionalType */: + case 180 /* RestType */: + case 176 /* TypeLiteral */: + case 171 /* TypePredicate */: + case 158 /* TypeParameter */: case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: + case 151 /* UnknownKeyword */: case 131 /* BooleanKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 141 /* NeverKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 140 /* NeverKeyword */: case 113 /* VoidKeyword */: - case 148 /* SymbolKeyword */: - case 175 /* ConstructorType */: - case 174 /* FunctionType */: - case 176 /* TypeQuery */: - case 173 /* TypeReference */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 184 /* ConditionalType */: - case 186 /* ParenthesizedType */: - case 187 /* ThisType */: - case 188 /* TypeOperator */: - case 189 /* IndexedAccessType */: - case 190 /* MappedType */: - case 191 /* LiteralType */: + case 147 /* SymbolKeyword */: + case 174 /* ConstructorType */: + case 173 /* FunctionType */: + case 175 /* TypeQuery */: + case 172 /* TypeReference */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 183 /* ConditionalType */: + case 185 /* ParenthesizedType */: + case 186 /* ThisType */: + case 187 /* TypeOperator */: + case 188 /* IndexedAccessType */: + case 189 /* MappedType */: + case 190 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 161 /* Decorator */: + case 160 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 166 /* Constructor */: + case 165 /* Constructor */: return visitConstructor(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return factory.createNotEmittedStatement(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -82736,7 +80697,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -82746,35 +80707,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 160 /* Parameter */: + case 159 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -82784,40 +80745,40 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: return visitJsxJsxOpeningElement(node); default: // node contains some other TypeScript syntax @@ -83226,12 +81187,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -83384,7 +81345,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 163 /* PropertyDeclaration */ + ? member.kind === 162 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? factory.createVoidZero() @@ -83508,10 +81469,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 163 /* PropertyDeclaration */; + return kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 162 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -83521,7 +81482,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 165 /* MethodDeclaration */; + return node.kind === 164 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -83532,12 +81493,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return true; } return false; @@ -83554,15 +81515,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: - case 160 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 159 /* Parameter */: return serializeTypeNode(node.type); - case 168 /* SetAccessor */: - case 167 /* GetAccessor */: + case 167 /* SetAccessor */: + case 166 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 165 /* MethodDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 164 /* MethodDeclaration */: return factory.createIdentifier("Function"); default: return factory.createVoidZero(); @@ -83599,7 +81560,7 @@ var ts; return factory.createArrayLiteralExpression(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 167 /* GetAccessor */) { + if (container && node.kind === 166 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -83645,30 +81606,30 @@ var ts; } switch (node.kind) { case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: return factory.createVoidZero(); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return factory.createIdentifier("Function"); - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return factory.createIdentifier("Array"); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: case 131 /* BooleanKeyword */: return factory.createIdentifier("Boolean"); - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: return factory.createIdentifier("String"); - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return factory.createIdentifier("Object"); - case 191 /* LiteralType */: + case 190 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return factory.createIdentifier("String"); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return factory.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -83681,45 +81642,45 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: return factory.createIdentifier("Number"); - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : factory.createIdentifier("Symbol"); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return serializeTypeReferenceNode(node); - case 183 /* IntersectionType */: - case 182 /* UnionType */: + case 182 /* IntersectionType */: + case 181 /* UnionType */: return serializeTypeList(node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 188 /* TypeOperator */: - if (node.operator === 142 /* ReadonlyKeyword */) { + case 187 /* TypeOperator */: + if (node.operator === 141 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 176 /* TypeQuery */: - case 189 /* IndexedAccessType */: - case 190 /* MappedType */: - case 177 /* TypeLiteral */: + case 175 /* TypeQuery */: + case 188 /* IndexedAccessType */: + case 189 /* MappedType */: + case 176 /* TypeLiteral */: case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 187 /* ThisType */: - case 195 /* ImportType */: + case 151 /* UnknownKeyword */: + case 186 /* ThisType */: + case 192 /* ImportType */: break; // handle JSDoc types from an invalid parse - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: - case 308 /* JSDocFunctionType */: - case 309 /* JSDocVariadicType */: - case 310 /* JSDocNamepathType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: + case 304 /* JSDocFunctionType */: + case 305 /* JSDocVariadicType */: + case 306 /* JSDocNamepathType */: break; - case 305 /* JSDocNullableType */: - case 306 /* JSDocNonNullableType */: - case 307 /* JSDocOptionalType */: + case 301 /* JSDocNullableType */: + case 302 /* JSDocNonNullableType */: + case 303 /* JSDocOptionalType */: return serializeTypeNode(node.type); default: return ts.Debug.failBadSyntaxKind(node); @@ -83730,15 +81691,15 @@ var ts; // Note when updating logic here also update getEntityNameForDecoratorMetadata // so that aliases can be marked as referenced var serializedUnion; - for (var _i = 0, types_22 = types; _i < types_22.length; _i++) { - var typeNode = types_22[_i]; - while (typeNode.kind === 186 /* ParenthesizedType */) { + for (var _i = 0, types_21 = types; _i < types_21.length; _i++) { + var typeNode = types_21[_i]; + while (typeNode.kind === 185 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 141 /* NeverKeyword */) { + if (typeNode.kind === 140 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 190 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 149 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -83848,7 +81809,7 @@ var ts; name.original = undefined; ts.setParent(name, ts.getParseTreeNode(currentLexicalScope)); // ensure the parent is set to a parse tree node. return name; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -84422,12 +82383,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = factory.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), factory.createVariableDeclarationList([ factory.createVariableDeclaration(factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 297 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 294 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 255 /* EnumDeclaration */) { + if (node.kind === 252 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -84552,7 +82513,7 @@ var ts; var statementsLocation; var blockLocation; if (node.body) { - if (node.body.kind === 257 /* ModuleBlock */) { + if (node.body.kind === 254 /* ModuleBlock */) { saveStateAndInvoke(node.body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = node.body.statements; blockLocation = node.body; @@ -84599,13 +82560,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (!node.body || node.body.kind !== 257 /* ModuleBlock */) { + if (!node.body || node.body.kind !== 254 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 256 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 253 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -84655,7 +82616,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 263 /* NamespaceImport */) { + if (node.kind === 260 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -84904,16 +82865,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(78 /* Identifier */); - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(256 /* ModuleDeclaration */); + context.enableEmitNotification(253 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 256 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 253 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 255 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 252 /* EnumDeclaration */; } /** * Hook for node emit. @@ -84974,9 +82935,9 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -85014,9 +82975,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 297 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 256 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 255 /* EnumDeclaration */); + if (container && container.kind !== 294 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 253 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 252 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(container), node), /*location*/ node); @@ -85116,40 +83077,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: return visitClassLike(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); case 79 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 200 /* ObjectLiteralExpression */: - case 199 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -85172,20 +83133,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -85937,31 +83898,31 @@ var ts; case 129 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitAwaitExpression(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return ts.visitEachChild(node, visitor, context); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -85970,27 +83931,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 230 /* Block */: - case 244 /* SwitchStatement */: - case 258 /* CaseBlock */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 247 /* TryStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 234 /* IfStatement */: - case 243 /* WithStatement */: - case 245 /* LabeledStatement */: + case 227 /* Block */: + case 241 /* SwitchStatement */: + case 255 /* CaseBlock */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 244 /* TryStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 231 /* IfStatement */: + case 240 /* WithStatement */: + case 242 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -86195,7 +84156,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 209 /* ArrowFunction */; + var isArrowFunction = node.kind === 206 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -86286,17 +84247,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(203 /* CallExpression */); - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(200 /* CallExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(252 /* ClassDeclaration */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(166 /* Constructor */); + context.enableEmitNotification(249 /* ClassDeclaration */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(165 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(232 /* VariableStatement */); + context.enableEmitNotification(229 /* VariableStatement */); } } /** @@ -86344,11 +84305,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -86380,11 +84341,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 252 /* ClassDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 249 /* ClassDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -86535,10 +84496,10 @@ var ts; return visited; } function visitor(node) { - return visitorWorker(node, /*expressionResultIsUnused*/ false); + return visitorWorker(node, /*noDestructuringValue*/ false); } - function visitorWithUnusedExpressionResult(node) { - return visitorWorker(node, /*expressionResultIsUnused*/ true); + function visitorNoDestructuringValue(node) { + return visitorWorker(node, /*noDestructuringValue*/ true); } function visitorNoAsyncModifier(node) { if (node.kind === 129 /* AsyncKeyword */) { @@ -86558,79 +84519,73 @@ var ts; function visitDefault(node) { return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitorWorker(node, expressionResultIsUnused) { + function visitorWorker(node, noDestructuringValue) { if ((node.transformFlags & 32 /* ContainsES2018 */) === 0) { return node; } switch (node.kind) { - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitAwaitExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 216 /* BinaryExpression */: - return visitBinaryExpression(node, expressionResultIsUnused); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node, expressionResultIsUnused); - case 287 /* CatchClause */: + case 213 /* BinaryExpression */: + return visitBinaryExpression(node, noDestructuringValue); + case 284 /* CatchClause */: return visitCatchClause(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 238 /* ForInStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 235 /* ForInStatement */: return doWithHierarchyFacts(visitDefault, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return doWithHierarchyFacts(visitForStatement, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return visitVoidExpression(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return doWithHierarchyFacts(visitConstructorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return doWithHierarchyFacts(visitMethodDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return doWithHierarchyFacts(visitGetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return doWithHierarchyFacts(visitSetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return doWithHierarchyFacts(visitFunctionDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return doWithHierarchyFacts(visitFunctionExpression, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return doWithHierarchyFacts(visitArrowFunction, node, 2 /* ArrowFunctionExcludes */, 0 /* ArrowFunctionIncludes */); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitParameter(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 207 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, expressionResultIsUnused); - case 205 /* TaggedTemplateExpression */: + case 204 /* ParenthesizedExpression */: + return visitParenthesizedExpression(node, noDestructuringValue); + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return ts.visitEachChild(node, visitor, context); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return doWithHierarchyFacts(visitDefault, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); default: return ts.visitEachChild(node, visitor, context); @@ -86666,7 +84621,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 239 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 236 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return factory.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement, factory.liftToBlock), node); @@ -86678,7 +84633,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 290 /* SpreadAssignment */) { + if (e.kind === 287 /* SpreadAssignment */) { if (chunkObject) { objects.push(factory.createObjectLiteralExpression(chunkObject)); chunkObject = undefined; @@ -86687,7 +84642,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 288 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 285 /* PropertyAssignment */ ? factory.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -86721,7 +84676,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 200 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 197 /* ObjectLiteralExpression */) { objects.unshift(factory.createObjectLiteralExpression()); } var expression = objects[0]; @@ -86738,14 +84693,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitExpressionStatement(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + return ts.visitEachChild(node, visitorNoDestructuringValue, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitParenthesizedExpression(node, expressionResultIsUnused) { - return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context); + function visitParenthesizedExpression(node, noDestructuringValue) { + return ts.visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context); } function visitSourceFile(node) { var ancestorFacts = enterSubtree(2 /* SourceFileExcludes */, ts.isEffectiveStrictModeSourceFile(node, compilerOptions) ? @@ -86767,38 +84718,16 @@ var ts; * Visits a BinaryExpression that contains a destructuring assignment. * * @param node A BinaryExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). */ - function visitBinaryExpression(node, expressionResultIsUnused) { + function visitBinaryExpression(node, noDestructuringValue) { if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { - return ts.flattenDestructuringAssignment(node, visitor, context, 1 /* ObjectRest */, !expressionResultIsUnused); + return ts.flattenDestructuringAssignment(node, visitor, context, 1 /* ObjectRest */, !noDestructuringValue); } - if (node.operatorToken.kind === 27 /* CommaToken */) { - return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression)); + else if (node.operatorToken.kind === 27 /* CommaToken */) { + return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorNoDestructuringValue, ts.isExpression), node.operatorToken, ts.visitNode(node.right, noDestructuringValue ? visitorNoDestructuringValue : visitor, ts.isExpression)); } return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitCommaListExpression(node, expressionResultIsUnused) { - if (expressionResultIsUnused) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - var result; - for (var i = 0; i < node.elements.length; i++) { - var element = node.elements[i]; - var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - result.push(visited); - } - } - var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements; - return factory.updateCommaListExpression(node, elements); - } function visitCatchClause(node) { if (node.variableDeclaration && ts.isBindingPattern(node.variableDeclaration.name) && @@ -86850,10 +84779,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitForStatement(node) { - return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement)); + return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorNoDestructuringValue, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement)); } function visitVoidExpression(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + return ts.visitEachChild(node, visitorNoDestructuringValue, context); } /** * Visits a ForOfStatement and converts it into a ES2015-compatible ForOfStatement. @@ -87134,17 +85063,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(203 /* CallExpression */); - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(200 /* CallExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(252 /* ClassDeclaration */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(166 /* Constructor */); + context.enableEmitNotification(249 /* ClassDeclaration */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(165 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(232 /* VariableStatement */); + context.enableEmitNotification(229 /* VariableStatement */); } } /** @@ -87192,11 +85121,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -87228,11 +85157,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 252 /* ClassDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 249 /* ClassDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -87264,7 +85193,7 @@ var ts; return node; } switch (node.kind) { - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -87296,21 +85225,21 @@ var ts; return node; } switch (node.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 203 /* CallExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 200 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -87353,7 +85282,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 201 /* PropertyAccessExpression */ + expression = node.kind === 198 /* PropertyAccessExpression */ ? factory.updatePropertyAccessExpression(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : factory.updateElementAccessExpression(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? factory.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -87367,10 +85296,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 203 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 204 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 200 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -87390,8 +85319,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (!ts.isSimpleCopiableExpression(rightExpression)) { thisArg = factory.createTempVariable(hoistVariableDeclaration); @@ -87402,11 +85331,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 201 /* PropertyAccessExpression */ + rightExpression = segment.kind === 198 /* PropertyAccessExpression */ ? factory.createPropertyAccessExpression(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : factory.createElementAccessExpression(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = factory.createFunctionCallCall(rightExpression, leftThisArg.kind === 105 /* SuperKeyword */ ? factory.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -87463,7 +85392,7 @@ var ts; return node; } switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var binaryExpression = node; if (ts.isLogicalOrCoalescingAssignmentExpression(binaryExpression)) { return transformLogicalAssignment(binaryExpression); @@ -87508,49 +85437,7 @@ var ts; var factory = context.factory, emitHelpers = context.getEmitHelperFactory; var compilerOptions = context.getCompilerOptions(); var currentSourceFile; - var currentFileState; return ts.chainBundle(context, transformSourceFile); - function getCurrentFileNameExpression() { - if (currentFileState.filenameDeclaration) { - return currentFileState.filenameDeclaration.name; - } - var declaration = factory.createVariableDeclaration(factory.createUniqueName("_jsxFileName", 16 /* Optimistic */ | 32 /* FileLevel */), /*exclaimationToken*/ undefined, /*type*/ undefined, factory.createStringLiteral(currentSourceFile.fileName)); - currentFileState.filenameDeclaration = declaration; - return currentFileState.filenameDeclaration.name; - } - function getJsxFactoryCalleePrimitive(childrenLength) { - return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" : childrenLength > 1 ? "jsxs" : "jsx"; - } - function getJsxFactoryCallee(childrenLength) { - var type = getJsxFactoryCalleePrimitive(childrenLength); - return getImplicitImportForName(type); - } - function getImplicitJsxFragmentReference() { - return getImplicitImportForName("Fragment"); - } - function getImplicitImportForName(name) { - var _a, _b; - var importSource = name === "createElement" - ? currentFileState.importSpecifier - : ts.getJSXRuntimeImport(currentFileState.importSpecifier, compilerOptions); - var existing = (_b = (_a = currentFileState.utilizedImplicitRuntimeImports) === null || _a === void 0 ? void 0 : _a.get(importSource)) === null || _b === void 0 ? void 0 : _b.get(name); - if (existing) { - return existing.name; - } - if (!currentFileState.utilizedImplicitRuntimeImports) { - currentFileState.utilizedImplicitRuntimeImports = ts.createMap(); - } - var specifierSourceImports = currentFileState.utilizedImplicitRuntimeImports.get(importSource); - if (!specifierSourceImports) { - specifierSourceImports = ts.createMap(); - currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports); - } - var generatedName = factory.createUniqueName("_" + name, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */); - var specifier = factory.createImportSpecifier(factory.createIdentifier(name), generatedName); - generatedName.generatedImportReference = specifier; - specifierSourceImports.set(name, specifier); - return generatedName; - } /** * Transform JSX-specific syntax in a SourceFile. * @@ -87561,42 +85448,8 @@ var ts; return node; } currentSourceFile = node; - currentFileState = {}; - currentFileState.importSpecifier = ts.getJSXImplicitImportBase(compilerOptions, node); var visited = ts.visitEachChild(node, visitor, context); ts.addEmitHelpers(visited, context.readEmitHelpers()); - var statements = visited.statements; - if (currentFileState.filenameDeclaration) { - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([currentFileState.filenameDeclaration], 2 /* Const */))); - } - if (currentFileState.utilizedImplicitRuntimeImports) { - for (var _i = 0, _a = ts.arrayFrom(currentFileState.utilizedImplicitRuntimeImports.entries()); _i < _a.length; _i++) { - var _b = _a[_i], importSource = _b[0], importSpecifiersMap = _b[1]; - if (ts.isExternalModule(node)) { - // Add `import` statement - var importStatement = factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, factory.createImportClause(/*typeOnly*/ false, /*name*/ undefined, factory.createNamedImports(ts.arrayFrom(importSpecifiersMap.values()))), factory.createStringLiteral(importSource)); - ts.setParentRecursive(importStatement, /*incremental*/ false); - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), importStatement); - } - else if (ts.isExternalOrCommonJsModule(node)) { - // Add `require` statement - var requireStatement = factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([ - factory.createVariableDeclaration(factory.createObjectBindingPattern(ts.map(ts.arrayFrom(importSpecifiersMap.values()), function (s) { return factory.createBindingElement(/*dotdotdot*/ undefined, s.propertyName, s.name); })), - /*exclaimationToken*/ undefined, - /*type*/ undefined, factory.createCallExpression(factory.createIdentifier("require"), /*typeArguments*/ undefined, [factory.createStringLiteral(importSource)])) - ], 2 /* Const */)); - ts.setParentRecursive(requireStatement, /*incremental*/ false); - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), requireStatement); - } - else { - // Do nothing (script file) - consider an error in the checker? - } - } - } - if (statements !== visited.statements) { - visited = factory.updateSourceFile(visited, statements); - } - currentFileState = undefined; return visited; } function visitor(node) { @@ -87609,13 +85462,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -87625,122 +85478,28 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitJsxExpression(node); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); } } - /** - * The react jsx/jsxs transform falls back to `createElement` when an explicit `key` argument comes after a spread - */ - function hasKeyAfterPropsSpread(node) { - var spread = false; - for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { - var elem = _a[_i]; - if (ts.isJsxSpreadAttribute(elem)) { - spread = true; - } - else if (spread && ts.isJsxAttribute(elem) && elem.name.escapedText === "key") { - return true; - } - } - return false; - } - function shouldUseCreateElement(node) { - return currentFileState.importSpecifier === undefined || hasKeyAfterPropsSpread(node); - } function visitJsxElement(node, isChild) { - var tagTransform = shouldUseCreateElement(node.openingElement) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform(node.openingElement, node.children, isChild, /*location*/ node); + return visitJsxOpeningLikeElement(node.openingElement, node.children, isChild, /*location*/ node); } function visitJsxSelfClosingElement(node, isChild) { - var tagTransform = shouldUseCreateElement(node) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform(node, /*children*/ undefined, isChild, /*location*/ node); + return visitJsxOpeningLikeElement(node, /*children*/ undefined, isChild, /*location*/ node); } function visitJsxFragment(node, isChild) { - var tagTransform = currentFileState.importSpecifier === undefined ? visitJsxOpeningFragmentCreateElement : visitJsxOpeningFragmentJSX; - return tagTransform(node.openingFragment, node.children, isChild, /*location*/ node); + return visitJsxOpeningFragment(node.openingFragment, node.children, isChild, /*location*/ node); } - function convertJsxChildrenToChildrenPropObject(children) { - var nonWhitespaceChildren = ts.getSemanticJsxChildren(children); - if (ts.length(nonWhitespaceChildren) === 1) { - var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]); - return result_13 && factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("children", result_13) - ]); - } - var result = ts.mapDefined(children, transformJsxChildToExpression); - return !result.length ? undefined : factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) - ]); - } - function visitJsxOpeningLikeElementJSX(node, children, isChild, location) { - var tagName = getTagName(node); - var objectProperties; - var keyAttr = ts.find(node.attributes.properties, function (p) { return !!p.name && ts.isIdentifier(p.name) && p.name.escapedText === "key"; }); - var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties; - var segments = []; - if (attrs.length) { - // Map spans of JsxAttribute nodes into object literals and spans - // of JsxSpreadAttribute nodes into expressions. - segments = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread - ? ts.map(attrs, transformJsxSpreadAttributeToExpression) - : factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); })); - if (ts.isJsxSpreadAttribute(attrs[0])) { - // We must always emit at least one object literal before a spread - // argument.factory.createObjectLiteral - segments.unshift(factory.createObjectLiteralExpression()); - } - } - if (children && children.length) { - var result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - segments.push(result); - } - } - if (segments.length === 0) { - objectProperties = factory.createObjectLiteralExpression([]); - // When there are no attributes, React wants {} - } - else { - // Either emit one big object literal (no spread attribs), or - // a call to the __assign helper. - objectProperties = ts.singleOrUndefined(segments) || emitHelpers().createAssignHelper(segments); - } - return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, ts.length(ts.getSemanticJsxChildren(children || ts.emptyArray)), isChild, location); - } - function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, childrenLength, isChild, location) { - var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)]; - if (compilerOptions.jsx === 5 /* ReactJSXDev */) { - var originalFile = ts.getOriginalNode(currentSourceFile); - if (originalFile && ts.isSourceFile(originalFile)) { - // isStaticChildren development flag - args.push(childrenLength > 1 ? factory.createTrue() : factory.createFalse()); - // __source development flag - var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos); - args.push(factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("fileName", getCurrentFileNameExpression()), - factory.createPropertyAssignment("lineNumber", factory.createNumericLiteral(lineCol.line + 1)), - factory.createPropertyAssignment("columnNumber", factory.createNumericLiteral(lineCol.character + 1)) - ])); - // __self development flag - args.push(factory.createThis()); - } - } - var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(childrenLength), /*typeArguments*/ undefined, args), location); - if (isChild) { - ts.startOnNewLine(element); - } - return element; - } - function visitJsxOpeningLikeElementCreateElement(node, children, isChild, location) { + function visitJsxOpeningLikeElement(node, children, isChild, location) { var tagName = getTagName(node); var objectProperties; var attrs = node.attributes.properties; @@ -87766,28 +85525,14 @@ var ts; objectProperties = emitHelpers().createAssignHelper(segments); } } - var callee = currentFileState.importSpecifier === undefined - ? ts.createJsxFactoryExpression(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 - node) - : getImplicitImportForName("createElement"); - var element = ts.createExpressionForJsxElement(factory, callee, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), location); + var element = ts.createExpressionForJsxElement(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 + tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } return element; } - function visitJsxOpeningFragmentJSX(_node, children, isChild, location) { - var childrenProps; - if (children && children.length) { - var result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - childrenProps = result; - } - } - return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]), - /*keyAttr*/ undefined, ts.length(ts.getSemanticJsxChildren(children)), isChild, location); - } - function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) { + function visitJsxOpeningFragment(node, children, isChild, location) { var element = ts.createExpressionForJsxFragment(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { @@ -87814,7 +85559,7 @@ var ts; var literal = factory.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote); return ts.setTextRange(literal, node); } - else if (node.kind === 283 /* JsxExpression */) { + else if (node.kind === 280 /* JsxExpression */) { if (node.expression === undefined) { return factory.createTrue(); } @@ -87908,7 +85653,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 273 /* JsxElement */) { + if (node.kind === 270 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -88214,7 +85959,7 @@ var ts; return node; } switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -88427,7 +86172,7 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 242 /* ReturnStatement */ + && node.kind === 239 /* ReturnStatement */ && !node.expression; } function isOrMayContainReturnCompletion(node) { @@ -88453,10 +86198,12 @@ var ts; || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } function visitor(node) { - return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ false) : node; - } - function visitorWithUnusedExpressionResult(node) { - return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ true) : node; + if (shouldVisitNode(node)) { + return visitJavaScript(node); + } + else { + return node; + } } function callExpressionVisitor(node) { if (node.kind === 105 /* SuperKeyword */) { @@ -88464,70 +86211,68 @@ var ts; } return visitor(node); } - function visitorWorker(node, expressionResultIsUnused) { + function visitJavaScript(node) { switch (node.kind) { case 123 /* StaticKeyword */: return undefined; // elide static keyword - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return visitClassExpression(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitParameter(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return visitArrowFunction(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); case 78 /* Identifier */: return visitIdentifier(node); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitCaseBlock(node); - case 230 /* Block */: + case 227 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); - case 207 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, expressionResultIsUnused); - case 216 /* BinaryExpression */: - return visitBinaryExpression(node, expressionResultIsUnused); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node, expressionResultIsUnused); + case 204 /* ParenthesizedExpression */: + return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); + case 213 /* BinaryExpression */: + return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: case 16 /* TemplateMiddle */: @@ -88537,31 +86282,29 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return visitTemplateExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return visitSpreadElement(node); case 105 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 107 /* ThisKeyword */: return visitThisKeyword(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return visitMetaProperty(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return visitAccessorDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); - case 212 /* VoidExpression */: - return visitVoidExpression(node); default: return ts.visitEachChild(node, visitor, context); } @@ -88632,9 +86375,6 @@ var ts; } return node; } - function visitVoidExpression(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } function visitIdentifier(node) { if (!convertedLoopState) { return node; @@ -88650,14 +86390,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 241 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 238 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 241 /* BreakStatement */) { + if (node.kind === 238 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -88668,7 +86408,7 @@ var ts; } } else { - if (node.kind === 241 /* BreakStatement */) { + if (node.kind === 238 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -88820,17 +86560,16 @@ var ts; */ function transformClassBody(node, extendsClauseElement) { var statements = []; - var name = factory.getInternalName(node); - var constructorLikeName = ts.isIdentifierANonContextualKeyword(name) ? factory.getGeneratedNameForNode(name) : name; startLexicalEnvironment(); addExtendsHelperIfNeeded(statements, node, extendsClauseElement); - addConstructor(statements, node, constructorLikeName, extendsClauseElement); + addConstructor(statements, node, extendsClauseElement); addClassMembers(statements, node); // Create a synthetic text range for the return statement. var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 19 /* CloseBraceToken */); + var localName = factory.getInternalName(node); // The following partially-emitted expression exists purely to align our sourcemap // emit with the original emitter. - var outer = factory.createPartiallyEmittedExpression(constructorLikeName); + var outer = factory.createPartiallyEmittedExpression(localName); ts.setTextRangeEnd(outer, closingBraceLocation.end); ts.setEmitFlags(outer, 1536 /* NoComments */); var statement = factory.createReturnStatement(outer); @@ -88862,7 +86601,7 @@ var ts; * @param node The ClassExpression or ClassDeclaration node. * @param extendsClauseElement The expression for the class `extends` clause. */ - function addConstructor(statements, node, name, extendsClauseElement) { + function addConstructor(statements, node, extendsClauseElement) { var savedConvertedLoopState = convertedLoopState; convertedLoopState = undefined; var ancestorFacts = enterSubtree(16278 /* ConstructorExcludes */, 73 /* ConstructorIncludes */); @@ -88871,7 +86610,7 @@ var ts; var constructorFunction = factory.createFunctionDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*asteriskToken*/ undefined, name, + /*asteriskToken*/ undefined, factory.getInternalName(node), /*typeParameters*/ undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper)); ts.setTextRange(constructorFunction, constructor || node); @@ -89066,11 +86805,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 242 /* ReturnStatement */) { + if (statement.kind === 239 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 234 /* IfStatement */) { + else if (statement.kind === 231 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -89078,7 +86817,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 230 /* Block */) { + else if (statement.kind === 227 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -89280,7 +87019,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 209 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 206 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, factory.createThis()); return true; } @@ -89302,22 +87041,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return statements; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = factory.createVoidZero(); break; - case 166 /* Constructor */: + case 165 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = factory.createPropertyAccessExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = factory.createConditionalExpression(factory.createLogicalAnd(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), factory.createBinaryExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), 101 /* InstanceOfKeyword */, factory.getLocalName(node))), @@ -89352,20 +87091,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 166 /* Constructor */: + case 165 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -89568,7 +87307,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */)) { name = factory.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -89614,7 +87353,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 209 /* ArrowFunction */); + ts.Debug.assert(node.kind === 206 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -89680,55 +87419,51 @@ var ts; * @param node An ExpressionStatement node. */ function visitExpressionStatement(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + // If we are here it is most likely because our expression is a destructuring assignment. + switch (node.expression.kind) { + case 204 /* ParenthesizedExpression */: + return factory.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); + case 213 /* BinaryExpression */: + return factory.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); + } + return ts.visitEachChild(node, visitor, context); } /** * Visits a ParenthesizedExpression that may contain a destructuring assignment. * * @param node A ParenthesizedExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). + * @param needsDestructuringValue A value indicating whether we need to hold onto the rhs + * of a destructuring assignment. */ - function visitParenthesizedExpression(node, expressionResultIsUnused) { - return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context); + function visitParenthesizedExpression(node, needsDestructuringValue) { + // If we are here it is most likely because our expression is a destructuring assignment. + if (!needsDestructuringValue) { + // By default we always emit the RHS at the end of a flattened destructuring + // expression. If we are in a state where we do not need the destructuring value, + // we pass that information along to the children that care about it. + switch (node.expression.kind) { + case 204 /* ParenthesizedExpression */: + return factory.updateParenthesizedExpression(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); + case 213 /* BinaryExpression */: + return factory.updateParenthesizedExpression(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); + } + } + return ts.visitEachChild(node, visitor, context); } /** * Visits a BinaryExpression that contains a destructuring assignment. * * @param node A BinaryExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). + * @param needsDestructuringValue A value indicating whether we need to hold onto the rhs + * of a destructuring assignment. */ - function visitBinaryExpression(node, expressionResultIsUnused) { + function visitBinaryExpression(node, needsDestructuringValue) { // If we are here it is because this is a destructuring assignment. if (ts.isDestructuringAssignment(node)) { - return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, !expressionResultIsUnused); - } - if (node.operatorToken.kind === 27 /* CommaToken */) { - return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression)); + return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, needsDestructuringValue); } return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitCommaListExpression(node, expressionResultIsUnused) { - if (expressionResultIsUnused) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - var result; - for (var i = 0; i < node.elements.length; i++) { - var element = node.elements[i]; - var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - result.push(visited); - } - } - var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements; - return factory.updateCommaListExpression(node, elements); - } function isVariableStatementOfTypeScriptClassWrapper(node) { return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer @@ -89921,14 +87656,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -89944,9 +87679,6 @@ var ts; function visitForStatement(node, outermostLabeledStatement) { return visitIterationStatementWithFacts(5056 /* ForStatementExcludes */, 3328 /* ForStatementIncludes */, node, outermostLabeledStatement); } - function visitEachChildOfForStatement(node) { - return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - } function visitForInStatement(node, outermostLabeledStatement) { return visitIterationStatementWithFacts(3008 /* ForInOrForOfStatementExcludes */, 5376 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement); } @@ -89989,7 +87721,7 @@ var ts; // evaluated on every iteration. var assignment = factory.createAssignment(initializer, boundValue); if (ts.isDestructuringAssignment(assignment)) { - statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*expressionResultIsUnused*/ true))); + statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*needsDestructuringValue*/ false))); } else { ts.setTextRangeEnd(assignment, initializer.end); @@ -90114,7 +87846,7 @@ var ts; var property = properties[i]; if ((property.transformFlags & 262144 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */) - || (hasComputed = ts.Debug.checkDefined(property.name).kind === 158 /* ComputedPropertyName */)) { + || (hasComputed = ts.Debug.checkDefined(property.name).kind === 157 /* ComputedPropertyName */)) { numInitialProperties = i; break; } @@ -90190,7 +87922,7 @@ var ts; } var result = convert ? convert(node, outermostLabeledStatement, /*convertedLoopBodyStatements*/ undefined, ancestorFacts) - : factory.restoreEnclosingLabel(ts.isForStatement(node) ? visitEachChildOfForStatement(node) : ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); + : factory.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); if (convertedLoopState) { convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; } @@ -90230,18 +87962,18 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 237 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 238 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 239 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 235 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 236 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 234 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 235 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 236 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 232 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 233 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } function convertForStatement(node, initializerFunction, convertedLoopBody) { var shouldConvertCondition = node.condition && shouldConvertPartOfIterationStatement(node.condition); var shouldConvertIncrementor = shouldConvertCondition || node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); - return factory.updateForStatement(node, ts.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(shouldConvertCondition ? undefined : node.condition, visitor, ts.isExpression), ts.visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), convertedLoopBody); + return factory.updateForStatement(node, ts.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitor, ts.isForInitializer), ts.visitNode(shouldConvertCondition ? undefined : node.condition, visitor, ts.isExpression), ts.visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitor, ts.isExpression), convertedLoopBody); } function convertForOfStatement(node, convertedLoopBody) { return factory.updateForOfStatement(node, @@ -90259,11 +87991,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 250 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 247 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -90671,20 +88403,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -90791,7 +88523,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { updated = factory.updateGetAccessorDeclaration(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -91283,13 +89015,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(107 /* ThisKeyword */); - context.enableEmitNotification(166 /* Constructor */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(209 /* ArrowFunction */); - context.enableEmitNotification(208 /* FunctionExpression */); - context.enableEmitNotification(251 /* FunctionDeclaration */); + context.enableEmitNotification(165 /* Constructor */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(206 /* ArrowFunction */); + context.enableEmitNotification(205 /* FunctionExpression */); + context.enableEmitNotification(248 /* FunctionDeclaration */); } } /** @@ -91330,10 +89062,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 246 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -91415,11 +89147,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 233 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 230 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 203 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 200 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -91427,7 +89159,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 220 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 217 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -91453,15 +89185,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(275 /* JsxOpeningElement */); - context.enableEmitNotification(276 /* JsxClosingElement */); - context.enableEmitNotification(274 /* JsxSelfClosingElement */); + context.enableEmitNotification(272 /* JsxOpeningElement */); + context.enableEmitNotification(273 /* JsxClosingElement */); + context.enableEmitNotification(271 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(288 /* PropertyAssignment */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(285 /* PropertyAssignment */); return ts.chainBundle(context, transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -91480,9 +89212,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 275 /* JsxOpeningElement */: - case 276 /* JsxClosingElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 273 /* JsxClosingElement */: + case 271 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -91817,13 +89549,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitWhileStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -91836,24 +89568,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return visitAccessorDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return visitBreakStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return visitContinueStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -91874,23 +89606,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return visitConditionalExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -91903,9 +89633,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -92113,7 +89843,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -92125,7 +89855,7 @@ var ts; // _a.b = %sent%; target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -92172,61 +89902,6 @@ var ts; } return ts.visitEachChild(node, visitor, context); } - /** - * Visits a comma expression containing `yield`. - * - * @param node The node to visit. - */ - function visitCommaExpression(node) { - // [source] - // x = a(), yield, b(); - // - // [intermediate] - // a(); - // .yield resumeLabel - // .mark resumeLabel - // x = %sent%, b(); - var pendingExpressions = []; - visit(node.left); - visit(node.right); - return factory.inlineExpressions(pendingExpressions); - function visit(node) { - if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { - visit(node.left); - visit(node.right); - } - else { - if (containsYield(node) && pendingExpressions.length > 0) { - emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); - pendingExpressions = []; - } - pendingExpressions.push(ts.visitNode(node, visitor, ts.isExpression)); - } - } - } - /** - * Visits a comma-list expression. - * - * @param node The node to visit. - */ - function visitCommaListExpression(node) { - // flattened version of `visitCommaExpression` - var pendingExpressions = []; - for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { - var elem = _a[_i]; - if (ts.isBinaryExpression(elem) && elem.operatorToken.kind === 27 /* CommaToken */) { - pendingExpressions.push(visitCommaExpression(elem)); - } - else { - if (containsYield(elem) && pendingExpressions.length > 0) { - emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); - pendingExpressions = []; - } - pendingExpressions.push(ts.visitNode(elem, visitor, ts.isExpression)); - } - } - return factory.inlineExpressions(pendingExpressions); - } /** * Visits a logical binary expression containing `yield`. * @@ -92276,6 +89951,38 @@ var ts; markLabel(resultLabel); return resultLocal; } + /** + * Visits a comma expression containing `yield`. + * + * @param node The node to visit. + */ + function visitCommaExpression(node) { + // [source] + // x = a(), yield, b(); + // + // [intermediate] + // a(); + // .yield resumeLabel + // .mark resumeLabel + // x = %sent%, b(); + var pendingExpressions = []; + visit(node.left); + visit(node.right); + return factory.inlineExpressions(pendingExpressions); + function visit(node) { + if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { + visit(node.left); + visit(node.right); + } + else { + if (containsYield(node) && pendingExpressions.length > 0) { + emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); + pendingExpressions = []; + } + pendingExpressions.push(ts.visitNode(node, visitor, ts.isExpression)); + } + } + } /** * Visits a conditional expression containing `yield`. * @@ -92519,35 +90226,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 230 /* Block */: + case 227 /* Block */: return transformAndEmitBlock(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return transformAndEmitIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return transformAndEmitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return transformAndEmitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return transformAndEmitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -92977,7 +90684,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 285 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 282 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -92990,7 +90697,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -94151,11 +91858,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(213 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(211 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(212 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(294 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -94206,10 +91913,7 @@ var ts; ts.append(statements, createUnderscoreUnderscoreESModule()); } if (ts.length(currentModuleInfo.exportedNames)) { - var chunkSize = 50; - for (var i = 0; i < currentModuleInfo.exportedNames.length; i += chunkSize) { - ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames.slice(i, i + chunkSize), function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero()))); - } + ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames, function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero()))); } ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); @@ -94483,23 +92187,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 338 /* MergeDeclarationMarker */: + case 333 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 339 /* EndOfDeclarationMarker */: + case 334 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -94526,24 +92230,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -94878,11 +92582,9 @@ var ts; else if (node.exportClause) { var statements = []; // export * as ns from "mod"; - // export * as default from "mod"; statements.push(ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(createExportExpression(factory.cloneNode(node.exportClause.name), getHelperExpressionForExport(node, moduleKind !== ts.ModuleKind.AMD ? createRequireCall(node) : - ts.isExportNamespaceAsDefaultDeclaration(node) ? generatedName : - factory.createIdentifier(ts.idText(node.exportClause.name))))), node), node)); + factory.createIdentifier(ts.idText(node.exportClause.name))))), node), node)); return ts.singleOrMany(statements); } else { @@ -94975,7 +92677,6 @@ var ts; var expressions; if (ts.hasSyntacticModifier(node, 1 /* Export */)) { var modifiers = void 0; - var removeCommentsOnExpressions = false; // If we're exporting these variables, then these just become assignments to 'exports.x'. for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var variable = _a[_i]; @@ -94986,28 +92687,14 @@ var ts; variables = ts.append(variables, variable); } else if (variable.initializer) { - if (!ts.isBindingPattern(variable.name) && (ts.isArrowFunction(variable.initializer) || ts.isFunctionExpression(variable.initializer) || ts.isClassExpression(variable.initializer))) { - var expression = factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), variable.name), - /*location*/ variable.name), factory.createIdentifier(ts.getTextOfIdentifierOrLiteral(variable.name))); - var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, moduleExpressionElementVisitor)); - variables = ts.append(variables, updatedVariable); - expressions = ts.append(expressions, expression); - removeCommentsOnExpressions = true; - } - else { - expressions = ts.append(expressions, transformInitializedVariable(variable)); - } + expressions = ts.append(expressions, transformInitializedVariable(variable)); } } if (variables) { statements = ts.append(statements, factory.updateVariableStatement(node, modifiers, factory.updateVariableDeclarationList(node.declarationList, variables))); } if (expressions) { - var statement = ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node); - if (removeCommentsOnExpressions) { - ts.removeAllComments(statement); - } - statements = ts.append(statements, statement); + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node)); } } else { @@ -95068,7 +92755,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 229 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -95123,10 +92810,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -95339,7 +93026,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -95403,10 +93090,10 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return substituteBinaryExpression(node); - case 215 /* PostfixUnaryExpression */: - case 214 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -95425,9 +93112,9 @@ var ts; } return node; } - if (!(ts.isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !ts.isLocalName(node)) { + if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 297 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 294 /* SourceFile */) { return ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.cloneNode(node)), /*location*/ node); } @@ -95502,7 +93189,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 215 /* PostfixUnaryExpression */ + var expression = node.kind === 212 /* PostfixUnaryExpression */ ? ts.setTextRange(factory.createBinaryExpression(node.operand, factory.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), factory.createNumericLiteral(1)), /*location*/ node) : node; @@ -95554,12 +93241,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(226 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(213 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(211 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(212 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(223 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(294 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -95783,7 +93470,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 267 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 264 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -95873,19 +93560,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(factory, entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(factory.createExpressionStatement(factory.createAssignment(importVariableName, parameterName))); break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -95944,13 +93631,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -96130,7 +93817,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 297 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 294 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -96194,7 +93881,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 229 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasSyntacticModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -96256,10 +93943,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -96439,43 +94126,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitWhileStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return visitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitCaseBlock(node); - case 284 /* CaseClause */: + case 281 /* CaseClause */: return visitCaseClause(node); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return visitDefaultClause(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return visitTryStatement(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); - case 230 /* Block */: + case 227 /* Block */: return visitBlock(node); - case 338 /* MergeDeclarationMarker */: + case 333 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 339 /* EndOfDeclarationMarker */: + case 334 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -96722,7 +94409,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 297 /* SourceFile */; + return container !== undefined && container.kind === 294 /* SourceFile */; } else { return false; @@ -96755,7 +94442,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -96805,7 +94492,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -96841,12 +94528,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return substituteBinaryExpression(node); - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -96939,14 +94626,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 215 /* PostfixUnaryExpression */ + var expression = node.kind === 212 /* PostfixUnaryExpression */ ? ts.setTextRange(factory.createPrefixUnaryExpression(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 215 /* PostfixUnaryExpression */) { + if (node.kind === 212 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? factory.createSubtract(preventSubstitution(expression), factory.createNumericLiteral(1)) : factory.createAdd(preventSubstitution(expression), factory.createNumericLiteral(1)); @@ -96974,7 +94661,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 297 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 294 /* SourceFile */) { exportedNames = ts.append(exportedNames, factory.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -97014,7 +94701,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(297 /* SourceFile */); + context.enableEmitNotification(294 /* SourceFile */); context.enableSubstitution(78 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(context, transformSourceFile); @@ -97046,12 +94733,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -97078,7 +94765,7 @@ var ts; /*isTypeOnly*/ false, /*name*/ undefined, factory.createNamespaceImport(synthName)), node.moduleSpecifier); ts.setOriginalNode(importDecl, node.exportClause); - var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration( + var exportDecl = factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, factory.createNamedExports([factory.createExportSpecifier(synthName, oldIdentifier)])); @@ -97185,7 +94872,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97214,7 +94901,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97261,7 +94948,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97270,8 +94957,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 163 /* PropertyDeclaration */ || node.kind === 201 /* PropertyAccessExpression */ || node.kind === 162 /* PropertySignature */ || - (node.kind === 160 /* Parameter */ && ts.hasSyntacticModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 162 /* PropertyDeclaration */ || node.kind === 198 /* PropertyAccessExpression */ || node.kind === 161 /* PropertySignature */ || + (node.kind === 159 /* Parameter */ && ts.hasSyntacticModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasSyntacticModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -97280,7 +94967,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */ || node.kind === 160 /* Parameter */) { + else if (node.parent.kind === 249 /* ClassDeclaration */ || node.kind === 159 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97305,7 +94992,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 168 /* SetAccessor */) { + if (node.kind === 167 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasSyntacticModifier(node, 32 /* Static */)) { @@ -97344,26 +95031,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -97371,7 +95058,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -97385,7 +95072,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -97410,30 +95097,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 170 /* ConstructSignature */: - case 175 /* ConstructorType */: + case 169 /* ConstructSignature */: + case 174 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 169 /* CallSignature */: + case 168 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -97441,7 +95128,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97454,15 +95141,15 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 251 /* FunctionDeclaration */: - case 174 /* FunctionType */: + case 248 /* FunctionDeclaration */: + case 173 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 168 /* SetAccessor */: - case 167 /* GetAccessor */: + case 167 /* SetAccessor */: + case 166 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97476,39 +95163,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 190 /* MappedType */: + case 189 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 249 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174 /* FunctionType */: - case 251 /* FunctionDeclaration */: + case 173 /* FunctionType */: + case 248 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -97572,7 +95259,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 160 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 159 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -97627,7 +95314,6 @@ var ts; reportCyclicStructureError: reportCyclicStructureError, reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression, reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError, - reportTruncationError: reportTruncationError, moduleResolverHost: host, trackReferencedAmbientModule: trackReferencedAmbientModule, trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode, @@ -97727,11 +95413,6 @@ var ts; context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier)); } } - function reportTruncationError() { - if (errorNameNode) { - context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed)); - } - } function reportNonlocalAugmentation(containingFile, parentSymbol, symbol) { var primaryDeclaration = ts.find(parentSymbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === containingFile; }); var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; }); @@ -97753,10 +95434,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 297 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 294 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 298 /* Bundle */) { + if (node.kind === 295 /* Bundle */) { isBundledEmit = true; refs = new ts.Map(); libs = new ts.Map(); @@ -97786,7 +95467,7 @@ var ts; var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return factory.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 300 /* InputFiles */) { + if (prepend.kind === 297 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -97927,7 +95608,7 @@ var ts; return name; } else { - if (name.kind === 197 /* ArrayBindingPattern */) { + if (name.kind === 194 /* ArrayBindingPattern */) { return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -97935,7 +95616,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 222 /* OmittedExpression */) { + if (elem.kind === 219 /* OmittedExpression */) { return elem; } return factory.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -97973,7 +95654,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 160 /* Parameter */ && + var shouldUseResolverType = node.kind === 159 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -97982,7 +95663,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : factory.createKeywordTypeNode(128 /* AnyKeyword */); } - if (node.kind === 168 /* SetAccessor */) { + if (node.kind === 167 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return factory.createKeywordTypeNode(128 /* AnyKeyword */); @@ -97993,12 +95674,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 160 /* Parameter */ - || node.kind === 163 /* PropertyDeclaration */ - || node.kind === 162 /* PropertySignature */) { + if (node.kind === 159 /* Parameter */ + || node.kind === 162 /* PropertyDeclaration */ + || node.kind === 161 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -98015,20 +95696,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: return false; } return false; @@ -98109,7 +95790,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 256 /* ModuleDeclaration */ && parent.kind !== 195 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 253 /* ModuleDeclaration */ && parent.kind !== 192 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -98129,7 +95810,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 272 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 269 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return factory.updateImportEqualsDeclaration(decl, @@ -98156,7 +95837,7 @@ var ts; return visibleDefaultBinding && factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, /*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 260 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -98251,7 +95932,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 177 /* TypeLiteral */ || input.kind === 190 /* MappedType */) && input.parent.kind !== 254 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 176 /* TypeLiteral */ || input.kind === 189 /* MappedType */) && input.parent.kind !== 251 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasEffectiveModifier(input, 8 /* Private */)) { @@ -98272,21 +95953,21 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 223 /* ExpressionWithTypeArguments */: { + case 220 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments)); } - case 173 /* TypeReference */: { + case 172 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory.updateTypeReferenceNode(node, node.typeName, node.typeArguments)); } - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return cleanup(factory.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 166 /* Constructor */: { + case 165 /* Constructor */: { // A constructor declaration may not have a type annotation var ctor = factory.createConstructorDeclaration( /*decorators*/ undefined, @@ -98294,7 +95975,7 @@ var ts; /*body*/ undefined); return cleanup(ctor); } - case 165 /* MethodDeclaration */: { + case 164 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98304,7 +95985,7 @@ var ts; /*body*/ undefined); return cleanup(sig); } - case 167 /* GetAccessor */: { + case 166 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98313,7 +95994,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 168 /* SetAccessor */: { + case 167 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98321,31 +96002,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updatePropertyDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type))); - case 164 /* MethodSignature */: { + case 163 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updateMethodSignature(input, ensureModifiers(input), input.name, input.questionToken, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 169 /* CallSignature */: { + case 168 /* CallSignature */: { return cleanup(factory.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 171 /* IndexSignature */: { + case 170 /* IndexSignature */: { return cleanup(factory.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || factory.createKeywordTypeNode(128 /* AnyKeyword */))); } - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -98353,13 +96034,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(factory.updateVariableDeclaration(input, input.name, /*exclamationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 159 /* TypeParameter */: { + case 158 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(factory.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 184 /* ConditionalType */: { + case 183 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -98371,13 +96052,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(factory.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 174 /* FunctionType */: { + case 173 /* FunctionType */: { return cleanup(factory.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 175 /* ConstructorType */: { + case 174 /* ConstructorType */: { return cleanup(factory.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 195 /* ImportType */: { + case 192 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -98409,7 +96090,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 165 /* MethodDeclaration */ && ts.hasEffectiveModifier(node.parent, 8 /* Private */); + return node.parent.kind === 164 /* MethodDeclaration */ && ts.hasEffectiveModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -98419,7 +96100,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 267 /* ExportDeclaration */: { + case 264 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -98429,7 +96110,7 @@ var ts; return factory.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier)); } - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -98468,10 +96149,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 260 /* ImportEqualsDeclaration */: { + case 257 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 261 /* ImportDeclaration */: { + case 258 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -98492,14 +96173,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 254 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 251 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(factory.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 253 /* InterfaceDeclaration */: { + case 250 /* InterfaceDeclaration */: { return cleanup(factory.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 251 /* FunctionDeclaration */: { + case 248 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(factory.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -98566,10 +96247,10 @@ var ts; return clean; } } - case 256 /* ModuleDeclaration */: { + case 253 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 257 /* ModuleBlock */) { + if (inner && inner.kind === 254 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -98612,7 +96293,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 252 /* ClassDeclaration */: { + case 249 /* ClassDeclaration */: { var modifiers = factory.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -98693,10 +96374,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 232 /* VariableStatement */: { + case 229 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 255 /* EnumDeclaration */: { + case 252 /* EnumDeclaration */: { return cleanup(factory.updateEnumDeclaration(input, /*decorators*/ undefined, factory.createNodeArray(ensureModifiers(input)), input.name, factory.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -98715,7 +96396,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 256 /* ModuleDeclaration */) { + if (input.kind === 253 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -98736,7 +96417,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 222 /* OmittedExpression */) { + if (e.kind === 219 /* OmittedExpression */) { return; } if (e.name) { @@ -98786,7 +96467,7 @@ var ts; function ensureModifierFlags(node) { var mask = 11263 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 297 /* SourceFile */; + var parentIsFile = node.parent.kind === 294 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -98815,7 +96496,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 253 /* InterfaceDeclaration */) { + if (node.kind === 250 /* InterfaceDeclaration */) { return true; } return false; @@ -98840,7 +96521,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 167 /* GetAccessor */ + return accessor.kind === 166 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -98849,52 +96530,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return !ts.hasEffectiveModifier(node, 8 /* Private */); - case 160 /* Parameter */: - case 249 /* VariableDeclaration */: + case 159 /* Parameter */: + case 246 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 232 /* VariableStatement */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 229 /* VariableStatement */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 170 /* ConstructSignature */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 171 /* IndexSignature */: - case 249 /* VariableDeclaration */: - case 159 /* TypeParameter */: - case 223 /* ExpressionWithTypeArguments */: - case 173 /* TypeReference */: - case 184 /* ConditionalType */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 195 /* ImportType */: + case 169 /* ConstructSignature */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 170 /* IndexSignature */: + case 246 /* VariableDeclaration */: + case 158 /* TypeParameter */: + case 220 /* ExpressionWithTypeArguments */: + case 172 /* TypeReference */: + case 183 /* ConditionalType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 192 /* ImportType */: return true; } return false; @@ -98938,13 +96619,14 @@ var ts; function getScriptTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles) { if (emitOnlyDtsFiles) return ts.emptyArray; + var jsx = compilerOptions.jsx; var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var transformers = []; ts.addRange(transformers, customTransformers && ts.map(customTransformers.before, wrapScriptTransformerFactory)); transformers.push(ts.transformTypeScript); transformers.push(ts.transformClassFields); - if (ts.getJSXTransformEnabled(compilerOptions)) { + if (jsx === 2 /* React */) { transformers.push(ts.transformJsx); } if (languageVersion < 99 /* ESNext */) { @@ -99026,7 +96708,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, factory, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(341 /* Count */); + var enabledSyntaxKindFeatures = new Array(336 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentStatements; @@ -99099,13 +96781,7 @@ var ts; // prevent modification of transformation hooks. state = 1 /* Initialized */; // Transform each node. - var transformed = []; - for (var _a = 0, nodes_3 = nodes; _a < nodes_3.length; _a++) { - var node = nodes_3[_a]; - ts.tracing.push("emit" /* Emit */, "transformNodes", node.kind === 297 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); - transformed.push((allowDtsFiles ? transformation : transformRoot)(node)); - ts.tracing.pop(); - } + var transformed = ts.map(nodes, allowDtsFiles ? transformation : transformRoot); // prevent modification of the lexical environment. state = 2 /* Completed */; ts.performance.mark("afterTransform"); @@ -99341,8 +97017,8 @@ var ts; function dispose() { if (state < 3 /* Disposed */) { // Clean up emit nodes on parse tree - for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { - var node = nodes_4[_i]; + for (var _i = 0, nodes_3 = nodes; _i < nodes_3.length; _i++) { + var node = nodes_3[_i]; ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); } // Release references to external entries for GC purposes. @@ -99474,7 +97150,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 298 /* Bundle */) { + if (sourceFile.kind === 295 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -99670,15 +97346,9 @@ var ts; sourceFiles: sourceFileOrBundle.sourceFiles.map(function (file) { return relativeToBuildInfo(ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory())); }) }; } - ts.tracing.push("emit" /* Emit */, "emitJsFileOrBundle", { jsFilePath: jsFilePath }); emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo); - ts.tracing.pop(); - ts.tracing.push("emit" /* Emit */, "emitDeclarationFileOrBundle", { declarationFilePath: declarationFilePath }); emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo); - ts.tracing.pop(); - ts.tracing.push("emit" /* Emit */, "emitBuildInfo", { buildInfoPath: buildInfoPath }); emitBuildInfo(bundleBuildInfo, buildInfoPath); - ts.tracing.pop(); if (!emitSkipped && emittedFilesList) { if (!emitOnlyDtsFiles) { if (jsFilePath) { @@ -99810,7 +97480,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 297 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 294 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -99833,8 +97503,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 298 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 297 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 295 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 294 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -99875,7 +97545,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 297 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 294 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -99919,16 +97589,16 @@ var ts; if (ts.getRootLength(sourceMapDir) === 0) { // The relative paths are relative to the common directory sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - return encodeURI(ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath + return ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath ts.combinePaths(sourceMapDir, sourceMapFile), // this is where user expects to see sourceMap host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ true)); + /*isAbsolutePathAnUrl*/ true); } else { - return encodeURI(ts.combinePaths(sourceMapDir, sourceMapFile)); + return ts.combinePaths(sourceMapDir, sourceMapFile); } } - return encodeURI(sourceMapFile); + return sourceMapFile; } } ts.emitFiles = emitFiles; @@ -100143,8 +97813,6 @@ var ts; var sourceMapGenerator; var sourceMapSource; var sourceMapSourceIndex = -1; - var mostRecentlyAddedSourceMapSource; - var mostRecentlyAddedSourceMapSourceIndex = -1; // Comments var containerPos = -1; var containerEnd = -1; @@ -100183,9 +97851,9 @@ var ts; break; } switch (node.kind) { - case 297 /* SourceFile */: return printFile(node); - case 298 /* Bundle */: return printBundle(node); - case 299 /* UnparsedSource */: return printUnparsedSource(node); + case 294 /* SourceFile */: return printFile(node); + case 295 /* Bundle */: return printBundle(node); + case 296 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -100441,12 +98109,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 297 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 294 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 297 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 294 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -100488,15 +98156,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 299 /* UnparsedSource */: - case 293 /* UnparsedPrepend */: + case 296 /* UnparsedSource */: + case 290 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 292 /* UnparsedPrologue */: + case 289 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 294 /* UnparsedText */: - case 295 /* UnparsedInternalText */: + case 291 /* UnparsedText */: + case 292 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 296 /* UnparsedSyntheticReference */: + case 293 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 78 /* Identifier */: @@ -100506,270 +98174,262 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return emitQualifiedName(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return emitTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return emitParameter(node); - case 161 /* Decorator */: + case 160 /* Decorator */: return emitDecorator(node); // Type members - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return emitPropertySignature(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 164 /* MethodSignature */: + case 163 /* MethodSignature */: return emitMethodSignature(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return emitConstructor(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return emitAccessorDeclaration(node); - case 169 /* CallSignature */: + case 168 /* CallSignature */: return emitCallSignature(node); - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return emitConstructSignature(node); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return emitIndexSignature(node); - case 194 /* TemplateLiteralTypeSpan */: - return emitTemplateTypeSpan(node); // Types - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return emitTypePredicate(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return emitTypeReference(node); - case 174 /* FunctionType */: + case 173 /* FunctionType */: return emitFunctionType(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 175 /* ConstructorType */: + case 174 /* ConstructorType */: return emitConstructorType(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return emitTypeQuery(node); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return emitTypeLiteral(node); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return emitArrayType(node); - case 179 /* TupleType */: + case 178 /* TupleType */: return emitTupleType(node); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return emitOptionalType(node); - case 182 /* UnionType */: + case 181 /* UnionType */: return emitUnionType(node); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return emitIntersectionType(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return emitConditionalType(node); - case 185 /* InferType */: + case 184 /* InferType */: return emitInferType(node); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return emitParenthesizedType(node); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 187 /* ThisType */: + case 186 /* ThisType */: return emitThisType(); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return emitTypeOperator(node); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return emitMappedType(node); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return emitLiteralType(node); - case 193 /* TemplateLiteralType */: - return emitTemplateType(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return emitImportTypeNode(node); - case 303 /* JSDocAllType */: + case 299 /* JSDocAllType */: writePunctuation("*"); return; - case 304 /* JSDocUnknownType */: + case 300 /* JSDocUnknownType */: writePunctuation("?"); return; - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 306 /* JSDocNonNullableType */: + case 302 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 181 /* RestType */: - case 309 /* JSDocVariadicType */: + case 180 /* RestType */: + case 305 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return emitNamedTupleMember(node); // Binding patterns - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return emitBindingElement(node); // Misc - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return emitTemplateSpan(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 230 /* Block */: + case 227 /* Block */: return emitBlock(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return emitVariableStatement(node); - case 231 /* EmptyStatement */: + case 228 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return emitExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return emitIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return emitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return emitWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return emitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return emitForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return emitForOfStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return emitContinueStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return emitBreakStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return emitReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return emitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return emitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return emitLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return emitThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return emitTryStatement(node); - case 248 /* DebuggerStatement */: + case 245 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return emitClassDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return emitModuleBlock(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return emitCaseBlock(node); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return emitImportDeclaration(node); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return emitImportClause(node); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return emitNamespaceImport(node); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return emitNamespaceExport(node); - case 264 /* NamedImports */: + case 261 /* NamedImports */: return emitNamedImports(node); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return emitImportSpecifier(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return emitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return emitExportDeclaration(node); - case 268 /* NamedExports */: + case 265 /* NamedExports */: return emitNamedExports(node); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return emitExportSpecifier(node); - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return; // Module references - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 275 /* JsxOpeningElement */: - case 278 /* JsxOpeningFragment */: + case 272 /* JsxOpeningElement */: + case 275 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 276 /* JsxClosingElement */: - case 279 /* JsxClosingFragment */: + case 273 /* JsxClosingElement */: + case 276 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return emitJsxAttribute(node); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return emitJsxAttributes(node); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 284 /* CaseClause */: + case 281 /* CaseClause */: return emitCaseClause(node); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return emitDefaultClause(node); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return emitHeritageClause(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 291 /* EnumMember */: + case 288 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 328 /* JSDocThisTag */: - case 325 /* JSDocEnumTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 324 /* JSDocThisTag */: + case 321 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 316 /* JSDocImplementsTag */: - case 315 /* JSDocAugmentsTag */: + case 312 /* JSDocImplementsTag */: + case 311 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 324 /* JSDocCallbackTag */: + case 320 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 313 /* JSDocSignature */: + case 309 /* JSDocSignature */: return emitJSDocSignature(node); - case 312 /* JSDocTypeLiteral */: + case 308 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 319 /* JSDocClassTag */: - case 314 /* JSDocTag */: + case 315 /* JSDocClassTag */: + case 310 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 332 /* JSDocSeeTag */: - return emitJSDocSeeTag(node); - case 302 /* JSDocNameReference */: - return emitJSDocNameReference(node); - case 311 /* JSDocComment */: + case 307 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -100806,71 +98466,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return emitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return emitNewExpression(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return emitFunctionExpression(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return emitArrowFunction(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return emitDeleteExpression(node); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return emitVoidExpression(node); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return emitAwaitExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return emitBinaryExpression(node); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return emitConditionalExpression(node); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return emitTemplateExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return emitYieldExpression(node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return emitSpreadExpression(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return emitClassExpression(node); - case 222 /* OmittedExpression */: + case 219 /* OmittedExpression */: return; - case 224 /* AsExpression */: + case 221 /* AsExpression */: return emitAsExpression(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return emitNonNullExpression(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 273 /* JsxElement */: + case 270 /* JsxElement */: return emitJsxElement(node); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return emitCommaList(node); } } @@ -100912,7 +98572,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 298 /* Bundle */ ? node : undefined; + var bundle = node.kind === 295 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -101012,7 +98672,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 294 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 291 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -101085,7 +98745,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 308 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 304 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -101147,7 +98807,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 167 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 166 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -101181,10 +98841,6 @@ var ts; emitTypeAnnotation(node.type); writeTrailingSemicolon(); } - function emitTemplateTypeSpan(node) { - emit(node.type); - emit(node.literal); - } function emitSemicolonClassElement() { writeTrailingSemicolon(); } @@ -101343,19 +98999,13 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 142 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 141 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); } writePunctuation("["); pipelineEmit(3 /* MappedTypeParameter */, node.typeParameter); - if (node.nameType) { - writeSpace(); - writeKeyword("as"); - writeSpace(); - emit(node.nameType); - } writePunctuation("]"); if (node.questionToken) { emit(node.questionToken); @@ -101379,10 +99029,6 @@ var ts; function emitLiteralType(node) { emitExpression(node.literal); } - function emitTemplateType(node) { - emit(node.head); - emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); - } function emitImportTypeNode(node) { if (node.isTypeOf) { writeKeyword("typeof"); @@ -101581,7 +99227,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 214 /* PrefixUnaryExpression */ + return operand.kind === 211 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -101769,7 +99415,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node, node.thenStatement, node.elseStatement); emitTokenWithComment(90 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 234 /* IfStatement */) { + if (node.elseStatement.kind === 231 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -101832,7 +99478,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(156 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(155 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -101840,7 +99486,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 250 /* VariableDeclarationList */) { + if (node.kind === 247 /* VariableDeclarationList */) { emit(node); } else { @@ -102136,7 +99782,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 256 /* ModuleDeclaration */) { + while (body.kind === 253 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -102181,7 +99827,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(153 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(152 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -102189,7 +99835,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(149 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(148 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -102229,7 +99875,7 @@ var ts; var nextPos = emitTokenWithComment(92 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(149 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(148 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -102241,7 +99887,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(153 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(152 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -102252,7 +99898,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(126 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(140 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(139 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -102475,7 +100121,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 329 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 325 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -102491,17 +100137,6 @@ var ts; emitJSDocTypeExpression(tag.typeExpression); emitJSDocComment(tag.comment); } - function emitJSDocSeeTag(tag) { - emitJSDocTagName(tag.tagName); - emit(tag.name); - emitJSDocComment(tag.comment); - } - function emitJSDocNameReference(node) { - writeSpace(); - writePunctuation("{"); - emit(node.name); - writePunctuation("}"); - } function emitJSDocHeritageTag(tag) { emitJSDocTagName(tag.tagName); writeSpace(); @@ -102520,7 +100155,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 301 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 298 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -102539,7 +100174,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 312 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 308 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -102673,8 +100308,8 @@ var ts; bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName }); writeLine(); } - for (var _d = 0, types_23 = types; _d < types_23.length; _d++) { - var directive = types_23[_d]; + for (var _d = 0, types_22 = types; _d < types_22.length; _d++) { + var directive = types_22[_d]; var pos = writer.getTextPos(); writeComment("/// "); if (bundleFileInfo) @@ -103403,7 +101038,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 207 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 204 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -103436,10 +101071,7 @@ var ts; return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape); } } - var flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) - | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) - | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0); - return ts.getLiteralText(node, currentSourceFile, flags); + return ts.getLiteralText(node, currentSourceFile, neverAsciiEscape, jsxAttributeEscape); } /** * Push a new name generation scope. @@ -103472,84 +101104,84 @@ var ts; if (!node) return; switch (node.kind) { - case 230 /* Block */: + case 227 /* Block */: ts.forEach(node.statements, generateNames); break; - case 245 /* LabeledStatement */: - case 243 /* WithStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 242 /* LabeledStatement */: + case 240 /* WithStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: generateNames(node.statement); break; - case 234 /* IfStatement */: + case 231 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 287 /* CatchClause */: + case 284 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: generateNames(node.declarationList); break; - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: generateNames(node.importClause); break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -103558,12 +101190,12 @@ var ts; if (!node) return; switch (node.kind) { - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -103745,23 +101377,23 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 266 /* ExportAssignment */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 263 /* ExportAssignment */: return generateNameForExportDefault(); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return generateNameForClassExpression(); - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -103809,7 +101441,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 335 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 330 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -103833,7 +101465,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 250 /* VariableDeclarationList */) { + if (node.kind === 247 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -103926,12 +101558,7 @@ var ts; function emitLeadingComments(pos, isEmittedNode) { hasWrittenComment = false; if (isEmittedNode) { - if (pos === 0 && (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.isDeclarationFile)) { - forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment); - } - else { - forEachLeadingCommentToEmit(pos, emitLeadingComment); - } + forEachLeadingCommentToEmit(pos, emitLeadingComment); } else if (pos === 0) { // If the node will not be emitted in JS, remove all the comments(normal, pinned and ///) associated with the node, @@ -103950,11 +101577,6 @@ var ts; emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); } } - function emitNonTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { - if (!isTripleSlashComment(commentPos, commentEnd)) { - emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); - } - } function shouldWriteComment(text, pos) { if (printerOptions.onlyPrintJsDocStyle) { return (ts.isJSDocLikeText(text, pos) || ts.isPinnedComment(text, pos)); @@ -104102,7 +101724,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 335 /* NotEmittedStatement */ + if (node.kind !== 330 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -104115,7 +101737,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 335 /* NotEmittedStatement */ + if (node.kind !== 330 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -104148,10 +101770,9 @@ var ts; function emitSourcePos(source, pos) { if (source !== sourceMapSource) { var savedSourceMapSource = sourceMapSource; - var savedSourceMapSourceIndex = sourceMapSourceIndex; setSourceMapSource(source); emitPos(pos); - resetSourceMapSource(savedSourceMapSource, savedSourceMapSourceIndex); + setSourceMapSource(savedSourceMapSource); } else { emitPos(pos); @@ -104190,12 +101811,6 @@ var ts; return; } sourceMapSource = source; - if (source === mostRecentlyAddedSourceMapSource) { - // Fast path for when the new source map is the most recently added, in which case - // we use its captured index without going through the source map generator. - sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex; - return; - } if (isJsonSourceMapSource(source)) { return; } @@ -104203,12 +101818,6 @@ var ts; if (printerOptions.inlineSources) { sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text); } - mostRecentlyAddedSourceMapSource = source; - mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex; - } - function resetSourceMapSource(source, sourceIndex) { - sourceMapSource = source; - sourceMapSourceIndex = sourceIndex; } function isJsonSourceMapSource(sourceFile) { return ts.fileExtensionIs(sourceFile.fileName, ".json" /* Json */); @@ -104707,7 +102316,6 @@ var ts; if (system === void 0) { system = ts.sys; } var existingDirectories = new ts.Map(); var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames); - var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash; function getSourceFile(fileName, languageVersion, onError) { var text; try { @@ -104752,14 +102360,14 @@ var ts; } var outputFingerprints; function writeFileWorker(fileName, data, writeByteOrderMark) { - if (!ts.isWatchSet(options) || !system.getModifiedTime) { + if (!ts.isWatchSet(options) || !system.createHash || !system.getModifiedTime) { system.writeFile(fileName, data, writeByteOrderMark); return; } if (!outputFingerprints) { outputFingerprints = new ts.Map(); } - var hash = computeHash(data); + var hash = system.createHash(data); var mtimeBefore = system.getModifiedTime(fileName); if (mtimeBefore) { var fingerprint = outputFingerprints.get(fileName); @@ -105112,35 +102720,6 @@ var ts; } ts.loadWithLocalCache = loadWithLocalCache; /* @internal */ - function forEachResolvedProjectReference(resolvedProjectReferences, cb) { - return forEachProjectReference(/*projectReferences*/ undefined, resolvedProjectReferences, function (resolvedRef, parent) { return resolvedRef && cb(resolvedRef, parent); }); - } - ts.forEachResolvedProjectReference = forEachResolvedProjectReference; - function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { - var seenResolvedRefs; - return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined); - function worker(projectReferences, resolvedProjectReferences, parent) { - // Visit project references first - if (cbRef) { - var result = cbRef(projectReferences, parent); - if (result) { - return result; - } - } - return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) { - if (resolvedRef && (seenResolvedRefs === null || seenResolvedRefs === void 0 ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) { - // ignore recursives - return undefined; - } - var result = cbResolvedRef(resolvedRef, parent, index); - if (result || !resolvedRef) - return result; - (seenResolvedRefs || (seenResolvedRefs = new ts.Set())).add(resolvedRef.sourceFile.path); - return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef); - }); - } - } - /* @internal */ ts.inferredTypesContainingFile = "__inferred type names__.ts"; /** * Determines if program structure is upto date or needs to be recreated @@ -105276,8 +102855,6 @@ var ts; var modulesWithElidedImports = new ts.Map(); // Track source files that are source files found by searching under node_modules, as these shouldn't be compiled. var sourceFilesFoundSearchingNodeModules = new ts.Map(); - var tracingData = ["program" /* Program */, "createProgram"]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeProgram"); var host = createProgramOptions.host || createCompilerHost(options); var configParsingHost = parseConfigHostFromCompilerHostLike(host); @@ -105353,16 +102930,12 @@ var ts; getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, forEachResolvedProjectReference: forEachResolvedProjectReference }), onProgramCreateComplete = _c.onProgramCreateComplete, fileExists = _c.fileExists, directoryExists = _c.directoryExists; - ts.tracing.push("program" /* Program */, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram }); var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); - ts.tracing.pop(); // We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks // `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`. - var structureIsReused; - ts.tracing.push("program" /* Program */, "tryReuseStructureFromOldProgram", {}); - structureIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const - ts.tracing.pop(); - if (structureIsReused !== 2 /* Completely */) { + var structuralIsReused; + structuralIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const + if (structuralIsReused !== 2 /* Completely */) { processingDefaultLibFiles = []; processingOtherFiles = []; if (projectReferences) { @@ -105399,13 +102972,10 @@ var ts; } } } - ts.tracing.push("program" /* Program */, "processRootFiles", { count: rootNames.length }); ts.forEach(rootNames, function (name) { return processRootFile(name, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false); }); - ts.tracing.pop(); // load type declarations specified via 'types' argument or implicitly from types/ and node_modules/@types folders var typeReferences = rootNames.length ? ts.getAutomaticTypeDirectiveNames(options, host) : ts.emptyArray; if (typeReferences.length) { - ts.tracing.push("program" /* Program */, "processTypeReferences", { count: typeReferences.length }); // This containingFilename needs to match with the one used in managed-side var containingDirectory = options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : host.getCurrentDirectory(); var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile); @@ -105413,7 +102983,6 @@ var ts; for (var i = 0; i < typeReferences.length; i++) { processTypeReferenceDirective(typeReferences[i], resolutions[i]); } - ts.tracing.pop(); } // Do not process the default library if: // - The '--noLib' flag is used. @@ -105454,8 +103023,8 @@ var ts; host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path)); } } - oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference) { - if (!getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) { + oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference, resolvedProjectReferencePath) { + if (resolvedProjectReference && !getResolvedProjectReferenceByPath(resolvedProjectReferencePath)) { host.onReleaseOldSourceFile(resolvedProjectReference.sourceFile, oldProgram.getCompilerOptions(), /*hasSourceFileByPath*/ false); } }); @@ -105475,7 +103044,6 @@ var ts; getOptionsDiagnostics: getOptionsDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getSemanticDiagnostics: getSemanticDiagnostics, - getCachedSemanticDiagnostics: getCachedSemanticDiagnostics, getSuggestionDiagnostics: getSuggestionDiagnostics, getDeclarationDiagnostics: getDeclarationDiagnostics, getBindAndCheckDiagnostics: getBindAndCheckDiagnostics, @@ -105489,7 +103057,6 @@ var ts; getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, - getTypeCatalog: function () { return getDiagnosticsProducingTypeChecker().getTypeCatalog(); }, getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); }, getInstantiationCount: function () { return getDiagnosticsProducingTypeChecker().getInstantiationCount(); }, getRelationCacheSizes: function () { return getDiagnosticsProducingTypeChecker().getRelationCacheSizes(); }, @@ -105518,73 +103085,26 @@ var ts; getSymlinkCache: getSymlinkCache, realpath: (_b = host.realpath) === null || _b === void 0 ? void 0 : _b.bind(host), useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, - structureIsReused: structureIsReused, }; onProgramCreateComplete(); verifyCompilerOptions(); ts.performance.mark("afterProgram"); ts.performance.measure("Program", "beforeProgram", "afterProgram"); - ts.tracing.end.apply(ts.tracing, tracingData); return program; - function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames) { - if (!moduleNames.length) - return ts.emptyArray; - var containingFileName = ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); - var redirectedReference = getRedirectReferenceForResolution(containingFile); - ts.tracing.push("program" /* Program */, "resolveModuleNamesWorker", { containingFileName: containingFileName }); + function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames, redirectedReference) { ts.performance.mark("beforeResolveModule"); - var result = actualResolveModuleNamesWorker(moduleNames, containingFileName, reusedNames, redirectedReference); + var result = actualResolveModuleNamesWorker(moduleNames, containingFile, reusedNames, redirectedReference); ts.performance.mark("afterResolveModule"); ts.performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule"); - ts.tracing.pop(); return result; } - function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile) { - if (!typeDirectiveNames.length) - return []; - var containingFileName = !ts.isString(containingFile) ? ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile; - var redirectedReference = !ts.isString(containingFile) ? getRedirectReferenceForResolution(containingFile) : undefined; - ts.tracing.push("program" /* Program */, "resolveTypeReferenceDirectiveNamesWorker", { containingFileName: containingFileName }); + function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, redirectedReference) { ts.performance.mark("beforeResolveTypeReference"); - var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference); + var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, redirectedReference); ts.performance.mark("afterResolveTypeReference"); ts.performance.measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference"); - ts.tracing.pop(); return result; } - function getRedirectReferenceForResolution(file) { - var redirect = getResolvedProjectReferenceToRedirect(file.originalFileName); - if (redirect || !ts.fileExtensionIs(file.originalFileName, ".d.ts" /* Dts */)) - return redirect; - // The originalFileName could not be actual source file name if file found was d.ts from referecned project - // So in this case try to look up if this is output from referenced project, if it is use the redirected project in that case - var resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.originalFileName, file.path); - if (resultFromDts) - return resultFromDts; - // If preserveSymlinks is true, module resolution wont jump the symlink - // but the resolved real path may be the .d.ts from project reference - // Note:: Currently we try the real path only if the - // file is from node_modules to avoid having to run real path on all file paths - if (!host.realpath || !options.preserveSymlinks || !ts.stringContains(file.originalFileName, ts.nodeModulesPathPart)) - return undefined; - var realDeclarationFileName = host.realpath(file.originalFileName); - var realDeclarationPath = toPath(realDeclarationFileName); - return realDeclarationPath === file.path ? undefined : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationFileName, realDeclarationPath); - } - function getRedirectReferenceForResolutionFromSourceOfProject(fileName, filePath) { - var source = getSourceOfProjectReferenceRedirect(fileName); - if (ts.isString(source)) - return getResolvedProjectReferenceToRedirect(source); - if (!source) - return undefined; - // Output of .d.ts file so return resolved ref that matches the out file name - return forEachResolvedProjectReference(function (resolvedRef) { - var out = ts.outFile(resolvedRef.commandLine.options); - if (!out) - return undefined; - return toPath(out) === filePath ? resolvedRef : undefined; - }); - } function compareDefaultLibFiles(a, b) { return ts.compareValues(getDefaultLibFilePriority(a), getDefaultLibFilePriority(b)); } @@ -105643,13 +103163,13 @@ var ts; } return classifiableNames; } - function resolveModuleNamesReusingOldState(moduleNames, file) { - if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) { + function resolveModuleNamesReusingOldState(moduleNames, containingFile, file) { + if (structuralIsReused === 0 /* Not */ && !file.ambientModuleNames.length) { // If the old program state does not permit reusing resolutions and `file` does not contain locally defined ambient modules, // the best we can do is fallback to the default logic. - return resolveModuleNamesWorker(moduleNames, file, /*reusedNames*/ undefined); + return resolveModuleNamesWorker(moduleNames, containingFile, /*reusedNames*/ undefined, getResolvedProjectReferenceToRedirect(file.originalFileName)); } - var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName); + var oldSourceFile = oldProgram && oldProgram.getSourceFile(containingFile); if (oldSourceFile !== file && file.resolvedModules) { // `file` was created for the new program. // @@ -105659,13 +103179,13 @@ var ts; // which per above occurred during the current program creation. // Since we assume the filesystem does not change during program creation, // it is safe to reuse resolutions from the earlier call. - var result_14 = []; + var result_12 = []; for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { var moduleName = moduleNames_1[_i]; var resolvedModule = file.resolvedModules.get(moduleName); - result_14.push(resolvedModule); + result_12.push(resolvedModule); } - return result_14; + return result_12; } // At this point, we know at least one of the following hold: // - file has local declarations for ambient modules @@ -105693,7 +103213,7 @@ var ts; var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName); if (oldResolvedModule) { if (ts.isTraceEnabled(options, host)) { - ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, containingFile); } (result || (result = new Array(moduleNames.length)))[i] = oldResolvedModule; (reusedNames || (reusedNames = [])).push(moduleName); @@ -105708,7 +103228,7 @@ var ts; if (ts.contains(file.ambientModuleNames, moduleName)) { resolvesToAmbientModuleInNonModifiedFile = true; if (ts.isTraceEnabled(options, host)) { - ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, containingFile); } } else { @@ -105723,7 +103243,7 @@ var ts; } } var resolutions = unknownModuleNames && unknownModuleNames.length - ? resolveModuleNamesWorker(unknownModuleNames, file, reusedNames) + ? resolveModuleNamesWorker(unknownModuleNames, containingFile, reusedNames, getResolvedProjectReferenceToRedirect(file.originalFileName)) : ts.emptyArray; // Combine results of resolutions and predicted results if (!result) { @@ -105771,7 +103291,7 @@ var ts; } } function canReuseProjectReferences() { - return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, parent, index) { + return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, index, parent) { var newRef = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; var newResolvedRef = parseProjectReferenceConfigFile(newRef); if (oldResolvedRef) { @@ -105797,19 +103317,19 @@ var ts; // if any of these properties has changed - structure cannot be reused var oldOptions = oldProgram.getCompilerOptions(); if (ts.changesAffectModuleResolution(oldOptions, options)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } // there is an old program, check if we can reuse its structure var oldRootNames = oldProgram.getRootFileNames(); if (!ts.arrayIsEqualTo(oldRootNames, rootNames)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (!ts.arrayIsEqualTo(options.types, oldOptions.types)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } // Check if any referenced project tsconfig files are different if (!canReuseProjectReferences()) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (projectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); @@ -105817,12 +103337,12 @@ var ts; // check if program source files has changed in the way that can affect structure of the program var newSourceFiles = []; var modifiedSourceFiles = []; - structureIsReused = 2 /* Completely */; + oldProgram.structureIsReused = 2 /* Completely */; // If the missing file paths are now present, it can change the progam structure, // and hence cant reuse the structure. // This is same as how we dont reuse the structure if one of the file from old program is now missing if (oldProgram.getMissingFilePaths().some(function (missingFilePath) { return host.fileExists(missingFilePath); })) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } var oldSourceFiles = oldProgram.getSourceFiles(); var SeenPackageName; @@ -105837,7 +103357,7 @@ var ts; ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, options.target, /*onError*/ undefined, shouldCreateNewSourceFile) : host.getSourceFile(oldSourceFile.fileName, options.target, /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217 if (!newSourceFile) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } ts.Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); var fileChanged = void 0; @@ -105846,7 +103366,7 @@ var ts; // This lets us know if the unredirected file has changed. If it has we should break the redirect. if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { // Underlying file has changed. Might not redirect anymore. Must rebuild program. - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } fileChanged = false; newSourceFile = oldSourceFile; // Use the redirect. @@ -105854,7 +103374,7 @@ var ts; else if (oldProgram.redirectTargetsMap.has(oldSourceFile.path)) { // If a redirected-to source file changes, the redirect may be broken. if (newSourceFile !== oldSourceFile) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } fileChanged = false; } @@ -105873,7 +103393,7 @@ var ts; var prevKind = seenPackageNames.get(packageName); var newKind = fileChanged ? 1 /* Modified */ : 0 /* Exists */; if ((prevKind !== undefined && newKind === 1 /* Modified */) || prevKind === 1 /* Modified */) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } seenPackageNames.set(packageName, newKind); } @@ -105881,50 +103401,50 @@ var ts; // The `newSourceFile` object was created for the new program. if (!ts.arrayIsEqualTo(oldSourceFile.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) { // 'lib' references has changed. Matches behavior in changesAffectModuleResolution - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { // value of no-default-lib has changed // this will affect if default library is injected into the list of files - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // check tripleslash references if (!ts.arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) { // tripleslash references has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // check imports and module augmentations collectExternalModuleReferences(newSourceFile); if (!ts.arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) { // imports has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { // moduleAugmentations has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if ((oldSourceFile.flags & 3145728 /* PermanentlySetIncrementalFlags */) !== (newSourceFile.flags & 3145728 /* PermanentlySetIncrementalFlags */)) { // dynamicImport has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { // 'types' references has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // tentatively approve the file modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); } else if (hasInvalidatedResolution(oldSourceFile.path)) { // 'module/types' references could have changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; // add file to the modified list so that we will resolve it later modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); } // if file has passed all checks it should be safe to reuse it newSourceFiles.push(newSourceFile); } - if (structureIsReused !== 2 /* Completely */) { - return structureIsReused; + if (oldProgram.structureIsReused !== 2 /* Completely */) { + return oldProgram.structureIsReused; } var modifiedFiles = modifiedSourceFiles.map(function (f) { return f.oldFile; }); for (var _b = 0, oldSourceFiles_3 = oldSourceFiles; _b < oldSourceFiles_3.length; _b++) { @@ -105939,35 +103459,38 @@ var ts; // try to verify results of module resolution for (var _e = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _e < modifiedSourceFiles_1.length; _e++) { var _f = modifiedSourceFiles_1[_e], oldSourceFile = _f.oldFile, newSourceFile = _f.newFile; + var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.originalFileName, currentDirectory); var moduleNames = getModuleNames(newSourceFile); - var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile); + var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile); // ensure that module resolution results are still correct var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo); if (resolutionsChanged) { - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; newSourceFile.resolvedModules = ts.zipToMap(moduleNames, resolutions); } else { newSourceFile.resolvedModules = oldSourceFile.resolvedModules; } - // We lower-case all type references because npm automatically lowercases all packages. See GH#9824. - var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); }); - var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile); - // ensure that types resolutions are still correct - var typeReferenceEesolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo); - if (typeReferenceEesolutionsChanged) { - structureIsReused = 1 /* SafeModules */; - newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, typeReferenceResolutions); - } - else { - newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; + if (resolveTypeReferenceDirectiveNamesWorker) { + // We lower-case all type references because npm automatically lowercases all packages. See GH#9824. + var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); }); + var resolutions_1 = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFilePath, getResolvedProjectReferenceToRedirect(newSourceFile.originalFileName)); + // ensure that types resolutions are still correct + var resolutionsChanged_1 = ts.hasChangesInResolutions(typesReferenceDirectives, resolutions_1, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo); + if (resolutionsChanged_1) { + oldProgram.structureIsReused = 1 /* SafeModules */; + newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, resolutions_1); + } + else { + newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; + } } } - if (structureIsReused !== 2 /* Completely */) { - return structureIsReused; + if (oldProgram.structureIsReused !== 2 /* Completely */) { + return oldProgram.structureIsReused; } if ((_a = host.hasChangedAutomaticTypeDirectiveNames) === null || _a === void 0 ? void 0 : _a.call(host)) { - return 1 /* SafeModules */; + return oldProgram.structureIsReused = 1 /* SafeModules */; } missingFilePaths = oldProgram.getMissingFilePaths(); refFileMap = oldProgram.getRefFileMap(); @@ -106001,7 +103524,7 @@ var ts; resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); sourceFileToPackageName = oldProgram.sourceFileToPackageName; redirectTargetsMap = oldProgram.redirectTargetsMap; - return 2 /* Completely */; + return oldProgram.structureIsReused = 2 /* Completely */; } function getEmitHost(writeFileCallback) { return { @@ -106041,8 +103564,6 @@ var ts; } function emitBuildInfo(writeFileCallback) { ts.Debug.assert(!ts.outFile(options)); - var tracingData = ["emit" /* Emit */, "emitBuildInfo"]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeEmit"); var emitResult = ts.emitFiles(ts.notImplementedResolver, getEmitHost(writeFileCallback), /*targetSourceFile*/ undefined, @@ -106051,7 +103572,6 @@ var ts; /*onlyBuildInfo*/ true); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); - ts.tracing.end.apply(ts.tracing, tracingData); return emitResult; } function getResolvedProjectReferences() { @@ -106097,11 +103617,7 @@ var ts; return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, /*produceDiagnostics:*/ false)); } function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit) { - var tracingData = ["emit" /* Emit */, "emit", { path: sourceFile === null || sourceFile === void 0 ? void 0 : sourceFile.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); - var result = runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); }); - ts.tracing.end.apply(ts.tracing, tracingData); - return result; + return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); }); } function isEmitBlocked(emitFileName) { return hasEmitBlockingDiagnostics.has(toPath(emitFileName)); @@ -106151,11 +103667,6 @@ var ts; function getSemanticDiagnostics(sourceFile, cancellationToken) { return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken); } - function getCachedSemanticDiagnostics(sourceFile) { - var _a; - return sourceFile - ? (_a = cachedBindAndCheckDiagnosticsForFile.perFile) === null || _a === void 0 ? void 0 : _a.get(sourceFile.path) : cachedBindAndCheckDiagnosticsForFile.allDiagnostics; - } function getBindAndCheckDiagnostics(sourceFile, cancellationToken) { return getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken); } @@ -106241,17 +103752,17 @@ var ts; sourceFile.scriptKind === 5 /* External */ || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; - return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); + return getMergedBindAndCheckDiagnostics(sourceFile, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); }); } - function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics) { + function getMergedBindAndCheckDiagnostics(sourceFile) { var _a; var allDiagnostics = []; - for (var _i = 2; _i < arguments.length; _i++) { - allDiagnostics[_i - 2] = arguments[_i]; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; } var flatDiagnostics = ts.flatten(allDiagnostics); - if (!includeBindAndCheckDiagnostics || !((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { return flatDiagnostics; } var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives; @@ -106312,22 +103823,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 249 /* VariableDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 246 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -106335,58 +103846,58 @@ var ts; } } switch (node.kind) { - case 262 /* ImportClause */: + case 259 /* ImportClause */: if (node.isTypeOnly) { - diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); + diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 116 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(117 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 256 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(140 /* NamespaceKeyword */) : ts.tokenToString(139 /* ModuleKeyword */); + case 253 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(139 /* NamespaceKeyword */) : ts.tokenToString(138 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(91 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 224 /* AsExpression */: + case 221 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -106395,29 +103906,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 232 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 229 /* VariableStatement */); return "skip"; } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -106429,19 +103940,19 @@ var ts; return "skip"; } break; - case 160 /* Parameter */: + case 159 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 223 /* ExpressionWithTypeArguments */: - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: - case 205 /* TaggedTemplateExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 220 /* ExpressionWithTypeArguments */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 202 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -106463,7 +103974,7 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 133 /* DeclareKeyword */: case 125 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); @@ -106524,7 +104035,9 @@ var ts; } var diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName); forEachResolvedProjectReference(function (resolvedRef) { - diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + if (resolvedRef) { + diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + } }); return diagnostics; } @@ -106545,18 +104058,6 @@ var ts; ? b.kind === 78 /* Identifier */ && a.escapedText === b.escapedText : b.kind === 10 /* StringLiteral */ && a.text === b.text; } - function createSyntheticImport(text, file) { - var externalHelpersModuleReference = ts.factory.createStringLiteral(text); - var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference); - ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */); - ts.setParent(externalHelpersModuleReference, importDecl); - ts.setParent(importDecl, file); - // explicitly unset the synthesized flag on these declarations so the checker API will answer questions about them - // (which is required to build the dependency graph for incremental emit) - externalHelpersModuleReference.flags &= ~8 /* Synthesized */; - importDecl.flags &= ~8 /* Synthesized */; - return externalHelpersModuleReference; - } function collectExternalModuleReferences(file) { if (file.imports) { return; @@ -106569,17 +104070,16 @@ var ts; var ambientModules; // If we are importing helpers, we need to add a synthetic reference to resolve the // helpers library. - if ((options.isolatedModules || isExternalModuleFile) + if (options.importHelpers + && (options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { - if (options.importHelpers) { - // synthesize 'import "tslib"' declaration - imports = [createSyntheticImport(ts.externalHelpersModuleNameText, file)]; - } - var jsxImport = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(options, file), options); - if (jsxImport) { - // synthesize `import "base/jsx-runtime"` declaration - (imports || (imports = [])).push(createSyntheticImport(jsxImport, file)); - } + // synthesize 'import "tslib"' declaration + var externalHelpersModuleReference = ts.factory.createStringLiteral(ts.externalHelpersModuleNameText); + var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference); + ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */); + ts.setParent(externalHelpersModuleReference, importDecl); + ts.setParent(importDecl, file); + imports = [externalHelpersModuleReference]; } for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; @@ -106763,16 +104263,6 @@ var ts; } // Get source file from normalized fileName function findSourceFile(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) { - ts.tracing.push("program" /* Program */, "findSourceFile", { - fileName: fileName, - isDefaultLib: isDefaultLib || undefined, - refKind: refFile ? ts.RefFileKind[refFile.kind] : undefined, - }); - var result = findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId); - ts.tracing.pop(); - return result; - } - function findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) { if (useSourceOfProjectReferenceRedirect) { var source = getSourceOfProjectReferenceRedirect(fileName); // If preserveSymlinks is true, module resolution wont jump the symlink @@ -106960,11 +104450,12 @@ var ts; function getResolvedProjectReferenceToRedirect(fileName) { if (mapFromFileToProjectReferenceRedirects === undefined) { mapFromFileToProjectReferenceRedirects = new ts.Map(); - forEachResolvedProjectReference(function (referencedProject) { + forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { // not input file from the referenced project, ignore - if (toPath(options.configFilePath) !== referencedProject.sourceFile.path) { + if (referencedProject && + toPath(options.configFilePath) !== referenceProjectPath) { referencedProject.commandLine.fileNames.forEach(function (f) { - return mapFromFileToProjectReferenceRedirects.set(toPath(f), referencedProject.sourceFile.path); + return mapFromFileToProjectReferenceRedirects.set(toPath(f), referenceProjectPath); }); } }); @@ -106973,7 +104464,11 @@ var ts; return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); } function forEachResolvedProjectReference(cb) { - return ts.forEachResolvedProjectReference(resolvedProjectReferences, cb); + return forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { + var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; + var resolvedRefPath = toPath(resolveProjectReferencePath(ref)); + return cb(resolvedRef, resolvedRefPath); + }); } function getSourceOfProjectReferenceRedirect(file) { if (!ts.isDeclarationFileName(file)) @@ -106981,19 +104476,21 @@ var ts; if (mapFromToProjectReferenceRedirectSource === undefined) { mapFromToProjectReferenceRedirectSource = new ts.Map(); forEachResolvedProjectReference(function (resolvedRef) { - var out = ts.outFile(resolvedRef.commandLine.options); - if (out) { - // Dont know which source file it means so return true? - var outputDts = ts.changeExtension(out, ".d.ts" /* Dts */); - mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), true); - } - else { - ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) { - if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { - var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames()); - mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName); - } - }); + if (resolvedRef) { + var out = ts.outFile(resolvedRef.commandLine.options); + if (out) { + // Dont know which source file it means so return true? + var outputDts = ts.changeExtension(out, ".d.ts" /* Dts */); + mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), true); + } + else { + ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) { + if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { + var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames()); + mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName); + } + }); + } } }); } @@ -107002,6 +104499,33 @@ var ts; function isSourceOfProjectReferenceRedirect(fileName) { return useSourceOfProjectReferenceRedirect && !!getResolvedProjectReferenceToRedirect(fileName); } + function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { + var seenResolvedRefs; + return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined, cbResolvedRef, cbRef); + function worker(projectReferences, resolvedProjectReferences, parent, cbResolvedRef, cbRef) { + // Visit project references first + if (cbRef) { + var result = cbRef(projectReferences, parent); + if (result) { + return result; + } + } + return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) { + if (ts.contains(seenResolvedRefs, resolvedRef)) { + // ignore recursives + return undefined; + } + var result = cbResolvedRef(resolvedRef, index, parent); + if (result) { + return result; + } + if (!resolvedRef) + return undefined; + (seenResolvedRefs || (seenResolvedRefs = [])).push(resolvedRef); + return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef, cbResolvedRef, cbRef); + }); + } + } function getResolvedProjectReferenceByPath(projectReferencePath) { if (!projectReferenceRedirects) { return undefined; @@ -107028,7 +104552,7 @@ var ts; if (!typeDirectives) { return; } - var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file); + var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file.originalFileName, getResolvedProjectReferenceToRedirect(file.originalFileName)); for (var i = 0; i < typeDirectives.length; i++) { var ref = file.typeReferenceDirectives[i]; var resolvedTypeReferenceDirective = resolutions[i]; @@ -107045,11 +104569,6 @@ var ts; } } function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, refFile) { - ts.tracing.push("program" /* Program */, "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolveModuleNamesReusingOldState, refKind: refFile === null || refFile === void 0 ? void 0 : refFile.kind, refPath: refFile === null || refFile === void 0 ? void 0 : refFile.file.path }); - processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, refFile); - ts.tracing.pop(); - } - function processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, refFile) { // If we already found this library as a primary reference - nothing to do var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective); if (previousResolution && previousResolution.primary) { @@ -107134,7 +104653,7 @@ var ts; if (file.imports.length || file.moduleAugmentations.length) { // Because global augmentation doesn't have string literal name, we can check for global augmentation as such. var moduleNames = getModuleNames(file); - var resolutions = resolveModuleNamesReusingOldState(moduleNames, file); + var resolutions = resolveModuleNamesReusingOldState(moduleNames, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory), file); ts.Debug.assert(resolutions.length === moduleNames.length); for (var i = 0; i < moduleNames.length; i++) { var resolution = resolutions[i]; @@ -107162,7 +104681,7 @@ var ts; && !options.noResolve && i < file.imports.length && !elideImport - && !(isJsFile && !ts.getAllowJSCompilerOption(options)) + && !(isJsFile && !options.allowJs) && (ts.isInJSFile(file.imports[i]) || !(file.imports[i].flags & 4194304 /* JSDoc */)); if (elideImport) { modulesWithElidedImports.set(file.path, true); @@ -107278,6 +104797,9 @@ var ts; createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap"); } } + if (options.paths && options.baseUrl === undefined) { + createDiagnosticForOptionName(ts.Diagnostics.Option_paths_cannot_be_used_without_specifying_baseUrl_option, "paths"); + } if (options.composite) { if (options.declaration === false) { createDiagnosticForOptionName(ts.Diagnostics.Composite_projects_may_not_disable_declaration_emit, "declaration"); @@ -107327,9 +104849,6 @@ var ts; if (!ts.hasZeroOrOneAsteriskCharacter(subst)) { createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character, subst, key); } - if (!options.baseUrl && !ts.pathIsRelative(subst) && !ts.pathIsAbsolute(subst)) { - createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash); - } } else { createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2, subst, key, typeOfSubst); @@ -107382,7 +104901,7 @@ var ts; var firstNonExternalModuleSourceFile = ts.find(files, function (f) { return !ts.isExternalModule(f) && !ts.isSourceFileJS(f) && !f.isDeclarationFile && f.scriptKind !== 6 /* JSON */; }); if (firstNonExternalModuleSourceFile) { var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); - programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts.getBaseFileName(firstNonExternalModuleSourceFile.fileName))); + programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.All_files_must_be_modules_when_the_isolatedModules_flag_is_provided)); } } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ES2015 */ && options.module === ts.ModuleKind.None) { @@ -107424,7 +104943,7 @@ var ts; if (options.useDefineForClassFields && languageVersion === 0 /* ES3 */) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, "useDefineForClassFields"); } - if (options.checkJs && !ts.getAllowJSCompilerOption(options)) { + if (options.checkJs && !options.allowJs) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); } if (options.emitDeclarationOnly) { @@ -107443,9 +104962,6 @@ var ts; if (options.reactNamespace) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "reactNamespace", "jsxFactory"); } - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFactory", ts.inverseJsxOptionMap.get("" + options.jsx)); - } if (!ts.parseIsolatedEntityName(options.jsxFactory, languageVersion)) { createOptionValueDiagnostic("jsxFactory", ts.Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFactory); } @@ -107457,23 +104973,10 @@ var ts; if (!options.jsxFactory) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "jsxFragmentFactory", "jsxFactory"); } - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFragmentFactory", ts.inverseJsxOptionMap.get("" + options.jsx)); - } if (!ts.parseIsolatedEntityName(options.jsxFragmentFactory, languageVersion)) { createOptionValueDiagnostic("jsxFragmentFactory", ts.Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFragmentFactory); } } - if (options.reactNamespace) { - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "reactNamespace", ts.inverseJsxOptionMap.get("" + options.jsx)); - } - } - if (options.jsxImportSource) { - if (options.jsx === 2 /* React */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxImportSource", ts.inverseJsxOptionMap.get("" + options.jsx)); - } - } // If the emit is enabled make sure that every output file is unique and not overwriting any of the input files if (!options.noEmit && !options.suppressOutputPathCheck) { var emitHost = getEmitHost(); @@ -107548,7 +105051,7 @@ var ts; } function verifyProjectReferences() { var buildInfoPath = !options.suppressOutputPathCheck ? ts.getTsBuildInfoEmitOutputFilePath(options) : undefined; - forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, parent, index) { + forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; var parentFile = parent && parent.sourceFile; if (!resolvedRef) { @@ -107743,6 +105246,8 @@ var ts; if (!setOfDeclarationDirectories) { setOfDeclarationDirectories = new ts.Set(); host.forEachResolvedProjectReference(function (ref) { + if (!ref) + return; var out = ts.outFile(ref.commandLine.options); if (out) { setOfDeclarationDirectories.add(ts.getDirectoryPath(host.toPath(out))); @@ -107975,7 +105480,7 @@ var ts; return options.jsx ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set; } function needAllowJs() { - return ts.getAllowJSCompilerOption(options) || !ts.getStrictOptionValue(options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; + return options.allowJs || !ts.getStrictOptionValue(options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; } function needResolveJsonModule() { return options.resolveJsonModule ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used; @@ -108129,7 +105634,7 @@ var ts; // Create the reference map, and set the file infos for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; - var version_2 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); + var version_1 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined; if (referencedMap) { var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName); @@ -108144,7 +105649,7 @@ var ts; } } } - fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) }); + fileInfos.set(sourceFile.resolvedPath, { version: version_1, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) }); } return { fileInfos: fileInfos, @@ -108246,7 +105751,7 @@ var ts; emitOutput_1.outputFiles.length > 0 ? emitOutput_1.outputFiles[0] : undefined; if (firstDts_1) { ts.Debug.assert(ts.fileExtensionIs(firstDts_1.name, ".d.ts" /* Dts */), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); }); - latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text); + latestSignature = computeHash(firstDts_1.text); if (exportedModulesMapCache && latestSignature !== prevSignature) { updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache); } @@ -108439,12 +105944,14 @@ var ts; if (!seenFileNamesMap.has(currentPath)) { var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); seenFileNamesMap.set(currentPath, currentSourceFile); - if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) { - queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath)); + if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) { // TODO: GH#18217 + queue.push.apply(// TODO: GH#18217 + queue, getReferencedByPaths(state, currentSourceFile.resolvedPath)); } } } // Return array of values that needs emit + // Return array of values that needs emit return ts.arrayFrom(ts.mapDefinedIterator(seenFileNamesMap.values(), function (value) { return value; })); } })(BuilderState = ts.BuilderState || (ts.BuilderState = {})); @@ -108565,7 +106072,7 @@ var ts; result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function (r) { return convertToDiagnosticRelatedInformation(r, newProgram, toPath); }) : - [] : + ts.emptyArray : undefined; return result; }); @@ -108757,10 +106264,10 @@ var ts; state.semanticDiagnosticsPerFile.delete(path); return !state.semanticDiagnosticsFromOldState.size; } - function isChangedSignature(state, path) { + function isChangedSignagure(state, path) { var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path); - var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature; - return newSignature !== oldSignature; + var oldSignagure = ts.Debug.checkDefined(state.fileInfos.get(path)).signature; + return newSignature !== oldSignagure; } /** * Iterate on referencing modules that export entities from affected file @@ -108771,7 +106278,7 @@ var ts; if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) { return; } - if (!isChangedSignature(state, affectedFile.resolvedPath)) + if (!isChangedSignagure(state, affectedFile.resolvedPath)) return; // Since isolated modules dont change js files, files affected by change in signature is itself // But we need to cleanup semantic diagnostics and queue dts emit for affected files @@ -108784,7 +106291,7 @@ var ts; if (!seenFileNamesMap.has(currentPath)) { seenFileNamesMap.set(currentPath, true); var result = fn(state, currentPath); - if (result && isChangedSignature(state, currentPath)) { + if (result && isChangedSignagure(state, currentPath)) { var currentSourceFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(currentPath); queue.push.apply(queue, ts.BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath)); } @@ -109034,7 +106541,7 @@ var ts; result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function (r) { return convertToReusableDiagnosticRelatedInformation(r, relativeToBuildInfo); }) : - [] : + ts.emptyArray : undefined; return result; }); @@ -109096,7 +106603,7 @@ var ts; /** * Computing hash to for signature verification */ - var computeHash = ts.maybeBind(host, host.createHash); + var computeHash = host.createHash || ts.generateDjb2Hash; var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState); var backupState; newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); }; @@ -109192,54 +106699,31 @@ var ts; * in that order would be used to write the files */ function emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { - var restorePendingEmitOnHandlingNoEmitSuccess = false; - var savedAffectedFilesPendingEmit; - var savedAffectedFilesPendingEmitKind; - var savedAffectedFilesPendingEmitIndex; - // Backup and restore affected pendings emit state for non emit Builder if noEmitOnError is enabled and emitBuildInfo could be written in case there are errors - // This ensures pending files to emit is updated in tsbuildinfo - // Note that when there are no errors, emit proceeds as if everything is emitted as it is callers reponsibility to write the files to disk if at all (because its builder that doesnt track files to emit) - if (kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram && - !targetSourceFile && - !ts.outFile(state.compilerOptions) && - !state.compilerOptions.noEmit && - state.compilerOptions.noEmitOnError) { - restorePendingEmitOnHandlingNoEmitSuccess = true; - savedAffectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice(); - savedAffectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind); - savedAffectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex; - } if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile); - } - var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken); - if (result) - return result; - if (restorePendingEmitOnHandlingNoEmitSuccess) { - state.affectedFilesPendingEmit = savedAffectedFilesPendingEmit; - state.affectedFilesPendingEmitKind = savedAffectedFilesPendingEmitKind; - state.affectedFilesPendingEmitIndex = savedAffectedFilesPendingEmitIndex; - } - // Emit only affected files if using builder for emit - if (!targetSourceFile && kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { - // Emit and report any errors we ran into. - var sourceMaps = []; - var emitSkipped = false; - var diagnostics = void 0; - var emittedFiles = []; - var affectedEmitResult = void 0; - while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { - emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; - diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); - emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); - sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken); + if (result) + return result; + if (!targetSourceFile) { + // Emit and report any errors we ran into. + var sourceMaps = []; + var emitSkipped = false; + var diagnostics = void 0; + var emittedFiles = []; + var affectedEmitResult = void 0; + while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { + emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; + diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); + emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); + sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + } + return { + emitSkipped: emitSkipped, + diagnostics: diagnostics || ts.emptyArray, + emittedFiles: emittedFiles, + sourceMaps: sourceMaps + }; } - return { - emitSkipped: emitSkipped, - diagnostics: diagnostics || ts.emptyArray, - emittedFiles: emittedFiles, - sourceMaps: sourceMaps - }; } return ts.Debug.checkDefined(state.program).emit(targetSourceFile, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers); } @@ -109259,8 +106743,7 @@ var ts; return toAffectedFileResult(state, state.program.getSemanticDiagnostics(/*targetSourceFile*/ undefined, cancellationToken), affected); } // Add file to affected file pending emit to handle for later emit time - // Apart for emit builder do this for tsbuildinfo, do this for non emit builder when noEmit is set as tsbuildinfo is written and reused between emitters - if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram || state.compilerOptions.noEmit || state.compilerOptions.noEmitOnError) { + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { addToAffectedFilesPendingEmit(state, affected.resolvedPath, 1 /* Full */); } // Get diagnostics for the affected file if its not ignored @@ -109974,8 +107457,8 @@ var ts; if (!resolutions) return false; var invalidated = false; - for (var _i = 0, resolutions_1 = resolutions; _i < resolutions_1.length; _i++) { - var resolution = resolutions_1[_i]; + for (var _i = 0, resolutions_2 = resolutions; _i < resolutions_2.length; _i++) { + var resolution = resolutions_2[_i]; if (resolution.isInvalidated || !canInvalidate(resolution)) continue; resolution.isInvalidated = invalidated = true; @@ -110187,14 +107670,14 @@ var ts; function getNodeModulesPackageName(compilerOptions, importingSourceFileName, nodeModulesFileName, host) { var info = getInfo(importingSourceFileName, host); var modulePaths = getAllModulePaths(importingSourceFileName, nodeModulesFileName, host); - return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions, /*packageNameOnly*/ true); }); + return ts.firstDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions, /*packageNameOnly*/ true); }); } moduleSpecifiers.getNodeModulesPackageName = getNodeModulesPackageName; function getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, preferences) { var info = getInfo(importingSourceFileName, host); var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host); - return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); }) || - getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences); + return ts.firstDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions); }) || + getLocalModuleSpecifier(toFileName, info, compilerOptions, preferences); } /** Returns an import for each symlink and for the realpath. */ function getModuleSpecifiers(moduleSymbol, compilerOptions, importingSourceFile, host, userPreferences) { @@ -110205,46 +107688,8 @@ var ts; var moduleSourceFile = ts.getSourceFileOfNode(moduleSymbol.valueDeclaration || ts.getNonAugmentationDeclaration(moduleSymbol)); var modulePaths = getAllModulePaths(importingSourceFile.path, moduleSourceFile.originalFileName, host); var preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile); - var importedFileIsInNodeModules = ts.some(modulePaths, function (p) { return p.isInNodeModules; }); - // Module specifier priority: - // 1. "Bare package specifiers" (e.g. "@foo/bar") resulting from a path through node_modules to a package.json's "types" entry - // 2. Specifiers generated using "paths" from tsconfig - // 3. Non-relative specfiers resulting from a path through node_modules (e.g. "@foo/bar/path/to/file") - // 4. Relative paths - var nodeModulesSpecifiers; - var pathsSpecifiers; - var relativeSpecifiers; - for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) { - var modulePath = modulePaths_1[_i]; - var specifier = tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); - nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier); - if (specifier && modulePath.isRedirect) { - // If we got a specifier for a redirect, it was a bare package specifier (e.g. "@foo/bar", - // not "@foo/bar/path/to/file"). No other specifier will be this good, so stop looking. - return nodeModulesSpecifiers; - } - if (!specifier && !modulePath.isRedirect) { - var local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, preferences); - if (ts.pathIsBareSpecifier(local)) { - pathsSpecifiers = ts.append(pathsSpecifiers, local); - } - else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) { - // Why this extra conditional, not just an `else`? If some path to the file contained - // 'node_modules', but we can't create a non-relative specifier (e.g. "@foo/bar/path/to/file"), - // that means we had to go through a *sibling's* node_modules, not one we can access directly. - // If some path to the file was in node_modules but another was not, this likely indicates that - // we have a monorepo structure with symlinks. In this case, the non-node_modules path is - // probably the realpath, e.g. "../bar/path/to/file", but a relative path to another package - // in a monorepo is probably not portable. So, the module specifier we actually go with will be - // the relative path through node_modules, so that the declaration emitter can produce a - // portability error. (See declarationEmitReexportedSymlinkReference3) - relativeSpecifiers = ts.append(relativeSpecifiers, local); - } - } - } - return (pathsSpecifiers === null || pathsSpecifiers === void 0 ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : - (nodeModulesSpecifiers === null || nodeModulesSpecifiers === void 0 ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : - ts.Debug.checkDefined(relativeSpecifiers); + var global = ts.mapDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions); }); + return global.length ? global : modulePaths.map(function (moduleFileName) { return getLocalModuleSpecifier(moduleFileName, info, compilerOptions, preferences); }); } moduleSpecifiers.getModuleSpecifiers = getModuleSpecifiers; // importingSourceFileName is separate because getEditsForFileRename may need to specify an updated path @@ -110253,26 +107698,22 @@ var ts; var sourceDirectory = ts.getDirectoryPath(importingSourceFileName); return { getCanonicalFileName: getCanonicalFileName, sourceDirectory: sourceDirectory }; } - function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, host, _b) { + function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, _b) { var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory; var ending = _b.ending, relativePreference = _b.relativePreference; var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs; var relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) || removeExtensionAndIndexPostFix(ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions); - if (!baseUrl && !paths || relativePreference === 0 /* Relative */) { + if (!baseUrl || relativePreference === 0 /* Relative */) { return relativePath; } - var baseDirectory = ts.getPathsBasePath(compilerOptions, host) || baseUrl; - var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseDirectory, getCanonicalFileName); + var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); if (!relativeToBaseUrl) { return relativePath; } var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions); var fromPaths = paths && tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); - var nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths; - if (!nonRelative) { - return relativePath; - } + var nonRelative = fromPaths === undefined ? importRelativeToBaseUrl : fromPaths; if (relativePreference === 1 /* NonRelative */) { return nonRelative; } @@ -110301,8 +107742,8 @@ var ts; var match = str.match(/\//g); return match ? match.length : 0; } - function comparePathsByRedirectAndNumberOfDirectorySeparators(a, b) { - return ts.compareBooleans(b.isRedirect, a.isRedirect) || ts.compareValues(numberOfDirectorySeparators(a.path), numberOfDirectorySeparators(b.path)); + function comparePathsByNumberOfDirectorySeparators(a, b) { + return ts.compareValues(numberOfDirectorySeparators(a), numberOfDirectorySeparators(b)); } function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) { var getCanonicalFileName = ts.hostGetCanonicalFileName(host); @@ -110312,36 +107753,34 @@ var ts; var importedFileNames = __spreadArrays((referenceRedirect ? [referenceRedirect] : ts.emptyArray), [importedFileName], redirects); var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); }); if (!preferSymlinks) { - var result_15 = ts.forEach(targets, function (p) { return cb(p, referenceRedirect === p); }); - if (result_15) - return result_15; + var result_13 = ts.forEach(targets, cb); + if (result_13) + return result_13; } var links = host.getSymlinkCache ? host.getSymlinkCache() : ts.discoverProbableSymlinks(host.getSourceFiles(), getCanonicalFileName, cwd); var symlinkedDirectories = links.getSymlinkedDirectories(); - var useCaseSensitiveFileNames = !host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames(); + var compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive; var result = symlinkedDirectories && ts.forEachEntry(symlinkedDirectories, function (resolved, path) { if (resolved === false) return undefined; if (ts.startsWithDirectory(importingFileName, resolved.realPath, getCanonicalFileName)) { return undefined; // Don't want to a package to globally import from itself } - return ts.forEach(targets, function (target) { - if (!ts.containsPath(resolved.real, target, !useCaseSensitiveFileNames)) { - return; - } - var relative = ts.getRelativePathFromDirectory(resolved.real, target, getCanonicalFileName); - var option = ts.resolvePath(path, relative); - if (!host.fileExists || host.fileExists(option)) { - var result_16 = cb(option, target === referenceRedirect); - if (result_16) - return result_16; - } - }); + var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.real.length), resolved.real) === 0 /* EqualTo */; }); + if (target === undefined) + return undefined; + var relative = ts.getRelativePathFromDirectory(resolved.real, target, getCanonicalFileName); + var option = ts.resolvePath(path, relative); + if (!host.fileExists || host.fileExists(option)) { + var result_14 = cb(option); + if (result_14) + return result_14; + } }); return result || - (preferSymlinks ? ts.forEach(targets, function (p) { return cb(p, p === referenceRedirect); }) : undefined); + (preferSymlinks ? ts.forEach(targets, cb) : undefined); } moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule; /** @@ -110354,27 +107793,28 @@ var ts; var allFileNames = new ts.Map(); var importedFileFromNodeModules = false; forEachFileNameOfModule(importingFileName, importedFileName, host, - /*preferSymlinks*/ true, function (path, isRedirect) { - var isInNodeModules = ts.pathContainsNodeModules(path); - allFileNames.set(path, { path: getCanonicalFileName(path), isRedirect: isRedirect, isInNodeModules: isInNodeModules }); - importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules; - // don't return value, so we collect everything + /*preferSymlinks*/ true, function (path) { + // dont return value, so we collect everything + allFileNames.set(path, getCanonicalFileName(path)); + importedFileFromNodeModules = importedFileFromNodeModules || ts.pathContainsNodeModules(path); }); // Sort by paths closest to importing file Name directory var sortedPaths = []; - var _loop_24 = function (directory) { + var _loop_23 = function (directory) { var directoryStart = ts.ensureTrailingDirectorySeparator(directory); var pathsInDirectory; - allFileNames.forEach(function (_a, fileName) { - var path = _a.path, isRedirect = _a.isRedirect, isInNodeModules = _a.isInNodeModules; - if (ts.startsWith(path, directoryStart)) { - (pathsInDirectory || (pathsInDirectory = [])).push({ path: fileName, isRedirect: isRedirect, isInNodeModules: isInNodeModules }); + allFileNames.forEach(function (canonicalFileName, fileName) { + if (ts.startsWith(canonicalFileName, directoryStart)) { + // If the importedFile is from node modules, use only paths in node_modules folder as option + if (!importedFileFromNodeModules || ts.pathContainsNodeModules(fileName)) { + (pathsInDirectory || (pathsInDirectory = [])).push(fileName); + } allFileNames.delete(fileName); } }); if (pathsInDirectory) { if (pathsInDirectory.length > 1) { - pathsInDirectory.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + pathsInDirectory.sort(comparePathsByNumberOfDirectorySeparators); } sortedPaths.push.apply(sortedPaths, pathsInDirectory); } @@ -110386,7 +107826,7 @@ var ts; }; var out_directory_1; for (var directory = ts.getDirectoryPath(ts.toPath(importingFileName, cwd, getCanonicalFileName)); allFileNames.size !== 0;) { - var state_8 = _loop_24(directory); + var state_8 = _loop_23(directory); directory = out_directory_1; if (state_8 === "break") break; @@ -110394,7 +107834,7 @@ var ts; if (allFileNames.size) { var remainingPaths = ts.arrayFrom(allFileNames.values()); if (remainingPaths.length > 1) - remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + remainingPaths.sort(comparePathsByNumberOfDirectorySeparators); sortedPaths.push.apply(sortedPaths, remainingPaths); } return sortedPaths; @@ -110439,43 +107879,37 @@ var ts; ? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions) : ts.removeFileExtension(relativePath); } - function tryGetModuleNameAsNodeModule(_a, _b, host, options, packageNameOnly) { - var path = _a.path, isRedirect = _a.isRedirect; - var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory; + function tryGetModuleNameAsNodeModule(moduleFileName, _a, host, options, packageNameOnly) { + var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory; if (!host.fileExists || !host.readFile) { return undefined; } - var parts = getNodeModulePathParts(path); + var parts = getNodeModulePathParts(moduleFileName); if (!parts) { return undefined; } // Simplify the full file path to something that can be resolved by Node. - var moduleSpecifier = path; - var isPackageRootPath = false; + var moduleSpecifier = moduleFileName; if (!packageNameOnly) { var packageRootIndex = parts.packageRootIndex; var moduleFileNameForExtensionless = void 0; while (true) { // If the module could be imported by a directory name, use that directory's name - var _c = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _c.moduleFileToTry, packageRootPath = _c.packageRootPath; + var _b = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _b.moduleFileToTry, packageRootPath = _b.packageRootPath; if (packageRootPath) { moduleSpecifier = packageRootPath; - isPackageRootPath = true; break; } if (!moduleFileNameForExtensionless) moduleFileNameForExtensionless = moduleFileToTry; // try with next level of directory - packageRootIndex = path.indexOf(ts.directorySeparator, packageRootIndex + 1); + packageRootIndex = moduleFileName.indexOf(ts.directorySeparator, packageRootIndex + 1); if (packageRootIndex === -1) { moduleSpecifier = getExtensionlessFileName(moduleFileNameForExtensionless); break; } } } - if (isRedirect && !isPackageRootPath) { - return undefined; - } var globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); // Get a path that's relative to node_modules or the importing file's path // if node_modules folder is in this folder or any of its parent folders, no need to keep it. @@ -110489,16 +107923,16 @@ var ts; // For classic resolution, only allow importing from node_modules/@types, not other node_modules return ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs && packageName === nodeModulesDirectoryName ? undefined : packageName; function tryDirectoryWithPackageJson(packageRootIndex) { - var packageRootPath = path.substring(0, packageRootIndex); + var packageRootPath = moduleFileName.substring(0, packageRootIndex); var packageJsonPath = ts.combinePaths(packageRootPath, "package.json"); - var moduleFileToTry = path; + var moduleFileToTry = moduleFileName; if (host.fileExists(packageJsonPath)) { var packageJsonContent = JSON.parse(host.readFile(packageJsonPath)); var versionPaths = packageJsonContent.typesVersions ? ts.getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions) : undefined; if (versionPaths) { - var subModuleName = path.slice(packageRootPath.length + 1); + var subModuleName = moduleFileName.slice(packageRootPath.length + 1); var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(subModuleName), removeExtensionAndIndexPostFix(subModuleName, 0 /* Minimal */, options), versionPaths.paths); if (fromPaths !== undefined) { moduleFileToTry = ts.combinePaths(packageRootPath, fromPaths); @@ -110902,7 +108336,7 @@ var ts; ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost; function setGetSourceFileAsHashVersioned(compilerHost, host) { var originalGetSourceFile = compilerHost.getSourceFile; - var computeHash = ts.maybeBind(host, host.createHash) || ts.generateDjb2Hash; + var computeHash = host.createHash || ts.generateDjb2Hash; compilerHost.getSourceFile = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -110910,7 +108344,7 @@ var ts; } var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args)); if (result) { - result.version = computeHash(result.text); + result.version = computeHash.call(host, result.text); } return result; }; @@ -111429,7 +108863,7 @@ var ts; } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); - var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions); + var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost); if (ts.updateErrorForNoInputFiles(result, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) { hasChangedConfigFileParsingErrors = true; } @@ -111515,7 +108949,6 @@ var ts; fileOrDirectoryPath: fileOrDirectoryPath, configFileName: configFileName, configFileSpecs: configFileSpecs, - extraFileExtensions: extraFileExtensions, options: compilerOptions, program: getCurrentBuilderProgram(), currentDirectory: currentDirectory, @@ -113104,7 +110537,7 @@ var ts; function nowString() { // E.g. "12:34:56.789" var d = new Date(); - return ts.padLeft(d.getHours().toString(), 2, "0") + ":" + ts.padLeft(d.getMinutes().toString(), 2, "0") + ":" + ts.padLeft(d.getSeconds().toString(), 2, "0") + "." + ts.padLeft(d.getMilliseconds().toString(), 3, "0"); + return d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + "." + d.getMilliseconds(); } server.nowString = nowString; })(server = ts.server || (ts.server = {})); @@ -113214,9 +110647,7 @@ var ts; var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); getTypingNamesFromPackagesFolder(nodeModulesPath, filesToWatch); }); - if (!typeAcquisition.disableFilenameBasedTypeAcquisition) { - getTypingNamesFromSourceFileNames(fileNames); - } + getTypingNamesFromSourceFileNames(fileNames); // add typings for unresolved imports if (unresolvedImports) { var module_1 = ts.deduplicate(unresolvedImports.map(nonRelativeModuleNameForTypingCache), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); @@ -113477,11 +110908,6 @@ var ts; })(LanguageServiceMode = ts.LanguageServiceMode || (ts.LanguageServiceMode = {})); /* @internal */ ts.emptyOptions = {}; - var SemanticClassificationFormat; - (function (SemanticClassificationFormat) { - SemanticClassificationFormat["Original"] = "original"; - SemanticClassificationFormat["TwentyTwenty"] = "2020"; - })(SemanticClassificationFormat = ts.SemanticClassificationFormat || (ts.SemanticClassificationFormat = {})); var HighlightSpanKind; (function (HighlightSpanKind) { HighlightSpanKind["none"] = "none"; @@ -113755,37 +111181,37 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 287 /* CatchClause */: - case 280 /* JsxAttribute */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 284 /* CatchClause */: + case 277 /* JsxAttribute */: return 1 /* Value */; - case 159 /* TypeParameter */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 177 /* TypeLiteral */: + case 158 /* TypeParameter */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 176 /* TypeLiteral */: return 2 /* Type */; - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 291 /* EnumMember */: - case 252 /* ClassDeclaration */: + case 288 /* EnumMember */: + case 249 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -113795,16 +111221,16 @@ var ts; else { return 4 /* Namespace */; } - case 255 /* EnumDeclaration */: - case 264 /* NamedImports */: - case 265 /* ImportSpecifier */: - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 252 /* EnumDeclaration */: + case 261 /* NamedImports */: + case 262 /* ImportSpecifier */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -113812,13 +111238,13 @@ var ts; ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 266 /* ExportAssignment */ - || node.parent.kind === 272 /* ExternalModuleReference */ - || node.parent.kind === 265 /* ImportSpecifier */ - || node.parent.kind === 262 /* ImportClause */ + else if (node.parent.kind === 263 /* ExportAssignment */ + || node.parent.kind === 269 /* ExternalModuleReference */ + || node.parent.kind === 262 /* ImportSpecifier */ + || node.parent.kind === 259 /* ImportClause */ || ts.isImportEqualsDeclaration(node.parent) && node === node.parent.name) { return 7 /* All */; } @@ -113828,9 +111254,6 @@ var ts; else if (ts.isDeclarationName(node)) { return getMeaningFromDeclaration(node.parent); } - else if (ts.isEntityName(node) && ts.isJSDocNameReference(node.parent)) { - return 7 /* All */; - } else if (isTypeReference(node)) { return 2 /* Type */; } @@ -113854,11 +111277,11 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - var name = node.kind === 157 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; - return name && name.parent.kind === 260 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + var name = node.kind === 156 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 257 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 157 /* QualifiedName */) { + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -113870,27 +111293,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 157 /* QualifiedName */) { - while (root.parent && root.parent.kind === 157 /* QualifiedName */) { + if (root.parent.kind === 156 /* QualifiedName */) { + while (root.parent && root.parent.kind === 156 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 173 /* TypeReference */ && !isLastClause; + return root.parent.kind === 172 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 201 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 201 /* PropertyAccessExpression */) { + if (root.parent.kind === 198 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 198 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 223 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 286 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 220 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 283 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 252 /* ClassDeclaration */ && root.parent.parent.token === 116 /* ImplementsKeyword */) || - (decl.kind === 253 /* InterfaceDeclaration */ && root.parent.parent.token === 93 /* ExtendsKeyword */); + return (decl.kind === 249 /* ClassDeclaration */ && root.parent.parent.token === 116 /* ImplementsKeyword */) || + (decl.kind === 250 /* InterfaceDeclaration */ && root.parent.parent.token === 93 /* ExtendsKeyword */); } return false; } @@ -113901,15 +111324,15 @@ var ts; switch (node.kind) { case 107 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 187 /* ThisType */: + case 186 /* ThisType */: return true; } switch (node.parent.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return true; - case 195 /* ImportType */: + case 192 /* ImportType */: return !node.parent.isTypeOf; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; @@ -113976,7 +111399,7 @@ var ts; ts.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 245 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 242 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -114037,22 +111460,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 288 /* PropertyAssignment */: - case 291 /* EnumMember */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 256 /* ModuleDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 285 /* PropertyAssignment */: + case 288 /* EnumMember */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 253 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return true; - case 191 /* LiteralType */: - return node.parent.parent.kind === 189 /* IndexedAccessType */; + case 190 /* LiteralType */: + return node.parent.parent.kind === 188 /* IndexedAccessType */; default: return false; } @@ -114076,17 +111499,17 @@ var ts; return undefined; } switch (node.kind) { - case 297 /* SourceFile */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 256 /* ModuleDeclaration */: + case 294 /* SourceFile */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: return node; } } @@ -114094,54 +111517,54 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return "class" /* classElement */; - case 253 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 254 /* TypeAliasDeclaration */: - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: + case 250 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 251 /* TypeAliasDeclaration */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 255 /* EnumDeclaration */: return "enum" /* enumElement */; - case 249 /* VariableDeclaration */: + case 252 /* EnumDeclaration */: return "enum" /* enumElement */; + case 246 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 209 /* ArrowFunction */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return "function" /* functionElement */; - case 167 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 168 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 166 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 167 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: var initializer = node.initializer; return ts.isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 289 /* ShorthandPropertyAssignment */: - case 290 /* SpreadAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 286 /* ShorthandPropertyAssignment */: + case 287 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 171 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 170 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 169 /* CallSignature */: return "call" /* callSignatureElement */; - case 166 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 159 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 291 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 160 /* Parameter */: return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 260 /* ImportEqualsDeclaration */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: - case 263 /* NamespaceImport */: - case 269 /* NamespaceExport */: + case 170 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 169 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 168 /* CallSignature */: return "call" /* callSignatureElement */; + case 165 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 158 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 288 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 159 /* Parameter */: return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 257 /* ImportEqualsDeclaration */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: + case 260 /* NamespaceImport */: + case 266 /* NamespaceExport */: return "alias" /* alias */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var kind = ts.getAssignmentDeclarationKind(node); var right = node.right; switch (kind) { @@ -114170,7 +111593,7 @@ var ts; } case 78 /* Identifier */: return ts.isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: var scriptKind = getNodeKind(node.expression); // If the expression didn't come back with something (like it does for an identifiers) return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; @@ -114193,7 +111616,7 @@ var ts; return true; case 78 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 160 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 159 /* Parameter */; default: return false; } @@ -114258,42 +111681,42 @@ var ts; return false; } switch (n.kind) { - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 200 /* ObjectLiteralExpression */: - case 196 /* ObjectBindingPattern */: - case 177 /* TypeLiteral */: - case 230 /* Block */: - case 257 /* ModuleBlock */: - case 258 /* CaseBlock */: - case 264 /* NamedImports */: - case 268 /* NamedExports */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 197 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 176 /* TypeLiteral */: + case 227 /* Block */: + case 254 /* ModuleBlock */: + case 255 /* CaseBlock */: + case 261 /* NamedImports */: + case 265 /* NamedExports */: return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 204 /* NewExpression */: + case 201 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 203 /* CallExpression */: - case 207 /* ParenthesizedExpression */: - case 186 /* ParenthesizedType */: + case 200 /* CallExpression */: + case 204 /* ParenthesizedExpression */: + case 185 /* ParenthesizedType */: return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 170 /* ConstructSignature */: - case 169 /* CallSignature */: - case 209 /* ArrowFunction */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 169 /* ConstructSignature */: + case 168 /* CallSignature */: + case 206 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -114303,65 +111726,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 234 /* IfStatement */: + case 231 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile); - case 199 /* ArrayLiteralExpression */: - case 197 /* ArrayBindingPattern */: - case 202 /* ElementAccessExpression */: - case 158 /* ComputedPropertyName */: - case 179 /* TupleType */: + case 196 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 199 /* ElementAccessExpression */: + case 157 /* ComputedPropertyName */: + case 178 /* TupleType */: return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 236 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 233 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 235 /* DoStatement */: + case 232 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 114 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 211 /* TypeOfExpression */: - case 210 /* DeleteExpression */: - case 212 /* VoidExpression */: - case 219 /* YieldExpression */: - case 220 /* SpreadElement */: + case 208 /* TypeOfExpression */: + case 207 /* DeleteExpression */: + case 209 /* VoidExpression */: + case 216 /* YieldExpression */: + case 217 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 267 /* ExportDeclaration */: - case 261 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -114468,11 +111891,11 @@ var ts; function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return getAdjustedLocationForFunction(node); } } @@ -114567,11 +111990,11 @@ var ts; node.kind === 97 /* FunctionKeyword */ ? ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(node) : node.kind === 117 /* InterfaceKeyword */ ? ts.isInterfaceDeclaration(parent) : node.kind === 91 /* EnumKeyword */ ? ts.isEnumDeclaration(parent) : - node.kind === 149 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : - node.kind === 140 /* NamespaceKeyword */ || node.kind === 139 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : + node.kind === 148 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : + node.kind === 139 /* NamespaceKeyword */ || node.kind === 138 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : node.kind === 99 /* ImportKeyword */ ? ts.isImportEqualsDeclaration(parent) : node.kind === 134 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : - node.kind === 146 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { + node.kind === 145 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { var location = getAdjustedLocationForDeclaration(parent, forRename); if (location) { return location; @@ -114585,7 +112008,7 @@ var ts; return decl.name; } } - if (node.kind === 149 /* TypeKeyword */) { + if (node.kind === 148 /* TypeKeyword */) { // import /**/type [|name|] from ...; // import /**/type { [|name|] } from ...; // import /**/type { propertyName as [|name|] } from ...; @@ -114652,12 +112075,12 @@ var ts; } } // import name = /**/require("[|module|]"); - if (node.kind === 143 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { + if (node.kind === 142 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { return parent.expression; } // import ... /**/from "[|module|]"; // export ... /**/from "[|module|]"; - if (node.kind === 153 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { + if (node.kind === 152 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { return parent.moduleSpecifier; } // class ... /**/extends [|name|] ... @@ -114690,12 +112113,12 @@ var ts; return parent.name; } // /**/keyof [|T|] - if (node.kind === 138 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 138 /* KeyOfKeyword */ && + if (node.kind === 137 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 137 /* KeyOfKeyword */ && ts.isTypeReferenceNode(parent.type)) { return parent.type.typeName; } // /**/readonly [|name|][] - if (node.kind === 142 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 142 /* ReadonlyKeyword */ && + if (node.kind === 141 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 141 /* ReadonlyKeyword */ && ts.isArrayTypeNode(parent.type) && ts.isTypeReferenceNode(parent.type.elementType)) { return parent.type.elementType.typeName; } @@ -114732,7 +112155,7 @@ var ts; // for (... /**/in [|name|]) // for (... /**/of [|name|]) if (node.kind === 100 /* InKeyword */ && ts.isForInStatement(parent) || - node.kind === 156 /* OfKeyword */ && ts.isForOfStatement(parent)) { + node.kind === 155 /* OfKeyword */ && ts.isForOfStatement(parent)) { return ts.skipOuterExpressions(parent.expression); } } @@ -114850,21 +112273,7 @@ var ts; return n; } var children = n.getChildren(sourceFile); - var i = ts.binarySearchKey(children, position, function (_, i) { return i; }, function (middle, _) { - // This last callback is more of a selector than a comparator - - // `EqualTo` causes the `middle` result to be returned - // `GreaterThan` causes recursion on the left of the middle - // `LessThan` causes recursion on the right of the middle - if (position < children[middle].end) { - // first element whose end position is greater than the input position - if (!children[middle - 1] || position >= children[middle - 1].end) { - return 0 /* EqualTo */; - } - return 1 /* GreaterThan */; - } - return -1 /* LessThan */; - }); - if (i >= 0 && children[i]) { + for (var i = 0; i < children.length; i++) { var child = children[i]; // Note that the span of a node's tokens is [node.getStart(...), node.end). // Given that `position < child.end` and child has constituent tokens, we distinguish these cases: @@ -114887,7 +112296,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 297 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 294 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -114905,9 +112314,6 @@ var ts; return n; } var children = n.getChildren(sourceFile); - if (children.length === 0) { - return n; - } var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length, sourceFile); return candidate && findRightmostToken(candidate, sourceFile); } @@ -114960,17 +112366,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 283 /* JsxExpression */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 280 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 283 /* JsxExpression */) { + if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 280 /* JsxExpression */) { return true; } //
|
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 276 /* JsxClosingElement */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 273 /* JsxClosingElement */) { return true; } return false; @@ -115001,7 +112407,7 @@ var ts; function isInsideJsxElement(sourceFile, position) { function isInsideJsxElementTraversal(node) { while (node) { - if (node.kind >= 274 /* JsxSelfClosingElement */ && node.kind <= 283 /* JsxExpression */ + if (node.kind >= 271 /* JsxSelfClosingElement */ && node.kind <= 280 /* JsxExpression */ || node.kind === 11 /* JsxText */ || node.kind === 29 /* LessThanToken */ || node.kind === 31 /* GreaterThanToken */ @@ -115011,7 +112417,7 @@ var ts; || node.kind === 43 /* SlashToken */) { node = node.parent; } - else if (node.kind === 273 /* JsxElement */) { + else if (node.kind === 270 /* JsxElement */) { if (position > node.getStart(sourceFile)) return true; node = node.parent; @@ -115138,7 +112544,7 @@ var ts; // falls through case 111 /* TypeOfKeyword */: case 93 /* ExtendsKeyword */: - case 138 /* KeyOfKeyword */: + case 137 /* KeyOfKeyword */: case 24 /* DotToken */: case 51 /* BarToken */: case 57 /* QuestionToken */: @@ -115195,16 +112601,16 @@ var ts; result.push("deprecated" /* deprecatedModifier */); if (node.flags & 8388608 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 266 /* ExportAssignment */) + if (node.kind === 263 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 173 /* TypeReference */ || node.kind === 203 /* CallExpression */) { + if (node.kind === 172 /* TypeReference */ || node.kind === 200 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 252 /* ClassDeclaration */ || node.kind === 253 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 249 /* ClassDeclaration */ || node.kind === 250 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -115249,18 +112655,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 199 /* ArrayLiteralExpression */ || - node.kind === 200 /* ObjectLiteralExpression */) { + if (node.kind === 196 /* ArrayLiteralExpression */ || + node.kind === 197 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 216 /* BinaryExpression */ && + if (node.parent.kind === 213 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 239 /* ForOfStatement */ && + if (node.parent.kind === 236 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -115268,7 +112674,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 288 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 285 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -115332,29 +112738,29 @@ var ts; ts.typeKeywords = [ 128 /* AnyKeyword */, 127 /* AssertsKeyword */, - 155 /* BigIntKeyword */, + 154 /* BigIntKeyword */, 131 /* BooleanKeyword */, 94 /* FalseKeyword */, - 138 /* KeyOfKeyword */, - 141 /* NeverKeyword */, + 137 /* KeyOfKeyword */, + 140 /* NeverKeyword */, 103 /* NullKeyword */, - 144 /* NumberKeyword */, - 145 /* ObjectKeyword */, - 142 /* ReadonlyKeyword */, - 147 /* StringKeyword */, - 148 /* SymbolKeyword */, + 143 /* NumberKeyword */, + 144 /* ObjectKeyword */, + 141 /* ReadonlyKeyword */, + 146 /* StringKeyword */, + 147 /* SymbolKeyword */, 109 /* TrueKeyword */, 113 /* VoidKeyword */, - 150 /* UndefinedKeyword */, - 151 /* UniqueKeyword */, - 152 /* UnknownKeyword */, + 149 /* UndefinedKeyword */, + 150 /* UniqueKeyword */, + 151 /* UnknownKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); } ts.isTypeKeyword = isTypeKeyword; function isTypeKeywordToken(node) { - return node.kind === 149 /* TypeKeyword */; + return node.kind === 148 /* TypeKeyword */; } ts.isTypeKeywordToken = isTypeKeywordToken; /** True if the symbol is for an external module, as opposed to a namespace. */ @@ -115387,7 +112793,7 @@ var ts; } ts.skipConstraint = skipConstraint; function getNameFromPropertyName(name) { - return name.kind === 158 /* ComputedPropertyName */ + return name.kind === 157 /* ComputedPropertyName */ // treat computed property names where expression is string/numeric literal as just string/numeric literal ? ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined : ts.isPrivateIdentifier(name) ? ts.idText(name) : ts.getTextOfIdentifierOrLiteral(name); @@ -115418,7 +112824,7 @@ var ts; getSourceFiles: function () { return program.getSourceFiles(); }, redirectTargetsMap: program.redirectTargetsMap, getProjectReferenceRedirect: function (fileName) { return program.getProjectReferenceRedirect(fileName); }, - isSourceOfProjectReferenceRedirect: function (fileName) { return program.isSourceOfProjectReferenceRedirect(fileName); } + isSourceOfProjectReferenceRedirect: function (fileName) { return program.isSourceOfProjectReferenceRedirect(fileName); }, }; } ts.createModuleSpecifierResolutionHost = createModuleSpecifierResolutionHost; @@ -115456,9 +112862,7 @@ var ts; return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */; } else { - // ignore synthetic import added when importHelpers: true - var firstModuleSpecifier = sourceFile.imports && - ts.find(sourceFile.imports, function (n) { return ts.isStringLiteral(n) && !ts.nodeIsSynthesized(n.parent); }); + var firstModuleSpecifier = sourceFile.imports && ts.find(sourceFile.imports, ts.isStringLiteral); return firstModuleSpecifier ? quotePreferenceFromString(firstModuleSpecifier, sourceFile) : 1 /* Double */; } } @@ -115550,7 +112954,7 @@ var ts; ts.findModifier = findModifier; function insertImports(changes, sourceFile, imports, blankLineBetween) { var decl = ts.isArray(imports) ? imports[0] : imports; - var importKindPredicate = decl.kind === 232 /* VariableStatement */ ? ts.isRequireVariableStatement : ts.isAnyImportSyntax; + var importKindPredicate = decl.kind === 229 /* VariableStatement */ ? ts.isRequireVariableStatement : ts.isAnyImportSyntax; var existingImportStatements = ts.filter(sourceFile.statements, importKindPredicate); var sortedNewImports = ts.isArray(imports) ? ts.stableSort(imports, ts.OrganizeImports.compareImportsOrRequireStatements) : [imports]; if (!existingImportStatements.length) { @@ -115561,10 +112965,7 @@ var ts; var newImport = sortedNewImports_1[_i]; var insertionIndex = ts.OrganizeImports.getImportDeclarationInsertionIndex(existingImportStatements, newImport); if (insertionIndex === 0) { - // If the first import is top-of-file, insert after the leading comment which is likely the header. - var options = existingImportStatements[0] === sourceFile.statements[0] ? - { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude } : {}; - changes.insertNodeBefore(sourceFile, existingImportStatements[0], newImport, /*blankLineBetween*/ false, options); + changes.insertNodeBefore(sourceFile, existingImportStatements[0], newImport, /*blankLineBetween*/ false); } else { var prevImport = existingImportStatements[insertionIndex - 1]; @@ -115628,7 +113029,7 @@ var ts; // Display-part writer helpers // #region function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 160 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 159 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -115909,22 +113310,36 @@ var ts; return clone; } ts.getSynthesizedDeepClone = getSynthesizedDeepClone; - function getSynthesizedDeepCloneWithReplacements(node, includeTrivia, replaceNode) { - var clone = replaceNode(node); - if (clone) { - ts.setOriginalNode(clone, node); + function getSynthesizedDeepCloneWithRenames(node, includeTrivia, renameMap, checker, callback) { + if (includeTrivia === void 0) { includeTrivia = true; } + var clone; + if (renameMap && checker && ts.isBindingElement(node) && ts.isIdentifier(node.name) && ts.isObjectBindingPattern(node.parent)) { + var symbol = checker.getSymbolAtLocation(node.name); + var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); + if (renameInfo && renameInfo.text !== (node.name || node.propertyName).getText()) { + clone = ts.setOriginalNode(ts.factory.createBindingElement(node.dotDotDotToken, node.propertyName || node.name, renameInfo, node.initializer), node); + } } - else { - clone = getSynthesizedDeepCloneWorker(node, replaceNode); + else if (renameMap && checker && ts.isIdentifier(node)) { + var symbol = checker.getSymbolAtLocation(node); + var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); + if (renameInfo) { + clone = ts.setOriginalNode(ts.factory.createIdentifier(renameInfo.text), node); + } + } + if (!clone) { + clone = getSynthesizedDeepCloneWorker(node, renameMap, checker, callback); } if (clone && !includeTrivia) suppressLeadingAndTrailingTrivia(clone); + if (callback && clone) + callback(node, clone); return clone; } - ts.getSynthesizedDeepCloneWithReplacements = getSynthesizedDeepCloneWithReplacements; - function getSynthesizedDeepCloneWorker(node, replaceNode) { - var visited = replaceNode ? - ts.visitEachChild(node, function (n) { return getSynthesizedDeepCloneWithReplacements(n, /*includeTrivia*/ true, replaceNode); }, ts.nullTransformationContext) : + ts.getSynthesizedDeepCloneWithRenames = getSynthesizedDeepCloneWithRenames; + function getSynthesizedDeepCloneWorker(node, renameMap, checker, callback) { + var visited = (renameMap || checker || callback) ? + ts.visitEachChild(node, wrapper, ts.nullTransformationContext) : ts.visitEachChild(node, getSynthesizedDeepClone, ts.nullTransformationContext); if (visited === node) { // This only happens for leaf nodes - internal nodes always see their children change. @@ -115938,16 +113353,15 @@ var ts; // would have made. visited.parent = undefined; return visited; + function wrapper(node) { + return getSynthesizedDeepCloneWithRenames(node, /*includeTrivia*/ true, renameMap, checker, callback); + } } function getSynthesizedDeepClones(nodes, includeTrivia) { if (includeTrivia === void 0) { includeTrivia = true; } return nodes && ts.factory.createNodeArray(nodes.map(function (n) { return getSynthesizedDeepClone(n, includeTrivia); }), nodes.hasTrailingComma); } ts.getSynthesizedDeepClones = getSynthesizedDeepClones; - function getSynthesizedDeepClonesWithReplacements(nodes, includeTrivia, replaceNode) { - return ts.factory.createNodeArray(nodes.map(function (n) { return getSynthesizedDeepCloneWithReplacements(n, includeTrivia, replaceNode); }), nodes.hasTrailingComma); - } - ts.getSynthesizedDeepClonesWithReplacements = getSynthesizedDeepClonesWithReplacements; /** * Sets EmitFlags to suppress leading and trailing trivia on the node. */ @@ -116092,26 +113506,35 @@ var ts; function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 204 /* NewExpression */: + case 201 /* NewExpression */: return checker.getContextualType(parent); - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 284 /* CaseClause */: + case 281 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); } } ts.getContextualTypeFromParent = getContextualTypeFromParent; - function quote(sourceFile, preferences, text) { + function quote(text, preferences) { // Editors can pass in undefined or empty string - we want to infer the preference in those cases. - var quotePreference = getQuotePreference(sourceFile, preferences); + var quotePreference = preferences.quotePreference || "auto"; var quoted = JSON.stringify(text); - return quotePreference === 0 /* Single */ ? "'" + ts.stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'" : quoted; + switch (quotePreference) { + // TODO use getQuotePreference to infer the actual quote style. + case "auto": + case "double": + return quoted; + case "single": + return "'" + ts.stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'"; + default: + return ts.Debug.assertNever(quotePreference); + } } ts.quote = quote; function isEqualityOperatorKind(kind) { @@ -116130,8 +113553,8 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: - case 205 /* TaggedTemplateExpression */: + case 215 /* TemplateExpression */: + case 202 /* TaggedTemplateExpression */: return true; default: return false; @@ -116151,7 +113574,7 @@ var ts; var checker = program.getTypeChecker(); var typeIsAccessible = true; var notAccessible = function () { typeIsAccessible = false; }; - var res = checker.typeToTypeNode(type, enclosingScope, 1 /* NoTruncation */, { + var res = checker.typeToTypeNode(type, enclosingScope, /*flags*/ undefined, { trackSymbol: function (symbol, declaration, meaning) { typeIsAccessible = typeIsAccessible && checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility === 0 /* Accessible */; }, @@ -116164,41 +113587,41 @@ var ts; } ts.getTypeNodeIfAccessible = getTypeNodeIfAccessible; function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 169 /* CallSignature */ - || kind === 170 /* ConstructSignature */ - || kind === 171 /* IndexSignature */ - || kind === 162 /* PropertySignature */ - || kind === 164 /* MethodSignature */; + return kind === 168 /* CallSignature */ + || kind === 169 /* ConstructSignature */ + || kind === 170 /* IndexSignature */ + || kind === 161 /* PropertySignature */ + || kind === 163 /* MethodSignature */; } ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI; function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 251 /* FunctionDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 248 /* FunctionDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI; function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 256 /* ModuleDeclaration */; + return kind === 253 /* ModuleDeclaration */; } ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI; function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 232 /* VariableStatement */ - || kind === 233 /* ExpressionStatement */ - || kind === 235 /* DoStatement */ - || kind === 240 /* ContinueStatement */ - || kind === 241 /* BreakStatement */ - || kind === 242 /* ReturnStatement */ - || kind === 246 /* ThrowStatement */ - || kind === 248 /* DebuggerStatement */ - || kind === 163 /* PropertyDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 267 /* ExportDeclaration */ - || kind === 259 /* NamespaceExportDeclaration */ - || kind === 266 /* ExportAssignment */; + return kind === 229 /* VariableStatement */ + || kind === 230 /* ExpressionStatement */ + || kind === 232 /* DoStatement */ + || kind === 237 /* ContinueStatement */ + || kind === 238 /* BreakStatement */ + || kind === 239 /* ReturnStatement */ + || kind === 243 /* ThrowStatement */ + || kind === 245 /* DebuggerStatement */ + || kind === 162 /* PropertyDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 264 /* ExportDeclaration */ + || kind === 256 /* NamespaceExportDeclaration */ + || kind === 263 /* ExportAssignment */; } ts.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI; ts.syntaxMayBeASICandidate = ts.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI); @@ -116228,7 +113651,7 @@ var ts; return false; } // See comment in parser’s `parseDoStatement` - if (node.kind === 235 /* DoStatement */) { + if (node.kind === 232 /* DoStatement */) { return true; } var topNode = ts.findAncestor(node, function (ancestor) { return !ancestor.parent; }); @@ -116647,10 +114070,10 @@ var ts; } break; case 128 /* AnyKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -116840,7 +114263,7 @@ var ts; } switch (keyword2) { case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: case 132 /* ConstructorKeyword */: case 123 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". @@ -116985,13 +114408,13 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -117211,18 +114634,18 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; break; - case 329 /* JSDocTypeTag */: + case 325 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; break; - case 327 /* JSDocReturnTag */: + case 323 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; break; @@ -117373,22 +114796,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -117417,17 +114840,17 @@ var ts; var parent = token.parent; if (tokenKind === 62 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (parent.kind === 249 /* VariableDeclaration */ || - parent.kind === 163 /* PropertyDeclaration */ || - parent.kind === 160 /* Parameter */ || - parent.kind === 280 /* JsxAttribute */) { + if (parent.kind === 246 /* VariableDeclaration */ || + parent.kind === 162 /* PropertyDeclaration */ || + parent.kind === 159 /* Parameter */ || + parent.kind === 277 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent.kind === 216 /* BinaryExpression */ || - parent.kind === 214 /* PrefixUnaryExpression */ || - parent.kind === 215 /* PostfixUnaryExpression */ || - parent.kind === 217 /* ConditionalExpression */) { + if (parent.kind === 213 /* BinaryExpression */ || + parent.kind === 211 /* PrefixUnaryExpression */ || + parent.kind === 212 /* PostfixUnaryExpression */ || + parent.kind === 214 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -117440,7 +114863,7 @@ var ts; return 25 /* bigintLiteral */; } else if (tokenKind === 10 /* StringLiteral */) { - return token && token.parent.kind === 280 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 277 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 13 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -117456,32 +114879,32 @@ var ts; else if (tokenKind === 78 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 160 /* Parameter */: + case 159 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -117510,254 +114933,6 @@ var ts; } ts.getEncodedSyntacticClassifications = getEncodedSyntacticClassifications; })(ts || (ts = {})); -/** @internal */ -var ts; -(function (ts) { - var classifier; - (function (classifier) { - var v2020; - (function (v2020) { - var TokenEncodingConsts; - (function (TokenEncodingConsts) { - TokenEncodingConsts[TokenEncodingConsts["typeOffset"] = 8] = "typeOffset"; - TokenEncodingConsts[TokenEncodingConsts["modifierMask"] = 255] = "modifierMask"; - })(TokenEncodingConsts = v2020.TokenEncodingConsts || (v2020.TokenEncodingConsts = {})); - var TokenType; - (function (TokenType) { - TokenType[TokenType["class"] = 0] = "class"; - TokenType[TokenType["enum"] = 1] = "enum"; - TokenType[TokenType["interface"] = 2] = "interface"; - TokenType[TokenType["namespace"] = 3] = "namespace"; - TokenType[TokenType["typeParameter"] = 4] = "typeParameter"; - TokenType[TokenType["type"] = 5] = "type"; - TokenType[TokenType["parameter"] = 6] = "parameter"; - TokenType[TokenType["variable"] = 7] = "variable"; - TokenType[TokenType["enumMember"] = 8] = "enumMember"; - TokenType[TokenType["property"] = 9] = "property"; - TokenType[TokenType["function"] = 10] = "function"; - TokenType[TokenType["member"] = 11] = "member"; - })(TokenType = v2020.TokenType || (v2020.TokenType = {})); - var TokenModifier; - (function (TokenModifier) { - TokenModifier[TokenModifier["declaration"] = 0] = "declaration"; - TokenModifier[TokenModifier["static"] = 1] = "static"; - TokenModifier[TokenModifier["async"] = 2] = "async"; - TokenModifier[TokenModifier["readonly"] = 3] = "readonly"; - TokenModifier[TokenModifier["defaultLibrary"] = 4] = "defaultLibrary"; - TokenModifier[TokenModifier["local"] = 5] = "local"; - })(TokenModifier = v2020.TokenModifier || (v2020.TokenModifier = {})); - /** This is mainly used internally for testing */ - function getSemanticClassifications(program, cancellationToken, sourceFile, span) { - var classifications = getEncodedSemanticClassifications(program, cancellationToken, sourceFile, span); - ts.Debug.assert(classifications.spans.length % 3 === 0); - var dense = classifications.spans; - var result = []; - for (var i = 0; i < dense.length; i += 3) { - result.push({ - textSpan: ts.createTextSpan(dense[i], dense[i + 1]), - classificationType: dense[i + 2] - }); - } - return result; - } - v2020.getSemanticClassifications = getSemanticClassifications; - function getEncodedSemanticClassifications(program, cancellationToken, sourceFile, span) { - return { - spans: getSemanticTokens(program, sourceFile, span, cancellationToken), - endOfLineState: 0 /* None */ - }; - } - v2020.getEncodedSemanticClassifications = getEncodedSemanticClassifications; - function getSemanticTokens(program, sourceFile, span, cancellationToken) { - var resultTokens = []; - var collector = function (node, typeIdx, modifierSet) { - resultTokens.push(node.getStart(sourceFile), node.getWidth(sourceFile), ((typeIdx + 1) << 8 /* typeOffset */) + modifierSet); - }; - if (program && sourceFile) { - collectTokens(program, sourceFile, span, collector, cancellationToken); - } - return resultTokens; - } - function collectTokens(program, sourceFile, span, collector, cancellationToken) { - var typeChecker = program.getTypeChecker(); - var inJSXElement = false; - function visit(node) { - switch (node.kind) { - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - cancellationToken.throwIfCancellationRequested(); - } - if (!node || !ts.textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) { - return; - } - var prevInJSXElement = inJSXElement; - if (ts.isJsxElement(node) || ts.isJsxSelfClosingElement(node)) { - inJSXElement = true; - } - if (ts.isJsxExpression(node)) { - inJSXElement = false; - } - if (ts.isIdentifier(node) && !inJSXElement && !inImportClause(node)) { - var symbol = typeChecker.getSymbolAtLocation(node); - if (symbol) { - if (symbol.flags & 2097152 /* Alias */) { - symbol = typeChecker.getAliasedSymbol(symbol); - } - var typeIdx = classifySymbol(symbol, ts.getMeaningFromLocation(node)); - if (typeIdx !== undefined) { - var modifierSet = 0; - if (node.parent) { - var parentIsDeclaration = (ts.isBindingElement(node.parent) || tokenFromDeclarationMapping.get(node.parent.kind) === typeIdx); - if (parentIsDeclaration && node.parent.name === node) { - modifierSet = 1 << 0 /* declaration */; - } - } - // property declaration in constructor - if (typeIdx === 6 /* parameter */ && isRightSideOfQualifiedNameOrPropertyAccess(node)) { - typeIdx = 9 /* property */; - } - typeIdx = reclassifyByType(typeChecker, node, typeIdx); - var decl = symbol.valueDeclaration; - if (decl) { - var modifiers = ts.getCombinedModifierFlags(decl); - var nodeFlags = ts.getCombinedNodeFlags(decl); - if (modifiers & 32 /* Static */) { - modifierSet |= 1 << 1 /* static */; - } - if (modifiers & 256 /* Async */) { - modifierSet |= 1 << 2 /* async */; - } - if (typeIdx !== 0 /* class */ && typeIdx !== 2 /* interface */) { - if ((modifiers & 64 /* Readonly */) || (nodeFlags & 2 /* Const */) || (symbol.getFlags() & 8 /* EnumMember */)) { - modifierSet |= 1 << 3 /* readonly */; - } - } - if ((typeIdx === 7 /* variable */ || typeIdx === 10 /* function */) && isLocalDeclaration(decl, sourceFile)) { - modifierSet |= 1 << 5 /* local */; - } - if (program.isSourceFileDefaultLibrary(decl.getSourceFile())) { - modifierSet |= 1 << 4 /* defaultLibrary */; - } - } - else if (symbol.declarations && symbol.declarations.some(function (d) { return program.isSourceFileDefaultLibrary(d.getSourceFile()); })) { - modifierSet |= 1 << 4 /* defaultLibrary */; - } - collector(node, typeIdx, modifierSet); - } - } - } - ts.forEachChild(node, visit); - inJSXElement = prevInJSXElement; - } - visit(sourceFile); - } - function classifySymbol(symbol, meaning) { - var flags = symbol.getFlags(); - if (flags & 32 /* Class */) { - return 0 /* class */; - } - else if (flags & 384 /* Enum */) { - return 1 /* enum */; - } - else if (flags & 524288 /* TypeAlias */) { - return 5 /* type */; - } - else if (flags & 64 /* Interface */) { - if (meaning & 2 /* Type */) { - return 2 /* interface */; - } - } - else if (flags & 262144 /* TypeParameter */) { - return 4 /* typeParameter */; - } - var decl = symbol.valueDeclaration || symbol.declarations && symbol.declarations[0]; - if (decl && ts.isBindingElement(decl)) { - decl = getDeclarationForBindingElement(decl); - } - return decl && tokenFromDeclarationMapping.get(decl.kind); - } - function reclassifyByType(typeChecker, node, typeIdx) { - // type based classifications - if (typeIdx === 7 /* variable */ || typeIdx === 9 /* property */ || typeIdx === 6 /* parameter */) { - var type_1 = typeChecker.getTypeAtLocation(node); - if (type_1) { - var test = function (condition) { - return condition(type_1) || type_1.isUnion() && type_1.types.some(condition); - }; - if (typeIdx !== 6 /* parameter */ && test(function (t) { return t.getConstructSignatures().length > 0; })) { - return 0 /* class */; - } - if (test(function (t) { return t.getCallSignatures().length > 0; }) && !test(function (t) { return t.getProperties().length > 0; }) || isExpressionInCallExpression(node)) { - return typeIdx === 9 /* property */ ? 11 /* member */ : 10 /* function */; - } - } - } - return typeIdx; - } - function isLocalDeclaration(decl, sourceFile) { - if (ts.isBindingElement(decl)) { - decl = getDeclarationForBindingElement(decl); - } - if (ts.isVariableDeclaration(decl)) { - return (!ts.isSourceFile(decl.parent.parent.parent) || ts.isCatchClause(decl.parent)) && decl.getSourceFile() === sourceFile; - } - else if (ts.isFunctionDeclaration(decl)) { - return !ts.isSourceFile(decl.parent) && decl.getSourceFile() === sourceFile; - } - return false; - } - function getDeclarationForBindingElement(element) { - while (true) { - if (ts.isBindingElement(element.parent.parent)) { - element = element.parent.parent; - } - else { - return element.parent.parent; - } - } - } - function inImportClause(node) { - var parent = node.parent; - return parent && (ts.isImportClause(parent) || ts.isImportSpecifier(parent) || ts.isNamespaceImport(parent)); - } - function isExpressionInCallExpression(node) { - while (isRightSideOfQualifiedNameOrPropertyAccess(node)) { - node = node.parent; - } - return ts.isCallExpression(node.parent) && node.parent.expression === node; - } - function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (ts.isQualifiedName(node.parent) && node.parent.right === node) || (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node); - } - var tokenFromDeclarationMapping = new ts.Map([ - [249 /* VariableDeclaration */, 7 /* variable */], - [160 /* Parameter */, 6 /* parameter */], - [163 /* PropertyDeclaration */, 9 /* property */], - [256 /* ModuleDeclaration */, 3 /* namespace */], - [255 /* EnumDeclaration */, 1 /* enum */], - [291 /* EnumMember */, 8 /* enumMember */], - [252 /* ClassDeclaration */, 0 /* class */], - [165 /* MethodDeclaration */, 11 /* member */], - [251 /* FunctionDeclaration */, 10 /* function */], - [208 /* FunctionExpression */, 10 /* function */], - [164 /* MethodSignature */, 11 /* member */], - [167 /* GetAccessor */, 9 /* property */], - [168 /* SetAccessor */, 9 /* property */], - [162 /* PropertySignature */, 9 /* property */], - [253 /* InterfaceDeclaration */, 2 /* interface */], - [254 /* TypeAliasDeclaration */, 5 /* type */], - [159 /* TypeParameter */, 4 /* typeParameter */], - [288 /* PropertyAssignment */, 9 /* property */], - [289 /* ShorthandPropertyAssignment */, 9 /* property */] - ]); - })(v2020 = classifier.v2020 || (classifier.v2020 = {})); - })(classifier = ts.classifier || (ts.classifier = {})); -})(ts || (ts = {})); /* @internal */ var ts; (function (ts) { @@ -117782,24 +114957,23 @@ var ts; if (completion === undefined) { return undefined; } - var optionalReplacementSpan = ts.createTextSpanFromStringLiteralLikeContent(contextToken); switch (completion.kind) { case 0 /* Paths */: return convertPathCompletions(completion.paths); case 1 /* Properties */: { var entries = []; Completions.getCompletionEntriesFromSymbols(completion.symbols, entries, contextToken, sourceFile, sourceFile, checker, 99 /* ESNext */, log, 4 /* String */, preferences); // Target will not be used, so arbitrary - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan: optionalReplacementSpan, entries: entries }; + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, entries: entries }; } case 2 /* Types */: { var entries = completion.types.map(function (type) { return ({ name: type.value, kindModifiers: "" /* none */, kind: "string" /* string */, - sortText: Completions.SortText.LocationPriority, + sortText: "0", replacementSpan: ts.getReplacementSpanForContextToken(contextToken) }); }); - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, optionalReplacementSpan: optionalReplacementSpan, entries: entries }; + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, entries: entries }; } default: return ts.Debug.assertNever(completion); @@ -117858,46 +115032,33 @@ var ts; StringLiteralCompletionKind[StringLiteralCompletionKind["Types"] = 2] = "Types"; })(StringLiteralCompletionKind || (StringLiteralCompletionKind = {})); function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { - var parent = walkUpParentheses(node.parent); + var parent = node.parent; switch (parent.kind) { - case 191 /* LiteralType */: { - var grandParent = walkUpParentheses(parent.parent); - switch (grandParent.kind) { - case 173 /* TypeReference */: { - var typeReference_1 = grandParent; - var typeArgument = ts.findAncestor(parent, function (n) { return n.parent === typeReference_1; }); - if (typeArgument) { - return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false }; - } - return undefined; - } - case 189 /* IndexedAccessType */: + case 190 /* LiteralType */: + switch (parent.parent.kind) { + case 172 /* TypeReference */: + return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent)), isNewIdentifier: false }; + case 188 /* IndexedAccessType */: // Get all apparent property names // i.e. interface Foo { // foo: string; // bar: string; // } // let x: Foo["/*completion position*/"] - var _a = grandParent, indexType = _a.indexType, objectType = _a.objectType; - if (!ts.rangeContainsPosition(indexType, position)) { - return undefined; - } - return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType)); - case 195 /* ImportType */: + return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(parent.parent.objectType)); + case 192 /* ImportType */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; - case 182 /* UnionType */: { - if (!ts.isTypeReferenceNode(grandParent.parent)) { + case 181 /* UnionType */: { + if (!ts.isTypeReferenceNode(parent.parent.parent)) return undefined; - } - var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent); - var types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(grandParent)).filter(function (t) { return !ts.contains(alreadyUsedTypes_1, t.value); }); + var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(parent.parent, parent); + var types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent.parent)).filter(function (t) { return !ts.contains(alreadyUsedTypes_1, t.value); }); return { kind: 2 /* Types */, types: types, isNewIdentifier: false }; } default: return undefined; } - } - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { @@ -117914,9 +115075,9 @@ var ts; return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(parent.parent)); } return fromContextualType(); - case 202 /* ElementAccessExpression */: { - var _b = parent, expression = _b.expression, argumentExpression = _b.argumentExpression; - if (node === ts.skipParentheses(argumentExpression)) { + case 199 /* ElementAccessExpression */: { + var _a = parent, expression = _a.expression, argumentExpression = _a.argumentExpression; + if (node === argumentExpression) { // Get all names of properties on the expression // i.e. interface A { // 'prop1': string @@ -117927,8 +115088,8 @@ var ts; } return undefined; } - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ false) && !ts.isImportCall(parent)) { var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile); // Get string literal completions from specialized signatures of the target @@ -117937,9 +115098,9 @@ var ts; return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType(); } // falls through (is `require("")` or `import("")`) - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 272 /* ExternalModuleReference */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 269 /* ExternalModuleReference */: // Get all known external module names or complete a path to a module // i.e. import * as ns from "/*completion position*/"; // var y = import("/*completion position*/"); @@ -117956,16 +115117,6 @@ var ts; return { kind: 2 /* Types */, types: getStringLiteralTypes(ts.getContextualTypeFromParent(node, typeChecker)), isNewIdentifier: false }; } } - function walkUpParentheses(node) { - switch (node.kind) { - case 186 /* ParenthesizedType */: - return ts.walkUpParenthesizedTypes(node); - case 207 /* ParenthesizedExpression */: - return ts.walkUpParenthesizedExpressions(node); - default: - return node; - } - } function getAlreadyUsedTypesInStringLiteralUnion(union, current) { return ts.mapDefined(union.types, function (type) { return type !== current && ts.isLiteralTypeNode(type) && ts.isStringLiteral(type.literal) ? type.literal.text : undefined; @@ -118412,14 +115563,13 @@ var ts; (function (Completions) { var SortText; (function (SortText) { - SortText["LocalDeclarationPriority"] = "0"; - SortText["LocationPriority"] = "1"; - SortText["OptionalMember"] = "2"; - SortText["MemberDeclaredBySpreadAssignment"] = "3"; - SortText["SuggestedClassMembers"] = "4"; - SortText["GlobalsOrKeywords"] = "5"; - SortText["AutoImportSuggestions"] = "6"; - SortText["JavascriptIdentifiers"] = "7"; + SortText["LocationPriority"] = "0"; + SortText["OptionalMember"] = "1"; + SortText["MemberDeclaredBySpreadAssignment"] = "2"; + SortText["SuggestedClassMembers"] = "3"; + SortText["GlobalsOrKeywords"] = "4"; + SortText["AutoImportSuggestions"] = "5"; + SortText["JavascriptIdentifiers"] = "6"; })(SortText = Completions.SortText || (Completions.SortText = {})); /** * Special values for `CompletionInfo['source']` used to disambiguate @@ -118566,10 +115716,6 @@ var ts; function jsdocCompletionInfo(entries) { return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; } - function getOptionalReplacementSpan(location) { - // StringLiteralLike locations are handled separately in stringCompletions.ts - return (location === null || location === void 0 ? void 0 : location.kind) === 78 /* Identifier */ ? ts.createTextSpanFromNode(location) : undefined; - } function completionInfoFromData(sourceFile, typeChecker, compilerOptions, log, completionData, preferences) { var symbols = completionData.symbols, completionKind = completionData.completionKind, isInSnippetScope = completionData.isInSnippetScope, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, literals = completionData.literals, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer, insideJsDocTagTypeExpression = completionData.insideJsDocTagTypeExpression, symbolToSortTextMap = completionData.symbolToSortTextMap; if (location && location.parent && ts.isJsxClosingElement(location.parent)) { @@ -118587,7 +115733,7 @@ var ts; kindModifiers: undefined, sortText: SortText.LocationPriority, }; - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, optionalReplacementSpan: getOptionalReplacementSpan(location), entries: [entry] }; + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, entries: [entry] }; } var entries = []; if (isUncheckedFile(sourceFile, compilerOptions)) { @@ -118613,15 +115759,9 @@ var ts; } for (var _b = 0, literals_1 = literals; _b < literals_1.length; _b++) { var literal = literals_1[_b]; - entries.push(createCompletionEntryForLiteral(sourceFile, preferences, literal)); + entries.push(createCompletionEntryForLiteral(literal, preferences)); } - return { - isGlobalCompletion: isInSnippetScope, - isMemberCompletion: isMemberCompletionKind(completionKind), - isNewIdentifierLocation: isNewIdentifierLocation, - optionalReplacementSpan: getOptionalReplacementSpan(location), - entries: entries - }; + return { isGlobalCompletion: isInSnippetScope, isMemberCompletion: isMemberCompletionKind(completionKind), isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; } function isUncheckedFile(sourceFile, compilerOptions) { return ts.isSourceFileJS(sourceFile) && !ts.isCheckJsEnabledForFile(sourceFile, compilerOptions); @@ -118655,12 +115795,12 @@ var ts; } }); } - function completionNameForLiteral(sourceFile, preferences, literal) { + function completionNameForLiteral(literal, preferences) { return typeof literal === "object" ? ts.pseudoBigIntToString(literal) + "n" : - ts.isString(literal) ? ts.quote(sourceFile, preferences, literal) : JSON.stringify(literal); + ts.isString(literal) ? ts.quote(literal, preferences) : JSON.stringify(literal); } - function createCompletionEntryForLiteral(sourceFile, preferences, literal) { - return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; + function createCompletionEntryForLiteral(literal, preferences) { + return { name: completionNameForLiteral(literal, preferences), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; } function createCompletionEntry(symbol, sortText, contextToken, location, sourceFile, typeChecker, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, preferences) { var insertText; @@ -118669,13 +115809,13 @@ var ts; var useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess; if (origin && originIsThisType(origin)) { insertText = needsConvertPropertyAccess - ? "this" + (insertQuestionDot ? "?." : "") + "[" + quotePropertyName(sourceFile, preferences, name) + "]" + ? "this" + (insertQuestionDot ? "?." : "") + "[" + quotePropertyName(name, preferences) + "]" : "this" + (insertQuestionDot ? "?." : ".") + name; } // We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790. // Somehow there was a global with a non-identifier name. Hopefully someone will complain about getting a "foo bar" global completion and provide a repro. else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) { - insertText = useBraces ? needsConvertPropertyAccess ? "[" + quotePropertyName(sourceFile, preferences, name) + "]" : "[" + name + "]" : name; + insertText = useBraces ? needsConvertPropertyAccess ? "[" + quotePropertyName(name, preferences) + "]" : "[" + name + "]" : name; if (insertQuestionDot || propertyAccessToConvert.questionDotToken) { insertText = "?." + insertText; } @@ -118731,11 +115871,11 @@ var ts; isPackageJsonImport: originIsPackageJsonImport(origin) || undefined, }; } - function quotePropertyName(sourceFile, preferences, name) { + function quotePropertyName(name, preferences) { if (/^\d+$/.test(name)) { return name; } - return ts.quote(sourceFile, preferences, name); + return ts.quote(name, preferences); } function isRecommendedCompletionMatch(localSymbol, recommendedCompletion, checker) { return localSymbol === recommendedCompletion || @@ -118826,7 +115966,7 @@ var ts; return { type: "request", request: completionData }; } var symbols = completionData.symbols, literals = completionData.literals, location = completionData.location, completionKind = completionData.completionKind, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, previousToken = completionData.previousToken, isJsxInitializer = completionData.isJsxInitializer, isTypeOnlyLocation = completionData.isTypeOnlyLocation; - var literal = ts.find(literals, function (l) { return completionNameForLiteral(sourceFile, preferences, l) === entryId.name; }); + var literal = ts.find(literals, function (l) { return completionNameForLiteral(l, preferences) === entryId.name; }); if (literal !== undefined) return { type: "literal", literal: literal }; // Find the symbol with the matching entry name. @@ -118872,7 +116012,7 @@ var ts; } case "literal": { var literal = symbolCompletion.literal; - return createSimpleDetails(completionNameForLiteral(sourceFile, preferences, literal), "string" /* string */, typeof literal === "string" ? ts.SymbolDisplayPartKind.stringLiteral : ts.SymbolDisplayPartKind.numericLiteral); + return createSimpleDetails(completionNameForLiteral(literal, preferences), "string" /* string */, typeof literal === "string" ? ts.SymbolDisplayPartKind.stringLiteral : ts.SymbolDisplayPartKind.numericLiteral); } case "none": // Didn't find a symbol with this name. See if we can find a keyword instead. @@ -118944,11 +116084,11 @@ var ts; return ts.getContextualTypeFromParent(previousToken, checker); case 62 /* EqualsToken */: switch (parent.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return checker.getContextualType(parent.initializer); // TODO: GH#18217 - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return checker.getTypeAtLocation(parent.left); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent); default: return undefined; @@ -118958,7 +116098,7 @@ var ts; case 81 /* CaseKeyword */: return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); case 18 /* OpenBraceToken */: - return ts.isJsxExpression(parent) && parent.parent.kind !== 273 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + return ts.isJsxExpression(parent) && parent.parent.kind !== 270 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); return argInfo ? @@ -118977,7 +116117,7 @@ var ts; return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 297 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 294 /* SourceFile */; }); } function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId, host) { var typeChecker = program.getTypeChecker(); @@ -119028,11 +116168,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 301 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 298 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 333 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 328 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -119085,7 +116225,7 @@ var ts; isRightOfDot = contextToken.kind === 24 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; if ((ts.isCallExpression(node) || ts.isFunctionLike(node)) && @@ -119098,14 +116238,14 @@ var ts; return undefined; } break; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: node = parent.left; break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: node = parent.name; break; - case 195 /* ImportType */: - case 226 /* MetaProperty */: + case 192 /* ImportType */: + case 223 /* MetaProperty */: node = parent; break; default: @@ -119118,7 +116258,7 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 201 /* PropertyAccessExpression */) { + if (parent && parent.kind === 198 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } @@ -119126,51 +116266,39 @@ var ts; if (currentToken.parent === location) { switch (currentToken.kind) { case 31 /* GreaterThanToken */: - if (currentToken.parent.kind === 273 /* JsxElement */ || currentToken.parent.kind === 275 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 270 /* JsxElement */ || currentToken.parent.kind === 272 /* JsxOpeningElement */) { location = currentToken; } break; case 43 /* SlashToken */: - if (currentToken.parent.kind === 274 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 271 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent.kind) { - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: if (contextToken.kind === 43 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent)) { break; } // falls through - case 274 /* JsxSelfClosingElement */: - case 273 /* JsxElement */: - case 275 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 270 /* JsxElement */: + case 272 /* JsxOpeningElement */: isJsxIdentifierExpected = true; if (contextToken.kind === 29 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 283 /* JsxExpression */: - // For `
`, `parent` will be `{true}` and `previousToken` will be `}` - if (previousToken.kind === 19 /* CloseBraceToken */ && currentToken.kind === 31 /* GreaterThanToken */) { - isJsxIdentifierExpected = true; - } - break; - case 280 /* JsxAttribute */: - // For `
`, `parent` will be JsxAttribute and `previousToken` will be its initializer - if (parent.initializer === previousToken && - previousToken.end < position) { - isJsxIdentifierExpected = true; - break; - } + case 277 /* JsxAttribute */: switch (previousToken.kind) { case 62 /* EqualsToken */: isJsxInitializer = true; @@ -119252,11 +116380,11 @@ var ts; }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 331 /* JSDocTypedefTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 327 /* JSDocTypedefTag */: return true; default: return false; @@ -119272,7 +116400,7 @@ var ts; || ts.isPartOfTypeNode(node.parent) || ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); var isRhsOfImportDeclaration = ts.isInRightSideOfInternalImportEqualsDeclaration(node); - if (ts.isEntityName(node) || isImportType || ts.isPropertyAccessExpression(node)) { + if (ts.isEntityName(node) || isImportType) { var isNamespaceName = ts.isModuleDeclaration(node.parent); if (isNamespaceName) isNewIdentifierLocation = true; @@ -119301,7 +116429,7 @@ var ts; // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). if (!isTypeLocation && symbol.declarations && - symbol.declarations.some(function (d) { return d.kind !== 297 /* SourceFile */ && d.kind !== 256 /* ModuleDeclaration */ && d.kind !== 255 /* EnumDeclaration */; })) { + symbol.declarations.some(function (d) { return d.kind !== 294 /* SourceFile */ && d.kind !== 253 /* ModuleDeclaration */ && d.kind !== 252 /* EnumDeclaration */; })) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); var insertQuestionDot = false; if (type.isNullableType()) { @@ -119348,7 +116476,7 @@ var ts; if (isRightOfQuestionDot && ts.some(type.getCallSignatures())) { isNewIdentifierLocation = true; } - var propertyAccess = node.kind === 195 /* ImportType */ ? node : node.parent; + var propertyAccess = node.kind === 192 /* ImportType */ ? node : node.parent; if (isUncheckedFile) { // In javascript files, for union types, we don't just get the members that // the individual types have in common, we also include all the members that @@ -119361,7 +116489,7 @@ var ts; for (var _i = 0, _a = type.getApparentProperties(); _i < _a.length; _i++) { var symbol = _a[_i]; if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type, symbol)) { - addPropertySymbol(symbol, /* insertAwait */ false, insertQuestionDot); + addPropertySymbol(symbol, /*insertAwait*/ false, insertQuestionDot); } } } @@ -119397,20 +116525,13 @@ var ts; } else if (preferences.includeCompletionsWithInsertText) { addSymbolOriginInfo(symbol); - addSymbolSortInfo(symbol); symbols.push(symbol); } } else { addSymbolOriginInfo(symbol); - addSymbolSortInfo(symbol); symbols.push(symbol); } - function addSymbolSortInfo(symbol) { - if (isStaticProperty(symbol)) { - symbolToSortTextMap[ts.getSymbolId(symbol)] = SortText.LocalDeclarationPriority; - } - } function addSymbolOriginInfo(symbol) { if (preferences.includeCompletionsWithInsertText) { if (insertAwait && !symbolToOriginInfoMap[ts.getSymbolId(symbol)]) { @@ -119512,7 +116633,7 @@ var ts; } } // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 297 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 294 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false); if (thisType && !isProbablyGlobalType(thisType, sourceFile, typeChecker)) { for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) { @@ -119562,10 +116683,10 @@ var ts; } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 297 /* SourceFile */: - case 218 /* TemplateExpression */: - case 283 /* JsxExpression */: - case 230 /* Block */: + case 294 /* SourceFile */: + case 215 /* TemplateExpression */: + case 280 /* JsxExpression */: + case 227 /* Block */: return true; default: return ts.isStatement(scopeNode); @@ -119608,27 +116729,27 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 111 /* TypeOfKeyword */ && - (contextToken.parent.kind === 176 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); + (contextToken.parent.kind === 175 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 58 /* ColonToken */: - return parentKind === 163 /* PropertyDeclaration */ || - parentKind === 162 /* PropertySignature */ || - parentKind === 160 /* Parameter */ || - parentKind === 249 /* VariableDeclaration */ || + return parentKind === 162 /* PropertyDeclaration */ || + parentKind === 161 /* PropertySignature */ || + parentKind === 159 /* Parameter */ || + parentKind === 246 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 62 /* EqualsToken */: - return parentKind === 254 /* TypeAliasDeclaration */; + return parentKind === 251 /* TypeAliasDeclaration */; case 126 /* AsKeyword */: - return parentKind === 224 /* AsExpression */; + return parentKind === 221 /* AsExpression */; case 29 /* LessThanToken */: - return parentKind === 173 /* TypeReference */ || - parentKind === 206 /* TypeAssertionExpression */; + return parentKind === 172 /* TypeReference */ || + parentKind === 203 /* TypeAssertionExpression */; case 93 /* ExtendsKeyword */: - return parentKind === 159 /* TypeParameter */; + return parentKind === 158 /* TypeParameter */; } } return false; @@ -119839,7 +116960,7 @@ var ts; return true; } if (contextToken.kind === 31 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 275 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 272 /* JsxOpeningElement */) { // Two possibilities: // 1.
/**/ // - contextToken: GreaterThanToken (before cursor) @@ -119849,10 +116970,10 @@ var ts; // - contextToken: GreaterThanToken (before cursor) // - location: GreaterThanToken (after cursor) // - same parent (JSXOpeningElement) - return location.parent.kind !== 275 /* JsxOpeningElement */; + return location.parent.kind !== 272 /* JsxOpeningElement */; } - if (contextToken.parent.kind === 276 /* JsxClosingElement */ || contextToken.parent.kind === 274 /* JsxSelfClosingElement */) { - return !!contextToken.parent.parent && contextToken.parent.parent.kind === 273 /* JsxElement */; + if (contextToken.parent.kind === 273 /* JsxClosingElement */ || contextToken.parent.kind === 271 /* JsxSelfClosingElement */) { + return !!contextToken.parent.parent && contextToken.parent.parent.kind === 270 /* JsxElement */; } } return false; @@ -119863,40 +116984,40 @@ var ts; // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(previousToken)) { case 27 /* CommaToken */: - return containingNodeKind === 203 /* CallExpression */ // func( a, | - || containingNodeKind === 166 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 204 /* NewExpression */ // new C(a, | - || containingNodeKind === 199 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 216 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 174 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 200 /* CallExpression */ // func( a, | + || containingNodeKind === 165 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 201 /* NewExpression */ // new C(a, | + || containingNodeKind === 196 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 213 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 173 /* FunctionType */; // var x: (s: string, list| case 20 /* OpenParenToken */: - return containingNodeKind === 203 /* CallExpression */ // func( | - || containingNodeKind === 166 /* Constructor */ // constructor( | - || containingNodeKind === 204 /* NewExpression */ // new C(a| - || containingNodeKind === 207 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 186 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 200 /* CallExpression */ // func( | + || containingNodeKind === 165 /* Constructor */ // constructor( | + || containingNodeKind === 201 /* NewExpression */ // new C(a| + || containingNodeKind === 204 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 185 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 22 /* OpenBracketToken */: - return containingNodeKind === 199 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 171 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 158 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 139 /* ModuleKeyword */: // module | - case 140 /* NamespaceKeyword */: // namespace | + return containingNodeKind === 196 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 170 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 157 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 138 /* ModuleKeyword */: // module | + case 139 /* NamespaceKeyword */: // namespace | return true; case 24 /* DotToken */: - return containingNodeKind === 256 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 253 /* ModuleDeclaration */; // module A.| case 18 /* OpenBraceToken */: - return containingNodeKind === 252 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 249 /* ClassDeclaration */; // class A{ | case 62 /* EqualsToken */: - return containingNodeKind === 249 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 216 /* BinaryExpression */; // x = a| + return containingNodeKind === 246 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 213 /* BinaryExpression */; // x = a| case 15 /* TemplateHead */: - return containingNodeKind === 218 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 215 /* TemplateExpression */; // `aa ${| case 16 /* TemplateMiddle */: - return containingNodeKind === 228 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 225 /* TemplateSpan */; // `aa ${10} dd ${| case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - return containingNodeKind === 163 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 162 /* PropertyDeclaration */; // class A{ public | } } return false; @@ -119923,18 +117044,17 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 200 /* ObjectLiteralExpression */) { - var instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker); - if (instantiatedType === undefined) { + if (objectLikeContainer.kind === 197 /* ObjectLiteralExpression */) { + var instantiatedType = typeChecker.getContextualType(objectLikeContainer); + var completionsType = instantiatedType && typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); + if (!instantiatedType || !completionsType) return 2 /* Fail */; - } - var completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); - isNewIdentifierLocation = ts.hasIndexSignature(completionsType || instantiatedType); + isNewIdentifierLocation = ts.hasIndexSignature(instantiatedType || completionsType); typeMembers = getPropertiesForObjectExpression(instantiatedType, completionsType, objectLikeContainer, typeChecker); existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 196 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 193 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -119945,12 +117065,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 239 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 160 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 236 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 159 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 165 /* MethodDeclaration */ || rootDeclaration.parent.kind === 168 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 164 /* MethodDeclaration */ || rootDeclaration.parent.kind === 167 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -119997,9 +117117,9 @@ var ts; if (!namedImportsOrExports) return 0 /* Continue */; // try to show exported member for imported/re-exported module - var moduleSpecifier = (namedImportsOrExports.kind === 264 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + var moduleSpecifier = (namedImportsOrExports.kind === 261 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; if (!moduleSpecifier) - return namedImportsOrExports.kind === 264 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; + return namedImportsOrExports.kind === 261 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217 if (!moduleSpecifierSymbol) return 2 /* Fail */; @@ -120152,11 +117272,11 @@ var ts; case 30 /* LessThanSlashToken */: case 43 /* SlashToken */: case 78 /* Identifier */: - case 201 /* PropertyAccessExpression */: - case 281 /* JsxAttributes */: - case 280 /* JsxAttribute */: - case 282 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 274 /* JsxSelfClosingElement */ || parent.kind === 275 /* JsxOpeningElement */)) { + case 198 /* PropertyAccessExpression */: + case 278 /* JsxAttributes */: + case 277 /* JsxAttribute */: + case 279 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 271 /* JsxSelfClosingElement */ || parent.kind === 272 /* JsxOpeningElement */)) { if (contextToken.kind === 31 /* GreaterThanToken */) { var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); if (!parent.typeArguments || (precedingToken && precedingToken.kind === 43 /* SlashToken */)) @@ -120164,7 +117284,7 @@ var ts; } return parent; } - else if (parent.kind === 280 /* JsxAttribute */) { + else if (parent.kind === 277 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -120176,7 +117296,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 10 /* StringLiteral */: - if (parent && ((parent.kind === 280 /* JsxAttribute */) || (parent.kind === 282 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 277 /* JsxAttribute */) || (parent.kind === 279 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -120186,8 +117306,8 @@ var ts; break; case 19 /* CloseBraceToken */: if (parent && - parent.kind === 283 /* JsxExpression */ && - parent.parent && parent.parent.kind === 280 /* JsxAttribute */) { + parent.kind === 280 /* JsxExpression */ && + parent.parent && parent.parent.kind === 277 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -120195,7 +117315,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 282 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 279 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -120215,51 +117335,51 @@ var ts; var containingNodeKind = parent.kind; switch (contextToken.kind) { case 27 /* CommaToken */: - return containingNodeKind === 249 /* VariableDeclaration */ || + return containingNodeKind === 246 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken) || - containingNodeKind === 232 /* VariableStatement */ || - containingNodeKind === 255 /* EnumDeclaration */ || // enum a { foo, | + containingNodeKind === 229 /* VariableStatement */ || + containingNodeKind === 252 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 253 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 24 /* DotToken */: - return containingNodeKind === 197 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 194 /* ArrayBindingPattern */; // var [.| case 58 /* ColonToken */: - return containingNodeKind === 198 /* BindingElement */; // var {x :html| + return containingNodeKind === 195 /* BindingElement */; // var {x :html| case 22 /* OpenBracketToken */: - return containingNodeKind === 197 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 194 /* ArrayBindingPattern */; // var [x| case 20 /* OpenParenToken */: - return containingNodeKind === 287 /* CatchClause */ || + return containingNodeKind === 284 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 18 /* OpenBraceToken */: - return containingNodeKind === 255 /* EnumDeclaration */; // enum a { | + return containingNodeKind === 252 /* EnumDeclaration */; // enum a { | case 29 /* LessThanToken */: - return containingNodeKind === 252 /* ClassDeclaration */ || // class A< | - containingNodeKind === 221 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 253 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 254 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 249 /* ClassDeclaration */ || // class A< | + containingNodeKind === 218 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 250 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 251 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 123 /* StaticKeyword */: - return containingNodeKind === 163 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); + return containingNodeKind === 162 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); case 25 /* DotDotDotToken */: - return containingNodeKind === 160 /* Parameter */ || - (!!parent.parent && parent.parent.kind === 197 /* ArrayBindingPattern */); // var [...z| + return containingNodeKind === 159 /* Parameter */ || + (!!parent.parent && parent.parent.kind === 194 /* ArrayBindingPattern */); // var [...z| case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - return containingNodeKind === 160 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); + return containingNodeKind === 159 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); case 126 /* AsKeyword */: - return containingNodeKind === 265 /* ImportSpecifier */ || - containingNodeKind === 270 /* ExportSpecifier */ || - containingNodeKind === 263 /* NamespaceImport */; + return containingNodeKind === 262 /* ImportSpecifier */ || + containingNodeKind === 267 /* ExportSpecifier */ || + containingNodeKind === 260 /* NamespaceImport */; case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken); case 83 /* ClassKeyword */: case 91 /* EnumKeyword */: @@ -120269,7 +117389,7 @@ var ts; case 99 /* ImportKeyword */: case 118 /* LetKeyword */: case 84 /* ConstKeyword */: - case 149 /* TypeKeyword */: // type htm| + case 148 /* TypeKeyword */: // type htm| return true; case 41 /* AsteriskToken */: return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent); @@ -120316,7 +117436,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 166 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 165 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -120326,7 +117446,7 @@ var ts; return false; } function isVariableDeclarationListButNotTypeArgument(node) { - return node.parent.kind === 250 /* VariableDeclarationList */ + return node.parent.kind === 247 /* VariableDeclarationList */ && !ts.isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker); } /** @@ -120344,13 +117464,13 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 288 /* PropertyAssignment */ && - m.kind !== 289 /* ShorthandPropertyAssignment */ && - m.kind !== 198 /* BindingElement */ && - m.kind !== 165 /* MethodDeclaration */ && - m.kind !== 167 /* GetAccessor */ && - m.kind !== 168 /* SetAccessor */ && - m.kind !== 290 /* SpreadAssignment */) { + if (m.kind !== 285 /* PropertyAssignment */ && + m.kind !== 286 /* ShorthandPropertyAssignment */ && + m.kind !== 195 /* BindingElement */ && + m.kind !== 164 /* MethodDeclaration */ && + m.kind !== 166 /* GetAccessor */ && + m.kind !== 167 /* SetAccessor */ && + m.kind !== 287 /* SpreadAssignment */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -120423,10 +117543,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 163 /* PropertyDeclaration */ && - m.kind !== 165 /* MethodDeclaration */ && - m.kind !== 167 /* GetAccessor */ && - m.kind !== 168 /* SetAccessor */) { + if (m.kind !== 162 /* PropertyDeclaration */ && + m.kind !== 164 /* MethodDeclaration */ && + m.kind !== 166 /* GetAccessor */ && + m.kind !== 167 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -120468,7 +117588,7 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 280 /* JsxAttribute */) { + if (attr.kind === 277 /* JsxAttribute */) { seenNames.add(attr.name.escapedText); } else if (ts.isJsxSpreadAttribute(attr)) { @@ -120518,7 +117638,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 80 /* FirstKeyword */; i <= 156 /* LastKeyword */; i++) { + for (var i = 80 /* FirstKeyword */; i <= 155 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -120545,10 +117665,11 @@ var ts; case 1 /* All */: return isFunctionLikeBodyKeyword(kind) || kind === 133 /* DeclareKeyword */ - || kind === 139 /* ModuleKeyword */ - || kind === 149 /* TypeKeyword */ - || kind === 140 /* NamespaceKeyword */ - || ts.isTypeKeyword(kind) && kind !== 150 /* UndefinedKeyword */; + || kind === 138 /* ModuleKeyword */ + || kind === 148 /* TypeKeyword */ + || kind === 139 /* NamespaceKeyword */ + || kind === 126 /* AsKeyword */ + || ts.isTypeKeyword(kind) && kind !== 149 /* UndefinedKeyword */; case 5 /* FunctionLikeBodyKeywords */: return isFunctionLikeBodyKeyword(kind); case 2 /* ClassElementKeywords */: @@ -120570,44 +117691,44 @@ var ts; switch (kind) { case 125 /* AbstractKeyword */: case 128 /* AnyKeyword */: - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: case 133 /* DeclareKeyword */: case 91 /* EnumKeyword */: - case 154 /* GlobalKeyword */: + case 153 /* GlobalKeyword */: case 116 /* ImplementsKeyword */: case 135 /* InferKeyword */: case 117 /* InterfaceKeyword */: - case 137 /* IsKeyword */: - case 138 /* KeyOfKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: - case 141 /* NeverKeyword */: - case 144 /* NumberKeyword */: - case 145 /* ObjectKeyword */: + case 136 /* IsKeyword */: + case 137 /* KeyOfKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: + case 140 /* NeverKeyword */: + case 143 /* NumberKeyword */: + case 144 /* ObjectKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 122 /* PublicKeyword */: - case 142 /* ReadonlyKeyword */: - case 147 /* StringKeyword */: - case 148 /* SymbolKeyword */: - case 149 /* TypeKeyword */: - case 151 /* UniqueKeyword */: - case 152 /* UnknownKeyword */: + case 141 /* ReadonlyKeyword */: + case 146 /* StringKeyword */: + case 147 /* SymbolKeyword */: + case 148 /* TypeKeyword */: + case 150 /* UniqueKeyword */: + case 151 /* UnknownKeyword */: return true; default: return false; } } function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 142 /* ReadonlyKeyword */; + return kind === 141 /* ReadonlyKeyword */; } function isClassMemberCompletionKeyword(kind) { switch (kind) { case 125 /* AbstractKeyword */: case 132 /* ConstructorKeyword */: case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: case 129 /* AsyncKeyword */: case 133 /* DeclareKeyword */: return true; @@ -120618,7 +117739,6 @@ var ts; function isFunctionLikeBodyKeyword(kind) { return kind === 129 /* AsyncKeyword */ || kind === 130 /* AwaitKeyword */ - || kind === 126 /* AsKeyword */ || !ts.isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } function keywordForNode(node) { @@ -120669,7 +117789,7 @@ var ts; function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { // class c { method() { } | method2() { } } switch (location.kind) { - case 334 /* SyntaxList */: + case 329 /* SyntaxList */: return ts.tryCast(location.parent, ts.isObjectTypeDeclaration); case 1 /* EndOfFileToken */: var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration); @@ -120772,19 +117892,6 @@ var ts; } return false; } - function isStaticProperty(symbol) { - return !!(symbol.valueDeclaration && ts.getEffectiveModifierFlags(symbol.valueDeclaration) & 32 /* Static */ && ts.isClassLike(symbol.valueDeclaration.parent)); - } - function tryGetObjectLiteralContextualType(node, typeChecker) { - var type = typeChecker.getContextualType(node); - if (type) { - return type; - } - if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 62 /* EqualsToken */) { - return typeChecker.getTypeAtLocation(node.parent); - } - return undefined; - } })(Completions = ts.Completions || (ts.Completions = {})); })(ts || (ts = {})); var ts; @@ -120868,8 +117975,8 @@ var ts; case 132 /* ConstructorKeyword */: return getFromAllDeclarations(ts.isConstructorDeclaration, [132 /* ConstructorKeyword */]); case 134 /* GetKeyword */: - case 146 /* SetKeyword */: - return getFromAllDeclarations(ts.isAccessor, [134 /* GetKeyword */, 146 /* SetKeyword */]); + case 145 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [134 /* GetKeyword */, 145 /* SetKeyword */]); case 130 /* AwaitKeyword */: return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences); case 129 /* AsyncKeyword */: @@ -120917,7 +118024,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 297 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 294 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has @@ -120949,16 +118056,16 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 244 /* SwitchStatement */: - if (statement.kind === 240 /* ContinueStatement */) { + case 241 /* SwitchStatement */: + if (statement.kind === 237 /* ContinueStatement */) { return false; } // falls through - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 236 /* WhileStatement */: - case 235 /* DoStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 233 /* WhileStatement */: + case 232 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. @@ -120974,11 +118081,11 @@ var ts; // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 257 /* ModuleBlock */: - case 297 /* SourceFile */: - case 230 /* Block */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 254 /* ModuleBlock */: + case 294 /* SourceFile */: + case 227 /* Block */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return __spreadArrays(declaration.members, [declaration]); @@ -120986,14 +118093,14 @@ var ts; else { return container.statements; } - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : [])); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 177 /* TypeLiteral */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 176 /* TypeLiteral */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -121007,9 +118114,6 @@ var ts; return __spreadArrays(nodes, [container]); } return nodes; - // Syntactically invalid positions that the parser might produce anyway - case 200 /* ObjectLiteralExpression */: - return undefined; default: ts.Debug.assertNever(container, "Invalid container kind."); } @@ -121029,7 +118133,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 96 /* ForKeyword */, 114 /* WhileKeyword */, 89 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 235 /* DoStatement */) { + if (loopNode.kind === 232 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 114 /* WhileKeyword */)) { @@ -121049,13 +118153,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -121422,39 +118526,41 @@ var ts; if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 249 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 246 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 78 /* Identifier */) { directImports.push(name); break; } } + // Don't support re-exporting 'require()' calls, so just add a single indirect user. + addIndirectUser(direct.getSourceFile()); } break; case 78 /* Identifier */: // for 'const x = require("y"); break; // TODO: GH#23879 - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasSyntacticModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false); break; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: directImports.push(direct); var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 263 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 260 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name, /*isReExport*/ false, /*alreadyAddedDirect*/ true); } else if (!isAvailableThroughGlobal && ts.isDefaultImport(direct)) { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); // Add a check for indirect uses to handle synthetic default imports } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); } - else if (direct.exportClause.kind === 269 /* NamespaceExport */) { + else if (direct.exportClause.kind === 266 /* NamespaceExport */) { // `export * as foo from "foo"` add to indirect uses addIndirectUsers(getSourceFileLikeForImportDeclaration(direct)); } @@ -121463,7 +118569,7 @@ var ts; directImports.push(direct); } break; - case 195 /* ImportType */: + case 192 /* ImportType */: directImports.push(direct); break; default: @@ -121480,7 +118586,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 297 /* SourceFile */ || sourceFileLike.kind === 256 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 294 /* SourceFile */ || sourceFileLike.kind === 253 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -121537,7 +118643,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 260 /* ImportEqualsDeclaration */) { + if (decl.kind === 257 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -121547,7 +118653,7 @@ var ts; handleNamespaceImportLike(decl); return; } - if (decl.kind === 195 /* ImportType */) { + if (decl.kind === 192 /* ImportType */) { if (decl.qualifier) { var firstIdentifier = ts.getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === ts.symbolName(exportSymbol)) { @@ -121563,7 +118669,7 @@ var ts; if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) { return; } - if (decl.kind === 267 /* ExportDeclaration */) { + if (decl.kind === 264 /* ExportDeclaration */) { if (decl.exportClause && ts.isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -121572,10 +118678,10 @@ var ts; var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: // 'default' might be accessed as a named import `{ default as foo }`. if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); @@ -121625,7 +118731,7 @@ var ts; } } else { - var localSymbol = element.kind === 270 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 267 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -121654,7 +118760,7 @@ var ts; for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { var referencingFile = sourceFiles_1[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 297 /* SourceFile */) { + if (searchSourceFile.kind === 294 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -121702,7 +118808,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 297 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 294 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -121717,15 +118823,15 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 267 /* ExportDeclaration */: - case 261 /* ImportDeclaration */: { + case 264 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 260 /* ImportEqualsDeclaration */: { + case 257 /* ImportEqualsDeclaration */: { var decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -121749,7 +118855,7 @@ var ts; var parent = node.parent; var grandParent = parent.parent; if (symbol.exportSymbol) { - if (parent.kind === 201 /* PropertyAccessExpression */) { + if (parent.kind === 198 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent) @@ -121882,17 +118988,15 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return !parent.propertyName; - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return true; - case 198 /* BindingElement */: - return ts.isInJSFile(node) && ts.isRequireVariableDeclaration(parent, /*requireStringLiteralLikeArgument*/ true); default: return false; } @@ -121915,14 +119019,6 @@ var ts; if (ts.isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) { return checker.getExportSpecifierLocalTargetSymbol(declaration); } - else if (ts.isPropertyAccessExpression(declaration) && ts.isModuleExportsAccessExpression(declaration.expression) && !ts.isPrivateIdentifier(declaration.name)) { - return checker.getExportSpecifierLocalTargetSymbol(declaration.name); - } - else if (ts.isShorthandPropertyAssignment(declaration) - && ts.isBinaryExpression(declaration.parent.parent) - && ts.getAssignmentDeclarationKind(declaration.parent.parent) === 2 /* ModuleExports */) { - return checker.getExportSpecifierLocalTargetSymbol(declaration.name); - } } } return symbol; @@ -121931,21 +119027,21 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 297 /* SourceFile */) { + if (parent.kind === 294 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 257 /* ModuleBlock */); + ts.Debug.assert(parent.kind === 254 /* ModuleBlock */); return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; + return node.kind === 253 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 272 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; + return eq.moduleReference.kind === 269 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -122047,7 +119143,7 @@ var ts; if (!node) return undefined; switch (node.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return !ts.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : ts.isVariableStatement(node.parent.parent) ? @@ -122055,28 +119151,28 @@ var ts; ts.isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getContextNode(node.parent.parent); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return node.parent.parent.parent; - case 270 /* ExportSpecifier */: - case 263 /* NamespaceImport */: + case 267 /* ExportSpecifier */: + case 260 /* NamespaceImport */: return node.parent.parent; - case 262 /* ImportClause */: - case 269 /* NamespaceExport */: + case 259 /* ImportClause */: + case 266 /* NamespaceExport */: return node.parent; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return ts.isExpressionStatement(node.parent) ? node.parent : node; - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(ts.findAncestor(node.parent, function (node) { return ts.isBinaryExpression(node) || ts.isForInOrOfStatement(node); @@ -122133,9 +119229,9 @@ var ts; var node = ts.getTouchingPropertyName(sourceFile, position); var referenceEntries; var entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); - if (node.parent.kind === 201 /* PropertyAccessExpression */ - || node.parent.kind === 198 /* BindingElement */ - || node.parent.kind === 202 /* ElementAccessExpression */ + if (node.parent.kind === 198 /* PropertyAccessExpression */ + || node.parent.kind === 195 /* BindingElement */ + || node.parent.kind === 199 /* ElementAccessExpression */ || node.kind === 105 /* SuperKeyword */) { referenceEntries = entries && __spreadArrays(entries); } @@ -122159,13 +119255,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 286 /* ShorthandPropertyAssignment */) { var result_1 = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); }); return result_1; @@ -122331,13 +119427,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 200 /* ObjectLiteralExpression */) { + else if (node.kind === 197 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(21 /* CloseParenToken */)] }; } - else if (node.kind === 221 /* ClassExpression */) { + else if (node.kind === 218 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(21 /* CloseParenToken */)] @@ -122398,47 +119494,47 @@ var ts; if (!!(decl.flags & 8388608 /* Ambient */)) return true; switch (decl.kind) { - case 216 /* BinaryExpression */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 213 /* BinaryExpression */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: case 87 /* DefaultKeyword */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 270 /* ExportSpecifier */: - case 262 /* ImportClause */: // default import - case 260 /* ImportEqualsDeclaration */: - case 265 /* ImportSpecifier */: - case 253 /* InterfaceDeclaration */: - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 280 /* JsxAttribute */: - case 256 /* ModuleDeclaration */: - case 259 /* NamespaceExportDeclaration */: - case 263 /* NamespaceImport */: - case 269 /* NamespaceExport */: - case 160 /* Parameter */: - case 289 /* ShorthandPropertyAssignment */: - case 254 /* TypeAliasDeclaration */: - case 159 /* TypeParameter */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 267 /* ExportSpecifier */: + case 259 /* ImportClause */: // default import + case 257 /* ImportEqualsDeclaration */: + case 262 /* ImportSpecifier */: + case 250 /* InterfaceDeclaration */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 277 /* JsxAttribute */: + case 253 /* ModuleDeclaration */: + case 256 /* NamespaceExportDeclaration */: + case 260 /* NamespaceImport */: + case 266 /* NamespaceExport */: + case 159 /* Parameter */: + case 286 /* ShorthandPropertyAssignment */: + case 251 /* TypeAliasDeclaration */: + case 158 /* TypeParameter */: return true; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.) return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return !!decl.body; - case 249 /* VariableDeclaration */: - case 163 /* PropertyDeclaration */: + case 246 /* VariableDeclaration */: + case 162 /* PropertyDeclaration */: return !!decl.initializer || ts.isCatchClause(decl.parent); - case 164 /* MethodSignature */: - case 162 /* PropertySignature */: - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: + case 163 /* MethodSignature */: + case 161 /* PropertySignature */: + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: return false; default: return ts.Debug.failBadSyntaxKind(decl); @@ -122599,10 +119695,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -122631,9 +119727,9 @@ var ts; } /** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */ function isReadonlyTypeOperator(node) { - return node.kind === 142 /* ReadonlyKeyword */ + return node.kind === 141 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(node.parent) - && node.parent.operator === 142 /* ReadonlyKeyword */; + && node.parent.operator === 141 /* ReadonlyKeyword */; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -122644,12 +119740,12 @@ var ts; } // A modifier readonly (like on a property declaration) is not special; // a readonly type keyword (like `readonly string[]`) is. - if (node.kind === 142 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { + if (node.kind === 141 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { return undefined; } // Likewise, when we *are* looking for a special keyword, make sure we // *don’t* include readonly member modifiers. - return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 142 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 141 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); } // Labels if (ts.isJumpStatementTarget(node)) { @@ -122950,7 +120046,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 208 /* FunctionExpression */ || valueDeclaration.kind === 221 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 205 /* FunctionExpression */ || valueDeclaration.kind === 218 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -122960,7 +120056,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasEffectiveModifier(d, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(d); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 252 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 249 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -122989,7 +120085,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 297 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 294 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -123361,14 +120457,14 @@ var ts; for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var ctrKeyword = ts.findChildOfKind(decl, 132 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 166 /* Constructor */ && !!ctrKeyword); + ts.Debug.assert(decl.kind === 165 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 165 /* MethodDeclaration */) { + if (decl && decl.kind === 164 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 107 /* ThisKeyword */, function (thisKeyword) { @@ -123392,7 +120488,7 @@ var ts; } for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 166 /* Constructor */); + ts.Debug.assert(decl.kind === 165 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 105 /* SuperKeyword */, function (node) { @@ -123422,7 +120518,7 @@ var ts; if (refNode.kind !== 78 /* Identifier */) { return; } - if (refNode.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 286 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -123442,7 +120538,7 @@ var ts; } else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) { var body = typeHavingNode.body; - if (body.kind === 230 /* Block */) { + if (body.kind === 227 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -123470,13 +120566,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: - case 200 /* ObjectLiteralExpression */: - case 221 /* ClassExpression */: - case 199 /* ArrayLiteralExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 197 /* ObjectLiteralExpression */: + case 218 /* ClassExpression */: + case 196 /* ArrayLiteralExpression */: return true; default: return false; @@ -123529,13 +120625,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: staticFlag &= ts.getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -123556,41 +120652,41 @@ var ts; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } function isParameterName(node) { - return node.kind === 78 /* Identifier */ && node.parent.kind === 160 /* Parameter */ && node.parent.name === node; + return node.kind === 78 /* Identifier */ && node.parent.kind === 159 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: staticFlag &= ts.getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return undefined; } - var references = ts.flatMap(searchSpaceNode.kind === 297 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { + var references = ts.flatMap(searchSpaceNode.kind === 294 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) { if (!ts.isThis(node)) { @@ -123598,19 +120694,19 @@ var ts; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getSyntacticModifierFlags(container) & 32 /* Static */) === staticFlag; - case 297 /* SourceFile */: - return container.kind === 297 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); + case 294 /* SourceFile */: + return container.kind === 294 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return nodeEntry(n); }); @@ -123709,7 +120805,7 @@ var ts; ts.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); // is [parameter, property] return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - var exportSpecifier = ts.getDeclarationOfKind(symbol, 270 /* ExportSpecifier */); + var exportSpecifier = ts.getDeclarationOfKind(symbol, 267 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -123754,7 +120850,7 @@ var ts; }); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { - var bindingElement = ts.getDeclarationOfKind(symbol, 198 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 195 /* BindingElement */); if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { return ts.getPropertySymbolFromBindingElement(checker, bindingElement); } @@ -123981,16 +121077,16 @@ var ts; return; } switch (node.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: - if (node.parent.kind === 200 /* ObjectLiteralExpression */) { + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: + if (node.parent.kind === 197 /* ObjectLiteralExpression */) { return (_a = ts.getAssignedName(node.parent)) === null || _a === void 0 ? void 0 : _a.getText(); } return (_b = ts.getNameOfDeclaration(node.parent)) === null || _b === void 0 ? void 0 : _b.getText(); - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: if (ts.isModuleBlock(node.parent) && ts.isIdentifier(node.parent.parent.name)) { return node.parent.parent.name.getText(); } @@ -124196,55 +121292,55 @@ var ts; } switch (node.kind) { case 78 /* Identifier */: - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: // do not descend into nodes that cannot contain callable nodes return; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: // do not descend into the type side of an assertion collect(node.expression); return; - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: // do not descend into the type of a variable or parameter declaration collect(node.name); collect(node.initializer); return; - case 203 /* CallExpression */: + case 200 /* CallExpression */: // do not descend into the type arguments of a call expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 204 /* NewExpression */: + case 201 /* NewExpression */: // do not descend into the type arguments of a new expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: // do not descend into the type arguments of a tagged template expression recordCallSite(node); collect(node.tag); collect(node.template); return; - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: // do not descend into the type arguments of a JsxOpeningLikeElement recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 161 /* Decorator */: + case 160 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: recordCallSite(node); ts.forEachChild(node, collect); break; @@ -124294,22 +121390,22 @@ var ts; var callSites = []; var collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; default: @@ -124590,7 +121686,9 @@ var ts; var sigInfo = createDefinitionFromSignatureDeclaration(typeChecker, calledDeclaration); // For a function, if this is the original function definition, return just sigInfo. // If this is the original constructor definition, parent is the class. - if (typeChecker.getRootSymbols(symbol).some(function (s) { return symbolMatchesSignature(s, calledDeclaration); })) { + if (typeChecker.getRootSymbols(symbol).some(function (s) { return symbolMatchesSignature(s, calledDeclaration); }) || + // TODO: GH#25533 Following check shouldn't be necessary if 'require' is an alias + symbol.declarations && symbol.declarations.some(function (d) { return ts.isVariableDeclaration(d) && !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ false); })) { return [sigInfo]; } else { @@ -124604,7 +121702,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 286 /* ShorthandPropertyAssignment */) { var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : []; } @@ -124649,11 +121747,6 @@ var ts; return getDefinitionFromSymbol(typeChecker, symbol, node); } GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition; - function isShorthandPropertyAssignmentOfModuleExports(symbol) { - var shorthandProperty = ts.tryCast(symbol.valueDeclaration, ts.isShorthandPropertyAssignment); - var binaryExpression = ts.tryCast(shorthandProperty === null || shorthandProperty === void 0 ? void 0 : shorthandProperty.parent.parent, ts.isAssignmentExpression); - return !!binaryExpression && ts.getAssignmentDeclarationKind(binaryExpression) === 2 /* ModuleExports */; - } /** * True if we should not add definitions for both the signature symbol and the definition symbol. * True for `const |f = |() => 0`, false for `function |f() {} const |g = f;`. @@ -124751,24 +121844,19 @@ var ts; // get the aliased symbol instead. This allows for goto def on an import e.g. // import {A, B} from "mod"; // to jump to the implementation directly. - while (symbol) { - if (symbol.flags & 2097152 /* Alias */ && shouldSkipAlias(node, symbol.declarations[0])) { - var aliased = checker.getAliasedSymbol(symbol); - if (!aliased.declarations) { - break; - } - symbol = aliased; + if (symbol && symbol.flags & 2097152 /* Alias */ && shouldSkipAlias(node, symbol.declarations[0])) { + var aliased = checker.getAliasedSymbol(symbol); + if (aliased.declarations) { + return aliased; } - else if (isShorthandPropertyAssignmentOfModuleExports(symbol)) { - // Skip past `module.exports = { Foo }` even though 'Foo' is not a real alias - var shorthandTarget = checker.resolveName(symbol.name, symbol.valueDeclaration, 111551 /* Value */, /*excludeGlobals*/ false); - if (!ts.some(shorthandTarget === null || shorthandTarget === void 0 ? void 0 : shorthandTarget.declarations)) { - break; + } + if (symbol && ts.isInJSFile(node)) { + var requireCall = ts.forEach(symbol.declarations, function (d) { return ts.isVariableDeclaration(d) && !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true) ? d.initializer : undefined; }); + if (requireCall) { + var moduleSymbol = checker.getSymbolAtLocation(requireCall.arguments[0]); + if (moduleSymbol) { + return checker.resolveExternalModuleSymbol(moduleSymbol); } - symbol = shorthandTarget; - } - else { - break; } } return symbol; @@ -124786,14 +121874,11 @@ var ts; return true; } switch (declaration.kind) { - case 262 /* ImportClause */: - case 260 /* ImportEqualsDeclaration */: + case 259 /* ImportClause */: + case 257 /* ImportEqualsDeclaration */: return true; - case 265 /* ImportSpecifier */: - return declaration.parent.kind === 264 /* NamedImports */; - case 198 /* BindingElement */: - case 249 /* VariableDeclaration */: - return ts.isInJSFile(declaration) && ts.isRequireVariableDeclaration(declaration, /*requireStringLiteralLikeArgument*/ true); + case 262 /* ImportSpecifier */: + return declaration.parent.kind === 261 /* NamedImports */; default: return false; } @@ -124878,9 +121963,9 @@ var ts; } function isConstructorLike(node) { switch (node.kind) { - case 166 /* Constructor */: - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 165 /* Constructor */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: return true; default: return false; @@ -124995,11 +122080,11 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return [declaration]; - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: return [declaration, declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -125020,19 +122105,18 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return withNode(tag.class); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return withNode(tag.class); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 329 /* JSDocTypeTag */: + case 325 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: - case 332 /* JSDocSeeTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -125054,7 +122138,7 @@ var ts; name: tagName, kind: "keyword" /* keyword */, kindModifiers: "", - sortText: ts.Completions.SortText.LocationPriority, + sortText: "0", }; })); } @@ -125066,7 +122150,7 @@ var ts; name: "@" + tagName, kind: "keyword" /* keyword */, kindModifiers: "", - sortText: ts.Completions.SortText.LocationPriority + sortText: "0" }; })); } @@ -125100,7 +122184,7 @@ var ts; || nameThusFar !== undefined && !ts.startsWith(name, nameThusFar)) { return undefined; } - return { name: name, kind: "parameter" /* parameterElement */, kindModifiers: "", sortText: ts.Completions.SortText.LocationPriority }; + return { name: name, kind: "parameter" /* parameterElement */, kindModifiers: "", sortText: "0" }; }); } JsDoc.getJSDocParameterNameCompletions = getJSDocParameterNameCompletions; @@ -125201,24 +122285,23 @@ var ts; } function getCommentOwnerInfoWorker(commentOwner) { switch (commentOwner.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 164 /* MethodSignature */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 163 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer); - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 162 /* PropertySignature */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 254 /* TypeAliasDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 161 /* PropertySignature */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 251 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 232 /* VariableStatement */: { + case 229 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -125226,16 +122309,16 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 297 /* SourceFile */: + case 294 /* SourceFile */: return "quit"; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 256 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 233 /* ExpressionStatement */: + return commentOwner.parent.kind === 253 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 230 /* ExpressionStatement */: return getCommentOwnerInfoWorker(commentOwner.expression); - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var be = commentOwner; if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; @@ -125243,7 +122326,7 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: var init = commentOwner.initializer; if (init && (ts.isFunctionExpression(init) || ts.isArrowFunction(init))) { return { commentOwner: commentOwner, parameters: init.parameters }; @@ -125259,14 +122342,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 207 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 204 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return rightHandSide.parameters; - case 221 /* ClassExpression */: { + case 218 /* ClassExpression */: { var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration); return ctr ? ctr.parameters : ts.emptyArray; } @@ -125328,9 +122411,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 262 /* ImportClause */: - case 265 /* ImportSpecifier */: - case 260 /* ImportEqualsDeclaration */: + case 259 /* ImportClause */: + case 262 /* ImportSpecifier */: + case 257 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217 var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -125340,7 +122423,7 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { var name = ts.getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 158 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 157 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } // Only added the names of computed properties if they're simple dotted expressions, like: // @@ -125357,7 +122440,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name && name.kind === 158 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 157 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return ts.emptyArray; } // Don't include the last portion. @@ -125565,7 +122648,7 @@ var ts; return; } switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -125577,21 +122660,21 @@ var ts; } } break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 163 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -125603,7 +122686,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 263 /* NamespaceImport */) { + if (namedBindings.kind === 260 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -125614,17 +122697,17 @@ var ts; } } break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: var expression = node.expression; // Use the expression as the name of the SpreadAssignment, otherwise show as . ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 198 /* BindingElement */: - case 288 /* PropertyAssignment */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 285 /* PropertyAssignment */: + case 246 /* VariableDeclaration */: var _e = node, name = _e.name, initializer = _e.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -125639,7 +122722,7 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: var nameNode = node.name; // If we see a function declaration track as a possible ES5 class if (nameNode && ts.isIdentifier(nameNode)) { @@ -125647,11 +122730,11 @@ var ts; } addNodeWithRecursiveChild(node, node.body); break; - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -125661,9 +122744,9 @@ var ts; } endNode(); break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: startNode(node); for (var _h = 0, _j = node.members; _h < _j.length; _h++) { var member = _j[_h]; @@ -125671,12 +122754,12 @@ var ts; } endNode(); break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { var expression_1 = node.expression; - var child = ts.isObjectLiteralExpression(expression_1) || ts.isCallExpression(expression_1) ? expression_1 : + var child = ts.isObjectLiteralExpression(expression_1) ? expression_1 : ts.isArrowFunction(expression_1) || ts.isFunctionExpression(expression_1) ? expression_1.body : undefined; if (child) { startNode(node); @@ -125688,16 +122771,16 @@ var ts; } break; } - case 270 /* ExportSpecifier */: - case 260 /* ImportEqualsDeclaration */: - case 171 /* IndexSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 254 /* TypeAliasDeclaration */: + case 267 /* ExportSpecifier */: + case 257 /* ImportEqualsDeclaration */: + case 170 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 251 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 203 /* CallExpression */: - case 216 /* BinaryExpression */: { + case 200 /* CallExpression */: + case 213 /* BinaryExpression */: { var special = ts.getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -125939,12 +123022,12 @@ var ts; return false; } switch (a.kind) { - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return ts.hasSyntacticModifier(a, 32 /* Static */) === ts.hasSyntacticModifier(b, 32 /* Static */); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -125960,7 +123043,7 @@ var ts; // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { // TODO: GH#18217 - return a.body.kind === b.body.kind && (a.body.kind !== 256 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 253 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -125990,7 +123073,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 256 /* ModuleDeclaration */) { + if (node.kind === 253 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -125999,16 +123082,16 @@ var ts; return propertyName && ts.unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 221 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 218 /* ClassExpression */: return getFunctionOrClassName(node); default: return undefined; } } function getItemName(node, name) { - if (node.kind === 256 /* ModuleDeclaration */) { + if (node.kind === 253 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -126020,18 +123103,18 @@ var ts; } } switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 209 /* ArrowFunction */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: if (ts.getSyntacticModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -126039,13 +123122,13 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return "constructor"; - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return "new()"; - case 169 /* CallSignature */: + case 168 /* CallSignature */: return "()"; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return "[]"; default: return ""; @@ -126078,19 +123161,19 @@ var ts; } // Some nodes are otherwise important enough to always include in the primary navigation menu. switch (navigationBarNodeKind(item)) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 255 /* EnumDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 297 /* SourceFile */: - case 254 /* TypeAliasDeclaration */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 252 /* EnumDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 294 /* SourceFile */: + case 251 /* TypeAliasDeclaration */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: return true; - case 209 /* ArrowFunction */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -126100,10 +123183,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 257 /* ModuleBlock */: - case 297 /* SourceFile */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: + case 254 /* ModuleBlock */: + case 294 /* SourceFile */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: return true; default: return false; @@ -126161,8 +123244,9 @@ var ts; return ts.getTextOfNode(moduleDeclaration.name); } // Otherwise, we need to aggregate each identifier to build up the qualified name. - var result = [ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)]; - while (moduleDeclaration.body && moduleDeclaration.body.kind === 256 /* ModuleDeclaration */) { + var result = []; + result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); + while (moduleDeclaration.body && moduleDeclaration.body.kind === 253 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -126176,13 +123260,13 @@ var ts; return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 158 /* ComputedPropertyName */; + return !member.name || member.name.kind === 157 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 297 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 294 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 249 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 246 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -126240,9 +123324,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: return true; default: return false; @@ -126596,11 +123680,11 @@ var ts; function getModuleSpecifierExpression(declaration) { var _a; switch (declaration.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return (_a = ts.tryCast(declaration.moduleReference, ts.isExternalModuleReference)) === null || _a === void 0 ? void 0 : _a.expression; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return declaration.moduleSpecifier; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return declaration.declarationList.declarations[0].initializer.arguments[0]; } } @@ -126639,19 +123723,19 @@ var ts; function getImportKindOrder(s1) { var _a; switch (s1.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: if (!s1.importClause) return 0; if (s1.importClause.isTypeOnly) return 1; - if (((_a = s1.importClause.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 263 /* NamespaceImport */) + if (((_a = s1.importClause.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 260 /* NamespaceImport */) return 2; if (s1.importClause.name) return 3; return 4; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return 5; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return 6; } } @@ -126697,9 +123781,12 @@ var ts; if (depthRemaining === 0) return; cancellationToken.throwIfCancellationRequested(); - if (ts.isDeclaration(n) || ts.isVariableStatement(n) || n.kind === 1 /* EndOfFileToken */) { + if (ts.isDeclaration(n) || n.kind === 1 /* EndOfFileToken */) { addOutliningForLeadingCommentsForNode(n, sourceFile, cancellationToken, out); } + if (isFunctionExpressionAssignedToVariable(n)) { + addOutliningForLeadingCommentsForNode(n.parent.parent.parent, sourceFile, cancellationToken, out); + } if (ts.isFunctionLike(n) && ts.isBinaryExpression(n.parent) && ts.isPropertyAccessExpression(n.parent.left)) { addOutliningForLeadingCommentsForNode(n.parent.left, sourceFile, cancellationToken, out); } @@ -126727,6 +123814,13 @@ var ts; } depthRemaining++; } + function isFunctionExpressionAssignedToVariable(n) { + if (!ts.isFunctionExpression(n) && !ts.isArrowFunction(n)) { + return false; + } + var ancestor = ts.findAncestor(n, ts.isVariableStatement); + return !!ancestor && ts.getSingleInitializerOfVariableStatementOrPropertyDeclaration(ancestor) === n; + } } function addRegionOutliningSpans(sourceFile, out) { var regions = []; @@ -126807,7 +123901,7 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 230 /* Block */: + case 227 /* Block */: if (ts.isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } @@ -126815,16 +123909,16 @@ var ts; // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 235 /* DoStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 237 /* ForStatement */: - case 234 /* IfStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 287 /* CatchClause */: + case 232 /* DoStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 234 /* ForStatement */: + case 231 /* IfStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 284 /* CatchClause */: return spanForNode(n.parent); - case 247 /* TryStatement */: + case 244 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -126841,40 +123935,40 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return spanForNode(n.parent); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 258 /* CaseBlock */: - case 177 /* TypeLiteral */: - case 196 /* ObjectBindingPattern */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 255 /* CaseBlock */: + case 176 /* TypeLiteral */: + case 193 /* ObjectBindingPattern */: return spanForNode(n); - case 179 /* TupleType */: + case 178 /* TupleType */: return spanForNode(n, /*autoCollapse*/ false, /*useFullStart*/ !ts.isTupleTypeNode(n.parent), 22 /* OpenBracketToken */); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: return spanForNodeArray(n.statements); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return spanForJSXElement(n); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return spanForJSXFragment(n); - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return spanForNode(n, /*autoCollapse*/ false, /*useFullStart*/ !ts.isBindingElement(n.parent), 22 /* OpenBracketToken */); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return spanForArrowFunction(n); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return spanForCallExpression(n); } function spanForCallExpression(node) { @@ -126941,7 +124035,7 @@ var ts; function functionSpan(node, body, sourceFile) { var openToken = tryGetFunctionOpenToken(node, body, sourceFile); var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile); - return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 209 /* ArrowFunction */); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 206 /* ArrowFunction */); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -127488,7 +124582,7 @@ var ts; if (token === 133 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 139 /* ModuleKeyword */) { + if (token === 138 /* ModuleKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { recordAmbientExternalModule(); @@ -127522,10 +124616,10 @@ var ts; return true; } else { - if (token === 149 /* TypeKeyword */) { + if (token === 148 /* TypeKeyword */) { var skipTypeKeyword = ts.scanner.lookAhead(function () { var token = ts.scanner.scan(); - return token !== 153 /* FromKeyword */ && (token === 41 /* AsteriskToken */ || + return token !== 152 /* FromKeyword */ && (token === 41 /* AsteriskToken */ || token === 18 /* OpenBraceToken */ || token === 78 /* Identifier */ || ts.isKeyword(token)); @@ -127536,7 +124630,7 @@ var ts; } if (token === 78 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import d from "mod"; @@ -127567,7 +124661,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import {a as A} from "mod"; @@ -127583,7 +124677,7 @@ var ts; token = nextToken(); if (token === 78 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import * as NS from "mod" @@ -127604,7 +124698,7 @@ var ts; if (token === 92 /* ExportKeyword */) { markAsExternalModuleIfTopLevel(); token = nextToken(); - if (token === 149 /* TypeKeyword */) { + if (token === 148 /* TypeKeyword */) { var skipTypeKeyword = ts.scanner.lookAhead(function () { var token = ts.scanner.scan(); return token === 41 /* AsteriskToken */ || @@ -127623,7 +124717,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export {a as A} from "mod"; @@ -127635,7 +124729,7 @@ var ts; } else if (token === 41 /* AsteriskToken */) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export * from "mod" @@ -127645,7 +124739,7 @@ var ts; } else if (token === 99 /* ImportKeyword */) { token = nextToken(); - if (token === 149 /* TypeKeyword */) { + if (token === 148 /* TypeKeyword */) { var skipTypeKeyword = ts.scanner.lookAhead(function () { var token = ts.scanner.scan(); return token === 78 /* Identifier */ || @@ -127671,7 +124765,7 @@ var ts; function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) { if (allowTemplateLiterals === void 0) { allowTemplateLiterals = false; } var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 143 /* RequireKeyword */) { + if (token === 142 /* RequireKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); @@ -127814,13 +124908,8 @@ var ts; Rename.getRenameInfo = getRenameInfo; function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile, options) { var symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { - if (ts.isLabelName(node)) { - var name = ts.getTextOfNode(node); - return getRenameInfoSuccess(name, name, "label" /* label */, "" /* none */, node, sourceFile); - } - return undefined; - } + if (!symbol) + return; // Only allow a symbol to be renamed if it actually has at least one declaration. var declarations = symbol.declarations; if (!declarations || declarations.length === 0) @@ -127837,7 +124926,7 @@ var ts; return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 158 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 157 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -127913,7 +125002,6 @@ var ts; var SmartSelectionRange; (function (SmartSelectionRange) { function getSmartSelectionRange(pos, sourceFile) { - var _a; var selectionRange = { textSpan: ts.createTextSpanFromBounds(sourceFile.getFullStart(), sourceFile.getEnd()) }; @@ -127926,7 +125014,7 @@ var ts; var prevNode = children[i - 1]; var node = children[i]; var nextNode = children[i + 1]; - if (ts.getTokenPosOfNode(node, sourceFile, /*includeJsDoc*/ true) > pos) { + if (node.getStart(sourceFile) > pos) { break outer; } if (positionShouldSnapToNode(sourceFile, pos, node)) { @@ -127935,14 +125023,14 @@ var ts; // of things that should be considered independently. // 3. A VariableStatement’s children are just a VaraiableDeclarationList and a semicolon. // 4. A lone VariableDeclaration in a VaraibleDeclaration feels redundant with the VariableStatement. + // // Dive in without pushing a selection range. if (ts.isBlock(node) || ts.isTemplateSpan(node) || ts.isTemplateHead(node) || ts.isTemplateTail(node) || prevNode && ts.isTemplateHead(prevNode) || ts.isVariableDeclarationList(node) && ts.isVariableStatement(parentNode) || ts.isSyntaxList(node) && ts.isVariableDeclarationList(parentNode) - || ts.isVariableDeclaration(node) && ts.isSyntaxList(parentNode) && children.length === 1 - || ts.isJSDocTypeExpression(node) || ts.isJSDocSignature(node) || ts.isJSDocTypeLiteral(node)) { + || ts.isVariableDeclaration(node) && ts.isSyntaxList(parentNode) && children.length === 1) { parentNode = node; break; } @@ -127954,12 +125042,15 @@ var ts; } // Blocks with braces, brackets, parens, or JSX tags on separate lines should be // selected from open to close, including whitespace but not including the braces/etc. themselves. - var isBetweenMultiLineBookends = ts.isSyntaxList(node) && isListOpener(prevNode) && isListCloser(nextNode) + var isBetweenMultiLineBookends = ts.isSyntaxList(node) + && isListOpener(prevNode) + && isListCloser(nextNode) && !ts.positionsAreOnSameLine(prevNode.getStart(), nextNode.getStart(), sourceFile); + var jsDocCommentStart = ts.hasJSDocNodes(node) && node.jsDoc[0].getStart(); var start = isBetweenMultiLineBookends ? prevNode.getEnd() : node.getStart(); - var end = isBetweenMultiLineBookends ? nextNode.getStart() : getEndPos(sourceFile, node); - if (ts.hasJSDocNodes(node) && ((_a = node.jsDoc) === null || _a === void 0 ? void 0 : _a.length)) { - pushSelectionRange(ts.first(node.jsDoc).getStart(), end); + var end = isBetweenMultiLineBookends ? nextNode.getStart() : node.getEnd(); + if (ts.isNumber(jsDocCommentStart)) { + pushSelectionRange(jsDocCommentStart, end); } pushSelectionRange(start, end); // String literals should have a stop both inside and outside their quotes. @@ -128047,14 +125138,14 @@ var ts; ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */); // Group `-/+readonly` and `-/+?` var groupedWithPlusMinusTokens = groupChildren(children, function (child) { - return child === node.readonlyToken || child.kind === 142 /* ReadonlyKeyword */ || + return child === node.readonlyToken || child.kind === 141 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */; }); // Group type parameter with surrounding brackets var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) { var kind = _a.kind; return kind === 22 /* OpenBracketToken */ || - kind === 159 /* TypeParameter */ || + kind === 158 /* TypeParameter */ || kind === 23 /* CloseBracketToken */; }); return [ @@ -128168,26 +125259,14 @@ var ts; return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ - || kind === 275 /* JsxOpeningElement */; + || kind === 272 /* JsxOpeningElement */; } function isListCloser(token) { var kind = token && token.kind; return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ - || kind === 276 /* JsxClosingElement */; - } - function getEndPos(sourceFile, node) { - switch (node.kind) { - case 326 /* JSDocParameterTag */: - case 324 /* JSDocCallbackTag */: - case 333 /* JSDocPropertyTag */: - case 331 /* JSDocTypedefTag */: - case 328 /* JSDocThisTag */: - return sourceFile.getLineEndOfPosition(node.getStart()); - default: - return node.getEnd(); - } + || kind === 273 /* JsxClosingElement */; } })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {})); })(ts || (ts = {})); @@ -128393,10 +125472,10 @@ var ts; } return undefined; } - else if (ts.isTemplateHead(node) && parent.parent.kind === 205 /* TaggedTemplateExpression */) { + else if (ts.isTemplateHead(node) && parent.parent.kind === 202 /* TaggedTemplateExpression */) { var templateExpression = parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 218 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 215 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } @@ -128465,17 +125544,17 @@ var ts; return undefined; var parent = startingToken.parent; switch (parent.kind) { - case 207 /* ParenthesizedExpression */: - case 165 /* MethodDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 204 /* ParenthesizedExpression */: + case 164 /* MethodDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: var info = getArgumentOrParameterListInfo(startingToken, sourceFile); if (!info) return undefined; var argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan; var contextualType = ts.isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent); return contextualType && { contextualType: contextualType, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan }; - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var highestBinary = getHighestBinary(parent); var contextualType_1 = checker.getContextualType(highestBinary); var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1; @@ -128599,7 +125678,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 218 /* TemplateExpression */) { + if (template.kind === 215 /* TemplateExpression */) { var lastSpan = ts.last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -128951,7 +126030,7 @@ var ts; return diags.sort(function (d1, d2) { return d1.start - d2.start; }); function check(node) { if (isJsFile) { - if (canBeConvertedToClass(node, checker)) { + if (canBeConvertedToClass(node)) { diags.push(ts.createDiagnosticForNode(ts.isVariableDeclaration(node.parent) ? node.parent.name : node, ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration)); } } @@ -128980,11 +126059,11 @@ var ts; function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some(function (statement) { switch (statement.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return statement.declarationList.declarations.some(function (decl) { return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true); }); - case 233 /* ExpressionStatement */: { + case 230 /* ExpressionStatement */: { var expression = statement.expression; if (!ts.isBinaryExpression(expression)) return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true); @@ -129001,12 +126080,12 @@ var ts; } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 263 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 260 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : undefined; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node.name; default: return undefined; @@ -129075,9 +126154,9 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 103 /* NullKeyword */: @@ -129090,16 +126169,17 @@ var ts; function getKeyFromNode(exp) { return exp.pos.toString() + ":" + exp.end.toString(); } - function canBeConvertedToClass(node, checker) { + function canBeConvertedToClass(node) { var _a, _b, _c, _d; - if (node.kind === 208 /* FunctionExpression */) { + if (node.kind === 205 /* FunctionExpression */) { if (ts.isVariableDeclaration(node.parent) && ((_a = node.symbol.members) === null || _a === void 0 ? void 0 : _a.size)) { return true; } - var symbol = checker.getSymbolOfExpando(node, /*allowDeclaration*/ false); + var decl = ts.getDeclarationOfExpando(node); + var symbol = decl === null || decl === void 0 ? void 0 : decl.symbol; return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size))); } - if (node.kind === 251 /* FunctionDeclaration */) { + if (node.kind === 248 /* FunctionDeclaration */) { return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size); } return false; @@ -129119,7 +126199,7 @@ var ts; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 221 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 218 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -129205,11 +126285,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 275 /* JsxOpeningElement */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: return location.kind === 78 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -129253,7 +126333,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 201 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 198 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -129273,7 +126353,7 @@ var ts; } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217 - var useConstructSignatures = callExpressionLike.kind === 204 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 105 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 201 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 105 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -129329,7 +126409,7 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 132 /* ConstructorKeyword */ && location.parent.kind === 166 /* Constructor */)) { // At constructor keyword of constructor declaration + (location.kind === 132 /* ConstructorKeyword */ && location.parent.kind === 165 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration @@ -129337,21 +126417,21 @@ var ts; return declaration === (location.kind === 132 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 166 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 165 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); // TODO: GH#18217 } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 166 /* Constructor */) { + if (functionDeclaration_1.kind === 165 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 169 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 168 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -129362,7 +126442,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 221 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 218 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -129385,7 +126465,7 @@ var ts; } if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(149 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(148 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -129406,9 +126486,9 @@ var ts; } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 256 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 253 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 78 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 140 /* NamespaceKeyword */ : 139 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 139 /* NamespaceKeyword */ : 138 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -129427,7 +126507,7 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 159 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 158 /* TypeParameter */); if (decl === undefined) return ts.Debug.fail(); var declaration = decl.parent; @@ -129435,21 +126515,21 @@ var ts; if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217 - if (declaration.kind === 170 /* ConstructSignature */) { + if (declaration.kind === 169 /* ConstructSignature */) { displayParts.push(ts.keywordPart(102 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 169 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 168 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 254 /* TypeAliasDeclaration */) { + else if (declaration.kind === 251 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(149 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(148 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -129461,7 +126541,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 291 /* EnumMember */) { + if (declaration.kind === 288 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -129492,17 +126572,17 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(92 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(140 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(139 /* NamespaceKeyword */)); break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: displayParts.push(ts.keywordPart(92 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 62 /* EqualsToken */ : 87 /* DefaultKeyword */)); break; - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: displayParts.push(ts.keywordPart(92 /* ExportKeyword */)); break; default: @@ -129511,13 +126591,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 260 /* ImportEqualsDeclaration */) { + if (declaration.kind === 257 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(62 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(143 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(142 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(20 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(21 /* CloseParenToken */)); @@ -129598,10 +126678,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 297 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 294 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 216 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 213 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -129719,16 +126799,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 208 /* FunctionExpression */) { + if (declaration.kind === 205 /* FunctionExpression */) { return true; } - if (declaration.kind !== 249 /* VariableDeclaration */ && declaration.kind !== 251 /* FunctionDeclaration */) { + if (declaration.kind !== 246 /* VariableDeclaration */ && declaration.kind !== 248 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 297 /* SourceFile */ || parent.kind === 257 /* ModuleBlock */) { + if (parent.kind === 294 /* SourceFile */ || parent.kind === 254 /* ModuleBlock */) { return false; } } @@ -130029,10 +127109,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 280 /* JsxAttribute */: - case 275 /* JsxOpeningElement */: - case 276 /* JsxClosingElement */: - case 274 /* JsxSelfClosingElement */: + case 277 /* JsxAttribute */: + case 272 /* JsxOpeningElement */: + case 273 /* JsxClosingElement */: + case 271 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 78 /* Identifier */; } @@ -130233,7 +127313,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 156 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 155 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -130248,9 +127328,9 @@ var ts; var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */])); var anyTokenIncludingEOF = tokenRangeFrom(__spreadArrays(allTokens, [1 /* EndOfFileToken */])); - var keywords = tokenRangeFromRange(80 /* FirstKeyword */, 156 /* LastKeyword */); + var keywords = tokenRangeFromRange(80 /* FirstKeyword */, 155 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 77 /* LastBinaryOperator */); - var binaryKeywordOperators = [100 /* InKeyword */, 101 /* InstanceOfKeyword */, 156 /* OfKeyword */, 126 /* AsKeyword */, 137 /* IsKeyword */]; + var binaryKeywordOperators = [100 /* InKeyword */, 101 /* InstanceOfKeyword */, 155 /* OfKeyword */, 126 /* AsKeyword */, 136 /* IsKeyword */]; var unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 78 /* Identifier */, 20 /* OpenParenToken */, @@ -130324,7 +127404,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [134 /* GetKeyword */, 146 /* SetKeyword */], 78 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), + rule("SpaceAfterGetSetInMember", [134 /* GetKeyword */, 145 /* SetKeyword */], 78 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), rule("NoSpaceBetweenYieldKeywordAndStar", 124 /* YieldKeyword */, 41 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [124 /* YieldKeyword */, 41 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */), rule("NoSpaceBetweenReturnAndSemicolon", 104 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), @@ -130348,7 +127428,7 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 62 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [139 /* ModuleKeyword */, 143 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceAfterModuleImport", [138 /* ModuleKeyword */, 142 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 125 /* AbstractKeyword */, @@ -130362,20 +127442,20 @@ var ts; 116 /* ImplementsKeyword */, 99 /* ImportKeyword */, 117 /* InterfaceKeyword */, - 139 /* ModuleKeyword */, - 140 /* NamespaceKeyword */, + 138 /* ModuleKeyword */, + 139 /* NamespaceKeyword */, 120 /* PrivateKeyword */, 122 /* PublicKeyword */, 121 /* ProtectedKeyword */, - 142 /* ReadonlyKeyword */, - 146 /* SetKeyword */, + 141 /* ReadonlyKeyword */, + 145 /* SetKeyword */, 123 /* StaticKeyword */, - 149 /* TypeKeyword */, - 153 /* FromKeyword */, - 138 /* KeyOfKeyword */, + 148 /* TypeKeyword */, + 152 /* FromKeyword */, + 137 /* KeyOfKeyword */, 135 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [93 /* ExtendsKeyword */, 116 /* ImplementsKeyword */, 153 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [93 /* ExtendsKeyword */, 116 /* ImplementsKeyword */, 152 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 10 /* StringLiteral */, 18 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */), // Lambda expressions @@ -130407,7 +127487,7 @@ var ts; 120 /* PrivateKeyword */, 121 /* ProtectedKeyword */, 134 /* GetKeyword */, - 146 /* SetKeyword */, + 145 /* SetKeyword */, 22 /* OpenBracketToken */, 41 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 4 /* InsertSpace */), @@ -130561,51 +127641,51 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 237 /* ForStatement */; + return context.contextNode.kind === 234 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 27 /* CommaToken */; - case 217 /* ConditionalExpression */: - case 184 /* ConditionalType */: - case 224 /* AsExpression */: - case 270 /* ExportSpecifier */: - case 265 /* ImportSpecifier */: - case 172 /* TypePredicate */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 214 /* ConditionalExpression */: + case 183 /* ConditionalType */: + case 221 /* AsExpression */: + case 267 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 171 /* TypePredicate */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 198 /* BindingElement */: + case 195 /* BindingElement */: // equals in type X = ... // falls through - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // equal in let a = 0 // falls through - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: // equal in p = 0 // falls through - case 160 /* Parameter */: - case 291 /* EnumMember */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 159 /* Parameter */: + case 288 /* EnumMember */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return context.currentTokenSpan.kind === 100 /* InKeyword */ || context.nextTokenSpan.kind === 100 /* InKeyword */ || context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 239 /* ForOfStatement */: - return context.currentTokenSpan.kind === 156 /* OfKeyword */ || context.nextTokenSpan.kind === 156 /* OfKeyword */; + case 236 /* ForOfStatement */: + return context.currentTokenSpan.kind === 155 /* OfKeyword */ || context.nextTokenSpan.kind === 155 /* OfKeyword */; } return false; } @@ -130617,22 +127697,22 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 163 /* PropertyDeclaration */ || - contextKind === 162 /* PropertySignature */ || - contextKind === 160 /* Parameter */ || - contextKind === 249 /* VariableDeclaration */ || + return contextKind === 162 /* PropertyDeclaration */ || + contextKind === 161 /* PropertySignature */ || + contextKind === 159 /* Parameter */ || + contextKind === 246 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 217 /* ConditionalExpression */ || - context.contextNode.kind === 184 /* ConditionalType */; + return context.contextNode.kind === 214 /* ConditionalExpression */ || + context.contextNode.kind === 183 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 196 /* ObjectBindingPattern */ || - context.contextNode.kind === 190 /* MappedType */ || + return context.contextNode.kind === 193 /* ObjectBindingPattern */ || + context.contextNode.kind === 189 /* MappedType */ || isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration @@ -130658,34 +127738,34 @@ var ts; return true; } switch (node.kind) { - case 230 /* Block */: - case 258 /* CaseBlock */: - case 200 /* ObjectLiteralExpression */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 197 /* ObjectLiteralExpression */: + case 254 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 169 /* CallSignature */: - case 208 /* FunctionExpression */: - case 166 /* Constructor */: - case 209 /* ArrowFunction */: + case 168 /* CallSignature */: + case 205 /* FunctionExpression */: + case 165 /* Constructor */: + case 206 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 253 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one + case 250 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; @@ -130694,40 +127774,40 @@ var ts; return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 251 /* FunctionDeclaration */ || context.contextNode.kind === 208 /* FunctionExpression */; + return context.contextNode.kind === 248 /* FunctionDeclaration */ || context.contextNode.kind === 205 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 177 /* TypeLiteral */: - case 256 /* ModuleDeclaration */: - case 267 /* ExportDeclaration */: - case 268 /* NamedExports */: - case 261 /* ImportDeclaration */: - case 264 /* NamedImports */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 176 /* TypeLiteral */: + case 253 /* ModuleDeclaration */: + case 264 /* ExportDeclaration */: + case 265 /* NamedExports */: + case 258 /* ImportDeclaration */: + case 261 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 287 /* CatchClause */: - case 257 /* ModuleBlock */: - case 244 /* SwitchStatement */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 284 /* CatchClause */: + case 254 /* ModuleBlock */: + case 241 /* SwitchStatement */: return true; - case 230 /* Block */: { + case 227 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 209 /* ArrowFunction */ && blockParent.kind !== 208 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 206 /* ArrowFunction */ && blockParent.kind !== 205 /* FunctionExpression */) { return true; } } @@ -130736,32 +127816,32 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 234 /* IfStatement */: - case 244 /* SwitchStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 236 /* WhileStatement */: - case 247 /* TryStatement */: - case 235 /* DoStatement */: - case 243 /* WithStatement */: + case 231 /* IfStatement */: + case 241 /* SwitchStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 233 /* WhileStatement */: + case 244 /* TryStatement */: + case 232 /* DoStatement */: + case 240 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 287 /* CatchClause */: + case 284 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 200 /* ObjectLiteralExpression */; + return context.contextNode.kind === 197 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 203 /* CallExpression */; + return context.contextNode.kind === 200 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 204 /* NewExpression */; + return context.contextNode.kind === 201 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -130776,10 +127856,10 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 209 /* ArrowFunction */; + return context.contextNode.kind === 206 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 195 /* ImportType */; + return context.contextNode.kind === 192 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */; @@ -130788,19 +127868,19 @@ var ts; return context.contextNode.kind !== 11 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 273 /* JsxElement */ && context.contextNode.kind !== 277 /* JsxFragment */; + return context.contextNode.kind !== 270 /* JsxElement */ && context.contextNode.kind !== 274 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 283 /* JsxExpression */ || context.contextNode.kind === 282 /* JsxSpreadAttribute */; + return context.contextNode.kind === 280 /* JsxExpression */ || context.contextNode.kind === 279 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 280 /* JsxAttribute */; + return context.nextTokenParent.kind === 277 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 280 /* JsxAttribute */; + return context.contextNode.kind === 277 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 274 /* JsxSelfClosingElement */; + return context.contextNode.kind === 271 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -130815,45 +127895,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 161 /* Decorator */; + return node.kind === 160 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 250 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 247 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 256 /* ModuleDeclaration */; + return context.contextNode.kind === 253 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 177 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 176 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 170 /* ConstructSignature */; + return context.contextNode.kind === 169 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 173 /* TypeReference */: - case 206 /* TypeAssertionExpression */: - case 254 /* TypeAliasDeclaration */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 223 /* ExpressionWithTypeArguments */: + case 172 /* TypeReference */: + case 203 /* TypeAssertionExpression */: + case 251 /* TypeAliasDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 220 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -130864,28 +127944,28 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 206 /* TypeAssertionExpression */; + return context.contextNode.kind === 203 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 113 /* VoidKeyword */ && context.currentTokenParent.kind === 212 /* VoidExpression */; + return context.currentTokenSpan.kind === 113 /* VoidKeyword */ && context.currentTokenParent.kind === 209 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 219 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 216 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 225 /* NonNullExpression */; + return context.contextNode.kind === 222 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 234 /* IfStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 231 /* IfStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return true; default: return false; @@ -130910,12 +127990,12 @@ var ts; return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; } - if (nextTokenKind === 229 /* SemicolonClassElement */ || + if (nextTokenKind === 226 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 253 /* InterfaceDeclaration */ || - context.contextNode.kind === 254 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 250 /* InterfaceDeclaration */ || + context.contextNode.kind === 251 /* TypeAliasDeclaration */) { // Can’t remove semicolon after `foo`; it would parse as a method declaration: // // interface I { @@ -130929,9 +128009,9 @@ var ts; if (ts.isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 237 /* ForStatement */ - && context.currentTokenParent.kind !== 231 /* EmptyStatement */ - && context.currentTokenParent.kind !== 229 /* SemicolonClassElement */ + return context.currentTokenParent.kind !== 234 /* ForStatement */ + && context.currentTokenParent.kind !== 228 /* EmptyStatement */ + && context.currentTokenParent.kind !== 226 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ @@ -130939,7 +128019,7 @@ var ts; && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ - && nextTokenKind !== 218 /* TemplateExpression */ + && nextTokenKind !== 215 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */; @@ -131030,12 +128110,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 156 /* LastKeyword */ && column <= 156 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 155 /* LastKeyword */ && column <= 155 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 156 /* LastToken */ + 1; + var mapRowLength = 155 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["StopRulesSpecific"] = 0] = "StopRulesSpecific"; @@ -131223,17 +128303,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var body = parent.body; - return !!body && body.kind === 257 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 297 /* SourceFile */: - case 230 /* Block */: - case 257 /* ModuleBlock */: + return !!body && body.kind === 254 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 294 /* SourceFile */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -131460,19 +128540,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 252 /* ClassDeclaration */: return 83 /* ClassKeyword */; - case 253 /* InterfaceDeclaration */: return 117 /* InterfaceKeyword */; - case 251 /* FunctionDeclaration */: return 97 /* FunctionKeyword */; - case 255 /* EnumDeclaration */: return 255 /* EnumDeclaration */; - case 167 /* GetAccessor */: return 134 /* GetKeyword */; - case 168 /* SetAccessor */: return 146 /* SetKeyword */; - case 165 /* MethodDeclaration */: + case 249 /* ClassDeclaration */: return 83 /* ClassKeyword */; + case 250 /* InterfaceDeclaration */: return 117 /* InterfaceKeyword */; + case 248 /* FunctionDeclaration */: return 97 /* FunctionKeyword */; + case 252 /* EnumDeclaration */: return 252 /* EnumDeclaration */; + case 166 /* GetAccessor */: return 134 /* GetKeyword */; + case 167 /* SetAccessor */: return 145 /* SetKeyword */; + case 164 /* MethodDeclaration */: if (node.asteriskToken) { return 41 /* AsteriskToken */; } // falls through - case 163 /* PropertyDeclaration */: - case 160 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 159 /* Parameter */: var name = ts.getNameOfDeclaration(node); if (name) { return name.kind; @@ -131529,15 +128609,15 @@ var ts; case 43 /* SlashToken */: case 31 /* GreaterThanToken */: switch (container.kind) { - case 275 /* JsxOpeningElement */: - case 276 /* JsxClosingElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 273 /* JsxClosingElement */: + case 271 /* JsxSelfClosingElement */: return false; } break; case 22 /* OpenBracketToken */: case 23 /* CloseBracketToken */: - if (container.kind !== 190 /* MappedType */) { + if (container.kind !== 189 /* MappedType */) { return false; } break; @@ -131645,7 +128725,7 @@ var ts; return inheritedIndentation; } } - var effectiveParentStartLine = child.kind === 161 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 160 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 11 /* JsxText */) { @@ -131665,7 +128745,7 @@ var ts; } } childContextNode = node; - if (isFirstListItem && parent.kind === 199 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 196 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -132105,12 +129185,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 209 /* ArrowFunction */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 206 /* ArrowFunction */: if (node.typeParameters === list) { return 29 /* LessThanToken */; } @@ -132118,8 +129198,8 @@ var ts; return 20 /* OpenParenToken */; } break; - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } @@ -132127,12 +129207,12 @@ var ts; return 20 /* OpenParenToken */; } break; - case 173 /* TypeReference */: + case 172 /* TypeReference */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } break; - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return 18 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -132250,7 +129330,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 216 /* BinaryExpression */) { + if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 213 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -132404,7 +129484,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 297 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 294 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -132452,7 +129532,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 234 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 231 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 90 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -132490,40 +129570,40 @@ var ts; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return getList(node.typeArguments); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return getList(node.properties); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getList(node.elements); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return getList(node.members); - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 166 /* Constructor */: - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 165 /* Constructor */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 204 /* NewExpression */: - case 203 /* CallExpression */: + case 201 /* NewExpression */: + case 200 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return getList(node.declarations); - case 264 /* NamedImports */: - case 268 /* NamedExports */: + case 261 /* NamedImports */: + case 265 /* NamedExports */: return getList(node.elements); - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -132546,7 +129626,7 @@ var ts; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 250 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 247 /* VariableDeclarationList */) { // VariableDeclarationList has no wrapping tokens return -1 /* Unknown */; } @@ -132619,91 +129699,87 @@ var ts; function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 233 /* ExpressionStatement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 199 /* ArrayLiteralExpression */: - case 230 /* Block */: - case 257 /* ModuleBlock */: - case 200 /* ObjectLiteralExpression */: - case 177 /* TypeLiteral */: - case 190 /* MappedType */: - case 179 /* TupleType */: - case 258 /* CaseBlock */: - case 285 /* DefaultClause */: - case 284 /* CaseClause */: - case 207 /* ParenthesizedExpression */: - case 201 /* PropertyAccessExpression */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 232 /* VariableStatement */: - case 266 /* ExportAssignment */: - case 242 /* ReturnStatement */: - case 217 /* ConditionalExpression */: - case 197 /* ArrayBindingPattern */: - case 196 /* ObjectBindingPattern */: - case 275 /* JsxOpeningElement */: - case 278 /* JsxOpeningFragment */: - case 274 /* JsxSelfClosingElement */: - case 283 /* JsxExpression */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 160 /* Parameter */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 186 /* ParenthesizedType */: - case 205 /* TaggedTemplateExpression */: - case 213 /* AwaitExpression */: - case 268 /* NamedExports */: - case 264 /* NamedImports */: - case 270 /* ExportSpecifier */: - case 265 /* ImportSpecifier */: - case 163 /* PropertyDeclaration */: + case 230 /* ExpressionStatement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 196 /* ArrayLiteralExpression */: + case 227 /* Block */: + case 254 /* ModuleBlock */: + case 197 /* ObjectLiteralExpression */: + case 176 /* TypeLiteral */: + case 189 /* MappedType */: + case 178 /* TupleType */: + case 255 /* CaseBlock */: + case 282 /* DefaultClause */: + case 281 /* CaseClause */: + case 204 /* ParenthesizedExpression */: + case 198 /* PropertyAccessExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 229 /* VariableStatement */: + case 263 /* ExportAssignment */: + case 239 /* ReturnStatement */: + case 214 /* ConditionalExpression */: + case 194 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 272 /* JsxOpeningElement */: + case 275 /* JsxOpeningFragment */: + case 271 /* JsxSelfClosingElement */: + case 280 /* JsxExpression */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 159 /* Parameter */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 185 /* ParenthesizedType */: + case 202 /* TaggedTemplateExpression */: + case 210 /* AwaitExpression */: + case 265 /* NamedExports */: + case 261 /* NamedImports */: + case 267 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 162 /* PropertyDeclaration */: return true; - case 249 /* VariableDeclaration */: - case 288 /* PropertyAssignment */: - case 216 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 200 /* ObjectLiteralExpression */) { // TODO: GH#18217 + case 246 /* VariableDeclaration */: + case 285 /* PropertyAssignment */: + case 213 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 197 /* ObjectLiteralExpression */) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child); } - if (parent.kind !== 216 /* BinaryExpression */) { + if (parent.kind !== 213 /* BinaryExpression */) { return true; } break; - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 237 /* ForStatement */: - case 234 /* IfStatement */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - return childKind !== 230 /* Block */; - case 209 /* ArrowFunction */: - if (sourceFile && childKind === 207 /* ParenthesizedExpression */) { - return rangeIsOnOneLine(sourceFile, child); - } - return childKind !== 230 /* Block */; - case 267 /* ExportDeclaration */: - return childKind !== 268 /* NamedExports */; - case 261 /* ImportDeclaration */: - return childKind !== 262 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 264 /* NamedImports */); - case 273 /* JsxElement */: - return childKind !== 276 /* JsxClosingElement */; - case 277 /* JsxFragment */: - return childKind !== 279 /* JsxClosingFragment */; - case 183 /* IntersectionType */: - case 182 /* UnionType */: - if (childKind === 177 /* TypeLiteral */ || childKind === 179 /* TupleType */) { + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 234 /* ForStatement */: + case 231 /* IfStatement */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 206 /* ArrowFunction */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + return childKind !== 227 /* Block */; + case 264 /* ExportDeclaration */: + return childKind !== 265 /* NamedExports */; + case 258 /* ImportDeclaration */: + return childKind !== 259 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 261 /* NamedImports */); + case 270 /* JsxElement */: + return childKind !== 273 /* JsxClosingElement */; + case 274 /* JsxFragment */: + return childKind !== 276 /* JsxClosingFragment */; + case 182 /* IntersectionType */: + case 181 /* UnionType */: + if (childKind === 176 /* TypeLiteral */ || childKind === 178 /* TupleType */) { return false; } // falls through @@ -132714,11 +129790,11 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 242 /* ReturnStatement */: - case 246 /* ThrowStatement */: - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: - return parent.kind !== 230 /* Block */; + case 239 /* ReturnStatement */: + case 243 /* ThrowStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: + return parent.kind !== 227 /* Block */; default: return false; } @@ -132792,10 +129868,8 @@ var ts; (function (TrailingTriviaOption) { /** Exclude all trailing trivia (use getEnd()) */ TrailingTriviaOption[TrailingTriviaOption["Exclude"] = 0] = "Exclude"; - /** Doesn't include whitespace, but does strip comments */ - TrailingTriviaOption[TrailingTriviaOption["ExcludeWhitespace"] = 1] = "ExcludeWhitespace"; /** Include trailing trivia */ - TrailingTriviaOption[TrailingTriviaOption["Include"] = 2] = "Include"; + TrailingTriviaOption[TrailingTriviaOption["Include"] = 1] = "Include"; })(TrailingTriviaOption = textChanges_3.TrailingTriviaOption || (textChanges_3.TrailingTriviaOption = {})); function skipWhitespacesAndLineBreaks(text, start) { return ts.skipTrivia(text, start, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); @@ -132866,18 +129940,9 @@ var ts; return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); } function getAdjustedEndPosition(sourceFile, node, options) { - var _a; var end = node.end; var trailingTriviaOption = options.trailingTriviaOption; - if (trailingTriviaOption === TrailingTriviaOption.Exclude) { - return end; - } - if (trailingTriviaOption === TrailingTriviaOption.ExcludeWhitespace) { - var comments = ts.concatenate(ts.getTrailingCommentRanges(sourceFile.text, end), ts.getLeadingCommentRanges(sourceFile.text, end)); - var realEnd = (_a = comments === null || comments === void 0 ? void 0 : comments[comments.length - 1]) === null || _a === void 0 ? void 0 : _a.end; - if (realEnd) { - return realEnd; - } + if (trailingTriviaOption === TrailingTriviaOption.Exclude || (ts.isExpression(node) && trailingTriviaOption !== TrailingTriviaOption.Include)) { return end; } var newEnd = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true); @@ -132889,7 +129954,7 @@ var ts; * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 200 /* ObjectLiteralExpression */)); + return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 197 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -133028,10 +130093,9 @@ var ts; this.insertNodeAt(sourceFile, parameters.pos, newParam); } }; - ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween, options) { + ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween) { if (blankLineBetween === void 0) { blankLineBetween = false; } - if (options === void 0) { options = {}; } - this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween)); + this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, {}), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween)); }; ChangeTracker.prototype.insertModifierBefore = function (sourceFile, modifier, before) { var pos = before.getStart(sourceFile); @@ -133093,7 +130157,7 @@ var ts; } } else { - endNode = (_a = (node.kind === 249 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken)) !== null && _a !== void 0 ? _a : node.name; + endNode = (_a = (node.kind === 246 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken)) !== null && _a !== void 0 ? _a : node.name; } this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " }); return true; @@ -133250,18 +130314,18 @@ var ts; }; ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: case 10 /* StringLiteral */: case 78 /* Identifier */: return { prefix: ", " }; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 92 /* ExportKeyword */: return { prefix: " " }; - case 160 /* Parameter */: + case 159 /* Parameter */: return {}; default: ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it @@ -133270,7 +130334,7 @@ var ts; }; ChangeTracker.prototype.insertName = function (sourceFile, node, name) { ts.Debug.assert(!node.name); - if (node.kind === 209 /* ArrowFunction */) { + if (node.kind === 206 /* ArrowFunction */) { var arrow = ts.findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile); var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile); if (lparen) { @@ -133284,14 +130348,14 @@ var ts; // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)` this.replaceRange(sourceFile, arrow, ts.factory.createToken(21 /* CloseParenToken */)); } - if (node.body.kind !== 230 /* Block */) { + if (node.body.kind !== 227 /* Block */) { // `() => 0` => `function f() { return 0; }` this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.factory.createToken(18 /* OpenBraceToken */), ts.factory.createToken(104 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [ts.factory.createToken(26 /* SemicolonToken */), ts.factory.createToken(19 /* CloseBraceToken */)], { joiner: " " }); } } else { - var pos = ts.findChildOfKind(node, node.kind === 208 /* FunctionExpression */ ? 97 /* FunctionKeyword */ : 83 /* ClassKeyword */, sourceFile).end; + var pos = ts.findChildOfKind(node, node.kind === 205 /* FunctionExpression */ ? 97 /* FunctionKeyword */ : 83 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, ts.factory.createIdentifier(name), { prefix: " " }); } }; @@ -133587,12 +130651,7 @@ var ts; function getNonformattedText(node, sourceFile, newLineCharacter) { var writer = createWriter(newLineCharacter); var newLine = newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */; - ts.createPrinter({ - newLine: newLine, - neverAsciiEscape: true, - preserveSourceNewlines: true, - terminateUnterminatedLiterals: true - }, writer).writeNode(4 /* Unspecified */, node, sourceFile, writer); + ts.createPrinter({ newLine: newLine, neverAsciiEscape: true, preserveSourceNewlines: true }, writer).writeNode(4 /* Unspecified */, node, sourceFile, writer); return { text: writer.getText(), node: assignPositionsToNode(node) }; } changesToText.getNonformattedText = getNonformattedText; @@ -133866,14 +130925,14 @@ var ts; } textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; function needSemicolonBetween(a, b) { - return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 158 /* ComputedPropertyName */ + return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 157 /* ComputedPropertyName */ || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[` } var deleteDeclaration; (function (deleteDeclaration_1) { function deleteDeclaration(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 160 /* Parameter */: { + case 159 /* Parameter */: { var oldFunction = node.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && @@ -133888,15 +130947,15 @@ var ts; } break; } - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: var isFirstImport = sourceFile.imports.length && node === ts.first(sourceFile.imports).parent || node === ts.find(sourceFile.statements, ts.isAnyImportSyntax); // For first import, leave header comment in place, otherwise only delete JSDoc comments deleteNode(changes, sourceFile, node, { leadingTriviaOption: isFirstImport ? LeadingTriviaOption.Exclude : ts.hasJSDocNodes(node) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: var pattern = node.parent; - var preserveComma = pattern.kind === 197 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); + var preserveComma = pattern.kind === 194 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } @@ -133904,13 +130963,13 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: var namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -133919,7 +130978,7 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; case 26 /* SemicolonToken */: @@ -133928,8 +130987,8 @@ var ts; case 97 /* FunctionKeyword */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: LeadingTriviaOption.Exclude }); break; - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: ts.hasJSDocNodes(node) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); break; default: @@ -133976,13 +131035,13 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(node, 261 /* ImportDeclaration */); + var importDecl = ts.getAncestor(node, 258 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { var parent = node.parent; - if (parent.kind === 287 /* CatchClause */) { + if (parent.kind === 284 /* CatchClause */) { // TODO: There's currently no unused diagnostic for this, could be a suggestion changes.deleteNodeRange(sourceFile, ts.findChildOfKind(parent, 20 /* OpenParenToken */, sourceFile), ts.findChildOfKind(parent, 21 /* CloseParenToken */, sourceFile)); return; @@ -133993,14 +131052,14 @@ var ts; } var gp = parent.parent; switch (gp.kind) { - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: changes.replaceNode(sourceFile, node, ts.factory.createObjectLiteralExpression()); break; - case 237 /* ForStatement */: + case 234 /* ForStatement */: deleteNode(changes, sourceFile, parent); break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: deleteNode(changes, sourceFile, gp, { leadingTriviaOption: ts.hasJSDocNodes(gp) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); break; default: @@ -134179,8 +131238,8 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var assertion = ts.Debug.checkDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertionExpression(n); }), "Expected to find an assertion expression"); var replacement = ts.isAsExpression(assertion) - ? ts.factory.createAsExpression(assertion.expression, ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */)) - : ts.factory.createTypeAssertion(ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */), assertion.expression); + ? ts.factory.createAsExpression(assertion.expression, ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */)) + : ts.factory.createTypeAssertion(ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */), assertion.expression); changeTracker.replaceNode(sourceFile, assertion.expression, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -134409,7 +131468,7 @@ var ts; } var declaration = ts.tryCast(symbol.valueDeclaration, ts.isVariableDeclaration); var variableName = declaration && ts.tryCast(declaration.name, ts.isIdentifier); - var variableStatement = ts.getAncestor(declaration, 232 /* VariableStatement */); + var variableStatement = ts.getAncestor(declaration, 229 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || @@ -134487,10 +131546,10 @@ var ts; function isInsideAwaitableBody(node) { return node.kind & 32768 /* AwaitContext */ || !!ts.findAncestor(node, function (ancestor) { return ancestor.parent && ts.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || - ts.isBlock(ancestor) && (ancestor.parent.kind === 251 /* FunctionDeclaration */ || - ancestor.parent.kind === 208 /* FunctionExpression */ || - ancestor.parent.kind === 209 /* ArrowFunction */ || - ancestor.parent.kind === 165 /* MethodDeclaration */); + ts.isBlock(ancestor) && (ancestor.parent.kind === 248 /* FunctionDeclaration */ || + ancestor.parent.kind === 205 /* FunctionExpression */ || + ancestor.parent.kind === 206 /* ArrowFunction */ || + ancestor.parent.kind === 164 /* MethodDeclaration */); }); } function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { @@ -134609,10 +131668,10 @@ var ts; function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 78 /* Identifier */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -134627,7 +131686,7 @@ var ts; function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 78 /* Identifier */: - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: case 27 /* CommaToken */: return true; default: @@ -134676,7 +131735,7 @@ var ts; return; } var declaration = token.parent; - if (declaration.kind === 163 /* PropertyDeclaration */ && + if (declaration.kind === 162 /* PropertyDeclaration */ && (!fixedNodes || ts.tryAddToSet(fixedNodes, declaration))) { changeTracker.insertModifierBefore(sourceFile, 133 /* DeclareKeyword */, declaration); } @@ -134813,26 +131872,26 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 249 /* VariableDeclaration */ || - node.kind === 162 /* PropertySignature */ || - node.kind === 163 /* PropertyDeclaration */; + node.kind === 246 /* VariableDeclaration */ || + node.kind === 161 /* PropertySignature */ || + node.kind === 162 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: return ts.factory.createTypeReferenceNode("any", ts.emptyArray); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 306 /* JSDocNonNullableType */: + case 302 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, ts.nullTransformationContext); @@ -134857,7 +131916,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 309 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 + var isRest = node.type.kind === 305 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.factory.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; return ts.factory.createParameterDeclaration(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -134897,8 +131956,8 @@ var ts; var index = ts.factory.createParameterDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 144 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.factory.createTypeReferenceNode(node.typeArguments[0].kind === 144 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 143 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.factory.createTypeReferenceNode(node.typeArguments[0].kind === 143 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.factory.createTypeLiteralNode([ts.factory.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -135027,7 +132086,7 @@ var ts; return members; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 233 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 230 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentExpr) { @@ -135083,7 +132142,7 @@ var ts; var arrowFunctionBody = arrowFunction.body; var bodyBlock; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 230 /* Block */) { + if (arrowFunctionBody.kind === 227 /* Block */) { bodyBlock = arrowFunctionBody; } // case 2: () => [1,2,3] @@ -135278,7 +132337,7 @@ var ts; // will eventually become // const response = await fetch('...') // so we push an entry for 'response'. - if (lastCallSignature && !ts.isParameter(node.parent) && !ts.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { + if (lastCallSignature && !ts.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { var firstParameter = ts.firstOrUndefined(lastCallSignature.parameters); var ident = firstParameter && ts.isParameter(firstParameter.valueDeclaration) && ts.tryCast(firstParameter.valueDeclaration.name, ts.isIdentifier) || ts.factory.createUniqueName("result", 16 /* Optimistic */); var synthName = getNewNameIfConflict(ident, collidingSymbolMap); @@ -135304,22 +132363,7 @@ var ts; } } }); - return ts.getSynthesizedDeepCloneWithReplacements(nodeToRename, /*includeTrivia*/ true, function (original) { - if (ts.isBindingElement(original) && ts.isIdentifier(original.name) && ts.isObjectBindingPattern(original.parent)) { - var symbol = checker.getSymbolAtLocation(original.name); - var renameInfo = symbol && identsToRenameMap.get(String(ts.getSymbolId(symbol))); - if (renameInfo && renameInfo.text !== (original.name || original.propertyName).getText()) { - return ts.factory.createBindingElement(original.dotDotDotToken, original.propertyName || original.name, renameInfo, original.initializer); - } - } - else if (ts.isIdentifier(original)) { - var symbol = checker.getSymbolAtLocation(original); - var renameInfo = symbol && identsToRenameMap.get(String(ts.getSymbolId(symbol))); - if (renameInfo) { - return ts.factory.createIdentifier(renameInfo.text); - } - } - }); + return ts.getSynthesizedDeepCloneWithRenames(nodeToRename, /*includeTrivia*/ true, identsToRenameMap, checker); } function getNewNameIfConflict(name, originalNames) { var numVarsSameName = (originalNames.get(name.text) || ts.emptyArray).length; @@ -135400,7 +132444,7 @@ var ts; } var tryStatement = ts.factory.createTryStatement(tryBlock, catchClause, /*finallyBlock*/ undefined); var destructuredResult = prevArgName && varDeclIdentifier && isSynthBindingPattern(prevArgName) - && ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(ts.getSynthesizedDeepClone(prevArgName.bindingPattern), /*exclamationToken*/ undefined, /*type*/ undefined, varDeclIdentifier)], 2 /* Const */)); + && ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(ts.getSynthesizedDeepCloneWithRenames(prevArgName.bindingPattern), /*exclamationToken*/ undefined, /*type*/ undefined, varDeclIdentifier)], 2 /* Const */)); return ts.compact([varDeclList, tryStatement, destructuredResult]); } function createUniqueSynthName(prevArgName) { @@ -135459,7 +132503,7 @@ var ts; } // should be kept up to date with isFixablePromiseArgument in suggestionDiagnostics.ts function getTransformationBody(func, prevArgName, argName, parent, transformer) { - var _a, _b, _c, _d, _e; + var _a, _b, _c, _d; switch (func.kind) { case 103 /* NullKeyword */: // do not produce a transformed statement for a null argument @@ -135485,24 +132529,22 @@ var ts; prevArgName.types.push(returnType); } return varDeclOrAssignment; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: { + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: { var funcBody = func.body; - var returnType_1 = (_c = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) === null || _c === void 0 ? void 0 : _c.getReturnType(); // Arrow functions with block bodies { } will enter this control flow if (ts.isBlock(funcBody)) { var refactoredStmts = []; var seenReturnStatement = false; - for (var _i = 0, _f = funcBody.statements; _i < _f.length; _i++) { - var statement = _f[_i]; + for (var _i = 0, _e = funcBody.statements; _i < _e.length; _i++) { + var statement = _e[_i]; if (ts.isReturnStatement(statement)) { seenReturnStatement = true; if (ts.isReturnStatementWithFixablePromiseHandler(statement)) { refactoredStmts = refactoredStmts.concat(getInnerTransformationBody(transformer, [statement], prevArgName)); } else { - var possiblyAwaitedRightHandSide = returnType_1 && statement.expression ? getPossiblyAwaitedRightHandSide(transformer.checker, returnType_1, statement.expression) : statement.expression; - refactoredStmts.push.apply(refactoredStmts, maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_d = parent.typeArguments) === null || _d === void 0 ? void 0 : _d[0])); + refactoredStmts.push.apply(refactoredStmts, maybeAnnotateAndReturn(statement.expression, (_c = parent.typeArguments) === null || _c === void 0 ? void 0 : _c[0])); } } else { @@ -135519,21 +132561,19 @@ var ts; if (innerCbBody.length > 0) { return innerCbBody; } - if (returnType_1) { - var possiblyAwaitedRightHandSide = getPossiblyAwaitedRightHandSide(transformer.checker, returnType_1, funcBody); - if (!shouldReturn(parent, transformer)) { - var transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide, /*typeAnnotation*/ undefined); - if (prevArgName) { - prevArgName.types.push(returnType_1); - } - return transformedStatement; - } - else { - return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_e = parent.typeArguments) === null || _e === void 0 ? void 0 : _e[0]); + var type_1 = transformer.checker.getTypeAtLocation(func); + var returnType_1 = getLastCallSignature(type_1, transformer.checker).getReturnType(); + var rightHandSide = ts.getSynthesizedDeepClone(funcBody); + var possiblyAwaitedRightHandSide = !!transformer.checker.getPromisedTypeOfPromise(returnType_1) ? ts.factory.createAwaitExpression(rightHandSide) : rightHandSide; + if (!shouldReturn(parent, transformer)) { + var transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide, /*typeAnnotation*/ undefined); + if (prevArgName) { + prevArgName.types.push(returnType_1); } + return transformedStatement; } else { - return silentFail(); + return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_d = parent.typeArguments) === null || _d === void 0 ? void 0 : _d[0]); } } } @@ -135543,10 +132583,6 @@ var ts; } return ts.emptyArray; } - function getPossiblyAwaitedRightHandSide(checker, type, expr) { - var rightHandSide = ts.getSynthesizedDeepClone(expr); - return !!checker.getPromisedTypeOfPromise(type) ? ts.factory.createAwaitExpression(rightHandSide) : rightHandSide; - } function getLastCallSignature(type, checker) { var callSignatures = checker.getSignaturesOfType(type, 0 /* Call */); return ts.lastOrUndefined(callSignatures); @@ -135702,10 +132738,10 @@ var ts; } var importNode = ts.importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference)); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) { changes.replaceNode(importingFile, importNode, ts.factory.createPropertyAccessExpression(ts.getSynthesizedDeepClone(importNode), "default")); } @@ -135719,25 +132755,11 @@ var ts; var exports = collectExportRenames(sourceFile, checker, identifiers); convertExportsAccesses(sourceFile, exports, changes); var moduleExportsChangedToDefault = false; - var useSitesToUnqualify; - // Process variable statements first to collect use sites that need to be updated inside other transformations - for (var _i = 0, _a = ts.filter(sourceFile.statements, ts.isVariableStatement); _i < _a.length; _i++) { + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var statement = _a[_i]; - var newUseSites = convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); - if (newUseSites) { - ts.copyEntries(newUseSites, useSitesToUnqualify !== null && useSitesToUnqualify !== void 0 ? useSitesToUnqualify : (useSitesToUnqualify = new ts.Map())); - } - } - // `convertStatement` will delete entries from `useSitesToUnqualify` when containing statements are replaced - for (var _b = 0, _c = ts.filter(sourceFile.statements, function (s) { return !ts.isVariableStatement(s); }); _b < _c.length; _b++) { - var statement = _c[_b]; - var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference); + var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference); moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; } - // Remaining use sites can be changed directly - useSitesToUnqualify === null || useSitesToUnqualify === void 0 ? void 0 : useSitesToUnqualify.forEach(function (replacement, original) { - changes.replaceNode(sourceFile, original, replacement); - }); return moduleExportsChangedToDefault; } function collectExportRenames(sourceFile, checker, identifiers) { @@ -135770,24 +132792,24 @@ var ts; node.forEachChild(recur); }); } - function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference) { + function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference) { switch (statement.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 233 /* ExpressionStatement */: { + case 230 /* ExpressionStatement */: { var expression = statement.expression; switch (expression.kind) { - case 203 /* CallExpression */: { + case 200 /* CallExpression */: { if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true)) { // For side-effecting require() call, just make a side-effecting import. changes.replaceNode(sourceFile, statement, ts.makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0], quotePreference)); } return false; } - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var operatorToken = expression.operatorToken; - return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports, useSitesToUnqualify); + return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); } } } @@ -135799,17 +132821,17 @@ var ts; function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference) { var declarationList = statement.declarationList; var foundImport = false; - var converted = ts.map(declarationList.declarations, function (decl) { + var newNodes = ts.flatMap(declarationList.declarations, function (decl) { var name = decl.name, initializer = decl.initializer; if (initializer) { if (ts.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { // `const alias = module.exports;` can be removed. foundImport = true; - return convertedImports([]); + return []; } else if (ts.isRequireCall(initializer, /*checkArgumentIsStringLiteralLike*/ true)) { foundImport = true; - return convertSingleImport(name, initializer.arguments[0], checker, identifiers, target, quotePreference); + return convertSingleImport(sourceFile, name, initializer.arguments[0], changes, checker, identifiers, target, quotePreference); } else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, /*checkArgumentIsStringLiteralLike*/ true)) { foundImport = true; @@ -135817,40 +132839,33 @@ var ts; } } // Move it out to its own variable statement. (This will not be used if `!foundImport`) - return convertedImports([ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([decl], declarationList.flags))]); + return ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([decl], declarationList.flags)); }); if (foundImport) { // useNonAdjustedEndPosition to ensure we don't eat the newline after the statement. - changes.replaceNodeWithNodes(sourceFile, statement, ts.flatMap(converted, function (c) { return c.newImports; })); - var combinedUseSites_1; - ts.forEach(converted, function (c) { - if (c.useSitesToUnqualify) { - ts.copyEntries(c.useSitesToUnqualify, combinedUseSites_1 !== null && combinedUseSites_1 !== void 0 ? combinedUseSites_1 : (combinedUseSites_1 = new ts.Map())); - } - }); - return combinedUseSites_1; + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); } } /** Converts `const name = require("moduleSpecifier").propertyName` */ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: { + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: { // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` var tmp = makeUniqueName(propertyName, identifiers); - return convertedImports([ + return [ makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference), makeConst(/*modifiers*/ undefined, name, ts.factory.createIdentifier(tmp)), - ]); + ]; } case 78 /* Identifier */: // `const a = require("b").c` --> `import { c as a } from "./b"; - return convertedImports([makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]); + return [makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]; default: return ts.Debug.assertNever(name, "Convert to ES6 module got invalid syntax form " + name.kind); } } - function convertAssignment(sourceFile, checker, assignment, changes, exports, useSitesToUnqualify) { + function convertAssignment(sourceFile, checker, assignment, changes, exports) { var left = assignment.left, right = assignment.right; if (!ts.isPropertyAccessExpression(left)) { return false; @@ -135861,7 +132876,7 @@ var ts; changes.delete(sourceFile, assignment.parent); } else { - var replacement = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right, useSitesToUnqualify) + var replacement = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right) : ts.isRequireCall(right, /*checkArgumentIsStringLiteralLike*/ true) ? convertReExportAll(right.arguments[0], checker) : undefined; if (replacement) { @@ -135883,20 +132898,20 @@ var ts; * Convert `module.exports = { ... }` to individual exports.. * We can't always do this if the module has interesting members -- then it will be a default export instead. */ - function tryChangeModuleExportsObject(object, useSitesToUnqualify) { + function tryChangeModuleExportsObject(object) { var statements = ts.mapAllOrFail(object.properties, function (prop) { switch (prop.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 289 /* ShorthandPropertyAssignment */: - case 290 /* SpreadAssignment */: + case 286 /* ShorthandPropertyAssignment */: + case 287 /* SpreadAssignment */: return undefined; - case 288 /* PropertyAssignment */: - return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify); - case 165 /* MethodDeclaration */: - return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(92 /* ExportKeyword */)], prop, useSitesToUnqualify); + case 285 /* PropertyAssignment */: + return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer); + case 164 /* MethodDeclaration */: + return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(92 /* ExportKeyword */)], prop); default: ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind); } @@ -135956,10 +132971,10 @@ var ts; } } // TODO: GH#22492 this will cause an error if a change has been made inside the body of the node. - function convertExportsDotXEquals_replaceNode(name, exported, useSitesToUnqualify) { + function convertExportsDotXEquals_replaceNode(name, exported) { var modifiers = [ts.factory.createToken(92 /* ExportKeyword */)]; switch (exported.kind) { - case 208 /* FunctionExpression */: { + case 205 /* FunctionExpression */: { var expressionName = exported.name; if (expressionName && expressionName.text !== name) { // `exports.f = function g() {}` -> `export const f = function g() {}` @@ -135967,35 +132982,18 @@ var ts; } } // falls through - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // `exports.f = function() {}` --> `export function f() {}` - return functionExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); - case 221 /* ClassExpression */: + return functionExpressionToDeclaration(name, modifiers, exported); + case 218 /* ClassExpression */: // `exports.C = class {}` --> `export class C {}` - return classExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); + return classExpressionToDeclaration(name, modifiers, exported); default: return exportConst(); } function exportConst() { // `exports.x = 0;` --> `export const x = 0;` - return makeConst(modifiers, ts.factory.createIdentifier(name), replaceImportUseSites(exported, useSitesToUnqualify)); // TODO: GH#18217 - } - } - function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) { - if (!useSitesToUnqualify || !ts.some(ts.arrayFrom(useSitesToUnqualify.keys()), function (original) { return ts.rangeContainsRange(nodeOrNodes, original); })) { - return nodeOrNodes; - } - return ts.isArray(nodeOrNodes) - ? ts.getSynthesizedDeepClonesWithReplacements(nodeOrNodes, /*includeTrivia*/ true, replaceNode) - : ts.getSynthesizedDeepCloneWithReplacements(nodeOrNodes, /*includeTrivia*/ true, replaceNode); - function replaceNode(original) { - // We are replacing `mod.SomeExport` wih `SomeExport`, so we only need to look at PropertyAccessExpressions - if (original.kind === 201 /* PropertyAccessExpression */) { - var replacement = useSitesToUnqualify.get(original); - // Remove entry from `useSitesToUnqualify` so the refactor knows it's taken care of by the parent statement we're replacing - useSitesToUnqualify.delete(original); - return replacement; - } + return makeConst(modifiers, ts.factory.createIdentifier(name), exported); // TODO: GH#18217 } } /** @@ -136003,9 +133001,9 @@ var ts; * Returns nodes that will replace the variable declaration for the commonjs import. * May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`. */ - function convertSingleImport(name, moduleSpecifier, checker, identifiers, target, quotePreference) { + function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 196 /* ObjectBindingPattern */: { + case 193 /* ObjectBindingPattern */: { var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) ? undefined @@ -136014,23 +133012,23 @@ var ts; : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text); }); if (importSpecifiers) { - return convertedImports([ts.makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier, quotePreference)]); + return [ts.makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier, quotePreference)]; } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 197 /* ArrayBindingPattern */: { + case 194 /* ArrayBindingPattern */: { /* import x from "x"; const [a, b, c] = x; */ var tmp = makeUniqueName(codefix.moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers); - return convertedImports([ + return [ ts.makeImport(ts.factory.createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier, quotePreference), makeConst(/*modifiers*/ undefined, ts.getSynthesizedDeepClone(name), ts.factory.createIdentifier(tmp)), - ]); + ]; } case 78 /* Identifier */: - return convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference); + return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers, quotePreference); default: return ts.Debug.assertNever(name, "Convert to ES6 module got invalid name kind " + name.kind); } @@ -136039,13 +133037,12 @@ var ts; * Convert `import x = require("x").` * Also converts uses like `x.y()` to `y()` and uses a named import. */ - function convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference) { + function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers, quotePreference) { var nameSymbol = checker.getSymbolAtLocation(name); // Maps from module property name to name actually used. (The same if there isn't shadowing.) var namedBindingsNames = new ts.Map(); // True if there is some non-property use like `x()` or `f(x)`. var needDefaultImport = false; - var useSitesToUnqualify; for (var _i = 0, _a = identifiers.original.get(name.text); _i < _a.length; _i++) { var use = _a[_i]; if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) { @@ -136061,7 +133058,7 @@ var ts; idName = makeUniqueName(propertyName, identifiers); namedBindingsNames.set(propertyName, idName); } - (useSitesToUnqualify !== null && useSitesToUnqualify !== void 0 ? useSitesToUnqualify : (useSitesToUnqualify = new ts.Map())).set(parent, ts.factory.createIdentifier(idName)); + changes.replaceNode(file, parent, ts.factory.createIdentifier(idName)); } else { needDefaultImport = true; @@ -136075,7 +133072,7 @@ var ts; // If it was unused, ensure that we at least import *something*. needDefaultImport = true; } - return convertedImports([ts.makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier, quotePreference)], useSitesToUnqualify); + return [ts.makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier, quotePreference)]; } // Identifiers helpers function makeUniqueName(name, identifiers) { @@ -136102,24 +133099,24 @@ var ts; function isFreeIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return parent.name !== node; - case 198 /* BindingElement */: + case 195 /* BindingElement */: return parent.propertyName !== node; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return parent.propertyName !== node; default: return true; } } // Node helpers - function functionExpressionToDeclaration(name, additionalModifiers, fn, useSitesToUnqualify) { + function functionExpressionToDeclaration(name, additionalModifiers, fn) { return ts.factory.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal. - ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.factory.converters.convertToFunctionBlock(replaceImportUseSites(fn.body, useSitesToUnqualify))); + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.factory.converters.convertToFunctionBlock(ts.getSynthesizedDeepClone(fn.body))); } - function classExpressionToDeclaration(name, additionalModifiers, cls, useSitesToUnqualify) { + function classExpressionToDeclaration(name, additionalModifiers, cls) { return ts.factory.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), // TODO: GH#19915 Don't think this is even legal. - ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), replaceImportUseSites(cls.members, useSitesToUnqualify)); + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), ts.getSynthesizedDeepClones(cls.members)); } function makeSingleImport(localName, propertyName, moduleSpecifier, quotePreference) { return propertyName === "default" @@ -136138,12 +133135,6 @@ var ts; /*modifiers*/ undefined, /*isTypeOnly*/ false, exportSpecifiers && ts.factory.createNamedExports(exportSpecifiers), moduleSpecifier === undefined ? undefined : ts.factory.createStringLiteral(moduleSpecifier)); } - function convertedImports(newImports, useSitesToUnqualify) { - return { - newImports: newImports, - useSitesToUnqualify: useSitesToUnqualify - }; - } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -136203,7 +133194,7 @@ var ts; var fixedExportDeclarations = new ts.Map(); return codefix.codeFixAll(context, errorCodes, function (changes, diag) { var exportSpecifier = getExportSpecifierForDiagnosticSpan(diag, context.sourceFile); - if (exportSpecifier && ts.addToSeen(fixedExportDeclarations, ts.getNodeId(exportSpecifier.parent.parent))) { + if (exportSpecifier && !ts.addToSeen(fixedExportDeclarations, ts.getNodeId(exportSpecifier.parent.parent))) { fixSingleExportDeclaration(changes, exportSpecifier, context); } }); @@ -136220,7 +133211,8 @@ var ts; var exportDeclaration = exportClause.parent; var typeExportSpecifiers = getTypeExportSpecifiers(exportSpecifier, context); if (typeExportSpecifiers.length === exportClause.elements.length) { - changes.insertModifierBefore(context.sourceFile, 149 /* TypeKeyword */, exportClause); + changes.replaceNode(context.sourceFile, exportDeclaration, ts.factory.updateExportDeclaration(exportDeclaration, exportDeclaration.decorators, exportDeclaration.modifiers, + /*isTypeOnly*/ true, exportClause, exportDeclaration.moduleSpecifier)); } else { var valueExportDeclaration = ts.factory.updateExportDeclaration(exportDeclaration, exportDeclaration.decorators, exportDeclaration.modifiers, @@ -136229,10 +133221,7 @@ var ts; /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ true, ts.factory.createNamedExports(typeExportSpecifiers), exportDeclaration.moduleSpecifier); - changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, { - leadingTriviaOption: ts.textChanges.LeadingTriviaOption.IncludeAll, - trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Exclude - }); + changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration); changes.insertNodeAfter(context.sourceFile, exportDeclaration, typeExportDeclaration); } } @@ -136299,53 +133288,6 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; -(function (ts) { - var codefix; - (function (codefix) { - var fixId = "convertLiteralTypeToMappedType"; - var errorCodes = [ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code]; - codefix.registerCodeFix({ - errorCodes: errorCodes, - getCodeActions: function (context) { - var sourceFile = context.sourceFile, span = context.span; - var info = getInfo(sourceFile, span.start); - if (!info) { - return undefined; - } - var name = info.name, constraint = info.constraint; - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); }); - return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Convert_0_to_1_in_0, constraint, name], fixId, ts.Diagnostics.Convert_all_type_literals_to_mapped_type)]; - }, - fixIds: [fixId], - getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { - var info = getInfo(diag.file, diag.start); - if (info) { - doChange(changes, diag.file, info); - } - }); } - }); - function getInfo(sourceFile, pos) { - var token = ts.getTokenAtPosition(sourceFile, pos); - if (ts.isIdentifier(token)) { - var propertySignature = ts.cast(token.parent.parent, ts.isPropertySignature); - var propertyName = token.getText(sourceFile); - return { - container: ts.cast(propertySignature.parent, ts.isTypeLiteralNode), - typeNode: propertySignature.type, - constraint: propertyName, - name: propertyName === "K" ? "P" : "K", - }; - } - return undefined; - } - function doChange(changes, sourceFile, _a) { - var container = _a.container, typeNode = _a.typeNode, constraint = _a.constraint, name = _a.name; - changes.replaceNode(sourceFile, container, ts.factory.createMappedTypeNode(/*readonlyToken*/ undefined, ts.factory.createTypeParameterDeclaration(name, ts.factory.createTypeReferenceNode(constraint)), /*nameType*/ undefined, /*questionToken*/ undefined, typeNode)); - } - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; (function (ts) { var codefix; (function (codefix) { @@ -136490,7 +133432,7 @@ var ts; var symbol = checker.getMergedSymbol(ts.skipAlias(exportedSymbol, checker)); var exportInfos = getAllReExportingModules(sourceFile, symbol, moduleSymbol, symbolName, host, program, useAutoImportProvider); var preferTypeOnlyImport = !!usageIsTypeOnly && compilerOptions.importsNotUsedAsValues === 2 /* Error */; - var useRequire = shouldUseRequire(sourceFile, program); + var useRequire = shouldUseRequire(sourceFile, compilerOptions); var fix = getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, /*position*/ undefined, preferTypeOnlyImport, useRequire, host, preferences); addImport({ fixes: [fix], symbolName: symbolName }); } @@ -136593,7 +133535,7 @@ var ts; function getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, symbolName, host, program, formatContext, position, preferences) { var compilerOptions = program.getCompilerOptions(); var exportInfos = getAllReExportingModules(sourceFile, exportedSymbol, moduleSymbol, symbolName, host, program, /*useAutoImportProvider*/ true); - var useRequire = shouldUseRequire(sourceFile, program); + var useRequire = shouldUseRequire(sourceFile, compilerOptions); var preferTypeOnlyImport = compilerOptions.importsNotUsedAsValues === 2 /* Error */ && !ts.isSourceFileJS(sourceFile) && ts.isValidTypeOnlyAliasUseSite(ts.getTokenAtPosition(sourceFile, position)); var moduleSpecifier = ts.first(getNewImportInfos(program, sourceFile, position, preferTypeOnlyImport, useRequire, exportInfos, host, preferences)).moduleSpecifier; var fix = getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, position, preferTypeOnlyImport, useRequire, host, preferences); @@ -136619,7 +133561,7 @@ var ts; return; } var defaultInfo = getDefaultLikeExportInfo(importingFile, moduleSymbol, checker, compilerOptions); - if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && ts.skipAlias(defaultInfo.symbol, checker) === exportedSymbol) { + if (defaultInfo && defaultInfo.name === symbolName && ts.skipAlias(defaultInfo.symbol, checker) === exportedSymbol) { result.push({ moduleSymbol: moduleSymbol, importKind: defaultInfo.kind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(defaultInfo.symbol, checker) }); } for (var _i = 0, _a = checker.getExportsAndPropertiesOfModule(moduleSymbol); _i < _a.length; _i++) { @@ -136675,11 +133617,11 @@ var ts; function getTargetModuleFromNamespaceLikeImport(declaration, checker) { var _a; switch (declaration.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return checker.getAliasedSymbol(declaration.symbol); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport); return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); default: @@ -136689,11 +133631,11 @@ var ts; function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return declaration.name.text; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text; default: return ts.Debug.assertNever(declaration); @@ -136702,10 +133644,10 @@ var ts; function tryAddToExistingImport(existingImports, canUseTypeOnlyImport) { return ts.firstDefined(existingImports, function (_a) { var declaration = _a.declaration, importKind = _a.importKind; - if (declaration.kind === 260 /* ImportEqualsDeclaration */) + if (declaration.kind === 257 /* ImportEqualsDeclaration */) return undefined; - if (declaration.kind === 249 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 196 /* ObjectBindingPattern */ + if (declaration.kind === 246 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 193 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind: importKind, moduleSpecifier: declaration.initializer.arguments[0].text, canUseTypeOnlyImport: false } : undefined; } @@ -136713,7 +133655,7 @@ var ts; if (!importClause) return undefined; var name = importClause.name, namedBindings = importClause.namedBindings; - return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 264 /* NamedImports */) + return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 261 /* NamedImports */) ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: importClause, importKind: importKind, moduleSpecifier: declaration.moduleSpecifier.getText(), canUseTypeOnlyImport: canUseTypeOnlyImport } : undefined; }); @@ -136726,38 +133668,15 @@ var ts; if (ts.isRequireVariableDeclaration(i.parent, /*requireStringLiteralLikeArgument*/ true)) { return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind } : undefined; } - if (i.kind === 261 /* ImportDeclaration */ || i.kind === 260 /* ImportEqualsDeclaration */) { + if (i.kind === 258 /* ImportDeclaration */ || i.kind === 257 /* ImportEqualsDeclaration */) { return checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined; } }); } - function shouldUseRequire(sourceFile, program) { - // 1. TypeScript files don't use require variable declarations - if (!ts.isSourceFileJS(sourceFile)) { - return false; - } - // 2. If the current source file is unambiguously CJS or ESM, go with that - if (sourceFile.commonJsModuleIndicator && !sourceFile.externalModuleIndicator) - return true; - if (sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) - return false; - // 3. If there's a tsconfig/jsconfig, use its module setting - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions.configFile) { - return ts.getEmitModuleKind(compilerOptions) < ts.ModuleKind.ES2015; - } - // 4. Match the first other JS file in the program that's unambiguously CJS or ESM - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var otherFile = _a[_i]; - if (otherFile === sourceFile || !ts.isSourceFileJS(otherFile) || program.isSourceFileFromExternalLibrary(otherFile)) - continue; - if (otherFile.commonJsModuleIndicator && !otherFile.externalModuleIndicator) - return true; - if (otherFile.externalModuleIndicator && !otherFile.commonJsModuleIndicator) - return false; - } - // 5. Literally nothing to go on - return true; + function shouldUseRequire(sourceFile, compilerOptions) { + return ts.isSourceFileJS(sourceFile) + && !sourceFile.externalModuleIndicator + && (!!sourceFile.commonJsModuleIndicator || ts.getEmitModuleKind(compilerOptions) < ts.ModuleKind.ES2015); } function getNewImportInfos(program, sourceFile, position, preferTypeOnlyImport, useRequire, moduleSymbols, host, preferences) { var isJs = ts.isSourceFileJS(sourceFile); @@ -136792,9 +133711,9 @@ var ts; } function newImportInfoFromExistingSpecifier(_a, preferTypeOnlyImport, useRequire) { var declaration = _a.declaration, importKind = _a.importKind; - var moduleSpecifier = declaration.kind === 261 /* ImportDeclaration */ ? declaration.moduleSpecifier : - declaration.kind === 249 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : - declaration.moduleReference.kind === 272 /* ExternalModuleReference */ ? declaration.moduleReference.expression : + var moduleSpecifier = declaration.kind === 258 /* ImportDeclaration */ ? declaration.moduleSpecifier : + declaration.kind === 246 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : + declaration.moduleReference.kind === 269 /* ExternalModuleReference */ ? declaration.moduleReference.expression : undefined; return moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier.text, importKind: importKind, typeOnly: preferTypeOnlyImport, useRequire: useRequire } @@ -136816,7 +133735,7 @@ var ts; var symbol = checker.getAliasedSymbol(umdSymbol); var symbolName = umdSymbol.name; var exportInfos = [{ moduleSymbol: symbol, importKind: getUmdImportKind(sourceFile, program.getCompilerOptions()), exportedSymbolIsTypeOnly: false }]; - var useRequire = shouldUseRequire(sourceFile, program); + var useRequire = shouldUseRequire(sourceFile, program.getCompilerOptions()); var fixes = getFixForImport(exportInfos, symbolName, ts.isIdentifier(token) ? token.getStart(sourceFile) : undefined, /*preferTypeOnlyImport*/ false, useRequire, program, sourceFile, host, preferences); return { fixes: fixes, symbolName: symbolName }; } @@ -136865,8 +133784,8 @@ var ts; ts.Debug.assert(symbolName !== "default" /* Default */, "'default' isn't a legal identifier and couldn't occur here"); var compilerOptions = program.getCompilerOptions(); var preferTypeOnlyImport = compilerOptions.importsNotUsedAsValues === 2 /* Error */ && ts.isValidTypeOnlyAliasUseSite(symbolToken); - var useRequire = shouldUseRequire(sourceFile, program); - var exportInfos = getExportInfos(symbolName, ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host); + var useRequire = shouldUseRequire(sourceFile, compilerOptions); + var exportInfos = getExportInfos(symbolName, ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, checker, program, useAutoImportProvider, host); var fixes = ts.arrayFrom(ts.flatMapIterator(exportInfos.entries(), function (_a) { var _ = _a[0], exportInfos = _a[1]; return getFixForImport(exportInfos, symbolName, symbolToken.getStart(sourceFile), preferTypeOnlyImport, useRequire, program, sourceFile, host, preferences); @@ -136884,25 +133803,23 @@ var ts; return symbolToken.text; } // Returns a map from an exported symbol's ID to a list of every way it's (re-)exported. - function getExportInfos(symbolName, currentTokenMeaning, cancellationToken, sourceFile, program, useAutoImportProvider, host) { + function getExportInfos(symbolName, currentTokenMeaning, cancellationToken, sourceFile, checker, program, useAutoImportProvider, host) { // For each original symbol, keep all re-exports of that symbol together so we can call `getCodeActionsForImport` on the whole group at once. // Maps symbol id to info for modules providing that symbol (original export + re-exports). var originalSymbolToExportInfos = ts.createMultiMap(); - function addSymbol(moduleSymbol, exportedSymbol, importKind, checker) { + function addSymbol(moduleSymbol, exportedSymbol, importKind) { originalSymbolToExportInfos.add(ts.getUniqueSymbolId(exportedSymbol, checker).toString(), { moduleSymbol: moduleSymbol, importKind: importKind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(exportedSymbol, checker) }); } - forEachExternalModuleToImportFrom(program, host, sourceFile, /*filterByPackageJson*/ true, useAutoImportProvider, function (moduleSymbol, _, program) { - var checker = program.getTypeChecker(); + forEachExternalModuleToImportFrom(program, host, sourceFile, /*filterByPackageJson*/ true, useAutoImportProvider, function (moduleSymbol) { cancellationToken.throwIfCancellationRequested(); - var compilerOptions = program.getCompilerOptions(); - var defaultInfo = getDefaultLikeExportInfo(sourceFile, moduleSymbol, checker, compilerOptions); - if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) { - addSymbol(moduleSymbol, defaultInfo.symbol, defaultInfo.kind, checker); + var defaultInfo = getDefaultLikeExportInfo(sourceFile, moduleSymbol, checker, program.getCompilerOptions()); + if (defaultInfo && defaultInfo.name === symbolName && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) { + addSymbol(moduleSymbol, defaultInfo.symbol, defaultInfo.kind); } // check exports with the same name var exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName, moduleSymbol); if (exportSymbolWithIdenticalName && symbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { - addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */, checker); + addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */); } }); return originalSymbolToExportInfos; @@ -136956,13 +133873,7 @@ var ts; return { symbolForMeaning: defaultExport, name: name }; if (defaultExport.flags & 2097152 /* Alias */) { var aliased = checker.getImmediateAliasedSymbol(defaultExport); - if (aliased && aliased.parent) { - // - `aliased` will be undefined if the module is exporting an unresolvable name, - // but we can still offer completions for it. - // - `aliased.parent` will be undefined if the module is exporting `globalThis.something`, - // or another expression that resolves to a global. - return getDefaultExportInfoWorker(aliased, aliased.parent, checker, compilerOptions); - } + return aliased && getDefaultExportInfoWorker(aliased, ts.Debug.checkDefined(aliased.parent, "Alias targets of default exports must have a parent"), checker, compilerOptions); } if (defaultExport.escapedName !== "default" /* Default */ && defaultExport.escapedName !== "export=" /* ExportEquals */) { @@ -137018,7 +133929,7 @@ var ts; } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, canUseTypeOnlyImport) { - if (clause.kind === 196 /* ObjectBindingPattern */) { + if (clause.kind === 193 /* ObjectBindingPattern */) { if (defaultImport) { addElementToBindingPattern(clause, defaultImport, "default"); } @@ -137052,7 +133963,7 @@ var ts; else if (existingSpecifiers === null || existingSpecifiers === void 0 ? void 0 : existingSpecifiers.length) { for (var _b = 0, newSpecifiers_2 = newSpecifiers; _b < newSpecifiers_2.length; _b++) { var spec = newSpecifiers_2[_b]; - changes.insertNodeInListAfter(sourceFile, ts.last(existingSpecifiers), spec, existingSpecifiers); + changes.insertNodeAtEndOfList(sourceFile, existingSpecifiers, spec); } } else { @@ -137425,7 +134336,7 @@ var ts; }); function getNamedTupleMember(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); - return ts.findAncestor(token, function (t) { return t.kind === 192 /* NamedTupleMember */; }); + return ts.findAncestor(token, function (t) { return t.kind === 191 /* NamedTupleMember */; }); } function doChange(changes, sourceFile, namedTupleMember) { if (!namedTupleMember) { @@ -137434,11 +134345,11 @@ var ts; var unwrappedType = namedTupleMember.type; var sawOptional = false; var sawRest = false; - while (unwrappedType.kind === 180 /* OptionalType */ || unwrappedType.kind === 181 /* RestType */ || unwrappedType.kind === 186 /* ParenthesizedType */) { - if (unwrappedType.kind === 180 /* OptionalType */) { + while (unwrappedType.kind === 179 /* OptionalType */ || unwrappedType.kind === 180 /* RestType */ || unwrappedType.kind === 185 /* ParenthesizedType */) { + if (unwrappedType.kind === 179 /* OptionalType */) { sawOptional = true; } - else if (unwrappedType.kind === 181 /* RestType */) { + else if (unwrappedType.kind === 180 /* RestType */) { sawRest = true; } unwrappedType = unwrappedType.type; @@ -137462,7 +134373,7 @@ var ts; ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code, - ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code, + ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2.code, // for JSX class components ts.Diagnostics.No_overload_matches_this_call.code, // for JSX FC @@ -137509,12 +134420,6 @@ var ts; } suggestedSymbol = checker.getSuggestedSymbolForNonexistentProperty(node, containingType); } - else if (ts.isQualifiedName(parent) && parent.right === node) { - var symbol = checker.getSymbolAtLocation(parent.left); - if (symbol && symbol.flags & 1536 /* Module */) { - suggestedSymbol = checker.getSuggestedSymbolForNonexistentModule(parent.right, symbol); - } - } else if (ts.isImportSpecifier(parent) && parent.name === node) { ts.Debug.assertNode(node, ts.isIdentifier, "Expected an identifier for spelling (import)"); var importDeclaration = ts.findAncestor(node, ts.isImportDeclaration); @@ -137738,19 +134643,19 @@ var ts; } function getVariableLikeInitializer(declaration) { switch (declaration.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: return declaration.initializer; - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return declaration.initializer && (ts.isJsxExpression(declaration.initializer) ? declaration.initializer.expression : undefined); - case 289 /* ShorthandPropertyAssignment */: - case 162 /* PropertySignature */: - case 291 /* EnumMember */: - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: + case 286 /* ShorthandPropertyAssignment */: + case 161 /* PropertySignature */: + case 288 /* EnumMember */: + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: return undefined; } } @@ -137936,7 +134841,7 @@ var ts; function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, token, makeStatic) { var tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 221 /* ClassExpression */) { + if (classDeclaration.kind === 218 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -137988,7 +134893,7 @@ var ts; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 216 /* BinaryExpression */) { + if (token.parent.parent.kind === 213 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -138027,7 +134932,7 @@ var ts; } function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.factory.createKeywordTypeNode(147 /* StringKeyword */); + var stringTypeNode = ts.factory.createKeywordTypeNode(146 /* StringKeyword */); var indexingParameter = ts.factory.createParameterDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -138078,7 +134983,7 @@ var ts; */ var hasStringInitializer = ts.some(enumDeclaration.members, function (member) { var type = checker.getTypeAtLocation(member); - return !!(type && type.flags & 402653316 /* StringLike */); + return !!(type && type.flags & 132 /* StringLike */); }); var enumMember = ts.factory.createEnumMember(token, hasStringInitializer ? ts.factory.createStringLiteral(token.text) : undefined); changes.replaceNode(enumDeclaration.getSourceFile(), enumDeclaration, ts.factory.updateEnumDeclaration(enumDeclaration, enumDeclaration.decorators, enumDeclaration.modifiers, enumDeclaration.name, ts.concatenate(enumDeclaration.members, ts.singleElementArray(enumMember))), { @@ -138602,7 +135507,7 @@ var ts; if (!isValidCharacter(character)) { return; } - var replacement = useHtmlEntity ? htmlEntity[character] : "{" + ts.quote(sourceFile, preferences, character) + "}"; + var replacement = useHtmlEntity ? htmlEntity[character] : "{" + ts.quote(character, preferences) + "}"; changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -138744,7 +135649,7 @@ var ts; }, }); function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */)); + changes.replaceNode(sourceFile, token.parent, ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */)); } function createDeleteFix(changes, diag) { return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations); @@ -138760,7 +135665,7 @@ var ts; return ts.isVariableDeclarationList(token.parent) && ts.first(token.parent.getChildren(sourceFile)) === token; } function deleteEntireVariableStatement(changes, sourceFile, node) { - changes.delete(sourceFile, node.parent.kind === 232 /* VariableStatement */ ? node.parent : node); + changes.delete(sourceFile, node.parent.kind === 229 /* VariableStatement */ ? node.parent : node); } function deleteDestructuringElements(changes, sourceFile, node) { ts.forEach(node.elements, function (n) { return changes.delete(sourceFile, n); }); @@ -138785,14 +135690,14 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 160 /* Parameter */: - case 159 /* TypeParameter */: + case 159 /* Parameter */: + case 158 /* TypeParameter */: return true; - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: return true; } } @@ -138824,10 +135729,12 @@ var ts; } function tryDeleteParameter(changes, sourceFile, p, checker, sourceFiles, isFixAll) { if (isFixAll === void 0) { isFixAll = false; } - if (mayDeleteParameter(checker, sourceFile, p, isFixAll)) { - if (p.modifiers && p.modifiers.length > 0 && - (!ts.isIdentifier(p.name) || ts.FindAllReferences.Core.isSymbolReferencedInFile(p.name, checker, sourceFile))) { - p.modifiers.forEach(function (modifier) { return changes.deleteModifier(sourceFile, modifier); }); + if (mayDeleteParameter(p, checker, isFixAll)) { + if (p.modifiers && p.modifiers.length > 0 + && (!ts.isIdentifier(p.name) || ts.FindAllReferences.Core.isSymbolReferencedInFile(p.name, checker, sourceFile))) { + p.modifiers.forEach(function (modifier) { + changes.deleteModifier(sourceFile, modifier); + }); } else { changes.delete(sourceFile, p); @@ -138835,28 +135742,29 @@ var ts; } } } - function mayDeleteParameter(checker, sourceFile, parameter, isFixAll) { - var parent = parameter.parent; + function mayDeleteParameter(p, checker, isFixAll) { + var parent = p.parent; switch (parent.kind) { - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // Don't remove a parameter if this overrides something. var symbol = checker.getSymbolAtLocation(parent.name); if (ts.isMemberSymbolInBaseType(symbol, checker)) return false; // falls through - case 166 /* Constructor */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: return true; - case 251 /* FunctionDeclaration */: { - if (parent.name && isCallbackLike(checker, sourceFile, parent.name)) { - return isLastParameter(parent, parameter, isFixAll); - } - return true; - } - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: { // Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused. - return isLastParameter(parent, parameter, isFixAll); - case 168 /* SetAccessor */: + var parameters = parent.parameters; + var index = parameters.indexOf(p); + ts.Debug.assert(index !== -1, "The parameter should already be in the list"); + return isFixAll + ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 78 /* Identifier */ && !p.symbol.isReferenced; }) + : index === parameters.length - 1; + } + case 167 /* SetAccessor */: // Setter must have a parameter return false; default: @@ -138871,19 +135779,6 @@ var ts; } }); } - function isCallbackLike(checker, sourceFile, name) { - return !!ts.FindAllReferences.Core.eachSymbolReferenceInFile(name, checker, sourceFile, function (reference) { - return ts.isIdentifier(reference) && ts.isCallExpression(reference.parent) && reference.parent.arguments.indexOf(reference) >= 0; - }); - } - function isLastParameter(func, parameter, isFixAll) { - var parameters = func.parameters; - var index = parameters.indexOf(parameter); - ts.Debug.assert(index !== -1, "The parameter should already be in the list"); - return isFixAll ? - parameters.slice(index + 1).every(function (p) { return ts.isIdentifier(p.name) && !p.symbol.isReferenced; }) : - index === parameters.length - 1; - } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -138918,7 +135813,7 @@ var ts; var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent; if (!ts.isBlock(statement.parent) || statement === ts.first(statement.parent.statements)) { switch (container.kind) { - case 234 /* IfStatement */: + case 231 /* IfStatement */: if (container.elseStatement) { if (ts.isBlock(statement.parent)) { break; @@ -138929,8 +135824,8 @@ var ts; return; } // falls through - case 236 /* WhileStatement */: - case 237 /* ForStatement */: + case 233 /* WhileStatement */: + case 234 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -139003,7 +135898,7 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 305 /* JSDocNullableType */) { + if (typeNode.kind === 301 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); @@ -139023,7 +135918,7 @@ var ts; if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 305 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + var fixedType = typeNode.kind === 301 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -139040,22 +135935,22 @@ var ts; // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 224 /* AsExpression */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 251 /* FunctionDeclaration */: - case 167 /* GetAccessor */: - case 171 /* IndexSignature */: - case 190 /* MappedType */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 168 /* SetAccessor */: - case 254 /* TypeAliasDeclaration */: - case 206 /* TypeAssertionExpression */: - case 249 /* VariableDeclaration */: + case 221 /* AsExpression */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 248 /* FunctionDeclaration */: + case 166 /* GetAccessor */: + case 170 /* IndexSignature */: + case 189 /* MappedType */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 167 /* SetAccessor */: + case 251 /* TypeAliasDeclaration */: + case 203 /* TypeAssertionExpression */: + case 246 /* VariableDeclaration */: return true; default: return false; @@ -139157,14 +136052,14 @@ var ts; } var insertBefore; switch (containingFunction.kind) { - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 97 /* FunctionKeyword */, sourceFile); break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -139243,7 +136138,7 @@ var ts; else { ts.Debug.fail("fixPropertyOverrideAccessor codefix got unexpected error code " + code); } - return codefix.generateAccessorFromProperty(file, context.program, startPosition, endPosition, context, ts.Diagnostics.Generate_get_and_set_accessors.message); + return codefix.generateAccessorFromProperty(file, startPosition, endPosition, context, ts.Diagnostics.Generate_get_and_set_accessors.message); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -139497,7 +136392,7 @@ var ts; function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (ts.isInJSFile(sourceFile) && declaration.kind !== 162 /* PropertySignature */) { + if (ts.isInJSFile(sourceFile) && declaration.kind !== 161 /* PropertySignature */) { var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration; if (!parent) { return; @@ -139546,14 +136441,14 @@ var ts; return !!merged; }); }); var tag = ts.factory.createJSDocComment(comments.join("\n"), ts.factory.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags))); - var jsDocNode = parent.kind === 209 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; + var jsDocNode = parent.kind === 206 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; jsDocNode.jsDoc = parent.jsDoc; jsDocNode.jsDocCache = parent.jsDocCache; changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag); } codefix.addJSDocTags = addJSDocTags; function getJsDocNodeForArrowFunction(signature) { - if (signature.parent.kind === 163 /* PropertyDeclaration */) { + if (signature.parent.kind === 162 /* PropertyDeclaration */) { return signature.parent; } return signature.parent.parent; @@ -139563,14 +136458,14 @@ var ts; return undefined; } switch (oldTag.kind) { - case 326 /* JSDocParameterTag */: { + case 322 /* JSDocParameterTag */: { var oldParam = oldTag; var newParam = newTag; return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts.factory.createJSDocParameterTag(/*tagName*/ undefined, newParam.name, /*isBracketed*/ false, newParam.typeExpression, newParam.isNameFirst, oldParam.comment) : undefined; } - case 327 /* JSDocReturnTag */: + case 323 /* JSDocReturnTag */: return ts.factory.createJSDocReturnTag(/*tagName*/ undefined, newTag.typeExpression, oldTag.comment); } } @@ -139595,18 +136490,18 @@ var ts; function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { var searchToken; switch (containingFunction.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: searchToken = ts.findChildOfKind(containingFunction, 132 /* ConstructorKeyword */, sourceFile); break; - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: var parent = containingFunction.parent; searchToken = ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) ? parent.name : containingFunction.name; break; - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: searchToken = containingFunction.name; break; } @@ -139748,24 +136643,24 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: inferTypeFromExpressionStatement(node, usage); break; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } @@ -139773,20 +136668,20 @@ var ts; inferTypeFromContextualType(node, usage); } break; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { var _a = node.parent, name = _a.name, initializer = _a.initializer; if (node === name) { if (initializer) { // This can happen for `let x = null;` which still has an implicit-any error. @@ -139881,7 +136776,7 @@ var ts; else if (otherOperandType.flags & 296 /* NumberLike */) { usage.isNumber = true; } - else if (otherOperandType.flags & 402653316 /* StringLike */) { + else if (otherOperandType.flags & 132 /* StringLike */) { usage.isString = true; } else if (otherOperandType.flags & 1 /* Any */) { @@ -139908,7 +136803,7 @@ var ts; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: if (node === parent.left && - (node.parent.parent.kind === 249 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 246 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usage, checker.getTypeAtLocation(parent.right)); @@ -139936,7 +136831,7 @@ var ts; } } calculateUsageOfNode(parent, call.return_); - if (parent.kind === 203 /* CallExpression */) { + if (parent.kind === 200 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { @@ -140379,8 +137274,8 @@ var ts; var ambient = !!(enclosingDeclaration.flags & 8388608 /* Ambient */); var quotePreference = ts.getQuotePreference(sourceFile, preferences); switch (declaration.kind) { - case 162 /* PropertySignature */: - case 163 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 162 /* PropertyDeclaration */: var flags = quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined; var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { @@ -140394,8 +137289,8 @@ var ts; /*decorators*/ undefined, modifiers, name, optional ? ts.factory.createToken(57 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: { + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: { var typeNode_1 = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); var allAccessors = ts.getAllAccessorDeclarations(declarations, declaration); var orderedAccessors = allAccessors.secondAccessor @@ -140424,8 +137319,8 @@ var ts; } break; } - case 164 /* MethodSignature */: - case 165 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 164 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -140471,7 +137366,7 @@ var ts; var checker = program.getTypeChecker(); var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions()); var flags = 1 /* NoTruncation */ | 1073741824 /* NoUndefinedOptionalParameterType */ | 256 /* SuppressAnyReturnType */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0); - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 165 /* MethodDeclaration */, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 164 /* MethodDeclaration */, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -140720,8 +137615,8 @@ var ts; (function (ts) { var codefix; (function (codefix) { - function generateAccessorFromProperty(file, program, start, end, context, _actionName) { - var fieldInfo = getAccessorConvertiblePropertyAtPosition(file, program, start, end); + function generateAccessorFromProperty(file, start, end, context, _actionName) { + var fieldInfo = getAccessorConvertiblePropertyAtPosition(file, start, end); if (!fieldInfo || !fieldInfo.info) return undefined; var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); @@ -140744,7 +137639,7 @@ var ts; fieldModifiers = createModifiers(prepareModifierFlagsForField(modifierFlags)); } } - updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, fieldModifiers); + updateFieldDeclaration(changeTracker, file, declaration, fieldName, fieldModifiers); var getAccessor = generateGetAccessor(fieldName, accessorName, type, accessorModifiers, isStatic, container); ts.suppressLeadingAndTrailingTrivia(getAccessor); insertAccessor(changeTracker, file, getAccessor, declaration, container); @@ -140793,7 +137688,7 @@ var ts; modifierFlags |= 8 /* Private */; return modifierFlags; } - function getAccessorConvertiblePropertyAtPosition(file, program, start, end, considerEmptySpans) { + function getAccessorConvertiblePropertyAtPosition(file, start, end, considerEmptySpans) { if (considerEmptySpans === void 0) { considerEmptySpans = true; } var node = ts.getTokenAtPosition(file, start); var cursorRequest = start === end && considerEmptySpans; @@ -140823,8 +137718,8 @@ var ts; info: { isStatic: ts.hasStaticModifier(declaration), isReadonly: ts.hasEffectiveReadonlyModifier(declaration), - type: getDeclarationType(declaration, program), - container: declaration.kind === 160 /* Parameter */ ? declaration.parent.parent : declaration.parent, + type: ts.getTypeAnnotationNode(declaration), + container: declaration.kind === 159 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, @@ -140852,17 +137747,17 @@ var ts; ts.factory.createExpressionStatement(ts.factory.createAssignment(createAccessorAccessExpression(fieldName, isStatic, container), ts.factory.createIdentifier("value"))) ], /*multiLine*/ true)); } - function updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) { - var property = ts.factory.updatePropertyDeclaration(declaration, declaration.decorators, modifiers, fieldName, declaration.questionToken || declaration.exclamationToken, type, declaration.initializer); + function updatePropertyDeclaration(changeTracker, file, declaration, fieldName, modifiers) { + var property = ts.factory.updatePropertyDeclaration(declaration, declaration.decorators, modifiers, fieldName, declaration.questionToken || declaration.exclamationToken, declaration.type, declaration.initializer); changeTracker.replaceNode(file, declaration, property); } function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) { var assignment = ts.factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer); changeTracker.replacePropertyAssignment(file, declaration, assignment); } - function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) { + function updateFieldDeclaration(changeTracker, file, declaration, fieldName, modifiers) { if (ts.isPropertyDeclaration(declaration)) { - updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers); + updatePropertyDeclaration(changeTracker, file, declaration, fieldName, modifiers); } else if (ts.isPropertyAssignment(declaration)) { updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName); @@ -140895,18 +137790,6 @@ var ts; } }); } - function getDeclarationType(declaration, program) { - var typeNode = ts.getTypeAnnotationNode(declaration); - if (ts.isPropertyDeclaration(declaration) && typeNode && declaration.questionToken) { - var typeChecker = program.getTypeChecker(); - var type = typeChecker.getTypeFromTypeNode(typeNode); - if (!typeChecker.isTypeAssignableTo(typeChecker.getUndefinedType(), type)) { - var types = ts.isUnionTypeNode(typeNode) ? typeNode.types : [typeNode]; - return ts.factory.createUnionTypeNode(__spreadArrays(types, [ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)])); - } - } - return typeNode; - } function getAllSupers(decl, checker) { var res = []; while (decl) { @@ -140960,7 +137843,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 203 /* CallExpression */ : 204 /* NewExpression */; + var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 200 /* CallExpression */ : 201 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind; }); if (!node) { return []; @@ -141079,7 +137962,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, ts.Diagnostics.Add_undefined_type_to_all_uninitialized_properties); } function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { - var undefinedTypeNode = ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */); + var undefinedTypeNode = ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */); var type = propertyDeclaration.type; // TODO: GH#18217 var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode]; changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.factory.createUnionTypeNode(types)); @@ -141294,7 +138177,7 @@ var ts; function getImportTypeNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); ts.Debug.assert(token.kind === 99 /* ImportKeyword */, "This token should be an ImportKeyword"); - ts.Debug.assert(token.parent.kind === 195 /* ImportType */, "Token parent should be an ImportType"); + ts.Debug.assert(token.parent.kind === 192 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange(changes, sourceFile, importType) { @@ -141426,8 +138309,7 @@ var ts; var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); }); var parameter = ts.first(indexSignature.parameters); var mappedTypeParameter = ts.factory.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type); - var mappedIntersectionType = ts.factory.createMappedTypeNode(ts.hasEffectiveReadonlyModifier(indexSignature) ? ts.factory.createModifier(142 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, - /*nameType*/ undefined, indexSignature.questionToken, indexSignature.type); + var mappedIntersectionType = ts.factory.createMappedTypeNode(ts.hasEffectiveReadonlyModifier(indexSignature) ? ts.factory.createModifier(141 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); var intersectionType = ts.factory.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [ mappedIntersectionType ], (otherMembers.length ? [ts.factory.createTypeLiteralNode(otherMembers)] : ts.emptyArray))); @@ -141616,90 +138498,6 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; -(function (ts) { - var codefix; - (function (codefix) { - var fixName = "addVoidToPromise"; - var fixId = "addVoidToPromise"; - var errorCodes = [ - ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code - ]; - codefix.registerCodeFix({ - errorCodes: errorCodes, - fixIds: [fixId], - getCodeActions: function (context) { - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span, context.program); }); - if (changes.length > 0) { - return [codefix.createCodeFixAction(fixName, changes, ts.Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId, ts.Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]; - } - }, - getAllCodeActions: function (context) { - return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag, context.program, new ts.Set()); }); - } - }); - function makeChange(changes, sourceFile, span, program, seen) { - var node = ts.getTokenAtPosition(sourceFile, span.start); - if (!ts.isIdentifier(node) || !ts.isCallExpression(node.parent) || node.parent.expression !== node || node.parent.arguments.length !== 0) - return; - var checker = program.getTypeChecker(); - var symbol = checker.getSymbolAtLocation(node); - // decl should be `new Promise(() => {})` - var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration; - if (!decl || !ts.isParameter(decl) || !ts.isNewExpression(decl.parent.parent)) - return; - // no need to make this change if we have already seen this parameter. - if (seen === null || seen === void 0 ? void 0 : seen.has(decl)) - return; - seen === null || seen === void 0 ? void 0 : seen.add(decl); - var typeArguments = getEffectiveTypeArguments(decl.parent.parent); - if (ts.some(typeArguments)) { - // append ` | void` to type argument - var typeArgument = typeArguments[0]; - var needsParens = !ts.isUnionTypeNode(typeArgument) && !ts.isParenthesizedTypeNode(typeArgument) && - ts.isParenthesizedTypeNode(ts.factory.createUnionTypeNode([typeArgument, ts.factory.createKeywordTypeNode(113 /* VoidKeyword */)]).types[0]); - if (needsParens) { - changes.insertText(sourceFile, typeArgument.pos, "("); - } - changes.insertText(sourceFile, typeArgument.end, needsParens ? ") | void" : " | void"); - } - else { - // make sure the Promise is type is untyped (i.e., `unknown`) - var signature = checker.getResolvedSignature(node.parent); - var parameter = signature === null || signature === void 0 ? void 0 : signature.parameters[0]; - var parameterType = parameter && checker.getTypeOfSymbolAtLocation(parameter, decl.parent.parent); - if (ts.isInJSFile(decl)) { - if (!parameterType || parameterType.flags & 3 /* AnyOrUnknown */) { - // give the expression a type - changes.insertText(sourceFile, decl.parent.parent.end, ")"); - changes.insertText(sourceFile, ts.skipTrivia(sourceFile.text, decl.parent.parent.pos), "/** @type {Promise} */("); - } - } - else { - if (!parameterType || parameterType.flags & 2 /* Unknown */) { - // add `void` type argument - changes.insertText(sourceFile, decl.parent.parent.expression.end, ""); - } - } - } - } - function getEffectiveTypeArguments(node) { - var _a; - if (ts.isInJSFile(node)) { - if (ts.isParenthesizedExpression(node.parent)) { - var jsDocType = (_a = ts.getJSDocTypeTag(node.parent)) === null || _a === void 0 ? void 0 : _a.typeExpression.type; - if (jsDocType && ts.isTypeReferenceNode(jsDocType) && ts.isIdentifier(jsDocType.typeName) && ts.idText(jsDocType.typeName) === "Promise") { - return jsDocType.typeArguments; - } - } - } - else { - return node.typeArguments; - } - } - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; (function (ts) { var refactor; (function (refactor) { @@ -141747,16 +138545,16 @@ var ts; return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.This_file_already_has_a_default_export) }; } switch (exportNode.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 256 /* ModuleDeclaration */: { + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 253 /* ModuleDeclaration */: { var node = exportNode; return node.name && ts.isIdentifier(node.name) ? { info: { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } } : undefined; } - case 232 /* VariableStatement */: { + case 229 /* VariableStatement */: { var vs = exportNode; // Must be `export const x = something;`. if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { @@ -141784,23 +138582,22 @@ var ts; else { var exportKeyword = ts.Debug.checkDefined(ts.findModifier(exportNode, 92 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.factory.createToken(87 /* DefaultKeyword */)); break; - case 232 /* VariableStatement */: - // If 'x' isn't used in this file and doesn't have type definition, `export const x = 0;` --> `export default 0;` - var decl = ts.first(exportNode.declarationList.declarations); - if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile) && !decl.type) { + case 229 /* VariableStatement */: + // If 'x' isn't used in this file, `export const x = 0;` --> `export default 0;` + if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile)) { // We checked in `getInfo` that an initializer exists. - changes.replaceNode(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.Debug.checkDefined(decl.initializer, "Initializer was previously known to be present"))); + changes.replaceNode(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.Debug.checkDefined(ts.first(exportNode.declarationList.declarations).initializer, "Initializer was previously known to be present"))); break; } // falls through - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 256 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 253 /* ModuleDeclaration */: // `export type T = number;` -> `type T = number; export default T;` changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.factory.createIdentifier(exportName.text))); @@ -141827,18 +138624,18 @@ var ts; function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { var parent = ref.parent; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: // `a.default` --> `a.foo` changes.replaceNode(importingSourceFile, ref, ts.factory.createIdentifier(exportName)); break; - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: { + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: { var spec = parent; // `default as foo` --> `foo`, `default as bar` --> `foo as bar` changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 262 /* ImportClause */: { + case 259 /* ImportClause */: { var clause = parent; ts.Debug.assert(clause.name === ref, "Import clause name should match provided ref"); var spec = makeImportSpecifier(exportName, ref.text); @@ -141847,7 +138644,7 @@ var ts; // `import foo from "./a";` --> `import { foo } from "./a";` changes.replaceNode(importingSourceFile, ref, ts.factory.createNamedImports([spec])); } - else if (namedBindings.kind === 263 /* NamespaceImport */) { + else if (namedBindings.kind === 260 /* NamespaceImport */) { // `import foo, * as a from "./a";` --> `import * as a from ".a/"; import { foo } from "./a";` changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); var quotePreference = ts.isStringLiteral(clause.parent.moduleSpecifier) ? ts.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; @@ -141868,11 +138665,11 @@ var ts; function changeNamedToDefaultImport(importingSourceFile, ref, changes) { var parent = ref.parent; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: // `a.foo` --> `a.default` changes.replaceNode(importingSourceFile, ref, ts.factory.createIdentifier("default")); break; - case 265 /* ImportSpecifier */: { + case 262 /* ImportSpecifier */: { // `import { foo } from "./a";` --> `import foo from "./a";` // `import { foo as bar } from "./a";` --> `import bar from "./a";` var defaultImport = ts.factory.createIdentifier(parent.name.text); @@ -141885,7 +138682,7 @@ var ts; } break; } - case 270 /* ExportSpecifier */: { + case 267 /* ExportSpecifier */: { // `export { foo } from "./a";` --> `export { default as foo } from "./a";` // `export { foo as bar } from "./a";` --> `export { default as bar } from "./a";` // `export { foo as default } from "./a";` --> `export { default } from "./a";` @@ -141919,8 +138716,8 @@ var ts; if (!i) return ts.emptyArray; if (i.error === undefined) { - var description = i.info.kind === 263 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; - var actionName = i.info.kind === 263 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; + var description = i.info.kind === 260 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; + var actionName = i.info.kind === 260 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }]; } if (context.preferences.provideRefactorNotApplicableReason) { @@ -141959,7 +138756,7 @@ var ts; } function doChange(sourceFile, program, changes, toConvert) { var checker = program.getTypeChecker(); - if (toConvert.kind === 263 /* NamespaceImport */) { + if (toConvert.kind === 260 /* NamespaceImport */) { doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())); } else { @@ -142130,6 +138927,7 @@ var ts; if (!finalExpression || checker.isNullableType(checker.getTypeAtLocation(finalExpression))) { return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_convertible_access_expression) }; } + ; if ((ts.isPropertyAccessExpression(condition) || ts.isIdentifier(condition)) && getMatchingStart(condition, finalExpression.expression)) { return { info: { finalExpression: finalExpression, occurrences: [condition], expression: expression } }; @@ -142176,25 +138974,23 @@ var ts; * Returns subchain if chain begins with subchain syntactically. */ function getMatchingStart(chain, subchain) { - if (!ts.isIdentifier(subchain) && !ts.isPropertyAccessExpression(subchain) && !ts.isElementAccessExpression(subchain)) { - return undefined; - } - return chainStartsWith(chain, subchain) ? subchain : undefined; + return (ts.isIdentifier(subchain) || ts.isPropertyAccessExpression(subchain)) && + chainStartsWith(chain, subchain) ? subchain : undefined; } /** * Returns true if chain begins with subchain syntactically. */ function chainStartsWith(chain, subchain) { // skip until we find a matching identifier. - while (ts.isCallExpression(chain) || ts.isPropertyAccessExpression(chain) || ts.isElementAccessExpression(chain)) { - if (getTextOfChainNode(chain) === getTextOfChainNode(subchain)) + while (ts.isCallExpression(chain) || ts.isPropertyAccessExpression(chain)) { + var subchainName = ts.isPropertyAccessExpression(subchain) ? subchain.name.getText() : subchain.getText(); + if (ts.isPropertyAccessExpression(chain) && chain.name.getText() === subchainName) break; chain = chain.expression; } - // check that the chains match at each access. Call chains in subchain are not valid. - while ((ts.isPropertyAccessExpression(chain) && ts.isPropertyAccessExpression(subchain)) || - (ts.isElementAccessExpression(chain) && ts.isElementAccessExpression(subchain))) { - if (getTextOfChainNode(chain) !== getTextOfChainNode(subchain)) + // check that the chains match at each access. Call chains in subchain are not valid. + while (ts.isPropertyAccessExpression(chain) && ts.isPropertyAccessExpression(subchain)) { + if (chain.name.getText() !== subchain.name.getText()) return false; chain = chain.expression; subchain = subchain.expression; @@ -142202,18 +138998,6 @@ var ts; // check if we have reached a final identifier. return ts.isIdentifier(chain) && ts.isIdentifier(subchain) && chain.getText() === subchain.getText(); } - function getTextOfChainNode(node) { - if (ts.isIdentifier(node) || ts.isStringOrNumericLiteralLike(node)) { - return node.getText(); - } - if (ts.isPropertyAccessExpression(node)) { - return getTextOfChainNode(node.name); - } - if (ts.isElementAccessExpression(node)) { - return getTextOfChainNode(node.argumentExpression); - } - return undefined; - } /** * Find the least ancestor of the input node that is a valid type for extraction and contains the input span. */ @@ -142266,7 +139050,7 @@ var ts; return getFinalExpressionInChain(node.left); } // foo && |foo.bar()()| - nested calls are treated like further accesses. - else if ((ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) || ts.isCallExpression(node)) && !ts.isOptionalChain(node)) { + else if ((ts.isPropertyAccessExpression(node) || ts.isCallExpression(node)) && !ts.isOptionalChain(node)) { return node; } return undefined; @@ -142275,7 +139059,7 @@ var ts; * Creates an access chain from toConvert with '?.' accesses at expressions appearing in occurrences. */ function convertOccurrences(checker, toConvert, occurrences) { - if (ts.isPropertyAccessExpression(toConvert) || ts.isElementAccessExpression(toConvert) || ts.isCallExpression(toConvert)) { + if (ts.isPropertyAccessExpression(toConvert) || ts.isCallExpression(toConvert)) { var chain = convertOccurrences(checker, toConvert.expression, occurrences); var lastOccurrence = occurrences.length > 0 ? occurrences[occurrences.length - 1] : undefined; var isOccurrence = (lastOccurrence === null || lastOccurrence === void 0 ? void 0 : lastOccurrence.getText()) === toConvert.expression.getText(); @@ -142291,11 +139075,6 @@ var ts; ts.factory.createPropertyAccessChain(chain, ts.factory.createToken(28 /* QuestionDotToken */), toConvert.name) : ts.factory.createPropertyAccessChain(chain, toConvert.questionDotToken, toConvert.name); } - else if (ts.isElementAccessExpression(toConvert)) { - return isOccurrence ? - ts.factory.createElementAccessChain(chain, ts.factory.createToken(28 /* QuestionDotToken */), toConvert.argumentExpression) : - ts.factory.createElementAccessChain(chain, toConvert.questionDotToken, toConvert.argumentExpression); - } } return toConvert; } @@ -142303,7 +139082,7 @@ var ts; var finalExpression = info.finalExpression, occurrences = info.occurrences, expression = info.expression; var firstOccurrence = occurrences[occurrences.length - 1]; var convertedChain = convertOccurrences(checker, finalExpression, occurrences); - if (convertedChain && (ts.isPropertyAccessExpression(convertedChain) || ts.isElementAccessExpression(convertedChain) || ts.isCallExpression(convertedChain))) { + if (convertedChain && (ts.isPropertyAccessExpression(convertedChain) || ts.isCallExpression(convertedChain))) { if (ts.isBinaryExpression(expression)) { changes.replaceNodeRange(sourceFile, firstOccurrence, finalExpression, convertedChain); } @@ -142348,27 +139127,27 @@ var ts; var lastDeclaration = signatureDecls[signatureDecls.length - 1]; var updated = lastDeclaration; switch (lastDeclaration.kind) { - case 164 /* MethodSignature */: { + case 163 /* MethodSignature */: { updated = ts.factory.updateMethodSignature(lastDeclaration, lastDeclaration.modifiers, lastDeclaration.name, lastDeclaration.questionToken, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); break; } - case 165 /* MethodDeclaration */: { + case 164 /* MethodDeclaration */: { updated = ts.factory.updateMethodDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, lastDeclaration.asteriskToken, lastDeclaration.name, lastDeclaration.questionToken, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type, lastDeclaration.body); break; } - case 169 /* CallSignature */: { + case 168 /* CallSignature */: { updated = ts.factory.updateCallSignature(lastDeclaration, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); break; } - case 166 /* Constructor */: { + case 165 /* Constructor */: { updated = ts.factory.updateConstructorDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.body); break; } - case 170 /* ConstructSignature */: { + case 169 /* ConstructSignature */: { updated = ts.factory.updateConstructSignature(lastDeclaration, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); break; } - case 251 /* FunctionDeclaration */: { + case 248 /* FunctionDeclaration */: { updated = ts.factory.updateFunctionDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, lastDeclaration.asteriskToken, lastDeclaration.name, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type, lastDeclaration.body); break; } @@ -142420,12 +139199,12 @@ var ts; } function isConvertableSignatureDeclaration(d) { switch (d.kind) { - case 164 /* MethodSignature */: - case 165 /* MethodDeclaration */: - case 169 /* CallSignature */: - case 166 /* Constructor */: - case 170 /* ConstructSignature */: - case 251 /* FunctionDeclaration */: + case 163 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 168 /* CallSignature */: + case 165 /* Constructor */: + case 169 /* ConstructSignature */: + case 248 /* FunctionDeclaration */: return true; } return false; @@ -142788,20 +139567,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 163 /* PropertyDeclaration */) { + if (current.kind === 162 /* PropertyDeclaration */) { if (ts.hasSyntacticModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 160 /* Parameter */) { + else if (current.kind === 159 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 166 /* Constructor */) { + if (ctorOrMethod.kind === 165 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 165 /* MethodDeclaration */) { + else if (current.kind === 164 /* MethodDeclaration */) { if (ts.hasSyntacticModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -142844,7 +139623,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 249 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 246 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasSyntacticModifier(declaringNode, 1 /* Export */)) { // TODO: GH#18217 Silly to use `errors ||` since it's definitely not defined (see top of `visit`) // Also, if we're only pushing one error, just use `let error: Diagnostic | undefined`! @@ -142856,16 +139635,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; - case 266 /* ExportAssignment */: - (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractExportedEntity)); - return true; case 105 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 203 /* CallExpression */) { + if (node.parent.kind === 200 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); // TODO:GH#18217 if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -142877,7 +139653,7 @@ var ts; rangeFacts |= RangeFacts.UsesThis; } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // check if arrow function uses this ts.forEachChild(node, function check(n) { if (ts.isThis(n)) { @@ -142891,39 +139667,39 @@ var ts; } }); // falls through - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); } // falls through - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // do not dive into functions or classes return false; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 234 /* IfStatement */: + case 231 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 230 /* Block */: - if (node.parent && node.parent.kind === 247 /* TryStatement */ && node.parent.finallyBlock === node) { + case 227 /* Block */: + if (node.parent && node.parent.kind === 244 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 285 /* DefaultClause */: - case 284 /* CaseClause */: + case 282 /* DefaultClause */: + case 281 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -142935,19 +139711,19 @@ var ts; break; } switch (node.kind) { - case 187 /* ThisType */: + case 186 /* ThisType */: case 107 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 245 /* LabeledStatement */: { + case 242 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); ts.forEachChild(node, visit); seenLabels.pop(); break; } - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: { + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: { var label = node.label; if (label) { if (!ts.contains(seenLabels, label.escapedText)) { @@ -142956,20 +139732,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 241 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 238 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -143023,7 +139799,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 160 /* Parameter */) { + if (current.kind === 159 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -143034,7 +139810,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 297 /* SourceFile */) { + if (current.kind === 294 /* SourceFile */) { return scopes; } } @@ -143124,32 +139900,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return "constructor"; - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : ts.ANONYMOUS; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return "arrow function"; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return "method '" + scope.name.getText() + "'"; - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 252 /* ClassDeclaration */ + return scope.kind === 249 /* ClassDeclaration */ ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 257 /* ModuleBlock */ + return scope.kind === 254 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -143375,9 +140151,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 150 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 149 /* UndefinedKeyword */; }) ? clone - : ts.factory.createUnionTypeNode([clone, ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)]); + : ts.factory.createUnionTypeNode([clone, ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */)]); } } /** @@ -143406,7 +140182,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.factory.createModifier(123 /* StaticKeyword */)); } - modifiers.push(ts.factory.createModifier(142 /* ReadonlyKeyword */)); + modifiers.push(ts.factory.createModifier(141 /* ReadonlyKeyword */)); var newVariable = ts.factory.createPropertyDeclaration( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -143438,7 +140214,7 @@ var ts; var localReference = ts.factory.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); } - else if (node.parent.kind === 233 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 230 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.factory.createVariableStatement( @@ -143457,7 +140233,7 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 233 /* ExpressionStatement */) { + if (node.parent.kind === 230 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. changeTracker.delete(context.file, node.parent); } @@ -143784,7 +140560,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: new ts.Map(), typeParameterUsages: new ts.Map(), substitutions: new ts.Map() }); substitutionsPerScope.push(new ts.Map()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 251 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 248 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -144103,30 +140879,30 @@ var ts; function isExtractableExpression(node) { var parent = node.parent; switch (parent.kind) { - case 291 /* EnumMember */: + case 288 /* EnumMember */: return false; } switch (node.kind) { case 10 /* StringLiteral */: - return parent.kind !== 261 /* ImportDeclaration */ && - parent.kind !== 265 /* ImportSpecifier */; - case 220 /* SpreadElement */: - case 196 /* ObjectBindingPattern */: - case 198 /* BindingElement */: + return parent.kind !== 258 /* ImportDeclaration */ && + parent.kind !== 262 /* ImportSpecifier */; + case 217 /* SpreadElement */: + case 193 /* ObjectBindingPattern */: + case 195 /* BindingElement */: return false; case 78 /* Identifier */: - return parent.kind !== 198 /* BindingElement */ && - parent.kind !== 265 /* ImportSpecifier */ && - parent.kind !== 270 /* ExportSpecifier */; + return parent.kind !== 195 /* BindingElement */ && + parent.kind !== 262 /* ImportSpecifier */ && + parent.kind !== 267 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 230 /* Block */: - case 297 /* SourceFile */: - case 257 /* ModuleBlock */: - case 284 /* CaseClause */: + case 227 /* Block */: + case 294 /* SourceFile */: + case 254 /* ModuleBlock */: + case 281 /* CaseClause */: return true; default: return false; @@ -144259,7 +141035,7 @@ var ts; if (symbol) { var declaration = ts.cast(ts.first(symbol.declarations), ts.isTypeParameterDeclaration); if (rangeContainsSkipTrivia(statement, declaration, file) && !rangeContainsSkipTrivia(selection, declaration, file)) { - ts.pushIfUnique(result, declaration); + result.push(declaration); } } } @@ -144301,18 +141077,16 @@ var ts; /* decorators */ undefined, /* modifiers */ undefined, name, typeParameters.map(function (id) { return ts.factory.updateTypeParameterDeclaration(id, id.name, id.constraint, /* defaultType */ undefined); }), selection); changes.insertNodeBefore(file, firstStatement, ts.ignoreSourceNewlines(newTypeNode), /* blankLineBetween */ true); - changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); })), { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude, trailingTriviaOption: ts.textChanges.TrailingTriviaOption.ExcludeWhitespace }); + changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); }))); } function doInterfaceChange(changes, file, name, info) { - var _a; var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters, typeElements = info.typeElements; var newTypeNode = ts.factory.createInterfaceDeclaration( /* decorators */ undefined, /* modifiers */ undefined, name, typeParameters, /* heritageClauses */ undefined, typeElements); - ts.setTextRange(newTypeNode, (_a = typeElements[0]) === null || _a === void 0 ? void 0 : _a.parent); changes.insertNodeBefore(file, firstStatement, ts.ignoreSourceNewlines(newTypeNode), /* blankLineBetween */ true); - changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); })), { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude, trailingTriviaOption: ts.textChanges.TrailingTriviaOption.ExcludeWhitespace }); + changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); }))); } function doTypedefChange(changes, file, name, info) { var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters; @@ -144342,10 +141116,10 @@ var ts; getEditsForAction: function (context, actionName) { if (!context.endPosition) return undefined; - var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition); + var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.startPosition, context.endPosition); if (!info || !info.info) return undefined; - var edits = ts.codefix.generateAccessorFromProperty(context.file, context.program, context.startPosition, context.endPosition, context, actionName); + var edits = ts.codefix.generateAccessorFromProperty(context.file, context.startPosition, context.endPosition, context, actionName); if (!edits) return undefined; var renameFilename = context.file.fileName; @@ -144357,7 +141131,7 @@ var ts; getAvailableActions: function (context) { if (!context.endPosition) return ts.emptyArray; - var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition, context.triggerReason === "invoked"); + var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.startPosition, context.endPosition, context.triggerReason === "invoked"); if (!info) return ts.emptyArray; if (!info.error) { @@ -144443,6 +141217,7 @@ var ts; changes.createNewFile(oldFile, ts.combinePaths(currentDirectory, newFileNameWithExtension), getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences)); addNewFileToTsconfig(program, changes, oldFile.fileName, newFileNameWithExtension, ts.hostGetCanonicalFileName(host)); } + // Filters imports out of the range of statements to move. Imports will be copied to the new file anyway, and may still be needed in the old file. function getStatementsToMove(context) { var rangeToMove = getRangeToMove(context); if (rangeToMove === undefined) @@ -144450,27 +141225,20 @@ var ts; var all = []; var ranges = []; var toMove = rangeToMove.toMove, afterLast = rangeToMove.afterLast; - ts.getRangesWhere(toMove, isAllowedStatementToMove, function (start, afterEndIndex) { + ts.getRangesWhere(toMove, function (s) { return !isPureImport(s); }, function (start, afterEndIndex) { for (var i = start; i < afterEndIndex; i++) all.push(toMove[i]); ranges.push({ first: toMove[start], afterLast: afterLast }); }); return all.length === 0 ? undefined : { all: all, ranges: ranges }; } - function isAllowedStatementToMove(statement) { - // Filters imports and prologue directives out of the range of statements to move. - // Imports will be copied to the new file anyway, and may still be needed in the old file. - // Prologue directives will be copied to the new file and should be left in the old file. - return !isPureImport(statement) && !ts.isPrologueDirective(statement); - ; - } function isPureImport(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return true; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return !ts.hasSyntacticModifier(node, 1 /* Export */); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); }); default: return false; @@ -144492,10 +141260,9 @@ var ts; } function getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences) { var checker = program.getTypeChecker(); - var prologueDirectives = ts.takeWhile(oldFile.statements, ts.isPrologueDirective); if (!oldFile.externalModuleIndicator && !oldFile.commonJsModuleIndicator) { deleteMovedStatements(oldFile, toMove.ranges, changes); - return __spreadArrays(prologueDirectives, toMove.all); + return toMove.all; } var useEs6ModuleSyntax = !!oldFile.externalModuleIndicator; var quotePreference = ts.getQuotePreference(oldFile, preferences); @@ -144509,11 +141276,11 @@ var ts; var imports = getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference); var body = addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax); if (imports.length && body.length) { - return __spreadArrays(prologueDirectives, imports, [ + return __spreadArrays(imports, [ 4 /* NewLineTrivia */ ], body); } - return __spreadArrays(prologueDirectives, imports, body); + return __spreadArrays(imports, body); } function deleteMovedStatements(sourceFile, moved, changes) { for (var _i = 0, moved_1 = moved; _i < moved_1.length; _i++) { @@ -144566,12 +141333,12 @@ var ts; } function getNamespaceLikeImport(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 263 /* NamespaceImport */ ? + case 258 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 260 /* NamespaceImport */ ? node.importClause.namedBindings.name : undefined; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node.name; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ts.tryCast(node.name, ts.isIdentifier); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); @@ -144602,20 +141369,20 @@ var ts; var newNamespaceId = ts.factory.createIdentifier(newNamespaceName); var newModuleString = ts.factory.createStringLiteral(newModuleSpecifier); switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, ts.factory.createNamespaceImport(newNamespaceId)), newModuleString); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return ts.factory.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newNamespaceId, ts.factory.createExternalModuleReference(newModuleString)); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ts.factory.createVariableDeclaration(newNamespaceId, /*exclamationToken*/ undefined, /*type*/ undefined, createRequireCall(newModuleString)); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); } } function moduleSpecifierFromImport(i) { - return (i.kind === 261 /* ImportDeclaration */ ? i.moduleSpecifier - : i.kind === 260 /* ImportEqualsDeclaration */ ? i.moduleReference.expression + return (i.kind === 258 /* ImportDeclaration */ ? i.moduleSpecifier + : i.kind === 257 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]); } function forEachImportInStatement(statement, cb) { @@ -144685,15 +141452,15 @@ var ts; } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -144706,7 +141473,7 @@ var ts; var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings; var defaultUnused = !name || isUnused(name); var namedBindingsUnused = !namedBindings || - (namedBindings.kind === 263 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); + (namedBindings.kind === 260 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } @@ -144718,7 +141485,7 @@ var ts; if (namedBindingsUnused) { changes.replaceNode(sourceFile, importDecl.importClause, ts.factory.updateImportClause(importDecl.importClause, importDecl.importClause.isTypeOnly, name, /*namedBindings*/ undefined)); } - else if (namedBindings.kind === 264 /* NamedImports */) { + else if (namedBindings.kind === 261 /* NamedImports */) { for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { var element = _b[_i]; if (isUnused(element.name)) @@ -144736,9 +141503,9 @@ var ts; changes.delete(sourceFile, name); } break; - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: break; - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) { changes.delete(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); } @@ -144865,14 +141632,14 @@ var ts; // Below should all be utilities function isInImport(decl) { switch (decl.kind) { - case 260 /* ImportEqualsDeclaration */: - case 265 /* ImportSpecifier */: - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: + case 257 /* ImportEqualsDeclaration */: + case 262 /* ImportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: return true; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -144884,7 +141651,7 @@ var ts; } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 261 /* ImportDeclaration */: { + case 258 /* ImportDeclaration */: { var clause = i.importClause; if (!clause) return undefined; @@ -144894,9 +141661,9 @@ var ts; ? ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, defaultImport, namedBindings), moduleSpecifier) : undefined; } - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return keep(i.name) ? i : undefined; - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { var name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined; } @@ -144905,7 +141672,7 @@ var ts; } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 263 /* NamespaceImport */) { + if (namedBindings.kind === 260 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : undefined; } else { @@ -144917,9 +141684,9 @@ var ts; switch (name.kind) { case 78 /* Identifier */: return keep(name) ? name : undefined; - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return name; - case 196 /* ObjectBindingPattern */: { + case 193 /* ObjectBindingPattern */: { // We can't handle nested destructurings or property names well here, so just copy them all. var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); }); return newElements.length ? ts.factory.createObjectBindingPattern(newElements) : undefined; @@ -144976,13 +141743,13 @@ var ts; } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 257 /* ImportEqualsDeclaration */: return true; default: return false; @@ -144990,17 +141757,17 @@ var ts; } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 257 /* ImportEqualsDeclaration */: return cb(statement); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); }); - case 233 /* ExpressionStatement */: { + case 230 /* ExpressionStatement */: { var expression = statement.expression; return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) @@ -145012,8 +141779,8 @@ var ts; switch (name.kind) { case 78 /* Identifier */: return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); })); - case 197 /* ArrayBindingPattern */: - case 196 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); }); default: return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind); @@ -145024,9 +141791,9 @@ var ts; } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return d.parent.parent; - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); })); default: return d; @@ -145059,23 +141826,23 @@ var ts; function addEs6Export(d) { var modifiers = ts.concatenate([ts.factory.createModifier(92 /* ExportKeyword */)], d.modifiers); switch (d.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return ts.factory.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return ts.factory.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return ts.factory.updateVariableStatement(d, modifiers, d.declarationList); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return ts.factory.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return ts.factory.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return ts.factory.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return ts.factory.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return ts.factory.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind); @@ -145086,18 +141853,18 @@ var ts; } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; }); - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 257 /* ImportEqualsDeclaration */: return ts.emptyArray; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind); @@ -145402,15 +142169,15 @@ var ts; var parent = functionReference.parent; switch (parent.kind) { // foo(...) or super(...) or new Foo(...) - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression); @@ -145420,7 +142187,7 @@ var ts; } break; // x["foo"](...) - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression); @@ -145439,14 +142206,14 @@ var ts; var parent = reference.parent; switch (parent.kind) { // `C.foo` - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -145488,11 +142255,11 @@ var ts; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return isSingleImplementation(functionDeclaration, checker); - case 166 /* Constructor */: + case 165 /* Constructor */: if (ts.isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } @@ -145500,8 +142267,8 @@ var ts; return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -145651,7 +142418,7 @@ var ts; } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; @@ -145659,7 +142426,7 @@ var ts; // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(classDeclaration, 87 /* DefaultKeyword */), "Nameless class declaration should be a default export"); return [defaultModifier]; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: var classExpression = constructorDeclaration.parent; var variableDeclaration = constructorDeclaration.parent.parent; var className = classExpression.name; @@ -145670,25 +142437,25 @@ var ts; } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; // If the function declaration doesn't have a name, it should have a default modifier. // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(functionDeclaration, 87 /* DefaultKeyword */), "Nameless function declaration should be a default export"); return [defaultModifier]; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return [functionDeclaration.name]; - case 166 /* Constructor */: + case 165 /* Constructor */: var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 132 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); - if (functionDeclaration.parent.kind === 221 /* ClassExpression */) { + if (functionDeclaration.parent.kind === 218 /* ClassExpression */) { var variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -145764,18 +142531,10 @@ var ts; return node.operatorToken.kind !== 62 /* EqualsToken */; } function getParentBinaryExpression(expr) { - var container = ts.findAncestor(expr.parent, function (n) { - switch (n.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - return false; - case 216 /* BinaryExpression */: - return !(ts.isBinaryExpression(n.parent) && isNotEqualsOperator(n.parent)); - default: - return "quit"; - } - }); - return container || expr; + while (ts.isBinaryExpression(expr.parent) && isNotEqualsOperator(expr.parent)) { + expr = expr.parent; + } + return expr; } function isStringConcatenationValid(node) { var _a = treeToArray(node), containsString = _a.containsString, areOperatorsValid = _a.areOperatorsValid; @@ -146124,8 +142883,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 301 /* FirstJSDocNode */ || kid.kind > 333 /* LastJSDocNode */; }); - return child.kind < 157 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 298 /* FirstJSDocNode */ || kid.kind > 328 /* LastJSDocNode */; }); + return child.kind < 156 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -146136,7 +142895,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 157 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 156 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -146194,7 +142953,7 @@ var ts; } } function createSyntaxList(nodes, parent) { - var list = createNode(334 /* SyntaxList */, nodes.pos, nodes.end, parent); + var list = createNode(329 /* SyntaxList */, nodes.pos, nodes.end, parent); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { @@ -146305,13 +143064,13 @@ var ts; }; SymbolObject.prototype.getContextualDocumentationComment = function (context, checker) { switch (context === null || context === void 0 ? void 0 : context.kind) { - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: if (!this.contextualGetAccessorDocumentationComment) { this.contextualGetAccessorDocumentationComment = ts.emptyArray; this.contextualGetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isGetAccessor), checker); } return this.contextualGetAccessorDocumentationComment; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: if (!this.contextualSetAccessorDocumentationComment) { this.contextualSetAccessorDocumentationComment = ts.emptyArray; this.contextualSetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isSetAccessor), checker); @@ -146532,7 +143291,7 @@ var ts; __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { var _this = _super.call(this, kind, pos, end) || this; - _this.kind = 297 /* SourceFile */; + _this.kind = 294 /* SourceFile */; return _this; } SourceFileObject.prototype.update = function (newText, textChangeRange) { @@ -146591,10 +143350,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -146614,31 +143373,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 256 /* ModuleDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 270 /* ExportSpecifier */: - case 265 /* ImportSpecifier */: - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 177 /* TypeLiteral */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 267 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 176 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 160 /* Parameter */: + case 159 /* Parameter */: // Only consider parameter properties if (!ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: { + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -146649,12 +143408,12 @@ var ts; } } // falls through - case 291 /* EnumMember */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 288 /* EnumMember */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: addDeclaration(node); break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; var exportDeclaration = node; @@ -146667,7 +143426,7 @@ var ts; } } break; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -146679,7 +143438,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 260 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -146688,7 +143447,7 @@ var ts; } } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -147343,12 +144102,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return !ts.isLabelName(node) && !ts.isTagName(node); - case 201 /* PropertyAccessExpression */: - case 157 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` return !ts.isInComment(sourceFile, position); case 107 /* ThisKeyword */: - case 187 /* ThisType */: + case 186 /* ThisType */: case 105 /* SuperKeyword */: return true; default: @@ -147433,7 +144192,7 @@ var ts; * This is a semantic operation. */ function getSignatureHelpItems(fileName, position, _a) { - var _b = _a === void 0 ? ts.emptyOptions : _a, triggerReason = _b.triggerReason; + var triggerReason = (_a === void 0 ? ts.emptyOptions : _a).triggerReason; synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, triggerReason, cancellationToken); @@ -147450,15 +144209,15 @@ var ts; return undefined; } switch (node.kind) { - case 201 /* PropertyAccessExpression */: - case 157 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: case 10 /* StringLiteral */: case 94 /* FalseKeyword */: case 109 /* TrueKeyword */: case 103 /* NullKeyword */: case 105 /* SuperKeyword */: case 107 /* ThisKeyword */: - case 187 /* ThisType */: + case 186 /* ThisType */: case 78 /* Identifier */: break; // Cant create the text span @@ -147475,7 +144234,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 256 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 253 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -147507,33 +144266,21 @@ var ts; var kind = ts.getScriptKind(fileName, host); return kind === 3 /* TS */ || kind === 4 /* TSX */; } - function getSemanticClassifications(fileName, span, format) { + function getSemanticClassifications(fileName, span) { if (!isTsOrTsxFile(fileName)) { // do not run semantic classification on non-ts-or-tsx files return []; } synchronizeHostData(); - var responseFormat = format || "original" /* Original */; - if (responseFormat === "2020" /* TwentyTwenty */) { - return ts.classifier.v2020.getSemanticClassifications(program, cancellationToken, getValidSourceFile(fileName), span); - } - else { - return ts.getSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); - } + return ts.getSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); } - function getEncodedSemanticClassifications(fileName, span, format) { + function getEncodedSemanticClassifications(fileName, span) { if (!isTsOrTsxFile(fileName)) { // do not run semantic classification on non-ts-or-tsx files return { spans: [], endOfLineState: 0 /* None */ }; } synchronizeHostData(); - var responseFormat = format || "original" /* Original */; - if (responseFormat === "original" /* Original */) { - return ts.getEncodedSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); - } - else { - return ts.classifier.v2020.getEncodedSemanticClassifications(program, cancellationToken, getValidSourceFile(fileName), span); - } + return ts.getEncodedSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); } function getSyntacticClassifications(fileName, span) { // doesn't use compiler - no need to synchronize with host @@ -147714,10 +144461,6 @@ var ts; } // Push all text changes. for (var i = firstLine; i <= lastLine; i++) { - // If the range is multiline and ends on a beginning of a line, don't comment/uncomment. - if (firstLine !== lastLine && lineStarts[i] === textRange.end) { - continue; - } var lineTextStart = lineTextStarts.get(i.toString()); // If the line is not an empty line; otherwise no-op. if (lineTextStart !== undefined) { @@ -148196,7 +144939,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 272 /* ExternalModuleReference */ || + node.parent.kind === 269 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -148214,13 +144957,13 @@ var ts; case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 158 /* ComputedPropertyName */) { + if (node.parent.kind === 157 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 78 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 200 /* ObjectLiteralExpression */ || node.parent.parent.kind === 281 /* JsxAttributes */) && + (node.parent.parent.kind === 197 /* ObjectLiteralExpression */ || node.parent.parent.kind === 278 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -148262,7 +145005,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 202 /* ElementAccessExpression */ && + node.parent.kind === 199 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -148342,114 +145085,114 @@ var ts; if (node) { var parent = node.parent; switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 249 /* VariableDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 246 /* VariableDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return spanInVariableDeclaration(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return spanInParameterDeclaration(node); - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 230 /* Block */: + case 227 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return spanInBlock(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return spanInBlock(node.block); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 235 /* DoStatement */: + case 232 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 248 /* DebuggerStatement */: + case 245 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 234 /* IfStatement */: + case 231 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return spanInForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 247 /* TryStatement */: + case 244 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 198 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 195 /* BindingElement */: // span on complete node return textSpan(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 161 /* Decorator */: + case 160 /* Decorator */: return spanInNodeArray(parent.decorators); - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return undefined; // Tokens: case 26 /* SemicolonToken */: @@ -148479,7 +145222,7 @@ var ts; case 82 /* CatchKeyword */: case 95 /* FinallyKeyword */: return spanInNextNode(node); - case 156 /* OfKeyword */: + case 155 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -148492,13 +145235,13 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 78 /* Identifier */ || - node.kind === 220 /* SpreadElement */ || - node.kind === 288 /* PropertyAssignment */ || - node.kind === 289 /* ShorthandPropertyAssignment */) && + node.kind === 217 /* SpreadElement */ || + node.kind === 285 /* PropertyAssignment */ || + node.kind === 286 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) { return textSpan(node); } - if (node.kind === 216 /* BinaryExpression */) { + if (node.kind === 213 /* BinaryExpression */) { var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -148520,22 +145263,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (parent.kind) { - case 235 /* DoStatement */: + case 232 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 161 /* Decorator */: + case 160 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: return textSpan(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (node.parent.operatorToken.kind === 27 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -148544,21 +145287,21 @@ var ts; } } switch (node.parent.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // If this is name of property assignment, set breakpoint in the initializer if (node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: // Breakpoint in type assertion goes to its operand if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: { + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: { // initializer of variable/parameter declaration go to previous node var _b = node.parent, initializer = _b.initializer, type = _b.type; if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { @@ -148566,7 +145309,7 @@ var ts; } break; } - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var left = node.parent.left; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { // If initializer of destructuring assignment move to previous token @@ -148596,7 +145339,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 238 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 235 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } var parent = variableDeclaration.parent; @@ -148608,7 +145351,7 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasSyntacticModifier(variableDeclaration, 1 /* Export */) || - parent.parent.kind === 239 /* ForOfStatement */) { + parent.parent.kind === 236 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (ts.isVariableDeclarationList(variableDeclaration.parent) && @@ -148649,7 +145392,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasSyntacticModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 252 /* ClassDeclaration */ && functionDeclaration.kind !== 166 /* Constructor */); + (functionDeclaration.parent.kind === 249 /* ClassDeclaration */ && functionDeclaration.kind !== 165 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -148672,26 +145415,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement // falls through - case 236 /* WhileStatement */: - case 234 /* IfStatement */: - case 238 /* ForInStatement */: + case 233 /* WhileStatement */: + case 231 /* IfStatement */: + case 235 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 250 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 247 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -148716,21 +145459,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 222 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 219 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 198 /* BindingElement */) { + if (bindingPattern.parent.kind === 195 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 197 /* ArrayBindingPattern */ && node.kind !== 196 /* ObjectBindingPattern */); - var elements = node.kind === 199 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 222 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 194 /* ArrayBindingPattern */ && node.kind !== 193 /* ObjectBindingPattern */); + var elements = node.kind === 196 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 219 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -148738,18 +145481,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 216 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 213 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -148757,25 +145500,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 255 /* EnumDeclaration */: - case 252 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 249 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 230 /* Block */: + case 227 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 287 /* CatchClause */: + case 284 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -148783,7 +145526,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -148799,7 +145542,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -148814,12 +145557,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 235 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 203 /* CallExpression */ || - node.parent.kind === 204 /* NewExpression */) { + if (node.parent.kind === 232 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 200 /* CallExpression */ || + node.parent.kind === 201 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 207 /* ParenthesizedExpression */) { + if (node.parent.kind === 204 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -148828,21 +145571,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 236 /* WhileStatement */: - case 235 /* DoStatement */: - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 207 /* ParenthesizedExpression */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 233 /* WhileStatement */: + case 232 /* DoStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 204 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -148852,20 +145595,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 288 /* PropertyAssignment */ || - node.parent.kind === 160 /* Parameter */) { + node.parent.kind === 285 /* PropertyAssignment */ || + node.parent.kind === 159 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 206 /* TypeAssertionExpression */) { + if (node.parent.kind === 203 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 235 /* DoStatement */) { + if (node.parent.kind === 232 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -148873,7 +145616,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 239 /* ForOfStatement */) { + if (node.parent.kind === 236 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -150448,7 +147191,7 @@ var ts; } else { type = operatorOrType; - operator = 138 /* KeyOfKeyword */; + operator = 137 /* KeyOfKeyword */; } return ts.factory.createTypeOperatorNode(operator, type); }, factoryDeprecation); @@ -150626,7 +147369,7 @@ var ts; ts.createNode = ts.Debug.deprecate(function createNode(kind, pos, end) { if (pos === void 0) { pos = 0; } if (end === void 0) { end = 0; } - return ts.setTextRangePosEnd(kind === 297 /* SourceFile */ ? ts.parseBaseNodeFactory.createBaseSourceFileNode(kind) : + return ts.setTextRangePosEnd(kind === 294 /* SourceFile */ ? ts.parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 78 /* Identifier */ ? ts.parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 79 /* PrivateIdentifier */ ? ts.parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !ts.isNodeKind(kind) ? ts.parseBaseNodeFactory.createBaseTokenNode(kind) : @@ -150655,7 +147398,7 @@ var ts; // #region Renamed node Tests /** @deprecated Use `isTypeAssertionExpression` instead. */ ts.isTypeAssertion = ts.Debug.deprecate(function isTypeAssertion(node) { - return node.kind === 206 /* TypeAssertionExpression */; + return node.kind === 203 /* TypeAssertionExpression */; }, { since: "4.0", warnAfter: "4.1", diff --git a/node_modules/typescript/lib/typescriptServices.d.ts b/node_modules/typescript/lib/typescriptServices.d.ts index 9a8352c..85c1d1c 100644 --- a/node_modules/typescript/lib/typescriptServices.d.ts +++ b/node_modules/typescript/lib/typescriptServices.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "4.1"; + const versionMajorMinor = "4.0"; /** The version of the TypeScript compiler release */ const version: string; /** @@ -240,212 +240,207 @@ declare namespace ts { DeclareKeyword = 133, GetKeyword = 134, InferKeyword = 135, - IntrinsicKeyword = 136, - IsKeyword = 137, - KeyOfKeyword = 138, - ModuleKeyword = 139, - NamespaceKeyword = 140, - NeverKeyword = 141, - ReadonlyKeyword = 142, - RequireKeyword = 143, - NumberKeyword = 144, - ObjectKeyword = 145, - SetKeyword = 146, - StringKeyword = 147, - SymbolKeyword = 148, - TypeKeyword = 149, - UndefinedKeyword = 150, - UniqueKeyword = 151, - UnknownKeyword = 152, - FromKeyword = 153, - GlobalKeyword = 154, - BigIntKeyword = 155, - OfKeyword = 156, - QualifiedName = 157, - ComputedPropertyName = 158, - TypeParameter = 159, - Parameter = 160, - Decorator = 161, - PropertySignature = 162, - PropertyDeclaration = 163, - MethodSignature = 164, - MethodDeclaration = 165, - Constructor = 166, - GetAccessor = 167, - SetAccessor = 168, - CallSignature = 169, - ConstructSignature = 170, - IndexSignature = 171, - TypePredicate = 172, - TypeReference = 173, - FunctionType = 174, - ConstructorType = 175, - TypeQuery = 176, - TypeLiteral = 177, - ArrayType = 178, - TupleType = 179, - OptionalType = 180, - RestType = 181, - UnionType = 182, - IntersectionType = 183, - ConditionalType = 184, - InferType = 185, - ParenthesizedType = 186, - ThisType = 187, - TypeOperator = 188, - IndexedAccessType = 189, - MappedType = 190, - LiteralType = 191, - NamedTupleMember = 192, - TemplateLiteralType = 193, - TemplateLiteralTypeSpan = 194, - ImportType = 195, - ObjectBindingPattern = 196, - ArrayBindingPattern = 197, - BindingElement = 198, - ArrayLiteralExpression = 199, - ObjectLiteralExpression = 200, - PropertyAccessExpression = 201, - ElementAccessExpression = 202, - CallExpression = 203, - NewExpression = 204, - TaggedTemplateExpression = 205, - TypeAssertionExpression = 206, - ParenthesizedExpression = 207, - FunctionExpression = 208, - ArrowFunction = 209, - DeleteExpression = 210, - TypeOfExpression = 211, - VoidExpression = 212, - AwaitExpression = 213, - PrefixUnaryExpression = 214, - PostfixUnaryExpression = 215, - BinaryExpression = 216, - ConditionalExpression = 217, - TemplateExpression = 218, - YieldExpression = 219, - SpreadElement = 220, - ClassExpression = 221, - OmittedExpression = 222, - ExpressionWithTypeArguments = 223, - AsExpression = 224, - NonNullExpression = 225, - MetaProperty = 226, - SyntheticExpression = 227, - TemplateSpan = 228, - SemicolonClassElement = 229, - Block = 230, - EmptyStatement = 231, - VariableStatement = 232, - ExpressionStatement = 233, - IfStatement = 234, - DoStatement = 235, - WhileStatement = 236, - ForStatement = 237, - ForInStatement = 238, - ForOfStatement = 239, - ContinueStatement = 240, - BreakStatement = 241, - ReturnStatement = 242, - WithStatement = 243, - SwitchStatement = 244, - LabeledStatement = 245, - ThrowStatement = 246, - TryStatement = 247, - DebuggerStatement = 248, - VariableDeclaration = 249, - VariableDeclarationList = 250, - FunctionDeclaration = 251, - ClassDeclaration = 252, - InterfaceDeclaration = 253, - TypeAliasDeclaration = 254, - EnumDeclaration = 255, - ModuleDeclaration = 256, - ModuleBlock = 257, - CaseBlock = 258, - NamespaceExportDeclaration = 259, - ImportEqualsDeclaration = 260, - ImportDeclaration = 261, - ImportClause = 262, - NamespaceImport = 263, - NamedImports = 264, - ImportSpecifier = 265, - ExportAssignment = 266, - ExportDeclaration = 267, - NamedExports = 268, - NamespaceExport = 269, - ExportSpecifier = 270, - MissingDeclaration = 271, - ExternalModuleReference = 272, - JsxElement = 273, - JsxSelfClosingElement = 274, - JsxOpeningElement = 275, - JsxClosingElement = 276, - JsxFragment = 277, - JsxOpeningFragment = 278, - JsxClosingFragment = 279, - JsxAttribute = 280, - JsxAttributes = 281, - JsxSpreadAttribute = 282, - JsxExpression = 283, - CaseClause = 284, - DefaultClause = 285, - HeritageClause = 286, - CatchClause = 287, - PropertyAssignment = 288, - ShorthandPropertyAssignment = 289, - SpreadAssignment = 290, - EnumMember = 291, - UnparsedPrologue = 292, - UnparsedPrepend = 293, - UnparsedText = 294, - UnparsedInternalText = 295, - UnparsedSyntheticReference = 296, - SourceFile = 297, - Bundle = 298, - UnparsedSource = 299, - InputFiles = 300, - JSDocTypeExpression = 301, - JSDocNameReference = 302, - JSDocAllType = 303, - JSDocUnknownType = 304, - JSDocNullableType = 305, - JSDocNonNullableType = 306, - JSDocOptionalType = 307, - JSDocFunctionType = 308, - JSDocVariadicType = 309, - JSDocNamepathType = 310, - JSDocComment = 311, - JSDocTypeLiteral = 312, - JSDocSignature = 313, - JSDocTag = 314, - JSDocAugmentsTag = 315, - JSDocImplementsTag = 316, - JSDocAuthorTag = 317, - JSDocDeprecatedTag = 318, - JSDocClassTag = 319, - JSDocPublicTag = 320, - JSDocPrivateTag = 321, - JSDocProtectedTag = 322, - JSDocReadonlyTag = 323, - JSDocCallbackTag = 324, - JSDocEnumTag = 325, - JSDocParameterTag = 326, - JSDocReturnTag = 327, - JSDocThisTag = 328, - JSDocTypeTag = 329, - JSDocTemplateTag = 330, - JSDocTypedefTag = 331, - JSDocSeeTag = 332, - JSDocPropertyTag = 333, - SyntaxList = 334, - NotEmittedStatement = 335, - PartiallyEmittedExpression = 336, - CommaListExpression = 337, - MergeDeclarationMarker = 338, - EndOfDeclarationMarker = 339, - SyntheticReferenceExpression = 340, - Count = 341, + IsKeyword = 136, + KeyOfKeyword = 137, + ModuleKeyword = 138, + NamespaceKeyword = 139, + NeverKeyword = 140, + ReadonlyKeyword = 141, + RequireKeyword = 142, + NumberKeyword = 143, + ObjectKeyword = 144, + SetKeyword = 145, + StringKeyword = 146, + SymbolKeyword = 147, + TypeKeyword = 148, + UndefinedKeyword = 149, + UniqueKeyword = 150, + UnknownKeyword = 151, + FromKeyword = 152, + GlobalKeyword = 153, + BigIntKeyword = 154, + OfKeyword = 155, + QualifiedName = 156, + ComputedPropertyName = 157, + TypeParameter = 158, + Parameter = 159, + Decorator = 160, + PropertySignature = 161, + PropertyDeclaration = 162, + MethodSignature = 163, + MethodDeclaration = 164, + Constructor = 165, + GetAccessor = 166, + SetAccessor = 167, + CallSignature = 168, + ConstructSignature = 169, + IndexSignature = 170, + TypePredicate = 171, + TypeReference = 172, + FunctionType = 173, + ConstructorType = 174, + TypeQuery = 175, + TypeLiteral = 176, + ArrayType = 177, + TupleType = 178, + OptionalType = 179, + RestType = 180, + UnionType = 181, + IntersectionType = 182, + ConditionalType = 183, + InferType = 184, + ParenthesizedType = 185, + ThisType = 186, + TypeOperator = 187, + IndexedAccessType = 188, + MappedType = 189, + LiteralType = 190, + NamedTupleMember = 191, + ImportType = 192, + ObjectBindingPattern = 193, + ArrayBindingPattern = 194, + BindingElement = 195, + ArrayLiteralExpression = 196, + ObjectLiteralExpression = 197, + PropertyAccessExpression = 198, + ElementAccessExpression = 199, + CallExpression = 200, + NewExpression = 201, + TaggedTemplateExpression = 202, + TypeAssertionExpression = 203, + ParenthesizedExpression = 204, + FunctionExpression = 205, + ArrowFunction = 206, + DeleteExpression = 207, + TypeOfExpression = 208, + VoidExpression = 209, + AwaitExpression = 210, + PrefixUnaryExpression = 211, + PostfixUnaryExpression = 212, + BinaryExpression = 213, + ConditionalExpression = 214, + TemplateExpression = 215, + YieldExpression = 216, + SpreadElement = 217, + ClassExpression = 218, + OmittedExpression = 219, + ExpressionWithTypeArguments = 220, + AsExpression = 221, + NonNullExpression = 222, + MetaProperty = 223, + SyntheticExpression = 224, + TemplateSpan = 225, + SemicolonClassElement = 226, + Block = 227, + EmptyStatement = 228, + VariableStatement = 229, + ExpressionStatement = 230, + IfStatement = 231, + DoStatement = 232, + WhileStatement = 233, + ForStatement = 234, + ForInStatement = 235, + ForOfStatement = 236, + ContinueStatement = 237, + BreakStatement = 238, + ReturnStatement = 239, + WithStatement = 240, + SwitchStatement = 241, + LabeledStatement = 242, + ThrowStatement = 243, + TryStatement = 244, + DebuggerStatement = 245, + VariableDeclaration = 246, + VariableDeclarationList = 247, + FunctionDeclaration = 248, + ClassDeclaration = 249, + InterfaceDeclaration = 250, + TypeAliasDeclaration = 251, + EnumDeclaration = 252, + ModuleDeclaration = 253, + ModuleBlock = 254, + CaseBlock = 255, + NamespaceExportDeclaration = 256, + ImportEqualsDeclaration = 257, + ImportDeclaration = 258, + ImportClause = 259, + NamespaceImport = 260, + NamedImports = 261, + ImportSpecifier = 262, + ExportAssignment = 263, + ExportDeclaration = 264, + NamedExports = 265, + NamespaceExport = 266, + ExportSpecifier = 267, + MissingDeclaration = 268, + ExternalModuleReference = 269, + JsxElement = 270, + JsxSelfClosingElement = 271, + JsxOpeningElement = 272, + JsxClosingElement = 273, + JsxFragment = 274, + JsxOpeningFragment = 275, + JsxClosingFragment = 276, + JsxAttribute = 277, + JsxAttributes = 278, + JsxSpreadAttribute = 279, + JsxExpression = 280, + CaseClause = 281, + DefaultClause = 282, + HeritageClause = 283, + CatchClause = 284, + PropertyAssignment = 285, + ShorthandPropertyAssignment = 286, + SpreadAssignment = 287, + EnumMember = 288, + UnparsedPrologue = 289, + UnparsedPrepend = 290, + UnparsedText = 291, + UnparsedInternalText = 292, + UnparsedSyntheticReference = 293, + SourceFile = 294, + Bundle = 295, + UnparsedSource = 296, + InputFiles = 297, + JSDocTypeExpression = 298, + JSDocAllType = 299, + JSDocUnknownType = 300, + JSDocNullableType = 301, + JSDocNonNullableType = 302, + JSDocOptionalType = 303, + JSDocFunctionType = 304, + JSDocVariadicType = 305, + JSDocNamepathType = 306, + JSDocComment = 307, + JSDocTypeLiteral = 308, + JSDocSignature = 309, + JSDocTag = 310, + JSDocAugmentsTag = 311, + JSDocImplementsTag = 312, + JSDocAuthorTag = 313, + JSDocDeprecatedTag = 314, + JSDocClassTag = 315, + JSDocPublicTag = 316, + JSDocPrivateTag = 317, + JSDocProtectedTag = 318, + JSDocReadonlyTag = 319, + JSDocCallbackTag = 320, + JSDocEnumTag = 321, + JSDocParameterTag = 322, + JSDocReturnTag = 323, + JSDocThisTag = 324, + JSDocTypeTag = 325, + JSDocTemplateTag = 326, + JSDocTypedefTag = 327, + JSDocPropertyTag = 328, + SyntaxList = 329, + NotEmittedStatement = 330, + PartiallyEmittedExpression = 331, + CommaListExpression = 332, + MergeDeclarationMarker = 333, + EndOfDeclarationMarker = 334, + SyntheticReferenceExpression = 335, + Count = 336, FirstAssignment = 62, LastAssignment = 77, FirstCompoundAssignment = 63, @@ -453,15 +448,15 @@ declare namespace ts { FirstReservedWord = 80, LastReservedWord = 115, FirstKeyword = 80, - LastKeyword = 156, + LastKeyword = 155, FirstFutureReservedWord = 116, LastFutureReservedWord = 124, - FirstTypeNode = 172, - LastTypeNode = 195, + FirstTypeNode = 171, + LastTypeNode = 192, FirstPunctuation = 18, LastPunctuation = 77, FirstToken = 0, - LastToken = 156, + LastToken = 155, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -470,21 +465,21 @@ declare namespace ts { LastTemplateToken = 17, FirstBinaryOperator = 29, LastBinaryOperator = 77, - FirstStatement = 232, - LastStatement = 248, - FirstNode = 157, - FirstJSDocNode = 301, - LastJSDocNode = 333, - FirstJSDocTagNode = 314, - LastJSDocTagNode = 333, + FirstStatement = 229, + LastStatement = 245, + FirstNode = 156, + FirstJSDocNode = 298, + LastJSDocNode = 328, + FirstJSDocTagNode = 310, + LastJSDocTagNode = 328, } export type TriviaSyntaxKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; export type LiteralSyntaxKind = SyntaxKind.NumericLiteral | SyntaxKind.BigIntLiteral | SyntaxKind.StringLiteral | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.RegularExpressionLiteral | SyntaxKind.NoSubstitutionTemplateLiteral; export type PseudoLiteralSyntaxKind = SyntaxKind.TemplateHead | SyntaxKind.TemplateMiddle | SyntaxKind.TemplateTail; export type PunctuationSyntaxKind = SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.DotToken | SyntaxKind.DotDotDotToken | SyntaxKind.SemicolonToken | SyntaxKind.CommaToken | SyntaxKind.QuestionDotToken | SyntaxKind.LessThanToken | SyntaxKind.LessThanSlashToken | SyntaxKind.GreaterThanToken | SyntaxKind.LessThanEqualsToken | SyntaxKind.GreaterThanEqualsToken | SyntaxKind.EqualsEqualsToken | SyntaxKind.ExclamationEqualsToken | SyntaxKind.EqualsEqualsEqualsToken | SyntaxKind.ExclamationEqualsEqualsToken | SyntaxKind.EqualsGreaterThanToken | SyntaxKind.PlusToken | SyntaxKind.MinusToken | SyntaxKind.AsteriskToken | SyntaxKind.AsteriskAsteriskToken | SyntaxKind.SlashToken | SyntaxKind.PercentToken | SyntaxKind.PlusPlusToken | SyntaxKind.MinusMinusToken | SyntaxKind.LessThanLessThanToken | SyntaxKind.GreaterThanGreaterThanToken | SyntaxKind.GreaterThanGreaterThanGreaterThanToken | SyntaxKind.AmpersandToken | SyntaxKind.BarToken | SyntaxKind.CaretToken | SyntaxKind.ExclamationToken | SyntaxKind.TildeToken | SyntaxKind.AmpersandAmpersandToken | SyntaxKind.BarBarToken | SyntaxKind.QuestionQuestionToken | SyntaxKind.QuestionToken | SyntaxKind.ColonToken | SyntaxKind.AtToken | SyntaxKind.BacktickToken | 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; - export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; + export type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.AssertsKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InferKeyword | SyntaxKind.InKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.OfKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword; export type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.StaticKeyword; - export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; + export type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword; export type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind; export type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken; export type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind; @@ -615,8 +610,7 @@ declare namespace ts { None = 0, ReservedInNestedScopes = 8, Optimistic = 16, - FileLevel = 32, - AllowNameSubstitution = 64 + FileLevel = 32 } export interface Identifier extends PrimaryExpression, Declaration { readonly kind: SyntaxKind.Identifier; @@ -948,7 +942,6 @@ declare namespace ts { readonly kind: SyntaxKind.MappedType; readonly readonlyToken?: ReadonlyToken | PlusToken | MinusToken; readonly typeParameter: TypeParameterDeclaration; - readonly nameType?: TypeNode; readonly questionToken?: QuestionToken | PlusToken | MinusToken; readonly type?: TypeNode; } @@ -961,17 +954,6 @@ declare namespace ts { } export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; export type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral; - export interface TemplateLiteralTypeNode extends TypeNode { - kind: SyntaxKind.TemplateLiteralType; - readonly head: TemplateHead; - readonly templateSpans: NodeArray; - } - export interface TemplateLiteralTypeSpan extends TypeNode { - readonly kind: SyntaxKind.TemplateLiteralTypeSpan; - readonly parent: TemplateLiteralTypeNode; - readonly type: TypeNode; - readonly literal: TemplateMiddle | TemplateTail; - } export interface Expression extends Node { _expressionBrand: any; } @@ -1160,15 +1142,15 @@ declare namespace ts { export type LiteralToken = NumericLiteral | BigIntLiteral | StringLiteral | JsxText | RegularExpressionLiteral | NoSubstitutionTemplateLiteral; export interface TemplateHead extends TemplateLiteralLikeNode { readonly kind: SyntaxKind.TemplateHead; - readonly parent: TemplateExpression | TemplateLiteralTypeNode; + readonly parent: TemplateExpression; } export interface TemplateMiddle extends TemplateLiteralLikeNode { readonly kind: SyntaxKind.TemplateMiddle; - readonly parent: TemplateSpan | TemplateLiteralTypeSpan; + readonly parent: TemplateSpan; } export interface TemplateTail extends TemplateLiteralLikeNode { readonly kind: SyntaxKind.TemplateTail; - readonly parent: TemplateSpan | TemplateLiteralTypeSpan; + readonly parent: TemplateSpan; } export type PseudoLiteralToken = TemplateHead | TemplateMiddle | TemplateTail; export type TemplateLiteralToken = NoSubstitutionTemplateLiteral | PseudoLiteralToken; @@ -1700,10 +1682,6 @@ declare namespace ts { readonly kind: SyntaxKind.JSDocTypeExpression; readonly type: TypeNode; } - export interface JSDocNameReference extends Node { - readonly kind: SyntaxKind.JSDocNameReference; - readonly name: EntityName; - } export interface JSDocType extends TypeNode { _jsDocTypeBrand: any; } @@ -1802,10 +1780,6 @@ declare namespace ts { readonly constraint: JSDocTypeExpression | undefined; readonly typeParameters: NodeArray; } - export interface JSDocSeeTag extends JSDocTag { - readonly kind: SyntaxKind.JSDocSeeTag; - readonly name?: JSDocNameReference; - } export interface JSDocReturnTag extends JSDocTag { readonly kind: SyntaxKind.JSDocReturnTag; readonly typeExpression?: JSDocTypeExpression; @@ -2079,7 +2053,6 @@ declare namespace ts { * Gets a type checker that can be used to semantically analyze source files in the program. */ getTypeChecker(): TypeChecker; - getTypeCatalog(): readonly Type[]; getNodeCount(): number; getIdentifierCount(): number; getSymbolCount(): number; @@ -2186,7 +2159,7 @@ declare namespace ts { * This is necessary as an identifier in short-hand property assignment can contains two meaning: property name and property value. */ getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined; - getExportSpecifierLocalTargetSymbol(location: ExportSpecifier | Identifier): Symbol | undefined; + getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol | undefined; /** * If a symbol is a local symbol with an associated exported symbol, returns the exported symbol. * Otherwise returns its input. @@ -2207,7 +2180,6 @@ declare namespace ts { getFullyQualifiedName(symbol: Symbol): string; getAugmentedPropertiesOfType(type: Type): Symbol[]; getRootSymbols(symbol: Symbol): readonly Symbol[]; - getSymbolOfExpando(node: Node, allowDeclaration: boolean): Symbol | undefined; getContextualType(node: Expression): Type | undefined; /** * returns unknownSignature in the case of an error. @@ -2478,13 +2450,11 @@ declare namespace ts { Conditional = 16777216, Substitution = 33554432, NonPrimitive = 67108864, - TemplateLiteral = 134217728, - StringMapping = 268435456, Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, PossiblyFalsy = 117724, - StringLike = 402653316, + StringLike = 132, NumberLike = 296, BigIntLike = 2112, BooleanLike = 528, @@ -2495,10 +2465,10 @@ declare namespace ts { StructuredType = 3670016, TypeVariable = 8650752, InstantiableNonPrimitive = 58982400, - InstantiablePrimitive = 406847488, - Instantiable = 465829888, - StructuredOrInstantiable = 469499904, - Narrowable = 536624127, + InstantiablePrimitive = 4194304, + Instantiable = 63176704, + StructuredOrInstantiable = 66846720, + Narrowable = 133970943, } export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; export interface Type { @@ -2635,6 +2605,8 @@ declare namespace ts { node: ConditionalTypeNode; checkType: Type; extendsType: Type; + trueType: Type; + falseType: Type; isDistributive: boolean; inferTypeParameters?: TypeParameter[]; outerTypeParameters?: TypeParameter[]; @@ -2649,14 +2621,6 @@ declare namespace ts { resolvedTrueType: Type; resolvedFalseType: Type; } - export interface TemplateLiteralType extends InstantiableType { - texts: readonly string[]; - types: readonly Type[]; - } - export interface StringMappingType extends InstantiableType { - symbol: Symbol; - type: Type; - } export interface SubstitutionType extends InstantiableType { baseType: Type; substitute: Type; @@ -2834,7 +2798,6 @@ declare namespace ts { assumeChangesOnlyAffectDirectDependencies?: boolean; noLib?: boolean; noResolve?: boolean; - noUncheckedIndexedAccess?: boolean; out?: string; outDir?: string; outFile?: string; @@ -2845,7 +2808,6 @@ declare namespace ts { reactNamespace?: string; jsxFactory?: string; jsxFragmentFactory?: string; - jsxImportSource?: string; composite?: boolean; incremental?: boolean; tsBuildInfoFile?: string; @@ -2890,8 +2852,7 @@ declare namespace ts { enable?: boolean; include?: string[]; exclude?: string[]; - disableFilenameBasedTypeAcquisition?: boolean; - [option: string]: CompilerOptionsValue | undefined; + [option: string]: string[] | boolean | undefined; } export enum ModuleKind { None = 0, @@ -2907,9 +2868,7 @@ declare namespace ts { None = 0, Preserve = 1, React = 2, - ReactNative = 3, - ReactJSX = 4, - ReactJSXDev = 5 + ReactNative = 3 } export enum ImportsNotUsedAsValues { Remove = 0, @@ -3219,8 +3178,6 @@ declare namespace ts { updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructSignatureDeclaration; createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration; - createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; - updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan; createKeywordTypeNode(kind: TKind): KeywordTypeNode; createTypePredicateNode(assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode | string, type: TypeNode | undefined): TypePredicateNode; updateTypePredicateNode(node: TypePredicateNode, assertsModifier: AssertsKeyword | undefined, parameterName: Identifier | ThisTypeNode, type: TypeNode | undefined): TypePredicateNode; @@ -3261,12 +3218,10 @@ declare namespace ts { updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; - createMappedTypeNode(readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; - updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; + createMappedTypeNode(readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; + updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode; updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode; - createTemplateLiteralType(head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode; - updateTemplateLiteralType(node: TemplateLiteralTypeNode, head: TemplateHead, templateSpans: readonly TemplateLiteralTypeSpan[]): TemplateLiteralTypeNode; createObjectBindingPattern(elements: readonly BindingElement[]): ObjectBindingPattern; updateObjectBindingPattern(node: ObjectBindingPattern, elements: readonly BindingElement[]): ObjectBindingPattern; createArrayBindingPattern(elements: readonly ArrayBindingElement[]): ArrayBindingPattern; @@ -3446,8 +3401,6 @@ declare namespace ts { updateJSDocNamepathType(node: JSDocNamepathType, type: TypeNode): JSDocNamepathType; createJSDocTypeExpression(type: TypeNode): JSDocTypeExpression; updateJSDocTypeExpression(node: JSDocTypeExpression, type: TypeNode): JSDocTypeExpression; - createJSDocNameReference(name: EntityName): JSDocNameReference; - updateJSDocNameReference(node: JSDocNameReference, name: EntityName): JSDocNameReference; createJSDocTypeLiteral(jsDocPropertyTags?: readonly JSDocPropertyLikeTag[], isArrayType?: boolean): JSDocTypeLiteral; updateJSDocTypeLiteral(node: JSDocTypeLiteral, jsDocPropertyTags: readonly JSDocPropertyLikeTag[] | undefined, isArrayType: boolean | undefined): JSDocTypeLiteral; createJSDocSignature(typeParameters: readonly JSDocTemplateTag[] | undefined, parameters: readonly JSDocParameterTag[], type?: JSDocReturnTag): JSDocSignature; @@ -3462,8 +3415,6 @@ declare namespace ts { updateJSDocPropertyTag(node: JSDocPropertyTag, tagName: Identifier | undefined, name: EntityName, isBracketed: boolean, typeExpression: JSDocTypeExpression | undefined, isNameFirst: boolean, comment: string | undefined): JSDocPropertyTag; createJSDocTypeTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocTypeTag; updateJSDocTypeTag(node: JSDocTypeTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment: string | undefined): JSDocTypeTag; - createJSDocSeeTag(tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string): JSDocSeeTag; - updateJSDocSeeTag(node: JSDocSeeTag, tagName: Identifier | undefined, nameExpression: JSDocNameReference | undefined, comment?: string): JSDocSeeTag; createJSDocReturnTag(tagName: Identifier | undefined, typeExpression?: JSDocTypeExpression, comment?: string): JSDocReturnTag; updateJSDocReturnTag(node: JSDocReturnTag, tagName: Identifier | undefined, typeExpression: JSDocTypeExpression | undefined, comment: string | undefined): JSDocReturnTag; createJSDocThisTag(tagName: Identifier | undefined, typeExpression: JSDocTypeExpression, comment?: string): JSDocThisTag; @@ -4051,14 +4002,6 @@ declare namespace ts { function getOriginalNode(node: Node, nodeTest: (node: Node) => node is T): T; function getOriginalNode(node: Node | undefined): Node | undefined; function getOriginalNode(node: Node | undefined, nodeTest: (node: Node | undefined) => node is T): T | undefined; - /** - * Iterates through the parent chain of a node and performs the callback on each parent until the callback - * returns a truthy value, then returns that value. - * If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit" - * At that point findAncestor returns undefined. - */ - function findAncestor(node: Node | undefined, callback: (element: Node) => element is T): T | undefined; - function findAncestor(node: Node | undefined, callback: (element: Node) => boolean | "quit"): Node | undefined; /** * Gets a value indicating whether a node originated in the parse tree. * @@ -4377,8 +4320,6 @@ declare namespace ts { function isMappedTypeNode(node: Node): node is MappedTypeNode; function isLiteralTypeNode(node: Node): node is LiteralTypeNode; function isImportTypeNode(node: Node): node is ImportTypeNode; - function isTemplateLiteralTypeSpan(node: Node): node is TemplateLiteralTypeSpan; - function isTemplateLiteralTypeNode(node: Node): node is TemplateLiteralTypeNode; function isObjectBindingPattern(node: Node): node is ObjectBindingPattern; function isArrayBindingPattern(node: Node): node is ArrayBindingPattern; function isBindingElement(node: Node): node is BindingElement; @@ -4483,7 +4424,6 @@ declare namespace ts { function isBundle(node: Node): node is Bundle; function isUnparsedSource(node: Node): node is UnparsedSource; function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression; - function isJSDocNameReference(node: Node): node is JSDocNameReference; function isJSDocAllType(node: Node): node is JSDocAllType; function isJSDocUnknownType(node: Node): node is JSDocUnknownType; function isJSDocNullableType(node: Node): node is JSDocNullableType; @@ -5417,10 +5357,6 @@ declare namespace ts { type WithMetadata = T & { metadata?: unknown; }; - enum SemanticClassificationFormat { - Original = "original", - TwentyTwenty = "2020" - } interface LanguageService { /** This is used as a part of restarting the language service. */ cleanupSemanticCache(): void; @@ -5472,22 +5408,10 @@ declare namespace ts { getCompilerOptionsDiagnostics(): Diagnostic[]; /** @deprecated Use getEncodedSyntacticClassifications instead. */ getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSyntacticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[]; /** @deprecated Use getEncodedSemanticClassifications instead. */ getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getSemanticClassifications(fileName: string, span: TextSpan, format: SemanticClassificationFormat): ClassifiedSpan[] | ClassifiedSpan2020[]; - /** Encoded as triples of [start, length, ClassificationType]. */ getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications; - /** - * Gets semantic highlights information for a particular file. Has two formats, an older - * version used by VS and a format used by VS Code. - * - * @param fileName The path to the file - * @param position A text span to return results within - * @param format Which format to use, defaults to "original" - * @returns a number array encoded as triples of [start, length, ClassificationType, ...]. - */ - getEncodedSemanticClassifications(fileName: string, span: TextSpan, format?: SemanticClassificationFormat): Classifications; + getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications; /** * Gets completion entries at a particular position in a file. * @@ -5646,10 +5570,6 @@ declare namespace ts { textSpan: TextSpan; classificationType: ClassificationTypeNames; } - interface ClassifiedSpan2020 { - textSpan: TextSpan; - classificationType: number; - } /** * Navigation bar interface designed for visual studio's dual-column layout. * This does not form a proper tree. @@ -6046,12 +5966,6 @@ declare namespace ts { /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; - /** - * In the absence of `CompletionEntry["replacementSpan"], the editor may choose whether to use - * this span or its default one. If `CompletionEntry["replacementSpan"]` is defined, that span - * must be used to commit that completion entry. - */ - optionalReplacementSpan?: TextSpan; /** * true when the current location also allows for a new identifier */ @@ -6595,9 +6509,9 @@ declare namespace ts { /** @deprecated Use `factory.updateIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */ const updateIndexedAccessTypeNode: (node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode) => IndexedAccessTypeNode; /** @deprecated Use `factory.createMappedTypeNode` or the factory supplied by your transformation context instead. */ - const createMappedTypeNode: (readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; + const createMappedTypeNode: (readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; /** @deprecated Use `factory.updateMappedTypeNode` or the factory supplied by your transformation context instead. */ - const updateMappedTypeNode: (node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, nameType: TypeNode | undefined, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; + const updateMappedTypeNode: (node: MappedTypeNode, readonlyToken: ReadonlyKeyword | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined) => MappedTypeNode; /** @deprecated Use `factory.createLiteralTypeNode` or the factory supplied by your transformation context instead. */ const createLiteralTypeNode: (literal: LiteralExpression | TrueLiteral | FalseLiteral | PrefixUnaryExpression | NullLiteral) => LiteralTypeNode; /** @deprecated Use `factory.updateLiteralTypeNode` or the factory supplied by your transformation context instead. */ diff --git a/node_modules/typescript/lib/typescriptServices.js b/node_modules/typescript/lib/typescriptServices.js index 4e9013c..ab017e6 100644 --- a/node_modules/typescript/lib/typescriptServices.js +++ b/node_modules/typescript/lib/typescriptServices.js @@ -286,9 +286,9 @@ var ts; (function (ts) { // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configurePrerelease` too. - ts.versionMajorMinor = "4.1"; + ts.versionMajorMinor = "4.0"; /** The version of the TypeScript compiler release */ - ts.version = "4.1.3"; + ts.version = "4.0.2"; /* @internal */ var Comparison; (function (Comparison) { @@ -1381,7 +1381,7 @@ var ts; var high = array.length - 1; while (low <= high) { var middle = low + ((high - low) >> 1); - var midKey = keySelector(array[middle], middle); + var midKey = keySelector(array[middle]); switch (keyComparer(midKey, key)) { case -1 /* LessThan */: low = middle + 1; @@ -1476,14 +1476,15 @@ var ts; return values; } ts.getOwnValues = getOwnValues; - var _entries = Object.entries || (function (obj) { + var _entries = Object.entries ? Object.entries : function (obj) { var keys = getOwnKeys(obj); var result = Array(keys.length); - for (var i = 0; i < keys.length; i++) { - result[i] = [keys[i], obj[keys[i]]]; + for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { + var key = keys_1[_i]; + result.push([key, obj[key]]); } return result; - }); + }; function getEntries(obj) { return obj ? _entries(obj) : []; } @@ -2355,39 +2356,20 @@ var ts; } } } - /** - * Returns string left-padded with spaces or zeros until it reaches the given length. - * - * @param s String to pad. - * @param length Final padded length. If less than or equal to 's.length', returns 's' unchanged. - * @param padString Character to use as padding (default " "). - */ - function padLeft(s, length, padString) { - if (padString === void 0) { padString = " "; } - return length <= s.length ? s : padString.repeat(length - s.length) + s; + function padLeft(s, length) { + while (s.length < length) { + s = " " + s; + } + return s; } ts.padLeft = padLeft; - /** - * Returns string right-padded with spaces until it reaches the given length. - * - * @param s String to pad. - * @param length Final padded length. If less than or equal to 's.length', returns 's' unchanged. - * @param padString Character to use as padding (default " "). - */ - function padRight(s, length, padString) { - if (padString === void 0) { padString = " "; } - return length <= s.length ? s : s + padString.repeat(length - s.length); + function padRight(s, length) { + while (s.length < length) { + s = s + " "; + } + return s; } ts.padRight = padRight; - function takeWhile(array, predicate) { - var len = array.length; - var index = 0; - while (index < len && predicate(array[index])) { - index++; - } - return array.slice(0, index); - } - ts.takeWhile = takeWhile; })(ts || (ts = {})); /* @internal */ var ts; @@ -2702,10 +2684,6 @@ var ts; return formatEnum(flags, ts.ObjectFlags, /*isFlags*/ true); } Debug.formatObjectFlags = formatObjectFlags; - function formatFlowFlags(flags) { - return formatEnum(flags, ts.FlowFlags, /*isFlags*/ true); - } - Debug.formatFlowFlags = formatFlowFlags; var isDebugInfoEnabled = false; var extendedDebugModule; function extendedDebug() { @@ -2723,167 +2701,31 @@ var ts; return extendedDebug().formatControlFlowGraph(flowNode); } Debug.formatControlFlowGraph = formatControlFlowGraph; - var flowNodeProto; - function attachFlowNodeDebugInfoWorker(flowNode) { - if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line no-in-operator - Object.defineProperties(flowNode, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var flowHeader = this.flags & 2 /* Start */ ? "FlowStart" : - this.flags & 4 /* BranchLabel */ ? "FlowBranchLabel" : - this.flags & 8 /* LoopLabel */ ? "FlowLoopLabel" : - this.flags & 16 /* Assignment */ ? "FlowAssignment" : - this.flags & 32 /* TrueCondition */ ? "FlowTrueCondition" : - this.flags & 64 /* FalseCondition */ ? "FlowFalseCondition" : - this.flags & 128 /* SwitchClause */ ? "FlowSwitchClause" : - this.flags & 256 /* ArrayMutation */ ? "FlowArrayMutation" : - this.flags & 512 /* Call */ ? "FlowCall" : - this.flags & 1024 /* ReduceLabel */ ? "FlowReduceLabel" : - this.flags & 1 /* Unreachable */ ? "FlowUnreachable" : - "UnknownFlow"; - var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1); - return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : ""); - } - }, - __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } }, - __debugToString: { value: function () { return formatControlFlowGraph(this); } } - }); - } - } function attachFlowNodeDebugInfo(flowNode) { if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - // if we're in es2015, attach the method to a shared prototype for `FlowNode` - // so the method doesn't show up in the watch window. - if (!flowNodeProto) { - flowNodeProto = Object.create(Object.prototype); - attachFlowNodeDebugInfoWorker(flowNodeProto); - } - Object.setPrototypeOf(flowNode, flowNodeProto); - } - else { - // not running in an es2015 environment, attach the method directly. - attachFlowNodeDebugInfoWorker(flowNode); + if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line no-in-operator + Object.defineProperties(flowNode, { + __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } }, + __debugToString: { value: function () { return formatControlFlowGraph(this); } } + }); } } } Debug.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo; - var nodeArrayProto; - function attachNodeArrayDebugInfoWorker(array) { - if (!("__tsDebuggerDisplay" in array)) { // eslint-disable-line no-in-operator - Object.defineProperties(array, { - __tsDebuggerDisplay: { - value: function (defaultValue) { - // An `Array` with extra properties is rendered as `[A, B, prop1: 1, prop2: 2]`. Most of - // these aren't immediately useful so we trim off the `prop1: ..., prop2: ...` part from the - // formatted string. - defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]"); - return "NodeArray " + defaultValue; - } - } - }); - } - } - function attachNodeArrayDebugInfo(array) { - if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - // if we're in es2015, attach the method to a shared prototype for `NodeArray` - // so the method doesn't show up in the watch window. - if (!nodeArrayProto) { - nodeArrayProto = Object.create(Array.prototype); - attachNodeArrayDebugInfoWorker(nodeArrayProto); - } - Object.setPrototypeOf(array, nodeArrayProto); - } - else { - // not running in an es2015 environment, attach the method directly. - attachNodeArrayDebugInfoWorker(array); - } - } - } - Debug.attachNodeArrayDebugInfo = attachNodeArrayDebugInfo; /** * Injects debug information into frequently used types. */ function enableDebugInfo() { if (isDebugInfoEnabled) return; - // avoid recomputing - var weakTypeTextMap; - var weakNodeTextMap; - function getWeakTypeTextMap() { - if (weakTypeTextMap === undefined) { - if (typeof WeakMap === "function") - weakTypeTextMap = new WeakMap(); - } - return weakTypeTextMap; - } - function getWeakNodeTextMap() { - if (weakNodeTextMap === undefined) { - if (typeof WeakMap === "function") - weakNodeTextMap = new WeakMap(); - } - return weakNodeTextMap; - } // Add additional properties in debug mode to assist with debugging. Object.defineProperties(ts.objectAllocator.getSymbolConstructor().prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" : - "Symbol"; - var remainingSymbolFlags = this.flags & ~33554432 /* Transient */; - return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : ""); - } - }, __debugFlags: { get: function () { return formatSymbolFlags(this.flags); } } }); Object.defineProperties(ts.objectAllocator.getTypeConstructor().prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" : - this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType " + JSON.stringify(this.value) : - this.flags & 2048 /* BigIntLiteral */ ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" : - this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : - this.flags & 32 /* Enum */ ? "EnumType" : - this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType " + this.intrinsicName : - this.flags & 1048576 /* Union */ ? "UnionType" : - this.flags & 2097152 /* Intersection */ ? "IntersectionType" : - this.flags & 4194304 /* Index */ ? "IndexType" : - this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : - this.flags & 16777216 /* Conditional */ ? "ConditionalType" : - this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : - this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : - this.flags & 524288 /* Object */ ? - this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : - this.objectFlags & 4 /* Reference */ ? "TypeReference" : - this.objectFlags & 8 /* Tuple */ ? "TupleType" : - this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : - this.objectFlags & 32 /* Mapped */ ? "MappedType" : - this.objectFlags & 2048 /* ReverseMapped */ ? "ReverseMappedType" : - this.objectFlags & 256 /* EvolvingArray */ ? "EvolvingArrayType" : - "ObjectType" : - "Type"; - var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~2367 /* ObjectTypeKindMask */ : 0; - return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : ""); - } - }, __debugFlags: { get: function () { return formatTypeFlags(this.flags); } }, __debugObjectFlags: { get: function () { return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : ""; } }, - __debugTypeToString: { - value: function () { - // avoid recomputing - var map = getWeakTypeTextMap(); - var text = map === null || map === void 0 ? void 0 : map.get(this); - if (text === undefined) { - text = this.checker.typeToString(this); - map === null || map === void 0 ? void 0 : map.set(this, text); - } - return text; - } - }, + __debugTypeToString: { value: function () { return this.checker.typeToString(this); } }, }); var nodeConstructors = [ ts.objectAllocator.getNodeConstructor(), @@ -2895,49 +2737,6 @@ var ts; var ctor = nodeConstructors_1[_i]; if (!ctor.prototype.hasOwnProperty("__debugKind")) { Object.defineProperties(ctor.prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" : - ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" : - ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" : - ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") : - ts.isNumericLiteral(this) ? "NumericLiteral " + this.text : - ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" : - ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" : - ts.isParameter(this) ? "ParameterDeclaration" : - ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" : - ts.isGetAccessorDeclaration(this) ? "GetAccessorDeclaration" : - ts.isSetAccessorDeclaration(this) ? "SetAccessorDeclaration" : - ts.isCallSignatureDeclaration(this) ? "CallSignatureDeclaration" : - ts.isConstructSignatureDeclaration(this) ? "ConstructSignatureDeclaration" : - ts.isIndexSignatureDeclaration(this) ? "IndexSignatureDeclaration" : - ts.isTypePredicateNode(this) ? "TypePredicateNode" : - ts.isTypeReferenceNode(this) ? "TypeReferenceNode" : - ts.isFunctionTypeNode(this) ? "FunctionTypeNode" : - ts.isConstructorTypeNode(this) ? "ConstructorTypeNode" : - ts.isTypeQueryNode(this) ? "TypeQueryNode" : - ts.isTypeLiteralNode(this) ? "TypeLiteralNode" : - ts.isArrayTypeNode(this) ? "ArrayTypeNode" : - ts.isTupleTypeNode(this) ? "TupleTypeNode" : - ts.isOptionalTypeNode(this) ? "OptionalTypeNode" : - ts.isRestTypeNode(this) ? "RestTypeNode" : - ts.isUnionTypeNode(this) ? "UnionTypeNode" : - ts.isIntersectionTypeNode(this) ? "IntersectionTypeNode" : - ts.isConditionalTypeNode(this) ? "ConditionalTypeNode" : - ts.isInferTypeNode(this) ? "InferTypeNode" : - ts.isParenthesizedTypeNode(this) ? "ParenthesizedTypeNode" : - ts.isThisTypeNode(this) ? "ThisTypeNode" : - ts.isTypeOperatorNode(this) ? "TypeOperatorNode" : - ts.isIndexedAccessTypeNode(this) ? "IndexedAccessTypeNode" : - ts.isMappedTypeNode(this) ? "MappedTypeNode" : - ts.isLiteralTypeNode(this) ? "LiteralTypeNode" : - ts.isNamedTupleMember(this) ? "NamedTupleMember" : - ts.isImportTypeNode(this) ? "ImportTypeNode" : - formatSyntaxKind(this.kind); - return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : ""); - } - }, __debugKind: { get: function () { return formatSyntaxKind(this.kind); } }, __debugNodeFlags: { get: function () { return formatNodeFlags(this.flags); } }, __debugModifierFlags: { get: function () { return formatModifierFlags(ts.getEffectiveModifierFlagsNoCache(this)); } }, @@ -2948,16 +2747,9 @@ var ts; value: function (includeTrivia) { if (ts.nodeIsSynthesized(this)) return ""; - // avoid recomputing - var map = getWeakNodeTextMap(); - var text = map === null || map === void 0 ? void 0 : map.get(this); - if (text === undefined) { - var parseNode = ts.getParseTreeNode(this); - var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); - text = sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; - map === null || map === void 0 ? void 0 : map.set(this, text); - } - return text; + var parseNode = ts.getParseTreeNode(this); + var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); + return sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; } } }); @@ -3029,6 +2821,168 @@ var ts; Debug.deprecate = deprecate; })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); +/*@internal*/ +var ts; +(function (ts) { + /** Gets a timestamp with (at least) ms resolution */ + ts.timestamp = typeof performance !== "undefined" && performance.now ? function () { return performance.now(); } : Date.now ? Date.now : function () { return +(new Date()); }; +})(ts || (ts = {})); +/*@internal*/ +/** Performance measurements for the compiler. */ +var ts; +(function (ts) { + var performance; + (function (performance) { + // NOTE: cannot use ts.noop as core.ts loads after this + var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : function () { }; + var enabled = false; + var profilerStart = 0; + var counts; + var marks; + var measures; + function createTimerIf(condition, measureName, startMarkName, endMarkName) { + return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer; + } + performance.createTimerIf = createTimerIf; + function createTimer(measureName, startMarkName, endMarkName) { + var enterCount = 0; + return { + enter: enter, + exit: exit + }; + function enter() { + if (++enterCount === 1) { + mark(startMarkName); + } + } + function exit() { + if (--enterCount === 0) { + mark(endMarkName); + measure(measureName, startMarkName, endMarkName); + } + else if (enterCount < 0) { + ts.Debug.fail("enter/exit count does not match."); + } + } + } + performance.createTimer = createTimer; + performance.nullTimer = { enter: ts.noop, exit: ts.noop }; + /** + * Marks a performance event. + * + * @param markName The name of the mark. + */ + function mark(markName) { + if (enabled) { + marks.set(markName, ts.timestamp()); + counts.set(markName, (counts.get(markName) || 0) + 1); + profilerEvent(markName); + } + } + performance.mark = mark; + /** + * Adds a performance measurement with the specified name. + * + * @param measureName The name of the performance measurement. + * @param startMarkName The name of the starting mark. If not supplied, the point at which the + * profiler was enabled is used. + * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is + * used. + */ + function measure(measureName, startMarkName, endMarkName) { + if (enabled) { + var end = endMarkName && marks.get(endMarkName) || ts.timestamp(); + var start = startMarkName && marks.get(startMarkName) || profilerStart; + measures.set(measureName, (measures.get(measureName) || 0) + (end - start)); + } + } + performance.measure = measure; + /** + * Gets the number of times a marker was encountered. + * + * @param markName The name of the mark. + */ + function getCount(markName) { + return counts && counts.get(markName) || 0; + } + performance.getCount = getCount; + /** + * Gets the total duration of all measurements with the supplied name. + * + * @param measureName The name of the measure whose durations should be accumulated. + */ + function getDuration(measureName) { + return measures && measures.get(measureName) || 0; + } + performance.getDuration = getDuration; + /** + * Iterate over each measure, performing some action + * + * @param cb The action to perform for each measure + */ + function forEachMeasure(cb) { + measures.forEach(function (measure, key) { + cb(key, measure); + }); + } + performance.forEachMeasure = forEachMeasure; + /** Enables (and resets) performance measurements for the compiler. */ + function enable() { + counts = new ts.Map(); + marks = new ts.Map(); + measures = new ts.Map(); + enabled = true; + profilerStart = ts.timestamp(); + } + performance.enable = enable; + /** Disables performance measurements for the compiler. */ + function disable() { + enabled = false; + } + performance.disable = disable; + })(performance = ts.performance || (ts.performance = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var _a; + var nullLogger = { + logEvent: ts.noop, + logErrEvent: ts.noop, + logPerfEvent: ts.noop, + logInfoEvent: ts.noop, + logStartCommand: ts.noop, + logStopCommand: ts.noop, + logStartUpdateProgram: ts.noop, + logStopUpdateProgram: ts.noop, + logStartUpdateGraph: ts.noop, + logStopUpdateGraph: ts.noop, + logStartResolveModule: ts.noop, + logStopResolveModule: ts.noop, + logStartParseSourceFile: ts.noop, + logStopParseSourceFile: ts.noop, + logStartReadFile: ts.noop, + logStopReadFile: ts.noop, + logStartBindFile: ts.noop, + logStopBindFile: ts.noop, + logStartScheduledOperation: ts.noop, + logStopScheduledOperation: ts.noop, + }; + // Load optional module to enable Event Tracing for Windows + // See https://github.com/microsoft/typescript-etw for more information + var etwModule; + try { + var etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) !== null && _a !== void 0 ? _a : "./node_modules/@microsoft/typescript-etw"; + // require() will throw an exception if the module is not found + // It may also return undefined if not installed properly + etwModule = require(etwModulePath); + } + catch (e) { + etwModule = undefined; + } + /** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */ + ts.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; +})(ts || (ts = {})); /* @internal */ var ts; (function (ts) { @@ -3105,7 +3059,7 @@ var ts; return ts.compareValues(this.major, other.major) || ts.compareValues(this.minor, other.minor) || ts.compareValues(this.patch, other.patch) - || comparePrereleaseIdentifiers(this.prerelease, other.prerelease); + || comparePrerelaseIdentifiers(this.prerelease, other.prerelease); }; Version.prototype.increment = function (field) { switch (field) { @@ -3144,7 +3098,7 @@ var ts; build: build }; } - function comparePrereleaseIdentifiers(left, right) { + function comparePrerelaseIdentifiers(left, right) { // https://semver.org/#spec-item-11 // > When major, minor, and patch are equal, a pre-release version has lower precedence // > than a normal version. @@ -3389,485 +3343,6 @@ var ts; return "" + comparator.operator + comparator.operand; } })(ts || (ts = {})); -/*@internal*/ -var ts; -(function (ts) { - // The following definitions provide the minimum compatible support for the Web Performance User Timings API - // between browsers and NodeJS: - // eslint-disable-next-line @typescript-eslint/naming-convention - function hasRequiredAPI(performance, PerformanceObserver) { - return typeof performance === "object" && - typeof performance.timeOrigin === "number" && - typeof performance.mark === "function" && - typeof performance.measure === "function" && - typeof performance.now === "function" && - typeof PerformanceObserver === "function"; - } - function tryGetWebPerformanceHooks() { - if (typeof performance === "object" && - typeof PerformanceObserver === "function" && - hasRequiredAPI(performance, PerformanceObserver)) { - return { - performance: performance, - PerformanceObserver: PerformanceObserver - }; - } - } - function tryGetNodePerformanceHooks() { - if (typeof module === "object" && typeof require === "function") { - try { - var _a = require("perf_hooks"), performance_1 = _a.performance, PerformanceObserver_1 = _a.PerformanceObserver; - if (hasRequiredAPI(performance_1, PerformanceObserver_1)) { - // There is a bug in Node's performance.measure prior to 12.16.3/13.13.0 that does not - // match the Web Performance API specification. Node's implementation did not allow - // optional `start` and `end` arguments for `performance.measure`. - // See https://github.com/nodejs/node/pull/32651 for more information. - var version_1 = new ts.Version(process.versions.node); - var range = new ts.VersionRange("<12.16.3 || 13 <13.13"); - if (range.test(version_1)) { - return { - performance: { - get timeOrigin() { return performance_1.timeOrigin; }, - now: function () { return performance_1.now(); }, - mark: function (name) { return performance_1.mark(name); }, - measure: function (name, start, end) { - if (start === void 0) { start = "nodeStart"; } - if (end === undefined) { - end = "__performance.measure-fix__"; - performance_1.mark(end); - } - performance_1.measure(name, start, end); - if (end === "__performance.measure-fix__") { - performance_1.clearMarks("__performance.measure-fix__"); - } - } - }, - PerformanceObserver: PerformanceObserver_1 - }; - } - return { - performance: performance_1, - PerformanceObserver: PerformanceObserver_1 - }; - } - } - catch (_b) { - // ignore errors - } - } - } - // Unlike with the native Map/Set 'tryGet' functions in corePublic.ts, we eagerly evaluate these - // since we will need them for `timestamp`, below. - var nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks(); - var nativePerformance = nativePerformanceHooks === null || nativePerformanceHooks === void 0 ? void 0 : nativePerformanceHooks.performance; - function tryGetNativePerformanceHooks() { - return nativePerformanceHooks; - } - ts.tryGetNativePerformanceHooks = tryGetNativePerformanceHooks; - /** Gets a timestamp with (at least) ms resolution */ - ts.timestamp = nativePerformance ? function () { return nativePerformance.now(); } : - Date.now ? Date.now : - function () { return +(new Date()); }; -})(ts || (ts = {})); -/*@internal*/ -/** Performance measurements for the compiler. */ -var ts; -(function (ts) { - var performance; - (function (performance) { - var perfHooks; - var perfObserver; - // when set, indicates the implementation of `Performance` to use for user timing. - // when unset, indicates user timing is unavailable or disabled. - var performanceImpl; - function createTimerIf(condition, measureName, startMarkName, endMarkName) { - return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer; - } - performance.createTimerIf = createTimerIf; - function createTimer(measureName, startMarkName, endMarkName) { - var enterCount = 0; - return { - enter: enter, - exit: exit - }; - function enter() { - if (++enterCount === 1) { - mark(startMarkName); - } - } - function exit() { - if (--enterCount === 0) { - mark(endMarkName); - measure(measureName, startMarkName, endMarkName); - } - else if (enterCount < 0) { - ts.Debug.fail("enter/exit count does not match."); - } - } - } - performance.createTimer = createTimer; - performance.nullTimer = { enter: ts.noop, exit: ts.noop }; - var counts = new ts.Map(); - var durations = new ts.Map(); - /** - * Marks a performance event. - * - * @param markName The name of the mark. - */ - function mark(markName) { - performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.mark(markName); - } - performance.mark = mark; - /** - * Adds a performance measurement with the specified name. - * - * @param measureName The name of the performance measurement. - * @param startMarkName The name of the starting mark. If not supplied, the point at which the - * profiler was enabled is used. - * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is - * used. - */ - function measure(measureName, startMarkName, endMarkName) { - performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName); - } - performance.measure = measure; - /** - * Gets the number of times a marker was encountered. - * - * @param markName The name of the mark. - */ - function getCount(markName) { - return counts.get(markName) || 0; - } - performance.getCount = getCount; - /** - * Gets the total duration of all measurements with the supplied name. - * - * @param measureName The name of the measure whose durations should be accumulated. - */ - function getDuration(measureName) { - return durations.get(measureName) || 0; - } - performance.getDuration = getDuration; - /** - * Iterate over each measure, performing some action - * - * @param cb The action to perform for each measure - */ - function forEachMeasure(cb) { - durations.forEach(function (duration, measureName) { return cb(measureName, duration); }); - } - performance.forEachMeasure = forEachMeasure; - /** - * Indicates whether the performance API is enabled. - */ - function isEnabled() { - return !!performanceImpl; - } - performance.isEnabled = isEnabled; - /** Enables (and resets) performance measurements for the compiler. */ - function enable() { - if (!performanceImpl) { - perfHooks || (perfHooks = ts.tryGetNativePerformanceHooks()); - if (!perfHooks) - return false; - perfObserver || (perfObserver = new perfHooks.PerformanceObserver(updateStatisticsFromList)); - perfObserver.observe({ entryTypes: ["mark", "measure"] }); - performanceImpl = perfHooks.performance; - } - return true; - } - performance.enable = enable; - /** Disables performance measurements for the compiler. */ - function disable() { - perfObserver === null || perfObserver === void 0 ? void 0 : perfObserver.disconnect(); - performanceImpl = undefined; - counts.clear(); - durations.clear(); - } - performance.disable = disable; - function updateStatisticsFromList(list) { - for (var _i = 0, _a = list.getEntriesByType("mark"); _i < _a.length; _i++) { - var mark_1 = _a[_i]; - counts.set(mark_1.name, (counts.get(mark_1.name) || 0) + 1); - } - for (var _b = 0, _c = list.getEntriesByType("measure"); _b < _c.length; _b++) { - var measure_1 = _c[_b]; - durations.set(measure_1.name, (durations.get(measure_1.name) || 0) + measure_1.duration); - } - } - })(performance = ts.performance || (ts.performance = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var _a; - var nullLogger = { - logEvent: ts.noop, - logErrEvent: ts.noop, - logPerfEvent: ts.noop, - logInfoEvent: ts.noop, - logStartCommand: ts.noop, - logStopCommand: ts.noop, - logStartUpdateProgram: ts.noop, - logStopUpdateProgram: ts.noop, - logStartUpdateGraph: ts.noop, - logStopUpdateGraph: ts.noop, - logStartResolveModule: ts.noop, - logStopResolveModule: ts.noop, - logStartParseSourceFile: ts.noop, - logStopParseSourceFile: ts.noop, - logStartReadFile: ts.noop, - logStopReadFile: ts.noop, - logStartBindFile: ts.noop, - logStopBindFile: ts.noop, - logStartScheduledOperation: ts.noop, - logStopScheduledOperation: ts.noop, - }; - // Load optional module to enable Event Tracing for Windows - // See https://github.com/microsoft/typescript-etw for more information - var etwModule; - try { - var etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) !== null && _a !== void 0 ? _a : "./node_modules/@microsoft/typescript-etw"; - // require() will throw an exception if the module is not found - // It may also return undefined if not installed properly - etwModule = require(etwModulePath); - } - catch (e) { - etwModule = undefined; - } - /** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */ - ts.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; -})(ts || (ts = {})); -/*@internal*/ -/** Tracing events for the compiler. */ -var ts; -(function (ts) { - var tracing; - (function (tracing) { - var fs; - var traceCount = 0; - var traceFd; - var legendPath; - var legend = []; - /** Starts tracing for the given project (unless the `fs` module is unavailable). */ - function startTracing(configFilePath, traceDir, isBuildMode) { - ts.Debug.assert(!traceFd, "Tracing already started"); - if (fs === undefined) { - try { - fs = require("fs"); - } - catch (_a) { - fs = false; - } - } - if (!fs) { - return; - } - if (legendPath === undefined) { - legendPath = ts.combinePaths(traceDir, "legend.json"); - } - // Note that writing will fail later on if it exists and is not a directory - if (!fs.existsSync(traceDir)) { - fs.mkdirSync(traceDir, { recursive: true }); - } - var countPart = isBuildMode ? "." + ++traceCount : ""; - var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json"); - var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json"); - legend.push({ - configFilePath: configFilePath, - tracePath: tracePath, - typesPath: typesPath, - }); - traceFd = fs.openSync(tracePath, "w"); - // Start with a prefix that contains some metadata that the devtools profiler expects (also avoids a warning on import) - var meta = { cat: "__metadata", ph: "M", ts: 1000 * ts.timestamp(), pid: 1, tid: 1 }; - fs.writeSync(traceFd, "[\n" - + [__assign({ name: "process_name", args: { name: "tsc" } }, meta), __assign({ name: "thread_name", args: { name: "Main" } }, meta), __assign(__assign({ name: "TracingStartedInBrowser" }, meta), { cat: "disabled-by-default-devtools.timeline" })] - .map(function (v) { return JSON.stringify(v); }).join(",\n")); - } - tracing.startTracing = startTracing; - /** Stops tracing for the in-progress project and dumps the type catalog (unless the `fs` module is unavailable). */ - function stopTracing(typeCatalog) { - if (!traceFd) { - ts.Debug.assert(!fs, "Tracing is not in progress"); - return; - } - ts.Debug.assert(fs); - fs.writeSync(traceFd, "\n]\n"); - fs.closeSync(traceFd); - traceFd = undefined; - if (typeCatalog) { - dumpTypes(typeCatalog); - } - else { - // We pre-computed this path for convenience, but clear it - // now that the file won't be created. - legend[legend.length - 1].typesPath = undefined; - } - } - tracing.stopTracing = stopTracing; - function isTracing() { - return !!traceFd; - } - tracing.isTracing = isTracing; - var Phase; - (function (Phase) { - Phase["Parse"] = "parse"; - Phase["Program"] = "program"; - Phase["Bind"] = "bind"; - Phase["Check"] = "check"; - Phase["Emit"] = "emit"; - })(Phase = tracing.Phase || (tracing.Phase = {})); - /** Note: `push`/`pop` should be used by default. - * `begin`/`end` are for special cases where we need the data point even if the event never - * terminates (typically for reducing a scenario too big to trace to one that can be completed). - * In the future we might implement an exit handler to dump unfinished events which would - * deprecate these operations. - */ - function begin(phase, name, args) { - if (!traceFd) - return; - writeEvent("B", phase, name, args); - } - tracing.begin = begin; - function end(phase, name, args) { - if (!traceFd) - return; - writeEvent("E", phase, name, args); - } - tracing.end = end; - function instant(phase, name, args) { - if (!traceFd) - return; - writeEvent("I", phase, name, args, "\"s\":\"g\""); - } - tracing.instant = instant; - // Used for "Complete" (ph:"X") events - var completeEvents = []; - function push(phase, name, args) { - if (!traceFd) - return; - completeEvents.push({ phase: phase, name: name, args: args, time: 1000 * ts.timestamp() }); - } - tracing.push = push; - function pop() { - if (!traceFd) - return; - ts.Debug.assert(completeEvents.length > 0); - var _a = completeEvents.pop(), phase = _a.phase, name = _a.name, args = _a.args, time = _a.time; - var dur = 1000 * ts.timestamp() - time; - writeEvent("X", phase, name, args, "\"dur\":" + dur, time); - } - tracing.pop = pop; - function writeEvent(eventType, phase, name, args, extras, time) { - if (time === void 0) { time = 1000 * ts.timestamp(); } - ts.Debug.assert(traceFd); - ts.Debug.assert(fs); - ts.performance.mark("beginTracing"); - fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\""); - if (extras) - fs.writeSync(traceFd, "," + extras); - if (args) - fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args)); - fs.writeSync(traceFd, "}"); - ts.performance.mark("endTracing"); - ts.performance.measure("Tracing", "beginTracing", "endTracing"); - } - function indexFromOne(lc) { - return { - line: lc.line + 1, - character: lc.character + 1, - }; - } - function dumpTypes(types) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r; - ts.Debug.assert(fs); - ts.performance.mark("beginDumpTypes"); - var typesPath = legend[legend.length - 1].typesPath; - var typesFd = fs.openSync(typesPath, "w"); - var recursionIdentityMap = new ts.Map(); - // Cleverness: no line break here so that the type ID will match the line number - fs.writeSync(typesFd, "["); - var numTypes = types.length; - for (var i = 0; i < numTypes; i++) { - var type = types[i]; - var objectFlags = type.objectFlags; - var symbol = (_a = type.aliasSymbol) !== null && _a !== void 0 ? _a : type.symbol; - var firstDeclaration = (_b = symbol === null || symbol === void 0 ? void 0 : symbol.declarations) === null || _b === void 0 ? void 0 : _b[0]; - var firstFile = firstDeclaration && ts.getSourceFileOfNode(firstDeclaration); - // It's slow to compute the display text, so skip it unless it's really valuable (or cheap) - var display = void 0; - if ((objectFlags & 16 /* Anonymous */) | (type.flags & 2944 /* Literal */)) { - try { - display = (_c = type.checker) === null || _c === void 0 ? void 0 : _c.typeToString(type); - } - catch (_s) { - display = undefined; - } - } - var indexedAccessProperties = {}; - if (type.flags & 8388608 /* IndexedAccess */) { - var indexedAccessType = type; - indexedAccessProperties = { - indexedAccessObjectType: (_d = indexedAccessType.objectType) === null || _d === void 0 ? void 0 : _d.id, - indexedAccessIndexType: (_e = indexedAccessType.indexType) === null || _e === void 0 ? void 0 : _e.id, - }; - } - var referenceProperties = {}; - if (objectFlags & 4 /* Reference */) { - var referenceType = type; - referenceProperties = { - instantiatedType: (_f = referenceType.target) === null || _f === void 0 ? void 0 : _f.id, - typeArguments: (_g = referenceType.resolvedTypeArguments) === null || _g === void 0 ? void 0 : _g.map(function (t) { return t.id; }), - }; - } - var conditionalProperties = {}; - if (type.flags & 16777216 /* Conditional */) { - var conditionalType = type; - conditionalProperties = { - conditionalCheckType: (_h = conditionalType.checkType) === null || _h === void 0 ? void 0 : _h.id, - conditionalExtendsType: (_j = conditionalType.extendsType) === null || _j === void 0 ? void 0 : _j.id, - conditionalTrueType: (_l = (_k = conditionalType.resolvedTrueType) === null || _k === void 0 ? void 0 : _k.id) !== null && _l !== void 0 ? _l : -1, - conditionalFalseType: (_o = (_m = conditionalType.resolvedFalseType) === null || _m === void 0 ? void 0 : _m.id) !== null && _o !== void 0 ? _o : -1, - }; - } - // We can't print out an arbitrary object, so just assign each one a unique number. - // Don't call it an "id" so people don't treat it as a type id. - var recursionToken = void 0; - var recursionIdentity = type.checker.getRecursionIdentity(type); - if (recursionIdentity) { - recursionToken = recursionIdentityMap.get(recursionIdentity); - if (!recursionToken) { - recursionToken = recursionIdentityMap.size; - recursionIdentityMap.set(recursionIdentity, recursionToken); - } - } - var descriptor = __assign(__assign(__assign(__assign({ id: type.id, intrinsicName: type.intrinsicName, symbolName: (symbol === null || symbol === void 0 ? void 0 : symbol.escapedName) && ts.unescapeLeadingUnderscores(symbol.escapedName), recursionId: recursionToken, unionTypes: (type.flags & 1048576 /* Union */) ? (_p = type.types) === null || _p === void 0 ? void 0 : _p.map(function (t) { return t.id; }) : undefined, intersectionTypes: (type.flags & 2097152 /* Intersection */) ? type.types.map(function (t) { return t.id; }) : undefined, aliasTypeArguments: (_q = type.aliasTypeArguments) === null || _q === void 0 ? void 0 : _q.map(function (t) { return t.id; }), keyofType: (type.flags & 4194304 /* Index */) ? (_r = type.type) === null || _r === void 0 ? void 0 : _r.id : undefined }, indexedAccessProperties), referenceProperties), conditionalProperties), { firstDeclaration: firstDeclaration && { - path: firstFile.path, - start: indexFromOne(ts.getLineAndCharacterOfPosition(firstFile, firstDeclaration.pos)), - end: indexFromOne(ts.getLineAndCharacterOfPosition(ts.getSourceFileOfNode(firstDeclaration), firstDeclaration.end)), - }, flags: ts.Debug.formatTypeFlags(type.flags).split("|"), display: display }); - fs.writeSync(typesFd, JSON.stringify(descriptor)); - if (i < numTypes - 1) { - fs.writeSync(typesFd, ",\n"); - } - } - fs.writeSync(typesFd, "]\n"); - fs.closeSync(typesFd); - ts.performance.mark("endDumpTypes"); - ts.performance.measure("Dump types", "beginDumpTypes", "endDumpTypes"); - } - function dumpLegend() { - if (!legendPath) { - return; - } - ts.Debug.assert(fs); - fs.writeFileSync(legendPath, JSON.stringify(legend)); - } - tracing.dumpLegend = dumpLegend; - })(tracing = ts.tracing || (ts.tracing = {})); -})(ts || (ts = {})); var ts; (function (ts) { // token > SyntaxKind.Identifier => token is a keyword @@ -4022,235 +3497,230 @@ var ts; SyntaxKind[SyntaxKind["DeclareKeyword"] = 133] = "DeclareKeyword"; SyntaxKind[SyntaxKind["GetKeyword"] = 134] = "GetKeyword"; SyntaxKind[SyntaxKind["InferKeyword"] = 135] = "InferKeyword"; - SyntaxKind[SyntaxKind["IntrinsicKeyword"] = 136] = "IntrinsicKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 137] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 138] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 139] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 140] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 141] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 142] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 143] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 144] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 145] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 146] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 147] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 148] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 149] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 150] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 151] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 152] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 153] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 154] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 155] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 156] = "OfKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 136] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 137] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 138] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 139] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 140] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 141] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 142] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 143] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 144] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 145] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 146] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 147] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 148] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 149] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 150] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 151] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 152] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 153] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 154] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 155] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 157] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 158] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 156] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 157] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 159] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 160] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 161] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 158] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 159] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 160] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 162] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 163] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 164] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 165] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 166] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 167] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 168] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 169] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 170] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 171] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 161] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 162] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 163] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 164] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 165] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 166] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 167] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 168] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 169] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 170] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 172] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 173] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 174] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 175] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 176] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 177] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 178] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 179] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 180] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 181] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 182] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 183] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 184] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 185] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 186] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 187] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 188] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 189] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 190] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 191] = "LiteralType"; - SyntaxKind[SyntaxKind["NamedTupleMember"] = 192] = "NamedTupleMember"; - SyntaxKind[SyntaxKind["TemplateLiteralType"] = 193] = "TemplateLiteralType"; - SyntaxKind[SyntaxKind["TemplateLiteralTypeSpan"] = 194] = "TemplateLiteralTypeSpan"; - SyntaxKind[SyntaxKind["ImportType"] = 195] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 171] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 172] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 173] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 174] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 175] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 176] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 177] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 178] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 179] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 180] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 181] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 182] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 183] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 184] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 185] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 186] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 187] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 188] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 189] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 190] = "LiteralType"; + SyntaxKind[SyntaxKind["NamedTupleMember"] = 191] = "NamedTupleMember"; + SyntaxKind[SyntaxKind["ImportType"] = 192] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 196] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 197] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 198] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 193] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 194] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 195] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 199] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 200] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 201] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 202] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 203] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 204] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 205] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 206] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 207] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 208] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 209] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 210] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 211] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 212] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 213] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 214] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 215] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 216] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 217] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 218] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 219] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 220] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 221] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 222] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 223] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 224] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 225] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 226] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 227] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 196] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 197] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 198] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 199] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 200] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 201] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 202] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 203] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 204] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 205] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 206] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 207] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 208] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 209] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 210] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 211] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 212] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 213] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 214] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 215] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 216] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 217] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 218] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 219] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 220] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 221] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 222] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 223] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 224] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 228] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 229] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 225] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 226] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 230] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 231] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 232] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 233] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 234] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 235] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 236] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 237] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 238] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 239] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 240] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 241] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 242] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 243] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 244] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 245] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 246] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 247] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 248] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 249] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 250] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 251] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 252] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 253] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 254] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 255] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 256] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 257] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 258] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 259] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 260] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 261] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 262] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 263] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 264] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 265] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 266] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 267] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 268] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 269] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 270] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 271] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 227] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 228] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 229] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 230] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 231] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 232] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 233] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 234] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 235] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 236] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 237] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 238] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 239] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 240] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 241] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 242] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 243] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 244] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 245] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 246] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 247] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 248] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 249] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 250] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 251] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 252] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 253] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 254] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 255] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 256] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 257] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 258] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 259] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 260] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 261] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 262] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 263] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 264] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 265] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 266] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 267] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 268] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 272] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 269] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 273] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 274] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 275] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 276] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 277] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 278] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 279] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 280] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 281] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 282] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 283] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 270] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 271] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 272] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 273] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 274] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 275] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 276] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 277] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 278] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 279] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 280] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 284] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 285] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 286] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 287] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 281] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 282] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 283] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 284] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 288] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 289] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 290] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 285] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 286] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 287] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 291] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 288] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 292] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 293] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 294] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 295] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 296] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 289] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 290] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 291] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 292] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 293] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 297] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 298] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 299] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 300] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 294] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 295] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 296] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 297] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 301] = "JSDocTypeExpression"; - SyntaxKind[SyntaxKind["JSDocNameReference"] = 302] = "JSDocNameReference"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 298] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 303] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 299] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 304] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 305] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 306] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 307] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 308] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 309] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 300] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 301] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 302] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 303] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 304] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 305] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 310] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 311] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 312] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 313] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 314] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 315] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 316] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 317] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 318] = "JSDocDeprecatedTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 319] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 320] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 321] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 322] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 323] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 324] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 325] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 326] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 327] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 328] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 329] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 330] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 331] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocSeeTag"] = 332] = "JSDocSeeTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 333] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 306] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 307] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 308] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 309] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 310] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 311] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 312] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 313] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 314] = "JSDocDeprecatedTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 315] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 316] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 317] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 318] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 319] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 320] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 321] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 322] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 323] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 324] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 325] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 326] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 327] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 328] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 334] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 329] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 335] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 336] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 337] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 338] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 339] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 340] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 330] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 331] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 332] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 333] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 334] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 335] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 341] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 336] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 77] = "LastAssignment"; @@ -4259,15 +3729,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 80] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 115] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 80] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 156] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 155] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 116] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 124] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 172] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 195] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 171] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 192] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 77] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 156] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 155] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -4276,15 +3746,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 77] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 232] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 248] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 157] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 301] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 333] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 314] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 333] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 229] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 245] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 156] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 298] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 328] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 310] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 328] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 125] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 156] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 155] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -4395,7 +3865,6 @@ var ts; GeneratedIdentifierFlags[GeneratedIdentifierFlags["ReservedInNestedScopes"] = 8] = "ReservedInNestedScopes"; GeneratedIdentifierFlags[GeneratedIdentifierFlags["Optimistic"] = 16] = "Optimistic"; GeneratedIdentifierFlags[GeneratedIdentifierFlags["FileLevel"] = 32] = "FileLevel"; - GeneratedIdentifierFlags[GeneratedIdentifierFlags["AllowNameSubstitution"] = 64] = "AllowNameSubstitution"; })(GeneratedIdentifierFlags = ts.GeneratedIdentifierFlags || (ts.GeneratedIdentifierFlags = {})); var TokenFlags; (function (TokenFlags) { @@ -4839,8 +4308,6 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; - TypeFlags[TypeFlags["TemplateLiteral"] = 134217728] = "TemplateLiteral"; - TypeFlags[TypeFlags["StringMapping"] = 268435456] = "StringMapping"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -4857,7 +4324,7 @@ var ts; TypeFlags[TypeFlags["Intrinsic"] = 67359327] = "Intrinsic"; /* @internal */ TypeFlags[TypeFlags["Primitive"] = 131068] = "Primitive"; - TypeFlags[TypeFlags["StringLike"] = 402653316] = "StringLike"; + TypeFlags[TypeFlags["StringLike"] = 132] = "StringLike"; TypeFlags[TypeFlags["NumberLike"] = 296] = "NumberLike"; TypeFlags[TypeFlags["BigIntLike"] = 2112] = "BigIntLike"; TypeFlags[TypeFlags["BooleanLike"] = 528] = "BooleanLike"; @@ -4865,28 +4332,28 @@ var ts; TypeFlags[TypeFlags["ESSymbolLike"] = 12288] = "ESSymbolLike"; TypeFlags[TypeFlags["VoidLike"] = 49152] = "VoidLike"; /* @internal */ - TypeFlags[TypeFlags["DisjointDomains"] = 469892092] = "DisjointDomains"; + TypeFlags[TypeFlags["DisjointDomains"] = 67238908] = "DisjointDomains"; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; - TypeFlags[TypeFlags["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 465829888] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; + TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ TypeFlags[TypeFlags["Simplifiable"] = 25165824] = "Simplifiable"; /* @internal */ - TypeFlags[TypeFlags["Substructure"] = 469237760] = "Substructure"; + TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 536624127] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 469647395] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ - TypeFlags[TypeFlags["IncludesMask"] = 205258751] = "IncludesMask"; + TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; // The following flags are used for different purposes during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesStructuredOrInstantiable"] = 262144] = "IncludesStructuredOrInstantiable"; @@ -4943,16 +4410,11 @@ var ts; ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] = 268435456] = "IsNeverIntersectionComputed"; /* @internal */ ObjectFlags[ObjectFlags["IsNeverIntersection"] = 536870912] = "IsNeverIntersection"; - /* @internal */ - ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 1073741824] = "IsClassInstanceClone"; ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; /* @internal */ ObjectFlags[ObjectFlags["RequiresWidening"] = 1572864] = "RequiresWidening"; /* @internal */ ObjectFlags[ObjectFlags["PropagatingFlags"] = 3670016] = "PropagatingFlags"; - // Object flags that uniquely identify the kind of ObjectType - /* @internal */ - ObjectFlags[ObjectFlags["ObjectTypeKindMask"] = 2367] = "ObjectTypeKindMask"; })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); /* @internal */ var VarianceFlags; @@ -5042,18 +4504,18 @@ var ts; })(InferenceFlags = ts.InferenceFlags || (ts.InferenceFlags = {})); /** * Ternary values are defined such that - * x & y picks the lesser in the order False < Unknown < Maybe < True, and - * x | y picks the greater in the order False < Unknown < Maybe < True. - * Generally, Ternary.Maybe is used as the result of a relation that depends on itself, and - * Ternary.Unknown is used as the result of a variance check that depends on itself. We make - * a distinction because we don't want to cache circular variance check results. + * x & y is False if either x or y is False. + * x & y is Maybe if either x or y is Maybe, but neither x or y is False. + * x & y is True if both x and y are True. + * x | y is False if both x and y are False. + * x | y is Maybe if either x or y is Maybe, but neither x or y is True. + * x | y is True if either x or y is True. */ /* @internal */ var Ternary; (function (Ternary) { Ternary[Ternary["False"] = 0] = "False"; - Ternary[Ternary["Unknown"] = 1] = "Unknown"; - Ternary[Ternary["Maybe"] = 3] = "Maybe"; + Ternary[Ternary["Maybe"] = 1] = "Maybe"; Ternary[Ternary["True"] = -1] = "True"; })(Ternary = ts.Ternary || (ts.Ternary = {})); /* @internal */ @@ -5061,7 +4523,6 @@ var ts; (function (AssignmentDeclarationKind) { AssignmentDeclarationKind[AssignmentDeclarationKind["None"] = 0] = "None"; /// exports.name = expr - /// module.exports.name = expr AssignmentDeclarationKind[AssignmentDeclarationKind["ExportsProperty"] = 1] = "ExportsProperty"; /// module.exports = expr AssignmentDeclarationKind[AssignmentDeclarationKind["ModuleExports"] = 2] = "ModuleExports"; @@ -5142,8 +4603,6 @@ var ts; JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve"; JsxEmit[JsxEmit["React"] = 2] = "React"; JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative"; - JsxEmit[JsxEmit["ReactJSX"] = 4] = "ReactJSX"; - JsxEmit[JsxEmit["ReactJSXDev"] = 5] = "ReactJSXDev"; })(JsxEmit = ts.JsxEmit || (ts.JsxEmit = {})); var ImportsNotUsedAsValues; (function (ImportsNotUsedAsValues) { @@ -5662,696 +5121,8 @@ var ts; args: [{ name: "factory" }], kind: 4 /* MultiLine */ }, - "jsximportsource": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - }, - "jsxruntime": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - }, }; })(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - /** - * Internally, we represent paths as strings with '/' as the directory separator. - * When we make system calls (eg: LanguageServiceHost.getDirectory()), - * we expect the host to correctly handle paths in our specified format. - */ - ts.directorySeparator = "/"; - var altDirectorySeparator = "\\"; - var urlSchemeSeparator = "://"; - var backslashRegExp = /\\/g; - //// Path Tests - /** - * Determines whether a charCode corresponds to `/` or `\`. - */ - function isAnyDirectorySeparator(charCode) { - return charCode === 47 /* slash */ || charCode === 92 /* backslash */; - } - ts.isAnyDirectorySeparator = isAnyDirectorySeparator; - /** - * Determines whether a path starts with a URL scheme (e.g. starts with `http://`, `ftp://`, `file://`, etc.). - */ - function isUrl(path) { - return getEncodedRootLength(path) < 0; - } - ts.isUrl = isUrl; - /** - * Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path - * like `c:`, `c:\` or `c:/`). - */ - function isRootedDiskPath(path) { - return getEncodedRootLength(path) > 0; - } - ts.isRootedDiskPath = isRootedDiskPath; - /** - * Determines whether a path consists only of a path root. - */ - function isDiskPathRoot(path) { - var rootLength = getEncodedRootLength(path); - return rootLength > 0 && rootLength === path.length; - } - ts.isDiskPathRoot = isDiskPathRoot; - /** - * Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.). - * - * ```ts - * // POSIX - * pathIsAbsolute("/path/to/file.ext") === true - * // DOS - * pathIsAbsolute("c:/path/to/file.ext") === true - * // URL - * pathIsAbsolute("file:///path/to/file.ext") === true - * // Non-absolute - * pathIsAbsolute("path/to/file.ext") === false - * pathIsAbsolute("./path/to/file.ext") === false - * ``` - */ - function pathIsAbsolute(path) { - return getEncodedRootLength(path) !== 0; - } - ts.pathIsAbsolute = pathIsAbsolute; - /** - * Determines whether a path starts with a relative path component (i.e. `.` or `..`). - */ - function pathIsRelative(path) { - return /^\.\.?($|[\\/])/.test(path); - } - ts.pathIsRelative = pathIsRelative; - /** - * Determines whether a path is neither relative nor absolute, e.g. "path/to/file". - * Also known misleadingly as "non-relative". - */ - function pathIsBareSpecifier(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path); - } - ts.pathIsBareSpecifier = pathIsBareSpecifier; - function hasExtension(fileName) { - return ts.stringContains(getBaseFileName(fileName), "."); - } - ts.hasExtension = hasExtension; - function fileExtensionIs(path, extension) { - return path.length > extension.length && ts.endsWith(path, extension); - } - ts.fileExtensionIs = fileExtensionIs; - function fileExtensionIsOneOf(path, extensions) { - for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { - var extension = extensions_1[_i]; - if (fileExtensionIs(path, extension)) { - return true; - } - } - return false; - } - ts.fileExtensionIsOneOf = fileExtensionIsOneOf; - /** - * Determines whether a path has a trailing separator (`/` or `\\`). - */ - function hasTrailingDirectorySeparator(path) { - return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); - } - ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator; - //// Path Parsing - function isVolumeCharacter(charCode) { - return (charCode >= 97 /* a */ && charCode <= 122 /* z */) || - (charCode >= 65 /* A */ && charCode <= 90 /* Z */); - } - function getFileUrlVolumeSeparatorEnd(url, start) { - var ch0 = url.charCodeAt(start); - if (ch0 === 58 /* colon */) - return start + 1; - if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { - var ch2 = url.charCodeAt(start + 2); - if (ch2 === 97 /* a */ || ch2 === 65 /* A */) - return start + 3; - } - return -1; - } - /** - * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). - * If the root is part of a URL, the twos-complement of the root length is returned. - */ - function getEncodedRootLength(path) { - if (!path) - return 0; - var ch0 = path.charCodeAt(0); - // POSIX or UNC - if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { - if (path.charCodeAt(1) !== ch0) - return 1; // POSIX: "/" (or non-normalized "\") - var p1 = path.indexOf(ch0 === 47 /* slash */ ? ts.directorySeparator : altDirectorySeparator, 2); - if (p1 < 0) - return path.length; // UNC: "//server" or "\\server" - return p1 + 1; // UNC: "//server/" or "\\server\" - } - // DOS - if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) { - var ch2 = path.charCodeAt(2); - if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) - return 3; // DOS: "c:/" or "c:\" - if (path.length === 2) - return 2; // DOS: "c:" (but not "c:d") - } - // URL - var schemeEnd = path.indexOf(urlSchemeSeparator); - if (schemeEnd !== -1) { - var authorityStart = schemeEnd + urlSchemeSeparator.length; - var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart); - if (authorityEnd !== -1) { // URL: "file:///", "file://server/", "file://server/path" - // For local "file" URLs, include the leading DOS volume (if present). - // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a - // special case interpreted as "the machine from which the URL is being interpreted". - var scheme = path.slice(0, schemeEnd); - var authority = path.slice(authorityStart, authorityEnd); - if (scheme === "file" && (authority === "" || authority === "localhost") && - isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { - var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); - if (volumeSeparatorEnd !== -1) { - if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { - // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/" - return ~(volumeSeparatorEnd + 1); - } - if (volumeSeparatorEnd === path.length) { - // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a" - // but not "file:///c:d" or "file:///c%3ad" - return ~volumeSeparatorEnd; - } - } - } - return ~(authorityEnd + 1); // URL: "file://server/", "http://server/" - } - return ~path.length; // URL: "file://server", "http://server" - } - // relative - return 0; - } - /** - * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). - * - * For example: - * ```ts - * getRootLength("a") === 0 // "" - * getRootLength("/") === 1 // "/" - * getRootLength("c:") === 2 // "c:" - * getRootLength("c:d") === 0 // "" - * getRootLength("c:/") === 3 // "c:/" - * getRootLength("c:\\") === 3 // "c:\\" - * getRootLength("//server") === 7 // "//server" - * getRootLength("//server/share") === 8 // "//server/" - * getRootLength("\\\\server") === 7 // "\\\\server" - * getRootLength("\\\\server\\share") === 8 // "\\\\server\\" - * getRootLength("file:///path") === 8 // "file:///" - * getRootLength("file:///c:") === 10 // "file:///c:" - * getRootLength("file:///c:d") === 8 // "file:///" - * getRootLength("file:///c:/path") === 11 // "file:///c:/" - * getRootLength("file://server") === 13 // "file://server" - * getRootLength("file://server/path") === 14 // "file://server/" - * getRootLength("http://server") === 13 // "http://server" - * getRootLength("http://server/path") === 14 // "http://server/" - * ``` - */ - function getRootLength(path) { - var rootLength = getEncodedRootLength(path); - return rootLength < 0 ? ~rootLength : rootLength; - } - ts.getRootLength = getRootLength; - function getDirectoryPath(path) { - path = normalizeSlashes(path); - // If the path provided is itself the root, then return it. - var rootLength = getRootLength(path); - if (rootLength === path.length) - return path; - // return the leading portion of the path up to the last (non-terminal) directory separator - // but not including any trailing directory separator. - path = removeTrailingDirectorySeparator(path); - return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator))); - } - ts.getDirectoryPath = getDirectoryPath; - function getBaseFileName(path, extensions, ignoreCase) { - path = normalizeSlashes(path); - // if the path provided is itself the root, then it has not file name. - var rootLength = getRootLength(path); - if (rootLength === path.length) - return ""; - // return the trailing portion of the path starting after the last (non-terminal) directory - // separator but not including any trailing directory separator. - path = removeTrailingDirectorySeparator(path); - var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1)); - var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined; - return extension ? name.slice(0, name.length - extension.length) : name; - } - ts.getBaseFileName = getBaseFileName; - function tryGetExtensionFromPath(path, extension, stringEqualityComparer) { - if (!ts.startsWith(extension, ".")) - extension = "." + extension; - if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46 /* dot */) { - var pathExtension = path.slice(path.length - extension.length); - if (stringEqualityComparer(pathExtension, extension)) { - return pathExtension; - } - } - } - function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) { - if (typeof extensions === "string") { - return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || ""; - } - for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) { - var extension = extensions_2[_i]; - var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer); - if (result) - return result; - } - return ""; - } - function getAnyExtensionFromPath(path, extensions, ignoreCase) { - // Retrieves any string from the final "." onwards from a base file name. - // Unlike extensionFromPath, which throws an exception on unrecognized extensions. - if (extensions) { - return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive); - } - var baseFileName = getBaseFileName(path); - var extensionIndex = baseFileName.lastIndexOf("."); - if (extensionIndex >= 0) { - return baseFileName.substring(extensionIndex); - } - return ""; - } - ts.getAnyExtensionFromPath = getAnyExtensionFromPath; - function pathComponents(path, rootLength) { - var root = path.substring(0, rootLength); - var rest = path.substring(rootLength).split(ts.directorySeparator); - if (rest.length && !ts.lastOrUndefined(rest)) - rest.pop(); - return __spreadArrays([root], rest); - } - /** - * Parse a path into an array containing a root component (at index 0) and zero or more path - * components (at indices > 0). The result is not normalized. - * If the path is relative, the root component is `""`. - * If the path is absolute, the root component includes the first path separator (`/`). - * - * ```ts - * // POSIX - * getPathComponents("/path/to/file.ext") === ["/", "path", "to", "file.ext"] - * getPathComponents("/path/to/") === ["/", "path", "to"] - * getPathComponents("/") === ["/"] - * // DOS - * getPathComponents("c:/path/to/file.ext") === ["c:/", "path", "to", "file.ext"] - * getPathComponents("c:/path/to/") === ["c:/", "path", "to"] - * getPathComponents("c:/") === ["c:/"] - * getPathComponents("c:") === ["c:"] - * // URL - * getPathComponents("http://typescriptlang.org/path/to/file.ext") === ["http://typescriptlang.org/", "path", "to", "file.ext"] - * getPathComponents("http://typescriptlang.org/path/to/") === ["http://typescriptlang.org/", "path", "to"] - * getPathComponents("http://typescriptlang.org/") === ["http://typescriptlang.org/"] - * getPathComponents("http://typescriptlang.org") === ["http://typescriptlang.org"] - * getPathComponents("file://server/path/to/file.ext") === ["file://server/", "path", "to", "file.ext"] - * getPathComponents("file://server/path/to/") === ["file://server/", "path", "to"] - * getPathComponents("file://server/") === ["file://server/"] - * getPathComponents("file://server") === ["file://server"] - * getPathComponents("file:///path/to/file.ext") === ["file:///", "path", "to", "file.ext"] - * getPathComponents("file:///path/to/") === ["file:///", "path", "to"] - * getPathComponents("file:///") === ["file:///"] - * getPathComponents("file://") === ["file://"] - */ - function getPathComponents(path, currentDirectory) { - if (currentDirectory === void 0) { currentDirectory = ""; } - path = combinePaths(currentDirectory, path); - return pathComponents(path, getRootLength(path)); - } - ts.getPathComponents = getPathComponents; - //// Path Formatting - /** - * Formats a parsed path consisting of a root component (at index 0) and zero or more path - * segments (at indices > 0). - * - * ```ts - * getPathFromPathComponents(["/", "path", "to", "file.ext"]) === "/path/to/file.ext" - * ``` - */ - function getPathFromPathComponents(pathComponents) { - if (pathComponents.length === 0) - return ""; - var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]); - return root + pathComponents.slice(1).join(ts.directorySeparator); - } - ts.getPathFromPathComponents = getPathFromPathComponents; - //// Path Normalization - /** - * Normalize path separators, converting `\` into `/`. - */ - function normalizeSlashes(path) { - return path.replace(backslashRegExp, ts.directorySeparator); - } - ts.normalizeSlashes = normalizeSlashes; - /** - * Reduce an array of path components to a more simplified path by navigating any - * `"."` or `".."` entries in the path. - */ - function reducePathComponents(components) { - if (!ts.some(components)) - return []; - var reduced = [components[0]]; - for (var i = 1; i < components.length; i++) { - var component = components[i]; - if (!component) - continue; - if (component === ".") - continue; - if (component === "..") { - if (reduced.length > 1) { - if (reduced[reduced.length - 1] !== "..") { - reduced.pop(); - continue; - } - } - else if (reduced[0]) - continue; - } - reduced.push(component); - } - return reduced; - } - ts.reducePathComponents = reducePathComponents; - /** - * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. - * - * ```ts - * // Non-rooted - * combinePaths("path", "to", "file.ext") === "path/to/file.ext" - * combinePaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file.ext" - * // POSIX - * combinePaths("/path", "to", "file.ext") === "/path/to/file.ext" - * combinePaths("/path", "/to", "file.ext") === "/to/file.ext" - * // DOS - * combinePaths("c:/path", "to", "file.ext") === "c:/path/to/file.ext" - * combinePaths("c:/path", "c:/to", "file.ext") === "c:/to/file.ext" - * // URL - * combinePaths("file:///path", "to", "file.ext") === "file:///path/to/file.ext" - * combinePaths("file:///path", "file:///to", "file.ext") === "file:///to/file.ext" - * ``` - */ - function combinePaths(path) { - var paths = []; - for (var _i = 1; _i < arguments.length; _i++) { - paths[_i - 1] = arguments[_i]; - } - if (path) - path = normalizeSlashes(path); - for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { - var relativePath = paths_1[_a]; - if (!relativePath) - continue; - relativePath = normalizeSlashes(relativePath); - if (!path || getRootLength(relativePath) !== 0) { - path = relativePath; - } - else { - path = ensureTrailingDirectorySeparator(path) + relativePath; - } - } - return path; - } - ts.combinePaths = combinePaths; - /** - * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any - * `.` and `..` path components are resolved. Trailing directory separators are preserved. - * - * ```ts - * resolvePath("/path", "to", "file.ext") === "path/to/file.ext" - * resolvePath("/path", "to", "file.ext/") === "path/to/file.ext/" - * resolvePath("/path", "dir", "..", "to", "file.ext") === "path/to/file.ext" - * ``` - */ - function resolvePath(path) { - var paths = []; - for (var _i = 1; _i < arguments.length; _i++) { - paths[_i - 1] = arguments[_i]; - } - return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : normalizeSlashes(path)); - } - ts.resolvePath = resolvePath; - /** - * Parse a path into an array containing a root component (at index 0) and zero or more path - * components (at indices > 0). The result is normalized. - * If the path is relative, the root component is `""`. - * If the path is absolute, the root component includes the first path separator (`/`). - * - * ```ts - * getNormalizedPathComponents("to/dir/../file.ext", "/path/") === ["/", "path", "to", "file.ext"] - * ``` - */ - function getNormalizedPathComponents(path, currentDirectory) { - return reducePathComponents(getPathComponents(path, currentDirectory)); - } - ts.getNormalizedPathComponents = getNormalizedPathComponents; - function getNormalizedAbsolutePath(fileName, currentDirectory) { - return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); - } - ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; - function normalizePath(path) { - path = normalizeSlashes(path); - var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); - return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; - } - ts.normalizePath = normalizePath; - function getPathWithoutRoot(pathComponents) { - if (pathComponents.length === 0) - return ""; - return pathComponents.slice(1).join(ts.directorySeparator); - } - function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { - return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); - } - ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; - function toPath(fileName, basePath, getCanonicalFileName) { - var nonCanonicalizedPath = isRootedDiskPath(fileName) - ? normalizePath(fileName) - : getNormalizedAbsolutePath(fileName, basePath); - return getCanonicalFileName(nonCanonicalizedPath); - } - ts.toPath = toPath; - function normalizePathAndParts(path) { - path = normalizeSlashes(path); - var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1); - if (parts.length) { - var joinedParts = root + parts.join(ts.directorySeparator); - return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts }; - } - else { - return { path: root, parts: parts }; - } - } - ts.normalizePathAndParts = normalizePathAndParts; - function removeTrailingDirectorySeparator(path) { - if (hasTrailingDirectorySeparator(path)) { - return path.substr(0, path.length - 1); - } - return path; - } - ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator; - function ensureTrailingDirectorySeparator(path) { - if (!hasTrailingDirectorySeparator(path)) { - return path + ts.directorySeparator; - } - return path; - } - ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; - /** - * Ensures a path is either absolute (prefixed with `/` or `c:`) or dot-relative (prefixed - * with `./` or `../`) so as not to be confused with an unprefixed module name. - * - * ```ts - * ensurePathIsNonModuleName("/path/to/file.ext") === "/path/to/file.ext" - * ensurePathIsNonModuleName("./path/to/file.ext") === "./path/to/file.ext" - * ensurePathIsNonModuleName("../path/to/file.ext") === "../path/to/file.ext" - * ensurePathIsNonModuleName("path/to/file.ext") === "./path/to/file.ext" - * ``` - */ - function ensurePathIsNonModuleName(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; - } - ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName; - function changeAnyExtension(path, ext, extensions, ignoreCase) { - var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path); - return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path; - } - ts.changeAnyExtension = changeAnyExtension; - //// Path Comparisons - // check path for these segments: '', '.'. '..' - var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; - function comparePathsWorker(a, b, componentComparer) { - if (a === b) - return 0 /* EqualTo */; - if (a === undefined) - return -1 /* LessThan */; - if (b === undefined) - return 1 /* GreaterThan */; - // NOTE: Performance optimization - shortcut if the root segments differ as there would be no - // need to perform path reduction. - var aRoot = a.substring(0, getRootLength(a)); - var bRoot = b.substring(0, getRootLength(b)); - var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); - if (result !== 0 /* EqualTo */) { - return result; - } - // NOTE: Performance optimization - shortcut if there are no relative path segments in - // the non-root portion of the path - var aRest = a.substring(aRoot.length); - var bRest = b.substring(bRoot.length); - if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { - return componentComparer(aRest, bRest); - } - // The path contains a relative path segment. Normalize the paths and perform a slower component - // by component comparison. - var aComponents = reducePathComponents(getPathComponents(a)); - var bComponents = reducePathComponents(getPathComponents(b)); - var sharedLength = Math.min(aComponents.length, bComponents.length); - for (var i = 1; i < sharedLength; i++) { - var result_2 = componentComparer(aComponents[i], bComponents[i]); - if (result_2 !== 0 /* EqualTo */) { - return result_2; - } - } - return ts.compareValues(aComponents.length, bComponents.length); - } - /** - * Performs a case-sensitive comparison of two paths. Path roots are always compared case-insensitively. - */ - function comparePathsCaseSensitive(a, b) { - return comparePathsWorker(a, b, ts.compareStringsCaseSensitive); - } - ts.comparePathsCaseSensitive = comparePathsCaseSensitive; - /** - * Performs a case-insensitive comparison of two paths. - */ - function comparePathsCaseInsensitive(a, b) { - return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive); - } - ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive; - function comparePaths(a, b, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - a = combinePaths(currentDirectory, a); - b = combinePaths(currentDirectory, b); - } - else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase)); - } - ts.comparePaths = comparePaths; - function containsPath(parent, child, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - parent = combinePaths(currentDirectory, parent); - child = combinePaths(currentDirectory, child); - } - else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - if (parent === undefined || child === undefined) - return false; - if (parent === child) - return true; - var parentComponents = reducePathComponents(getPathComponents(parent)); - var childComponents = reducePathComponents(getPathComponents(child)); - if (childComponents.length < parentComponents.length) { - return false; - } - var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive; - for (var i = 0; i < parentComponents.length; i++) { - var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer; - if (!equalityComparer(parentComponents[i], childComponents[i])) { - return false; - } - } - return true; - } - ts.containsPath = containsPath; - /** - * Determines whether `fileName` starts with the specified `directoryName` using the provided path canonicalization callback. - * Comparison is case-sensitive between the canonical paths. - * - * @deprecated Use `containsPath` if possible. - */ - function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { - var canonicalFileName = getCanonicalFileName(fileName); - var canonicalDirectoryName = getCanonicalFileName(directoryName); - return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\"); - } - ts.startsWithDirectory = startsWithDirectory; - //// Relative Paths - function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { - var fromComponents = reducePathComponents(getPathComponents(from)); - var toComponents = reducePathComponents(getPathComponents(to)); - var start; - for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { - var fromComponent = getCanonicalFileName(fromComponents[start]); - var toComponent = getCanonicalFileName(toComponents[start]); - var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer; - if (!comparer(fromComponent, toComponent)) - break; - } - if (start === 0) { - return toComponents; - } - var components = toComponents.slice(start); - var relative = []; - for (; start < fromComponents.length; start++) { - relative.push(".."); - } - return __spreadArrays([""], relative, components); - } - ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo; - function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { - ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative"); - var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity; - var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; - var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName); - return getPathFromPathComponents(pathComponents); - } - ts.getRelativePathFromDirectory = getRelativePathFromDirectory; - function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { - return !isRootedDiskPath(absoluteOrRelativePath) - ? absoluteOrRelativePath - : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); - } - ts.convertToRelativePath = convertToRelativePath; - function getRelativePathFromFile(from, to, getCanonicalFileName) { - return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); - } - ts.getRelativePathFromFile = getRelativePathFromFile; - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { - var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName); - var firstComponent = pathComponents[0]; - if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { - var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///"; - pathComponents[0] = prefix + firstComponent; - } - return getPathFromPathComponents(pathComponents); - } - ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; - function forEachAncestorDirectory(directory, callback) { - while (true) { - var result = callback(directory); - if (result !== undefined) { - return result; - } - var parentPath = getDirectoryPath(directory); - if (parentPath === directory) { - return undefined; - } - directory = parentPath; - } - } - ts.forEachAncestorDirectory = forEachAncestorDirectory; - function isNodeModulesDirectory(dirPath) { - return ts.endsWith(dirPath, "/node_modules"); - } - ts.isNodeModulesDirectory = isNodeModulesDirectory; -})(ts || (ts = {})); var ts; (function (ts) { /** @@ -7597,10 +6368,6 @@ var ts; return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath); } function fileSystemEntryExists(path, entryKind) { - // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve - // the CPU time performance. - var originalStackTraceLimit = Error.stackTraceLimit; - Error.stackTraceLimit = 0; try { var stat = _fs.statSync(path); switch (entryKind) { @@ -7612,9 +6379,6 @@ var ts; catch (e) { return false; } - finally { - Error.stackTraceLimit = originalStackTraceLimit; - } } function fileExists(path) { return fileSystemEntryExists(path, 0 /* File */); @@ -7685,6 +6449,678 @@ var ts; ts.Debug.isDebugging = true; } })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + /** + * Internally, we represent paths as strings with '/' as the directory separator. + * When we make system calls (eg: LanguageServiceHost.getDirectory()), + * we expect the host to correctly handle paths in our specified format. + */ + ts.directorySeparator = "/"; + var altDirectorySeparator = "\\"; + var urlSchemeSeparator = "://"; + var backslashRegExp = /\\/g; + //// Path Tests + /** + * Determines whether a charCode corresponds to `/` or `\`. + */ + function isAnyDirectorySeparator(charCode) { + return charCode === 47 /* slash */ || charCode === 92 /* backslash */; + } + ts.isAnyDirectorySeparator = isAnyDirectorySeparator; + /** + * Determines whether a path starts with a URL scheme (e.g. starts with `http://`, `ftp://`, `file://`, etc.). + */ + function isUrl(path) { + return getEncodedRootLength(path) < 0; + } + ts.isUrl = isUrl; + /** + * Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path + * like `c:`, `c:\` or `c:/`). + */ + function isRootedDiskPath(path) { + return getEncodedRootLength(path) > 0; + } + ts.isRootedDiskPath = isRootedDiskPath; + /** + * Determines whether a path consists only of a path root. + */ + function isDiskPathRoot(path) { + var rootLength = getEncodedRootLength(path); + return rootLength > 0 && rootLength === path.length; + } + ts.isDiskPathRoot = isDiskPathRoot; + /** + * Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.). + * + * ```ts + * // POSIX + * pathIsAbsolute("/path/to/file.ext") === true + * // DOS + * pathIsAbsolute("c:/path/to/file.ext") === true + * // URL + * pathIsAbsolute("file:///path/to/file.ext") === true + * // Non-absolute + * pathIsAbsolute("path/to/file.ext") === false + * pathIsAbsolute("./path/to/file.ext") === false + * ``` + */ + function pathIsAbsolute(path) { + return getEncodedRootLength(path) !== 0; + } + ts.pathIsAbsolute = pathIsAbsolute; + /** + * Determines whether a path starts with a relative path component (i.e. `.` or `..`). + */ + function pathIsRelative(path) { + return /^\.\.?($|[\\/])/.test(path); + } + ts.pathIsRelative = pathIsRelative; + function hasExtension(fileName) { + return ts.stringContains(getBaseFileName(fileName), "."); + } + ts.hasExtension = hasExtension; + function fileExtensionIs(path, extension) { + return path.length > extension.length && ts.endsWith(path, extension); + } + ts.fileExtensionIs = fileExtensionIs; + function fileExtensionIsOneOf(path, extensions) { + for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { + var extension = extensions_1[_i]; + if (fileExtensionIs(path, extension)) { + return true; + } + } + return false; + } + ts.fileExtensionIsOneOf = fileExtensionIsOneOf; + /** + * Determines whether a path has a trailing separator (`/` or `\\`). + */ + function hasTrailingDirectorySeparator(path) { + return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); + } + ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator; + //// Path Parsing + function isVolumeCharacter(charCode) { + return (charCode >= 97 /* a */ && charCode <= 122 /* z */) || + (charCode >= 65 /* A */ && charCode <= 90 /* Z */); + } + function getFileUrlVolumeSeparatorEnd(url, start) { + var ch0 = url.charCodeAt(start); + if (ch0 === 58 /* colon */) + return start + 1; + if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { + var ch2 = url.charCodeAt(start + 2); + if (ch2 === 97 /* a */ || ch2 === 65 /* A */) + return start + 3; + } + return -1; + } + /** + * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). + * If the root is part of a URL, the twos-complement of the root length is returned. + */ + function getEncodedRootLength(path) { + if (!path) + return 0; + var ch0 = path.charCodeAt(0); + // POSIX or UNC + if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { + if (path.charCodeAt(1) !== ch0) + return 1; // POSIX: "/" (or non-normalized "\") + var p1 = path.indexOf(ch0 === 47 /* slash */ ? ts.directorySeparator : altDirectorySeparator, 2); + if (p1 < 0) + return path.length; // UNC: "//server" or "\\server" + return p1 + 1; // UNC: "//server/" or "\\server\" + } + // DOS + if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) { + var ch2 = path.charCodeAt(2); + if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) + return 3; // DOS: "c:/" or "c:\" + if (path.length === 2) + return 2; // DOS: "c:" (but not "c:d") + } + // URL + var schemeEnd = path.indexOf(urlSchemeSeparator); + if (schemeEnd !== -1) { + var authorityStart = schemeEnd + urlSchemeSeparator.length; + var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart); + if (authorityEnd !== -1) { // URL: "file:///", "file://server/", "file://server/path" + // For local "file" URLs, include the leading DOS volume (if present). + // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a + // special case interpreted as "the machine from which the URL is being interpreted". + var scheme = path.slice(0, schemeEnd); + var authority = path.slice(authorityStart, authorityEnd); + if (scheme === "file" && (authority === "" || authority === "localhost") && + isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { + var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); + if (volumeSeparatorEnd !== -1) { + if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { + // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/" + return ~(volumeSeparatorEnd + 1); + } + if (volumeSeparatorEnd === path.length) { + // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a" + // but not "file:///c:d" or "file:///c%3ad" + return ~volumeSeparatorEnd; + } + } + } + return ~(authorityEnd + 1); // URL: "file://server/", "http://server/" + } + return ~path.length; // URL: "file://server", "http://server" + } + // relative + return 0; + } + /** + * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). + * + * For example: + * ```ts + * getRootLength("a") === 0 // "" + * getRootLength("/") === 1 // "/" + * getRootLength("c:") === 2 // "c:" + * getRootLength("c:d") === 0 // "" + * getRootLength("c:/") === 3 // "c:/" + * getRootLength("c:\\") === 3 // "c:\\" + * getRootLength("//server") === 7 // "//server" + * getRootLength("//server/share") === 8 // "//server/" + * getRootLength("\\\\server") === 7 // "\\\\server" + * getRootLength("\\\\server\\share") === 8 // "\\\\server\\" + * getRootLength("file:///path") === 8 // "file:///" + * getRootLength("file:///c:") === 10 // "file:///c:" + * getRootLength("file:///c:d") === 8 // "file:///" + * getRootLength("file:///c:/path") === 11 // "file:///c:/" + * getRootLength("file://server") === 13 // "file://server" + * getRootLength("file://server/path") === 14 // "file://server/" + * getRootLength("http://server") === 13 // "http://server" + * getRootLength("http://server/path") === 14 // "http://server/" + * ``` + */ + function getRootLength(path) { + var rootLength = getEncodedRootLength(path); + return rootLength < 0 ? ~rootLength : rootLength; + } + ts.getRootLength = getRootLength; + function getDirectoryPath(path) { + path = normalizeSlashes(path); + // If the path provided is itself the root, then return it. + var rootLength = getRootLength(path); + if (rootLength === path.length) + return path; + // return the leading portion of the path up to the last (non-terminal) directory separator + // but not including any trailing directory separator. + path = removeTrailingDirectorySeparator(path); + return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator))); + } + ts.getDirectoryPath = getDirectoryPath; + function getBaseFileName(path, extensions, ignoreCase) { + path = normalizeSlashes(path); + // if the path provided is itself the root, then it has not file name. + var rootLength = getRootLength(path); + if (rootLength === path.length) + return ""; + // return the trailing portion of the path starting after the last (non-terminal) directory + // separator but not including any trailing directory separator. + path = removeTrailingDirectorySeparator(path); + var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1)); + var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined; + return extension ? name.slice(0, name.length - extension.length) : name; + } + ts.getBaseFileName = getBaseFileName; + function tryGetExtensionFromPath(path, extension, stringEqualityComparer) { + if (!ts.startsWith(extension, ".")) + extension = "." + extension; + if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46 /* dot */) { + var pathExtension = path.slice(path.length - extension.length); + if (stringEqualityComparer(pathExtension, extension)) { + return pathExtension; + } + } + } + function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) { + if (typeof extensions === "string") { + return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || ""; + } + for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) { + var extension = extensions_2[_i]; + var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer); + if (result) + return result; + } + return ""; + } + function getAnyExtensionFromPath(path, extensions, ignoreCase) { + // Retrieves any string from the final "." onwards from a base file name. + // Unlike extensionFromPath, which throws an exception on unrecognized extensions. + if (extensions) { + return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive); + } + var baseFileName = getBaseFileName(path); + var extensionIndex = baseFileName.lastIndexOf("."); + if (extensionIndex >= 0) { + return baseFileName.substring(extensionIndex); + } + return ""; + } + ts.getAnyExtensionFromPath = getAnyExtensionFromPath; + function pathComponents(path, rootLength) { + var root = path.substring(0, rootLength); + var rest = path.substring(rootLength).split(ts.directorySeparator); + if (rest.length && !ts.lastOrUndefined(rest)) + rest.pop(); + return __spreadArrays([root], rest); + } + /** + * Parse a path into an array containing a root component (at index 0) and zero or more path + * components (at indices > 0). The result is not normalized. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + * + * ```ts + * // POSIX + * getPathComponents("/path/to/file.ext") === ["/", "path", "to", "file.ext"] + * getPathComponents("/path/to/") === ["/", "path", "to"] + * getPathComponents("/") === ["/"] + * // DOS + * getPathComponents("c:/path/to/file.ext") === ["c:/", "path", "to", "file.ext"] + * getPathComponents("c:/path/to/") === ["c:/", "path", "to"] + * getPathComponents("c:/") === ["c:/"] + * getPathComponents("c:") === ["c:"] + * // URL + * getPathComponents("http://typescriptlang.org/path/to/file.ext") === ["http://typescriptlang.org/", "path", "to", "file.ext"] + * getPathComponents("http://typescriptlang.org/path/to/") === ["http://typescriptlang.org/", "path", "to"] + * getPathComponents("http://typescriptlang.org/") === ["http://typescriptlang.org/"] + * getPathComponents("http://typescriptlang.org") === ["http://typescriptlang.org"] + * getPathComponents("file://server/path/to/file.ext") === ["file://server/", "path", "to", "file.ext"] + * getPathComponents("file://server/path/to/") === ["file://server/", "path", "to"] + * getPathComponents("file://server/") === ["file://server/"] + * getPathComponents("file://server") === ["file://server"] + * getPathComponents("file:///path/to/file.ext") === ["file:///", "path", "to", "file.ext"] + * getPathComponents("file:///path/to/") === ["file:///", "path", "to"] + * getPathComponents("file:///") === ["file:///"] + * getPathComponents("file://") === ["file://"] + */ + function getPathComponents(path, currentDirectory) { + if (currentDirectory === void 0) { currentDirectory = ""; } + path = combinePaths(currentDirectory, path); + return pathComponents(path, getRootLength(path)); + } + ts.getPathComponents = getPathComponents; + //// Path Formatting + /** + * Formats a parsed path consisting of a root component (at index 0) and zero or more path + * segments (at indices > 0). + * + * ```ts + * getPathFromPathComponents(["/", "path", "to", "file.ext"]) === "/path/to/file.ext" + * ``` + */ + function getPathFromPathComponents(pathComponents) { + if (pathComponents.length === 0) + return ""; + var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]); + return root + pathComponents.slice(1).join(ts.directorySeparator); + } + ts.getPathFromPathComponents = getPathFromPathComponents; + //// Path Normalization + /** + * Normalize path separators, converting `\` into `/`. + */ + function normalizeSlashes(path) { + return path.replace(backslashRegExp, ts.directorySeparator); + } + ts.normalizeSlashes = normalizeSlashes; + /** + * Reduce an array of path components to a more simplified path by navigating any + * `"."` or `".."` entries in the path. + */ + function reducePathComponents(components) { + if (!ts.some(components)) + return []; + var reduced = [components[0]]; + for (var i = 1; i < components.length; i++) { + var component = components[i]; + if (!component) + continue; + if (component === ".") + continue; + if (component === "..") { + if (reduced.length > 1) { + if (reduced[reduced.length - 1] !== "..") { + reduced.pop(); + continue; + } + } + else if (reduced[0]) + continue; + } + reduced.push(component); + } + return reduced; + } + ts.reducePathComponents = reducePathComponents; + /** + * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. + * + * ```ts + * // Non-rooted + * combinePaths("path", "to", "file.ext") === "path/to/file.ext" + * combinePaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file.ext" + * // POSIX + * combinePaths("/path", "to", "file.ext") === "/path/to/file.ext" + * combinePaths("/path", "/to", "file.ext") === "/to/file.ext" + * // DOS + * combinePaths("c:/path", "to", "file.ext") === "c:/path/to/file.ext" + * combinePaths("c:/path", "c:/to", "file.ext") === "c:/to/file.ext" + * // URL + * combinePaths("file:///path", "to", "file.ext") === "file:///path/to/file.ext" + * combinePaths("file:///path", "file:///to", "file.ext") === "file:///to/file.ext" + * ``` + */ + function combinePaths(path) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + if (path) + path = normalizeSlashes(path); + for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { + var relativePath = paths_1[_a]; + if (!relativePath) + continue; + relativePath = normalizeSlashes(relativePath); + if (!path || getRootLength(relativePath) !== 0) { + path = relativePath; + } + else { + path = ensureTrailingDirectorySeparator(path) + relativePath; + } + } + return path; + } + ts.combinePaths = combinePaths; + /** + * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any + * `.` and `..` path components are resolved. Trailing directory separators are preserved. + * + * ```ts + * resolvePath("/path", "to", "file.ext") === "path/to/file.ext" + * resolvePath("/path", "to", "file.ext/") === "path/to/file.ext/" + * resolvePath("/path", "dir", "..", "to", "file.ext") === "path/to/file.ext" + * ``` + */ + function resolvePath(path) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : normalizeSlashes(path)); + } + ts.resolvePath = resolvePath; + /** + * Parse a path into an array containing a root component (at index 0) and zero or more path + * components (at indices > 0). The result is normalized. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + * + * ```ts + * getNormalizedPathComponents("to/dir/../file.ext", "/path/") === ["/", "path", "to", "file.ext"] + * ``` + */ + function getNormalizedPathComponents(path, currentDirectory) { + return reducePathComponents(getPathComponents(path, currentDirectory)); + } + ts.getNormalizedPathComponents = getNormalizedPathComponents; + function getNormalizedAbsolutePath(fileName, currentDirectory) { + return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; + function normalizePath(path) { + path = normalizeSlashes(path); + var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); + return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; + } + ts.normalizePath = normalizePath; + function getPathWithoutRoot(pathComponents) { + if (pathComponents.length === 0) + return ""; + return pathComponents.slice(1).join(ts.directorySeparator); + } + function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { + return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; + function toPath(fileName, basePath, getCanonicalFileName) { + var nonCanonicalizedPath = isRootedDiskPath(fileName) + ? normalizePath(fileName) + : getNormalizedAbsolutePath(fileName, basePath); + return getCanonicalFileName(nonCanonicalizedPath); + } + ts.toPath = toPath; + function normalizePathAndParts(path) { + path = normalizeSlashes(path); + var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1); + if (parts.length) { + var joinedParts = root + parts.join(ts.directorySeparator); + return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts }; + } + else { + return { path: root, parts: parts }; + } + } + ts.normalizePathAndParts = normalizePathAndParts; + function removeTrailingDirectorySeparator(path) { + if (hasTrailingDirectorySeparator(path)) { + return path.substr(0, path.length - 1); + } + return path; + } + ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator; + function ensureTrailingDirectorySeparator(path) { + if (!hasTrailingDirectorySeparator(path)) { + return path + ts.directorySeparator; + } + return path; + } + ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; + /** + * Ensures a path is either absolute (prefixed with `/` or `c:`) or dot-relative (prefixed + * with `./` or `../`) so as not to be confused with an unprefixed module name. + * + * ```ts + * ensurePathIsNonModuleName("/path/to/file.ext") === "/path/to/file.ext" + * ensurePathIsNonModuleName("./path/to/file.ext") === "./path/to/file.ext" + * ensurePathIsNonModuleName("../path/to/file.ext") === "../path/to/file.ext" + * ensurePathIsNonModuleName("path/to/file.ext") === "./path/to/file.ext" + * ``` + */ + function ensurePathIsNonModuleName(path) { + return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; + } + ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName; + function changeAnyExtension(path, ext, extensions, ignoreCase) { + var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path); + return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path; + } + ts.changeAnyExtension = changeAnyExtension; + //// Path Comparisons + // check path for these segments: '', '.'. '..' + var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; + function comparePathsWorker(a, b, componentComparer) { + if (a === b) + return 0 /* EqualTo */; + if (a === undefined) + return -1 /* LessThan */; + if (b === undefined) + return 1 /* GreaterThan */; + // NOTE: Performance optimization - shortcut if the root segments differ as there would be no + // need to perform path reduction. + var aRoot = a.substring(0, getRootLength(a)); + var bRoot = b.substring(0, getRootLength(b)); + var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); + if (result !== 0 /* EqualTo */) { + return result; + } + // NOTE: Performance optimization - shortcut if there are no relative path segments in + // the non-root portion of the path + var aRest = a.substring(aRoot.length); + var bRest = b.substring(bRoot.length); + if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { + return componentComparer(aRest, bRest); + } + // The path contains a relative path segment. Normalize the paths and perform a slower component + // by component comparison. + var aComponents = reducePathComponents(getPathComponents(a)); + var bComponents = reducePathComponents(getPathComponents(b)); + var sharedLength = Math.min(aComponents.length, bComponents.length); + for (var i = 1; i < sharedLength; i++) { + var result_2 = componentComparer(aComponents[i], bComponents[i]); + if (result_2 !== 0 /* EqualTo */) { + return result_2; + } + } + return ts.compareValues(aComponents.length, bComponents.length); + } + /** + * Performs a case-sensitive comparison of two paths. Path roots are always compared case-insensitively. + */ + function comparePathsCaseSensitive(a, b) { + return comparePathsWorker(a, b, ts.compareStringsCaseSensitive); + } + ts.comparePathsCaseSensitive = comparePathsCaseSensitive; + /** + * Performs a case-insensitive comparison of two paths. + */ + function comparePathsCaseInsensitive(a, b) { + return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive); + } + ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive; + function comparePaths(a, b, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + a = combinePaths(currentDirectory, a); + b = combinePaths(currentDirectory, b); + } + else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase)); + } + ts.comparePaths = comparePaths; + function containsPath(parent, child, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + parent = combinePaths(currentDirectory, parent); + child = combinePaths(currentDirectory, child); + } + else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + if (parent === undefined || child === undefined) + return false; + if (parent === child) + return true; + var parentComponents = reducePathComponents(getPathComponents(parent)); + var childComponents = reducePathComponents(getPathComponents(child)); + if (childComponents.length < parentComponents.length) { + return false; + } + var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive; + for (var i = 0; i < parentComponents.length; i++) { + var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer; + if (!equalityComparer(parentComponents[i], childComponents[i])) { + return false; + } + } + return true; + } + ts.containsPath = containsPath; + /** + * Determines whether `fileName` starts with the specified `directoryName` using the provided path canonicalization callback. + * Comparison is case-sensitive between the canonical paths. + * + * @deprecated Use `containsPath` if possible. + */ + function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { + var canonicalFileName = getCanonicalFileName(fileName); + var canonicalDirectoryName = getCanonicalFileName(directoryName); + return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\"); + } + ts.startsWithDirectory = startsWithDirectory; + //// Relative Paths + function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { + var fromComponents = reducePathComponents(getPathComponents(from)); + var toComponents = reducePathComponents(getPathComponents(to)); + var start; + for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { + var fromComponent = getCanonicalFileName(fromComponents[start]); + var toComponent = getCanonicalFileName(toComponents[start]); + var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer; + if (!comparer(fromComponent, toComponent)) + break; + } + if (start === 0) { + return toComponents; + } + var components = toComponents.slice(start); + var relative = []; + for (; start < fromComponents.length; start++) { + relative.push(".."); + } + return __spreadArrays([""], relative, components); + } + ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo; + function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { + ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative"); + var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity; + var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; + var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName); + return getPathFromPathComponents(pathComponents); + } + ts.getRelativePathFromDirectory = getRelativePathFromDirectory; + function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { + return !isRootedDiskPath(absoluteOrRelativePath) + ? absoluteOrRelativePath + : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); + } + ts.convertToRelativePath = convertToRelativePath; + function getRelativePathFromFile(from, to, getCanonicalFileName) { + return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); + } + ts.getRelativePathFromFile = getRelativePathFromFile; + function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { + var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName); + var firstComponent = pathComponents[0]; + if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { + var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///"; + pathComponents[0] = prefix + firstComponent; + } + return getPathFromPathComponents(pathComponents); + } + ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; + function forEachAncestorDirectory(directory, callback) { + while (true) { + var result = callback(directory); + if (result !== undefined) { + return result; + } + var parentPath = getDirectoryPath(directory); + if (parentPath === directory) { + return undefined; + } + directory = parentPath; + } + } + ts.forEachAncestorDirectory = forEachAncestorDirectory; + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + ts.isNodeModulesDirectory = isNodeModulesDirectory; +})(ts || (ts = {})); // // generated from './diagnosticInformationMap.generated.ts' by 'src/compiler' /* @internal */ @@ -7719,7 +7155,7 @@ var ts; Accessibility_modifier_already_seen: diag(1028, ts.DiagnosticCategory.Error, "Accessibility_modifier_already_seen_1028", "Accessibility modifier already seen."), _0_modifier_must_precede_1_modifier: diag(1029, ts.DiagnosticCategory.Error, "_0_modifier_must_precede_1_modifier_1029", "'{0}' modifier must precede '{1}' modifier."), _0_modifier_already_seen: diag(1030, ts.DiagnosticCategory.Error, "_0_modifier_already_seen_1030", "'{0}' modifier already seen."), - _0_modifier_cannot_appear_on_class_elements_of_this_kind: diag(1031, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031", "'{0}' modifier cannot appear on class elements of this kind."), + _0_modifier_cannot_appear_on_a_class_element: diag(1031, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_class_element_1031", "'{0}' modifier cannot appear on a class element."), super_must_be_followed_by_an_argument_list_or_member_access: diag(1034, ts.DiagnosticCategory.Error, "super_must_be_followed_by_an_argument_list_or_member_access_1034", "'super' must be followed by an argument list or member access."), Only_ambient_modules_can_use_quoted_names: diag(1035, ts.DiagnosticCategory.Error, "Only_ambient_modules_can_use_quoted_names_1035", "Only ambient modules can use quoted names."), Statements_are_not_allowed_in_ambient_contexts: diag(1036, ts.DiagnosticCategory.Error, "Statements_are_not_allowed_in_ambient_contexts_1036", "Statements are not allowed in ambient contexts."), @@ -7859,7 +7295,7 @@ var ts; Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, ts.DiagnosticCategory.Error, "Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205", "Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."), Decorators_are_not_valid_here: diag(1206, ts.DiagnosticCategory.Error, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, ts.DiagnosticCategory.Error, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), - _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, ts.DiagnosticCategory.Error, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."), + All_files_must_be_modules_when_the_isolatedModules_flag_is_provided: diag(1208, ts.DiagnosticCategory.Error, "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208", "All files must be modules when the '--isolatedModules' flag is provided."), Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: diag(1210, ts.DiagnosticCategory.Error, "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", "Invalid use of '{0}'. Class definitions are automatically in strict mode."), A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, ts.DiagnosticCategory.Error, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), Identifier_expected_0_is_a_reserved_word_in_strict_mode: diag(1212, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", "Identifier expected. '{0}' is a reserved word in strict mode."), @@ -7907,12 +7343,11 @@ var ts; A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, ts.DiagnosticCategory.Error, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."), A_rest_element_must_be_last_in_a_tuple_type: diag(1256, ts.DiagnosticCategory.Error, "A_rest_element_must_be_last_in_a_tuple_type_1256", "A rest element must be last in a tuple type."), A_required_element_cannot_follow_an_optional_element: diag(1257, ts.DiagnosticCategory.Error, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."), + Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation: diag(1258, ts.DiagnosticCategory.Error, "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258", "Definite assignment assertions can only be used along with a type annotation."), Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, ts.DiagnosticCategory.Error, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"), Keywords_cannot_contain_escape_characters: diag(1260, ts.DiagnosticCategory.Error, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."), Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, ts.DiagnosticCategory.Error, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."), Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."), - Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, ts.DiagnosticCategory.Error, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."), - Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, ts.DiagnosticCategory.Error, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."), with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."), @@ -7929,7 +7364,7 @@ var ts; Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_or_umd: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'esnext', 'commonjs', 'amd', 'system', or 'umd'."), Dynamic_import_must_have_one_specifier_as_an_argument: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_import_must_have_one_specifier_as_an_argument_1324", "Dynamic import must have one specifier as an argument."), Specifier_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Specifier_of_dynamic_import_cannot_be_spread_element_1325", "Specifier of dynamic import cannot be spread element."), - Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments."), + Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments"), String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."), Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: diag(1328, ts.DiagnosticCategory.Error, "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328", "Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."), _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: diag(1329, ts.DiagnosticCategory.Error, "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329", "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"), @@ -7945,9 +7380,9 @@ var ts; Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."), - The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system_1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'."), + The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system_1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'esnext' or 'system'."), A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), - An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), + An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness"), This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."), use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, ts.DiagnosticCategory.Error, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."), Non_simple_parameter_declared_here: diag(1348, ts.DiagnosticCategory.Error, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."), @@ -7990,7 +7425,6 @@ var ts; Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."), - _0_is_not_allowed_as_a_variable_declaration_name: diag(1389, ts.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."), The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true), @@ -8116,7 +7550,6 @@ var ts; Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts.DiagnosticCategory.Error, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), - Types_of_construct_signatures_are_incompatible: diag(2419, ts.DiagnosticCategory.Error, "Types_of_construct_signatures_are_incompatible_2419", "Types of construct signatures are incompatible."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), @@ -8240,7 +7673,6 @@ var ts; The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: diag(2547, ts.DiagnosticCategory.Error, "The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547", "The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."), Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2548, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."), Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2549, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."), - Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later: diag(2550, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550", "Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later."), Property_0_does_not_exist_on_type_1_Did_you_mean_2: diag(2551, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", "Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"), Cannot_find_name_0_Did_you_mean_1: diag(2552, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Did_you_mean_1_2552", "Cannot find name '{0}'. Did you mean '{1}'?"), Computed_values_are_not_permitted_in_an_enum_with_string_valued_members: diag(2553, ts.DiagnosticCategory.Error, "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553", "Computed values are not permitted in an enum with string valued members."), @@ -8264,13 +7696,13 @@ var ts; Property_0_is_incompatible_with_rest_element_type: diag(2573, ts.DiagnosticCategory.Error, "Property_0_is_incompatible_with_rest_element_type_2573", "Property '{0}' is incompatible with rest element type."), A_rest_element_type_must_be_an_array_type: diag(2574, ts.DiagnosticCategory.Error, "A_rest_element_type_must_be_an_array_type_2574", "A rest element type must be an array type."), No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), - Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'."), + Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"), Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), Unused_ts_expect_error_directive: diag(2578, ts.DiagnosticCategory.Error, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."), - Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."), + Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."), @@ -8278,9 +7710,9 @@ var ts; Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), Type_instantiation_is_excessively_deep_and_possibly_infinite: diag(2589, ts.DiagnosticCategory.Error, "Type_instantiation_is_excessively_deep_and_possibly_infinite_2589", "Type instantiation is excessively deep and possibly infinite."), Expression_produces_a_union_type_that_is_too_complex_to_represent: diag(2590, ts.DiagnosticCategory.Error, "Expression_produces_a_union_type_that_is_too_complex_to_represent_2590", "Expression produces a union type that is too complex to represent."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."), This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, ts.DiagnosticCategory.Error, "This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594", "This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag."), _0_can_only_be_imported_by_using_a_default_import: diag(2595, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."), _0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."), @@ -8348,7 +7780,6 @@ var ts; All_declarations_of_0_must_have_identical_modifiers: diag(2687, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_modifiers_2687", "All declarations of '{0}' must have identical modifiers."), Cannot_find_type_definition_file_for_0: diag(2688, ts.DiagnosticCategory.Error, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, ts.DiagnosticCategory.Error, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), - _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, ts.DiagnosticCategory.Error, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."), _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, ts.DiagnosticCategory.Error, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), @@ -8382,7 +7813,7 @@ var ts; Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), - _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"), + Module_0_has_no_exported_member_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_2_2724", "Module '{0}' has no exported member '{1}'. Did you mean '{2}'?"), Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, ts.DiagnosticCategory.Error, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."), Cannot_find_lib_definition_for_0: diag(2726, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."), Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"), @@ -8390,7 +7821,7 @@ var ts; Property_0_is_used_before_its_initialization: diag(2729, ts.DiagnosticCategory.Error, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."), An_arrow_function_cannot_have_a_this_parameter: diag(2730, ts.DiagnosticCategory.Error, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."), Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."), - Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."), + Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension"), Property_0_was_also_declared_here: diag(2733, ts.DiagnosticCategory.Error, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."), Are_you_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"), Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"), @@ -8451,10 +7882,6 @@ var ts; The_operand_of_a_delete_operator_must_be_optional: diag(2790, ts.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_must_be_optional_2790", "The operand of a 'delete' operator must be optional."), Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: diag(2791, ts.DiagnosticCategory.Error, "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791", "Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."), Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option: diag(2792, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792", "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"), - The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: diag(2793, ts.DiagnosticCategory.Error, "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793", "The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."), - Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: diag(2794, ts.DiagnosticCategory.Error, "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794", "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"), - The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, ts.DiagnosticCategory.Error, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."), - It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked: diag(2796, ts.DiagnosticCategory.Error, "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796", "It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -8568,6 +7995,7 @@ var ts; Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: diag(5057, ts.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", "Cannot find a tsconfig.json file at the specified directory: '{0}'."), The_specified_path_does_not_exist_Colon_0: diag(5058, ts.DiagnosticCategory.Error, "The_specified_path_does_not_exist_Colon_0_5058", "The specified path does not exist: '{0}'."), Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, ts.DiagnosticCategory.Error, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."), + Option_paths_cannot_be_used_without_specifying_baseUrl_option: diag(5060, ts.DiagnosticCategory.Error, "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", "Option 'paths' cannot be used without specifying '--baseUrl' option."), Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, ts.DiagnosticCategory.Error, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."), Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: diag(5062, ts.DiagnosticCategory.Error, "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' can have at most one '*' character."), Substitutions_for_pattern_0_should_be_an_array: diag(5063, ts.DiagnosticCategory.Error, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."), @@ -8596,8 +8024,6 @@ var ts; A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: diag(5086, ts.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086", "A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."), A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, ts.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087", "A labeled tuple element is declared as rest with a `...` before the name, rather than before the type."), The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), - Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, ts.DiagnosticCategory.Error, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), - Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, ts.DiagnosticCategory.Error, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -8788,7 +8214,7 @@ var ts; Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"), _0_was_also_declared_here: diag(6203, ts.DiagnosticCategory.Message, "_0_was_also_declared_here_6203", "'{0}' was also declared here."), and_here: diag(6204, ts.DiagnosticCategory.Message, "and_here_6204", "and here."), - All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused."), + All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused"), package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."), package_json_does_not_have_a_typesVersions_entry_that_matches_version_0: diag(6207, ts.DiagnosticCategory.Message, "package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207", "'package.json' does not have a 'typesVersions' entry that matches version '{0}'."), package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2: diag(6208, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208", "'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."), @@ -8820,8 +8246,6 @@ var ts; This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without: diag(6234, ts.DiagnosticCategory.Error, "This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234", "This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"), Disable_loading_referenced_projects: diag(6235, ts.DiagnosticCategory.Message, "Disable_loading_referenced_projects_6235", "Disable loading referenced projects."), Arguments_for_the_rest_parameter_0_were_not_provided: diag(6236, ts.DiagnosticCategory.Error, "Arguments_for_the_rest_parameter_0_were_not_provided_6236", "Arguments for the rest parameter '{0}' were not provided."), - Generates_an_event_trace_and_a_list_of_types: diag(6237, ts.DiagnosticCategory.Message, "Generates_an_event_trace_and_a_list_of_types_6237", "Generates an event trace and a list of types."), - Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react: diag(6238, ts.DiagnosticCategory.Error, "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238", "Specify the module specifier to be used to import the `jsx` and `jsxs` factory functions from. eg, react"), Projects_to_reference: diag(6300, ts.DiagnosticCategory.Message, "Projects_to_reference_6300", "Projects to reference"), Enable_project_compilation: diag(6302, ts.DiagnosticCategory.Message, "Enable_project_compilation_6302", "Enable project compilation"), Composite_projects_may_not_disable_declaration_emit: diag(6304, ts.DiagnosticCategory.Error, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), @@ -8867,13 +8291,11 @@ var ts; Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, ts.DiagnosticCategory.Message, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"), Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, ts.DiagnosticCategory.Message, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."), _0_is_deprecated: diag(6385, ts.DiagnosticCategory.Suggestion, "_0_is_deprecated_6385", "'{0}' is deprecated", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ undefined, /*reportsDeprecated*/ true), - Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, ts.DiagnosticCategory.Message, "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386", "Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing: diag(6503, ts.DiagnosticCategory.Message, "Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503", "Print names of files that are part of the compilation and then stop processing."), File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, ts.DiagnosticCategory.Error, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"), - Include_undefined_in_index_signature_results: diag(6800, ts.DiagnosticCategory.Message, "Include_undefined_in_index_signature_results_6800", "Include 'undefined' in index signature results"), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -8901,7 +8323,7 @@ var ts; Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: diag(7032, ts.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."), Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: diag(7033, ts.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."), Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), - Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035", "Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), + Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035", "Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts.DiagnosticCategory.Error, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead: diag(7038, ts.DiagnosticCategory.Message, "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038", "Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."), @@ -8922,7 +8344,6 @@ var ts; Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: diag(7053, ts.DiagnosticCategory.Error, "Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053", "Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."), No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1: diag(7054, ts.DiagnosticCategory.Error, "No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054", "No index signature with a parameter of type '{0}' was found on type '{1}'."), _0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type: diag(7055, ts.DiagnosticCategory.Error, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055", "'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."), - The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed: diag(7056, ts.DiagnosticCategory.Error, "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056", "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."), @@ -9033,7 +8454,6 @@ var ts; Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), - Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), Extract_function: diag(95005, ts.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"), Extract_constant: diag(95006, ts.DiagnosticCategory.Message, "Extract_constant_95006", "Extract constant"), @@ -9051,7 +8471,6 @@ var ts; Add_undefined_type_to_property_0: diag(95018, ts.DiagnosticCategory.Message, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"), Add_initializer_to_property_0: diag(95019, ts.DiagnosticCategory.Message, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"), Add_definite_assignment_assertion_to_property_0: diag(95020, ts.DiagnosticCategory.Message, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"), - Convert_all_type_literals_to_mapped_type: diag(95021, ts.DiagnosticCategory.Message, "Convert_all_type_literals_to_mapped_type_95021", "Convert all type literals to mapped type"), Add_all_missing_members: diag(95022, ts.DiagnosticCategory.Message, "Add_all_missing_members_95022", "Add all missing members"), Infer_all_types_from_usage: diag(95023, ts.DiagnosticCategory.Message, "Infer_all_types_from_usage_95023", "Infer all types from usage"), Delete_all_unused_declarations: diag(95024, ts.DiagnosticCategory.Message, "Delete_all_unused_declarations_95024", "Delete all unused declarations"), @@ -9173,12 +8592,10 @@ var ts; Could_not_find_convertible_access_expression: diag(95140, ts.DiagnosticCategory.Message, "Could_not_find_convertible_access_expression_95140", "Could not find convertible access expression"), Could_not_find_matching_access_expressions: diag(95141, ts.DiagnosticCategory.Message, "Could_not_find_matching_access_expressions_95141", "Could not find matching access expressions"), Can_only_convert_logical_AND_access_chains: diag(95142, ts.DiagnosticCategory.Message, "Can_only_convert_logical_AND_access_chains_95142", "Can only convert logical AND access chains"), - Add_void_to_Promise_resolved_without_a_value: diag(95143, ts.DiagnosticCategory.Message, "Add_void_to_Promise_resolved_without_a_value_95143", "Add 'void' to Promise resolved without a value"), - Add_void_to_all_Promises_resolved_without_a_value: diag(95144, ts.DiagnosticCategory.Message, "Add_void_to_all_Promises_resolved_without_a_value_95144", "Add 'void' to all Promises resolved without a value"), No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."), Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."), JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"), - Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts.DiagnosticCategory.Error, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters."), + Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts.DiagnosticCategory.Error, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters"), An_accessibility_modifier_cannot_be_used_with_a_private_identifier: diag(18010, ts.DiagnosticCategory.Error, "An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010", "An accessibility modifier cannot be used with a private identifier."), The_operand_of_a_delete_operator_cannot_be_a_private_identifier: diag(18011, ts.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011", "The operand of a 'delete' operator cannot be a private identifier."), constructor_is_a_reserved_word: diag(18012, ts.DiagnosticCategory.Error, "constructor_is_a_reserved_word_18012", "'#constructor' is a reserved word."), @@ -9188,7 +8605,7 @@ var ts; Private_identifiers_are_not_allowed_outside_class_bodies: diag(18016, ts.DiagnosticCategory.Error, "Private_identifiers_are_not_allowed_outside_class_bodies_18016", "Private identifiers are not allowed outside class bodies."), The_shadowing_declaration_of_0_is_defined_here: diag(18017, ts.DiagnosticCategory.Error, "The_shadowing_declaration_of_0_is_defined_here_18017", "The shadowing declaration of '{0}' is defined here"), The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here: diag(18018, ts.DiagnosticCategory.Error, "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018", "The declaration of '{0}' that you probably intended to use is defined here"), - _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier."), + _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier"), A_method_cannot_be_named_with_a_private_identifier: diag(18022, ts.DiagnosticCategory.Error, "A_method_cannot_be_named_with_a_private_identifier_18022", "A method cannot be named with a private identifier."), An_accessor_cannot_be_named_with_a_private_identifier: diag(18023, ts.DiagnosticCategory.Error, "An_accessor_cannot_be_named_with_a_private_identifier_18023", "An accessor cannot be named with a private identifier."), An_enum_member_cannot_be_named_with_a_private_identifier: diag(18024, ts.DiagnosticCategory.Error, "An_enum_member_cannot_be_named_with_a_private_identifier_18024", "An enum member cannot be named with a private identifier."), @@ -9222,7 +8639,7 @@ var ts; any: 128 /* AnyKeyword */, as: 126 /* AsKeyword */, asserts: 127 /* AssertsKeyword */, - bigint: 155 /* BigIntKeyword */, + bigint: 154 /* BigIntKeyword */, boolean: 131 /* BooleanKeyword */, break: 80 /* BreakKeyword */, case: 81 /* CaseKeyword */, @@ -9244,7 +8661,7 @@ var ts; _a.false = 94 /* FalseKeyword */, _a.finally = 95 /* FinallyKeyword */, _a.for = 96 /* ForKeyword */, - _a.from = 153 /* FromKeyword */, + _a.from = 152 /* FromKeyword */, _a.function = 97 /* FunctionKeyword */, _a.get = 134 /* GetKeyword */, _a.if = 98 /* IfKeyword */, @@ -9254,40 +8671,39 @@ var ts; _a.infer = 135 /* InferKeyword */, _a.instanceof = 101 /* InstanceOfKeyword */, _a.interface = 117 /* InterfaceKeyword */, - _a.intrinsic = 136 /* IntrinsicKeyword */, - _a.is = 137 /* IsKeyword */, - _a.keyof = 138 /* KeyOfKeyword */, + _a.is = 136 /* IsKeyword */, + _a.keyof = 137 /* KeyOfKeyword */, _a.let = 118 /* LetKeyword */, - _a.module = 139 /* ModuleKeyword */, - _a.namespace = 140 /* NamespaceKeyword */, - _a.never = 141 /* NeverKeyword */, + _a.module = 138 /* ModuleKeyword */, + _a.namespace = 139 /* NamespaceKeyword */, + _a.never = 140 /* NeverKeyword */, _a.new = 102 /* NewKeyword */, _a.null = 103 /* NullKeyword */, - _a.number = 144 /* NumberKeyword */, - _a.object = 145 /* ObjectKeyword */, + _a.number = 143 /* NumberKeyword */, + _a.object = 144 /* ObjectKeyword */, _a.package = 119 /* PackageKeyword */, _a.private = 120 /* PrivateKeyword */, _a.protected = 121 /* ProtectedKeyword */, _a.public = 122 /* PublicKeyword */, - _a.readonly = 142 /* ReadonlyKeyword */, - _a.require = 143 /* RequireKeyword */, - _a.global = 154 /* GlobalKeyword */, + _a.readonly = 141 /* ReadonlyKeyword */, + _a.require = 142 /* RequireKeyword */, + _a.global = 153 /* GlobalKeyword */, _a.return = 104 /* ReturnKeyword */, - _a.set = 146 /* SetKeyword */, + _a.set = 145 /* SetKeyword */, _a.static = 123 /* StaticKeyword */, - _a.string = 147 /* StringKeyword */, + _a.string = 146 /* StringKeyword */, _a.super = 105 /* SuperKeyword */, _a.switch = 106 /* SwitchKeyword */, - _a.symbol = 148 /* SymbolKeyword */, + _a.symbol = 147 /* SymbolKeyword */, _a.this = 107 /* ThisKeyword */, _a.throw = 108 /* ThrowKeyword */, _a.true = 109 /* TrueKeyword */, _a.try = 110 /* TryKeyword */, - _a.type = 149 /* TypeKeyword */, + _a.type = 148 /* TypeKeyword */, _a.typeof = 111 /* TypeOfKeyword */, - _a.undefined = 150 /* UndefinedKeyword */, - _a.unique = 151 /* UniqueKeyword */, - _a.unknown = 152 /* UnknownKeyword */, + _a.undefined = 149 /* UndefinedKeyword */, + _a.unique = 150 /* UniqueKeyword */, + _a.unknown = 151 /* UnknownKeyword */, _a.var = 112 /* VarKeyword */, _a.void = 113 /* VoidKeyword */, _a.while = 114 /* WhileKeyword */, @@ -9295,7 +8711,7 @@ var ts; _a.yield = 124 /* YieldKeyword */, _a.async = 129 /* AsyncKeyword */, _a.await = 130 /* AwaitKeyword */, - _a.of = 156 /* OfKeyword */, + _a.of = 155 /* OfKeyword */, _a); var textToKeyword = new ts.Map(ts.getEntries(textToKeywordObj)); var textToToken = new ts.Map(ts.getEntries(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 77 /* CaretEqualsToken */, "||=": 74 /* BarBarEqualsToken */, "&&=": 75 /* AmpersandAmpersandEqualsToken */, "??=": 76 /* QuestionQuestionEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ }))); @@ -10476,9 +9892,9 @@ var ts; return result; } function getIdentifierToken() { - // Reserved words are between 2 and 12 characters long and start with a lowercase letter + // Reserved words are between 2 and 11 characters long and start with a lowercase letter var len = tokenValue.length; - if (len >= 2 && len <= 12) { + if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 /* a */ && ch <= 122 /* z */) { var keyword = textToKeyword.get(tokenValue); @@ -11681,9 +11097,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 159 /* TypeParameter */) { + if (d && d.kind === 158 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 253 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 250 /* InterfaceDeclaration */) { return current; } } @@ -11691,7 +11107,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 166 /* Constructor */; + return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 165 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -11721,14 +11137,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 249 /* VariableDeclaration */) { + if (node.kind === 246 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 250 /* VariableDeclarationList */) { + if (node && node.kind === 247 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 232 /* VariableStatement */) { + if (node && node.kind === 229 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -11819,20 +11235,6 @@ var ts; return !nodeTest || nodeTest(node) ? node : undefined; } ts.getOriginalNode = getOriginalNode; - function findAncestor(node, callback) { - while (node) { - var result = callback(node); - if (result === "quit") { - return undefined; - } - else if (result) { - return node; - } - node = node.parent; - } - return undefined; - } - ts.findAncestor = findAncestor; /** * Gets a value indicating whether a node originated in the parse tree. * @@ -11898,30 +11300,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 216 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 213 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return expr.name; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; } } break; - case 207 /* ParenthesizedExpression */: { + case 204 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 245 /* LabeledStatement */: { + case 242 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -11958,16 +11360,16 @@ var ts; switch (declaration.kind) { case 78 /* Identifier */: return declaration; - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: { + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 157 /* QualifiedName */) { + if (name.kind === 156 /* QualifiedName */) { return name.right; } break; } - case 203 /* CallExpression */: - case 216 /* BinaryExpression */: { + case 200 /* CallExpression */: + case 213 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -11983,15 +11385,15 @@ var ts; return undefined; } } - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 325 /* JSDocEnumTag */: + case 321 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -12286,7 +11688,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 311 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 307 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -12318,7 +11720,7 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 168 /* SetAccessor */ || node.kind === 167 /* GetAccessor */; + return node.kind === 167 /* SetAccessor */ || node.kind === 166 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; function isPropertyAccessChain(node) { @@ -12336,10 +11738,10 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 201 /* PropertyAccessExpression */ - || kind === 202 /* ElementAccessExpression */ - || kind === 203 /* CallExpression */ - || kind === 225 /* NonNullExpression */); + (kind === 198 /* PropertyAccessExpression */ + || kind === 199 /* ElementAccessExpression */ + || kind === 200 /* CallExpression */ + || kind === 222 /* NonNullExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ @@ -12374,7 +11776,7 @@ var ts; } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isConstTypeReference(node) { @@ -12391,17 +11793,17 @@ var ts; } ts.isNonNullChain = isNonNullChain; function isBreakOrContinueStatement(node) { - return node.kind === 241 /* BreakStatement */ || node.kind === 240 /* ContinueStatement */; + return node.kind === 238 /* BreakStatement */ || node.kind === 237 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isNamedExportBindings(node) { - return node.kind === 269 /* NamespaceExport */ || node.kind === 268 /* NamedExports */; + return node.kind === 266 /* NamespaceExport */ || node.kind === 265 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isUnparsedTextLike(node) { switch (node.kind) { - case 294 /* UnparsedText */: - case 295 /* UnparsedInternalText */: + case 291 /* UnparsedText */: + case 292 /* UnparsedInternalText */: return true; default: return false; @@ -12410,12 +11812,12 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 292 /* UnparsedPrologue */ || - node.kind === 296 /* UnparsedSyntheticReference */; + node.kind === 289 /* UnparsedPrologue */ || + node.kind === 293 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; function isJSDocPropertyLikeTag(node) { - return node.kind === 333 /* JSDocPropertyTag */ || node.kind === 326 /* JSDocParameterTag */; + return node.kind === 328 /* JSDocPropertyTag */ || node.kind === 322 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; // #endregion @@ -12431,7 +11833,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 157 /* FirstNode */; + return kind >= 156 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -12440,7 +11842,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 156 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 155 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -12481,12 +11883,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return node.parent.isTypeOnly; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -12527,7 +11929,7 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 123 /* StaticKeyword */: return true; } @@ -12550,7 +11952,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 157 /* QualifiedName */ + return kind === 156 /* QualifiedName */ || kind === 78 /* Identifier */; } ts.isEntityName = isEntityName; @@ -12560,14 +11962,14 @@ var ts; || kind === 79 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 158 /* ComputedPropertyName */; + || kind === 157 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 78 /* Identifier */ - || kind === 196 /* ObjectBindingPattern */ - || kind === 197 /* ArrayBindingPattern */; + || kind === 193 /* ObjectBindingPattern */ + || kind === 194 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12582,13 +11984,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; default: return false; @@ -12597,14 +11999,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 174 /* FunctionType */: - case 308 /* JSDocFunctionType */: - case 175 /* ConstructorType */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 173 /* FunctionType */: + case 304 /* JSDocFunctionType */: + case 174 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12619,29 +12021,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 166 /* Constructor */ - || kind === 163 /* PropertyDeclaration */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 171 /* IndexSignature */ - || kind === 229 /* SemicolonClassElement */; + return kind === 165 /* Constructor */ + || kind === 162 /* PropertyDeclaration */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 170 /* IndexSignature */ + || kind === 226 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */); + return node && (node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */); + return node && (node.kind === 166 /* GetAccessor */ || node.kind === 167 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return true; default: return false; @@ -12651,11 +12053,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 170 /* ConstructSignature */ - || kind === 169 /* CallSignature */ - || kind === 162 /* PropertySignature */ - || kind === 164 /* MethodSignature */ - || kind === 171 /* IndexSignature */; + return kind === 169 /* ConstructSignature */ + || kind === 168 /* CallSignature */ + || kind === 161 /* PropertySignature */ + || kind === 163 /* MethodSignature */ + || kind === 170 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12664,12 +12066,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 288 /* PropertyAssignment */ - || kind === 289 /* ShorthandPropertyAssignment */ - || kind === 290 /* SpreadAssignment */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 285 /* PropertyAssignment */ + || kind === 286 /* ShorthandPropertyAssignment */ + || kind === 287 /* SpreadAssignment */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12684,8 +12086,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return true; } return false; @@ -12696,8 +12098,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 197 /* ArrayBindingPattern */ - || kind === 196 /* ObjectBindingPattern */; + return kind === 194 /* ArrayBindingPattern */ + || kind === 193 /* ObjectBindingPattern */; } return false; } @@ -12705,15 +12107,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 199 /* ArrayLiteralExpression */ - || kind === 200 /* ObjectLiteralExpression */; + return kind === 196 /* ArrayLiteralExpression */ + || kind === 197 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 198 /* BindingElement */ - || kind === 222 /* OmittedExpression */; + return kind === 195 /* BindingElement */ + || kind === 219 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12722,9 +12124,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: return true; } return false; @@ -12745,8 +12147,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 196 /* ObjectBindingPattern */: - case 200 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 197 /* ObjectLiteralExpression */: return true; } return false; @@ -12758,8 +12160,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: return true; } return false; @@ -12768,26 +12170,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 201 /* PropertyAccessExpression */ - || kind === 157 /* QualifiedName */ - || kind === 195 /* ImportType */; + return kind === 198 /* PropertyAccessExpression */ + || kind === 156 /* QualifiedName */ + || kind === 192 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 201 /* PropertyAccessExpression */ - || kind === 157 /* QualifiedName */; + return kind === 198 /* PropertyAccessExpression */ + || kind === 156 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 161 /* Decorator */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 160 /* Decorator */: return true; default: return false; @@ -12795,12 +12197,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 203 /* CallExpression */ || node.kind === 204 /* NewExpression */; + return node.kind === 200 /* CallExpression */ || node.kind === 201 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 218 /* TemplateExpression */ + return kind === 215 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12811,33 +12213,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 204 /* NewExpression */: - case 203 /* CallExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: - case 205 /* TaggedTemplateExpression */: - case 199 /* ArrayLiteralExpression */: - case 207 /* ParenthesizedExpression */: - case 200 /* ObjectLiteralExpression */: - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 201 /* NewExpression */: + case 200 /* CallExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: + case 202 /* TaggedTemplateExpression */: + case 196 /* ArrayLiteralExpression */: + case 204 /* ParenthesizedExpression */: + case 197 /* ObjectLiteralExpression */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: case 78 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: case 94 /* FalseKeyword */: case 103 /* NullKeyword */: case 107 /* ThisKeyword */: case 109 /* TrueKeyword */: case 105 /* SuperKeyword */: - case 225 /* NonNullExpression */: - case 226 /* MetaProperty */: + case 222 /* NonNullExpression */: + case 223 /* MetaProperty */: case 99 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12851,13 +12253,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: - case 210 /* DeleteExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 213 /* AwaitExpression */: - case 206 /* TypeAssertionExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 207 /* DeleteExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 210 /* AwaitExpression */: + case 203 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12866,9 +12268,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return true; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12887,15 +12289,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 217 /* ConditionalExpression */: - case 219 /* YieldExpression */: - case 209 /* ArrowFunction */: - case 216 /* BinaryExpression */: - case 220 /* SpreadElement */: - case 224 /* AsExpression */: - case 222 /* OmittedExpression */: - case 337 /* CommaListExpression */: - case 336 /* PartiallyEmittedExpression */: + case 214 /* ConditionalExpression */: + case 216 /* YieldExpression */: + case 206 /* ArrowFunction */: + case 213 /* BinaryExpression */: + case 217 /* SpreadElement */: + case 221 /* AsExpression */: + case 219 /* OmittedExpression */: + case 332 /* CommaListExpression */: + case 331 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12903,8 +12305,8 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 206 /* TypeAssertionExpression */ - || kind === 224 /* AsExpression */; + return kind === 203 /* TypeAssertionExpression */ + || kind === 221 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ @@ -12915,13 +12317,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return true; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12950,7 +12352,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 238 /* ForInStatement */ || node.kind === 239 /* ForOfStatement */; + return node.kind === 235 /* ForInStatement */ || node.kind === 236 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12974,114 +12376,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 257 /* ModuleBlock */ - || kind === 256 /* ModuleDeclaration */ + return kind === 254 /* ModuleBlock */ + || kind === 253 /* ModuleDeclaration */ || kind === 78 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 257 /* ModuleBlock */ - || kind === 256 /* ModuleDeclaration */; + return kind === 254 /* ModuleBlock */ + || kind === 253 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 78 /* Identifier */ - || kind === 256 /* ModuleDeclaration */; + || kind === 253 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 264 /* NamedImports */ - || kind === 263 /* NamespaceImport */; + return kind === 261 /* NamedImports */ + || kind === 260 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */ || node.kind === 255 /* EnumDeclaration */; + return node.kind === 253 /* ModuleDeclaration */ || node.kind === 252 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 209 /* ArrowFunction */ - || kind === 198 /* BindingElement */ - || kind === 252 /* ClassDeclaration */ - || kind === 221 /* ClassExpression */ - || kind === 166 /* Constructor */ - || kind === 255 /* EnumDeclaration */ - || kind === 291 /* EnumMember */ - || kind === 270 /* ExportSpecifier */ - || kind === 251 /* FunctionDeclaration */ - || kind === 208 /* FunctionExpression */ - || kind === 167 /* GetAccessor */ - || kind === 262 /* ImportClause */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 265 /* ImportSpecifier */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 280 /* JsxAttribute */ - || kind === 165 /* MethodDeclaration */ - || kind === 164 /* MethodSignature */ - || kind === 256 /* ModuleDeclaration */ - || kind === 259 /* NamespaceExportDeclaration */ - || kind === 263 /* NamespaceImport */ - || kind === 269 /* NamespaceExport */ - || kind === 160 /* Parameter */ - || kind === 288 /* PropertyAssignment */ - || kind === 163 /* PropertyDeclaration */ - || kind === 162 /* PropertySignature */ - || kind === 168 /* SetAccessor */ - || kind === 289 /* ShorthandPropertyAssignment */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 159 /* TypeParameter */ - || kind === 249 /* VariableDeclaration */ - || kind === 331 /* JSDocTypedefTag */ - || kind === 324 /* JSDocCallbackTag */ - || kind === 333 /* JSDocPropertyTag */; + return kind === 206 /* ArrowFunction */ + || kind === 195 /* BindingElement */ + || kind === 249 /* ClassDeclaration */ + || kind === 218 /* ClassExpression */ + || kind === 165 /* Constructor */ + || kind === 252 /* EnumDeclaration */ + || kind === 288 /* EnumMember */ + || kind === 267 /* ExportSpecifier */ + || kind === 248 /* FunctionDeclaration */ + || kind === 205 /* FunctionExpression */ + || kind === 166 /* GetAccessor */ + || kind === 259 /* ImportClause */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 262 /* ImportSpecifier */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 277 /* JsxAttribute */ + || kind === 164 /* MethodDeclaration */ + || kind === 163 /* MethodSignature */ + || kind === 253 /* ModuleDeclaration */ + || kind === 256 /* NamespaceExportDeclaration */ + || kind === 260 /* NamespaceImport */ + || kind === 266 /* NamespaceExport */ + || kind === 159 /* Parameter */ + || kind === 285 /* PropertyAssignment */ + || kind === 162 /* PropertyDeclaration */ + || kind === 161 /* PropertySignature */ + || kind === 167 /* SetAccessor */ + || kind === 286 /* ShorthandPropertyAssignment */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 158 /* TypeParameter */ + || kind === 246 /* VariableDeclaration */ + || kind === 327 /* JSDocTypedefTag */ + || kind === 320 /* JSDocCallbackTag */ + || kind === 328 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 251 /* FunctionDeclaration */ - || kind === 271 /* MissingDeclaration */ - || kind === 252 /* ClassDeclaration */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 255 /* EnumDeclaration */ - || kind === 256 /* ModuleDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 267 /* ExportDeclaration */ - || kind === 266 /* ExportAssignment */ - || kind === 259 /* NamespaceExportDeclaration */; + return kind === 248 /* FunctionDeclaration */ + || kind === 268 /* MissingDeclaration */ + || kind === 249 /* ClassDeclaration */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 252 /* EnumDeclaration */ + || kind === 253 /* ModuleDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 264 /* ExportDeclaration */ + || kind === 263 /* ExportAssignment */ + || kind === 256 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 241 /* BreakStatement */ - || kind === 240 /* ContinueStatement */ - || kind === 248 /* DebuggerStatement */ - || kind === 235 /* DoStatement */ - || kind === 233 /* ExpressionStatement */ - || kind === 231 /* EmptyStatement */ - || kind === 238 /* ForInStatement */ - || kind === 239 /* ForOfStatement */ - || kind === 237 /* ForStatement */ - || kind === 234 /* IfStatement */ - || kind === 245 /* LabeledStatement */ - || kind === 242 /* ReturnStatement */ - || kind === 244 /* SwitchStatement */ - || kind === 246 /* ThrowStatement */ - || kind === 247 /* TryStatement */ - || kind === 232 /* VariableStatement */ - || kind === 236 /* WhileStatement */ - || kind === 243 /* WithStatement */ - || kind === 335 /* NotEmittedStatement */ - || kind === 339 /* EndOfDeclarationMarker */ - || kind === 338 /* MergeDeclarationMarker */; + return kind === 238 /* BreakStatement */ + || kind === 237 /* ContinueStatement */ + || kind === 245 /* DebuggerStatement */ + || kind === 232 /* DoStatement */ + || kind === 230 /* ExpressionStatement */ + || kind === 228 /* EmptyStatement */ + || kind === 235 /* ForInStatement */ + || kind === 236 /* ForOfStatement */ + || kind === 234 /* ForStatement */ + || kind === 231 /* IfStatement */ + || kind === 242 /* LabeledStatement */ + || kind === 239 /* ReturnStatement */ + || kind === 241 /* SwitchStatement */ + || kind === 243 /* ThrowStatement */ + || kind === 244 /* TryStatement */ + || kind === 229 /* VariableStatement */ + || kind === 233 /* WhileStatement */ + || kind === 240 /* WithStatement */ + || kind === 330 /* NotEmittedStatement */ + || kind === 334 /* EndOfDeclarationMarker */ + || kind === 333 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 159 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 330 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 158 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 326 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -13108,10 +12510,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 230 /* Block */) + if (node.kind !== 227 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 247 /* TryStatement */ || node.parent.kind === 287 /* CatchClause */) { + if (node.parent.kind === 244 /* TryStatement */ || node.parent.kind === 284 /* CatchClause */) { return false; } } @@ -13125,15 +12527,15 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 230 /* Block */; + || kind === 227 /* Block */; } ts.isStatementOrBlock = isStatementOrBlock; // Module references /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 272 /* ExternalModuleReference */ - || kind === 157 /* QualifiedName */ + return kind === 269 /* ExternalModuleReference */ + || kind === 156 /* QualifiedName */ || kind === 78 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -13143,70 +12545,70 @@ var ts; var kind = node.kind; return kind === 107 /* ThisKeyword */ || kind === 78 /* Identifier */ - || kind === 201 /* PropertyAccessExpression */; + || kind === 198 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 273 /* JsxElement */ - || kind === 283 /* JsxExpression */ - || kind === 274 /* JsxSelfClosingElement */ + return kind === 270 /* JsxElement */ + || kind === 280 /* JsxExpression */ + || kind === 271 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 277 /* JsxFragment */; + || kind === 274 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 280 /* JsxAttribute */ - || kind === 282 /* JsxSpreadAttribute */; + return kind === 277 /* JsxAttribute */ + || kind === 279 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 283 /* JsxExpression */; + || kind === 280 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 275 /* JsxOpeningElement */ - || kind === 274 /* JsxSelfClosingElement */; + return kind === 272 /* JsxOpeningElement */ + || kind === 271 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 284 /* CaseClause */ - || kind === 285 /* DefaultClause */; + return kind === 281 /* CaseClause */ + || kind === 282 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 301 /* FirstJSDocNode */ && node.kind <= 333 /* LastJSDocNode */; + return node.kind >= 298 /* FirstJSDocNode */ && node.kind <= 328 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 311 /* JSDocComment */ || node.kind === 310 /* JSDocNamepathType */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node); + return node.kind === 307 /* JSDocComment */ || node.kind === 306 /* JSDocNamepathType */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 314 /* FirstJSDocTagNode */ && node.kind <= 333 /* LastJSDocTagNode */; + return node.kind >= 310 /* FirstJSDocTagNode */ && node.kind <= 328 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 168 /* SetAccessor */; + return node.kind === 167 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 167 /* GetAccessor */; + return node.kind === 166 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -13232,13 +12634,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 162 /* PropertySignature */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: - case 291 /* EnumMember */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 161 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: + case 288 /* EnumMember */: return true; default: return false; @@ -13246,12 +12648,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 280 /* JsxAttribute */ || node.kind === 282 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 277 /* JsxAttribute */ || node.kind === 279 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 173 /* TypeReference */ || node.kind === 223 /* ExpressionWithTypeArguments */; + return node.kind === 172 /* TypeReference */ || node.kind === 220 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -13384,6 +12786,20 @@ var ts; }); } ts.optionsHaveModuleResolutionChanges = optionsHaveModuleResolutionChanges; + function findAncestor(node, callback) { + while (node) { + var result = callback(node); + if (result === "quit") { + return undefined; + } + else if (result) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.findAncestor = findAncestor; function forEachAncestor(node, callback) { while (true) { var res = callback(node); @@ -13532,7 +12948,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 297 /* SourceFile */) { + while (node && node.kind !== 294 /* SourceFile */) { node = node.parent; } return node; @@ -13540,11 +12956,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 230 /* Block */: - case 258 /* CaseBlock */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return true; } return false; @@ -13740,7 +13156,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 334 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 329 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13759,12 +13175,8 @@ var ts; } ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile; function isJSDocTypeExpressionOrChild(node) { - return !!ts.findAncestor(node, ts.isJSDocTypeExpression); + return !!findAncestor(node, ts.isJSDocTypeExpression); } - function isExportNamespaceAsDefaultDeclaration(node) { - return !!(ts.isExportDeclaration(node) && node.exportClause && ts.isNamespaceExport(node.exportClause) && node.exportClause.name.escapedText === "default"); - } - ts.isExportNamespaceAsDefaultDeclaration = isExportNamespaceAsDefaultDeclaration; function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) { if (includeTrivia === void 0) { includeTrivia = false; } if (nodeIsMissing(node)) { @@ -13802,85 +13214,10 @@ var ts; return emitNode && emitNode.flags || 0; } ts.getEmitFlags = getEmitFlags; - ; - function getScriptTargetFeatures() { - return { - es2015: { - Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"], - RegExp: ["flags", "sticky", "unicode"], - Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"], - ArrayConstructor: ["from", "of"], - ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"], - NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"], - Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"], - Map: ["entries", "keys", "values"], - Set: ["entries", "keys", "values"], - Promise: ts.emptyArray, - PromiseConstructor: ["all", "race", "reject", "resolve"], - Symbol: ["for", "keyFor"], - WeakMap: ["entries", "keys", "values"], - WeakSet: ["entries", "keys", "values"], - Iterator: ts.emptyArray, - AsyncIterator: ts.emptyArray, - String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"], - StringConstructor: ["fromCodePoint", "raw"] - }, - es2016: { - Array: ["includes"] - }, - es2017: { - Atomics: ts.emptyArray, - SharedArrayBuffer: ts.emptyArray, - String: ["padStart", "padEnd"], - ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"], - DateTimeFormat: ["formatToParts"] - }, - es2018: { - Promise: ["finally"], - RegExpMatchArray: ["groups"], - RegExpExecArray: ["groups"], - RegExp: ["dotAll"], - Intl: ["PluralRules"], - AsyncIterable: ts.emptyArray, - AsyncIterableIterator: ts.emptyArray, - AsyncGenerator: ts.emptyArray, - AsyncGeneratorFunction: ts.emptyArray, - }, - es2019: { - Array: ["flat", "flatMap"], - ObjectConstructor: ["fromEntries"], - String: ["trimStart", "trimEnd", "trimLeft", "trimRight"], - Symbol: ["description"] - }, - es2020: { - BigInt: ts.emptyArray, - BigInt64Array: ts.emptyArray, - BigUint64Array: ts.emptyArray, - PromiseConstructor: ["allSettled"], - SymbolConstructor: ["matchAll"], - String: ["matchAll"], - DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"], - RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"] - }, - esnext: { - PromiseConstructor: ["any"], - String: ["replaceAll"], - NumberFormat: ["formatToParts"] - } - }; - } - ts.getScriptTargetFeatures = getScriptTargetFeatures; - var GetLiteralTextFlags; - (function (GetLiteralTextFlags) { - GetLiteralTextFlags[GetLiteralTextFlags["None"] = 0] = "None"; - GetLiteralTextFlags[GetLiteralTextFlags["NeverAsciiEscape"] = 1] = "NeverAsciiEscape"; - GetLiteralTextFlags[GetLiteralTextFlags["JsxAttributeEscape"] = 2] = "JsxAttributeEscape"; - GetLiteralTextFlags[GetLiteralTextFlags["TerminateUnterminatedLiterals"] = 4] = "TerminateUnterminatedLiterals"; - })(GetLiteralTextFlags = ts.GetLiteralTextFlags || (ts.GetLiteralTextFlags = {})); - function getLiteralText(node, sourceFile, flags) { + function getLiteralText(node, sourceFile, neverAsciiEscape, jsxAttributeEscape) { // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. - if (!nodeIsSynthesized(node) && node.parent && !(flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) || + if (!nodeIsSynthesized(node) && node.parent && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) || ts.isBigIntLiteral(node))) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); } @@ -13888,8 +13225,8 @@ var ts; // or a (possibly escaped) quoted form of the original text if it's string-like. switch (node.kind) { case 10 /* StringLiteral */: { - var escapeText = flags & 2 /* JsxAttributeEscape */ ? escapeJsxAttributeString : - flags & 1 /* NeverAsciiEscape */ || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : + var escapeText = jsxAttributeEscape ? escapeJsxAttributeString : + neverAsciiEscape || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : escapeNonAsciiString; if (node.singleQuote) { return "'" + escapeText(node.text, 39 /* singleQuote */) + "'"; @@ -13904,7 +13241,7 @@ var ts; case 17 /* TemplateTail */: { // If a NoSubstitutionTemplateLiteral appears to have a substitution in it, the original text // had to include a backslash: `not \${a} substitution`. - var escapeText = flags & 1 /* NeverAsciiEscape */ || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : + var escapeText = neverAsciiEscape || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : escapeNonAsciiString; var rawText = node.rawText || escapeTemplateSubstitution(escapeText(node.text, 96 /* backtick */)); switch (node.kind) { @@ -13921,11 +13258,7 @@ var ts; } case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: - return node.text; case 13 /* RegularExpressionLiteral */: - if (flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) { - return node.text + (node.text.charCodeAt(node.text.length - 1) === 92 /* backslash */ ? " /" : "/"); - } return node.text; } return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); @@ -13948,7 +13281,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 249 /* VariableDeclaration */ && node.parent.kind === 287 /* CatchClause */; + return node.kind === 246 /* VariableDeclaration */ && node.parent.kind === 284 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13980,11 +13313,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 256 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 253 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 297 /* SourceFile */ || - node.kind === 256 /* ModuleDeclaration */ || + return node.kind === 294 /* SourceFile */ || + node.kind === 253 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -14001,9 +13334,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: return ts.isExternalModule(node.parent); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -14056,22 +13389,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 297 /* SourceFile */: - case 258 /* CaseBlock */: - case 287 /* CatchClause */: - case 256 /* ModuleDeclaration */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 294 /* SourceFile */: + case 255 /* CaseBlock */: + case 284 /* CatchClause */: + case 253 /* ModuleDeclaration */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; - case 230 /* Block */: + case 227 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -14081,9 +13414,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 313 /* JSDocSignature */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 309 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -14093,25 +13426,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 308 /* JSDocFunctionType */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 304 /* JSDocFunctionType */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -14121,8 +13454,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: return true; default: return false; @@ -14131,15 +13464,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 232 /* VariableStatement */: - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 229 /* VariableStatement */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: return true; default: return false; @@ -14153,7 +13486,7 @@ var ts; // Gets the nearest enclosing block scope container that has the provided node // as a descendant, that is not the provided node. function getEnclosingBlockScopeContainer(node) { - return ts.findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); }); + return findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); }); } ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; // Return display name of an identifier @@ -14168,7 +13501,7 @@ var ts; } ts.getNameFromIndexInfo = getNameFromIndexInfo; function isComputedNonLiteralName(name) { - return name.kind === 158 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); + return name.kind === 157 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); } ts.isComputedNonLiteralName = isComputedNonLiteralName; function getTextOfPropertyName(name) { @@ -14180,7 +13513,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -14196,9 +13529,9 @@ var ts; case 79 /* PrivateIdentifier */: case 78 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -14239,18 +13572,6 @@ var ts; }; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; - function createDiagnosticForFileFromMessageChain(sourceFile, messageChain, relatedInformation) { - return { - file: sourceFile, - start: 0, - length: 0, - code: messageChain.code, - category: messageChain.category, - messageText: messageChain.next ? messageChain : messageChain.messageText, - relatedInformation: relatedInformation - }; - } - ts.createDiagnosticForFileFromMessageChain = createDiagnosticForFileFromMessageChain; function createDiagnosticForRange(sourceFile, range, message) { return { file: sourceFile, @@ -14271,7 +13592,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 230 /* Block */) { + if (node.body && node.body.kind === 227 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -14285,7 +13606,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -14294,28 +13615,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 254 /* TypeAliasDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 251 /* TypeAliasDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: errorNode = node.name; break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -14367,11 +13688,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 203 /* CallExpression */ && n.expression.kind === 105 /* SuperKeyword */; + return n.kind === 200 /* CallExpression */ && n.expression.kind === 105 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 203 /* CallExpression */ && n.expression.kind === 99 /* ImportKeyword */; + return n.kind === 200 /* CallExpression */ && n.expression.kind === 99 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -14385,7 +13706,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 233 /* ExpressionStatement */ + return node.kind === 230 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -14413,11 +13734,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 160 /* Parameter */ || - node.kind === 159 /* TypeParameter */ || - node.kind === 208 /* FunctionExpression */ || - node.kind === 209 /* ArrowFunction */ || - node.kind === 207 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 159 /* Parameter */ || + node.kind === 158 /* TypeParameter */ || + node.kind === 205 /* FunctionExpression */ || + node.kind === 206 /* ArrowFunction */ || + node.kind === 204 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -14433,48 +13754,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (172 /* FirstTypeNode */ <= node.kind && node.kind <= 195 /* LastTypeNode */) { + if (171 /* FirstTypeNode */ <= node.kind && node.kind <= 192 /* LastTypeNode */) { return true; } switch (node.kind) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 147 /* StringKeyword */: + case 151 /* UnknownKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 146 /* StringKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: - case 145 /* ObjectKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: + case 147 /* SymbolKeyword */: + case 144 /* ObjectKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: return true; case 113 /* VoidKeyword */: - return node.parent.kind !== 212 /* VoidExpression */; - case 223 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 209 /* VoidExpression */; + case 220 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 159 /* TypeParameter */: - return node.parent.kind === 190 /* MappedType */ || node.parent.kind === 185 /* InferType */; + case 158 /* TypeParameter */: + return node.parent.kind === 189 /* MappedType */ || node.parent.kind === 184 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 78 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 156 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */ || node.kind === 201 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 78 /* Identifier */ || node.kind === 156 /* QualifiedName */ || node.kind === 198 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 157 /* QualifiedName */: - case 201 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: case 107 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 176 /* TypeQuery */) { + if (parent.kind === 175 /* TypeQuery */) { return false; } - if (parent.kind === 195 /* ImportType */) { + if (parent.kind === 192 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -14483,40 +13804,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (172 /* FirstTypeNode */ <= parent.kind && parent.kind <= 195 /* LastTypeNode */) { + if (171 /* FirstTypeNode */ <= parent.kind && parent.kind <= 192 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return node === parent.constraint; - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return node === parent.constraint; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 160 /* Parameter */: - case 249 /* VariableDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 159 /* Parameter */: + case 246 /* VariableDeclaration */: return node === parent.type; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return node === parent.type; - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return node === parent.type; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return node === parent.type; - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -14541,23 +13862,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitor(node); - case 258 /* CaseBlock */: - case 230 /* Block */: - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 243 /* WithStatement */: - case 244 /* SwitchStatement */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 245 /* LabeledStatement */: - case 247 /* TryStatement */: - case 287 /* CatchClause */: + case 255 /* CaseBlock */: + case 227 /* Block */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 240 /* WithStatement */: + case 241 /* SwitchStatement */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 242 /* LabeledStatement */: + case 244 /* TryStatement */: + case 284 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -14567,23 +13888,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 255 /* EnumDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 157 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. traverse(node.name.expression); @@ -14606,10 +13927,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 178 /* ArrayType */) { + if (node && node.kind === 177 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 173 /* TypeReference */) { + else if (node && node.kind === 172 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -14619,12 +13940,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 177 /* TypeLiteral */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 176 /* TypeLiteral */: return node.members; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return node.properties; } } @@ -14632,14 +13953,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 198 /* BindingElement */: - case 291 /* EnumMember */: - case 160 /* Parameter */: - case 288 /* PropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 289 /* ShorthandPropertyAssignment */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 288 /* EnumMember */: + case 159 /* Parameter */: + case 285 /* PropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 286 /* ShorthandPropertyAssignment */: + case 246 /* VariableDeclaration */: return true; } } @@ -14651,8 +13972,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 250 /* VariableDeclarationList */ - && node.parent.parent.kind === 232 /* VariableStatement */; + return node.parent.kind === 247 /* VariableDeclarationList */ + && node.parent.parent.kind === 229 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -14663,13 +13984,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return true; } return false; @@ -14680,7 +14001,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 245 /* LabeledStatement */) { + if (node.statement.kind !== 242 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -14688,17 +14009,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 230 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 227 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 165 /* MethodDeclaration */ && node.parent.kind === 200 /* ObjectLiteralExpression */; + return node && node.kind === 164 /* MethodDeclaration */ && node.parent.kind === 197 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 165 /* MethodDeclaration */ && - (node.parent.kind === 200 /* ObjectLiteralExpression */ || - node.parent.kind === 221 /* ClassExpression */); + return node.kind === 164 /* MethodDeclaration */ && + (node.parent.kind === 197 /* ObjectLiteralExpression */ || + node.parent.kind === 218 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -14711,7 +14032,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 288 /* PropertyAssignment */) { + if (property.kind === 285 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -14740,26 +14061,26 @@ var ts; } ts.getTsConfigPropArray = getTsConfigPropArray; function getContainingFunction(node) { - return ts.findAncestor(node.parent, ts.isFunctionLike); + return findAncestor(node.parent, ts.isFunctionLike); } ts.getContainingFunction = getContainingFunction; function getContainingFunctionDeclaration(node) { - return ts.findAncestor(node.parent, ts.isFunctionLikeDeclaration); + return findAncestor(node.parent, ts.isFunctionLikeDeclaration); } ts.getContainingFunctionDeclaration = getContainingFunctionDeclaration; function getContainingClass(node) { - return ts.findAncestor(node.parent, ts.isClassLike); + return findAncestor(node.parent, ts.isClassLike); } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 297 /* SourceFile */); + ts.Debug.assert(node.kind !== 294 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -14774,9 +14095,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 159 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14787,26 +14108,26 @@ var ts; node = node.parent; } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 256 /* ModuleDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 255 /* EnumDeclaration */: - case 297 /* SourceFile */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 253 /* ModuleDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 252 /* EnumDeclaration */: + case 294 /* SourceFile */: return node; } } @@ -14825,9 +14146,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return container; } } @@ -14849,27 +14170,27 @@ var ts; return node; } switch (node.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: node = node.parent; break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return node; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 159 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14885,14 +14206,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 208 /* FunctionExpression */ || func.kind === 209 /* ArrowFunction */) { + if (func.kind === 205 /* FunctionExpression */ || func.kind === 206 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 207 /* ParenthesizedExpression */) { + while (parent.kind === 204 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 203 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 200 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14908,7 +14229,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */) + return (kind === 198 /* PropertyAccessExpression */ || kind === 199 /* ElementAccessExpression */) && node.expression.kind === 105 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14917,26 +14238,21 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */) + return (kind === 198 /* PropertyAccessExpression */ || kind === 199 /* ElementAccessExpression */) && node.expression.kind === 107 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; - function isThisInitializedDeclaration(node) { - var _a; - return !!node && ts.isVariableDeclaration(node) && ((_a = node.initializer) === null || _a === void 0 ? void 0 : _a.kind) === 107 /* ThisKeyword */; - } - ts.isThisInitializedDeclaration = isThisInitializedDeclaration; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 78 /* Identifier */: - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return node; } return undefined; @@ -14944,10 +14260,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return node.tag; - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14960,25 +14276,25 @@ var ts; return false; } switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: // classes are valid targets return true; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 252 /* ClassDeclaration */; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + return parent.kind === 249 /* ClassDeclaration */; + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 252 /* ClassDeclaration */; - case 160 /* Parameter */: + && parent.kind === 249 /* ClassDeclaration */; + case 159 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 166 /* Constructor */ - || parent.kind === 165 /* MethodDeclaration */ - || parent.kind === 168 /* SetAccessor */) - && grandparent.kind === 252 /* ClassDeclaration */; + && (parent.kind === 165 /* Constructor */ + || parent.kind === 164 /* MethodDeclaration */ + || parent.kind === 167 /* SetAccessor */) + && grandparent.kind === 249 /* ClassDeclaration */; } return false; } @@ -14994,10 +14310,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 165 /* MethodDeclaration */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 167 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -15006,9 +14322,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 275 /* JsxOpeningElement */ || - parent.kind === 274 /* JsxSelfClosingElement */ || - parent.kind === 276 /* JsxClosingElement */) { + if (parent.kind === 272 /* JsxOpeningElement */ || + parent.kind === 271 /* JsxSelfClosingElement */ || + parent.kind === 273 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -15021,44 +14337,44 @@ var ts; case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 224 /* AsExpression */: - case 206 /* TypeAssertionExpression */: - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: - case 209 /* ArrowFunction */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 211 /* TypeOfExpression */: - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: - case 216 /* BinaryExpression */: - case 217 /* ConditionalExpression */: - case 220 /* SpreadElement */: - case 218 /* TemplateExpression */: - case 222 /* OmittedExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: - case 219 /* YieldExpression */: - case 213 /* AwaitExpression */: - case 226 /* MetaProperty */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 221 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 208 /* TypeOfExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 213 /* BinaryExpression */: + case 214 /* ConditionalExpression */: + case 217 /* SpreadElement */: + case 215 /* TemplateExpression */: + case 219 /* OmittedExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: + case 216 /* YieldExpression */: + case 210 /* AwaitExpression */: + case 223 /* MetaProperty */: return true; - case 157 /* QualifiedName */: - while (node.parent.kind === 157 /* QualifiedName */) { + case 156 /* QualifiedName */: + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 175 /* TypeQuery */ || isJSXTagName(node); case 78 /* Identifier */: - if (node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 175 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -15076,49 +14392,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 291 /* EnumMember */: - case 288 /* PropertyAssignment */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 288 /* EnumMember */: + case 285 /* PropertyAssignment */: + case 195 /* BindingElement */: return parent.initializer === node; - case 233 /* ExpressionStatement */: - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 242 /* ReturnStatement */: - case 243 /* WithStatement */: - case 244 /* SwitchStatement */: - case 284 /* CaseClause */: - case 246 /* ThrowStatement */: + case 230 /* ExpressionStatement */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 239 /* ReturnStatement */: + case 240 /* WithStatement */: + case 241 /* SwitchStatement */: + case 281 /* CaseClause */: + case 243 /* ThrowStatement */: return parent.expression === node; - case 237 /* ForStatement */: + case 234 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 250 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 247 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 250 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 247 /* VariableDeclarationList */) || forInStatement.expression === node; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return node === parent.expression; - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return node === parent.expression; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return node === parent.expression; - case 161 /* Decorator */: - case 283 /* JsxExpression */: - case 282 /* JsxSpreadAttribute */: - case 290 /* SpreadAssignment */: + case 160 /* Decorator */: + case 280 /* JsxExpression */: + case 279 /* JsxSpreadAttribute */: + case 287 /* SpreadAssignment */: return true; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -15126,14 +14442,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 157 /* QualifiedName */ || node.kind === 78 /* Identifier */) { + while (node.kind === 156 /* QualifiedName */ || node.kind === 78 /* Identifier */) { node = node.parent; } - return node.kind === 176 /* TypeQuery */; + return node.kind === 175 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 272 /* ExternalModuleReference */; + return node.kind === 257 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 269 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -15141,13 +14457,8 @@ var ts; return node.moduleReference.expression; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; - function getExternalModuleRequireArgument(node) { - return isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true) - && getLeftmostAccessExpression(node.initializer).arguments[0]; - } - ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 272 /* ExternalModuleReference */; + return node.kind === 257 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 269 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -15179,11 +14490,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 147 /* StringKeyword */ || node.typeArguments[0].kind === 144 /* NumberKeyword */); + (node.typeArguments[0].kind === 146 /* StringKeyword */ || node.typeArguments[0].kind === 143 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 203 /* CallExpression */) { + if (callExpression.kind !== 200 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -15198,10 +14509,7 @@ var ts; } ts.isRequireCall = isRequireCall; function isRequireVariableDeclaration(node, requireStringLiteralLikeArgument) { - if (node.kind === 198 /* BindingElement */) { - node = node.parent.parent; - } - return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(getLeftmostAccessExpression(node.initializer), requireStringLiteralLikeArgument); + return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(node.initializer, requireStringLiteralLikeArgument); } ts.isRequireVariableDeclaration = isRequireVariableDeclaration; function isRequireVariableStatement(node, requireStringLiteralLikeArgument) { @@ -15219,6 +14527,46 @@ var ts; return getSourceTextOfNodeFromSourceFile(sourceFile, str).charCodeAt(0) === 34 /* doubleQuote */; } ts.isStringDoubleQuoted = isStringDoubleQuoted; + function getDeclarationOfExpando(node) { + if (!node.parent) { + return undefined; + } + var name; + var decl; + if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) { + if (!isInJSFile(node) && !isVarConst(node.parent)) { + return undefined; + } + name = node.parent.name; + decl = node.parent; + } + else if (ts.isBinaryExpression(node.parent)) { + var parentNode = node.parent; + var parentNodeOperator = node.parent.operatorToken.kind; + if (parentNodeOperator === 62 /* EqualsToken */ && parentNode.right === node) { + name = parentNode.left; + decl = name; + } + else if (parentNodeOperator === 56 /* BarBarToken */ || parentNodeOperator === 60 /* QuestionQuestionToken */) { + if (ts.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { + name = parentNode.parent.name; + decl = parentNode.parent; + } + else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 /* EqualsToken */ && parentNode.parent.right === parentNode) { + name = parentNode.parent.left; + decl = name; + } + if (!name || !isBindableStaticNameExpression(name) || !isSameEntityName(name, parentNode.left)) { + return undefined; + } + } + } + if (!name || !getExpandoInitializer(node, isPrototypeAccess(name))) { + return undefined; + } + return decl; + } + ts.getDeclarationOfExpando = getDeclarationOfExpando; function isAssignmentDeclaration(decl) { return ts.isBinaryExpression(decl) || isAccessExpression(decl) || ts.isIdentifier(decl) || ts.isCallExpression(decl); } @@ -15280,11 +14628,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 208 /* FunctionExpression */ || e.kind === 209 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 205 /* FunctionExpression */ || e.kind === 206 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 208 /* FunctionExpression */ || - initializer.kind === 221 /* ClassExpression */ || - initializer.kind === 209 /* ArrowFunction */) { + if (initializer.kind === 205 /* FunctionExpression */ || + initializer.kind === 218 /* ClassExpression */ || + initializer.kind === 206 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -15359,7 +14707,6 @@ var ts; } return false; } - ts.isSameEntityName = isSameEntityName; function getRightMostAssignedExpression(node) { while (isAssignmentExpression(node, /*excludeCompoundAssignments*/ true)) { node = node.right; @@ -15538,7 +14885,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 233 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 230 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -15559,7 +14906,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 251 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 248 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -15568,14 +14915,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return node.parent; - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return node.parent.parent; - case 203 /* CallExpression */: + case 200 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 191 /* LiteralType */: + case 190 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -15585,12 +14932,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return node.moduleSpecifier; - case 260 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 272 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 195 /* ImportType */: + case 257 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 269 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 192 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -15599,11 +14946,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -15611,7 +14958,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 261 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 258 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -15632,13 +14979,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 160 /* Parameter */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 289 /* ShorthandPropertyAssignment */: - case 288 /* PropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 159 /* Parameter */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 286 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -15652,7 +14999,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 331 /* JSDocTypedefTag */ || node.kind === 324 /* JSDocCallbackTag */ || node.kind === 325 /* JSDocEnumTag */; + return node.kind === 327 /* JSDocTypedefTag */ || node.kind === 320 /* JSDocCallbackTag */ || node.kind === 321 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -15677,12 +15024,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return node.initializer; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return node.initializer; } } @@ -15694,7 +15041,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 256 /* ModuleDeclaration */ + node.body.kind === 253 /* ModuleDeclaration */ ? node.body : undefined; } @@ -15709,11 +15056,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 160 /* Parameter */) { + if (node.kind === 159 /* Parameter */) { result = ts.addRange(result, (noCache ? ts.getJSDocParameterTagsNoCache : ts.getJSDocParameterTags)(node)); break; } - if (node.kind === 159 /* TypeParameter */) { + if (node.kind === 158 /* TypeParameter */) { result = ts.addRange(result, (noCache ? ts.getJSDocTypeParameterTagsNoCache : ts.getJSDocTypeParameterTags)(node)); break; } @@ -15724,10 +15071,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 288 /* PropertyAssignment */ || - parent.kind === 266 /* ExportAssignment */ || - parent.kind === 163 /* PropertyDeclaration */ || - parent.kind === 233 /* ExpressionStatement */ && node.kind === 201 /* PropertyAccessExpression */ || + if (parent.kind === 285 /* PropertyAssignment */ || + parent.kind === 263 /* ExportAssignment */ || + parent.kind === 162 /* PropertyDeclaration */ || + parent.kind === 230 /* ExpressionStatement */ && node.kind === 198 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -15785,7 +15132,7 @@ var ts; ts.getEffectiveJSDocHost = getEffectiveJSDocHost; /** Use getEffectiveJSDocHost if you additionally need to look for jsdoc on parent nodes, like assignments. */ function getJSDocHost(node) { - return ts.Debug.checkDefined(ts.findAncestor(node.parent, ts.isJSDoc)).parent; + return ts.Debug.checkDefined(findAncestor(node.parent, ts.isJSDoc)).parent; } ts.getJSDocHost = getJSDocHost; function getTypeParameterFromJsDoc(node) { @@ -15801,7 +15148,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 309 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 305 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15818,31 +15165,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 207 /* ParenthesizedExpression */: - case 199 /* ArrayLiteralExpression */: - case 220 /* SpreadElement */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 196 /* ArrayLiteralExpression */: + case 217 /* SpreadElement */: + case 222 /* NonNullExpression */: node = parent; break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15869,22 +15216,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 230 /* Block */: - case 232 /* VariableStatement */: - case 243 /* WithStatement */: - case 234 /* IfStatement */: - case 244 /* SwitchStatement */: - case 258 /* CaseBlock */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 245 /* LabeledStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 247 /* TryStatement */: - case 287 /* CatchClause */: + case 227 /* Block */: + case 229 /* VariableStatement */: + case 240 /* WithStatement */: + case 231 /* IfStatement */: + case 241 /* SwitchStatement */: + case 255 /* CaseBlock */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 242 /* LabeledStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 244 /* TryStatement */: + case 284 /* CatchClause */: return true; } return false; @@ -15901,44 +15248,30 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 186 /* ParenthesizedType */); + return walkUp(node, 185 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 207 /* ParenthesizedExpression */); + return walkUp(node, 204 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; - /** - * Walks up parenthesized types. - * It returns both the outermost parenthesized type and its parent. - * If given node is not a parenthesiezd type, undefined is return as the former. - */ - function walkUpParenthesizedTypesAndGetParentAndChild(node) { - var child; - while (node && node.kind === 186 /* ParenthesizedType */) { - child = node; - node = node.parent; - } - return [child, node]; - } - ts.walkUpParenthesizedTypesAndGetParentAndChild = walkUpParenthesizedTypesAndGetParentAndChild; function skipParentheses(node) { return ts.skipOuterExpressions(node, 1 /* Parentheses */); } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 207 /* ParenthesizedExpression */) { + while (node.kind === 204 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 201 /* PropertyAccessExpression */ && node.kind !== 202 /* ElementAccessExpression */) { + if (node.kind !== 198 /* PropertyAccessExpression */ && node.kind !== 199 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 210 /* DeleteExpression */; + return node && node.kind === 207 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15991,7 +15324,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 158 /* ComputedPropertyName */ && + node.parent.kind === 157 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15999,26 +15332,26 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 291 /* EnumMember */: - case 288 /* PropertyAssignment */: - case 201 /* PropertyAccessExpression */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 288 /* EnumMember */: + case 285 /* PropertyAssignment */: + case 198 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference return parent.right === node; - case 198 /* BindingElement */: - case 265 /* ImportSpecifier */: + case 195 /* BindingElement */: + case 262 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 270 /* ExportSpecifier */: - case 280 /* JsxAttribute */: + case 267 /* ExportSpecifier */: + case 277 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -16038,33 +15371,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ || - node.kind === 259 /* NamespaceExportDeclaration */ || - node.kind === 262 /* ImportClause */ && !!node.name || - node.kind === 263 /* NamespaceImport */ || - node.kind === 269 /* NamespaceExport */ || - node.kind === 265 /* ImportSpecifier */ || - node.kind === 270 /* ExportSpecifier */ || - node.kind === 266 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 256 /* NamespaceExportDeclaration */ || + node.kind === 259 /* ImportClause */ && !!node.name || + node.kind === 260 /* NamespaceImport */ || + node.kind === 266 /* NamespaceExport */ || + node.kind === 262 /* ImportSpecifier */ || + node.kind === 267 /* ExportSpecifier */ || + node.kind === 263 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 289 /* ShorthandPropertyAssignment */ || - node.kind === 288 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 286 /* ShorthandPropertyAssignment */ || + node.kind === 285 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 262 /* ImportClause */: - case 265 /* ImportSpecifier */: - case 263 /* NamespaceImport */: - case 270 /* ExportSpecifier */: - case 266 /* ExportAssignment */: - case 260 /* ImportEqualsDeclaration */: + case 259 /* ImportClause */: + case 262 /* ImportSpecifier */: + case 260 /* NamespaceImport */: + case 267 /* ExportSpecifier */: + case 263 /* ExportAssignment */: + case 257 /* ImportEqualsDeclaration */: return node.parent; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 157 /* QualifiedName */); + } while (node.parent.kind === 156 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -16083,7 +15416,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 289 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 288 /* PropertyAssignment */ ? node.initializer : + return node.kind === 286 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 285 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -16149,11 +15482,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 80 /* FirstKeyword */ <= token && token <= 156 /* LastKeyword */; + return 80 /* FirstKeyword */ <= token && token <= 155 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 125 /* FirstContextualKeyword */ <= token && token <= 156 /* LastContextualKeyword */; + return 125 /* FirstContextualKeyword */ <= token && token <= 155 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -16197,14 +15530,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (hasSyntacticModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -16218,10 +15551,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasSyntacticModifier(node, 256 /* Async */); @@ -16254,7 +15587,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 158 /* ComputedPropertyName */ || name.kind === 202 /* ElementAccessExpression */)) { + if (!(name.kind === 157 /* ComputedPropertyName */ || name.kind === 199 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression; @@ -16280,7 +15613,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -16349,11 +15682,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 160 /* Parameter */; + return root.kind === 159 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 198 /* BindingElement */) { + while (node.kind === 195 /* BindingElement */) { node = node.parent.parent; } return node; @@ -16361,15 +15694,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 166 /* Constructor */ - || kind === 208 /* FunctionExpression */ - || kind === 251 /* FunctionDeclaration */ - || kind === 209 /* ArrowFunction */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 256 /* ModuleDeclaration */ - || kind === 297 /* SourceFile */; + return kind === 165 /* Constructor */ + || kind === 205 /* FunctionExpression */ + || kind === 248 /* FunctionDeclaration */ + || kind === 206 /* ArrowFunction */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 253 /* ModuleDeclaration */ + || kind === 294 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -16388,23 +15721,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 201 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 204 /* NewExpression */: + case 201 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 214 /* PrefixUnaryExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 213 /* AwaitExpression */: - case 217 /* ConditionalExpression */: - case 219 /* YieldExpression */: + case 211 /* PrefixUnaryExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 210 /* AwaitExpression */: + case 214 /* ConditionalExpression */: + case 216 /* YieldExpression */: return 1 /* Right */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -16431,15 +15764,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 201 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 216 /* BinaryExpression */) { + if (expression.kind === 213 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 214 /* PrefixUnaryExpression */ || expression.kind === 215 /* PostfixUnaryExpression */) { + else if (expression.kind === 211 /* PrefixUnaryExpression */ || expression.kind === 212 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -16618,15 +15951,15 @@ var ts; })(OperatorPrecedence = ts.OperatorPrecedence || (ts.OperatorPrecedence = {})); function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return 0 /* Comma */; - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return 1 /* Spread */; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return 2 /* Yield */; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return 4 /* Conditional */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0 /* Comma */; @@ -16652,21 +15985,21 @@ var ts; } // TODO: Should prefix `++` and `--` be moved to the `Update` precedence? // TODO: We are missing `TypeAssertionExpression` - case 214 /* PrefixUnaryExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 213 /* AwaitExpression */: + case 211 /* PrefixUnaryExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 210 /* AwaitExpression */: return 16 /* Unary */; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return 17 /* Update */; - case 203 /* CallExpression */: + case 200 /* CallExpression */: return 18 /* LeftHandSide */; - case 204 /* NewExpression */: + case 201 /* NewExpression */: return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */; - case 205 /* TaggedTemplateExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 202 /* TaggedTemplateExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return 19 /* Member */; case 107 /* ThisKeyword */: case 105 /* SuperKeyword */: @@ -16677,19 +16010,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 221 /* ClassExpression */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 218 /* ClassExpression */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: - case 207 /* ParenthesizedExpression */: - case 222 /* OmittedExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: + case 215 /* TemplateExpression */: + case 204 /* ParenthesizedExpression */: + case 219 /* OmittedExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: return 20 /* Primary */; default: return -1 /* Invalid */; @@ -16742,19 +16075,6 @@ var ts; return -1; } ts.getBinaryOperatorPrecedence = getBinaryOperatorPrecedence; - function getSemanticJsxChildren(children) { - return ts.filter(children, function (i) { - switch (i.kind) { - case 283 /* JsxExpression */: - return !!i.expression; - case 11 /* JsxText */: - return !i.containsOnlyTriviaWhiteSpaces; - default: - return true; - } - }); - } - ts.getSemanticJsxChildren = getSemanticJsxChildren; function createDiagnosticCollection() { var nonFileDiagnostics = []; // See GH#19873 var filesWithDiagnostics = []; @@ -16949,10 +16269,8 @@ var ts; ts.isIntrinsicJsxName = isIntrinsicJsxName; var indentStrings = ["", " "]; function getIndentString(level) { - // prepopulate cache - var singleLevel = indentStrings[1]; - for (var current = indentStrings.length; current <= level; current++) { - indentStrings.push(indentStrings[current - 1] + singleLevel); + if (indentStrings[level] === undefined) { + indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; } return indentStrings[level]; } @@ -17191,14 +16509,6 @@ var ts; return options.outFile || options.out; } ts.outFile = outFile; - /** Returns 'undefined' if and only if 'options.paths' is undefined. */ - function getPathsBasePath(options, host) { - var _a, _b; - if (!options.paths) - return undefined; - return (_a = options.baseUrl) !== null && _a !== void 0 ? _a : ts.Debug.checkDefined(options.pathsBasePath || ((_b = host.getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(host)), "Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'."); - } - ts.getPathsBasePath = getPathsBasePath; /** * Gets the source files that are expected to have an emit output. * @@ -17327,10 +16637,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 167 /* GetAccessor */) { + if (accessor.kind === 166 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 168 /* SetAccessor */) { + else if (accessor.kind === 167 /* SetAccessor */) { setAccessor = accessor; } else { @@ -17350,10 +16660,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 167 /* GetAccessor */ && !getAccessor) { + if (member.kind === 166 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 168 /* SetAccessor */ && !setAccessor) { + if (member.kind === 167 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -17402,7 +16712,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 311 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 307 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -17638,7 +16948,7 @@ var ts; } ts.getSelectedSyntacticModifierFlags = getSelectedSyntacticModifierFlags; function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 156 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 155 /* LastToken */) { return 0 /* None */; } if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) { @@ -17734,7 +17044,7 @@ var ts; case 84 /* ConstKeyword */: return 2048 /* Const */; case 87 /* DefaultKeyword */: return 512 /* Default */; case 129 /* AsyncKeyword */: return 256 /* Async */; - case 142 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 141 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -17784,8 +17094,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 200 /* ObjectLiteralExpression */ - || kind === 199 /* ArrayLiteralExpression */; + return kind === 197 /* ObjectLiteralExpression */ + || kind === 196 /* ArrayLiteralExpression */; } return false; } @@ -17802,12 +17112,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.left; } while (node.kind !== 78 /* Identifier */); return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 78 /* Identifier */); @@ -17817,8 +17127,8 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 78 /* Identifier */ || node.kind === 107 /* ThisKeyword */ || node.kind === 105 /* SuperKeyword */ || - node.kind === 201 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 207 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 198 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 204 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { @@ -17843,17 +17153,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 156 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 200 /* ObjectLiteralExpression */ && + return expression.kind === 197 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 199 /* ArrayLiteralExpression */ && + return expression.kind === 196 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -18185,8 +17495,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 255 /* EnumDeclaration */: - case 256 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -18263,35 +17573,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return accessKind(parent); - case 215 /* PostfixUnaryExpression */: - case 214 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 288 /* PropertyAssignment */: { + case 285 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 233 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 230 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -18440,37 +17750,37 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */) + return (kind >= 171 /* FirstTypeNode */ && kind <= 192 /* LastTypeNode */) || kind === 128 /* AnyKeyword */ - || kind === 152 /* UnknownKeyword */ - || kind === 144 /* NumberKeyword */ - || kind === 155 /* BigIntKeyword */ - || kind === 145 /* ObjectKeyword */ + || kind === 151 /* UnknownKeyword */ + || kind === 143 /* NumberKeyword */ + || kind === 154 /* BigIntKeyword */ + || kind === 144 /* ObjectKeyword */ || kind === 131 /* BooleanKeyword */ - || kind === 147 /* StringKeyword */ - || kind === 148 /* SymbolKeyword */ + || kind === 146 /* StringKeyword */ + || kind === 147 /* SymbolKeyword */ || kind === 113 /* VoidKeyword */ - || kind === 150 /* UndefinedKeyword */ - || kind === 141 /* NeverKeyword */ - || kind === 223 /* ExpressionWithTypeArguments */ - || kind === 303 /* JSDocAllType */ - || kind === 304 /* JSDocUnknownType */ - || kind === 305 /* JSDocNullableType */ - || kind === 306 /* JSDocNonNullableType */ - || kind === 307 /* JSDocOptionalType */ - || kind === 308 /* JSDocFunctionType */ - || kind === 309 /* JSDocVariadicType */; + || kind === 149 /* UndefinedKeyword */ + || kind === 140 /* NeverKeyword */ + || kind === 220 /* ExpressionWithTypeArguments */ + || kind === 299 /* JSDocAllType */ + || kind === 300 /* JSDocUnknownType */ + || kind === 301 /* JSDocNullableType */ + || kind === 302 /* JSDocNonNullableType */ + || kind === 303 /* JSDocOptionalType */ + || kind === 304 /* JSDocFunctionType */ + || kind === 305 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 201 /* PropertyAccessExpression */ || node.kind === 202 /* ElementAccessExpression */; + return node.kind === 198 /* PropertyAccessExpression */ || node.kind === 199 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 201 /* PropertyAccessExpression */) { + if (node.kind === 198 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 202 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 199 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -18485,41 +17795,34 @@ var ts; } ts.isBundleFileTextLike = isBundleFileTextLike; function isNamedImportsOrExports(node) { - return node.kind === 264 /* NamedImports */ || node.kind === 268 /* NamedExports */; + return node.kind === 261 /* NamedImports */ || node.kind === 265 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; - function getLeftmostAccessExpression(expr) { - while (isAccessExpression(expr)) { - expr = expr.expression; - } - return expr; - } - ts.getLeftmostAccessExpression = getLeftmostAccessExpression; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: node = node.operand; continue; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: node = node.left; continue; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: node = node.condition; continue; - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: node = node.tag; continue; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 224 /* AsExpression */: - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: - case 225 /* NonNullExpression */: - case 336 /* PartiallyEmittedExpression */: + case 221 /* AsExpression */: + case 199 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 222 /* NonNullExpression */: + case 331 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -18538,7 +17841,7 @@ var ts; } function Type(checker, flags) { this.flags = flags; - if (ts.Debug.isDebugging || ts.tracing.isTracing()) { + if (ts.Debug.isDebugging) { this.checker = checker; } } @@ -18895,10 +18198,6 @@ var ts; return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag]; } ts.getStrictOptionValue = getStrictOptionValue; - function getAllowJSCompilerOption(compilerOptions) { - return compilerOptions.allowJs === undefined ? !!compilerOptions.checkJs : compilerOptions.allowJs; - } - ts.getAllowJSCompilerOption = getAllowJSCompilerOption; function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) { return oldOptions !== newOptions && ts.semanticDiagnosticsOptionDeclarations.some(function (option) { return !isJsonEqual(getCompilerOptionValue(oldOptions, option), getCompilerOptionValue(newOptions, option)); }); @@ -18913,26 +18212,6 @@ var ts; return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name]; } ts.getCompilerOptionValue = getCompilerOptionValue; - function getJSXTransformEnabled(options) { - var jsx = options.jsx; - return jsx === 2 /* React */ || jsx === 4 /* ReactJSX */ || jsx === 5 /* ReactJSXDev */; - } - ts.getJSXTransformEnabled = getJSXTransformEnabled; - function getJSXImplicitImportBase(compilerOptions, file) { - var jsxImportSourcePragmas = file === null || file === void 0 ? void 0 : file.pragmas.get("jsximportsource"); - var jsxImportSourcePragma = ts.isArray(jsxImportSourcePragmas) ? jsxImportSourcePragmas[0] : jsxImportSourcePragmas; - return compilerOptions.jsx === 4 /* ReactJSX */ || - compilerOptions.jsx === 5 /* ReactJSXDev */ || - compilerOptions.jsxImportSource || - jsxImportSourcePragma ? - (jsxImportSourcePragma === null || jsxImportSourcePragma === void 0 ? void 0 : jsxImportSourcePragma.arguments.factory) || compilerOptions.jsxImportSource || "react" : - undefined; - } - ts.getJSXImplicitImportBase = getJSXImplicitImportBase; - function getJSXRuntimeImport(base, options) { - return base ? base + "/" + (options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined; - } - ts.getJSXRuntimeImport = getJSXRuntimeImport; function hasZeroOrOneAsteriskCharacter(str) { var seenAsterisk = false; for (var i = 0; i < str.length; i++) { @@ -19312,7 +18591,7 @@ var ts; var allSupportedExtensions = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions); var allSupportedExtensionsWithJson = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions, [".json" /* Json */]); function getSupportedExtensions(options, extraFileExtensions) { - var needJsExtensions = options && getAllowJSCompilerOption(options); + var needJsExtensions = options && options.allowJs; if (!extraFileExtensions || extraFileExtensions.length === 0) { return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions; } @@ -19523,7 +18802,6 @@ var ts; if (!diagnostic.relatedInformation) { diagnostic.relatedInformation = []; } - ts.Debug.assert(diagnostic.relatedInformation !== ts.emptyArray, "Diagnostic had empty array singleton for related info, but is still being constructed!"); (_a = diagnostic.relatedInformation).push.apply(_a, relatedInformation); return diagnostic; } @@ -19652,38 +18930,38 @@ var ts; } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 270 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 267 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 78 /* Identifier */ || node.kind === 201 /* PropertyAccessExpression */) { + while (node.kind === 78 /* Identifier */ || node.kind === 198 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 158 /* ComputedPropertyName */) { + if (node.kind !== 157 /* ComputedPropertyName */) { return false; } if (hasSyntacticModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 253 /* InterfaceDeclaration */ || containerKind === 177 /* TypeLiteral */; + return containerKind === 250 /* InterfaceDeclaration */ || containerKind === 176 /* TypeLiteral */; } /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ function isIdentifierInNonEmittingHeritageClause(node) { if (node.kind !== 78 /* Identifier */) return false; - var heritageClause = ts.findAncestor(node.parent, function (parent) { + var heritageClause = findAncestor(node.parent, function (parent) { switch (parent.kind) { - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return true; - case 201 /* PropertyAccessExpression */: - case 223 /* ExpressionWithTypeArguments */: + case 198 /* PropertyAccessExpression */: + case 220 /* ExpressionWithTypeArguments */: return false; default: return "quit"; } }); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 253 /* InterfaceDeclaration */; + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 250 /* InterfaceDeclaration */; } function isIdentifierTypeReference(node) { return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName); @@ -19877,10 +19155,10 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(216 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(213 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(213 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 209 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { + if (!isLeftSideOfBinary && operand.kind === 206 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -19892,7 +19170,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 219 /* YieldExpression */) { + && operand.kind === 216 /* YieldExpression */) { return false; } return true; @@ -19980,7 +19258,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -20006,7 +19284,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 207 /* ParenthesizedExpression */) { + if (skipped.kind === 204 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -20023,7 +19301,7 @@ var ts; return ts.isCommaSequence(expression) ? factory.createParenthesizedExpression(expression) : expression; } function parenthesizeConditionOfConditionalExpression(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(217 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(214 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -20056,8 +19334,8 @@ var ts; var needsParens = ts.isCommaSequence(check); if (!needsParens) { switch (ts.getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: needsParens = true; } } @@ -20070,9 +19348,9 @@ var ts; function parenthesizeExpressionOfNew(expression) { var leftmostExpr = ts.getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: return factory.createParenthesizedExpression(expression); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return !leftmostExpr.arguments ? factory.createParenthesizedExpression(expression) : expression; // TODO(rbuckton): Verify this assertion holds @@ -20092,7 +19370,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 204 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 201 /* NewExpression */ || emittedExpression.arguments)) { // TODO(rbuckton): Verify whether this assertion holds. return expression; } @@ -20114,7 +19392,7 @@ var ts; function parenthesizeExpressionForDisallowedComma(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(213 /* BinaryExpression */, 27 /* CommaToken */); // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(factory.createParenthesizedExpression(expression), expression); } @@ -20123,44 +19401,44 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 208 /* FunctionExpression */ || kind === 209 /* ArrowFunction */) { + if (kind === 205 /* FunctionExpression */ || kind === 206 /* ArrowFunction */) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. var updated = factory.updateCallExpression(emittedExpression, ts.setTextRange(factory.createParenthesizedExpression(callee), callee), emittedExpression.typeArguments, emittedExpression.arguments); return factory.restoreOuterExpressions(expression, updated, 8 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = ts.getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 200 /* ObjectLiteralExpression */ || leftmostExpressionKind === 208 /* FunctionExpression */) { + if (leftmostExpressionKind === 197 /* ObjectLiteralExpression */ || leftmostExpressionKind === 205 /* FunctionExpression */) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return ts.setTextRange(factory.createParenthesizedExpression(expression), expression); } return expression; } function parenthesizeConciseBodyOfArrowFunction(body) { - if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 200 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 197 /* ObjectLiteralExpression */)) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return ts.setTextRange(factory.createParenthesizedExpression(body), body); } return body; } function parenthesizeMemberOfConditionalType(member) { - return member.kind === 184 /* ConditionalType */ ? factory.createParenthesizedType(member) : member; + return member.kind === 183 /* ConditionalType */ ? factory.createParenthesizedType(member) : member; } function parenthesizeMemberOfElementType(member) { switch (member.kind) { - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return factory.createParenthesizedType(member); } return parenthesizeMemberOfConditionalType(member); } function parenthesizeElementTypeOfArrayType(member) { switch (member.kind) { - case 176 /* TypeQuery */: - case 188 /* TypeOperator */: - case 185 /* InferType */: + case 175 /* TypeQuery */: + case 187 /* TypeOperator */: + case 184 /* InferType */: return factory.createParenthesizedType(member); } return parenthesizeMemberOfElementType(member); @@ -20264,11 +19542,11 @@ var ts; } function convertToAssignmentPattern(node) { switch (node.kind) { - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 196 /* ObjectBindingPattern */: - case 200 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 197 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -20396,8 +19674,6 @@ var ts; updateConstructSignature: updateConstructSignature, createIndexSignature: createIndexSignature, updateIndexSignature: updateIndexSignature, - createTemplateLiteralTypeSpan: createTemplateLiteralTypeSpan, - updateTemplateLiteralTypeSpan: updateTemplateLiteralTypeSpan, createKeywordTypeNode: createKeywordTypeNode, createTypePredicateNode: createTypePredicateNode, updateTypePredicateNode: updateTypePredicateNode, @@ -20442,8 +19718,6 @@ var ts; updateMappedTypeNode: updateMappedTypeNode, createLiteralTypeNode: createLiteralTypeNode, updateLiteralTypeNode: updateLiteralTypeNode, - createTemplateLiteralType: createTemplateLiteralType, - updateTemplateLiteralType: updateTemplateLiteralType, createObjectBindingPattern: createObjectBindingPattern, updateObjectBindingPattern: updateObjectBindingPattern, createArrayBindingPattern: createArrayBindingPattern, @@ -20609,18 +19883,18 @@ var ts; createExternalModuleReference: createExternalModuleReference, updateExternalModuleReference: updateExternalModuleReference, // lazily load factory members for JSDoc types with similar structure - get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(303 /* JSDocAllType */); }, - get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(304 /* JSDocUnknownType */); }, - get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(306 /* JSDocNonNullableType */); }, - get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(306 /* JSDocNonNullableType */); }, - get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(305 /* JSDocNullableType */); }, - get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(305 /* JSDocNullableType */); }, - get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(307 /* JSDocOptionalType */); }, - get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(307 /* JSDocOptionalType */); }, - get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(309 /* JSDocVariadicType */); }, - get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(309 /* JSDocVariadicType */); }, - get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(310 /* JSDocNamepathType */); }, - get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(310 /* JSDocNamepathType */); }, + get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(299 /* JSDocAllType */); }, + get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(300 /* JSDocUnknownType */); }, + get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(302 /* JSDocNonNullableType */); }, + get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(302 /* JSDocNonNullableType */); }, + get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(301 /* JSDocNullableType */); }, + get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(301 /* JSDocNullableType */); }, + get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(303 /* JSDocOptionalType */); }, + get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(303 /* JSDocOptionalType */); }, + get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(305 /* JSDocVariadicType */); }, + get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(305 /* JSDocVariadicType */); }, + get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(306 /* JSDocNamepathType */); }, + get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(306 /* JSDocNamepathType */); }, createJSDocFunctionType: createJSDocFunctionType, updateJSDocFunctionType: updateJSDocFunctionType, createJSDocTypeLiteral: createJSDocTypeLiteral, @@ -20643,33 +19917,29 @@ var ts; updateJSDocAugmentsTag: updateJSDocAugmentsTag, createJSDocImplementsTag: createJSDocImplementsTag, updateJSDocImplementsTag: updateJSDocImplementsTag, - createJSDocSeeTag: createJSDocSeeTag, - updateJSDocSeeTag: updateJSDocSeeTag, - createJSDocNameReference: createJSDocNameReference, - updateJSDocNameReference: updateJSDocNameReference, // lazily load factory members for JSDoc tags with similar structure - get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(329 /* JSDocTypeTag */); }, - get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(329 /* JSDocTypeTag */); }, - get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(327 /* JSDocReturnTag */); }, - get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(327 /* JSDocReturnTag */); }, - get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(328 /* JSDocThisTag */); }, - get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(328 /* JSDocThisTag */); }, - get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(325 /* JSDocEnumTag */); }, - get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(325 /* JSDocEnumTag */); }, - get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(317 /* JSDocAuthorTag */); }, - get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(317 /* JSDocAuthorTag */); }, - get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(319 /* JSDocClassTag */); }, - get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(319 /* JSDocClassTag */); }, - get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(320 /* JSDocPublicTag */); }, - get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(320 /* JSDocPublicTag */); }, - get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(321 /* JSDocPrivateTag */); }, - get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(321 /* JSDocPrivateTag */); }, - get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(322 /* JSDocProtectedTag */); }, - get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(322 /* JSDocProtectedTag */); }, - get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(323 /* JSDocReadonlyTag */); }, - get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(323 /* JSDocReadonlyTag */); }, - get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(318 /* JSDocDeprecatedTag */); }, - get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(318 /* JSDocDeprecatedTag */); }, + get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(325 /* JSDocTypeTag */); }, + get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(325 /* JSDocTypeTag */); }, + get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(323 /* JSDocReturnTag */); }, + get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(323 /* JSDocReturnTag */); }, + get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(324 /* JSDocThisTag */); }, + get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(324 /* JSDocThisTag */); }, + get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(321 /* JSDocEnumTag */); }, + get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(321 /* JSDocEnumTag */); }, + get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(313 /* JSDocAuthorTag */); }, + get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(313 /* JSDocAuthorTag */); }, + get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(315 /* JSDocClassTag */); }, + get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(315 /* JSDocClassTag */); }, + get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(316 /* JSDocPublicTag */); }, + get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(316 /* JSDocPublicTag */); }, + get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(317 /* JSDocPrivateTag */); }, + get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(317 /* JSDocPrivateTag */); }, + get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(318 /* JSDocProtectedTag */); }, + get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(318 /* JSDocProtectedTag */); }, + get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(319 /* JSDocReadonlyTag */); }, + get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(319 /* JSDocReadonlyTag */); }, + get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(314 /* JSDocDeprecatedTag */); }, + get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(314 /* JSDocDeprecatedTag */); }, createJSDocUnknownTag: createJSDocUnknownTag, updateJSDocUnknownTag: updateJSDocUnknownTag, createJSDocComment: createJSDocComment, @@ -20814,7 +20084,6 @@ var ts; if (elements.transformFlags === undefined) { aggregateChildrenFlags(elements); } - ts.Debug.attachNodeArrayDebugInfo(elements); return elements; } // Since the element list of a node array is typically created by starting with an empty array and @@ -20825,7 +20094,6 @@ var ts; ts.setTextRangePosEnd(array, -1, -1); array.hasTrailingComma = !!hasTrailingComma; aggregateChildrenFlags(array); - ts.Debug.attachNodeArrayDebugInfo(array); return array; } function createBaseNode(kind) { @@ -20855,11 +20123,11 @@ var ts; // don't propagate child flags. if (name) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: if (ts.isIdentifier(name)) { node.transformFlags |= propagateIdentifierNameFlags(name); break; @@ -21087,7 +20355,7 @@ var ts; return baseFactory.createBaseTokenNode(kind); } function createToken(token) { - ts.Debug.assert(token >= 0 /* FirstToken */ && token <= 156 /* LastToken */, "Invalid token"); + ts.Debug.assert(token >= 0 /* FirstToken */ && token <= 155 /* LastToken */, "Invalid token"); ts.Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); ts.Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals."); ts.Debug.assert(token !== 78 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers"); @@ -21103,21 +20371,21 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 125 /* AbstractKeyword */: case 133 /* DeclareKeyword */: case 84 /* ConstKeyword */: case 128 /* AnyKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 141 /* NeverKeyword */: - case 145 /* ObjectKeyword */: - case 147 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 140 /* NeverKeyword */: + case 144 /* ObjectKeyword */: + case 146 /* StringKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: case 113 /* VoidKeyword */: - case 152 /* UnknownKeyword */: - case 150 /* UndefinedKeyword */: // `undefined` is an Identifier in the expression case. + case 151 /* UnknownKeyword */: + case 149 /* UndefinedKeyword */: // `undefined` is an Identifier in the expression case. transformFlags = 1 /* ContainsTypeScript */; break; case 123 /* StaticKeyword */: @@ -21195,7 +20463,7 @@ var ts; result.push(createModifier(123 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(142 /* ReadonlyKeyword */)); + result.push(createModifier(141 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(129 /* AsyncKeyword */)); @@ -21207,7 +20475,7 @@ var ts; // // @api function createQualifiedName(left, right) { - var node = createBaseNode(157 /* QualifiedName */); + var node = createBaseNode(156 /* QualifiedName */); node.left = left; node.right = asName(right); node.transformFlags |= @@ -21224,7 +20492,7 @@ var ts; } // @api function createComputedPropertyName(expression) { - var node = createBaseNode(158 /* ComputedPropertyName */); + var node = createBaseNode(157 /* ComputedPropertyName */); node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -21243,7 +20511,7 @@ var ts; // // @api function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createBaseNamedDeclaration(159 /* TypeParameter */, + var node = createBaseNamedDeclaration(158 /* TypeParameter */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.constraint = constraint; @@ -21261,7 +20529,7 @@ var ts; } // @api function createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(160 /* Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); + var node = createBaseVariableLikeDeclaration(159 /* Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); node.dotDotDotToken = dotDotDotToken; node.questionToken = questionToken; if (ts.isThisIdentifier(node.name)) { @@ -21294,7 +20562,7 @@ var ts; } // @api function createDecorator(expression) { - var node = createBaseNode(161 /* Decorator */); + var node = createBaseNode(160 /* Decorator */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -21313,7 +20581,7 @@ var ts; // // @api function createPropertySignature(modifiers, name, questionToken, type) { - var node = createBaseNamedDeclaration(162 /* PropertySignature */, + var node = createBaseNamedDeclaration(161 /* PropertySignature */, /*decorators*/ undefined, modifiers, name); node.type = type; node.questionToken = questionToken; @@ -21331,7 +20599,7 @@ var ts; } // @api function createPropertyDeclaration(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(163 /* PropertyDeclaration */, decorators, modifiers, name, type, initializer); + var node = createBaseVariableLikeDeclaration(162 /* PropertyDeclaration */, decorators, modifiers, name, type, initializer); node.questionToken = questionOrExclamationToken && ts.isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined; node.exclamationToken = questionOrExclamationToken && ts.isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined; node.transformFlags |= @@ -21360,7 +20628,7 @@ var ts; } // @api function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(164 /* MethodSignature */, + var node = createBaseSignatureDeclaration(163 /* MethodSignature */, /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type); node.questionToken = questionToken; node.transformFlags = 1 /* ContainsTypeScript */; @@ -21379,7 +20647,7 @@ var ts; } // @api function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(165 /* MethodDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); + var node = createBaseFunctionLikeDeclaration(164 /* MethodDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; node.questionToken = questionToken; node.transformFlags |= @@ -21418,7 +20686,7 @@ var ts; } // @api function createConstructorDeclaration(decorators, modifiers, parameters, body) { - var node = createBaseFunctionLikeDeclaration(166 /* Constructor */, decorators, modifiers, + var node = createBaseFunctionLikeDeclaration(165 /* Constructor */, decorators, modifiers, /*name*/ undefined, /*typeParameters*/ undefined, parameters, /*type*/ undefined, body); @@ -21436,7 +20704,7 @@ var ts; } // @api function createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) { - return createBaseFunctionLikeDeclaration(167 /* GetAccessor */, decorators, modifiers, name, + return createBaseFunctionLikeDeclaration(166 /* GetAccessor */, decorators, modifiers, name, /*typeParameters*/ undefined, parameters, type, body); } // @api @@ -21452,7 +20720,7 @@ var ts; } // @api function createSetAccessorDeclaration(decorators, modifiers, name, parameters, body) { - return createBaseFunctionLikeDeclaration(168 /* SetAccessor */, decorators, modifiers, name, + return createBaseFunctionLikeDeclaration(167 /* SetAccessor */, decorators, modifiers, name, /*typeParameters*/ undefined, parameters, /*type*/ undefined, body); } @@ -21468,7 +20736,7 @@ var ts; } // @api function createCallSignature(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(169 /* CallSignature */, + var node = createBaseSignatureDeclaration(168 /* CallSignature */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21485,7 +20753,7 @@ var ts; } // @api function createConstructSignature(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(170 /* ConstructSignature */, + var node = createBaseSignatureDeclaration(169 /* ConstructSignature */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21502,7 +20770,7 @@ var ts; } // @api function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createBaseSignatureDeclaration(171 /* IndexSignature */, decorators, modifiers, + var node = createBaseSignatureDeclaration(170 /* IndexSignature */, decorators, modifiers, /*name*/ undefined, /*typeParameters*/ undefined, parameters, type); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21517,21 +20785,6 @@ var ts; ? updateBaseSignatureDeclaration(createIndexSignature(decorators, modifiers, parameters, type), node) : node; } - // @api - function createTemplateLiteralTypeSpan(type, literal) { - var node = createBaseNode(194 /* TemplateLiteralTypeSpan */); - node.type = type; - node.literal = literal; - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - // @api - function updateTemplateLiteralTypeSpan(node, type, literal) { - return node.type !== type - || node.literal !== literal - ? update(createTemplateLiteralTypeSpan(type, literal), node) - : node; - } // // Types // @@ -21541,7 +20794,7 @@ var ts; } // @api function createTypePredicateNode(assertsModifier, parameterName, type) { - var node = createBaseNode(172 /* TypePredicate */); + var node = createBaseNode(171 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -21558,7 +20811,7 @@ var ts; } // @api function createTypeReferenceNode(typeName, typeArguments) { - var node = createBaseNode(173 /* TypeReference */); + var node = createBaseNode(172 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21573,7 +20826,7 @@ var ts; } // @api function createFunctionTypeNode(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(174 /* FunctionType */, + var node = createBaseSignatureDeclaration(173 /* FunctionType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21590,7 +20843,7 @@ var ts; } // @api function createConstructorTypeNode(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(175 /* ConstructorType */, + var node = createBaseSignatureDeclaration(174 /* ConstructorType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21607,7 +20860,7 @@ var ts; } // @api function createTypeQueryNode(exprName) { - var node = createBaseNode(176 /* TypeQuery */); + var node = createBaseNode(175 /* TypeQuery */); node.exprName = exprName; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21620,7 +20873,7 @@ var ts; } // @api function createTypeLiteralNode(members) { - var node = createBaseNode(177 /* TypeLiteral */); + var node = createBaseNode(176 /* TypeLiteral */); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21633,7 +20886,7 @@ var ts; } // @api function createArrayTypeNode(elementType) { - var node = createBaseNode(178 /* ArrayType */); + var node = createBaseNode(177 /* ArrayType */); node.elementType = parenthesizerRules().parenthesizeElementTypeOfArrayType(elementType); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21646,7 +20899,7 @@ var ts; } // @api function createTupleTypeNode(elements) { - var node = createBaseNode(179 /* TupleType */); + var node = createBaseNode(178 /* TupleType */); node.elements = createNodeArray(elements); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21659,7 +20912,7 @@ var ts; } // @api function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { - var node = createBaseNode(192 /* NamedTupleMember */); + var node = createBaseNode(191 /* NamedTupleMember */); node.dotDotDotToken = dotDotDotToken; node.name = name; node.questionToken = questionToken; @@ -21678,7 +20931,7 @@ var ts; } // @api function createOptionalTypeNode(type) { - var node = createBaseNode(180 /* OptionalType */); + var node = createBaseNode(179 /* OptionalType */); node.type = parenthesizerRules().parenthesizeElementTypeOfArrayType(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21691,7 +20944,7 @@ var ts; } // @api function createRestTypeNode(type) { - var node = createBaseNode(181 /* RestType */); + var node = createBaseNode(180 /* RestType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21715,7 +20968,7 @@ var ts; } // @api function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(182 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(181 /* UnionType */, types); } // @api function updateUnionTypeNode(node, types) { @@ -21723,7 +20976,7 @@ var ts; } // @api function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(183 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(182 /* IntersectionType */, types); } // @api function updateIntersectionTypeNode(node, types) { @@ -21731,7 +20984,7 @@ var ts; } // @api function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createBaseNode(184 /* ConditionalType */); + var node = createBaseNode(183 /* ConditionalType */); node.checkType = parenthesizerRules().parenthesizeMemberOfConditionalType(checkType); node.extendsType = parenthesizerRules().parenthesizeMemberOfConditionalType(extendsType); node.trueType = trueType; @@ -21750,7 +21003,7 @@ var ts; } // @api function createInferTypeNode(typeParameter) { - var node = createBaseNode(185 /* InferType */); + var node = createBaseNode(184 /* InferType */); node.typeParameter = typeParameter; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21762,24 +21015,9 @@ var ts; : node; } // @api - function createTemplateLiteralType(head, templateSpans) { - var node = createBaseNode(193 /* TemplateLiteralType */); - node.head = head; - node.templateSpans = createNodeArray(templateSpans); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - // @api - function updateTemplateLiteralType(node, head, templateSpans) { - return node.head !== head - || node.templateSpans !== templateSpans - ? update(createTemplateLiteralType(head, templateSpans), node) - : node; - } - // @api function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { if (isTypeOf === void 0) { isTypeOf = false; } - var node = createBaseNode(195 /* ImportType */); + var node = createBaseNode(192 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); @@ -21799,7 +21037,7 @@ var ts; } // @api function createParenthesizedType(type) { - var node = createBaseNode(186 /* ParenthesizedType */); + var node = createBaseNode(185 /* ParenthesizedType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21812,13 +21050,13 @@ var ts; } // @api function createThisTypeNode() { - var node = createBaseNode(187 /* ThisType */); + var node = createBaseNode(186 /* ThisType */); node.transformFlags = 1 /* ContainsTypeScript */; return node; } // @api function createTypeOperatorNode(operator, type) { - var node = createBaseNode(188 /* TypeOperator */); + var node = createBaseNode(187 /* TypeOperator */); node.operator = operator; node.type = parenthesizerRules().parenthesizeMemberOfElementType(type); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21832,7 +21070,7 @@ var ts; } // @api function createIndexedAccessTypeNode(objectType, indexType) { - var node = createBaseNode(189 /* IndexedAccessType */); + var node = createBaseNode(188 /* IndexedAccessType */); node.objectType = parenthesizerRules().parenthesizeMemberOfElementType(objectType); node.indexType = indexType; node.transformFlags = 1 /* ContainsTypeScript */; @@ -21846,29 +21084,27 @@ var ts; : node; } // @api - function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type) { - var node = createBaseNode(190 /* MappedType */); + function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { + var node = createBaseNode(189 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; - node.nameType = nameType; node.questionToken = questionToken; node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; } // @api - function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type) { + function updateMappedTypeNode(node, readonlyToken, typeParameter, questionToken, type) { return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter - || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type - ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), node) + ? update(createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), node) : node; } // @api function createLiteralTypeNode(literal) { - var node = createBaseNode(191 /* LiteralType */); + var node = createBaseNode(190 /* LiteralType */); node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21884,7 +21120,7 @@ var ts; // // @api function createObjectBindingPattern(elements) { - var node = createBaseNode(196 /* ObjectBindingPattern */); + var node = createBaseNode(193 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | @@ -21905,7 +21141,7 @@ var ts; } // @api function createArrayBindingPattern(elements) { - var node = createBaseNode(197 /* ArrayBindingPattern */); + var node = createBaseNode(194 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | @@ -21921,7 +21157,7 @@ var ts; } // @api function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createBaseBindingLikeDeclaration(198 /* BindingElement */, + var node = createBaseBindingLikeDeclaration(195 /* BindingElement */, /*decorators*/ undefined, /*modifiers*/ undefined, name, initializer); node.propertyName = asName(propertyName); @@ -21957,7 +21193,7 @@ var ts; } // @api function createArrayLiteralExpression(elements, multiLine) { - var node = createBaseExpression(199 /* ArrayLiteralExpression */); + var node = createBaseExpression(196 /* ArrayLiteralExpression */); node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(elements)); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.elements); @@ -21971,7 +21207,7 @@ var ts; } // @api function createObjectLiteralExpression(properties, multiLine) { - var node = createBaseExpression(200 /* ObjectLiteralExpression */); + var node = createBaseExpression(197 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); @@ -21985,7 +21221,7 @@ var ts; } // @api function createPropertyAccessExpression(expression, name) { - var node = createBaseExpression(201 /* PropertyAccessExpression */); + var node = createBaseExpression(198 /* PropertyAccessExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.name = asName(name); node.transformFlags = @@ -22014,7 +21250,7 @@ var ts; } // @api function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createBaseExpression(201 /* PropertyAccessExpression */); + var node = createBaseExpression(198 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -22041,7 +21277,7 @@ var ts; } // @api function createElementAccessExpression(expression, index) { - var node = createBaseExpression(202 /* ElementAccessExpression */); + var node = createBaseExpression(199 /* ElementAccessExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.argumentExpression = asExpression(index); node.transformFlags |= @@ -22068,7 +21304,7 @@ var ts; } // @api function createElementAccessChain(expression, questionDotToken, index) { - var node = createBaseExpression(202 /* ElementAccessExpression */); + var node = createBaseExpression(199 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -22093,7 +21329,7 @@ var ts; } // @api function createCallExpression(expression, typeArguments, argumentsArray) { - var node = createBaseExpression(203 /* CallExpression */); + var node = createBaseExpression(200 /* CallExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)); @@ -22125,7 +21361,7 @@ var ts; } // @api function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createBaseExpression(203 /* CallExpression */); + var node = createBaseExpression(200 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -22157,7 +21393,7 @@ var ts; } // @api function createNewExpression(expression, typeArguments, argumentsArray) { - var node = createBaseExpression(204 /* NewExpression */); + var node = createBaseExpression(201 /* NewExpression */); node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : undefined; @@ -22181,7 +21417,7 @@ var ts; } // @api function createTaggedTemplateExpression(tag, typeArguments, template) { - var node = createBaseExpression(205 /* TaggedTemplateExpression */); + var node = createBaseExpression(202 /* TaggedTemplateExpression */); node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag); node.typeArguments = asNodeArray(typeArguments); node.template = template; @@ -22208,7 +21444,7 @@ var ts; } // @api function createTypeAssertion(type, expression) { - var node = createBaseExpression(206 /* TypeAssertionExpression */); + var node = createBaseExpression(203 /* TypeAssertionExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.type = type; node.transformFlags |= @@ -22226,7 +21462,7 @@ var ts; } // @api function createParenthesizedExpression(expression) { - var node = createBaseExpression(207 /* ParenthesizedExpression */); + var node = createBaseExpression(204 /* ParenthesizedExpression */); node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); return node; @@ -22239,7 +21475,7 @@ var ts; } // @api function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(208 /* FunctionExpression */, + var node = createBaseFunctionLikeDeclaration(205 /* FunctionExpression */, /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; node.transformFlags |= propagateChildFlags(node.asteriskToken); @@ -22273,7 +21509,7 @@ var ts; } // @api function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createBaseFunctionLikeDeclaration(209 /* ArrowFunction */, + var node = createBaseFunctionLikeDeclaration(206 /* ArrowFunction */, /*decorators*/ undefined, modifiers, /*name*/ undefined, typeParameters, parameters, type, parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body)); node.equalsGreaterThanToken = equalsGreaterThanToken !== null && equalsGreaterThanToken !== void 0 ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */); @@ -22298,7 +21534,7 @@ var ts; } // @api function createDeleteExpression(expression) { - var node = createBaseExpression(210 /* DeleteExpression */); + var node = createBaseExpression(207 /* DeleteExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22311,7 +21547,7 @@ var ts; } // @api function createTypeOfExpression(expression) { - var node = createBaseExpression(211 /* TypeOfExpression */); + var node = createBaseExpression(208 /* TypeOfExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22324,7 +21560,7 @@ var ts; } // @api function createVoidExpression(expression) { - var node = createBaseExpression(212 /* VoidExpression */); + var node = createBaseExpression(209 /* VoidExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22337,7 +21573,7 @@ var ts; } // @api function createAwaitExpression(expression) { - var node = createBaseExpression(213 /* AwaitExpression */); + var node = createBaseExpression(210 /* AwaitExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22354,7 +21590,7 @@ var ts; } // @api function createPrefixUnaryExpression(operator, operand) { - var node = createBaseExpression(214 /* PrefixUnaryExpression */); + var node = createBaseExpression(211 /* PrefixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand); node.transformFlags |= propagateChildFlags(node.operand); @@ -22368,7 +21604,7 @@ var ts; } // @api function createPostfixUnaryExpression(operand, operator) { - var node = createBaseExpression(215 /* PostfixUnaryExpression */); + var node = createBaseExpression(212 /* PostfixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand); node.transformFlags = propagateChildFlags(node.operand); @@ -22382,7 +21618,7 @@ var ts; } // @api function createBinaryExpression(left, operator, right) { - var node = createBaseExpression(216 /* BinaryExpression */); + var node = createBaseExpression(213 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left); @@ -22400,14 +21636,12 @@ var ts; node.transformFlags |= 256 /* ContainsES2015 */ | 32 /* ContainsES2018 */ | - 1024 /* ContainsDestructuringAssignment */ | - propagateAssignmentPatternFlags(node.left); + 1024 /* ContainsDestructuringAssignment */; } else if (ts.isArrayLiteralExpression(node.left)) { node.transformFlags |= 256 /* ContainsES2015 */ | - 1024 /* ContainsDestructuringAssignment */ | - propagateAssignmentPatternFlags(node.left); + 1024 /* ContainsDestructuringAssignment */; } } else if (operatorKind === 42 /* AsteriskAsteriskToken */ || operatorKind === 66 /* AsteriskAsteriskEqualsToken */) { @@ -22418,29 +21652,6 @@ var ts; } return node; } - function propagateAssignmentPatternFlags(node) { - if (node.transformFlags & 16384 /* ContainsObjectRestOrSpread */) - return 16384 /* ContainsObjectRestOrSpread */; - if (node.transformFlags & 32 /* ContainsES2018 */) { - // check for nested spread assignments, otherwise '{ x: { a, ...b } = foo } = c' - // will not be correctly interpreted by the ES2018 transformer - for (var _i = 0, _a = ts.getElementsOfBindingOrAssignmentPattern(node); _i < _a.length; _i++) { - var element = _a[_i]; - var target = ts.getTargetOfBindingOrAssignmentElement(element); - if (target && ts.isAssignmentPattern(target)) { - if (target.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { - return 16384 /* ContainsObjectRestOrSpread */; - } - if (target.transformFlags & 32 /* ContainsES2018 */) { - var flags_1 = propagateAssignmentPatternFlags(target); - if (flags_1) - return flags_1; - } - } - } - } - return 0 /* None */; - } // @api function updateBinaryExpression(node, left, operator, right) { return node.left !== left @@ -22451,7 +21662,7 @@ var ts; } // @api function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { - var node = createBaseExpression(217 /* ConditionalExpression */); + var node = createBaseExpression(214 /* ConditionalExpression */); node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); node.questionToken = questionToken !== null && questionToken !== void 0 ? questionToken : createToken(57 /* QuestionToken */); node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); @@ -22477,7 +21688,7 @@ var ts; } // @api function createTemplateExpression(head, templateSpans) { - var node = createBaseExpression(218 /* TemplateExpression */); + var node = createBaseExpression(215 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); node.transformFlags |= @@ -22547,7 +21758,7 @@ var ts; // @api function createYieldExpression(asteriskToken, expression) { ts.Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression."); - var node = createBaseExpression(219 /* YieldExpression */); + var node = createBaseExpression(216 /* YieldExpression */); node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.asteriskToken = asteriskToken; node.transformFlags |= @@ -22567,7 +21778,7 @@ var ts; } // @api function createSpreadElement(expression) { - var node = createBaseExpression(220 /* SpreadElement */); + var node = createBaseExpression(217 /* SpreadElement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22583,7 +21794,7 @@ var ts; } // @api function createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseClassLikeDeclaration(221 /* ClassExpression */, decorators, modifiers, name, typeParameters, heritageClauses, members); + var node = createBaseClassLikeDeclaration(218 /* ClassExpression */, decorators, modifiers, name, typeParameters, heritageClauses, members); node.transformFlags |= 256 /* ContainsES2015 */; return node; } @@ -22600,11 +21811,11 @@ var ts; } // @api function createOmittedExpression() { - return createBaseExpression(222 /* OmittedExpression */); + return createBaseExpression(219 /* OmittedExpression */); } // @api function createExpressionWithTypeArguments(expression, typeArguments) { - var node = createBaseNode(223 /* ExpressionWithTypeArguments */); + var node = createBaseNode(220 /* ExpressionWithTypeArguments */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.transformFlags |= @@ -22622,7 +21833,7 @@ var ts; } // @api function createAsExpression(expression, type) { - var node = createBaseExpression(224 /* AsExpression */); + var node = createBaseExpression(221 /* AsExpression */); node.expression = expression; node.type = type; node.transformFlags |= @@ -22640,7 +21851,7 @@ var ts; } // @api function createNonNullExpression(expression) { - var node = createBaseExpression(225 /* NonNullExpression */); + var node = createBaseExpression(222 /* NonNullExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22658,7 +21869,7 @@ var ts; } // @api function createNonNullChain(expression) { - var node = createBaseExpression(225 /* NonNullExpression */); + var node = createBaseExpression(222 /* NonNullExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= @@ -22675,7 +21886,7 @@ var ts; } // @api function createMetaProperty(keywordToken, name) { - var node = createBaseExpression(226 /* MetaProperty */); + var node = createBaseExpression(223 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; node.transformFlags |= propagateChildFlags(node.name); @@ -22702,7 +21913,7 @@ var ts; // // @api function createTemplateSpan(expression, literal) { - var node = createBaseNode(228 /* TemplateSpan */); + var node = createBaseNode(225 /* TemplateSpan */); node.expression = expression; node.literal = literal; node.transformFlags |= @@ -22720,7 +21931,7 @@ var ts; } // @api function createSemicolonClassElement() { - var node = createBaseNode(229 /* SemicolonClassElement */); + var node = createBaseNode(226 /* SemicolonClassElement */); node.transformFlags |= 256 /* ContainsES2015 */; return node; } @@ -22729,7 +21940,7 @@ var ts; // // @api function createBlock(statements, multiLine) { - var node = createBaseNode(230 /* Block */); + var node = createBaseNode(227 /* Block */); node.statements = createNodeArray(statements); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); @@ -22743,7 +21954,7 @@ var ts; } // @api function createVariableStatement(modifiers, declarationList) { - var node = createBaseDeclaration(232 /* VariableStatement */, /*decorators*/ undefined, modifiers); + var node = createBaseDeclaration(229 /* VariableStatement */, /*decorators*/ undefined, modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; node.transformFlags |= propagateChildFlags(node.declarationList); @@ -22761,11 +21972,11 @@ var ts; } // @api function createEmptyStatement() { - return createBaseNode(231 /* EmptyStatement */); + return createBaseNode(228 /* EmptyStatement */); } // @api function createExpressionStatement(expression) { - var node = createBaseNode(233 /* ExpressionStatement */); + var node = createBaseNode(230 /* ExpressionStatement */); node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22778,7 +21989,7 @@ var ts; } // @api function createIfStatement(expression, thenStatement, elseStatement) { - var node = createBaseNode(234 /* IfStatement */); + var node = createBaseNode(231 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -22798,7 +22009,7 @@ var ts; } // @api function createDoStatement(statement, expression) { - var node = createBaseNode(235 /* DoStatement */); + var node = createBaseNode(232 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; node.transformFlags |= @@ -22815,7 +22026,7 @@ var ts; } // @api function createWhileStatement(expression, statement) { - var node = createBaseNode(236 /* WhileStatement */); + var node = createBaseNode(233 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22832,7 +22043,7 @@ var ts; } // @api function createForStatement(initializer, condition, incrementor, statement) { - var node = createBaseNode(237 /* ForStatement */); + var node = createBaseNode(234 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -22855,7 +22066,7 @@ var ts; } // @api function createForInStatement(initializer, expression, statement) { - var node = createBaseNode(238 /* ForInStatement */); + var node = createBaseNode(235 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -22875,7 +22086,7 @@ var ts; } // @api function createForOfStatement(awaitModifier, initializer, expression, statement) { - var node = createBaseNode(239 /* ForOfStatement */); + var node = createBaseNode(236 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); @@ -22901,7 +22112,7 @@ var ts; } // @api function createContinueStatement(label) { - var node = createBaseNode(240 /* ContinueStatement */); + var node = createBaseNode(237 /* ContinueStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | @@ -22916,7 +22127,7 @@ var ts; } // @api function createBreakStatement(label) { - var node = createBaseNode(241 /* BreakStatement */); + var node = createBaseNode(238 /* BreakStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | @@ -22931,7 +22142,7 @@ var ts; } // @api function createReturnStatement(expression) { - var node = createBaseNode(242 /* ReturnStatement */); + var node = createBaseNode(239 /* ReturnStatement */); node.expression = expression; // return in an ES2018 async generator must be awaited node.transformFlags |= @@ -22948,7 +22159,7 @@ var ts; } // @api function createWithStatement(expression, statement) { - var node = createBaseNode(243 /* WithStatement */); + var node = createBaseNode(240 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22965,7 +22176,7 @@ var ts; } // @api function createSwitchStatement(expression, caseBlock) { - var node = createBaseNode(244 /* SwitchStatement */); + var node = createBaseNode(241 /* SwitchStatement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.caseBlock = caseBlock; node.transformFlags |= @@ -22982,7 +22193,7 @@ var ts; } // @api function createLabeledStatement(label, statement) { - var node = createBaseNode(245 /* LabeledStatement */); + var node = createBaseNode(242 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22999,7 +22210,7 @@ var ts; } // @api function createThrowStatement(expression) { - var node = createBaseNode(246 /* ThrowStatement */); + var node = createBaseNode(243 /* ThrowStatement */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -23012,7 +22223,7 @@ var ts; } // @api function createTryStatement(tryBlock, catchClause, finallyBlock) { - var node = createBaseNode(247 /* TryStatement */); + var node = createBaseNode(244 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -23032,11 +22243,11 @@ var ts; } // @api function createDebuggerStatement() { - return createBaseNode(248 /* DebuggerStatement */); + return createBaseNode(245 /* DebuggerStatement */); } // @api function createVariableDeclaration(name, exclamationToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(249 /* VariableDeclaration */, + var node = createBaseVariableLikeDeclaration(246 /* VariableDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); node.exclamationToken = exclamationToken; @@ -23058,7 +22269,7 @@ var ts; // @api function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createBaseNode(250 /* VariableDeclarationList */); + var node = createBaseNode(247 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); node.transformFlags |= @@ -23079,7 +22290,7 @@ var ts; } // @api function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(251 /* FunctionDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); + var node = createBaseFunctionLikeDeclaration(248 /* FunctionDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; if (!node.body || ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; @@ -23117,7 +22328,7 @@ var ts; } // @api function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseClassLikeDeclaration(252 /* ClassDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses, members); + var node = createBaseClassLikeDeclaration(249 /* ClassDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses, members); if (ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } @@ -23142,7 +22353,7 @@ var ts; } // @api function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseInterfaceOrClassLikeDeclaration(253 /* InterfaceDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses); + var node = createBaseInterfaceOrClassLikeDeclaration(250 /* InterfaceDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -23160,7 +22371,7 @@ var ts; } // @api function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createBaseGenericNamedDeclaration(254 /* TypeAliasDeclaration */, decorators, modifiers, name, typeParameters); + var node = createBaseGenericNamedDeclaration(251 /* TypeAliasDeclaration */, decorators, modifiers, name, typeParameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -23177,7 +22388,7 @@ var ts; } // @api function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createBaseNamedDeclaration(255 /* EnumDeclaration */, decorators, modifiers, name); + var node = createBaseNamedDeclaration(252 /* EnumDeclaration */, decorators, modifiers, name); node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.members) | @@ -23197,7 +22408,7 @@ var ts; // @api function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createBaseDeclaration(256 /* ModuleDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(253 /* ModuleDeclaration */, decorators, modifiers); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.name = name; node.body = body; @@ -23224,7 +22435,7 @@ var ts; } // @api function createModuleBlock(statements) { - var node = createBaseNode(257 /* ModuleBlock */); + var node = createBaseNode(254 /* ModuleBlock */); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); return node; @@ -23237,7 +22448,7 @@ var ts; } // @api function createCaseBlock(clauses) { - var node = createBaseNode(258 /* CaseBlock */); + var node = createBaseNode(255 /* CaseBlock */); node.clauses = createNodeArray(clauses); node.transformFlags |= propagateChildrenFlags(node.clauses); return node; @@ -23250,7 +22461,7 @@ var ts; } // @api function createNamespaceExportDeclaration(name) { - var node = createBaseNamedDeclaration(259 /* NamespaceExportDeclaration */, + var node = createBaseNamedDeclaration(256 /* NamespaceExportDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.transformFlags = 1 /* ContainsTypeScript */; @@ -23264,7 +22475,7 @@ var ts; } // @api function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createBaseNamedDeclaration(260 /* ImportEqualsDeclaration */, decorators, modifiers, name); + var node = createBaseNamedDeclaration(257 /* ImportEqualsDeclaration */, decorators, modifiers, name); node.moduleReference = moduleReference; node.transformFlags |= propagateChildFlags(node.moduleReference); if (!ts.isExternalModuleReference(node.moduleReference)) @@ -23283,7 +22494,7 @@ var ts; } // @api function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createBaseDeclaration(261 /* ImportDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(258 /* ImportDeclaration */, decorators, modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; node.transformFlags |= @@ -23303,7 +22514,7 @@ var ts; } // @api function createImportClause(isTypeOnly, name, namedBindings) { - var node = createBaseNode(262 /* ImportClause */); + var node = createBaseNode(259 /* ImportClause */); node.isTypeOnly = isTypeOnly; node.name = name; node.namedBindings = namedBindings; @@ -23326,7 +22537,7 @@ var ts; } // @api function createNamespaceImport(name) { - var node = createBaseNode(263 /* NamespaceImport */); + var node = createBaseNode(260 /* NamespaceImport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23340,7 +22551,7 @@ var ts; } // @api function createNamespaceExport(name) { - var node = createBaseNode(269 /* NamespaceExport */); + var node = createBaseNode(266 /* NamespaceExport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name) | @@ -23356,7 +22567,7 @@ var ts; } // @api function createNamedImports(elements) { - var node = createBaseNode(264 /* NamedImports */); + var node = createBaseNode(261 /* NamedImports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23370,7 +22581,7 @@ var ts; } // @api function createImportSpecifier(propertyName, name) { - var node = createBaseNode(265 /* ImportSpecifier */); + var node = createBaseNode(262 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; node.transformFlags |= @@ -23388,7 +22599,7 @@ var ts; } // @api function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createBaseDeclaration(266 /* ExportAssignment */, decorators, modifiers); + var node = createBaseDeclaration(263 /* ExportAssignment */, decorators, modifiers); node.isExportEquals = isExportEquals; node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary(62 /* EqualsToken */, /*leftSide*/ undefined, expression) @@ -23407,7 +22618,7 @@ var ts; } // @api function createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier) { - var node = createBaseDeclaration(267 /* ExportDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(264 /* ExportDeclaration */, decorators, modifiers); node.isTypeOnly = isTypeOnly; node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; @@ -23429,7 +22640,7 @@ var ts; } // @api function createNamedExports(elements) { - var node = createBaseNode(268 /* NamedExports */); + var node = createBaseNode(265 /* NamedExports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23443,7 +22654,7 @@ var ts; } // @api function createExportSpecifier(propertyName, name) { - var node = createBaseNode(270 /* ExportSpecifier */); + var node = createBaseNode(267 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); node.transformFlags |= @@ -23461,7 +22672,7 @@ var ts; } // @api function createMissingDeclaration() { - var node = createBaseDeclaration(271 /* MissingDeclaration */, + var node = createBaseDeclaration(268 /* MissingDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined); return node; @@ -23471,7 +22682,7 @@ var ts; // // @api function createExternalModuleReference(expression) { - var node = createBaseNode(272 /* ExternalModuleReference */); + var node = createBaseNode(269 /* ExternalModuleReference */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23516,7 +22727,7 @@ var ts; } // @api function createJSDocFunctionType(parameters, type) { - var node = createBaseSignatureDeclaration(308 /* JSDocFunctionType */, + var node = createBaseSignatureDeclaration(304 /* JSDocFunctionType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, @@ -23533,7 +22744,7 @@ var ts; // @api function createJSDocTypeLiteral(propertyTags, isArrayType) { if (isArrayType === void 0) { isArrayType = false; } - var node = createBaseNode(312 /* JSDocTypeLiteral */); + var node = createBaseNode(308 /* JSDocTypeLiteral */); node.jsDocPropertyTags = asNodeArray(propertyTags); node.isArrayType = isArrayType; return node; @@ -23547,7 +22758,7 @@ var ts; } // @api function createJSDocTypeExpression(type) { - var node = createBaseNode(301 /* JSDocTypeExpression */); + var node = createBaseNode(298 /* JSDocTypeExpression */); node.type = type; return node; } @@ -23559,7 +22770,7 @@ var ts; } // @api function createJSDocSignature(typeParameters, parameters, type) { - var node = createBaseNode(313 /* JSDocSignature */); + var node = createBaseNode(309 /* JSDocSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; @@ -23588,7 +22799,7 @@ var ts; } // @api function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { - var node = createBaseJSDocTag(330 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment); + var node = createBaseJSDocTag(326 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment); node.constraint = constraint; node.typeParameters = createNodeArray(typeParameters); return node; @@ -23605,7 +22816,7 @@ var ts; } // @api function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { - var node = createBaseJSDocTag(331 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment); + var node = createBaseJSDocTag(327 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = ts.getJSDocTypeAliasName(fullName); @@ -23623,7 +22834,7 @@ var ts; } // @api function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - var node = createBaseJSDocTag(326 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment); + var node = createBaseJSDocTag(322 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -23644,7 +22855,7 @@ var ts; } // @api function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - var node = createBaseJSDocTag(333 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment); + var node = createBaseJSDocTag(328 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -23665,7 +22876,7 @@ var ts; } // @api function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { - var node = createBaseJSDocTag(324 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment); + var node = createBaseJSDocTag(320 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = ts.getJSDocTypeAliasName(fullName); @@ -23683,7 +22894,7 @@ var ts; } // @api function createJSDocAugmentsTag(tagName, className, comment) { - var node = createBaseJSDocTag(315 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment); + var node = createBaseJSDocTag(311 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment); node.class = className; return node; } @@ -23698,37 +22909,11 @@ var ts; } // @api function createJSDocImplementsTag(tagName, className, comment) { - var node = createBaseJSDocTag(316 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment); + var node = createBaseJSDocTag(312 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment); node.class = className; return node; } // @api - function createJSDocSeeTag(tagName, name, comment) { - var node = createBaseJSDocTag(332 /* JSDocSeeTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("see"), comment); - node.name = name; - return node; - } - // @api - function updateJSDocSeeTag(node, tagName, name, comment) { - return node.tagName !== tagName - || node.name !== name - || node.comment !== comment - ? update(createJSDocSeeTag(tagName, name, comment), node) - : node; - } - // @api - function createJSDocNameReference(name) { - var node = createBaseNode(302 /* JSDocNameReference */); - node.name = name; - return node; - } - // @api - function updateJSDocNameReference(node, name) { - return node.name !== name - ? update(createJSDocNameReference(name), node) - : node; - } - // @api function updateJSDocImplementsTag(node, tagName, className, comment) { if (tagName === void 0) { tagName = getDefaultTagName(node); } return node.tagName !== tagName @@ -23789,7 +22974,7 @@ var ts; } // @api function createJSDocUnknownTag(tagName, comment) { - var node = createBaseJSDocTag(314 /* JSDocTag */, tagName, comment); + var node = createBaseJSDocTag(310 /* JSDocTag */, tagName, comment); return node; } // @api @@ -23801,7 +22986,7 @@ var ts; } // @api function createJSDocComment(comment, tags) { - var node = createBaseNode(311 /* JSDocComment */); + var node = createBaseNode(307 /* JSDocComment */); node.comment = comment; node.tags = asNodeArray(tags); return node; @@ -23818,7 +23003,7 @@ var ts; // // @api function createJsxElement(openingElement, children, closingElement) { - var node = createBaseNode(273 /* JsxElement */); + var node = createBaseNode(270 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -23839,7 +23024,7 @@ var ts; } // @api function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createBaseNode(274 /* JsxSelfClosingElement */); + var node = createBaseNode(271 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -23863,7 +23048,7 @@ var ts; } // @api function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createBaseNode(275 /* JsxOpeningElement */); + var node = createBaseNode(272 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -23887,7 +23072,7 @@ var ts; } // @api function createJsxClosingElement(tagName) { - var node = createBaseNode(276 /* JsxClosingElement */); + var node = createBaseNode(273 /* JsxClosingElement */); node.tagName = tagName; node.transformFlags |= propagateChildFlags(node.tagName) | @@ -23902,7 +23087,7 @@ var ts; } // @api function createJsxFragment(openingFragment, children, closingFragment) { - var node = createBaseNode(277 /* JsxFragment */); + var node = createBaseNode(274 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -23938,19 +23123,19 @@ var ts; } // @api function createJsxOpeningFragment() { - var node = createBaseNode(278 /* JsxOpeningFragment */); + var node = createBaseNode(275 /* JsxOpeningFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } // @api function createJsxJsxClosingFragment() { - var node = createBaseNode(279 /* JsxClosingFragment */); + var node = createBaseNode(276 /* JsxClosingFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } // @api function createJsxAttribute(name, initializer) { - var node = createBaseNode(280 /* JsxAttribute */); + var node = createBaseNode(277 /* JsxAttribute */); node.name = name; node.initializer = initializer; node.transformFlags |= @@ -23968,7 +23153,7 @@ var ts; } // @api function createJsxAttributes(properties) { - var node = createBaseNode(281 /* JsxAttributes */); + var node = createBaseNode(278 /* JsxAttributes */); node.properties = createNodeArray(properties); node.transformFlags |= propagateChildrenFlags(node.properties) | @@ -23983,7 +23168,7 @@ var ts; } // @api function createJsxSpreadAttribute(expression) { - var node = createBaseNode(282 /* JsxSpreadAttribute */); + var node = createBaseNode(279 /* JsxSpreadAttribute */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | @@ -23998,7 +23183,7 @@ var ts; } // @api function createJsxExpression(dotDotDotToken, expression) { - var node = createBaseNode(283 /* JsxExpression */); + var node = createBaseNode(280 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; node.transformFlags |= @@ -24018,7 +23203,7 @@ var ts; // // @api function createCaseClause(expression, statements) { - var node = createBaseNode(284 /* CaseClause */); + var node = createBaseNode(281 /* CaseClause */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.statements = createNodeArray(statements); node.transformFlags |= @@ -24035,7 +23220,7 @@ var ts; } // @api function createDefaultClause(statements) { - var node = createBaseNode(285 /* DefaultClause */); + var node = createBaseNode(282 /* DefaultClause */); node.statements = createNodeArray(statements); node.transformFlags = propagateChildrenFlags(node.statements); return node; @@ -24048,7 +23233,7 @@ var ts; } // @api function createHeritageClause(token, types) { - var node = createBaseNode(286 /* HeritageClause */); + var node = createBaseNode(283 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); node.transformFlags |= propagateChildrenFlags(node.types); @@ -24072,7 +23257,7 @@ var ts; } // @api function createCatchClause(variableDeclaration, block) { - var node = createBaseNode(287 /* CatchClause */); + var node = createBaseNode(284 /* CatchClause */); variableDeclaration = !ts.isString(variableDeclaration) ? variableDeclaration : createVariableDeclaration(variableDeclaration, /*exclamationToken*/ undefined, /*type*/ undefined, @@ -24098,7 +23283,7 @@ var ts; // // @api function createPropertyAssignment(name, initializer) { - var node = createBaseNamedDeclaration(288 /* PropertyAssignment */, + var node = createBaseNamedDeclaration(285 /* PropertyAssignment */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); @@ -24128,7 +23313,7 @@ var ts; } // @api function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createBaseNamedDeclaration(289 /* ShorthandPropertyAssignment */, + var node = createBaseNamedDeclaration(286 /* ShorthandPropertyAssignment */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); @@ -24160,7 +23345,7 @@ var ts; } // @api function createSpreadAssignment(expression) { - var node = createBaseNode(290 /* SpreadAssignment */); + var node = createBaseNode(287 /* SpreadAssignment */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -24179,7 +23364,7 @@ var ts; // // @api function createEnumMember(name, initializer) { - var node = createBaseNode(291 /* EnumMember */); + var node = createBaseNode(288 /* EnumMember */); node.name = asName(name); node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= @@ -24200,7 +23385,7 @@ var ts; // // @api function createSourceFile(statements, endOfFileToken, flags) { - var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */); + var node = baseFactory.createBaseSourceFileNode(294 /* SourceFile */); node.statements = createNodeArray(statements); node.endOfFileToken = endOfFileToken; node.flags |= flags; @@ -24217,7 +23402,7 @@ var ts; return node; } function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) { - var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */); + var node = baseFactory.createBaseSourceFileNode(294 /* SourceFile */); for (var p in source) { if (p === "emitNode" || ts.hasProperty(node, p) || !ts.hasProperty(source, p)) continue; @@ -24255,7 +23440,7 @@ var ts; // @api function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = createBaseNode(298 /* Bundle */); + var node = createBaseNode(295 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -24270,7 +23455,7 @@ var ts; } // @api function createUnparsedSource(prologues, syntheticReferences, texts) { - var node = createBaseNode(299 /* UnparsedSource */); + var node = createBaseNode(296 /* UnparsedSource */); node.prologues = prologues; node.syntheticReferences = syntheticReferences; node.texts = texts; @@ -24288,28 +23473,28 @@ var ts; } // @api function createUnparsedPrologue(data) { - return createBaseUnparsedNode(292 /* UnparsedPrologue */, data); + return createBaseUnparsedNode(289 /* UnparsedPrologue */, data); } // @api function createUnparsedPrepend(data, texts) { - var node = createBaseUnparsedNode(293 /* UnparsedPrepend */, data); + var node = createBaseUnparsedNode(290 /* UnparsedPrepend */, data); node.texts = texts; return node; } // @api function createUnparsedTextLike(data, internal) { - return createBaseUnparsedNode(internal ? 295 /* UnparsedInternalText */ : 294 /* UnparsedText */, data); + return createBaseUnparsedNode(internal ? 292 /* UnparsedInternalText */ : 291 /* UnparsedText */, data); } // @api function createUnparsedSyntheticReference(section) { - var node = createBaseNode(296 /* UnparsedSyntheticReference */); + var node = createBaseNode(293 /* UnparsedSyntheticReference */); node.data = section.data; node.section = section; return node; } // @api function createInputFiles() { - var node = createBaseNode(300 /* InputFiles */); + var node = createBaseNode(297 /* InputFiles */); node.javascriptText = ""; node.declarationText = ""; return node; @@ -24320,7 +23505,7 @@ var ts; // @api function createSyntheticExpression(type, isSpread, tupleNameSource) { if (isSpread === void 0) { isSpread = false; } - var node = createBaseNode(227 /* SyntheticExpression */); + var node = createBaseNode(224 /* SyntheticExpression */); node.type = type; node.isSpread = isSpread; node.tupleNameSource = tupleNameSource; @@ -24328,7 +23513,7 @@ var ts; } // @api function createSyntaxList(children) { - var node = createBaseNode(334 /* SyntaxList */); + var node = createBaseNode(329 /* SyntaxList */); node._children = children; return node; } @@ -24343,7 +23528,7 @@ var ts; */ // @api function createNotEmittedStatement(original) { - var node = createBaseNode(335 /* NotEmittedStatement */); + var node = createBaseNode(330 /* NotEmittedStatement */); node.original = original; ts.setTextRange(node, original); return node; @@ -24357,7 +23542,7 @@ var ts; */ // @api function createPartiallyEmittedExpression(expression, original) { - var node = createBaseNode(336 /* PartiallyEmittedExpression */); + var node = createBaseNode(331 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; node.transformFlags |= @@ -24385,7 +23570,7 @@ var ts; } // @api function createCommaListExpression(elements) { - var node = createBaseNode(337 /* CommaListExpression */); + var node = createBaseNode(332 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; @@ -24402,7 +23587,7 @@ var ts; */ // @api function createEndOfDeclarationMarker(original) { - var node = createBaseNode(339 /* EndOfDeclarationMarker */); + var node = createBaseNode(334 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -24413,14 +23598,14 @@ var ts; */ // @api function createMergeDeclarationMarker(original) { - var node = createBaseNode(338 /* MergeDeclarationMarker */); + var node = createBaseNode(333 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } // @api function createSyntheticReferenceExpression(expression, thisArg) { - var node = createBaseNode(340 /* SyntheticReferenceExpression */); + var node = createBaseNode(335 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= @@ -24442,7 +23627,7 @@ var ts; if (node === undefined) { return node; } - var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(297 /* SourceFile */) : + var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(294 /* SourceFile */) : ts.isIdentifier(node) ? baseFactory.createBaseIdentifierNode(78 /* Identifier */) : ts.isPrivateIdentifier(node) ? baseFactory.createBasePrivateIdentifierNode(79 /* PrivateIdentifier */) : !ts.isNodeKind(node.kind) ? baseFactory.createBaseTokenNode(node.kind) : @@ -24549,11 +23734,11 @@ var ts; } function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 207 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); - case 206 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 224 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type); - case 225 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); - case 336 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); + case 204 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); + case 203 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 221 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type); + case 222 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); + case 331 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -24607,13 +23792,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -25016,23 +24201,23 @@ var ts; } function getDefaultTagNameForKind(kind) { switch (kind) { - case 329 /* JSDocTypeTag */: return "type"; - case 327 /* JSDocReturnTag */: return "returns"; - case 328 /* JSDocThisTag */: return "this"; - case 325 /* JSDocEnumTag */: return "enum"; - case 317 /* JSDocAuthorTag */: return "author"; - case 319 /* JSDocClassTag */: return "class"; - case 320 /* JSDocPublicTag */: return "public"; - case 321 /* JSDocPrivateTag */: return "private"; - case 322 /* JSDocProtectedTag */: return "protected"; - case 323 /* JSDocReadonlyTag */: return "readonly"; - case 330 /* JSDocTemplateTag */: return "template"; - case 331 /* JSDocTypedefTag */: return "typedef"; - case 326 /* JSDocParameterTag */: return "param"; - case 333 /* JSDocPropertyTag */: return "prop"; - case 324 /* JSDocCallbackTag */: return "callback"; - case 315 /* JSDocAugmentsTag */: return "augments"; - case 316 /* JSDocImplementsTag */: return "implements"; + case 325 /* JSDocTypeTag */: return "type"; + case 323 /* JSDocReturnTag */: return "returns"; + case 324 /* JSDocThisTag */: return "this"; + case 321 /* JSDocEnumTag */: return "enum"; + case 313 /* JSDocAuthorTag */: return "author"; + case 315 /* JSDocClassTag */: return "class"; + case 316 /* JSDocPublicTag */: return "public"; + case 317 /* JSDocPrivateTag */: return "private"; + case 318 /* JSDocProtectedTag */: return "protected"; + case 319 /* JSDocReadonlyTag */: return "readonly"; + case 326 /* JSDocTemplateTag */: return "template"; + case 327 /* JSDocTypedefTag */: return "typedef"; + case 322 /* JSDocParameterTag */: return "param"; + case 328 /* JSDocPropertyTag */: return "prop"; + case 320 /* JSDocCallbackTag */: return "callback"; + case 311 /* JSDocAugmentsTag */: return "augments"; + case 312 /* JSDocImplementsTag */: return "implements"; default: return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind)); } @@ -25112,69 +24297,69 @@ var ts; */ /* @internal */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */) { + if (kind >= 171 /* FirstTypeNode */ && kind <= 192 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 199 /* ArrayLiteralExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 196 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return 546379776 /* ModuleExcludes */; - case 160 /* Parameter */: + case 159 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return 547309568 /* ArrowFunctionExcludes */; - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: return 547313664 /* FunctionExcludes */; - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 166 /* Constructor */: + case 165 /* Constructor */: return 547311616 /* ConstructorExcludes */; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return 536875008 /* PropertyExcludes */; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 128 /* AnyKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 141 /* NeverKeyword */: - case 147 /* StringKeyword */: - case 145 /* ObjectKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 140 /* NeverKeyword */: + case 146 /* StringKeyword */: + case 144 /* ObjectKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: case 113 /* VoidKeyword */: - case 159 /* TypeParameter */: - case 162 /* PropertySignature */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 158 /* TypeParameter */: + case 161 /* PropertySignature */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 287 /* CatchClause */: + case 284 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: - case 336 /* PartiallyEmittedExpression */: - case 207 /* ParenthesizedExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: + case 331 /* PartiallyEmittedExpression */: + case 204 /* ParenthesizedExpression */: case 105 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -25473,7 +24658,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = (_a = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node)))) !== null && _a !== void 0 ? _a : ts.Debug.fail("Could not determine parsed source file."); @@ -26330,11 +25515,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 157 /* QualifiedName */; + return node.kind === 156 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 158 /* ComputedPropertyName */; + return node.kind === 157 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -26369,580 +25554,572 @@ var ts; ts.isExclamationToken = isExclamationToken; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 159 /* TypeParameter */; + return node.kind === 158 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; // TODO(rbuckton): Rename to 'isParameterDeclaration' function isParameter(node) { - return node.kind === 160 /* Parameter */; + return node.kind === 159 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 161 /* Decorator */; + return node.kind === 160 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 162 /* PropertySignature */; + return node.kind === 161 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 163 /* PropertyDeclaration */; + return node.kind === 162 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 164 /* MethodSignature */; + return node.kind === 163 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 165 /* MethodDeclaration */; + return node.kind === 164 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 166 /* Constructor */; + return node.kind === 165 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 167 /* GetAccessor */; + return node.kind === 166 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 168 /* SetAccessor */; + return node.kind === 167 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 169 /* CallSignature */; + return node.kind === 168 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 170 /* ConstructSignature */; + return node.kind === 169 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 171 /* IndexSignature */; + return node.kind === 170 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 172 /* TypePredicate */; + return node.kind === 171 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 173 /* TypeReference */; + return node.kind === 172 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 174 /* FunctionType */; + return node.kind === 173 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 175 /* ConstructorType */; + return node.kind === 174 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 176 /* TypeQuery */; + return node.kind === 175 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 177 /* TypeLiteral */; + return node.kind === 176 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 178 /* ArrayType */; + return node.kind === 177 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 179 /* TupleType */; + return node.kind === 178 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isNamedTupleMember(node) { - return node.kind === 192 /* NamedTupleMember */; + return node.kind === 191 /* NamedTupleMember */; } ts.isNamedTupleMember = isNamedTupleMember; function isOptionalTypeNode(node) { - return node.kind === 180 /* OptionalType */; + return node.kind === 179 /* OptionalType */; } ts.isOptionalTypeNode = isOptionalTypeNode; function isRestTypeNode(node) { - return node.kind === 181 /* RestType */; + return node.kind === 180 /* RestType */; } ts.isRestTypeNode = isRestTypeNode; function isUnionTypeNode(node) { - return node.kind === 182 /* UnionType */; + return node.kind === 181 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 183 /* IntersectionType */; + return node.kind === 182 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 184 /* ConditionalType */; + return node.kind === 183 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 185 /* InferType */; + return node.kind === 184 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 186 /* ParenthesizedType */; + return node.kind === 185 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 187 /* ThisType */; + return node.kind === 186 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 188 /* TypeOperator */; + return node.kind === 187 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 189 /* IndexedAccessType */; + return node.kind === 188 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 190 /* MappedType */; + return node.kind === 189 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 191 /* LiteralType */; + return node.kind === 190 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 195 /* ImportType */; + return node.kind === 192 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; - function isTemplateLiteralTypeSpan(node) { - return node.kind === 194 /* TemplateLiteralTypeSpan */; - } - ts.isTemplateLiteralTypeSpan = isTemplateLiteralTypeSpan; - function isTemplateLiteralTypeNode(node) { - return node.kind === 193 /* TemplateLiteralType */; - } - ts.isTemplateLiteralTypeNode = isTemplateLiteralTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 196 /* ObjectBindingPattern */; + return node.kind === 193 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 197 /* ArrayBindingPattern */; + return node.kind === 194 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 198 /* BindingElement */; + return node.kind === 195 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 199 /* ArrayLiteralExpression */; + return node.kind === 196 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 200 /* ObjectLiteralExpression */; + return node.kind === 197 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 201 /* PropertyAccessExpression */; + return node.kind === 198 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 202 /* ElementAccessExpression */; + return node.kind === 199 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 203 /* CallExpression */; + return node.kind === 200 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 204 /* NewExpression */; + return node.kind === 201 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 205 /* TaggedTemplateExpression */; + return node.kind === 202 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertionExpression(node) { - return node.kind === 206 /* TypeAssertionExpression */; + return node.kind === 203 /* TypeAssertionExpression */; } ts.isTypeAssertionExpression = isTypeAssertionExpression; function isParenthesizedExpression(node) { - return node.kind === 207 /* ParenthesizedExpression */; + return node.kind === 204 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function isFunctionExpression(node) { - return node.kind === 208 /* FunctionExpression */; + return node.kind === 205 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 209 /* ArrowFunction */; + return node.kind === 206 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 210 /* DeleteExpression */; + return node.kind === 207 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 211 /* TypeOfExpression */; + return node.kind === 208 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 212 /* VoidExpression */; + return node.kind === 209 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 213 /* AwaitExpression */; + return node.kind === 210 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 214 /* PrefixUnaryExpression */; + return node.kind === 211 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 215 /* PostfixUnaryExpression */; + return node.kind === 212 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 216 /* BinaryExpression */; + return node.kind === 213 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 217 /* ConditionalExpression */; + return node.kind === 214 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 218 /* TemplateExpression */; + return node.kind === 215 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 219 /* YieldExpression */; + return node.kind === 216 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 220 /* SpreadElement */; + return node.kind === 217 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 221 /* ClassExpression */; + return node.kind === 218 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 222 /* OmittedExpression */; + return node.kind === 219 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 223 /* ExpressionWithTypeArguments */; + return node.kind === 220 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 224 /* AsExpression */; + return node.kind === 221 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 225 /* NonNullExpression */; + return node.kind === 222 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 226 /* MetaProperty */; + return node.kind === 223 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; function isSyntheticExpression(node) { - return node.kind === 227 /* SyntheticExpression */; + return node.kind === 224 /* SyntheticExpression */; } ts.isSyntheticExpression = isSyntheticExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 336 /* PartiallyEmittedExpression */; + return node.kind === 331 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isCommaListExpression(node) { - return node.kind === 337 /* CommaListExpression */; + return node.kind === 332 /* CommaListExpression */; } ts.isCommaListExpression = isCommaListExpression; // Misc function isTemplateSpan(node) { - return node.kind === 228 /* TemplateSpan */; + return node.kind === 225 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 229 /* SemicolonClassElement */; + return node.kind === 226 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Elements function isBlock(node) { - return node.kind === 230 /* Block */; + return node.kind === 227 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 232 /* VariableStatement */; + return node.kind === 229 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 231 /* EmptyStatement */; + return node.kind === 228 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 233 /* ExpressionStatement */; + return node.kind === 230 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 234 /* IfStatement */; + return node.kind === 231 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 235 /* DoStatement */; + return node.kind === 232 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 236 /* WhileStatement */; + return node.kind === 233 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 237 /* ForStatement */; + return node.kind === 234 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 238 /* ForInStatement */; + return node.kind === 235 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 239 /* ForOfStatement */; + return node.kind === 236 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 240 /* ContinueStatement */; + return node.kind === 237 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 241 /* BreakStatement */; + return node.kind === 238 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isReturnStatement(node) { - return node.kind === 242 /* ReturnStatement */; + return node.kind === 239 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 243 /* WithStatement */; + return node.kind === 240 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 244 /* SwitchStatement */; + return node.kind === 241 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 245 /* LabeledStatement */; + return node.kind === 242 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 246 /* ThrowStatement */; + return node.kind === 243 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 247 /* TryStatement */; + return node.kind === 244 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 248 /* DebuggerStatement */; + return node.kind === 245 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 249 /* VariableDeclaration */; + return node.kind === 246 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 250 /* VariableDeclarationList */; + return node.kind === 247 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 251 /* FunctionDeclaration */; + return node.kind === 248 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 252 /* ClassDeclaration */; + return node.kind === 249 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 253 /* InterfaceDeclaration */; + return node.kind === 250 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 254 /* TypeAliasDeclaration */; + return node.kind === 251 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 255 /* EnumDeclaration */; + return node.kind === 252 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */; + return node.kind === 253 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 257 /* ModuleBlock */; + return node.kind === 254 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 258 /* CaseBlock */; + return node.kind === 255 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 259 /* NamespaceExportDeclaration */; + return node.kind === 256 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */; + return node.kind === 257 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 261 /* ImportDeclaration */; + return node.kind === 258 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 262 /* ImportClause */; + return node.kind === 259 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 263 /* NamespaceImport */; + return node.kind === 260 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 269 /* NamespaceExport */; + return node.kind === 266 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedImports(node) { - return node.kind === 264 /* NamedImports */; + return node.kind === 261 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 265 /* ImportSpecifier */; + return node.kind === 262 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 266 /* ExportAssignment */; + return node.kind === 263 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 267 /* ExportDeclaration */; + return node.kind === 264 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 268 /* NamedExports */; + return node.kind === 265 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 270 /* ExportSpecifier */; + return node.kind === 267 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 271 /* MissingDeclaration */; + return node.kind === 268 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; function isNotEmittedStatement(node) { - return node.kind === 335 /* NotEmittedStatement */; + return node.kind === 330 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 340 /* SyntheticReferenceExpression */; + return node.kind === 335 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ function isMergeDeclarationMarker(node) { - return node.kind === 338 /* MergeDeclarationMarker */; + return node.kind === 333 /* MergeDeclarationMarker */; } ts.isMergeDeclarationMarker = isMergeDeclarationMarker; /* @internal */ function isEndOfDeclarationMarker(node) { - return node.kind === 339 /* EndOfDeclarationMarker */; + return node.kind === 334 /* EndOfDeclarationMarker */; } ts.isEndOfDeclarationMarker = isEndOfDeclarationMarker; // Module References function isExternalModuleReference(node) { - return node.kind === 272 /* ExternalModuleReference */; + return node.kind === 269 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 273 /* JsxElement */; + return node.kind === 270 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 274 /* JsxSelfClosingElement */; + return node.kind === 271 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 275 /* JsxOpeningElement */; + return node.kind === 272 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 276 /* JsxClosingElement */; + return node.kind === 273 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 277 /* JsxFragment */; + return node.kind === 274 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 278 /* JsxOpeningFragment */; + return node.kind === 275 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 279 /* JsxClosingFragment */; + return node.kind === 276 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 280 /* JsxAttribute */; + return node.kind === 277 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 281 /* JsxAttributes */; + return node.kind === 278 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 282 /* JsxSpreadAttribute */; + return node.kind === 279 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 283 /* JsxExpression */; + return node.kind === 280 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 284 /* CaseClause */; + return node.kind === 281 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 285 /* DefaultClause */; + return node.kind === 282 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 286 /* HeritageClause */; + return node.kind === 283 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 287 /* CatchClause */; + return node.kind === 284 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 288 /* PropertyAssignment */; + return node.kind === 285 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 289 /* ShorthandPropertyAssignment */; + return node.kind === 286 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 290 /* SpreadAssignment */; + return node.kind === 287 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 291 /* EnumMember */; + return node.kind === 288 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Unparsed // TODO(rbuckton): isUnparsedPrologue function isUnparsedPrepend(node) { - return node.kind === 293 /* UnparsedPrepend */; + return node.kind === 290 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; // TODO(rbuckton): isUnparsedText @@ -26950,152 +26127,148 @@ var ts; // TODO(rbuckton): isUnparsedSyntheticReference // Top-level nodes function isSourceFile(node) { - return node.kind === 297 /* SourceFile */; + return node.kind === 294 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 298 /* Bundle */; + return node.kind === 295 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 299 /* UnparsedSource */; + return node.kind === 296 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; // TODO(rbuckton): isInputFiles // JSDoc Elements function isJSDocTypeExpression(node) { - return node.kind === 301 /* JSDocTypeExpression */; + return node.kind === 298 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; - function isJSDocNameReference(node) { - return node.kind === 302 /* JSDocNameReference */; - } - ts.isJSDocNameReference = isJSDocNameReference; function isJSDocAllType(node) { - return node.kind === 303 /* JSDocAllType */; + return node.kind === 299 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 304 /* JSDocUnknownType */; + return node.kind === 300 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 305 /* JSDocNullableType */; + return node.kind === 301 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 306 /* JSDocNonNullableType */; + return node.kind === 302 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 307 /* JSDocOptionalType */; + return node.kind === 303 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 308 /* JSDocFunctionType */; + return node.kind === 304 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 309 /* JSDocVariadicType */; + return node.kind === 305 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDocNamepathType(node) { - return node.kind === 310 /* JSDocNamepathType */; + return node.kind === 306 /* JSDocNamepathType */; } ts.isJSDocNamepathType = isJSDocNamepathType; function isJSDoc(node) { - return node.kind === 311 /* JSDocComment */; + return node.kind === 307 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocTypeLiteral(node) { - return node.kind === 312 /* JSDocTypeLiteral */; + return node.kind === 308 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocSignature(node) { - return node.kind === 313 /* JSDocSignature */; + return node.kind === 309 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // JSDoc Tags function isJSDocAugmentsTag(node) { - return node.kind === 315 /* JSDocAugmentsTag */; + return node.kind === 311 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocAuthorTag(node) { - return node.kind === 317 /* JSDocAuthorTag */; + return node.kind === 313 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocClassTag(node) { - return node.kind === 319 /* JSDocClassTag */; + return node.kind === 315 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocCallbackTag(node) { - return node.kind === 324 /* JSDocCallbackTag */; + return node.kind === 320 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocPublicTag(node) { - return node.kind === 320 /* JSDocPublicTag */; + return node.kind === 316 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 321 /* JSDocPrivateTag */; + return node.kind === 317 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 322 /* JSDocProtectedTag */; + return node.kind === 318 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 323 /* JSDocReadonlyTag */; + return node.kind === 319 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocDeprecatedTag(node) { - return node.kind === 318 /* JSDocDeprecatedTag */; + return node.kind === 314 /* JSDocDeprecatedTag */; } ts.isJSDocDeprecatedTag = isJSDocDeprecatedTag; function isJSDocEnumTag(node) { - return node.kind === 325 /* JSDocEnumTag */; + return node.kind === 321 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocParameterTag(node) { - return node.kind === 326 /* JSDocParameterTag */; + return node.kind === 322 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 327 /* JSDocReturnTag */; + return node.kind === 323 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocThisTag(node) { - return node.kind === 328 /* JSDocThisTag */; + return node.kind === 324 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocTypeTag(node) { - return node.kind === 329 /* JSDocTypeTag */; + return node.kind === 325 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 330 /* JSDocTemplateTag */; + return node.kind === 326 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 331 /* JSDocTypedefTag */; + return node.kind === 327 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocUnknownTag(node) { - return node.kind === 314 /* JSDocTag */; + return node.kind === 310 /* JSDocTag */; } ts.isJSDocUnknownTag = isJSDocUnknownTag; function isJSDocPropertyTag(node) { - return node.kind === 333 /* JSDocPropertyTag */; + return node.kind === 328 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocImplementsTag(node) { - return node.kind === 316 /* JSDocImplementsTag */; + return node.kind === 312 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; // Synthesized list /* @internal */ function isSyntaxList(n) { - return n.kind === 334 /* SyntaxList */; + return n.kind === 329 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; })(ts || (ts = {})); @@ -27146,13 +26319,12 @@ var ts; createJsxFactoryExpressionFromEntityName(factory, jsxFactoryEntity, parent) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), "createElement"); } - ts.createJsxFactoryExpression = createJsxFactoryExpression; function createJsxFragmentFactoryExpression(factory, jsxFragmentFactoryEntity, reactNamespace, parent) { return jsxFragmentFactoryEntity ? createJsxFactoryExpressionFromEntityName(factory, jsxFragmentFactoryEntity, parent) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), "Fragment"); } - function createExpressionForJsxElement(factory, callee, tagName, props, children, location) { + function createExpressionForJsxElement(factory, jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { var argumentsList = [tagName]; if (props) { argumentsList.push(props); @@ -27172,7 +26344,7 @@ var ts; argumentsList.push(children[0]); } } - return ts.setTextRange(factory.createCallExpression(callee, + return ts.setTextRange(factory.createCallExpression(createJsxFactoryExpression(factory, jsxFactoryEntity, reactNamespace, parentElement), /*typeArguments*/ undefined, argumentsList), location); } ts.createExpressionForJsxElement = createExpressionForJsxElement; @@ -27294,14 +26466,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return createExpressionForAccessorDeclaration(factory, node.properties, property, receiver, !!node.multiLine); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return createExpressionForPropertyAssignment(factory, property, receiver); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(factory, property, receiver); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return createExpressionForMethodDeclaration(factory, property, receiver); } } @@ -27354,21 +26526,21 @@ var ts; } ts.startsWithUseStrict = startsWithUseStrict; function isCommaSequence(node) { - return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 337 /* CommaListExpression */; + return node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 332 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 15 /* All */; } switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return (kinds & 2 /* TypeAssertions */) !== 0; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return (kinds & 4 /* NonNullAssertions */) !== 0; - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -27485,14 +26657,14 @@ var ts; */ function getLocalNameForExternalImport(factory, node, sourceFile) { var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); - if (namespaceDeclaration && !ts.isDefaultImport(node) && !ts.isExportNamespaceAsDefaultDeclaration(node)) { + if (namespaceDeclaration && !ts.isDefaultImport(node)) { var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : factory.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 261 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 258 /* ImportDeclaration */ && node.importClause) { return factory.getGeneratedNameForNode(node); } - if (node.kind === 267 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 264 /* ExportDeclaration */ && node.moduleSpecifier) { return factory.getGeneratedNameForNode(node); } return undefined; @@ -27611,7 +26783,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -27623,11 +26795,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -27659,12 +26831,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 160 /* Parameter */: - case 198 /* BindingElement */: + case 159 /* Parameter */: + case 195 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 220 /* SpreadElement */: - case 290 /* SpreadAssignment */: + case 217 /* SpreadElement */: + case 287 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -27682,7 +26854,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 198 /* BindingElement */: + case 195 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -27697,7 +26869,7 @@ var ts; : propertyName; } break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -27712,7 +26884,7 @@ var ts; : propertyName; } break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -27735,13 +26907,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -27762,29 +26934,29 @@ var ts; ts.getJSDocTypeAliasName = getJSDocTypeAliasName; function canHaveModifiers(node) { var kind = node.kind; - return kind === 160 /* Parameter */ - || kind === 162 /* PropertySignature */ - || kind === 163 /* PropertyDeclaration */ - || kind === 164 /* MethodSignature */ - || kind === 165 /* MethodDeclaration */ - || kind === 166 /* Constructor */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 171 /* IndexSignature */ - || kind === 208 /* FunctionExpression */ - || kind === 209 /* ArrowFunction */ - || kind === 221 /* ClassExpression */ - || kind === 232 /* VariableStatement */ - || kind === 251 /* FunctionDeclaration */ - || kind === 252 /* ClassDeclaration */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 255 /* EnumDeclaration */ - || kind === 256 /* ModuleDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 266 /* ExportAssignment */ - || kind === 267 /* ExportDeclaration */; + return kind === 159 /* Parameter */ + || kind === 161 /* PropertySignature */ + || kind === 162 /* PropertyDeclaration */ + || kind === 163 /* MethodSignature */ + || kind === 164 /* MethodDeclaration */ + || kind === 165 /* Constructor */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 170 /* IndexSignature */ + || kind === 205 /* FunctionExpression */ + || kind === 206 /* ArrowFunction */ + || kind === 218 /* ClassExpression */ + || kind === 229 /* VariableStatement */ + || kind === 248 /* FunctionDeclaration */ + || kind === 249 /* ClassDeclaration */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 252 /* EnumDeclaration */ + || kind === 253 /* ModuleDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 263 /* ExportAssignment */ + || kind === 264 /* ExportDeclaration */; } ts.canHaveModifiers = canHaveModifiers; /* @internal */ @@ -27883,19 +27055,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 156 /* LastToken */) { + if (!node || node.kind <= 155 /* LastToken */) { return; } switch (node.kind) { - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -27903,9 +27075,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -27913,7 +27085,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -27921,51 +27093,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -27977,374 +27149,364 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 179 /* TupleType */: + case 178 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elements); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 185 /* InferType */: + case 184 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 195 /* ImportType */: + case 192 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 186 /* ParenthesizedType */: - case 188 /* TypeOperator */: + case 185 /* ParenthesizedType */: + case 187 /* TypeOperator */: return visitNode(cbNode, node.type); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 190 /* MappedType */: + case 189 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || - visitNode(cbNode, node.nameType) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return visitNode(cbNode, node.literal); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 224 /* AsExpression */: + case 221 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return visitNode(cbNode, node.name); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 297 /* SourceFile */: + case 294 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: return visitNode(cbNode, node.label); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 284 /* CaseClause */: + case 281 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 161 /* Decorator */: + case 160 /* Decorator */: return visitNode(cbNode, node.expression); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 291 /* EnumMember */: + case 288 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 264 /* NamedImports */: - case 268 /* NamedExports */: + case 261 /* NamedImports */: + case 265 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 193 /* TemplateLiteralType */: - return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 194 /* TemplateLiteralTypeSpan */: - return visitNode(cbNode, node.type) || visitNode(cbNode, node.literal); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 180 /* OptionalType */: - case 181 /* RestType */: - case 301 /* JSDocTypeExpression */: - case 306 /* JSDocNonNullableType */: - case 305 /* JSDocNullableType */: - case 307 /* JSDocOptionalType */: - case 309 /* JSDocVariadicType */: + case 179 /* OptionalType */: + case 180 /* RestType */: + case 298 /* JSDocTypeExpression */: + case 302 /* JSDocNonNullableType */: + case 301 /* JSDocNullableType */: + case 303 /* JSDocOptionalType */: + case 305 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 311 /* JSDocComment */: + case 307 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 332 /* JSDocSeeTag */: - return visitNode(cbNode, node.tagName) || - visitNode(cbNode, node.name); - case 302 /* JSDocNameReference */: - return visitNode(cbNode, node.name); - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 317 /* JSDocAuthorTag */: + case 313 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 301 /* JSDocTypeExpression */ + node.typeExpression.kind === 298 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 324 /* JSDocCallbackTag */: + case 320 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 328 /* JSDocThisTag */: - case 325 /* JSDocEnumTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 324 /* JSDocThisTag */: + case 321 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 313 /* JSDocSignature */: + case 309 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 312 /* JSDocTypeLiteral */: + case 308 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 314 /* JSDocTag */: - case 319 /* JSDocClassTag */: - case 320 /* JSDocPublicTag */: - case 321 /* JSDocPrivateTag */: - case 322 /* JSDocProtectedTag */: - case 323 /* JSDocReadonlyTag */: + case 310 /* JSDocTag */: + case 315 /* JSDocClassTag */: + case 316 /* JSDocPublicTag */: + case 317 /* JSDocPrivateTag */: + case 318 /* JSDocProtectedTag */: + case 319 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -28419,8 +27581,6 @@ var ts; ts.forEachChildRecursively = forEachChildRecursively; function createSourceFile(fileName, sourceText, languageVersion, setParentNodes, scriptKind) { if (setParentNodes === void 0) { setParentNodes = false; } - var tracingData = ["parse" /* Parse */, "createSourceFile", { path: fileName }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeParse"); var result; ts.perfLogger.logStartParseSourceFile(fileName); @@ -28433,7 +27593,6 @@ var ts; ts.perfLogger.logStopParseSourceFile(); ts.performance.mark("afterParse"); ts.performance.measure("Parse", "beforeParse", "afterParse"); - ts.tracing.end.apply(ts.tracing, tracingData); return result; } ts.createSourceFile = createSourceFile; @@ -29294,7 +28453,7 @@ var ts; ts.isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode(kind, "", "", /*templateFlags*/ undefined) : kind === 8 /* NumericLiteral */ ? factory.createNumericLiteral("", /*numericLiteralFlags*/ undefined) : kind === 10 /* StringLiteral */ ? factory.createStringLiteral("", /*isSingleQuote*/ undefined) : - kind === 271 /* MissingDeclaration */ ? factory.createMissingDeclaration() : + kind === 268 /* MissingDeclaration */ ? factory.createMissingDeclaration() : factory.createToken(kind); return finishNode(result, pos); } @@ -29408,7 +28567,7 @@ var ts; if (token() === 87 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 149 /* TypeKeyword */) { + if (token() === 148 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); @@ -29416,7 +28575,7 @@ var ts; return nextTokenCanFollowDefaultKeyword(); case 123 /* StaticKeyword */: case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -29826,14 +28985,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 166 /* Constructor */: - case 171 /* IndexSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 229 /* SemicolonClassElement */: + case 165 /* Constructor */: + case 170 /* IndexSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 226 /* SemicolonClassElement */: return true; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -29848,8 +29007,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: return true; } } @@ -29858,58 +29017,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 232 /* VariableStatement */: - case 230 /* Block */: - case 234 /* IfStatement */: - case 233 /* ExpressionStatement */: - case 246 /* ThrowStatement */: - case 242 /* ReturnStatement */: - case 244 /* SwitchStatement */: - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 237 /* ForStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 231 /* EmptyStatement */: - case 247 /* TryStatement */: - case 245 /* LabeledStatement */: - case 235 /* DoStatement */: - case 248 /* DebuggerStatement */: - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 248 /* FunctionDeclaration */: + case 229 /* VariableStatement */: + case 227 /* Block */: + case 231 /* IfStatement */: + case 230 /* ExpressionStatement */: + case 243 /* ThrowStatement */: + case 239 /* ReturnStatement */: + case 241 /* SwitchStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 234 /* ForStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 228 /* EmptyStatement */: + case 244 /* TryStatement */: + case 242 /* LabeledStatement */: + case 232 /* DoStatement */: + case 245 /* DebuggerStatement */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 291 /* EnumMember */; + return node.kind === 288 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 162 /* PropertySignature */: - case 169 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 161 /* PropertySignature */: + case 168 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 249 /* VariableDeclaration */) { + if (node.kind !== 246 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -29930,7 +29089,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 160 /* Parameter */) { + if (node.kind !== 159 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -29939,7 +29098,7 @@ var ts; } // Returns true if we should abort parsing. function abortParsingListOrMoveToNextToken(kind) { - parsingContextErrors(kind); + parseErrorAtCurrentToken(parsingContextErrors(kind)); if (isInSomeParsingContext()) { return true; } @@ -29948,34 +29107,31 @@ var ts; } function parsingContextErrors(context) { switch (context) { - case 0 /* SourceElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); - case 1 /* BlockStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); - case 2 /* SwitchClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.case_or_default_expected); - case 3 /* SwitchClauseStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Statement_expected); + case 0 /* SourceElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 1 /* BlockStatements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 2 /* SwitchClauses */: return ts.Diagnostics.case_or_default_expected; + case 3 /* SwitchClauseStatements */: return ts.Diagnostics.Statement_expected; case 18 /* RestProperties */: // fallthrough - case 4 /* TypeMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_or_signature_expected); - case 5 /* ClassMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); - case 6 /* EnumMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Enum_member_expected); - case 7 /* HeritageClauseElement */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_expected); - case 8 /* VariableDeclarations */: - return ts.isKeyword(token()) - ? parseErrorAtCurrentToken(ts.Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, ts.tokenToString(token())) - : parseErrorAtCurrentToken(ts.Diagnostics.Variable_declaration_expected); - case 9 /* ObjectBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_destructuring_pattern_expected); - case 10 /* ArrayBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Array_element_destructuring_pattern_expected); - case 11 /* ArgumentExpressions */: return parseErrorAtCurrentToken(ts.Diagnostics.Argument_expression_expected); - case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_assignment_expected); - case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_or_comma_expected); - case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); - case 16 /* Parameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); - case 19 /* TypeParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_parameter_declaration_expected); - case 20 /* TypeArguments */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_argument_expected); - case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_expected); - case 22 /* HeritageClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_expected); - case 23 /* ImportOrExportSpecifiers */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - case 13 /* JsxAttributes */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - case 14 /* JsxChildren */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - default: return [undefined]; // TODO: GH#18217 `default: Debug.assertNever(context);` + case 4 /* TypeMembers */: return ts.Diagnostics.Property_or_signature_expected; + case 5 /* ClassMembers */: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 6 /* EnumMembers */: return ts.Diagnostics.Enum_member_expected; + case 7 /* HeritageClauseElement */: return ts.Diagnostics.Expression_expected; + case 8 /* VariableDeclarations */: return ts.Diagnostics.Variable_declaration_expected; + case 9 /* ObjectBindingElements */: return ts.Diagnostics.Property_destructuring_pattern_expected; + case 10 /* ArrayBindingElements */: return ts.Diagnostics.Array_element_destructuring_pattern_expected; + case 11 /* ArgumentExpressions */: return ts.Diagnostics.Argument_expression_expected; + case 12 /* ObjectLiteralMembers */: return ts.Diagnostics.Property_assignment_expected; + case 15 /* ArrayLiteralMembers */: return ts.Diagnostics.Expression_or_comma_expected; + case 17 /* JSDocParameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 16 /* Parameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 19 /* TypeParameters */: return ts.Diagnostics.Type_parameter_declaration_expected; + case 20 /* TypeArguments */: return ts.Diagnostics.Type_argument_expected; + case 21 /* TupleElementTypes */: return ts.Diagnostics.Type_expected; + case 22 /* HeritageClauses */: return ts.Diagnostics.Unexpected_token_expected; + case 23 /* ImportOrExportSpecifiers */: return ts.Diagnostics.Identifier_expected; + case 13 /* JsxAttributes */: return ts.Diagnostics.Identifier_expected; + case 14 /* JsxChildren */: return ts.Diagnostics.Identifier_expected; + default: return undefined; // TODO: GH#18217 `default: Debug.assertNever(context);` } } // Parses a comma-delimited list of elements @@ -30120,24 +29276,6 @@ var ts; var pos = getNodePos(); return finishNode(factory.createTemplateExpression(parseTemplateHead(isTaggedTemplate), parseTemplateSpans(isTaggedTemplate)), pos); } - function parseTemplateType() { - var pos = getNodePos(); - return finishNode(factory.createTemplateLiteralType(parseTemplateHead(/*isTaggedTemplate*/ false), parseTemplateTypeSpans()), pos); - } - function parseTemplateTypeSpans() { - var pos = getNodePos(); - var list = []; - var node; - do { - node = parseTemplateTypeSpan(); - list.push(node); - } while (node.literal.kind === 16 /* TemplateMiddle */); - return createNodeArray(list, pos); - } - function parseTemplateTypeSpan() { - var pos = getNodePos(); - return finishNode(factory.createTemplateLiteralTypeSpan(parseType(), parseLiteralOfTemplateSpan(/*isTaggedTemplate*/ false)), pos); - } function parseLiteralOfTemplateSpan(isTaggedTemplate) { if (token() === 19 /* CloseBraceToken */) { reScanTemplateToken(isTaggedTemplate); @@ -30211,14 +29349,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: { + case 173 /* FunctionType */: + case 174 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -30298,7 +29436,7 @@ var ts; function parseJSDocType() { scanner.setInJSDocType(true); var pos = getNodePos(); - if (parseOptional(139 /* ModuleKeyword */)) { + if (parseOptional(138 /* ModuleKeyword */)) { // TODO(rbuckton): We never set the type for a JSDocNamepathType. What should we put here? var moduleTag = factory.createJSDocNamepathType(/*type*/ undefined); terminate: while (true) { @@ -30498,14 +29636,14 @@ var ts; function parseSignatureMember(kind) { var pos = getNodePos(); var hasJSDoc = hasPrecedingJSDocComment(); - if (kind === 170 /* ConstructSignature */) { + if (kind === 169 /* ConstructSignature */) { parseExpected(102 /* NewKeyword */); } var typeParameters = parseTypeParameters(); var parameters = parseParameters(4 /* Type */); var type = parseReturnType(58 /* ColonToken */, /*isType*/ true); parseTypeMemberSemicolon(); - var node = kind === 169 /* CallSignature */ + var node = kind === 168 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, type) : factory.createConstructSignature(typeParameters, parameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -30628,10 +29766,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(169 /* CallSignature */); + return parseSignatureMember(168 /* CallSignature */); } if (token() === 102 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(170 /* ConstructSignature */); + return parseSignatureMember(169 /* ConstructSignature */); } var pos = getNodePos(); var hasJSDoc = hasPrecedingJSDocComment(); @@ -30675,9 +29813,9 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 142 /* ReadonlyKeyword */; + return nextToken() === 141 /* ReadonlyKeyword */; } - if (token() === 142 /* ReadonlyKeyword */) { + if (token() === 141 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 100 /* InKeyword */; @@ -30693,15 +29831,14 @@ var ts; var pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); var readonlyToken; - if (token() === 142 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 141 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { readonlyToken = parseTokenNode(); - if (readonlyToken.kind !== 142 /* ReadonlyKeyword */) { - parseExpected(142 /* ReadonlyKeyword */); + if (readonlyToken.kind !== 141 /* ReadonlyKeyword */) { + parseExpected(141 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); var typeParameter = parseMappedTypeParameter(); - var nameType = parseOptional(126 /* AsKeyword */) ? parseType() : undefined; parseExpected(23 /* CloseBracketToken */); var questionToken; if (token() === 57 /* QuestionToken */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { @@ -30713,7 +29850,7 @@ var ts; var type = parseTypeAnnotation(); parseSemicolon(); parseExpected(19 /* CloseBraceToken */); - return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), pos); + return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), pos); } function parseTupleElementType() { var pos = getNodePos(); @@ -30815,15 +29952,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 148 /* SymbolKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 147 /* SymbolKeyword */: case 131 /* BooleanKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: - case 145 /* ObjectKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: + case 144 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 65 /* AsteriskEqualsToken */: @@ -30856,7 +29993,7 @@ var ts; return parseTokenNode(); case 107 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 136 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -30875,8 +30012,6 @@ var ts; return parseImportType(); case 127 /* AssertsKeyword */: return lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine) ? parseAssertsTypePredicate() : parseTypeReference(); - case 15 /* TemplateHead */: - return parseTemplateType(); default: return parseTypeReference(); } @@ -30884,20 +30019,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: - case 142 /* ReadonlyKeyword */: - case 148 /* SymbolKeyword */: - case 151 /* UniqueKeyword */: + case 141 /* ReadonlyKeyword */: + case 147 /* SymbolKeyword */: + case 150 /* UniqueKeyword */: case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: case 103 /* NullKeyword */: case 107 /* ThisKeyword */: case 111 /* TypeOfKeyword */: - case 141 /* NeverKeyword */: + case 140 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -30909,7 +30044,7 @@ var ts; case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: @@ -30917,8 +30052,6 @@ var ts; case 135 /* InferKeyword */: case 99 /* ImportKeyword */: case 127 /* AssertsKeyword */: - case 14 /* NoSubstitutionTemplateLiteral */: - case 15 /* TemplateHead */: return true; case 97 /* FunctionKeyword */: return !inStartOfParameter; @@ -30990,9 +30123,9 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 138 /* KeyOfKeyword */: - case 151 /* UniqueKeyword */: - case 142 /* ReadonlyKeyword */: + case 137 /* KeyOfKeyword */: + case 150 /* UniqueKeyword */: + case 141 /* ReadonlyKeyword */: return parseTypeOperator(operator); case 135 /* InferKeyword */: return parseInferType(); @@ -31109,7 +30242,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 136 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -31118,7 +30251,7 @@ var ts; var pos = getNodePos(); var assertsModifier = parseExpectedToken(127 /* AssertsKeyword */); var parameterName = token() === 107 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - var type = parseOptional(137 /* IsKeyword */) ? parseType() : undefined; + var type = parseOptional(136 /* IsKeyword */) ? parseType() : undefined; return finishNode(factory.createTypePredicateNode(assertsModifier, parameterName, type), pos); } function parseType() { @@ -31650,7 +30783,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand, pos); } function isInOrOfKeyword(t) { - return t === 100 /* InKeyword */ || t === 156 /* OfKeyword */; + return t === 100 /* InKeyword */ || t === 155 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand, pos) { while (true) { @@ -31790,7 +30923,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 206 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 203 /* TypeAssertionExpression */) { parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -32041,7 +31174,7 @@ var ts; var pos = getNodePos(); var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 275 /* JsxOpeningElement */) { + if (opening.kind === 272 /* JsxOpeningElement */) { var children = parseJsxChildren(opening); var closingElement = parseJsxClosingElement(inExpressionContext); if (!tagNamesAreEquivalent(opening.tagName, closingElement.tagName)) { @@ -32049,11 +31182,11 @@ var ts; } result = finishNode(factory.createJsxElement(opening, children, closingElement), pos); } - else if (opening.kind === 278 /* JsxOpeningFragment */) { + else if (opening.kind === 275 /* JsxOpeningFragment */) { result = finishNode(factory.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos); } else { - ts.Debug.assert(opening.kind === 274 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 271 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -32548,10 +31681,10 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(); if (parseContextualModifier(134 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */); + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 166 /* GetAccessor */); } - if (parseContextualModifier(146 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */); + if (parseContextualModifier(145 /* SetKeyword */)) { + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -32762,7 +31895,7 @@ var ts; } } var node; - if (awaitToken ? parseExpected(156 /* OfKeyword */) : parseOptional(156 /* OfKeyword */)) { + if (awaitToken ? parseExpected(155 /* OfKeyword */) : parseOptional(155 /* OfKeyword */)) { var expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(21 /* CloseParenToken */); node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement()); @@ -32788,10 +31921,10 @@ var ts; } function parseBreakOrContinueStatement(kind) { var pos = getNodePos(); - parseExpected(kind === 241 /* BreakStatement */ ? 80 /* BreakKeyword */ : 85 /* ContinueKeyword */); + parseExpected(kind === 238 /* BreakStatement */ ? 80 /* BreakKeyword */ : 85 /* ContinueKeyword */); var label = canParseSemicolon() ? undefined : parseIdentifier(); parseSemicolon(); - var node = kind === 241 /* BreakStatement */ + var node = kind === 238 /* BreakStatement */ ? factory.createBreakStatement(label) : factory.createContinueStatement(label); return finishNode(node, pos); @@ -32970,10 +32103,10 @@ var ts; // // could be legal, it would add complexity for very little gain. case 117 /* InterfaceKeyword */: - case 149 /* TypeKeyword */: + case 148 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 125 /* AbstractKeyword */: case 129 /* AsyncKeyword */: @@ -32981,14 +32114,14 @@ var ts; case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 122 /* PublicKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 154 /* GlobalKeyword */: + case 153 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 78 /* Identifier */ || token() === 92 /* ExportKeyword */; case 99 /* ImportKeyword */: @@ -32997,7 +32130,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 92 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 149 /* TypeKeyword */) { + if (currentToken_1 === 148 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -33053,17 +32186,17 @@ var ts; case 129 /* AsyncKeyword */: case 133 /* DeclareKeyword */: case 117 /* InterfaceKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: - case 149 /* TypeKeyword */: - case 154 /* GlobalKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: + case 148 /* TypeKeyword */: + case 153 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 123 /* StaticKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -33106,9 +32239,9 @@ var ts; case 96 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 85 /* ContinueKeyword */: - return parseBreakOrContinueStatement(240 /* ContinueStatement */); + return parseBreakOrContinueStatement(237 /* ContinueStatement */); case 80 /* BreakKeyword */: - return parseBreakOrContinueStatement(241 /* BreakStatement */); + return parseBreakOrContinueStatement(238 /* BreakStatement */); case 104 /* ReturnKeyword */: return parseReturnStatement(); case 115 /* WithKeyword */: @@ -33129,9 +32262,9 @@ var ts; return parseDeclaration(); case 129 /* AsyncKeyword */: case 117 /* InterfaceKeyword */: - case 149 /* TypeKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 148 /* TypeKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: case 133 /* DeclareKeyword */: case 84 /* ConstKeyword */: case 91 /* EnumKeyword */: @@ -33142,8 +32275,8 @@ var ts; case 122 /* PublicKeyword */: case 125 /* AbstractKeyword */: case 123 /* StaticKeyword */: - case 142 /* ReadonlyKeyword */: - case 154 /* GlobalKeyword */: + case 141 /* ReadonlyKeyword */: + case 153 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -33203,13 +32336,13 @@ var ts; return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers); case 117 /* InterfaceKeyword */: return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers); - case 149 /* TypeKeyword */: + case 148 /* TypeKeyword */: return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers); case 91 /* EnumKeyword */: return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers); - case 154 /* GlobalKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 153 /* GlobalKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers); case 99 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers); @@ -33228,7 +32361,7 @@ var ts; if (decorators || modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(271 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(268 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); ts.setTextRangePos(missing, pos); missing.decorators = decorators; missing.modifiers = modifiers; @@ -33347,7 +32480,7 @@ var ts; // this context. // The checker will then give an error that there is an empty declaration list. var declarations; - if (token() === 156 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 155 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { declarations = createMissingList(); } else { @@ -33451,12 +32584,12 @@ var ts; var parameters = parseParameters(0 /* None */); var type = parseReturnType(58 /* ColonToken */, /*isType*/ false); var body = parseFunctionBlockOrSemicolon(0 /* None */); - var node = kind === 167 /* GetAccessor */ + var node = kind === 166 /* GetAccessor */ ? factory.createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) : factory.createSetAccessorDeclaration(decorators, modifiers, name, parameters, body); // Keep track of `typeParameters` (for both) and `type` (for setters) if they were parsed those indicate grammar errors node.typeParameters = typeParameters; - if (type && node.kind === 168 /* SetAccessor */) + if (type && node.kind === 167 /* SetAccessor */) node.type = type; return withJSDoc(finishNode(node, pos), hasJSDoc); } @@ -33495,7 +32628,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 146 /* SetKeyword */ || idToken === 134 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 145 /* SetKeyword */ || idToken === 134 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -33599,10 +32732,10 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); if (parseContextualModifier(134 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */); + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 166 /* GetAccessor */); } - if (parseContextualModifier(146 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */); + if (parseContextualModifier(145 /* SetKeyword */)) { + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* SetAccessor */); } if (token() === 132 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers); @@ -33641,10 +32774,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, 221 /* ClassExpression */); + return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, 218 /* ClassExpression */); } function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 252 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 249 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) { var savedAwaitContext = inAwaitContext(); @@ -33666,7 +32799,7 @@ var ts; members = createMissingList(); } setAwaitContext(savedAwaitContext); - var node = kind === 252 /* ClassDeclaration */ + var node = kind === 249 /* ClassDeclaration */ ? factory.createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) : factory.createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -33726,11 +32859,11 @@ var ts; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) { - parseExpected(149 /* TypeKeyword */); + parseExpected(148 /* TypeKeyword */); var name = parseIdentifier(); var typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); - var type = token() === 136 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType(); + var type = parseType(); parseSemicolon(); var node = factory.createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -33786,7 +32919,7 @@ var ts; function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { var flags = 0; var name; - if (token() === 154 /* GlobalKeyword */) { + if (token() === 153 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation name = parseIdentifier(); flags |= 1024 /* GlobalAugmentation */; @@ -33807,15 +32940,15 @@ var ts; } function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { var flags = 0; - if (token() === 154 /* GlobalKeyword */) { + if (token() === 153 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); } - else if (parseOptional(140 /* NamespaceKeyword */)) { + else if (parseOptional(139 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(139 /* ModuleKeyword */); + parseExpected(138 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); } @@ -33823,7 +32956,7 @@ var ts; return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags); } function isExternalModuleReference() { - return token() === 143 /* RequireKeyword */ && + return token() === 142 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -33834,7 +32967,7 @@ var ts; } function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) { parseExpected(126 /* AsKeyword */); - parseExpected(140 /* NamespaceKeyword */); + parseExpected(139 /* NamespaceKeyword */); var name = parseIdentifier(); parseSemicolon(); var node = factory.createNamespaceExportDeclaration(name); @@ -33852,7 +32985,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 153 /* FromKeyword */ && + if (token() !== 152 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -33870,7 +33003,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(153 /* FromKeyword */); + parseExpected(152 /* FromKeyword */); } var moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -33883,7 +33016,7 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 153 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 152 /* FromKeyword */; } function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) { parseExpected(62 /* EqualsToken */); @@ -33908,7 +33041,7 @@ var ts; var namedBindings; if (!identifier || parseOptional(27 /* CommaToken */)) { - namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(264 /* NamedImports */); + namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(261 /* NamedImports */); } return finishNode(factory.createImportClause(isTypeOnly, identifier, namedBindings), pos); } @@ -33919,7 +33052,7 @@ var ts; } function parseExternalModuleReference() { var pos = getNodePos(); - parseExpected(143 /* RequireKeyword */); + parseExpected(142 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); var expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -33956,16 +33089,16 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - var node = kind === 264 /* NamedImports */ + var node = kind === 261 /* NamedImports */ ? factory.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); return finishNode(node, pos); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(270 /* ExportSpecifier */); + return parseImportOrExportSpecifier(267 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(265 /* ImportSpecifier */); + return parseImportOrExportSpecifier(262 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var pos = getNodePos(); @@ -33992,38 +33125,38 @@ var ts; else { name = identifierName; } - if (kind === 265 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 262 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } - var node = kind === 265 /* ImportSpecifier */ + var node = kind === 262 /* ImportSpecifier */ ? factory.createImportSpecifier(propertyName, name) : factory.createExportSpecifier(propertyName, name); return finishNode(node, pos); } function parseNamespaceExport(pos) { - return finishNode(factory.createNamespaceExport(parseIdentifierName()), pos); + return finishNode(factory.createNamespaceExport(parseIdentifier()), pos); } function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) { var savedAwaitContext = inAwaitContext(); setAwaitContext(/*value*/ true); var exportClause; var moduleSpecifier; - var isTypeOnly = parseOptional(149 /* TypeKeyword */); + var isTypeOnly = parseOptional(148 /* TypeKeyword */); var namespaceExportPos = getNodePos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(126 /* AsKeyword */)) { exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(153 /* FromKeyword */); + parseExpected(152 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } else { - exportClause = parseNamedImportsOrExports(268 /* NamedExports */); + exportClause = parseNamedImportsOrExports(265 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 153 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(153 /* FromKeyword */); + if (token() === 152 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(152 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } } @@ -34140,18 +33273,6 @@ var ts; return finishNode(result, pos); } JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression; - function parseJSDocNameReference() { - var pos = getNodePos(); - var hasBrace = parseOptional(18 /* OpenBraceToken */); - var entityName = parseEntityName(/* allowReservedWords*/ false); - if (hasBrace) { - parseExpectedJSDoc(19 /* CloseBraceToken */); - } - var result = factory.createJSDocNameReference(entityName); - fixupParentReferences(result); - return finishNode(result, pos); - } - JSDocParser.parseJSDocNameReference = parseJSDocNameReference; function parseIsolatedJSDocComment(content, start, length) { initializeState("", content, 99 /* Latest */, /*_syntaxCursor:*/ undefined, 1 /* JS */); var jsDoc = doInsideOfContext(4194304 /* JSDoc */, function () { return parseJSDocCommentWorker(start, length); }); @@ -34215,8 +33336,7 @@ var ts; var state = 1 /* SawAsterisk */; var margin; // + 4 for leading '/** ' - // + 1 because the last index of \n is always one index before the first character in the line and coincidentally, if there is no \n before start, it is -1, which is also one index before the first character - var indent = start - (content.lastIndexOf("\n", start) + 1) + 4; + var indent = start - Math.max(content.lastIndexOf("\n", start), 0) + 4; function pushComment(text) { if (!margin) { margin = indent; @@ -34272,7 +33392,7 @@ var ts; comments.push(whitespace); } else if (margin !== undefined && indent + whitespace.length > margin) { - comments.push(whitespace.slice(margin - indent)); + comments.push(whitespace.slice(margin - indent - 1)); } indent += whitespace.length; break; @@ -34416,9 +33536,6 @@ var ts; case "callback": tag = parseCallbackTag(start, tagName, margin, indentText); break; - case "see": - tag = parseSeeTag(start, tagName, margin, indentText); - break; default: tag = parseUnknownTag(start, tagName, margin, indentText); break; @@ -34568,9 +33685,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return true; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -34602,12 +33719,12 @@ var ts; var child = void 0; var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) { + if (child.kind === 322 /* JSDocParameterTag */ || child.kind === 328 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 178 /* ArrayType */), pos); + var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 177 /* ArrayType */), pos); return finishNode(factory.createJSDocTypeExpression(literal), pos); } } @@ -34629,12 +33746,6 @@ var ts; var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined; return finishNode(factory.createJSDocTypeTag(tagName, typeExpression, comments), start, end); } - function parseSeeTag(start, tagName, indent, indentText) { - var nameExpression = parseJSDocNameReference(); - var end = getNodePos(); - var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined; - return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start, end); - } function parseAuthorTag(start, tagName, indent, indentText) { var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -34750,7 +33861,7 @@ var ts; var hasChildren = false; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { hasChildren = true; - if (child.kind === 329 /* JSDocTypeTag */) { + if (child.kind === 325 /* JSDocTypeTag */) { if (childTypeTag) { parseErrorAtCurrentToken(ts.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); var lastError = ts.lastOrUndefined(parseDiagnostics); @@ -34768,7 +33879,7 @@ var ts; } } if (hasChildren) { - var isArrayType = typeExpression && typeExpression.type.kind === 178 /* ArrayType */; + var isArrayType = typeExpression && typeExpression.type.kind === 177 /* ArrayType */; var jsdocTypeLiteral = factory.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType); typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : @@ -34821,7 +33932,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 327 /* JSDocReturnTag */) { + if (tag && tag.kind === 323 /* JSDocReturnTag */) { return tag; } } @@ -34856,7 +33967,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) && + if (child && (child.kind === 322 /* JSDocParameterTag */ || child.kind === 328 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -35602,8 +34713,6 @@ var ts; } case "jsx": case "jsxfrag": - case "jsximportsource": - case "jsxruntime": return; // Accessed directly default: ts.Debug.fail("Unhandled pragma kind"); // Can this be made into an assertNever in the future? } @@ -35728,18 +34837,6 @@ var ts; (function (ts) { /* @internal */ ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; - var jsxOptionMap = new ts.Map(ts.getEntries({ - "preserve": 1 /* Preserve */, - "react-native": 3 /* ReactNative */, - "react": 2 /* React */, - "react-jsx": 4 /* ReactJSX */, - "react-jsxdev": 5 /* ReactJSXDev */, - })); - /* @internal */ - ts.inverseJsxOptionMap = new ts.Map(ts.arrayFrom(ts.mapIterator(jsxOptionMap.entries(), function (_a) { - var key = _a[0], value = _a[1]; - return ["" + value, key]; - }))); // NOTE: The order here is important to default lib ordering as entries will have the same // order in the generated program (see `getDefaultLibPriority` in program.ts). This // order also affects overload resolution when a type declared in one lib is @@ -35761,7 +34858,6 @@ var ts; ["dom.iterable", "lib.dom.iterable.d.ts"], ["webworker", "lib.webworker.d.ts"], ["webworker.importscripts", "lib.webworker.importscripts.d.ts"], - ["webworker.iterable", "lib.webworker.iterable.d.ts"], ["scripthost", "lib.scripthost.d.ts"], // ES2015 Or ESNext By-feature options ["es2015.core", "lib.es2015.core.d.ts"], @@ -35790,7 +34886,6 @@ var ts; ["es2019.symbol", "lib.es2019.symbol.d.ts"], ["es2020.bigint", "lib.es2020.bigint.d.ts"], ["es2020.promise", "lib.es2020.promise.d.ts"], - ["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"], ["es2020.string", "lib.es2020.string.d.ts"], ["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"], ["es2020.intl", "lib.es2020.intl.d.ts"], @@ -35800,8 +34895,7 @@ var ts; ["esnext.intl", "lib.esnext.intl.d.ts"], ["esnext.bigint", "lib.es2020.bigint.d.ts"], ["esnext.string", "lib.esnext.string.d.ts"], - ["esnext.promise", "lib.esnext.promise.d.ts"], - ["esnext.weakref", "lib.esnext.weakref.d.ts"] + ["esnext.promise", "lib.esnext.promise.d.ts"] ]; /** * An array of supported "lib" reference file names used to determine the order for inclusion @@ -35933,15 +35027,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Generates_a_CPU_profile }, - { - name: "generateTrace", - type: "string", - isFilePath: true, - isCommandLineOnly: true, - paramType: ts.Diagnostics.DIRECTORY, - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Generates_an_event_trace_and_a_list_of_types - }, { name: "incremental", shortName: "i", @@ -36097,10 +35182,12 @@ var ts; }, { name: "jsx", - type: jsxOptionMap, + type: new ts.Map(ts.getEntries({ + "preserve": 1 /* Preserve */, + "react-native": 3 /* ReactNative */, + "react": 2 /* React */ + })), affectsSourceFile: true, - affectsEmit: true, - affectsModuleResolution: true, paramType: ts.Diagnostics.KIND, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, @@ -36343,14 +35430,6 @@ var ts; category: ts.Diagnostics.Additional_Checks, description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement }, - { - name: "noUncheckedIndexedAccess", - type: "boolean", - affectsSemanticDiagnostics: true, - showInSimplifiedHelpView: false, - category: ts.Diagnostics.Additional_Checks, - description: ts.Diagnostics.Include_undefined_in_index_signature_results - }, // Module Resolution { name: "moduleResolution", @@ -36512,15 +35591,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment }, - { - name: "jsxImportSource", - type: "string", - affectsSemanticDiagnostics: true, - affectsEmit: true, - affectsModuleResolution: true, - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react - }, { name: "resolveJsonModule", type: "boolean", @@ -36832,11 +35902,7 @@ var ts; name: "exclude", type: "string" } - }, - { - name: "disableFilenameBasedTypeAcquisition", - type: "boolean", - }, + } ]; /*@internal*/ function createOptionNameMap(optionDeclarations) { @@ -37191,7 +36257,7 @@ var ts; */ function readJsonConfigFile(fileName, readFile) { var textOrDiagnostic = tryReadFile(fileName, readFile); - return ts.isString(textOrDiagnostic) ? ts.parseJsonText(fileName, textOrDiagnostic) : { fileName: fileName, parseDiagnostics: [textOrDiagnostic] }; + return ts.isString(textOrDiagnostic) ? ts.parseJsonText(fileName, textOrDiagnostic) : { parseDiagnostics: [textOrDiagnostic] }; } ts.readJsonConfigFile = readJsonConfigFile; /*@internal*/ @@ -37334,7 +36400,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_4 = function (element) { - if (element.kind !== 288 /* PropertyAssignment */) { + if (element.kind !== 285 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -37425,13 +36491,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -37448,7 +36514,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -37933,7 +36999,6 @@ var ts; * It does *not* resolve the included files. */ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache) { - var _a; basePath = ts.normalizeSlashes(basePath); var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { @@ -37943,13 +37008,6 @@ var ts; var ownConfig = json ? parseOwnConfigOfJson(json, host, basePath, configFileName, errors) : parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); - if ((_a = ownConfig.options) === null || _a === void 0 ? void 0 : _a.paths) { - // If we end up needing to resolve relative paths from 'paths' relative to - // the config file location, we'll need to know where that config file was. - // Since 'paths' can be inherited from an extended config in another directory, - // we wouldn't know which directory to use unless we store it here. - ownConfig.options.pathsBasePath = basePath; - } if (ownConfig.extendedConfigPath) { // copy the resolution stack so it is never reused between branches in potential diamond-problem scenarios. resolutionStack = resolutionStack.concat([resolvedPath]); @@ -39249,15 +38307,12 @@ var ts; } function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) { var _a = state.compilerOptions, baseUrl = _a.baseUrl, paths = _a.paths; - if (paths && !ts.pathIsRelative(moduleName)) { + if (baseUrl && paths && !ts.pathIsRelative(moduleName)) { if (state.traceEnabled) { - if (baseUrl) { - trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); - } + trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName); } - var baseDirectory = ts.getPathsBasePath(state.compilerOptions, state.host); // Always defined when 'paths' is defined - return tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, loader, /*onlyRecordFailures*/ false, state); + return tryLoadModuleUsingPaths(extensions, moduleName, baseUrl, paths, loader, /*onlyRecordFailures*/ false, state); } } function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state) { @@ -39756,7 +38811,6 @@ var ts; } var resolved = ts.forEach(paths[matchedPatternText], function (subst) { var path = matchedStar_1 ? subst.replace("*", matchedStar_1) : subst; - // When baseUrl is not specified, the command line parser resolves relative paths to the config file location. var candidate = ts.normalizePath(ts.combinePaths(baseDirectory, path)); if (state.traceEnabled) { trace(state.host, ts.Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path); @@ -39922,26 +38976,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: if (!(ts.hasSyntacticModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 268 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 265 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -39957,7 +39011,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 257 /* ModuleBlock */: { + case 254 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -39979,7 +39033,7 @@ var ts; }); return state_1; } - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 78 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -40051,15 +39105,12 @@ var ts; } var binder = createBinder(); function bindSourceFile(file, options) { - var tracingData = ["bind" /* Bind */, "bindSourceFile", { path: file.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeBind"); ts.perfLogger.logStartBindFile("" + file.fileName); binder(file, options); ts.perfLogger.logStopBindFile(); ts.performance.mark("afterBind"); ts.performance.measure("Bind", "beforeBind", "afterBind"); - ts.tracing.end.apply(ts.tracing, tracingData); } ts.bindSourceFile = bindSourceFile; function createBinder() { @@ -40091,8 +39142,6 @@ var ts; // not depending on if we see "use strict" in certain places or if we hit a class/namespace // or if compiler options contain alwaysStrict. var inStrictMode; - // If we are binding an assignment pattern, we will bind certain expressions differently. - var inAssignmentPattern = false; var symbolCount = 0; var Symbol; var classifiableNames; @@ -40142,7 +39191,6 @@ var ts; currentExceptionTarget = undefined; activeLabelList = undefined; hasExplicitReturn = false; - inAssignmentPattern = false; emitFlags = 0 /* None */; } return bindSourceFile; @@ -40180,7 +39228,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 266 /* ExportAssignment */) { + if (node.kind === 263 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -40189,7 +39237,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 158 /* ComputedPropertyName */) { + if (name.kind === 157 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -40217,36 +39265,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return "__constructor" /* Constructor */; - case 174 /* FunctionType */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: + case 173 /* FunctionType */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: return "__call" /* Call */; - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: return "__new" /* New */; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return "__index" /* Index */; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 160 /* Parameter */: + case 159 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 308 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 304 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -40346,7 +39394,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 266 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 263 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -40383,9 +39431,9 @@ var ts; return symbol; } function declareModuleMember(node, symbolFlags, symbolExcludes) { - var hasExportModifier = !!(ts.getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node); + var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 270 /* ExportSpecifier */ || (node.kind === 260 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 267 /* ExportSpecifier */ || (node.kind === 257 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -40409,7 +39457,7 @@ var ts; // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. if (ts.isJSDocTypeAlias(node)) ts.Debug.assert(ts.isInJSFile(node)); // We shouldn't add symbols for JSDoc nodes if not in a JS file. - if (!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) { + if ((!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) || ts.isJSDocTypeAlias(node)) { if (!container.locals || (ts.hasSyntacticModifier(node, 512 /* Default */) && !getDeclarationName(node))) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); // No local symbol for an unnamed default! } @@ -40424,28 +39472,6 @@ var ts; } } } - function jsdocTreatAsExported(node) { - if (node.parent && ts.isModuleDeclaration(node)) { - node = node.parent; - } - if (!ts.isJSDocTypeAlias(node)) - return false; - // jsdoc typedef handling is a bit of a doozy, but to summarize, treat the typedef as exported if: - // 1. It has an explicit name (since by default typedefs are always directly exported, either at the top level or in a container), or - if (!ts.isJSDocEnumTag(node) && !!node.fullName) - return true; - // 2. The thing a nameless typedef pulls its name from is implicitly a direct export (either by assignment or actual export flag). - var declName = ts.getNameOfDeclaration(node); - if (!declName) - return false; - if (ts.isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent)) - return true; - if (ts.isDeclaration(declName.parent) && ts.getCombinedModifierFlags(declName.parent) & 1 /* Export */) - return true; - // This could potentially be simplified by having `delayedBindJSDocTypedefTag` pass in an override for `hasExportModifier`, since it should - // already have calculated and branched on most of this. - return false; - } // All container nodes are kept on a linked list in declaration order. This list is used by // the getLocalNameOfContainer function in the type checker to validate that the local name // used for a container is unique. @@ -40474,7 +39500,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 209 /* ArrowFunction */) { + if (node.kind !== 206 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -40507,7 +39533,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 166 /* Constructor */ || (ts.isInJSFile && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 165 /* Constructor */ || (ts.isInJSFile && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */)) ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -40522,13 +39548,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 166 /* Constructor */ || (ts.isInJSFile && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */))) { + if (node.kind === 165 /* Constructor */ || (ts.isInJSFile && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */))) { node.returnFlowNode = currentFlow; } } @@ -40555,8 +39581,8 @@ var ts; blockScopeContainer = savedBlockScopeContainer; } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 251 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 251 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 248 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 248 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -40569,156 +39595,129 @@ var ts; ts.forEachChild(node, bind, bindEach); } function bindChildren(node) { - var saveInAssignmentPattern = inAssignmentPattern; - // Most nodes aren't valid in an assignment pattern, so we clear the value here - // and set it before we descend into nodes that could actually be part of an assignment pattern. - inAssignmentPattern = false; if (checkUnreachable(node)) { bindEachChild(node); bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; return; } - if (node.kind >= 232 /* FirstStatement */ && node.kind <= 248 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 229 /* FirstStatement */ && node.kind <= 245 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: bindWhileStatement(node); break; - case 235 /* DoStatement */: + case 232 /* DoStatement */: bindDoStatement(node); break; - case 237 /* ForStatement */: + case 234 /* ForStatement */: bindForStatement(node); break; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 234 /* IfStatement */: + case 231 /* IfStatement */: bindIfStatement(node); break; - case 242 /* ReturnStatement */: - case 246 /* ThrowStatement */: + case 239 /* ReturnStatement */: + case 243 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: bindTryStatement(node); break; - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: bindSwitchStatement(node); break; - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: bindCaseBlock(node); break; - case 284 /* CaseClause */: + case 281 /* CaseClause */: bindCaseClause(node); break; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: bindLabeledStatement(node); break; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 216 /* BinaryExpression */: - if (ts.isDestructuringAssignment(node)) { - // Carry over whether we are in an assignment pattern to - // binary expressions that could actually be an initializer - inAssignmentPattern = saveInAssignmentPattern; - bindDestructuringAssignmentFlow(node); - return; - } + case 213 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: bindCallExpressionFlow(node); break; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: bindNonNullExpressionFlow(node); break; - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 297 /* SourceFile */: { + case 294 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; - case 198 /* BindingElement */: - bindBindingElementFlow(node); - break; - case 200 /* ObjectLiteralExpression */: - case 199 /* ArrayLiteralExpression */: - case 288 /* PropertyAssignment */: - case 220 /* SpreadElement */: - // Carry over whether we are in an assignment pattern of Object and Array literals - // as well as their children that are valid assignment targets. - inAssignmentPattern = saveInAssignmentPattern; - // falls through default: bindEachChild(node); break; } bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; } function isNarrowingExpression(expr) { switch (expr.kind) { case 78 /* Identifier */: - case 79 /* PrivateIdentifier */: case 107 /* ThisKeyword */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return hasNarrowableArgument(expr); - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; } function isNarrowableReference(expr) { - return expr.kind === 78 /* Identifier */ || expr.kind === 79 /* PrivateIdentifier */ || expr.kind === 107 /* ThisKeyword */ || expr.kind === 105 /* SuperKeyword */ || + return expr.kind === 78 /* Identifier */ || expr.kind === 107 /* ThisKeyword */ || expr.kind === 105 /* SuperKeyword */ || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) || - ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right) || ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression) || ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left); } @@ -40734,7 +39733,7 @@ var ts; } } } - if (expr.expression.kind === 201 /* PropertyAccessExpression */ && + if (expr.expression.kind === 198 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -40770,9 +39769,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -40848,26 +39847,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 234 /* IfStatement */: - case 236 /* WhileStatement */: - case 235 /* DoStatement */: + case 231 /* IfStatement */: + case 233 /* WhileStatement */: + case 232 /* DoStatement */: return parent.expression === node; - case 237 /* ForStatement */: - case 217 /* ConditionalExpression */: + case 234 /* ForStatement */: + case 214 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 207 /* ParenthesizedExpression */) { + if (node.kind === 204 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 214 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 211 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 213 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -40914,7 +39913,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 245 /* LabeledStatement */) { + while (label && node.parent.kind === 242 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -40965,12 +39964,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 239 /* ForOfStatement */) { + if (node.kind === 236 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 250 /* VariableDeclarationList */) { + if (node.initializer.kind !== 247 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -40992,7 +39991,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 242 /* ReturnStatement */) { + if (node.kind === 239 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -41009,7 +40008,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 241 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 238 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -41114,7 +40113,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 285 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 282 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -41157,13 +40156,10 @@ var ts; } function bindExpressionStatement(node) { bind(node.expression); - maybeBindExpressionFlowIfCall(node.expression); - } - function maybeBindExpressionFlowIfCall(node) { - // A top level or LHS of comma expression call expression with a dotted function name and at least one argument + // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.kind === 203 /* CallExpression */) { - var call = node; + if (node.expression.kind === 200 /* CallExpression */) { + var call = node.expression; if (ts.isDottedName(call.expression) && call.expression.kind !== 105 /* SuperKeyword */) { currentFlow = createFlowCall(currentFlow, call); } @@ -41188,7 +40184,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -41199,10 +40195,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 199 /* ArrayLiteralExpression */) { + else if (node.kind === 196 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 220 /* SpreadElement */) { + if (e.kind === 217 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -41210,16 +40206,16 @@ var ts; } } } - else if (node.kind === 200 /* ObjectLiteralExpression */) { + else if (node.kind === 197 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 288 /* PropertyAssignment */) { + if (p.kind === 285 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 289 /* ShorthandPropertyAssignment */) { + else if (p.kind === 286 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 290 /* SpreadAssignment */) { + else if (p.kind === 287 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -41267,23 +40263,6 @@ var ts; bindAssignmentTargetFlow(node.operand); } } - function bindDestructuringAssignmentFlow(node) { - if (inAssignmentPattern) { - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - inAssignmentPattern = true; - bind(node.left); - } - else { - inAssignmentPattern = true; - bind(node.left); - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - } - bindAssignmentTargetFlow(node.left); - } var BindBinaryExpressionFlowState; (function (BindBinaryExpressionFlowState) { BindBinaryExpressionFlowState[BindBinaryExpressionFlowState["BindThenBindChildren"] = 0] = "BindThenBindChildren"; @@ -41338,9 +40317,6 @@ var ts; break; } case 2 /* BindToken */: { - if (node.operatorToken.kind === 27 /* CommaToken */) { - maybeBindExpressionFlowIfCall(node.left); - } advanceState(3 /* BindRight */); maybeBind(node.operatorToken); break; @@ -41354,7 +40330,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 202 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 199 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -41391,7 +40367,7 @@ var ts; * If `node` is a BinaryExpression, adds it to the local work stack, otherwise recursively binds it */ function maybeBind(node) { - if (node && ts.isBinaryExpression(node) && !ts.isDestructuringAssignment(node)) { + if (node && ts.isBinaryExpression(node)) { stackIndex++; workStacks.expr[stackIndex] = node; workStacks.state[stackIndex] = 0 /* BindThenBindChildren */; @@ -41405,7 +40381,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 201 /* PropertyAccessExpression */) { + if (node.expression.kind === 198 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -41442,27 +40418,9 @@ var ts; bindInitializedVariableFlow(node); } } - function bindBindingElementFlow(node) { - if (ts.isBindingPattern(node.name)) { - // When evaluating a binding pattern, the initializer is evaluated before the binding pattern, per: - // - https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-iteratorbindinginitialization - // - `BindingElement: BindingPattern Initializer?` - // - https://tc39.es/ecma262/#sec-runtime-semantics-keyedbindinginitialization - // - `BindingElement: BindingPattern Initializer?` - bindEach(node.decorators); - bindEach(node.modifiers); - bind(node.dotDotDotToken); - bind(node.propertyName); - bind(node.initializer); - bind(node.name); - } - else { - bindEachChild(node); - } - } function bindJSDocTypeAlias(node) { ts.setParent(node.tagName, node); - if (node.kind !== 325 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 321 /* JSDocEnumTag */ && node.fullName) { ts.setParent(node.fullName, node); ts.setParentRecursive(node.fullName, /*incremental*/ false); } @@ -41470,7 +40428,7 @@ var ts; function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 165 /* MethodDeclaration */) { + if (host && host.kind !== 164 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -41483,15 +40441,15 @@ var ts; } function bindOptionalChainRest(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: bind(node.questionDotToken); bind(node.name); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: bind(node.questionDotToken); bind(node.argumentExpression); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); @@ -41556,7 +40514,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 208 /* FunctionExpression */ || expr.kind === 209 /* ArrowFunction */) { + if (expr.kind === 205 /* FunctionExpression */ || expr.kind === 206 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -41568,7 +40526,7 @@ var ts; } } } - if (node.expression.kind === 201 /* PropertyAccessExpression */) { + if (node.expression.kind === 198 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -41577,54 +40535,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 200 /* ObjectLiteralExpression */: - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 281 /* JsxAttributes */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 197 /* ObjectLiteralExpression */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 278 /* JsxAttributes */: return 1 /* IsContainer */; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 190 /* MappedType */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 189 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: - case 308 /* JSDocFunctionType */: - case 174 /* FunctionType */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 175 /* ConstructorType */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: + case 304 /* JSDocFunctionType */: + case 173 /* FunctionType */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 174 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 287 /* CatchClause */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 258 /* CaseBlock */: + case 284 /* CatchClause */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 255 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 230 /* Block */: + case 227 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -41657,45 +40615,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 297 /* SourceFile */: + case 294 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 200 /* ObjectLiteralExpression */: - case 253 /* InterfaceDeclaration */: - case 281 /* JsxAttributes */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 197 /* ObjectLiteralExpression */: + case 250 /* InterfaceDeclaration */: + case 278 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 313 /* JSDocSignature */: - case 171 /* IndexSignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 308 /* JSDocFunctionType */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 254 /* TypeAliasDeclaration */: - case 190 /* MappedType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 309 /* JSDocSignature */: + case 170 /* IndexSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 304 /* JSDocFunctionType */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 251 /* TypeAliasDeclaration */: + case 189 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -41796,7 +40754,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 290 /* SpreadAssignment */ || prop.name.kind !== 78 /* Identifier */) { + if (prop.kind === 287 /* SpreadAssignment */ || prop.name.kind !== 78 /* Identifier */) { continue; } var identifier = prop.name; @@ -41808,7 +40766,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 288 /* PropertyAssignment */ || prop.kind === 289 /* ShorthandPropertyAssignment */ || prop.kind === 165 /* MethodDeclaration */ + var currentKind = prop.kind === 285 /* PropertyAssignment */ || prop.kind === 286 /* ShorthandPropertyAssignment */ || prop.kind === 164 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -41840,10 +40798,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -42042,8 +41000,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 297 /* SourceFile */ && - blockScopeContainer.kind !== 256 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 294 /* SourceFile */ && + blockScopeContainer.kind !== 253 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -42138,7 +41096,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 156 /* LastToken */) { + if (node.kind > 155 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -42214,7 +41172,7 @@ var ts; } // falls through case 107 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 289 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 286 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkContextualIdentifier(node); @@ -42223,8 +41181,8 @@ var ts; break; case 79 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -42235,11 +41193,11 @@ var ts; if (ts.isInJSFile(expr) && file.commonJsModuleIndicator && ts.isModuleExportsAccessExpression(expr) && - !lookupSymbolForName(blockScopeContainer, "module")) { + !lookupSymbolForNameWorker(blockScopeContainer, "module")) { declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -42258,14 +41216,6 @@ var ts; bindThisPropertyAssignment(node); break; case 5 /* Property */: - var expression = node.left.expression; - if (ts.isInJSFile(node) && ts.isIdentifier(expression)) { - var symbol = lookupSymbolForName(blockScopeContainer, expression.escapedText); - if (ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration)) { - bindThisPropertyAssignment(node); - break; - } - } bindSpecialPropertyAssignment(node); break; case 0 /* None */: @@ -42275,78 +41225,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return checkStrictModeCatchClause(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return checkStrictModeWithStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 187 /* ThisType */: + case 186 /* ThisType */: seenThisKeyword = true; return; - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: break; // Binding the children will handle everything - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return bindTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return bindParameter(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return bindPropertyWorker(node); - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 291 /* EnumMember */: + case 288 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 174 /* FunctionType */: - case 308 /* JSDocFunctionType */: - case 313 /* JSDocSignature */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 304 /* JSDocFunctionType */: + case 309 /* JSDocSignature */: + case 174 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 190 /* MappedType */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 189 /* MappedType */: return bindAnonymousTypeWorker(node); - case 319 /* JSDocClassTag */: + case 315 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return bindFunctionExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -42365,65 +41315,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return bindJsxAttributes(node); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return bindImportClause(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return bindExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return bindExportAssignment(node); - case 297 /* SourceFile */: + case 294 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 230 /* Block */: + case 227 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 326 /* JSDocParameterTag */: - if (node.parent.kind === 313 /* JSDocSignature */) { + case 322 /* JSDocParameterTag */: + if (node.parent.kind === 309 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 312 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 308 /* JSDocTypeLiteral */) { break; } // falls through - case 333 /* JSDocPropertyTag */: + case 328 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 307 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 303 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -42544,9 +41494,9 @@ var ts; return symbol; }); if (symbol) { - var isAlias = ts.isAliasableExpression(node.right) && (ts.isExportsIdentifier(node.left.expression) || ts.isModuleExportsAccessExpression(node.left.expression)); - var flags = isAlias ? 2097152 /* Alias */ : 4 /* Property */ | 1048576 /* ExportValue */; - ts.setParent(node.left, node); + var flags = ts.isClassExpression(node.right) ? + 4 /* Property */ | 1048576 /* ExportValue */ | 32 /* Class */ : + 4 /* Property */ | 1048576 /* ExportValue */; declareSymbol(symbol.exports, symbol, node.left, flags, 0 /* None */); } } @@ -42562,10 +41512,6 @@ var ts; if (ts.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { return; } - if (ts.isObjectLiteralExpression(assignedExpression) && ts.every(assignedExpression.properties, ts.isShorthandPropertyAssignment)) { - ts.forEach(assignedExpression.properties, bindExportAssignedObjectMemberAlias); - return; - } // 'module.exports = expr' assignment var flags = ts.exportAssignmentIsAlias(node) ? 2097152 /* Alias */ @@ -42573,9 +41519,6 @@ var ts; var symbol = declareSymbol(file.symbol.exports, file.symbol, node, flags | 67108864 /* Assignment */, 0 /* None */); ts.setValueDeclaration(symbol, node); } - function bindExportAssignedObjectMemberAlias(node) { - declareSymbol(file.symbol.exports, file.symbol, node, 2097152 /* Alias */ | 67108864 /* Assignment */, 0 /* None */); - } function bindThisPropertyAssignment(node) { ts.Debug.assert(ts.isInJSFile(node)); // private identifiers *must* be declared (even in JS files) @@ -42586,8 +41529,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -42609,11 +41552,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 166 /* Constructor */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 165 /* Constructor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -42625,7 +41568,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -42654,7 +41597,7 @@ var ts; if (node.expression.kind === 107 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 297 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 294 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -42694,21 +41637,16 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 297 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 294 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } function bindSpecialPropertyAssignment(node) { - var _a; // Class declarations in Typescript do not allow property declarations var parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, container) || lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer); if (!ts.isInJSFile(node) && !ts.isFunctionSymbol(parentSymbol)) { return; } - var rootExpr = ts.getLeftmostAccessExpression(node.left); - if (ts.isIdentifier(rootExpr) && ((_a = lookupSymbolForName(container, rootExpr.escapedText)) === null || _a === void 0 ? void 0 : _a.flags) & 2097152 /* Alias */) { - return; - } // Fix up parent pointers since we're going to use these nodes before we bind into them ts.setParent(node.left, node); ts.setParent(node.right, node); @@ -42742,17 +41680,17 @@ var ts; } if (isToplevel && !isPrototypeProperty) { // make symbols or add declarations for intermediate containers - var flags_2 = 1536 /* Module */ | 67108864 /* Assignment */; + var flags_1 = 1536 /* Module */ | 67108864 /* Assignment */; var excludeFlags_1 = 110735 /* ValueModuleExcludes */ & ~67108864 /* Assignment */; namespaceSymbol = forEachIdentifierInEntityName(entityName, namespaceSymbol, function (id, symbol, parent) { if (symbol) { - addDeclarationToSymbol(symbol, id, flags_2); + addDeclarationToSymbol(symbol, id, flags_1); return symbol; } else { var table = parent ? parent.exports : file.jsGlobalAugmentations || (file.jsGlobalAugmentations = ts.createSymbolTable()); - return declareSymbol(table, parent, id, flags_2, excludeFlags_1); + return declareSymbol(table, parent, id, flags_1, excludeFlags_1); } }); } @@ -42803,8 +41741,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 297 /* SourceFile */ - : propertyAccess.parent.parent.kind === 297 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 294 /* SourceFile */ + : propertyAccess.parent.parent.kind === 294 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer); @@ -42851,7 +41789,7 @@ var ts; function lookupSymbolForPropertyAccess(node, lookupContainer) { if (lookupContainer === void 0) { lookupContainer = container; } if (ts.isIdentifier(node)) { - return lookupSymbolForName(lookupContainer, node.escapedText); + return lookupSymbolForNameWorker(lookupContainer, node.escapedText); } else { var symbol = lookupSymbolForPropertyAccess(node.expression); @@ -42883,7 +41821,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 252 /* ClassDeclaration */) { + if (node.kind === 249 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -42925,10 +41863,7 @@ var ts; checkStrictModeEvalOrArguments(node, node.name); } if (!ts.isBindingPattern(node.name)) { - if (ts.isInJSFile(node) && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true) && !ts.getJSDocTypeTag(node)) { - declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - } - else if (ts.isBlockOrCatchScoped(node)) { + if (ts.isBlockOrCatchScoped(node)) { bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */); } else if (ts.isParameterDeclaration(node)) { @@ -42949,7 +41884,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 326 /* JSDocParameterTag */ && container.kind !== 313 /* JSDocSignature */) { + if (node.kind === 322 /* JSDocParameterTag */ && container.kind !== 309 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -43026,7 +41961,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 185 /* InferType */) { + else if (node.parent.kind === 184 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -43054,11 +41989,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 231 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 228 /* EmptyStatement */) || // report error on class declarations - node.kind === 252 /* ClassDeclaration */ || + node.kind === 249 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 256 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 253 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -43102,12 +42037,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return ts.hasSyntacticModifier(s, 2048 /* Const */); default: return false; @@ -43123,7 +42058,7 @@ var ts; return true; } else if (ts.isIdentifier(node)) { - var symbol = lookupSymbolForName(sourceFile, node.escapedText); + var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText); if (!!symbol && !!symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) { var init = symbol.valueDeclaration.initializer; q.push(init); @@ -43137,7 +42072,7 @@ var ts; return false; } ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias; - function lookupSymbolForName(container, name) { + function lookupSymbolForNameWorker(container, name) { var local = container.locals && container.locals.get(name); if (local) { return local.exportSymbol || local; @@ -43307,7 +42242,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 176 /* TypeQuery */) { + if (d.type && d.type.kind === 175 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -43337,7 +42272,6 @@ var ts; IterationUse[IterationUse["YieldStarFlag"] = 16] = "YieldStarFlag"; IterationUse[IterationUse["SpreadFlag"] = 32] = "SpreadFlag"; IterationUse[IterationUse["DestructuringFlag"] = 64] = "DestructuringFlag"; - IterationUse[IterationUse["PossiblyOutOfBounds"] = 128] = "PossiblyOutOfBounds"; // Spread, Destructuring, Array element assignment IterationUse[IterationUse["Element"] = 1] = "Element"; IterationUse[IterationUse["Spread"] = 33] = "Spread"; @@ -43484,7 +42418,6 @@ var ts; AccessFlags[AccessFlags["Writing"] = 2] = "Writing"; AccessFlags[AccessFlags["CacheSymbol"] = 4] = "CacheSymbol"; AccessFlags[AccessFlags["NoTupleBoundsCheck"] = 8] = "NoTupleBoundsCheck"; - AccessFlags[AccessFlags["ExpressionPosition"] = 16] = "ExpressionPosition"; })(AccessFlags || (AccessFlags = {})); var SignatureCheckMode; (function (SignatureCheckMode) { @@ -43543,25 +42476,6 @@ var ts; DeclarationSpaces[DeclarationSpaces["ExportType"] = 2] = "ExportType"; DeclarationSpaces[DeclarationSpaces["ExportNamespace"] = 4] = "ExportNamespace"; })(DeclarationSpaces || (DeclarationSpaces = {})); - var MinArgumentCountFlags; - (function (MinArgumentCountFlags) { - MinArgumentCountFlags[MinArgumentCountFlags["None"] = 0] = "None"; - MinArgumentCountFlags[MinArgumentCountFlags["StrongArityForUntypedJS"] = 1] = "StrongArityForUntypedJS"; - MinArgumentCountFlags[MinArgumentCountFlags["VoidIsNonOptional"] = 2] = "VoidIsNonOptional"; - })(MinArgumentCountFlags || (MinArgumentCountFlags = {})); - var IntrinsicTypeKind; - (function (IntrinsicTypeKind) { - IntrinsicTypeKind[IntrinsicTypeKind["Uppercase"] = 0] = "Uppercase"; - IntrinsicTypeKind[IntrinsicTypeKind["Lowercase"] = 1] = "Lowercase"; - IntrinsicTypeKind[IntrinsicTypeKind["Capitalize"] = 2] = "Capitalize"; - IntrinsicTypeKind[IntrinsicTypeKind["Uncapitalize"] = 3] = "Uncapitalize"; - })(IntrinsicTypeKind || (IntrinsicTypeKind = {})); - var intrinsicTypeKinds = new ts.Map(ts.getEntries({ - Uppercase: 0 /* Uppercase */, - Lowercase: 1 /* Lowercase */, - Capitalize: 2 /* Capitalize */, - Uncapitalize: 3 /* Uncapitalize */ - })); function SymbolLinks() { } function NodeLinks() { @@ -43625,7 +42539,6 @@ var ts; var instantiationDepth = 0; var constraintDepth = 0; var currentNode; - var typeCatalog = []; // NB: id is index + 1 var emptySymbols = ts.createSymbolTable(); var arrayVariances = [1 /* Covariant */]; var compilerOptions = host.getCompilerOptions(); @@ -43662,7 +42575,6 @@ var ts; getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount") + symbolCount; }, - getTypeCatalog: function () { return typeCatalog; }, getTypeCount: function () { return typeCount; }, getInstantiationCount: function () { return totalInstantiationCount; }, getRelationCacheSizes: function () { return ({ @@ -43677,7 +42589,6 @@ var ts; getMergedSymbol: getMergedSymbol, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getRecursionIdentity: getRecursionIdentity, getTypeOfSymbolAtLocation: function (symbol, locationIn) { var location = ts.getParseTreeNode(locationIn); return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType; @@ -43786,7 +42697,6 @@ var ts; }, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getSymbolOfExpando: getSymbolOfExpando, getContextualType: function (nodeIn, contextFlags) { var node = ts.getParseTreeNode(nodeIn, ts.isExpression); if (!node) { @@ -43980,8 +42890,6 @@ var ts; var intersectionTypes = new ts.Map(); var literalTypes = new ts.Map(); var indexedAccessTypes = new ts.Map(); - var templateLiteralTypes = new ts.Map(); - var stringMappingTypes = new ts.Map(); var substitutionTypes = new ts.Map(); var evolvingArrayTypes = []; var undefinedProperties = new ts.Map(); @@ -43992,7 +42900,6 @@ var ts; var wildcardType = createIntrinsicType(1 /* Any */, "any"); var errorType = createIntrinsicType(1 /* Any */, "error"); var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 524288 /* ContainsWideningType */); - var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); var unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 524288 /* ContainsWideningType */); @@ -44031,7 +42938,6 @@ var ts; var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; var numberOrBigIntType = getUnionType([numberType, bigintType]); - var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; }); var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; }); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -44303,16 +43209,6 @@ var ts; } } function errorOrSuggestion(isError, location, message, arg0, arg1, arg2, arg3) { - // Pseudo-synthesized input node - if (location.pos < 0 || location.end < 0) { - if (!isError) { - return; // Drop suggestions (we have no span to suggest on) - } - // Issue errors globally - var file = ts.getSourceFileOfNode(location); - addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message)); // eslint-disable-line no-in-operator - return; - } addErrorOrSuggestion(isError, "message" in message ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForNodeFromMessageChain(location, message)); // eslint-disable-line no-in-operator } function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) { @@ -44602,7 +43498,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 297 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 294 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -44661,17 +43557,17 @@ var ts; } if (declaration.pos <= usage.pos && !(ts.isPropertyDeclaration(declaration) && ts.isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) { // declaration is before usage - if (declaration.kind === 198 /* BindingElement */) { + if (declaration.kind === 195 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 198 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 195 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 249 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 246 /* VariableDeclaration */), usage); } - else if (declaration.kind === 249 /* VariableDeclaration */) { + else if (declaration.kind === 246 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -44701,12 +43597,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 270 /* ExportSpecifier */ || (usage.parent.kind === 266 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 267 /* ExportSpecifier */ || (usage.parent.kind === 263 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 266 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 263 /* ExportAssignment */ && usage.isExportEquals) { return true; } if (!!(usage.flags & 4194304 /* JSDoc */) || isInTypeQuery(usage) || usageInTypeDeclaration()) { @@ -44728,9 +43624,9 @@ var ts; } function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { switch (declaration.parent.parent.kind) { - case 232 /* VariableStatement */: - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: + case 229 /* VariableStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, declContainer)) { @@ -44751,16 +43647,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 163 /* PropertyDeclaration */ && + current.parent.kind === 162 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasSyntacticModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 165 /* MethodDeclaration */) { + if (declaration.kind === 164 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -44782,19 +43678,19 @@ var ts; return "quit"; } switch (node.kind) { - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return true; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 230 /* Block */: + case 227 /* Block */: switch (node.parent.kind) { - case 167 /* GetAccessor */: - case 165 /* MethodDeclaration */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 164 /* MethodDeclaration */: + case 167 /* SetAccessor */: return true; default: return false; @@ -44830,18 +43726,18 @@ var ts; } function requiresScopeChangeWorker(node) { switch (node.kind) { - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 166 /* Constructor */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 165 /* Constructor */: // do not descend into these return false; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 288 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 285 /* PropertyAssignment */: return requiresScopeChangeWorker(node.name); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // static properties in classes introduce temporary variables if (ts.hasStaticModifier(node)) { return target < 99 /* ESNext */ || !compilerOptions.useDefineForClassFields; @@ -44895,12 +43791,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 311 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 307 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 160 /* Parameter */ || - lastLocation.kind === 159 /* TypeParameter */ + lastLocation.kind === 159 /* Parameter */ || + lastLocation.kind === 158 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -44915,13 +43811,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 160 /* Parameter */ || + lastLocation.kind === 159 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 184 /* ConditionalType */) { + else if (location.kind === 183 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -44936,14 +43832,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 297 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 294 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -44967,7 +43863,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 270 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 269 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 267 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 266 /* NamespaceExport */))) { break; } } @@ -44981,12 +43877,12 @@ var ts; } } break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -45003,9 +43899,9 @@ var ts; } } break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -45024,7 +43920,7 @@ var ts; } break loop; } - if (location.kind === 221 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 218 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -45032,7 +43928,7 @@ var ts; } } break; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 93 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -45052,9 +43948,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 253 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 250 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -45062,24 +43958,24 @@ var ts; } } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -45092,7 +43988,7 @@ var ts; } } break; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -45101,7 +43997,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 160 /* Parameter */) { + if (location.parent && location.parent.kind === 159 /* Parameter */) { location = location.parent; } // @@ -45116,17 +44012,17 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 252 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 249 /* ClassDeclaration */)) { location = location.parent; } break; - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 160 /* Parameter */: + case 159 /* Parameter */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && ts.isBindingPattern(lastLocation))) { if (!associatedDeclarationForContainingInitializerOrBindingName) { @@ -45134,20 +44030,14 @@ var ts; } } break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && ts.isBindingPattern(lastLocation))) { - if (ts.isParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) { - associatedDeclarationForContainingInitializerOrBindingName = location; - } - } - break; - case 185 /* InferType */: - if (meaning & 262144 /* TypeParameter */) { - var parameterName = location.typeParameter.name; - if (parameterName && name === parameterName.escapedText) { - result = location.typeParameter.symbol; - break loop; + var root = ts.getRootDeclaration(location); + if (root.kind === 159 /* Parameter */) { + if (!associatedDeclarationForContainingInitializerOrBindingName) { + associatedDeclarationForContainingInitializerOrBindingName = location; + } } } break; @@ -45166,7 +44056,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 297 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 294 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -45204,15 +44094,7 @@ var ts; } } if (!suggestion) { - if (nameArg) { - var lib = getSuggestedLibForNonExistentName(nameArg); - if (lib) { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg), lib); - } - else { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); - } - } + error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); } suggestionCount++; } @@ -45291,10 +44173,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 209 /* ArrowFunction */ && location.kind !== 208 /* FunctionExpression */) { + if (location.kind !== 206 /* ArrowFunction */ && location.kind !== 205 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -45307,12 +44189,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 256 /* ModuleDeclaration */: // For `namespace N { N; }` + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 253 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -45324,7 +44206,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 159 /* TypeParameter */) { + if (decl.kind === 158 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -45380,9 +44262,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 78 /* Identifier */: - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -45426,7 +44308,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 270 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 267 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -45440,31 +44322,15 @@ var ts; } var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* Type */ & ~111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol && !(symbol.flags & 1024 /* NamespaceModule */)) { - var rawName = ts.unescapeLeadingUnderscores(name); - if (isES2015OrLaterConstructorName(name)) { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName); - } - else if (maybeMappedType(errorLocation, symbol)) { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0, rawName, rawName === "K" ? "P" : "K"); - } - else { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, rawName); - } + var message = isES2015OrLaterConstructorName(name) + ? ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later + : ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here; + error(errorLocation, message, ts.unescapeLeadingUnderscores(name)); return true; } } return false; } - function maybeMappedType(node, symbol) { - var container = ts.findAncestor(node.parent, function (n) { - return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit"; - }); - if (container && container.members.length === 1) { - var type = getDeclaredTypeOfSymbol(symbol); - return !!(type.flags & 1048576 /* Union */) && allTypesAssignableToKind(type, 384 /* StringOrNumberLiteral */, /*strict*/ true); - } - return false; - } function isES2015OrLaterConstructorName(n) { switch (n) { case "Promise": @@ -45501,7 +44367,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 255 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 252 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -45536,13 +44402,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.parent; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return node.parent.parent; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -45566,37 +44432,29 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ - || node.kind === 259 /* NamespaceExportDeclaration */ - || node.kind === 262 /* ImportClause */ && !!node.name - || node.kind === 263 /* NamespaceImport */ - || node.kind === 269 /* NamespaceExport */ - || node.kind === 265 /* ImportSpecifier */ - || node.kind === 270 /* ExportSpecifier */ - || node.kind === 266 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) - || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) - || ts.isAccessExpression(node) + return node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 256 /* NamespaceExportDeclaration */ || + node.kind === 259 /* ImportClause */ && !!node.name || + node.kind === 260 /* NamespaceImport */ || + node.kind === 266 /* NamespaceExport */ || + node.kind === 262 /* ImportSpecifier */ || + node.kind === 267 /* ExportSpecifier */ || + node.kind === 263 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || + ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ - && isAliasableOrJsExpression(node.parent.right) - || node.kind === 289 /* ShorthandPropertyAssignment */ - || node.kind === 288 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) - || ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true); + && isAliasableOrJsExpression(node.parent.right) || + node.kind === 286 /* ShorthandPropertyAssignment */ || + node.kind === 285 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - var commonJSPropertyAccess = getCommonJSPropertyAccess(node); - if (commonJSPropertyAccess) { - var name = ts.getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0]; - return ts.isIdentifier(commonJSPropertyAccess.name) - ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText)) - : undefined; - } - if (ts.isVariableDeclaration(node) || node.moduleReference.kind === 272 /* ExternalModuleReference */) { - var immediate = resolveExternalModuleName(node, ts.getExternalModuleRequireArgument(node) || ts.getExternalModuleImportEqualsDeclarationExpression(node)); + if (node.moduleReference.kind === 269 /* ExternalModuleReference */) { + var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); return resolved_4; @@ -45623,7 +44481,10 @@ var ts; } function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) { var exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */); - var exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports.get(name); + if (exportValue) { + return getPropertyOfType(getTypeOfSymbol(exportValue), name); + } + var exportSymbol = moduleSymbol.exports.get(name); var resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(sourceNode, exportSymbol, resolved, /*overwriteEmpty*/ false); return resolved; @@ -45764,9 +44625,11 @@ var ts; result.exports = new ts.Map(valueSymbol.exports); return result; } - function getExportOfModule(symbol, name, specifier, dontResolveAlias) { + function getExportOfModule(symbol, specifier, dontResolveAlias) { + var _a; if (symbol.flags & 1536 /* Module */) { - var exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText); + var name = ((_a = specifier.propertyName) !== null && _a !== void 0 ? _a : specifier.name).escapedText; + var exportSymbol = getExportsOfSymbol(symbol).get(name); var resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(specifier, exportSymbol, resolved, /*overwriteEmpty*/ false); return resolved; @@ -45783,14 +44646,10 @@ var ts; function getExternalModuleMember(node, specifier, dontResolveAlias) { var _a; if (dontResolveAlias === void 0) { dontResolveAlias = false; } - var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier; - var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); // TODO: GH#18217 - var name = !ts.isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name; - if (!ts.isIdentifier(name)) { - return undefined; - } + var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); + var name = specifier.propertyName || specifier.name; var suppressInteropError = name.escapedText === "default" /* Default */ && !!(compilerOptions.allowSyntheticDefaultImports || compilerOptions.esModuleInterop); - var targetSymbol = resolveESModuleSymbol(moduleSymbol, moduleSpecifier, dontResolveAlias, suppressInteropError); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias, suppressInteropError); if (targetSymbol) { if (name.escapedText) { if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { @@ -45806,7 +44665,7 @@ var ts; } // if symbolFromVariable is export - get its final target symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); - var symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias); + var symbolFromModule = getExportOfModule(targetSymbol, specifier, dontResolveAlias); if (symbolFromModule === undefined && name.escapedText === "default" /* Default */) { var file = ts.find(moduleSymbol.declarations, ts.isSourceFile); if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias)) { @@ -45822,7 +44681,7 @@ var ts; var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol); if (suggestion !== undefined) { var suggestionName = symbolToString(suggestion); - var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName); + var diagnostic = error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2, moduleName, declarationName, suggestionName); if (suggestion.valueDeclaration) { ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName)); } @@ -45883,21 +44742,10 @@ var ts; } } function getTargetOfImportSpecifier(node, dontResolveAlias) { - var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent; - var commonJSPropertyAccess = getCommonJSPropertyAccess(root); - var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias); - var name = node.propertyName || node.name; - if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) { - return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias); - } + var resolved = getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false); return resolved; } - function getCommonJSPropertyAccess(node) { - if (ts.isVariableDeclaration(node) && node.initializer && ts.isPropertyAccessExpression(node.initializer)) { - return node.initializer; - } - } function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { var resolved = resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false); @@ -45934,7 +44782,7 @@ var ts; var expression = node.initializer; return getTargetOfAliasLikeExpression(expression, dontRecursivelyResolve); } - function getTargetOfAccessExpression(node, dontRecursivelyResolve) { + function getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve) { if (!(ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */)) { return undefined; } @@ -45943,32 +44791,29 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: - case 249 /* VariableDeclaration */: + case 257 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 265 /* ImportSpecifier */: - case 198 /* BindingElement */: + case 262 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 266 /* ExportAssignment */: - case 216 /* BinaryExpression */: + case 263 /* ExportAssignment */: + case 213 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: - return getTargetOfAccessExpression(node, dontRecursivelyResolve); + case 198 /* PropertyAccessExpression */: + return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); } @@ -46035,7 +44880,7 @@ var ts; * @param overwriteEmpty Checks `resolvesToSymbol` for type-only declarations even if `aliasDeclaration` */ function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) { - if (!aliasDeclaration || ts.isPropertyAccessExpression(aliasDeclaration)) + if (!aliasDeclaration) return false; // If the declaration itself is type-only, mark it and return. // No need to check what it resolves to. @@ -46119,13 +44964,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 78 /* Identifier */ || entityName.parent.kind === 157 /* QualifiedName */) { + if (entityName.kind === 78 /* Identifier */ || entityName.parent.kind === 156 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 260 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 257 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -46149,9 +44994,9 @@ var ts; return getMergedSymbol(symbolFromJSPrototype); } } - else if (name.kind === 157 /* QualifiedName */ || name.kind === 201 /* PropertyAccessExpression */) { - var left = name.kind === 157 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 157 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 156 /* QualifiedName */ || name.kind === 198 /* PropertyAccessExpression */) { + var left = name.kind === 156 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 156 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -46177,12 +45022,7 @@ var ts; symbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, meaning)); if (!symbol) { if (!ignoreErrors) { - var namespaceName = getFullyQualifiedName(namespace); - var declarationName = ts.declarationNameToString(right); - var suggestion = getSuggestedSymbolForNonexistentModule(right, namespace); - suggestion ? - error(right, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestion)) : - error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName); + error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); } return undefined; } @@ -46191,7 +45031,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 266 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 263 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -46375,7 +45215,7 @@ var ts; ? ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, packageId.name, ts.mangleScopedPackageName(packageId.name)) : ts.chainDiagnosticMessages( - /*details*/ undefined, ts.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name)) + /*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name)) : undefined; errorOrSuggestion(isError, errorNode, ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedFileName)); } @@ -46417,7 +45257,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 297 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 294 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -46719,7 +45559,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 166 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 165 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -46728,7 +45568,6 @@ var ts; var result = new Type(checker, flags); typeCount++; result.id = typeCount; - typeCatalog.push(result); return result; } function createIntrinsicType(kind, intrinsicName, objectFlags) { @@ -46807,12 +45646,12 @@ var ts; } } switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -46821,9 +45660,9 @@ var ts; return { value: result }; } break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -46906,7 +45745,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 267 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -46950,7 +45789,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 267 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -46965,10 +45804,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: continue; default: return false; @@ -47097,10 +45936,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -47109,7 +45948,6 @@ var ts; } return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { - var _a, _b; if (!isDeclarationVisible(declaration)) { // Mark the unexported alias as visible if its parent is visible // because these kind of aliases can be used to name types in declaration file @@ -47129,14 +45967,6 @@ var ts; && isDeclarationVisible(declaration.parent)) { return addVisibleAlias(declaration, declaration); } - else if (symbol.flags & 2097152 /* Alias */ && ts.isBindingElement(declaration) && ts.isInJSFile(declaration) && ((_a = declaration.parent) === null || _a === void 0 ? void 0 : _a.parent) // exported import-like top-level JS require statement - && ts.isVariableDeclaration(declaration.parent.parent) - && ((_b = declaration.parent.parent.parent) === null || _b === void 0 ? void 0 : _b.parent) && ts.isVariableStatement(declaration.parent.parent.parent.parent) - && !ts.hasSyntacticModifier(declaration.parent.parent.parent.parent, 1 /* Export */) - && declaration.parent.parent.parent.parent.parent // check if the thing containing the variable statement is visible (ie, the file) - && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) { - return addVisibleAlias(declaration, declaration.parent.parent.parent.parent); - } // Declaration is not visible return false; } @@ -47156,14 +45986,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 176 /* TypeQuery */ || + if (entityName.parent.kind === 175 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 158 /* ComputedPropertyName */) { + entityName.parent.kind === 157 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 157 /* QualifiedName */ || entityName.kind === 201 /* PropertyAccessExpression */ || - entityName.parent.kind === 260 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 156 /* QualifiedName */ || entityName.kind === 198 /* PropertyAccessExpression */ || + entityName.parent.kind === 257 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -47204,7 +46034,7 @@ var ts; function symbolToStringWorker(writer) { var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217 // add neverAsciiEscape for GH#39027 - var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 297 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true }); + var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 294 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, entity, /*sourceFile*/ sourceFile, writer); return writer; @@ -47216,10 +46046,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 175 /* ConstructorType */ : 174 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 174 /* ConstructorType */ : 173 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 170 /* ConstructSignature */ : 169 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 169 /* ConstructSignature */ : 168 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -47265,9 +46095,6 @@ var ts; if (flags === void 0) { flags = 0 /* None */; } return flags & 814775659 /* NodeBuilderFlagsMask */; } - function isClassInstanceSide(type) { - return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(ts.getObjectFlags(type) & 1073741824 /* IsClassInstanceClone */)); - } function createNodeBuilder() { return { typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) { @@ -47299,7 +46126,6 @@ var ts; }, }; function withContext(enclosingDeclaration, flags, tracker, cb) { - var _a, _b; ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); var context = { enclosingDeclaration: enclosingDeclaration, @@ -47323,9 +46149,6 @@ var ts; approximateLength: 0 }; var resultingNode = cb(context); - if (context.truncating && context.flags & 1 /* NoTruncation */) { - (_b = (_a = context.tracker) === null || _a === void 0 ? void 0 : _a.reportTruncationError) === null || _b === void 0 ? void 0 : _b.call(_a); - } return context.encounteredError ? undefined : resultingNode; } function checkTruncationLength(context) { @@ -47352,22 +46175,22 @@ var ts; } if (type.flags & 1 /* Any */) { context.approximateLength += 3; - return ts.factory.createKeywordTypeNode(type === intrinsicMarkerType ? 136 /* IntrinsicKeyword */ : 128 /* AnyKeyword */); + return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */); + return ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(147 /* StringKeyword */); + return ts.factory.createKeywordTypeNode(146 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(144 /* NumberKeyword */); + return ts.factory.createKeywordTypeNode(143 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(155 /* BigIntKeyword */); + return ts.factory.createKeywordTypeNode(154 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; @@ -47376,23 +46199,10 @@ var ts; if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); var parentName = symbolToTypeNode(parentSymbol, context, 788968 /* Type */); - if (getDeclaredTypeOfSymbol(parentSymbol) === type) { - return parentName; - } - var memberName = ts.symbolName(type.symbol); - if (ts.isIdentifierText(memberName, 0 /* ES3 */)) { - return appendReferenceToType(parentName, ts.factory.createTypeReferenceNode(memberName, /*typeArguments*/ undefined)); - } - if (ts.isImportTypeNode(parentName)) { - parentName.isTypeOf = true; // mutably update, node is freshly manufactured anyhow - return ts.factory.createIndexedAccessTypeNode(parentName, ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName))); - } - else if (ts.isTypeReferenceNode(parentName)) { - return ts.factory.createIndexedAccessTypeNode(ts.factory.createTypeQueryNode(parentName.typeName), ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName))); - } - else { - return ts.Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`."); - } + var enumLiteralName = getDeclaredTypeOfSymbol(parentSymbol) === type + ? parentName + : appendReferenceToType(parentName, ts.factory.createTypeReferenceNode(ts.symbolName(type.symbol), /*typeArguments*/ undefined)); + return enumLiteralName; } if (type.flags & 1056 /* EnumLike */) { return symbolToTypeNode(type.symbol, context, 788968 /* Type */); @@ -47425,7 +46235,7 @@ var ts; } } context.approximateLength += 13; - return ts.factory.createTypeOperatorNode(151 /* UniqueKeyword */, ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */)); + return ts.factory.createTypeOperatorNode(150 /* UniqueKeyword */, ts.factory.createKeywordTypeNode(147 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -47433,7 +46243,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */); + return ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -47441,15 +46251,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.factory.createKeywordTypeNode(141 /* NeverKeyword */); + return ts.factory.createKeywordTypeNode(140 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */); + return ts.factory.createKeywordTypeNode(147 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(145 /* ObjectKeyword */); + return ts.factory.createKeywordTypeNode(144 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -47517,19 +46327,7 @@ var ts; var indexedType = type.type; context.approximateLength += 6; var indexTypeNode = typeToTypeNodeHelper(indexedType, context); - return ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, indexTypeNode); - } - if (type.flags & 134217728 /* TemplateLiteral */) { - var texts_1 = type.texts; - var types_1 = type.types; - var templateHead = ts.factory.createTemplateHead(texts_1[0]); - var templateSpans = ts.factory.createNodeArray(ts.map(types_1, function (t, i) { return ts.factory.createTemplateLiteralTypeSpan(typeToTypeNodeHelper(t, context), (i < types_1.length - 1 ? ts.factory.createTemplateMiddle : ts.factory.createTemplateTail)(texts_1[i + 1])); })); - context.approximateLength += 2; - return ts.factory.createTemplateLiteralType(templateHead, templateSpans); - } - if (type.flags & 268435456 /* StringMapping */) { - var typeNode = typeToTypeNodeHelper(type.type, context); - return symbolToTypeNode(type.symbol, context, 788968 /* Type */, [typeNode]); + return ts.factory.createTypeOperatorNode(137 /* KeyOfKeyword */, indexTypeNode); } if (type.flags & 8388608 /* IndexedAccess */) { var objectTypeNode = typeToTypeNodeHelper(type.objectType, context); @@ -47574,15 +46372,14 @@ var ts; if (isMappedTypeWithKeyofConstraintDeclaration(type)) { // We have a { [P in keyof T]: X } // We do this to ensure we retain the toplevel keyof-ness of the type which may be lost due to keyof distribution during `getConstraintTypeFromMappedType` - appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context)); + appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(137 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context)); } else { appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type), context); } var typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type), context, appropriateConstraintTypeNode); - var nameTypeNode = type.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type), context) : undefined; var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); - var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode); + var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); context.approximateLength += 10; return ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */); } @@ -47591,16 +46388,16 @@ var ts; var typeId = type.id; var symbol = type.symbol; if (symbol) { - var isInstanceType = isClassInstanceSide(type) ? 788968 /* Type */ : 111551 /* Value */; if (isJSConstructor(symbol.valueDeclaration)) { // Instance and static types share the same symbol; only add 'typeof' for the static side. + var isInstanceType = type === getDeclaredTypeOfClassOrInterface(symbol) ? 788968 /* Type */ : 111551 /* Value */; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 221 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 218 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { - return symbolToTypeNode(symbol, context, isInstanceType); + return symbolToTypeNode(symbol, context, 111551 /* Value */); } else if ((_a = context.visitedTypes) === null || _a === void 0 ? void 0 : _a.has(typeId)) { // If type is an anonymous type literal in a type alias declaration, use type alias name @@ -47628,7 +46425,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 297 /* SourceFile */ || declaration.parent.kind === 257 /* ModuleBlock */; + return declaration.parent.kind === 294 /* SourceFile */ || declaration.parent.kind === 254 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -47679,12 +46476,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 174 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 173 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 175 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 174 /* ConstructorType */, context); return signatureNode; } } @@ -47705,7 +46502,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.factory.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -47729,12 +46526,12 @@ var ts; } } var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode(tupleConstituentNodes), 1 /* SingleLine */); - return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode([]), 1 /* SingleLine */); - return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -47762,10 +46559,10 @@ var ts; // the default outer type arguments), we don't show the group. if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { var typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start, i), context); - var flags_3 = context.flags; + var flags_2 = context.flags; context.flags |= 16 /* ForbidIndexedAccessSymbolReferences */; var ref = symbolToTypeNode(parent, context, 788968 /* Type */, typeArgumentSlice); - context.flags = flags_3; + context.flags = flags_2; resultType = !resultType ? ref : appendReferenceToType(resultType, ref); } } @@ -47841,11 +46638,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 169 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 168 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 170 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 169 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -47921,7 +46718,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 164 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 163 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); typeElements.push(preserveCommentsOn(methodDeclaration)); } } @@ -47936,7 +46733,7 @@ var ts; propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(141 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -47944,8 +46741,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 328 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 328 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -47977,8 +46774,8 @@ var ts; var seenNames = mayHaveNameCollisions ? ts.createUnderscoreEscapedMultiMap() : undefined; var result_4 = []; var i = 0; - for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { - var type = types_2[_i]; + for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { + var type = types_1[_i]; i++; if (checkTruncationLength(context) && (i + 2 < types.length - 1)) { result_4.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", /*typeArguments*/ undefined)); @@ -48013,8 +46810,8 @@ var ts; var b = _b[0]; return typesAreSameReference(a, b); })) { - for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { - var _a = types_3[_i], type = _a[0], resultIndex = _a[1]; + for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { + var _a = types_2[_i], type = _a[0], resultIndex = _a[1]; result_4[resultIndex] = typeToTypeNodeHelper(type, context); } } @@ -48031,7 +46828,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context, typeNode) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 /* String */ ? 147 /* StringKeyword */ : 144 /* NumberKeyword */); + var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 /* String */ ? 146 /* StringKeyword */ : 143 /* NumberKeyword */); var indexingParameter = ts.factory.createParameterDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -48046,7 +46843,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.factory.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.factory.createToken(141 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context, options) { var _a, _b, _c, _d; @@ -48061,9 +46858,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var expandedParams = getExpandedParameters(signature, /*skipUnionExpanding*/ true)[0]; - // If the expanded parameter list had a variadic in a non-trailing position, don't expand it - var parameters = (ts.some(expandedParams, function (p) { return p !== expandedParams[expandedParams.length - 1] && !!(ts.getCheckFlags(p) & 32768 /* RestParameter */); }) ? signature.parameters : expandedParams).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 166 /* Constructor */, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); }); + var parameters = getExpandedParameters(signature, /*skipUnionExpanding*/ true)[0].map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 165 /* Constructor */, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -48090,20 +46885,20 @@ var ts; } } context.approximateLength += 3; // Usually a signature contributes a few more characters than this, but 3 is the minimum - var node = kind === 169 /* CallSignature */ ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) : - kind === 170 /* ConstructSignature */ ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : - kind === 164 /* MethodSignature */ ? ts.factory.createMethodSignature(options === null || options === void 0 ? void 0 : options.modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : - kind === 165 /* MethodDeclaration */ ? ts.factory.createMethodDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) : - kind === 166 /* Constructor */ ? ts.factory.createConstructorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, /*body*/ undefined) : - kind === 167 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) : - kind === 168 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, /*body*/ undefined) : - kind === 171 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, returnTypeNode) : - kind === 308 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) : - kind === 174 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : - kind === 175 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : - kind === 251 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) : - kind === 208 /* FunctionExpression */ ? ts.factory.createFunctionExpression(options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) : - kind === 209 /* ArrowFunction */ ? ts.factory.createArrowFunction(options === null || options === void 0 ? void 0 : options.modifiers, typeParameters, parameters, returnTypeNode, /*equalsGreaterThanToken*/ undefined, ts.factory.createBlock([])) : + var node = kind === 168 /* CallSignature */ ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) : + kind === 169 /* ConstructSignature */ ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : + kind === 163 /* MethodSignature */ ? ts.factory.createMethodSignature(options === null || options === void 0 ? void 0 : options.modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : + kind === 164 /* MethodDeclaration */ ? ts.factory.createMethodDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) : + kind === 165 /* Constructor */ ? ts.factory.createConstructorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, /*body*/ undefined) : + kind === 166 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) : + kind === 167 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, /*body*/ undefined) : + kind === 170 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, returnTypeNode) : + kind === 304 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) : + kind === 173 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : + kind === 174 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : + kind === 248 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) : + kind === 205 /* FunctionExpression */ ? ts.factory.createFunctionExpression(options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) : + kind === 206 /* ArrowFunction */ ? ts.factory.createArrowFunction(options === null || options === void 0 ? void 0 : options.modifiers, typeParameters, parameters, returnTypeNode, /*equalsGreaterThanToken*/ undefined, ts.factory.createBlock([])) : ts.Debug.assertNever(kind); if (typeArguments) { node.typeArguments = ts.factory.createNodeArray(typeArguments); @@ -48125,9 +46920,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 160 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 159 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 326 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 322 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -48142,7 +46937,7 @@ var ts; var dotDotDotToken = isRest ? ts.factory.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 78 /* Identifier */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 157 /* QualifiedName */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 156 /* QualifiedName */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -48307,11 +47102,11 @@ var ts; } function getSpecifierForModuleSymbol(symbol, context) { var _a; - var file = ts.getDeclarationOfKind(symbol, 297 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 294 /* SourceFile */); if (!file) { var equivalentFileSymbol = ts.firstDefined(symbol.declarations, function (d) { return getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol); }); if (equivalentFileSymbol) { - file = ts.getDeclarationOfKind(equivalentFileSymbol, 297 /* SourceFile */); + file = ts.getDeclarationOfKind(equivalentFileSymbol, 294 /* SourceFile */); } } if (file && file.moduleName !== undefined) { @@ -48350,7 +47145,7 @@ var ts; // specifier preference var moduleResolverHost = context.tracker.moduleResolverHost; var specifierCompilerOptions = isBundle_1 ? __assign(__assign({}, compilerOptions), { baseUrl: moduleResolverHost.getCommonSourceDirectory() }) : compilerOptions; - specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative", importModuleSpecifierEnding: isBundle_1 ? "minimal" : undefined })); + specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative" })); (_a = links.specifierCache) !== null && _a !== void 0 ? _a : (links.specifierCache = new ts.Map()); links.specifierCache.set(contextFile.path, specifier); } @@ -48656,7 +47451,7 @@ var ts; } var oldFlags = context.flags; if (type.flags & 8192 /* UniqueESSymbol */ && - type.symbol === symbol && (!context.enclosingDeclaration || ts.some(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === ts.getSourceFileOfNode(context.enclosingDeclaration); }))) { + type.symbol === symbol) { context.flags |= 1048576 /* AllowUniqueESSymbolType */; } var result = typeToTypeNodeHelper(type, context); @@ -48689,17 +47484,17 @@ var ts; function visitExistingNodeTreeSymbols(node) { var _a, _b; // We don't _actually_ support jsdoc namepath types, emit `any` instead - if (ts.isJSDocAllType(node) || node.kind === 310 /* JSDocNamepathType */) { + if (ts.isJSDocAllType(node) || node.kind === 306 /* JSDocNamepathType */) { return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */); + return ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createLiteralTypeNode(ts.factory.createNull())]); } if (ts.isJSDocOptionalType(node)) { - return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)]); + return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -48813,8 +47608,8 @@ var ts; } } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 165 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 164 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 164 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 163 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -49093,50 +47888,38 @@ var ts; if (textRange && ts.isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) { textRange = textRange.parent.parent; } - var propertyAccessRequire = ts.find(symbol.declarations, ts.isPropertyAccessExpression); - if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right) - && type.symbol && ts.isSourceFile(type.symbol.valueDeclaration)) { - var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right; + var statement = ts.setTextRange(ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ + ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) + ], flags)), textRange); + addResult(statement, name !== localName ? modifierFlags & ~1 /* Export */ : modifierFlags); + if (name !== localName && !isPrivate) { + // We rename the variable declaration we generate for Property symbols since they may have a name which + // conflicts with a local declaration. For example, given input: + // ``` + // function g() {} + // module.exports.g = g + // ``` + // In such a situation, we have a local variable named `g`, and a separate exported variable named `g`. + // Naively, we would emit + // ``` + // function g() {} + // export const g: typeof g; + // ``` + // That's obviously incorrect - the `g` in the type annotation needs to refer to the local `g`, but + // the export declaration shadows it. + // To work around that, we instead write + // ``` + // function g() {} + // const g_1: typeof g; + // export { g_1 as g }; + // ``` + // To create an export named `g` that does _not_ shadow the local `g` addResult(ts.factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(alias, localName)])), 0 /* None */); - context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551 /* Value */); - } - else { - var statement = ts.setTextRange(ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ - ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) - ], flags)), textRange); - addResult(statement, name !== localName ? modifierFlags & ~1 /* Export */ : modifierFlags); - if (name !== localName && !isPrivate) { - // We rename the variable declaration we generate for Property symbols since they may have a name which - // conflicts with a local declaration. For example, given input: - // ``` - // function g() {} - // module.exports.g = g - // ``` - // In such a situation, we have a local variable named `g`, and a separate exported variable named `g`. - // Naively, we would emit - // ``` - // function g() {} - // export const g: typeof g; - // ``` - // That's obviously incorrect - the `g` in the type annotation needs to refer to the local `g`, but - // the export declaration shadows it. - // To work around that, we instead write - // ``` - // function g() {} - // const g_1: typeof g; - // export { g_1 as g }; - // ``` - // To create an export named `g` that does _not_ shadow the local `g` - addResult(ts.factory.createExportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, - /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0 /* None */); - needsExportDeclaration = false; - needsPostExportDefault = false; - } + /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0 /* None */); + needsExportDeclaration = false; + needsPostExportDefault = false; } } } @@ -49158,8 +47941,7 @@ var ts; if ((symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && (!isConstMergedWithNS || isTypeOnlyNamespace(symbol))) || isConstMergedWithNSPrintableAsSignatureMerge) { serializeModule(symbol, symbolName, modifierFlags); } - // The class meaning serialization should handle serializing all interface members - if (symbol.flags & 64 /* Interface */ && !(symbol.flags & 32 /* Class */)) { + if (symbol.flags & 64 /* Interface */) { serializeInterface(symbol, symbolName, modifierFlags); } if (symbol.flags & 2097152 /* Alias */) { @@ -49254,8 +48036,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 169 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 170 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 168 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 169 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.factory.createHeritageClause(93 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b, 111551 /* Value */); }))]; addResult(ts.factory.createInterfaceDeclaration( @@ -49324,7 +48106,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 251 /* FunctionDeclaration */, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); + var decl = signatureToSignatureDeclarationHelper(sig, 248 /* FunctionDeclaration */, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); // for expressions assigned to `var`s, use the `var` as the text range addResult(ts.setTextRange(decl, sig.declaration && ts.isVariableDeclaration(sig.declaration.parent) && sig.declaration.parent.parent || sig.declaration), modifierFlags); } @@ -49387,7 +48169,7 @@ var ts; } function isNamespaceMember(p) { return !!(p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) || - !(p.flags & 4194304 /* Prototype */ || p.escapedName === "prototype" || p.valueDeclaration && ts.getEffectiveModifierFlags(p.valueDeclaration) & 32 /* Static */ && ts.isClassLike(p.valueDeclaration.parent)); + !(p.flags & 4194304 /* Prototype */ || p.escapedName === "prototype" || p.valueDeclaration && ts.isClassLike(p.valueDeclaration.parent)); } function serializeAsClass(symbol, localName, modifierFlags) { var _a; @@ -49438,14 +48220,13 @@ var ts; !ts.some(getSignaturesOfType(staticType, 1 /* Construct */)); var constructors = isNonConstructableClassLikeInJsFile ? [ts.factory.createConstructorDeclaration(/*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags(8 /* Private */), [], /*body*/ undefined)] : - serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 166 /* Constructor */); + serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 165 /* Constructor */); var indexSignatures = serializeIndexSignatures(classType, baseTypes[0]); addResult(ts.setTextRange(ts.factory.createClassDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, localName, typeParamDecls, heritageClauses, __spreadArrays(indexSignatures, staticMembers, constructors, publicProperties, privateProperties)), symbol.declarations && ts.filter(symbol.declarations, function (d) { return ts.isClassDeclaration(d) || ts.isClassExpression(d); })[0]), modifierFlags); } function serializeAsAlias(symbol, localName, modifierFlags) { - var _a, _b, _c, _d, _e; // synthesize an alias, eg `export { symbolName as Name }` // need to mark the alias `symbol` points at // as something we need to serialize as a private declaration as well @@ -49464,66 +48245,23 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 198 /* BindingElement */: - if (((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.kind) === 249 /* VariableDeclaration */) { - // const { SomeClass } = require('./lib'); - var specifier_1 = getSpecifierForModuleSymbol(target.parent || target, context); // './lib' - var propertyName = node.propertyName; - addResult(ts.factory.createImportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1)), 0 /* None */); - break; - } - // We don't know how to serialize this (nested?) binding element - ts.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization"); - break; - case 289 /* ShorthandPropertyAssignment */: - if (((_e = (_d = node.parent) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.kind) === 216 /* BinaryExpression */) { - // module.exports = { SomeClass } - serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), targetName); - } - break; - case 249 /* VariableDeclaration */: - // commonjs require: const x = require('y') - if (ts.isPropertyAccessExpression(node.initializer)) { - // const x = require('y').z - var initializer = node.initializer; // require('y').z - var uniqueName = ts.factory.createUniqueName(localName); // _x - var specifier_2 = getSpecifierForModuleSymbol(target.parent || target, context); // 'y' - // import _x = require('y'); - addResult(ts.factory.createImportEqualsDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, uniqueName, ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(specifier_2))), 0 /* None */); - // import x = _x.z - addResult(ts.factory.createImportEqualsDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.factory.createIdentifier(localName), ts.factory.createQualifiedName(uniqueName, initializer.name)), modifierFlags); - break; - } - // else fall through and treat commonjs require just like import= - case 260 /* ImportEqualsDeclaration */: - // This _specifically_ only exists to handle json declarations - where we make aliases, but since - // we emit no declarations for the json document, must not refer to it in the declarations - if (target.escapedName === "export=" /* ExportEquals */ && ts.some(target.declarations, ts.isJsonSourceFile)) { - serializeMaybeAliasAssignment(symbol); - break; - } + case 257 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` - var isLocalImport = !(target.flags & 512 /* ValueModule */) && !ts.isVariableDeclaration(node); + var isLocalImport = !(target.flags & 512 /* ValueModule */); addResult(ts.factory.createImportEqualsDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createIdentifier(localName), isLocalImport ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) - : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))), isLocalImport ? modifierFlags : 0 /* None */); + : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.factory.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, ts.factory.createIdentifier(localName), /*namedBindings*/ undefined), @@ -49532,18 +48270,18 @@ var ts; // In such cases, the `target` refers to the module itself already ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*importClause*/ undefined, ts.factory.createNamespaceImport(ts.factory.createIdentifier(localName))), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: addResult(ts.factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, ts.factory.createNamespaceExport(ts.factory.createIdentifier(localName)), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause( @@ -49552,7 +48290,7 @@ var ts; ts.factory.createImportSpecifier(localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName)) ])), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -49560,12 +48298,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.factory.createStringLiteral(specifier.text) : undefined); break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 216 /* BinaryExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 213 /* BinaryExpression */: + case 198 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -49596,7 +48333,7 @@ var ts; var name = ts.unescapeLeadingUnderscores(symbol.escapedName); var isExportEquals = name === "export=" /* ExportEquals */; var isDefault = name === "default" /* Default */; - var isExportAssignmentCompatibleSymbolName = isExportEquals || isDefault; + var isExportAssignment = isExportEquals || isDefault; // synthesize export = ref // ref should refer to either be a locally scoped symbol which we need to emit, or // a reference to another namespace/module which we may need to emit an `import` statement for @@ -49608,8 +48345,8 @@ var ts; // In case `target` refers to a namespace member, look at the declaration and serialize the leftmost symbol in it // eg, `namespace A { export class B {} }; exports = A.B;` // Technically, this is all that's required in the case where the assignment is an entity name expression - var expr = aliasDecl && ((ts.isExportAssignment(aliasDecl) || ts.isBinaryExpression(aliasDecl)) ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl)); - var first_1 = expr && ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; + var expr = isExportAssignment ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl); + var first_1 = ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; var referenced = first_1 && resolveEntityName(first_1, 67108863 /* All */, /*ignoreErrors*/ true, /*dontResolveAlias*/ true, enclosingDeclaration); if (referenced || target) { includePrivateSymbol(referenced || target); @@ -49621,17 +48358,17 @@ var ts; // into the containing scope anyway, so we want to skip the visibility checks. var oldTrack = context.tracker.trackSymbol; context.tracker.trackSymbol = ts.noop; - if (isExportAssignmentCompatibleSymbolName) { + if (isExportAssignment) { results.push(ts.factory.createExportAssignment( /*decorators*/ undefined, /*modifiers*/ undefined, isExportEquals, symbolToExpression(target, context, 67108863 /* All */))); } else { - if (first_1 === expr && first_1) { + if (first_1 === expr) { // serialize as `export {target as name}` serializeExportSpecifier(name, ts.idText(first_1)); } - else if (expr && ts.isClassExpression(expr)) { + else if (ts.isClassExpression(expr)) { serializeExportSpecifier(name, getInternalSymbolName(target, ts.symbolName(target))); } else { @@ -49654,19 +48391,15 @@ var ts; var typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol))); if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) { // If there are no index signatures and `typeToSerialize` is an object type, emit as a namespace instead of a const - serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 1 /* Export */); + serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignment ? 0 /* None */ : 1 /* Export */); } else { var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ ts.factory.createVariableDeclaration(varName, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) ], 2 /* Const */)); - // Inlined JSON types exported with [module.]exports= will already emit an export=, so should use `declare`. - // Otherwise, the type itself should be exported. - addResult(statement, target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ? 2 /* Ambient */ - : name === varName ? 1 /* Export */ - : 0 /* None */); + addResult(statement, name === varName ? 1 /* Export */ : 0 /* None */); } - if (isExportAssignmentCompatibleSymbolName) { + if (isExportAssignment) { results.push(ts.factory.createExportAssignment( /*decorators*/ undefined, /*modifiers*/ undefined, isExportEquals, ts.factory.createIdentifier(varName))); @@ -49687,8 +48420,7 @@ var ts; return ts.getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !getIndexInfoOfType(typeToSerialize, 0 /* String */) && !getIndexInfoOfType(typeToSerialize, 1 /* Number */) && - !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class - !!(ts.length(ts.filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || ts.length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && + !!(ts.length(getPropertiesOfType(typeToSerialize)) || ts.length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !ts.length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && ts.some(typeToSerialize.symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== ctxSrc; })) && @@ -49736,7 +48468,7 @@ var ts; } // This is an else/if as accessors and properties can't merge in TS, but might in JS // If this happens, we assume the accessor takes priority, as it imposes more constraints - else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) { + else if (p.flags & (4 /* Property */ | 3 /* Variable */)) { return ts.setTextRange(createProperty( /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined, isPrivate ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357 @@ -49979,7 +48711,7 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = ts.walkUpParenthesizedTypes(type.symbol.declarations[0].parent); - if (node.kind === 254 /* TypeAliasDeclaration */) { + if (node.kind === 251 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -49987,11 +48719,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 257 /* ModuleBlock */ && + node.parent.kind === 254 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 297 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 294 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -50050,17 +48782,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 249 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 246 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 221 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 218 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -50077,28 +48809,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 325 /* JSDocEnumTag */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 321 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 251 /* FunctionDeclaration */: - case 255 /* EnumDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 248 /* FunctionDeclaration */: + case 252 /* EnumDeclaration */: + case 257 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -50106,55 +48838,55 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 260 /* ImportEqualsDeclaration */ && parent.kind !== 297 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 257 /* ImportEqualsDeclaration */ && parent.kind !== 294 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasEffectiveModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 166 /* Constructor */: - case 170 /* ConstructSignature */: - case 169 /* CallSignature */: - case 171 /* IndexSignature */: - case 160 /* Parameter */: - case 257 /* ModuleBlock */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 177 /* TypeLiteral */: - case 173 /* TypeReference */: - case 178 /* ArrayType */: - case 179 /* TupleType */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: + case 165 /* Constructor */: + case 169 /* ConstructSignature */: + case 168 /* CallSignature */: + case 170 /* IndexSignature */: + case 159 /* Parameter */: + case 254 /* ModuleBlock */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 176 /* TypeLiteral */: + case 172 /* TypeReference */: + case 177 /* ArrayType */: + case 178 /* TupleType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: return false; // Type parameters are always visible - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 297 /* SourceFile */: - case 259 /* NamespaceExportDeclaration */: + case 294 /* SourceFile */: + case 256 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return false; default: return false; @@ -50163,10 +48895,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 266 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 263 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 270 /* ExportSpecifier */) { + else if (node.parent.kind === 267 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -50271,12 +49003,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 249 /* VariableDeclaration */: - case 250 /* VariableDeclarationList */: - case 265 /* ImportSpecifier */: - case 264 /* NamedImports */: - case 263 /* NamespaceImport */: - case 262 /* ImportClause */: + case 246 /* VariableDeclaration */: + case 247 /* VariableDeclarationList */: + case 262 /* ImportSpecifier */: + case 261 /* NamedImports */: + case 260 /* NamespaceImport */: + case 259 /* ImportClause */: return false; default: return true; @@ -50361,13 +49093,9 @@ var ts; var propName = getDestructuringPropertyName(node); if (propName) { var literal = ts.setTextRange(ts.parseNodeFactory.createStringLiteral(propName), node); - var lhsExpr = ts.isLeftHandSideExpression(parentAccess) ? parentAccess : ts.parseNodeFactory.createParenthesizedExpression(parentAccess); - var result = ts.setTextRange(ts.parseNodeFactory.createElementAccessExpression(lhsExpr, literal), node); + var result = ts.setTextRange(ts.parseNodeFactory.createElementAccessExpression(parentAccess, literal), node); ts.setParent(literal, result); ts.setParent(result, node); - if (lhsExpr !== parentAccess) { - ts.setParent(lhsExpr, result); - } result.flowNode = parentAccess.flowNode; return result; } @@ -50376,23 +49104,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 198 /* BindingElement */: - case 288 /* PropertyAssignment */: + case 195 /* BindingElement */: + case 285 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ancestor.initializer; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 198 /* BindingElement */ && parent.kind === 196 /* ObjectBindingPattern */) { + if (node.kind === 195 /* BindingElement */ && parent.kind === 193 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 288 /* PropertyAssignment */ || node.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.kind === 285 /* PropertyAssignment */ || node.kind === 286 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -50418,7 +49146,7 @@ var ts; parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); } var type; - if (pattern.kind === 196 /* ObjectBindingPattern */) { + if (pattern.kind === 193 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -50438,7 +49166,7 @@ var ts; // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name = declaration.propertyName || declaration.name; var indexType = getLiteralTypeFromPropertyName(name); - var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */), declaration.name); + var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, name), declaration.name); type = getFlowTypeOfDestructuring(declaration, declaredType); } } @@ -50446,7 +49174,7 @@ var ts; // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern); + var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */, parentType, undefinedType, pattern); var index_2 = pattern.elements.indexOf(declaration); if (declaration.dotDotDotToken) { // If the parent is a tuple type, the rest element has a tuple type of the @@ -50459,7 +49187,7 @@ var ts; else if (isArrayLikeType(parentType)) { var indexType = getLiteralType(index_2); var accessFlags = hasDefaultValue(declaration) ? 8 /* NoTupleBoundsCheck */ : 0; - var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, declaration.name, accessFlags | 16 /* ExpressionPosition */) || errorType, declaration.name); + var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, declaration.name, accessFlags) || errorType, declaration.name); type = getFlowTypeOfDestructuring(declaration, declaredType); } else { @@ -50491,7 +49219,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 199 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 196 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -50501,11 +49229,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 238 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 235 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 236 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -50542,8 +49270,8 @@ var ts; if (ts.isParameter(declaration)) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 168 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 167 /* GetAccessor */); + if (func.kind === 167 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 166 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -50610,11 +49338,10 @@ var ts; if (symbol.valueDeclaration && ts.isBinaryExpression(symbol.valueDeclaration)) { var links = getSymbolLinks(symbol); if (links.isConstructorDeclaredProperty === undefined) { - links.isConstructorDeclaredProperty = false; links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && ts.every(symbol.declarations, function (declaration) { return ts.isBinaryExpression(declaration) && - isPossiblyAliasedThisProperty(declaration) && - (declaration.left.kind !== 202 /* ElementAccessExpression */ || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && + ts.getAssignmentDeclarationKind(declaration) === 4 /* ThisProperty */ && + (declaration.left.kind !== 199 /* ElementAccessExpression */ || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(/*declaredType*/ undefined, declaration, symbol, declaration); }); } @@ -50633,16 +49360,13 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; var container = ts.getThisContainer(declaration, /*includeArrowFunctions*/ false); - if (container && (container.kind === 166 /* Constructor */ || isJSConstructor(container))) { + if (container && (container.kind === 165 /* Constructor */ || isJSConstructor(container))) { return container; } } } function getFlowTypeInConstructor(symbol, constructor) { - var accessName = ts.startsWith(symbol.escapedName, "__#") - ? ts.factory.createPrivateIdentifier(symbol.escapedName.split("@")[1]) - : ts.unescapeLeadingUnderscores(symbol.escapedName); - var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), accessName); + var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), ts.unescapeLeadingUnderscores(symbol.escapedName)); ts.setParent(reference.expression, reference); ts.setParent(reference, constructor); reference.flowNode = constructor.returnFlowNode; @@ -50690,7 +49414,7 @@ var ts; var kind = ts.isAccessExpression(expression) ? ts.getAssignmentDeclarationPropertyAccessKind(expression) : ts.getAssignmentDeclarationKind(expression); - if (kind === 4 /* ThisProperty */ || ts.isBinaryExpression(expression) && isPossiblyAliasedThisProperty(expression, kind)) { + if (kind === 4 /* ThisProperty */) { if (isDeclarationInConstructor(expression)) { definedInConstructor = true; } @@ -50807,7 +49531,6 @@ var ts; var exportedType = resolveStructuredTypeMembers(type); var members_4 = ts.createSymbolTable(); ts.copyEntries(exportedType.members, members_4); - var initialSize = members_4.size; if (resolvedSymbol && !resolvedSymbol.exports) { resolvedSymbol.exports = ts.createSymbolTable(); } @@ -50846,12 +49569,8 @@ var ts; members_4.set(name, s); } }); - var result = createAnonymousType(initialSize !== members_4.size ? undefined : exportedType.symbol, // Only set the type's symbol if it looks to be the same as the original type - members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo); + var result = createAnonymousType(exportedType.symbol, members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo); result.objectFlags |= (ts.getObjectFlags(type) & 16384 /* JSLiteral */); // Propagate JSLiteral flag - if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) { - result.objectFlags |= 1073741824 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type - } return result; } if (isEmptyArrayLiteralType(type)) { @@ -50869,9 +49588,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 166 /* Constructor */ || - thisContainer.kind === 251 /* FunctionDeclaration */ || - (thisContainer.kind === 208 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 165 /* Constructor */ || + thisContainer.kind === 248 /* FunctionDeclaration */ || + (thisContainer.kind === 205 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -50941,7 +49660,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var restElement = lastElement && lastElement.kind === 198 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : undefined; + var restElement = lastElement && lastElement.kind === 195 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : undefined; if (elements.length === 0 || elements.length === 1 && restElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -50966,7 +49685,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 196 /* ObjectBindingPattern */ + return pattern.kind === 193 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -51005,7 +49724,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 160 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 159 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -51068,7 +49787,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 266 /* ExportAssignment */) { + if (declaration.kind === 263 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -51139,7 +49858,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 167 /* GetAccessor */) { + if (accessor.kind === 166 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -51173,15 +49892,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 166 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 168 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 166 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 167 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -51232,9 +49951,9 @@ var ts; var links = getSymbolLinks(symbol); var originalLinks = links; if (!links.type) { - var expando = symbol.valueDeclaration && getSymbolOfExpando(symbol.valueDeclaration, /*allowDeclaration*/ false); - if (expando) { - var merged = mergeJSSymbols(symbol, expando); + var jsDeclaration = symbol.valueDeclaration && ts.getDeclarationOfExpando(symbol.valueDeclaration); + if (jsDeclaration) { + var merged = mergeJSSymbols(symbol, getSymbolOfNode(jsDeclaration)); if (merged) { // note:we overwrite links because we just cloned the symbol symbol = links = merged; @@ -51249,9 +49968,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration && (declaration.kind === 216 /* BinaryExpression */ || + else if (declaration && (declaration.kind === 213 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 216 /* BinaryExpression */)) { + declaration.parent.kind === 213 /* BinaryExpression */)) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -51318,7 +50037,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 160 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 159 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -51417,43 +50136,43 @@ var ts; return undefined; } switch (node.kind) { - case 232 /* VariableStatement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 308 /* JSDocFunctionType */: - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: - case 331 /* JSDocTypedefTag */: - case 325 /* JSDocEnumTag */: - case 324 /* JSDocCallbackTag */: - case 190 /* MappedType */: - case 184 /* ConditionalType */: + case 229 /* VariableStatement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 304 /* JSDocFunctionType */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: + case 327 /* JSDocTypedefTag */: + case 321 /* JSDocEnumTag */: + case 320 /* JSDocCallbackTag */: + case 189 /* MappedType */: + case 183 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 190 /* MappedType */) { + if (node.kind === 189 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 184 /* ConditionalType */) { + else if (node.kind === 183 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } - else if (node.kind === 232 /* VariableStatement */ && !ts.isInJSFile(node)) { + else if (node.kind === 229 /* VariableStatement */ && !ts.isInJSFile(node)) { break; } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */ || node.kind === 253 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */ || node.kind === 250 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: var paramSymbol = ts.getParameterSymbolFromJSDoc(node); if (paramSymbol) { node = paramSymbol.valueDeclaration; @@ -51464,7 +50183,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 250 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -51474,9 +50193,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 253 /* InterfaceDeclaration */ || - node.kind === 252 /* ClassDeclaration */ || - node.kind === 221 /* ClassExpression */ || + if (node.kind === 250 /* InterfaceDeclaration */ || + node.kind === 249 /* ClassDeclaration */ || + node.kind === 218 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -51620,7 +50339,7 @@ var ts; if (!popTypeResolution()) { for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 252 /* ClassDeclaration */ || declaration.kind === 253 /* InterfaceDeclaration */) { + if (declaration.kind === 249 /* ClassDeclaration */ || declaration.kind === 250 /* InterfaceDeclaration */) { reportCircularBaseType(declaration, type); } } @@ -51715,7 +50434,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 253 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 250 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -51751,7 +50470,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 253 /* InterfaceDeclaration */) { + if (declaration.kind === 250 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -51839,7 +50558,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 216 /* BinaryExpression */) { + else if (expr.kind === 213 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -51854,12 +50573,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 78 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -51873,7 +50592,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 255 /* EnumDeclaration */) { + if (declaration.kind === 252 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -51900,7 +50619,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 255 /* EnumDeclaration */) { + if (declaration.kind === 252 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -51973,21 +50692,21 @@ var ts; function isThislessType(node) { switch (node.kind) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: - case 145 /* ObjectKeyword */: + case 147 /* SymbolKeyword */: + case 144 /* ObjectKeyword */: case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: - case 191 /* LiteralType */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: + case 190 /* LiteralType */: return true; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return isThislessType(node.elementType); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -52013,7 +50732,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 166 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 165 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -52029,14 +50748,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -52241,7 +50960,7 @@ var ts; links[resolutionKind] = earlySymbols || emptySymbols; // fill in any as-yet-unresolved late-bound members. var lateSymbols = ts.createSymbolTable(); - for (var _i = 0, _a = symbol.declarations || ts.emptyArray; _i < _a.length; _i++) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var members = ts.getMembersOfDeclaration(decl); if (members) { @@ -52260,7 +50979,7 @@ var ts; var member = decls_1[_c]; var assignmentKind = ts.getAssignmentDeclarationKind(member); var isInstanceMember = assignmentKind === 3 /* PrototypeProperty */ - || ts.isBinaryExpression(member) && isPossiblyAliasedThisProperty(member, assignmentKind) + || assignmentKind === 4 /* ThisProperty */ || assignmentKind === 9 /* ObjectDefinePrototypeProperty */ || assignmentKind === 6 /* Prototype */; // A straight `Prototype` assignment probably can never have a computed name if (isStatic === !isInstanceMember && hasLateBindableName(member)) { @@ -52383,7 +51102,6 @@ var ts; sig.resolvedReturnType = resolvedReturnType; sig.resolvedTypePredicate = resolvedTypePredicate; sig.minArgumentCount = minArgumentCount; - sig.resolvedMinArgumentCount = undefined; sig.target = undefined; sig.mapper = undefined; sig.unionSignatures = undefined; @@ -52627,8 +51345,8 @@ var ts; function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; - for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { - var type = types_4[_i]; + for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { + var type = types_3[_i]; var indexInfo = getIndexInfoOfType(getApparentType(type), kind); if (!indexInfo) { return undefined; @@ -52827,6 +51545,9 @@ var ts; // bound includes those keys that are known to always be present, for example because // because of constraints on type parameters (e.g. 'keyof T' for a constrained T). function getLowerBoundOfKeyType(type) { + if (type.flags & (1 /* Any */ | 131068 /* Primitive */)) { + return type; + } if (type.flags & 4194304 /* Index */) { var t = getApparentType(type.type); return isGenericTupleType(t) ? getKnownKeysOfTupleType(t) : getIndexType(t); @@ -52847,7 +51568,7 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return getIntersectionType(ts.sameMap(type.types, getLowerBoundOfKeyType)); } - return type; + return neverType; } /** Resolve the members of a mapped type { [P in K]: T } */ function resolveMappedTypeMembers(type) { @@ -52860,7 +51581,6 @@ var ts; // and T as the template type. var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); - var nameType = getNameTypeFromMappedType(type.target || type); var templateType = getTemplateTypeFromMappedType(type.target || type); var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' var templateModifiers = getMappedTypeModifiers(type); @@ -52882,25 +51602,25 @@ var ts; forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType); } setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); - function addMemberForKeyType(keyType) { - var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType; - forEachType(propNameType, function (t) { return addMemberForKeyTypeWorker(keyType, t); }); - } - function addMemberForKeyTypeWorker(keyType, propNameType) { + function addMemberForKeyType(t) { + // Create a mapper from T to the current iteration type constituent. Then, if the + // mapped type is itself an instantiated type, combine the iteration mapper with the + // instantiation mapper. + var templateMapper = appendTypeMapping(type.mapper, typeParameter, t); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. - if (isTypeUsableAsPropertyName(propNameType)) { - var propName = getPropertyNameFromType(propNameType); + if (isTypeUsableAsPropertyName(t)) { + var propName = getPropertyNameFromType(t); // String enum members from separate enums with identical values // are distinct types with the same property name. Make the resulting // property symbol's name type be the union of those enum member types. var existingProp = members.get(propName); if (existingProp) { - existingProp.nameType = getUnionType([existingProp.nameType, propNameType]); - existingProp.keyType = getUnionType([existingProp.keyType, keyType]); + existingProp.nameType = getUnionType([existingProp.nameType, t]); + existingProp.mapper = appendTypeMapping(type.mapper, typeParameter, existingProp.nameType); } else { - var modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : undefined; + var modifiersProp = getPropertyOfType(modifiersType, propName); var isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */); var isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || @@ -52908,19 +51628,19 @@ var ts; var stripOptional = strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */; var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0)); prop.mappedType = type; - prop.nameType = propNameType; - prop.keyType = keyType; if (modifiersProp) { prop.syntheticOrigin = modifiersProp; prop.declarations = modifiersProp.declarations; } + prop.nameType = t; + prop.mapper = templateMapper; members.set(propName, prop); } } - else if (propNameType.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 32 /* Enum */)) { - var propType = instantiateType(templateType, appendTypeMapping(type.mapper, typeParameter, keyType)); - if (propNameType.flags & (1 /* Any */ | 4 /* String */)) { - stringIndexInfo = createIndexInfo(stringIndexInfo ? getUnionType([stringIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */)); + else if (t.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 32 /* Enum */)) { + var propType = instantiateType(templateType, templateMapper); + if (t.flags & (1 /* Any */ | 4 /* String */)) { + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1 /* IncludeReadonly */)); } else { numberIndexInfo = createIndexInfo(numberIndexInfo ? getUnionType([numberIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */)); @@ -52930,14 +51650,12 @@ var ts; } function getTypeOfMappedSymbol(symbol) { if (!symbol.type) { - var mappedType = symbol.mappedType; if (!pushTypeResolution(symbol, 0 /* Type */)) { - mappedType.containsError = true; + symbol.mappedType.containsError = true; return errorType; } - var templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType); - var mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.keyType); - var propType = instantiateType(templateType, mapper); + var templateType = getTemplateTypeFromMappedType(symbol.mappedType.target || symbol.mappedType); + var propType = instantiateType(templateType, symbol.mapper); // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks // mode, if the underlying property is optional we remove 'undefined' from the type. @@ -52945,10 +51663,11 @@ var ts; symbol.checkFlags & 524288 /* StripOptional */ ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType; if (!popTypeResolution()) { - error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType)); + error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(symbol.mappedType)); type = errorType; } symbol.type = type; + symbol.mapper = undefined; } return symbol.type; } @@ -52960,11 +51679,6 @@ var ts; return type.constraintType || (type.constraintType = getConstraintOfTypeParameter(getTypeParameterFromMappedType(type)) || errorType); } - function getNameTypeFromMappedType(type) { - return type.declaration.nameType ? - type.nameType || (type.nameType = instantiateType(getTypeFromTypeNode(type.declaration.nameType), type.mapper)) : - undefined; - } function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? @@ -52976,8 +51690,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 188 /* TypeOperator */ && - constraintDeclaration.operator === 138 /* KeyOfKeyword */; + return constraintDeclaration.kind === 187 /* TypeOperator */ && + constraintDeclaration.operator === 137 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -53111,8 +51825,8 @@ var ts; return getAugmentedPropertiesOfType(unionType); } var props = ts.createSymbolTable(); - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var memberType = types_5[_i]; + for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { + var memberType = types_4[_i]; for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) { var escapedName = _b[_a].escapedName; if (!props.has(escapedName)) { @@ -53144,14 +51858,14 @@ var ts; function getConstraintFromIndexedAccess(type) { var indexConstraint = getSimplifiedTypeOrConstraint(type.indexType); if (indexConstraint && indexConstraint !== type.indexType) { - var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.noUncheckedIndexedAccessCandidate); + var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint); if (indexedAccess) { return indexedAccess; } } var objectConstraint = getSimplifiedTypeOrConstraint(type.objectType); if (objectConstraint && objectConstraint !== type.objectType) { - return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType, type.noUncheckedIndexedAccessCandidate); + return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType); } return undefined; } @@ -53200,9 +51914,9 @@ var ts; function getEffectiveConstraintOfIntersection(types, targetIsUnion) { var constraints; var hasDisjointDomainType = false; - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var t = types_6[_i]; - if (t.flags & 465829888 /* Instantiable */) { + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var t = types_5[_i]; + if (t.flags & 63176704 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -53216,7 +51930,7 @@ var ts; } } } - else if (t.flags & 469892092 /* DisjointDomains */) { + else if (t.flags & 67238908 /* DisjointDomains */) { hasDisjointDomainType = true; } } @@ -53226,9 +51940,9 @@ var ts; if (hasDisjointDomainType) { // We add any types belong to one of the disjoint domains because they might cause the final // intersection operation to reduce the union constraints. - for (var _a = 0, types_7 = types; _a < types_7.length; _a++) { - var t = types_7[_a]; - if (t.flags & 469892092 /* DisjointDomains */) { + for (var _a = 0, types_6 = types; _a < types_6.length; _a++) { + var t = types_6[_a]; + if (t.flags & 67238908 /* DisjointDomains */) { constraints = ts.append(constraints, t); } } @@ -53238,7 +51952,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) { + if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -53260,12 +51974,9 @@ var ts; * circularly references the type variable. */ function getResolvedBaseConstraint(type) { - if (type.resolvedBaseConstraint) { - return type.resolvedBaseConstraint; - } var nonTerminating = false; - var stack = []; - return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type); + return type.resolvedBaseConstraint || + (type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type)); function getImmediateBaseConstraint(t) { if (!t.immediateBaseConstraint) { if (!pushTypeResolution(t, 4 /* ImmediateBaseConstraint */)) { @@ -53276,19 +51987,13 @@ var ts; // very high likelihood we're dealing with an infinite generic type that perpetually generates // new type identities as we descend into it. We stop the recursion here and mark this type // and the outer types as having circular constraints. - ts.tracing.instant("check" /* Check */, "getImmediateBaseConstraint_DepthLimit", { typeId: t.id, originalTypeId: type.id, depth: constraintDepth }); error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); nonTerminating = true; return t.immediateBaseConstraint = noConstraintType; } - var result = void 0; - if (!isDeeplyNestedType(t, stack, stack.length)) { - stack.push(t); - constraintDepth++; - result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false)); - constraintDepth--; - stack.pop(); - } + constraintDepth++; + var result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false)); + constraintDepth--; if (!popTypeResolution()) { if (t.flags & 262144 /* TypeParameter */) { var errorNode = getConstraintDeclaration(t); @@ -53322,8 +52027,8 @@ var ts; if (t.flags & 3145728 /* UnionOrIntersection */) { var types = t.types; var baseTypes = []; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var type_3 = types_8[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var type_3 = types_7[_i]; var baseType = getBaseConstraint(type_3); if (baseType) { baseTypes.push(baseType); @@ -53336,19 +52041,10 @@ var ts; if (t.flags & 4194304 /* Index */) { return keyofConstraintType; } - if (t.flags & 134217728 /* TemplateLiteral */) { - var types = t.types; - var constraints = ts.mapDefined(types, getBaseConstraint); - return constraints.length === types.length ? getTemplateLiteralType(t.texts, constraints) : stringType; - } - if (t.flags & 268435456 /* StringMapping */) { - var constraint = getBaseConstraint(t.type); - return constraint ? getStringMappingType(t.symbol, constraint) : stringType; - } if (t.flags & 8388608 /* IndexedAccess */) { var baseObjectType = getBaseConstraint(t.objectType); var baseIndexType = getBaseConstraint(t.indexType); - var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t.noUncheckedIndexedAccessCandidate); + var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType); return baseIndexedAccess && getBaseConstraint(baseIndexedAccess); } if (t.flags & 16777216 /* Conditional */) { @@ -53415,7 +52111,7 @@ var ts; } function getResolvedApparentTypeOfMappedType(type) { var typeVariable = getHomomorphicTypeVariable(type); - if (typeVariable && !type.declaration.nameType) { + if (typeVariable) { var constraint = getConstraintOfTypeParameter(typeVariable); if (constraint && (isArrayType(constraint) || isTupleType(constraint))) { return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper)); @@ -53429,10 +52125,10 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : - t.flags & 402653316 /* StringLike */ ? globalStringType : + t.flags & 132 /* StringLike */ ? globalStringType : t.flags & 296 /* NumberLike */ ? globalNumberType : t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType(/*reportErrors*/ languageVersion >= 7 /* ES2020 */) : t.flags & 528 /* BooleanLike */ ? globalBooleanType : @@ -53757,10 +52453,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 307 /* JSDocOptionalType */ + node.type && node.type.kind === 303 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 303 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -53779,10 +52475,7 @@ var ts; var signature = getSignatureFromDeclaration(node.parent); var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); - // Only consider syntactic or instantiated parameters as optional, not `void` parameters as this function is used - // in grammar checks and checking for `void` too early results in parameter types widening too early - // and causes some noImplicitAny errors to be lost. - return parameterIndex >= getMinArgumentCount(signature, 1 /* StrongArityForUntypedJS */ | 2 /* VoidIsNonOptional */); + return parameterIndex >= getMinArgumentCount(signature, /*strongArityForUntypedJS*/ true); } var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); if (iife) { @@ -53797,7 +52490,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 303 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -53879,7 +52572,7 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 191 /* LiteralType */) { + if (type && type.kind === 190 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter @@ -53892,16 +52585,16 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 167 /* GetAccessor */ || declaration.kind === 168 /* SetAccessor */) && + if ((declaration.kind === 166 /* GetAccessor */ || declaration.kind === 167 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + var otherKind = declaration.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 166 /* Constructor */ ? + var classType = declaration.kind === 165 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -53966,11 +52659,11 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - return node.name.kind === 158 /* ComputedPropertyName */ + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + return node.name.kind === 157 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -54042,7 +52735,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 187 /* ThisType */ ? + return parameterName.kind === 186 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -54085,7 +52778,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 166 /* Constructor */) { + if (declaration.kind === 165 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -54095,12 +52788,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 167 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 166 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 168 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 167 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -54190,7 +52883,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 166 /* Constructor */ || kind === 170 /* ConstructSignature */ || kind === 175 /* ConstructorType */; + var isConstructor = kind === 165 /* Constructor */ || kind === 169 /* ConstructSignature */ || kind === 174 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -54204,7 +52897,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 144 /* NumberKeyword */ : 147 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 143 /* NumberKeyword */ : 146 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -54238,17 +52931,17 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 185 /* InferType */) { + if (declaration.parent.kind === 184 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. - var _b = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _c = _b[0], childTypeParameter = _c === void 0 ? declaration.parent : _c, grandParent = _b[1]; - if (grandParent.kind === 173 /* TypeReference */) { + var grandParent = declaration.parent.parent; + if (grandParent.kind === 172 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { - var index = typeReference.typeArguments.indexOf(childTypeParameter); + var index = typeReference.typeArguments.indexOf(declaration.parent); if (index < typeParameters.length) { var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); if (declaredConstraint) { @@ -54269,16 +52962,11 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter declaration, a rest type // or a named rest tuple element, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 160 /* Parameter */ && grandParent.dotDotDotToken || - grandParent.kind === 181 /* RestType */ || - grandParent.kind === 192 /* NamedTupleMember */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 159 /* Parameter */ && grandParent.dotDotDotToken || + grandParent.kind === 180 /* RestType */ || + grandParent.kind === 191 /* NamedTupleMember */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } - // When an 'infer T' declaration is immediately contained in a string template type, we infer a 'string' - // constraint. - else if (grandParent.kind === 194 /* TemplateLiteralTypeSpan */) { - inferences = ts.append(inferences, stringType); - } } } } @@ -54301,7 +52989,7 @@ var ts; if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), // use unknown otherwise - type = constraintDeclaration.parent.parent.kind === 190 /* MappedType */ ? keyofConstraintType : unknownType; + type = constraintDeclaration.parent.parent.kind === 189 /* MappedType */ ? keyofConstraintType : unknownType; } typeParameter.constraint = type; } @@ -54310,7 +52998,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 159 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 158 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -54343,8 +53031,8 @@ var ts; // that care about the presence of such types at arbitrary depth in a containing type. function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var type = types_9[_i]; + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; if (!(type.flags & excludeKinds)) { result |= ts.getObjectFlags(type); } @@ -54390,8 +53078,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 173 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 172 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 177 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -54433,7 +53121,7 @@ var ts; return errorType; } } - if (node.kind === 173 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 172 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -54446,9 +53134,6 @@ var ts; } function getTypeAliasInstantiation(symbol, typeArguments) { var type = getDeclaredTypeOfSymbol(symbol); - if (type === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName) && typeArguments && typeArguments.length === 1) { - return getStringMappingType(symbol, typeArguments[0]); - } var links = getSymbolLinks(symbol); var typeParameters = links.typeParameters; var id = getTypeListId(typeArguments); @@ -54481,9 +53166,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -54531,7 +53216,8 @@ var ts; } /** * A JSdoc TypeReference may be to a value, but resolve it as a type anyway. - * Example: import('./b').ConstructorFunction + * Note: If the value is imported from commonjs, it should really be an alias, + * but this function's special-case code fakes alias resolution as well. */ function getTypeFromJSDocValueReference(node, symbol) { var links = getNodeLinks(node); @@ -54539,9 +53225,19 @@ var ts; var valueType = getTypeOfSymbol(symbol); var typeType = valueType; if (symbol.valueDeclaration) { - var isImportTypeWithQualifier = node.kind === 195 /* ImportType */ && node.qualifier; + var decl = ts.getRootDeclaration(symbol.valueDeclaration); + var isRequireAlias = false; + if (ts.isVariableDeclaration(decl) && decl.initializer) { + var expr = decl.initializer; + // skip past entity names, eg `require("x").a.b.c` + while (ts.isPropertyAccessExpression(expr)) { + expr = expr.expression; + } + isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; + } + var isImportTypeWithQualifier = node.kind === 192 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} - if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) { + if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); } } @@ -54565,7 +53261,7 @@ var ts; return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 179 /* TupleType */ && node.elements.length === 1; + return node.kind === 178 /* TupleType */ && node.elements.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) : @@ -54574,9 +53270,9 @@ var ts; } function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 311 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 307 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 184 /* ConditionalType */ && node === parent.trueType) { + if (parent.kind === 183 /* ConditionalType */ && node === parent.trueType) { var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); @@ -54587,7 +53283,7 @@ var ts; return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 173 /* TypeReference */ || node.kind === 195 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 172 /* TypeReference */ || node.kind === 192 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -54700,9 +53396,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: return declaration; } } @@ -54823,11 +53519,11 @@ var ts; } function getTupleElementFlags(node) { switch (node.kind) { - case 180 /* OptionalType */: + case 179 /* OptionalType */: return 2 /* Optional */; - case 181 /* RestType */: + case 180 /* RestType */: return getRestTypeElementFlags(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return node.questionToken ? 2 /* Optional */ : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1 /* Required */; @@ -54845,14 +53541,14 @@ var ts; return readonly ? globalReadonlyArrayType : globalArrayType; } var elementFlags = ts.map(node.elements, getTupleElementFlags); - var missingName = ts.some(node.elements, function (e) { return e.kind !== 192 /* NamedTupleMember */; }); + var missingName = ts.some(node.elements, function (e) { return e.kind !== 191 /* NamedTupleMember */; }); return getTupleTargetType(elementFlags, readonly, /*associatedNames*/ missingName ? undefined : node.elements); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 178 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 179 /* TupleType */ ? ts.some(node.elements, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 177 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 178 /* TupleType */ ? ts.some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -54861,18 +53557,18 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: - case 173 /* TypeReference */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 189 /* IndexedAccessType */: - case 184 /* ConditionalType */: - case 188 /* TypeOperator */: - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: + case 172 /* TypeReference */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 188 /* IndexedAccessType */: + case 183 /* ConditionalType */: + case 187 /* TypeOperator */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return isResolvedByTypeAlias(parent); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; } return false; @@ -54881,28 +53577,28 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return true; - case 188 /* TypeOperator */: - return node.operator !== 151 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 186 /* ParenthesizedType */: - case 180 /* OptionalType */: - case 192 /* NamedTupleMember */: - case 307 /* JSDocOptionalType */: - case 305 /* JSDocNullableType */: - case 306 /* JSDocNonNullableType */: - case 301 /* JSDocTypeExpression */: + case 187 /* TypeOperator */: + return node.operator !== 150 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 185 /* ParenthesizedType */: + case 179 /* OptionalType */: + case 191 /* NamedTupleMember */: + case 303 /* JSDocOptionalType */: + case 301 /* JSDocNullableType */: + case 302 /* JSDocNonNullableType */: + case 298 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 181 /* RestType */: - return node.type.kind !== 178 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 180 /* RestType */: + return node.type.kind !== 177 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 181 /* UnionType */: + case 182 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -54915,19 +53611,19 @@ var ts; if (target === emptyGenericType) { links.resolvedType = emptyObjectType; } - else if (!(node.kind === 179 /* TupleType */ && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8 /* Variadic */); })) && isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 179 /* TupleType */ && node.elements.length === 0 ? target : + else if (!(node.kind === 178 /* TupleType */ && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8 /* Variadic */); })) && isDeferredTypeReferenceNode(node)) { + links.resolvedType = node.kind === 178 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); + var elementTypes = node.kind === 177 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); links.resolvedType = createNormalizedTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 142 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 141 /* ReadonlyKeyword */; } function createTupleType(elementTypes, elementFlags, readonly, namedMemberDeclarations) { if (readonly === void 0) { readonly = false; } @@ -55024,9 +53720,7 @@ var ts; // Transform [A, ...(X | Y | Z)] into [A, ...X] | [A, ...Y] | [A, ...Z] var unionIndex = ts.findIndex(elementTypes, function (t, i) { return !!(target.elementFlags[i] & 8 /* Variadic */ && t.flags & (131072 /* Never */ | 1048576 /* Union */)); }); if (unionIndex >= 0) { - return checkCrossProductUnion(ts.map(elementTypes, function (t, i) { return target.elementFlags[i] & 8 /* Variadic */ ? t : unknownType; })) ? - mapType(elementTypes[unionIndex], function (t) { return createNormalizedTupleType(target, ts.replaceElement(elementTypes, unionIndex, t)); }) : - errorType; + return mapType(elementTypes[unionIndex], function (t) { return createNormalizedTupleType(target, ts.replaceElement(elementTypes, unionIndex, t)); }); } // If there are no variadic elements with non-generic types, just create a type reference with the same target type. var spreadIndex = ts.findIndex(elementTypes, function (t, i) { return !!(target.elementFlags[i] & 8 /* Variadic */) && !(t.flags & 58982400 /* InstantiableNonPrimitive */) && !isGenericMappedType(t); }); @@ -55140,8 +53834,8 @@ var ts; } // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { - includes |= flags & 205258751 /* IncludesMask */; - if (flags & 469499904 /* StructuredOrInstantiable */) + includes |= flags & 71041023 /* IncludesMask */; + if (flags & 66846720 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -55162,8 +53856,8 @@ var ts; // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. function addTypesToUnion(typeSet, includes, types) { - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var type = types_10[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var type = types_9[_i]; includes = addTypeToUnion(typeSet, includes, type); } return includes; @@ -55192,8 +53886,8 @@ var ts; while (i > 0) { i--; var source = types[i]; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var target = types_11[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var target = types_10[_i]; if (source !== target) { if (count === 100000) { // After 100000 subtype checks we estimate the remaining amount of work by assuming the @@ -55203,7 +53897,6 @@ var ts; // caps union types at 5000 unique literal types and 1000 unique object types. var estimatedCount = (count / (len - i)) * len; if (estimatedCount > (primitivesOnly ? 25000000 : 1000000)) { - ts.tracing.instant("check" /* Check */, "removeSubtypes_DepthLimit", { typeIds: types.map(function (t) { return t.id; }) }); error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return false; } @@ -55235,22 +53928,6 @@ var ts; } } } - function removeStringLiteralsMatchedByTemplateLiterals(types) { - var templates = ts.filter(types, isPatternLiteralType); - if (templates.length) { - var i = types.length; - var _loop_14 = function () { - i--; - var t = types[i]; - if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeSubtypeOf(t, template); })) { - ts.orderedRemoveItemAt(types, i); - } - }; - while (i > 0) { - _loop_14(); - } - } - } // We sort and deduplicate the constituent types based on object identity. If the subtypeReduction // flag is specified we also reduce the constituent type set to only include types that aren't subtypes // of other types. Subtype reduction is expensive for large union types and is possible only when union @@ -55277,9 +53954,6 @@ var ts; if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */)) { removeRedundantLiteralTypes(typeSet, includes); } - if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) { - removeStringLiteralsMatchedByTemplateLiterals(typeSet); - } break; case 2 /* Subtype */: if (!removeSubtypes(typeSet, !(includes & 262144 /* IncludesStructuredOrInstantiable */))) { @@ -55293,7 +53967,7 @@ var ts; neverType; } } - var objectFlags = (includes & 469647395 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -55385,15 +54059,15 @@ var ts; } typeSet.set(type.id.toString(), type); } - includes |= flags & 205258751 /* IncludesMask */; + includes |= flags & 71041023 /* IncludesMask */; } return includes; } // Add the given types to the given type set. Order is preserved, freshness is removed from literal // types, duplicates are removed, and nested types of the given kind are flattened into the set. function addTypesToIntersection(typeSet, includes, types) { - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var type = types_12[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var type = types_11[_i]; includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); } return includes; @@ -55431,31 +54105,6 @@ var ts; } return true; } - /** - * Returns `true` if the intersection of the template literals and string literals is the empty set, eg `get${string}` & "setX", and should reduce to `never` - */ - function extractRedundantTemplateLiterals(types) { - var i = types.length; - var literals = ts.filter(types, function (t) { return !!(t.flags & 128 /* StringLiteral */); }); - while (i > 0) { - i--; - var t = types[i]; - if (!(t.flags & 134217728 /* TemplateLiteral */)) - continue; - for (var _i = 0, literals_1 = literals; _i < literals_1.length; _i++) { - var t2 = literals_1[_i]; - if (isTypeSubtypeOf(t2, t)) { - // eg, ``get${T}` & "getX"` is just `"getX"` - ts.orderedRemoveItemAt(types, i); - break; - } - else if (isPatternLiteralType(t)) { - return true; - } - } - } - return false; - } function extractIrreducible(types, flag) { if (ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) { for (var i = 0; i < types.length; i++) { @@ -55544,15 +54193,12 @@ var ts; // a non-primitive type and a type known to be primitive. if (includes & 131072 /* Never */ || strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) || - includes & 67108864 /* NonPrimitive */ && includes & (469892092 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || - includes & 402653316 /* StringLike */ && includes & (469892092 /* DisjointDomains */ & ~402653316 /* StringLike */) || - includes & 296 /* NumberLike */ && includes & (469892092 /* DisjointDomains */ & ~296 /* NumberLike */) || - includes & 2112 /* BigIntLike */ && includes & (469892092 /* DisjointDomains */ & ~2112 /* BigIntLike */) || - includes & 12288 /* ESSymbolLike */ && includes & (469892092 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || - includes & 49152 /* VoidLike */ && includes & (469892092 /* DisjointDomains */ & ~49152 /* VoidLike */)) { - return neverType; - } - if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) { + includes & 67108864 /* NonPrimitive */ && includes & (67238908 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || + includes & 132 /* StringLike */ && includes & (67238908 /* DisjointDomains */ & ~132 /* StringLike */) || + includes & 296 /* NumberLike */ && includes & (67238908 /* DisjointDomains */ & ~296 /* NumberLike */) || + includes & 2112 /* BigIntLike */ && includes & (67238908 /* DisjointDomains */ & ~2112 /* BigIntLike */) || + includes & 12288 /* ESSymbolLike */ && includes & (67238908 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || + includes & 49152 /* VoidLike */ && includes & (67238908 /* DisjointDomains */ & ~49152 /* VoidLike */)) { return neverType; } if (includes & 1 /* Any */) { @@ -55596,7 +54242,9 @@ var ts; // We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of // the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain. // If the estimated size of the resulting union type exceeds 100000 constituents, report an error. - if (!checkCrossProductUnion(typeSet)) { + var size = ts.reduceLeft(typeSet, function (n, t) { return n * (t.flags & 1048576 /* Union */ ? t.types.length : 1); }, 1); + if (size >= 100000) { + error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return errorType; } var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 1048576 /* Union */) !== 0; }); @@ -55611,15 +54259,6 @@ var ts; } return result; } - function checkCrossProductUnion(types) { - var size = ts.reduceLeft(types, function (n, t) { return n * (t.flags & 1048576 /* Union */ ? t.types.length : t.flags & 131072 /* Never */ ? 0 : 1); }, 1); - if (size >= 100000) { - ts.tracing.instant("check" /* Check */, "checkCrossProductUnion_DepthLimit", { typeIds: types.map(function (t) { return t.id; }), size: size }); - error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); - return false; - } - return true; - } function getTypeFromIntersectionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -55639,24 +54278,6 @@ var ts; type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, /*stringsOnly*/ true)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, /*stringsOnly*/ false)); } - function getIndexTypeForMappedType(type, noIndexSignatures) { - var constraint = filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }); - var nameType = type.declaration.nameType && getTypeFromTypeNode(type.declaration.nameType); - return nameType ? - mapType(constraint, function (t) { return instantiateType(nameType, appendTypeMapping(type.mapper, getTypeParameterFromMappedType(type), t)); }) : - constraint; - } - // Ordinarily we reduce a keyof M where M is a mapped type { [P in K as N

]: X } to simply N. This however presumes - // that N distributes over union types, i.e. that N is equivalent to N | N | N. That presumption is - // generally true, except when N is a non-distributive conditional type or an instantiable type with non-distributive - // conditional type as a constituent. In those cases, we cannot reduce keyof M and need to preserve it as is. - function isNonDistributiveNameType(type) { - return !!(type && (type.flags & 16777216 /* Conditional */ && !type.root.isDistributive || - type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && ts.some(type.types, isNonDistributiveNameType) || - type.flags & (4194304 /* Index */ | 268435456 /* StringMapping */) && isNonDistributiveNameType(type.type) || - type.flags & 8388608 /* IndexedAccess */ && isNonDistributiveNameType(type.indexType) || - type.flags & 33554432 /* Substitution */ && isNonDistributiveNameType(type.substitute))); - } function getLiteralTypeFromPropertyName(name) { if (ts.isPrivateIdentifier(name)) { return neverType; @@ -55700,8 +54321,8 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && isNonDistributiveNameType(getNameTypeFromMappedType(type)) ? getIndexTypeForGenericType(type, stringsOnly) : - ts.getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, noIndexSignatures) : + type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) ? getIndexTypeForGenericType(type, stringsOnly) : + ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : @@ -55725,15 +54346,15 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 138 /* KeyOfKeyword */: + case 137 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 151 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 148 /* SymbolKeyword */ + case 150 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 147 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; default: @@ -55742,115 +54363,12 @@ var ts; } return links.resolvedType; } - function getTypeFromTemplateTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getTemplateLiteralType(__spreadArrays([node.head.text], ts.map(node.templateSpans, function (span) { return span.literal.text; })), ts.map(node.templateSpans, function (span) { return getTypeFromTypeNode(span.type); })); - } - return links.resolvedType; - } - function getTemplateLiteralType(texts, types) { - var unionIndex = ts.findIndex(types, function (t) { return !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)); }); - if (unionIndex >= 0) { - return checkCrossProductUnion(types) ? - mapType(types[unionIndex], function (t) { return getTemplateLiteralType(texts, ts.replaceElement(types, unionIndex, t)); }) : - errorType; - } - if (ts.contains(types, wildcardType)) { - return wildcardType; - } - var newTypes = []; - var newTexts = []; - var text = texts[0]; - if (!addSpans(texts, types)) { - return stringType; - } - if (newTypes.length === 0) { - return getLiteralType(text); - } - newTexts.push(text); - var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join(""); - var type = templateLiteralTypes.get(id); - if (!type) { - templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes)); - } - return type; - function addSpans(texts, types) { - for (var i = 0; i < types.length; i++) { - var t = types[i]; - if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) { - text += getTemplateStringForType(t) || ""; - text += texts[i + 1]; - } - else if (t.flags & 134217728 /* TemplateLiteral */) { - text += t.texts[0]; - if (!addSpans(t.texts, t.types)) - return false; - text += texts[i + 1]; - } - else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) { - newTypes.push(t); - newTexts.push(text); - text = texts[i + 1]; - } - else { - return false; - } - } - return true; - } - } - function getTemplateStringForType(type) { - return type.flags & 128 /* StringLiteral */ ? type.value : - type.flags & 256 /* NumberLiteral */ ? "" + type.value : - type.flags & 2048 /* BigIntLiteral */ ? ts.pseudoBigIntToString(type.value) : - type.flags & 512 /* BooleanLiteral */ ? type.intrinsicName : - type.flags & 65536 /* Null */ ? "null" : - type.flags & 32768 /* Undefined */ ? "undefined" : - undefined; - } - function createTemplateLiteralType(texts, types) { - var type = createType(134217728 /* TemplateLiteral */); - type.texts = texts; - type.types = types; - return type; - } - function getStringMappingType(symbol, type) { - return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) : - isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) : - type.flags & 128 /* StringLiteral */ ? getLiteralType(applyStringMapping(symbol, type.value)) : - type; - } - function applyStringMapping(symbol, str) { - switch (intrinsicTypeKinds.get(symbol.escapedName)) { - case 0 /* Uppercase */: return str.toUpperCase(); - case 1 /* Lowercase */: return str.toLowerCase(); - case 2 /* Capitalize */: return str.charAt(0).toUpperCase() + str.slice(1); - case 3 /* Uncapitalize */: return str.charAt(0).toLowerCase() + str.slice(1); - } - return str; - } - function getStringMappingTypeForGenericType(symbol, type) { - var id = getSymbolId(symbol) + "," + getTypeId(type); - var result = stringMappingTypes.get(id); - if (!result) { - stringMappingTypes.set(id, result = createStringMappingType(symbol, type)); - } - return result; - } - function createStringMappingType(symbol, type) { - var result = createType(268435456 /* StringMapping */); - result.symbol = symbol; - result.type = type; - return result; - } - function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined) { + function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments) { var type = createType(8388608 /* IndexedAccess */); type.objectType = objectType; type.indexType = indexType; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; - type.noUncheckedIndexedAccessCandidate = shouldIncludeUndefined; return type; } /** @@ -55875,13 +54393,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -55896,15 +54414,15 @@ var ts; || !ts.isCallLikeExpression(ts.findAncestor(node, function (n) { return !ts.isAccessExpression(n); }) || node.parent) && ts.every(symbol.declarations, function (d) { return !ts.isFunctionLike(d) || !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }); } - function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, noUncheckedIndexedAccessCandidate, reportDeprecated) { - var _a; - var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined; + function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, reportDeprecated) { + var _a, _b; + var accessExpression = accessNode && accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); if (prop) { - if (reportDeprecated && accessNode && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) { - var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); + if (reportDeprecated && accessNode && ((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.flags) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) { + var deprecatedNode = (_b = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _b !== void 0 ? _b : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); errorOrSuggestion(/* isError */ false, deprecatedNode, ts.Diagnostics._0_is_deprecated, propName); } if (accessExpression) { @@ -55936,13 +54454,10 @@ var ts; } } errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, 1 /* Number */)); - return mapType(objectType, function (t) { - var restType = getRestTypeOfTupleType(t) || undefinedType; - return noUncheckedIndexedAccessCandidate ? getUnionType([restType, undefinedType]) : restType; - }); + return mapType(objectType, function (t) { return getRestTypeOfTupleType(t) || undefinedType; }); } } - if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) { + if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) { if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) { return objectType; } @@ -55958,10 +54473,10 @@ var ts; if (accessNode && !isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) { var indexNode = getIndexNodeForAccessExpression(accessNode); error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); - return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + return indexInfo.type; } errorIfWritingToReadonlyIndex(indexInfo); - return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + return indexInfo.type; } if (indexType.flags & 131072 /* Never */) { return neverType; @@ -56045,17 +54560,11 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 189 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 158 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 188 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 157 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } - function isPatternLiteralPlaceholderType(type) { - return templateConstraintType.types.indexOf(type) !== -1 || !!(type.flags & 1 /* Any */); - } - function isPatternLiteralType(type) { - return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType); - } function isGenericObjectType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { if (!(type.objectFlags & 4194304 /* IsGenericObjectTypeComputed */)) { @@ -56074,7 +54583,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) && !isPatternLiteralType(type); + return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -56127,7 +54636,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 465829888 /* Instantiable */)) { + if (!(indexType.flags & 63176704 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -56190,9 +54699,8 @@ var ts; var templateMapper = combineTypeMappers(objectType.mapper, mapper); return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); } - function getIndexedAccessType(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, aliasSymbol, aliasTypeArguments, accessFlags) { - if (accessFlags === void 0) { accessFlags = 0 /* None */; } - return getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType); + function getIndexedAccessType(objectType, indexType, accessNode, aliasSymbol, aliasTypeArguments) { + return getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, 0 /* None */, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType); } function indexTypeLessThan(indexType, limit) { return everyType(indexType, function (t) { @@ -56206,14 +54714,11 @@ var ts; return false; }); } - function getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) { + function getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) { if (accessFlags === void 0) { accessFlags = 0 /* None */; } if (objectType === wildcardType || indexType === wildcardType) { return wildcardType; } - var shouldIncludeUndefined = noUncheckedIndexedAccessCandidate || - (!!compilerOptions.noUncheckedIndexedAccess && - (accessFlags & (2 /* Writing */ | 16 /* ExpressionPosition */)) === 16 /* ExpressionPosition */); // If the object type has a string index signature and no other members we know that the result will // always be the type of that index signature and we can simplify accordingly. if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) { @@ -56225,17 +54730,17 @@ var ts; // for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in an expression. This is to // preserve backwards compatibility. For example, an element access 'this["foo"]' has always been resolved // eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 189 /* IndexedAccessType */ ? + if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 188 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } // Defer the operation by creating an indexed access type. - var id = objectType.id + "," + indexType.id + (shouldIncludeUndefined ? "?" : ""); + var id = objectType.id + "," + indexType.id; var type = indexedAccessTypes.get(id); if (!type) { - indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined)); + indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments)); } return type; } @@ -56248,7 +54753,7 @@ var ts; var wasMissingProp = false; for (var _i = 0, _a = indexType.types; _i < _a.length; _i++) { var t = _a[_i]; - var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags, shouldIncludeUndefined); + var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags); if (propType) { propTypes.push(propType); } @@ -56264,11 +54769,9 @@ var ts; if (wasMissingProp) { return undefined; } - return accessFlags & 2 /* Writing */ - ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) - : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments); + return accessFlags & 2 /* Writing */ ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments); } - return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, /* supressNoImplicitAnyError */ false, accessNode, accessFlags | 4 /* CacheSymbol */, shouldIncludeUndefined, /* reportDeprecated */ true); + return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, /* supressNoImplicitAnyError */ false, accessNode, accessFlags | 4 /* CacheSymbol */, /* reportDeprecated */ true); } function getTypeFromIndexedAccessTypeNode(node) { var links = getNodeLinks(node); @@ -56276,7 +54779,7 @@ var ts; var objectType = getTypeFromTypeNode(node.objectType); var indexType = getTypeFromTypeNode(node.indexType); var potentialAlias = getAliasSymbolForTypeNode(node); - var resolved = getIndexedAccessType(objectType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); + var resolved = getIndexedAccessType(objectType, indexType, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); links.resolvedType = resolved.flags & 8388608 /* IndexedAccess */ && resolved.objectType === objectType && resolved.indexType === indexType ? @@ -56311,7 +54814,7 @@ var ts; function getConditionalType(root, mapper) { var result; var extraTypes; - var _loop_15 = function () { + var _loop_14 = function () { var checkType = instantiateType(root.checkType, mapper); var checkTypeInstantiable = isGenericObjectType(checkType) || isGenericIndexType(checkType); var extendsType = instantiateType(root.extendsType, mapper); @@ -56344,11 +54847,11 @@ var ts; if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) { // Return union of trueType and falseType for 'any' since it matches anything if (checkType.flags & 1 /* Any */) { - (extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper)); + (extraTypes || (extraTypes = [])).push(instantiateTypeWithoutDepthIncrease(root.trueType, combinedMapper || mapper)); } // If falseType is an immediately nested conditional type that isn't distributive or has an // identical checkType, switch to that type and loop. - var falseType_1 = getTypeFromTypeNode(root.node.falseType); + var falseType_1 = root.falseType; if (falseType_1.flags & 16777216 /* Conditional */) { var newRoot = falseType_1.root; if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) { @@ -56356,7 +54859,7 @@ var ts; return "continue"; } } - result = instantiateType(falseType_1, mapper); + result = instantiateTypeWithoutDepthIncrease(falseType_1, mapper); return "break"; } // Return trueType for a definitely true extends check. We check instantiations of the two @@ -56365,7 +54868,7 @@ var ts; // type Foo = T extends { x: string } ? string : number // doesn't immediately resolve to 'string' instead of being deferred. if (inferredExtendsType.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) { - result = instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper); + result = instantiateTypeWithoutDepthIncrease(root.trueType, combinedMapper || mapper); return "break"; } } @@ -56385,7 +54888,7 @@ var ts; // types of the form 'A extends B ? X : C extends D ? Y : E extends F ? Z : ...' as a single construct for // purposes of resolution. This means such types aren't subject to the instatiation depth limiter. while (true) { - var state_4 = _loop_15(); + var state_4 = _loop_14(); if (typeof state_4 === "object") return state_4.value; if (state_4 === "break") @@ -56394,13 +54897,13 @@ var ts; return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result; } function getTrueTypeFromConditionalType(type) { - return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.mapper)); + return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(type.root.trueType, type.mapper)); } function getFalseTypeFromConditionalType(type) { - return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(getTypeFromTypeNode(type.root.node.falseType), type.mapper)); + return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(type.root.falseType, type.mapper)); } function getInferredTrueTypeFromConditionalType(type) { - return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.combinedMapper) : getTrueTypeFromConditionalType(type)); + return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(type.root.trueType, type.combinedMapper) : getTrueTypeFromConditionalType(type)); } function getInferTypeParameters(node) { var result; @@ -56425,6 +54928,8 @@ var ts; node: node, checkType: checkType, extendsType: getTypeFromTypeNode(node.extendsType), + trueType: getTypeFromTypeNode(node.trueType), + falseType: getTypeFromTypeNode(node.falseType), isDistributive: !!(checkType.flags & 262144 /* TypeParameter */), inferTypeParameters: getInferTypeParameters(node), outerTypeParameters: outerTypeParameters, @@ -56482,13 +54987,7 @@ var ts; var current = void 0; while (current = nameStack.shift()) { var meaning = nameStack.length ? 1920 /* Namespace */ : targetMeaning; - // typeof a.b.c is normally resolved using `checkExpression` which in turn defers to `checkQualifiedName` - // That, in turn, ultimately uses `getPropertyOfType` on the type of the symbol, which differs slightly from - // the `exports` lookup process that only looks up namespace members which is used for most type references - var mergedResolvedSymbol = getMergedSymbol(resolveSymbol(currentNamespace)); - var next = node.isTypeOf - ? getPropertyOfType(getTypeOfSymbol(mergedResolvedSymbol), current.escapedText) - : getSymbol(getExportsOfSymbol(mergedResolvedSymbol), current.escapedText, meaning); + var next = getSymbol(getExportsOfSymbol(getMergedSymbol(resolveSymbol(currentNamespace))), current.escapedText, meaning); if (!next) { error(current, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), ts.declarationNameToString(current)); return links.resolvedType = errorType; @@ -56547,7 +55046,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isJSDocTypeExpression(host) || ts.isTypeOperatorNode(host) && host.operator === 142 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 141 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -56559,7 +55058,12 @@ var ts; return !!(type.flags & 524288 /* Object */) && !isGenericMappedType(type); } function isEmptyObjectTypeOrSpreadsIntoEmptyObject(type) { - return isEmptyObjectType(type) || !!(type.flags & (65536 /* Null */ | 32768 /* Undefined */ | 528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)); + return isEmptyObjectType(type) || !!(type.flags & (65536 /* Null */ | 32768 /* Undefined */ | 528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)); + } + function isSinglePropertyAnonymousObjectType(type) { + return !!(type.flags & 524288 /* Object */) && + !!(ts.getObjectFlags(type) & 16 /* Anonymous */) && + (ts.length(getPropertiesOfType(type)) === 1 || ts.every(getPropertiesOfType(type), function (p) { return !!(p.flags & 16777216 /* Optional */); })); } function tryMergeUnionOfObjectTypeAndEmptyObject(type, readonly) { if (type.types.length === 2) { @@ -56568,10 +55072,10 @@ var ts; if (ts.every(type.types, isEmptyObjectTypeOrSpreadsIntoEmptyObject)) { return isEmptyObjectType(firstType) ? firstType : isEmptyObjectType(secondType) ? secondType : emptyObjectType; } - if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(firstType)) { + if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(firstType) && isSinglePropertyAnonymousObjectType(secondType)) { return getAnonymousPartialType(secondType); } - if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(secondType)) { + if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(secondType) && isSinglePropertyAnonymousObjectType(firstType)) { return getAnonymousPartialType(firstType); } } @@ -56622,20 +55126,16 @@ var ts; if (merged) { return getSpreadType(merged, right, symbol, objectFlags, readonly); } - return checkCrossProductUnion([left, right]) - ? mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }) - : errorType; + return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }); } if (right.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); if (merged) { return getSpreadType(left, merged, symbol, objectFlags, readonly); } - return checkCrossProductUnion([left, right]) - ? mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }) - : errorType; + return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }); } - if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { + if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { return left; } if (isGenericObjectType(left) || isGenericObjectType(right)) { @@ -56796,7 +55296,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 253 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 250 /* InterfaceDeclaration */)) { if (!ts.hasSyntacticModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -56831,17 +55331,17 @@ var ts; } function getArrayElementTypeNode(node) { switch (node.kind) { - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return getArrayElementTypeNode(node.type); - case 179 /* TupleType */: + case 178 /* TupleType */: if (node.elements.length === 1) { node = node.elements[0]; - if (node.kind === 181 /* RestType */ || node.kind === 192 /* NamedTupleMember */ && node.dotDotDotToken) { + if (node.kind === 180 /* RestType */ || node.kind === 191 /* NamedTupleMember */ && node.dotDotDotToken) { return getArrayElementTypeNode(node.type); } } break; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return node.elementType; } return undefined; @@ -56859,98 +55359,94 @@ var ts; function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 128 /* AnyKeyword */: - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: return anyType; - case 152 /* UnknownKeyword */: + case 151 /* UnknownKeyword */: return unknownType; - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: return stringType; - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: return numberType; - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: return bigintType; case 131 /* BooleanKeyword */: return booleanType; - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: return esSymbolType; case 113 /* VoidKeyword */: return voidType; - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: return undefinedType; case 103 /* NullKeyword */: // TODO(rbuckton): `NullKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service. return nullType; - case 141 /* NeverKeyword */: + case 140 /* NeverKeyword */: return neverType; - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 136 /* IntrinsicKeyword */: - return intrinsicMarkerType; - case 187 /* ThisType */: + case 186 /* ThisType */: case 107 /* ThisKeyword */: // TODO(rbuckton): `ThisKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service and because of `isPartOfTypeNode`. return getTypeFromThisTypeNode(node); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return getTypeFromTypeReference(node); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 182 /* UnionType */: + case 181 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return getTypeFromNamedTupleTypeNode(node); - case 186 /* ParenthesizedType */: - case 306 /* JSDocNonNullableType */: - case 301 /* JSDocTypeExpression */: + case 185 /* ParenthesizedType */: + case 302 /* JSDocNonNullableType */: + case 298 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 181 /* RestType */: + case 180 /* RestType */: return getTypeFromRestTypeNode(node); - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 308 /* JSDocFunctionType */: - case 313 /* JSDocSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 304 /* JSDocFunctionType */: + case 309 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 185 /* InferType */: + case 184 /* InferType */: return getTypeFromInferTypeNode(node); - case 193 /* TemplateLiteralType */: - return getTypeFromTemplateTypeNode(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier, qualified name, or property access expression is a type expression // Callers should first ensure this by calling `isPartOfTypeNode` // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 78 /* Identifier */: - case 157 /* QualifiedName */: - case 201 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -57104,10 +55600,9 @@ var ts; return result; } function getObjectTypeInstantiation(type, mapper) { + var target = type.objectFlags & 64 /* Instantiated */ ? type.target : type; var declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.symbol.declarations[0]; var links = getNodeLinks(declaration); - var target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : - type.objectFlags & 64 /* Instantiated */ ? type.target : type; var typeParameters = links.outerTypeParameters; if (!typeParameters) { // The first time an anonymous type is instantiated we compute and store a list of the type @@ -57124,6 +55619,10 @@ var ts; ts.filter(typeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration); }) : typeParameters; links.outerTypeParameters = typeParameters; + if (typeParameters.length) { + links.instantiations = new ts.Map(); + links.instantiations.set(getTypeListId(typeParameters), target); + } } if (typeParameters.length) { // We are instantiating an anonymous type that has one or more type parameters in scope. Apply the @@ -57132,26 +55631,22 @@ var ts; var combinedMapper_1 = combineTypeMappers(type.mapper, mapper); var typeArguments = ts.map(typeParameters, function (t) { return getMappedType(t, combinedMapper_1); }); var id = getTypeListId(typeArguments); - if (!target.instantiations) { - target.instantiations = new ts.Map(); - target.instantiations.set(getTypeListId(typeParameters), target); - } - var result = target.instantiations.get(id); + var result = links.instantiations.get(id); if (!result) { var newMapper = createTypeMapper(typeParameters, typeArguments); result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper) : instantiateAnonymousType(target, newMapper); - target.instantiations.set(id, result); + links.instantiations.set(id, result); } return result; } return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 157 /* QualifiedName */ || - node.parent.kind === 173 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 195 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 156 /* QualifiedName */ || + node.parent.kind === 172 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 192 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -57160,7 +55655,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 230 /* Block */ || n.kind === 184 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 227 /* Block */ || n.kind === 183 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -57169,12 +55664,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 187 /* ThisType */: + case 186 /* ThisType */: return !!tp.isThisType; case 78 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -57207,18 +55702,13 @@ var ts; if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { - if (!type.declaration.nameType) { - if (isArrayType(t)) { - return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper)); - } - if (isGenericTupleType(t)) { - return instantiateMappedGenericTupleType(t, type, typeVariable, mapper); - } - if (isTupleType(t)) { - return instantiateMappedTupleType(t, type, prependTypeMapping(typeVariable, t, mapper)); - } + if (isGenericTupleType(t)) { + return instantiateMappedGenericTupleType(t, type, typeVariable, mapper); } - return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper)); + var replacementMapper = prependTypeMapping(typeVariable, t, mapper); + return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : + isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : + instantiateAnonymousType(type, replacementMapper); } return t; }); @@ -57327,7 +55817,6 @@ var ts; // We have reached 50 recursive type instantiations and there is a very high likelyhood we're dealing // with a combination of infinite generic types that perpetually generate new type identities. We stop // the recursion here by yielding the error type. - ts.tracing.instant("check" /* Check */, "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth: instantiationDepth, instantiationCount: instantiationCount }); error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); return errorType; } @@ -57338,6 +55827,16 @@ var ts; instantiationDepth--; return result; } + /** + * This can be used to avoid the penalty on instantiation depth for types which result from immediate + * simplification. It essentially removes the depth increase done in `instantiateType`. + */ + function instantiateTypeWithoutDepthIncrease(type, mapper) { + instantiationDepth--; + var result = instantiateType(type, mapper); + instantiationDepth++; + return result; + } function instantiateTypeWorker(type, mapper) { var flags = type.flags; if (flags & 262144 /* TypeParameter */) { @@ -57366,14 +55865,8 @@ var ts; if (flags & 4194304 /* Index */) { return getIndexType(instantiateType(type.type, mapper)); } - if (flags & 134217728 /* TemplateLiteral */) { - return getTemplateLiteralType(type.texts, instantiateTypes(type.types, mapper)); - } - if (flags & 268435456 /* StringMapping */) { - return getStringMappingType(type.symbol, instantiateType(type.type, mapper)); - } if (flags & 8388608 /* IndexedAccess */) { - return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), type.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), /*accessNode*/ undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); } if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); @@ -57419,35 +55912,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 280 /* JsxAttribute */: { + case 277 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 283 /* JsxExpression */: { + case 280 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g

) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -57466,7 +55959,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 209 /* ArrowFunction */) { + if (node.kind !== 206 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -57479,7 +55972,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 230 /* Block */ && isContextSensitive(node.body); + return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 227 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -57535,7 +56028,7 @@ var ts; source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : - hasBaseType(source, getTargetType(target)) || (isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType)); + hasBaseType(source, getTargetType(target)); } /** * This is *not* a bi-directional relationship. @@ -57582,23 +56075,23 @@ var ts; return true; } switch (node.kind) { - case 283 /* JsxExpression */: - case 207 /* ParenthesizedExpression */: + case 280 /* JsxExpression */: + case 204 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -57798,7 +56291,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -57807,15 +56300,18 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: return ts.Debug.assertNever(child, "Found invalid jsx child"); } } + function getSemanticJsxChildren(children) { + return ts.filter(children, function (i) { return !ts.isJsxText(i) || !i.containsOnlyTriviaWhiteSpaces; }); + } function elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer) { var result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer); var invalidTextDiagnostic; @@ -57825,7 +56321,7 @@ var ts; var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName); var childrenNameType = getLiteralType(childrenPropName); var childrenTargetType = getIndexedAccessType(target, childrenNameType); - var validChildren = ts.getSemanticJsxChildren(containingElement.children); + var validChildren = getSemanticJsxChildren(containingElement.children); if (!ts.length(validChildren)) { return result; } @@ -57957,11 +56453,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 168 /* SetAccessor */: return [3 /*break*/, 2]; - case 167 /* GetAccessor */: return [3 /*break*/, 2]; - case 165 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 289 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 288 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 167 /* SetAccessor */: return [3 /*break*/, 2]; + case 166 /* GetAccessor */: return [3 /*break*/, 2]; + case 164 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 286 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 285 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -58038,8 +56534,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 165 /* MethodDeclaration */ && - kind !== 164 /* MethodSignature */ && kind !== 166 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 164 /* MethodDeclaration */ && + kind !== 163 /* MethodSignature */ && kind !== 165 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -58060,36 +56556,34 @@ var ts; var paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount); var restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1; for (var i = 0; i < paramCount; i++) { - var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i); - var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i); - if (sourceType && targetType) { - // In order to ensure that any generic type Foo is at least co-variant with respect to T no matter - // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions, - // they naturally relate only contra-variantly). However, if the source and target parameters both have - // function types with a single call signature, we know we are relating two callback parameters. In - // that case it is sufficient to only relate the parameters of the signatures co-variantly because, - // similar to return values, callback parameters are output positions. This means that a Promise, - // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) - // with respect to T. - var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); - var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType)); - var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && - (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */); - var related = callbacks ? - compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : - !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); - // With strict arity, (x: number | undefined) => void is a subtype of (x?: number | undefined) => void - if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, /*reportErrors*/ false)) { - related = 0 /* False */; - } - if (!related) { - if (reportErrors) { - errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), ts.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); - } - return 0 /* False */; - } - result &= related; + var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : getTypeAtPosition(source, i); + var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : getTypeAtPosition(target, i); + // In order to ensure that any generic type Foo is at least co-variant with respect to T no matter + // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions, + // they naturally relate only contra-variantly). However, if the source and target parameters both have + // function types with a single call signature, we know we are relating two callback parameters. In + // that case it is sufficient to only relate the parameters of the signatures co-variantly because, + // similar to return values, callback parameters are output positions. This means that a Promise, + // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) + // with respect to T. + var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); + var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType)); + var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && + (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */); + var related = callbacks ? + compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : + !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); + // With strict arity, (x: number | undefined) => void is a subtype of (x?: number | undefined) => void + if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, /*reportErrors*/ false)) { + related = 0 /* False */; } + if (!related) { + if (reportErrors) { + errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), ts.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); + } + return 0 /* False */; + } + result &= related; } if (!(checkMode & 4 /* IgnoreReturnTypes */)) { // If a signature resolution is already in-flight, skip issuing a circularity error @@ -58232,7 +56726,7 @@ var ts; return true; if (t & 131072 /* Never */) return false; - if (s & 402653316 /* StringLike */ && t & 4 /* String */) + if (s & 132 /* StringLike */ && t & 4 /* String */) return true; if (s & 128 /* StringLiteral */ && s & 1024 /* EnumLiteral */ && t & 128 /* StringLiteral */ && !(t & 1024 /* EnumLiteral */) && @@ -58294,7 +56788,7 @@ var ts; } else { if (!(source.flags & 3145728 /* UnionOrIntersection */) && !(target.flags & 3145728 /* UnionOrIntersection */) && - source.flags !== target.flags && !(source.flags & 469237760 /* Substructure */)) + source.flags !== target.flags && !(source.flags & 66584576 /* Substructure */)) return false; } if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) { @@ -58303,7 +56797,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) { + if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -58356,7 +56850,6 @@ var ts; reportIncompatibleStack(); } if (overflow) { - ts.tracing.instant("check" /* Check */, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: depth }); var diag = error(errorNode || currentNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); if (errorOutputContainer) { (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); @@ -58731,7 +57224,7 @@ var ts; // breaking the intersection apart. result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); } - if (!result && (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -58829,7 +57322,7 @@ var ts; } function isIdenticalTo(source, target) { var flags = source.flags & target.flags; - if (!(flags & 469237760 /* Substructure */)) { + if (!(flags & 66584576 /* Substructure */)) { return 0 /* False */; } if (flags & 3145728 /* UnionOrIntersection */) { @@ -58865,7 +57358,7 @@ var ts; reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target); checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget]; } - var _loop_16 = function (prop) { + var _loop_15 = function (prop) { if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) { if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) { if (reportErrors) { @@ -58928,7 +57421,7 @@ var ts; }; for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; - var state_5 = _loop_16(prop); + var state_5 = _loop_15(prop); if (typeof state_5 === "object") return state_5.value; } @@ -59114,7 +57607,7 @@ var ts; for (var i = 0; i < maybeCount; i++) { // If source and target are already being compared, consider them related with assumptions if (id === maybeKeys[i]) { - return 3 /* Maybe */; + return 1 /* Maybe */; } } if (depth === 100) { @@ -59142,16 +57635,7 @@ var ts; return originalHandler(onlyUnreliable); }; } - if (expandingFlags === 3 /* Both */) { - ts.tracing.instant("check" /* Check */, "recursiveTypeRelatedTo_DepthLimit", { - sourceId: source.id, - sourceIdStack: sourceStack.map(function (t) { return t.id; }), - targetId: target.id, - targetIdStack: targetStack.map(function (t) { return t.id; }), - depth: depth, - }); - } - var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3 /* Maybe */; + var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 1 /* Maybe */; if (outofbandVarianceMarkerHandler) { outofbandVarianceMarkerHandler = originalHandler; } @@ -59159,12 +57643,9 @@ var ts; depth--; if (result) { if (result === -1 /* True */ || depth === 0) { - if (result === -1 /* True */ || result === 3 /* Maybe */) { - // If result is definitely true, record all maybe keys as having succeeded. Also, record Ternary.Maybe - // results as having succeeded once we reach depth 0, but never record Ternary.Unknown results. - for (var i = maybeStart; i < maybeCount; i++) { - relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags); - } + // If result is definitely true, record all maybe keys as having succeeded + for (var i = maybeStart; i < maybeCount; i++) { + relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags); } maybeCount = maybeStart; } @@ -59178,12 +57659,6 @@ var ts; return result; } function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) { - ts.tracing.push("check" /* Check */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id }); - var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState); - ts.tracing.pop(); - return result; - } - function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) { if (intersectionState & 4 /* PropertyCheck */) { return propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */); } @@ -59230,7 +57705,7 @@ var ts; !(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) { var variances = getAliasVariances(source.aliasSymbol); if (variances === ts.emptyArray) { - return 1 /* Unknown */; + return 1 /* Maybe */; } var varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances, intersectionState); if (varianceResult !== undefined) { @@ -59245,7 +57720,7 @@ var ts; } if (target.flags & 262144 /* TypeParameter */) { // A source type { [P in Q]: X } is related to a target type T if keyof T is related to Q and X is related to T[Q]. - if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) { + if (ts.getObjectFlags(source) & 32 /* Mapped */ && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) { if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) { var templateType = getTemplateTypeFromMappedType(source); var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); @@ -59295,14 +57770,14 @@ var ts; var baseIndexType = getBaseConstraintOfType(indexType) || indexType; if (!isGenericObjectType(baseObjectType) && !isGenericIndexType(baseIndexType)) { var accessFlags = 2 /* Writing */ | (baseObjectType !== objectType ? 1 /* NoIndexSignatures */ : 0); - var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, target.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, accessFlags); + var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, /*accessNode*/ undefined, accessFlags); if (constraint && (result = isRelatedTo(source, constraint, reportErrors))) { return result; } } } } - else if (isGenericMappedType(target) && !target.declaration.nameType) { + else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); var modifiers = getMappedTypeModifiers(target); @@ -59344,15 +57819,6 @@ var ts; } } } - else if (target.flags & 134217728 /* TemplateLiteral */ && source.flags & 128 /* StringLiteral */) { - if (isPatternLiteralType(target)) { - // match all non-`string` segments - var result_8 = inferLiteralsFromTemplateLiteralType(source, target); - if (result_8 && ts.every(result_8, function (r, i) { return isStringLiteralTypeValueParsableAsType(r, target.types[i]); })) { - return -1 /* True */; - } - } - } if (source.flags & 8650752 /* TypeVariable */) { if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) { // A type S[K] is related to a type T[J] if S is related to T and K is related to J. @@ -59391,35 +57857,6 @@ var ts; return result; } } - else if (source.flags & 134217728 /* TemplateLiteral */) { - if (target.flags & 134217728 /* TemplateLiteral */ && - source.texts.length === target.texts.length && - source.types.length === target.types.length && - ts.every(source.texts, function (t, i) { return t === target.texts[i]; }) && - ts.every(instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)).types, function (t, i) { return !!(target.types[i].flags & (1 /* Any */ | 4 /* String */)) || !!isRelatedTo(t, target.types[i], /*reportErrors*/ false); })) { - return -1 /* True */; - } - var constraint = getBaseConstraintOfType(source); - if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, reportErrors))) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - else if (source.flags & 268435456 /* StringMapping */) { - if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) { - if (result = isRelatedTo(source.type, target.type, reportErrors)) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - else { - var constraint = getBaseConstraintOfType(source); - if (constraint && (result = isRelatedTo(constraint, target, reportErrors))) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - } else if (source.flags & 16777216 /* Conditional */) { if (target.flags & 16777216 /* Conditional */) { // Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if @@ -59498,7 +57935,7 @@ var ts; // effectively means we measure variance only from type parameter occurrences that aren't nested in // recursive instantiations of the generic type. if (variances === ts.emptyArray) { - return 1 /* Unknown */; + return 1 /* Maybe */; } var varianceResult = relateVariances(getTypeArguments(source), getTypeArguments(target), variances, intersectionState); if (varianceResult !== undefined) { @@ -59555,9 +57992,9 @@ var ts; if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) { var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */); if (objectOnlyTarget.flags & 1048576 /* Union */) { - var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget); - if (result_9) { - return result_9; + var result_8 = typeRelatedToDiscriminatedType(source, objectOnlyTarget); + if (result_8) { + return result_8; } } } @@ -59624,14 +58061,12 @@ var ts; var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { - var result_10; + var result_9; var targetConstraint = getConstraintTypeFromMappedType(target); var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers)); - if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { + if (result_9 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); - if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) { - return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); - } + return result_9 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); } } return 0 /* False */; @@ -59661,7 +58096,6 @@ var ts; numCombinations *= countTypes(getTypeOfSymbol(sourceProperty)); if (numCombinations > 25) { // We've reached the complexity limit. - ts.tracing.instant("check" /* Check */, "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source.id, targetId: target.id, numCombinations: numCombinations }); return 0 /* False */; } } @@ -59680,11 +58114,11 @@ var ts; // constituents of 'target'. If any combination does not have a match then 'source' is not relatable. var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes); var matchingTypes = []; - var _loop_17 = function (combination) { + var _loop_16 = function (combination) { var hasMatch = false; outer: for (var _i = 0, _a = target.types; _i < _a.length; _i++) { var type = _a[_i]; - var _loop_18 = function (i) { + var _loop_17 = function (i) { var sourceProperty = sourcePropertiesFiltered[i]; var targetProperty = getPropertyOfType(type, sourceProperty.escapedName); if (!targetProperty) @@ -59700,7 +58134,7 @@ var ts; } }; for (var i = 0; i < sourcePropertiesFiltered.length; i++) { - var state_7 = _loop_18(i); + var state_7 = _loop_17(i); switch (state_7) { case "continue-outer": continue outer; } @@ -59714,7 +58148,7 @@ var ts; }; for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) { var combination = discriminantCombinations_1[_a]; - var state_6 = _loop_17(combination); + var state_6 = _loop_16(combination); if (typeof state_6 === "object") return state_6.value; } @@ -59770,7 +58204,7 @@ var ts; ts.Debug.assertIsDefined(links.deferralParent); ts.Debug.assertIsDefined(links.deferralConstituents); var unionParent = !!(links.deferralParent.flags & 1048576 /* Union */); - var result_11 = unionParent ? 0 /* False */ : -1 /* True */; + var result_10 = unionParent ? 0 /* False */ : -1 /* True */; var targetTypes = links.deferralConstituents; for (var _i = 0, targetTypes_3 = targetTypes; _i < targetTypes_3.length; _i++) { var targetType = targetTypes_3[_i]; @@ -59780,7 +58214,7 @@ var ts; // Can't assign to a target individually - have to fallback to assigning to the _whole_ intersection (which forces normalization) return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors); } - result_11 &= related; + result_10 &= related; } else { if (related) { @@ -59788,17 +58222,17 @@ var ts; } } } - if (unionParent && !result_11 && targetIsOptional) { - result_11 = isRelatedTo(source, undefinedType); + if (unionParent && !result_10 && targetIsOptional) { + result_10 = isRelatedTo(source, undefinedType); } - if (unionParent && !result_11 && reportErrors) { + if (unionParent && !result_10 && reportErrors) { // The easiest way to get the right errors here is to un-defer (which may be costly) // If it turns out this is too costly too often, we can replicate the error handling logic within // typeRelatedToSomeType without the discriminatable type branch (as that requires a manifest union // type on which to hand discriminable properties, which we are expressly trying to avoid here) return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors); } - return result_11; + return result_10; } else { return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors, /*headMessage*/ undefined, intersectionState); @@ -60058,7 +58492,6 @@ var ts; return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { - var _a, _b; if (relation === identityRelation) { return signaturesIdenticalTo(source, target, kind); } @@ -60089,9 +58522,7 @@ var ts; var result = -1 /* True */; var saveErrorInfo = captureErrorCalculationState(); var incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn; - var sourceObjectFlags = ts.getObjectFlags(source); - var targetObjectFlags = ts.getObjectFlags(target); - if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source.symbol === target.symbol) { + if (ts.getObjectFlags(source) & 64 /* Instantiated */ && ts.getObjectFlags(target) & 64 /* Instantiated */ && source.symbol === target.symbol) { // We have instantiations of the same anonymous type (which typically will be the type of a // method). Simply do a pairwise comparison of the signatures in the two signature lists instead // of the much more expensive N * M comparison matrix we explore below. We erase type parameters @@ -60111,26 +58542,15 @@ var ts; // this regardless of the number of signatures, but the potential costs are prohibitive due // to the quadratic nature of the logic below. var eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; - var sourceSignature = ts.first(sourceSignatures); - var targetSignature = ts.first(targetSignatures); - result = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors, incompatibleReporter(sourceSignature, targetSignature)); - if (!result && reportErrors && kind === 1 /* Construct */ && (sourceObjectFlags & targetObjectFlags) && - (((_a = targetSignature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 166 /* Constructor */ || ((_b = sourceSignature.declaration) === null || _b === void 0 ? void 0 : _b.kind) === 166 /* Constructor */)) { - var constructSignatureToString = function (signature) { - return signatureToString(signature, /*enclosingDeclaration*/ undefined, 262144 /* WriteArrowStyleSignature */, kind); - }; - reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature)); - reportError(ts.Diagnostics.Types_of_construct_signatures_are_incompatible); - return result; - } + result = signatureRelatedTo(sourceSignatures[0], targetSignatures[0], eraseGenerics, reportErrors, incompatibleReporter(sourceSignatures[0], targetSignatures[0])); } else { outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) { var t = targetSignatures_1[_i]; // Only elaborate errors from the first failure var shouldElaborateErrors = reportErrors; - for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) { - var s = sourceSignatures_1[_c]; + for (var _a = 0, sourceSignatures_1 = sourceSignatures; _a < sourceSignatures_1.length; _a++) { + var s = sourceSignatures_1[_a]; var related = signatureRelatedTo(s, t, /*erase*/ true, shouldElaborateErrors, incompatibleReporter(s, t)); if (related) { result &= related; @@ -60294,13 +58714,13 @@ var ts; if (type.flags & 3145728 /* UnionOrIntersection */) { return !!ts.forEach(type.types, typeCouldHaveTopLevelSingletonTypes); } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getConstraintOfType(type); - if (constraint && constraint !== type) { + if (constraint) { return typeCouldHaveTopLevelSingletonTypes(constraint); } } - return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */); + return isUnitType(type); } function getBestMatchingType(source, target, isRelatedTo) { if (isRelatedTo === void 0) { isRelatedTo = compareTypesAssignable; } @@ -60334,18 +58754,8 @@ var ts; } } var match = discriminable.indexOf(/*searchElement*/ true); - if (match === -1) { - return defaultValue; - } // make sure exactly 1 matches before returning it - var nextMatch = discriminable.indexOf(/*searchElement*/ true, match + 1); - while (nextMatch !== -1) { - if (!isTypeIdenticalTo(target.types[match], target.types[nextMatch])) { - return defaultValue; - } - nextMatch = discriminable.indexOf(/*searchElement*/ true, nextMatch + 1); - } - return target.types[match]; + return match === -1 || discriminable.indexOf(/*searchElement*/ true, match + 1) !== -1 ? defaultValue : target.types[match]; } /** * A type is 'weak' if it is an object type with at least one optional property @@ -60394,15 +58804,13 @@ var ts; // instantiations of the generic type for type arguments with known relations. The function // returns the emptyArray singleton when invoked recursively for the given generic type. function getVariancesWorker(typeParameters, cache, createMarkerType) { - var _a, _b, _c; if (typeParameters === void 0) { typeParameters = ts.emptyArray; } var variances = cache.variances; if (!variances) { - ts.tracing.push("check" /* Check */, "getVariancesWorker", { arity: typeParameters.length, id: (_c = (_a = cache.id) !== null && _a !== void 0 ? _a : (_b = cache.declaredType) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : -1 }); // The emptyArray singleton is used to signal a recursive invocation. cache.variances = ts.emptyArray; variances = []; - var _loop_19 = function (tp) { + var _loop_18 = function (tp) { var unmeasurable = false; var unreliable = false; var oldHandler = outofbandVarianceMarkerHandler; @@ -60434,10 +58842,9 @@ var ts; }; for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) { var tp = typeParameters_1[_i]; - _loop_19(tp); + _loop_18(tp); } cache.variances = variances; - ts.tracing.pop(); } return variances; } @@ -60568,54 +58975,58 @@ var ts; // has expanded into `[A>>>>>]` // in such cases we need to terminate the expansion, and we do so here. function isDeeplyNestedType(type, stack, depth) { - if (depth >= 5) { - var identity_1 = getRecursionIdentity(type); - if (identity_1) { - var count = 0; - for (var i = 0; i < depth; i++) { - if (getRecursionIdentity(stack[i]) === identity_1) { - count++; - if (count >= 5) { - return true; + // We track all object types that have an associated symbol (representing the origin of the type) + if (depth >= 5 && type.flags & 524288 /* Object */) { + if (!isObjectOrArrayLiteralType(type)) { + var symbol = type.symbol; + if (symbol) { + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 524288 /* Object */ && t.symbol === symbol) { + count++; + if (count >= 5) + return true; } } } } + if (ts.getObjectFlags(type) && 4 /* Reference */ && !!type.node) { + var root = type.target; + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (ts.getObjectFlags(t) && 4 /* Reference */ && !!t.node && t.target === root) { + count++; + if (count >= 5) + return true; + } + } + } + } + if (depth >= 5 && type.flags & 8388608 /* IndexedAccess */) { + var root = getRootObjectTypeFromIndexedAccessChain(type); + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (getRootObjectTypeFromIndexedAccessChain(t) === root) { + count++; + if (count >= 5) + return true; + } + } } return false; } - // Types with constituents that could circularly reference the type have a recursion identity. The recursion - // identity is some object that is common to instantiations of the type with the same origin. - function getRecursionIdentity(type) { - if (type.flags & 524288 /* Object */ && !isObjectOrArrayLiteralType(type)) { - if (ts.getObjectFlags(type) && 4 /* Reference */ && type.node) { - // Deferred type references are tracked through their associated AST node. This gives us finer - // granularity than using their associated target because each manifest type reference has a - // unique AST node. - return type.node; - } - if (type.symbol && !(ts.getObjectFlags(type) & 16 /* Anonymous */ && type.symbol.flags & 32 /* Class */)) { - // We track all object types that have an associated symbol (representing the origin of the type), but - // exclude the static side of classes from this check since it shares its symbol with the instance side. - return type.symbol; - } - if (isTupleType(type)) { - // Tuple types are tracked through their target type - return type.target; - } + /** + * Gets the leftmost object type in a chain of indexed accesses, eg, in A[P][Q], returns A + */ + function getRootObjectTypeFromIndexedAccessChain(type) { + var t = type; + while (t.flags & 8388608 /* IndexedAccess */) { + t = t.objectType; } - if (type.flags & 8388608 /* IndexedAccess */) { - // Identity is the leftmost object type in a chain of indexed accesses, eg, in A[P][Q] it is A - do { - type = type.objectType; - } while (type.flags & 8388608 /* IndexedAccess */); - return type; - } - if (type.flags & 16777216 /* Conditional */) { - // The root object represents the origin of the conditional type - return type.root; - } - return undefined; + return t; } function isPropertyIdenticalTo(sourceProp, targetProp) { return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0 /* False */; @@ -60738,8 +59149,8 @@ var ts; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var t = types_13[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -60913,8 +59324,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var t = types_14[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var t = types_13[_i]; result |= getFalsyFlags(t); } return result; @@ -60944,7 +59355,7 @@ var ts; type.flags & 64 /* BigInt */ ? zeroBigIntType : type === regularFalseType || type === falseType || - type.flags & (16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */ | 3 /* AnyOrUnknown */) || + type.flags & (16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */) || type.flags & 128 /* StringLiteral */ && type.value === "" || type.flags & 256 /* NumberLiteral */ && type.value === 0 || type.flags & 2048 /* BigIntLiteral */ && isZeroBigInt(type) ? type : @@ -61247,12 +59658,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 216 /* BinaryExpression */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 213 /* BinaryExpression */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 160 /* Parameter */: + case 159 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -61267,23 +59678,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 3 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -61297,7 +59708,7 @@ var ts; wideningKind === 3 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 190 /* MappedType */: + case 189 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -61427,7 +59838,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 465829888 /* Instantiable */ || + var result = !!(type.flags & 63176704 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */)) || @@ -61439,15 +59850,16 @@ var ts; } function isNonGenericTopLevelType(type) { if (type.aliasSymbol && !type.aliasTypeArguments) { - var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 254 /* TypeAliasDeclaration */); - return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 297 /* SourceFile */ ? true : n.kind === 256 /* ModuleDeclaration */ ? false : "quit"; })); + var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 251 /* TypeAliasDeclaration */); + return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 294 /* SourceFile */ ? true : n.kind === 253 /* ModuleDeclaration */ ? false : "quit"; })); } return false; } function isTypeParameterAtTopLevel(type, typeParameter) { return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && ts.some(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }) || - type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); + type.flags & 16777216 /* Conditional */ && (isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type), typeParameter) || + isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type), typeParameter))); } /** Create an object with properties named in the string literal type. Every property has type `any` */ function createEmptyObjectTypeFromStringLiteral(type) { @@ -61494,8 +59906,7 @@ var ts; // arrow function, but is considered partially inferable because property 'a' has an inferable type. function isPartiallyInferableType(type) { return !(ts.getObjectFlags(type) & 2097152 /* NonInferrableType */) || - isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }) || - isTupleType(type) && ts.some(getTypeArguments(type), isPartiallyInferableType); + isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }); } function createReverseMappedType(source, target, constraint) { // We consider a source type reverse mappable if it has a string index signature or if @@ -61599,73 +60010,17 @@ var ts; function isFromInferenceBlockedSource(type) { return !!(type.symbol && ts.some(type.symbol.declarations, hasSkipDirectInferenceFlag)); } - function isValidBigIntString(s) { - var scanner = ts.createScanner(99 /* ESNext */, /*skipTrivia*/ false); - var success = true; - scanner.setOnError(function () { return success = false; }); - scanner.setText(s + "n"); - var result = scanner.scan(); - if (result === 40 /* MinusToken */) { - result = scanner.scan(); - } - var flags = scanner.getTokenFlags(); - // validate that - // * scanning proceeded without error - // * a bigint can be scanned, and that when it is scanned, it is - // * the full length of the input string (so the scanner is one character beyond the augmented input length) - // * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input) - return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === (s.length + 1) && !(flags & 512 /* ContainsSeparator */); - } - function isStringLiteralTypeValueParsableAsType(s, target) { - if (target.flags & 1048576 /* Union */) { - return !!forEachType(target, function (t) { return isStringLiteralTypeValueParsableAsType(s, t); }); - } - switch (target) { - case stringType: return true; - case numberType: return s.value !== "" && isFinite(+(s.value)); - case bigintType: return s.value !== "" && isValidBigIntString(s.value); - // the next 4 should be handled in `getTemplateLiteralType`, as they are all exactly one value, but are here for completeness, just in case - // this function is ever used on types which don't come from template literal holes - case trueType: return s.value === "true"; - case falseType: return s.value === "false"; - case undefinedType: return s.value === "undefined"; - case nullType: return s.value === "null"; - default: return !!(target.flags & 1 /* Any */); - } - } - function inferLiteralsFromTemplateLiteralType(source, target) { - var value = source.value; - var texts = target.texts; - var lastIndex = texts.length - 1; - var startText = texts[0]; - var endText = texts[lastIndex]; - if (!(value.startsWith(startText) && value.slice(startText.length).endsWith(endText))) - return undefined; - var matches = []; - var str = value.slice(startText.length, value.length - endText.length); - var pos = 0; - for (var i = 1; i < lastIndex; i++) { - var delim = texts[i]; - var delimPos = delim.length > 0 ? str.indexOf(delim, pos) : pos < str.length ? pos + 1 : -1; - if (delimPos < 0) - return undefined; - matches.push(getLiteralType(str.slice(pos, delimPos))); - pos = delimPos + delim.length; - } - matches.push(getLiteralType(str.slice(pos))); - return matches; - } function inferTypes(inferences, originalSource, originalTarget, priority, contravariant) { if (priority === void 0) { priority = 0; } if (contravariant === void 0) { contravariant = false; } + var symbolOrTypeStack; + var visited; var bivariant = false; var propagationType; var inferencePriority = 1024 /* MaxValue */; var allowComplexConstraintInference = true; - var visited; - var sourceStack; - var targetStack; - var expandingFlags = 0 /* None */; + var objectTypeComparisonDepth = 0; + var targetStack = []; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { if (!couldContainTypeVariables(target)) { @@ -61793,7 +60148,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 465829888 /* Instantiable */) { + if (indexType.flags & 63176704 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -61822,13 +60177,18 @@ var ts; inferFromTypes(source.objectType, target.objectType); inferFromTypes(source.indexType, target.indexType); } - else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) { - if (source.symbol === target.symbol) { - inferFromTypes(source.type, target.type); - } + else if (source.flags & 16777216 /* Conditional */ && target.flags & 16777216 /* Conditional */) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); + inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } else if (target.flags & 16777216 /* Conditional */) { - invokeOnce(source, target, inferToConditionalType); + var savePriority = priority; + priority |= contravariant ? 32 /* ContravariantConditional */ : 0; + var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; + inferToMultipleTypes(source, targetTypes, target.flags); + priority = savePriority; } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); @@ -61841,12 +60201,9 @@ var ts; inferFromTypes(sourceType, target); } } - else if (target.flags & 134217728 /* TemplateLiteral */) { - inferToTemplateLiteralType(source, target); - } else { source = getReducedType(source); - if (!(priority & 256 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) { + if (!(priority & 256 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -61891,30 +60248,7 @@ var ts; (visited || (visited = new ts.Map())).set(key, -1 /* Circularity */); var saveInferencePriority = inferencePriority; inferencePriority = 1024 /* MaxValue */; - // We stop inferring and report a circularity if we encounter duplicate recursion identities on both - // the source side and the target side. - var saveExpandingFlags = expandingFlags; - var sourceIdentity = getRecursionIdentity(source) || source; - var targetIdentity = getRecursionIdentity(target) || target; - if (sourceIdentity && ts.contains(sourceStack, sourceIdentity)) - expandingFlags |= 1 /* Source */; - if (targetIdentity && ts.contains(targetStack, targetIdentity)) - expandingFlags |= 2 /* Target */; - if (expandingFlags !== 3 /* Both */) { - if (sourceIdentity) - (sourceStack || (sourceStack = [])).push(sourceIdentity); - if (targetIdentity) - (targetStack || (targetStack = [])).push(targetIdentity); - action(source, target); - if (targetIdentity) - targetStack.pop(); - if (sourceIdentity) - sourceStack.pop(); - } - else { - inferencePriority = -1 /* Circularity */; - } - expandingFlags = saveExpandingFlags; + action(source, target); visited.set(key, inferencePriority); inferencePriority = Math.min(inferencePriority, saveInferencePriority); } @@ -61971,8 +60305,8 @@ var ts; } function getSingleTypeVariableFromIntersectionTypes(types) { var typeVariable; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var type = types_15[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var type = types_14[_i]; var t = type.flags & 2097152 /* Intersection */ && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); }); if (!t || typeVariable && t !== typeVariable) { return undefined; @@ -62110,31 +60444,40 @@ var ts; } return false; } - function inferToConditionalType(source, target) { - if (source.flags & 16777216 /* Conditional */) { - inferFromTypes(source.checkType, target.checkType); - inferFromTypes(source.extendsType, target.extendsType); - inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); - inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); + function inferFromObjectTypes(source, target) { + // If we are already processing another target type with the same associated symbol (such as + // an instantiation of the same generic type), we do not explore this target as it would yield + // no further inferences. We exclude the static side of classes from this check since it shares + // its symbol with the instance side which would lead to false positives. + var isNonConstructorObject = target.flags & 524288 /* Object */ && + !(ts.getObjectFlags(target) & 16 /* Anonymous */ && target.symbol && target.symbol.flags & 32 /* Class */); + var symbolOrType = ts.getObjectFlags(target) & 4 /* Reference */ && target.node ? getNormalizedType(target, /*writing*/ false) : isNonConstructorObject ? isTupleType(target) ? target.target : target.symbol : undefined; + if (symbolOrType) { + if (ts.contains(symbolOrTypeStack, symbolOrType)) { + if (ts.getObjectFlags(target) & 4 /* Reference */ && target.node) { + // Don't set the circularity flag for re-encountered recursive type references just because we're already exploring them + return; + } + inferencePriority = -1 /* Circularity */; + return; + } + targetStack[objectTypeComparisonDepth] = target; + objectTypeComparisonDepth++; + if (isDeeplyNestedType(target, targetStack, objectTypeComparisonDepth)) { + inferencePriority = -1 /* Circularity */; + objectTypeComparisonDepth--; + return; + } + (symbolOrTypeStack || (symbolOrTypeStack = [])).push(symbolOrType); + inferFromObjectTypesWorker(source, target); + symbolOrTypeStack.pop(); + objectTypeComparisonDepth--; } else { - var savePriority = priority; - priority |= contravariant ? 32 /* ContravariantConditional */ : 0; - var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; - inferToMultipleTypes(source, targetTypes, target.flags); - priority = savePriority; + inferFromObjectTypesWorker(source, target); } } - function inferToTemplateLiteralType(source, target) { - var matches = source.flags & 128 /* StringLiteral */ ? inferLiteralsFromTemplateLiteralType(source, target) : - source.flags & 134217728 /* TemplateLiteral */ && ts.arraysEqual(source.texts, target.texts) ? source.types : - undefined; - var types = target.types; - for (var i = 0; i < types.length; i++) { - inferFromTypes(matches ? matches[i] : neverType, types[i]); - } - } - function inferFromObjectTypes(source, target) { + function inferFromObjectTypesWorker(source, target) { if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) { // If source and target are references to the same generic type, infer from type arguments inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target)); @@ -62145,12 +60488,8 @@ var ts; // from S to T and from X to Y. inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target)); inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); - var sourceNameType = getNameTypeFromMappedType(source); - var targetNameType = getNameTypeFromMappedType(target); - if (sourceNameType && targetNameType) - inferFromTypes(sourceNameType, targetNameType); } - if (ts.getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) { + if (ts.getObjectFlags(target) & 32 /* Mapped */) { var constraintType = getConstraintTypeFromMappedType(target); if (inferToMappedType(source, target, constraintType)) { return; @@ -62258,7 +60597,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 165 /* MethodDeclaration */ || kind === 164 /* MethodSignature */ || kind === 166 /* Constructor */; + bivariant = bivariant || kind === 164 /* MethodDeclaration */ || kind === 163 /* MethodSignature */ || kind === 165 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -62293,7 +60632,7 @@ var ts; } function hasPrimitiveConstraint(type) { var constraint = getConstraintOfTypeParameter(type); - return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */); } function isObjectLiteralType(type) { return !!(ts.getObjectFlags(type) & 128 /* ObjectLiteral */); @@ -62402,22 +60741,22 @@ var ts; return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom; case "$": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery; case "describe": case "suite": case "it": case "test": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha; case "process": case "require": case "Buffer": case "module": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode; case "Map": case "Set": case "Promise": @@ -62426,19 +60765,9 @@ var ts; case "WeakSet": case "Iterator": case "AsyncIterator": - case "SharedArrayBuffer": - case "Atomics": - case "AsyncIterable": - case "AsyncIterableIterator": - case "AsyncGenerator": - case "AsyncGeneratorFunction": - case "BigInt": - case "Reflect": - case "BigInt64Array": - case "BigUint64Array": - return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later; + return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 286 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -62459,7 +60788,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 176 /* TypeQuery */ ? true : n.kind === 78 /* Identifier */ || n.kind === 157 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 175 /* TypeQuery */ ? true : n.kind === 78 /* Identifier */ || n.kind === 156 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -62474,11 +60803,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 107 /* ThisKeyword */: return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType); - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -62489,28 +60818,26 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: return isMatchingReference(source, target.expression); - case 216 /* BinaryExpression */: - return (ts.isAssignmentExpression(target) && isMatchingReference(source, target.left)) || - (ts.isBinaryExpression(target) && target.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source, target.right)); + case 213 /* BinaryExpression */: + return ts.isAssignmentExpression(target) && isMatchingReference(source, target.left); } switch (source.kind) { case 78 /* Identifier */: - case 79 /* PrivateIdentifier */: return target.kind === 78 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 249 /* VariableDeclaration */ || target.kind === 198 /* BindingElement */) && + (target.kind === 246 /* VariableDeclaration */ || target.kind === 195 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 107 /* ThisKeyword */: return target.kind === 107 /* ThisKeyword */; case 105 /* SuperKeyword */: return target.kind === 105 /* SuperKeyword */; - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -62520,11 +60847,11 @@ var ts; // Given a source x, check if target matches x or is an && operation with an operand that matches x. function containsTruthyCheck(source, target) { return isMatchingReference(source, target) || - (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && + (target.kind === 213 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right))); } function getAccessedPropertyName(access) { - return access.kind === 201 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 198 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -62553,7 +60880,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 465829888 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -62586,7 +60913,7 @@ var ts; } } } - if (callExpression.expression.kind === 201 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 198 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -62635,8 +60962,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0 /* None */; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var t = types_16[_i]; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var t = types_15[_i]; result |= getTypeFacts(t); } return result; @@ -62707,7 +61034,7 @@ var ts; if (flags & 131072 /* Never */) { return 0 /* None */; } - if (flags & 465829888 /* Instantiable */) { + if (flags & 63176704 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -62731,35 +61058,28 @@ var ts; return errorType; var text = getPropertyNameFromType(nameType); return getConstraintForLocation(getTypeOfPropertyOfType(type, text), name) || - isNumericLiteralName(text) && includeUndefinedInIndexSignature(getIndexTypeOfType(type, 1 /* Number */)) || - includeUndefinedInIndexSignature(getIndexTypeOfType(type, 0 /* String */)) || + isNumericLiteralName(text) && getIndexTypeOfType(type, 1 /* Number */) || + getIndexTypeOfType(type, 0 /* String */) || errorType; } function getTypeOfDestructuredArrayElement(type, index) { return everyType(type, isTupleLikeType) && getTupleElementType(type, index) || - includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined)) || + checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType; } - function includeUndefinedInIndexSignature(type) { - if (!type) - return type; - return compilerOptions.noUncheckedIndexedAccess ? - getUnionType([type, undefinedType]) : - type; - } function getTypeOfDestructuredSpreadExpression(type) { return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 199 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 288 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 196 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 285 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 216 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 239 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 213 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 236 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -62776,21 +61096,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return stringType; - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return checkRightHandSideOfForOf(parent) || errorType; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return undefinedType; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -62798,7 +61118,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 196 /* ObjectBindingPattern */ ? + var type = pattern.kind === 193 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -62816,30 +61136,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 238 /* ForInStatement */) { + if (node.parent.parent.kind === 235 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 239 /* ForOfStatement */) { + if (node.parent.parent.kind === 236 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 249 /* VariableDeclaration */ ? + return node.kind === 246 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 249 /* VariableDeclaration */ && node.initializer && + return node.kind === 246 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 198 /* BindingElement */ && node.parent.kind === 216 /* BinaryExpression */ && + node.kind !== 195 /* BindingElement */ && node.parent.kind === 213 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 74 /* BarBarEqualsToken */: @@ -62854,13 +61174,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 207 /* ParenthesizedExpression */ || - parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 204 /* ParenthesizedExpression */ || + parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -62880,7 +61200,7 @@ var ts; var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; @@ -63017,8 +61337,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { - var t = types_17[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var t = types_16[_i]; if (!(t.flags & 131072 /* Never */)) { if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) { return false; @@ -63042,12 +61362,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 203 /* CallExpression */ + parent.parent.kind === 200 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 202 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 199 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 216 /* BinaryExpression */ && + parent.parent.kind === 213 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -63055,8 +61375,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return (declaration.kind === 249 /* VariableDeclaration */ || declaration.kind === 160 /* Parameter */ || - declaration.kind === 163 /* PropertyDeclaration */ || declaration.kind === 162 /* PropertySignature */) && + return (declaration.kind === 246 /* VariableDeclaration */ || declaration.kind === 159 /* Parameter */ || + declaration.kind === 162 /* PropertyDeclaration */ || declaration.kind === 161 /* PropertySignature */) && !!ts.getEffectiveTypeAnnotationNode(declaration); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -63064,18 +61384,12 @@ var ts; return getTypeOfSymbol(symbol); } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { - if (ts.getCheckFlags(symbol) & 262144 /* Mapped */) { - var origin = symbol.syntheticOrigin; - if (origin && getExplicitTypeOfSymbol(origin)) { - return getTypeOfSymbol(symbol); - } - } var declaration = symbol.valueDeclaration; if (declaration) { if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 236 /* ForOfStatement */) { var statement = declaration.parent.parent; var expressionType = getTypeOfDottedName(statement.expression, /*diagnostic*/ undefined); if (expressionType) { @@ -63103,11 +61417,11 @@ var ts; return getExplicitThisType(node); case 105 /* SuperKeyword */: return checkSuperExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -63121,7 +61435,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 233 /* ExpressionStatement */) { + if (node.parent.kind === 230 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 105 /* SuperKeyword */) { @@ -63165,7 +61479,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 94 /* FalseKeyword */ || node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 94 /* FalseKeyword */ || node.kind === 213 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -63284,7 +61598,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 536624127 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -63296,7 +61610,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 225 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 222 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -63311,13 +61625,11 @@ var ts; if (flowDepth === 2000) { // We have made 2000 recursive invocations. To avoid overflowing the call stack we report an error // and disable further control flow analysis in the containing function or module body. - ts.tracing.instant("check" /* Check */, "getTypeAtFlowNode_DepthLimit", { flowId: flow.id }); flowAnalysisDisabled = true; reportFlowControlError(reference); return errorType; } flowDepth++; - var sharedFlow; while (true) { var flags = flow.flags; if (flags & 4096 /* Shared */) { @@ -63330,7 +61642,6 @@ var ts; return sharedFlowTypes[i]; } } - sharedFlow = flow; } var type = void 0; if (flags & 16 /* Assignment */) { @@ -63380,8 +61691,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 201 /* PropertyAccessExpression */ && - reference.kind !== 202 /* ElementAccessExpression */ && + reference.kind !== 198 /* PropertyAccessExpression */ && + reference.kind !== 199 /* ElementAccessExpression */ && reference.kind !== 107 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -63394,9 +61705,9 @@ var ts; // simply return the non-auto declared type to reduce follow-on errors. type = convertAutoToAny(declaredType); } - if (sharedFlow) { + if (flags & 4096 /* Shared */) { // Record visited node and the associated type in the cache. - sharedFlowNodes[sharedFlowCount] = sharedFlow; + sharedFlowNodes[sharedFlowCount] = flow; sharedFlowTypes[sharedFlowCount] = type; sharedFlowCount++; } @@ -63406,7 +61717,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -63446,14 +61757,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 208 /* FunctionExpression */ || init.kind === 209 /* ArrowFunction */)) { + if (init && (init.kind === 205 /* FunctionExpression */ || init.kind === 206 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 238 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 235 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -63464,7 +61775,7 @@ var ts; if (node.kind === 94 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 216 /* BinaryExpression */) { + if (node.kind === 213 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -63495,7 +61806,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 203 /* CallExpression */ ? + var expr = node.kind === 200 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -63503,7 +61814,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -63551,7 +61862,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 211 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 208 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -63559,7 +61870,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 211 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 208 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -63777,10 +62088,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 208 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 208 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -63900,7 +62211,7 @@ var ts; if (assumeTrue && type.flags & 2 /* Unknown */ && literal.text === "object") { // The pattern x && typeof x === 'object', where x is of type unknown, narrows x to type object. We don't // need to check for the reverse typeof x === 'object' && x since that already narrows correctly. - if (typeOfExpr.parent.parent.kind === 216 /* BinaryExpression */) { + if (typeOfExpr.parent.parent.kind === 213 /* BinaryExpression */) { var expr = typeOfExpr.parent.parent; if (expr.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) { return nonPrimitiveType; @@ -63983,7 +62294,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -64148,10 +62459,15 @@ var ts; return assignableType; } } - // If the candidate type is a subtype of the target type, narrow to the candidate type, - // if the target type is a subtype of the candidate type, narrow to the target type, - // otherwise, narrow to an intersection of the two types. - return isTypeSubtypeOf(candidate, type) ? candidate : isTypeSubtypeOf(type, candidate) ? type : getIntersectionType([type, candidate]); + // If the candidate type is a subtype of the target type, narrow to the candidate type. + // Otherwise, if the target type is assignable to the candidate type, keep the target type. + // Otherwise, if the candidate type is assignable to the target type, narrow to the candidate + // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the + // two types. + return isTypeSubtypeOf(candidate, type) ? candidate : + isTypeAssignableTo(type, candidate) ? type : + isTypeAssignableTo(candidate, type) ? candidate : + getIntersectionType([type, candidate]); } function narrowTypeByCallExpression(type, callExpression, assumeTrue) { if (hasMatchingArgument(callExpression, reference)) { @@ -64194,17 +62510,16 @@ var ts; case 78 /* Identifier */: case 107 /* ThisKeyword */: case 105 /* SuperKeyword */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -64249,9 +62564,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 257 /* ModuleBlock */ || - node.kind === 297 /* SourceFile */ || - node.kind === 163 /* PropertyDeclaration */; + node.kind === 254 /* ModuleBlock */ || + node.kind === 294 /* SourceFile */ || + node.kind === 162 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -64273,7 +62588,7 @@ var ts; if (node.kind === 78 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 160 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 159 /* Parameter */) { symbol.isAssigned = true; } } @@ -64289,7 +62604,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 160 /* Parameter */ && + declaration.kind === 159 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -64303,10 +62618,10 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 201 /* PropertyAccessExpression */ || - parent.kind === 203 /* CallExpression */ && parent.expression === node || - parent.kind === 202 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 198 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 198 /* PropertyAccessExpression */ || + parent.kind === 200 /* CallExpression */ && parent.expression === node || + parent.kind === 199 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 195 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); @@ -64348,7 +62663,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 209 /* ArrowFunction */) { + if (container.kind === 206 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasSyntacticModifier(container, 256 /* Async */)) { @@ -64364,16 +62679,16 @@ var ts; markAliasReferenced(symbol, node); } var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - var sourceSymbol = localOrExportSymbol.flags & 2097152 /* Alias */ ? resolveAlias(localOrExportSymbol) : localOrExportSymbol; - if (getDeclarationNodeFlagsFromSymbol(sourceSymbol) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node.parent, sourceSymbol)) { - errorOrSuggestion(/* isError */ false, node, ts.Diagnostics._0_is_deprecated, node.escapedText); - } var declaration = localOrExportSymbol.valueDeclaration; + if (declaration && ts.getCombinedNodeFlags(declaration) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node.parent, localOrExportSymbol)) { + errorOrSuggestion(/* isError */ false, node, ts.Diagnostics._0_is_deprecated, node.escapedText); + ; + } if (localOrExportSymbol.flags & 32 /* Class */) { // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 252 /* ClassDeclaration */ + if (declaration.kind === 249 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -64385,14 +62700,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 221 /* ClassExpression */) { + else if (declaration.kind === 218 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 297 /* SourceFile */) { + while (container.kind !== 294 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 163 /* PropertyDeclaration */ && ts.hasSyntacticModifier(container, 32 /* Static */)) { + if (container.kind === 162 /* PropertyDeclaration */ && ts.hasSyntacticModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -64441,7 +62756,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 160 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 159 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -64450,8 +62765,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 208 /* FunctionExpression */ || - flowContainer.kind === 209 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 205 /* FunctionExpression */ || + flowContainer.kind === 206 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -64460,9 +62775,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 270 /* ExportSpecifier */) || - node.parent.kind === 225 /* NonNullExpression */ || - declaration.kind === 249 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 267 /* ExportSpecifier */) || + node.parent.kind === 222 /* NonNullExpression */ || + declaration.kind === 246 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -64497,7 +62812,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 287 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 284 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -64520,7 +62835,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 247 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -64541,7 +62856,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 247 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -64560,7 +62875,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 207 /* ParenthesizedExpression */) { + while (current.parent.kind === 204 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -64568,7 +62883,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 214 /* PrefixUnaryExpression */ || current.parent.kind === 215 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 211 /* PrefixUnaryExpression */ || current.parent.kind === 212 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -64581,7 +62896,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 163 /* PropertyDeclaration */ || container.kind === 166 /* Constructor */) { + if (container.kind === 162 /* PropertyDeclaration */ || container.kind === 165 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -64621,37 +62936,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 166 /* Constructor */) { + if (container.kind === 165 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 209 /* ArrowFunction */) { + if (container.kind === 206 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 166 /* Constructor */: + case 165 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: if (ts.hasSyntacticModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -64739,7 +63054,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 208 /* FunctionExpression */ && + if (container.kind === 205 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -64749,16 +63064,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 165 /* MethodDeclaration */ && - container.parent.kind === 200 /* ObjectLiteralExpression */ && + else if (container.kind === 164 /* MethodDeclaration */ && + container.parent.kind === 197 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 208 /* FunctionExpression */ && - container.parent.kind === 288 /* PropertyAssignment */ && - container.parent.parent.kind === 200 /* ObjectLiteralExpression */ && + else if (container.kind === 205 /* FunctionExpression */ && + container.parent.kind === 285 /* PropertyAssignment */ && + container.parent.parent.kind === 197 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -64766,7 +63081,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 208 /* FunctionExpression */ && + else if (container.kind === 205 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -64791,7 +63106,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 308 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 304 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -64805,16 +63120,16 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 160 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 159 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 203 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 200 /* CallExpression */ && node.parent.expression === node; var immediateContainer = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var container = immediateContainer; var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 209 /* ArrowFunction */) { + while (container && container.kind === 206 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -64827,14 +63142,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 158 /* ComputedPropertyName */; }); - if (current && current.kind === 158 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 157 /* ComputedPropertyName */; }); + if (current && current.kind === 157 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 197 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -64842,7 +63157,7 @@ var ts; } return errorType; } - if (!isCallExpression && immediateContainer.kind === 166 /* Constructor */) { + if (!isCallExpression && immediateContainer.kind === 165 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasSyntacticModifier(container, 32 /* Static */) || isCallExpression) { @@ -64911,7 +63226,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 165 /* MethodDeclaration */ && ts.hasSyntacticModifier(container, 256 /* Async */)) { + if (container.kind === 164 /* MethodDeclaration */ && ts.hasSyntacticModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -64925,7 +63240,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 200 /* ObjectLiteralExpression */) { + if (container.parent.kind === 197 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -64946,7 +63261,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 166 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 165 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -64961,7 +63276,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 166 /* Constructor */; + return container.kind === 165 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -64969,21 +63284,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 197 /* ObjectLiteralExpression */) { if (ts.hasSyntacticModifier(container, 32 /* Static */)) { - return container.kind === 165 /* MethodDeclaration */ || - container.kind === 164 /* MethodSignature */ || - container.kind === 167 /* GetAccessor */ || - container.kind === 168 /* SetAccessor */; + return container.kind === 164 /* MethodDeclaration */ || + container.kind === 163 /* MethodSignature */ || + container.kind === 166 /* GetAccessor */ || + container.kind === 167 /* SetAccessor */; } else { - return container.kind === 165 /* MethodDeclaration */ || - container.kind === 164 /* MethodSignature */ || - container.kind === 167 /* GetAccessor */ || - container.kind === 168 /* SetAccessor */ || - container.kind === 163 /* PropertyDeclaration */ || - container.kind === 162 /* PropertySignature */ || - container.kind === 166 /* Constructor */; + return container.kind === 164 /* MethodDeclaration */ || + container.kind === 163 /* MethodSignature */ || + container.kind === 166 /* GetAccessor */ || + container.kind === 167 /* SetAccessor */ || + container.kind === 162 /* PropertyDeclaration */ || + container.kind === 161 /* PropertySignature */ || + container.kind === 165 /* Constructor */; } } } @@ -64991,10 +63306,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 165 /* MethodDeclaration */ || - func.kind === 167 /* GetAccessor */ || - func.kind === 168 /* SetAccessor */) && func.parent.kind === 200 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 208 /* FunctionExpression */ && func.parent.kind === 288 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 164 /* MethodDeclaration */ || + func.kind === 166 /* GetAccessor */ || + func.kind === 167 /* SetAccessor */) && func.parent.kind === 197 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 205 /* FunctionExpression */ && func.parent.kind === 285 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -65006,7 +63321,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 209 /* ArrowFunction */) { + if (func.kind === 206 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -65033,7 +63348,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 288 /* PropertyAssignment */) { + if (literal.parent.kind !== 285 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -65047,7 +63362,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -65100,41 +63415,25 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 160 /* Parameter */: + case 159 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getContextualTypeForBindingElement(declaration); - case 163 /* PropertyDeclaration */: - if (ts.hasSyntacticModifier(declaration, 32 /* Static */)) { - return getContextualTypeForStaticPropertyDeclaration(declaration); - } - // By default, do nothing and return undefined - only the above cases have context implied by a parent + // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } } function getContextualTypeForBindingElement(declaration) { var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 198 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); - if (!parentType || ts.isBindingPattern(name) || ts.isComputedNonLiteralName(name)) - return undefined; - if (parent.name.kind === 197 /* ArrayBindingPattern */) { - var index = ts.indexOfNode(declaration.parent.elements, declaration); - if (index < 0) - return undefined; - return getContextualTypeForElementExpression(parentType, index); + parent.kind !== 195 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + if (parentType && !ts.isBindingPattern(name) && !ts.isComputedNonLiteralName(name)) { + var nameType = getLiteralTypeFromPropertyName(name); + if (isTypeUsableAsPropertyName(nameType)) { + var text = getPropertyNameFromType(nameType); + return getTypeOfPropertyOfType(parentType, text); + } } - var nameType = getLiteralTypeFromPropertyName(name); - if (isTypeUsableAsPropertyName(nameType)) { - var text = getPropertyNameFromType(nameType); - return getTypeOfPropertyOfType(parentType, text); - } - } - function getContextualTypeForStaticPropertyDeclaration(declaration) { - var parentType = ts.isExpression(declaration.parent) && getContextualType(declaration.parent); - if (!parentType) - return undefined; - return getTypeOfPropertyOfContextualType(parentType, getSymbolOfNode(declaration).escapedName); } // In a variable, parameter or property declaration with a type annotation, // the contextual type of an initializer expression is the type of the variable, parameter or property. @@ -65255,7 +63554,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 205 /* TaggedTemplateExpression */) { + if (template.parent.kind === 202 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -65268,7 +63567,14 @@ var ts; case 75 /* AmpersandAmpersandEqualsToken */: case 74 /* BarBarEqualsToken */: case 76 /* QuestionQuestionEqualsToken */: - return node === right ? getContextualTypeForAssignmentDeclaration(binaryExpression) : undefined; + if (node !== right) { + return undefined; + } + var contextSensitive = getIsContextSensitiveAssignmentOrContextType(binaryExpression); + if (!contextSensitive) { + return undefined; + } + return contextSensitive === true ? getTypeOfExpression(left) : contextSensitive; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: // When an || expression has a contextual type, the operands are contextually typed by that type, except @@ -65288,27 +63594,24 @@ var ts; } // In an assignment expression, the right operand is contextually typed by the type of the left operand. // Don't do this for assignment declarations unless there is a type tag on the assignment, to avoid circularity from checking the right operand. - function getContextualTypeForAssignmentDeclaration(binaryExpression) { + function getIsContextSensitiveAssignmentOrContextType(binaryExpression) { var kind = ts.getAssignmentDeclarationKind(binaryExpression); switch (kind) { case 0 /* None */: - return getTypeOfExpression(binaryExpression.left); + return true; case 5 /* Property */: case 1 /* ExportsProperty */: case 6 /* Prototype */: case 3 /* PrototypeProperty */: - if (isPossiblyAliasedThisProperty(binaryExpression, kind)) { - return getContextualTypeForThisPropertyAssignment(binaryExpression, kind); - } // If `binaryExpression.left` was assigned a symbol, then this is a new declaration; otherwise it is an assignment to an existing declaration. // See `bindStaticPropertyAssignment` in `binder.ts`. - else if (!binaryExpression.left.symbol) { - return getTypeOfExpression(binaryExpression.left); + if (!binaryExpression.left.symbol) { + return true; } else { var decl = binaryExpression.left.symbol.valueDeclaration; if (!decl) { - return undefined; + return false; } var lhs = ts.cast(binaryExpression.left, ts.isAccessExpression); var overallAnnotation = ts.getEffectiveTypeAnnotationNode(decl); @@ -65321,19 +63624,39 @@ var ts; if (parentSymbol) { var annotated = parentSymbol.valueDeclaration && ts.getEffectiveTypeAnnotationNode(parentSymbol.valueDeclaration); if (annotated) { - var nameStr = ts.getElementOrPropertyAccessName(lhs); - if (nameStr !== undefined) { - return getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr); + var nameStr_1 = ts.getElementOrPropertyAccessName(lhs); + if (nameStr_1 !== undefined) { + var type = getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr_1); + return type || false; } } - return undefined; + return false; } } - return ts.isInJSFile(decl) ? undefined : getTypeOfExpression(binaryExpression.left); + return !ts.isInJSFile(decl); } case 2 /* ModuleExports */: case 4 /* ThisProperty */: - return getContextualTypeForThisPropertyAssignment(binaryExpression, kind); + if (!binaryExpression.symbol) + return true; + if (binaryExpression.symbol.valueDeclaration) { + var annotated = ts.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); + if (annotated) { + var type = getTypeFromTypeNode(annotated); + if (type) { + return type; + } + } + } + if (kind === 2 /* ModuleExports */) + return false; + var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression); + if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, /*includeArrowFunctions*/ false))) { + return false; + } + var thisType = checkThisExpression(thisAccess.expression); + var nameStr = ts.getElementOrPropertyAccessName(thisAccess); + return nameStr !== undefined && thisType && getTypeOfPropertyOfContextualType(thisType, nameStr) || false; case 7 /* ObjectDefinePropertyValue */: case 8 /* ObjectDefinePropertyExports */: case 9 /* ObjectDefinePrototypeProperty */: @@ -65342,40 +63665,6 @@ var ts; return ts.Debug.assertNever(kind); } } - function isPossiblyAliasedThisProperty(declaration, kind) { - if (kind === void 0) { kind = ts.getAssignmentDeclarationKind(declaration); } - if (kind === 4 /* ThisProperty */) { - return true; - } - if (!ts.isInJSFile(declaration) || kind !== 5 /* Property */ || !ts.isIdentifier(declaration.left.expression)) { - return false; - } - var name = declaration.left.expression.escapedText; - var symbol = resolveName(declaration.left, name, 111551 /* Value */, undefined, undefined, /*isUse*/ true, /*excludeGlobals*/ true); - return ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration); - } - function getContextualTypeForThisPropertyAssignment(binaryExpression, kind) { - if (!binaryExpression.symbol) - return getTypeOfExpression(binaryExpression.left); - if (binaryExpression.symbol.valueDeclaration) { - var annotated = ts.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); - if (annotated) { - var type = getTypeFromTypeNode(annotated); - if (type) { - return type; - } - } - } - if (kind === 2 /* ModuleExports */) - return undefined; - var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression); - if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, /*includeArrowFunctions*/ false))) { - return undefined; - } - var thisType = checkThisExpression(thisAccess.expression); - var nameStr = ts.getElementOrPropertyAccessName(thisAccess); - return nameStr !== undefined && getTypeOfPropertyOfContextualType(thisType, nameStr) || undefined; - } function isCircularMappedProperty(symbol) { return !!(ts.getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0); } @@ -65445,8 +63734,7 @@ var ts; // type of T. function getContextualTypeForElementExpression(arrayContextualType, index) { return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) - || mapType(arrayContextualType, function (t) { return getIteratedTypeOrElementType(1 /* Element */, t, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false); }, - /*noReductions*/ true)); + || getIteratedTypeOrElementType(1 /* Element */, arrayContextualType, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false)); } // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type. function getContextualTypeForConditionalOperand(node, contextFlags) { @@ -65460,7 +63748,7 @@ var ts; if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) { return undefined; } - var realChildren = ts.getSemanticJsxChildren(node.children); + var realChildren = getSemanticJsxChildren(node.children); var childIndex = realChildren.indexOf(child); var childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName); return childFieldType && (realChildren.length === 1 ? childFieldType : mapType(childFieldType, function (t) { @@ -65508,21 +63796,21 @@ var ts; case 94 /* FalseKeyword */: case 103 /* NullKeyword */: case 78 /* Identifier */: - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: return true; - case 201 /* PropertyAccessExpression */: - case 207 /* ParenthesizedExpression */: + case 198 /* PropertyAccessExpression */: + case 204 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 288 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 285 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 280 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 277 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -65547,7 +63835,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -65570,7 +63858,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -65608,58 +63896,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 195 /* BindingElement */: return getContextualTypeForInitializerExpression(node, contextFlags); - case 209 /* ArrowFunction */: - case 242 /* ReturnStatement */: + case 206 /* ArrowFunction */: + case 239 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent, contextFlags); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (parent.expression.kind === 99 /* ImportKeyword */) { return stringType; } /* falls through */ - case 204 /* NewExpression */: + case 201 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(parent.type); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 199 /* ArrayLiteralExpression */: { + case 196 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 228 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 218 /* TemplateExpression */); + case 225 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 215 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 207 /* ParenthesizedExpression */: { + case 204 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 280 /* JsxAttribute */: - case 282 /* JsxSpreadAttribute */: + case 277 /* JsxAttribute */: + case 279 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -65822,7 +64110,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 208 /* FunctionExpression */ || node.kind === 209 /* ArrowFunction */; + return node.kind === 205 /* FunctionExpression */ || node.kind === 206 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -65836,7 +64124,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -65850,8 +64138,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var current = types_18[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var current = types_17[_i]; var signature = getContextualCallSignature(current, node); if (signature) { if (!signatureList) { @@ -65884,8 +64172,8 @@ var ts; return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type; } function hasDefaultValue(node) { - return (node.kind === 198 /* BindingElement */ && !!node.initializer) || - (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 195 /* BindingElement */ && !!node.initializer) || + (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -65897,7 +64185,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - if (e.kind === 220 /* SpreadElement */) { + if (e.kind === 217 /* SpreadElement */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 2048 /* SpreadArrays */); } @@ -65960,7 +64248,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return isNumericComputedName(name); case 78 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -66010,7 +64298,7 @@ var ts; // This will allow types number, string, symbol or any. It will also allow enums, the unknown // type, and any union of these types (like string | number). if (links.resolvedType.flags & 98304 /* Nullable */ || - !isTypeAssignableToKind(links.resolvedType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && + !isTypeAssignableToKind(links.resolvedType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) { error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } @@ -66056,7 +64344,7 @@ var ts; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 196 /* ObjectBindingPattern */ || contextualType.pattern.kind === 200 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 193 /* ObjectBindingPattern */ || contextualType.pattern.kind === 197 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -66079,16 +64367,16 @@ var ts; for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var memberDecl = _c[_b]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 158 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 157 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 288 /* PropertyAssignment */ || - memberDecl.kind === 289 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 285 /* PropertyAssignment */ || + memberDecl.kind === 286 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 288 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + var type = memberDecl.kind === 285 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`. // we don't want to say "could not find 'a'". - memberDecl.kind === 289 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : + memberDecl.kind === 286 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -66111,8 +64399,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 288 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 289 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 285 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 286 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -66138,7 +64426,7 @@ var ts; member = prop; allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 290 /* SpreadAssignment */) { + else if (memberDecl.kind === 287 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -66167,7 +64455,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 167 /* GetAccessor */ || memberDecl.kind === 168 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 166 /* GetAccessor */ || memberDecl.kind === 167 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -66192,7 +64480,7 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 290 /* SpreadAssignment */) { + if (contextualTypeHasPattern && node.parent.kind !== 287 /* SpreadAssignment */) { for (var _d = 0, _e = getPropertiesOfType(contextualType); _d < _e.length; _d++) { var prop = _e[_d]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { @@ -66234,7 +64522,7 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); @@ -66246,6 +64534,7 @@ var ts; } function checkJsxSelfClosingElementDeferred(node) { checkJsxOpeningLikeElementOrOpeningFragment(node); + resolveUntypedCall(node); // ensure type arguments and parameters are typechecked, even if there is an arity error } function checkJsxSelfClosingElement(node, _checkMode) { checkNodeDeferred(node); @@ -66272,7 +64561,7 @@ var ts; // by default, jsx:'react' will use jsxFactory = React.createElement and jsxFragmentFactory = React.Fragment // if jsxFactory compiler option is provided, ensure jsxFragmentFactory compiler option or @jsxFrag pragma is provided too var nodeSourceFile = ts.getSourceFileOfNode(node); - if (ts.getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) + if (compilerOptions.jsx === 2 /* React */ && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) && !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) { error(node, compilerOptions.jsxFactory ? ts.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option @@ -66324,7 +64613,7 @@ var ts; if (ts.isJsxAttribute(attributeDecl)) { var exprType = checkJsxAttribute(attributeDecl, checkMode); objectFlags |= ts.getObjectFlags(exprType) & 3670016 /* PropagatingFlags */; - var attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName); + var attributeSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */ | member.flags, member.escapedName); attributeSymbol.declarations = member.declarations; attributeSymbol.parent = member.parent; if (member.valueDeclaration) { @@ -66339,7 +64628,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 282 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 279 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -66365,7 +64654,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 273 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 270 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -66379,7 +64668,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(openingLikeElement.attributes); var childrenContextualType = contextualType && getTypeOfPropertyOfContextualType(contextualType, jsxChildrenPropertyName); // If there are children in the body of JSX element, create dummy attribute "children" with the union of children types so that it will pass the attribute checking process - var childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName); + var childrenPropSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */, jsxChildrenPropertyName); childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && forEachType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes)); @@ -66422,9 +64711,6 @@ var ts; childrenTypes.push(stringType); } } - else if (child.kind === 283 /* JsxExpression */ && !child.expression) { - continue; // empty jsx expressions don't *really* count as present children - } else { childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); } @@ -66494,60 +64780,29 @@ var ts; } return links.resolvedSymbol; } - function getJsxNamespaceContainerForImplicitImport(location) { - var file = location && ts.getSourceFileOfNode(location); - var links = file && getNodeLinks(file); - if (links && links.jsxImplicitImportContainer === false) { - return undefined; - } - if (links && links.jsxImplicitImportContainer) { - return links.jsxImplicitImportContainer; - } - var runtimeImportSpecifier = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(compilerOptions, file), compilerOptions); - if (!runtimeImportSpecifier) { - return undefined; - } - var isClassic = ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Classic; - var errorMessage = isClassic - ? ts.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option - : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations; - var mod = resolveExternalModule(location, runtimeImportSpecifier, errorMessage, location); - var result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : undefined; - if (links) { - links.jsxImplicitImportContainer = result || false; - } - return result; - } function getJsxNamespaceAt(location) { var links = location && getNodeLinks(location); if (links && links.jsxNamespace) { return links.jsxNamespace; } if (!links || links.jsxNamespace !== false) { - var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); - if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { - var namespaceName = getJsxNamespace(location); - resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); - } + var namespaceName = getJsxNamespace(location); + var resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); if (resolvedNamespace) { var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */)); - if (candidate && candidate !== unknownSymbol) { + if (candidate) { if (links) { links.jsxNamespace = candidate; } return candidate; } - } - if (links) { - links.jsxNamespace = false; + if (links) { + links.jsxNamespace = false; + } } } // JSX global fallback - var s = resolveSymbol(getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined)); - if (s === unknownSymbol) { - return undefined; // TODO: GH#18217 - } - return s; // TODO: GH#18217 + return getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined); // TODO: GH#18217 } /** * Look into JSX namespace and then look for container with matching name as nameOfAttribPropContainer. @@ -66734,25 +64989,23 @@ var ts; checkGrammarJsxElement(node); } checkJsxPreconditions(node); - if (!getJsxNamespaceContainerForImplicitImport(node)) { - // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. - // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. - var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var jsxFactoryNamespace = getJsxNamespace(node); - var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; - // allow null as jsxFragmentFactory - var jsxFactorySym = void 0; - if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); - } - if (jsxFactorySym) { - // Mark local symbol as referenced here because it might not have been marked - // if jsx emit was not jsxFactory as there wont be error being emitted - jsxFactorySym.isReferenced = 67108863 /* All */; - // If react/jsxFactory symbol is alias, mark it as refereced - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { - markAliasSymbolAsReferenced(jsxFactorySym); - } + // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. + // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. + var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var jsxFactoryNamespace = getJsxNamespace(node); + var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + // allow null as jsxFragmentFactory + var jsxFactorySym; + if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); + } + if (jsxFactorySym) { + // Mark local symbol as referenced here because it might not have been marked + // if jsx emit was not jsxFactory as there wont be error being emitted + jsxFactorySym.isReferenced = 67108863 /* All */; + // If react/jsxFactory symbol is alias, mark it as refereced + if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); } } if (isNodeOpeningLikeElement) { @@ -66842,7 +65095,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 157 /* QualifiedName */ ? node.right : node.kind === 195 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 156 /* QualifiedName */ ? node.right : node.kind === 192 /* ImportType */ ? node : node.name; if (isSuper) { // TS 1.0 spec (April 2014): 4.8.2 // - In a constructor, instance member function, instance member accessor, or @@ -66996,7 +65249,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 207 /* ParenthesizedExpression */) { + while (node.parent.kind === 204 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -67054,10 +65307,10 @@ var ts; return false; } function isThisPropertyAccessInConstructor(node, prop) { - return (isConstructorDeclaredProperty(prop) || ts.isThisProperty(node) && isAutoTypedProperty(prop)) - && ts.getThisContainer(node, /*includeArrowFunctions*/ true) === getDeclaringConstructor(prop); + return ts.isThisProperty(node) && (isAutoTypedProperty(prop) || isConstructorDeclaredProperty(prop)) && ts.getThisContainer(node, /*includeArrowFunctions*/ true) === getDeclaringConstructor(prop); } function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right) { + var _a; var parentSymbol = getNodeLinks(left).resolvedSymbol; var assignmentKind = ts.getAssignmentTargetKind(node); var apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType); @@ -67119,10 +65372,10 @@ var ts; if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) { error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); } - propType = (compilerOptions.noUncheckedIndexedAccess && !ts.isAssignmentTarget(node)) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + propType = indexInfo.type; } else { - if (getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) { + if (((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.flags) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) { errorOrSuggestion(/* isError */ false, right, ts.Diagnostics._0_is_deprecated, right.escapedText); } checkPropertyNotUsedBeforeDeclaration(prop, node, right); @@ -67159,7 +65412,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 166 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 165 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -67191,8 +65444,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 252 /* ClassDeclaration */ && - node.parent.kind !== 173 /* TypeReference */ && + else if (valueDeclaration.kind === 249 /* ClassDeclaration */ && + node.parent.kind !== 172 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -67204,22 +65457,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return true; - case 288 /* PropertyAssignment */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 290 /* SpreadAssignment */: - case 158 /* ComputedPropertyName */: - case 228 /* TemplateSpan */: - case 283 /* JsxExpression */: - case 280 /* JsxAttribute */: - case 281 /* JsxAttributes */: - case 282 /* JsxSpreadAttribute */: - case 275 /* JsxOpeningElement */: - case 223 /* ExpressionWithTypeArguments */: - case 286 /* HeritageClause */: + case 285 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 287 /* SpreadAssignment */: + case 157 /* ComputedPropertyName */: + case 225 /* TemplateSpan */: + case 280 /* JsxExpression */: + case 277 /* JsxAttribute */: + case 278 /* JsxAttributes */: + case 279 /* JsxSpreadAttribute */: + case 272 /* JsxOpeningElement */: + case 220 /* ExpressionWithTypeArguments */: + case 283 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -67275,22 +65528,14 @@ var ts; relatedInfo = ts.createDiagnosticForNode(propNode, ts.Diagnostics.Did_you_forget_to_use_await); } else { - var missingProperty = ts.declarationNameToString(propNode); - var container = typeToString(containingType); - var libSuggestion = getSuggestedLibForNonExistentProperty(missingProperty, containingType); - if (libSuggestion !== undefined) { - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later, missingProperty, container, libSuggestion); + var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); + if (suggestion !== undefined) { + var suggestedName = ts.symbolName(suggestion); + errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, ts.declarationNameToString(propNode), typeToString(containingType), suggestedName); + relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName); } else { - var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); - if (suggestion !== undefined) { - var suggestedName = ts.symbolName(suggestion); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, missingProperty, container, suggestedName); - relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName); - } - else { - errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, missingProperty, container); - } + errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(propNode), typeToString(containingType)); } } } @@ -67304,34 +65549,6 @@ var ts; var prop = containingType.symbol && getPropertyOfType(getTypeOfSymbol(containingType.symbol), propName); return prop !== undefined && prop.valueDeclaration && ts.hasSyntacticModifier(prop.valueDeclaration, 32 /* Static */); } - function getSuggestedLibForNonExistentName(name) { - var missingName = diagnosticName(name); - var allFeatures = ts.getScriptTargetFeatures(); - var libTargets = ts.getOwnKeys(allFeatures); - for (var _i = 0, libTargets_1 = libTargets; _i < libTargets_1.length; _i++) { - var libTarget = libTargets_1[_i]; - var containingTypes = ts.getOwnKeys(allFeatures[libTarget]); - if (containingTypes !== undefined && ts.contains(containingTypes, missingName)) { - return libTarget; - } - } - } - function getSuggestedLibForNonExistentProperty(missingProperty, containingType) { - var container = getApparentType(containingType).symbol; - if (!container) { - return undefined; - } - var allFeatures = ts.getScriptTargetFeatures(); - var libTargets = ts.getOwnKeys(allFeatures); - for (var _i = 0, libTargets_2 = libTargets; _i < libTargets_2.length; _i++) { - var libTarget = libTargets_2[_i]; - var featuresOfLib = allFeatures[libTarget]; - var featuresOfContainingType = featuresOfLib[ts.symbolName(container)]; - if (featuresOfContainingType !== undefined && ts.contains(featuresOfContainingType, missingProperty)) { - return libTarget; - } - } - } function getSuggestedSymbolForNonexistentProperty(name, containingType) { return getSpellingSuggestionForName(ts.isString(name) ? name : ts.idText(name), getPropertiesOfType(containingType), 111551 /* Value */); } @@ -67452,16 +65669,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 105 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 195 /* ImportType */: + case 192 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 201 /* PropertyAccessExpression */ && node.expression.kind === 105 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 198 /* PropertyAccessExpression */ && node.expression.kind === 105 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -67484,7 +65701,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 250 /* VariableDeclarationList */) { + if (initializer.kind === 247 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -67513,7 +65730,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 238 /* ForInStatement */ && + if (node.kind === 235 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -67550,7 +65767,7 @@ var ts; var accessFlags = ts.isAssignmentTarget(node) ? 2 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 /* NoIndexSignatures */ : 0) : 0 /* None */; - var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, accessFlags | 16 /* ExpressionPosition */) || errorType; + var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType; return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node); } function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { @@ -67597,13 +65814,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 161 /* Decorator */) { + else if (node.kind !== 160 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -67667,7 +65884,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 220 /* SpreadElement */ || arg.kind === 227 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 217 /* SpreadElement */ || arg.kind === 224 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -67675,18 +65892,15 @@ var ts; function acceptsVoid(t) { return !!(t.flags & 16384 /* Void */); } - function acceptsVoidUndefinedUnknownOrAny(t) { - return !!(t.flags & (16384 /* Void */ | 32768 /* Undefined */ | 2 /* Unknown */ | 1 /* Any */)); - } function hasCorrectArity(node, args, signature, signatureHelpTrailingComma) { if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } var argCount; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 218 /* TemplateExpression */) { + if (node.template.kind === 215 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -67701,7 +65915,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 161 /* Decorator */) { + else if (node.kind === 160 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -67715,7 +65929,7 @@ var ts; } else if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 204 /* NewExpression */); + ts.Debug.assert(node.kind === 201 /* NewExpression */); return getMinArgumentCount(signature) === 0; } else { @@ -67739,7 +65953,7 @@ var ts; } for (var i = argCount; i < effectiveMinimumArguments; i++) { var type = getTypeAtPosition(signature, i); - if (filterType(type, ts.isInJSFile(node) && !strictNullChecks ? acceptsVoidUndefinedUnknownOrAny : acceptsVoid).flags & 131072 /* Never */) { + if (filterType(type, acceptsVoid).flags & 131072 /* Never */) { return false; } } @@ -67809,7 +66023,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 161 /* Decorator */) { + if (node.kind !== 160 /* Decorator */) { var contextualType = getContextualType(node, ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); }) ? 8 /* SkipBindingPatterns */ : 0 /* None */); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -67858,7 +66072,7 @@ var ts; } for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 222 /* OmittedExpression */) { + if (arg.kind !== 219 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -67882,7 +66096,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return getMutableArrayOrTupleType(arg.kind === 227 /* SyntheticExpression */ ? arg.type : + return getMutableArrayOrTupleType(arg.kind === 224 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode)); } } @@ -67892,24 +66106,24 @@ var ts; for (var i = index; i < argCount; i++) { var arg = args[i]; if (isSpreadArgument(arg)) { - var spreadType = arg.kind === 227 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); + var spreadType = arg.kind === 224 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); if (isArrayLikeType(spreadType)) { types.push(spreadType); flags.push(8 /* Variadic */); } else { - types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 220 /* SpreadElement */ ? arg.expression : arg)); + types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 217 /* SpreadElement */ ? arg.expression : arg)); flags.push(4 /* Rest */); } } else { var contextualType = getIndexedAccessType(restType, getLiteralType(i - index)); var argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode); - var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */); types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(1 /* Required */); } - if (arg.kind === 227 /* SyntheticExpression */ && arg.tupleNameSource) { + if (arg.kind === 224 /* SyntheticExpression */ && arg.tupleNameSource) { names.push(arg.tupleNameSource); } } @@ -68050,7 +66264,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 204 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 201 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -68080,7 +66294,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 222 /* OmittedExpression */) { + if (arg.kind !== 219 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -68121,7 +66335,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -68138,17 +66352,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 218 /* TemplateExpression */) { + if (template.kind === 215 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 161 /* Decorator */) { + if (node.kind === 160 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -68159,10 +66373,10 @@ var ts; if (spreadIndex >= 0) { // Create synthetic arguments from spreads of tuple types. var effectiveArgs_1 = args.slice(0, spreadIndex); - var _loop_20 = function (i) { + var _loop_19 = function (i) { var arg = args[i]; // We can call checkExpressionCached because spread expressions never have a contextual type. - var spreadType = arg.kind === 220 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); + var spreadType = arg.kind === 217 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); if (spreadType && isTupleType(spreadType)) { ts.forEach(getTypeArguments(spreadType), function (t, i) { var _a; @@ -68176,7 +66390,7 @@ var ts; } }; for (var i = spreadIndex; i < args.length; i++) { - _loop_20(i); + _loop_19(i); } return effectiveArgs_1; } @@ -68189,30 +66403,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 160 /* Parameter */: + case 159 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 166 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 165 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 163 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 162 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -68226,17 +66440,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return 1; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return 2; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 160 /* Parameter */: + case 159 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -68267,20 +66481,6 @@ var ts; return ts.createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); } } - function isPromiseResolveArityError(node) { - if (!ts.isCallExpression(node) || !ts.isIdentifier(node.expression)) - return false; - var symbol = resolveName(node.expression, node.expression.escapedText, 111551 /* Value */, undefined, undefined, false); - var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration; - if (!decl || !ts.isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !ts.isNewExpression(decl.parent.parent) || !ts.isIdentifier(decl.parent.parent.expression)) { - return false; - } - var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(/*reportErrors*/ false); - if (!globalPromiseSymbol) - return false; - var constructorSymbol = getSymbolAtLocation(decl.parent.parent.expression, /*ignoreErrors*/ true); - return constructorSymbol === globalPromiseSymbol; - } function getArgumentArityError(node, signatures, args) { var min = Number.POSITIVE_INFINITY; var max = Number.NEGATIVE_INFINITY; @@ -68312,15 +66512,9 @@ var ts; } var spanArray; var related; - var error = hasRestParameter || hasSpreadArgument ? - hasRestParameter && hasSpreadArgument ? - ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more : - hasRestParameter ? - ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 : - ts.Diagnostics.Expected_0_arguments_but_got_1_or_more : - paramRange === 1 && argCount === 0 && isPromiseResolveArityError(node) ? - ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : - ts.Diagnostics.Expected_0_arguments_but_got_1; + var error = hasRestParameter || hasSpreadArgument ? hasRestParameter && hasSpreadArgument ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more : + hasRestParameter ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 : + ts.Diagnostics.Expected_0_arguments_but_got_1_or_more : ts.Diagnostics.Expected_0_arguments_but_got_1; if (closestSignature && getMinArgumentCount(closestSignature) > argCount && closestSignature.declaration) { var paramDecl = closestSignature.declaration.parameters[closestSignature.thisParameter ? argCount + 1 : argCount]; if (paramDecl) { @@ -68383,8 +66577,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 205 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 161 /* Decorator */; + var isTaggedTemplate = node.kind === 202 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 160 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray && produceDiagnostics; var typeArguments; @@ -68446,7 +66640,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 203 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 200 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -68458,10 +66652,10 @@ var ts; // is just important for choosing the best signature. So in the case where there is only one // signature, the subtype pass is useless. So skipping it is an optimization. if (candidates.length > 1) { - result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma); } if (!result) { - result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + result = chooseOverload(candidates, assignableRelation, signatureHelpTrailingComma); } if (result) { return result; @@ -68486,7 +66680,6 @@ var ts; if (last_2.declaration && candidatesForArgumentError.length > 3) { ts.addRelatedInfo(d, ts.createDiagnosticForNode(last_2.declaration, ts.Diagnostics.The_last_overload_is_declared_here)); } - addImplementationSuccessElaboration(last_2, d); diagnostics.add(d); } } @@ -68500,7 +66693,7 @@ var ts; var min_3 = Number.MAX_VALUE; var minIndex = 0; var i_1 = 0; - var _loop_21 = function (c) { + var _loop_20 = function (c) { var chain_2 = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); }; var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* Normal */, /*reportErrors*/ true, chain_2); if (diags_2) { @@ -68518,24 +66711,19 @@ var ts; }; for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) { var c = candidatesForArgumentError_1[_a]; - _loop_21(c); + _loop_20(c); } var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics); ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures"); var chain = ts.chainDiagnosticMessages(ts.map(diags_3, function (d) { return typeof d.messageText === "string" ? d : d.messageText; }), ts.Diagnostics.No_overload_matches_this_call); - // The below is a spread to guarantee we get a new (mutable) array - our `flatMap` helper tries to do "smart" optimizations where it reuses input - // arrays and the emptyArray singleton where possible, which is decidedly not what we want while we're still constructing this diagnostic - var related = __spreadArrays(ts.flatMap(diags_3, function (d) { return d.relatedInformation; })); - var diag = void 0; + var related = ts.flatMap(diags_3, function (d) { return d.relatedInformation; }); if (ts.every(diags_3, function (d) { return d.start === diags_3[0].start && d.length === diags_3[0].length && d.file === diags_3[0].file; })) { var _b = diags_3[0], file = _b.file, start = _b.start, length_6 = _b.length; - diag = { file: file, start: start, length: length_6, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }; + diagnostics.add({ file: file, start: start, length: length_6, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }); } else { - diag = ts.createDiagnosticForNodeFromMessageChain(node, chain, related); + diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(node, chain, related)); } - addImplementationSuccessElaboration(candidatesForArgumentError[0], diag); - diagnostics.add(diag); } } else if (candidateForArgumentArityError) { @@ -68558,26 +66746,7 @@ var ts; } } return getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray); - function addImplementationSuccessElaboration(failed, diagnostic) { - var _a, _b; - var oldCandidatesForArgumentError = candidatesForArgumentError; - var oldCandidateForArgumentArityError = candidateForArgumentArityError; - var oldCandidateForTypeArgumentError = candidateForTypeArgumentError; - var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray; - var isOverload = failedSignatureDeclarations.length > 1; - var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined; - if (implDecl) { - var candidate = getSignatureFromDeclaration(implDecl); - var isSingleNonGenericCandidate_1 = !candidate.typeParameters; - if (chooseOverload([candidate], assignableRelation, isSingleNonGenericCandidate_1)) { - ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(implDecl, ts.Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible)); - } - } - candidatesForArgumentError = oldCandidatesForArgumentError; - candidateForArgumentArityError = oldCandidateForArgumentArityError; - candidateForTypeArgumentError = oldCandidateForTypeArgumentError; - } - function chooseOverload(candidates, relation, isSingleNonGenericCandidate, signatureHelpTrailingComma) { + function chooseOverload(candidates, relation, signatureHelpTrailingComma) { if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } candidatesForArgumentError = undefined; candidateForArgumentArityError = undefined; @@ -68676,7 +66845,7 @@ var ts; } var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max; var parameters = []; - var _loop_22 = function (i) { + var _loop_21 = function (i) { var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ? i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) : i < s.parameters.length ? s.parameters[i] : undefined; }); @@ -68684,7 +66853,7 @@ var ts; parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); }))); }; for (var i = 0; i < maxNonRestParam; i++) { - _loop_22(i); + _loop_21(i); } var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; }); var flags = 0 /* None */; @@ -68987,7 +67156,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedEffectiveModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 166 /* Constructor */) { + if (!modifiers || declaration.kind !== 165 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -69019,8 +67188,8 @@ var ts; if (apparentType.flags & 1048576 /* Union */) { var types = apparentType.types; var hasSignatures = false; - for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { - var constituent = types_19[_i]; + for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { + var constituent = types_18[_i]; var signatures = getSignaturesOfType(constituent, kind); if (signatures.length !== 0) { hasSignatures = true; @@ -69116,11 +67285,6 @@ var ts; return resolveUntypedCall(node); } if (!callSignatures.length) { - if (ts.isArrayLiteralExpression(node.parent)) { - var diagnostic = ts.createDiagnosticForNode(node.tag, ts.Diagnostics.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked); - diagnostics.add(diagnostic); - return resolveErrorCall(node); - } invocationError(node.tag, apparentType, 0 /* Call */); return resolveErrorCall(node); } @@ -69131,16 +67295,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 160 /* Parameter */: + case 159 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -69199,10 +67363,6 @@ var ts; var result = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); var fakeSignature = createSignatureForJSXIntrinsic(node, result); checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), /*mapper*/ undefined, 0 /* Normal */), result, node.tagName, node.attributes); - if (ts.length(node.typeArguments)) { - ts.forEach(node.typeArguments, checkSourceElement); - diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), node.typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, 0, ts.length(node.typeArguments))); - } return fakeSignature; } var exprTypes = checkExpression(node.tagName); @@ -69235,16 +67395,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 161 /* Decorator */: + case 160 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -69322,61 +67482,20 @@ var ts; } } function getAssignedClassSymbol(decl) { - var _a; - var assignmentSymbol = decl && getSymbolOfExpando(decl, /*allowDeclaration*/ true); - var prototype = (_a = assignmentSymbol === null || assignmentSymbol === void 0 ? void 0 : assignmentSymbol.exports) === null || _a === void 0 ? void 0 : _a.get("prototype"); - var init = (prototype === null || prototype === void 0 ? void 0 : prototype.valueDeclaration) && getAssignedJSPrototype(prototype.valueDeclaration); + var assignmentSymbol = decl && decl.parent && + (ts.isFunctionDeclaration(decl) && getSymbolOfNode(decl) || + ts.isBinaryExpression(decl.parent) && getSymbolOfNode(decl.parent.left) || + ts.isVariableDeclaration(decl.parent) && getSymbolOfNode(decl.parent)); + var prototype = assignmentSymbol && assignmentSymbol.exports && assignmentSymbol.exports.get("prototype"); + var init = prototype && prototype.valueDeclaration && getAssignedJSPrototype(prototype.valueDeclaration); return init ? getSymbolOfNode(init) : undefined; } - function getSymbolOfExpando(node, allowDeclaration) { - if (!node.parent) { - return undefined; - } - var name; - var decl; - if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) { - if (!ts.isInJSFile(node) && !(ts.isVarConst(node.parent) && ts.isFunctionLikeDeclaration(node))) { - return undefined; - } - name = node.parent.name; - decl = node.parent; - } - else if (ts.isBinaryExpression(node.parent)) { - var parentNode = node.parent; - var parentNodeOperator = node.parent.operatorToken.kind; - if (parentNodeOperator === 62 /* EqualsToken */ && (allowDeclaration || parentNode.right === node)) { - name = parentNode.left; - decl = name; - } - else if (parentNodeOperator === 56 /* BarBarToken */ || parentNodeOperator === 60 /* QuestionQuestionToken */) { - if (ts.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { - name = parentNode.parent.name; - decl = parentNode.parent; - } - else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 /* EqualsToken */ && (allowDeclaration || parentNode.parent.right === parentNode)) { - name = parentNode.parent.left; - decl = name; - } - if (!name || !ts.isBindableStaticNameExpression(name) || !ts.isSameEntityName(name, parentNode.left)) { - return undefined; - } - } - } - else if (allowDeclaration && ts.isFunctionDeclaration(node)) { - name = node.name; - decl = node; - } - if (!decl || !name || (!allowDeclaration && !ts.getExpandoInitializer(node, ts.isPrototypeAccess(name)))) { - return undefined; - } - return getSymbolOfNode(decl); - } function getAssignedJSPrototype(node) { if (!node.parent) { return false; } var parent = node.parent; - while (parent && parent.kind === 201 /* PropertyAccessExpression */) { + while (parent && parent.kind === 198 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -69403,12 +67522,12 @@ var ts; if (node.expression.kind === 105 /* SuperKeyword */) { return voidType; } - if (node.kind === 204 /* NewExpression */) { + if (node.kind === 201 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 166 /* Constructor */ && - declaration.kind !== 170 /* ConstructSignature */ && - declaration.kind !== 175 /* ConstructorType */ && + declaration.kind !== 165 /* Constructor */ && + declaration.kind !== 169 /* ConstructSignature */ && + declaration.kind !== 174 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -69428,7 +67547,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 203 /* CallExpression */ && node.parent.kind === 233 /* ExpressionStatement */ && + if (node.kind === 200 /* CallExpression */ && node.parent.kind === 230 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -69439,11 +67558,14 @@ var ts; } } if (ts.isInJSFile(node)) { - var jsSymbol = getSymbolOfExpando(node, /*allowDeclaration*/ false); - if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) { - var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined); - jsAssignmentType.objectFlags |= 16384 /* JSLiteral */; - return getIntersectionType([returnType, jsAssignmentType]); + var decl = ts.getDeclarationOfExpando(node); + if (decl) { + var jsSymbol = getSymbolOfNode(decl); + if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) { + var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined); + jsAssignmentType.objectFlags |= 16384 /* JSLiteral */; + return getIntersectionType([returnType, jsAssignmentType]); + } } } return returnType; @@ -69457,20 +67579,20 @@ var ts; function getDeprecatedSuggestionNode(node) { node = ts.skipParentheses(node); switch (node.kind) { - case 203 /* CallExpression */: - case 161 /* Decorator */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 160 /* Decorator */: + case 201 /* NewExpression */: return getDeprecatedSuggestionNode(node.expression); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return getDeprecatedSuggestionNode(node.tag); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return getDeprecatedSuggestionNode(node.tagName); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return node.argumentExpression; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.name; - case 173 /* TypeReference */: + case 172 /* TypeReference */: var typeReference = node; return ts.isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference; default: @@ -69529,7 +67651,6 @@ var ts; if (hasSyntheticDefault) { var memberTable = ts.createSymbolTable(); var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */); - newSymbol.parent = originalSymbol; newSymbol.nameType = getLiteralType("default"); newSymbol.target = resolveSymbol(symbol); memberTable.set("default" /* Default */, newSymbol); @@ -69562,9 +67683,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 251 /* FunctionDeclaration */ + ? 248 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 249 /* VariableDeclaration */ + ? 246 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -69594,19 +67715,18 @@ var ts; case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 218 /* TemplateExpression */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return true; - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -69662,7 +67782,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 166 /* Constructor */) { + else if (container.kind === 165 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -69672,8 +67792,8 @@ var ts; } } function checkImportMetaProperty(node) { - if (moduleKind !== ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) { - error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system); + if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) { + error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system); } var file = ts.getSourceFileOfNode(node); ts.Debug.assert(!!(file.flags & 2097152 /* PossiblyContainsImportMeta */), "Containing file is missing import meta node flag."); @@ -69709,7 +67829,7 @@ var ts; return restParameter.escapedName; } function isValidDeclarationForTupleLabel(d) { - return d.kind === 192 /* NamedTupleMember */ || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name)); + return d.kind === 191 /* NamedTupleMember */ || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name)); } function getNameableDeclarationAtPosition(signature, pos) { var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); @@ -69782,40 +67902,21 @@ var ts; } return length; } - function getMinArgumentCount(signature, flags) { - var strongArityForUntypedJS = flags & 1 /* StrongArityForUntypedJS */; - var voidIsNonOptional = flags & 2 /* VoidIsNonOptional */; - if (voidIsNonOptional || signature.resolvedMinArgumentCount === undefined) { - var minArgumentCount = void 0; - if (signatureHasRestParameter(signature)) { - var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - if (isTupleType(restType)) { - var firstOptionalIndex = ts.findIndex(restType.target.elementFlags, function (f) { return !(f & 1 /* Required */); }); - var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; - if (requiredCount > 0) { - minArgumentCount = signature.parameters.length - 1 + requiredCount; - } + function getMinArgumentCount(signature, strongArityForUntypedJS) { + if (signatureHasRestParameter(signature)) { + var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + if (isTupleType(restType)) { + var firstOptionalIndex = ts.findIndex(restType.target.elementFlags, function (f) { return !(f & 1 /* Required */); }); + var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; + if (requiredCount > 0) { + return signature.parameters.length - 1 + requiredCount; } } - if (minArgumentCount === undefined) { - if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { - return 0; - } - minArgumentCount = signature.minArgumentCount; - } - if (voidIsNonOptional) { - return minArgumentCount; - } - for (var i = minArgumentCount - 1; i >= 0; i--) { - var type = getTypeAtPosition(signature, i); - if (filterType(type, acceptsVoid).flags & 131072 /* Never */) { - break; - } - minArgumentCount = i; - } - signature.resolvedMinArgumentCount = minArgumentCount; } - return signature.resolvedMinArgumentCount; + if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { + return 0; + } + return signature.minArgumentCount; } function hasEffectiveRestParameter(signature) { if (signatureHasRestParameter(signature)) { @@ -69981,7 +68082,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 230 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 227 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -70166,7 +68267,7 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 211 /* TypeOfExpression */) { + if (node.expression.kind === 208 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. @@ -70229,11 +68330,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; - case 165 /* MethodDeclaration */: - return func.parent.kind === 200 /* ObjectLiteralExpression */; + case 164 /* MethodDeclaration */: + return func.parent.kind === 197 /* ObjectLiteralExpression */; default: return false; } @@ -70259,7 +68360,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 164 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 230 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 163 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 227 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -70292,7 +68393,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -70316,7 +68417,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 208 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 205 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -70362,7 +68463,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -70375,7 +68476,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 230 /* Block */) { + if (node.body.kind === 227 /* Block */) { checkSourceElement(node.body); } else { @@ -70465,7 +68566,7 @@ var ts; expr.expression.kind === 107 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && (ctor.kind === 166 /* Constructor */ || isJSConstructor(ctor)))) { + if (!(ctor && (ctor.kind === 165 /* Constructor */ || isJSConstructor(ctor)))) { return true; } if (symbol.valueDeclaration) { @@ -70490,7 +68591,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 263 /* NamespaceImport */; + return !!declaration && declaration.kind === 260 /* NamespaceImport */; } } } @@ -70571,7 +68672,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 166 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 165 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -70673,8 +68774,8 @@ var ts; } if (type.flags & 3145728 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { - var t = types_20[_i]; + for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { + var t = types_19[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -70691,7 +68792,7 @@ var ts; } return !!(kind & 296 /* NumberLike */) && isTypeAssignableTo(source, numberType) || !!(kind & 2112 /* BigIntLike */) && isTypeAssignableTo(source, bigintType) || - !!(kind & 402653316 /* StringLike */) && isTypeAssignableTo(source, stringType) || + !!(kind & 132 /* StringLike */) && isTypeAssignableTo(source, stringType) || !!(kind & 528 /* BooleanLike */) && isTypeAssignableTo(source, booleanType) || !!(kind & 16384 /* Void */) && isTypeAssignableTo(source, voidType) || !!(kind & 131072 /* Never */) && isTypeAssignableTo(source, neverType) || @@ -70740,8 +68841,8 @@ var ts; // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, // and the right operand to be of type Any, an object type, or a type parameter type. // The result is always of the Boolean primitive type. - if (!(allTypesAssignableToKind(leftType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) || - isTypeAssignableToKind(leftType, 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */ | 262144 /* TypeParameter */))) { + if (!(allTypesAssignableToKind(leftType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) || + isTypeAssignableToKind(leftType, 4194304 /* Index */ | 262144 /* TypeParameter */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { @@ -70764,7 +68865,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 288 /* PropertyAssignment */ || property.kind === 289 /* ShorthandPropertyAssignment */) { + if (property.kind === 285 /* PropertyAssignment */ || property.kind === 286 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -70775,11 +68876,11 @@ var ts; checkPropertyAccessibility(property, /*isSuper*/ false, objectLiteralType, prop); } } - var elementType = getIndexedAccessType(objectLiteralType, exprType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */); + var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 289 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 286 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 290 /* SpreadAssignment */) { + else if (property.kind === 287 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -70813,28 +68914,23 @@ var ts; // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType; - var inBoundsType = compilerOptions.noUncheckedIndexedAccess ? undefined : possiblyOutOfBoundsType; + var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType; for (var i = 0; i < elements.length; i++) { - var type = possiblyOutOfBoundsType; - if (node.elements[i].kind === 220 /* SpreadElement */) { - type = inBoundsType = inBoundsType !== null && inBoundsType !== void 0 ? inBoundsType : (checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType); - } - checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode); + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode); } return sourceType; } function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 222 /* OmittedExpression */) { - if (element.kind !== 220 /* SpreadElement */) { + if (element.kind !== 219 /* OmittedExpression */) { + if (element.kind !== 217 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused // when the element is a SyntaxKind.ElementAccessExpression. - var accessFlags = 16 /* ExpressionPosition */ | (hasDefaultValue(element) ? 8 /* NoTupleBoundsCheck */ : 0); - var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, createSyntheticExpression(element, indexType), accessFlags) || errorType; + var accessFlags = hasDefaultValue(element) ? 8 /* NoTupleBoundsCheck */ : 0; + var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, createSyntheticExpression(element, indexType), accessFlags) || errorType; var assignedType = hasDefaultValue(element) ? getTypeWithFacts(elementType_2, 524288 /* NEUndefined */) : elementType_2; var type = getFlowTypeOfDestructuring(element, assignedType); return checkDestructuringAssignment(element, type, checkMode); @@ -70846,7 +68942,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 216 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 213 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -70862,7 +68958,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 289 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 286 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -70878,24 +68974,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 213 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 200 /* ObjectLiteralExpression */) { + if (target.kind === 197 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 199 /* ArrayLiteralExpression */) { + if (target.kind === 196 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 290 /* SpreadAssignment */ ? + var error = target.parent.kind === 287 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 290 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 287 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -70920,36 +69016,36 @@ var ts; case 78 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 205 /* TaggedTemplateExpression */: - case 218 /* TemplateExpression */: + case 202 /* TaggedTemplateExpression */: + case 215 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: case 103 /* NullKeyword */: - case 150 /* UndefinedKeyword */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: - case 209 /* ArrowFunction */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 211 /* TypeOfExpression */: - case 225 /* NonNullExpression */: - case 274 /* JsxSelfClosingElement */: - case 273 /* JsxElement */: + case 149 /* UndefinedKeyword */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 208 /* TypeOfExpression */: + case 222 /* NonNullExpression */: + case 271 /* JsxSelfClosingElement */: + case 270 /* JsxElement */: return true; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -70961,9 +69057,9 @@ var ts; } return false; // Some forms listed here for clarity - case 212 /* VoidExpression */: // Explicit opt-out - case 206 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 224 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 209 /* VoidExpression */: // Explicit opt-out + case 203 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 221 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -70995,7 +69091,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 200 /* ObjectLiteralExpression */ || node.left.kind === 199 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 197 /* ObjectLiteralExpression */ || node.left.kind === 196 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 107 /* ThisKeyword */)); break; } @@ -71062,7 +69158,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 200 /* ObjectLiteralExpression */ || left.kind === 199 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 197 /* ObjectLiteralExpression */ || left.kind === 196 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 107 /* ThisKeyword */); } var leftType; @@ -71155,7 +69251,7 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeAssignableToKind(leftType, 402653316 /* StringLike */) && !isTypeAssignableToKind(rightType, 402653316 /* StringLike */)) { + if (!isTypeAssignableToKind(leftType, 132 /* StringLike */) && !isTypeAssignableToKind(rightType, 132 /* StringLike */)) { leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); } @@ -71169,7 +69265,7 @@ var ts; // If both operands are of the BigInt primitive type, the result is of the BigInt primitive type. resultType = bigintType; } - else if (isTypeAssignableToKind(leftType, 402653316 /* StringLike */, /*strict*/ true) || isTypeAssignableToKind(rightType, 402653316 /* StringLike */, /*strict*/ true)) { + else if (isTypeAssignableToKind(leftType, 132 /* StringLike */, /*strict*/ true) || isTypeAssignableToKind(rightType, 132 /* StringLike */, /*strict*/ true)) { // If one or both operands are of the String primitive type, the result is of the String primitive type. resultType = stringType; } @@ -71187,7 +69283,7 @@ var ts; // If both types have an awaited type of one of these, we'll assume the user // might be missing an await without doing an exhaustive check that inserting // await(s) will actually be a completely valid binary expression. - var closeEnoughKind_1 = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 3 /* AnyOrUnknown */; + var closeEnoughKind_1 = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 3 /* AnyOrUnknown */; reportOperatorError(function (left, right) { return isTypeAssignableToKind(left, closeEnoughKind_1) && isTypeAssignableToKind(right, closeEnoughKind_1); @@ -71488,21 +69584,20 @@ var ts; return getUnionType([type1, type2], 2 /* Subtype */); } function checkTemplateExpression(node) { - var texts = [node.head.text]; - var types = []; - for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) { - var span = _a[_i]; - var type = checkExpression(span.expression); - if (maybeTypeOfKind(type, 12288 /* ESSymbolLike */)) { - error(span.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); + // We just want to check each expressions, but we are unconcerned with + // the type of each expression, as any value may be coerced into a string. + // It is worth asking whether this is what we really want though. + // A place where we actually *are* concerned with the expressions' types are + // in tagged templates. + ts.forEach(node.templateSpans, function (templateSpan) { + if (maybeTypeOfKind(checkExpression(templateSpan.expression), 12288 /* ESSymbolLike */)) { + error(templateSpan.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); } - texts.push(span.literal.text); - types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType); - } - return isConstContext(node) ? getTemplateLiteralType(texts, types) : stringType; + }); + return stringType; } function getContextNode(node) { - if (node.kind === 281 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 278 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -71551,13 +69646,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 206 /* TypeAssertionExpression */ || node.kind === 224 /* AsExpression */; + return node.kind === 203 /* TypeAssertionExpression */ || node.kind === 221 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 197 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 194 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -71567,7 +69662,7 @@ var ts; var elementFlags = type.target.elementFlags.slice(); for (var i = getTypeReferenceArity(type); i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 198 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 195 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); elementFlags.push(2 /* Optional */); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { @@ -71610,7 +69705,7 @@ var ts; } // If the contextual type is a literal of a particular primitive type, we consider this a // literal context for all literals of that primitive type. - return !!(contextualType.flags & (128 /* StringLiteral */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || + return !!(contextualType.flags & (128 /* StringLiteral */ | 4194304 /* Index */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || contextualType.flags & 256 /* NumberLiteral */ && maybeTypeOfKind(candidateType, 256 /* NumberLiteral */) || contextualType.flags & 2048 /* BigIntLiteral */ && maybeTypeOfKind(candidateType, 2048 /* BigIntLiteral */) || contextualType.flags & 512 /* BooleanLiteral */ && maybeTypeOfKind(candidateType, 512 /* BooleanLiteral */) || @@ -71622,7 +69717,7 @@ var ts; var parent = node.parent; return ts.isAssertionExpression(parent) && ts.isConstTypeReference(parent.type) || (ts.isParenthesizedExpression(parent) || ts.isArrayLiteralExpression(parent) || ts.isSpreadElement(parent)) && isConstContext(parent) || - (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent) || ts.isTemplateSpan(parent)) && isConstContext(parent.parent); + (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent)) && isConstContext(parent.parent); } function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) { var type = checkExpression(node, checkMode, forceTuple); @@ -71634,7 +69729,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -71645,7 +69740,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -71863,7 +69958,6 @@ var ts; } } function checkExpression(node, checkMode, forceTuple) { - ts.tracing.push("check" /* Check */, "checkExpression", { kind: node.kind, pos: node.pos, end: node.end }); var saveCurrentNode = currentNode; currentNode = node; instantiationCount = 0; @@ -71873,7 +69967,6 @@ var ts; checkConstEnumAccess(node, type); } currentNode = saveCurrentNode; - ts.tracing.pop(); return type; } function checkConstEnumAccess(node, type) { @@ -71881,11 +69974,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 202 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 176 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 270 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 199 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 78 /* Identifier */ || node.kind === 156 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 175 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 267 /* ExportSpecifier */); // We allow reexporting const enums if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -71910,9 +70003,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -71938,78 +70031,78 @@ var ts; return trueType; case 94 /* FalseKeyword */: return falseType; - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return checkQualifiedName(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (node.expression.kind === 99 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 204 /* NewExpression */: + case 201 /* NewExpression */: return checkCallExpression(node, checkMode); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return checkClassExpression(node); - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return checkAssertion(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return checkNonNullAssertion(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return checkMetaProperty(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return checkDeleteExpression(node); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return checkVoidExpression(node); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return checkAwaitExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 222 /* OmittedExpression */: + case 219 /* OmittedExpression */: return undefinedWideningType; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return checkYieldExpression(node); - case 227 /* SyntheticExpression */: + case 224 /* SyntheticExpression */: return checkSyntheticExpression(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return checkJsxElement(node, checkMode); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return checkJsxFragment(node); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -72046,10 +70139,10 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 166 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 165 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 166 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 165 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -72060,13 +70153,13 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 166 /* Constructor */ || func.kind === 170 /* ConstructSignature */ || func.kind === 175 /* ConstructorType */) { + if (func.kind === 165 /* Constructor */ || func.kind === 169 /* ConstructSignature */ || func.kind === 174 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 209 /* ArrowFunction */) { + if (func.kind === 206 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 167 /* GetAccessor */ || func.kind === 168 /* SetAccessor */) { + if (func.kind === 166 /* GetAccessor */ || func.kind === 167 /* SetAccessor */) { error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -72124,13 +70217,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 209 /* ArrowFunction */: - case 169 /* CallSignature */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 174 /* FunctionType */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 206 /* ArrowFunction */: + case 168 /* CallSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 173 /* FunctionType */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -72148,7 +70241,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 197 /* ArrayBindingPattern */ || name.kind === 196 /* ObjectBindingPattern */) { + else if (name.kind === 194 /* ArrayBindingPattern */ || name.kind === 193 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -72157,13 +70250,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 171 /* IndexSignature */) { + if (node.kind === 170 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 174 /* FunctionType */ || node.kind === 251 /* FunctionDeclaration */ || node.kind === 175 /* ConstructorType */ || - node.kind === 169 /* CallSignature */ || node.kind === 166 /* Constructor */ || - node.kind === 170 /* ConstructSignature */) { + else if (node.kind === 173 /* FunctionType */ || node.kind === 248 /* FunctionDeclaration */ || node.kind === 174 /* ConstructorType */ || + node.kind === 168 /* CallSignature */ || node.kind === 165 /* Constructor */ || + node.kind === 169 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -72193,10 +70286,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -72226,7 +70319,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 171 /* IndexSignature */ && node.kind !== 308 /* JSDocFunctionType */) { + if (node.kind !== 170 /* IndexSignature */ && node.kind !== 304 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -72238,7 +70331,7 @@ var ts; var privateIdentifiers = new ts.Map(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 166 /* Constructor */) { + if (member.kind === 165 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -72258,16 +70351,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -72330,7 +70423,7 @@ var ts; var names = new ts.Map(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 162 /* PropertySignature */) { + if (member.kind === 161 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -72355,7 +70448,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 253 /* InterfaceDeclaration */) { + if (node.kind === 250 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -72375,7 +70468,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -72383,7 +70476,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -72425,7 +70518,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 165 /* MethodDeclaration */ && node.body) { + if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 164 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -72453,7 +70546,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 163 /* PropertyDeclaration */ && + return n.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(n, 32 /* Static */) && !!n.initializer; } @@ -72484,7 +70577,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_4 = statements; _i < statements_4.length; _i++) { var statement = statements_4[_i]; - if (statement.kind === 233 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 230 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -72509,7 +70602,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -72519,7 +70612,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -72528,7 +70621,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + var otherKind = node.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getEffectiveModifierFlags(node); @@ -72546,7 +70639,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -72594,7 +70687,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 173 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 172 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -72643,27 +70736,28 @@ var ts; function checkTupleType(node) { var elementTypes = node.elements; var seenOptionalElement = false; - var seenRestElement = false; - var hasNamedElement = ts.some(elementTypes, ts.isNamedTupleMember); + var seenNamedElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind !== 192 /* NamedTupleMember */ && hasNamedElement) { + if (e.kind === 191 /* NamedTupleMember */) { + seenNamedElement = true; + } + else if (seenNamedElement) { grammarErrorOnNode(e, ts.Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names); break; } var flags = getTupleElementFlags(e); if (flags & 8 /* Variadic */) { - var type = getTypeFromTypeNode(e.type); - if (!isArrayLikeType(type)) { + if (!isArrayLikeType(getTypeFromTypeNode(e.type))) { error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); break; } - if (isArrayType(type) || isTupleType(type) && type.target.combinedFlags & 4 /* Rest */) { - seenRestElement = true; - } } else if (flags & 4 /* Rest */) { - seenRestElement = true; + if (i !== elementTypes.length - 1) { + grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); + break; + } } else if (flags & 2 /* Optional */) { seenOptionalElement = true; @@ -72672,17 +70766,11 @@ var ts; grammarErrorOnNode(e, ts.Diagnostics.A_required_element_cannot_follow_an_optional_element); break; } - if (seenRestElement && i !== elementTypes.length - 1) { - grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); - break; - } } ts.forEach(node.elements, checkSourceElement); - getTypeFromTypeNode(node); } function checkUnionOrIntersectionType(node) { ts.forEach(node.types, checkSourceElement); - getTypeFromTypeNode(node); } function checkIndexedAccessIndexType(type, accessNode) { if (!(type.flags & 8388608 /* IndexedAccess */)) { @@ -72692,7 +70780,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 202 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 199 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -72724,20 +70812,13 @@ var ts; } function checkMappedType(node) { checkSourceElement(node.typeParameter); - checkSourceElement(node.nameType); checkSourceElement(node.type); if (!node.type) { reportImplicitAny(node, anyType); } var type = getTypeFromMappedTypeNode(node); - var nameType = getNameTypeFromMappedType(type); - if (nameType) { - checkTypeAssignableTo(nameType, keyofConstraintType, node.nameType); - } - else { - var constraintType = getConstraintTypeFromMappedType(type); - checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter)); - } + var constraintType = getConstraintTypeFromMappedType(type); + checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter)); } function checkThisType(node) { getTypeFromThisTypeNode(node); @@ -72750,21 +70831,12 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 184 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 183 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); registerForUnusedIdentifiersCheck(node); } - function checkTemplateLiteralType(node) { - for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) { - var span = _a[_i]; - checkSourceElement(span.type); - var type = getTypeFromTypeNode(span.type); - checkTypeAssignableTo(type, templateConstraintType, span.type); - } - getTypeFromTypeNode(node); - } function checkImportType(node) { checkSourceElement(node.argument); getTypeFromTypeNode(node); @@ -72773,10 +70845,10 @@ var ts; if (node.dotDotDotToken && node.questionToken) { grammarErrorOnNode(node, ts.Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest); } - if (node.type.kind === 180 /* OptionalType */) { + if (node.type.kind === 179 /* OptionalType */) { grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type); } - if (node.type.kind === 181 /* RestType */) { + if (node.type.kind === 180 /* RestType */) { grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type); } checkSourceElement(node.type); @@ -72789,9 +70861,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 253 /* InterfaceDeclaration */ && - n.parent.kind !== 252 /* ClassDeclaration */ && - n.parent.kind !== 221 /* ClassExpression */ && + if (n.parent.kind !== 250 /* InterfaceDeclaration */ && + n.parent.kind !== 249 /* ClassDeclaration */ && + n.parent.kind !== 218 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -72887,7 +70959,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */) && + var reportError = (node.kind === 164 /* MethodDeclaration */ || node.kind === 163 /* MethodSignature */) && ts.hasSyntacticModifier(node, 32 /* Static */) !== ts.hasSyntacticModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -72928,7 +71000,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent && (node.parent.kind === 253 /* InterfaceDeclaration */ || node.parent.kind === 177 /* TypeLiteral */) || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 250 /* InterfaceDeclaration */ || node.parent.kind === 176 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -72939,10 +71011,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 251 /* FunctionDeclaration */ || node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */ || node.kind === 166 /* Constructor */) { + if (node.kind === 248 /* FunctionDeclaration */ || node.kind === 164 /* MethodDeclaration */ || node.kind === 163 /* MethodSignature */ || node.kind === 165 /* Constructor */) { functionDeclarations.push(node); var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; @@ -73075,25 +71147,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return 2 /* ExportType */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -73101,17 +71173,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 262 /* ImportClause */: - var result_12 = 0 /* None */; + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 259 /* ImportClause */: + var result_11 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result_12 |= getDeclarationSpaces(d); }); - return result_12; - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: - case 251 /* FunctionDeclaration */: - case 265 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + ts.forEach(target.declarations, function (d) { result_11 |= getDeclarationSpaces(d); }); + return result_11; + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 248 /* FunctionDeclaration */: + case 262 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 78 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -73404,24 +71476,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 160 /* Parameter */: + case 159 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -73468,30 +71540,30 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 183 /* IntersectionType */: - case 182 /* UnionType */: + case 182 /* IntersectionType */: + case 181 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: return getEntityNameForDecoratorMetadata(node.type); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; } } } function getEntityNameForDecoratorMetadataFromTypeList(types) { var commonEntityName; - for (var _i = 0, types_21 = types; _i < types_21.length; _i++) { - var typeNode = types_21[_i]; - while (typeNode.kind === 186 /* ParenthesizedType */ || typeNode.kind === 192 /* NamedTupleMember */) { + for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { + var typeNode = types_20[_i]; + while (typeNode.kind === 185 /* ParenthesizedType */ || typeNode.kind === 191 /* NamedTupleMember */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 141 /* NeverKeyword */) { + if (typeNode.kind === 140 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 190 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 149 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -73537,14 +71609,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 160 /* Parameter */) { + if (node.kind === 159 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -73553,23 +71625,23 @@ var ts; } } break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + var otherKind = node.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 160 /* Parameter */: + case 159 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -73632,7 +71704,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 157 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 156 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -73676,7 +71748,7 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -73689,7 +71761,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 157 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -73711,11 +71783,14 @@ var ts; checkFunctionOrConstructorSymbol(localSymbol); } if (symbol.parent) { - // run check on export symbol to check that modifiers agree across all exported declarations - checkFunctionOrConstructorSymbol(symbol); + // run check once for the first declaration + if (ts.getDeclarationOfKind(symbol, node.kind) === node) { + // run check on export symbol to check that modifiers agree across all exported declarations + checkFunctionOrConstructorSymbol(symbol); + } } } - var body = node.kind === 164 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 163 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -73757,42 +71832,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 297 /* SourceFile */: - case 256 /* ModuleDeclaration */: - case 230 /* Block */: - case 258 /* CaseBlock */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 294 /* SourceFile */: + case 253 /* ModuleDeclaration */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 166 /* Constructor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 165 /* Constructor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 185 /* InferType */: + case 184 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -73812,11 +71887,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 165 /* MethodDeclaration */: - case 163 /* PropertyDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - if (member.kind === 168 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 164 /* MethodDeclaration */: + case 162 /* PropertyDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + if (member.kind === 167 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -73827,7 +71902,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 166 /* Constructor */: + case 165 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasSyntacticModifier(parameter, 8 /* Private */)) { @@ -73835,8 +71910,8 @@ var ts; } } break; - case 171 /* IndexSignature */: - case 229 /* SemicolonClassElement */: + case 170 /* IndexSignature */: + case 226 /* SemicolonClassElement */: // Can't be private break; default: @@ -73863,7 +71938,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 185 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 184 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (ts.tryAddToSet(seenParentsWithEveryUnused, parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -73955,7 +72030,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 263 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 260 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -73973,7 +72048,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 249 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 250 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 246 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 247 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -73994,7 +72069,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 232 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 229 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -74008,22 +72083,22 @@ var ts; switch (name.kind) { case 78 /* Identifier */: return ts.idText(name); - case 197 /* ArrayBindingPattern */: - case 196 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 262 /* ImportClause */ || node.kind === 265 /* ImportSpecifier */ || node.kind === 263 /* NamespaceImport */; + return node.kind === 259 /* ImportClause */ || node.kind === 262 /* ImportSpecifier */ || node.kind === 260 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 262 /* ImportClause */ ? decl : decl.kind === 263 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 259 /* ImportClause */ ? decl : decl.kind === 260 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 230 /* Block */) { + if (node.kind === 227 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -74053,12 +72128,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 163 /* PropertyDeclaration */ || - node.kind === 162 /* PropertySignature */ || - node.kind === 165 /* MethodDeclaration */ || - node.kind === 164 /* MethodSignature */ || - node.kind === 167 /* GetAccessor */ || - node.kind === 168 /* SetAccessor */) { + if (node.kind === 162 /* PropertyDeclaration */ || + node.kind === 161 /* PropertySignature */ || + node.kind === 164 /* MethodDeclaration */ || + node.kind === 163 /* MethodSignature */ || + node.kind === 166 /* GetAccessor */ || + node.kind === 167 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -74067,7 +72142,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 160 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 159 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -74124,7 +72199,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -74139,7 +72214,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -74174,7 +72249,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 249 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 246 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -74186,17 +72261,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 250 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 232 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 247 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 229 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 230 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 257 /* ModuleBlock */ || - container.kind === 256 /* ModuleDeclaration */ || - container.kind === 297 /* SourceFile */); + (container.kind === 227 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 254 /* ModuleBlock */ || + container.kind === 253 /* ModuleDeclaration */ || + container.kind === 294 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -74227,18 +72302,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 198 /* BindingElement */) { - if (node.parent.kind === 196 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 195 /* BindingElement */) { + if (node.parent.kind === 193 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 158 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -74259,19 +72334,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 197 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 194 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.isParameterDeclaration(node) && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 159 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 238 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 235 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -74297,12 +72372,7 @@ var ts; } return; } - // For a commonjs `const x = require`, validate the alias and exit var symbol = getSymbolOfNode(node); - if (symbol.flags & 2097152 /* Alias */ && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true)) { - checkAliasSymbol(node); - return; - } var type = convertAutoToAny(getTypeOfSymbol(symbol)); if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer @@ -74313,7 +72383,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && !!((_a = symbol.exports) === null || _a === void 0 ? void 0 : _a.size); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 238 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 235 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -74339,10 +72409,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */) { + if (node.kind !== 162 /* PropertyDeclaration */ && node.kind !== 161 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -74354,7 +72424,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 163 /* PropertyDeclaration */ || nextDeclaration.kind === 162 /* PropertySignature */ + var message = nextDeclaration.kind === 162 /* PropertyDeclaration */ || nextDeclaration.kind === 161 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -74364,8 +72434,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 160 /* Parameter */ && right.kind === 249 /* VariableDeclaration */) || - (left.kind === 249 /* VariableDeclaration */ && right.kind === 160 /* Parameter */)) { + if ((left.kind === 159 /* Parameter */ && right.kind === 246 /* VariableDeclaration */) || + (left.kind === 246 /* VariableDeclaration */ && right.kind === 159 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -74381,10 +72451,8 @@ var ts; return ts.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts.getSelectedEffectiveModifierFlags(right, interestingFlags); } function checkVariableDeclaration(node) { - ts.tracing.push("check" /* Check */, "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end }); checkGrammarVariableDeclaration(node); - checkVariableLikeDeclaration(node); - ts.tracing.pop(); + return checkVariableLikeDeclaration(node); } function checkBindingElement(node) { checkGrammarBindingElement(node); @@ -74407,7 +72475,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 231 /* EmptyStatement */) { + if (node.thenStatement.kind === 228 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -74500,12 +72568,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 247 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -74539,14 +72607,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node); // There may be a destructuring assignment on the left side - if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) { + if (varExpr.kind === 196 /* ArrayLiteralExpression */ || varExpr.kind === 197 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -74578,7 +72646,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -74592,7 +72660,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) { + if (varExpr.kind === 196 /* ArrayLiteralExpression */ || varExpr.kind === 197 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -74644,7 +72712,6 @@ var ts; } var uplevelIteration = languageVersion >= 2 /* ES2015 */; var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; - var possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & 128 /* PossiblyOutOfBounds */); // Get the iterated type of an `Iterable` or `IterableIterator` only in ES2015 // or higher, when inside of an async generator or for-await-if, or when // downlevelIteration is requested. @@ -74664,7 +72731,7 @@ var ts; } } if (iterationTypes || uplevelIteration) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType) : (iterationTypes && iterationTypes.yieldType); + return iterationTypes && iterationTypes.yieldType; } } var arrayType = inputType; @@ -74678,12 +72745,12 @@ var ts; // After we remove all types that are StringLike, we will know if there was a string constituent // based on whether the result of filter is a new array. var arrayTypes = inputType.types; - var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 402653316 /* StringLike */); }); + var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 132 /* StringLike */); }); if (filteredTypes !== arrayTypes) { arrayType = getUnionType(filteredTypes, 2 /* Subtype */); } } - else if (arrayType.flags & 402653316 /* StringLike */) { + else if (arrayType.flags & 132 /* StringLike */) { arrayType = neverType; } hasStringConstituent = arrayType !== inputType; @@ -74697,7 +72764,7 @@ var ts; // Now that we've removed all the StringLike types, if no constituents remain, then the entire // arrayOrStringType was a string. if (arrayType.flags & 131072 /* Never */) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType; + return stringType; } } } @@ -74722,17 +72789,17 @@ var ts; : [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true], defaultDiagnostic = _a[0], maybeMissingAwait = _a[1]; errorAndMaybeSuggestAwait(errorNode, maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType), defaultDiagnostic, typeToString(arrayType)); } - return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType : undefined; + return hasStringConstituent ? stringType : undefined; } var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */); if (hasStringConstituent && arrayElementType) { // This is just an optimization for the case where arrayOrStringType is string | string[] - if (arrayElementType.flags & 402653316 /* StringLike */ && !compilerOptions.noUncheckedIndexedAccess) { + if (arrayElementType.flags & 132 /* StringLike */) { return stringType; } - return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2 /* Subtype */); + return getUnionType([arrayElementType, stringType], 2 /* Subtype */); } - return (use & 128 /* PossiblyOutOfBounds */) ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType; + return arrayElementType; } /** * Gets the requested "iteration type" from an `Iterable`-like or `AsyncIterable`-like type. @@ -74848,9 +72915,8 @@ var ts; if (iterationTypes_2 === noIterationTypes) { if (errorNode) { reportTypeNotIterableError(errorNode, type, !!(use & 2 /* AllowsAsyncIterablesFlag */)); + errorNode = undefined; } - setCachedIterationTypes(type, cacheKey, noIterationTypes); - return undefined; } else { allIterationTypes = ts.append(allIterationTypes, iterationTypes_2); @@ -75128,7 +73194,6 @@ var ts; * record is returned. Otherwise, we return `undefined`. */ function getIterationTypesOfMethod(type, resolver, methodName, errorNode) { - var _a, _b, _c, _d; var method = getPropertyOfType(type, methodName); // Ignore 'return' or 'throw' if they are missing. if (!method && methodName !== "next") { @@ -75152,24 +73217,6 @@ var ts; } return methodName === "next" ? anyIterationTypes : undefined; } - // If the method signature comes exclusively from the global iterator or generator type, - // create iteration types from its type arguments like `getIterationTypesOfIteratorFast` - // does (so as to remove `undefined` from the next and return types). We arrive here when - // a contextual type for a generator was not a direct reference to one of those global types, - // but looking up `methodType` referred to one of them (and nothing else). E.g., in - // `interface SpecialIterator extends Iterator {}`, `SpecialIterator` is not a - // reference to `Iterator`, but its `next` member derives exclusively from `Iterator`. - if ((methodType === null || methodType === void 0 ? void 0 : methodType.symbol) && methodSignatures.length === 1) { - var globalGeneratorType = resolver.getGlobalGeneratorType(/*reportErrors*/ false); - var globalIteratorType = resolver.getGlobalIteratorType(/*reportErrors*/ false); - var isGeneratorMethod = ((_b = (_a = globalGeneratorType.symbol) === null || _a === void 0 ? void 0 : _a.members) === null || _b === void 0 ? void 0 : _b.get(methodName)) === methodType.symbol; - var isIteratorMethod = !isGeneratorMethod && ((_d = (_c = globalIteratorType.symbol) === null || _c === void 0 ? void 0 : _c.members) === null || _d === void 0 ? void 0 : _d.get(methodName)) === methodType.symbol; - if (isGeneratorMethod || isIteratorMethod) { - var globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType; - var mapper = methodType.mapper; - return createIterationTypes(getMappedType(globalType.typeParameters[0], mapper), getMappedType(globalType.typeParameters[1], mapper), methodName === "next" ? getMappedType(globalType.typeParameters[2], mapper) : undefined); - } - } // Extract the first parameter and return type of each signature. var methodParameterTypes; var methodReturnTypes; @@ -75287,12 +73334,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 168 /* SetAccessor */) { + if (func.kind === 167 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 166 /* Constructor */) { + else if (func.kind === 165 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -75310,7 +73357,7 @@ var ts; } } } - else if (func.kind !== 166 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 165 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -75339,7 +73386,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 285 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 282 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -75348,7 +73395,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 284 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 281 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -75380,7 +73427,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 245 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 242 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -75409,15 +73456,11 @@ var ts; if (catchClause) { // Grammar checking if (catchClause.variableDeclaration) { - var declaration = catchClause.variableDeclaration; - if (declaration.type) { - var type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ false); - if (type && !(type.flags & 3 /* AnyOrUnknown */)) { - grammarErrorOnFirstToken(declaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); - } + if (catchClause.variableDeclaration.type && getTypeOfNode(catchClause.variableDeclaration) === errorType) { + grammarErrorOnFirstToken(catchClause.variableDeclaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); } - else if (declaration.initializer) { - grammarErrorOnFirstToken(declaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); + else if (catchClause.variableDeclaration.initializer) { + grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); } else { var blockLocals_1 = catchClause.block.locals; @@ -75494,8 +73537,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 216 /* BinaryExpression */ || - name.kind === 158 /* ComputedPropertyName */ || + (propDeclaration.kind === 213 /* BinaryExpression */ || + name.kind === 157 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -75572,7 +73615,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 173 /* TypeReference */) { + if (node.kind === 172 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -75683,7 +73726,6 @@ var ts; var typeWithThis = getTypeWithThisArgument(type); var staticType = getTypeOfSymbol(symbol); checkTypeParameterListsIdentical(symbol); - checkFunctionOrConstructorSymbol(symbol); checkClassForDuplicateDeclarations(node); // Only check for reserved static identifiers on non-ambient context. if (!(node.flags & 8388608 /* Ambient */)) { @@ -75774,7 +73816,7 @@ var ts; function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible var issuedMemberError = false; - var _loop_23 = function (member) { + var _loop_22 = function (member) { if (ts.hasStaticModifier(member)) { return "continue"; } @@ -75793,7 +73835,7 @@ var ts; }; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - _loop_23(member); + _loop_22(member); } if (!issuedMemberError) { // check again with diagnostics to generate a less-specific error @@ -75819,7 +73861,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 252 /* ClassDeclaration */ || d.kind === 253 /* InterfaceDeclaration */; + return d.kind === 249 /* ClassDeclaration */ || d.kind === 250 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -75874,7 +73916,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 221 /* ClassExpression */) { + if (derivedClassDecl.kind === 218 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -75895,7 +73937,7 @@ var ts; if (basePropertyFlags && derivedPropertyFlags) { // property/accessor is overridden with property/accessor if (baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 253 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 250 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -75910,7 +73952,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else if (compilerOptions.useDefineForClassFields) { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 163 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 162 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -76026,7 +74068,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 163 /* PropertyDeclaration */ && + return node.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -76050,7 +74092,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 250 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -76083,15 +74125,8 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); checkExportsOnMergedDeclarations(node); checkTypeParameters(node.typeParameters); - if (node.type.kind === 136 /* IntrinsicKeyword */) { - if (!intrinsicTypeKinds.has(node.name.escapedText) || ts.length(node.typeParameters) !== 1) { - error(node.type, ts.Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types); - } - } - else { - checkSourceElement(node.type); - registerForUnusedIdentifiersCheck(node); - } + checkSourceElement(node.type); + registerForUnusedIdentifiersCheck(node); } function computeEnumMemberValues(node) { var nodeLinks = getNodeLinks(node); @@ -76169,7 +74204,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -76179,7 +74214,7 @@ var ts; } } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -76208,7 +74243,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return evaluate(expr.expression); case 78 /* Identifier */: var identifier = expr; @@ -76216,14 +74251,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 201 /* PropertyAccessExpression */) { + if (ex.kind === 198 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -76256,8 +74291,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 78 /* Identifier */ || - node.kind === 201 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 202 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 198 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 199 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -76293,7 +74328,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 255 /* EnumDeclaration */) { + if (declaration.kind !== 252 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -76321,8 +74356,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 252 /* ClassDeclaration */ || - (declaration.kind === 251 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 249 /* ClassDeclaration */ || + (declaration.kind === 248 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -76385,7 +74420,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 252 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 249 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -76435,23 +74470,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 198 /* BindingElement */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 246 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -76462,12 +74497,12 @@ var ts; break; } // falls through - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 251 /* FunctionDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 248 /* FunctionDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -76490,12 +74525,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.left; } while (node.kind !== 78 /* Identifier */); return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -76515,9 +74550,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 267 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 254 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 294 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 264 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -76551,14 +74586,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 270 /* ExportSpecifier */ ? + var message = node.kind === 267 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 270 /* ExportSpecifier */ + && node.kind === 267 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -76573,7 +74608,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); checkAliasSymbol(node); - if (node.kind === 265 /* ImportSpecifier */ && + if (node.kind === 262 /* ImportSpecifier */ && ts.idText(node.propertyName || node.name) === "default" && compilerOptions.esModuleInterop && moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015) { @@ -76595,7 +74630,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 260 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); if (moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015 && compilerOptions.esModuleInterop) { // import * as ns from "foo"; @@ -76623,7 +74658,7 @@ var ts; if (ts.hasSyntacticModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 272 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 269 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -76663,10 +74698,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 257 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 254 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 254 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 294 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -76699,14 +74734,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 268 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 265 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 297 /* SourceFile */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 256 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 294 /* SourceFile */ || node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 253 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -76770,8 +74805,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 294 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 253 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -76796,9 +74831,6 @@ var ts; checkExpressionCached(node.expression); } } - else { - checkExpressionCached(node.expression); // doesn't resolve, check as expression to mark as error - } if (ts.getEmitDeclarations(compilerOptions)) { collectLinkedAliases(node.expression, /*setVisibility*/ true); } @@ -76888,171 +74920,169 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 232 /* FirstStatement */ && kind <= 248 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 229 /* FirstStatement */ && kind <= 245 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return checkTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return checkParameter(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return checkPropertySignature(node); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return checkSignatureDeclaration(node); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: return checkMethodDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return checkConstructorDeclaration(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return checkAccessorDeclaration(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return checkTypeReferenceNode(node); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return checkTypePredicate(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return checkTypeQuery(node); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return checkTypeLiteral(node); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return checkArrayType(node); - case 179 /* TupleType */: + case 178 /* TupleType */: return checkTupleType(node); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 186 /* ParenthesizedType */: - case 180 /* OptionalType */: - case 181 /* RestType */: + case 185 /* ParenthesizedType */: + case 179 /* OptionalType */: + case 180 /* RestType */: return checkSourceElement(node.type); - case 187 /* ThisType */: + case 186 /* ThisType */: return checkThisType(node); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return checkTypeOperator(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return checkConditionalType(node); - case 185 /* InferType */: + case 184 /* InferType */: return checkInferType(node); - case 193 /* TemplateLiteralType */: - return checkTemplateLiteralType(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return checkImportType(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return checkNamedTupleMember(node); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 329 /* JSDocTypeTag */: + case 325 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 333 /* JSDocPropertyTag */: + case 328 /* JSDocPropertyTag */: return checkJSDocPropertyTag(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 306 /* JSDocNonNullableType */: - case 305 /* JSDocNullableType */: - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: - case 312 /* JSDocTypeLiteral */: + case 302 /* JSDocNonNullableType */: + case 301 /* JSDocNullableType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: + case 308 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 301 /* JSDocTypeExpression */: + case 298 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return checkMappedType(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return checkBlock(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return checkVariableStatement(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return checkExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return checkIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return checkDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return checkWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return checkForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return checkForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return checkForOfStatement(node); - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return checkReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return checkWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return checkSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return checkLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return checkThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return checkTryStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return checkBindingElement(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return checkClassDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return checkImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return checkExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return checkExportAssignment(node); - case 231 /* EmptyStatement */: - case 248 /* DebuggerStatement */: + case 228 /* EmptyStatement */: + case 245 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -77147,46 +75177,43 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 161 /* Decorator */: - case 275 /* JsxOpeningElement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 160 /* Decorator */: + case 272 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 273 /* JsxElement */: + case 270 /* JsxElement */: checkJsxElementDeferred(node); break; } currentNode = saveCurrentNode; } function checkSourceFile(node) { - var tracingData = ["check" /* Check */, "checkSourceFile", { path: node.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeCheck"); checkSourceFileWorker(node); ts.performance.mark("afterCheck"); ts.performance.measure("Check", "beforeCheck", "afterCheck"); - ts.tracing.end.apply(ts.tracing, tracingData); } function unusedIsError(kind, isAmbient) { if (isAmbient) { @@ -77319,17 +75346,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -77337,8 +75364,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -77347,7 +75374,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -77395,19 +75422,19 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 159 /* TypeParameter */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 158 /* TypeParameter */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return true; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.isTypeOnly; - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -77415,25 +75442,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 157 /* QualifiedName */) { + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 173 /* TypeReference */; + return node.parent.kind === 172 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 201 /* PropertyAccessExpression */) { + while (node.parent.kind === 198 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 223 /* ExpressionWithTypeArguments */; - } - function isJSDocEntryNameReference(node) { - while (node.parent.kind === 157 /* QualifiedName */) { - node = node.parent; - } - while (node.parent.kind === 201 /* PropertyAccessExpression */) { - node = node.parent; - } - return node.parent.kind === 302 /* JSDocNameReference */; + return node.parent.kind === 220 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -77461,13 +75479,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 157 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 156 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 260 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 257 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 266 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 263 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -77493,7 +75511,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 195 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 192 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -77503,7 +75521,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 201 /* PropertyAccessExpression */ && + name.parent.kind === 198 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -77513,7 +75531,7 @@ var ts; } } } - if (name.parent.kind === 266 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 263 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -77523,7 +75541,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 260 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 257 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -77541,7 +75559,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 223 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 220 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -77557,10 +75575,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 326 /* JSDocParameterTag */) { + if (name.parent.kind === 322 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 159 /* TypeParameter */ && name.parent.parent.kind === 330 /* JSDocTemplateTag */) { + if (name.parent.kind === 158 /* TypeParameter */ && name.parent.parent.kind === 326 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -77577,12 +75595,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 201 /* PropertyAccessExpression */ || name.kind === 157 /* QualifiedName */) { + else if (name.kind === 198 /* PropertyAccessExpression */ || name.kind === 156 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 201 /* PropertyAccessExpression */) { + if (name.kind === 198 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -77592,21 +75610,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 173 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 172 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (isJSDocEntryNameReference(name)) { - var meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */; - return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true, ts.getHostSignatureFromJSDoc(name)); - } - if (name.parent.kind === 172 /* TypePredicate */) { + if (name.parent.kind === 171 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -77629,8 +75643,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 198 /* BindingElement */ && - grandParent.kind === 196 /* ObjectBindingPattern */ && + else if (parent.kind === 195 /* BindingElement */ && + grandParent.kind === 193 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -77642,8 +75656,8 @@ var ts; switch (node.kind) { case 78 /* Identifier */: case 79 /* PrivateIdentifier */: - case 201 /* PropertyAccessExpression */: - case 157 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 107 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -77657,14 +75671,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 187 /* ThisType */: + case 186 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 105 /* SuperKeyword */: return checkExpression(node).symbol; case 132 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 166 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 165 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -77675,7 +75689,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 261 /* ImportDeclaration */ || node.parent.kind === 267 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 258 /* ImportDeclaration */ || node.parent.kind === 264 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -77697,7 +75711,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 83 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 195 /* ImportType */: + case 192 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 92 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -77706,26 +75720,18 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 289 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 286 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; } /** Returns the target of an export specifier without following aliases */ function getExportSpecifierLocalTargetSymbol(node) { - if (ts.isExportSpecifier(node)) { - return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); - } - else { - return resolveEntityName(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); - } + return node.parent.parent.moduleSpecifier ? + getExternalModuleMember(node.parent.parent, node) : + resolveEntityName(node.propertyName || node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } function getTypeOfNode(node) { - if (ts.isSourceFile(node) && !ts.isExternalModule(node)) { - return errorType; - } if (node.flags & 16777216 /* InWithStatement */) { // We cannot answer semantic questions within a with block, do not proceed any further return errorType; @@ -77785,23 +75791,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 200 /* ObjectLiteralExpression */ || expr.kind === 199 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 197 /* ObjectLiteralExpression */ || expr.kind === 196 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 239 /* ForOfStatement */) { + if (expr.parent.kind === 236 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 216 /* BinaryExpression */) { + if (expr.parent.kind === 213 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 288 /* PropertyAssignment */) { + if (expr.parent.kind === 285 /* PropertyAssignment */) { var node_2 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_2) || errorType; var propertyIndex = ts.indexOfNode(node_2.properties, expr.parent); @@ -77849,7 +75855,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -77966,7 +75972,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 297 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 294 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -77981,9 +75987,6 @@ var ts; // When resolved as an expression identifier, if the given node references an import, return the declaration of // that import. Otherwise, return undefined. function getReferencedImportDeclaration(nodeIn) { - if (nodeIn.generatedImportReference) { - return nodeIn.generatedImportReference; - } var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { var symbol = getReferencedValueSymbol(node); @@ -77997,7 +76000,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 287 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 284 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -78028,7 +76031,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 230 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 227 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -78069,19 +76072,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return node.expression && node.expression.kind === 78 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -78090,7 +76093,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 297 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 294 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -78197,15 +76200,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 291 /* EnumMember */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 288 /* EnumMember */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 291 /* EnumMember */) { + if (node.kind === 288 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -78271,7 +76274,7 @@ var ts; else if (isTypeAssignableToKind(type, 2112 /* BigIntLike */)) { return ts.TypeReferenceSerializationKind.BigIntLikeType; } - else if (isTypeAssignableToKind(type, 402653316 /* StringLike */)) { + else if (isTypeAssignableToKind(type, 132 /* StringLike */)) { return ts.TypeReferenceSerializationKind.StringLikeType; } else if (isTupleType(type)) { @@ -78474,12 +76477,12 @@ var ts; getJsxFragmentFactoryEntity: getJsxFragmentFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 168 /* SetAccessor */ ? 167 /* GetAccessor */ : 168 /* SetAccessor */; + var otherKind = accessor.kind === 167 /* SetAccessor */ ? 166 /* GetAccessor */ : 167 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 168 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 167 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 167 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 166 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -78495,7 +76498,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 297 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 294 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -78530,7 +76533,7 @@ var ts; return false; } function isInHeritageClause(node) { - return node.parent && node.parent.kind === 223 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 286 /* HeritageClause */; + return node.parent && node.parent.kind === 220 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 283 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -78542,7 +76545,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 78 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 201 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 78 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 198 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -78593,7 +76596,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 297 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 294 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -78621,12 +76624,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 256 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 253 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 297 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 294 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -78820,14 +76823,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 165 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 164 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */) { + else if (node.kind === 166 /* GetAccessor */ || node.kind === 167 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -78844,17 +76847,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 142 /* ReadonlyKeyword */) { - if (node.kind === 162 /* PropertySignature */ || node.kind === 164 /* MethodSignature */) { + if (modifier.kind !== 141 /* ReadonlyKeyword */) { + if (node.kind === 161 /* PropertySignature */ || node.kind === 163 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 171 /* IndexSignature */) { + if (node.kind === 170 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 84 /* ConstKeyword */: - if (node.kind !== 255 /* EnumDeclaration */) { + if (node.kind !== 252 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(84 /* ConstKeyword */)); } break; @@ -78874,7 +76877,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + else if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -78900,10 +76903,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + else if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -78915,11 +76918,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */ && node.kind !== 171 /* IndexSignature */ && node.kind !== 160 /* Parameter */) { + else if (node.kind !== 162 /* PropertyDeclaration */ && node.kind !== 161 /* PropertySignature */ && node.kind !== 170 /* IndexSignature */ && node.kind !== 159 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -78940,16 +76943,16 @@ var ts; return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } else if (ts.isClassLike(node.parent)) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 87 /* DefaultKeyword */: - var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 294 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 253 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; @@ -78962,12 +76965,12 @@ var ts; return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 257 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 254 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -78980,14 +76983,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 252 /* ClassDeclaration */) { - if (node.kind !== 165 /* MethodDeclaration */ && - node.kind !== 163 /* PropertyDeclaration */ && - node.kind !== 167 /* GetAccessor */ && - node.kind !== 168 /* SetAccessor */) { + if (node.kind !== 249 /* ClassDeclaration */) { + if (node.kind !== 164 /* MethodDeclaration */ && + node.kind !== 162 /* PropertyDeclaration */ && + node.kind !== 166 /* GetAccessor */ && + node.kind !== 167 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 252 /* ClassDeclaration */ && ts.hasSyntacticModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 249 /* ClassDeclaration */ && ts.hasSyntacticModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -78996,9 +76999,6 @@ var ts; if (flags & 8 /* Private */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); } - if (flags & 256 /* Async */ && lastAsync) { - return grammarErrorOnNode(lastAsync, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } } if (ts.isNamedDeclaration(node) && node.name.kind === 79 /* PrivateIdentifier */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); @@ -79012,18 +77012,15 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } - if (flags & 128 /* Abstract */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } flags |= 256 /* Async */; lastAsync = modifier; break; } } - if (node.kind === 166 /* Constructor */) { + if (node.kind === 165 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -79038,13 +77035,13 @@ var ts; } return false; } - else if ((node.kind === 261 /* ImportDeclaration */ || node.kind === 260 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 258 /* ImportDeclaration */ || node.kind === 257 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 159 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 159 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -79065,37 +77062,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 256 /* ModuleDeclaration */: - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 160 /* Parameter */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 253 /* ModuleDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 159 /* Parameter */: return false; default: - if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return false; } switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 129 /* AsyncKeyword */); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 125 /* AbstractKeyword */); - case 253 /* InterfaceDeclaration */: - case 232 /* VariableStatement */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 229 /* VariableStatement */: + case 251 /* TypeAliasDeclaration */: return true; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 84 /* ConstKeyword */); default: ts.Debug.fail(); @@ -79108,10 +77105,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -79230,7 +77227,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 147 /* StringKeyword */ && parameter.type.kind !== 144 /* NumberKeyword */) { + if (parameter.type.kind !== 146 /* StringKeyword */ && parameter.type.kind !== 143 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -79272,7 +77269,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 222 /* OmittedExpression */) { + if (arg.kind === 219 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -79349,20 +77346,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 158 /* ComputedPropertyName */) { + if (node.kind !== 157 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 216 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 213 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 251 /* FunctionDeclaration */ || - node.kind === 208 /* FunctionExpression */ || - node.kind === 165 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 248 /* FunctionDeclaration */ || + node.kind === 205 /* FunctionExpression */ || + node.kind === 164 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -79381,7 +77378,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 290 /* SpreadAssignment */) { + if (prop.kind === 287 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -79392,11 +77389,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 158 /* ComputedPropertyName */) { + if (name.kind === 157 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 289 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 286 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern); @@ -79409,7 +77406,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 129 /* AsyncKeyword */ || prop.kind !== 165 /* MethodDeclaration */) { + if (mod.kind !== 129 /* AsyncKeyword */ || prop.kind !== 164 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -79424,10 +77421,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -79435,13 +77432,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -79480,7 +77477,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 282 /* JsxSpreadAttribute */) { + if (attr.kind === 279 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -79490,7 +77487,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 283 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 280 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -79504,14 +77501,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 239 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 236 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 166 /* Constructor */) { + if (func && func.kind !== 165 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -79522,7 +77519,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 250 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 247 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -79537,20 +77534,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -79575,11 +77572,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 167 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 166 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 168 /* SetAccessor */) { + if (accessor.kind === 167 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -79601,17 +77598,17 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 166 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 166 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 151 /* UniqueKeyword */) { - if (node.type.kind !== 148 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(148 /* SymbolKeyword */)); + if (node.operator === 150 /* UniqueKeyword */) { + if (node.type.kind !== 147 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(147 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) { @@ -79622,7 +77619,7 @@ var ts; } } switch (parent.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 78 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -79634,13 +77631,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: if (!ts.hasSyntacticModifier(parent, 32 /* Static */) || !ts.hasEffectiveModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: if (!ts.hasSyntacticModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -79649,9 +77646,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 142 /* ReadonlyKeyword */) { - if (node.type.kind !== 178 /* ArrayType */ && node.type.kind !== 179 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(148 /* SymbolKeyword */)); + else if (node.operator === 141 /* ReadonlyKeyword */) { + if (node.type.kind !== 177 /* ArrayType */ && node.type.kind !== 178 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(147 /* SymbolKeyword */)); } } } @@ -79664,8 +77661,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 165 /* MethodDeclaration */) { - if (node.parent.kind === 200 /* ObjectLiteralExpression */) { + if (node.kind === 164 /* MethodDeclaration */) { + if (node.parent.kind === 197 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 129 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -79693,14 +77690,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 165 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 164 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 253 /* InterfaceDeclaration */) { + else if (node.parent.kind === 250 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 177 /* TypeLiteral */) { + else if (node.parent.kind === 176 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -79711,11 +77708,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 240 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 237 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -79723,8 +77720,8 @@ var ts; return false; } break; - case 244 /* SwitchStatement */: - if (node.kind === 241 /* BreakStatement */ && !node.label) { + case 241 /* SwitchStatement */: + if (node.kind === 238 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -79739,13 +77736,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 241 /* BreakStatement */ + var message = node.kind === 238 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 241 /* BreakStatement */ + var message = node.kind === 238 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -79769,12 +77766,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 211 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 211 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -79805,7 +77802,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 238 /* ForInStatement */ && node.parent.parent.kind !== 239 /* ForOfStatement */) { + if (node.parent.parent.kind !== 235 /* ForInStatement */ && node.parent.parent.kind !== 236 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -79818,11 +77815,8 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 232 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { - var message = node.initializer - ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions - : ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations; - return grammarErrorOnNode(node.exclamationToken, message); + if (node.exclamationToken && (node.parent.parent.kind !== 229 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); if (moduleKind < ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.System && @@ -79884,15 +77878,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return false; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -79984,7 +77978,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 253 /* InterfaceDeclaration */) { + else if (node.parent.kind === 250 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -79992,7 +77986,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 177 /* TypeLiteral */) { + else if (node.parent.kind === 176 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -80005,12 +77999,7 @@ var ts; } if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || node.flags & 8388608 /* Ambient */ || ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */))) { - var message = node.initializer - ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions - : !node.type - ? ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations - : ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; - return grammarErrorOnNode(node.exclamationToken, message); + return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { @@ -80026,13 +78015,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 253 /* InterfaceDeclaration */ || - node.kind === 254 /* TypeAliasDeclaration */ || - node.kind === 261 /* ImportDeclaration */ || - node.kind === 260 /* ImportEqualsDeclaration */ || - node.kind === 267 /* ExportDeclaration */ || - node.kind === 266 /* ExportAssignment */ || - node.kind === 259 /* NamespaceExportDeclaration */ || + if (node.kind === 250 /* InterfaceDeclaration */ || + node.kind === 251 /* TypeAliasDeclaration */ || + node.kind === 258 /* ImportDeclaration */ || + node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 264 /* ExportDeclaration */ || + node.kind === 263 /* ExportAssignment */ || + node.kind === 256 /* NamespaceExportDeclaration */ || ts.hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -80041,7 +78030,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 232 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 229 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -80064,7 +78053,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 230 /* Block */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + if (node.parent.kind === 227 /* Block */ || node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -80086,10 +78075,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 191 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 190 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 291 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 288 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -80264,14 +78253,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 251 /* FunctionDeclaration */ && declaration.kind !== 165 /* MethodDeclaration */) || + return (declaration.kind !== 248 /* FunctionDeclaration */ && declaration.kind !== 164 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -80279,14 +78268,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 262 /* ImportClause */: // For default import - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: // For rename import `x as y` + case 259 /* ImportClause */: // For default import + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: // For rename import `x as y` return true; case 78 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 265 /* ImportSpecifier */; + return decl.parent.kind === 262 /* ImportSpecifier */; default: return false; } @@ -80518,7 +78507,7 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 156 /* LastToken */) || kind === 187 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 155 /* LastToken */) || kind === 186 /* ThisType */) { return node; } var factory = context.factory; @@ -80526,291 +78515,287 @@ var ts; // Names case 78 /* Identifier */: return factory.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return factory.updateQualifiedName(node, nodeVisitor(node.left, visitor, ts.isEntityName), nodeVisitor(node.right, visitor, ts.isIdentifier)); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return factory.updateComputedPropertyName(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Signature elements - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return factory.updateTypeParameterDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.constraint, visitor, ts.isTypeNode), nodeVisitor(node.default, visitor, ts.isTypeNode)); - case 160 /* Parameter */: + case 159 /* Parameter */: return factory.updateParameterDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 161 /* Decorator */: + case 160 /* Decorator */: return factory.updateDecorator(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Type elements - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return factory.updatePropertyDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too nodeVisitor(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 164 /* MethodSignature */: + case 163 /* MethodSignature */: return factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return factory.updateMethodDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 166 /* Constructor */: + case 165 /* Constructor */: return factory.updateConstructorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return factory.updateGetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return factory.updateSetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 169 /* CallSignature */: + case 168 /* CallSignature */: return factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return factory.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); // Types - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return factory.updateTypePredicateNode(node, nodeVisitor(node.assertsModifier, visitor), nodeVisitor(node.parameterName, visitor), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return factory.updateTypeReferenceNode(node, nodeVisitor(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 174 /* FunctionType */: + case 173 /* FunctionType */: return factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 175 /* ConstructorType */: + case 174 /* ConstructorType */: return factory.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName)); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return factory.updateArrayTypeNode(node, nodeVisitor(node.elementType, visitor, ts.isTypeNode)); - case 179 /* TupleType */: + case 178 /* TupleType */: return factory.updateTupleTypeNode(node, nodesVisitor(node.elements, visitor, ts.isTypeNode)); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return factory.updateOptionalTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 181 /* RestType */: + case 180 /* RestType */: return factory.updateRestTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 182 /* UnionType */: + case 181 /* UnionType */: return factory.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return factory.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return factory.updateConditionalTypeNode(node, nodeVisitor(node.checkType, visitor, ts.isTypeNode), nodeVisitor(node.extendsType, visitor, ts.isTypeNode), nodeVisitor(node.trueType, visitor, ts.isTypeNode), nodeVisitor(node.falseType, visitor, ts.isTypeNode)); - case 185 /* InferType */: + case 184 /* InferType */: return factory.updateInferTypeNode(node, nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 195 /* ImportType */: + case 192 /* ImportType */: return factory.updateImportTypeNode(node, nodeVisitor(node.argument, visitor, ts.isTypeNode), nodeVisitor(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return factory.updateNamedTupleMember(node, visitNode(node.dotDotDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return factory.updateParenthesizedType(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return factory.updateTypeOperatorNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return factory.updateIndexedAccessTypeNode(node, nodeVisitor(node.objectType, visitor, ts.isTypeNode), nodeVisitor(node.indexType, visitor, ts.isTypeNode)); - case 190 /* MappedType */: - return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.nameType, visitor, ts.isTypeNode), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 191 /* LiteralType */: + case 189 /* MappedType */: + return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); + case 190 /* LiteralType */: return factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.isExpression)); - case 193 /* TemplateLiteralType */: - return factory.updateTemplateLiteralType(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateLiteralTypeSpan)); - case 194 /* TemplateLiteralTypeSpan */: - return factory.updateTemplateLiteralTypeSpan(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Binding patterns - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: return factory.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return factory.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return factory.updateBindingElement(node, nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.propertyName, visitor, ts.isPropertyName), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.initializer, visitor, ts.isExpression)); // Expression - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return factory.updateArrayLiteralExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return factory.updateObjectLiteralExpression(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updatePropertyAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier)); } return factory.updatePropertyAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateElementAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.argumentExpression, visitor, ts.isExpression)); } return factory.updateElementAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.argumentExpression, visitor, ts.isExpression)); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateCallChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return factory.updateCallExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return factory.updateNewExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return factory.updateTaggedTemplateExpression(node, nodeVisitor(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), nodeVisitor(node.template, visitor, ts.isTemplateLiteral)); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return factory.updateTypeAssertion(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return factory.updateParenthesizedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return factory.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return factory.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return factory.updateDeleteExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return factory.updateTypeOfExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return factory.updateVoidExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return factory.updateAwaitExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return factory.updatePrefixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression)); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return factory.updatePostfixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression)); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return factory.updateBinaryExpression(node, nodeVisitor(node.left, visitor, ts.isExpression), nodeVisitor(node.operatorToken, tokenVisitor, ts.isToken), nodeVisitor(node.right, visitor, ts.isExpression)); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return factory.updateConditionalExpression(node, nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenTrue, visitor, ts.isExpression), nodeVisitor(node.colonToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenFalse, visitor, ts.isExpression)); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return factory.updateTemplateExpression(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return factory.updateYieldExpression(node, nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return factory.updateSpreadElement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return factory.updateClassExpression(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return factory.updateExpressionWithTypeArguments(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 224 /* AsExpression */: + case 221 /* AsExpression */: return factory.updateAsExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateNonNullChain(node, nodeVisitor(node.expression, visitor, ts.isExpression)); } return factory.updateNonNullExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return factory.updateMetaProperty(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); // Misc - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return factory.updateTemplateSpan(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 230 /* Block */: + case 227 /* Block */: return factory.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return factory.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return factory.updateExpressionStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return factory.updateIfStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.thenStatement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.elseStatement, visitor, ts.isStatement, factory.liftToBlock)); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return factory.updateDoStatement(node, nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return factory.updateWhileStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return factory.updateForStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.incrementor, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return factory.updateForInStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return factory.updateForOfStatement(node, nodeVisitor(node.awaitModifier, tokenVisitor, ts.isToken), nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return factory.updateContinueStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier)); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return factory.updateBreakStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier)); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return factory.updateReturnStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return factory.updateWithStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return factory.updateSwitchStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.caseBlock, visitor, ts.isCaseBlock)); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return factory.updateLabeledStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return factory.updateThrowStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return factory.updateTryStatement(node, nodeVisitor(node.tryBlock, visitor, ts.isBlock), nodeVisitor(node.catchClause, visitor, ts.isCatchClause), nodeVisitor(node.finallyBlock, visitor, ts.isBlock)); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return factory.updateVariableDeclaration(node, nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return factory.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return factory.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return factory.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return factory.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return factory.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return factory.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return factory.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.body, visitor, ts.isModuleBody)); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return factory.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return factory.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return factory.updateNamespaceExportDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return factory.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.moduleReference, visitor, ts.isModuleReference)); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return factory.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.importClause, visitor, ts.isImportClause), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression)); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts.isNamedImportBindings)); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return factory.updateNamespaceImport(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return factory.updateNamespaceExport(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 264 /* NamedImports */: + case 261 /* NamedImports */: return factory.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return factory.updateImportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return factory.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return factory.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, ts.isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression)); - case 268 /* NamedExports */: + case 265 /* NamedExports */: return factory.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return factory.updateExportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier)); // Module references - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return factory.updateExternalModuleReference(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // JSX - case 273 /* JsxElement */: + case 270 /* JsxElement */: return factory.updateJsxElement(node, nodeVisitor(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingElement, visitor, ts.isJsxClosingElement)); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return factory.updateJsxSelfClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes)); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: return factory.updateJsxOpeningElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes)); - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: return factory.updateJsxClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return factory.updateJsxFragment(node, nodeVisitor(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return factory.updateJsxAttribute(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return factory.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return factory.updateJsxSpreadAttribute(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return factory.updateJsxExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Clauses - case 284 /* CaseClause */: + case 281 /* CaseClause */: return factory.updateCaseClause(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return factory.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return factory.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return factory.updateCatchClause(node, nodeVisitor(node.variableDeclaration, visitor, ts.isVariableDeclaration), nodeVisitor(node.block, visitor, ts.isBlock)); // Property assignments - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return factory.updatePropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return factory.updateShorthandPropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return factory.updateSpreadAssignment(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Enum - case 291 /* EnumMember */: + case 288 /* EnumMember */: return factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 297 /* SourceFile */: + case 294 /* SourceFile */: return factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return factory.updateCommaListExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -81485,7 +79470,7 @@ var ts; function chainBundle(context, transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 297 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 294 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -81536,7 +79521,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -81549,13 +79534,13 @@ var ts; hasImportDefault = true; } break; - case 260 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 272 /* ExternalModuleReference */) { + case 257 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 269 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -81586,13 +79571,13 @@ var ts; addExportedNamesForExportDeclaration(node); } break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { for (var _b = 0, _c = node.declarationList.declarations; _b < _c.length; _b++) { var decl = _c[_b]; @@ -81600,7 +79585,7 @@ var ts; } } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { if (ts.hasSyntacticModifier(node, 512 /* Default */)) { // export default function() { } @@ -81620,7 +79605,7 @@ var ts; } } break; - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { if (ts.hasSyntacticModifier(node, 512 /* Default */)) { // export default class { } @@ -81794,7 +79779,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 163 /* PropertyDeclaration */ + return member.kind === 162 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -82013,27 +79998,18 @@ var ts; * for the element. */ function flattenBindingOrAssignmentElement(flattenContext, element, value, location, skipInitializer) { - var bindingTarget = ts.getTargetOfBindingOrAssignmentElement(element); // TODO: GH#18217 if (!skipInitializer) { var initializer = ts.visitNode(ts.getInitializerOfBindingOrAssignmentElement(element), flattenContext.visitor, ts.isExpression); if (initializer) { // Combine value and initializer - if (value) { - value = createDefaultValueCheck(flattenContext, value, initializer, location); - // If 'value' is not a simple expression, it could contain side-effecting code that should evaluate before an object or array binding pattern. - if (!ts.isSimpleInlineableExpression(initializer) && ts.isBindingOrAssignmentPattern(bindingTarget)) { - value = ensureIdentifier(flattenContext, value, /*reuseIdentifierExpressions*/ true, location); - } - } - else { - value = initializer; - } + value = value ? createDefaultValueCheck(flattenContext, value, initializer, location) : initializer; } else if (!value) { // Use 'void 0' in absence of value and initializer value = flattenContext.context.factory.createVoidZero(); } } + var bindingTarget = ts.getTargetOfBindingOrAssignmentElement(element); // TODO: GH#18217 if (ts.isObjectBindingOrAssignmentPattern(bindingTarget)) { flattenObjectBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value, location); } @@ -82138,8 +80114,7 @@ var ts; if (flattenContext.level >= 1 /* ObjectRest */) { // If an array pattern contains an ObjectRest, we must cache the result so that we // can perform the ObjectRest destructuring in a different declaration - if (element.transformFlags & 16384 /* ContainsObjectRestOrSpread */ || flattenContext.hasTransformedPriorElement && !isSimpleBindingOrAssignmentElement(element)) { - flattenContext.hasTransformedPriorElement = true; + if (element.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { var temp = flattenContext.context.factory.createTempVariable(/*recordTempVariable*/ undefined); if (flattenContext.hoistTempVariables) { flattenContext.context.hoistVariableDeclaration(temp); @@ -82173,20 +80148,6 @@ var ts; } } } - function isSimpleBindingOrAssignmentElement(element) { - var target = ts.getTargetOfBindingOrAssignmentElement(element); - if (!target || ts.isOmittedExpression(target)) - return true; - var propertyName = ts.tryGetPropertyNameOfBindingOrAssignmentElement(element); - if (propertyName && !ts.isPropertyNameLiteral(propertyName)) - return false; - var initializer = ts.getInitializerOfBindingOrAssignmentElement(element); - if (initializer && !ts.isSimpleInlineableExpression(initializer)) - return false; - if (ts.isBindingOrAssignmentPattern(target)) - return ts.every(ts.getElementsOfBindingOrAssignmentPattern(target), isSimpleBindingOrAssignmentElement); - return ts.isIdentifier(target); - } /** * Creates an expression used to provide a default value if a value is `undefined` at runtime. * @@ -82396,8 +80357,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -82423,14 +80384,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 298 /* Bundle */) { + if (node.kind === 295 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return factory.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 300 /* InputFiles */) { + if (prepend.kind === 297 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -82481,16 +80442,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 297 /* SourceFile */: - case 258 /* CaseBlock */: - case 257 /* ModuleBlock */: - case 230 /* Block */: + case 294 /* SourceFile */: + case 255 /* CaseBlock */: + case 254 /* ModuleBlock */: + case 227 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.hasSyntacticModifier(node, 2 /* Ambient */)) { break; } @@ -82502,7 +80463,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 252 /* ClassDeclaration */ || ts.hasSyntacticModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 249 /* ClassDeclaration */ || ts.hasSyntacticModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -82545,10 +80506,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: return visitElidableStatement(node); default: return visitorWorker(node); @@ -82569,13 +80530,13 @@ var ts; return node; } switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -82595,11 +80556,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 267 /* ExportDeclaration */ || - node.kind === 261 /* ImportDeclaration */ || - node.kind === 262 /* ImportClause */ || - (node.kind === 260 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 272 /* ExternalModuleReference */)) { + if (node.kind === 264 /* ExportDeclaration */ || + node.kind === 258 /* ImportDeclaration */ || + node.kind === 259 /* ImportClause */ || + (node.kind === 257 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 269 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -82623,19 +80584,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return visitConstructor(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 171 /* IndexSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + case 170 /* IndexSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -82672,61 +80633,61 @@ var ts; case 125 /* AbstractKeyword */: case 84 /* ConstKeyword */: case 133 /* DeclareKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 178 /* ArrayType */: - case 179 /* TupleType */: - case 180 /* OptionalType */: - case 181 /* RestType */: - case 177 /* TypeLiteral */: - case 172 /* TypePredicate */: - case 159 /* TypeParameter */: + case 177 /* ArrayType */: + case 178 /* TupleType */: + case 179 /* OptionalType */: + case 180 /* RestType */: + case 176 /* TypeLiteral */: + case 171 /* TypePredicate */: + case 158 /* TypeParameter */: case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: + case 151 /* UnknownKeyword */: case 131 /* BooleanKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 141 /* NeverKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 140 /* NeverKeyword */: case 113 /* VoidKeyword */: - case 148 /* SymbolKeyword */: - case 175 /* ConstructorType */: - case 174 /* FunctionType */: - case 176 /* TypeQuery */: - case 173 /* TypeReference */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 184 /* ConditionalType */: - case 186 /* ParenthesizedType */: - case 187 /* ThisType */: - case 188 /* TypeOperator */: - case 189 /* IndexedAccessType */: - case 190 /* MappedType */: - case 191 /* LiteralType */: + case 147 /* SymbolKeyword */: + case 174 /* ConstructorType */: + case 173 /* FunctionType */: + case 175 /* TypeQuery */: + case 172 /* TypeReference */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 183 /* ConditionalType */: + case 185 /* ParenthesizedType */: + case 186 /* ThisType */: + case 187 /* TypeOperator */: + case 188 /* IndexedAccessType */: + case 189 /* MappedType */: + case 190 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 161 /* Decorator */: + case 160 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 166 /* Constructor */: + case 165 /* Constructor */: return visitConstructor(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return factory.createNotEmittedStatement(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -82736,7 +80697,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -82746,35 +80707,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 160 /* Parameter */: + case 159 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -82784,40 +80745,40 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: return visitJsxJsxOpeningElement(node); default: // node contains some other TypeScript syntax @@ -83226,12 +81187,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -83384,7 +81345,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 163 /* PropertyDeclaration */ + ? member.kind === 162 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? factory.createVoidZero() @@ -83508,10 +81469,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 163 /* PropertyDeclaration */; + return kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 162 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -83521,7 +81482,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 165 /* MethodDeclaration */; + return node.kind === 164 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -83532,12 +81493,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return true; } return false; @@ -83554,15 +81515,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: - case 160 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 159 /* Parameter */: return serializeTypeNode(node.type); - case 168 /* SetAccessor */: - case 167 /* GetAccessor */: + case 167 /* SetAccessor */: + case 166 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 165 /* MethodDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 164 /* MethodDeclaration */: return factory.createIdentifier("Function"); default: return factory.createVoidZero(); @@ -83599,7 +81560,7 @@ var ts; return factory.createArrayLiteralExpression(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 167 /* GetAccessor */) { + if (container && node.kind === 166 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -83645,30 +81606,30 @@ var ts; } switch (node.kind) { case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: return factory.createVoidZero(); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return factory.createIdentifier("Function"); - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return factory.createIdentifier("Array"); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: case 131 /* BooleanKeyword */: return factory.createIdentifier("Boolean"); - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: return factory.createIdentifier("String"); - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return factory.createIdentifier("Object"); - case 191 /* LiteralType */: + case 190 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return factory.createIdentifier("String"); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return factory.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -83681,45 +81642,45 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: return factory.createIdentifier("Number"); - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : factory.createIdentifier("Symbol"); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return serializeTypeReferenceNode(node); - case 183 /* IntersectionType */: - case 182 /* UnionType */: + case 182 /* IntersectionType */: + case 181 /* UnionType */: return serializeTypeList(node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 188 /* TypeOperator */: - if (node.operator === 142 /* ReadonlyKeyword */) { + case 187 /* TypeOperator */: + if (node.operator === 141 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 176 /* TypeQuery */: - case 189 /* IndexedAccessType */: - case 190 /* MappedType */: - case 177 /* TypeLiteral */: + case 175 /* TypeQuery */: + case 188 /* IndexedAccessType */: + case 189 /* MappedType */: + case 176 /* TypeLiteral */: case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 187 /* ThisType */: - case 195 /* ImportType */: + case 151 /* UnknownKeyword */: + case 186 /* ThisType */: + case 192 /* ImportType */: break; // handle JSDoc types from an invalid parse - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: - case 308 /* JSDocFunctionType */: - case 309 /* JSDocVariadicType */: - case 310 /* JSDocNamepathType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: + case 304 /* JSDocFunctionType */: + case 305 /* JSDocVariadicType */: + case 306 /* JSDocNamepathType */: break; - case 305 /* JSDocNullableType */: - case 306 /* JSDocNonNullableType */: - case 307 /* JSDocOptionalType */: + case 301 /* JSDocNullableType */: + case 302 /* JSDocNonNullableType */: + case 303 /* JSDocOptionalType */: return serializeTypeNode(node.type); default: return ts.Debug.failBadSyntaxKind(node); @@ -83730,15 +81691,15 @@ var ts; // Note when updating logic here also update getEntityNameForDecoratorMetadata // so that aliases can be marked as referenced var serializedUnion; - for (var _i = 0, types_22 = types; _i < types_22.length; _i++) { - var typeNode = types_22[_i]; - while (typeNode.kind === 186 /* ParenthesizedType */) { + for (var _i = 0, types_21 = types; _i < types_21.length; _i++) { + var typeNode = types_21[_i]; + while (typeNode.kind === 185 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 141 /* NeverKeyword */) { + if (typeNode.kind === 140 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 190 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 149 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -83848,7 +81809,7 @@ var ts; name.original = undefined; ts.setParent(name, ts.getParseTreeNode(currentLexicalScope)); // ensure the parent is set to a parse tree node. return name; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -84422,12 +82383,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = factory.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), factory.createVariableDeclarationList([ factory.createVariableDeclaration(factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 297 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 294 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 255 /* EnumDeclaration */) { + if (node.kind === 252 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -84552,7 +82513,7 @@ var ts; var statementsLocation; var blockLocation; if (node.body) { - if (node.body.kind === 257 /* ModuleBlock */) { + if (node.body.kind === 254 /* ModuleBlock */) { saveStateAndInvoke(node.body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = node.body.statements; blockLocation = node.body; @@ -84599,13 +82560,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (!node.body || node.body.kind !== 257 /* ModuleBlock */) { + if (!node.body || node.body.kind !== 254 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 256 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 253 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -84655,7 +82616,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 263 /* NamespaceImport */) { + if (node.kind === 260 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -84904,16 +82865,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(78 /* Identifier */); - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(256 /* ModuleDeclaration */); + context.enableEmitNotification(253 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 256 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 253 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 255 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 252 /* EnumDeclaration */; } /** * Hook for node emit. @@ -84974,9 +82935,9 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -85014,9 +82975,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 297 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 256 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 255 /* EnumDeclaration */); + if (container && container.kind !== 294 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 253 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 252 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(container), node), /*location*/ node); @@ -85116,40 +83077,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: return visitClassLike(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); case 79 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 200 /* ObjectLiteralExpression */: - case 199 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -85172,20 +83133,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -85937,31 +83898,31 @@ var ts; case 129 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitAwaitExpression(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return ts.visitEachChild(node, visitor, context); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -85970,27 +83931,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 230 /* Block */: - case 244 /* SwitchStatement */: - case 258 /* CaseBlock */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 247 /* TryStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 234 /* IfStatement */: - case 243 /* WithStatement */: - case 245 /* LabeledStatement */: + case 227 /* Block */: + case 241 /* SwitchStatement */: + case 255 /* CaseBlock */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 244 /* TryStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 231 /* IfStatement */: + case 240 /* WithStatement */: + case 242 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -86195,7 +84156,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 209 /* ArrowFunction */; + var isArrowFunction = node.kind === 206 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -86286,17 +84247,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(203 /* CallExpression */); - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(200 /* CallExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(252 /* ClassDeclaration */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(166 /* Constructor */); + context.enableEmitNotification(249 /* ClassDeclaration */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(165 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(232 /* VariableStatement */); + context.enableEmitNotification(229 /* VariableStatement */); } } /** @@ -86344,11 +84305,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -86380,11 +84341,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 252 /* ClassDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 249 /* ClassDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -86535,10 +84496,10 @@ var ts; return visited; } function visitor(node) { - return visitorWorker(node, /*expressionResultIsUnused*/ false); + return visitorWorker(node, /*noDestructuringValue*/ false); } - function visitorWithUnusedExpressionResult(node) { - return visitorWorker(node, /*expressionResultIsUnused*/ true); + function visitorNoDestructuringValue(node) { + return visitorWorker(node, /*noDestructuringValue*/ true); } function visitorNoAsyncModifier(node) { if (node.kind === 129 /* AsyncKeyword */) { @@ -86558,79 +84519,73 @@ var ts; function visitDefault(node) { return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitorWorker(node, expressionResultIsUnused) { + function visitorWorker(node, noDestructuringValue) { if ((node.transformFlags & 32 /* ContainsES2018 */) === 0) { return node; } switch (node.kind) { - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitAwaitExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 216 /* BinaryExpression */: - return visitBinaryExpression(node, expressionResultIsUnused); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node, expressionResultIsUnused); - case 287 /* CatchClause */: + case 213 /* BinaryExpression */: + return visitBinaryExpression(node, noDestructuringValue); + case 284 /* CatchClause */: return visitCatchClause(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 238 /* ForInStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 235 /* ForInStatement */: return doWithHierarchyFacts(visitDefault, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return doWithHierarchyFacts(visitForStatement, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return visitVoidExpression(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return doWithHierarchyFacts(visitConstructorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return doWithHierarchyFacts(visitMethodDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return doWithHierarchyFacts(visitGetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return doWithHierarchyFacts(visitSetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return doWithHierarchyFacts(visitFunctionDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return doWithHierarchyFacts(visitFunctionExpression, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return doWithHierarchyFacts(visitArrowFunction, node, 2 /* ArrowFunctionExcludes */, 0 /* ArrowFunctionIncludes */); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitParameter(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 207 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, expressionResultIsUnused); - case 205 /* TaggedTemplateExpression */: + case 204 /* ParenthesizedExpression */: + return visitParenthesizedExpression(node, noDestructuringValue); + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return ts.visitEachChild(node, visitor, context); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return doWithHierarchyFacts(visitDefault, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); default: return ts.visitEachChild(node, visitor, context); @@ -86666,7 +84621,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 239 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 236 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return factory.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement, factory.liftToBlock), node); @@ -86678,7 +84633,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 290 /* SpreadAssignment */) { + if (e.kind === 287 /* SpreadAssignment */) { if (chunkObject) { objects.push(factory.createObjectLiteralExpression(chunkObject)); chunkObject = undefined; @@ -86687,7 +84642,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 288 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 285 /* PropertyAssignment */ ? factory.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -86721,7 +84676,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 200 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 197 /* ObjectLiteralExpression */) { objects.unshift(factory.createObjectLiteralExpression()); } var expression = objects[0]; @@ -86738,14 +84693,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitExpressionStatement(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + return ts.visitEachChild(node, visitorNoDestructuringValue, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitParenthesizedExpression(node, expressionResultIsUnused) { - return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context); + function visitParenthesizedExpression(node, noDestructuringValue) { + return ts.visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context); } function visitSourceFile(node) { var ancestorFacts = enterSubtree(2 /* SourceFileExcludes */, ts.isEffectiveStrictModeSourceFile(node, compilerOptions) ? @@ -86767,38 +84718,16 @@ var ts; * Visits a BinaryExpression that contains a destructuring assignment. * * @param node A BinaryExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). */ - function visitBinaryExpression(node, expressionResultIsUnused) { + function visitBinaryExpression(node, noDestructuringValue) { if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { - return ts.flattenDestructuringAssignment(node, visitor, context, 1 /* ObjectRest */, !expressionResultIsUnused); + return ts.flattenDestructuringAssignment(node, visitor, context, 1 /* ObjectRest */, !noDestructuringValue); } - if (node.operatorToken.kind === 27 /* CommaToken */) { - return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression)); + else if (node.operatorToken.kind === 27 /* CommaToken */) { + return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorNoDestructuringValue, ts.isExpression), node.operatorToken, ts.visitNode(node.right, noDestructuringValue ? visitorNoDestructuringValue : visitor, ts.isExpression)); } return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitCommaListExpression(node, expressionResultIsUnused) { - if (expressionResultIsUnused) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - var result; - for (var i = 0; i < node.elements.length; i++) { - var element = node.elements[i]; - var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - result.push(visited); - } - } - var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements; - return factory.updateCommaListExpression(node, elements); - } function visitCatchClause(node) { if (node.variableDeclaration && ts.isBindingPattern(node.variableDeclaration.name) && @@ -86850,10 +84779,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitForStatement(node) { - return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement)); + return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorNoDestructuringValue, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement)); } function visitVoidExpression(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + return ts.visitEachChild(node, visitorNoDestructuringValue, context); } /** * Visits a ForOfStatement and converts it into a ES2015-compatible ForOfStatement. @@ -87134,17 +85063,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(203 /* CallExpression */); - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(200 /* CallExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(252 /* ClassDeclaration */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(166 /* Constructor */); + context.enableEmitNotification(249 /* ClassDeclaration */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(165 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(232 /* VariableStatement */); + context.enableEmitNotification(229 /* VariableStatement */); } } /** @@ -87192,11 +85121,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -87228,11 +85157,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 252 /* ClassDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 249 /* ClassDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -87264,7 +85193,7 @@ var ts; return node; } switch (node.kind) { - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -87296,21 +85225,21 @@ var ts; return node; } switch (node.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 203 /* CallExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 200 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -87353,7 +85282,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 201 /* PropertyAccessExpression */ + expression = node.kind === 198 /* PropertyAccessExpression */ ? factory.updatePropertyAccessExpression(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : factory.updateElementAccessExpression(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? factory.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -87367,10 +85296,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 203 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 204 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 200 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -87390,8 +85319,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (!ts.isSimpleCopiableExpression(rightExpression)) { thisArg = factory.createTempVariable(hoistVariableDeclaration); @@ -87402,11 +85331,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 201 /* PropertyAccessExpression */ + rightExpression = segment.kind === 198 /* PropertyAccessExpression */ ? factory.createPropertyAccessExpression(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : factory.createElementAccessExpression(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = factory.createFunctionCallCall(rightExpression, leftThisArg.kind === 105 /* SuperKeyword */ ? factory.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -87463,7 +85392,7 @@ var ts; return node; } switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var binaryExpression = node; if (ts.isLogicalOrCoalescingAssignmentExpression(binaryExpression)) { return transformLogicalAssignment(binaryExpression); @@ -87508,49 +85437,7 @@ var ts; var factory = context.factory, emitHelpers = context.getEmitHelperFactory; var compilerOptions = context.getCompilerOptions(); var currentSourceFile; - var currentFileState; return ts.chainBundle(context, transformSourceFile); - function getCurrentFileNameExpression() { - if (currentFileState.filenameDeclaration) { - return currentFileState.filenameDeclaration.name; - } - var declaration = factory.createVariableDeclaration(factory.createUniqueName("_jsxFileName", 16 /* Optimistic */ | 32 /* FileLevel */), /*exclaimationToken*/ undefined, /*type*/ undefined, factory.createStringLiteral(currentSourceFile.fileName)); - currentFileState.filenameDeclaration = declaration; - return currentFileState.filenameDeclaration.name; - } - function getJsxFactoryCalleePrimitive(childrenLength) { - return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" : childrenLength > 1 ? "jsxs" : "jsx"; - } - function getJsxFactoryCallee(childrenLength) { - var type = getJsxFactoryCalleePrimitive(childrenLength); - return getImplicitImportForName(type); - } - function getImplicitJsxFragmentReference() { - return getImplicitImportForName("Fragment"); - } - function getImplicitImportForName(name) { - var _a, _b; - var importSource = name === "createElement" - ? currentFileState.importSpecifier - : ts.getJSXRuntimeImport(currentFileState.importSpecifier, compilerOptions); - var existing = (_b = (_a = currentFileState.utilizedImplicitRuntimeImports) === null || _a === void 0 ? void 0 : _a.get(importSource)) === null || _b === void 0 ? void 0 : _b.get(name); - if (existing) { - return existing.name; - } - if (!currentFileState.utilizedImplicitRuntimeImports) { - currentFileState.utilizedImplicitRuntimeImports = ts.createMap(); - } - var specifierSourceImports = currentFileState.utilizedImplicitRuntimeImports.get(importSource); - if (!specifierSourceImports) { - specifierSourceImports = ts.createMap(); - currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports); - } - var generatedName = factory.createUniqueName("_" + name, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */); - var specifier = factory.createImportSpecifier(factory.createIdentifier(name), generatedName); - generatedName.generatedImportReference = specifier; - specifierSourceImports.set(name, specifier); - return generatedName; - } /** * Transform JSX-specific syntax in a SourceFile. * @@ -87561,42 +85448,8 @@ var ts; return node; } currentSourceFile = node; - currentFileState = {}; - currentFileState.importSpecifier = ts.getJSXImplicitImportBase(compilerOptions, node); var visited = ts.visitEachChild(node, visitor, context); ts.addEmitHelpers(visited, context.readEmitHelpers()); - var statements = visited.statements; - if (currentFileState.filenameDeclaration) { - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([currentFileState.filenameDeclaration], 2 /* Const */))); - } - if (currentFileState.utilizedImplicitRuntimeImports) { - for (var _i = 0, _a = ts.arrayFrom(currentFileState.utilizedImplicitRuntimeImports.entries()); _i < _a.length; _i++) { - var _b = _a[_i], importSource = _b[0], importSpecifiersMap = _b[1]; - if (ts.isExternalModule(node)) { - // Add `import` statement - var importStatement = factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, factory.createImportClause(/*typeOnly*/ false, /*name*/ undefined, factory.createNamedImports(ts.arrayFrom(importSpecifiersMap.values()))), factory.createStringLiteral(importSource)); - ts.setParentRecursive(importStatement, /*incremental*/ false); - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), importStatement); - } - else if (ts.isExternalOrCommonJsModule(node)) { - // Add `require` statement - var requireStatement = factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([ - factory.createVariableDeclaration(factory.createObjectBindingPattern(ts.map(ts.arrayFrom(importSpecifiersMap.values()), function (s) { return factory.createBindingElement(/*dotdotdot*/ undefined, s.propertyName, s.name); })), - /*exclaimationToken*/ undefined, - /*type*/ undefined, factory.createCallExpression(factory.createIdentifier("require"), /*typeArguments*/ undefined, [factory.createStringLiteral(importSource)])) - ], 2 /* Const */)); - ts.setParentRecursive(requireStatement, /*incremental*/ false); - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), requireStatement); - } - else { - // Do nothing (script file) - consider an error in the checker? - } - } - } - if (statements !== visited.statements) { - visited = factory.updateSourceFile(visited, statements); - } - currentFileState = undefined; return visited; } function visitor(node) { @@ -87609,13 +85462,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -87625,122 +85478,28 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitJsxExpression(node); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); } } - /** - * The react jsx/jsxs transform falls back to `createElement` when an explicit `key` argument comes after a spread - */ - function hasKeyAfterPropsSpread(node) { - var spread = false; - for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { - var elem = _a[_i]; - if (ts.isJsxSpreadAttribute(elem)) { - spread = true; - } - else if (spread && ts.isJsxAttribute(elem) && elem.name.escapedText === "key") { - return true; - } - } - return false; - } - function shouldUseCreateElement(node) { - return currentFileState.importSpecifier === undefined || hasKeyAfterPropsSpread(node); - } function visitJsxElement(node, isChild) { - var tagTransform = shouldUseCreateElement(node.openingElement) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform(node.openingElement, node.children, isChild, /*location*/ node); + return visitJsxOpeningLikeElement(node.openingElement, node.children, isChild, /*location*/ node); } function visitJsxSelfClosingElement(node, isChild) { - var tagTransform = shouldUseCreateElement(node) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform(node, /*children*/ undefined, isChild, /*location*/ node); + return visitJsxOpeningLikeElement(node, /*children*/ undefined, isChild, /*location*/ node); } function visitJsxFragment(node, isChild) { - var tagTransform = currentFileState.importSpecifier === undefined ? visitJsxOpeningFragmentCreateElement : visitJsxOpeningFragmentJSX; - return tagTransform(node.openingFragment, node.children, isChild, /*location*/ node); + return visitJsxOpeningFragment(node.openingFragment, node.children, isChild, /*location*/ node); } - function convertJsxChildrenToChildrenPropObject(children) { - var nonWhitespaceChildren = ts.getSemanticJsxChildren(children); - if (ts.length(nonWhitespaceChildren) === 1) { - var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]); - return result_13 && factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("children", result_13) - ]); - } - var result = ts.mapDefined(children, transformJsxChildToExpression); - return !result.length ? undefined : factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) - ]); - } - function visitJsxOpeningLikeElementJSX(node, children, isChild, location) { - var tagName = getTagName(node); - var objectProperties; - var keyAttr = ts.find(node.attributes.properties, function (p) { return !!p.name && ts.isIdentifier(p.name) && p.name.escapedText === "key"; }); - var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties; - var segments = []; - if (attrs.length) { - // Map spans of JsxAttribute nodes into object literals and spans - // of JsxSpreadAttribute nodes into expressions. - segments = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread - ? ts.map(attrs, transformJsxSpreadAttributeToExpression) - : factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); })); - if (ts.isJsxSpreadAttribute(attrs[0])) { - // We must always emit at least one object literal before a spread - // argument.factory.createObjectLiteral - segments.unshift(factory.createObjectLiteralExpression()); - } - } - if (children && children.length) { - var result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - segments.push(result); - } - } - if (segments.length === 0) { - objectProperties = factory.createObjectLiteralExpression([]); - // When there are no attributes, React wants {} - } - else { - // Either emit one big object literal (no spread attribs), or - // a call to the __assign helper. - objectProperties = ts.singleOrUndefined(segments) || emitHelpers().createAssignHelper(segments); - } - return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, ts.length(ts.getSemanticJsxChildren(children || ts.emptyArray)), isChild, location); - } - function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, childrenLength, isChild, location) { - var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)]; - if (compilerOptions.jsx === 5 /* ReactJSXDev */) { - var originalFile = ts.getOriginalNode(currentSourceFile); - if (originalFile && ts.isSourceFile(originalFile)) { - // isStaticChildren development flag - args.push(childrenLength > 1 ? factory.createTrue() : factory.createFalse()); - // __source development flag - var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos); - args.push(factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("fileName", getCurrentFileNameExpression()), - factory.createPropertyAssignment("lineNumber", factory.createNumericLiteral(lineCol.line + 1)), - factory.createPropertyAssignment("columnNumber", factory.createNumericLiteral(lineCol.character + 1)) - ])); - // __self development flag - args.push(factory.createThis()); - } - } - var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(childrenLength), /*typeArguments*/ undefined, args), location); - if (isChild) { - ts.startOnNewLine(element); - } - return element; - } - function visitJsxOpeningLikeElementCreateElement(node, children, isChild, location) { + function visitJsxOpeningLikeElement(node, children, isChild, location) { var tagName = getTagName(node); var objectProperties; var attrs = node.attributes.properties; @@ -87766,28 +85525,14 @@ var ts; objectProperties = emitHelpers().createAssignHelper(segments); } } - var callee = currentFileState.importSpecifier === undefined - ? ts.createJsxFactoryExpression(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 - node) - : getImplicitImportForName("createElement"); - var element = ts.createExpressionForJsxElement(factory, callee, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), location); + var element = ts.createExpressionForJsxElement(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 + tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } return element; } - function visitJsxOpeningFragmentJSX(_node, children, isChild, location) { - var childrenProps; - if (children && children.length) { - var result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - childrenProps = result; - } - } - return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]), - /*keyAttr*/ undefined, ts.length(ts.getSemanticJsxChildren(children)), isChild, location); - } - function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) { + function visitJsxOpeningFragment(node, children, isChild, location) { var element = ts.createExpressionForJsxFragment(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { @@ -87814,7 +85559,7 @@ var ts; var literal = factory.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote); return ts.setTextRange(literal, node); } - else if (node.kind === 283 /* JsxExpression */) { + else if (node.kind === 280 /* JsxExpression */) { if (node.expression === undefined) { return factory.createTrue(); } @@ -87908,7 +85653,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 273 /* JsxElement */) { + if (node.kind === 270 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -88214,7 +85959,7 @@ var ts; return node; } switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -88427,7 +86172,7 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 242 /* ReturnStatement */ + && node.kind === 239 /* ReturnStatement */ && !node.expression; } function isOrMayContainReturnCompletion(node) { @@ -88453,10 +86198,12 @@ var ts; || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } function visitor(node) { - return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ false) : node; - } - function visitorWithUnusedExpressionResult(node) { - return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ true) : node; + if (shouldVisitNode(node)) { + return visitJavaScript(node); + } + else { + return node; + } } function callExpressionVisitor(node) { if (node.kind === 105 /* SuperKeyword */) { @@ -88464,70 +86211,68 @@ var ts; } return visitor(node); } - function visitorWorker(node, expressionResultIsUnused) { + function visitJavaScript(node) { switch (node.kind) { case 123 /* StaticKeyword */: return undefined; // elide static keyword - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return visitClassExpression(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitParameter(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return visitArrowFunction(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); case 78 /* Identifier */: return visitIdentifier(node); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitCaseBlock(node); - case 230 /* Block */: + case 227 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); - case 207 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, expressionResultIsUnused); - case 216 /* BinaryExpression */: - return visitBinaryExpression(node, expressionResultIsUnused); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node, expressionResultIsUnused); + case 204 /* ParenthesizedExpression */: + return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); + case 213 /* BinaryExpression */: + return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: case 16 /* TemplateMiddle */: @@ -88537,31 +86282,29 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return visitTemplateExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return visitSpreadElement(node); case 105 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 107 /* ThisKeyword */: return visitThisKeyword(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return visitMetaProperty(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return visitAccessorDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); - case 212 /* VoidExpression */: - return visitVoidExpression(node); default: return ts.visitEachChild(node, visitor, context); } @@ -88632,9 +86375,6 @@ var ts; } return node; } - function visitVoidExpression(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } function visitIdentifier(node) { if (!convertedLoopState) { return node; @@ -88650,14 +86390,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 241 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 238 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 241 /* BreakStatement */) { + if (node.kind === 238 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -88668,7 +86408,7 @@ var ts; } } else { - if (node.kind === 241 /* BreakStatement */) { + if (node.kind === 238 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -88820,17 +86560,16 @@ var ts; */ function transformClassBody(node, extendsClauseElement) { var statements = []; - var name = factory.getInternalName(node); - var constructorLikeName = ts.isIdentifierANonContextualKeyword(name) ? factory.getGeneratedNameForNode(name) : name; startLexicalEnvironment(); addExtendsHelperIfNeeded(statements, node, extendsClauseElement); - addConstructor(statements, node, constructorLikeName, extendsClauseElement); + addConstructor(statements, node, extendsClauseElement); addClassMembers(statements, node); // Create a synthetic text range for the return statement. var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 19 /* CloseBraceToken */); + var localName = factory.getInternalName(node); // The following partially-emitted expression exists purely to align our sourcemap // emit with the original emitter. - var outer = factory.createPartiallyEmittedExpression(constructorLikeName); + var outer = factory.createPartiallyEmittedExpression(localName); ts.setTextRangeEnd(outer, closingBraceLocation.end); ts.setEmitFlags(outer, 1536 /* NoComments */); var statement = factory.createReturnStatement(outer); @@ -88862,7 +86601,7 @@ var ts; * @param node The ClassExpression or ClassDeclaration node. * @param extendsClauseElement The expression for the class `extends` clause. */ - function addConstructor(statements, node, name, extendsClauseElement) { + function addConstructor(statements, node, extendsClauseElement) { var savedConvertedLoopState = convertedLoopState; convertedLoopState = undefined; var ancestorFacts = enterSubtree(16278 /* ConstructorExcludes */, 73 /* ConstructorIncludes */); @@ -88871,7 +86610,7 @@ var ts; var constructorFunction = factory.createFunctionDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*asteriskToken*/ undefined, name, + /*asteriskToken*/ undefined, factory.getInternalName(node), /*typeParameters*/ undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper)); ts.setTextRange(constructorFunction, constructor || node); @@ -89066,11 +86805,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 242 /* ReturnStatement */) { + if (statement.kind === 239 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 234 /* IfStatement */) { + else if (statement.kind === 231 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -89078,7 +86817,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 230 /* Block */) { + else if (statement.kind === 227 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -89280,7 +87019,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 209 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 206 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, factory.createThis()); return true; } @@ -89302,22 +87041,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return statements; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = factory.createVoidZero(); break; - case 166 /* Constructor */: + case 165 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = factory.createPropertyAccessExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = factory.createConditionalExpression(factory.createLogicalAnd(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), factory.createBinaryExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), 101 /* InstanceOfKeyword */, factory.getLocalName(node))), @@ -89352,20 +87091,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 166 /* Constructor */: + case 165 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -89568,7 +87307,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */)) { name = factory.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -89614,7 +87353,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 209 /* ArrowFunction */); + ts.Debug.assert(node.kind === 206 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -89680,55 +87419,51 @@ var ts; * @param node An ExpressionStatement node. */ function visitExpressionStatement(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + // If we are here it is most likely because our expression is a destructuring assignment. + switch (node.expression.kind) { + case 204 /* ParenthesizedExpression */: + return factory.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); + case 213 /* BinaryExpression */: + return factory.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); + } + return ts.visitEachChild(node, visitor, context); } /** * Visits a ParenthesizedExpression that may contain a destructuring assignment. * * @param node A ParenthesizedExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). + * @param needsDestructuringValue A value indicating whether we need to hold onto the rhs + * of a destructuring assignment. */ - function visitParenthesizedExpression(node, expressionResultIsUnused) { - return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context); + function visitParenthesizedExpression(node, needsDestructuringValue) { + // If we are here it is most likely because our expression is a destructuring assignment. + if (!needsDestructuringValue) { + // By default we always emit the RHS at the end of a flattened destructuring + // expression. If we are in a state where we do not need the destructuring value, + // we pass that information along to the children that care about it. + switch (node.expression.kind) { + case 204 /* ParenthesizedExpression */: + return factory.updateParenthesizedExpression(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); + case 213 /* BinaryExpression */: + return factory.updateParenthesizedExpression(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); + } + } + return ts.visitEachChild(node, visitor, context); } /** * Visits a BinaryExpression that contains a destructuring assignment. * * @param node A BinaryExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). + * @param needsDestructuringValue A value indicating whether we need to hold onto the rhs + * of a destructuring assignment. */ - function visitBinaryExpression(node, expressionResultIsUnused) { + function visitBinaryExpression(node, needsDestructuringValue) { // If we are here it is because this is a destructuring assignment. if (ts.isDestructuringAssignment(node)) { - return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, !expressionResultIsUnused); - } - if (node.operatorToken.kind === 27 /* CommaToken */) { - return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression)); + return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, needsDestructuringValue); } return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitCommaListExpression(node, expressionResultIsUnused) { - if (expressionResultIsUnused) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - var result; - for (var i = 0; i < node.elements.length; i++) { - var element = node.elements[i]; - var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - result.push(visited); - } - } - var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements; - return factory.updateCommaListExpression(node, elements); - } function isVariableStatementOfTypeScriptClassWrapper(node) { return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer @@ -89921,14 +87656,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -89944,9 +87679,6 @@ var ts; function visitForStatement(node, outermostLabeledStatement) { return visitIterationStatementWithFacts(5056 /* ForStatementExcludes */, 3328 /* ForStatementIncludes */, node, outermostLabeledStatement); } - function visitEachChildOfForStatement(node) { - return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - } function visitForInStatement(node, outermostLabeledStatement) { return visitIterationStatementWithFacts(3008 /* ForInOrForOfStatementExcludes */, 5376 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement); } @@ -89989,7 +87721,7 @@ var ts; // evaluated on every iteration. var assignment = factory.createAssignment(initializer, boundValue); if (ts.isDestructuringAssignment(assignment)) { - statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*expressionResultIsUnused*/ true))); + statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*needsDestructuringValue*/ false))); } else { ts.setTextRangeEnd(assignment, initializer.end); @@ -90114,7 +87846,7 @@ var ts; var property = properties[i]; if ((property.transformFlags & 262144 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */) - || (hasComputed = ts.Debug.checkDefined(property.name).kind === 158 /* ComputedPropertyName */)) { + || (hasComputed = ts.Debug.checkDefined(property.name).kind === 157 /* ComputedPropertyName */)) { numInitialProperties = i; break; } @@ -90190,7 +87922,7 @@ var ts; } var result = convert ? convert(node, outermostLabeledStatement, /*convertedLoopBodyStatements*/ undefined, ancestorFacts) - : factory.restoreEnclosingLabel(ts.isForStatement(node) ? visitEachChildOfForStatement(node) : ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); + : factory.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); if (convertedLoopState) { convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; } @@ -90230,18 +87962,18 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 237 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 238 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 239 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 235 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 236 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 234 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 235 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 236 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 232 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 233 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } function convertForStatement(node, initializerFunction, convertedLoopBody) { var shouldConvertCondition = node.condition && shouldConvertPartOfIterationStatement(node.condition); var shouldConvertIncrementor = shouldConvertCondition || node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); - return factory.updateForStatement(node, ts.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(shouldConvertCondition ? undefined : node.condition, visitor, ts.isExpression), ts.visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), convertedLoopBody); + return factory.updateForStatement(node, ts.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitor, ts.isForInitializer), ts.visitNode(shouldConvertCondition ? undefined : node.condition, visitor, ts.isExpression), ts.visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitor, ts.isExpression), convertedLoopBody); } function convertForOfStatement(node, convertedLoopBody) { return factory.updateForOfStatement(node, @@ -90259,11 +87991,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 250 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 247 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -90671,20 +88403,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -90791,7 +88523,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { updated = factory.updateGetAccessorDeclaration(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -91283,13 +89015,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(107 /* ThisKeyword */); - context.enableEmitNotification(166 /* Constructor */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(209 /* ArrowFunction */); - context.enableEmitNotification(208 /* FunctionExpression */); - context.enableEmitNotification(251 /* FunctionDeclaration */); + context.enableEmitNotification(165 /* Constructor */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(206 /* ArrowFunction */); + context.enableEmitNotification(205 /* FunctionExpression */); + context.enableEmitNotification(248 /* FunctionDeclaration */); } } /** @@ -91330,10 +89062,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 246 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -91415,11 +89147,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 233 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 230 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 203 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 200 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -91427,7 +89159,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 220 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 217 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -91453,15 +89185,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(275 /* JsxOpeningElement */); - context.enableEmitNotification(276 /* JsxClosingElement */); - context.enableEmitNotification(274 /* JsxSelfClosingElement */); + context.enableEmitNotification(272 /* JsxOpeningElement */); + context.enableEmitNotification(273 /* JsxClosingElement */); + context.enableEmitNotification(271 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(288 /* PropertyAssignment */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(285 /* PropertyAssignment */); return ts.chainBundle(context, transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -91480,9 +89212,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 275 /* JsxOpeningElement */: - case 276 /* JsxClosingElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 273 /* JsxClosingElement */: + case 271 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -91817,13 +89549,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitWhileStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -91836,24 +89568,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return visitAccessorDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return visitBreakStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return visitContinueStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -91874,23 +89606,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return visitConditionalExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -91903,9 +89633,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -92113,7 +89843,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -92125,7 +89855,7 @@ var ts; // _a.b = %sent%; target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -92172,61 +89902,6 @@ var ts; } return ts.visitEachChild(node, visitor, context); } - /** - * Visits a comma expression containing `yield`. - * - * @param node The node to visit. - */ - function visitCommaExpression(node) { - // [source] - // x = a(), yield, b(); - // - // [intermediate] - // a(); - // .yield resumeLabel - // .mark resumeLabel - // x = %sent%, b(); - var pendingExpressions = []; - visit(node.left); - visit(node.right); - return factory.inlineExpressions(pendingExpressions); - function visit(node) { - if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { - visit(node.left); - visit(node.right); - } - else { - if (containsYield(node) && pendingExpressions.length > 0) { - emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); - pendingExpressions = []; - } - pendingExpressions.push(ts.visitNode(node, visitor, ts.isExpression)); - } - } - } - /** - * Visits a comma-list expression. - * - * @param node The node to visit. - */ - function visitCommaListExpression(node) { - // flattened version of `visitCommaExpression` - var pendingExpressions = []; - for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { - var elem = _a[_i]; - if (ts.isBinaryExpression(elem) && elem.operatorToken.kind === 27 /* CommaToken */) { - pendingExpressions.push(visitCommaExpression(elem)); - } - else { - if (containsYield(elem) && pendingExpressions.length > 0) { - emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); - pendingExpressions = []; - } - pendingExpressions.push(ts.visitNode(elem, visitor, ts.isExpression)); - } - } - return factory.inlineExpressions(pendingExpressions); - } /** * Visits a logical binary expression containing `yield`. * @@ -92276,6 +89951,38 @@ var ts; markLabel(resultLabel); return resultLocal; } + /** + * Visits a comma expression containing `yield`. + * + * @param node The node to visit. + */ + function visitCommaExpression(node) { + // [source] + // x = a(), yield, b(); + // + // [intermediate] + // a(); + // .yield resumeLabel + // .mark resumeLabel + // x = %sent%, b(); + var pendingExpressions = []; + visit(node.left); + visit(node.right); + return factory.inlineExpressions(pendingExpressions); + function visit(node) { + if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { + visit(node.left); + visit(node.right); + } + else { + if (containsYield(node) && pendingExpressions.length > 0) { + emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); + pendingExpressions = []; + } + pendingExpressions.push(ts.visitNode(node, visitor, ts.isExpression)); + } + } + } /** * Visits a conditional expression containing `yield`. * @@ -92519,35 +90226,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 230 /* Block */: + case 227 /* Block */: return transformAndEmitBlock(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return transformAndEmitIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return transformAndEmitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return transformAndEmitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return transformAndEmitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -92977,7 +90684,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 285 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 282 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -92990,7 +90697,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -94151,11 +91858,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(213 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(211 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(212 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(294 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -94206,10 +91913,7 @@ var ts; ts.append(statements, createUnderscoreUnderscoreESModule()); } if (ts.length(currentModuleInfo.exportedNames)) { - var chunkSize = 50; - for (var i = 0; i < currentModuleInfo.exportedNames.length; i += chunkSize) { - ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames.slice(i, i + chunkSize), function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero()))); - } + ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames, function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero()))); } ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); @@ -94483,23 +92187,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 338 /* MergeDeclarationMarker */: + case 333 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 339 /* EndOfDeclarationMarker */: + case 334 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -94526,24 +92230,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -94878,11 +92582,9 @@ var ts; else if (node.exportClause) { var statements = []; // export * as ns from "mod"; - // export * as default from "mod"; statements.push(ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(createExportExpression(factory.cloneNode(node.exportClause.name), getHelperExpressionForExport(node, moduleKind !== ts.ModuleKind.AMD ? createRequireCall(node) : - ts.isExportNamespaceAsDefaultDeclaration(node) ? generatedName : - factory.createIdentifier(ts.idText(node.exportClause.name))))), node), node)); + factory.createIdentifier(ts.idText(node.exportClause.name))))), node), node)); return ts.singleOrMany(statements); } else { @@ -94975,7 +92677,6 @@ var ts; var expressions; if (ts.hasSyntacticModifier(node, 1 /* Export */)) { var modifiers = void 0; - var removeCommentsOnExpressions = false; // If we're exporting these variables, then these just become assignments to 'exports.x'. for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var variable = _a[_i]; @@ -94986,28 +92687,14 @@ var ts; variables = ts.append(variables, variable); } else if (variable.initializer) { - if (!ts.isBindingPattern(variable.name) && (ts.isArrowFunction(variable.initializer) || ts.isFunctionExpression(variable.initializer) || ts.isClassExpression(variable.initializer))) { - var expression = factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), variable.name), - /*location*/ variable.name), factory.createIdentifier(ts.getTextOfIdentifierOrLiteral(variable.name))); - var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, moduleExpressionElementVisitor)); - variables = ts.append(variables, updatedVariable); - expressions = ts.append(expressions, expression); - removeCommentsOnExpressions = true; - } - else { - expressions = ts.append(expressions, transformInitializedVariable(variable)); - } + expressions = ts.append(expressions, transformInitializedVariable(variable)); } } if (variables) { statements = ts.append(statements, factory.updateVariableStatement(node, modifiers, factory.updateVariableDeclarationList(node.declarationList, variables))); } if (expressions) { - var statement = ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node); - if (removeCommentsOnExpressions) { - ts.removeAllComments(statement); - } - statements = ts.append(statements, statement); + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node)); } } else { @@ -95068,7 +92755,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 229 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -95123,10 +92810,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -95339,7 +93026,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -95403,10 +93090,10 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return substituteBinaryExpression(node); - case 215 /* PostfixUnaryExpression */: - case 214 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -95425,9 +93112,9 @@ var ts; } return node; } - if (!(ts.isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !ts.isLocalName(node)) { + if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 297 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 294 /* SourceFile */) { return ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.cloneNode(node)), /*location*/ node); } @@ -95502,7 +93189,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 215 /* PostfixUnaryExpression */ + var expression = node.kind === 212 /* PostfixUnaryExpression */ ? ts.setTextRange(factory.createBinaryExpression(node.operand, factory.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), factory.createNumericLiteral(1)), /*location*/ node) : node; @@ -95554,12 +93241,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(226 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(213 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(211 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(212 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(223 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(294 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -95783,7 +93470,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 267 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 264 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -95873,19 +93560,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(factory, entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(factory.createExpressionStatement(factory.createAssignment(importVariableName, parameterName))); break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -95944,13 +93631,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -96130,7 +93817,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 297 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 294 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -96194,7 +93881,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 229 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasSyntacticModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -96256,10 +93943,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -96439,43 +94126,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitWhileStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return visitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitCaseBlock(node); - case 284 /* CaseClause */: + case 281 /* CaseClause */: return visitCaseClause(node); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return visitDefaultClause(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return visitTryStatement(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); - case 230 /* Block */: + case 227 /* Block */: return visitBlock(node); - case 338 /* MergeDeclarationMarker */: + case 333 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 339 /* EndOfDeclarationMarker */: + case 334 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -96722,7 +94409,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 297 /* SourceFile */; + return container !== undefined && container.kind === 294 /* SourceFile */; } else { return false; @@ -96755,7 +94442,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -96805,7 +94492,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -96841,12 +94528,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return substituteBinaryExpression(node); - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -96939,14 +94626,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 215 /* PostfixUnaryExpression */ + var expression = node.kind === 212 /* PostfixUnaryExpression */ ? ts.setTextRange(factory.createPrefixUnaryExpression(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 215 /* PostfixUnaryExpression */) { + if (node.kind === 212 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? factory.createSubtract(preventSubstitution(expression), factory.createNumericLiteral(1)) : factory.createAdd(preventSubstitution(expression), factory.createNumericLiteral(1)); @@ -96974,7 +94661,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 297 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 294 /* SourceFile */) { exportedNames = ts.append(exportedNames, factory.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -97014,7 +94701,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(297 /* SourceFile */); + context.enableEmitNotification(294 /* SourceFile */); context.enableSubstitution(78 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(context, transformSourceFile); @@ -97046,12 +94733,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -97078,7 +94765,7 @@ var ts; /*isTypeOnly*/ false, /*name*/ undefined, factory.createNamespaceImport(synthName)), node.moduleSpecifier); ts.setOriginalNode(importDecl, node.exportClause); - var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration( + var exportDecl = factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, factory.createNamedExports([factory.createExportSpecifier(synthName, oldIdentifier)])); @@ -97185,7 +94872,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97214,7 +94901,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97261,7 +94948,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97270,8 +94957,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 163 /* PropertyDeclaration */ || node.kind === 201 /* PropertyAccessExpression */ || node.kind === 162 /* PropertySignature */ || - (node.kind === 160 /* Parameter */ && ts.hasSyntacticModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 162 /* PropertyDeclaration */ || node.kind === 198 /* PropertyAccessExpression */ || node.kind === 161 /* PropertySignature */ || + (node.kind === 159 /* Parameter */ && ts.hasSyntacticModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasSyntacticModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -97280,7 +94967,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */ || node.kind === 160 /* Parameter */) { + else if (node.parent.kind === 249 /* ClassDeclaration */ || node.kind === 159 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97305,7 +94992,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 168 /* SetAccessor */) { + if (node.kind === 167 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasSyntacticModifier(node, 32 /* Static */)) { @@ -97344,26 +95031,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -97371,7 +95058,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -97385,7 +95072,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -97410,30 +95097,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 170 /* ConstructSignature */: - case 175 /* ConstructorType */: + case 169 /* ConstructSignature */: + case 174 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 169 /* CallSignature */: + case 168 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -97441,7 +95128,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97454,15 +95141,15 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 251 /* FunctionDeclaration */: - case 174 /* FunctionType */: + case 248 /* FunctionDeclaration */: + case 173 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 168 /* SetAccessor */: - case 167 /* GetAccessor */: + case 167 /* SetAccessor */: + case 166 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97476,39 +95163,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 190 /* MappedType */: + case 189 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 249 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174 /* FunctionType */: - case 251 /* FunctionDeclaration */: + case 173 /* FunctionType */: + case 248 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -97572,7 +95259,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 160 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 159 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -97627,7 +95314,6 @@ var ts; reportCyclicStructureError: reportCyclicStructureError, reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression, reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError, - reportTruncationError: reportTruncationError, moduleResolverHost: host, trackReferencedAmbientModule: trackReferencedAmbientModule, trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode, @@ -97727,11 +95413,6 @@ var ts; context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier)); } } - function reportTruncationError() { - if (errorNameNode) { - context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed)); - } - } function reportNonlocalAugmentation(containingFile, parentSymbol, symbol) { var primaryDeclaration = ts.find(parentSymbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === containingFile; }); var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; }); @@ -97753,10 +95434,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 297 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 294 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 298 /* Bundle */) { + if (node.kind === 295 /* Bundle */) { isBundledEmit = true; refs = new ts.Map(); libs = new ts.Map(); @@ -97786,7 +95467,7 @@ var ts; var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return factory.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 300 /* InputFiles */) { + if (prepend.kind === 297 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -97927,7 +95608,7 @@ var ts; return name; } else { - if (name.kind === 197 /* ArrayBindingPattern */) { + if (name.kind === 194 /* ArrayBindingPattern */) { return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -97935,7 +95616,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 222 /* OmittedExpression */) { + if (elem.kind === 219 /* OmittedExpression */) { return elem; } return factory.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -97973,7 +95654,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 160 /* Parameter */ && + var shouldUseResolverType = node.kind === 159 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -97982,7 +95663,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : factory.createKeywordTypeNode(128 /* AnyKeyword */); } - if (node.kind === 168 /* SetAccessor */) { + if (node.kind === 167 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return factory.createKeywordTypeNode(128 /* AnyKeyword */); @@ -97993,12 +95674,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 160 /* Parameter */ - || node.kind === 163 /* PropertyDeclaration */ - || node.kind === 162 /* PropertySignature */) { + if (node.kind === 159 /* Parameter */ + || node.kind === 162 /* PropertyDeclaration */ + || node.kind === 161 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -98015,20 +95696,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: return false; } return false; @@ -98109,7 +95790,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 256 /* ModuleDeclaration */ && parent.kind !== 195 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 253 /* ModuleDeclaration */ && parent.kind !== 192 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -98129,7 +95810,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 272 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 269 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return factory.updateImportEqualsDeclaration(decl, @@ -98156,7 +95837,7 @@ var ts; return visibleDefaultBinding && factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, /*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 260 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -98251,7 +95932,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 177 /* TypeLiteral */ || input.kind === 190 /* MappedType */) && input.parent.kind !== 254 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 176 /* TypeLiteral */ || input.kind === 189 /* MappedType */) && input.parent.kind !== 251 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasEffectiveModifier(input, 8 /* Private */)) { @@ -98272,21 +95953,21 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 223 /* ExpressionWithTypeArguments */: { + case 220 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments)); } - case 173 /* TypeReference */: { + case 172 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory.updateTypeReferenceNode(node, node.typeName, node.typeArguments)); } - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return cleanup(factory.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 166 /* Constructor */: { + case 165 /* Constructor */: { // A constructor declaration may not have a type annotation var ctor = factory.createConstructorDeclaration( /*decorators*/ undefined, @@ -98294,7 +95975,7 @@ var ts; /*body*/ undefined); return cleanup(ctor); } - case 165 /* MethodDeclaration */: { + case 164 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98304,7 +95985,7 @@ var ts; /*body*/ undefined); return cleanup(sig); } - case 167 /* GetAccessor */: { + case 166 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98313,7 +95994,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 168 /* SetAccessor */: { + case 167 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98321,31 +96002,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updatePropertyDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type))); - case 164 /* MethodSignature */: { + case 163 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updateMethodSignature(input, ensureModifiers(input), input.name, input.questionToken, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 169 /* CallSignature */: { + case 168 /* CallSignature */: { return cleanup(factory.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 171 /* IndexSignature */: { + case 170 /* IndexSignature */: { return cleanup(factory.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || factory.createKeywordTypeNode(128 /* AnyKeyword */))); } - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -98353,13 +96034,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(factory.updateVariableDeclaration(input, input.name, /*exclamationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 159 /* TypeParameter */: { + case 158 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(factory.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 184 /* ConditionalType */: { + case 183 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -98371,13 +96052,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(factory.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 174 /* FunctionType */: { + case 173 /* FunctionType */: { return cleanup(factory.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 175 /* ConstructorType */: { + case 174 /* ConstructorType */: { return cleanup(factory.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 195 /* ImportType */: { + case 192 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -98409,7 +96090,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 165 /* MethodDeclaration */ && ts.hasEffectiveModifier(node.parent, 8 /* Private */); + return node.parent.kind === 164 /* MethodDeclaration */ && ts.hasEffectiveModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -98419,7 +96100,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 267 /* ExportDeclaration */: { + case 264 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -98429,7 +96110,7 @@ var ts; return factory.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier)); } - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -98468,10 +96149,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 260 /* ImportEqualsDeclaration */: { + case 257 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 261 /* ImportDeclaration */: { + case 258 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -98492,14 +96173,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 254 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 251 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(factory.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 253 /* InterfaceDeclaration */: { + case 250 /* InterfaceDeclaration */: { return cleanup(factory.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 251 /* FunctionDeclaration */: { + case 248 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(factory.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -98566,10 +96247,10 @@ var ts; return clean; } } - case 256 /* ModuleDeclaration */: { + case 253 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 257 /* ModuleBlock */) { + if (inner && inner.kind === 254 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -98612,7 +96293,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 252 /* ClassDeclaration */: { + case 249 /* ClassDeclaration */: { var modifiers = factory.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -98693,10 +96374,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 232 /* VariableStatement */: { + case 229 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 255 /* EnumDeclaration */: { + case 252 /* EnumDeclaration */: { return cleanup(factory.updateEnumDeclaration(input, /*decorators*/ undefined, factory.createNodeArray(ensureModifiers(input)), input.name, factory.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -98715,7 +96396,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 256 /* ModuleDeclaration */) { + if (input.kind === 253 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -98736,7 +96417,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 222 /* OmittedExpression */) { + if (e.kind === 219 /* OmittedExpression */) { return; } if (e.name) { @@ -98786,7 +96467,7 @@ var ts; function ensureModifierFlags(node) { var mask = 11263 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 297 /* SourceFile */; + var parentIsFile = node.parent.kind === 294 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -98815,7 +96496,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 253 /* InterfaceDeclaration */) { + if (node.kind === 250 /* InterfaceDeclaration */) { return true; } return false; @@ -98840,7 +96521,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 167 /* GetAccessor */ + return accessor.kind === 166 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -98849,52 +96530,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return !ts.hasEffectiveModifier(node, 8 /* Private */); - case 160 /* Parameter */: - case 249 /* VariableDeclaration */: + case 159 /* Parameter */: + case 246 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 232 /* VariableStatement */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 229 /* VariableStatement */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 170 /* ConstructSignature */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 171 /* IndexSignature */: - case 249 /* VariableDeclaration */: - case 159 /* TypeParameter */: - case 223 /* ExpressionWithTypeArguments */: - case 173 /* TypeReference */: - case 184 /* ConditionalType */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 195 /* ImportType */: + case 169 /* ConstructSignature */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 170 /* IndexSignature */: + case 246 /* VariableDeclaration */: + case 158 /* TypeParameter */: + case 220 /* ExpressionWithTypeArguments */: + case 172 /* TypeReference */: + case 183 /* ConditionalType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 192 /* ImportType */: return true; } return false; @@ -98938,13 +96619,14 @@ var ts; function getScriptTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles) { if (emitOnlyDtsFiles) return ts.emptyArray; + var jsx = compilerOptions.jsx; var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var transformers = []; ts.addRange(transformers, customTransformers && ts.map(customTransformers.before, wrapScriptTransformerFactory)); transformers.push(ts.transformTypeScript); transformers.push(ts.transformClassFields); - if (ts.getJSXTransformEnabled(compilerOptions)) { + if (jsx === 2 /* React */) { transformers.push(ts.transformJsx); } if (languageVersion < 99 /* ESNext */) { @@ -99026,7 +96708,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, factory, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(341 /* Count */); + var enabledSyntaxKindFeatures = new Array(336 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentStatements; @@ -99099,13 +96781,7 @@ var ts; // prevent modification of transformation hooks. state = 1 /* Initialized */; // Transform each node. - var transformed = []; - for (var _a = 0, nodes_3 = nodes; _a < nodes_3.length; _a++) { - var node = nodes_3[_a]; - ts.tracing.push("emit" /* Emit */, "transformNodes", node.kind === 297 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); - transformed.push((allowDtsFiles ? transformation : transformRoot)(node)); - ts.tracing.pop(); - } + var transformed = ts.map(nodes, allowDtsFiles ? transformation : transformRoot); // prevent modification of the lexical environment. state = 2 /* Completed */; ts.performance.mark("afterTransform"); @@ -99341,8 +97017,8 @@ var ts; function dispose() { if (state < 3 /* Disposed */) { // Clean up emit nodes on parse tree - for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { - var node = nodes_4[_i]; + for (var _i = 0, nodes_3 = nodes; _i < nodes_3.length; _i++) { + var node = nodes_3[_i]; ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); } // Release references to external entries for GC purposes. @@ -99474,7 +97150,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 298 /* Bundle */) { + if (sourceFile.kind === 295 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -99670,15 +97346,9 @@ var ts; sourceFiles: sourceFileOrBundle.sourceFiles.map(function (file) { return relativeToBuildInfo(ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory())); }) }; } - ts.tracing.push("emit" /* Emit */, "emitJsFileOrBundle", { jsFilePath: jsFilePath }); emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo); - ts.tracing.pop(); - ts.tracing.push("emit" /* Emit */, "emitDeclarationFileOrBundle", { declarationFilePath: declarationFilePath }); emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo); - ts.tracing.pop(); - ts.tracing.push("emit" /* Emit */, "emitBuildInfo", { buildInfoPath: buildInfoPath }); emitBuildInfo(bundleBuildInfo, buildInfoPath); - ts.tracing.pop(); if (!emitSkipped && emittedFilesList) { if (!emitOnlyDtsFiles) { if (jsFilePath) { @@ -99810,7 +97480,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 297 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 294 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -99833,8 +97503,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 298 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 297 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 295 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 294 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -99875,7 +97545,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 297 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 294 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -99919,16 +97589,16 @@ var ts; if (ts.getRootLength(sourceMapDir) === 0) { // The relative paths are relative to the common directory sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - return encodeURI(ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath + return ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath ts.combinePaths(sourceMapDir, sourceMapFile), // this is where user expects to see sourceMap host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ true)); + /*isAbsolutePathAnUrl*/ true); } else { - return encodeURI(ts.combinePaths(sourceMapDir, sourceMapFile)); + return ts.combinePaths(sourceMapDir, sourceMapFile); } } - return encodeURI(sourceMapFile); + return sourceMapFile; } } ts.emitFiles = emitFiles; @@ -100143,8 +97813,6 @@ var ts; var sourceMapGenerator; var sourceMapSource; var sourceMapSourceIndex = -1; - var mostRecentlyAddedSourceMapSource; - var mostRecentlyAddedSourceMapSourceIndex = -1; // Comments var containerPos = -1; var containerEnd = -1; @@ -100183,9 +97851,9 @@ var ts; break; } switch (node.kind) { - case 297 /* SourceFile */: return printFile(node); - case 298 /* Bundle */: return printBundle(node); - case 299 /* UnparsedSource */: return printUnparsedSource(node); + case 294 /* SourceFile */: return printFile(node); + case 295 /* Bundle */: return printBundle(node); + case 296 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -100441,12 +98109,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 297 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 294 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 297 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 294 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -100488,15 +98156,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 299 /* UnparsedSource */: - case 293 /* UnparsedPrepend */: + case 296 /* UnparsedSource */: + case 290 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 292 /* UnparsedPrologue */: + case 289 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 294 /* UnparsedText */: - case 295 /* UnparsedInternalText */: + case 291 /* UnparsedText */: + case 292 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 296 /* UnparsedSyntheticReference */: + case 293 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 78 /* Identifier */: @@ -100506,270 +98174,262 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return emitQualifiedName(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return emitTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return emitParameter(node); - case 161 /* Decorator */: + case 160 /* Decorator */: return emitDecorator(node); // Type members - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return emitPropertySignature(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 164 /* MethodSignature */: + case 163 /* MethodSignature */: return emitMethodSignature(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return emitConstructor(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return emitAccessorDeclaration(node); - case 169 /* CallSignature */: + case 168 /* CallSignature */: return emitCallSignature(node); - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return emitConstructSignature(node); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return emitIndexSignature(node); - case 194 /* TemplateLiteralTypeSpan */: - return emitTemplateTypeSpan(node); // Types - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return emitTypePredicate(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return emitTypeReference(node); - case 174 /* FunctionType */: + case 173 /* FunctionType */: return emitFunctionType(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 175 /* ConstructorType */: + case 174 /* ConstructorType */: return emitConstructorType(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return emitTypeQuery(node); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return emitTypeLiteral(node); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return emitArrayType(node); - case 179 /* TupleType */: + case 178 /* TupleType */: return emitTupleType(node); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return emitOptionalType(node); - case 182 /* UnionType */: + case 181 /* UnionType */: return emitUnionType(node); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return emitIntersectionType(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return emitConditionalType(node); - case 185 /* InferType */: + case 184 /* InferType */: return emitInferType(node); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return emitParenthesizedType(node); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 187 /* ThisType */: + case 186 /* ThisType */: return emitThisType(); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return emitTypeOperator(node); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return emitMappedType(node); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return emitLiteralType(node); - case 193 /* TemplateLiteralType */: - return emitTemplateType(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return emitImportTypeNode(node); - case 303 /* JSDocAllType */: + case 299 /* JSDocAllType */: writePunctuation("*"); return; - case 304 /* JSDocUnknownType */: + case 300 /* JSDocUnknownType */: writePunctuation("?"); return; - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 306 /* JSDocNonNullableType */: + case 302 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 181 /* RestType */: - case 309 /* JSDocVariadicType */: + case 180 /* RestType */: + case 305 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return emitNamedTupleMember(node); // Binding patterns - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return emitBindingElement(node); // Misc - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return emitTemplateSpan(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 230 /* Block */: + case 227 /* Block */: return emitBlock(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return emitVariableStatement(node); - case 231 /* EmptyStatement */: + case 228 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return emitExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return emitIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return emitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return emitWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return emitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return emitForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return emitForOfStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return emitContinueStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return emitBreakStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return emitReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return emitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return emitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return emitLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return emitThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return emitTryStatement(node); - case 248 /* DebuggerStatement */: + case 245 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return emitClassDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return emitModuleBlock(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return emitCaseBlock(node); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return emitImportDeclaration(node); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return emitImportClause(node); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return emitNamespaceImport(node); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return emitNamespaceExport(node); - case 264 /* NamedImports */: + case 261 /* NamedImports */: return emitNamedImports(node); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return emitImportSpecifier(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return emitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return emitExportDeclaration(node); - case 268 /* NamedExports */: + case 265 /* NamedExports */: return emitNamedExports(node); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return emitExportSpecifier(node); - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return; // Module references - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 275 /* JsxOpeningElement */: - case 278 /* JsxOpeningFragment */: + case 272 /* JsxOpeningElement */: + case 275 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 276 /* JsxClosingElement */: - case 279 /* JsxClosingFragment */: + case 273 /* JsxClosingElement */: + case 276 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return emitJsxAttribute(node); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return emitJsxAttributes(node); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 284 /* CaseClause */: + case 281 /* CaseClause */: return emitCaseClause(node); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return emitDefaultClause(node); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return emitHeritageClause(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 291 /* EnumMember */: + case 288 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 328 /* JSDocThisTag */: - case 325 /* JSDocEnumTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 324 /* JSDocThisTag */: + case 321 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 316 /* JSDocImplementsTag */: - case 315 /* JSDocAugmentsTag */: + case 312 /* JSDocImplementsTag */: + case 311 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 324 /* JSDocCallbackTag */: + case 320 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 313 /* JSDocSignature */: + case 309 /* JSDocSignature */: return emitJSDocSignature(node); - case 312 /* JSDocTypeLiteral */: + case 308 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 319 /* JSDocClassTag */: - case 314 /* JSDocTag */: + case 315 /* JSDocClassTag */: + case 310 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 332 /* JSDocSeeTag */: - return emitJSDocSeeTag(node); - case 302 /* JSDocNameReference */: - return emitJSDocNameReference(node); - case 311 /* JSDocComment */: + case 307 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -100806,71 +98466,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return emitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return emitNewExpression(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return emitFunctionExpression(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return emitArrowFunction(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return emitDeleteExpression(node); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return emitVoidExpression(node); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return emitAwaitExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return emitBinaryExpression(node); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return emitConditionalExpression(node); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return emitTemplateExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return emitYieldExpression(node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return emitSpreadExpression(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return emitClassExpression(node); - case 222 /* OmittedExpression */: + case 219 /* OmittedExpression */: return; - case 224 /* AsExpression */: + case 221 /* AsExpression */: return emitAsExpression(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return emitNonNullExpression(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 273 /* JsxElement */: + case 270 /* JsxElement */: return emitJsxElement(node); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return emitCommaList(node); } } @@ -100912,7 +98572,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 298 /* Bundle */ ? node : undefined; + var bundle = node.kind === 295 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -101012,7 +98672,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 294 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 291 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -101085,7 +98745,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 308 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 304 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -101147,7 +98807,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 167 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 166 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -101181,10 +98841,6 @@ var ts; emitTypeAnnotation(node.type); writeTrailingSemicolon(); } - function emitTemplateTypeSpan(node) { - emit(node.type); - emit(node.literal); - } function emitSemicolonClassElement() { writeTrailingSemicolon(); } @@ -101343,19 +98999,13 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 142 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 141 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); } writePunctuation("["); pipelineEmit(3 /* MappedTypeParameter */, node.typeParameter); - if (node.nameType) { - writeSpace(); - writeKeyword("as"); - writeSpace(); - emit(node.nameType); - } writePunctuation("]"); if (node.questionToken) { emit(node.questionToken); @@ -101379,10 +99029,6 @@ var ts; function emitLiteralType(node) { emitExpression(node.literal); } - function emitTemplateType(node) { - emit(node.head); - emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); - } function emitImportTypeNode(node) { if (node.isTypeOf) { writeKeyword("typeof"); @@ -101581,7 +99227,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 214 /* PrefixUnaryExpression */ + return operand.kind === 211 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -101769,7 +99415,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node, node.thenStatement, node.elseStatement); emitTokenWithComment(90 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 234 /* IfStatement */) { + if (node.elseStatement.kind === 231 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -101832,7 +99478,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(156 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(155 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -101840,7 +99486,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 250 /* VariableDeclarationList */) { + if (node.kind === 247 /* VariableDeclarationList */) { emit(node); } else { @@ -102136,7 +99782,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 256 /* ModuleDeclaration */) { + while (body.kind === 253 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -102181,7 +99827,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(153 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(152 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -102189,7 +99835,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(149 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(148 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -102229,7 +99875,7 @@ var ts; var nextPos = emitTokenWithComment(92 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(149 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(148 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -102241,7 +99887,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(153 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(152 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -102252,7 +99898,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(126 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(140 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(139 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -102475,7 +100121,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 329 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 325 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -102491,17 +100137,6 @@ var ts; emitJSDocTypeExpression(tag.typeExpression); emitJSDocComment(tag.comment); } - function emitJSDocSeeTag(tag) { - emitJSDocTagName(tag.tagName); - emit(tag.name); - emitJSDocComment(tag.comment); - } - function emitJSDocNameReference(node) { - writeSpace(); - writePunctuation("{"); - emit(node.name); - writePunctuation("}"); - } function emitJSDocHeritageTag(tag) { emitJSDocTagName(tag.tagName); writeSpace(); @@ -102520,7 +100155,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 301 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 298 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -102539,7 +100174,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 312 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 308 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -102673,8 +100308,8 @@ var ts; bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName }); writeLine(); } - for (var _d = 0, types_23 = types; _d < types_23.length; _d++) { - var directive = types_23[_d]; + for (var _d = 0, types_22 = types; _d < types_22.length; _d++) { + var directive = types_22[_d]; var pos = writer.getTextPos(); writeComment("/// "); if (bundleFileInfo) @@ -103403,7 +101038,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 207 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 204 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -103436,10 +101071,7 @@ var ts; return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape); } } - var flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) - | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) - | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0); - return ts.getLiteralText(node, currentSourceFile, flags); + return ts.getLiteralText(node, currentSourceFile, neverAsciiEscape, jsxAttributeEscape); } /** * Push a new name generation scope. @@ -103472,84 +101104,84 @@ var ts; if (!node) return; switch (node.kind) { - case 230 /* Block */: + case 227 /* Block */: ts.forEach(node.statements, generateNames); break; - case 245 /* LabeledStatement */: - case 243 /* WithStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 242 /* LabeledStatement */: + case 240 /* WithStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: generateNames(node.statement); break; - case 234 /* IfStatement */: + case 231 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 287 /* CatchClause */: + case 284 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: generateNames(node.declarationList); break; - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: generateNames(node.importClause); break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -103558,12 +101190,12 @@ var ts; if (!node) return; switch (node.kind) { - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -103745,23 +101377,23 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 266 /* ExportAssignment */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 263 /* ExportAssignment */: return generateNameForExportDefault(); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return generateNameForClassExpression(); - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -103809,7 +101441,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 335 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 330 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -103833,7 +101465,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 250 /* VariableDeclarationList */) { + if (node.kind === 247 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -103926,12 +101558,7 @@ var ts; function emitLeadingComments(pos, isEmittedNode) { hasWrittenComment = false; if (isEmittedNode) { - if (pos === 0 && (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.isDeclarationFile)) { - forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment); - } - else { - forEachLeadingCommentToEmit(pos, emitLeadingComment); - } + forEachLeadingCommentToEmit(pos, emitLeadingComment); } else if (pos === 0) { // If the node will not be emitted in JS, remove all the comments(normal, pinned and ///) associated with the node, @@ -103950,11 +101577,6 @@ var ts; emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); } } - function emitNonTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { - if (!isTripleSlashComment(commentPos, commentEnd)) { - emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); - } - } function shouldWriteComment(text, pos) { if (printerOptions.onlyPrintJsDocStyle) { return (ts.isJSDocLikeText(text, pos) || ts.isPinnedComment(text, pos)); @@ -104102,7 +101724,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 335 /* NotEmittedStatement */ + if (node.kind !== 330 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -104115,7 +101737,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 335 /* NotEmittedStatement */ + if (node.kind !== 330 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -104148,10 +101770,9 @@ var ts; function emitSourcePos(source, pos) { if (source !== sourceMapSource) { var savedSourceMapSource = sourceMapSource; - var savedSourceMapSourceIndex = sourceMapSourceIndex; setSourceMapSource(source); emitPos(pos); - resetSourceMapSource(savedSourceMapSource, savedSourceMapSourceIndex); + setSourceMapSource(savedSourceMapSource); } else { emitPos(pos); @@ -104190,12 +101811,6 @@ var ts; return; } sourceMapSource = source; - if (source === mostRecentlyAddedSourceMapSource) { - // Fast path for when the new source map is the most recently added, in which case - // we use its captured index without going through the source map generator. - sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex; - return; - } if (isJsonSourceMapSource(source)) { return; } @@ -104203,12 +101818,6 @@ var ts; if (printerOptions.inlineSources) { sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text); } - mostRecentlyAddedSourceMapSource = source; - mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex; - } - function resetSourceMapSource(source, sourceIndex) { - sourceMapSource = source; - sourceMapSourceIndex = sourceIndex; } function isJsonSourceMapSource(sourceFile) { return ts.fileExtensionIs(sourceFile.fileName, ".json" /* Json */); @@ -104707,7 +102316,6 @@ var ts; if (system === void 0) { system = ts.sys; } var existingDirectories = new ts.Map(); var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames); - var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash; function getSourceFile(fileName, languageVersion, onError) { var text; try { @@ -104752,14 +102360,14 @@ var ts; } var outputFingerprints; function writeFileWorker(fileName, data, writeByteOrderMark) { - if (!ts.isWatchSet(options) || !system.getModifiedTime) { + if (!ts.isWatchSet(options) || !system.createHash || !system.getModifiedTime) { system.writeFile(fileName, data, writeByteOrderMark); return; } if (!outputFingerprints) { outputFingerprints = new ts.Map(); } - var hash = computeHash(data); + var hash = system.createHash(data); var mtimeBefore = system.getModifiedTime(fileName); if (mtimeBefore) { var fingerprint = outputFingerprints.get(fileName); @@ -105112,35 +102720,6 @@ var ts; } ts.loadWithLocalCache = loadWithLocalCache; /* @internal */ - function forEachResolvedProjectReference(resolvedProjectReferences, cb) { - return forEachProjectReference(/*projectReferences*/ undefined, resolvedProjectReferences, function (resolvedRef, parent) { return resolvedRef && cb(resolvedRef, parent); }); - } - ts.forEachResolvedProjectReference = forEachResolvedProjectReference; - function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { - var seenResolvedRefs; - return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined); - function worker(projectReferences, resolvedProjectReferences, parent) { - // Visit project references first - if (cbRef) { - var result = cbRef(projectReferences, parent); - if (result) { - return result; - } - } - return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) { - if (resolvedRef && (seenResolvedRefs === null || seenResolvedRefs === void 0 ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) { - // ignore recursives - return undefined; - } - var result = cbResolvedRef(resolvedRef, parent, index); - if (result || !resolvedRef) - return result; - (seenResolvedRefs || (seenResolvedRefs = new ts.Set())).add(resolvedRef.sourceFile.path); - return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef); - }); - } - } - /* @internal */ ts.inferredTypesContainingFile = "__inferred type names__.ts"; /** * Determines if program structure is upto date or needs to be recreated @@ -105276,8 +102855,6 @@ var ts; var modulesWithElidedImports = new ts.Map(); // Track source files that are source files found by searching under node_modules, as these shouldn't be compiled. var sourceFilesFoundSearchingNodeModules = new ts.Map(); - var tracingData = ["program" /* Program */, "createProgram"]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeProgram"); var host = createProgramOptions.host || createCompilerHost(options); var configParsingHost = parseConfigHostFromCompilerHostLike(host); @@ -105353,16 +102930,12 @@ var ts; getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, forEachResolvedProjectReference: forEachResolvedProjectReference }), onProgramCreateComplete = _c.onProgramCreateComplete, fileExists = _c.fileExists, directoryExists = _c.directoryExists; - ts.tracing.push("program" /* Program */, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram }); var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); - ts.tracing.pop(); // We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks // `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`. - var structureIsReused; - ts.tracing.push("program" /* Program */, "tryReuseStructureFromOldProgram", {}); - structureIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const - ts.tracing.pop(); - if (structureIsReused !== 2 /* Completely */) { + var structuralIsReused; + structuralIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const + if (structuralIsReused !== 2 /* Completely */) { processingDefaultLibFiles = []; processingOtherFiles = []; if (projectReferences) { @@ -105399,13 +102972,10 @@ var ts; } } } - ts.tracing.push("program" /* Program */, "processRootFiles", { count: rootNames.length }); ts.forEach(rootNames, function (name) { return processRootFile(name, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false); }); - ts.tracing.pop(); // load type declarations specified via 'types' argument or implicitly from types/ and node_modules/@types folders var typeReferences = rootNames.length ? ts.getAutomaticTypeDirectiveNames(options, host) : ts.emptyArray; if (typeReferences.length) { - ts.tracing.push("program" /* Program */, "processTypeReferences", { count: typeReferences.length }); // This containingFilename needs to match with the one used in managed-side var containingDirectory = options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : host.getCurrentDirectory(); var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile); @@ -105413,7 +102983,6 @@ var ts; for (var i = 0; i < typeReferences.length; i++) { processTypeReferenceDirective(typeReferences[i], resolutions[i]); } - ts.tracing.pop(); } // Do not process the default library if: // - The '--noLib' flag is used. @@ -105454,8 +103023,8 @@ var ts; host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path)); } } - oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference) { - if (!getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) { + oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference, resolvedProjectReferencePath) { + if (resolvedProjectReference && !getResolvedProjectReferenceByPath(resolvedProjectReferencePath)) { host.onReleaseOldSourceFile(resolvedProjectReference.sourceFile, oldProgram.getCompilerOptions(), /*hasSourceFileByPath*/ false); } }); @@ -105475,7 +103044,6 @@ var ts; getOptionsDiagnostics: getOptionsDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getSemanticDiagnostics: getSemanticDiagnostics, - getCachedSemanticDiagnostics: getCachedSemanticDiagnostics, getSuggestionDiagnostics: getSuggestionDiagnostics, getDeclarationDiagnostics: getDeclarationDiagnostics, getBindAndCheckDiagnostics: getBindAndCheckDiagnostics, @@ -105489,7 +103057,6 @@ var ts; getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, - getTypeCatalog: function () { return getDiagnosticsProducingTypeChecker().getTypeCatalog(); }, getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); }, getInstantiationCount: function () { return getDiagnosticsProducingTypeChecker().getInstantiationCount(); }, getRelationCacheSizes: function () { return getDiagnosticsProducingTypeChecker().getRelationCacheSizes(); }, @@ -105518,73 +103085,26 @@ var ts; getSymlinkCache: getSymlinkCache, realpath: (_b = host.realpath) === null || _b === void 0 ? void 0 : _b.bind(host), useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, - structureIsReused: structureIsReused, }; onProgramCreateComplete(); verifyCompilerOptions(); ts.performance.mark("afterProgram"); ts.performance.measure("Program", "beforeProgram", "afterProgram"); - ts.tracing.end.apply(ts.tracing, tracingData); return program; - function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames) { - if (!moduleNames.length) - return ts.emptyArray; - var containingFileName = ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); - var redirectedReference = getRedirectReferenceForResolution(containingFile); - ts.tracing.push("program" /* Program */, "resolveModuleNamesWorker", { containingFileName: containingFileName }); + function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames, redirectedReference) { ts.performance.mark("beforeResolveModule"); - var result = actualResolveModuleNamesWorker(moduleNames, containingFileName, reusedNames, redirectedReference); + var result = actualResolveModuleNamesWorker(moduleNames, containingFile, reusedNames, redirectedReference); ts.performance.mark("afterResolveModule"); ts.performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule"); - ts.tracing.pop(); return result; } - function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile) { - if (!typeDirectiveNames.length) - return []; - var containingFileName = !ts.isString(containingFile) ? ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile; - var redirectedReference = !ts.isString(containingFile) ? getRedirectReferenceForResolution(containingFile) : undefined; - ts.tracing.push("program" /* Program */, "resolveTypeReferenceDirectiveNamesWorker", { containingFileName: containingFileName }); + function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, redirectedReference) { ts.performance.mark("beforeResolveTypeReference"); - var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference); + var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, redirectedReference); ts.performance.mark("afterResolveTypeReference"); ts.performance.measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference"); - ts.tracing.pop(); return result; } - function getRedirectReferenceForResolution(file) { - var redirect = getResolvedProjectReferenceToRedirect(file.originalFileName); - if (redirect || !ts.fileExtensionIs(file.originalFileName, ".d.ts" /* Dts */)) - return redirect; - // The originalFileName could not be actual source file name if file found was d.ts from referecned project - // So in this case try to look up if this is output from referenced project, if it is use the redirected project in that case - var resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.originalFileName, file.path); - if (resultFromDts) - return resultFromDts; - // If preserveSymlinks is true, module resolution wont jump the symlink - // but the resolved real path may be the .d.ts from project reference - // Note:: Currently we try the real path only if the - // file is from node_modules to avoid having to run real path on all file paths - if (!host.realpath || !options.preserveSymlinks || !ts.stringContains(file.originalFileName, ts.nodeModulesPathPart)) - return undefined; - var realDeclarationFileName = host.realpath(file.originalFileName); - var realDeclarationPath = toPath(realDeclarationFileName); - return realDeclarationPath === file.path ? undefined : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationFileName, realDeclarationPath); - } - function getRedirectReferenceForResolutionFromSourceOfProject(fileName, filePath) { - var source = getSourceOfProjectReferenceRedirect(fileName); - if (ts.isString(source)) - return getResolvedProjectReferenceToRedirect(source); - if (!source) - return undefined; - // Output of .d.ts file so return resolved ref that matches the out file name - return forEachResolvedProjectReference(function (resolvedRef) { - var out = ts.outFile(resolvedRef.commandLine.options); - if (!out) - return undefined; - return toPath(out) === filePath ? resolvedRef : undefined; - }); - } function compareDefaultLibFiles(a, b) { return ts.compareValues(getDefaultLibFilePriority(a), getDefaultLibFilePriority(b)); } @@ -105643,13 +103163,13 @@ var ts; } return classifiableNames; } - function resolveModuleNamesReusingOldState(moduleNames, file) { - if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) { + function resolveModuleNamesReusingOldState(moduleNames, containingFile, file) { + if (structuralIsReused === 0 /* Not */ && !file.ambientModuleNames.length) { // If the old program state does not permit reusing resolutions and `file` does not contain locally defined ambient modules, // the best we can do is fallback to the default logic. - return resolveModuleNamesWorker(moduleNames, file, /*reusedNames*/ undefined); + return resolveModuleNamesWorker(moduleNames, containingFile, /*reusedNames*/ undefined, getResolvedProjectReferenceToRedirect(file.originalFileName)); } - var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName); + var oldSourceFile = oldProgram && oldProgram.getSourceFile(containingFile); if (oldSourceFile !== file && file.resolvedModules) { // `file` was created for the new program. // @@ -105659,13 +103179,13 @@ var ts; // which per above occurred during the current program creation. // Since we assume the filesystem does not change during program creation, // it is safe to reuse resolutions from the earlier call. - var result_14 = []; + var result_12 = []; for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { var moduleName = moduleNames_1[_i]; var resolvedModule = file.resolvedModules.get(moduleName); - result_14.push(resolvedModule); + result_12.push(resolvedModule); } - return result_14; + return result_12; } // At this point, we know at least one of the following hold: // - file has local declarations for ambient modules @@ -105693,7 +103213,7 @@ var ts; var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName); if (oldResolvedModule) { if (ts.isTraceEnabled(options, host)) { - ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, containingFile); } (result || (result = new Array(moduleNames.length)))[i] = oldResolvedModule; (reusedNames || (reusedNames = [])).push(moduleName); @@ -105708,7 +103228,7 @@ var ts; if (ts.contains(file.ambientModuleNames, moduleName)) { resolvesToAmbientModuleInNonModifiedFile = true; if (ts.isTraceEnabled(options, host)) { - ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, containingFile); } } else { @@ -105723,7 +103243,7 @@ var ts; } } var resolutions = unknownModuleNames && unknownModuleNames.length - ? resolveModuleNamesWorker(unknownModuleNames, file, reusedNames) + ? resolveModuleNamesWorker(unknownModuleNames, containingFile, reusedNames, getResolvedProjectReferenceToRedirect(file.originalFileName)) : ts.emptyArray; // Combine results of resolutions and predicted results if (!result) { @@ -105771,7 +103291,7 @@ var ts; } } function canReuseProjectReferences() { - return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, parent, index) { + return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, index, parent) { var newRef = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; var newResolvedRef = parseProjectReferenceConfigFile(newRef); if (oldResolvedRef) { @@ -105797,19 +103317,19 @@ var ts; // if any of these properties has changed - structure cannot be reused var oldOptions = oldProgram.getCompilerOptions(); if (ts.changesAffectModuleResolution(oldOptions, options)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } // there is an old program, check if we can reuse its structure var oldRootNames = oldProgram.getRootFileNames(); if (!ts.arrayIsEqualTo(oldRootNames, rootNames)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (!ts.arrayIsEqualTo(options.types, oldOptions.types)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } // Check if any referenced project tsconfig files are different if (!canReuseProjectReferences()) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (projectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); @@ -105817,12 +103337,12 @@ var ts; // check if program source files has changed in the way that can affect structure of the program var newSourceFiles = []; var modifiedSourceFiles = []; - structureIsReused = 2 /* Completely */; + oldProgram.structureIsReused = 2 /* Completely */; // If the missing file paths are now present, it can change the progam structure, // and hence cant reuse the structure. // This is same as how we dont reuse the structure if one of the file from old program is now missing if (oldProgram.getMissingFilePaths().some(function (missingFilePath) { return host.fileExists(missingFilePath); })) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } var oldSourceFiles = oldProgram.getSourceFiles(); var SeenPackageName; @@ -105837,7 +103357,7 @@ var ts; ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, options.target, /*onError*/ undefined, shouldCreateNewSourceFile) : host.getSourceFile(oldSourceFile.fileName, options.target, /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217 if (!newSourceFile) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } ts.Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); var fileChanged = void 0; @@ -105846,7 +103366,7 @@ var ts; // This lets us know if the unredirected file has changed. If it has we should break the redirect. if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { // Underlying file has changed. Might not redirect anymore. Must rebuild program. - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } fileChanged = false; newSourceFile = oldSourceFile; // Use the redirect. @@ -105854,7 +103374,7 @@ var ts; else if (oldProgram.redirectTargetsMap.has(oldSourceFile.path)) { // If a redirected-to source file changes, the redirect may be broken. if (newSourceFile !== oldSourceFile) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } fileChanged = false; } @@ -105873,7 +103393,7 @@ var ts; var prevKind = seenPackageNames.get(packageName); var newKind = fileChanged ? 1 /* Modified */ : 0 /* Exists */; if ((prevKind !== undefined && newKind === 1 /* Modified */) || prevKind === 1 /* Modified */) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } seenPackageNames.set(packageName, newKind); } @@ -105881,50 +103401,50 @@ var ts; // The `newSourceFile` object was created for the new program. if (!ts.arrayIsEqualTo(oldSourceFile.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) { // 'lib' references has changed. Matches behavior in changesAffectModuleResolution - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { // value of no-default-lib has changed // this will affect if default library is injected into the list of files - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // check tripleslash references if (!ts.arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) { // tripleslash references has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // check imports and module augmentations collectExternalModuleReferences(newSourceFile); if (!ts.arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) { // imports has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { // moduleAugmentations has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if ((oldSourceFile.flags & 3145728 /* PermanentlySetIncrementalFlags */) !== (newSourceFile.flags & 3145728 /* PermanentlySetIncrementalFlags */)) { // dynamicImport has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { // 'types' references has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // tentatively approve the file modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); } else if (hasInvalidatedResolution(oldSourceFile.path)) { // 'module/types' references could have changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; // add file to the modified list so that we will resolve it later modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); } // if file has passed all checks it should be safe to reuse it newSourceFiles.push(newSourceFile); } - if (structureIsReused !== 2 /* Completely */) { - return structureIsReused; + if (oldProgram.structureIsReused !== 2 /* Completely */) { + return oldProgram.structureIsReused; } var modifiedFiles = modifiedSourceFiles.map(function (f) { return f.oldFile; }); for (var _b = 0, oldSourceFiles_3 = oldSourceFiles; _b < oldSourceFiles_3.length; _b++) { @@ -105939,35 +103459,38 @@ var ts; // try to verify results of module resolution for (var _e = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _e < modifiedSourceFiles_1.length; _e++) { var _f = modifiedSourceFiles_1[_e], oldSourceFile = _f.oldFile, newSourceFile = _f.newFile; + var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.originalFileName, currentDirectory); var moduleNames = getModuleNames(newSourceFile); - var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile); + var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile); // ensure that module resolution results are still correct var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo); if (resolutionsChanged) { - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; newSourceFile.resolvedModules = ts.zipToMap(moduleNames, resolutions); } else { newSourceFile.resolvedModules = oldSourceFile.resolvedModules; } - // We lower-case all type references because npm automatically lowercases all packages. See GH#9824. - var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); }); - var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile); - // ensure that types resolutions are still correct - var typeReferenceEesolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo); - if (typeReferenceEesolutionsChanged) { - structureIsReused = 1 /* SafeModules */; - newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, typeReferenceResolutions); - } - else { - newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; + if (resolveTypeReferenceDirectiveNamesWorker) { + // We lower-case all type references because npm automatically lowercases all packages. See GH#9824. + var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); }); + var resolutions_1 = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFilePath, getResolvedProjectReferenceToRedirect(newSourceFile.originalFileName)); + // ensure that types resolutions are still correct + var resolutionsChanged_1 = ts.hasChangesInResolutions(typesReferenceDirectives, resolutions_1, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo); + if (resolutionsChanged_1) { + oldProgram.structureIsReused = 1 /* SafeModules */; + newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, resolutions_1); + } + else { + newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; + } } } - if (structureIsReused !== 2 /* Completely */) { - return structureIsReused; + if (oldProgram.structureIsReused !== 2 /* Completely */) { + return oldProgram.structureIsReused; } if ((_a = host.hasChangedAutomaticTypeDirectiveNames) === null || _a === void 0 ? void 0 : _a.call(host)) { - return 1 /* SafeModules */; + return oldProgram.structureIsReused = 1 /* SafeModules */; } missingFilePaths = oldProgram.getMissingFilePaths(); refFileMap = oldProgram.getRefFileMap(); @@ -106001,7 +103524,7 @@ var ts; resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); sourceFileToPackageName = oldProgram.sourceFileToPackageName; redirectTargetsMap = oldProgram.redirectTargetsMap; - return 2 /* Completely */; + return oldProgram.structureIsReused = 2 /* Completely */; } function getEmitHost(writeFileCallback) { return { @@ -106041,8 +103564,6 @@ var ts; } function emitBuildInfo(writeFileCallback) { ts.Debug.assert(!ts.outFile(options)); - var tracingData = ["emit" /* Emit */, "emitBuildInfo"]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeEmit"); var emitResult = ts.emitFiles(ts.notImplementedResolver, getEmitHost(writeFileCallback), /*targetSourceFile*/ undefined, @@ -106051,7 +103572,6 @@ var ts; /*onlyBuildInfo*/ true); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); - ts.tracing.end.apply(ts.tracing, tracingData); return emitResult; } function getResolvedProjectReferences() { @@ -106097,11 +103617,7 @@ var ts; return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, /*produceDiagnostics:*/ false)); } function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit) { - var tracingData = ["emit" /* Emit */, "emit", { path: sourceFile === null || sourceFile === void 0 ? void 0 : sourceFile.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); - var result = runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); }); - ts.tracing.end.apply(ts.tracing, tracingData); - return result; + return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); }); } function isEmitBlocked(emitFileName) { return hasEmitBlockingDiagnostics.has(toPath(emitFileName)); @@ -106151,11 +103667,6 @@ var ts; function getSemanticDiagnostics(sourceFile, cancellationToken) { return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken); } - function getCachedSemanticDiagnostics(sourceFile) { - var _a; - return sourceFile - ? (_a = cachedBindAndCheckDiagnosticsForFile.perFile) === null || _a === void 0 ? void 0 : _a.get(sourceFile.path) : cachedBindAndCheckDiagnosticsForFile.allDiagnostics; - } function getBindAndCheckDiagnostics(sourceFile, cancellationToken) { return getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken); } @@ -106241,17 +103752,17 @@ var ts; sourceFile.scriptKind === 5 /* External */ || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; - return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); + return getMergedBindAndCheckDiagnostics(sourceFile, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); }); } - function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics) { + function getMergedBindAndCheckDiagnostics(sourceFile) { var _a; var allDiagnostics = []; - for (var _i = 2; _i < arguments.length; _i++) { - allDiagnostics[_i - 2] = arguments[_i]; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; } var flatDiagnostics = ts.flatten(allDiagnostics); - if (!includeBindAndCheckDiagnostics || !((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { return flatDiagnostics; } var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives; @@ -106312,22 +103823,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 249 /* VariableDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 246 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -106335,58 +103846,58 @@ var ts; } } switch (node.kind) { - case 262 /* ImportClause */: + case 259 /* ImportClause */: if (node.isTypeOnly) { - diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); + diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 116 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(117 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 256 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(140 /* NamespaceKeyword */) : ts.tokenToString(139 /* ModuleKeyword */); + case 253 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(139 /* NamespaceKeyword */) : ts.tokenToString(138 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(91 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 224 /* AsExpression */: + case 221 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -106395,29 +103906,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 232 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 229 /* VariableStatement */); return "skip"; } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -106429,19 +103940,19 @@ var ts; return "skip"; } break; - case 160 /* Parameter */: + case 159 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 223 /* ExpressionWithTypeArguments */: - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: - case 205 /* TaggedTemplateExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 220 /* ExpressionWithTypeArguments */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 202 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -106463,7 +103974,7 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 133 /* DeclareKeyword */: case 125 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); @@ -106524,7 +104035,9 @@ var ts; } var diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName); forEachResolvedProjectReference(function (resolvedRef) { - diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + if (resolvedRef) { + diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + } }); return diagnostics; } @@ -106545,18 +104058,6 @@ var ts; ? b.kind === 78 /* Identifier */ && a.escapedText === b.escapedText : b.kind === 10 /* StringLiteral */ && a.text === b.text; } - function createSyntheticImport(text, file) { - var externalHelpersModuleReference = ts.factory.createStringLiteral(text); - var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference); - ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */); - ts.setParent(externalHelpersModuleReference, importDecl); - ts.setParent(importDecl, file); - // explicitly unset the synthesized flag on these declarations so the checker API will answer questions about them - // (which is required to build the dependency graph for incremental emit) - externalHelpersModuleReference.flags &= ~8 /* Synthesized */; - importDecl.flags &= ~8 /* Synthesized */; - return externalHelpersModuleReference; - } function collectExternalModuleReferences(file) { if (file.imports) { return; @@ -106569,17 +104070,16 @@ var ts; var ambientModules; // If we are importing helpers, we need to add a synthetic reference to resolve the // helpers library. - if ((options.isolatedModules || isExternalModuleFile) + if (options.importHelpers + && (options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { - if (options.importHelpers) { - // synthesize 'import "tslib"' declaration - imports = [createSyntheticImport(ts.externalHelpersModuleNameText, file)]; - } - var jsxImport = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(options, file), options); - if (jsxImport) { - // synthesize `import "base/jsx-runtime"` declaration - (imports || (imports = [])).push(createSyntheticImport(jsxImport, file)); - } + // synthesize 'import "tslib"' declaration + var externalHelpersModuleReference = ts.factory.createStringLiteral(ts.externalHelpersModuleNameText); + var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference); + ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */); + ts.setParent(externalHelpersModuleReference, importDecl); + ts.setParent(importDecl, file); + imports = [externalHelpersModuleReference]; } for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; @@ -106763,16 +104263,6 @@ var ts; } // Get source file from normalized fileName function findSourceFile(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) { - ts.tracing.push("program" /* Program */, "findSourceFile", { - fileName: fileName, - isDefaultLib: isDefaultLib || undefined, - refKind: refFile ? ts.RefFileKind[refFile.kind] : undefined, - }); - var result = findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId); - ts.tracing.pop(); - return result; - } - function findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) { if (useSourceOfProjectReferenceRedirect) { var source = getSourceOfProjectReferenceRedirect(fileName); // If preserveSymlinks is true, module resolution wont jump the symlink @@ -106960,11 +104450,12 @@ var ts; function getResolvedProjectReferenceToRedirect(fileName) { if (mapFromFileToProjectReferenceRedirects === undefined) { mapFromFileToProjectReferenceRedirects = new ts.Map(); - forEachResolvedProjectReference(function (referencedProject) { + forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { // not input file from the referenced project, ignore - if (toPath(options.configFilePath) !== referencedProject.sourceFile.path) { + if (referencedProject && + toPath(options.configFilePath) !== referenceProjectPath) { referencedProject.commandLine.fileNames.forEach(function (f) { - return mapFromFileToProjectReferenceRedirects.set(toPath(f), referencedProject.sourceFile.path); + return mapFromFileToProjectReferenceRedirects.set(toPath(f), referenceProjectPath); }); } }); @@ -106973,7 +104464,11 @@ var ts; return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); } function forEachResolvedProjectReference(cb) { - return ts.forEachResolvedProjectReference(resolvedProjectReferences, cb); + return forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { + var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; + var resolvedRefPath = toPath(resolveProjectReferencePath(ref)); + return cb(resolvedRef, resolvedRefPath); + }); } function getSourceOfProjectReferenceRedirect(file) { if (!ts.isDeclarationFileName(file)) @@ -106981,19 +104476,21 @@ var ts; if (mapFromToProjectReferenceRedirectSource === undefined) { mapFromToProjectReferenceRedirectSource = new ts.Map(); forEachResolvedProjectReference(function (resolvedRef) { - var out = ts.outFile(resolvedRef.commandLine.options); - if (out) { - // Dont know which source file it means so return true? - var outputDts = ts.changeExtension(out, ".d.ts" /* Dts */); - mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), true); - } - else { - ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) { - if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { - var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames()); - mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName); - } - }); + if (resolvedRef) { + var out = ts.outFile(resolvedRef.commandLine.options); + if (out) { + // Dont know which source file it means so return true? + var outputDts = ts.changeExtension(out, ".d.ts" /* Dts */); + mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), true); + } + else { + ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) { + if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { + var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames()); + mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName); + } + }); + } } }); } @@ -107002,6 +104499,33 @@ var ts; function isSourceOfProjectReferenceRedirect(fileName) { return useSourceOfProjectReferenceRedirect && !!getResolvedProjectReferenceToRedirect(fileName); } + function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { + var seenResolvedRefs; + return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined, cbResolvedRef, cbRef); + function worker(projectReferences, resolvedProjectReferences, parent, cbResolvedRef, cbRef) { + // Visit project references first + if (cbRef) { + var result = cbRef(projectReferences, parent); + if (result) { + return result; + } + } + return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) { + if (ts.contains(seenResolvedRefs, resolvedRef)) { + // ignore recursives + return undefined; + } + var result = cbResolvedRef(resolvedRef, index, parent); + if (result) { + return result; + } + if (!resolvedRef) + return undefined; + (seenResolvedRefs || (seenResolvedRefs = [])).push(resolvedRef); + return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef, cbResolvedRef, cbRef); + }); + } + } function getResolvedProjectReferenceByPath(projectReferencePath) { if (!projectReferenceRedirects) { return undefined; @@ -107028,7 +104552,7 @@ var ts; if (!typeDirectives) { return; } - var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file); + var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file.originalFileName, getResolvedProjectReferenceToRedirect(file.originalFileName)); for (var i = 0; i < typeDirectives.length; i++) { var ref = file.typeReferenceDirectives[i]; var resolvedTypeReferenceDirective = resolutions[i]; @@ -107045,11 +104569,6 @@ var ts; } } function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, refFile) { - ts.tracing.push("program" /* Program */, "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolveModuleNamesReusingOldState, refKind: refFile === null || refFile === void 0 ? void 0 : refFile.kind, refPath: refFile === null || refFile === void 0 ? void 0 : refFile.file.path }); - processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, refFile); - ts.tracing.pop(); - } - function processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, refFile) { // If we already found this library as a primary reference - nothing to do var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective); if (previousResolution && previousResolution.primary) { @@ -107134,7 +104653,7 @@ var ts; if (file.imports.length || file.moduleAugmentations.length) { // Because global augmentation doesn't have string literal name, we can check for global augmentation as such. var moduleNames = getModuleNames(file); - var resolutions = resolveModuleNamesReusingOldState(moduleNames, file); + var resolutions = resolveModuleNamesReusingOldState(moduleNames, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory), file); ts.Debug.assert(resolutions.length === moduleNames.length); for (var i = 0; i < moduleNames.length; i++) { var resolution = resolutions[i]; @@ -107162,7 +104681,7 @@ var ts; && !options.noResolve && i < file.imports.length && !elideImport - && !(isJsFile && !ts.getAllowJSCompilerOption(options)) + && !(isJsFile && !options.allowJs) && (ts.isInJSFile(file.imports[i]) || !(file.imports[i].flags & 4194304 /* JSDoc */)); if (elideImport) { modulesWithElidedImports.set(file.path, true); @@ -107278,6 +104797,9 @@ var ts; createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap"); } } + if (options.paths && options.baseUrl === undefined) { + createDiagnosticForOptionName(ts.Diagnostics.Option_paths_cannot_be_used_without_specifying_baseUrl_option, "paths"); + } if (options.composite) { if (options.declaration === false) { createDiagnosticForOptionName(ts.Diagnostics.Composite_projects_may_not_disable_declaration_emit, "declaration"); @@ -107327,9 +104849,6 @@ var ts; if (!ts.hasZeroOrOneAsteriskCharacter(subst)) { createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character, subst, key); } - if (!options.baseUrl && !ts.pathIsRelative(subst) && !ts.pathIsAbsolute(subst)) { - createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash); - } } else { createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2, subst, key, typeOfSubst); @@ -107382,7 +104901,7 @@ var ts; var firstNonExternalModuleSourceFile = ts.find(files, function (f) { return !ts.isExternalModule(f) && !ts.isSourceFileJS(f) && !f.isDeclarationFile && f.scriptKind !== 6 /* JSON */; }); if (firstNonExternalModuleSourceFile) { var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); - programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts.getBaseFileName(firstNonExternalModuleSourceFile.fileName))); + programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.All_files_must_be_modules_when_the_isolatedModules_flag_is_provided)); } } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ES2015 */ && options.module === ts.ModuleKind.None) { @@ -107424,7 +104943,7 @@ var ts; if (options.useDefineForClassFields && languageVersion === 0 /* ES3 */) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, "useDefineForClassFields"); } - if (options.checkJs && !ts.getAllowJSCompilerOption(options)) { + if (options.checkJs && !options.allowJs) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); } if (options.emitDeclarationOnly) { @@ -107443,9 +104962,6 @@ var ts; if (options.reactNamespace) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "reactNamespace", "jsxFactory"); } - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFactory", ts.inverseJsxOptionMap.get("" + options.jsx)); - } if (!ts.parseIsolatedEntityName(options.jsxFactory, languageVersion)) { createOptionValueDiagnostic("jsxFactory", ts.Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFactory); } @@ -107457,23 +104973,10 @@ var ts; if (!options.jsxFactory) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "jsxFragmentFactory", "jsxFactory"); } - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFragmentFactory", ts.inverseJsxOptionMap.get("" + options.jsx)); - } if (!ts.parseIsolatedEntityName(options.jsxFragmentFactory, languageVersion)) { createOptionValueDiagnostic("jsxFragmentFactory", ts.Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFragmentFactory); } } - if (options.reactNamespace) { - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "reactNamespace", ts.inverseJsxOptionMap.get("" + options.jsx)); - } - } - if (options.jsxImportSource) { - if (options.jsx === 2 /* React */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxImportSource", ts.inverseJsxOptionMap.get("" + options.jsx)); - } - } // If the emit is enabled make sure that every output file is unique and not overwriting any of the input files if (!options.noEmit && !options.suppressOutputPathCheck) { var emitHost = getEmitHost(); @@ -107548,7 +105051,7 @@ var ts; } function verifyProjectReferences() { var buildInfoPath = !options.suppressOutputPathCheck ? ts.getTsBuildInfoEmitOutputFilePath(options) : undefined; - forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, parent, index) { + forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; var parentFile = parent && parent.sourceFile; if (!resolvedRef) { @@ -107743,6 +105246,8 @@ var ts; if (!setOfDeclarationDirectories) { setOfDeclarationDirectories = new ts.Set(); host.forEachResolvedProjectReference(function (ref) { + if (!ref) + return; var out = ts.outFile(ref.commandLine.options); if (out) { setOfDeclarationDirectories.add(ts.getDirectoryPath(host.toPath(out))); @@ -107975,7 +105480,7 @@ var ts; return options.jsx ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set; } function needAllowJs() { - return ts.getAllowJSCompilerOption(options) || !ts.getStrictOptionValue(options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; + return options.allowJs || !ts.getStrictOptionValue(options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; } function needResolveJsonModule() { return options.resolveJsonModule ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used; @@ -108129,7 +105634,7 @@ var ts; // Create the reference map, and set the file infos for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; - var version_2 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); + var version_1 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined; if (referencedMap) { var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName); @@ -108144,7 +105649,7 @@ var ts; } } } - fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) }); + fileInfos.set(sourceFile.resolvedPath, { version: version_1, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) }); } return { fileInfos: fileInfos, @@ -108246,7 +105751,7 @@ var ts; emitOutput_1.outputFiles.length > 0 ? emitOutput_1.outputFiles[0] : undefined; if (firstDts_1) { ts.Debug.assert(ts.fileExtensionIs(firstDts_1.name, ".d.ts" /* Dts */), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); }); - latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text); + latestSignature = computeHash(firstDts_1.text); if (exportedModulesMapCache && latestSignature !== prevSignature) { updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache); } @@ -108439,12 +105944,14 @@ var ts; if (!seenFileNamesMap.has(currentPath)) { var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); seenFileNamesMap.set(currentPath, currentSourceFile); - if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) { - queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath)); + if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) { // TODO: GH#18217 + queue.push.apply(// TODO: GH#18217 + queue, getReferencedByPaths(state, currentSourceFile.resolvedPath)); } } } // Return array of values that needs emit + // Return array of values that needs emit return ts.arrayFrom(ts.mapDefinedIterator(seenFileNamesMap.values(), function (value) { return value; })); } })(BuilderState = ts.BuilderState || (ts.BuilderState = {})); @@ -108565,7 +106072,7 @@ var ts; result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function (r) { return convertToDiagnosticRelatedInformation(r, newProgram, toPath); }) : - [] : + ts.emptyArray : undefined; return result; }); @@ -108757,10 +106264,10 @@ var ts; state.semanticDiagnosticsPerFile.delete(path); return !state.semanticDiagnosticsFromOldState.size; } - function isChangedSignature(state, path) { + function isChangedSignagure(state, path) { var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path); - var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature; - return newSignature !== oldSignature; + var oldSignagure = ts.Debug.checkDefined(state.fileInfos.get(path)).signature; + return newSignature !== oldSignagure; } /** * Iterate on referencing modules that export entities from affected file @@ -108771,7 +106278,7 @@ var ts; if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) { return; } - if (!isChangedSignature(state, affectedFile.resolvedPath)) + if (!isChangedSignagure(state, affectedFile.resolvedPath)) return; // Since isolated modules dont change js files, files affected by change in signature is itself // But we need to cleanup semantic diagnostics and queue dts emit for affected files @@ -108784,7 +106291,7 @@ var ts; if (!seenFileNamesMap.has(currentPath)) { seenFileNamesMap.set(currentPath, true); var result = fn(state, currentPath); - if (result && isChangedSignature(state, currentPath)) { + if (result && isChangedSignagure(state, currentPath)) { var currentSourceFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(currentPath); queue.push.apply(queue, ts.BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath)); } @@ -109034,7 +106541,7 @@ var ts; result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function (r) { return convertToReusableDiagnosticRelatedInformation(r, relativeToBuildInfo); }) : - [] : + ts.emptyArray : undefined; return result; }); @@ -109096,7 +106603,7 @@ var ts; /** * Computing hash to for signature verification */ - var computeHash = ts.maybeBind(host, host.createHash); + var computeHash = host.createHash || ts.generateDjb2Hash; var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState); var backupState; newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); }; @@ -109192,54 +106699,31 @@ var ts; * in that order would be used to write the files */ function emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { - var restorePendingEmitOnHandlingNoEmitSuccess = false; - var savedAffectedFilesPendingEmit; - var savedAffectedFilesPendingEmitKind; - var savedAffectedFilesPendingEmitIndex; - // Backup and restore affected pendings emit state for non emit Builder if noEmitOnError is enabled and emitBuildInfo could be written in case there are errors - // This ensures pending files to emit is updated in tsbuildinfo - // Note that when there are no errors, emit proceeds as if everything is emitted as it is callers reponsibility to write the files to disk if at all (because its builder that doesnt track files to emit) - if (kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram && - !targetSourceFile && - !ts.outFile(state.compilerOptions) && - !state.compilerOptions.noEmit && - state.compilerOptions.noEmitOnError) { - restorePendingEmitOnHandlingNoEmitSuccess = true; - savedAffectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice(); - savedAffectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind); - savedAffectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex; - } if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile); - } - var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken); - if (result) - return result; - if (restorePendingEmitOnHandlingNoEmitSuccess) { - state.affectedFilesPendingEmit = savedAffectedFilesPendingEmit; - state.affectedFilesPendingEmitKind = savedAffectedFilesPendingEmitKind; - state.affectedFilesPendingEmitIndex = savedAffectedFilesPendingEmitIndex; - } - // Emit only affected files if using builder for emit - if (!targetSourceFile && kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { - // Emit and report any errors we ran into. - var sourceMaps = []; - var emitSkipped = false; - var diagnostics = void 0; - var emittedFiles = []; - var affectedEmitResult = void 0; - while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { - emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; - diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); - emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); - sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken); + if (result) + return result; + if (!targetSourceFile) { + // Emit and report any errors we ran into. + var sourceMaps = []; + var emitSkipped = false; + var diagnostics = void 0; + var emittedFiles = []; + var affectedEmitResult = void 0; + while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { + emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; + diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); + emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); + sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + } + return { + emitSkipped: emitSkipped, + diagnostics: diagnostics || ts.emptyArray, + emittedFiles: emittedFiles, + sourceMaps: sourceMaps + }; } - return { - emitSkipped: emitSkipped, - diagnostics: diagnostics || ts.emptyArray, - emittedFiles: emittedFiles, - sourceMaps: sourceMaps - }; } return ts.Debug.checkDefined(state.program).emit(targetSourceFile, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers); } @@ -109259,8 +106743,7 @@ var ts; return toAffectedFileResult(state, state.program.getSemanticDiagnostics(/*targetSourceFile*/ undefined, cancellationToken), affected); } // Add file to affected file pending emit to handle for later emit time - // Apart for emit builder do this for tsbuildinfo, do this for non emit builder when noEmit is set as tsbuildinfo is written and reused between emitters - if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram || state.compilerOptions.noEmit || state.compilerOptions.noEmitOnError) { + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { addToAffectedFilesPendingEmit(state, affected.resolvedPath, 1 /* Full */); } // Get diagnostics for the affected file if its not ignored @@ -109974,8 +107457,8 @@ var ts; if (!resolutions) return false; var invalidated = false; - for (var _i = 0, resolutions_1 = resolutions; _i < resolutions_1.length; _i++) { - var resolution = resolutions_1[_i]; + for (var _i = 0, resolutions_2 = resolutions; _i < resolutions_2.length; _i++) { + var resolution = resolutions_2[_i]; if (resolution.isInvalidated || !canInvalidate(resolution)) continue; resolution.isInvalidated = invalidated = true; @@ -110187,14 +107670,14 @@ var ts; function getNodeModulesPackageName(compilerOptions, importingSourceFileName, nodeModulesFileName, host) { var info = getInfo(importingSourceFileName, host); var modulePaths = getAllModulePaths(importingSourceFileName, nodeModulesFileName, host); - return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions, /*packageNameOnly*/ true); }); + return ts.firstDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions, /*packageNameOnly*/ true); }); } moduleSpecifiers.getNodeModulesPackageName = getNodeModulesPackageName; function getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, preferences) { var info = getInfo(importingSourceFileName, host); var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host); - return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); }) || - getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences); + return ts.firstDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions); }) || + getLocalModuleSpecifier(toFileName, info, compilerOptions, preferences); } /** Returns an import for each symlink and for the realpath. */ function getModuleSpecifiers(moduleSymbol, compilerOptions, importingSourceFile, host, userPreferences) { @@ -110205,46 +107688,8 @@ var ts; var moduleSourceFile = ts.getSourceFileOfNode(moduleSymbol.valueDeclaration || ts.getNonAugmentationDeclaration(moduleSymbol)); var modulePaths = getAllModulePaths(importingSourceFile.path, moduleSourceFile.originalFileName, host); var preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile); - var importedFileIsInNodeModules = ts.some(modulePaths, function (p) { return p.isInNodeModules; }); - // Module specifier priority: - // 1. "Bare package specifiers" (e.g. "@foo/bar") resulting from a path through node_modules to a package.json's "types" entry - // 2. Specifiers generated using "paths" from tsconfig - // 3. Non-relative specfiers resulting from a path through node_modules (e.g. "@foo/bar/path/to/file") - // 4. Relative paths - var nodeModulesSpecifiers; - var pathsSpecifiers; - var relativeSpecifiers; - for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) { - var modulePath = modulePaths_1[_i]; - var specifier = tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); - nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier); - if (specifier && modulePath.isRedirect) { - // If we got a specifier for a redirect, it was a bare package specifier (e.g. "@foo/bar", - // not "@foo/bar/path/to/file"). No other specifier will be this good, so stop looking. - return nodeModulesSpecifiers; - } - if (!specifier && !modulePath.isRedirect) { - var local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, preferences); - if (ts.pathIsBareSpecifier(local)) { - pathsSpecifiers = ts.append(pathsSpecifiers, local); - } - else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) { - // Why this extra conditional, not just an `else`? If some path to the file contained - // 'node_modules', but we can't create a non-relative specifier (e.g. "@foo/bar/path/to/file"), - // that means we had to go through a *sibling's* node_modules, not one we can access directly. - // If some path to the file was in node_modules but another was not, this likely indicates that - // we have a monorepo structure with symlinks. In this case, the non-node_modules path is - // probably the realpath, e.g. "../bar/path/to/file", but a relative path to another package - // in a monorepo is probably not portable. So, the module specifier we actually go with will be - // the relative path through node_modules, so that the declaration emitter can produce a - // portability error. (See declarationEmitReexportedSymlinkReference3) - relativeSpecifiers = ts.append(relativeSpecifiers, local); - } - } - } - return (pathsSpecifiers === null || pathsSpecifiers === void 0 ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : - (nodeModulesSpecifiers === null || nodeModulesSpecifiers === void 0 ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : - ts.Debug.checkDefined(relativeSpecifiers); + var global = ts.mapDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions); }); + return global.length ? global : modulePaths.map(function (moduleFileName) { return getLocalModuleSpecifier(moduleFileName, info, compilerOptions, preferences); }); } moduleSpecifiers.getModuleSpecifiers = getModuleSpecifiers; // importingSourceFileName is separate because getEditsForFileRename may need to specify an updated path @@ -110253,26 +107698,22 @@ var ts; var sourceDirectory = ts.getDirectoryPath(importingSourceFileName); return { getCanonicalFileName: getCanonicalFileName, sourceDirectory: sourceDirectory }; } - function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, host, _b) { + function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, _b) { var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory; var ending = _b.ending, relativePreference = _b.relativePreference; var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs; var relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) || removeExtensionAndIndexPostFix(ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions); - if (!baseUrl && !paths || relativePreference === 0 /* Relative */) { + if (!baseUrl || relativePreference === 0 /* Relative */) { return relativePath; } - var baseDirectory = ts.getPathsBasePath(compilerOptions, host) || baseUrl; - var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseDirectory, getCanonicalFileName); + var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); if (!relativeToBaseUrl) { return relativePath; } var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions); var fromPaths = paths && tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); - var nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths; - if (!nonRelative) { - return relativePath; - } + var nonRelative = fromPaths === undefined ? importRelativeToBaseUrl : fromPaths; if (relativePreference === 1 /* NonRelative */) { return nonRelative; } @@ -110301,8 +107742,8 @@ var ts; var match = str.match(/\//g); return match ? match.length : 0; } - function comparePathsByRedirectAndNumberOfDirectorySeparators(a, b) { - return ts.compareBooleans(b.isRedirect, a.isRedirect) || ts.compareValues(numberOfDirectorySeparators(a.path), numberOfDirectorySeparators(b.path)); + function comparePathsByNumberOfDirectorySeparators(a, b) { + return ts.compareValues(numberOfDirectorySeparators(a), numberOfDirectorySeparators(b)); } function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) { var getCanonicalFileName = ts.hostGetCanonicalFileName(host); @@ -110312,36 +107753,34 @@ var ts; var importedFileNames = __spreadArrays((referenceRedirect ? [referenceRedirect] : ts.emptyArray), [importedFileName], redirects); var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); }); if (!preferSymlinks) { - var result_15 = ts.forEach(targets, function (p) { return cb(p, referenceRedirect === p); }); - if (result_15) - return result_15; + var result_13 = ts.forEach(targets, cb); + if (result_13) + return result_13; } var links = host.getSymlinkCache ? host.getSymlinkCache() : ts.discoverProbableSymlinks(host.getSourceFiles(), getCanonicalFileName, cwd); var symlinkedDirectories = links.getSymlinkedDirectories(); - var useCaseSensitiveFileNames = !host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames(); + var compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive; var result = symlinkedDirectories && ts.forEachEntry(symlinkedDirectories, function (resolved, path) { if (resolved === false) return undefined; if (ts.startsWithDirectory(importingFileName, resolved.realPath, getCanonicalFileName)) { return undefined; // Don't want to a package to globally import from itself } - return ts.forEach(targets, function (target) { - if (!ts.containsPath(resolved.real, target, !useCaseSensitiveFileNames)) { - return; - } - var relative = ts.getRelativePathFromDirectory(resolved.real, target, getCanonicalFileName); - var option = ts.resolvePath(path, relative); - if (!host.fileExists || host.fileExists(option)) { - var result_16 = cb(option, target === referenceRedirect); - if (result_16) - return result_16; - } - }); + var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.real.length), resolved.real) === 0 /* EqualTo */; }); + if (target === undefined) + return undefined; + var relative = ts.getRelativePathFromDirectory(resolved.real, target, getCanonicalFileName); + var option = ts.resolvePath(path, relative); + if (!host.fileExists || host.fileExists(option)) { + var result_14 = cb(option); + if (result_14) + return result_14; + } }); return result || - (preferSymlinks ? ts.forEach(targets, function (p) { return cb(p, p === referenceRedirect); }) : undefined); + (preferSymlinks ? ts.forEach(targets, cb) : undefined); } moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule; /** @@ -110354,27 +107793,28 @@ var ts; var allFileNames = new ts.Map(); var importedFileFromNodeModules = false; forEachFileNameOfModule(importingFileName, importedFileName, host, - /*preferSymlinks*/ true, function (path, isRedirect) { - var isInNodeModules = ts.pathContainsNodeModules(path); - allFileNames.set(path, { path: getCanonicalFileName(path), isRedirect: isRedirect, isInNodeModules: isInNodeModules }); - importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules; - // don't return value, so we collect everything + /*preferSymlinks*/ true, function (path) { + // dont return value, so we collect everything + allFileNames.set(path, getCanonicalFileName(path)); + importedFileFromNodeModules = importedFileFromNodeModules || ts.pathContainsNodeModules(path); }); // Sort by paths closest to importing file Name directory var sortedPaths = []; - var _loop_24 = function (directory) { + var _loop_23 = function (directory) { var directoryStart = ts.ensureTrailingDirectorySeparator(directory); var pathsInDirectory; - allFileNames.forEach(function (_a, fileName) { - var path = _a.path, isRedirect = _a.isRedirect, isInNodeModules = _a.isInNodeModules; - if (ts.startsWith(path, directoryStart)) { - (pathsInDirectory || (pathsInDirectory = [])).push({ path: fileName, isRedirect: isRedirect, isInNodeModules: isInNodeModules }); + allFileNames.forEach(function (canonicalFileName, fileName) { + if (ts.startsWith(canonicalFileName, directoryStart)) { + // If the importedFile is from node modules, use only paths in node_modules folder as option + if (!importedFileFromNodeModules || ts.pathContainsNodeModules(fileName)) { + (pathsInDirectory || (pathsInDirectory = [])).push(fileName); + } allFileNames.delete(fileName); } }); if (pathsInDirectory) { if (pathsInDirectory.length > 1) { - pathsInDirectory.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + pathsInDirectory.sort(comparePathsByNumberOfDirectorySeparators); } sortedPaths.push.apply(sortedPaths, pathsInDirectory); } @@ -110386,7 +107826,7 @@ var ts; }; var out_directory_1; for (var directory = ts.getDirectoryPath(ts.toPath(importingFileName, cwd, getCanonicalFileName)); allFileNames.size !== 0;) { - var state_8 = _loop_24(directory); + var state_8 = _loop_23(directory); directory = out_directory_1; if (state_8 === "break") break; @@ -110394,7 +107834,7 @@ var ts; if (allFileNames.size) { var remainingPaths = ts.arrayFrom(allFileNames.values()); if (remainingPaths.length > 1) - remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + remainingPaths.sort(comparePathsByNumberOfDirectorySeparators); sortedPaths.push.apply(sortedPaths, remainingPaths); } return sortedPaths; @@ -110439,43 +107879,37 @@ var ts; ? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions) : ts.removeFileExtension(relativePath); } - function tryGetModuleNameAsNodeModule(_a, _b, host, options, packageNameOnly) { - var path = _a.path, isRedirect = _a.isRedirect; - var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory; + function tryGetModuleNameAsNodeModule(moduleFileName, _a, host, options, packageNameOnly) { + var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory; if (!host.fileExists || !host.readFile) { return undefined; } - var parts = getNodeModulePathParts(path); + var parts = getNodeModulePathParts(moduleFileName); if (!parts) { return undefined; } // Simplify the full file path to something that can be resolved by Node. - var moduleSpecifier = path; - var isPackageRootPath = false; + var moduleSpecifier = moduleFileName; if (!packageNameOnly) { var packageRootIndex = parts.packageRootIndex; var moduleFileNameForExtensionless = void 0; while (true) { // If the module could be imported by a directory name, use that directory's name - var _c = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _c.moduleFileToTry, packageRootPath = _c.packageRootPath; + var _b = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _b.moduleFileToTry, packageRootPath = _b.packageRootPath; if (packageRootPath) { moduleSpecifier = packageRootPath; - isPackageRootPath = true; break; } if (!moduleFileNameForExtensionless) moduleFileNameForExtensionless = moduleFileToTry; // try with next level of directory - packageRootIndex = path.indexOf(ts.directorySeparator, packageRootIndex + 1); + packageRootIndex = moduleFileName.indexOf(ts.directorySeparator, packageRootIndex + 1); if (packageRootIndex === -1) { moduleSpecifier = getExtensionlessFileName(moduleFileNameForExtensionless); break; } } } - if (isRedirect && !isPackageRootPath) { - return undefined; - } var globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); // Get a path that's relative to node_modules or the importing file's path // if node_modules folder is in this folder or any of its parent folders, no need to keep it. @@ -110489,16 +107923,16 @@ var ts; // For classic resolution, only allow importing from node_modules/@types, not other node_modules return ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs && packageName === nodeModulesDirectoryName ? undefined : packageName; function tryDirectoryWithPackageJson(packageRootIndex) { - var packageRootPath = path.substring(0, packageRootIndex); + var packageRootPath = moduleFileName.substring(0, packageRootIndex); var packageJsonPath = ts.combinePaths(packageRootPath, "package.json"); - var moduleFileToTry = path; + var moduleFileToTry = moduleFileName; if (host.fileExists(packageJsonPath)) { var packageJsonContent = JSON.parse(host.readFile(packageJsonPath)); var versionPaths = packageJsonContent.typesVersions ? ts.getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions) : undefined; if (versionPaths) { - var subModuleName = path.slice(packageRootPath.length + 1); + var subModuleName = moduleFileName.slice(packageRootPath.length + 1); var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(subModuleName), removeExtensionAndIndexPostFix(subModuleName, 0 /* Minimal */, options), versionPaths.paths); if (fromPaths !== undefined) { moduleFileToTry = ts.combinePaths(packageRootPath, fromPaths); @@ -110902,7 +108336,7 @@ var ts; ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost; function setGetSourceFileAsHashVersioned(compilerHost, host) { var originalGetSourceFile = compilerHost.getSourceFile; - var computeHash = ts.maybeBind(host, host.createHash) || ts.generateDjb2Hash; + var computeHash = host.createHash || ts.generateDjb2Hash; compilerHost.getSourceFile = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -110910,7 +108344,7 @@ var ts; } var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args)); if (result) { - result.version = computeHash(result.text); + result.version = computeHash.call(host, result.text); } return result; }; @@ -111429,7 +108863,7 @@ var ts; } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); - var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions); + var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost); if (ts.updateErrorForNoInputFiles(result, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) { hasChangedConfigFileParsingErrors = true; } @@ -111515,7 +108949,6 @@ var ts; fileOrDirectoryPath: fileOrDirectoryPath, configFileName: configFileName, configFileSpecs: configFileSpecs, - extraFileExtensions: extraFileExtensions, options: compilerOptions, program: getCurrentBuilderProgram(), currentDirectory: currentDirectory, @@ -113104,7 +110537,7 @@ var ts; function nowString() { // E.g. "12:34:56.789" var d = new Date(); - return ts.padLeft(d.getHours().toString(), 2, "0") + ":" + ts.padLeft(d.getMinutes().toString(), 2, "0") + ":" + ts.padLeft(d.getSeconds().toString(), 2, "0") + "." + ts.padLeft(d.getMilliseconds().toString(), 3, "0"); + return d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + "." + d.getMilliseconds(); } server.nowString = nowString; })(server = ts.server || (ts.server = {})); @@ -113214,9 +110647,7 @@ var ts; var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); getTypingNamesFromPackagesFolder(nodeModulesPath, filesToWatch); }); - if (!typeAcquisition.disableFilenameBasedTypeAcquisition) { - getTypingNamesFromSourceFileNames(fileNames); - } + getTypingNamesFromSourceFileNames(fileNames); // add typings for unresolved imports if (unresolvedImports) { var module_1 = ts.deduplicate(unresolvedImports.map(nonRelativeModuleNameForTypingCache), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); @@ -113477,11 +110908,6 @@ var ts; })(LanguageServiceMode = ts.LanguageServiceMode || (ts.LanguageServiceMode = {})); /* @internal */ ts.emptyOptions = {}; - var SemanticClassificationFormat; - (function (SemanticClassificationFormat) { - SemanticClassificationFormat["Original"] = "original"; - SemanticClassificationFormat["TwentyTwenty"] = "2020"; - })(SemanticClassificationFormat = ts.SemanticClassificationFormat || (ts.SemanticClassificationFormat = {})); var HighlightSpanKind; (function (HighlightSpanKind) { HighlightSpanKind["none"] = "none"; @@ -113755,37 +111181,37 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ts.isInJSFile(node) && ts.getJSDocEnumTag(node) ? 7 /* All */ : 1 /* Value */; - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 287 /* CatchClause */: - case 280 /* JsxAttribute */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 284 /* CatchClause */: + case 277 /* JsxAttribute */: return 1 /* Value */; - case 159 /* TypeParameter */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 177 /* TypeLiteral */: + case 158 /* TypeParameter */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 176 /* TypeLiteral */: return 2 /* Type */; - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 291 /* EnumMember */: - case 252 /* ClassDeclaration */: + case 288 /* EnumMember */: + case 249 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -113795,16 +111221,16 @@ var ts; else { return 4 /* Namespace */; } - case 255 /* EnumDeclaration */: - case 264 /* NamedImports */: - case 265 /* ImportSpecifier */: - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 252 /* EnumDeclaration */: + case 261 /* NamedImports */: + case 262 /* ImportSpecifier */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; @@ -113812,13 +111238,13 @@ var ts; ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { node = getAdjustedReferenceLocation(node); - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 266 /* ExportAssignment */ - || node.parent.kind === 272 /* ExternalModuleReference */ - || node.parent.kind === 265 /* ImportSpecifier */ - || node.parent.kind === 262 /* ImportClause */ + else if (node.parent.kind === 263 /* ExportAssignment */ + || node.parent.kind === 269 /* ExternalModuleReference */ + || node.parent.kind === 262 /* ImportSpecifier */ + || node.parent.kind === 259 /* ImportClause */ || ts.isImportEqualsDeclaration(node.parent) && node === node.parent.name) { return 7 /* All */; } @@ -113828,9 +111254,6 @@ var ts; else if (ts.isDeclarationName(node)) { return getMeaningFromDeclaration(node.parent); } - else if (ts.isEntityName(node) && ts.isJSDocNameReference(node.parent)) { - return 7 /* All */; - } else if (isTypeReference(node)) { return 2 /* Type */; } @@ -113854,11 +111277,11 @@ var ts; // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - var name = node.kind === 157 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; - return name && name.parent.kind === 260 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; + var name = node.kind === 156 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 257 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 157 /* QualifiedName */) { + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -113870,27 +111293,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 157 /* QualifiedName */) { - while (root.parent && root.parent.kind === 157 /* QualifiedName */) { + if (root.parent.kind === 156 /* QualifiedName */) { + while (root.parent && root.parent.kind === 156 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 173 /* TypeReference */ && !isLastClause; + return root.parent.kind === 172 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 201 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 201 /* PropertyAccessExpression */) { + if (root.parent.kind === 198 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 198 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 223 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 286 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 220 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 283 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 252 /* ClassDeclaration */ && root.parent.parent.token === 116 /* ImplementsKeyword */) || - (decl.kind === 253 /* InterfaceDeclaration */ && root.parent.parent.token === 93 /* ExtendsKeyword */); + return (decl.kind === 249 /* ClassDeclaration */ && root.parent.parent.token === 116 /* ImplementsKeyword */) || + (decl.kind === 250 /* InterfaceDeclaration */ && root.parent.parent.token === 93 /* ExtendsKeyword */); } return false; } @@ -113901,15 +111324,15 @@ var ts; switch (node.kind) { case 107 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 187 /* ThisType */: + case 186 /* ThisType */: return true; } switch (node.parent.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return true; - case 195 /* ImportType */: + case 192 /* ImportType */: return !node.parent.isTypeOf; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; @@ -113976,7 +111399,7 @@ var ts; ts.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 245 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 242 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -114037,22 +111460,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 288 /* PropertyAssignment */: - case 291 /* EnumMember */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 256 /* ModuleDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 285 /* PropertyAssignment */: + case 288 /* EnumMember */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 253 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return true; - case 191 /* LiteralType */: - return node.parent.parent.kind === 189 /* IndexedAccessType */; + case 190 /* LiteralType */: + return node.parent.parent.kind === 188 /* IndexedAccessType */; default: return false; } @@ -114076,17 +111499,17 @@ var ts; return undefined; } switch (node.kind) { - case 297 /* SourceFile */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 256 /* ModuleDeclaration */: + case 294 /* SourceFile */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: return node; } } @@ -114094,54 +111517,54 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return "class" /* classElement */; - case 253 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 254 /* TypeAliasDeclaration */: - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: + case 250 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 251 /* TypeAliasDeclaration */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 255 /* EnumDeclaration */: return "enum" /* enumElement */; - case 249 /* VariableDeclaration */: + case 252 /* EnumDeclaration */: return "enum" /* enumElement */; + case 246 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 209 /* ArrowFunction */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return "function" /* functionElement */; - case 167 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 168 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 166 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 167 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: var initializer = node.initializer; return ts.isFunctionLike(initializer) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 289 /* ShorthandPropertyAssignment */: - case 290 /* SpreadAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 286 /* ShorthandPropertyAssignment */: + case 287 /* SpreadAssignment */: return "property" /* memberVariableElement */; - case 171 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 170 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 169 /* CallSignature */: return "call" /* callSignatureElement */; - case 166 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 159 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 291 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 160 /* Parameter */: return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 260 /* ImportEqualsDeclaration */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: - case 263 /* NamespaceImport */: - case 269 /* NamespaceExport */: + case 170 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 169 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 168 /* CallSignature */: return "call" /* callSignatureElement */; + case 165 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 158 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 288 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 159 /* Parameter */: return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 257 /* ImportEqualsDeclaration */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: + case 260 /* NamespaceImport */: + case 266 /* NamespaceExport */: return "alias" /* alias */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var kind = ts.getAssignmentDeclarationKind(node); var right = node.right; switch (kind) { @@ -114170,7 +111593,7 @@ var ts; } case 78 /* Identifier */: return ts.isImportClause(node.parent) ? "alias" /* alias */ : "" /* unknown */; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: var scriptKind = getNodeKind(node.expression); // If the expression didn't come back with something (like it does for an identifiers) return scriptKind === "" /* unknown */ ? "const" /* constElement */ : scriptKind; @@ -114193,7 +111616,7 @@ var ts; return true; case 78 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 160 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 159 /* Parameter */; default: return false; } @@ -114258,42 +111681,42 @@ var ts; return false; } switch (n.kind) { - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 200 /* ObjectLiteralExpression */: - case 196 /* ObjectBindingPattern */: - case 177 /* TypeLiteral */: - case 230 /* Block */: - case 257 /* ModuleBlock */: - case 258 /* CaseBlock */: - case 264 /* NamedImports */: - case 268 /* NamedExports */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 197 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 176 /* TypeLiteral */: + case 227 /* Block */: + case 254 /* ModuleBlock */: + case 255 /* CaseBlock */: + case 261 /* NamedImports */: + case 265 /* NamedExports */: return nodeEndsWith(n, 19 /* CloseBraceToken */, sourceFile); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 204 /* NewExpression */: + case 201 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 203 /* CallExpression */: - case 207 /* ParenthesizedExpression */: - case 186 /* ParenthesizedType */: + case 200 /* CallExpression */: + case 204 /* ParenthesizedExpression */: + case 185 /* ParenthesizedType */: return nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 170 /* ConstructSignature */: - case 169 /* CallSignature */: - case 209 /* ArrowFunction */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 169 /* ConstructSignature */: + case 168 /* CallSignature */: + case 206 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -114303,65 +111726,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 21 /* CloseParenToken */, sourceFile); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return !!n.body && isCompletedNode(n.body, sourceFile); - case 234 /* IfStatement */: + case 231 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 26 /* SemicolonToken */, sourceFile); - case 199 /* ArrayLiteralExpression */: - case 197 /* ArrayBindingPattern */: - case 202 /* ElementAccessExpression */: - case 158 /* ComputedPropertyName */: - case 179 /* TupleType */: + case 196 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 199 /* ElementAccessExpression */: + case 157 /* ComputedPropertyName */: + case 178 /* TupleType */: return nodeEndsWith(n, 23 /* CloseBracketToken */, sourceFile); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 23 /* CloseBracketToken */, sourceFile); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 236 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 233 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 235 /* DoStatement */: + case 232 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 114 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 21 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 211 /* TypeOfExpression */: - case 210 /* DeleteExpression */: - case 212 /* VoidExpression */: - case 219 /* YieldExpression */: - case 220 /* SpreadElement */: + case 208 /* TypeOfExpression */: + case 207 /* DeleteExpression */: + case 209 /* VoidExpression */: + case 216 /* YieldExpression */: + case 217 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 267 /* ExportDeclaration */: - case 261 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -114468,11 +111891,11 @@ var ts; function getAdjustedLocationForDeclaration(node, forRename) { if (!forRename) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return getAdjustedLocationForClass(node); - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return getAdjustedLocationForFunction(node); } } @@ -114567,11 +111990,11 @@ var ts; node.kind === 97 /* FunctionKeyword */ ? ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(node) : node.kind === 117 /* InterfaceKeyword */ ? ts.isInterfaceDeclaration(parent) : node.kind === 91 /* EnumKeyword */ ? ts.isEnumDeclaration(parent) : - node.kind === 149 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : - node.kind === 140 /* NamespaceKeyword */ || node.kind === 139 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : + node.kind === 148 /* TypeKeyword */ ? ts.isTypeAliasDeclaration(parent) : + node.kind === 139 /* NamespaceKeyword */ || node.kind === 138 /* ModuleKeyword */ ? ts.isModuleDeclaration(parent) : node.kind === 99 /* ImportKeyword */ ? ts.isImportEqualsDeclaration(parent) : node.kind === 134 /* GetKeyword */ ? ts.isGetAccessorDeclaration(parent) : - node.kind === 146 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { + node.kind === 145 /* SetKeyword */ && ts.isSetAccessorDeclaration(parent)) { var location = getAdjustedLocationForDeclaration(parent, forRename); if (location) { return location; @@ -114585,7 +112008,7 @@ var ts; return decl.name; } } - if (node.kind === 149 /* TypeKeyword */) { + if (node.kind === 148 /* TypeKeyword */) { // import /**/type [|name|] from ...; // import /**/type { [|name|] } from ...; // import /**/type { propertyName as [|name|] } from ...; @@ -114652,12 +112075,12 @@ var ts; } } // import name = /**/require("[|module|]"); - if (node.kind === 143 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { + if (node.kind === 142 /* RequireKeyword */ && ts.isExternalModuleReference(parent)) { return parent.expression; } // import ... /**/from "[|module|]"; // export ... /**/from "[|module|]"; - if (node.kind === 153 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { + if (node.kind === 152 /* FromKeyword */ && (ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier) { return parent.moduleSpecifier; } // class ... /**/extends [|name|] ... @@ -114690,12 +112113,12 @@ var ts; return parent.name; } // /**/keyof [|T|] - if (node.kind === 138 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 138 /* KeyOfKeyword */ && + if (node.kind === 137 /* KeyOfKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 137 /* KeyOfKeyword */ && ts.isTypeReferenceNode(parent.type)) { return parent.type.typeName; } // /**/readonly [|name|][] - if (node.kind === 142 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 142 /* ReadonlyKeyword */ && + if (node.kind === 141 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(parent) && parent.operator === 141 /* ReadonlyKeyword */ && ts.isArrayTypeNode(parent.type) && ts.isTypeReferenceNode(parent.type.elementType)) { return parent.type.elementType.typeName; } @@ -114732,7 +112155,7 @@ var ts; // for (... /**/in [|name|]) // for (... /**/of [|name|]) if (node.kind === 100 /* InKeyword */ && ts.isForInStatement(parent) || - node.kind === 156 /* OfKeyword */ && ts.isForOfStatement(parent)) { + node.kind === 155 /* OfKeyword */ && ts.isForOfStatement(parent)) { return ts.skipOuterExpressions(parent.expression); } } @@ -114850,21 +112273,7 @@ var ts; return n; } var children = n.getChildren(sourceFile); - var i = ts.binarySearchKey(children, position, function (_, i) { return i; }, function (middle, _) { - // This last callback is more of a selector than a comparator - - // `EqualTo` causes the `middle` result to be returned - // `GreaterThan` causes recursion on the left of the middle - // `LessThan` causes recursion on the right of the middle - if (position < children[middle].end) { - // first element whose end position is greater than the input position - if (!children[middle - 1] || position >= children[middle - 1].end) { - return 0 /* EqualTo */; - } - return 1 /* GreaterThan */; - } - return -1 /* LessThan */; - }); - if (i >= 0 && children[i]) { + for (var i = 0; i < children.length; i++) { var child = children[i]; // Note that the span of a node's tokens is [node.getStart(...), node.end). // Given that `position < child.end` and child has constituent tokens, we distinguish these cases: @@ -114887,7 +112296,7 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 297 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 294 /* SourceFile */ || n.kind === 1 /* EndOfFileToken */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. @@ -114905,9 +112314,6 @@ var ts; return n; } var children = n.getChildren(sourceFile); - if (children.length === 0) { - return n; - } var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length, sourceFile); return candidate && findRightmostToken(candidate, sourceFile); } @@ -114960,17 +112366,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 283 /* JsxExpression */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 280 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 283 /* JsxExpression */) { + if (token && token.kind === 19 /* CloseBraceToken */ && token.parent.kind === 280 /* JsxExpression */) { return true; } //
|
- if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 276 /* JsxClosingElement */) { + if (token.kind === 29 /* LessThanToken */ && token.parent.kind === 273 /* JsxClosingElement */) { return true; } return false; @@ -115001,7 +112407,7 @@ var ts; function isInsideJsxElement(sourceFile, position) { function isInsideJsxElementTraversal(node) { while (node) { - if (node.kind >= 274 /* JsxSelfClosingElement */ && node.kind <= 283 /* JsxExpression */ + if (node.kind >= 271 /* JsxSelfClosingElement */ && node.kind <= 280 /* JsxExpression */ || node.kind === 11 /* JsxText */ || node.kind === 29 /* LessThanToken */ || node.kind === 31 /* GreaterThanToken */ @@ -115011,7 +112417,7 @@ var ts; || node.kind === 43 /* SlashToken */) { node = node.parent; } - else if (node.kind === 273 /* JsxElement */) { + else if (node.kind === 270 /* JsxElement */) { if (position > node.getStart(sourceFile)) return true; node = node.parent; @@ -115138,7 +112544,7 @@ var ts; // falls through case 111 /* TypeOfKeyword */: case 93 /* ExtendsKeyword */: - case 138 /* KeyOfKeyword */: + case 137 /* KeyOfKeyword */: case 24 /* DotToken */: case 51 /* BarToken */: case 57 /* QuestionToken */: @@ -115195,16 +112601,16 @@ var ts; result.push("deprecated" /* deprecatedModifier */); if (node.flags & 8388608 /* Ambient */) result.push("declare" /* ambientModifier */); - if (node.kind === 266 /* ExportAssignment */) + if (node.kind === 263 /* ExportAssignment */) result.push("export" /* exportedModifier */); return result.length > 0 ? result.join(",") : "" /* none */; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 173 /* TypeReference */ || node.kind === 203 /* CallExpression */) { + if (node.kind === 172 /* TypeReference */ || node.kind === 200 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 252 /* ClassDeclaration */ || node.kind === 253 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 249 /* ClassDeclaration */ || node.kind === 250 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -115249,18 +112655,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 199 /* ArrayLiteralExpression */ || - node.kind === 200 /* ObjectLiteralExpression */) { + if (node.kind === 196 /* ArrayLiteralExpression */ || + node.kind === 197 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 216 /* BinaryExpression */ && + if (node.parent.kind === 213 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 239 /* ForOfStatement */ && + if (node.parent.kind === 236 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -115268,7 +112674,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 288 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 285 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -115332,29 +112738,29 @@ var ts; ts.typeKeywords = [ 128 /* AnyKeyword */, 127 /* AssertsKeyword */, - 155 /* BigIntKeyword */, + 154 /* BigIntKeyword */, 131 /* BooleanKeyword */, 94 /* FalseKeyword */, - 138 /* KeyOfKeyword */, - 141 /* NeverKeyword */, + 137 /* KeyOfKeyword */, + 140 /* NeverKeyword */, 103 /* NullKeyword */, - 144 /* NumberKeyword */, - 145 /* ObjectKeyword */, - 142 /* ReadonlyKeyword */, - 147 /* StringKeyword */, - 148 /* SymbolKeyword */, + 143 /* NumberKeyword */, + 144 /* ObjectKeyword */, + 141 /* ReadonlyKeyword */, + 146 /* StringKeyword */, + 147 /* SymbolKeyword */, 109 /* TrueKeyword */, 113 /* VoidKeyword */, - 150 /* UndefinedKeyword */, - 151 /* UniqueKeyword */, - 152 /* UnknownKeyword */, + 149 /* UndefinedKeyword */, + 150 /* UniqueKeyword */, + 151 /* UnknownKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); } ts.isTypeKeyword = isTypeKeyword; function isTypeKeywordToken(node) { - return node.kind === 149 /* TypeKeyword */; + return node.kind === 148 /* TypeKeyword */; } ts.isTypeKeywordToken = isTypeKeywordToken; /** True if the symbol is for an external module, as opposed to a namespace. */ @@ -115387,7 +112793,7 @@ var ts; } ts.skipConstraint = skipConstraint; function getNameFromPropertyName(name) { - return name.kind === 158 /* ComputedPropertyName */ + return name.kind === 157 /* ComputedPropertyName */ // treat computed property names where expression is string/numeric literal as just string/numeric literal ? ts.isStringOrNumericLiteralLike(name.expression) ? name.expression.text : undefined : ts.isPrivateIdentifier(name) ? ts.idText(name) : ts.getTextOfIdentifierOrLiteral(name); @@ -115418,7 +112824,7 @@ var ts; getSourceFiles: function () { return program.getSourceFiles(); }, redirectTargetsMap: program.redirectTargetsMap, getProjectReferenceRedirect: function (fileName) { return program.getProjectReferenceRedirect(fileName); }, - isSourceOfProjectReferenceRedirect: function (fileName) { return program.isSourceOfProjectReferenceRedirect(fileName); } + isSourceOfProjectReferenceRedirect: function (fileName) { return program.isSourceOfProjectReferenceRedirect(fileName); }, }; } ts.createModuleSpecifierResolutionHost = createModuleSpecifierResolutionHost; @@ -115456,9 +112862,7 @@ var ts; return preferences.quotePreference === "single" ? 0 /* Single */ : 1 /* Double */; } else { - // ignore synthetic import added when importHelpers: true - var firstModuleSpecifier = sourceFile.imports && - ts.find(sourceFile.imports, function (n) { return ts.isStringLiteral(n) && !ts.nodeIsSynthesized(n.parent); }); + var firstModuleSpecifier = sourceFile.imports && ts.find(sourceFile.imports, ts.isStringLiteral); return firstModuleSpecifier ? quotePreferenceFromString(firstModuleSpecifier, sourceFile) : 1 /* Double */; } } @@ -115550,7 +112954,7 @@ var ts; ts.findModifier = findModifier; function insertImports(changes, sourceFile, imports, blankLineBetween) { var decl = ts.isArray(imports) ? imports[0] : imports; - var importKindPredicate = decl.kind === 232 /* VariableStatement */ ? ts.isRequireVariableStatement : ts.isAnyImportSyntax; + var importKindPredicate = decl.kind === 229 /* VariableStatement */ ? ts.isRequireVariableStatement : ts.isAnyImportSyntax; var existingImportStatements = ts.filter(sourceFile.statements, importKindPredicate); var sortedNewImports = ts.isArray(imports) ? ts.stableSort(imports, ts.OrganizeImports.compareImportsOrRequireStatements) : [imports]; if (!existingImportStatements.length) { @@ -115561,10 +112965,7 @@ var ts; var newImport = sortedNewImports_1[_i]; var insertionIndex = ts.OrganizeImports.getImportDeclarationInsertionIndex(existingImportStatements, newImport); if (insertionIndex === 0) { - // If the first import is top-of-file, insert after the leading comment which is likely the header. - var options = existingImportStatements[0] === sourceFile.statements[0] ? - { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude } : {}; - changes.insertNodeBefore(sourceFile, existingImportStatements[0], newImport, /*blankLineBetween*/ false, options); + changes.insertNodeBefore(sourceFile, existingImportStatements[0], newImport, /*blankLineBetween*/ false); } else { var prevImport = existingImportStatements[insertionIndex - 1]; @@ -115628,7 +113029,7 @@ var ts; // Display-part writer helpers // #region function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 160 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 159 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -115909,22 +113310,36 @@ var ts; return clone; } ts.getSynthesizedDeepClone = getSynthesizedDeepClone; - function getSynthesizedDeepCloneWithReplacements(node, includeTrivia, replaceNode) { - var clone = replaceNode(node); - if (clone) { - ts.setOriginalNode(clone, node); + function getSynthesizedDeepCloneWithRenames(node, includeTrivia, renameMap, checker, callback) { + if (includeTrivia === void 0) { includeTrivia = true; } + var clone; + if (renameMap && checker && ts.isBindingElement(node) && ts.isIdentifier(node.name) && ts.isObjectBindingPattern(node.parent)) { + var symbol = checker.getSymbolAtLocation(node.name); + var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); + if (renameInfo && renameInfo.text !== (node.name || node.propertyName).getText()) { + clone = ts.setOriginalNode(ts.factory.createBindingElement(node.dotDotDotToken, node.propertyName || node.name, renameInfo, node.initializer), node); + } } - else { - clone = getSynthesizedDeepCloneWorker(node, replaceNode); + else if (renameMap && checker && ts.isIdentifier(node)) { + var symbol = checker.getSymbolAtLocation(node); + var renameInfo = symbol && renameMap.get(String(ts.getSymbolId(symbol))); + if (renameInfo) { + clone = ts.setOriginalNode(ts.factory.createIdentifier(renameInfo.text), node); + } + } + if (!clone) { + clone = getSynthesizedDeepCloneWorker(node, renameMap, checker, callback); } if (clone && !includeTrivia) suppressLeadingAndTrailingTrivia(clone); + if (callback && clone) + callback(node, clone); return clone; } - ts.getSynthesizedDeepCloneWithReplacements = getSynthesizedDeepCloneWithReplacements; - function getSynthesizedDeepCloneWorker(node, replaceNode) { - var visited = replaceNode ? - ts.visitEachChild(node, function (n) { return getSynthesizedDeepCloneWithReplacements(n, /*includeTrivia*/ true, replaceNode); }, ts.nullTransformationContext) : + ts.getSynthesizedDeepCloneWithRenames = getSynthesizedDeepCloneWithRenames; + function getSynthesizedDeepCloneWorker(node, renameMap, checker, callback) { + var visited = (renameMap || checker || callback) ? + ts.visitEachChild(node, wrapper, ts.nullTransformationContext) : ts.visitEachChild(node, getSynthesizedDeepClone, ts.nullTransformationContext); if (visited === node) { // This only happens for leaf nodes - internal nodes always see their children change. @@ -115938,16 +113353,15 @@ var ts; // would have made. visited.parent = undefined; return visited; + function wrapper(node) { + return getSynthesizedDeepCloneWithRenames(node, /*includeTrivia*/ true, renameMap, checker, callback); + } } function getSynthesizedDeepClones(nodes, includeTrivia) { if (includeTrivia === void 0) { includeTrivia = true; } return nodes && ts.factory.createNodeArray(nodes.map(function (n) { return getSynthesizedDeepClone(n, includeTrivia); }), nodes.hasTrailingComma); } ts.getSynthesizedDeepClones = getSynthesizedDeepClones; - function getSynthesizedDeepClonesWithReplacements(nodes, includeTrivia, replaceNode) { - return ts.factory.createNodeArray(nodes.map(function (n) { return getSynthesizedDeepCloneWithReplacements(n, includeTrivia, replaceNode); }), nodes.hasTrailingComma); - } - ts.getSynthesizedDeepClonesWithReplacements = getSynthesizedDeepClonesWithReplacements; /** * Sets EmitFlags to suppress leading and trailing trivia on the node. */ @@ -116092,26 +113506,35 @@ var ts; function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 204 /* NewExpression */: + case 201 /* NewExpression */: return checker.getContextualType(parent); - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 284 /* CaseClause */: + case 281 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); } } ts.getContextualTypeFromParent = getContextualTypeFromParent; - function quote(sourceFile, preferences, text) { + function quote(text, preferences) { // Editors can pass in undefined or empty string - we want to infer the preference in those cases. - var quotePreference = getQuotePreference(sourceFile, preferences); + var quotePreference = preferences.quotePreference || "auto"; var quoted = JSON.stringify(text); - return quotePreference === 0 /* Single */ ? "'" + ts.stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'" : quoted; + switch (quotePreference) { + // TODO use getQuotePreference to infer the actual quote style. + case "auto": + case "double": + return quoted; + case "single": + return "'" + ts.stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"') + "'"; + default: + return ts.Debug.assertNever(quotePreference); + } } ts.quote = quote; function isEqualityOperatorKind(kind) { @@ -116130,8 +113553,8 @@ var ts; switch (node.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: - case 205 /* TaggedTemplateExpression */: + case 215 /* TemplateExpression */: + case 202 /* TaggedTemplateExpression */: return true; default: return false; @@ -116151,7 +113574,7 @@ var ts; var checker = program.getTypeChecker(); var typeIsAccessible = true; var notAccessible = function () { typeIsAccessible = false; }; - var res = checker.typeToTypeNode(type, enclosingScope, 1 /* NoTruncation */, { + var res = checker.typeToTypeNode(type, enclosingScope, /*flags*/ undefined, { trackSymbol: function (symbol, declaration, meaning) { typeIsAccessible = typeIsAccessible && checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility === 0 /* Accessible */; }, @@ -116164,41 +113587,41 @@ var ts; } ts.getTypeNodeIfAccessible = getTypeNodeIfAccessible; function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { - return kind === 169 /* CallSignature */ - || kind === 170 /* ConstructSignature */ - || kind === 171 /* IndexSignature */ - || kind === 162 /* PropertySignature */ - || kind === 164 /* MethodSignature */; + return kind === 168 /* CallSignature */ + || kind === 169 /* ConstructSignature */ + || kind === 170 /* IndexSignature */ + || kind === 161 /* PropertySignature */ + || kind === 163 /* MethodSignature */; } ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI; function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { - return kind === 251 /* FunctionDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 248 /* FunctionDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI; function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { - return kind === 256 /* ModuleDeclaration */; + return kind === 253 /* ModuleDeclaration */; } ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI; function syntaxRequiresTrailingSemicolonOrASI(kind) { - return kind === 232 /* VariableStatement */ - || kind === 233 /* ExpressionStatement */ - || kind === 235 /* DoStatement */ - || kind === 240 /* ContinueStatement */ - || kind === 241 /* BreakStatement */ - || kind === 242 /* ReturnStatement */ - || kind === 246 /* ThrowStatement */ - || kind === 248 /* DebuggerStatement */ - || kind === 163 /* PropertyDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 267 /* ExportDeclaration */ - || kind === 259 /* NamespaceExportDeclaration */ - || kind === 266 /* ExportAssignment */; + return kind === 229 /* VariableStatement */ + || kind === 230 /* ExpressionStatement */ + || kind === 232 /* DoStatement */ + || kind === 237 /* ContinueStatement */ + || kind === 238 /* BreakStatement */ + || kind === 239 /* ReturnStatement */ + || kind === 243 /* ThrowStatement */ + || kind === 245 /* DebuggerStatement */ + || kind === 162 /* PropertyDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 264 /* ExportDeclaration */ + || kind === 256 /* NamespaceExportDeclaration */ + || kind === 263 /* ExportAssignment */; } ts.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI; ts.syntaxMayBeASICandidate = ts.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI); @@ -116228,7 +113651,7 @@ var ts; return false; } // See comment in parser’s `parseDoStatement` - if (node.kind === 235 /* DoStatement */) { + if (node.kind === 232 /* DoStatement */) { return true; } var topNode = ts.findAncestor(node, function (ancestor) { return !ancestor.parent; }); @@ -116647,10 +114070,10 @@ var ts; } break; case 128 /* AnyKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -116840,7 +114263,7 @@ var ts; } switch (keyword2) { case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: case 132 /* ConstructorKeyword */: case 123 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". @@ -116985,13 +114408,13 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -117211,18 +114634,18 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); pos = tag.end; break; - case 329 /* JSDocTypeTag */: + case 325 /* JSDocTypeTag */: processElement(tag.typeExpression); pos = tag.end; break; - case 327 /* JSDocReturnTag */: + case 323 /* JSDocReturnTag */: processElement(tag.typeExpression); pos = tag.end; break; @@ -117373,22 +114796,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -117417,17 +114840,17 @@ var ts; var parent = token.parent; if (tokenKind === 62 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (parent.kind === 249 /* VariableDeclaration */ || - parent.kind === 163 /* PropertyDeclaration */ || - parent.kind === 160 /* Parameter */ || - parent.kind === 280 /* JsxAttribute */) { + if (parent.kind === 246 /* VariableDeclaration */ || + parent.kind === 162 /* PropertyDeclaration */ || + parent.kind === 159 /* Parameter */ || + parent.kind === 277 /* JsxAttribute */) { return 5 /* operator */; } } - if (parent.kind === 216 /* BinaryExpression */ || - parent.kind === 214 /* PrefixUnaryExpression */ || - parent.kind === 215 /* PostfixUnaryExpression */ || - parent.kind === 217 /* ConditionalExpression */) { + if (parent.kind === 213 /* BinaryExpression */ || + parent.kind === 211 /* PrefixUnaryExpression */ || + parent.kind === 212 /* PostfixUnaryExpression */ || + parent.kind === 214 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -117440,7 +114863,7 @@ var ts; return 25 /* bigintLiteral */; } else if (tokenKind === 10 /* StringLiteral */) { - return token && token.parent.kind === 280 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token && token.parent.kind === 277 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 13 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -117456,32 +114879,32 @@ var ts; else if (tokenKind === 78 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 160 /* Parameter */: + case 159 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -117510,254 +114933,6 @@ var ts; } ts.getEncodedSyntacticClassifications = getEncodedSyntacticClassifications; })(ts || (ts = {})); -/** @internal */ -var ts; -(function (ts) { - var classifier; - (function (classifier) { - var v2020; - (function (v2020) { - var TokenEncodingConsts; - (function (TokenEncodingConsts) { - TokenEncodingConsts[TokenEncodingConsts["typeOffset"] = 8] = "typeOffset"; - TokenEncodingConsts[TokenEncodingConsts["modifierMask"] = 255] = "modifierMask"; - })(TokenEncodingConsts = v2020.TokenEncodingConsts || (v2020.TokenEncodingConsts = {})); - var TokenType; - (function (TokenType) { - TokenType[TokenType["class"] = 0] = "class"; - TokenType[TokenType["enum"] = 1] = "enum"; - TokenType[TokenType["interface"] = 2] = "interface"; - TokenType[TokenType["namespace"] = 3] = "namespace"; - TokenType[TokenType["typeParameter"] = 4] = "typeParameter"; - TokenType[TokenType["type"] = 5] = "type"; - TokenType[TokenType["parameter"] = 6] = "parameter"; - TokenType[TokenType["variable"] = 7] = "variable"; - TokenType[TokenType["enumMember"] = 8] = "enumMember"; - TokenType[TokenType["property"] = 9] = "property"; - TokenType[TokenType["function"] = 10] = "function"; - TokenType[TokenType["member"] = 11] = "member"; - })(TokenType = v2020.TokenType || (v2020.TokenType = {})); - var TokenModifier; - (function (TokenModifier) { - TokenModifier[TokenModifier["declaration"] = 0] = "declaration"; - TokenModifier[TokenModifier["static"] = 1] = "static"; - TokenModifier[TokenModifier["async"] = 2] = "async"; - TokenModifier[TokenModifier["readonly"] = 3] = "readonly"; - TokenModifier[TokenModifier["defaultLibrary"] = 4] = "defaultLibrary"; - TokenModifier[TokenModifier["local"] = 5] = "local"; - })(TokenModifier = v2020.TokenModifier || (v2020.TokenModifier = {})); - /** This is mainly used internally for testing */ - function getSemanticClassifications(program, cancellationToken, sourceFile, span) { - var classifications = getEncodedSemanticClassifications(program, cancellationToken, sourceFile, span); - ts.Debug.assert(classifications.spans.length % 3 === 0); - var dense = classifications.spans; - var result = []; - for (var i = 0; i < dense.length; i += 3) { - result.push({ - textSpan: ts.createTextSpan(dense[i], dense[i + 1]), - classificationType: dense[i + 2] - }); - } - return result; - } - v2020.getSemanticClassifications = getSemanticClassifications; - function getEncodedSemanticClassifications(program, cancellationToken, sourceFile, span) { - return { - spans: getSemanticTokens(program, sourceFile, span, cancellationToken), - endOfLineState: 0 /* None */ - }; - } - v2020.getEncodedSemanticClassifications = getEncodedSemanticClassifications; - function getSemanticTokens(program, sourceFile, span, cancellationToken) { - var resultTokens = []; - var collector = function (node, typeIdx, modifierSet) { - resultTokens.push(node.getStart(sourceFile), node.getWidth(sourceFile), ((typeIdx + 1) << 8 /* typeOffset */) + modifierSet); - }; - if (program && sourceFile) { - collectTokens(program, sourceFile, span, collector, cancellationToken); - } - return resultTokens; - } - function collectTokens(program, sourceFile, span, collector, cancellationToken) { - var typeChecker = program.getTypeChecker(); - var inJSXElement = false; - function visit(node) { - switch (node.kind) { - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - cancellationToken.throwIfCancellationRequested(); - } - if (!node || !ts.textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) { - return; - } - var prevInJSXElement = inJSXElement; - if (ts.isJsxElement(node) || ts.isJsxSelfClosingElement(node)) { - inJSXElement = true; - } - if (ts.isJsxExpression(node)) { - inJSXElement = false; - } - if (ts.isIdentifier(node) && !inJSXElement && !inImportClause(node)) { - var symbol = typeChecker.getSymbolAtLocation(node); - if (symbol) { - if (symbol.flags & 2097152 /* Alias */) { - symbol = typeChecker.getAliasedSymbol(symbol); - } - var typeIdx = classifySymbol(symbol, ts.getMeaningFromLocation(node)); - if (typeIdx !== undefined) { - var modifierSet = 0; - if (node.parent) { - var parentIsDeclaration = (ts.isBindingElement(node.parent) || tokenFromDeclarationMapping.get(node.parent.kind) === typeIdx); - if (parentIsDeclaration && node.parent.name === node) { - modifierSet = 1 << 0 /* declaration */; - } - } - // property declaration in constructor - if (typeIdx === 6 /* parameter */ && isRightSideOfQualifiedNameOrPropertyAccess(node)) { - typeIdx = 9 /* property */; - } - typeIdx = reclassifyByType(typeChecker, node, typeIdx); - var decl = symbol.valueDeclaration; - if (decl) { - var modifiers = ts.getCombinedModifierFlags(decl); - var nodeFlags = ts.getCombinedNodeFlags(decl); - if (modifiers & 32 /* Static */) { - modifierSet |= 1 << 1 /* static */; - } - if (modifiers & 256 /* Async */) { - modifierSet |= 1 << 2 /* async */; - } - if (typeIdx !== 0 /* class */ && typeIdx !== 2 /* interface */) { - if ((modifiers & 64 /* Readonly */) || (nodeFlags & 2 /* Const */) || (symbol.getFlags() & 8 /* EnumMember */)) { - modifierSet |= 1 << 3 /* readonly */; - } - } - if ((typeIdx === 7 /* variable */ || typeIdx === 10 /* function */) && isLocalDeclaration(decl, sourceFile)) { - modifierSet |= 1 << 5 /* local */; - } - if (program.isSourceFileDefaultLibrary(decl.getSourceFile())) { - modifierSet |= 1 << 4 /* defaultLibrary */; - } - } - else if (symbol.declarations && symbol.declarations.some(function (d) { return program.isSourceFileDefaultLibrary(d.getSourceFile()); })) { - modifierSet |= 1 << 4 /* defaultLibrary */; - } - collector(node, typeIdx, modifierSet); - } - } - } - ts.forEachChild(node, visit); - inJSXElement = prevInJSXElement; - } - visit(sourceFile); - } - function classifySymbol(symbol, meaning) { - var flags = symbol.getFlags(); - if (flags & 32 /* Class */) { - return 0 /* class */; - } - else if (flags & 384 /* Enum */) { - return 1 /* enum */; - } - else if (flags & 524288 /* TypeAlias */) { - return 5 /* type */; - } - else if (flags & 64 /* Interface */) { - if (meaning & 2 /* Type */) { - return 2 /* interface */; - } - } - else if (flags & 262144 /* TypeParameter */) { - return 4 /* typeParameter */; - } - var decl = symbol.valueDeclaration || symbol.declarations && symbol.declarations[0]; - if (decl && ts.isBindingElement(decl)) { - decl = getDeclarationForBindingElement(decl); - } - return decl && tokenFromDeclarationMapping.get(decl.kind); - } - function reclassifyByType(typeChecker, node, typeIdx) { - // type based classifications - if (typeIdx === 7 /* variable */ || typeIdx === 9 /* property */ || typeIdx === 6 /* parameter */) { - var type_1 = typeChecker.getTypeAtLocation(node); - if (type_1) { - var test = function (condition) { - return condition(type_1) || type_1.isUnion() && type_1.types.some(condition); - }; - if (typeIdx !== 6 /* parameter */ && test(function (t) { return t.getConstructSignatures().length > 0; })) { - return 0 /* class */; - } - if (test(function (t) { return t.getCallSignatures().length > 0; }) && !test(function (t) { return t.getProperties().length > 0; }) || isExpressionInCallExpression(node)) { - return typeIdx === 9 /* property */ ? 11 /* member */ : 10 /* function */; - } - } - } - return typeIdx; - } - function isLocalDeclaration(decl, sourceFile) { - if (ts.isBindingElement(decl)) { - decl = getDeclarationForBindingElement(decl); - } - if (ts.isVariableDeclaration(decl)) { - return (!ts.isSourceFile(decl.parent.parent.parent) || ts.isCatchClause(decl.parent)) && decl.getSourceFile() === sourceFile; - } - else if (ts.isFunctionDeclaration(decl)) { - return !ts.isSourceFile(decl.parent) && decl.getSourceFile() === sourceFile; - } - return false; - } - function getDeclarationForBindingElement(element) { - while (true) { - if (ts.isBindingElement(element.parent.parent)) { - element = element.parent.parent; - } - else { - return element.parent.parent; - } - } - } - function inImportClause(node) { - var parent = node.parent; - return parent && (ts.isImportClause(parent) || ts.isImportSpecifier(parent) || ts.isNamespaceImport(parent)); - } - function isExpressionInCallExpression(node) { - while (isRightSideOfQualifiedNameOrPropertyAccess(node)) { - node = node.parent; - } - return ts.isCallExpression(node.parent) && node.parent.expression === node; - } - function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (ts.isQualifiedName(node.parent) && node.parent.right === node) || (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node); - } - var tokenFromDeclarationMapping = new ts.Map([ - [249 /* VariableDeclaration */, 7 /* variable */], - [160 /* Parameter */, 6 /* parameter */], - [163 /* PropertyDeclaration */, 9 /* property */], - [256 /* ModuleDeclaration */, 3 /* namespace */], - [255 /* EnumDeclaration */, 1 /* enum */], - [291 /* EnumMember */, 8 /* enumMember */], - [252 /* ClassDeclaration */, 0 /* class */], - [165 /* MethodDeclaration */, 11 /* member */], - [251 /* FunctionDeclaration */, 10 /* function */], - [208 /* FunctionExpression */, 10 /* function */], - [164 /* MethodSignature */, 11 /* member */], - [167 /* GetAccessor */, 9 /* property */], - [168 /* SetAccessor */, 9 /* property */], - [162 /* PropertySignature */, 9 /* property */], - [253 /* InterfaceDeclaration */, 2 /* interface */], - [254 /* TypeAliasDeclaration */, 5 /* type */], - [159 /* TypeParameter */, 4 /* typeParameter */], - [288 /* PropertyAssignment */, 9 /* property */], - [289 /* ShorthandPropertyAssignment */, 9 /* property */] - ]); - })(v2020 = classifier.v2020 || (classifier.v2020 = {})); - })(classifier = ts.classifier || (ts.classifier = {})); -})(ts || (ts = {})); /* @internal */ var ts; (function (ts) { @@ -117782,24 +114957,23 @@ var ts; if (completion === undefined) { return undefined; } - var optionalReplacementSpan = ts.createTextSpanFromStringLiteralLikeContent(contextToken); switch (completion.kind) { case 0 /* Paths */: return convertPathCompletions(completion.paths); case 1 /* Properties */: { var entries = []; Completions.getCompletionEntriesFromSymbols(completion.symbols, entries, contextToken, sourceFile, sourceFile, checker, 99 /* ESNext */, log, 4 /* String */, preferences); // Target will not be used, so arbitrary - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan: optionalReplacementSpan, entries: entries }; + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, entries: entries }; } case 2 /* Types */: { var entries = completion.types.map(function (type) { return ({ name: type.value, kindModifiers: "" /* none */, kind: "string" /* string */, - sortText: Completions.SortText.LocationPriority, + sortText: "0", replacementSpan: ts.getReplacementSpanForContextToken(contextToken) }); }); - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, optionalReplacementSpan: optionalReplacementSpan, entries: entries }; + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, entries: entries }; } default: return ts.Debug.assertNever(completion); @@ -117858,46 +115032,33 @@ var ts; StringLiteralCompletionKind[StringLiteralCompletionKind["Types"] = 2] = "Types"; })(StringLiteralCompletionKind || (StringLiteralCompletionKind = {})); function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { - var parent = walkUpParentheses(node.parent); + var parent = node.parent; switch (parent.kind) { - case 191 /* LiteralType */: { - var grandParent = walkUpParentheses(parent.parent); - switch (grandParent.kind) { - case 173 /* TypeReference */: { - var typeReference_1 = grandParent; - var typeArgument = ts.findAncestor(parent, function (n) { return n.parent === typeReference_1; }); - if (typeArgument) { - return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false }; - } - return undefined; - } - case 189 /* IndexedAccessType */: + case 190 /* LiteralType */: + switch (parent.parent.kind) { + case 172 /* TypeReference */: + return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent)), isNewIdentifier: false }; + case 188 /* IndexedAccessType */: // Get all apparent property names // i.e. interface Foo { // foo: string; // bar: string; // } // let x: Foo["/*completion position*/"] - var _a = grandParent, indexType = _a.indexType, objectType = _a.objectType; - if (!ts.rangeContainsPosition(indexType, position)) { - return undefined; - } - return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType)); - case 195 /* ImportType */: + return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(parent.parent.objectType)); + case 192 /* ImportType */: return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; - case 182 /* UnionType */: { - if (!ts.isTypeReferenceNode(grandParent.parent)) { + case 181 /* UnionType */: { + if (!ts.isTypeReferenceNode(parent.parent.parent)) return undefined; - } - var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent); - var types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(grandParent)).filter(function (t) { return !ts.contains(alreadyUsedTypes_1, t.value); }); + var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(parent.parent, parent); + var types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(parent.parent)).filter(function (t) { return !ts.contains(alreadyUsedTypes_1, t.value); }); return { kind: 2 /* Types */, types: types, isNewIdentifier: false }; } default: return undefined; } - } - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (ts.isObjectLiteralExpression(parent.parent) && parent.name === node) { // Get quoted name of properties of the object literal expression // i.e. interface ConfigFiles { @@ -117914,9 +115075,9 @@ var ts; return stringLiteralCompletionsFromProperties(typeChecker.getContextualType(parent.parent)); } return fromContextualType(); - case 202 /* ElementAccessExpression */: { - var _b = parent, expression = _b.expression, argumentExpression = _b.argumentExpression; - if (node === ts.skipParentheses(argumentExpression)) { + case 199 /* ElementAccessExpression */: { + var _a = parent, expression = _a.expression, argumentExpression = _a.argumentExpression; + if (node === argumentExpression) { // Get all names of properties on the expression // i.e. interface A { // 'prop1': string @@ -117927,8 +115088,8 @@ var ts; } return undefined; } - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: if (!ts.isRequireCall(parent, /*checkArgumentIsStringLiteralLike*/ false) && !ts.isImportCall(parent)) { var argumentInfo = ts.SignatureHelp.getArgumentInfoForCompletions(node, position, sourceFile); // Get string literal completions from specialized signatures of the target @@ -117937,9 +115098,9 @@ var ts; return argumentInfo ? getStringLiteralCompletionsFromSignature(argumentInfo, typeChecker) : fromContextualType(); } // falls through (is `require("")` or `import("")`) - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 272 /* ExternalModuleReference */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 269 /* ExternalModuleReference */: // Get all known external module names or complete a path to a module // i.e. import * as ns from "/*completion position*/"; // var y = import("/*completion position*/"); @@ -117956,16 +115117,6 @@ var ts; return { kind: 2 /* Types */, types: getStringLiteralTypes(ts.getContextualTypeFromParent(node, typeChecker)), isNewIdentifier: false }; } } - function walkUpParentheses(node) { - switch (node.kind) { - case 186 /* ParenthesizedType */: - return ts.walkUpParenthesizedTypes(node); - case 207 /* ParenthesizedExpression */: - return ts.walkUpParenthesizedExpressions(node); - default: - return node; - } - } function getAlreadyUsedTypesInStringLiteralUnion(union, current) { return ts.mapDefined(union.types, function (type) { return type !== current && ts.isLiteralTypeNode(type) && ts.isStringLiteral(type.literal) ? type.literal.text : undefined; @@ -118412,14 +115563,13 @@ var ts; (function (Completions) { var SortText; (function (SortText) { - SortText["LocalDeclarationPriority"] = "0"; - SortText["LocationPriority"] = "1"; - SortText["OptionalMember"] = "2"; - SortText["MemberDeclaredBySpreadAssignment"] = "3"; - SortText["SuggestedClassMembers"] = "4"; - SortText["GlobalsOrKeywords"] = "5"; - SortText["AutoImportSuggestions"] = "6"; - SortText["JavascriptIdentifiers"] = "7"; + SortText["LocationPriority"] = "0"; + SortText["OptionalMember"] = "1"; + SortText["MemberDeclaredBySpreadAssignment"] = "2"; + SortText["SuggestedClassMembers"] = "3"; + SortText["GlobalsOrKeywords"] = "4"; + SortText["AutoImportSuggestions"] = "5"; + SortText["JavascriptIdentifiers"] = "6"; })(SortText = Completions.SortText || (Completions.SortText = {})); /** * Special values for `CompletionInfo['source']` used to disambiguate @@ -118566,10 +115716,6 @@ var ts; function jsdocCompletionInfo(entries) { return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; } - function getOptionalReplacementSpan(location) { - // StringLiteralLike locations are handled separately in stringCompletions.ts - return (location === null || location === void 0 ? void 0 : location.kind) === 78 /* Identifier */ ? ts.createTextSpanFromNode(location) : undefined; - } function completionInfoFromData(sourceFile, typeChecker, compilerOptions, log, completionData, preferences) { var symbols = completionData.symbols, completionKind = completionData.completionKind, isInSnippetScope = completionData.isInSnippetScope, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, literals = completionData.literals, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer, insideJsDocTagTypeExpression = completionData.insideJsDocTagTypeExpression, symbolToSortTextMap = completionData.symbolToSortTextMap; if (location && location.parent && ts.isJsxClosingElement(location.parent)) { @@ -118587,7 +115733,7 @@ var ts; kindModifiers: undefined, sortText: SortText.LocationPriority, }; - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, optionalReplacementSpan: getOptionalReplacementSpan(location), entries: [entry] }; + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, entries: [entry] }; } var entries = []; if (isUncheckedFile(sourceFile, compilerOptions)) { @@ -118613,15 +115759,9 @@ var ts; } for (var _b = 0, literals_1 = literals; _b < literals_1.length; _b++) { var literal = literals_1[_b]; - entries.push(createCompletionEntryForLiteral(sourceFile, preferences, literal)); + entries.push(createCompletionEntryForLiteral(literal, preferences)); } - return { - isGlobalCompletion: isInSnippetScope, - isMemberCompletion: isMemberCompletionKind(completionKind), - isNewIdentifierLocation: isNewIdentifierLocation, - optionalReplacementSpan: getOptionalReplacementSpan(location), - entries: entries - }; + return { isGlobalCompletion: isInSnippetScope, isMemberCompletion: isMemberCompletionKind(completionKind), isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; } function isUncheckedFile(sourceFile, compilerOptions) { return ts.isSourceFileJS(sourceFile) && !ts.isCheckJsEnabledForFile(sourceFile, compilerOptions); @@ -118655,12 +115795,12 @@ var ts; } }); } - function completionNameForLiteral(sourceFile, preferences, literal) { + function completionNameForLiteral(literal, preferences) { return typeof literal === "object" ? ts.pseudoBigIntToString(literal) + "n" : - ts.isString(literal) ? ts.quote(sourceFile, preferences, literal) : JSON.stringify(literal); + ts.isString(literal) ? ts.quote(literal, preferences) : JSON.stringify(literal); } - function createCompletionEntryForLiteral(sourceFile, preferences, literal) { - return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; + function createCompletionEntryForLiteral(literal, preferences) { + return { name: completionNameForLiteral(literal, preferences), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority }; } function createCompletionEntry(symbol, sortText, contextToken, location, sourceFile, typeChecker, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, preferences) { var insertText; @@ -118669,13 +115809,13 @@ var ts; var useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess; if (origin && originIsThisType(origin)) { insertText = needsConvertPropertyAccess - ? "this" + (insertQuestionDot ? "?." : "") + "[" + quotePropertyName(sourceFile, preferences, name) + "]" + ? "this" + (insertQuestionDot ? "?." : "") + "[" + quotePropertyName(name, preferences) + "]" : "this" + (insertQuestionDot ? "?." : ".") + name; } // We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790. // Somehow there was a global with a non-identifier name. Hopefully someone will complain about getting a "foo bar" global completion and provide a repro. else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) { - insertText = useBraces ? needsConvertPropertyAccess ? "[" + quotePropertyName(sourceFile, preferences, name) + "]" : "[" + name + "]" : name; + insertText = useBraces ? needsConvertPropertyAccess ? "[" + quotePropertyName(name, preferences) + "]" : "[" + name + "]" : name; if (insertQuestionDot || propertyAccessToConvert.questionDotToken) { insertText = "?." + insertText; } @@ -118731,11 +115871,11 @@ var ts; isPackageJsonImport: originIsPackageJsonImport(origin) || undefined, }; } - function quotePropertyName(sourceFile, preferences, name) { + function quotePropertyName(name, preferences) { if (/^\d+$/.test(name)) { return name; } - return ts.quote(sourceFile, preferences, name); + return ts.quote(name, preferences); } function isRecommendedCompletionMatch(localSymbol, recommendedCompletion, checker) { return localSymbol === recommendedCompletion || @@ -118826,7 +115966,7 @@ var ts; return { type: "request", request: completionData }; } var symbols = completionData.symbols, literals = completionData.literals, location = completionData.location, completionKind = completionData.completionKind, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, previousToken = completionData.previousToken, isJsxInitializer = completionData.isJsxInitializer, isTypeOnlyLocation = completionData.isTypeOnlyLocation; - var literal = ts.find(literals, function (l) { return completionNameForLiteral(sourceFile, preferences, l) === entryId.name; }); + var literal = ts.find(literals, function (l) { return completionNameForLiteral(l, preferences) === entryId.name; }); if (literal !== undefined) return { type: "literal", literal: literal }; // Find the symbol with the matching entry name. @@ -118872,7 +116012,7 @@ var ts; } case "literal": { var literal = symbolCompletion.literal; - return createSimpleDetails(completionNameForLiteral(sourceFile, preferences, literal), "string" /* string */, typeof literal === "string" ? ts.SymbolDisplayPartKind.stringLiteral : ts.SymbolDisplayPartKind.numericLiteral); + return createSimpleDetails(completionNameForLiteral(literal, preferences), "string" /* string */, typeof literal === "string" ? ts.SymbolDisplayPartKind.stringLiteral : ts.SymbolDisplayPartKind.numericLiteral); } case "none": // Didn't find a symbol with this name. See if we can find a keyword instead. @@ -118944,11 +116084,11 @@ var ts; return ts.getContextualTypeFromParent(previousToken, checker); case 62 /* EqualsToken */: switch (parent.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return checker.getContextualType(parent.initializer); // TODO: GH#18217 - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return checker.getTypeAtLocation(parent.left); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return checker.getContextualTypeForJsxAttribute(parent); default: return undefined; @@ -118958,7 +116098,7 @@ var ts; case 81 /* CaseKeyword */: return ts.getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); case 18 /* OpenBraceToken */: - return ts.isJsxExpression(parent) && parent.parent.kind !== 273 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + return ts.isJsxExpression(parent) && parent.parent.kind !== 270 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: var argInfo = ts.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); return argInfo ? @@ -118977,7 +116117,7 @@ var ts; return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 297 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 294 /* SourceFile */; }); } function getCompletionData(program, log, sourceFile, isUncheckedFile, position, preferences, detailsEntryId, host) { var typeChecker = program.getTypeChecker(); @@ -119028,11 +116168,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 301 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 298 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 333 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 328 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -119085,7 +116225,7 @@ var ts; isRightOfDot = contextToken.kind === 24 /* DotToken */; isRightOfQuestionDot = contextToken.kind === 28 /* QuestionDotToken */; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; if ((ts.isCallExpression(node) || ts.isFunctionLike(node)) && @@ -119098,14 +116238,14 @@ var ts; return undefined; } break; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: node = parent.left; break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: node = parent.name; break; - case 195 /* ImportType */: - case 226 /* MetaProperty */: + case 192 /* ImportType */: + case 223 /* MetaProperty */: node = parent; break; default: @@ -119118,7 +116258,7 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 201 /* PropertyAccessExpression */) { + if (parent && parent.kind === 198 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } @@ -119126,51 +116266,39 @@ var ts; if (currentToken.parent === location) { switch (currentToken.kind) { case 31 /* GreaterThanToken */: - if (currentToken.parent.kind === 273 /* JsxElement */ || currentToken.parent.kind === 275 /* JsxOpeningElement */) { + if (currentToken.parent.kind === 270 /* JsxElement */ || currentToken.parent.kind === 272 /* JsxOpeningElement */) { location = currentToken; } break; case 43 /* SlashToken */: - if (currentToken.parent.kind === 274 /* JsxSelfClosingElement */) { + if (currentToken.parent.kind === 271 /* JsxSelfClosingElement */) { location = currentToken; } break; } } switch (parent.kind) { - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: if (contextToken.kind === 43 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (!binaryExpressionMayBeOpenTag(parent)) { break; } // falls through - case 274 /* JsxSelfClosingElement */: - case 273 /* JsxElement */: - case 275 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 270 /* JsxElement */: + case 272 /* JsxOpeningElement */: isJsxIdentifierExpected = true; if (contextToken.kind === 29 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 283 /* JsxExpression */: - // For `
`, `parent` will be `{true}` and `previousToken` will be `}` - if (previousToken.kind === 19 /* CloseBraceToken */ && currentToken.kind === 31 /* GreaterThanToken */) { - isJsxIdentifierExpected = true; - } - break; - case 280 /* JsxAttribute */: - // For `
`, `parent` will be JsxAttribute and `previousToken` will be its initializer - if (parent.initializer === previousToken && - previousToken.end < position) { - isJsxIdentifierExpected = true; - break; - } + case 277 /* JsxAttribute */: switch (previousToken.kind) { case 62 /* EqualsToken */: isJsxInitializer = true; @@ -119252,11 +116380,11 @@ var ts; }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 331 /* JSDocTypedefTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 327 /* JSDocTypedefTag */: return true; default: return false; @@ -119272,7 +116400,7 @@ var ts; || ts.isPartOfTypeNode(node.parent) || ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); var isRhsOfImportDeclaration = ts.isInRightSideOfInternalImportEqualsDeclaration(node); - if (ts.isEntityName(node) || isImportType || ts.isPropertyAccessExpression(node)) { + if (ts.isEntityName(node) || isImportType) { var isNamespaceName = ts.isModuleDeclaration(node.parent); if (isNamespaceName) isNewIdentifierLocation = true; @@ -119301,7 +116429,7 @@ var ts; // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). if (!isTypeLocation && symbol.declarations && - symbol.declarations.some(function (d) { return d.kind !== 297 /* SourceFile */ && d.kind !== 256 /* ModuleDeclaration */ && d.kind !== 255 /* EnumDeclaration */; })) { + symbol.declarations.some(function (d) { return d.kind !== 294 /* SourceFile */ && d.kind !== 253 /* ModuleDeclaration */ && d.kind !== 252 /* EnumDeclaration */; })) { var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); var insertQuestionDot = false; if (type.isNullableType()) { @@ -119348,7 +116476,7 @@ var ts; if (isRightOfQuestionDot && ts.some(type.getCallSignatures())) { isNewIdentifierLocation = true; } - var propertyAccess = node.kind === 195 /* ImportType */ ? node : node.parent; + var propertyAccess = node.kind === 192 /* ImportType */ ? node : node.parent; if (isUncheckedFile) { // In javascript files, for union types, we don't just get the members that // the individual types have in common, we also include all the members that @@ -119361,7 +116489,7 @@ var ts; for (var _i = 0, _a = type.getApparentProperties(); _i < _a.length; _i++) { var symbol = _a[_i]; if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type, symbol)) { - addPropertySymbol(symbol, /* insertAwait */ false, insertQuestionDot); + addPropertySymbol(symbol, /*insertAwait*/ false, insertQuestionDot); } } } @@ -119397,20 +116525,13 @@ var ts; } else if (preferences.includeCompletionsWithInsertText) { addSymbolOriginInfo(symbol); - addSymbolSortInfo(symbol); symbols.push(symbol); } } else { addSymbolOriginInfo(symbol); - addSymbolSortInfo(symbol); symbols.push(symbol); } - function addSymbolSortInfo(symbol) { - if (isStaticProperty(symbol)) { - symbolToSortTextMap[ts.getSymbolId(symbol)] = SortText.LocalDeclarationPriority; - } - } function addSymbolOriginInfo(symbol) { if (preferences.includeCompletionsWithInsertText) { if (insertAwait && !symbolToOriginInfoMap[ts.getSymbolId(symbol)]) { @@ -119512,7 +116633,7 @@ var ts; } } // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 297 /* SourceFile */) { + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 294 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode, /*includeGlobalThis*/ false); if (thisType && !isProbablyGlobalType(thisType, sourceFile, typeChecker)) { for (var _a = 0, _b = getPropertiesForCompletion(thisType, typeChecker); _a < _b.length; _a++) { @@ -119562,10 +116683,10 @@ var ts; } function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 297 /* SourceFile */: - case 218 /* TemplateExpression */: - case 283 /* JsxExpression */: - case 230 /* Block */: + case 294 /* SourceFile */: + case 215 /* TemplateExpression */: + case 280 /* JsxExpression */: + case 227 /* Block */: return true; default: return ts.isStatement(scopeNode); @@ -119608,27 +116729,27 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 111 /* TypeOfKeyword */ && - (contextToken.parent.kind === 176 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); + (contextToken.parent.kind === 175 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 58 /* ColonToken */: - return parentKind === 163 /* PropertyDeclaration */ || - parentKind === 162 /* PropertySignature */ || - parentKind === 160 /* Parameter */ || - parentKind === 249 /* VariableDeclaration */ || + return parentKind === 162 /* PropertyDeclaration */ || + parentKind === 161 /* PropertySignature */ || + parentKind === 159 /* Parameter */ || + parentKind === 246 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 62 /* EqualsToken */: - return parentKind === 254 /* TypeAliasDeclaration */; + return parentKind === 251 /* TypeAliasDeclaration */; case 126 /* AsKeyword */: - return parentKind === 224 /* AsExpression */; + return parentKind === 221 /* AsExpression */; case 29 /* LessThanToken */: - return parentKind === 173 /* TypeReference */ || - parentKind === 206 /* TypeAssertionExpression */; + return parentKind === 172 /* TypeReference */ || + parentKind === 203 /* TypeAssertionExpression */; case 93 /* ExtendsKeyword */: - return parentKind === 159 /* TypeParameter */; + return parentKind === 158 /* TypeParameter */; } } return false; @@ -119839,7 +116960,7 @@ var ts; return true; } if (contextToken.kind === 31 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 275 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 272 /* JsxOpeningElement */) { // Two possibilities: // 1.
/**/ // - contextToken: GreaterThanToken (before cursor) @@ -119849,10 +116970,10 @@ var ts; // - contextToken: GreaterThanToken (before cursor) // - location: GreaterThanToken (after cursor) // - same parent (JSXOpeningElement) - return location.parent.kind !== 275 /* JsxOpeningElement */; + return location.parent.kind !== 272 /* JsxOpeningElement */; } - if (contextToken.parent.kind === 276 /* JsxClosingElement */ || contextToken.parent.kind === 274 /* JsxSelfClosingElement */) { - return !!contextToken.parent.parent && contextToken.parent.parent.kind === 273 /* JsxElement */; + if (contextToken.parent.kind === 273 /* JsxClosingElement */ || contextToken.parent.kind === 271 /* JsxSelfClosingElement */) { + return !!contextToken.parent.parent && contextToken.parent.parent.kind === 270 /* JsxElement */; } } return false; @@ -119863,40 +116984,40 @@ var ts; // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(previousToken)) { case 27 /* CommaToken */: - return containingNodeKind === 203 /* CallExpression */ // func( a, | - || containingNodeKind === 166 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 204 /* NewExpression */ // new C(a, | - || containingNodeKind === 199 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 216 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 174 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 200 /* CallExpression */ // func( a, | + || containingNodeKind === 165 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 201 /* NewExpression */ // new C(a, | + || containingNodeKind === 196 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 213 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 173 /* FunctionType */; // var x: (s: string, list| case 20 /* OpenParenToken */: - return containingNodeKind === 203 /* CallExpression */ // func( | - || containingNodeKind === 166 /* Constructor */ // constructor( | - || containingNodeKind === 204 /* NewExpression */ // new C(a| - || containingNodeKind === 207 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 186 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 200 /* CallExpression */ // func( | + || containingNodeKind === 165 /* Constructor */ // constructor( | + || containingNodeKind === 201 /* NewExpression */ // new C(a| + || containingNodeKind === 204 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 185 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 22 /* OpenBracketToken */: - return containingNodeKind === 199 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 171 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 158 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 139 /* ModuleKeyword */: // module | - case 140 /* NamespaceKeyword */: // namespace | + return containingNodeKind === 196 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 170 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 157 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 138 /* ModuleKeyword */: // module | + case 139 /* NamespaceKeyword */: // namespace | return true; case 24 /* DotToken */: - return containingNodeKind === 256 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 253 /* ModuleDeclaration */; // module A.| case 18 /* OpenBraceToken */: - return containingNodeKind === 252 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 249 /* ClassDeclaration */; // class A{ | case 62 /* EqualsToken */: - return containingNodeKind === 249 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 216 /* BinaryExpression */; // x = a| + return containingNodeKind === 246 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 213 /* BinaryExpression */; // x = a| case 15 /* TemplateHead */: - return containingNodeKind === 218 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 215 /* TemplateExpression */; // `aa ${| case 16 /* TemplateMiddle */: - return containingNodeKind === 228 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 225 /* TemplateSpan */; // `aa ${10} dd ${| case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - return containingNodeKind === 163 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 162 /* PropertyDeclaration */; // class A{ public | } } return false; @@ -119923,18 +117044,17 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 200 /* ObjectLiteralExpression */) { - var instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker); - if (instantiatedType === undefined) { + if (objectLikeContainer.kind === 197 /* ObjectLiteralExpression */) { + var instantiatedType = typeChecker.getContextualType(objectLikeContainer); + var completionsType = instantiatedType && typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); + if (!instantiatedType || !completionsType) return 2 /* Fail */; - } - var completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */); - isNewIdentifierLocation = ts.hasIndexSignature(completionsType || instantiatedType); + isNewIdentifierLocation = ts.hasIndexSignature(instantiatedType || completionsType); typeMembers = getPropertiesForObjectExpression(instantiatedType, completionsType, objectLikeContainer, typeChecker); existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 196 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 193 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -119945,12 +117065,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 239 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 160 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 236 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 159 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 165 /* MethodDeclaration */ || rootDeclaration.parent.kind === 168 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 164 /* MethodDeclaration */ || rootDeclaration.parent.kind === 167 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -119997,9 +117117,9 @@ var ts; if (!namedImportsOrExports) return 0 /* Continue */; // try to show exported member for imported/re-exported module - var moduleSpecifier = (namedImportsOrExports.kind === 264 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + var moduleSpecifier = (namedImportsOrExports.kind === 261 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; if (!moduleSpecifier) - return namedImportsOrExports.kind === 264 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; + return namedImportsOrExports.kind === 261 /* NamedImports */ ? 2 /* Fail */ : 0 /* Continue */; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); // TODO: GH#18217 if (!moduleSpecifierSymbol) return 2 /* Fail */; @@ -120152,11 +117272,11 @@ var ts; case 30 /* LessThanSlashToken */: case 43 /* SlashToken */: case 78 /* Identifier */: - case 201 /* PropertyAccessExpression */: - case 281 /* JsxAttributes */: - case 280 /* JsxAttribute */: - case 282 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 274 /* JsxSelfClosingElement */ || parent.kind === 275 /* JsxOpeningElement */)) { + case 198 /* PropertyAccessExpression */: + case 278 /* JsxAttributes */: + case 277 /* JsxAttribute */: + case 279 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 271 /* JsxSelfClosingElement */ || parent.kind === 272 /* JsxOpeningElement */)) { if (contextToken.kind === 31 /* GreaterThanToken */) { var precedingToken = ts.findPrecedingToken(contextToken.pos, sourceFile, /*startNode*/ undefined); if (!parent.typeArguments || (precedingToken && precedingToken.kind === 43 /* SlashToken */)) @@ -120164,7 +117284,7 @@ var ts; } return parent; } - else if (parent.kind === 280 /* JsxAttribute */) { + else if (parent.kind === 277 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -120176,7 +117296,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 10 /* StringLiteral */: - if (parent && ((parent.kind === 280 /* JsxAttribute */) || (parent.kind === 282 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 277 /* JsxAttribute */) || (parent.kind === 279 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -120186,8 +117306,8 @@ var ts; break; case 19 /* CloseBraceToken */: if (parent && - parent.kind === 283 /* JsxExpression */ && - parent.parent && parent.parent.kind === 280 /* JsxAttribute */) { + parent.kind === 280 /* JsxExpression */ && + parent.parent && parent.parent.kind === 277 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -120195,7 +117315,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 282 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 279 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -120215,51 +117335,51 @@ var ts; var containingNodeKind = parent.kind; switch (contextToken.kind) { case 27 /* CommaToken */: - return containingNodeKind === 249 /* VariableDeclaration */ || + return containingNodeKind === 246 /* VariableDeclaration */ || isVariableDeclarationListButNotTypeArgument(contextToken) || - containingNodeKind === 232 /* VariableStatement */ || - containingNodeKind === 255 /* EnumDeclaration */ || // enum a { foo, | + containingNodeKind === 229 /* VariableStatement */ || + containingNodeKind === 252 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 253 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 24 /* DotToken */: - return containingNodeKind === 197 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 194 /* ArrayBindingPattern */; // var [.| case 58 /* ColonToken */: - return containingNodeKind === 198 /* BindingElement */; // var {x :html| + return containingNodeKind === 195 /* BindingElement */; // var {x :html| case 22 /* OpenBracketToken */: - return containingNodeKind === 197 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 194 /* ArrayBindingPattern */; // var [x| case 20 /* OpenParenToken */: - return containingNodeKind === 287 /* CatchClause */ || + return containingNodeKind === 284 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 18 /* OpenBraceToken */: - return containingNodeKind === 255 /* EnumDeclaration */; // enum a { | + return containingNodeKind === 252 /* EnumDeclaration */; // enum a { | case 29 /* LessThanToken */: - return containingNodeKind === 252 /* ClassDeclaration */ || // class A< | - containingNodeKind === 221 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 253 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 254 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 249 /* ClassDeclaration */ || // class A< | + containingNodeKind === 218 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 250 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 251 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 123 /* StaticKeyword */: - return containingNodeKind === 163 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); + return containingNodeKind === 162 /* PropertyDeclaration */ && !ts.isClassLike(parent.parent); case 25 /* DotDotDotToken */: - return containingNodeKind === 160 /* Parameter */ || - (!!parent.parent && parent.parent.kind === 197 /* ArrayBindingPattern */); // var [...z| + return containingNodeKind === 159 /* Parameter */ || + (!!parent.parent && parent.parent.kind === 194 /* ArrayBindingPattern */); // var [...z| case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - return containingNodeKind === 160 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); + return containingNodeKind === 159 /* Parameter */ && !ts.isConstructorDeclaration(parent.parent); case 126 /* AsKeyword */: - return containingNodeKind === 265 /* ImportSpecifier */ || - containingNodeKind === 270 /* ExportSpecifier */ || - containingNodeKind === 263 /* NamespaceImport */; + return containingNodeKind === 262 /* ImportSpecifier */ || + containingNodeKind === 267 /* ExportSpecifier */ || + containingNodeKind === 260 /* NamespaceImport */; case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: return !isFromObjectTypeDeclaration(contextToken); case 83 /* ClassKeyword */: case 91 /* EnumKeyword */: @@ -120269,7 +117389,7 @@ var ts; case 99 /* ImportKeyword */: case 118 /* LetKeyword */: case 84 /* ConstKeyword */: - case 149 /* TypeKeyword */: // type htm| + case 148 /* TypeKeyword */: // type htm| return true; case 41 /* AsteriskToken */: return ts.isFunctionLike(contextToken.parent) && !ts.isMethodDeclaration(contextToken.parent); @@ -120316,7 +117436,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 166 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 165 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -120326,7 +117446,7 @@ var ts; return false; } function isVariableDeclarationListButNotTypeArgument(node) { - return node.parent.kind === 250 /* VariableDeclarationList */ + return node.parent.kind === 247 /* VariableDeclarationList */ && !ts.isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker); } /** @@ -120344,13 +117464,13 @@ var ts; for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 288 /* PropertyAssignment */ && - m.kind !== 289 /* ShorthandPropertyAssignment */ && - m.kind !== 198 /* BindingElement */ && - m.kind !== 165 /* MethodDeclaration */ && - m.kind !== 167 /* GetAccessor */ && - m.kind !== 168 /* SetAccessor */ && - m.kind !== 290 /* SpreadAssignment */) { + if (m.kind !== 285 /* PropertyAssignment */ && + m.kind !== 286 /* ShorthandPropertyAssignment */ && + m.kind !== 195 /* BindingElement */ && + m.kind !== 164 /* MethodDeclaration */ && + m.kind !== 166 /* GetAccessor */ && + m.kind !== 167 /* SetAccessor */ && + m.kind !== 287 /* SpreadAssignment */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -120423,10 +117543,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 163 /* PropertyDeclaration */ && - m.kind !== 165 /* MethodDeclaration */ && - m.kind !== 167 /* GetAccessor */ && - m.kind !== 168 /* SetAccessor */) { + if (m.kind !== 162 /* PropertyDeclaration */ && + m.kind !== 164 /* MethodDeclaration */ && + m.kind !== 166 /* GetAccessor */ && + m.kind !== 167 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -120468,7 +117588,7 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 280 /* JsxAttribute */) { + if (attr.kind === 277 /* JsxAttribute */) { seenNames.add(attr.name.escapedText); } else if (ts.isJsxSpreadAttribute(attr)) { @@ -120518,7 +117638,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 80 /* FirstKeyword */; i <= 156 /* LastKeyword */; i++) { + for (var i = 80 /* FirstKeyword */; i <= 155 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -120545,10 +117665,11 @@ var ts; case 1 /* All */: return isFunctionLikeBodyKeyword(kind) || kind === 133 /* DeclareKeyword */ - || kind === 139 /* ModuleKeyword */ - || kind === 149 /* TypeKeyword */ - || kind === 140 /* NamespaceKeyword */ - || ts.isTypeKeyword(kind) && kind !== 150 /* UndefinedKeyword */; + || kind === 138 /* ModuleKeyword */ + || kind === 148 /* TypeKeyword */ + || kind === 139 /* NamespaceKeyword */ + || kind === 126 /* AsKeyword */ + || ts.isTypeKeyword(kind) && kind !== 149 /* UndefinedKeyword */; case 5 /* FunctionLikeBodyKeywords */: return isFunctionLikeBodyKeyword(kind); case 2 /* ClassElementKeywords */: @@ -120570,44 +117691,44 @@ var ts; switch (kind) { case 125 /* AbstractKeyword */: case 128 /* AnyKeyword */: - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: case 133 /* DeclareKeyword */: case 91 /* EnumKeyword */: - case 154 /* GlobalKeyword */: + case 153 /* GlobalKeyword */: case 116 /* ImplementsKeyword */: case 135 /* InferKeyword */: case 117 /* InterfaceKeyword */: - case 137 /* IsKeyword */: - case 138 /* KeyOfKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: - case 141 /* NeverKeyword */: - case 144 /* NumberKeyword */: - case 145 /* ObjectKeyword */: + case 136 /* IsKeyword */: + case 137 /* KeyOfKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: + case 140 /* NeverKeyword */: + case 143 /* NumberKeyword */: + case 144 /* ObjectKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 122 /* PublicKeyword */: - case 142 /* ReadonlyKeyword */: - case 147 /* StringKeyword */: - case 148 /* SymbolKeyword */: - case 149 /* TypeKeyword */: - case 151 /* UniqueKeyword */: - case 152 /* UnknownKeyword */: + case 141 /* ReadonlyKeyword */: + case 146 /* StringKeyword */: + case 147 /* SymbolKeyword */: + case 148 /* TypeKeyword */: + case 150 /* UniqueKeyword */: + case 151 /* UnknownKeyword */: return true; default: return false; } } function isInterfaceOrTypeLiteralCompletionKeyword(kind) { - return kind === 142 /* ReadonlyKeyword */; + return kind === 141 /* ReadonlyKeyword */; } function isClassMemberCompletionKeyword(kind) { switch (kind) { case 125 /* AbstractKeyword */: case 132 /* ConstructorKeyword */: case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: case 129 /* AsyncKeyword */: case 133 /* DeclareKeyword */: return true; @@ -120618,7 +117739,6 @@ var ts; function isFunctionLikeBodyKeyword(kind) { return kind === 129 /* AsyncKeyword */ || kind === 130 /* AwaitKeyword */ - || kind === 126 /* AsKeyword */ || !ts.isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); } function keywordForNode(node) { @@ -120669,7 +117789,7 @@ var ts; function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) { // class c { method() { } | method2() { } } switch (location.kind) { - case 334 /* SyntaxList */: + case 329 /* SyntaxList */: return ts.tryCast(location.parent, ts.isObjectTypeDeclaration); case 1 /* EndOfFileToken */: var cls = ts.tryCast(ts.lastOrUndefined(ts.cast(location.parent, ts.isSourceFile).statements), ts.isObjectTypeDeclaration); @@ -120772,19 +117892,6 @@ var ts; } return false; } - function isStaticProperty(symbol) { - return !!(symbol.valueDeclaration && ts.getEffectiveModifierFlags(symbol.valueDeclaration) & 32 /* Static */ && ts.isClassLike(symbol.valueDeclaration.parent)); - } - function tryGetObjectLiteralContextualType(node, typeChecker) { - var type = typeChecker.getContextualType(node); - if (type) { - return type; - } - if (ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 62 /* EqualsToken */) { - return typeChecker.getTypeAtLocation(node.parent); - } - return undefined; - } })(Completions = ts.Completions || (ts.Completions = {})); })(ts || (ts = {})); var ts; @@ -120868,8 +117975,8 @@ var ts; case 132 /* ConstructorKeyword */: return getFromAllDeclarations(ts.isConstructorDeclaration, [132 /* ConstructorKeyword */]); case 134 /* GetKeyword */: - case 146 /* SetKeyword */: - return getFromAllDeclarations(ts.isAccessor, [134 /* GetKeyword */, 146 /* SetKeyword */]); + case 145 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [134 /* GetKeyword */, 145 /* SetKeyword */]); case 130 /* AwaitKeyword */: return useParent(node.parent, ts.isAwaitExpression, getAsyncAndAwaitOccurrences); case 129 /* AsyncKeyword */: @@ -120917,7 +118024,7 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 297 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 294 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has @@ -120949,16 +118056,16 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 244 /* SwitchStatement */: - if (statement.kind === 240 /* ContinueStatement */) { + case 241 /* SwitchStatement */: + if (statement.kind === 237 /* ContinueStatement */) { return false; } // falls through - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 236 /* WhileStatement */: - case 235 /* DoStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 233 /* WhileStatement */: + case 232 /* DoStatement */: return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. @@ -120974,11 +118081,11 @@ var ts; // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 257 /* ModuleBlock */: - case 297 /* SourceFile */: - case 230 /* Block */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 254 /* ModuleBlock */: + case 294 /* SourceFile */: + case 227 /* Block */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return __spreadArrays(declaration.members, [declaration]); @@ -120986,14 +118093,14 @@ var ts; else { return container.statements; } - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: return __spreadArrays(container.parameters, (ts.isClassLike(container.parent) ? container.parent.members : [])); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 177 /* TypeLiteral */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 176 /* TypeLiteral */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -121007,9 +118114,6 @@ var ts; return __spreadArrays(nodes, [container]); } return nodes; - // Syntactically invalid positions that the parser might produce anyway - case 200 /* ObjectLiteralExpression */: - return undefined; default: ts.Debug.assertNever(container, "Invalid container kind."); } @@ -121029,7 +118133,7 @@ var ts; var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 96 /* ForKeyword */, 114 /* WhileKeyword */, 89 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 235 /* DoStatement */) { + if (loopNode.kind === 232 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 114 /* WhileKeyword */)) { @@ -121049,13 +118153,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -121422,39 +118526,41 @@ var ts; if (cancellationToken) cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 249 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 246 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 78 /* Identifier */) { directImports.push(name); break; } } + // Don't support re-exporting 'require()' calls, so just add a single indirect user. + addIndirectUser(direct.getSourceFile()); } break; case 78 /* Identifier */: // for 'const x = require("y"); break; // TODO: GH#23879 - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasSyntacticModifier(direct, 1 /* Export */), /*alreadyAddedDirect*/ false); break; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: directImports.push(direct); var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 263 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 260 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name, /*isReExport*/ false, /*alreadyAddedDirect*/ true); } else if (!isAvailableThroughGlobal && ts.isDefaultImport(direct)) { addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); // Add a check for indirect uses to handle synthetic default imports } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); } - else if (direct.exportClause.kind === 269 /* NamespaceExport */) { + else if (direct.exportClause.kind === 266 /* NamespaceExport */) { // `export * as foo from "foo"` add to indirect uses addIndirectUsers(getSourceFileLikeForImportDeclaration(direct)); } @@ -121463,7 +118569,7 @@ var ts; directImports.push(direct); } break; - case 195 /* ImportType */: + case 192 /* ImportType */: directImports.push(direct); break; default: @@ -121480,7 +118586,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 297 /* SourceFile */ || sourceFileLike.kind === 256 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 294 /* SourceFile */ || sourceFileLike.kind === 253 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -121537,7 +118643,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 260 /* ImportEqualsDeclaration */) { + if (decl.kind === 257 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -121547,7 +118653,7 @@ var ts; handleNamespaceImportLike(decl); return; } - if (decl.kind === 195 /* ImportType */) { + if (decl.kind === 192 /* ImportType */) { if (decl.qualifier) { var firstIdentifier = ts.getFirstIdentifier(decl.qualifier); if (firstIdentifier.escapedText === ts.symbolName(exportSymbol)) { @@ -121563,7 +118669,7 @@ var ts; if (decl.moduleSpecifier.kind !== 10 /* StringLiteral */) { return; } - if (decl.kind === 267 /* ExportDeclaration */) { + if (decl.kind === 264 /* ExportDeclaration */) { if (decl.exportClause && ts.isNamedExports(decl.exportClause)) { searchForNamedImport(decl.exportClause); } @@ -121572,10 +118678,10 @@ var ts; var _a = decl.importClause || { name: undefined, namedBindings: undefined }, name = _a.name, namedBindings = _a.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: handleNamespaceImportLike(namedBindings.name); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: // 'default' might be accessed as a named import `{ default as foo }`. if (exportKind === 0 /* Named */ || exportKind === 1 /* Default */) { searchForNamedImport(namedBindings); @@ -121625,7 +118731,7 @@ var ts; } } else { - var localSymbol = element.kind === 270 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 267 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -121654,7 +118760,7 @@ var ts; for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { var referencingFile = sourceFiles_1[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 297 /* SourceFile */) { + if (searchSourceFile.kind === 294 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -121702,7 +118808,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 297 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 294 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -121717,15 +118823,15 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 267 /* ExportDeclaration */: - case 261 /* ImportDeclaration */: { + case 264 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && ts.isStringLiteral(decl.moduleSpecifier)) { action(decl, decl.moduleSpecifier); } break; } - case 260 /* ImportEqualsDeclaration */: { + case 257 /* ImportEqualsDeclaration */: { var decl = statement; if (isExternalModuleImportEquals(decl)) { action(decl, decl.moduleReference.expression); @@ -121749,7 +118855,7 @@ var ts; var parent = node.parent; var grandParent = parent.parent; if (symbol.exportSymbol) { - if (parent.kind === 201 /* PropertyAccessExpression */) { + if (parent.kind === 198 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(grandParent) @@ -121882,17 +118988,15 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return !parent.propertyName; - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return true; - case 198 /* BindingElement */: - return ts.isInJSFile(node) && ts.isRequireVariableDeclaration(parent, /*requireStringLiteralLikeArgument*/ true); default: return false; } @@ -121915,14 +119019,6 @@ var ts; if (ts.isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) { return checker.getExportSpecifierLocalTargetSymbol(declaration); } - else if (ts.isPropertyAccessExpression(declaration) && ts.isModuleExportsAccessExpression(declaration.expression) && !ts.isPrivateIdentifier(declaration.name)) { - return checker.getExportSpecifierLocalTargetSymbol(declaration.name); - } - else if (ts.isShorthandPropertyAssignment(declaration) - && ts.isBinaryExpression(declaration.parent.parent) - && ts.getAssignmentDeclarationKind(declaration.parent.parent) === 2 /* ModuleExports */) { - return checker.getExportSpecifierLocalTargetSymbol(declaration.name); - } } } return symbol; @@ -121931,21 +119027,21 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 297 /* SourceFile */) { + if (parent.kind === 294 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 257 /* ModuleBlock */); + ts.Debug.assert(parent.kind === 254 /* ModuleBlock */); return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; + return node.kind === 253 /* ModuleDeclaration */ && node.name.kind === 10 /* StringLiteral */; } function isExternalModuleImportEquals(eq) { - return eq.moduleReference.kind === 272 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; + return eq.moduleReference.kind === 269 /* ExternalModuleReference */ && eq.moduleReference.expression.kind === 10 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -122047,7 +119143,7 @@ var ts; if (!node) return undefined; switch (node.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return !ts.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : ts.isVariableStatement(node.parent.parent) ? @@ -122055,28 +119151,28 @@ var ts; ts.isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getContextNode(node.parent.parent); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return node.parent.parent.parent; - case 270 /* ExportSpecifier */: - case 263 /* NamespaceImport */: + case 267 /* ExportSpecifier */: + case 260 /* NamespaceImport */: return node.parent.parent; - case 262 /* ImportClause */: - case 269 /* NamespaceExport */: + case 259 /* ImportClause */: + case 266 /* NamespaceExport */: return node.parent; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return ts.isExpressionStatement(node.parent) ? node.parent : node; - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: return { start: node.initializer, end: node.expression }; - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(ts.findAncestor(node.parent, function (node) { return ts.isBinaryExpression(node) || ts.isForInOrOfStatement(node); @@ -122133,9 +119229,9 @@ var ts; var node = ts.getTouchingPropertyName(sourceFile, position); var referenceEntries; var entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); - if (node.parent.kind === 201 /* PropertyAccessExpression */ - || node.parent.kind === 198 /* BindingElement */ - || node.parent.kind === 202 /* ElementAccessExpression */ + if (node.parent.kind === 198 /* PropertyAccessExpression */ + || node.parent.kind === 195 /* BindingElement */ + || node.parent.kind === 199 /* ElementAccessExpression */ || node.kind === 105 /* SuperKeyword */) { referenceEntries = entries && __spreadArrays(entries); } @@ -122159,13 +119255,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 286 /* ShorthandPropertyAssignment */) { var result_1 = []; Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_1.push(nodeEntry(node)); }); return result_1; @@ -122331,13 +119427,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 200 /* ObjectLiteralExpression */) { + else if (node.kind === 197 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(21 /* CloseParenToken */)] }; } - else if (node.kind === 221 /* ClassExpression */) { + else if (node.kind === 218 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(20 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(21 /* CloseParenToken */)] @@ -122398,47 +119494,47 @@ var ts; if (!!(decl.flags & 8388608 /* Ambient */)) return true; switch (decl.kind) { - case 216 /* BinaryExpression */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 213 /* BinaryExpression */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: case 87 /* DefaultKeyword */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 270 /* ExportSpecifier */: - case 262 /* ImportClause */: // default import - case 260 /* ImportEqualsDeclaration */: - case 265 /* ImportSpecifier */: - case 253 /* InterfaceDeclaration */: - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 280 /* JsxAttribute */: - case 256 /* ModuleDeclaration */: - case 259 /* NamespaceExportDeclaration */: - case 263 /* NamespaceImport */: - case 269 /* NamespaceExport */: - case 160 /* Parameter */: - case 289 /* ShorthandPropertyAssignment */: - case 254 /* TypeAliasDeclaration */: - case 159 /* TypeParameter */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 267 /* ExportSpecifier */: + case 259 /* ImportClause */: // default import + case 257 /* ImportEqualsDeclaration */: + case 262 /* ImportSpecifier */: + case 250 /* InterfaceDeclaration */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 277 /* JsxAttribute */: + case 253 /* ModuleDeclaration */: + case 256 /* NamespaceExportDeclaration */: + case 260 /* NamespaceImport */: + case 266 /* NamespaceExport */: + case 159 /* Parameter */: + case 286 /* ShorthandPropertyAssignment */: + case 251 /* TypeAliasDeclaration */: + case 158 /* TypeParameter */: return true; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // In `({ x: y } = 0);`, `x` is not a write access. (Won't call this function for `y`.) return !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return !!decl.body; - case 249 /* VariableDeclaration */: - case 163 /* PropertyDeclaration */: + case 246 /* VariableDeclaration */: + case 162 /* PropertyDeclaration */: return !!decl.initializer || ts.isCatchClause(decl.parent); - case 164 /* MethodSignature */: - case 162 /* PropertySignature */: - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: + case 163 /* MethodSignature */: + case 161 /* PropertySignature */: + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: return false; default: return ts.Debug.failBadSyntaxKind(decl); @@ -122599,10 +119695,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { references.push(nodeEntry(decl.name)); } @@ -122631,9 +119727,9 @@ var ts; } /** As in a `readonly prop: any` or `constructor(readonly prop: any)`, not a `readonly any[]`. */ function isReadonlyTypeOperator(node) { - return node.kind === 142 /* ReadonlyKeyword */ + return node.kind === 141 /* ReadonlyKeyword */ && ts.isTypeOperatorNode(node.parent) - && node.parent.operator === 142 /* ReadonlyKeyword */; + && node.parent.operator === 141 /* ReadonlyKeyword */; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -122644,12 +119740,12 @@ var ts; } // A modifier readonly (like on a property declaration) is not special; // a readonly type keyword (like `readonly string[]`) is. - if (node.kind === 142 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { + if (node.kind === 141 /* ReadonlyKeyword */ && !isReadonlyTypeOperator(node)) { return undefined; } // Likewise, when we *are* looking for a special keyword, make sure we // *don’t* include readonly member modifiers. - return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 142 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 141 /* ReadonlyKeyword */ ? isReadonlyTypeOperator : undefined); } // Labels if (ts.isJumpStatementTarget(node)) { @@ -122950,7 +120046,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 208 /* FunctionExpression */ || valueDeclaration.kind === 221 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 205 /* FunctionExpression */ || valueDeclaration.kind === 218 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -122960,7 +120056,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasEffectiveModifier(d, 8 /* Private */) || ts.isPrivateIdentifierPropertyDeclaration(d); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 252 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 249 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -122989,7 +120085,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 297 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 294 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -123361,14 +120457,14 @@ var ts; for (var _i = 0, _a = constructorSymbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var ctrKeyword = ts.findChildOfKind(decl, 132 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 166 /* Constructor */ && !!ctrKeyword); + ts.Debug.assert(decl.kind === 165 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } } if (classSymbol.exports) { classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 165 /* MethodDeclaration */) { + if (decl && decl.kind === 164 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 107 /* ThisKeyword */, function (thisKeyword) { @@ -123392,7 +120488,7 @@ var ts; } for (var _i = 0, _a = constructor.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 166 /* Constructor */); + ts.Debug.assert(decl.kind === 165 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 105 /* SuperKeyword */, function (node) { @@ -123422,7 +120518,7 @@ var ts; if (refNode.kind !== 78 /* Identifier */) { return; } - if (refNode.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 286 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -123442,7 +120538,7 @@ var ts; } else if (ts.isFunctionLike(typeHavingNode) && typeHavingNode.body) { var body = typeHavingNode.body; - if (body.kind === 230 /* Block */) { + if (body.kind === 227 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression) addIfImplementation(returnStatement.expression); @@ -123470,13 +120566,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: - case 200 /* ObjectLiteralExpression */: - case 221 /* ClassExpression */: - case 199 /* ArrayLiteralExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 197 /* ObjectLiteralExpression */: + case 218 /* ClassExpression */: + case 196 /* ArrayLiteralExpression */: return true; default: return false; @@ -123529,13 +120625,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: staticFlag &= ts.getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -123556,41 +120652,41 @@ var ts; return [{ definition: { type: 0 /* Symbol */, symbol: searchSpaceNode.symbol }, references: references }]; } function isParameterName(node) { - return node.kind === 78 /* Identifier */ && node.parent.kind === 160 /* Parameter */ && node.parent.name === node; + return node.kind === 78 /* Identifier */ && node.parent.kind === 159 /* Parameter */ && node.parent.name === node; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: staticFlag &= ts.getSyntacticModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { return undefined; } // falls through - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. default: return undefined; } - var references = ts.flatMap(searchSpaceNode.kind === 297 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { + var references = ts.flatMap(searchSpaceNode.kind === 294 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()], function (sourceFile) { cancellationToken.throwIfCancellationRequested(); return getPossibleSymbolReferenceNodes(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function (node) { if (!ts.isThis(node)) { @@ -123598,19 +120694,19 @@ var ts; } var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); switch (searchSpaceNode.kind) { - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: return searchSpaceNode.symbol === container.symbol; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: return ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: // Make sure the container belongs to the same class // and has the appropriate static modifier from the original container. return container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getSyntacticModifierFlags(container) & 32 /* Static */) === staticFlag; - case 297 /* SourceFile */: - return container.kind === 297 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); + case 294 /* SourceFile */: + return container.kind === 294 /* SourceFile */ && !ts.isExternalModule(container) && !isParameterName(node); } }); }).map(function (n) { return nodeEntry(n); }); @@ -123709,7 +120805,7 @@ var ts; ts.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1 /* FunctionScopedVariable */) && !!(paramProps[1].flags & 4 /* Property */)); // is [parameter, property] return fromRoot(symbol.flags & 1 /* FunctionScopedVariable */ ? paramProps[1] : paramProps[0]); } - var exportSpecifier = ts.getDeclarationOfKind(symbol, 270 /* ExportSpecifier */); + var exportSpecifier = ts.getDeclarationOfKind(symbol, 267 /* ExportSpecifier */); if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); if (localSymbol) { @@ -123754,7 +120850,7 @@ var ts; }); } function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker) { - var bindingElement = ts.getDeclarationOfKind(symbol, 198 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 195 /* BindingElement */); if (bindingElement && ts.isObjectBindingElementWithoutPropertyName(bindingElement)) { return ts.getPropertySymbolFromBindingElement(checker, bindingElement); } @@ -123981,16 +121077,16 @@ var ts; return; } switch (node.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: - if (node.parent.kind === 200 /* ObjectLiteralExpression */) { + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: + if (node.parent.kind === 197 /* ObjectLiteralExpression */) { return (_a = ts.getAssignedName(node.parent)) === null || _a === void 0 ? void 0 : _a.getText(); } return (_b = ts.getNameOfDeclaration(node.parent)) === null || _b === void 0 ? void 0 : _b.getText(); - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: if (ts.isModuleBlock(node.parent) && ts.isIdentifier(node.parent.parent.name)) { return node.parent.parent.name.getText(); } @@ -124196,55 +121292,55 @@ var ts; } switch (node.kind) { case 78 /* Identifier */: - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: // do not descend into nodes that cannot contain callable nodes return; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: // do not descend into the type side of an assertion collect(node.expression); return; - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: // do not descend into the type of a variable or parameter declaration collect(node.name); collect(node.initializer); return; - case 203 /* CallExpression */: + case 200 /* CallExpression */: // do not descend into the type arguments of a call expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 204 /* NewExpression */: + case 201 /* NewExpression */: // do not descend into the type arguments of a new expression recordCallSite(node); collect(node.expression); ts.forEach(node.arguments, collect); return; - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: // do not descend into the type arguments of a tagged template expression recordCallSite(node); collect(node.tag); collect(node.template); return; - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: // do not descend into the type arguments of a JsxOpeningLikeElement recordCallSite(node); collect(node.tagName); collect(node.attributes); return; - case 161 /* Decorator */: + case 160 /* Decorator */: recordCallSite(node); collect(node.expression); return; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: recordCallSite(node); ts.forEachChild(node, collect); break; @@ -124294,22 +121390,22 @@ var ts; var callSites = []; var collect = createCallSiteCollector(program, callSites); switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: collectCallSitesOfSourceFile(node, collect); break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: collectCallSitesOfModuleDeclaration(node, collect); break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: collectCallSitesOfClassLikeDeclaration(node, collect); break; default: @@ -124590,7 +121686,9 @@ var ts; var sigInfo = createDefinitionFromSignatureDeclaration(typeChecker, calledDeclaration); // For a function, if this is the original function definition, return just sigInfo. // If this is the original constructor definition, parent is the class. - if (typeChecker.getRootSymbols(symbol).some(function (s) { return symbolMatchesSignature(s, calledDeclaration); })) { + if (typeChecker.getRootSymbols(symbol).some(function (s) { return symbolMatchesSignature(s, calledDeclaration); }) || + // TODO: GH#25533 Following check shouldn't be necessary if 'require' is an alias + symbol.declarations && symbol.declarations.some(function (d) { return ts.isVariableDeclaration(d) && !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ false); })) { return [sigInfo]; } else { @@ -124604,7 +121702,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 286 /* ShorthandPropertyAssignment */) { var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); return shorthandSymbol_1 ? shorthandSymbol_1.declarations.map(function (decl) { return createDefinitionInfo(decl, typeChecker, shorthandSymbol_1, node); }) : []; } @@ -124649,11 +121747,6 @@ var ts; return getDefinitionFromSymbol(typeChecker, symbol, node); } GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition; - function isShorthandPropertyAssignmentOfModuleExports(symbol) { - var shorthandProperty = ts.tryCast(symbol.valueDeclaration, ts.isShorthandPropertyAssignment); - var binaryExpression = ts.tryCast(shorthandProperty === null || shorthandProperty === void 0 ? void 0 : shorthandProperty.parent.parent, ts.isAssignmentExpression); - return !!binaryExpression && ts.getAssignmentDeclarationKind(binaryExpression) === 2 /* ModuleExports */; - } /** * True if we should not add definitions for both the signature symbol and the definition symbol. * True for `const |f = |() => 0`, false for `function |f() {} const |g = f;`. @@ -124751,24 +121844,19 @@ var ts; // get the aliased symbol instead. This allows for goto def on an import e.g. // import {A, B} from "mod"; // to jump to the implementation directly. - while (symbol) { - if (symbol.flags & 2097152 /* Alias */ && shouldSkipAlias(node, symbol.declarations[0])) { - var aliased = checker.getAliasedSymbol(symbol); - if (!aliased.declarations) { - break; - } - symbol = aliased; + if (symbol && symbol.flags & 2097152 /* Alias */ && shouldSkipAlias(node, symbol.declarations[0])) { + var aliased = checker.getAliasedSymbol(symbol); + if (aliased.declarations) { + return aliased; } - else if (isShorthandPropertyAssignmentOfModuleExports(symbol)) { - // Skip past `module.exports = { Foo }` even though 'Foo' is not a real alias - var shorthandTarget = checker.resolveName(symbol.name, symbol.valueDeclaration, 111551 /* Value */, /*excludeGlobals*/ false); - if (!ts.some(shorthandTarget === null || shorthandTarget === void 0 ? void 0 : shorthandTarget.declarations)) { - break; + } + if (symbol && ts.isInJSFile(node)) { + var requireCall = ts.forEach(symbol.declarations, function (d) { return ts.isVariableDeclaration(d) && !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true) ? d.initializer : undefined; }); + if (requireCall) { + var moduleSymbol = checker.getSymbolAtLocation(requireCall.arguments[0]); + if (moduleSymbol) { + return checker.resolveExternalModuleSymbol(moduleSymbol); } - symbol = shorthandTarget; - } - else { - break; } } return symbol; @@ -124786,14 +121874,11 @@ var ts; return true; } switch (declaration.kind) { - case 262 /* ImportClause */: - case 260 /* ImportEqualsDeclaration */: + case 259 /* ImportClause */: + case 257 /* ImportEqualsDeclaration */: return true; - case 265 /* ImportSpecifier */: - return declaration.parent.kind === 264 /* NamedImports */; - case 198 /* BindingElement */: - case 249 /* VariableDeclaration */: - return ts.isInJSFile(declaration) && ts.isRequireVariableDeclaration(declaration, /*requireStringLiteralLikeArgument*/ true); + case 262 /* ImportSpecifier */: + return declaration.parent.kind === 261 /* NamedImports */; default: return false; } @@ -124878,9 +121963,9 @@ var ts; } function isConstructorLike(node) { switch (node.kind) { - case 166 /* Constructor */: - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 165 /* Constructor */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: return true; default: return false; @@ -124995,11 +122080,11 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return [declaration]; - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: return [declaration, declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -125020,19 +122105,18 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return withNode(tag.class); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return withNode(tag.class); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 329 /* JSDocTypeTag */: + case 325 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: - case 332 /* JSDocSeeTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -125054,7 +122138,7 @@ var ts; name: tagName, kind: "keyword" /* keyword */, kindModifiers: "", - sortText: ts.Completions.SortText.LocationPriority, + sortText: "0", }; })); } @@ -125066,7 +122150,7 @@ var ts; name: "@" + tagName, kind: "keyword" /* keyword */, kindModifiers: "", - sortText: ts.Completions.SortText.LocationPriority + sortText: "0" }; })); } @@ -125100,7 +122184,7 @@ var ts; || nameThusFar !== undefined && !ts.startsWith(name, nameThusFar)) { return undefined; } - return { name: name, kind: "parameter" /* parameterElement */, kindModifiers: "", sortText: ts.Completions.SortText.LocationPriority }; + return { name: name, kind: "parameter" /* parameterElement */, kindModifiers: "", sortText: "0" }; }); } JsDoc.getJSDocParameterNameCompletions = getJSDocParameterNameCompletions; @@ -125201,24 +122285,23 @@ var ts; } function getCommentOwnerInfoWorker(commentOwner) { switch (commentOwner.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 164 /* MethodSignature */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 163 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getCommentOwnerInfoWorker(commentOwner.initializer); - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 162 /* PropertySignature */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 254 /* TypeAliasDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 161 /* PropertySignature */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 251 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 232 /* VariableStatement */: { + case 229 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -125226,16 +122309,16 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 297 /* SourceFile */: + case 294 /* SourceFile */: return "quit"; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 256 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 233 /* ExpressionStatement */: + return commentOwner.parent.kind === 253 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 230 /* ExpressionStatement */: return getCommentOwnerInfoWorker(commentOwner.expression); - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var be = commentOwner; if (ts.getAssignmentDeclarationKind(be) === 0 /* None */) { return "quit"; @@ -125243,7 +122326,7 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: var init = commentOwner.initializer; if (init && (ts.isFunctionExpression(init) || ts.isArrowFunction(init))) { return { commentOwner: commentOwner, parameters: init.parameters }; @@ -125259,14 +122342,14 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 207 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 204 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return rightHandSide.parameters; - case 221 /* ClassExpression */: { + case 218 /* ClassExpression */: { var ctr = ts.find(rightHandSide.members, ts.isConstructorDeclaration); return ctr ? ctr.parameters : ts.emptyArray; } @@ -125328,9 +122411,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 262 /* ImportClause */: - case 265 /* ImportSpecifier */: - case 260 /* ImportEqualsDeclaration */: + case 259 /* ImportClause */: + case 262 /* ImportSpecifier */: + case 257 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); // TODO: GH#18217 var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -125340,7 +122423,7 @@ var ts; } function tryAddSingleDeclarationName(declaration, containers) { var name = ts.getNameOfDeclaration(declaration); - return !!name && (pushLiteral(name, containers) || name.kind === 158 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); + return !!name && (pushLiteral(name, containers) || name.kind === 157 /* ComputedPropertyName */ && tryAddComputedPropertyName(name.expression, containers)); } // Only added the names of computed properties if they're simple dotted expressions, like: // @@ -125357,7 +122440,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name && name.kind === 158 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { + if (name && name.kind === 157 /* ComputedPropertyName */ && !tryAddComputedPropertyName(name.expression, containers)) { return ts.emptyArray; } // Don't include the last portion. @@ -125565,7 +122648,7 @@ var ts; return; } switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -125577,21 +122660,21 @@ var ts; } } break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 163 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -125603,7 +122686,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 263 /* NamespaceImport */) { + if (namedBindings.kind === 260 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -125614,17 +122697,17 @@ var ts; } } break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: addNodeWithRecursiveChild(node, node.name); break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: var expression = node.expression; // Use the expression as the name of the SpreadAssignment, otherwise show as . ts.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); break; - case 198 /* BindingElement */: - case 288 /* PropertyAssignment */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 285 /* PropertyAssignment */: + case 246 /* VariableDeclaration */: var _e = node, name = _e.name, initializer = _e.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -125639,7 +122722,7 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: var nameNode = node.name; // If we see a function declaration track as a possible ES5 class if (nameNode && ts.isIdentifier(nameNode)) { @@ -125647,11 +122730,11 @@ var ts; } addNodeWithRecursiveChild(node, node.body); break; - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: startNode(node); for (var _f = 0, _g = node.members; _f < _g.length; _f++) { var member = _g[_f]; @@ -125661,9 +122744,9 @@ var ts; } endNode(); break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: startNode(node); for (var _h = 0, _j = node.members; _h < _j.length; _h++) { var member = _j[_h]; @@ -125671,12 +122754,12 @@ var ts; } endNode(); break; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { var expression_1 = node.expression; - var child = ts.isObjectLiteralExpression(expression_1) || ts.isCallExpression(expression_1) ? expression_1 : + var child = ts.isObjectLiteralExpression(expression_1) ? expression_1 : ts.isArrowFunction(expression_1) || ts.isFunctionExpression(expression_1) ? expression_1.body : undefined; if (child) { startNode(node); @@ -125688,16 +122771,16 @@ var ts; } break; } - case 270 /* ExportSpecifier */: - case 260 /* ImportEqualsDeclaration */: - case 171 /* IndexSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 254 /* TypeAliasDeclaration */: + case 267 /* ExportSpecifier */: + case 257 /* ImportEqualsDeclaration */: + case 170 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 251 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 203 /* CallExpression */: - case 216 /* BinaryExpression */: { + case 200 /* CallExpression */: + case 213 /* BinaryExpression */: { var special = ts.getAssignmentDeclarationKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -125939,12 +123022,12 @@ var ts; return false; } switch (a.kind) { - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return ts.hasSyntacticModifier(a, 32 /* Static */) === ts.hasSyntacticModifier(b, 32 /* Static */); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -125960,7 +123043,7 @@ var ts; // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { // TODO: GH#18217 - return a.body.kind === b.body.kind && (a.body.kind !== 256 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 253 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -125990,7 +123073,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 256 /* ModuleDeclaration */) { + if (node.kind === 253 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -125999,16 +123082,16 @@ var ts; return propertyName && ts.unescapeLeadingUnderscores(propertyName); } switch (node.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 221 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 218 /* ClassExpression */: return getFunctionOrClassName(node); default: return undefined; } } function getItemName(node, name) { - if (node.kind === 256 /* ModuleDeclaration */) { + if (node.kind === 253 /* ModuleDeclaration */) { return cleanText(getModuleName(node)); } if (name) { @@ -126020,18 +123103,18 @@ var ts; } } switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; - case 209 /* ArrowFunction */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: if (ts.getSyntacticModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -126039,13 +123122,13 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return "constructor"; - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return "new()"; - case 169 /* CallSignature */: + case 168 /* CallSignature */: return "()"; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return "[]"; default: return ""; @@ -126078,19 +123161,19 @@ var ts; } // Some nodes are otherwise important enough to always include in the primary navigation menu. switch (navigationBarNodeKind(item)) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 255 /* EnumDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 297 /* SourceFile */: - case 254 /* TypeAliasDeclaration */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 252 /* EnumDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 294 /* SourceFile */: + case 251 /* TypeAliasDeclaration */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: return true; - case 209 /* ArrowFunction */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -126100,10 +123183,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 257 /* ModuleBlock */: - case 297 /* SourceFile */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: + case 254 /* ModuleBlock */: + case 294 /* SourceFile */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: return true; default: return false; @@ -126161,8 +123244,9 @@ var ts; return ts.getTextOfNode(moduleDeclaration.name); } // Otherwise, we need to aggregate each identifier to build up the qualified name. - var result = [ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)]; - while (moduleDeclaration.body && moduleDeclaration.body.kind === 256 /* ModuleDeclaration */) { + var result = []; + result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); + while (moduleDeclaration.body && moduleDeclaration.body.kind === 253 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -126176,13 +123260,13 @@ var ts; return decl.body && ts.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 158 /* ComputedPropertyName */; + return !member.name || member.name.kind === 157 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 297 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 294 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 249 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 246 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -126240,9 +123324,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: return true; default: return false; @@ -126596,11 +123680,11 @@ var ts; function getModuleSpecifierExpression(declaration) { var _a; switch (declaration.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return (_a = ts.tryCast(declaration.moduleReference, ts.isExternalModuleReference)) === null || _a === void 0 ? void 0 : _a.expression; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return declaration.moduleSpecifier; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return declaration.declarationList.declarations[0].initializer.arguments[0]; } } @@ -126639,19 +123723,19 @@ var ts; function getImportKindOrder(s1) { var _a; switch (s1.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: if (!s1.importClause) return 0; if (s1.importClause.isTypeOnly) return 1; - if (((_a = s1.importClause.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 263 /* NamespaceImport */) + if (((_a = s1.importClause.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 260 /* NamespaceImport */) return 2; if (s1.importClause.name) return 3; return 4; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return 5; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return 6; } } @@ -126697,9 +123781,12 @@ var ts; if (depthRemaining === 0) return; cancellationToken.throwIfCancellationRequested(); - if (ts.isDeclaration(n) || ts.isVariableStatement(n) || n.kind === 1 /* EndOfFileToken */) { + if (ts.isDeclaration(n) || n.kind === 1 /* EndOfFileToken */) { addOutliningForLeadingCommentsForNode(n, sourceFile, cancellationToken, out); } + if (isFunctionExpressionAssignedToVariable(n)) { + addOutliningForLeadingCommentsForNode(n.parent.parent.parent, sourceFile, cancellationToken, out); + } if (ts.isFunctionLike(n) && ts.isBinaryExpression(n.parent) && ts.isPropertyAccessExpression(n.parent.left)) { addOutliningForLeadingCommentsForNode(n.parent.left, sourceFile, cancellationToken, out); } @@ -126727,6 +123814,13 @@ var ts; } depthRemaining++; } + function isFunctionExpressionAssignedToVariable(n) { + if (!ts.isFunctionExpression(n) && !ts.isArrowFunction(n)) { + return false; + } + var ancestor = ts.findAncestor(n, ts.isVariableStatement); + return !!ancestor && ts.getSingleInitializerOfVariableStatementOrPropertyDeclaration(ancestor) === n; + } } function addRegionOutliningSpans(sourceFile, out) { var regions = []; @@ -126807,7 +123901,7 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 230 /* Block */: + case 227 /* Block */: if (ts.isFunctionLike(n.parent)) { return functionSpan(n.parent, n, sourceFile); } @@ -126815,16 +123909,16 @@ var ts; // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 235 /* DoStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 237 /* ForStatement */: - case 234 /* IfStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 287 /* CatchClause */: + case 232 /* DoStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 234 /* ForStatement */: + case 231 /* IfStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 284 /* CatchClause */: return spanForNode(n.parent); - case 247 /* TryStatement */: + case 244 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -126841,40 +123935,40 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile), "code" /* Code */); } - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return spanForNode(n.parent); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 258 /* CaseBlock */: - case 177 /* TypeLiteral */: - case 196 /* ObjectBindingPattern */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 255 /* CaseBlock */: + case 176 /* TypeLiteral */: + case 193 /* ObjectBindingPattern */: return spanForNode(n); - case 179 /* TupleType */: + case 178 /* TupleType */: return spanForNode(n, /*autoCollapse*/ false, /*useFullStart*/ !ts.isTupleTypeNode(n.parent), 22 /* OpenBracketToken */); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: return spanForNodeArray(n.statements); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 22 /* OpenBracketToken */); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return spanForJSXElement(n); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return spanForJSXFragment(n); - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: return spanForJSXAttributes(n.attributes); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: return spanForTemplateLiteral(n); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return spanForNode(n, /*autoCollapse*/ false, /*useFullStart*/ !ts.isBindingElement(n.parent), 22 /* OpenBracketToken */); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return spanForArrowFunction(n); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return spanForCallExpression(n); } function spanForCallExpression(node) { @@ -126941,7 +124035,7 @@ var ts; function functionSpan(node, body, sourceFile) { var openToken = tryGetFunctionOpenToken(node, body, sourceFile); var closeToken = ts.findChildOfKind(body, 19 /* CloseBraceToken */, sourceFile); - return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 209 /* ArrowFunction */); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== 206 /* ArrowFunction */); } function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { if (autoCollapse === void 0) { autoCollapse = false; } @@ -127488,7 +124582,7 @@ var ts; if (token === 133 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 139 /* ModuleKeyword */) { + if (token === 138 /* ModuleKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { recordAmbientExternalModule(); @@ -127522,10 +124616,10 @@ var ts; return true; } else { - if (token === 149 /* TypeKeyword */) { + if (token === 148 /* TypeKeyword */) { var skipTypeKeyword = ts.scanner.lookAhead(function () { var token = ts.scanner.scan(); - return token !== 153 /* FromKeyword */ && (token === 41 /* AsteriskToken */ || + return token !== 152 /* FromKeyword */ && (token === 41 /* AsteriskToken */ || token === 18 /* OpenBraceToken */ || token === 78 /* Identifier */ || ts.isKeyword(token)); @@ -127536,7 +124630,7 @@ var ts; } if (token === 78 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import d from "mod"; @@ -127567,7 +124661,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import {a as A} from "mod"; @@ -127583,7 +124677,7 @@ var ts; token = nextToken(); if (token === 78 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // import * as NS from "mod" @@ -127604,7 +124698,7 @@ var ts; if (token === 92 /* ExportKeyword */) { markAsExternalModuleIfTopLevel(); token = nextToken(); - if (token === 149 /* TypeKeyword */) { + if (token === 148 /* TypeKeyword */) { var skipTypeKeyword = ts.scanner.lookAhead(function () { var token = ts.scanner.scan(); return token === 41 /* AsteriskToken */ || @@ -127623,7 +124717,7 @@ var ts; } if (token === 19 /* CloseBraceToken */) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export {a as A} from "mod"; @@ -127635,7 +124729,7 @@ var ts; } else if (token === 41 /* AsteriskToken */) { token = nextToken(); - if (token === 153 /* FromKeyword */) { + if (token === 152 /* FromKeyword */) { token = nextToken(); if (token === 10 /* StringLiteral */) { // export * from "mod" @@ -127645,7 +124739,7 @@ var ts; } else if (token === 99 /* ImportKeyword */) { token = nextToken(); - if (token === 149 /* TypeKeyword */) { + if (token === 148 /* TypeKeyword */) { var skipTypeKeyword = ts.scanner.lookAhead(function () { var token = ts.scanner.scan(); return token === 78 /* Identifier */ || @@ -127671,7 +124765,7 @@ var ts; function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) { if (allowTemplateLiterals === void 0) { allowTemplateLiterals = false; } var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 143 /* RequireKeyword */) { + if (token === 142 /* RequireKeyword */) { token = nextToken(); if (token === 20 /* OpenParenToken */) { token = nextToken(); @@ -127814,13 +124908,8 @@ var ts; Rename.getRenameInfo = getRenameInfo; function getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile, options) { var symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { - if (ts.isLabelName(node)) { - var name = ts.getTextOfNode(node); - return getRenameInfoSuccess(name, name, "label" /* label */, "" /* none */, node, sourceFile); - } - return undefined; - } + if (!symbol) + return; // Only allow a symbol to be renamed if it actually has at least one declaration. var declarations = symbol.declarations; if (!declarations || declarations.length === 0) @@ -127837,7 +124926,7 @@ var ts; return options && options.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 158 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteralLike(node) && node.parent.kind === 157 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -127913,7 +125002,6 @@ var ts; var SmartSelectionRange; (function (SmartSelectionRange) { function getSmartSelectionRange(pos, sourceFile) { - var _a; var selectionRange = { textSpan: ts.createTextSpanFromBounds(sourceFile.getFullStart(), sourceFile.getEnd()) }; @@ -127926,7 +125014,7 @@ var ts; var prevNode = children[i - 1]; var node = children[i]; var nextNode = children[i + 1]; - if (ts.getTokenPosOfNode(node, sourceFile, /*includeJsDoc*/ true) > pos) { + if (node.getStart(sourceFile) > pos) { break outer; } if (positionShouldSnapToNode(sourceFile, pos, node)) { @@ -127935,14 +125023,14 @@ var ts; // of things that should be considered independently. // 3. A VariableStatement’s children are just a VaraiableDeclarationList and a semicolon. // 4. A lone VariableDeclaration in a VaraibleDeclaration feels redundant with the VariableStatement. + // // Dive in without pushing a selection range. if (ts.isBlock(node) || ts.isTemplateSpan(node) || ts.isTemplateHead(node) || ts.isTemplateTail(node) || prevNode && ts.isTemplateHead(prevNode) || ts.isVariableDeclarationList(node) && ts.isVariableStatement(parentNode) || ts.isSyntaxList(node) && ts.isVariableDeclarationList(parentNode) - || ts.isVariableDeclaration(node) && ts.isSyntaxList(parentNode) && children.length === 1 - || ts.isJSDocTypeExpression(node) || ts.isJSDocSignature(node) || ts.isJSDocTypeLiteral(node)) { + || ts.isVariableDeclaration(node) && ts.isSyntaxList(parentNode) && children.length === 1) { parentNode = node; break; } @@ -127954,12 +125042,15 @@ var ts; } // Blocks with braces, brackets, parens, or JSX tags on separate lines should be // selected from open to close, including whitespace but not including the braces/etc. themselves. - var isBetweenMultiLineBookends = ts.isSyntaxList(node) && isListOpener(prevNode) && isListCloser(nextNode) + var isBetweenMultiLineBookends = ts.isSyntaxList(node) + && isListOpener(prevNode) + && isListCloser(nextNode) && !ts.positionsAreOnSameLine(prevNode.getStart(), nextNode.getStart(), sourceFile); + var jsDocCommentStart = ts.hasJSDocNodes(node) && node.jsDoc[0].getStart(); var start = isBetweenMultiLineBookends ? prevNode.getEnd() : node.getStart(); - var end = isBetweenMultiLineBookends ? nextNode.getStart() : getEndPos(sourceFile, node); - if (ts.hasJSDocNodes(node) && ((_a = node.jsDoc) === null || _a === void 0 ? void 0 : _a.length)) { - pushSelectionRange(ts.first(node.jsDoc).getStart(), end); + var end = isBetweenMultiLineBookends ? nextNode.getStart() : node.getEnd(); + if (ts.isNumber(jsDocCommentStart)) { + pushSelectionRange(jsDocCommentStart, end); } pushSelectionRange(start, end); // String literals should have a stop both inside and outside their quotes. @@ -128047,14 +125138,14 @@ var ts; ts.Debug.assertEqual(closeBraceToken.kind, 19 /* CloseBraceToken */); // Group `-/+readonly` and `-/+?` var groupedWithPlusMinusTokens = groupChildren(children, function (child) { - return child === node.readonlyToken || child.kind === 142 /* ReadonlyKeyword */ || + return child === node.readonlyToken || child.kind === 141 /* ReadonlyKeyword */ || child === node.questionToken || child.kind === 57 /* QuestionToken */; }); // Group type parameter with surrounding brackets var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function (_a) { var kind = _a.kind; return kind === 22 /* OpenBracketToken */ || - kind === 159 /* TypeParameter */ || + kind === 158 /* TypeParameter */ || kind === 23 /* CloseBracketToken */; }); return [ @@ -128168,26 +125259,14 @@ var ts; return kind === 18 /* OpenBraceToken */ || kind === 22 /* OpenBracketToken */ || kind === 20 /* OpenParenToken */ - || kind === 275 /* JsxOpeningElement */; + || kind === 272 /* JsxOpeningElement */; } function isListCloser(token) { var kind = token && token.kind; return kind === 19 /* CloseBraceToken */ || kind === 23 /* CloseBracketToken */ || kind === 21 /* CloseParenToken */ - || kind === 276 /* JsxClosingElement */; - } - function getEndPos(sourceFile, node) { - switch (node.kind) { - case 326 /* JSDocParameterTag */: - case 324 /* JSDocCallbackTag */: - case 333 /* JSDocPropertyTag */: - case 331 /* JSDocTypedefTag */: - case 328 /* JSDocThisTag */: - return sourceFile.getLineEndOfPosition(node.getStart()); - default: - return node.getEnd(); - } + || kind === 273 /* JsxClosingElement */; } })(SmartSelectionRange = ts.SmartSelectionRange || (ts.SmartSelectionRange = {})); })(ts || (ts = {})); @@ -128393,10 +125472,10 @@ var ts; } return undefined; } - else if (ts.isTemplateHead(node) && parent.parent.kind === 205 /* TaggedTemplateExpression */) { + else if (ts.isTemplateHead(node) && parent.parent.kind === 202 /* TaggedTemplateExpression */) { var templateExpression = parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 218 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 215 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } @@ -128465,17 +125544,17 @@ var ts; return undefined; var parent = startingToken.parent; switch (parent.kind) { - case 207 /* ParenthesizedExpression */: - case 165 /* MethodDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 204 /* ParenthesizedExpression */: + case 164 /* MethodDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: var info = getArgumentOrParameterListInfo(startingToken, sourceFile); if (!info) return undefined; var argumentIndex = info.argumentIndex, argumentCount = info.argumentCount, argumentsSpan = info.argumentsSpan; var contextualType = ts.isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent); return contextualType && { contextualType: contextualType, argumentIndex: argumentIndex, argumentCount: argumentCount, argumentsSpan: argumentsSpan }; - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var highestBinary = getHighestBinary(parent); var contextualType_1 = checker.getContextualType(highestBinary); var argumentIndex_1 = startingToken.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent) - 1; @@ -128599,7 +125678,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 218 /* TemplateExpression */) { + if (template.kind === 215 /* TemplateExpression */) { var lastSpan = ts.last(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -128951,7 +126030,7 @@ var ts; return diags.sort(function (d1, d2) { return d1.start - d2.start; }); function check(node) { if (isJsFile) { - if (canBeConvertedToClass(node, checker)) { + if (canBeConvertedToClass(node)) { diags.push(ts.createDiagnosticForNode(ts.isVariableDeclaration(node.parent) ? node.parent.name : node, ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration)); } } @@ -128980,11 +126059,11 @@ var ts; function containsTopLevelCommonjs(sourceFile) { return sourceFile.statements.some(function (statement) { switch (statement.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return statement.declarationList.declarations.some(function (decl) { return !!decl.initializer && ts.isRequireCall(propertyAccessLeftHandSide(decl.initializer), /*checkArgumentIsStringLiteralLike*/ true); }); - case 233 /* ExpressionStatement */: { + case 230 /* ExpressionStatement */: { var expression = statement.expression; if (!ts.isBinaryExpression(expression)) return ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true); @@ -129001,12 +126080,12 @@ var ts; } function importNameForConvertToDefaultImport(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; - return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 263 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 260 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : undefined; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node.name; default: return undefined; @@ -129075,9 +126154,9 @@ var ts; // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts function isFixablePromiseArgument(arg) { switch (arg.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); // falls through case 103 /* NullKeyword */: @@ -129090,16 +126169,17 @@ var ts; function getKeyFromNode(exp) { return exp.pos.toString() + ":" + exp.end.toString(); } - function canBeConvertedToClass(node, checker) { + function canBeConvertedToClass(node) { var _a, _b, _c, _d; - if (node.kind === 208 /* FunctionExpression */) { + if (node.kind === 205 /* FunctionExpression */) { if (ts.isVariableDeclaration(node.parent) && ((_a = node.symbol.members) === null || _a === void 0 ? void 0 : _a.size)) { return true; } - var symbol = checker.getSymbolOfExpando(node, /*allowDeclaration*/ false); + var decl = ts.getDeclarationOfExpando(node); + var symbol = decl === null || decl === void 0 ? void 0 : decl.symbol; return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size))); } - if (node.kind === 251 /* FunctionDeclaration */) { + if (node.kind === 248 /* FunctionDeclaration */) { return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size); } return false; @@ -129119,7 +126199,7 @@ var ts; } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 221 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 218 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -129205,11 +126285,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 275 /* JsxOpeningElement */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: return location.kind === 78 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -129253,7 +126333,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 201 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 198 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -129273,7 +126353,7 @@ var ts; } if (callExpressionLike) { signature = typeChecker.getResolvedSignature(callExpressionLike); // TODO: GH#18217 - var useConstructSignatures = callExpressionLike.kind === 204 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 105 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 201 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 105 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -129329,7 +126409,7 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 132 /* ConstructorKeyword */ && location.parent.kind === 166 /* Constructor */)) { // At constructor keyword of constructor declaration + (location.kind === 132 /* ConstructorKeyword */ && location.parent.kind === 165 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration @@ -129337,21 +126417,21 @@ var ts; return declaration === (location.kind === 132 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 166 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 165 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); // TODO: GH#18217 } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 166 /* Constructor */) { + if (functionDeclaration_1.kind === 165 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 169 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 168 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -129362,7 +126442,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 221 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 218 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -129385,7 +126465,7 @@ var ts; } if ((symbolFlags & 524288 /* TypeAlias */) && (semanticMeaning & 2 /* Type */)) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(149 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(148 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -129406,9 +126486,9 @@ var ts; } if (symbolFlags & 1536 /* Module */ && !isThisExpression) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 256 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 253 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 78 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 140 /* NamespaceKeyword */ : 139 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 139 /* NamespaceKeyword */ : 138 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -129427,7 +126507,7 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 159 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 158 /* TypeParameter */); if (decl === undefined) return ts.Debug.fail(); var declaration = decl.parent; @@ -129435,21 +126515,21 @@ var ts; if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); // TODO: GH#18217 - if (declaration.kind === 170 /* ConstructSignature */) { + if (declaration.kind === 169 /* ConstructSignature */) { displayParts.push(ts.keywordPart(102 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 169 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 168 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 254 /* TypeAliasDeclaration */) { + else if (declaration.kind === 251 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(149 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(148 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -129461,7 +126541,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 291 /* EnumMember */) { + if (declaration.kind === 288 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -129492,17 +126572,17 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(92 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(140 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(139 /* NamespaceKeyword */)); break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: displayParts.push(ts.keywordPart(92 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 62 /* EqualsToken */ : 87 /* DefaultKeyword */)); break; - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: displayParts.push(ts.keywordPart(92 /* ExportKeyword */)); break; default: @@ -129511,13 +126591,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 260 /* ImportEqualsDeclaration */) { + if (declaration.kind === 257 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(62 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(143 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(142 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(20 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(21 /* CloseParenToken */)); @@ -129598,10 +126678,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 297 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 294 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 216 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 213 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -129719,16 +126799,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 208 /* FunctionExpression */) { + if (declaration.kind === 205 /* FunctionExpression */) { return true; } - if (declaration.kind !== 249 /* VariableDeclaration */ && declaration.kind !== 251 /* FunctionDeclaration */) { + if (declaration.kind !== 246 /* VariableDeclaration */ && declaration.kind !== 248 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 297 /* SourceFile */ || parent.kind === 257 /* ModuleBlock */) { + if (parent.kind === 294 /* SourceFile */ || parent.kind === 254 /* ModuleBlock */) { return false; } } @@ -130029,10 +127109,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 280 /* JsxAttribute */: - case 275 /* JsxOpeningElement */: - case 276 /* JsxClosingElement */: - case 274 /* JsxSelfClosingElement */: + case 277 /* JsxAttribute */: + case 272 /* JsxOpeningElement */: + case 273 /* JsxClosingElement */: + case 271 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 78 /* Identifier */; } @@ -130233,7 +127313,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 156 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 155 /* LastToken */; token++) { if (token !== 1 /* EndOfFileToken */) { allTokens.push(token); } @@ -130248,9 +127328,9 @@ var ts; var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArrays(allTokens, [3 /* MultiLineCommentTrivia */])); var anyTokenIncludingEOF = tokenRangeFrom(__spreadArrays(allTokens, [1 /* EndOfFileToken */])); - var keywords = tokenRangeFromRange(80 /* FirstKeyword */, 156 /* LastKeyword */); + var keywords = tokenRangeFromRange(80 /* FirstKeyword */, 155 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(29 /* FirstBinaryOperator */, 77 /* LastBinaryOperator */); - var binaryKeywordOperators = [100 /* InKeyword */, 101 /* InstanceOfKeyword */, 156 /* OfKeyword */, 126 /* AsKeyword */, 137 /* IsKeyword */]; + var binaryKeywordOperators = [100 /* InKeyword */, 101 /* InstanceOfKeyword */, 155 /* OfKeyword */, 126 /* AsKeyword */, 136 /* IsKeyword */]; var unaryPrefixOperators = [45 /* PlusPlusToken */, 46 /* MinusMinusToken */, 54 /* TildeToken */, 53 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 9 /* BigIntLiteral */, 78 /* Identifier */, 20 /* OpenParenToken */, @@ -130324,7 +127404,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [134 /* GetKeyword */, 146 /* SetKeyword */], 78 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), + rule("SpaceAfterGetSetInMember", [134 /* GetKeyword */, 145 /* SetKeyword */], 78 /* Identifier */, [isFunctionDeclContext], 4 /* InsertSpace */), rule("NoSpaceBetweenYieldKeywordAndStar", 124 /* YieldKeyword */, 41 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 16 /* DeleteSpace */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [124 /* YieldKeyword */, 41 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 4 /* InsertSpace */), rule("NoSpaceBetweenReturnAndSemicolon", 104 /* ReturnKeyword */, 26 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), @@ -130348,7 +127428,7 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 62 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [139 /* ModuleKeyword */, 143 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), + rule("NoSpaceAfterModuleImport", [138 /* ModuleKeyword */, 142 /* RequireKeyword */], 20 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 16 /* DeleteSpace */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 125 /* AbstractKeyword */, @@ -130362,20 +127442,20 @@ var ts; 116 /* ImplementsKeyword */, 99 /* ImportKeyword */, 117 /* InterfaceKeyword */, - 139 /* ModuleKeyword */, - 140 /* NamespaceKeyword */, + 138 /* ModuleKeyword */, + 139 /* NamespaceKeyword */, 120 /* PrivateKeyword */, 122 /* PublicKeyword */, 121 /* ProtectedKeyword */, - 142 /* ReadonlyKeyword */, - 146 /* SetKeyword */, + 141 /* ReadonlyKeyword */, + 145 /* SetKeyword */, 123 /* StaticKeyword */, - 149 /* TypeKeyword */, - 153 /* FromKeyword */, - 138 /* KeyOfKeyword */, + 148 /* TypeKeyword */, + 152 /* FromKeyword */, + 137 /* KeyOfKeyword */, 135 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [93 /* ExtendsKeyword */, 116 /* ImplementsKeyword */, 153 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [93 /* ExtendsKeyword */, 116 /* ImplementsKeyword */, 152 /* FromKeyword */], [isNonJsxSameLineTokenContext], 4 /* InsertSpace */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 10 /* StringLiteral */, 18 /* OpenBraceToken */, [isModuleDeclContext], 4 /* InsertSpace */), // Lambda expressions @@ -130407,7 +127487,7 @@ var ts; 120 /* PrivateKeyword */, 121 /* ProtectedKeyword */, 134 /* GetKeyword */, - 146 /* SetKeyword */, + 145 /* SetKeyword */, 22 /* OpenBracketToken */, 41 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 4 /* InsertSpace */), @@ -130561,51 +127641,51 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 237 /* ForStatement */; + return context.contextNode.kind === 234 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return context.contextNode.operatorToken.kind !== 27 /* CommaToken */; - case 217 /* ConditionalExpression */: - case 184 /* ConditionalType */: - case 224 /* AsExpression */: - case 270 /* ExportSpecifier */: - case 265 /* ImportSpecifier */: - case 172 /* TypePredicate */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 214 /* ConditionalExpression */: + case 183 /* ConditionalType */: + case 221 /* AsExpression */: + case 267 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 171 /* TypePredicate */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 198 /* BindingElement */: + case 195 /* BindingElement */: // equals in type X = ... // falls through - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: // equal in import a = module('a'); // falls through - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // equal in let a = 0 // falls through - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: // equal in p = 0 // falls through - case 160 /* Parameter */: - case 291 /* EnumMember */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 159 /* Parameter */: + case 288 /* EnumMember */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] // falls through - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return context.currentTokenSpan.kind === 100 /* InKeyword */ || context.nextTokenSpan.kind === 100 /* InKeyword */ || context.currentTokenSpan.kind === 62 /* EqualsToken */ || context.nextTokenSpan.kind === 62 /* EqualsToken */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 239 /* ForOfStatement */: - return context.currentTokenSpan.kind === 156 /* OfKeyword */ || context.nextTokenSpan.kind === 156 /* OfKeyword */; + case 236 /* ForOfStatement */: + return context.currentTokenSpan.kind === 155 /* OfKeyword */ || context.nextTokenSpan.kind === 155 /* OfKeyword */; } return false; } @@ -130617,22 +127697,22 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 163 /* PropertyDeclaration */ || - contextKind === 162 /* PropertySignature */ || - contextKind === 160 /* Parameter */ || - contextKind === 249 /* VariableDeclaration */ || + return contextKind === 162 /* PropertyDeclaration */ || + contextKind === 161 /* PropertySignature */ || + contextKind === 159 /* Parameter */ || + contextKind === 246 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 217 /* ConditionalExpression */ || - context.contextNode.kind === 184 /* ConditionalType */; + return context.contextNode.kind === 214 /* ConditionalExpression */ || + context.contextNode.kind === 183 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 196 /* ObjectBindingPattern */ || - context.contextNode.kind === 190 /* MappedType */ || + return context.contextNode.kind === 193 /* ObjectBindingPattern */ || + context.contextNode.kind === 189 /* MappedType */ || isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration @@ -130658,34 +127738,34 @@ var ts; return true; } switch (node.kind) { - case 230 /* Block */: - case 258 /* CaseBlock */: - case 200 /* ObjectLiteralExpression */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 197 /* ObjectLiteralExpression */: + case 254 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: // falls through - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // case SyntaxKind.MethodSignature: // falls through - case 169 /* CallSignature */: - case 208 /* FunctionExpression */: - case 166 /* Constructor */: - case 209 /* ArrowFunction */: + case 168 /* CallSignature */: + case 205 /* FunctionExpression */: + case 165 /* Constructor */: + case 206 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: // falls through - case 253 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one + case 250 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; @@ -130694,40 +127774,40 @@ var ts; return !isFunctionDeclContext(context); } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 251 /* FunctionDeclaration */ || context.contextNode.kind === 208 /* FunctionExpression */; + return context.contextNode.kind === 248 /* FunctionDeclaration */ || context.contextNode.kind === 205 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 177 /* TypeLiteral */: - case 256 /* ModuleDeclaration */: - case 267 /* ExportDeclaration */: - case 268 /* NamedExports */: - case 261 /* ImportDeclaration */: - case 264 /* NamedImports */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 176 /* TypeLiteral */: + case 253 /* ModuleDeclaration */: + case 264 /* ExportDeclaration */: + case 265 /* NamedExports */: + case 258 /* ImportDeclaration */: + case 261 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 287 /* CatchClause */: - case 257 /* ModuleBlock */: - case 244 /* SwitchStatement */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 284 /* CatchClause */: + case 254 /* ModuleBlock */: + case 241 /* SwitchStatement */: return true; - case 230 /* Block */: { + case 227 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 209 /* ArrowFunction */ && blockParent.kind !== 208 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 206 /* ArrowFunction */ && blockParent.kind !== 205 /* FunctionExpression */) { return true; } } @@ -130736,32 +127816,32 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 234 /* IfStatement */: - case 244 /* SwitchStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 236 /* WhileStatement */: - case 247 /* TryStatement */: - case 235 /* DoStatement */: - case 243 /* WithStatement */: + case 231 /* IfStatement */: + case 241 /* SwitchStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 233 /* WhileStatement */: + case 244 /* TryStatement */: + case 232 /* DoStatement */: + case 240 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: // falls through - case 287 /* CatchClause */: + case 284 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 200 /* ObjectLiteralExpression */; + return context.contextNode.kind === 197 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 203 /* CallExpression */; + return context.contextNode.kind === 200 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 204 /* NewExpression */; + return context.contextNode.kind === 201 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -130776,10 +127856,10 @@ var ts; return context.nextTokenSpan.kind !== 21 /* CloseParenToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 209 /* ArrowFunction */; + return context.contextNode.kind === 206 /* ArrowFunction */; } function isImportTypeContext(context) { - return context.contextNode.kind === 195 /* ImportType */; + return context.contextNode.kind === 192 /* ImportType */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 11 /* JsxText */; @@ -130788,19 +127868,19 @@ var ts; return context.contextNode.kind !== 11 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 273 /* JsxElement */ && context.contextNode.kind !== 277 /* JsxFragment */; + return context.contextNode.kind !== 270 /* JsxElement */ && context.contextNode.kind !== 274 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 283 /* JsxExpression */ || context.contextNode.kind === 282 /* JsxSpreadAttribute */; + return context.contextNode.kind === 280 /* JsxExpression */ || context.contextNode.kind === 279 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 280 /* JsxAttribute */; + return context.nextTokenParent.kind === 277 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 280 /* JsxAttribute */; + return context.contextNode.kind === 277 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 274 /* JsxSelfClosingElement */; + return context.contextNode.kind === 271 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -130815,45 +127895,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 161 /* Decorator */; + return node.kind === 160 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 250 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 247 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 256 /* ModuleDeclaration */; + return context.contextNode.kind === 253 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 177 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 176 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 170 /* ConstructSignature */; + return context.contextNode.kind === 169 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 29 /* LessThanToken */ && token.kind !== 31 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 173 /* TypeReference */: - case 206 /* TypeAssertionExpression */: - case 254 /* TypeAliasDeclaration */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 223 /* ExpressionWithTypeArguments */: + case 172 /* TypeReference */: + case 203 /* TypeAssertionExpression */: + case 251 /* TypeAliasDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 220 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -130864,28 +127944,28 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 206 /* TypeAssertionExpression */; + return context.contextNode.kind === 203 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 113 /* VoidKeyword */ && context.currentTokenParent.kind === 212 /* VoidExpression */; + return context.currentTokenSpan.kind === 113 /* VoidKeyword */ && context.currentTokenParent.kind === 209 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 219 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 216 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 225 /* NonNullExpression */; + return context.contextNode.kind === 222 /* NonNullExpression */; } function isNotStatementConditionContext(context) { return !isStatementConditionContext(context); } function isStatementConditionContext(context) { switch (context.contextNode.kind) { - case 234 /* IfStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 231 /* IfStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return true; default: return false; @@ -130910,12 +127990,12 @@ var ts; return nextTokenKind === 19 /* CloseBraceToken */ || nextTokenKind === 1 /* EndOfFileToken */; } - if (nextTokenKind === 229 /* SemicolonClassElement */ || + if (nextTokenKind === 226 /* SemicolonClassElement */ || nextTokenKind === 26 /* SemicolonToken */) { return false; } - if (context.contextNode.kind === 253 /* InterfaceDeclaration */ || - context.contextNode.kind === 254 /* TypeAliasDeclaration */) { + if (context.contextNode.kind === 250 /* InterfaceDeclaration */ || + context.contextNode.kind === 251 /* TypeAliasDeclaration */) { // Can’t remove semicolon after `foo`; it would parse as a method declaration: // // interface I { @@ -130929,9 +128009,9 @@ var ts; if (ts.isPropertyDeclaration(context.currentTokenParent)) { return !context.currentTokenParent.initializer; } - return context.currentTokenParent.kind !== 237 /* ForStatement */ - && context.currentTokenParent.kind !== 231 /* EmptyStatement */ - && context.currentTokenParent.kind !== 229 /* SemicolonClassElement */ + return context.currentTokenParent.kind !== 234 /* ForStatement */ + && context.currentTokenParent.kind !== 228 /* EmptyStatement */ + && context.currentTokenParent.kind !== 226 /* SemicolonClassElement */ && nextTokenKind !== 22 /* OpenBracketToken */ && nextTokenKind !== 20 /* OpenParenToken */ && nextTokenKind !== 39 /* PlusToken */ @@ -130939,7 +128019,7 @@ var ts; && nextTokenKind !== 43 /* SlashToken */ && nextTokenKind !== 13 /* RegularExpressionLiteral */ && nextTokenKind !== 27 /* CommaToken */ - && nextTokenKind !== 218 /* TemplateExpression */ + && nextTokenKind !== 215 /* TemplateExpression */ && nextTokenKind !== 15 /* TemplateHead */ && nextTokenKind !== 14 /* NoSubstitutionTemplateLiteral */ && nextTokenKind !== 24 /* DotToken */; @@ -131030,12 +128110,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 156 /* LastKeyword */ && column <= 156 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 155 /* LastKeyword */ && column <= 155 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 156 /* LastToken */ + 1; + var mapRowLength = 155 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["StopRulesSpecific"] = 0] = "StopRulesSpecific"; @@ -131223,17 +128303,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var body = parent.body; - return !!body && body.kind === 257 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 297 /* SourceFile */: - case 230 /* Block */: - case 257 /* ModuleBlock */: + return !!body && body.kind === 254 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 294 /* SourceFile */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -131460,19 +128540,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 252 /* ClassDeclaration */: return 83 /* ClassKeyword */; - case 253 /* InterfaceDeclaration */: return 117 /* InterfaceKeyword */; - case 251 /* FunctionDeclaration */: return 97 /* FunctionKeyword */; - case 255 /* EnumDeclaration */: return 255 /* EnumDeclaration */; - case 167 /* GetAccessor */: return 134 /* GetKeyword */; - case 168 /* SetAccessor */: return 146 /* SetKeyword */; - case 165 /* MethodDeclaration */: + case 249 /* ClassDeclaration */: return 83 /* ClassKeyword */; + case 250 /* InterfaceDeclaration */: return 117 /* InterfaceKeyword */; + case 248 /* FunctionDeclaration */: return 97 /* FunctionKeyword */; + case 252 /* EnumDeclaration */: return 252 /* EnumDeclaration */; + case 166 /* GetAccessor */: return 134 /* GetKeyword */; + case 167 /* SetAccessor */: return 145 /* SetKeyword */; + case 164 /* MethodDeclaration */: if (node.asteriskToken) { return 41 /* AsteriskToken */; } // falls through - case 163 /* PropertyDeclaration */: - case 160 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 159 /* Parameter */: var name = ts.getNameOfDeclaration(node); if (name) { return name.kind; @@ -131529,15 +128609,15 @@ var ts; case 43 /* SlashToken */: case 31 /* GreaterThanToken */: switch (container.kind) { - case 275 /* JsxOpeningElement */: - case 276 /* JsxClosingElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 273 /* JsxClosingElement */: + case 271 /* JsxSelfClosingElement */: return false; } break; case 22 /* OpenBracketToken */: case 23 /* CloseBracketToken */: - if (container.kind !== 190 /* MappedType */) { + if (container.kind !== 189 /* MappedType */) { return false; } break; @@ -131645,7 +128725,7 @@ var ts; return inheritedIndentation; } } - var effectiveParentStartLine = child.kind === 161 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 160 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 11 /* JsxText */) { @@ -131665,7 +128745,7 @@ var ts; } } childContextNode = node; - if (isFirstListItem && parent.kind === 199 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 196 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -132105,12 +129185,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 209 /* ArrowFunction */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 206 /* ArrowFunction */: if (node.typeParameters === list) { return 29 /* LessThanToken */; } @@ -132118,8 +129198,8 @@ var ts; return 20 /* OpenParenToken */; } break; - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } @@ -132127,12 +129207,12 @@ var ts; return 20 /* OpenParenToken */; } break; - case 173 /* TypeReference */: + case 172 /* TypeReference */: if (node.typeArguments === list) { return 29 /* LessThanToken */; } break; - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return 18 /* OpenBraceToken */; } return 0 /* Unknown */; @@ -132250,7 +129330,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 216 /* BinaryExpression */) { + if (precedingToken.kind === 27 /* CommaToken */ && precedingToken.parent.kind !== 213 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -132404,7 +129484,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 297 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 294 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -132452,7 +129532,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 234 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 231 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 90 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -132490,40 +129570,40 @@ var ts; } function getListByRange(start, end, node, sourceFile) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return getList(node.typeArguments); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return getList(node.properties); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getList(node.elements); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return getList(node.members); - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 166 /* Constructor */: - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 165 /* Constructor */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: return getList(node.typeParameters) || getList(node.parameters); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: return getList(node.typeParameters); - case 204 /* NewExpression */: - case 203 /* CallExpression */: + case 201 /* NewExpression */: + case 200 /* CallExpression */: return getList(node.typeArguments) || getList(node.arguments); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return getList(node.declarations); - case 264 /* NamedImports */: - case 268 /* NamedExports */: + case 261 /* NamedImports */: + case 265 /* NamedExports */: return getList(node.elements); - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return getList(node.elements); } function getList(list) { @@ -132546,7 +129626,7 @@ var ts; return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); } function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { - if (node.parent && node.parent.kind === 250 /* VariableDeclarationList */) { + if (node.parent && node.parent.kind === 247 /* VariableDeclarationList */) { // VariableDeclarationList has no wrapping tokens return -1 /* Unknown */; } @@ -132619,91 +129699,87 @@ var ts; function nodeWillIndentChild(settings, parent, child, sourceFile, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 233 /* ExpressionStatement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 199 /* ArrayLiteralExpression */: - case 230 /* Block */: - case 257 /* ModuleBlock */: - case 200 /* ObjectLiteralExpression */: - case 177 /* TypeLiteral */: - case 190 /* MappedType */: - case 179 /* TupleType */: - case 258 /* CaseBlock */: - case 285 /* DefaultClause */: - case 284 /* CaseClause */: - case 207 /* ParenthesizedExpression */: - case 201 /* PropertyAccessExpression */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 232 /* VariableStatement */: - case 266 /* ExportAssignment */: - case 242 /* ReturnStatement */: - case 217 /* ConditionalExpression */: - case 197 /* ArrayBindingPattern */: - case 196 /* ObjectBindingPattern */: - case 275 /* JsxOpeningElement */: - case 278 /* JsxOpeningFragment */: - case 274 /* JsxSelfClosingElement */: - case 283 /* JsxExpression */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 160 /* Parameter */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 186 /* ParenthesizedType */: - case 205 /* TaggedTemplateExpression */: - case 213 /* AwaitExpression */: - case 268 /* NamedExports */: - case 264 /* NamedImports */: - case 270 /* ExportSpecifier */: - case 265 /* ImportSpecifier */: - case 163 /* PropertyDeclaration */: + case 230 /* ExpressionStatement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 196 /* ArrayLiteralExpression */: + case 227 /* Block */: + case 254 /* ModuleBlock */: + case 197 /* ObjectLiteralExpression */: + case 176 /* TypeLiteral */: + case 189 /* MappedType */: + case 178 /* TupleType */: + case 255 /* CaseBlock */: + case 282 /* DefaultClause */: + case 281 /* CaseClause */: + case 204 /* ParenthesizedExpression */: + case 198 /* PropertyAccessExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 229 /* VariableStatement */: + case 263 /* ExportAssignment */: + case 239 /* ReturnStatement */: + case 214 /* ConditionalExpression */: + case 194 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 272 /* JsxOpeningElement */: + case 275 /* JsxOpeningFragment */: + case 271 /* JsxSelfClosingElement */: + case 280 /* JsxExpression */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 159 /* Parameter */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 185 /* ParenthesizedType */: + case 202 /* TaggedTemplateExpression */: + case 210 /* AwaitExpression */: + case 265 /* NamedExports */: + case 261 /* NamedImports */: + case 267 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 162 /* PropertyDeclaration */: return true; - case 249 /* VariableDeclaration */: - case 288 /* PropertyAssignment */: - case 216 /* BinaryExpression */: - if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 200 /* ObjectLiteralExpression */) { // TODO: GH#18217 + case 246 /* VariableDeclaration */: + case 285 /* PropertyAssignment */: + case 213 /* BinaryExpression */: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 197 /* ObjectLiteralExpression */) { // TODO: GH#18217 return rangeIsOnOneLine(sourceFile, child); } - if (parent.kind !== 216 /* BinaryExpression */) { + if (parent.kind !== 213 /* BinaryExpression */) { return true; } break; - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 237 /* ForStatement */: - case 234 /* IfStatement */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - return childKind !== 230 /* Block */; - case 209 /* ArrowFunction */: - if (sourceFile && childKind === 207 /* ParenthesizedExpression */) { - return rangeIsOnOneLine(sourceFile, child); - } - return childKind !== 230 /* Block */; - case 267 /* ExportDeclaration */: - return childKind !== 268 /* NamedExports */; - case 261 /* ImportDeclaration */: - return childKind !== 262 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 264 /* NamedImports */); - case 273 /* JsxElement */: - return childKind !== 276 /* JsxClosingElement */; - case 277 /* JsxFragment */: - return childKind !== 279 /* JsxClosingFragment */; - case 183 /* IntersectionType */: - case 182 /* UnionType */: - if (childKind === 177 /* TypeLiteral */ || childKind === 179 /* TupleType */) { + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 234 /* ForStatement */: + case 231 /* IfStatement */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 206 /* ArrowFunction */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + return childKind !== 227 /* Block */; + case 264 /* ExportDeclaration */: + return childKind !== 265 /* NamedExports */; + case 258 /* ImportDeclaration */: + return childKind !== 259 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 261 /* NamedImports */); + case 270 /* JsxElement */: + return childKind !== 273 /* JsxClosingElement */; + case 274 /* JsxFragment */: + return childKind !== 276 /* JsxClosingFragment */; + case 182 /* IntersectionType */: + case 181 /* UnionType */: + if (childKind === 176 /* TypeLiteral */ || childKind === 178 /* TupleType */) { return false; } // falls through @@ -132714,11 +129790,11 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 242 /* ReturnStatement */: - case 246 /* ThrowStatement */: - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: - return parent.kind !== 230 /* Block */; + case 239 /* ReturnStatement */: + case 243 /* ThrowStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: + return parent.kind !== 227 /* Block */; default: return false; } @@ -132792,10 +129868,8 @@ var ts; (function (TrailingTriviaOption) { /** Exclude all trailing trivia (use getEnd()) */ TrailingTriviaOption[TrailingTriviaOption["Exclude"] = 0] = "Exclude"; - /** Doesn't include whitespace, but does strip comments */ - TrailingTriviaOption[TrailingTriviaOption["ExcludeWhitespace"] = 1] = "ExcludeWhitespace"; /** Include trailing trivia */ - TrailingTriviaOption[TrailingTriviaOption["Include"] = 2] = "Include"; + TrailingTriviaOption[TrailingTriviaOption["Include"] = 1] = "Include"; })(TrailingTriviaOption = textChanges_3.TrailingTriviaOption || (textChanges_3.TrailingTriviaOption = {})); function skipWhitespacesAndLineBreaks(text, start) { return ts.skipTrivia(text, start, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); @@ -132866,18 +129940,9 @@ var ts; return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); } function getAdjustedEndPosition(sourceFile, node, options) { - var _a; var end = node.end; var trailingTriviaOption = options.trailingTriviaOption; - if (trailingTriviaOption === TrailingTriviaOption.Exclude) { - return end; - } - if (trailingTriviaOption === TrailingTriviaOption.ExcludeWhitespace) { - var comments = ts.concatenate(ts.getTrailingCommentRanges(sourceFile.text, end), ts.getLeadingCommentRanges(sourceFile.text, end)); - var realEnd = (_a = comments === null || comments === void 0 ? void 0 : comments[comments.length - 1]) === null || _a === void 0 ? void 0 : _a.end; - if (realEnd) { - return realEnd; - } + if (trailingTriviaOption === TrailingTriviaOption.Exclude || (ts.isExpression(node) && trailingTriviaOption !== TrailingTriviaOption.Include)) { return end; } var newEnd = ts.skipTrivia(sourceFile.text, end, /*stopAfterLineBreak*/ true); @@ -132889,7 +129954,7 @@ var ts; * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 200 /* ObjectLiteralExpression */)); + return !!candidate && !!node.parent && (candidate.kind === 27 /* CommaToken */ || (candidate.kind === 26 /* SemicolonToken */ && node.parent.kind === 197 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -133028,10 +130093,9 @@ var ts; this.insertNodeAt(sourceFile, parameters.pos, newParam); } }; - ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween, options) { + ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween) { if (blankLineBetween === void 0) { blankLineBetween = false; } - if (options === void 0) { options = {}; } - this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween)); + this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, {}), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween)); }; ChangeTracker.prototype.insertModifierBefore = function (sourceFile, modifier, before) { var pos = before.getStart(sourceFile); @@ -133093,7 +130157,7 @@ var ts; } } else { - endNode = (_a = (node.kind === 249 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken)) !== null && _a !== void 0 ? _a : node.name; + endNode = (_a = (node.kind === 246 /* VariableDeclaration */ ? node.exclamationToken : node.questionToken)) !== null && _a !== void 0 ? _a : node.name; } this.insertNodeAt(sourceFile, endNode.end, type, { prefix: ": " }); return true; @@ -133250,18 +130314,18 @@ var ts; }; ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: case 10 /* StringLiteral */: case 78 /* Identifier */: return { prefix: ", " }; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return { suffix: "," + this.newLineCharacter }; case 92 /* ExportKeyword */: return { prefix: " " }; - case 160 /* Parameter */: + case 159 /* Parameter */: return {}; default: ts.Debug.assert(ts.isStatement(node) || ts.isClassOrTypeElement(node)); // Else we haven't handled this kind of node yet -- add it @@ -133270,7 +130334,7 @@ var ts; }; ChangeTracker.prototype.insertName = function (sourceFile, node, name) { ts.Debug.assert(!node.name); - if (node.kind === 209 /* ArrowFunction */) { + if (node.kind === 206 /* ArrowFunction */) { var arrow = ts.findChildOfKind(node, 38 /* EqualsGreaterThanToken */, sourceFile); var lparen = ts.findChildOfKind(node, 20 /* OpenParenToken */, sourceFile); if (lparen) { @@ -133284,14 +130348,14 @@ var ts; // Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)` this.replaceRange(sourceFile, arrow, ts.factory.createToken(21 /* CloseParenToken */)); } - if (node.body.kind !== 230 /* Block */) { + if (node.body.kind !== 227 /* Block */) { // `() => 0` => `function f() { return 0; }` this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts.factory.createToken(18 /* OpenBraceToken */), ts.factory.createToken(104 /* ReturnKeyword */)], { joiner: " ", suffix: " " }); this.insertNodesAt(sourceFile, node.body.end, [ts.factory.createToken(26 /* SemicolonToken */), ts.factory.createToken(19 /* CloseBraceToken */)], { joiner: " " }); } } else { - var pos = ts.findChildOfKind(node, node.kind === 208 /* FunctionExpression */ ? 97 /* FunctionKeyword */ : 83 /* ClassKeyword */, sourceFile).end; + var pos = ts.findChildOfKind(node, node.kind === 205 /* FunctionExpression */ ? 97 /* FunctionKeyword */ : 83 /* ClassKeyword */, sourceFile).end; this.insertNodeAt(sourceFile, pos, ts.factory.createIdentifier(name), { prefix: " " }); } }; @@ -133587,12 +130651,7 @@ var ts; function getNonformattedText(node, sourceFile, newLineCharacter) { var writer = createWriter(newLineCharacter); var newLine = newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */; - ts.createPrinter({ - newLine: newLine, - neverAsciiEscape: true, - preserveSourceNewlines: true, - terminateUnterminatedLiterals: true - }, writer).writeNode(4 /* Unspecified */, node, sourceFile, writer); + ts.createPrinter({ newLine: newLine, neverAsciiEscape: true, preserveSourceNewlines: true }, writer).writeNode(4 /* Unspecified */, node, sourceFile, writer); return { text: writer.getText(), node: assignPositionsToNode(node) }; } changesToText.getNonformattedText = getNonformattedText; @@ -133866,14 +130925,14 @@ var ts; } textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; function needSemicolonBetween(a, b) { - return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 158 /* ComputedPropertyName */ + return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 157 /* ComputedPropertyName */ || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[` } var deleteDeclaration; (function (deleteDeclaration_1) { function deleteDeclaration(changes, deletedNodesInLists, sourceFile, node) { switch (node.kind) { - case 160 /* Parameter */: { + case 159 /* Parameter */: { var oldFunction = node.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && @@ -133888,15 +130947,15 @@ var ts; } break; } - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: var isFirstImport = sourceFile.imports.length && node === ts.first(sourceFile.imports).parent || node === ts.find(sourceFile.statements, ts.isAnyImportSyntax); // For first import, leave header comment in place, otherwise only delete JSDoc comments deleteNode(changes, sourceFile, node, { leadingTriviaOption: isFirstImport ? LeadingTriviaOption.Exclude : ts.hasJSDocNodes(node) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: var pattern = node.parent; - var preserveComma = pattern.kind === 197 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); + var preserveComma = pattern.kind === 194 /* ArrayBindingPattern */ && node !== ts.last(pattern.elements); if (preserveComma) { deleteNode(changes, sourceFile, node); } @@ -133904,13 +130963,13 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); break; - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: var namedImports = node.parent; if (namedImports.elements.length === 1) { deleteImportBinding(changes, sourceFile, namedImports); @@ -133919,7 +130978,7 @@ var ts; deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); } break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: deleteImportBinding(changes, sourceFile, node); break; case 26 /* SemicolonToken */: @@ -133928,8 +130987,8 @@ var ts; case 97 /* FunctionKeyword */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: LeadingTriviaOption.Exclude }); break; - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: deleteNode(changes, sourceFile, node, { leadingTriviaOption: ts.hasJSDocNodes(node) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); break; default: @@ -133976,13 +131035,13 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(node, 261 /* ImportDeclaration */); + var importDecl = ts.getAncestor(node, 258 /* ImportDeclaration */); deleteNode(changes, sourceFile, importDecl); } } function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { var parent = node.parent; - if (parent.kind === 287 /* CatchClause */) { + if (parent.kind === 284 /* CatchClause */) { // TODO: There's currently no unused diagnostic for this, could be a suggestion changes.deleteNodeRange(sourceFile, ts.findChildOfKind(parent, 20 /* OpenParenToken */, sourceFile), ts.findChildOfKind(parent, 21 /* CloseParenToken */, sourceFile)); return; @@ -133993,14 +131052,14 @@ var ts; } var gp = parent.parent; switch (gp.kind) { - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: changes.replaceNode(sourceFile, node, ts.factory.createObjectLiteralExpression()); break; - case 237 /* ForStatement */: + case 234 /* ForStatement */: deleteNode(changes, sourceFile, parent); break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: deleteNode(changes, sourceFile, gp, { leadingTriviaOption: ts.hasJSDocNodes(gp) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); break; default: @@ -134179,8 +131238,8 @@ var ts; var token = ts.getTokenAtPosition(sourceFile, pos); var assertion = ts.Debug.checkDefined(ts.findAncestor(token, function (n) { return ts.isAsExpression(n) || ts.isTypeAssertionExpression(n); }), "Expected to find an assertion expression"); var replacement = ts.isAsExpression(assertion) - ? ts.factory.createAsExpression(assertion.expression, ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */)) - : ts.factory.createTypeAssertion(ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */), assertion.expression); + ? ts.factory.createAsExpression(assertion.expression, ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */)) + : ts.factory.createTypeAssertion(ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */), assertion.expression); changeTracker.replaceNode(sourceFile, assertion.expression, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -134409,7 +131468,7 @@ var ts; } var declaration = ts.tryCast(symbol.valueDeclaration, ts.isVariableDeclaration); var variableName = declaration && ts.tryCast(declaration.name, ts.isIdentifier); - var variableStatement = ts.getAncestor(declaration, 232 /* VariableStatement */); + var variableStatement = ts.getAncestor(declaration, 229 /* VariableStatement */); if (!declaration || !variableStatement || declaration.type || !declaration.initializer || @@ -134487,10 +131546,10 @@ var ts; function isInsideAwaitableBody(node) { return node.kind & 32768 /* AwaitContext */ || !!ts.findAncestor(node, function (ancestor) { return ancestor.parent && ts.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || - ts.isBlock(ancestor) && (ancestor.parent.kind === 251 /* FunctionDeclaration */ || - ancestor.parent.kind === 208 /* FunctionExpression */ || - ancestor.parent.kind === 209 /* ArrowFunction */ || - ancestor.parent.kind === 165 /* MethodDeclaration */); + ts.isBlock(ancestor) && (ancestor.parent.kind === 248 /* FunctionDeclaration */ || + ancestor.parent.kind === 205 /* FunctionExpression */ || + ancestor.parent.kind === 206 /* ArrowFunction */ || + ancestor.parent.kind === 164 /* MethodDeclaration */); }); } function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { @@ -134609,10 +131668,10 @@ var ts; function isPossiblyPartOfDestructuring(node) { switch (node.kind) { case 78 /* Identifier */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return true; default: return false; @@ -134627,7 +131686,7 @@ var ts; function isPossiblyPartOfCommaSeperatedInitializer(node) { switch (node.kind) { case 78 /* Identifier */: - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: case 27 /* CommaToken */: return true; default: @@ -134676,7 +131735,7 @@ var ts; return; } var declaration = token.parent; - if (declaration.kind === 163 /* PropertyDeclaration */ && + if (declaration.kind === 162 /* PropertyDeclaration */ && (!fixedNodes || ts.tryAddToSet(fixedNodes, declaration))) { changeTracker.insertModifierBefore(sourceFile, 133 /* DeclareKeyword */, declaration); } @@ -134813,26 +131872,26 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 249 /* VariableDeclaration */ || - node.kind === 162 /* PropertySignature */ || - node.kind === 163 /* PropertyDeclaration */; + node.kind === 246 /* VariableDeclaration */ || + node.kind === 161 /* PropertySignature */ || + node.kind === 162 /* PropertyDeclaration */; } function transformJSDocType(node) { switch (node.kind) { - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: return ts.factory.createTypeReferenceNode("any", ts.emptyArray); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 306 /* JSDocNonNullableType */: + case 302 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, ts.nullTransformationContext); @@ -134857,7 +131916,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 309 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 + var isRest = node.type.kind === 305 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; // TODO: GH#18217 var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.factory.createToken(25 /* DotDotDotToken */) : node.dotDotDotToken; return ts.factory.createParameterDeclaration(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -134897,8 +131956,8 @@ var ts; var index = ts.factory.createParameterDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 144 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.factory.createTypeReferenceNode(node.typeArguments[0].kind === 144 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 143 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.factory.createTypeReferenceNode(node.typeArguments[0].kind === 143 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.factory.createTypeLiteralNode([ts.factory.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -135027,7 +132086,7 @@ var ts; return members; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 233 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 230 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; changes.delete(sourceFile, nodeToDelete); if (!assignmentExpr) { @@ -135083,7 +132142,7 @@ var ts; var arrowFunctionBody = arrowFunction.body; var bodyBlock; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 230 /* Block */) { + if (arrowFunctionBody.kind === 227 /* Block */) { bodyBlock = arrowFunctionBody; } // case 2: () => [1,2,3] @@ -135278,7 +132337,7 @@ var ts; // will eventually become // const response = await fetch('...') // so we push an entry for 'response'. - if (lastCallSignature && !ts.isParameter(node.parent) && !ts.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { + if (lastCallSignature && !ts.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { var firstParameter = ts.firstOrUndefined(lastCallSignature.parameters); var ident = firstParameter && ts.isParameter(firstParameter.valueDeclaration) && ts.tryCast(firstParameter.valueDeclaration.name, ts.isIdentifier) || ts.factory.createUniqueName("result", 16 /* Optimistic */); var synthName = getNewNameIfConflict(ident, collidingSymbolMap); @@ -135304,22 +132363,7 @@ var ts; } } }); - return ts.getSynthesizedDeepCloneWithReplacements(nodeToRename, /*includeTrivia*/ true, function (original) { - if (ts.isBindingElement(original) && ts.isIdentifier(original.name) && ts.isObjectBindingPattern(original.parent)) { - var symbol = checker.getSymbolAtLocation(original.name); - var renameInfo = symbol && identsToRenameMap.get(String(ts.getSymbolId(symbol))); - if (renameInfo && renameInfo.text !== (original.name || original.propertyName).getText()) { - return ts.factory.createBindingElement(original.dotDotDotToken, original.propertyName || original.name, renameInfo, original.initializer); - } - } - else if (ts.isIdentifier(original)) { - var symbol = checker.getSymbolAtLocation(original); - var renameInfo = symbol && identsToRenameMap.get(String(ts.getSymbolId(symbol))); - if (renameInfo) { - return ts.factory.createIdentifier(renameInfo.text); - } - } - }); + return ts.getSynthesizedDeepCloneWithRenames(nodeToRename, /*includeTrivia*/ true, identsToRenameMap, checker); } function getNewNameIfConflict(name, originalNames) { var numVarsSameName = (originalNames.get(name.text) || ts.emptyArray).length; @@ -135400,7 +132444,7 @@ var ts; } var tryStatement = ts.factory.createTryStatement(tryBlock, catchClause, /*finallyBlock*/ undefined); var destructuredResult = prevArgName && varDeclIdentifier && isSynthBindingPattern(prevArgName) - && ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(ts.getSynthesizedDeepClone(prevArgName.bindingPattern), /*exclamationToken*/ undefined, /*type*/ undefined, varDeclIdentifier)], 2 /* Const */)); + && ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ts.factory.createVariableDeclaration(ts.getSynthesizedDeepCloneWithRenames(prevArgName.bindingPattern), /*exclamationToken*/ undefined, /*type*/ undefined, varDeclIdentifier)], 2 /* Const */)); return ts.compact([varDeclList, tryStatement, destructuredResult]); } function createUniqueSynthName(prevArgName) { @@ -135459,7 +132503,7 @@ var ts; } // should be kept up to date with isFixablePromiseArgument in suggestionDiagnostics.ts function getTransformationBody(func, prevArgName, argName, parent, transformer) { - var _a, _b, _c, _d, _e; + var _a, _b, _c, _d; switch (func.kind) { case 103 /* NullKeyword */: // do not produce a transformed statement for a null argument @@ -135485,24 +132529,22 @@ var ts; prevArgName.types.push(returnType); } return varDeclOrAssignment; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: { + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: { var funcBody = func.body; - var returnType_1 = (_c = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) === null || _c === void 0 ? void 0 : _c.getReturnType(); // Arrow functions with block bodies { } will enter this control flow if (ts.isBlock(funcBody)) { var refactoredStmts = []; var seenReturnStatement = false; - for (var _i = 0, _f = funcBody.statements; _i < _f.length; _i++) { - var statement = _f[_i]; + for (var _i = 0, _e = funcBody.statements; _i < _e.length; _i++) { + var statement = _e[_i]; if (ts.isReturnStatement(statement)) { seenReturnStatement = true; if (ts.isReturnStatementWithFixablePromiseHandler(statement)) { refactoredStmts = refactoredStmts.concat(getInnerTransformationBody(transformer, [statement], prevArgName)); } else { - var possiblyAwaitedRightHandSide = returnType_1 && statement.expression ? getPossiblyAwaitedRightHandSide(transformer.checker, returnType_1, statement.expression) : statement.expression; - refactoredStmts.push.apply(refactoredStmts, maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_d = parent.typeArguments) === null || _d === void 0 ? void 0 : _d[0])); + refactoredStmts.push.apply(refactoredStmts, maybeAnnotateAndReturn(statement.expression, (_c = parent.typeArguments) === null || _c === void 0 ? void 0 : _c[0])); } } else { @@ -135519,21 +132561,19 @@ var ts; if (innerCbBody.length > 0) { return innerCbBody; } - if (returnType_1) { - var possiblyAwaitedRightHandSide = getPossiblyAwaitedRightHandSide(transformer.checker, returnType_1, funcBody); - if (!shouldReturn(parent, transformer)) { - var transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide, /*typeAnnotation*/ undefined); - if (prevArgName) { - prevArgName.types.push(returnType_1); - } - return transformedStatement; - } - else { - return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_e = parent.typeArguments) === null || _e === void 0 ? void 0 : _e[0]); + var type_1 = transformer.checker.getTypeAtLocation(func); + var returnType_1 = getLastCallSignature(type_1, transformer.checker).getReturnType(); + var rightHandSide = ts.getSynthesizedDeepClone(funcBody); + var possiblyAwaitedRightHandSide = !!transformer.checker.getPromisedTypeOfPromise(returnType_1) ? ts.factory.createAwaitExpression(rightHandSide) : rightHandSide; + if (!shouldReturn(parent, transformer)) { + var transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide, /*typeAnnotation*/ undefined); + if (prevArgName) { + prevArgName.types.push(returnType_1); } + return transformedStatement; } else { - return silentFail(); + return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, (_d = parent.typeArguments) === null || _d === void 0 ? void 0 : _d[0]); } } } @@ -135543,10 +132583,6 @@ var ts; } return ts.emptyArray; } - function getPossiblyAwaitedRightHandSide(checker, type, expr) { - var rightHandSide = ts.getSynthesizedDeepClone(expr); - return !!checker.getPromisedTypeOfPromise(type) ? ts.factory.createAwaitExpression(rightHandSide) : rightHandSide; - } function getLastCallSignature(type, checker) { var callSignatures = checker.getSignaturesOfType(type, 0 /* Call */); return ts.lastOrUndefined(callSignatures); @@ -135702,10 +132738,10 @@ var ts; } var importNode = ts.importFromModuleSpecifier(moduleSpecifier); switch (importNode.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: changes.replaceNode(importingFile, importNode, ts.makeImport(importNode.name, /*namedImports*/ undefined, moduleSpecifier, quotePreference)); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (ts.isRequireCall(importNode, /*checkArgumentIsStringLiteralLike*/ false)) { changes.replaceNode(importingFile, importNode, ts.factory.createPropertyAccessExpression(ts.getSynthesizedDeepClone(importNode), "default")); } @@ -135719,25 +132755,11 @@ var ts; var exports = collectExportRenames(sourceFile, checker, identifiers); convertExportsAccesses(sourceFile, exports, changes); var moduleExportsChangedToDefault = false; - var useSitesToUnqualify; - // Process variable statements first to collect use sites that need to be updated inside other transformations - for (var _i = 0, _a = ts.filter(sourceFile.statements, ts.isVariableStatement); _i < _a.length; _i++) { + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var statement = _a[_i]; - var newUseSites = convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); - if (newUseSites) { - ts.copyEntries(newUseSites, useSitesToUnqualify !== null && useSitesToUnqualify !== void 0 ? useSitesToUnqualify : (useSitesToUnqualify = new ts.Map())); - } - } - // `convertStatement` will delete entries from `useSitesToUnqualify` when containing statements are replaced - for (var _b = 0, _c = ts.filter(sourceFile.statements, function (s) { return !ts.isVariableStatement(s); }); _b < _c.length; _b++) { - var statement = _c[_b]; - var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference); + var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference); moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; } - // Remaining use sites can be changed directly - useSitesToUnqualify === null || useSitesToUnqualify === void 0 ? void 0 : useSitesToUnqualify.forEach(function (replacement, original) { - changes.replaceNode(sourceFile, original, replacement); - }); return moduleExportsChangedToDefault; } function collectExportRenames(sourceFile, checker, identifiers) { @@ -135770,24 +132792,24 @@ var ts; node.forEachChild(recur); }); } - function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference) { + function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference) { switch (statement.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); return false; - case 233 /* ExpressionStatement */: { + case 230 /* ExpressionStatement */: { var expression = statement.expression; switch (expression.kind) { - case 203 /* CallExpression */: { + case 200 /* CallExpression */: { if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteralLike*/ true)) { // For side-effecting require() call, just make a side-effecting import. changes.replaceNode(sourceFile, statement, ts.makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0], quotePreference)); } return false; } - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var operatorToken = expression.operatorToken; - return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports, useSitesToUnqualify); + return operatorToken.kind === 62 /* EqualsToken */ && convertAssignment(sourceFile, checker, expression, changes, exports); } } } @@ -135799,17 +132821,17 @@ var ts; function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference) { var declarationList = statement.declarationList; var foundImport = false; - var converted = ts.map(declarationList.declarations, function (decl) { + var newNodes = ts.flatMap(declarationList.declarations, function (decl) { var name = decl.name, initializer = decl.initializer; if (initializer) { if (ts.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { // `const alias = module.exports;` can be removed. foundImport = true; - return convertedImports([]); + return []; } else if (ts.isRequireCall(initializer, /*checkArgumentIsStringLiteralLike*/ true)) { foundImport = true; - return convertSingleImport(name, initializer.arguments[0], checker, identifiers, target, quotePreference); + return convertSingleImport(sourceFile, name, initializer.arguments[0], changes, checker, identifiers, target, quotePreference); } else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, /*checkArgumentIsStringLiteralLike*/ true)) { foundImport = true; @@ -135817,40 +132839,33 @@ var ts; } } // Move it out to its own variable statement. (This will not be used if `!foundImport`) - return convertedImports([ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([decl], declarationList.flags))]); + return ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([decl], declarationList.flags)); }); if (foundImport) { // useNonAdjustedEndPosition to ensure we don't eat the newline after the statement. - changes.replaceNodeWithNodes(sourceFile, statement, ts.flatMap(converted, function (c) { return c.newImports; })); - var combinedUseSites_1; - ts.forEach(converted, function (c) { - if (c.useSitesToUnqualify) { - ts.copyEntries(c.useSitesToUnqualify, combinedUseSites_1 !== null && combinedUseSites_1 !== void 0 ? combinedUseSites_1 : (combinedUseSites_1 = new ts.Map())); - } - }); - return combinedUseSites_1; + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); } } /** Converts `const name = require("moduleSpecifier").propertyName` */ function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers, quotePreference) { switch (name.kind) { - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: { + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: { // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` var tmp = makeUniqueName(propertyName, identifiers); - return convertedImports([ + return [ makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference), makeConst(/*modifiers*/ undefined, name, ts.factory.createIdentifier(tmp)), - ]); + ]; } case 78 /* Identifier */: // `const a = require("b").c` --> `import { c as a } from "./b"; - return convertedImports([makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]); + return [makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]; default: return ts.Debug.assertNever(name, "Convert to ES6 module got invalid syntax form " + name.kind); } } - function convertAssignment(sourceFile, checker, assignment, changes, exports, useSitesToUnqualify) { + function convertAssignment(sourceFile, checker, assignment, changes, exports) { var left = assignment.left, right = assignment.right; if (!ts.isPropertyAccessExpression(left)) { return false; @@ -135861,7 +132876,7 @@ var ts; changes.delete(sourceFile, assignment.parent); } else { - var replacement = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right, useSitesToUnqualify) + var replacement = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right) : ts.isRequireCall(right, /*checkArgumentIsStringLiteralLike*/ true) ? convertReExportAll(right.arguments[0], checker) : undefined; if (replacement) { @@ -135883,20 +132898,20 @@ var ts; * Convert `module.exports = { ... }` to individual exports.. * We can't always do this if the module has interesting members -- then it will be a default export instead. */ - function tryChangeModuleExportsObject(object, useSitesToUnqualify) { + function tryChangeModuleExportsObject(object) { var statements = ts.mapAllOrFail(object.properties, function (prop) { switch (prop.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. // falls through - case 289 /* ShorthandPropertyAssignment */: - case 290 /* SpreadAssignment */: + case 286 /* ShorthandPropertyAssignment */: + case 287 /* SpreadAssignment */: return undefined; - case 288 /* PropertyAssignment */: - return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify); - case 165 /* MethodDeclaration */: - return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(92 /* ExportKeyword */)], prop, useSitesToUnqualify); + case 285 /* PropertyAssignment */: + return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer); + case 164 /* MethodDeclaration */: + return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(92 /* ExportKeyword */)], prop); default: ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind); } @@ -135956,10 +132971,10 @@ var ts; } } // TODO: GH#22492 this will cause an error if a change has been made inside the body of the node. - function convertExportsDotXEquals_replaceNode(name, exported, useSitesToUnqualify) { + function convertExportsDotXEquals_replaceNode(name, exported) { var modifiers = [ts.factory.createToken(92 /* ExportKeyword */)]; switch (exported.kind) { - case 208 /* FunctionExpression */: { + case 205 /* FunctionExpression */: { var expressionName = exported.name; if (expressionName && expressionName.text !== name) { // `exports.f = function g() {}` -> `export const f = function g() {}` @@ -135967,35 +132982,18 @@ var ts; } } // falls through - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // `exports.f = function() {}` --> `export function f() {}` - return functionExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); - case 221 /* ClassExpression */: + return functionExpressionToDeclaration(name, modifiers, exported); + case 218 /* ClassExpression */: // `exports.C = class {}` --> `export class C {}` - return classExpressionToDeclaration(name, modifiers, exported, useSitesToUnqualify); + return classExpressionToDeclaration(name, modifiers, exported); default: return exportConst(); } function exportConst() { // `exports.x = 0;` --> `export const x = 0;` - return makeConst(modifiers, ts.factory.createIdentifier(name), replaceImportUseSites(exported, useSitesToUnqualify)); // TODO: GH#18217 - } - } - function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) { - if (!useSitesToUnqualify || !ts.some(ts.arrayFrom(useSitesToUnqualify.keys()), function (original) { return ts.rangeContainsRange(nodeOrNodes, original); })) { - return nodeOrNodes; - } - return ts.isArray(nodeOrNodes) - ? ts.getSynthesizedDeepClonesWithReplacements(nodeOrNodes, /*includeTrivia*/ true, replaceNode) - : ts.getSynthesizedDeepCloneWithReplacements(nodeOrNodes, /*includeTrivia*/ true, replaceNode); - function replaceNode(original) { - // We are replacing `mod.SomeExport` wih `SomeExport`, so we only need to look at PropertyAccessExpressions - if (original.kind === 201 /* PropertyAccessExpression */) { - var replacement = useSitesToUnqualify.get(original); - // Remove entry from `useSitesToUnqualify` so the refactor knows it's taken care of by the parent statement we're replacing - useSitesToUnqualify.delete(original); - return replacement; - } + return makeConst(modifiers, ts.factory.createIdentifier(name), exported); // TODO: GH#18217 } } /** @@ -136003,9 +133001,9 @@ var ts; * Returns nodes that will replace the variable declaration for the commonjs import. * May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`. */ - function convertSingleImport(name, moduleSpecifier, checker, identifiers, target, quotePreference) { + function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target, quotePreference) { switch (name.kind) { - case 196 /* ObjectBindingPattern */: { + case 193 /* ObjectBindingPattern */: { var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) ? undefined @@ -136014,23 +133012,23 @@ var ts; : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text); }); if (importSpecifiers) { - return convertedImports([ts.makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier, quotePreference)]); + return [ts.makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier, quotePreference)]; } } // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 197 /* ArrayBindingPattern */: { + case 194 /* ArrayBindingPattern */: { /* import x from "x"; const [a, b, c] = x; */ var tmp = makeUniqueName(codefix.moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers); - return convertedImports([ + return [ ts.makeImport(ts.factory.createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier, quotePreference), makeConst(/*modifiers*/ undefined, ts.getSynthesizedDeepClone(name), ts.factory.createIdentifier(tmp)), - ]); + ]; } case 78 /* Identifier */: - return convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference); + return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers, quotePreference); default: return ts.Debug.assertNever(name, "Convert to ES6 module got invalid name kind " + name.kind); } @@ -136039,13 +133037,12 @@ var ts; * Convert `import x = require("x").` * Also converts uses like `x.y()` to `y()` and uses a named import. */ - function convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference) { + function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers, quotePreference) { var nameSymbol = checker.getSymbolAtLocation(name); // Maps from module property name to name actually used. (The same if there isn't shadowing.) var namedBindingsNames = new ts.Map(); // True if there is some non-property use like `x()` or `f(x)`. var needDefaultImport = false; - var useSitesToUnqualify; for (var _i = 0, _a = identifiers.original.get(name.text); _i < _a.length; _i++) { var use = _a[_i]; if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) { @@ -136061,7 +133058,7 @@ var ts; idName = makeUniqueName(propertyName, identifiers); namedBindingsNames.set(propertyName, idName); } - (useSitesToUnqualify !== null && useSitesToUnqualify !== void 0 ? useSitesToUnqualify : (useSitesToUnqualify = new ts.Map())).set(parent, ts.factory.createIdentifier(idName)); + changes.replaceNode(file, parent, ts.factory.createIdentifier(idName)); } else { needDefaultImport = true; @@ -136075,7 +133072,7 @@ var ts; // If it was unused, ensure that we at least import *something*. needDefaultImport = true; } - return convertedImports([ts.makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier, quotePreference)], useSitesToUnqualify); + return [ts.makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier, quotePreference)]; } // Identifiers helpers function makeUniqueName(name, identifiers) { @@ -136102,24 +133099,24 @@ var ts; function isFreeIdentifier(node) { var parent = node.parent; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return parent.name !== node; - case 198 /* BindingElement */: + case 195 /* BindingElement */: return parent.propertyName !== node; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return parent.propertyName !== node; default: return true; } } // Node helpers - function functionExpressionToDeclaration(name, additionalModifiers, fn, useSitesToUnqualify) { + function functionExpressionToDeclaration(name, additionalModifiers, fn) { return ts.factory.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal. - ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.factory.converters.convertToFunctionBlock(replaceImportUseSites(fn.body, useSitesToUnqualify))); + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.factory.converters.convertToFunctionBlock(ts.getSynthesizedDeepClone(fn.body))); } - function classExpressionToDeclaration(name, additionalModifiers, cls, useSitesToUnqualify) { + function classExpressionToDeclaration(name, additionalModifiers, cls) { return ts.factory.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), // TODO: GH#19915 Don't think this is even legal. - ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), replaceImportUseSites(cls.members, useSitesToUnqualify)); + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), ts.getSynthesizedDeepClones(cls.members)); } function makeSingleImport(localName, propertyName, moduleSpecifier, quotePreference) { return propertyName === "default" @@ -136138,12 +133135,6 @@ var ts; /*modifiers*/ undefined, /*isTypeOnly*/ false, exportSpecifiers && ts.factory.createNamedExports(exportSpecifiers), moduleSpecifier === undefined ? undefined : ts.factory.createStringLiteral(moduleSpecifier)); } - function convertedImports(newImports, useSitesToUnqualify) { - return { - newImports: newImports, - useSitesToUnqualify: useSitesToUnqualify - }; - } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -136203,7 +133194,7 @@ var ts; var fixedExportDeclarations = new ts.Map(); return codefix.codeFixAll(context, errorCodes, function (changes, diag) { var exportSpecifier = getExportSpecifierForDiagnosticSpan(diag, context.sourceFile); - if (exportSpecifier && ts.addToSeen(fixedExportDeclarations, ts.getNodeId(exportSpecifier.parent.parent))) { + if (exportSpecifier && !ts.addToSeen(fixedExportDeclarations, ts.getNodeId(exportSpecifier.parent.parent))) { fixSingleExportDeclaration(changes, exportSpecifier, context); } }); @@ -136220,7 +133211,8 @@ var ts; var exportDeclaration = exportClause.parent; var typeExportSpecifiers = getTypeExportSpecifiers(exportSpecifier, context); if (typeExportSpecifiers.length === exportClause.elements.length) { - changes.insertModifierBefore(context.sourceFile, 149 /* TypeKeyword */, exportClause); + changes.replaceNode(context.sourceFile, exportDeclaration, ts.factory.updateExportDeclaration(exportDeclaration, exportDeclaration.decorators, exportDeclaration.modifiers, + /*isTypeOnly*/ true, exportClause, exportDeclaration.moduleSpecifier)); } else { var valueExportDeclaration = ts.factory.updateExportDeclaration(exportDeclaration, exportDeclaration.decorators, exportDeclaration.modifiers, @@ -136229,10 +133221,7 @@ var ts; /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ true, ts.factory.createNamedExports(typeExportSpecifiers), exportDeclaration.moduleSpecifier); - changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, { - leadingTriviaOption: ts.textChanges.LeadingTriviaOption.IncludeAll, - trailingTriviaOption: ts.textChanges.TrailingTriviaOption.Exclude - }); + changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration); changes.insertNodeAfter(context.sourceFile, exportDeclaration, typeExportDeclaration); } } @@ -136299,53 +133288,6 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; -(function (ts) { - var codefix; - (function (codefix) { - var fixId = "convertLiteralTypeToMappedType"; - var errorCodes = [ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code]; - codefix.registerCodeFix({ - errorCodes: errorCodes, - getCodeActions: function (context) { - var sourceFile = context.sourceFile, span = context.span; - var info = getInfo(sourceFile, span.start); - if (!info) { - return undefined; - } - var name = info.name, constraint = info.constraint; - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); }); - return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Convert_0_to_1_in_0, constraint, name], fixId, ts.Diagnostics.Convert_all_type_literals_to_mapped_type)]; - }, - fixIds: [fixId], - getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { - var info = getInfo(diag.file, diag.start); - if (info) { - doChange(changes, diag.file, info); - } - }); } - }); - function getInfo(sourceFile, pos) { - var token = ts.getTokenAtPosition(sourceFile, pos); - if (ts.isIdentifier(token)) { - var propertySignature = ts.cast(token.parent.parent, ts.isPropertySignature); - var propertyName = token.getText(sourceFile); - return { - container: ts.cast(propertySignature.parent, ts.isTypeLiteralNode), - typeNode: propertySignature.type, - constraint: propertyName, - name: propertyName === "K" ? "P" : "K", - }; - } - return undefined; - } - function doChange(changes, sourceFile, _a) { - var container = _a.container, typeNode = _a.typeNode, constraint = _a.constraint, name = _a.name; - changes.replaceNode(sourceFile, container, ts.factory.createMappedTypeNode(/*readonlyToken*/ undefined, ts.factory.createTypeParameterDeclaration(name, ts.factory.createTypeReferenceNode(constraint)), /*nameType*/ undefined, /*questionToken*/ undefined, typeNode)); - } - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; (function (ts) { var codefix; (function (codefix) { @@ -136490,7 +133432,7 @@ var ts; var symbol = checker.getMergedSymbol(ts.skipAlias(exportedSymbol, checker)); var exportInfos = getAllReExportingModules(sourceFile, symbol, moduleSymbol, symbolName, host, program, useAutoImportProvider); var preferTypeOnlyImport = !!usageIsTypeOnly && compilerOptions.importsNotUsedAsValues === 2 /* Error */; - var useRequire = shouldUseRequire(sourceFile, program); + var useRequire = shouldUseRequire(sourceFile, compilerOptions); var fix = getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, /*position*/ undefined, preferTypeOnlyImport, useRequire, host, preferences); addImport({ fixes: [fix], symbolName: symbolName }); } @@ -136593,7 +133535,7 @@ var ts; function getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, symbolName, host, program, formatContext, position, preferences) { var compilerOptions = program.getCompilerOptions(); var exportInfos = getAllReExportingModules(sourceFile, exportedSymbol, moduleSymbol, symbolName, host, program, /*useAutoImportProvider*/ true); - var useRequire = shouldUseRequire(sourceFile, program); + var useRequire = shouldUseRequire(sourceFile, compilerOptions); var preferTypeOnlyImport = compilerOptions.importsNotUsedAsValues === 2 /* Error */ && !ts.isSourceFileJS(sourceFile) && ts.isValidTypeOnlyAliasUseSite(ts.getTokenAtPosition(sourceFile, position)); var moduleSpecifier = ts.first(getNewImportInfos(program, sourceFile, position, preferTypeOnlyImport, useRequire, exportInfos, host, preferences)).moduleSpecifier; var fix = getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, position, preferTypeOnlyImport, useRequire, host, preferences); @@ -136619,7 +133561,7 @@ var ts; return; } var defaultInfo = getDefaultLikeExportInfo(importingFile, moduleSymbol, checker, compilerOptions); - if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && ts.skipAlias(defaultInfo.symbol, checker) === exportedSymbol) { + if (defaultInfo && defaultInfo.name === symbolName && ts.skipAlias(defaultInfo.symbol, checker) === exportedSymbol) { result.push({ moduleSymbol: moduleSymbol, importKind: defaultInfo.kind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(defaultInfo.symbol, checker) }); } for (var _i = 0, _a = checker.getExportsAndPropertiesOfModule(moduleSymbol); _i < _a.length; _i++) { @@ -136675,11 +133617,11 @@ var ts; function getTargetModuleFromNamespaceLikeImport(declaration, checker) { var _a; switch (declaration.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return checker.getAliasedSymbol(declaration.symbol); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport); return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); default: @@ -136689,11 +133631,11 @@ var ts; function getNamespaceLikeImportText(declaration) { var _a, _b, _c; switch (declaration.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return declaration.name.text; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text; default: return ts.Debug.assertNever(declaration); @@ -136702,10 +133644,10 @@ var ts; function tryAddToExistingImport(existingImports, canUseTypeOnlyImport) { return ts.firstDefined(existingImports, function (_a) { var declaration = _a.declaration, importKind = _a.importKind; - if (declaration.kind === 260 /* ImportEqualsDeclaration */) + if (declaration.kind === 257 /* ImportEqualsDeclaration */) return undefined; - if (declaration.kind === 249 /* VariableDeclaration */) { - return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 196 /* ObjectBindingPattern */ + if (declaration.kind === 246 /* VariableDeclaration */) { + return (importKind === 0 /* Named */ || importKind === 1 /* Default */) && declaration.name.kind === 193 /* ObjectBindingPattern */ ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: declaration.name, importKind: importKind, moduleSpecifier: declaration.initializer.arguments[0].text, canUseTypeOnlyImport: false } : undefined; } @@ -136713,7 +133655,7 @@ var ts; if (!importClause) return undefined; var name = importClause.name, namedBindings = importClause.namedBindings; - return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 264 /* NamedImports */) + return importKind === 1 /* Default */ && !name || importKind === 0 /* Named */ && (!namedBindings || namedBindings.kind === 261 /* NamedImports */) ? { kind: 2 /* AddToExisting */, importClauseOrBindingPattern: importClause, importKind: importKind, moduleSpecifier: declaration.moduleSpecifier.getText(), canUseTypeOnlyImport: canUseTypeOnlyImport } : undefined; }); @@ -136726,38 +133668,15 @@ var ts; if (ts.isRequireVariableDeclaration(i.parent, /*requireStringLiteralLikeArgument*/ true)) { return checker.resolveExternalModuleName(moduleSpecifier) === moduleSymbol ? { declaration: i.parent, importKind: importKind } : undefined; } - if (i.kind === 261 /* ImportDeclaration */ || i.kind === 260 /* ImportEqualsDeclaration */) { + if (i.kind === 258 /* ImportDeclaration */ || i.kind === 257 /* ImportEqualsDeclaration */) { return checker.getSymbolAtLocation(moduleSpecifier) === moduleSymbol ? { declaration: i, importKind: importKind } : undefined; } }); } - function shouldUseRequire(sourceFile, program) { - // 1. TypeScript files don't use require variable declarations - if (!ts.isSourceFileJS(sourceFile)) { - return false; - } - // 2. If the current source file is unambiguously CJS or ESM, go with that - if (sourceFile.commonJsModuleIndicator && !sourceFile.externalModuleIndicator) - return true; - if (sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) - return false; - // 3. If there's a tsconfig/jsconfig, use its module setting - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions.configFile) { - return ts.getEmitModuleKind(compilerOptions) < ts.ModuleKind.ES2015; - } - // 4. Match the first other JS file in the program that's unambiguously CJS or ESM - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var otherFile = _a[_i]; - if (otherFile === sourceFile || !ts.isSourceFileJS(otherFile) || program.isSourceFileFromExternalLibrary(otherFile)) - continue; - if (otherFile.commonJsModuleIndicator && !otherFile.externalModuleIndicator) - return true; - if (otherFile.externalModuleIndicator && !otherFile.commonJsModuleIndicator) - return false; - } - // 5. Literally nothing to go on - return true; + function shouldUseRequire(sourceFile, compilerOptions) { + return ts.isSourceFileJS(sourceFile) + && !sourceFile.externalModuleIndicator + && (!!sourceFile.commonJsModuleIndicator || ts.getEmitModuleKind(compilerOptions) < ts.ModuleKind.ES2015); } function getNewImportInfos(program, sourceFile, position, preferTypeOnlyImport, useRequire, moduleSymbols, host, preferences) { var isJs = ts.isSourceFileJS(sourceFile); @@ -136792,9 +133711,9 @@ var ts; } function newImportInfoFromExistingSpecifier(_a, preferTypeOnlyImport, useRequire) { var declaration = _a.declaration, importKind = _a.importKind; - var moduleSpecifier = declaration.kind === 261 /* ImportDeclaration */ ? declaration.moduleSpecifier : - declaration.kind === 249 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : - declaration.moduleReference.kind === 272 /* ExternalModuleReference */ ? declaration.moduleReference.expression : + var moduleSpecifier = declaration.kind === 258 /* ImportDeclaration */ ? declaration.moduleSpecifier : + declaration.kind === 246 /* VariableDeclaration */ ? declaration.initializer.arguments[0] : + declaration.moduleReference.kind === 269 /* ExternalModuleReference */ ? declaration.moduleReference.expression : undefined; return moduleSpecifier && ts.isStringLiteral(moduleSpecifier) ? { kind: 3 /* AddNew */, moduleSpecifier: moduleSpecifier.text, importKind: importKind, typeOnly: preferTypeOnlyImport, useRequire: useRequire } @@ -136816,7 +133735,7 @@ var ts; var symbol = checker.getAliasedSymbol(umdSymbol); var symbolName = umdSymbol.name; var exportInfos = [{ moduleSymbol: symbol, importKind: getUmdImportKind(sourceFile, program.getCompilerOptions()), exportedSymbolIsTypeOnly: false }]; - var useRequire = shouldUseRequire(sourceFile, program); + var useRequire = shouldUseRequire(sourceFile, program.getCompilerOptions()); var fixes = getFixForImport(exportInfos, symbolName, ts.isIdentifier(token) ? token.getStart(sourceFile) : undefined, /*preferTypeOnlyImport*/ false, useRequire, program, sourceFile, host, preferences); return { fixes: fixes, symbolName: symbolName }; } @@ -136865,8 +133784,8 @@ var ts; ts.Debug.assert(symbolName !== "default" /* Default */, "'default' isn't a legal identifier and couldn't occur here"); var compilerOptions = program.getCompilerOptions(); var preferTypeOnlyImport = compilerOptions.importsNotUsedAsValues === 2 /* Error */ && ts.isValidTypeOnlyAliasUseSite(symbolToken); - var useRequire = shouldUseRequire(sourceFile, program); - var exportInfos = getExportInfos(symbolName, ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host); + var useRequire = shouldUseRequire(sourceFile, compilerOptions); + var exportInfos = getExportInfos(symbolName, ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, checker, program, useAutoImportProvider, host); var fixes = ts.arrayFrom(ts.flatMapIterator(exportInfos.entries(), function (_a) { var _ = _a[0], exportInfos = _a[1]; return getFixForImport(exportInfos, symbolName, symbolToken.getStart(sourceFile), preferTypeOnlyImport, useRequire, program, sourceFile, host, preferences); @@ -136884,25 +133803,23 @@ var ts; return symbolToken.text; } // Returns a map from an exported symbol's ID to a list of every way it's (re-)exported. - function getExportInfos(symbolName, currentTokenMeaning, cancellationToken, sourceFile, program, useAutoImportProvider, host) { + function getExportInfos(symbolName, currentTokenMeaning, cancellationToken, sourceFile, checker, program, useAutoImportProvider, host) { // For each original symbol, keep all re-exports of that symbol together so we can call `getCodeActionsForImport` on the whole group at once. // Maps symbol id to info for modules providing that symbol (original export + re-exports). var originalSymbolToExportInfos = ts.createMultiMap(); - function addSymbol(moduleSymbol, exportedSymbol, importKind, checker) { + function addSymbol(moduleSymbol, exportedSymbol, importKind) { originalSymbolToExportInfos.add(ts.getUniqueSymbolId(exportedSymbol, checker).toString(), { moduleSymbol: moduleSymbol, importKind: importKind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(exportedSymbol, checker) }); } - forEachExternalModuleToImportFrom(program, host, sourceFile, /*filterByPackageJson*/ true, useAutoImportProvider, function (moduleSymbol, _, program) { - var checker = program.getTypeChecker(); + forEachExternalModuleToImportFrom(program, host, sourceFile, /*filterByPackageJson*/ true, useAutoImportProvider, function (moduleSymbol) { cancellationToken.throwIfCancellationRequested(); - var compilerOptions = program.getCompilerOptions(); - var defaultInfo = getDefaultLikeExportInfo(sourceFile, moduleSymbol, checker, compilerOptions); - if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) { - addSymbol(moduleSymbol, defaultInfo.symbol, defaultInfo.kind, checker); + var defaultInfo = getDefaultLikeExportInfo(sourceFile, moduleSymbol, checker, program.getCompilerOptions()); + if (defaultInfo && defaultInfo.name === symbolName && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) { + addSymbol(moduleSymbol, defaultInfo.symbol, defaultInfo.kind); } // check exports with the same name var exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName, moduleSymbol); if (exportSymbolWithIdenticalName && symbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { - addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */, checker); + addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */); } }); return originalSymbolToExportInfos; @@ -136956,13 +133873,7 @@ var ts; return { symbolForMeaning: defaultExport, name: name }; if (defaultExport.flags & 2097152 /* Alias */) { var aliased = checker.getImmediateAliasedSymbol(defaultExport); - if (aliased && aliased.parent) { - // - `aliased` will be undefined if the module is exporting an unresolvable name, - // but we can still offer completions for it. - // - `aliased.parent` will be undefined if the module is exporting `globalThis.something`, - // or another expression that resolves to a global. - return getDefaultExportInfoWorker(aliased, aliased.parent, checker, compilerOptions); - } + return aliased && getDefaultExportInfoWorker(aliased, ts.Debug.checkDefined(aliased.parent, "Alias targets of default exports must have a parent"), checker, compilerOptions); } if (defaultExport.escapedName !== "default" /* Default */ && defaultExport.escapedName !== "export=" /* ExportEquals */) { @@ -137018,7 +133929,7 @@ var ts; } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, canUseTypeOnlyImport) { - if (clause.kind === 196 /* ObjectBindingPattern */) { + if (clause.kind === 193 /* ObjectBindingPattern */) { if (defaultImport) { addElementToBindingPattern(clause, defaultImport, "default"); } @@ -137052,7 +133963,7 @@ var ts; else if (existingSpecifiers === null || existingSpecifiers === void 0 ? void 0 : existingSpecifiers.length) { for (var _b = 0, newSpecifiers_2 = newSpecifiers; _b < newSpecifiers_2.length; _b++) { var spec = newSpecifiers_2[_b]; - changes.insertNodeInListAfter(sourceFile, ts.last(existingSpecifiers), spec, existingSpecifiers); + changes.insertNodeAtEndOfList(sourceFile, existingSpecifiers, spec); } } else { @@ -137425,7 +134336,7 @@ var ts; }); function getNamedTupleMember(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); - return ts.findAncestor(token, function (t) { return t.kind === 192 /* NamedTupleMember */; }); + return ts.findAncestor(token, function (t) { return t.kind === 191 /* NamedTupleMember */; }); } function doChange(changes, sourceFile, namedTupleMember) { if (!namedTupleMember) { @@ -137434,11 +134345,11 @@ var ts; var unwrappedType = namedTupleMember.type; var sawOptional = false; var sawRest = false; - while (unwrappedType.kind === 180 /* OptionalType */ || unwrappedType.kind === 181 /* RestType */ || unwrappedType.kind === 186 /* ParenthesizedType */) { - if (unwrappedType.kind === 180 /* OptionalType */) { + while (unwrappedType.kind === 179 /* OptionalType */ || unwrappedType.kind === 180 /* RestType */ || unwrappedType.kind === 185 /* ParenthesizedType */) { + if (unwrappedType.kind === 179 /* OptionalType */) { sawOptional = true; } - else if (unwrappedType.kind === 181 /* RestType */) { + else if (unwrappedType.kind === 180 /* RestType */) { sawRest = true; } unwrappedType = unwrappedType.type; @@ -137462,7 +134373,7 @@ var ts; ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code, - ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code, + ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2.code, // for JSX class components ts.Diagnostics.No_overload_matches_this_call.code, // for JSX FC @@ -137509,12 +134420,6 @@ var ts; } suggestedSymbol = checker.getSuggestedSymbolForNonexistentProperty(node, containingType); } - else if (ts.isQualifiedName(parent) && parent.right === node) { - var symbol = checker.getSymbolAtLocation(parent.left); - if (symbol && symbol.flags & 1536 /* Module */) { - suggestedSymbol = checker.getSuggestedSymbolForNonexistentModule(parent.right, symbol); - } - } else if (ts.isImportSpecifier(parent) && parent.name === node) { ts.Debug.assertNode(node, ts.isIdentifier, "Expected an identifier for spelling (import)"); var importDeclaration = ts.findAncestor(node, ts.isImportDeclaration); @@ -137738,19 +134643,19 @@ var ts; } function getVariableLikeInitializer(declaration) { switch (declaration.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: return declaration.initializer; - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return declaration.initializer && (ts.isJsxExpression(declaration.initializer) ? declaration.initializer.expression : undefined); - case 289 /* ShorthandPropertyAssignment */: - case 162 /* PropertySignature */: - case 291 /* EnumMember */: - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: + case 286 /* ShorthandPropertyAssignment */: + case 161 /* PropertySignature */: + case 288 /* EnumMember */: + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: return undefined; } } @@ -137936,7 +134841,7 @@ var ts; function addMissingMemberInJs(changeTracker, declSourceFile, classDeclaration, token, makeStatic) { var tokenName = token.text; if (makeStatic) { - if (classDeclaration.kind === 221 /* ClassExpression */) { + if (classDeclaration.kind === 218 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -137988,7 +134893,7 @@ var ts; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 216 /* BinaryExpression */) { + if (token.parent.parent.kind === 213 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -138027,7 +134932,7 @@ var ts; } function createAddIndexSignatureAction(context, declSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.factory.createKeywordTypeNode(147 /* StringKeyword */); + var stringTypeNode = ts.factory.createKeywordTypeNode(146 /* StringKeyword */); var indexingParameter = ts.factory.createParameterDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -138078,7 +134983,7 @@ var ts; */ var hasStringInitializer = ts.some(enumDeclaration.members, function (member) { var type = checker.getTypeAtLocation(member); - return !!(type && type.flags & 402653316 /* StringLike */); + return !!(type && type.flags & 132 /* StringLike */); }); var enumMember = ts.factory.createEnumMember(token, hasStringInitializer ? ts.factory.createStringLiteral(token.text) : undefined); changes.replaceNode(enumDeclaration.getSourceFile(), enumDeclaration, ts.factory.updateEnumDeclaration(enumDeclaration, enumDeclaration.decorators, enumDeclaration.modifiers, enumDeclaration.name, ts.concatenate(enumDeclaration.members, ts.singleElementArray(enumMember))), { @@ -138602,7 +135507,7 @@ var ts; if (!isValidCharacter(character)) { return; } - var replacement = useHtmlEntity ? htmlEntity[character] : "{" + ts.quote(sourceFile, preferences, character) + "}"; + var replacement = useHtmlEntity ? htmlEntity[character] : "{" + ts.quote(character, preferences) + "}"; changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -138744,7 +135649,7 @@ var ts; }, }); function changeInferToUnknown(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token.parent, ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */)); + changes.replaceNode(sourceFile, token.parent, ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */)); } function createDeleteFix(changes, diag) { return codefix.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts.Diagnostics.Delete_all_unused_declarations); @@ -138760,7 +135665,7 @@ var ts; return ts.isVariableDeclarationList(token.parent) && ts.first(token.parent.getChildren(sourceFile)) === token; } function deleteEntireVariableStatement(changes, sourceFile, node) { - changes.delete(sourceFile, node.parent.kind === 232 /* VariableStatement */ ? node.parent : node); + changes.delete(sourceFile, node.parent.kind === 229 /* VariableStatement */ ? node.parent : node); } function deleteDestructuringElements(changes, sourceFile, node) { ts.forEach(node.elements, function (n) { return changes.delete(sourceFile, n); }); @@ -138785,14 +135690,14 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 160 /* Parameter */: - case 159 /* TypeParameter */: + case 159 /* Parameter */: + case 158 /* TypeParameter */: return true; - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: return true; } } @@ -138824,10 +135729,12 @@ var ts; } function tryDeleteParameter(changes, sourceFile, p, checker, sourceFiles, isFixAll) { if (isFixAll === void 0) { isFixAll = false; } - if (mayDeleteParameter(checker, sourceFile, p, isFixAll)) { - if (p.modifiers && p.modifiers.length > 0 && - (!ts.isIdentifier(p.name) || ts.FindAllReferences.Core.isSymbolReferencedInFile(p.name, checker, sourceFile))) { - p.modifiers.forEach(function (modifier) { return changes.deleteModifier(sourceFile, modifier); }); + if (mayDeleteParameter(p, checker, isFixAll)) { + if (p.modifiers && p.modifiers.length > 0 + && (!ts.isIdentifier(p.name) || ts.FindAllReferences.Core.isSymbolReferencedInFile(p.name, checker, sourceFile))) { + p.modifiers.forEach(function (modifier) { + changes.deleteModifier(sourceFile, modifier); + }); } else { changes.delete(sourceFile, p); @@ -138835,28 +135742,29 @@ var ts; } } } - function mayDeleteParameter(checker, sourceFile, parameter, isFixAll) { - var parent = parameter.parent; + function mayDeleteParameter(p, checker, isFixAll) { + var parent = p.parent; switch (parent.kind) { - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // Don't remove a parameter if this overrides something. var symbol = checker.getSymbolAtLocation(parent.name); if (ts.isMemberSymbolInBaseType(symbol, checker)) return false; // falls through - case 166 /* Constructor */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: return true; - case 251 /* FunctionDeclaration */: { - if (parent.name && isCallbackLike(checker, sourceFile, parent.name)) { - return isLastParameter(parent, parameter, isFixAll); - } - return true; - } - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: { // Can't remove a non-last parameter in a callback. Can remove a parameter in code-fix-all if future parameters are also unused. - return isLastParameter(parent, parameter, isFixAll); - case 168 /* SetAccessor */: + var parameters = parent.parameters; + var index = parameters.indexOf(p); + ts.Debug.assert(index !== -1, "The parameter should already be in the list"); + return isFixAll + ? parameters.slice(index + 1).every(function (p) { return p.name.kind === 78 /* Identifier */ && !p.symbol.isReferenced; }) + : index === parameters.length - 1; + } + case 167 /* SetAccessor */: // Setter must have a parameter return false; default: @@ -138871,19 +135779,6 @@ var ts; } }); } - function isCallbackLike(checker, sourceFile, name) { - return !!ts.FindAllReferences.Core.eachSymbolReferenceInFile(name, checker, sourceFile, function (reference) { - return ts.isIdentifier(reference) && ts.isCallExpression(reference.parent) && reference.parent.arguments.indexOf(reference) >= 0; - }); - } - function isLastParameter(func, parameter, isFixAll) { - var parameters = func.parameters; - var index = parameters.indexOf(parameter); - ts.Debug.assert(index !== -1, "The parameter should already be in the list"); - return isFixAll ? - parameters.slice(index + 1).every(function (p) { return ts.isIdentifier(p.name) && !p.symbol.isReferenced; }) : - index === parameters.length - 1; - } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -138918,7 +135813,7 @@ var ts; var container = (ts.isBlock(statement.parent) ? statement.parent : statement).parent; if (!ts.isBlock(statement.parent) || statement === ts.first(statement.parent.statements)) { switch (container.kind) { - case 234 /* IfStatement */: + case 231 /* IfStatement */: if (container.elseStatement) { if (ts.isBlock(statement.parent)) { break; @@ -138929,8 +135824,8 @@ var ts; return; } // falls through - case 236 /* WhileStatement */: - case 237 /* ForStatement */: + case 233 /* WhileStatement */: + case 234 /* ForStatement */: changes.delete(sourceFile, container); return; } @@ -139003,7 +135898,7 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; - if (typeNode.kind === 305 /* JSDocNullableType */) { + if (typeNode.kind === 301 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 32768 /* Undefined */), fixIdNullable, ts.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); @@ -139023,7 +135918,7 @@ var ts; if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 305 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; + var fixedType = typeNode.kind === 301 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type; doChange(changes, sourceFile, typeNode, fixedType, checker); }); } @@ -139040,22 +135935,22 @@ var ts; // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 224 /* AsExpression */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 251 /* FunctionDeclaration */: - case 167 /* GetAccessor */: - case 171 /* IndexSignature */: - case 190 /* MappedType */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 168 /* SetAccessor */: - case 254 /* TypeAliasDeclaration */: - case 206 /* TypeAssertionExpression */: - case 249 /* VariableDeclaration */: + case 221 /* AsExpression */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 248 /* FunctionDeclaration */: + case 166 /* GetAccessor */: + case 170 /* IndexSignature */: + case 189 /* MappedType */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 167 /* SetAccessor */: + case 251 /* TypeAliasDeclaration */: + case 203 /* TypeAssertionExpression */: + case 246 /* VariableDeclaration */: return true; default: return false; @@ -139157,14 +136052,14 @@ var ts; } var insertBefore; switch (containingFunction.kind) { - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 97 /* FunctionKeyword */, sourceFile); break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 20 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -139243,7 +136138,7 @@ var ts; else { ts.Debug.fail("fixPropertyOverrideAccessor codefix got unexpected error code " + code); } - return codefix.generateAccessorFromProperty(file, context.program, startPosition, endPosition, context, ts.Diagnostics.Generate_get_and_set_accessors.message); + return codefix.generateAccessorFromProperty(file, startPosition, endPosition, context, ts.Diagnostics.Generate_get_and_set_accessors.message); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -139497,7 +136392,7 @@ var ts; function annotate(changes, importAdder, sourceFile, declaration, type, program, host) { var typeNode = ts.getTypeNodeIfAccessible(type, declaration, program, host); if (typeNode) { - if (ts.isInJSFile(sourceFile) && declaration.kind !== 162 /* PropertySignature */) { + if (ts.isInJSFile(sourceFile) && declaration.kind !== 161 /* PropertySignature */) { var parent = ts.isVariableDeclaration(declaration) ? ts.tryCast(declaration.parent.parent, ts.isVariableStatement) : declaration; if (!parent) { return; @@ -139546,14 +136441,14 @@ var ts; return !!merged; }); }); var tag = ts.factory.createJSDocComment(comments.join("\n"), ts.factory.createNodeArray(__spreadArrays((oldTags || ts.emptyArray), unmergedNewTags))); - var jsDocNode = parent.kind === 209 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; + var jsDocNode = parent.kind === 206 /* ArrowFunction */ ? getJsDocNodeForArrowFunction(parent) : parent; jsDocNode.jsDoc = parent.jsDoc; jsDocNode.jsDocCache = parent.jsDocCache; changes.insertJsdocCommentBefore(sourceFile, jsDocNode, tag); } codefix.addJSDocTags = addJSDocTags; function getJsDocNodeForArrowFunction(signature) { - if (signature.parent.kind === 163 /* PropertyDeclaration */) { + if (signature.parent.kind === 162 /* PropertyDeclaration */) { return signature.parent; } return signature.parent.parent; @@ -139563,14 +136458,14 @@ var ts; return undefined; } switch (oldTag.kind) { - case 326 /* JSDocParameterTag */: { + case 322 /* JSDocParameterTag */: { var oldParam = oldTag; var newParam = newTag; return ts.isIdentifier(oldParam.name) && ts.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts.factory.createJSDocParameterTag(/*tagName*/ undefined, newParam.name, /*isBracketed*/ false, newParam.typeExpression, newParam.isNameFirst, oldParam.comment) : undefined; } - case 327 /* JSDocReturnTag */: + case 323 /* JSDocReturnTag */: return ts.factory.createJSDocReturnTag(/*tagName*/ undefined, newTag.typeExpression, oldTag.comment); } } @@ -139595,18 +136490,18 @@ var ts; function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { var searchToken; switch (containingFunction.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: searchToken = ts.findChildOfKind(containingFunction, 132 /* ConstructorKeyword */, sourceFile); break; - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: var parent = containingFunction.parent; searchToken = ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) ? parent.name : containingFunction.name; break; - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: searchToken = containingFunction.name; break; } @@ -139748,24 +136643,24 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: inferTypeFromExpressionStatement(node, usage); break; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: usage.isNumber = true; break; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpression(node.parent, usage); break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: inferTypeFromBinaryExpression(node, node.parent, usage); break; - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: inferTypeFromSwitchStatementLabel(node.parent, usage); break; - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpression(node.parent, usage); } @@ -139773,20 +136668,20 @@ var ts; inferTypeFromContextualType(node, usage); } break; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpression(node.parent, usage); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: inferTypeFromPropertyElementExpression(node.parent, node, usage); break; - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: inferTypeFromPropertyAssignment(node.parent, usage); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: inferTypeFromPropertyDeclaration(node.parent, usage); break; - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { var _a = node.parent, name = _a.name, initializer = _a.initializer; if (node === name) { if (initializer) { // This can happen for `let x = null;` which still has an implicit-any error. @@ -139881,7 +136776,7 @@ var ts; else if (otherOperandType.flags & 296 /* NumberLike */) { usage.isNumber = true; } - else if (otherOperandType.flags & 402653316 /* StringLike */) { + else if (otherOperandType.flags & 132 /* StringLike */) { usage.isString = true; } else if (otherOperandType.flags & 1 /* Any */) { @@ -139908,7 +136803,7 @@ var ts; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: if (node === parent.left && - (node.parent.parent.kind === 249 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 246 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usage, checker.getTypeAtLocation(parent.right)); @@ -139936,7 +136831,7 @@ var ts; } } calculateUsageOfNode(parent, call.return_); - if (parent.kind === 203 /* CallExpression */) { + if (parent.kind === 200 /* CallExpression */) { (usage.calls || (usage.calls = [])).push(call); } else { @@ -140379,8 +137274,8 @@ var ts; var ambient = !!(enclosingDeclaration.flags & 8388608 /* Ambient */); var quotePreference = ts.getQuotePreference(sourceFile, preferences); switch (declaration.kind) { - case 162 /* PropertySignature */: - case 163 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 162 /* PropertyDeclaration */: var flags = quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined; var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (importAdder) { @@ -140394,8 +137289,8 @@ var ts; /*decorators*/ undefined, modifiers, name, optional ? ts.factory.createToken(57 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: { + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: { var typeNode_1 = checker.typeToTypeNode(type, enclosingDeclaration, /*flags*/ undefined, getNoopSymbolTrackerWithResolver(context)); var allAccessors = ts.getAllAccessorDeclarations(declarations, declaration); var orderedAccessors = allAccessors.secondAccessor @@ -140424,8 +137319,8 @@ var ts; } break; } - case 164 /* MethodSignature */: - case 165 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 164 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -140471,7 +137366,7 @@ var ts; var checker = program.getTypeChecker(); var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions()); var flags = 1 /* NoTruncation */ | 1073741824 /* NoUndefinedOptionalParameterType */ | 256 /* SuppressAnyReturnType */ | (quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : 0); - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 165 /* MethodDeclaration */, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 164 /* MethodDeclaration */, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context)); if (!signatureDeclaration) { return undefined; } @@ -140720,8 +137615,8 @@ var ts; (function (ts) { var codefix; (function (codefix) { - function generateAccessorFromProperty(file, program, start, end, context, _actionName) { - var fieldInfo = getAccessorConvertiblePropertyAtPosition(file, program, start, end); + function generateAccessorFromProperty(file, start, end, context, _actionName) { + var fieldInfo = getAccessorConvertiblePropertyAtPosition(file, start, end); if (!fieldInfo || !fieldInfo.info) return undefined; var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); @@ -140744,7 +137639,7 @@ var ts; fieldModifiers = createModifiers(prepareModifierFlagsForField(modifierFlags)); } } - updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, fieldModifiers); + updateFieldDeclaration(changeTracker, file, declaration, fieldName, fieldModifiers); var getAccessor = generateGetAccessor(fieldName, accessorName, type, accessorModifiers, isStatic, container); ts.suppressLeadingAndTrailingTrivia(getAccessor); insertAccessor(changeTracker, file, getAccessor, declaration, container); @@ -140793,7 +137688,7 @@ var ts; modifierFlags |= 8 /* Private */; return modifierFlags; } - function getAccessorConvertiblePropertyAtPosition(file, program, start, end, considerEmptySpans) { + function getAccessorConvertiblePropertyAtPosition(file, start, end, considerEmptySpans) { if (considerEmptySpans === void 0) { considerEmptySpans = true; } var node = ts.getTokenAtPosition(file, start); var cursorRequest = start === end && considerEmptySpans; @@ -140823,8 +137718,8 @@ var ts; info: { isStatic: ts.hasStaticModifier(declaration), isReadonly: ts.hasEffectiveReadonlyModifier(declaration), - type: getDeclarationType(declaration, program), - container: declaration.kind === 160 /* Parameter */ ? declaration.parent.parent : declaration.parent, + type: ts.getTypeAnnotationNode(declaration), + container: declaration.kind === 159 /* Parameter */ ? declaration.parent.parent : declaration.parent, originalName: declaration.name.text, declaration: declaration, fieldName: fieldName, @@ -140852,17 +137747,17 @@ var ts; ts.factory.createExpressionStatement(ts.factory.createAssignment(createAccessorAccessExpression(fieldName, isStatic, container), ts.factory.createIdentifier("value"))) ], /*multiLine*/ true)); } - function updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) { - var property = ts.factory.updatePropertyDeclaration(declaration, declaration.decorators, modifiers, fieldName, declaration.questionToken || declaration.exclamationToken, type, declaration.initializer); + function updatePropertyDeclaration(changeTracker, file, declaration, fieldName, modifiers) { + var property = ts.factory.updatePropertyDeclaration(declaration, declaration.decorators, modifiers, fieldName, declaration.questionToken || declaration.exclamationToken, declaration.type, declaration.initializer); changeTracker.replaceNode(file, declaration, property); } function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) { var assignment = ts.factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer); changeTracker.replacePropertyAssignment(file, declaration, assignment); } - function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) { + function updateFieldDeclaration(changeTracker, file, declaration, fieldName, modifiers) { if (ts.isPropertyDeclaration(declaration)) { - updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers); + updatePropertyDeclaration(changeTracker, file, declaration, fieldName, modifiers); } else if (ts.isPropertyAssignment(declaration)) { updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName); @@ -140895,18 +137790,6 @@ var ts; } }); } - function getDeclarationType(declaration, program) { - var typeNode = ts.getTypeAnnotationNode(declaration); - if (ts.isPropertyDeclaration(declaration) && typeNode && declaration.questionToken) { - var typeChecker = program.getTypeChecker(); - var type = typeChecker.getTypeFromTypeNode(typeNode); - if (!typeChecker.isTypeAssignableTo(typeChecker.getUndefinedType(), type)) { - var types = ts.isUnionTypeNode(typeNode) ? typeNode.types : [typeNode]; - return ts.factory.createUnionTypeNode(__spreadArrays(types, [ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)])); - } - } - return typeNode; - } function getAllSupers(decl, checker) { var res = []; while (decl) { @@ -140960,7 +137843,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 203 /* CallExpression */ : 204 /* NewExpression */; + var targetKind = ts.Diagnostics.This_expression_is_not_callable.code === context.errorCode ? 200 /* CallExpression */ : 201 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start), function (a) { return a.kind === targetKind; }); if (!node) { return []; @@ -141079,7 +137962,7 @@ var ts; return codefix.createCodeFixAction(fixName, changes, [ts.Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, ts.Diagnostics.Add_undefined_type_to_all_uninitialized_properties); } function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { - var undefinedTypeNode = ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */); + var undefinedTypeNode = ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */); var type = propertyDeclaration.type; // TODO: GH#18217 var types = ts.isUnionTypeNode(type) ? type.types.concat(undefinedTypeNode) : [type, undefinedTypeNode]; changeTracker.replaceNode(propertyDeclarationSourceFile, type, ts.factory.createUnionTypeNode(types)); @@ -141294,7 +138177,7 @@ var ts; function getImportTypeNode(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos); ts.Debug.assert(token.kind === 99 /* ImportKeyword */, "This token should be an ImportKeyword"); - ts.Debug.assert(token.parent.kind === 195 /* ImportType */, "Token parent should be an ImportType"); + ts.Debug.assert(token.parent.kind === 192 /* ImportType */, "Token parent should be an ImportType"); return token.parent; } function doChange(changes, sourceFile, importType) { @@ -141426,8 +138309,7 @@ var ts; var otherMembers = members.filter(function (member) { return !ts.isIndexSignatureDeclaration(member); }); var parameter = ts.first(indexSignature.parameters); var mappedTypeParameter = ts.factory.createTypeParameterDeclaration(ts.cast(parameter.name, ts.isIdentifier), parameter.type); - var mappedIntersectionType = ts.factory.createMappedTypeNode(ts.hasEffectiveReadonlyModifier(indexSignature) ? ts.factory.createModifier(142 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, - /*nameType*/ undefined, indexSignature.questionToken, indexSignature.type); + var mappedIntersectionType = ts.factory.createMappedTypeNode(ts.hasEffectiveReadonlyModifier(indexSignature) ? ts.factory.createModifier(141 /* ReadonlyKeyword */) : undefined, mappedTypeParameter, indexSignature.questionToken, indexSignature.type); var intersectionType = ts.factory.createIntersectionTypeNode(__spreadArrays(ts.getAllSuperTypeNodes(container), [ mappedIntersectionType ], (otherMembers.length ? [ts.factory.createTypeLiteralNode(otherMembers)] : ts.emptyArray))); @@ -141616,90 +138498,6 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; -(function (ts) { - var codefix; - (function (codefix) { - var fixName = "addVoidToPromise"; - var fixId = "addVoidToPromise"; - var errorCodes = [ - ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code - ]; - codefix.registerCodeFix({ - errorCodes: errorCodes, - fixIds: [fixId], - getCodeActions: function (context) { - var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span, context.program); }); - if (changes.length > 0) { - return [codefix.createCodeFixAction(fixName, changes, ts.Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId, ts.Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]; - } - }, - getAllCodeActions: function (context) { - return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag, context.program, new ts.Set()); }); - } - }); - function makeChange(changes, sourceFile, span, program, seen) { - var node = ts.getTokenAtPosition(sourceFile, span.start); - if (!ts.isIdentifier(node) || !ts.isCallExpression(node.parent) || node.parent.expression !== node || node.parent.arguments.length !== 0) - return; - var checker = program.getTypeChecker(); - var symbol = checker.getSymbolAtLocation(node); - // decl should be `new Promise(() => {})` - var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration; - if (!decl || !ts.isParameter(decl) || !ts.isNewExpression(decl.parent.parent)) - return; - // no need to make this change if we have already seen this parameter. - if (seen === null || seen === void 0 ? void 0 : seen.has(decl)) - return; - seen === null || seen === void 0 ? void 0 : seen.add(decl); - var typeArguments = getEffectiveTypeArguments(decl.parent.parent); - if (ts.some(typeArguments)) { - // append ` | void` to type argument - var typeArgument = typeArguments[0]; - var needsParens = !ts.isUnionTypeNode(typeArgument) && !ts.isParenthesizedTypeNode(typeArgument) && - ts.isParenthesizedTypeNode(ts.factory.createUnionTypeNode([typeArgument, ts.factory.createKeywordTypeNode(113 /* VoidKeyword */)]).types[0]); - if (needsParens) { - changes.insertText(sourceFile, typeArgument.pos, "("); - } - changes.insertText(sourceFile, typeArgument.end, needsParens ? ") | void" : " | void"); - } - else { - // make sure the Promise is type is untyped (i.e., `unknown`) - var signature = checker.getResolvedSignature(node.parent); - var parameter = signature === null || signature === void 0 ? void 0 : signature.parameters[0]; - var parameterType = parameter && checker.getTypeOfSymbolAtLocation(parameter, decl.parent.parent); - if (ts.isInJSFile(decl)) { - if (!parameterType || parameterType.flags & 3 /* AnyOrUnknown */) { - // give the expression a type - changes.insertText(sourceFile, decl.parent.parent.end, ")"); - changes.insertText(sourceFile, ts.skipTrivia(sourceFile.text, decl.parent.parent.pos), "/** @type {Promise} */("); - } - } - else { - if (!parameterType || parameterType.flags & 2 /* Unknown */) { - // add `void` type argument - changes.insertText(sourceFile, decl.parent.parent.expression.end, ""); - } - } - } - } - function getEffectiveTypeArguments(node) { - var _a; - if (ts.isInJSFile(node)) { - if (ts.isParenthesizedExpression(node.parent)) { - var jsDocType = (_a = ts.getJSDocTypeTag(node.parent)) === null || _a === void 0 ? void 0 : _a.typeExpression.type; - if (jsDocType && ts.isTypeReferenceNode(jsDocType) && ts.isIdentifier(jsDocType.typeName) && ts.idText(jsDocType.typeName) === "Promise") { - return jsDocType.typeArguments; - } - } - } - else { - return node.typeArguments; - } - } - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; (function (ts) { var refactor; (function (refactor) { @@ -141747,16 +138545,16 @@ var ts; return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.This_file_already_has_a_default_export) }; } switch (exportNode.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 256 /* ModuleDeclaration */: { + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 253 /* ModuleDeclaration */: { var node = exportNode; return node.name && ts.isIdentifier(node.name) ? { info: { exportNode: node, exportName: node.name, wasDefault: wasDefault, exportingModuleSymbol: exportingModuleSymbol } } : undefined; } - case 232 /* VariableStatement */: { + case 229 /* VariableStatement */: { var vs = exportNode; // Must be `export const x = something;`. if (!(vs.declarationList.flags & 2 /* Const */) || vs.declarationList.declarations.length !== 1) { @@ -141784,23 +138582,22 @@ var ts; else { var exportKeyword = ts.Debug.checkDefined(ts.findModifier(exportNode, 92 /* ExportKeyword */), "Should find an export keyword in modifier list"); switch (exportNode.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts.factory.createToken(87 /* DefaultKeyword */)); break; - case 232 /* VariableStatement */: - // If 'x' isn't used in this file and doesn't have type definition, `export const x = 0;` --> `export default 0;` - var decl = ts.first(exportNode.declarationList.declarations); - if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile) && !decl.type) { + case 229 /* VariableStatement */: + // If 'x' isn't used in this file, `export const x = 0;` --> `export default 0;` + if (!ts.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile)) { // We checked in `getInfo` that an initializer exists. - changes.replaceNode(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.Debug.checkDefined(decl.initializer, "Initializer was previously known to be present"))); + changes.replaceNode(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.Debug.checkDefined(ts.first(exportNode.declarationList.declarations).initializer, "Initializer was previously known to be present"))); break; } // falls through - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 256 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 253 /* ModuleDeclaration */: // `export type T = number;` -> `type T = number; export default T;` changes.deleteModifier(exportingSourceFile, exportKeyword); changes.insertNodeAfter(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.factory.createIdentifier(exportName.text))); @@ -141827,18 +138624,18 @@ var ts; function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { var parent = ref.parent; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: // `a.default` --> `a.foo` changes.replaceNode(importingSourceFile, ref, ts.factory.createIdentifier(exportName)); break; - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: { + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: { var spec = parent; // `default as foo` --> `foo`, `default as bar` --> `foo as bar` changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); break; } - case 262 /* ImportClause */: { + case 259 /* ImportClause */: { var clause = parent; ts.Debug.assert(clause.name === ref, "Import clause name should match provided ref"); var spec = makeImportSpecifier(exportName, ref.text); @@ -141847,7 +138644,7 @@ var ts; // `import foo from "./a";` --> `import { foo } from "./a";` changes.replaceNode(importingSourceFile, ref, ts.factory.createNamedImports([spec])); } - else if (namedBindings.kind === 263 /* NamespaceImport */) { + else if (namedBindings.kind === 260 /* NamespaceImport */) { // `import foo, * as a from "./a";` --> `import * as a from ".a/"; import { foo } from "./a";` changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); var quotePreference = ts.isStringLiteral(clause.parent.moduleSpecifier) ? ts.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1 /* Double */; @@ -141868,11 +138665,11 @@ var ts; function changeNamedToDefaultImport(importingSourceFile, ref, changes) { var parent = ref.parent; switch (parent.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: // `a.foo` --> `a.default` changes.replaceNode(importingSourceFile, ref, ts.factory.createIdentifier("default")); break; - case 265 /* ImportSpecifier */: { + case 262 /* ImportSpecifier */: { // `import { foo } from "./a";` --> `import foo from "./a";` // `import { foo as bar } from "./a";` --> `import bar from "./a";` var defaultImport = ts.factory.createIdentifier(parent.name.text); @@ -141885,7 +138682,7 @@ var ts; } break; } - case 270 /* ExportSpecifier */: { + case 267 /* ExportSpecifier */: { // `export { foo } from "./a";` --> `export { default as foo } from "./a";` // `export { foo as bar } from "./a";` --> `export { default as bar } from "./a";` // `export { foo as default } from "./a";` --> `export { default } from "./a";` @@ -141919,8 +138716,8 @@ var ts; if (!i) return ts.emptyArray; if (i.error === undefined) { - var description = i.info.kind === 263 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; - var actionName = i.info.kind === 263 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; + var description = i.info.kind === 260 /* NamespaceImport */ ? ts.Diagnostics.Convert_namespace_import_to_named_imports.message : ts.Diagnostics.Convert_named_imports_to_namespace_import.message; + var actionName = i.info.kind === 260 /* NamespaceImport */ ? actionNameNamespaceToNamed : actionNameNamedToNamespace; return [{ name: refactorName, description: description, actions: [{ name: actionName, description: description }] }]; } if (context.preferences.provideRefactorNotApplicableReason) { @@ -141959,7 +138756,7 @@ var ts; } function doChange(sourceFile, program, changes, toConvert) { var checker = program.getTypeChecker(); - if (toConvert.kind === 263 /* NamespaceImport */) { + if (toConvert.kind === 260 /* NamespaceImport */) { doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())); } else { @@ -142130,6 +138927,7 @@ var ts; if (!finalExpression || checker.isNullableType(checker.getTypeAtLocation(finalExpression))) { return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_convertible_access_expression) }; } + ; if ((ts.isPropertyAccessExpression(condition) || ts.isIdentifier(condition)) && getMatchingStart(condition, finalExpression.expression)) { return { info: { finalExpression: finalExpression, occurrences: [condition], expression: expression } }; @@ -142176,25 +138974,23 @@ var ts; * Returns subchain if chain begins with subchain syntactically. */ function getMatchingStart(chain, subchain) { - if (!ts.isIdentifier(subchain) && !ts.isPropertyAccessExpression(subchain) && !ts.isElementAccessExpression(subchain)) { - return undefined; - } - return chainStartsWith(chain, subchain) ? subchain : undefined; + return (ts.isIdentifier(subchain) || ts.isPropertyAccessExpression(subchain)) && + chainStartsWith(chain, subchain) ? subchain : undefined; } /** * Returns true if chain begins with subchain syntactically. */ function chainStartsWith(chain, subchain) { // skip until we find a matching identifier. - while (ts.isCallExpression(chain) || ts.isPropertyAccessExpression(chain) || ts.isElementAccessExpression(chain)) { - if (getTextOfChainNode(chain) === getTextOfChainNode(subchain)) + while (ts.isCallExpression(chain) || ts.isPropertyAccessExpression(chain)) { + var subchainName = ts.isPropertyAccessExpression(subchain) ? subchain.name.getText() : subchain.getText(); + if (ts.isPropertyAccessExpression(chain) && chain.name.getText() === subchainName) break; chain = chain.expression; } - // check that the chains match at each access. Call chains in subchain are not valid. - while ((ts.isPropertyAccessExpression(chain) && ts.isPropertyAccessExpression(subchain)) || - (ts.isElementAccessExpression(chain) && ts.isElementAccessExpression(subchain))) { - if (getTextOfChainNode(chain) !== getTextOfChainNode(subchain)) + // check that the chains match at each access. Call chains in subchain are not valid. + while (ts.isPropertyAccessExpression(chain) && ts.isPropertyAccessExpression(subchain)) { + if (chain.name.getText() !== subchain.name.getText()) return false; chain = chain.expression; subchain = subchain.expression; @@ -142202,18 +138998,6 @@ var ts; // check if we have reached a final identifier. return ts.isIdentifier(chain) && ts.isIdentifier(subchain) && chain.getText() === subchain.getText(); } - function getTextOfChainNode(node) { - if (ts.isIdentifier(node) || ts.isStringOrNumericLiteralLike(node)) { - return node.getText(); - } - if (ts.isPropertyAccessExpression(node)) { - return getTextOfChainNode(node.name); - } - if (ts.isElementAccessExpression(node)) { - return getTextOfChainNode(node.argumentExpression); - } - return undefined; - } /** * Find the least ancestor of the input node that is a valid type for extraction and contains the input span. */ @@ -142266,7 +139050,7 @@ var ts; return getFinalExpressionInChain(node.left); } // foo && |foo.bar()()| - nested calls are treated like further accesses. - else if ((ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) || ts.isCallExpression(node)) && !ts.isOptionalChain(node)) { + else if ((ts.isPropertyAccessExpression(node) || ts.isCallExpression(node)) && !ts.isOptionalChain(node)) { return node; } return undefined; @@ -142275,7 +139059,7 @@ var ts; * Creates an access chain from toConvert with '?.' accesses at expressions appearing in occurrences. */ function convertOccurrences(checker, toConvert, occurrences) { - if (ts.isPropertyAccessExpression(toConvert) || ts.isElementAccessExpression(toConvert) || ts.isCallExpression(toConvert)) { + if (ts.isPropertyAccessExpression(toConvert) || ts.isCallExpression(toConvert)) { var chain = convertOccurrences(checker, toConvert.expression, occurrences); var lastOccurrence = occurrences.length > 0 ? occurrences[occurrences.length - 1] : undefined; var isOccurrence = (lastOccurrence === null || lastOccurrence === void 0 ? void 0 : lastOccurrence.getText()) === toConvert.expression.getText(); @@ -142291,11 +139075,6 @@ var ts; ts.factory.createPropertyAccessChain(chain, ts.factory.createToken(28 /* QuestionDotToken */), toConvert.name) : ts.factory.createPropertyAccessChain(chain, toConvert.questionDotToken, toConvert.name); } - else if (ts.isElementAccessExpression(toConvert)) { - return isOccurrence ? - ts.factory.createElementAccessChain(chain, ts.factory.createToken(28 /* QuestionDotToken */), toConvert.argumentExpression) : - ts.factory.createElementAccessChain(chain, toConvert.questionDotToken, toConvert.argumentExpression); - } } return toConvert; } @@ -142303,7 +139082,7 @@ var ts; var finalExpression = info.finalExpression, occurrences = info.occurrences, expression = info.expression; var firstOccurrence = occurrences[occurrences.length - 1]; var convertedChain = convertOccurrences(checker, finalExpression, occurrences); - if (convertedChain && (ts.isPropertyAccessExpression(convertedChain) || ts.isElementAccessExpression(convertedChain) || ts.isCallExpression(convertedChain))) { + if (convertedChain && (ts.isPropertyAccessExpression(convertedChain) || ts.isCallExpression(convertedChain))) { if (ts.isBinaryExpression(expression)) { changes.replaceNodeRange(sourceFile, firstOccurrence, finalExpression, convertedChain); } @@ -142348,27 +139127,27 @@ var ts; var lastDeclaration = signatureDecls[signatureDecls.length - 1]; var updated = lastDeclaration; switch (lastDeclaration.kind) { - case 164 /* MethodSignature */: { + case 163 /* MethodSignature */: { updated = ts.factory.updateMethodSignature(lastDeclaration, lastDeclaration.modifiers, lastDeclaration.name, lastDeclaration.questionToken, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); break; } - case 165 /* MethodDeclaration */: { + case 164 /* MethodDeclaration */: { updated = ts.factory.updateMethodDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, lastDeclaration.asteriskToken, lastDeclaration.name, lastDeclaration.questionToken, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type, lastDeclaration.body); break; } - case 169 /* CallSignature */: { + case 168 /* CallSignature */: { updated = ts.factory.updateCallSignature(lastDeclaration, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); break; } - case 166 /* Constructor */: { + case 165 /* Constructor */: { updated = ts.factory.updateConstructorDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.body); break; } - case 170 /* ConstructSignature */: { + case 169 /* ConstructSignature */: { updated = ts.factory.updateConstructSignature(lastDeclaration, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); break; } - case 251 /* FunctionDeclaration */: { + case 248 /* FunctionDeclaration */: { updated = ts.factory.updateFunctionDeclaration(lastDeclaration, lastDeclaration.decorators, lastDeclaration.modifiers, lastDeclaration.asteriskToken, lastDeclaration.name, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type, lastDeclaration.body); break; } @@ -142420,12 +139199,12 @@ var ts; } function isConvertableSignatureDeclaration(d) { switch (d.kind) { - case 164 /* MethodSignature */: - case 165 /* MethodDeclaration */: - case 169 /* CallSignature */: - case 166 /* Constructor */: - case 170 /* ConstructSignature */: - case 251 /* FunctionDeclaration */: + case 163 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 168 /* CallSignature */: + case 165 /* Constructor */: + case 169 /* ConstructSignature */: + case 248 /* FunctionDeclaration */: return true; } return false; @@ -142788,20 +139567,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 163 /* PropertyDeclaration */) { + if (current.kind === 162 /* PropertyDeclaration */) { if (ts.hasSyntacticModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 160 /* Parameter */) { + else if (current.kind === 159 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 166 /* Constructor */) { + if (ctorOrMethod.kind === 165 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 165 /* MethodDeclaration */) { + else if (current.kind === 164 /* MethodDeclaration */) { if (ts.hasSyntacticModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -142844,7 +139623,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 249 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 246 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasSyntacticModifier(declaringNode, 1 /* Export */)) { // TODO: GH#18217 Silly to use `errors ||` since it's definitely not defined (see top of `visit`) // Also, if we're only pushing one error, just use `let error: Diagnostic | undefined`! @@ -142856,16 +139635,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; - case 266 /* ExportAssignment */: - (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractExportedEntity)); - return true; case 105 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 203 /* CallExpression */) { + if (node.parent.kind === 200 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); // TODO:GH#18217 if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -142877,7 +139653,7 @@ var ts; rangeFacts |= RangeFacts.UsesThis; } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // check if arrow function uses this ts.forEachChild(node, function check(n) { if (ts.isThis(n)) { @@ -142891,39 +139667,39 @@ var ts; } }); // falls through - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); } // falls through - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // do not dive into functions or classes return false; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 234 /* IfStatement */: + case 231 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 230 /* Block */: - if (node.parent && node.parent.kind === 247 /* TryStatement */ && node.parent.finallyBlock === node) { + case 227 /* Block */: + if (node.parent && node.parent.kind === 244 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 285 /* DefaultClause */: - case 284 /* CaseClause */: + case 282 /* DefaultClause */: + case 281 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -142935,19 +139711,19 @@ var ts; break; } switch (node.kind) { - case 187 /* ThisType */: + case 186 /* ThisType */: case 107 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 245 /* LabeledStatement */: { + case 242 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); ts.forEachChild(node, visit); seenLabels.pop(); break; } - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: { + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: { var label = node.label; if (label) { if (!ts.contains(seenLabels, label.escapedText)) { @@ -142956,20 +139732,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 241 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 238 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -143023,7 +139799,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 160 /* Parameter */) { + if (current.kind === 159 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -143034,7 +139810,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 297 /* SourceFile */) { + if (current.kind === 294 /* SourceFile */) { return scopes; } } @@ -143124,32 +139900,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return "constructor"; - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : ts.ANONYMOUS; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return "arrow function"; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return "method '" + scope.name.getText() + "'"; - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 252 /* ClassDeclaration */ + return scope.kind === 249 /* ClassDeclaration */ ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 257 /* ModuleBlock */ + return scope.kind === 254 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -143375,9 +140151,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 150 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 149 /* UndefinedKeyword */; }) ? clone - : ts.factory.createUnionTypeNode([clone, ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)]); + : ts.factory.createUnionTypeNode([clone, ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */)]); } } /** @@ -143406,7 +140182,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.factory.createModifier(123 /* StaticKeyword */)); } - modifiers.push(ts.factory.createModifier(142 /* ReadonlyKeyword */)); + modifiers.push(ts.factory.createModifier(141 /* ReadonlyKeyword */)); var newVariable = ts.factory.createPropertyDeclaration( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -143438,7 +140214,7 @@ var ts; var localReference = ts.factory.createIdentifier(localNameText); changeTracker.replaceNode(context.file, node, localReference); } - else if (node.parent.kind === 233 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 230 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.factory.createVariableStatement( @@ -143457,7 +140233,7 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 233 /* ExpressionStatement */) { + if (node.parent.kind === 230 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. changeTracker.delete(context.file, node.parent); } @@ -143784,7 +140560,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: new ts.Map(), typeParameterUsages: new ts.Map(), substitutions: new ts.Map() }); substitutionsPerScope.push(new ts.Map()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 251 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 248 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -144103,30 +140879,30 @@ var ts; function isExtractableExpression(node) { var parent = node.parent; switch (parent.kind) { - case 291 /* EnumMember */: + case 288 /* EnumMember */: return false; } switch (node.kind) { case 10 /* StringLiteral */: - return parent.kind !== 261 /* ImportDeclaration */ && - parent.kind !== 265 /* ImportSpecifier */; - case 220 /* SpreadElement */: - case 196 /* ObjectBindingPattern */: - case 198 /* BindingElement */: + return parent.kind !== 258 /* ImportDeclaration */ && + parent.kind !== 262 /* ImportSpecifier */; + case 217 /* SpreadElement */: + case 193 /* ObjectBindingPattern */: + case 195 /* BindingElement */: return false; case 78 /* Identifier */: - return parent.kind !== 198 /* BindingElement */ && - parent.kind !== 265 /* ImportSpecifier */ && - parent.kind !== 270 /* ExportSpecifier */; + return parent.kind !== 195 /* BindingElement */ && + parent.kind !== 262 /* ImportSpecifier */ && + parent.kind !== 267 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 230 /* Block */: - case 297 /* SourceFile */: - case 257 /* ModuleBlock */: - case 284 /* CaseClause */: + case 227 /* Block */: + case 294 /* SourceFile */: + case 254 /* ModuleBlock */: + case 281 /* CaseClause */: return true; default: return false; @@ -144259,7 +141035,7 @@ var ts; if (symbol) { var declaration = ts.cast(ts.first(symbol.declarations), ts.isTypeParameterDeclaration); if (rangeContainsSkipTrivia(statement, declaration, file) && !rangeContainsSkipTrivia(selection, declaration, file)) { - ts.pushIfUnique(result, declaration); + result.push(declaration); } } } @@ -144301,18 +141077,16 @@ var ts; /* decorators */ undefined, /* modifiers */ undefined, name, typeParameters.map(function (id) { return ts.factory.updateTypeParameterDeclaration(id, id.name, id.constraint, /* defaultType */ undefined); }), selection); changes.insertNodeBefore(file, firstStatement, ts.ignoreSourceNewlines(newTypeNode), /* blankLineBetween */ true); - changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); })), { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude, trailingTriviaOption: ts.textChanges.TrailingTriviaOption.ExcludeWhitespace }); + changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); }))); } function doInterfaceChange(changes, file, name, info) { - var _a; var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters, typeElements = info.typeElements; var newTypeNode = ts.factory.createInterfaceDeclaration( /* decorators */ undefined, /* modifiers */ undefined, name, typeParameters, /* heritageClauses */ undefined, typeElements); - ts.setTextRange(newTypeNode, (_a = typeElements[0]) === null || _a === void 0 ? void 0 : _a.parent); changes.insertNodeBefore(file, firstStatement, ts.ignoreSourceNewlines(newTypeNode), /* blankLineBetween */ true); - changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); })), { leadingTriviaOption: ts.textChanges.LeadingTriviaOption.Exclude, trailingTriviaOption: ts.textChanges.TrailingTriviaOption.ExcludeWhitespace }); + changes.replaceNode(file, selection, ts.factory.createTypeReferenceNode(name, typeParameters.map(function (id) { return ts.factory.createTypeReferenceNode(id.name, /* typeArguments */ undefined); }))); } function doTypedefChange(changes, file, name, info) { var firstStatement = info.firstStatement, selection = info.selection, typeParameters = info.typeParameters; @@ -144342,10 +141116,10 @@ var ts; getEditsForAction: function (context, actionName) { if (!context.endPosition) return undefined; - var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition); + var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.startPosition, context.endPosition); if (!info || !info.info) return undefined; - var edits = ts.codefix.generateAccessorFromProperty(context.file, context.program, context.startPosition, context.endPosition, context, actionName); + var edits = ts.codefix.generateAccessorFromProperty(context.file, context.startPosition, context.endPosition, context, actionName); if (!edits) return undefined; var renameFilename = context.file.fileName; @@ -144357,7 +141131,7 @@ var ts; getAvailableActions: function (context) { if (!context.endPosition) return ts.emptyArray; - var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition, context.triggerReason === "invoked"); + var info = ts.codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.startPosition, context.endPosition, context.triggerReason === "invoked"); if (!info) return ts.emptyArray; if (!info.error) { @@ -144443,6 +141217,7 @@ var ts; changes.createNewFile(oldFile, ts.combinePaths(currentDirectory, newFileNameWithExtension), getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences)); addNewFileToTsconfig(program, changes, oldFile.fileName, newFileNameWithExtension, ts.hostGetCanonicalFileName(host)); } + // Filters imports out of the range of statements to move. Imports will be copied to the new file anyway, and may still be needed in the old file. function getStatementsToMove(context) { var rangeToMove = getRangeToMove(context); if (rangeToMove === undefined) @@ -144450,27 +141225,20 @@ var ts; var all = []; var ranges = []; var toMove = rangeToMove.toMove, afterLast = rangeToMove.afterLast; - ts.getRangesWhere(toMove, isAllowedStatementToMove, function (start, afterEndIndex) { + ts.getRangesWhere(toMove, function (s) { return !isPureImport(s); }, function (start, afterEndIndex) { for (var i = start; i < afterEndIndex; i++) all.push(toMove[i]); ranges.push({ first: toMove[start], afterLast: afterLast }); }); return all.length === 0 ? undefined : { all: all, ranges: ranges }; } - function isAllowedStatementToMove(statement) { - // Filters imports and prologue directives out of the range of statements to move. - // Imports will be copied to the new file anyway, and may still be needed in the old file. - // Prologue directives will be copied to the new file and should be left in the old file. - return !isPureImport(statement) && !ts.isPrologueDirective(statement); - ; - } function isPureImport(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return true; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return !ts.hasSyntacticModifier(node, 1 /* Export */); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return node.declarationList.declarations.every(function (d) { return !!d.initializer && ts.isRequireCall(d.initializer, /*checkArgumentIsStringLiteralLike*/ true); }); default: return false; @@ -144492,10 +141260,9 @@ var ts; } function getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences) { var checker = program.getTypeChecker(); - var prologueDirectives = ts.takeWhile(oldFile.statements, ts.isPrologueDirective); if (!oldFile.externalModuleIndicator && !oldFile.commonJsModuleIndicator) { deleteMovedStatements(oldFile, toMove.ranges, changes); - return __spreadArrays(prologueDirectives, toMove.all); + return toMove.all; } var useEs6ModuleSyntax = !!oldFile.externalModuleIndicator; var quotePreference = ts.getQuotePreference(oldFile, preferences); @@ -144509,11 +141276,11 @@ var ts; var imports = getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEs6ModuleSyntax, quotePreference); var body = addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEs6ModuleSyntax); if (imports.length && body.length) { - return __spreadArrays(prologueDirectives, imports, [ + return __spreadArrays(imports, [ 4 /* NewLineTrivia */ ], body); } - return __spreadArrays(prologueDirectives, imports, body); + return __spreadArrays(imports, body); } function deleteMovedStatements(sourceFile, moved, changes) { for (var _i = 0, moved_1 = moved; _i < moved_1.length; _i++) { @@ -144566,12 +141333,12 @@ var ts; } function getNamespaceLikeImport(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 263 /* NamespaceImport */ ? + case 258 /* ImportDeclaration */: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 260 /* NamespaceImport */ ? node.importClause.namedBindings.name : undefined; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node.name; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ts.tryCast(node.name, ts.isIdentifier); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); @@ -144602,20 +141369,20 @@ var ts; var newNamespaceId = ts.factory.createIdentifier(newNamespaceName); var newModuleString = ts.factory.createStringLiteral(newModuleSpecifier); switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, ts.factory.createNamespaceImport(newNamespaceId)), newModuleString); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return ts.factory.createImportEqualsDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newNamespaceId, ts.factory.createExternalModuleReference(newModuleString)); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ts.factory.createVariableDeclaration(newNamespaceId, /*exclamationToken*/ undefined, /*type*/ undefined, createRequireCall(newModuleString)); default: return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind); } } function moduleSpecifierFromImport(i) { - return (i.kind === 261 /* ImportDeclaration */ ? i.moduleSpecifier - : i.kind === 260 /* ImportEqualsDeclaration */ ? i.moduleReference.expression + return (i.kind === 258 /* ImportDeclaration */ ? i.moduleSpecifier + : i.kind === 257 /* ImportEqualsDeclaration */ ? i.moduleReference.expression : i.initializer.arguments[0]); } function forEachImportInStatement(statement, cb) { @@ -144685,15 +141452,15 @@ var ts; } function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { switch (importDecl.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); break; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: if (isUnused(importDecl.name)) { changes.delete(sourceFile, importDecl); } break; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); break; default: @@ -144706,7 +141473,7 @@ var ts; var _a = importDecl.importClause, name = _a.name, namedBindings = _a.namedBindings; var defaultUnused = !name || isUnused(name); var namedBindingsUnused = !namedBindings || - (namedBindings.kind === 263 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); + (namedBindings.kind === 260 /* NamespaceImport */ ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function (e) { return isUnused(e.name); })); if (defaultUnused && namedBindingsUnused) { changes.delete(sourceFile, importDecl); } @@ -144718,7 +141485,7 @@ var ts; if (namedBindingsUnused) { changes.replaceNode(sourceFile, importDecl.importClause, ts.factory.updateImportClause(importDecl.importClause, importDecl.importClause.isTypeOnly, name, /*namedBindings*/ undefined)); } - else if (namedBindings.kind === 264 /* NamedImports */) { + else if (namedBindings.kind === 261 /* NamedImports */) { for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { var element = _b[_i]; if (isUnused(element.name)) @@ -144736,9 +141503,9 @@ var ts; changes.delete(sourceFile, name); } break; - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: break; - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: if (name.elements.every(function (e) { return ts.isIdentifier(e.name) && isUnused(e.name); })) { changes.delete(sourceFile, ts.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); } @@ -144865,14 +141632,14 @@ var ts; // Below should all be utilities function isInImport(decl) { switch (decl.kind) { - case 260 /* ImportEqualsDeclaration */: - case 265 /* ImportSpecifier */: - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: + case 257 /* ImportEqualsDeclaration */: + case 262 /* ImportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: return true; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return isVariableDeclarationInImport(decl); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); default: return false; @@ -144884,7 +141651,7 @@ var ts; } function filterImport(i, moduleSpecifier, keep) { switch (i.kind) { - case 261 /* ImportDeclaration */: { + case 258 /* ImportDeclaration */: { var clause = i.importClause; if (!clause) return undefined; @@ -144894,9 +141661,9 @@ var ts; ? ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, defaultImport, namedBindings), moduleSpecifier) : undefined; } - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return keep(i.name) ? i : undefined; - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { var name = filterBindingName(i.name, keep); return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined; } @@ -144905,7 +141672,7 @@ var ts; } } function filterNamedBindings(namedBindings, keep) { - if (namedBindings.kind === 263 /* NamespaceImport */) { + if (namedBindings.kind === 260 /* NamespaceImport */) { return keep(namedBindings.name) ? namedBindings : undefined; } else { @@ -144917,9 +141684,9 @@ var ts; switch (name.kind) { case 78 /* Identifier */: return keep(name) ? name : undefined; - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return name; - case 196 /* ObjectBindingPattern */: { + case 193 /* ObjectBindingPattern */: { // We can't handle nested destructurings or property names well here, so just copy them all. var newElements = name.elements.filter(function (prop) { return prop.propertyName || !ts.isIdentifier(prop.name) || keep(prop.name); }); return newElements.length ? ts.factory.createObjectBindingPattern(newElements) : undefined; @@ -144976,13 +141743,13 @@ var ts; } function isNonVariableTopLevelDeclaration(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 257 /* ImportEqualsDeclaration */: return true; default: return false; @@ -144990,17 +141757,17 @@ var ts; } function forEachTopLevelDeclaration(statement, cb) { switch (statement.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 257 /* ImportEqualsDeclaration */: return cb(statement); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return ts.firstDefined(statement.declarationList.declarations, function (decl) { return forEachTopLevelDeclarationInBindingName(decl.name, cb); }); - case 233 /* ExpressionStatement */: { + case 230 /* ExpressionStatement */: { var expression = statement.expression; return ts.isBinaryExpression(expression) && ts.getAssignmentDeclarationKind(expression) === 1 /* ExportsProperty */ ? cb(statement) @@ -145012,8 +141779,8 @@ var ts; switch (name.kind) { case 78 /* Identifier */: return cb(ts.cast(name.parent, function (x) { return ts.isVariableDeclaration(x) || ts.isBindingElement(x); })); - case 197 /* ArrayBindingPattern */: - case 196 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); }); default: return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind); @@ -145024,9 +141791,9 @@ var ts; } function getTopLevelDeclarationStatement(d) { switch (d.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return d.parent.parent; - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); })); default: return d; @@ -145059,23 +141826,23 @@ var ts; function addEs6Export(d) { var modifiers = ts.concatenate([ts.factory.createModifier(92 /* ExportKeyword */)], d.modifiers); switch (d.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return ts.factory.updateFunctionDeclaration(d, d.decorators, modifiers, d.asteriskToken, d.name, d.typeParameters, d.parameters, d.type, d.body); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return ts.factory.updateClassDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return ts.factory.updateVariableStatement(d, modifiers, d.declarationList); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return ts.factory.updateModuleDeclaration(d, d.decorators, modifiers, d.name, d.body); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return ts.factory.updateEnumDeclaration(d, d.decorators, modifiers, d.name, d.members); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return ts.factory.updateTypeAliasDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.type); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return ts.factory.updateInterfaceDeclaration(d, d.decorators, modifiers, d.name, d.typeParameters, d.heritageClauses, d.members); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return ts.factory.updateImportEqualsDeclaration(d, d.decorators, modifiers, d.name, d.moduleReference); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind); @@ -145086,18 +141853,18 @@ var ts; } function getNamesToExportInCommonJS(decl) { switch (decl.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: return [decl.name.text]; // TODO: GH#18217 - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return ts.mapDefined(decl.declarationList.declarations, function (d) { return ts.isIdentifier(d.name) ? d.name.text : undefined; }); - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 257 /* ImportEqualsDeclaration */: return ts.emptyArray; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...` default: return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind); @@ -145402,15 +142169,15 @@ var ts; var parent = functionReference.parent; switch (parent.kind) { // foo(...) or super(...) or new Foo(...) - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: var callOrNewExpression = ts.tryCast(parent, ts.isCallOrNewExpression); if (callOrNewExpression && callOrNewExpression.expression === functionReference) { return callOrNewExpression; } break; // x.foo(...) - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { var callOrNewExpression_1 = ts.tryCast(propertyAccessExpression.parent, ts.isCallOrNewExpression); @@ -145420,7 +142187,7 @@ var ts; } break; // x["foo"](...) - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { var callOrNewExpression_2 = ts.tryCast(elementAccessExpression.parent, ts.isCallOrNewExpression); @@ -145439,14 +142206,14 @@ var ts; var parent = reference.parent; switch (parent.kind) { // `C.foo` - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: var propertyAccessExpression = ts.tryCast(parent, ts.isPropertyAccessExpression); if (propertyAccessExpression && propertyAccessExpression.expression === reference) { return propertyAccessExpression; } break; // `C["foo"]` - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var elementAccessExpression = ts.tryCast(parent, ts.isElementAccessExpression); if (elementAccessExpression && elementAccessExpression.expression === reference) { return elementAccessExpression; @@ -145488,11 +142255,11 @@ var ts; if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) return false; switch (functionDeclaration.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return isSingleImplementation(functionDeclaration, checker); - case 166 /* Constructor */: + case 165 /* Constructor */: if (ts.isClassDeclaration(functionDeclaration.parent)) { return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); } @@ -145500,8 +142267,8 @@ var ts; return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); } - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return isValidVariableDeclaration(functionDeclaration.parent); } return false; @@ -145651,7 +142418,7 @@ var ts; } function getClassNames(constructorDeclaration) { switch (constructorDeclaration.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var classDeclaration = constructorDeclaration.parent; if (classDeclaration.name) return [classDeclaration.name]; @@ -145659,7 +142426,7 @@ var ts; // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(classDeclaration, 87 /* DefaultKeyword */), "Nameless class declaration should be a default export"); return [defaultModifier]; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: var classExpression = constructorDeclaration.parent; var variableDeclaration = constructorDeclaration.parent.parent; var className = classExpression.name; @@ -145670,25 +142437,25 @@ var ts; } function getFunctionNames(functionDeclaration) { switch (functionDeclaration.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: if (functionDeclaration.name) return [functionDeclaration.name]; // If the function declaration doesn't have a name, it should have a default modifier. // We validated this in `isValidFunctionDeclaration` through `hasNameOrDefault` var defaultModifier = ts.Debug.checkDefined(ts.findModifier(functionDeclaration, 87 /* DefaultKeyword */), "Nameless function declaration should be a default export"); return [defaultModifier]; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return [functionDeclaration.name]; - case 166 /* Constructor */: + case 165 /* Constructor */: var ctrKeyword = ts.Debug.checkDefined(ts.findChildOfKind(functionDeclaration, 132 /* ConstructorKeyword */, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); - if (functionDeclaration.parent.kind === 221 /* ClassExpression */) { + if (functionDeclaration.parent.kind === 218 /* ClassExpression */) { var variableDeclaration = functionDeclaration.parent.parent; return [variableDeclaration.name, ctrKeyword]; } return [ctrKeyword]; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return [functionDeclaration.parent.name]; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: if (functionDeclaration.name) return [functionDeclaration.name, functionDeclaration.parent.name]; return [functionDeclaration.parent.name]; @@ -145764,18 +142531,10 @@ var ts; return node.operatorToken.kind !== 62 /* EqualsToken */; } function getParentBinaryExpression(expr) { - var container = ts.findAncestor(expr.parent, function (n) { - switch (n.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - return false; - case 216 /* BinaryExpression */: - return !(ts.isBinaryExpression(n.parent) && isNotEqualsOperator(n.parent)); - default: - return "quit"; - } - }); - return container || expr; + while (ts.isBinaryExpression(expr.parent) && isNotEqualsOperator(expr.parent)) { + expr = expr.parent; + } + return expr; } function isStringConcatenationValid(node) { var _a = treeToArray(node), containsString = _a.containsString, areOperatorsValid = _a.areOperatorsValid; @@ -146124,8 +142883,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 301 /* FirstJSDocNode */ || kid.kind > 333 /* LastJSDocNode */; }); - return child.kind < 157 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 298 /* FirstJSDocNode */ || kid.kind > 328 /* LastJSDocNode */; }); + return child.kind < 156 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -146136,7 +142895,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 157 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 156 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -146194,7 +142953,7 @@ var ts; } } function createSyntaxList(nodes, parent) { - var list = createNode(334 /* SyntaxList */, nodes.pos, nodes.end, parent); + var list = createNode(329 /* SyntaxList */, nodes.pos, nodes.end, parent); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { @@ -146305,13 +143064,13 @@ var ts; }; SymbolObject.prototype.getContextualDocumentationComment = function (context, checker) { switch (context === null || context === void 0 ? void 0 : context.kind) { - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: if (!this.contextualGetAccessorDocumentationComment) { this.contextualGetAccessorDocumentationComment = ts.emptyArray; this.contextualGetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isGetAccessor), checker); } return this.contextualGetAccessorDocumentationComment; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: if (!this.contextualSetAccessorDocumentationComment) { this.contextualSetAccessorDocumentationComment = ts.emptyArray; this.contextualSetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isSetAccessor), checker); @@ -146532,7 +143291,7 @@ var ts; __extends(SourceFileObject, _super); function SourceFileObject(kind, pos, end) { var _this = _super.call(this, kind, pos, end) || this; - _this.kind = 297 /* SourceFile */; + _this.kind = 294 /* SourceFile */; return _this; } SourceFileObject.prototype.update = function (newText, textChangeRange) { @@ -146591,10 +143350,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -146614,31 +143373,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 256 /* ModuleDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 270 /* ExportSpecifier */: - case 265 /* ImportSpecifier */: - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 177 /* TypeLiteral */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 267 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 176 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 160 /* Parameter */: + case 159 /* Parameter */: // Only consider parameter properties if (!ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: { + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -146649,12 +143408,12 @@ var ts; } } // falls through - case 291 /* EnumMember */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 288 /* EnumMember */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: addDeclaration(node); break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; var exportDeclaration = node; @@ -146667,7 +143426,7 @@ var ts; } } break; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -146679,7 +143438,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 260 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -146688,7 +143447,7 @@ var ts; } } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -147343,12 +144102,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return !ts.isLabelName(node) && !ts.isTagName(node); - case 201 /* PropertyAccessExpression */: - case 157 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: // Don't return quickInfo if inside the comment in `a/**/.b` return !ts.isInComment(sourceFile, position); case 107 /* ThisKeyword */: - case 187 /* ThisType */: + case 186 /* ThisType */: case 105 /* SuperKeyword */: return true; default: @@ -147433,7 +144192,7 @@ var ts; * This is a semantic operation. */ function getSignatureHelpItems(fileName, position, _a) { - var _b = _a === void 0 ? ts.emptyOptions : _a, triggerReason = _b.triggerReason; + var triggerReason = (_a === void 0 ? ts.emptyOptions : _a).triggerReason; synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, triggerReason, cancellationToken); @@ -147450,15 +144209,15 @@ var ts; return undefined; } switch (node.kind) { - case 201 /* PropertyAccessExpression */: - case 157 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: case 10 /* StringLiteral */: case 94 /* FalseKeyword */: case 109 /* TrueKeyword */: case 103 /* NullKeyword */: case 105 /* SuperKeyword */: case 107 /* ThisKeyword */: - case 187 /* ThisType */: + case 186 /* ThisType */: case 78 /* Identifier */: break; // Cant create the text span @@ -147475,7 +144234,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 256 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 253 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -147507,33 +144266,21 @@ var ts; var kind = ts.getScriptKind(fileName, host); return kind === 3 /* TS */ || kind === 4 /* TSX */; } - function getSemanticClassifications(fileName, span, format) { + function getSemanticClassifications(fileName, span) { if (!isTsOrTsxFile(fileName)) { // do not run semantic classification on non-ts-or-tsx files return []; } synchronizeHostData(); - var responseFormat = format || "original" /* Original */; - if (responseFormat === "2020" /* TwentyTwenty */) { - return ts.classifier.v2020.getSemanticClassifications(program, cancellationToken, getValidSourceFile(fileName), span); - } - else { - return ts.getSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); - } + return ts.getSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); } - function getEncodedSemanticClassifications(fileName, span, format) { + function getEncodedSemanticClassifications(fileName, span) { if (!isTsOrTsxFile(fileName)) { // do not run semantic classification on non-ts-or-tsx files return { spans: [], endOfLineState: 0 /* None */ }; } synchronizeHostData(); - var responseFormat = format || "original" /* Original */; - if (responseFormat === "original" /* Original */) { - return ts.getEncodedSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); - } - else { - return ts.classifier.v2020.getEncodedSemanticClassifications(program, cancellationToken, getValidSourceFile(fileName), span); - } + return ts.getEncodedSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); } function getSyntacticClassifications(fileName, span) { // doesn't use compiler - no need to synchronize with host @@ -147714,10 +144461,6 @@ var ts; } // Push all text changes. for (var i = firstLine; i <= lastLine; i++) { - // If the range is multiline and ends on a beginning of a line, don't comment/uncomment. - if (firstLine !== lastLine && lineStarts[i] === textRange.end) { - continue; - } var lineTextStart = lineTextStarts.get(i.toString()); // If the line is not an empty line; otherwise no-op. if (lineTextStart !== undefined) { @@ -148196,7 +144939,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 272 /* ExternalModuleReference */ || + node.parent.kind === 269 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -148214,13 +144957,13 @@ var ts; case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 158 /* ComputedPropertyName */) { + if (node.parent.kind === 157 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 78 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 200 /* ObjectLiteralExpression */ || node.parent.parent.kind === 281 /* JsxAttributes */) && + (node.parent.parent.kind === 197 /* ObjectLiteralExpression */ || node.parent.parent.kind === 278 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -148262,7 +145005,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 202 /* ElementAccessExpression */ && + node.parent.kind === 199 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -148342,114 +145085,114 @@ var ts; if (node) { var parent = node.parent; switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 249 /* VariableDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 246 /* VariableDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return spanInVariableDeclaration(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return spanInParameterDeclaration(node); - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 230 /* Block */: + case 227 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return spanInBlock(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return spanInBlock(node.block); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 235 /* DoStatement */: + case 232 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 248 /* DebuggerStatement */: + case 245 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 234 /* IfStatement */: + case 231 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return spanInForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 247 /* TryStatement */: + case 244 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 198 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 195 /* BindingElement */: // span on complete node return textSpan(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 161 /* Decorator */: + case 160 /* Decorator */: return spanInNodeArray(parent.decorators); - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return undefined; // Tokens: case 26 /* SemicolonToken */: @@ -148479,7 +145222,7 @@ var ts; case 82 /* CatchKeyword */: case 95 /* FinallyKeyword */: return spanInNextNode(node); - case 156 /* OfKeyword */: + case 155 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -148492,13 +145235,13 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 78 /* Identifier */ || - node.kind === 220 /* SpreadElement */ || - node.kind === 288 /* PropertyAssignment */ || - node.kind === 289 /* ShorthandPropertyAssignment */) && + node.kind === 217 /* SpreadElement */ || + node.kind === 285 /* PropertyAssignment */ || + node.kind === 286 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(parent)) { return textSpan(node); } - if (node.kind === 216 /* BinaryExpression */) { + if (node.kind === 213 /* BinaryExpression */) { var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -148520,22 +145263,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (parent.kind) { - case 235 /* DoStatement */: + case 232 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 161 /* Decorator */: + case 160 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: return textSpan(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (node.parent.operatorToken.kind === 27 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -148544,21 +145287,21 @@ var ts; } } switch (node.parent.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // If this is name of property assignment, set breakpoint in the initializer if (node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } break; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: // Breakpoint in type assertion goes to its operand if (node.parent.type === node) { return spanInNextNode(node.parent.type); } break; - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: { + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: { // initializer of variable/parameter declaration go to previous node var _b = node.parent, initializer = _b.initializer, type = _b.type; if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { @@ -148566,7 +145309,7 @@ var ts; } break; } - case 216 /* BinaryExpression */: { + case 213 /* BinaryExpression */: { var left = node.parent.left; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { // If initializer of destructuring assignment move to previous token @@ -148596,7 +145339,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 238 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 235 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } var parent = variableDeclaration.parent; @@ -148608,7 +145351,7 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasSyntacticModifier(variableDeclaration, 1 /* Export */) || - parent.parent.kind === 239 /* ForOfStatement */) { + parent.parent.kind === 236 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } if (ts.isVariableDeclarationList(variableDeclaration.parent) && @@ -148649,7 +145392,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasSyntacticModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 252 /* ClassDeclaration */ && functionDeclaration.kind !== 166 /* Constructor */); + (functionDeclaration.parent.kind === 249 /* ClassDeclaration */ && functionDeclaration.kind !== 165 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -148672,26 +145415,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // Set on parent if on same line otherwise on first statement // falls through - case 236 /* WhileStatement */: - case 234 /* IfStatement */: - case 238 /* ForInStatement */: + case 233 /* WhileStatement */: + case 231 /* IfStatement */: + case 235 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 250 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 247 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -148716,21 +145459,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 222 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 219 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 198 /* BindingElement */) { + if (bindingPattern.parent.kind === 195 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 197 /* ArrayBindingPattern */ && node.kind !== 196 /* ObjectBindingPattern */); - var elements = node.kind === 199 /* ArrayLiteralExpression */ ? node.elements : node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 222 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 194 /* ArrayBindingPattern */ && node.kind !== 193 /* ObjectBindingPattern */); + var elements = node.kind === 196 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 219 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -148738,18 +145481,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 216 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 213 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -148757,25 +145500,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 255 /* EnumDeclaration */: - case 252 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 249 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 230 /* Block */: + case 227 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 287 /* CatchClause */: + case 284 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -148783,7 +145526,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -148799,7 +145542,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -148814,12 +145557,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 235 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 203 /* CallExpression */ || - node.parent.kind === 204 /* NewExpression */) { + if (node.parent.kind === 232 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 200 /* CallExpression */ || + node.parent.kind === 201 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 207 /* ParenthesizedExpression */) { + if (node.parent.kind === 204 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -148828,21 +145571,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 236 /* WhileStatement */: - case 235 /* DoStatement */: - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 207 /* ParenthesizedExpression */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 233 /* WhileStatement */: + case 232 /* DoStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 204 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -148852,20 +145595,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 288 /* PropertyAssignment */ || - node.parent.kind === 160 /* Parameter */) { + node.parent.kind === 285 /* PropertyAssignment */ || + node.parent.kind === 159 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 206 /* TypeAssertionExpression */) { + if (node.parent.kind === 203 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 235 /* DoStatement */) { + if (node.parent.kind === 232 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -148873,7 +145616,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 239 /* ForOfStatement */) { + if (node.parent.kind === 236 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -150448,7 +147191,7 @@ var ts; } else { type = operatorOrType; - operator = 138 /* KeyOfKeyword */; + operator = 137 /* KeyOfKeyword */; } return ts.factory.createTypeOperatorNode(operator, type); }, factoryDeprecation); @@ -150626,7 +147369,7 @@ var ts; ts.createNode = ts.Debug.deprecate(function createNode(kind, pos, end) { if (pos === void 0) { pos = 0; } if (end === void 0) { end = 0; } - return ts.setTextRangePosEnd(kind === 297 /* SourceFile */ ? ts.parseBaseNodeFactory.createBaseSourceFileNode(kind) : + return ts.setTextRangePosEnd(kind === 294 /* SourceFile */ ? ts.parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 78 /* Identifier */ ? ts.parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 79 /* PrivateIdentifier */ ? ts.parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !ts.isNodeKind(kind) ? ts.parseBaseNodeFactory.createBaseTokenNode(kind) : @@ -150655,7 +147398,7 @@ var ts; // #region Renamed node Tests /** @deprecated Use `isTypeAssertionExpression` instead. */ ts.isTypeAssertion = ts.Debug.deprecate(function isTypeAssertion(node) { - return node.kind === 206 /* TypeAssertionExpression */; + return node.kind === 203 /* TypeAssertionExpression */; }, { since: "4.0", warnAfter: "4.1", diff --git a/node_modules/typescript/lib/typingsInstaller.js b/node_modules/typescript/lib/typingsInstaller.js index fbb900b..f3f435d 100644 --- a/node_modules/typescript/lib/typingsInstaller.js +++ b/node_modules/typescript/lib/typingsInstaller.js @@ -81,9 +81,9 @@ var ts; (function (ts) { // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configurePrerelease` too. - ts.versionMajorMinor = "4.1"; + ts.versionMajorMinor = "4.0"; /** The version of the TypeScript compiler release */ - ts.version = "4.1.3"; + ts.version = "4.0.2"; /* @internal */ var Comparison; (function (Comparison) { @@ -1176,7 +1176,7 @@ var ts; var high = array.length - 1; while (low <= high) { var middle = low + ((high - low) >> 1); - var midKey = keySelector(array[middle], middle); + var midKey = keySelector(array[middle]); switch (keyComparer(midKey, key)) { case -1 /* LessThan */: low = middle + 1; @@ -1271,14 +1271,15 @@ var ts; return values; } ts.getOwnValues = getOwnValues; - var _entries = Object.entries || (function (obj) { + var _entries = Object.entries ? Object.entries : function (obj) { var keys = getOwnKeys(obj); var result = Array(keys.length); - for (var i = 0; i < keys.length; i++) { - result[i] = [keys[i], obj[keys[i]]]; + for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { + var key = keys_1[_i]; + result.push([key, obj[key]]); } return result; - }); + }; function getEntries(obj) { return obj ? _entries(obj) : []; } @@ -2150,39 +2151,20 @@ var ts; } } } - /** - * Returns string left-padded with spaces or zeros until it reaches the given length. - * - * @param s String to pad. - * @param length Final padded length. If less than or equal to 's.length', returns 's' unchanged. - * @param padString Character to use as padding (default " "). - */ - function padLeft(s, length, padString) { - if (padString === void 0) { padString = " "; } - return length <= s.length ? s : padString.repeat(length - s.length) + s; + function padLeft(s, length) { + while (s.length < length) { + s = " " + s; + } + return s; } ts.padLeft = padLeft; - /** - * Returns string right-padded with spaces until it reaches the given length. - * - * @param s String to pad. - * @param length Final padded length. If less than or equal to 's.length', returns 's' unchanged. - * @param padString Character to use as padding (default " "). - */ - function padRight(s, length, padString) { - if (padString === void 0) { padString = " "; } - return length <= s.length ? s : s + padString.repeat(length - s.length); + function padRight(s, length) { + while (s.length < length) { + s = s + " "; + } + return s; } ts.padRight = padRight; - function takeWhile(array, predicate) { - var len = array.length; - var index = 0; - while (index < len && predicate(array[index])) { - index++; - } - return array.slice(0, index); - } - ts.takeWhile = takeWhile; })(ts || (ts = {})); /* @internal */ var ts; @@ -2497,10 +2479,6 @@ var ts; return formatEnum(flags, ts.ObjectFlags, /*isFlags*/ true); } Debug.formatObjectFlags = formatObjectFlags; - function formatFlowFlags(flags) { - return formatEnum(flags, ts.FlowFlags, /*isFlags*/ true); - } - Debug.formatFlowFlags = formatFlowFlags; var isDebugInfoEnabled = false; var extendedDebugModule; function extendedDebug() { @@ -2518,167 +2496,31 @@ var ts; return extendedDebug().formatControlFlowGraph(flowNode); } Debug.formatControlFlowGraph = formatControlFlowGraph; - var flowNodeProto; - function attachFlowNodeDebugInfoWorker(flowNode) { - if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line no-in-operator - Object.defineProperties(flowNode, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var flowHeader = this.flags & 2 /* Start */ ? "FlowStart" : - this.flags & 4 /* BranchLabel */ ? "FlowBranchLabel" : - this.flags & 8 /* LoopLabel */ ? "FlowLoopLabel" : - this.flags & 16 /* Assignment */ ? "FlowAssignment" : - this.flags & 32 /* TrueCondition */ ? "FlowTrueCondition" : - this.flags & 64 /* FalseCondition */ ? "FlowFalseCondition" : - this.flags & 128 /* SwitchClause */ ? "FlowSwitchClause" : - this.flags & 256 /* ArrayMutation */ ? "FlowArrayMutation" : - this.flags & 512 /* Call */ ? "FlowCall" : - this.flags & 1024 /* ReduceLabel */ ? "FlowReduceLabel" : - this.flags & 1 /* Unreachable */ ? "FlowUnreachable" : - "UnknownFlow"; - var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1); - return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : ""); - } - }, - __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } }, - __debugToString: { value: function () { return formatControlFlowGraph(this); } } - }); - } - } function attachFlowNodeDebugInfo(flowNode) { if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - // if we're in es2015, attach the method to a shared prototype for `FlowNode` - // so the method doesn't show up in the watch window. - if (!flowNodeProto) { - flowNodeProto = Object.create(Object.prototype); - attachFlowNodeDebugInfoWorker(flowNodeProto); - } - Object.setPrototypeOf(flowNode, flowNodeProto); - } - else { - // not running in an es2015 environment, attach the method directly. - attachFlowNodeDebugInfoWorker(flowNode); + if (!("__debugFlowFlags" in flowNode)) { // eslint-disable-line no-in-operator + Object.defineProperties(flowNode, { + __debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } }, + __debugToString: { value: function () { return formatControlFlowGraph(this); } } + }); } } } Debug.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo; - var nodeArrayProto; - function attachNodeArrayDebugInfoWorker(array) { - if (!("__tsDebuggerDisplay" in array)) { // eslint-disable-line no-in-operator - Object.defineProperties(array, { - __tsDebuggerDisplay: { - value: function (defaultValue) { - // An `Array` with extra properties is rendered as `[A, B, prop1: 1, prop2: 2]`. Most of - // these aren't immediately useful so we trim off the `prop1: ..., prop2: ...` part from the - // formatted string. - defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]"); - return "NodeArray " + defaultValue; - } - } - }); - } - } - function attachNodeArrayDebugInfo(array) { - if (isDebugInfoEnabled) { - if (typeof Object.setPrototypeOf === "function") { - // if we're in es2015, attach the method to a shared prototype for `NodeArray` - // so the method doesn't show up in the watch window. - if (!nodeArrayProto) { - nodeArrayProto = Object.create(Array.prototype); - attachNodeArrayDebugInfoWorker(nodeArrayProto); - } - Object.setPrototypeOf(array, nodeArrayProto); - } - else { - // not running in an es2015 environment, attach the method directly. - attachNodeArrayDebugInfoWorker(array); - } - } - } - Debug.attachNodeArrayDebugInfo = attachNodeArrayDebugInfo; /** * Injects debug information into frequently used types. */ function enableDebugInfo() { if (isDebugInfoEnabled) return; - // avoid recomputing - var weakTypeTextMap; - var weakNodeTextMap; - function getWeakTypeTextMap() { - if (weakTypeTextMap === undefined) { - if (typeof WeakMap === "function") - weakTypeTextMap = new WeakMap(); - } - return weakTypeTextMap; - } - function getWeakNodeTextMap() { - if (weakNodeTextMap === undefined) { - if (typeof WeakMap === "function") - weakNodeTextMap = new WeakMap(); - } - return weakNodeTextMap; - } // Add additional properties in debug mode to assist with debugging. Object.defineProperties(ts.objectAllocator.getSymbolConstructor().prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" : - "Symbol"; - var remainingSymbolFlags = this.flags & ~33554432 /* Transient */; - return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : ""); - } - }, __debugFlags: { get: function () { return formatSymbolFlags(this.flags); } } }); Object.defineProperties(ts.objectAllocator.getTypeConstructor().prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" : - this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType " + JSON.stringify(this.value) : - this.flags & 2048 /* BigIntLiteral */ ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" : - this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : - this.flags & 32 /* Enum */ ? "EnumType" : - this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType " + this.intrinsicName : - this.flags & 1048576 /* Union */ ? "UnionType" : - this.flags & 2097152 /* Intersection */ ? "IntersectionType" : - this.flags & 4194304 /* Index */ ? "IndexType" : - this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : - this.flags & 16777216 /* Conditional */ ? "ConditionalType" : - this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : - this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : - this.flags & 524288 /* Object */ ? - this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : - this.objectFlags & 4 /* Reference */ ? "TypeReference" : - this.objectFlags & 8 /* Tuple */ ? "TupleType" : - this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : - this.objectFlags & 32 /* Mapped */ ? "MappedType" : - this.objectFlags & 2048 /* ReverseMapped */ ? "ReverseMappedType" : - this.objectFlags & 256 /* EvolvingArray */ ? "EvolvingArrayType" : - "ObjectType" : - "Type"; - var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~2367 /* ObjectTypeKindMask */ : 0; - return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : ""); - } - }, __debugFlags: { get: function () { return formatTypeFlags(this.flags); } }, __debugObjectFlags: { get: function () { return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : ""; } }, - __debugTypeToString: { - value: function () { - // avoid recomputing - var map = getWeakTypeTextMap(); - var text = map === null || map === void 0 ? void 0 : map.get(this); - if (text === undefined) { - text = this.checker.typeToString(this); - map === null || map === void 0 ? void 0 : map.set(this, text); - } - return text; - } - }, + __debugTypeToString: { value: function () { return this.checker.typeToString(this); } }, }); var nodeConstructors = [ ts.objectAllocator.getNodeConstructor(), @@ -2690,49 +2532,6 @@ var ts; var ctor = nodeConstructors_1[_i]; if (!ctor.prototype.hasOwnProperty("__debugKind")) { Object.defineProperties(ctor.prototype, { - // for use with vscode-js-debug's new customDescriptionGenerator in launch.json - __tsDebuggerDisplay: { - value: function () { - var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" : - ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" : - ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" : - ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") : - ts.isNumericLiteral(this) ? "NumericLiteral " + this.text : - ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" : - ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" : - ts.isParameter(this) ? "ParameterDeclaration" : - ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" : - ts.isGetAccessorDeclaration(this) ? "GetAccessorDeclaration" : - ts.isSetAccessorDeclaration(this) ? "SetAccessorDeclaration" : - ts.isCallSignatureDeclaration(this) ? "CallSignatureDeclaration" : - ts.isConstructSignatureDeclaration(this) ? "ConstructSignatureDeclaration" : - ts.isIndexSignatureDeclaration(this) ? "IndexSignatureDeclaration" : - ts.isTypePredicateNode(this) ? "TypePredicateNode" : - ts.isTypeReferenceNode(this) ? "TypeReferenceNode" : - ts.isFunctionTypeNode(this) ? "FunctionTypeNode" : - ts.isConstructorTypeNode(this) ? "ConstructorTypeNode" : - ts.isTypeQueryNode(this) ? "TypeQueryNode" : - ts.isTypeLiteralNode(this) ? "TypeLiteralNode" : - ts.isArrayTypeNode(this) ? "ArrayTypeNode" : - ts.isTupleTypeNode(this) ? "TupleTypeNode" : - ts.isOptionalTypeNode(this) ? "OptionalTypeNode" : - ts.isRestTypeNode(this) ? "RestTypeNode" : - ts.isUnionTypeNode(this) ? "UnionTypeNode" : - ts.isIntersectionTypeNode(this) ? "IntersectionTypeNode" : - ts.isConditionalTypeNode(this) ? "ConditionalTypeNode" : - ts.isInferTypeNode(this) ? "InferTypeNode" : - ts.isParenthesizedTypeNode(this) ? "ParenthesizedTypeNode" : - ts.isThisTypeNode(this) ? "ThisTypeNode" : - ts.isTypeOperatorNode(this) ? "TypeOperatorNode" : - ts.isIndexedAccessTypeNode(this) ? "IndexedAccessTypeNode" : - ts.isMappedTypeNode(this) ? "MappedTypeNode" : - ts.isLiteralTypeNode(this) ? "LiteralTypeNode" : - ts.isNamedTupleMember(this) ? "NamedTupleMember" : - ts.isImportTypeNode(this) ? "ImportTypeNode" : - formatSyntaxKind(this.kind); - return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : ""); - } - }, __debugKind: { get: function () { return formatSyntaxKind(this.kind); } }, __debugNodeFlags: { get: function () { return formatNodeFlags(this.flags); } }, __debugModifierFlags: { get: function () { return formatModifierFlags(ts.getEffectiveModifierFlagsNoCache(this)); } }, @@ -2743,16 +2542,9 @@ var ts; value: function (includeTrivia) { if (ts.nodeIsSynthesized(this)) return ""; - // avoid recomputing - var map = getWeakNodeTextMap(); - var text = map === null || map === void 0 ? void 0 : map.get(this); - if (text === undefined) { - var parseNode = ts.getParseTreeNode(this); - var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); - text = sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; - map === null || map === void 0 ? void 0 : map.set(this, text); - } - return text; + var parseNode = ts.getParseTreeNode(this); + var sourceFile = parseNode && ts.getSourceFileOfNode(parseNode); + return sourceFile ? ts.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; } } }); @@ -2824,6 +2616,168 @@ var ts; Debug.deprecate = deprecate; })(Debug = ts.Debug || (ts.Debug = {})); })(ts || (ts = {})); +/*@internal*/ +var ts; +(function (ts) { + /** Gets a timestamp with (at least) ms resolution */ + ts.timestamp = typeof performance !== "undefined" && performance.now ? function () { return performance.now(); } : Date.now ? Date.now : function () { return +(new Date()); }; +})(ts || (ts = {})); +/*@internal*/ +/** Performance measurements for the compiler. */ +var ts; +(function (ts) { + var performance; + (function (performance) { + // NOTE: cannot use ts.noop as core.ts loads after this + var profilerEvent = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : function () { }; + var enabled = false; + var profilerStart = 0; + var counts; + var marks; + var measures; + function createTimerIf(condition, measureName, startMarkName, endMarkName) { + return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer; + } + performance.createTimerIf = createTimerIf; + function createTimer(measureName, startMarkName, endMarkName) { + var enterCount = 0; + return { + enter: enter, + exit: exit + }; + function enter() { + if (++enterCount === 1) { + mark(startMarkName); + } + } + function exit() { + if (--enterCount === 0) { + mark(endMarkName); + measure(measureName, startMarkName, endMarkName); + } + else if (enterCount < 0) { + ts.Debug.fail("enter/exit count does not match."); + } + } + } + performance.createTimer = createTimer; + performance.nullTimer = { enter: ts.noop, exit: ts.noop }; + /** + * Marks a performance event. + * + * @param markName The name of the mark. + */ + function mark(markName) { + if (enabled) { + marks.set(markName, ts.timestamp()); + counts.set(markName, (counts.get(markName) || 0) + 1); + profilerEvent(markName); + } + } + performance.mark = mark; + /** + * Adds a performance measurement with the specified name. + * + * @param measureName The name of the performance measurement. + * @param startMarkName The name of the starting mark. If not supplied, the point at which the + * profiler was enabled is used. + * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is + * used. + */ + function measure(measureName, startMarkName, endMarkName) { + if (enabled) { + var end = endMarkName && marks.get(endMarkName) || ts.timestamp(); + var start = startMarkName && marks.get(startMarkName) || profilerStart; + measures.set(measureName, (measures.get(measureName) || 0) + (end - start)); + } + } + performance.measure = measure; + /** + * Gets the number of times a marker was encountered. + * + * @param markName The name of the mark. + */ + function getCount(markName) { + return counts && counts.get(markName) || 0; + } + performance.getCount = getCount; + /** + * Gets the total duration of all measurements with the supplied name. + * + * @param measureName The name of the measure whose durations should be accumulated. + */ + function getDuration(measureName) { + return measures && measures.get(measureName) || 0; + } + performance.getDuration = getDuration; + /** + * Iterate over each measure, performing some action + * + * @param cb The action to perform for each measure + */ + function forEachMeasure(cb) { + measures.forEach(function (measure, key) { + cb(key, measure); + }); + } + performance.forEachMeasure = forEachMeasure; + /** Enables (and resets) performance measurements for the compiler. */ + function enable() { + counts = new ts.Map(); + marks = new ts.Map(); + measures = new ts.Map(); + enabled = true; + profilerStart = ts.timestamp(); + } + performance.enable = enable; + /** Disables performance measurements for the compiler. */ + function disable() { + enabled = false; + } + performance.disable = disable; + })(performance = ts.performance || (ts.performance = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var _a; + var nullLogger = { + logEvent: ts.noop, + logErrEvent: ts.noop, + logPerfEvent: ts.noop, + logInfoEvent: ts.noop, + logStartCommand: ts.noop, + logStopCommand: ts.noop, + logStartUpdateProgram: ts.noop, + logStopUpdateProgram: ts.noop, + logStartUpdateGraph: ts.noop, + logStopUpdateGraph: ts.noop, + logStartResolveModule: ts.noop, + logStopResolveModule: ts.noop, + logStartParseSourceFile: ts.noop, + logStopParseSourceFile: ts.noop, + logStartReadFile: ts.noop, + logStopReadFile: ts.noop, + logStartBindFile: ts.noop, + logStopBindFile: ts.noop, + logStartScheduledOperation: ts.noop, + logStopScheduledOperation: ts.noop, + }; + // Load optional module to enable Event Tracing for Windows + // See https://github.com/microsoft/typescript-etw for more information + var etwModule; + try { + var etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) !== null && _a !== void 0 ? _a : "./node_modules/@microsoft/typescript-etw"; + // require() will throw an exception if the module is not found + // It may also return undefined if not installed properly + etwModule = require(etwModulePath); + } + catch (e) { + etwModule = undefined; + } + /** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */ + ts.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; +})(ts || (ts = {})); /* @internal */ var ts; (function (ts) { @@ -2900,7 +2854,7 @@ var ts; return ts.compareValues(this.major, other.major) || ts.compareValues(this.minor, other.minor) || ts.compareValues(this.patch, other.patch) - || comparePrereleaseIdentifiers(this.prerelease, other.prerelease); + || comparePrerelaseIdentifiers(this.prerelease, other.prerelease); }; Version.prototype.increment = function (field) { switch (field) { @@ -2939,7 +2893,7 @@ var ts; build: build }; } - function comparePrereleaseIdentifiers(left, right) { + function comparePrerelaseIdentifiers(left, right) { // https://semver.org/#spec-item-11 // > When major, minor, and patch are equal, a pre-release version has lower precedence // > than a normal version. @@ -3184,485 +3138,6 @@ var ts; return "" + comparator.operator + comparator.operand; } })(ts || (ts = {})); -/*@internal*/ -var ts; -(function (ts) { - // The following definitions provide the minimum compatible support for the Web Performance User Timings API - // between browsers and NodeJS: - // eslint-disable-next-line @typescript-eslint/naming-convention - function hasRequiredAPI(performance, PerformanceObserver) { - return typeof performance === "object" && - typeof performance.timeOrigin === "number" && - typeof performance.mark === "function" && - typeof performance.measure === "function" && - typeof performance.now === "function" && - typeof PerformanceObserver === "function"; - } - function tryGetWebPerformanceHooks() { - if (typeof performance === "object" && - typeof PerformanceObserver === "function" && - hasRequiredAPI(performance, PerformanceObserver)) { - return { - performance: performance, - PerformanceObserver: PerformanceObserver - }; - } - } - function tryGetNodePerformanceHooks() { - if (typeof module === "object" && typeof require === "function") { - try { - var _a = require("perf_hooks"), performance_1 = _a.performance, PerformanceObserver_1 = _a.PerformanceObserver; - if (hasRequiredAPI(performance_1, PerformanceObserver_1)) { - // There is a bug in Node's performance.measure prior to 12.16.3/13.13.0 that does not - // match the Web Performance API specification. Node's implementation did not allow - // optional `start` and `end` arguments for `performance.measure`. - // See https://github.com/nodejs/node/pull/32651 for more information. - var version_1 = new ts.Version(process.versions.node); - var range = new ts.VersionRange("<12.16.3 || 13 <13.13"); - if (range.test(version_1)) { - return { - performance: { - get timeOrigin() { return performance_1.timeOrigin; }, - now: function () { return performance_1.now(); }, - mark: function (name) { return performance_1.mark(name); }, - measure: function (name, start, end) { - if (start === void 0) { start = "nodeStart"; } - if (end === undefined) { - end = "__performance.measure-fix__"; - performance_1.mark(end); - } - performance_1.measure(name, start, end); - if (end === "__performance.measure-fix__") { - performance_1.clearMarks("__performance.measure-fix__"); - } - } - }, - PerformanceObserver: PerformanceObserver_1 - }; - } - return { - performance: performance_1, - PerformanceObserver: PerformanceObserver_1 - }; - } - } - catch (_b) { - // ignore errors - } - } - } - // Unlike with the native Map/Set 'tryGet' functions in corePublic.ts, we eagerly evaluate these - // since we will need them for `timestamp`, below. - var nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks(); - var nativePerformance = nativePerformanceHooks === null || nativePerformanceHooks === void 0 ? void 0 : nativePerformanceHooks.performance; - function tryGetNativePerformanceHooks() { - return nativePerformanceHooks; - } - ts.tryGetNativePerformanceHooks = tryGetNativePerformanceHooks; - /** Gets a timestamp with (at least) ms resolution */ - ts.timestamp = nativePerformance ? function () { return nativePerformance.now(); } : - Date.now ? Date.now : - function () { return +(new Date()); }; -})(ts || (ts = {})); -/*@internal*/ -/** Performance measurements for the compiler. */ -var ts; -(function (ts) { - var performance; - (function (performance) { - var perfHooks; - var perfObserver; - // when set, indicates the implementation of `Performance` to use for user timing. - // when unset, indicates user timing is unavailable or disabled. - var performanceImpl; - function createTimerIf(condition, measureName, startMarkName, endMarkName) { - return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer; - } - performance.createTimerIf = createTimerIf; - function createTimer(measureName, startMarkName, endMarkName) { - var enterCount = 0; - return { - enter: enter, - exit: exit - }; - function enter() { - if (++enterCount === 1) { - mark(startMarkName); - } - } - function exit() { - if (--enterCount === 0) { - mark(endMarkName); - measure(measureName, startMarkName, endMarkName); - } - else if (enterCount < 0) { - ts.Debug.fail("enter/exit count does not match."); - } - } - } - performance.createTimer = createTimer; - performance.nullTimer = { enter: ts.noop, exit: ts.noop }; - var counts = new ts.Map(); - var durations = new ts.Map(); - /** - * Marks a performance event. - * - * @param markName The name of the mark. - */ - function mark(markName) { - performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.mark(markName); - } - performance.mark = mark; - /** - * Adds a performance measurement with the specified name. - * - * @param measureName The name of the performance measurement. - * @param startMarkName The name of the starting mark. If not supplied, the point at which the - * profiler was enabled is used. - * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is - * used. - */ - function measure(measureName, startMarkName, endMarkName) { - performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName); - } - performance.measure = measure; - /** - * Gets the number of times a marker was encountered. - * - * @param markName The name of the mark. - */ - function getCount(markName) { - return counts.get(markName) || 0; - } - performance.getCount = getCount; - /** - * Gets the total duration of all measurements with the supplied name. - * - * @param measureName The name of the measure whose durations should be accumulated. - */ - function getDuration(measureName) { - return durations.get(measureName) || 0; - } - performance.getDuration = getDuration; - /** - * Iterate over each measure, performing some action - * - * @param cb The action to perform for each measure - */ - function forEachMeasure(cb) { - durations.forEach(function (duration, measureName) { return cb(measureName, duration); }); - } - performance.forEachMeasure = forEachMeasure; - /** - * Indicates whether the performance API is enabled. - */ - function isEnabled() { - return !!performanceImpl; - } - performance.isEnabled = isEnabled; - /** Enables (and resets) performance measurements for the compiler. */ - function enable() { - if (!performanceImpl) { - perfHooks || (perfHooks = ts.tryGetNativePerformanceHooks()); - if (!perfHooks) - return false; - perfObserver || (perfObserver = new perfHooks.PerformanceObserver(updateStatisticsFromList)); - perfObserver.observe({ entryTypes: ["mark", "measure"] }); - performanceImpl = perfHooks.performance; - } - return true; - } - performance.enable = enable; - /** Disables performance measurements for the compiler. */ - function disable() { - perfObserver === null || perfObserver === void 0 ? void 0 : perfObserver.disconnect(); - performanceImpl = undefined; - counts.clear(); - durations.clear(); - } - performance.disable = disable; - function updateStatisticsFromList(list) { - for (var _i = 0, _a = list.getEntriesByType("mark"); _i < _a.length; _i++) { - var mark_1 = _a[_i]; - counts.set(mark_1.name, (counts.get(mark_1.name) || 0) + 1); - } - for (var _b = 0, _c = list.getEntriesByType("measure"); _b < _c.length; _b++) { - var measure_1 = _c[_b]; - durations.set(measure_1.name, (durations.get(measure_1.name) || 0) + measure_1.duration); - } - } - })(performance = ts.performance || (ts.performance = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var _a; - var nullLogger = { - logEvent: ts.noop, - logErrEvent: ts.noop, - logPerfEvent: ts.noop, - logInfoEvent: ts.noop, - logStartCommand: ts.noop, - logStopCommand: ts.noop, - logStartUpdateProgram: ts.noop, - logStopUpdateProgram: ts.noop, - logStartUpdateGraph: ts.noop, - logStopUpdateGraph: ts.noop, - logStartResolveModule: ts.noop, - logStopResolveModule: ts.noop, - logStartParseSourceFile: ts.noop, - logStopParseSourceFile: ts.noop, - logStartReadFile: ts.noop, - logStopReadFile: ts.noop, - logStartBindFile: ts.noop, - logStopBindFile: ts.noop, - logStartScheduledOperation: ts.noop, - logStopScheduledOperation: ts.noop, - }; - // Load optional module to enable Event Tracing for Windows - // See https://github.com/microsoft/typescript-etw for more information - var etwModule; - try { - var etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) !== null && _a !== void 0 ? _a : "./node_modules/@microsoft/typescript-etw"; - // require() will throw an exception if the module is not found - // It may also return undefined if not installed properly - etwModule = require(etwModulePath); - } - catch (e) { - etwModule = undefined; - } - /** Performance logger that will generate ETW events if possible - check for `logEvent` member, as `etwModule` will be `{}` when browserified */ - ts.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; -})(ts || (ts = {})); -/*@internal*/ -/** Tracing events for the compiler. */ -var ts; -(function (ts) { - var tracing; - (function (tracing) { - var fs; - var traceCount = 0; - var traceFd; - var legendPath; - var legend = []; - /** Starts tracing for the given project (unless the `fs` module is unavailable). */ - function startTracing(configFilePath, traceDir, isBuildMode) { - ts.Debug.assert(!traceFd, "Tracing already started"); - if (fs === undefined) { - try { - fs = require("fs"); - } - catch (_a) { - fs = false; - } - } - if (!fs) { - return; - } - if (legendPath === undefined) { - legendPath = ts.combinePaths(traceDir, "legend.json"); - } - // Note that writing will fail later on if it exists and is not a directory - if (!fs.existsSync(traceDir)) { - fs.mkdirSync(traceDir, { recursive: true }); - } - var countPart = isBuildMode ? "." + ++traceCount : ""; - var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json"); - var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json"); - legend.push({ - configFilePath: configFilePath, - tracePath: tracePath, - typesPath: typesPath, - }); - traceFd = fs.openSync(tracePath, "w"); - // Start with a prefix that contains some metadata that the devtools profiler expects (also avoids a warning on import) - var meta = { cat: "__metadata", ph: "M", ts: 1000 * ts.timestamp(), pid: 1, tid: 1 }; - fs.writeSync(traceFd, "[\n" - + [__assign({ name: "process_name", args: { name: "tsc" } }, meta), __assign({ name: "thread_name", args: { name: "Main" } }, meta), __assign(__assign({ name: "TracingStartedInBrowser" }, meta), { cat: "disabled-by-default-devtools.timeline" })] - .map(function (v) { return JSON.stringify(v); }).join(",\n")); - } - tracing.startTracing = startTracing; - /** Stops tracing for the in-progress project and dumps the type catalog (unless the `fs` module is unavailable). */ - function stopTracing(typeCatalog) { - if (!traceFd) { - ts.Debug.assert(!fs, "Tracing is not in progress"); - return; - } - ts.Debug.assert(fs); - fs.writeSync(traceFd, "\n]\n"); - fs.closeSync(traceFd); - traceFd = undefined; - if (typeCatalog) { - dumpTypes(typeCatalog); - } - else { - // We pre-computed this path for convenience, but clear it - // now that the file won't be created. - legend[legend.length - 1].typesPath = undefined; - } - } - tracing.stopTracing = stopTracing; - function isTracing() { - return !!traceFd; - } - tracing.isTracing = isTracing; - var Phase; - (function (Phase) { - Phase["Parse"] = "parse"; - Phase["Program"] = "program"; - Phase["Bind"] = "bind"; - Phase["Check"] = "check"; - Phase["Emit"] = "emit"; - })(Phase = tracing.Phase || (tracing.Phase = {})); - /** Note: `push`/`pop` should be used by default. - * `begin`/`end` are for special cases where we need the data point even if the event never - * terminates (typically for reducing a scenario too big to trace to one that can be completed). - * In the future we might implement an exit handler to dump unfinished events which would - * deprecate these operations. - */ - function begin(phase, name, args) { - if (!traceFd) - return; - writeEvent("B", phase, name, args); - } - tracing.begin = begin; - function end(phase, name, args) { - if (!traceFd) - return; - writeEvent("E", phase, name, args); - } - tracing.end = end; - function instant(phase, name, args) { - if (!traceFd) - return; - writeEvent("I", phase, name, args, "\"s\":\"g\""); - } - tracing.instant = instant; - // Used for "Complete" (ph:"X") events - var completeEvents = []; - function push(phase, name, args) { - if (!traceFd) - return; - completeEvents.push({ phase: phase, name: name, args: args, time: 1000 * ts.timestamp() }); - } - tracing.push = push; - function pop() { - if (!traceFd) - return; - ts.Debug.assert(completeEvents.length > 0); - var _a = completeEvents.pop(), phase = _a.phase, name = _a.name, args = _a.args, time = _a.time; - var dur = 1000 * ts.timestamp() - time; - writeEvent("X", phase, name, args, "\"dur\":" + dur, time); - } - tracing.pop = pop; - function writeEvent(eventType, phase, name, args, extras, time) { - if (time === void 0) { time = 1000 * ts.timestamp(); } - ts.Debug.assert(traceFd); - ts.Debug.assert(fs); - ts.performance.mark("beginTracing"); - fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\""); - if (extras) - fs.writeSync(traceFd, "," + extras); - if (args) - fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args)); - fs.writeSync(traceFd, "}"); - ts.performance.mark("endTracing"); - ts.performance.measure("Tracing", "beginTracing", "endTracing"); - } - function indexFromOne(lc) { - return { - line: lc.line + 1, - character: lc.character + 1, - }; - } - function dumpTypes(types) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r; - ts.Debug.assert(fs); - ts.performance.mark("beginDumpTypes"); - var typesPath = legend[legend.length - 1].typesPath; - var typesFd = fs.openSync(typesPath, "w"); - var recursionIdentityMap = new ts.Map(); - // Cleverness: no line break here so that the type ID will match the line number - fs.writeSync(typesFd, "["); - var numTypes = types.length; - for (var i = 0; i < numTypes; i++) { - var type = types[i]; - var objectFlags = type.objectFlags; - var symbol = (_a = type.aliasSymbol) !== null && _a !== void 0 ? _a : type.symbol; - var firstDeclaration = (_b = symbol === null || symbol === void 0 ? void 0 : symbol.declarations) === null || _b === void 0 ? void 0 : _b[0]; - var firstFile = firstDeclaration && ts.getSourceFileOfNode(firstDeclaration); - // It's slow to compute the display text, so skip it unless it's really valuable (or cheap) - var display = void 0; - if ((objectFlags & 16 /* Anonymous */) | (type.flags & 2944 /* Literal */)) { - try { - display = (_c = type.checker) === null || _c === void 0 ? void 0 : _c.typeToString(type); - } - catch (_s) { - display = undefined; - } - } - var indexedAccessProperties = {}; - if (type.flags & 8388608 /* IndexedAccess */) { - var indexedAccessType = type; - indexedAccessProperties = { - indexedAccessObjectType: (_d = indexedAccessType.objectType) === null || _d === void 0 ? void 0 : _d.id, - indexedAccessIndexType: (_e = indexedAccessType.indexType) === null || _e === void 0 ? void 0 : _e.id, - }; - } - var referenceProperties = {}; - if (objectFlags & 4 /* Reference */) { - var referenceType = type; - referenceProperties = { - instantiatedType: (_f = referenceType.target) === null || _f === void 0 ? void 0 : _f.id, - typeArguments: (_g = referenceType.resolvedTypeArguments) === null || _g === void 0 ? void 0 : _g.map(function (t) { return t.id; }), - }; - } - var conditionalProperties = {}; - if (type.flags & 16777216 /* Conditional */) { - var conditionalType = type; - conditionalProperties = { - conditionalCheckType: (_h = conditionalType.checkType) === null || _h === void 0 ? void 0 : _h.id, - conditionalExtendsType: (_j = conditionalType.extendsType) === null || _j === void 0 ? void 0 : _j.id, - conditionalTrueType: (_l = (_k = conditionalType.resolvedTrueType) === null || _k === void 0 ? void 0 : _k.id) !== null && _l !== void 0 ? _l : -1, - conditionalFalseType: (_o = (_m = conditionalType.resolvedFalseType) === null || _m === void 0 ? void 0 : _m.id) !== null && _o !== void 0 ? _o : -1, - }; - } - // We can't print out an arbitrary object, so just assign each one a unique number. - // Don't call it an "id" so people don't treat it as a type id. - var recursionToken = void 0; - var recursionIdentity = type.checker.getRecursionIdentity(type); - if (recursionIdentity) { - recursionToken = recursionIdentityMap.get(recursionIdentity); - if (!recursionToken) { - recursionToken = recursionIdentityMap.size; - recursionIdentityMap.set(recursionIdentity, recursionToken); - } - } - var descriptor = __assign(__assign(__assign(__assign({ id: type.id, intrinsicName: type.intrinsicName, symbolName: (symbol === null || symbol === void 0 ? void 0 : symbol.escapedName) && ts.unescapeLeadingUnderscores(symbol.escapedName), recursionId: recursionToken, unionTypes: (type.flags & 1048576 /* Union */) ? (_p = type.types) === null || _p === void 0 ? void 0 : _p.map(function (t) { return t.id; }) : undefined, intersectionTypes: (type.flags & 2097152 /* Intersection */) ? type.types.map(function (t) { return t.id; }) : undefined, aliasTypeArguments: (_q = type.aliasTypeArguments) === null || _q === void 0 ? void 0 : _q.map(function (t) { return t.id; }), keyofType: (type.flags & 4194304 /* Index */) ? (_r = type.type) === null || _r === void 0 ? void 0 : _r.id : undefined }, indexedAccessProperties), referenceProperties), conditionalProperties), { firstDeclaration: firstDeclaration && { - path: firstFile.path, - start: indexFromOne(ts.getLineAndCharacterOfPosition(firstFile, firstDeclaration.pos)), - end: indexFromOne(ts.getLineAndCharacterOfPosition(ts.getSourceFileOfNode(firstDeclaration), firstDeclaration.end)), - }, flags: ts.Debug.formatTypeFlags(type.flags).split("|"), display: display }); - fs.writeSync(typesFd, JSON.stringify(descriptor)); - if (i < numTypes - 1) { - fs.writeSync(typesFd, ",\n"); - } - } - fs.writeSync(typesFd, "]\n"); - fs.closeSync(typesFd); - ts.performance.mark("endDumpTypes"); - ts.performance.measure("Dump types", "beginDumpTypes", "endDumpTypes"); - } - function dumpLegend() { - if (!legendPath) { - return; - } - ts.Debug.assert(fs); - fs.writeFileSync(legendPath, JSON.stringify(legend)); - } - tracing.dumpLegend = dumpLegend; - })(tracing = ts.tracing || (ts.tracing = {})); -})(ts || (ts = {})); var ts; (function (ts) { // token > SyntaxKind.Identifier => token is a keyword @@ -3817,235 +3292,230 @@ var ts; SyntaxKind[SyntaxKind["DeclareKeyword"] = 133] = "DeclareKeyword"; SyntaxKind[SyntaxKind["GetKeyword"] = 134] = "GetKeyword"; SyntaxKind[SyntaxKind["InferKeyword"] = 135] = "InferKeyword"; - SyntaxKind[SyntaxKind["IntrinsicKeyword"] = 136] = "IntrinsicKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 137] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 138] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 139] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 140] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 141] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 142] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 143] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 144] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 145] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 146] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 147] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 148] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 149] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 150] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 151] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["UnknownKeyword"] = 152] = "UnknownKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 153] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 154] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["BigIntKeyword"] = 155] = "BigIntKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 156] = "OfKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 136] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 137] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 138] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 139] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 140] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 141] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 142] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 143] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 144] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 145] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 146] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 147] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 148] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 149] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 150] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["UnknownKeyword"] = 151] = "UnknownKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 152] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 153] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["BigIntKeyword"] = 154] = "BigIntKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 155] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 157] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 158] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 156] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 157] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 159] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 160] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 161] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 158] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 159] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 160] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 162] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 163] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 164] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 165] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 166] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 167] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 168] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 169] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 170] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 171] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 161] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 162] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 163] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 164] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 165] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 166] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 167] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 168] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 169] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 170] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 172] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 173] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 174] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 175] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 176] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 177] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 178] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 179] = "TupleType"; - SyntaxKind[SyntaxKind["OptionalType"] = 180] = "OptionalType"; - SyntaxKind[SyntaxKind["RestType"] = 181] = "RestType"; - SyntaxKind[SyntaxKind["UnionType"] = 182] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 183] = "IntersectionType"; - SyntaxKind[SyntaxKind["ConditionalType"] = 184] = "ConditionalType"; - SyntaxKind[SyntaxKind["InferType"] = 185] = "InferType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 186] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 187] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 188] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 189] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 190] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 191] = "LiteralType"; - SyntaxKind[SyntaxKind["NamedTupleMember"] = 192] = "NamedTupleMember"; - SyntaxKind[SyntaxKind["TemplateLiteralType"] = 193] = "TemplateLiteralType"; - SyntaxKind[SyntaxKind["TemplateLiteralTypeSpan"] = 194] = "TemplateLiteralTypeSpan"; - SyntaxKind[SyntaxKind["ImportType"] = 195] = "ImportType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 171] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 172] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 173] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 174] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 175] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 176] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 177] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 178] = "TupleType"; + SyntaxKind[SyntaxKind["OptionalType"] = 179] = "OptionalType"; + SyntaxKind[SyntaxKind["RestType"] = 180] = "RestType"; + SyntaxKind[SyntaxKind["UnionType"] = 181] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 182] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 183] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 184] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 185] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 186] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 187] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 188] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 189] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 190] = "LiteralType"; + SyntaxKind[SyntaxKind["NamedTupleMember"] = 191] = "NamedTupleMember"; + SyntaxKind[SyntaxKind["ImportType"] = 192] = "ImportType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 196] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 197] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 198] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 193] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 194] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 195] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 199] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 200] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 201] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 202] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 203] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 204] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 205] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 206] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 207] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 208] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 209] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 210] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 211] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 212] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 213] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 214] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 215] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 216] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 217] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 218] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 219] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 220] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 221] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 222] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 223] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 224] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 225] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 226] = "MetaProperty"; - SyntaxKind[SyntaxKind["SyntheticExpression"] = 227] = "SyntheticExpression"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 196] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 197] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 198] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 199] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 200] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 201] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 202] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 203] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 204] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 205] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 206] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 207] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 208] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 209] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 210] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 211] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 212] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 213] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 214] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 215] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 216] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 217] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 218] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 219] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 220] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 221] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 222] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 223] = "MetaProperty"; + SyntaxKind[SyntaxKind["SyntheticExpression"] = 224] = "SyntheticExpression"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 228] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 229] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 225] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 226] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 230] = "Block"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 231] = "EmptyStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 232] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 233] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 234] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 235] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 236] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 237] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 238] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 239] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 240] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 241] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 242] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 243] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 244] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 245] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 246] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 247] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 248] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 249] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 250] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 251] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 252] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 253] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 254] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 255] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 256] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 257] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 258] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 259] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 260] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 261] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 262] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 263] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 264] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 265] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 266] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 267] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 268] = "NamedExports"; - SyntaxKind[SyntaxKind["NamespaceExport"] = 269] = "NamespaceExport"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 270] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 271] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 227] = "Block"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 228] = "EmptyStatement"; + SyntaxKind[SyntaxKind["VariableStatement"] = 229] = "VariableStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 230] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 231] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 232] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 233] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 234] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 235] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 236] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 237] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 238] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 239] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 240] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 241] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 242] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 243] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 244] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 245] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 246] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 247] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 248] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 249] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 250] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 251] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 252] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 253] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 254] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 255] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 256] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 257] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 258] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 259] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 260] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 261] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 262] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 263] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 264] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 265] = "NamedExports"; + SyntaxKind[SyntaxKind["NamespaceExport"] = 266] = "NamespaceExport"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 267] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 268] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 272] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 269] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 273] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 274] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 275] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 276] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 277] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 278] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 279] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 280] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 281] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 282] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 283] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 270] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 271] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 272] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 273] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 274] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 275] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 276] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 277] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 278] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 279] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 280] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 284] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 285] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 286] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 287] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 281] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 282] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 283] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 284] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 288] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 289] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 290] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 285] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 286] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 287] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 291] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 288] = "EnumMember"; // Unparsed - SyntaxKind[SyntaxKind["UnparsedPrologue"] = 292] = "UnparsedPrologue"; - SyntaxKind[SyntaxKind["UnparsedPrepend"] = 293] = "UnparsedPrepend"; - SyntaxKind[SyntaxKind["UnparsedText"] = 294] = "UnparsedText"; - SyntaxKind[SyntaxKind["UnparsedInternalText"] = 295] = "UnparsedInternalText"; - SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 296] = "UnparsedSyntheticReference"; + SyntaxKind[SyntaxKind["UnparsedPrologue"] = 289] = "UnparsedPrologue"; + SyntaxKind[SyntaxKind["UnparsedPrepend"] = 290] = "UnparsedPrepend"; + SyntaxKind[SyntaxKind["UnparsedText"] = 291] = "UnparsedText"; + SyntaxKind[SyntaxKind["UnparsedInternalText"] = 292] = "UnparsedInternalText"; + SyntaxKind[SyntaxKind["UnparsedSyntheticReference"] = 293] = "UnparsedSyntheticReference"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 297] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 298] = "Bundle"; - SyntaxKind[SyntaxKind["UnparsedSource"] = 299] = "UnparsedSource"; - SyntaxKind[SyntaxKind["InputFiles"] = 300] = "InputFiles"; + SyntaxKind[SyntaxKind["SourceFile"] = 294] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 295] = "Bundle"; + SyntaxKind[SyntaxKind["UnparsedSource"] = 296] = "UnparsedSource"; + SyntaxKind[SyntaxKind["InputFiles"] = 297] = "InputFiles"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 301] = "JSDocTypeExpression"; - SyntaxKind[SyntaxKind["JSDocNameReference"] = 302] = "JSDocNameReference"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 298] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 303] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 299] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 304] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 305] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 306] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 307] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 308] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 309] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 300] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 301] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 302] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 303] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 304] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 305] = "JSDocVariadicType"; // https://jsdoc.app/about-namepaths.html - SyntaxKind[SyntaxKind["JSDocNamepathType"] = 310] = "JSDocNamepathType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 311] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 312] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocSignature"] = 313] = "JSDocSignature"; - SyntaxKind[SyntaxKind["JSDocTag"] = 314] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 315] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 316] = "JSDocImplementsTag"; - SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 317] = "JSDocAuthorTag"; - SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 318] = "JSDocDeprecatedTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 319] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocPublicTag"] = 320] = "JSDocPublicTag"; - SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 321] = "JSDocPrivateTag"; - SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 322] = "JSDocProtectedTag"; - SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 323] = "JSDocReadonlyTag"; - SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 324] = "JSDocCallbackTag"; - SyntaxKind[SyntaxKind["JSDocEnumTag"] = 325] = "JSDocEnumTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 326] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 327] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocThisTag"] = 328] = "JSDocThisTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 329] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 330] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 331] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocSeeTag"] = 332] = "JSDocSeeTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 333] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocNamepathType"] = 306] = "JSDocNamepathType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 307] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 308] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocSignature"] = 309] = "JSDocSignature"; + SyntaxKind[SyntaxKind["JSDocTag"] = 310] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 311] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 312] = "JSDocImplementsTag"; + SyntaxKind[SyntaxKind["JSDocAuthorTag"] = 313] = "JSDocAuthorTag"; + SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 314] = "JSDocDeprecatedTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 315] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocPublicTag"] = 316] = "JSDocPublicTag"; + SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 317] = "JSDocPrivateTag"; + SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 318] = "JSDocProtectedTag"; + SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 319] = "JSDocReadonlyTag"; + SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 320] = "JSDocCallbackTag"; + SyntaxKind[SyntaxKind["JSDocEnumTag"] = 321] = "JSDocEnumTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 322] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 323] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocThisTag"] = 324] = "JSDocThisTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 325] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 326] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 327] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 328] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 334] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 329] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 335] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 336] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 337] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 338] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 339] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 340] = "SyntheticReferenceExpression"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 330] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 331] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 332] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 333] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 334] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 335] = "SyntheticReferenceExpression"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 341] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 336] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 62] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 77] = "LastAssignment"; @@ -4054,15 +3524,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 80] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 115] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 80] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 156] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 155] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 116] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 124] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 172] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 195] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 171] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 192] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 77] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 156] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 155] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -4071,15 +3541,15 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 77] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstStatement"] = 232] = "FirstStatement"; - SyntaxKind[SyntaxKind["LastStatement"] = 248] = "LastStatement"; - SyntaxKind[SyntaxKind["FirstNode"] = 157] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 301] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 333] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 314] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 333] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstStatement"] = 229] = "FirstStatement"; + SyntaxKind[SyntaxKind["LastStatement"] = 245] = "LastStatement"; + SyntaxKind[SyntaxKind["FirstNode"] = 156] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 298] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 328] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 310] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 328] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 125] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 156] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 155] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -4190,7 +3660,6 @@ var ts; GeneratedIdentifierFlags[GeneratedIdentifierFlags["ReservedInNestedScopes"] = 8] = "ReservedInNestedScopes"; GeneratedIdentifierFlags[GeneratedIdentifierFlags["Optimistic"] = 16] = "Optimistic"; GeneratedIdentifierFlags[GeneratedIdentifierFlags["FileLevel"] = 32] = "FileLevel"; - GeneratedIdentifierFlags[GeneratedIdentifierFlags["AllowNameSubstitution"] = 64] = "AllowNameSubstitution"; })(GeneratedIdentifierFlags = ts.GeneratedIdentifierFlags || (ts.GeneratedIdentifierFlags = {})); var TokenFlags; (function (TokenFlags) { @@ -4634,8 +4103,6 @@ var ts; TypeFlags[TypeFlags["Conditional"] = 16777216] = "Conditional"; TypeFlags[TypeFlags["Substitution"] = 33554432] = "Substitution"; TypeFlags[TypeFlags["NonPrimitive"] = 67108864] = "NonPrimitive"; - TypeFlags[TypeFlags["TemplateLiteral"] = 134217728] = "TemplateLiteral"; - TypeFlags[TypeFlags["StringMapping"] = 268435456] = "StringMapping"; /* @internal */ TypeFlags[TypeFlags["AnyOrUnknown"] = 3] = "AnyOrUnknown"; /* @internal */ @@ -4652,7 +4119,7 @@ var ts; TypeFlags[TypeFlags["Intrinsic"] = 67359327] = "Intrinsic"; /* @internal */ TypeFlags[TypeFlags["Primitive"] = 131068] = "Primitive"; - TypeFlags[TypeFlags["StringLike"] = 402653316] = "StringLike"; + TypeFlags[TypeFlags["StringLike"] = 132] = "StringLike"; TypeFlags[TypeFlags["NumberLike"] = 296] = "NumberLike"; TypeFlags[TypeFlags["BigIntLike"] = 2112] = "BigIntLike"; TypeFlags[TypeFlags["BooleanLike"] = 528] = "BooleanLike"; @@ -4660,28 +4127,28 @@ var ts; TypeFlags[TypeFlags["ESSymbolLike"] = 12288] = "ESSymbolLike"; TypeFlags[TypeFlags["VoidLike"] = 49152] = "VoidLike"; /* @internal */ - TypeFlags[TypeFlags["DisjointDomains"] = 469892092] = "DisjointDomains"; + TypeFlags[TypeFlags["DisjointDomains"] = 67238908] = "DisjointDomains"; TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType"; TypeFlags[TypeFlags["TypeVariable"] = 8650752] = "TypeVariable"; TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; - TypeFlags[TypeFlags["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive"; - TypeFlags[TypeFlags["Instantiable"] = 465829888] = "Instantiable"; - TypeFlags[TypeFlags["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["InstantiablePrimitive"] = 4194304] = "InstantiablePrimitive"; + TypeFlags[TypeFlags["Instantiable"] = 63176704] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 66846720] = "StructuredOrInstantiable"; /* @internal */ TypeFlags[TypeFlags["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; /* @internal */ TypeFlags[TypeFlags["Simplifiable"] = 25165824] = "Simplifiable"; /* @internal */ - TypeFlags[TypeFlags["Substructure"] = 469237760] = "Substructure"; + TypeFlags[TypeFlags["Substructure"] = 66584576] = "Substructure"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 536624127] = "Narrowable"; + TypeFlags[TypeFlags["Narrowable"] = 133970943] = "Narrowable"; /* @internal */ - TypeFlags[TypeFlags["NotPrimitiveUnion"] = 469647395] = "NotPrimitiveUnion"; + TypeFlags[TypeFlags["NotPrimitiveUnion"] = 66994211] = "NotPrimitiveUnion"; // The following flags are aggregated during union and intersection type construction /* @internal */ - TypeFlags[TypeFlags["IncludesMask"] = 205258751] = "IncludesMask"; + TypeFlags[TypeFlags["IncludesMask"] = 71041023] = "IncludesMask"; // The following flags are used for different purposes during union and intersection type construction /* @internal */ TypeFlags[TypeFlags["IncludesStructuredOrInstantiable"] = 262144] = "IncludesStructuredOrInstantiable"; @@ -4738,16 +4205,11 @@ var ts; ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] = 268435456] = "IsNeverIntersectionComputed"; /* @internal */ ObjectFlags[ObjectFlags["IsNeverIntersection"] = 536870912] = "IsNeverIntersection"; - /* @internal */ - ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 1073741824] = "IsClassInstanceClone"; ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; /* @internal */ ObjectFlags[ObjectFlags["RequiresWidening"] = 1572864] = "RequiresWidening"; /* @internal */ ObjectFlags[ObjectFlags["PropagatingFlags"] = 3670016] = "PropagatingFlags"; - // Object flags that uniquely identify the kind of ObjectType - /* @internal */ - ObjectFlags[ObjectFlags["ObjectTypeKindMask"] = 2367] = "ObjectTypeKindMask"; })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); /* @internal */ var VarianceFlags; @@ -4837,18 +4299,18 @@ var ts; })(InferenceFlags = ts.InferenceFlags || (ts.InferenceFlags = {})); /** * Ternary values are defined such that - * x & y picks the lesser in the order False < Unknown < Maybe < True, and - * x | y picks the greater in the order False < Unknown < Maybe < True. - * Generally, Ternary.Maybe is used as the result of a relation that depends on itself, and - * Ternary.Unknown is used as the result of a variance check that depends on itself. We make - * a distinction because we don't want to cache circular variance check results. + * x & y is False if either x or y is False. + * x & y is Maybe if either x or y is Maybe, but neither x or y is False. + * x & y is True if both x and y are True. + * x | y is False if both x and y are False. + * x | y is Maybe if either x or y is Maybe, but neither x or y is True. + * x | y is True if either x or y is True. */ /* @internal */ var Ternary; (function (Ternary) { Ternary[Ternary["False"] = 0] = "False"; - Ternary[Ternary["Unknown"] = 1] = "Unknown"; - Ternary[Ternary["Maybe"] = 3] = "Maybe"; + Ternary[Ternary["Maybe"] = 1] = "Maybe"; Ternary[Ternary["True"] = -1] = "True"; })(Ternary = ts.Ternary || (ts.Ternary = {})); /* @internal */ @@ -4856,7 +4318,6 @@ var ts; (function (AssignmentDeclarationKind) { AssignmentDeclarationKind[AssignmentDeclarationKind["None"] = 0] = "None"; /// exports.name = expr - /// module.exports.name = expr AssignmentDeclarationKind[AssignmentDeclarationKind["ExportsProperty"] = 1] = "ExportsProperty"; /// module.exports = expr AssignmentDeclarationKind[AssignmentDeclarationKind["ModuleExports"] = 2] = "ModuleExports"; @@ -4937,8 +4398,6 @@ var ts; JsxEmit[JsxEmit["Preserve"] = 1] = "Preserve"; JsxEmit[JsxEmit["React"] = 2] = "React"; JsxEmit[JsxEmit["ReactNative"] = 3] = "ReactNative"; - JsxEmit[JsxEmit["ReactJSX"] = 4] = "ReactJSX"; - JsxEmit[JsxEmit["ReactJSXDev"] = 5] = "ReactJSXDev"; })(JsxEmit = ts.JsxEmit || (ts.JsxEmit = {})); var ImportsNotUsedAsValues; (function (ImportsNotUsedAsValues) { @@ -5457,696 +4916,8 @@ var ts; args: [{ name: "factory" }], kind: 4 /* MultiLine */ }, - "jsximportsource": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - }, - "jsxruntime": { - args: [{ name: "factory" }], - kind: 4 /* MultiLine */ - }, }; })(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - /** - * Internally, we represent paths as strings with '/' as the directory separator. - * When we make system calls (eg: LanguageServiceHost.getDirectory()), - * we expect the host to correctly handle paths in our specified format. - */ - ts.directorySeparator = "/"; - var altDirectorySeparator = "\\"; - var urlSchemeSeparator = "://"; - var backslashRegExp = /\\/g; - //// Path Tests - /** - * Determines whether a charCode corresponds to `/` or `\`. - */ - function isAnyDirectorySeparator(charCode) { - return charCode === 47 /* slash */ || charCode === 92 /* backslash */; - } - ts.isAnyDirectorySeparator = isAnyDirectorySeparator; - /** - * Determines whether a path starts with a URL scheme (e.g. starts with `http://`, `ftp://`, `file://`, etc.). - */ - function isUrl(path) { - return getEncodedRootLength(path) < 0; - } - ts.isUrl = isUrl; - /** - * Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path - * like `c:`, `c:\` or `c:/`). - */ - function isRootedDiskPath(path) { - return getEncodedRootLength(path) > 0; - } - ts.isRootedDiskPath = isRootedDiskPath; - /** - * Determines whether a path consists only of a path root. - */ - function isDiskPathRoot(path) { - var rootLength = getEncodedRootLength(path); - return rootLength > 0 && rootLength === path.length; - } - ts.isDiskPathRoot = isDiskPathRoot; - /** - * Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.). - * - * ```ts - * // POSIX - * pathIsAbsolute("/path/to/file.ext") === true - * // DOS - * pathIsAbsolute("c:/path/to/file.ext") === true - * // URL - * pathIsAbsolute("file:///path/to/file.ext") === true - * // Non-absolute - * pathIsAbsolute("path/to/file.ext") === false - * pathIsAbsolute("./path/to/file.ext") === false - * ``` - */ - function pathIsAbsolute(path) { - return getEncodedRootLength(path) !== 0; - } - ts.pathIsAbsolute = pathIsAbsolute; - /** - * Determines whether a path starts with a relative path component (i.e. `.` or `..`). - */ - function pathIsRelative(path) { - return /^\.\.?($|[\\/])/.test(path); - } - ts.pathIsRelative = pathIsRelative; - /** - * Determines whether a path is neither relative nor absolute, e.g. "path/to/file". - * Also known misleadingly as "non-relative". - */ - function pathIsBareSpecifier(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path); - } - ts.pathIsBareSpecifier = pathIsBareSpecifier; - function hasExtension(fileName) { - return ts.stringContains(getBaseFileName(fileName), "."); - } - ts.hasExtension = hasExtension; - function fileExtensionIs(path, extension) { - return path.length > extension.length && ts.endsWith(path, extension); - } - ts.fileExtensionIs = fileExtensionIs; - function fileExtensionIsOneOf(path, extensions) { - for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { - var extension = extensions_1[_i]; - if (fileExtensionIs(path, extension)) { - return true; - } - } - return false; - } - ts.fileExtensionIsOneOf = fileExtensionIsOneOf; - /** - * Determines whether a path has a trailing separator (`/` or `\\`). - */ - function hasTrailingDirectorySeparator(path) { - return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); - } - ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator; - //// Path Parsing - function isVolumeCharacter(charCode) { - return (charCode >= 97 /* a */ && charCode <= 122 /* z */) || - (charCode >= 65 /* A */ && charCode <= 90 /* Z */); - } - function getFileUrlVolumeSeparatorEnd(url, start) { - var ch0 = url.charCodeAt(start); - if (ch0 === 58 /* colon */) - return start + 1; - if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { - var ch2 = url.charCodeAt(start + 2); - if (ch2 === 97 /* a */ || ch2 === 65 /* A */) - return start + 3; - } - return -1; - } - /** - * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). - * If the root is part of a URL, the twos-complement of the root length is returned. - */ - function getEncodedRootLength(path) { - if (!path) - return 0; - var ch0 = path.charCodeAt(0); - // POSIX or UNC - if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { - if (path.charCodeAt(1) !== ch0) - return 1; // POSIX: "/" (or non-normalized "\") - var p1 = path.indexOf(ch0 === 47 /* slash */ ? ts.directorySeparator : altDirectorySeparator, 2); - if (p1 < 0) - return path.length; // UNC: "//server" or "\\server" - return p1 + 1; // UNC: "//server/" or "\\server\" - } - // DOS - if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) { - var ch2 = path.charCodeAt(2); - if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) - return 3; // DOS: "c:/" or "c:\" - if (path.length === 2) - return 2; // DOS: "c:" (but not "c:d") - } - // URL - var schemeEnd = path.indexOf(urlSchemeSeparator); - if (schemeEnd !== -1) { - var authorityStart = schemeEnd + urlSchemeSeparator.length; - var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart); - if (authorityEnd !== -1) { // URL: "file:///", "file://server/", "file://server/path" - // For local "file" URLs, include the leading DOS volume (if present). - // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a - // special case interpreted as "the machine from which the URL is being interpreted". - var scheme = path.slice(0, schemeEnd); - var authority = path.slice(authorityStart, authorityEnd); - if (scheme === "file" && (authority === "" || authority === "localhost") && - isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { - var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); - if (volumeSeparatorEnd !== -1) { - if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { - // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/" - return ~(volumeSeparatorEnd + 1); - } - if (volumeSeparatorEnd === path.length) { - // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a" - // but not "file:///c:d" or "file:///c%3ad" - return ~volumeSeparatorEnd; - } - } - } - return ~(authorityEnd + 1); // URL: "file://server/", "http://server/" - } - return ~path.length; // URL: "file://server", "http://server" - } - // relative - return 0; - } - /** - * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). - * - * For example: - * ```ts - * getRootLength("a") === 0 // "" - * getRootLength("/") === 1 // "/" - * getRootLength("c:") === 2 // "c:" - * getRootLength("c:d") === 0 // "" - * getRootLength("c:/") === 3 // "c:/" - * getRootLength("c:\\") === 3 // "c:\\" - * getRootLength("//server") === 7 // "//server" - * getRootLength("//server/share") === 8 // "//server/" - * getRootLength("\\\\server") === 7 // "\\\\server" - * getRootLength("\\\\server\\share") === 8 // "\\\\server\\" - * getRootLength("file:///path") === 8 // "file:///" - * getRootLength("file:///c:") === 10 // "file:///c:" - * getRootLength("file:///c:d") === 8 // "file:///" - * getRootLength("file:///c:/path") === 11 // "file:///c:/" - * getRootLength("file://server") === 13 // "file://server" - * getRootLength("file://server/path") === 14 // "file://server/" - * getRootLength("http://server") === 13 // "http://server" - * getRootLength("http://server/path") === 14 // "http://server/" - * ``` - */ - function getRootLength(path) { - var rootLength = getEncodedRootLength(path); - return rootLength < 0 ? ~rootLength : rootLength; - } - ts.getRootLength = getRootLength; - function getDirectoryPath(path) { - path = normalizeSlashes(path); - // If the path provided is itself the root, then return it. - var rootLength = getRootLength(path); - if (rootLength === path.length) - return path; - // return the leading portion of the path up to the last (non-terminal) directory separator - // but not including any trailing directory separator. - path = removeTrailingDirectorySeparator(path); - return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator))); - } - ts.getDirectoryPath = getDirectoryPath; - function getBaseFileName(path, extensions, ignoreCase) { - path = normalizeSlashes(path); - // if the path provided is itself the root, then it has not file name. - var rootLength = getRootLength(path); - if (rootLength === path.length) - return ""; - // return the trailing portion of the path starting after the last (non-terminal) directory - // separator but not including any trailing directory separator. - path = removeTrailingDirectorySeparator(path); - var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1)); - var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined; - return extension ? name.slice(0, name.length - extension.length) : name; - } - ts.getBaseFileName = getBaseFileName; - function tryGetExtensionFromPath(path, extension, stringEqualityComparer) { - if (!ts.startsWith(extension, ".")) - extension = "." + extension; - if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46 /* dot */) { - var pathExtension = path.slice(path.length - extension.length); - if (stringEqualityComparer(pathExtension, extension)) { - return pathExtension; - } - } - } - function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) { - if (typeof extensions === "string") { - return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || ""; - } - for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) { - var extension = extensions_2[_i]; - var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer); - if (result) - return result; - } - return ""; - } - function getAnyExtensionFromPath(path, extensions, ignoreCase) { - // Retrieves any string from the final "." onwards from a base file name. - // Unlike extensionFromPath, which throws an exception on unrecognized extensions. - if (extensions) { - return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive); - } - var baseFileName = getBaseFileName(path); - var extensionIndex = baseFileName.lastIndexOf("."); - if (extensionIndex >= 0) { - return baseFileName.substring(extensionIndex); - } - return ""; - } - ts.getAnyExtensionFromPath = getAnyExtensionFromPath; - function pathComponents(path, rootLength) { - var root = path.substring(0, rootLength); - var rest = path.substring(rootLength).split(ts.directorySeparator); - if (rest.length && !ts.lastOrUndefined(rest)) - rest.pop(); - return __spreadArrays([root], rest); - } - /** - * Parse a path into an array containing a root component (at index 0) and zero or more path - * components (at indices > 0). The result is not normalized. - * If the path is relative, the root component is `""`. - * If the path is absolute, the root component includes the first path separator (`/`). - * - * ```ts - * // POSIX - * getPathComponents("/path/to/file.ext") === ["/", "path", "to", "file.ext"] - * getPathComponents("/path/to/") === ["/", "path", "to"] - * getPathComponents("/") === ["/"] - * // DOS - * getPathComponents("c:/path/to/file.ext") === ["c:/", "path", "to", "file.ext"] - * getPathComponents("c:/path/to/") === ["c:/", "path", "to"] - * getPathComponents("c:/") === ["c:/"] - * getPathComponents("c:") === ["c:"] - * // URL - * getPathComponents("http://typescriptlang.org/path/to/file.ext") === ["http://typescriptlang.org/", "path", "to", "file.ext"] - * getPathComponents("http://typescriptlang.org/path/to/") === ["http://typescriptlang.org/", "path", "to"] - * getPathComponents("http://typescriptlang.org/") === ["http://typescriptlang.org/"] - * getPathComponents("http://typescriptlang.org") === ["http://typescriptlang.org"] - * getPathComponents("file://server/path/to/file.ext") === ["file://server/", "path", "to", "file.ext"] - * getPathComponents("file://server/path/to/") === ["file://server/", "path", "to"] - * getPathComponents("file://server/") === ["file://server/"] - * getPathComponents("file://server") === ["file://server"] - * getPathComponents("file:///path/to/file.ext") === ["file:///", "path", "to", "file.ext"] - * getPathComponents("file:///path/to/") === ["file:///", "path", "to"] - * getPathComponents("file:///") === ["file:///"] - * getPathComponents("file://") === ["file://"] - */ - function getPathComponents(path, currentDirectory) { - if (currentDirectory === void 0) { currentDirectory = ""; } - path = combinePaths(currentDirectory, path); - return pathComponents(path, getRootLength(path)); - } - ts.getPathComponents = getPathComponents; - //// Path Formatting - /** - * Formats a parsed path consisting of a root component (at index 0) and zero or more path - * segments (at indices > 0). - * - * ```ts - * getPathFromPathComponents(["/", "path", "to", "file.ext"]) === "/path/to/file.ext" - * ``` - */ - function getPathFromPathComponents(pathComponents) { - if (pathComponents.length === 0) - return ""; - var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]); - return root + pathComponents.slice(1).join(ts.directorySeparator); - } - ts.getPathFromPathComponents = getPathFromPathComponents; - //// Path Normalization - /** - * Normalize path separators, converting `\` into `/`. - */ - function normalizeSlashes(path) { - return path.replace(backslashRegExp, ts.directorySeparator); - } - ts.normalizeSlashes = normalizeSlashes; - /** - * Reduce an array of path components to a more simplified path by navigating any - * `"."` or `".."` entries in the path. - */ - function reducePathComponents(components) { - if (!ts.some(components)) - return []; - var reduced = [components[0]]; - for (var i = 1; i < components.length; i++) { - var component = components[i]; - if (!component) - continue; - if (component === ".") - continue; - if (component === "..") { - if (reduced.length > 1) { - if (reduced[reduced.length - 1] !== "..") { - reduced.pop(); - continue; - } - } - else if (reduced[0]) - continue; - } - reduced.push(component); - } - return reduced; - } - ts.reducePathComponents = reducePathComponents; - /** - * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. - * - * ```ts - * // Non-rooted - * combinePaths("path", "to", "file.ext") === "path/to/file.ext" - * combinePaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file.ext" - * // POSIX - * combinePaths("/path", "to", "file.ext") === "/path/to/file.ext" - * combinePaths("/path", "/to", "file.ext") === "/to/file.ext" - * // DOS - * combinePaths("c:/path", "to", "file.ext") === "c:/path/to/file.ext" - * combinePaths("c:/path", "c:/to", "file.ext") === "c:/to/file.ext" - * // URL - * combinePaths("file:///path", "to", "file.ext") === "file:///path/to/file.ext" - * combinePaths("file:///path", "file:///to", "file.ext") === "file:///to/file.ext" - * ``` - */ - function combinePaths(path) { - var paths = []; - for (var _i = 1; _i < arguments.length; _i++) { - paths[_i - 1] = arguments[_i]; - } - if (path) - path = normalizeSlashes(path); - for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { - var relativePath = paths_1[_a]; - if (!relativePath) - continue; - relativePath = normalizeSlashes(relativePath); - if (!path || getRootLength(relativePath) !== 0) { - path = relativePath; - } - else { - path = ensureTrailingDirectorySeparator(path) + relativePath; - } - } - return path; - } - ts.combinePaths = combinePaths; - /** - * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any - * `.` and `..` path components are resolved. Trailing directory separators are preserved. - * - * ```ts - * resolvePath("/path", "to", "file.ext") === "path/to/file.ext" - * resolvePath("/path", "to", "file.ext/") === "path/to/file.ext/" - * resolvePath("/path", "dir", "..", "to", "file.ext") === "path/to/file.ext" - * ``` - */ - function resolvePath(path) { - var paths = []; - for (var _i = 1; _i < arguments.length; _i++) { - paths[_i - 1] = arguments[_i]; - } - return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : normalizeSlashes(path)); - } - ts.resolvePath = resolvePath; - /** - * Parse a path into an array containing a root component (at index 0) and zero or more path - * components (at indices > 0). The result is normalized. - * If the path is relative, the root component is `""`. - * If the path is absolute, the root component includes the first path separator (`/`). - * - * ```ts - * getNormalizedPathComponents("to/dir/../file.ext", "/path/") === ["/", "path", "to", "file.ext"] - * ``` - */ - function getNormalizedPathComponents(path, currentDirectory) { - return reducePathComponents(getPathComponents(path, currentDirectory)); - } - ts.getNormalizedPathComponents = getNormalizedPathComponents; - function getNormalizedAbsolutePath(fileName, currentDirectory) { - return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); - } - ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; - function normalizePath(path) { - path = normalizeSlashes(path); - var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); - return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; - } - ts.normalizePath = normalizePath; - function getPathWithoutRoot(pathComponents) { - if (pathComponents.length === 0) - return ""; - return pathComponents.slice(1).join(ts.directorySeparator); - } - function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { - return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); - } - ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; - function toPath(fileName, basePath, getCanonicalFileName) { - var nonCanonicalizedPath = isRootedDiskPath(fileName) - ? normalizePath(fileName) - : getNormalizedAbsolutePath(fileName, basePath); - return getCanonicalFileName(nonCanonicalizedPath); - } - ts.toPath = toPath; - function normalizePathAndParts(path) { - path = normalizeSlashes(path); - var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1); - if (parts.length) { - var joinedParts = root + parts.join(ts.directorySeparator); - return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts }; - } - else { - return { path: root, parts: parts }; - } - } - ts.normalizePathAndParts = normalizePathAndParts; - function removeTrailingDirectorySeparator(path) { - if (hasTrailingDirectorySeparator(path)) { - return path.substr(0, path.length - 1); - } - return path; - } - ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator; - function ensureTrailingDirectorySeparator(path) { - if (!hasTrailingDirectorySeparator(path)) { - return path + ts.directorySeparator; - } - return path; - } - ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; - /** - * Ensures a path is either absolute (prefixed with `/` or `c:`) or dot-relative (prefixed - * with `./` or `../`) so as not to be confused with an unprefixed module name. - * - * ```ts - * ensurePathIsNonModuleName("/path/to/file.ext") === "/path/to/file.ext" - * ensurePathIsNonModuleName("./path/to/file.ext") === "./path/to/file.ext" - * ensurePathIsNonModuleName("../path/to/file.ext") === "../path/to/file.ext" - * ensurePathIsNonModuleName("path/to/file.ext") === "./path/to/file.ext" - * ``` - */ - function ensurePathIsNonModuleName(path) { - return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; - } - ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName; - function changeAnyExtension(path, ext, extensions, ignoreCase) { - var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path); - return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path; - } - ts.changeAnyExtension = changeAnyExtension; - //// Path Comparisons - // check path for these segments: '', '.'. '..' - var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; - function comparePathsWorker(a, b, componentComparer) { - if (a === b) - return 0 /* EqualTo */; - if (a === undefined) - return -1 /* LessThan */; - if (b === undefined) - return 1 /* GreaterThan */; - // NOTE: Performance optimization - shortcut if the root segments differ as there would be no - // need to perform path reduction. - var aRoot = a.substring(0, getRootLength(a)); - var bRoot = b.substring(0, getRootLength(b)); - var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); - if (result !== 0 /* EqualTo */) { - return result; - } - // NOTE: Performance optimization - shortcut if there are no relative path segments in - // the non-root portion of the path - var aRest = a.substring(aRoot.length); - var bRest = b.substring(bRoot.length); - if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { - return componentComparer(aRest, bRest); - } - // The path contains a relative path segment. Normalize the paths and perform a slower component - // by component comparison. - var aComponents = reducePathComponents(getPathComponents(a)); - var bComponents = reducePathComponents(getPathComponents(b)); - var sharedLength = Math.min(aComponents.length, bComponents.length); - for (var i = 1; i < sharedLength; i++) { - var result_2 = componentComparer(aComponents[i], bComponents[i]); - if (result_2 !== 0 /* EqualTo */) { - return result_2; - } - } - return ts.compareValues(aComponents.length, bComponents.length); - } - /** - * Performs a case-sensitive comparison of two paths. Path roots are always compared case-insensitively. - */ - function comparePathsCaseSensitive(a, b) { - return comparePathsWorker(a, b, ts.compareStringsCaseSensitive); - } - ts.comparePathsCaseSensitive = comparePathsCaseSensitive; - /** - * Performs a case-insensitive comparison of two paths. - */ - function comparePathsCaseInsensitive(a, b) { - return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive); - } - ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive; - function comparePaths(a, b, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - a = combinePaths(currentDirectory, a); - b = combinePaths(currentDirectory, b); - } - else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase)); - } - ts.comparePaths = comparePaths; - function containsPath(parent, child, currentDirectory, ignoreCase) { - if (typeof currentDirectory === "string") { - parent = combinePaths(currentDirectory, parent); - child = combinePaths(currentDirectory, child); - } - else if (typeof currentDirectory === "boolean") { - ignoreCase = currentDirectory; - } - if (parent === undefined || child === undefined) - return false; - if (parent === child) - return true; - var parentComponents = reducePathComponents(getPathComponents(parent)); - var childComponents = reducePathComponents(getPathComponents(child)); - if (childComponents.length < parentComponents.length) { - return false; - } - var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive; - for (var i = 0; i < parentComponents.length; i++) { - var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer; - if (!equalityComparer(parentComponents[i], childComponents[i])) { - return false; - } - } - return true; - } - ts.containsPath = containsPath; - /** - * Determines whether `fileName` starts with the specified `directoryName` using the provided path canonicalization callback. - * Comparison is case-sensitive between the canonical paths. - * - * @deprecated Use `containsPath` if possible. - */ - function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { - var canonicalFileName = getCanonicalFileName(fileName); - var canonicalDirectoryName = getCanonicalFileName(directoryName); - return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\"); - } - ts.startsWithDirectory = startsWithDirectory; - //// Relative Paths - function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { - var fromComponents = reducePathComponents(getPathComponents(from)); - var toComponents = reducePathComponents(getPathComponents(to)); - var start; - for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { - var fromComponent = getCanonicalFileName(fromComponents[start]); - var toComponent = getCanonicalFileName(toComponents[start]); - var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer; - if (!comparer(fromComponent, toComponent)) - break; - } - if (start === 0) { - return toComponents; - } - var components = toComponents.slice(start); - var relative = []; - for (; start < fromComponents.length; start++) { - relative.push(".."); - } - return __spreadArrays([""], relative, components); - } - ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo; - function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { - ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative"); - var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity; - var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; - var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName); - return getPathFromPathComponents(pathComponents); - } - ts.getRelativePathFromDirectory = getRelativePathFromDirectory; - function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { - return !isRootedDiskPath(absoluteOrRelativePath) - ? absoluteOrRelativePath - : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); - } - ts.convertToRelativePath = convertToRelativePath; - function getRelativePathFromFile(from, to, getCanonicalFileName) { - return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); - } - ts.getRelativePathFromFile = getRelativePathFromFile; - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { - var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName); - var firstComponent = pathComponents[0]; - if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { - var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///"; - pathComponents[0] = prefix + firstComponent; - } - return getPathFromPathComponents(pathComponents); - } - ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; - function forEachAncestorDirectory(directory, callback) { - while (true) { - var result = callback(directory); - if (result !== undefined) { - return result; - } - var parentPath = getDirectoryPath(directory); - if (parentPath === directory) { - return undefined; - } - directory = parentPath; - } - } - ts.forEachAncestorDirectory = forEachAncestorDirectory; - function isNodeModulesDirectory(dirPath) { - return ts.endsWith(dirPath, "/node_modules"); - } - ts.isNodeModulesDirectory = isNodeModulesDirectory; -})(ts || (ts = {})); var ts; (function (ts) { /** @@ -7392,10 +6163,6 @@ var ts; return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath); } function fileSystemEntryExists(path, entryKind) { - // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve - // the CPU time performance. - var originalStackTraceLimit = Error.stackTraceLimit; - Error.stackTraceLimit = 0; try { var stat = _fs.statSync(path); switch (entryKind) { @@ -7407,9 +6174,6 @@ var ts; catch (e) { return false; } - finally { - Error.stackTraceLimit = originalStackTraceLimit; - } } function fileExists(path) { return fileSystemEntryExists(path, 0 /* File */); @@ -7480,6 +6244,678 @@ var ts; ts.Debug.isDebugging = true; } })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + /** + * Internally, we represent paths as strings with '/' as the directory separator. + * When we make system calls (eg: LanguageServiceHost.getDirectory()), + * we expect the host to correctly handle paths in our specified format. + */ + ts.directorySeparator = "/"; + var altDirectorySeparator = "\\"; + var urlSchemeSeparator = "://"; + var backslashRegExp = /\\/g; + //// Path Tests + /** + * Determines whether a charCode corresponds to `/` or `\`. + */ + function isAnyDirectorySeparator(charCode) { + return charCode === 47 /* slash */ || charCode === 92 /* backslash */; + } + ts.isAnyDirectorySeparator = isAnyDirectorySeparator; + /** + * Determines whether a path starts with a URL scheme (e.g. starts with `http://`, `ftp://`, `file://`, etc.). + */ + function isUrl(path) { + return getEncodedRootLength(path) < 0; + } + ts.isUrl = isUrl; + /** + * Determines whether a path is an absolute disk path (e.g. starts with `/`, or a dos path + * like `c:`, `c:\` or `c:/`). + */ + function isRootedDiskPath(path) { + return getEncodedRootLength(path) > 0; + } + ts.isRootedDiskPath = isRootedDiskPath; + /** + * Determines whether a path consists only of a path root. + */ + function isDiskPathRoot(path) { + var rootLength = getEncodedRootLength(path); + return rootLength > 0 && rootLength === path.length; + } + ts.isDiskPathRoot = isDiskPathRoot; + /** + * Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.). + * + * ```ts + * // POSIX + * pathIsAbsolute("/path/to/file.ext") === true + * // DOS + * pathIsAbsolute("c:/path/to/file.ext") === true + * // URL + * pathIsAbsolute("file:///path/to/file.ext") === true + * // Non-absolute + * pathIsAbsolute("path/to/file.ext") === false + * pathIsAbsolute("./path/to/file.ext") === false + * ``` + */ + function pathIsAbsolute(path) { + return getEncodedRootLength(path) !== 0; + } + ts.pathIsAbsolute = pathIsAbsolute; + /** + * Determines whether a path starts with a relative path component (i.e. `.` or `..`). + */ + function pathIsRelative(path) { + return /^\.\.?($|[\\/])/.test(path); + } + ts.pathIsRelative = pathIsRelative; + function hasExtension(fileName) { + return ts.stringContains(getBaseFileName(fileName), "."); + } + ts.hasExtension = hasExtension; + function fileExtensionIs(path, extension) { + return path.length > extension.length && ts.endsWith(path, extension); + } + ts.fileExtensionIs = fileExtensionIs; + function fileExtensionIsOneOf(path, extensions) { + for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { + var extension = extensions_1[_i]; + if (fileExtensionIs(path, extension)) { + return true; + } + } + return false; + } + ts.fileExtensionIsOneOf = fileExtensionIsOneOf; + /** + * Determines whether a path has a trailing separator (`/` or `\\`). + */ + function hasTrailingDirectorySeparator(path) { + return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); + } + ts.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator; + //// Path Parsing + function isVolumeCharacter(charCode) { + return (charCode >= 97 /* a */ && charCode <= 122 /* z */) || + (charCode >= 65 /* A */ && charCode <= 90 /* Z */); + } + function getFileUrlVolumeSeparatorEnd(url, start) { + var ch0 = url.charCodeAt(start); + if (ch0 === 58 /* colon */) + return start + 1; + if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { + var ch2 = url.charCodeAt(start + 2); + if (ch2 === 97 /* a */ || ch2 === 65 /* A */) + return start + 3; + } + return -1; + } + /** + * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). + * If the root is part of a URL, the twos-complement of the root length is returned. + */ + function getEncodedRootLength(path) { + if (!path) + return 0; + var ch0 = path.charCodeAt(0); + // POSIX or UNC + if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { + if (path.charCodeAt(1) !== ch0) + return 1; // POSIX: "/" (or non-normalized "\") + var p1 = path.indexOf(ch0 === 47 /* slash */ ? ts.directorySeparator : altDirectorySeparator, 2); + if (p1 < 0) + return path.length; // UNC: "//server" or "\\server" + return p1 + 1; // UNC: "//server/" or "\\server\" + } + // DOS + if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) { + var ch2 = path.charCodeAt(2); + if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) + return 3; // DOS: "c:/" or "c:\" + if (path.length === 2) + return 2; // DOS: "c:" (but not "c:d") + } + // URL + var schemeEnd = path.indexOf(urlSchemeSeparator); + if (schemeEnd !== -1) { + var authorityStart = schemeEnd + urlSchemeSeparator.length; + var authorityEnd = path.indexOf(ts.directorySeparator, authorityStart); + if (authorityEnd !== -1) { // URL: "file:///", "file://server/", "file://server/path" + // For local "file" URLs, include the leading DOS volume (if present). + // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a + // special case interpreted as "the machine from which the URL is being interpreted". + var scheme = path.slice(0, schemeEnd); + var authority = path.slice(authorityStart, authorityEnd); + if (scheme === "file" && (authority === "" || authority === "localhost") && + isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) { + var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); + if (volumeSeparatorEnd !== -1) { + if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { + // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/" + return ~(volumeSeparatorEnd + 1); + } + if (volumeSeparatorEnd === path.length) { + // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a" + // but not "file:///c:d" or "file:///c%3ad" + return ~volumeSeparatorEnd; + } + } + } + return ~(authorityEnd + 1); // URL: "file://server/", "http://server/" + } + return ~path.length; // URL: "file://server", "http://server" + } + // relative + return 0; + } + /** + * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). + * + * For example: + * ```ts + * getRootLength("a") === 0 // "" + * getRootLength("/") === 1 // "/" + * getRootLength("c:") === 2 // "c:" + * getRootLength("c:d") === 0 // "" + * getRootLength("c:/") === 3 // "c:/" + * getRootLength("c:\\") === 3 // "c:\\" + * getRootLength("//server") === 7 // "//server" + * getRootLength("//server/share") === 8 // "//server/" + * getRootLength("\\\\server") === 7 // "\\\\server" + * getRootLength("\\\\server\\share") === 8 // "\\\\server\\" + * getRootLength("file:///path") === 8 // "file:///" + * getRootLength("file:///c:") === 10 // "file:///c:" + * getRootLength("file:///c:d") === 8 // "file:///" + * getRootLength("file:///c:/path") === 11 // "file:///c:/" + * getRootLength("file://server") === 13 // "file://server" + * getRootLength("file://server/path") === 14 // "file://server/" + * getRootLength("http://server") === 13 // "http://server" + * getRootLength("http://server/path") === 14 // "http://server/" + * ``` + */ + function getRootLength(path) { + var rootLength = getEncodedRootLength(path); + return rootLength < 0 ? ~rootLength : rootLength; + } + ts.getRootLength = getRootLength; + function getDirectoryPath(path) { + path = normalizeSlashes(path); + // If the path provided is itself the root, then return it. + var rootLength = getRootLength(path); + if (rootLength === path.length) + return path; + // return the leading portion of the path up to the last (non-terminal) directory separator + // but not including any trailing directory separator. + path = removeTrailingDirectorySeparator(path); + return path.slice(0, Math.max(rootLength, path.lastIndexOf(ts.directorySeparator))); + } + ts.getDirectoryPath = getDirectoryPath; + function getBaseFileName(path, extensions, ignoreCase) { + path = normalizeSlashes(path); + // if the path provided is itself the root, then it has not file name. + var rootLength = getRootLength(path); + if (rootLength === path.length) + return ""; + // return the trailing portion of the path starting after the last (non-terminal) directory + // separator but not including any trailing directory separator. + path = removeTrailingDirectorySeparator(path); + var name = path.slice(Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator) + 1)); + var extension = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(name, extensions, ignoreCase) : undefined; + return extension ? name.slice(0, name.length - extension.length) : name; + } + ts.getBaseFileName = getBaseFileName; + function tryGetExtensionFromPath(path, extension, stringEqualityComparer) { + if (!ts.startsWith(extension, ".")) + extension = "." + extension; + if (path.length >= extension.length && path.charCodeAt(path.length - extension.length) === 46 /* dot */) { + var pathExtension = path.slice(path.length - extension.length); + if (stringEqualityComparer(pathExtension, extension)) { + return pathExtension; + } + } + } + function getAnyExtensionFromPathWorker(path, extensions, stringEqualityComparer) { + if (typeof extensions === "string") { + return tryGetExtensionFromPath(path, extensions, stringEqualityComparer) || ""; + } + for (var _i = 0, extensions_2 = extensions; _i < extensions_2.length; _i++) { + var extension = extensions_2[_i]; + var result = tryGetExtensionFromPath(path, extension, stringEqualityComparer); + if (result) + return result; + } + return ""; + } + function getAnyExtensionFromPath(path, extensions, ignoreCase) { + // Retrieves any string from the final "." onwards from a base file name. + // Unlike extensionFromPath, which throws an exception on unrecognized extensions. + if (extensions) { + return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path), extensions, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive); + } + var baseFileName = getBaseFileName(path); + var extensionIndex = baseFileName.lastIndexOf("."); + if (extensionIndex >= 0) { + return baseFileName.substring(extensionIndex); + } + return ""; + } + ts.getAnyExtensionFromPath = getAnyExtensionFromPath; + function pathComponents(path, rootLength) { + var root = path.substring(0, rootLength); + var rest = path.substring(rootLength).split(ts.directorySeparator); + if (rest.length && !ts.lastOrUndefined(rest)) + rest.pop(); + return __spreadArrays([root], rest); + } + /** + * Parse a path into an array containing a root component (at index 0) and zero or more path + * components (at indices > 0). The result is not normalized. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + * + * ```ts + * // POSIX + * getPathComponents("/path/to/file.ext") === ["/", "path", "to", "file.ext"] + * getPathComponents("/path/to/") === ["/", "path", "to"] + * getPathComponents("/") === ["/"] + * // DOS + * getPathComponents("c:/path/to/file.ext") === ["c:/", "path", "to", "file.ext"] + * getPathComponents("c:/path/to/") === ["c:/", "path", "to"] + * getPathComponents("c:/") === ["c:/"] + * getPathComponents("c:") === ["c:"] + * // URL + * getPathComponents("http://typescriptlang.org/path/to/file.ext") === ["http://typescriptlang.org/", "path", "to", "file.ext"] + * getPathComponents("http://typescriptlang.org/path/to/") === ["http://typescriptlang.org/", "path", "to"] + * getPathComponents("http://typescriptlang.org/") === ["http://typescriptlang.org/"] + * getPathComponents("http://typescriptlang.org") === ["http://typescriptlang.org"] + * getPathComponents("file://server/path/to/file.ext") === ["file://server/", "path", "to", "file.ext"] + * getPathComponents("file://server/path/to/") === ["file://server/", "path", "to"] + * getPathComponents("file://server/") === ["file://server/"] + * getPathComponents("file://server") === ["file://server"] + * getPathComponents("file:///path/to/file.ext") === ["file:///", "path", "to", "file.ext"] + * getPathComponents("file:///path/to/") === ["file:///", "path", "to"] + * getPathComponents("file:///") === ["file:///"] + * getPathComponents("file://") === ["file://"] + */ + function getPathComponents(path, currentDirectory) { + if (currentDirectory === void 0) { currentDirectory = ""; } + path = combinePaths(currentDirectory, path); + return pathComponents(path, getRootLength(path)); + } + ts.getPathComponents = getPathComponents; + //// Path Formatting + /** + * Formats a parsed path consisting of a root component (at index 0) and zero or more path + * segments (at indices > 0). + * + * ```ts + * getPathFromPathComponents(["/", "path", "to", "file.ext"]) === "/path/to/file.ext" + * ``` + */ + function getPathFromPathComponents(pathComponents) { + if (pathComponents.length === 0) + return ""; + var root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]); + return root + pathComponents.slice(1).join(ts.directorySeparator); + } + ts.getPathFromPathComponents = getPathFromPathComponents; + //// Path Normalization + /** + * Normalize path separators, converting `\` into `/`. + */ + function normalizeSlashes(path) { + return path.replace(backslashRegExp, ts.directorySeparator); + } + ts.normalizeSlashes = normalizeSlashes; + /** + * Reduce an array of path components to a more simplified path by navigating any + * `"."` or `".."` entries in the path. + */ + function reducePathComponents(components) { + if (!ts.some(components)) + return []; + var reduced = [components[0]]; + for (var i = 1; i < components.length; i++) { + var component = components[i]; + if (!component) + continue; + if (component === ".") + continue; + if (component === "..") { + if (reduced.length > 1) { + if (reduced[reduced.length - 1] !== "..") { + reduced.pop(); + continue; + } + } + else if (reduced[0]) + continue; + } + reduced.push(component); + } + return reduced; + } + ts.reducePathComponents = reducePathComponents; + /** + * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. + * + * ```ts + * // Non-rooted + * combinePaths("path", "to", "file.ext") === "path/to/file.ext" + * combinePaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file.ext" + * // POSIX + * combinePaths("/path", "to", "file.ext") === "/path/to/file.ext" + * combinePaths("/path", "/to", "file.ext") === "/to/file.ext" + * // DOS + * combinePaths("c:/path", "to", "file.ext") === "c:/path/to/file.ext" + * combinePaths("c:/path", "c:/to", "file.ext") === "c:/to/file.ext" + * // URL + * combinePaths("file:///path", "to", "file.ext") === "file:///path/to/file.ext" + * combinePaths("file:///path", "file:///to", "file.ext") === "file:///to/file.ext" + * ``` + */ + function combinePaths(path) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + if (path) + path = normalizeSlashes(path); + for (var _a = 0, paths_1 = paths; _a < paths_1.length; _a++) { + var relativePath = paths_1[_a]; + if (!relativePath) + continue; + relativePath = normalizeSlashes(relativePath); + if (!path || getRootLength(relativePath) !== 0) { + path = relativePath; + } + else { + path = ensureTrailingDirectorySeparator(path) + relativePath; + } + } + return path; + } + ts.combinePaths = combinePaths; + /** + * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any + * `.` and `..` path components are resolved. Trailing directory separators are preserved. + * + * ```ts + * resolvePath("/path", "to", "file.ext") === "path/to/file.ext" + * resolvePath("/path", "to", "file.ext/") === "path/to/file.ext/" + * resolvePath("/path", "dir", "..", "to", "file.ext") === "path/to/file.ext" + * ``` + */ + function resolvePath(path) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + return normalizePath(ts.some(paths) ? combinePaths.apply(void 0, __spreadArrays([path], paths)) : normalizeSlashes(path)); + } + ts.resolvePath = resolvePath; + /** + * Parse a path into an array containing a root component (at index 0) and zero or more path + * components (at indices > 0). The result is normalized. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + * + * ```ts + * getNormalizedPathComponents("to/dir/../file.ext", "/path/") === ["/", "path", "to", "file.ext"] + * ``` + */ + function getNormalizedPathComponents(path, currentDirectory) { + return reducePathComponents(getPathComponents(path, currentDirectory)); + } + ts.getNormalizedPathComponents = getNormalizedPathComponents; + function getNormalizedAbsolutePath(fileName, currentDirectory) { + return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; + function normalizePath(path) { + path = normalizeSlashes(path); + var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); + return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized; + } + ts.normalizePath = normalizePath; + function getPathWithoutRoot(pathComponents) { + if (pathComponents.length === 0) + return ""; + return pathComponents.slice(1).join(ts.directorySeparator); + } + function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { + return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; + function toPath(fileName, basePath, getCanonicalFileName) { + var nonCanonicalizedPath = isRootedDiskPath(fileName) + ? normalizePath(fileName) + : getNormalizedAbsolutePath(fileName, basePath); + return getCanonicalFileName(nonCanonicalizedPath); + } + ts.toPath = toPath; + function normalizePathAndParts(path) { + path = normalizeSlashes(path); + var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1); + if (parts.length) { + var joinedParts = root + parts.join(ts.directorySeparator); + return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts }; + } + else { + return { path: root, parts: parts }; + } + } + ts.normalizePathAndParts = normalizePathAndParts; + function removeTrailingDirectorySeparator(path) { + if (hasTrailingDirectorySeparator(path)) { + return path.substr(0, path.length - 1); + } + return path; + } + ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator; + function ensureTrailingDirectorySeparator(path) { + if (!hasTrailingDirectorySeparator(path)) { + return path + ts.directorySeparator; + } + return path; + } + ts.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; + /** + * Ensures a path is either absolute (prefixed with `/` or `c:`) or dot-relative (prefixed + * with `./` or `../`) so as not to be confused with an unprefixed module name. + * + * ```ts + * ensurePathIsNonModuleName("/path/to/file.ext") === "/path/to/file.ext" + * ensurePathIsNonModuleName("./path/to/file.ext") === "./path/to/file.ext" + * ensurePathIsNonModuleName("../path/to/file.ext") === "../path/to/file.ext" + * ensurePathIsNonModuleName("path/to/file.ext") === "./path/to/file.ext" + * ``` + */ + function ensurePathIsNonModuleName(path) { + return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; + } + ts.ensurePathIsNonModuleName = ensurePathIsNonModuleName; + function changeAnyExtension(path, ext, extensions, ignoreCase) { + var pathext = extensions !== undefined && ignoreCase !== undefined ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path); + return pathext ? path.slice(0, path.length - pathext.length) + (ts.startsWith(ext, ".") ? ext : "." + ext) : path; + } + ts.changeAnyExtension = changeAnyExtension; + //// Path Comparisons + // check path for these segments: '', '.'. '..' + var relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/; + function comparePathsWorker(a, b, componentComparer) { + if (a === b) + return 0 /* EqualTo */; + if (a === undefined) + return -1 /* LessThan */; + if (b === undefined) + return 1 /* GreaterThan */; + // NOTE: Performance optimization - shortcut if the root segments differ as there would be no + // need to perform path reduction. + var aRoot = a.substring(0, getRootLength(a)); + var bRoot = b.substring(0, getRootLength(b)); + var result = ts.compareStringsCaseInsensitive(aRoot, bRoot); + if (result !== 0 /* EqualTo */) { + return result; + } + // NOTE: Performance optimization - shortcut if there are no relative path segments in + // the non-root portion of the path + var aRest = a.substring(aRoot.length); + var bRest = b.substring(bRoot.length); + if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { + return componentComparer(aRest, bRest); + } + // The path contains a relative path segment. Normalize the paths and perform a slower component + // by component comparison. + var aComponents = reducePathComponents(getPathComponents(a)); + var bComponents = reducePathComponents(getPathComponents(b)); + var sharedLength = Math.min(aComponents.length, bComponents.length); + for (var i = 1; i < sharedLength; i++) { + var result_2 = componentComparer(aComponents[i], bComponents[i]); + if (result_2 !== 0 /* EqualTo */) { + return result_2; + } + } + return ts.compareValues(aComponents.length, bComponents.length); + } + /** + * Performs a case-sensitive comparison of two paths. Path roots are always compared case-insensitively. + */ + function comparePathsCaseSensitive(a, b) { + return comparePathsWorker(a, b, ts.compareStringsCaseSensitive); + } + ts.comparePathsCaseSensitive = comparePathsCaseSensitive; + /** + * Performs a case-insensitive comparison of two paths. + */ + function comparePathsCaseInsensitive(a, b) { + return comparePathsWorker(a, b, ts.compareStringsCaseInsensitive); + } + ts.comparePathsCaseInsensitive = comparePathsCaseInsensitive; + function comparePaths(a, b, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + a = combinePaths(currentDirectory, a); + b = combinePaths(currentDirectory, b); + } + else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + return comparePathsWorker(a, b, ts.getStringComparer(ignoreCase)); + } + ts.comparePaths = comparePaths; + function containsPath(parent, child, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + parent = combinePaths(currentDirectory, parent); + child = combinePaths(currentDirectory, child); + } + else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + if (parent === undefined || child === undefined) + return false; + if (parent === child) + return true; + var parentComponents = reducePathComponents(getPathComponents(parent)); + var childComponents = reducePathComponents(getPathComponents(child)); + if (childComponents.length < parentComponents.length) { + return false; + } + var componentEqualityComparer = ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive; + for (var i = 0; i < parentComponents.length; i++) { + var equalityComparer = i === 0 ? ts.equateStringsCaseInsensitive : componentEqualityComparer; + if (!equalityComparer(parentComponents[i], childComponents[i])) { + return false; + } + } + return true; + } + ts.containsPath = containsPath; + /** + * Determines whether `fileName` starts with the specified `directoryName` using the provided path canonicalization callback. + * Comparison is case-sensitive between the canonical paths. + * + * @deprecated Use `containsPath` if possible. + */ + function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { + var canonicalFileName = getCanonicalFileName(fileName); + var canonicalDirectoryName = getCanonicalFileName(directoryName); + return ts.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts.startsWith(canonicalFileName, canonicalDirectoryName + "\\"); + } + ts.startsWithDirectory = startsWithDirectory; + //// Relative Paths + function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { + var fromComponents = reducePathComponents(getPathComponents(from)); + var toComponents = reducePathComponents(getPathComponents(to)); + var start; + for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { + var fromComponent = getCanonicalFileName(fromComponents[start]); + var toComponent = getCanonicalFileName(toComponents[start]); + var comparer = start === 0 ? ts.equateStringsCaseInsensitive : stringEqualityComparer; + if (!comparer(fromComponent, toComponent)) + break; + } + if (start === 0) { + return toComponents; + } + var components = toComponents.slice(start); + var relative = []; + for (; start < fromComponents.length; start++) { + relative.push(".."); + } + return __spreadArrays([""], relative, components); + } + ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo; + function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { + ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative"); + var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity; + var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; + var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName); + return getPathFromPathComponents(pathComponents); + } + ts.getRelativePathFromDirectory = getRelativePathFromDirectory; + function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { + return !isRootedDiskPath(absoluteOrRelativePath) + ? absoluteOrRelativePath + : getRelativePathToDirectoryOrUrl(basePath, absoluteOrRelativePath, basePath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); + } + ts.convertToRelativePath = convertToRelativePath; + function getRelativePathFromFile(from, to, getCanonicalFileName) { + return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); + } + ts.getRelativePathFromFile = getRelativePathFromFile; + function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { + var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName); + var firstComponent = pathComponents[0]; + if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { + var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///"; + pathComponents[0] = prefix + firstComponent; + } + return getPathFromPathComponents(pathComponents); + } + ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; + function forEachAncestorDirectory(directory, callback) { + while (true) { + var result = callback(directory); + if (result !== undefined) { + return result; + } + var parentPath = getDirectoryPath(directory); + if (parentPath === directory) { + return undefined; + } + directory = parentPath; + } + } + ts.forEachAncestorDirectory = forEachAncestorDirectory; + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + ts.isNodeModulesDirectory = isNodeModulesDirectory; +})(ts || (ts = {})); // // generated from './diagnosticInformationMap.generated.ts' by 'src/compiler' /* @internal */ @@ -7514,7 +6950,7 @@ var ts; Accessibility_modifier_already_seen: diag(1028, ts.DiagnosticCategory.Error, "Accessibility_modifier_already_seen_1028", "Accessibility modifier already seen."), _0_modifier_must_precede_1_modifier: diag(1029, ts.DiagnosticCategory.Error, "_0_modifier_must_precede_1_modifier_1029", "'{0}' modifier must precede '{1}' modifier."), _0_modifier_already_seen: diag(1030, ts.DiagnosticCategory.Error, "_0_modifier_already_seen_1030", "'{0}' modifier already seen."), - _0_modifier_cannot_appear_on_class_elements_of_this_kind: diag(1031, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031", "'{0}' modifier cannot appear on class elements of this kind."), + _0_modifier_cannot_appear_on_a_class_element: diag(1031, ts.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_class_element_1031", "'{0}' modifier cannot appear on a class element."), super_must_be_followed_by_an_argument_list_or_member_access: diag(1034, ts.DiagnosticCategory.Error, "super_must_be_followed_by_an_argument_list_or_member_access_1034", "'super' must be followed by an argument list or member access."), Only_ambient_modules_can_use_quoted_names: diag(1035, ts.DiagnosticCategory.Error, "Only_ambient_modules_can_use_quoted_names_1035", "Only ambient modules can use quoted names."), Statements_are_not_allowed_in_ambient_contexts: diag(1036, ts.DiagnosticCategory.Error, "Statements_are_not_allowed_in_ambient_contexts_1036", "Statements are not allowed in ambient contexts."), @@ -7654,7 +7090,7 @@ var ts; Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, ts.DiagnosticCategory.Error, "Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205", "Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."), Decorators_are_not_valid_here: diag(1206, ts.DiagnosticCategory.Error, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, ts.DiagnosticCategory.Error, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), - _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, ts.DiagnosticCategory.Error, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."), + All_files_must_be_modules_when_the_isolatedModules_flag_is_provided: diag(1208, ts.DiagnosticCategory.Error, "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208", "All files must be modules when the '--isolatedModules' flag is provided."), Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: diag(1210, ts.DiagnosticCategory.Error, "Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode_1210", "Invalid use of '{0}'. Class definitions are automatically in strict mode."), A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, ts.DiagnosticCategory.Error, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), Identifier_expected_0_is_a_reserved_word_in_strict_mode: diag(1212, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", "Identifier expected. '{0}' is a reserved word in strict mode."), @@ -7702,12 +7138,11 @@ var ts; A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, ts.DiagnosticCategory.Error, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."), A_rest_element_must_be_last_in_a_tuple_type: diag(1256, ts.DiagnosticCategory.Error, "A_rest_element_must_be_last_in_a_tuple_type_1256", "A rest element must be last in a tuple type."), A_required_element_cannot_follow_an_optional_element: diag(1257, ts.DiagnosticCategory.Error, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."), + Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation: diag(1258, ts.DiagnosticCategory.Error, "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258", "Definite assignment assertions can only be used along with a type annotation."), Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, ts.DiagnosticCategory.Error, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"), Keywords_cannot_contain_escape_characters: diag(1260, ts.DiagnosticCategory.Error, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."), Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, ts.DiagnosticCategory.Error, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."), Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."), - Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, ts.DiagnosticCategory.Error, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."), - Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, ts.DiagnosticCategory.Error, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."), with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."), @@ -7724,7 +7159,7 @@ var ts; Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system_or_umd: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'esnext', 'commonjs', 'amd', 'system', or 'umd'."), Dynamic_import_must_have_one_specifier_as_an_argument: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_import_must_have_one_specifier_as_an_argument_1324", "Dynamic import must have one specifier as an argument."), Specifier_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Specifier_of_dynamic_import_cannot_be_spread_element_1325", "Specifier of dynamic import cannot be spread element."), - Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments."), + Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments"), String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."), Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: diag(1328, ts.DiagnosticCategory.Error, "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328", "Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."), _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: diag(1329, ts.DiagnosticCategory.Error, "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329", "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"), @@ -7740,9 +7175,9 @@ var ts; Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."), - The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system_1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'."), + The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system_1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'esnext' or 'system'."), A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), - An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), + An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness"), This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."), use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, ts.DiagnosticCategory.Error, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."), Non_simple_parameter_declared_here: diag(1348, ts.DiagnosticCategory.Error, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."), @@ -7785,7 +7220,6 @@ var ts; Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."), - _0_is_not_allowed_as_a_variable_declaration_name: diag(1389, ts.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."), The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true), @@ -7911,7 +7345,6 @@ var ts; Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts.DiagnosticCategory.Error, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), - Types_of_construct_signatures_are_incompatible: diag(2419, ts.DiagnosticCategory.Error, "Types_of_construct_signatures_are_incompatible_2419", "Types of construct signatures are incompatible."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts.DiagnosticCategory.Error, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), @@ -8035,7 +7468,6 @@ var ts; The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: diag(2547, ts.DiagnosticCategory.Error, "The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547", "The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."), Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2548, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."), Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2549, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."), - Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later: diag(2550, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550", "Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later."), Property_0_does_not_exist_on_type_1_Did_you_mean_2: diag(2551, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", "Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"), Cannot_find_name_0_Did_you_mean_1: diag(2552, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Did_you_mean_1_2552", "Cannot find name '{0}'. Did you mean '{1}'?"), Computed_values_are_not_permitted_in_an_enum_with_string_valued_members: diag(2553, ts.DiagnosticCategory.Error, "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553", "Computed values are not permitted in an enum with string valued members."), @@ -8059,13 +7491,13 @@ var ts; Property_0_is_incompatible_with_rest_element_type: diag(2573, ts.DiagnosticCategory.Error, "Property_0_is_incompatible_with_rest_element_type_2573", "Property '{0}' is incompatible with rest element type."), A_rest_element_type_must_be_an_array_type: diag(2574, ts.DiagnosticCategory.Error, "A_rest_element_type_must_be_an_array_type_2574", "A rest element type must be an array type."), No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), - Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'."), + Property_0_is_a_static_member_of_type_1: diag(2576, ts.DiagnosticCategory.Error, "Property_0_is_a_static_member_of_type_1_2576", "Property '{0}' is a static member of type '{1}'"), Return_type_annotation_circularly_references_itself: diag(2577, ts.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), Unused_ts_expect_error_directive: diag(2578, ts.DiagnosticCategory.Error, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."), - Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode: diag(2580, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery: diag(2581, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha: diag(2582, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`."), + Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2583, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later."), Enum_type_0_circularly_references_itself: diag(2586, ts.DiagnosticCategory.Error, "Enum_type_0_circularly_references_itself_2586", "Enum type '{0}' circularly references itself."), @@ -8073,9 +7505,9 @@ var ts; Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), Type_instantiation_is_excessively_deep_and_possibly_infinite: diag(2589, ts.DiagnosticCategory.Error, "Type_instantiation_is_excessively_deep_and_possibly_infinite_2589", "Type instantiation is excessively deep and possibly infinite."), Expression_produces_a_union_type_that_is_too_complex_to_represent: diag(2590, ts.DiagnosticCategory.Error, "Expression_produces_a_union_type_that_is_too_complex_to_represent_2590", "Expression produces a union type that is too complex to represent."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig."), - Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig."), This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, ts.DiagnosticCategory.Error, "This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594", "This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag."), _0_can_only_be_imported_by_using_a_default_import: diag(2595, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."), _0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, ts.DiagnosticCategory.Error, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."), @@ -8143,7 +7575,6 @@ var ts; All_declarations_of_0_must_have_identical_modifiers: diag(2687, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_modifiers_2687", "All declarations of '{0}' must have identical modifiers."), Cannot_find_type_definition_file_for_0: diag(2688, ts.DiagnosticCategory.Error, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, ts.DiagnosticCategory.Error, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), - _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, ts.DiagnosticCategory.Error, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."), _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, ts.DiagnosticCategory.Error, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, ts.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), @@ -8177,7 +7608,7 @@ var ts; Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), - _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"), + Module_0_has_no_exported_member_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_2_2724", "Module '{0}' has no exported member '{1}'. Did you mean '{2}'?"), Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, ts.DiagnosticCategory.Error, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."), Cannot_find_lib_definition_for_0: diag(2726, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."), Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"), @@ -8185,7 +7616,7 @@ var ts; Property_0_is_used_before_its_initialization: diag(2729, ts.DiagnosticCategory.Error, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."), An_arrow_function_cannot_have_a_this_parameter: diag(2730, ts.DiagnosticCategory.Error, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."), Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."), - Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."), + Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension"), Property_0_was_also_declared_here: diag(2733, ts.DiagnosticCategory.Error, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."), Are_you_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"), Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"), @@ -8246,10 +7677,6 @@ var ts; The_operand_of_a_delete_operator_must_be_optional: diag(2790, ts.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_must_be_optional_2790", "The operand of a 'delete' operator must be optional."), Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: diag(2791, ts.DiagnosticCategory.Error, "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791", "Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."), Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option: diag(2792, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792", "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"), - The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: diag(2793, ts.DiagnosticCategory.Error, "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793", "The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."), - Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: diag(2794, ts.DiagnosticCategory.Error, "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794", "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"), - The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, ts.DiagnosticCategory.Error, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."), - It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked: diag(2796, ts.DiagnosticCategory.Error, "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796", "It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -8363,6 +7790,7 @@ var ts; Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: diag(5057, ts.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", "Cannot find a tsconfig.json file at the specified directory: '{0}'."), The_specified_path_does_not_exist_Colon_0: diag(5058, ts.DiagnosticCategory.Error, "The_specified_path_does_not_exist_Colon_0_5058", "The specified path does not exist: '{0}'."), Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, ts.DiagnosticCategory.Error, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."), + Option_paths_cannot_be_used_without_specifying_baseUrl_option: diag(5060, ts.DiagnosticCategory.Error, "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060", "Option 'paths' cannot be used without specifying '--baseUrl' option."), Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, ts.DiagnosticCategory.Error, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."), Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: diag(5062, ts.DiagnosticCategory.Error, "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' can have at most one '*' character."), Substitutions_for_pattern_0_should_be_an_array: diag(5063, ts.DiagnosticCategory.Error, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."), @@ -8391,8 +7819,6 @@ var ts; A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: diag(5086, ts.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086", "A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."), A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, ts.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087", "A labeled tuple element is declared as rest with a `...` before the name, rather than before the type."), The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, ts.DiagnosticCategory.Error, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), - Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, ts.DiagnosticCategory.Error, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), - Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, ts.DiagnosticCategory.Error, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6000, ts.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), Concatenate_and_emit_output_to_single_file: diag(6001, ts.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), Generates_corresponding_d_ts_file: diag(6002, ts.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), @@ -8583,7 +8009,7 @@ var ts; Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"), _0_was_also_declared_here: diag(6203, ts.DiagnosticCategory.Message, "_0_was_also_declared_here_6203", "'{0}' was also declared here."), and_here: diag(6204, ts.DiagnosticCategory.Message, "and_here_6204", "and here."), - All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused."), + All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused"), package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."), package_json_does_not_have_a_typesVersions_entry_that_matches_version_0: diag(6207, ts.DiagnosticCategory.Message, "package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207", "'package.json' does not have a 'typesVersions' entry that matches version '{0}'."), package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2: diag(6208, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208", "'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."), @@ -8615,8 +8041,6 @@ var ts; This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without: diag(6234, ts.DiagnosticCategory.Error, "This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234", "This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"), Disable_loading_referenced_projects: diag(6235, ts.DiagnosticCategory.Message, "Disable_loading_referenced_projects_6235", "Disable loading referenced projects."), Arguments_for_the_rest_parameter_0_were_not_provided: diag(6236, ts.DiagnosticCategory.Error, "Arguments_for_the_rest_parameter_0_were_not_provided_6236", "Arguments for the rest parameter '{0}' were not provided."), - Generates_an_event_trace_and_a_list_of_types: diag(6237, ts.DiagnosticCategory.Message, "Generates_an_event_trace_and_a_list_of_types_6237", "Generates an event trace and a list of types."), - Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react: diag(6238, ts.DiagnosticCategory.Error, "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238", "Specify the module specifier to be used to import the `jsx` and `jsxs` factory functions from. eg, react"), Projects_to_reference: diag(6300, ts.DiagnosticCategory.Message, "Projects_to_reference_6300", "Projects to reference"), Enable_project_compilation: diag(6302, ts.DiagnosticCategory.Message, "Enable_project_compilation_6302", "Enable project compilation"), Composite_projects_may_not_disable_declaration_emit: diag(6304, ts.DiagnosticCategory.Error, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), @@ -8662,13 +8086,11 @@ var ts; Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, ts.DiagnosticCategory.Message, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"), Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, ts.DiagnosticCategory.Message, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."), _0_is_deprecated: diag(6385, ts.DiagnosticCategory.Suggestion, "_0_is_deprecated_6385", "'{0}' is deprecated", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ undefined, /*reportsDeprecated*/ true), - Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, ts.DiagnosticCategory.Message, "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386", "Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."), The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), The_expected_type_comes_from_this_index_signature: diag(6501, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing: diag(6503, ts.DiagnosticCategory.Message, "Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503", "Print names of files that are part of the compilation and then stop processing."), File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, ts.DiagnosticCategory.Error, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"), - Include_undefined_in_index_signature_results: diag(6800, ts.DiagnosticCategory.Message, "Include_undefined_in_index_signature_results_6800", "Include 'undefined' in index signature results"), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -8696,7 +8118,7 @@ var ts; Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: diag(7032, ts.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."), Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: diag(7033, ts.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."), Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), - Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035", "Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), + Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035", "Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts.DiagnosticCategory.Error, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead: diag(7038, ts.DiagnosticCategory.Message, "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038", "Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."), @@ -8717,7 +8139,6 @@ var ts; Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: diag(7053, ts.DiagnosticCategory.Error, "Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053", "Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."), No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1: diag(7054, ts.DiagnosticCategory.Error, "No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054", "No index signature with a parameter of type '{0}' was found on type '{1}'."), _0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type: diag(7055, ts.DiagnosticCategory.Error, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055", "'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."), - The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed: diag(7056, ts.DiagnosticCategory.Error, "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056", "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."), @@ -8828,7 +8249,6 @@ var ts; Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), - Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), Extract_function: diag(95005, ts.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"), Extract_constant: diag(95006, ts.DiagnosticCategory.Message, "Extract_constant_95006", "Extract constant"), @@ -8846,7 +8266,6 @@ var ts; Add_undefined_type_to_property_0: diag(95018, ts.DiagnosticCategory.Message, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"), Add_initializer_to_property_0: diag(95019, ts.DiagnosticCategory.Message, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"), Add_definite_assignment_assertion_to_property_0: diag(95020, ts.DiagnosticCategory.Message, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"), - Convert_all_type_literals_to_mapped_type: diag(95021, ts.DiagnosticCategory.Message, "Convert_all_type_literals_to_mapped_type_95021", "Convert all type literals to mapped type"), Add_all_missing_members: diag(95022, ts.DiagnosticCategory.Message, "Add_all_missing_members_95022", "Add all missing members"), Infer_all_types_from_usage: diag(95023, ts.DiagnosticCategory.Message, "Infer_all_types_from_usage_95023", "Infer all types from usage"), Delete_all_unused_declarations: diag(95024, ts.DiagnosticCategory.Message, "Delete_all_unused_declarations_95024", "Delete all unused declarations"), @@ -8968,12 +8387,10 @@ var ts; Could_not_find_convertible_access_expression: diag(95140, ts.DiagnosticCategory.Message, "Could_not_find_convertible_access_expression_95140", "Could not find convertible access expression"), Could_not_find_matching_access_expressions: diag(95141, ts.DiagnosticCategory.Message, "Could_not_find_matching_access_expressions_95141", "Could not find matching access expressions"), Can_only_convert_logical_AND_access_chains: diag(95142, ts.DiagnosticCategory.Message, "Can_only_convert_logical_AND_access_chains_95142", "Can only convert logical AND access chains"), - Add_void_to_Promise_resolved_without_a_value: diag(95143, ts.DiagnosticCategory.Message, "Add_void_to_Promise_resolved_without_a_value_95143", "Add 'void' to Promise resolved without a value"), - Add_void_to_all_Promises_resolved_without_a_value: diag(95144, ts.DiagnosticCategory.Message, "Add_void_to_all_Promises_resolved_without_a_value_95144", "Add 'void' to all Promises resolved without a value"), No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."), Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."), JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"), - Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts.DiagnosticCategory.Error, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters."), + Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts.DiagnosticCategory.Error, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters"), An_accessibility_modifier_cannot_be_used_with_a_private_identifier: diag(18010, ts.DiagnosticCategory.Error, "An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010", "An accessibility modifier cannot be used with a private identifier."), The_operand_of_a_delete_operator_cannot_be_a_private_identifier: diag(18011, ts.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011", "The operand of a 'delete' operator cannot be a private identifier."), constructor_is_a_reserved_word: diag(18012, ts.DiagnosticCategory.Error, "constructor_is_a_reserved_word_18012", "'#constructor' is a reserved word."), @@ -8983,7 +8400,7 @@ var ts; Private_identifiers_are_not_allowed_outside_class_bodies: diag(18016, ts.DiagnosticCategory.Error, "Private_identifiers_are_not_allowed_outside_class_bodies_18016", "Private identifiers are not allowed outside class bodies."), The_shadowing_declaration_of_0_is_defined_here: diag(18017, ts.DiagnosticCategory.Error, "The_shadowing_declaration_of_0_is_defined_here_18017", "The shadowing declaration of '{0}' is defined here"), The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here: diag(18018, ts.DiagnosticCategory.Error, "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018", "The declaration of '{0}' that you probably intended to use is defined here"), - _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier."), + _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier"), A_method_cannot_be_named_with_a_private_identifier: diag(18022, ts.DiagnosticCategory.Error, "A_method_cannot_be_named_with_a_private_identifier_18022", "A method cannot be named with a private identifier."), An_accessor_cannot_be_named_with_a_private_identifier: diag(18023, ts.DiagnosticCategory.Error, "An_accessor_cannot_be_named_with_a_private_identifier_18023", "An accessor cannot be named with a private identifier."), An_enum_member_cannot_be_named_with_a_private_identifier: diag(18024, ts.DiagnosticCategory.Error, "An_enum_member_cannot_be_named_with_a_private_identifier_18024", "An enum member cannot be named with a private identifier."), @@ -9017,7 +8434,7 @@ var ts; any: 128 /* AnyKeyword */, as: 126 /* AsKeyword */, asserts: 127 /* AssertsKeyword */, - bigint: 155 /* BigIntKeyword */, + bigint: 154 /* BigIntKeyword */, boolean: 131 /* BooleanKeyword */, break: 80 /* BreakKeyword */, case: 81 /* CaseKeyword */, @@ -9039,7 +8456,7 @@ var ts; _a.false = 94 /* FalseKeyword */, _a.finally = 95 /* FinallyKeyword */, _a.for = 96 /* ForKeyword */, - _a.from = 153 /* FromKeyword */, + _a.from = 152 /* FromKeyword */, _a.function = 97 /* FunctionKeyword */, _a.get = 134 /* GetKeyword */, _a.if = 98 /* IfKeyword */, @@ -9049,40 +8466,39 @@ var ts; _a.infer = 135 /* InferKeyword */, _a.instanceof = 101 /* InstanceOfKeyword */, _a.interface = 117 /* InterfaceKeyword */, - _a.intrinsic = 136 /* IntrinsicKeyword */, - _a.is = 137 /* IsKeyword */, - _a.keyof = 138 /* KeyOfKeyword */, + _a.is = 136 /* IsKeyword */, + _a.keyof = 137 /* KeyOfKeyword */, _a.let = 118 /* LetKeyword */, - _a.module = 139 /* ModuleKeyword */, - _a.namespace = 140 /* NamespaceKeyword */, - _a.never = 141 /* NeverKeyword */, + _a.module = 138 /* ModuleKeyword */, + _a.namespace = 139 /* NamespaceKeyword */, + _a.never = 140 /* NeverKeyword */, _a.new = 102 /* NewKeyword */, _a.null = 103 /* NullKeyword */, - _a.number = 144 /* NumberKeyword */, - _a.object = 145 /* ObjectKeyword */, + _a.number = 143 /* NumberKeyword */, + _a.object = 144 /* ObjectKeyword */, _a.package = 119 /* PackageKeyword */, _a.private = 120 /* PrivateKeyword */, _a.protected = 121 /* ProtectedKeyword */, _a.public = 122 /* PublicKeyword */, - _a.readonly = 142 /* ReadonlyKeyword */, - _a.require = 143 /* RequireKeyword */, - _a.global = 154 /* GlobalKeyword */, + _a.readonly = 141 /* ReadonlyKeyword */, + _a.require = 142 /* RequireKeyword */, + _a.global = 153 /* GlobalKeyword */, _a.return = 104 /* ReturnKeyword */, - _a.set = 146 /* SetKeyword */, + _a.set = 145 /* SetKeyword */, _a.static = 123 /* StaticKeyword */, - _a.string = 147 /* StringKeyword */, + _a.string = 146 /* StringKeyword */, _a.super = 105 /* SuperKeyword */, _a.switch = 106 /* SwitchKeyword */, - _a.symbol = 148 /* SymbolKeyword */, + _a.symbol = 147 /* SymbolKeyword */, _a.this = 107 /* ThisKeyword */, _a.throw = 108 /* ThrowKeyword */, _a.true = 109 /* TrueKeyword */, _a.try = 110 /* TryKeyword */, - _a.type = 149 /* TypeKeyword */, + _a.type = 148 /* TypeKeyword */, _a.typeof = 111 /* TypeOfKeyword */, - _a.undefined = 150 /* UndefinedKeyword */, - _a.unique = 151 /* UniqueKeyword */, - _a.unknown = 152 /* UnknownKeyword */, + _a.undefined = 149 /* UndefinedKeyword */, + _a.unique = 150 /* UniqueKeyword */, + _a.unknown = 151 /* UnknownKeyword */, _a.var = 112 /* VarKeyword */, _a.void = 113 /* VoidKeyword */, _a.while = 114 /* WhileKeyword */, @@ -9090,7 +8506,7 @@ var ts; _a.yield = 124 /* YieldKeyword */, _a.async = 129 /* AsyncKeyword */, _a.await = 130 /* AwaitKeyword */, - _a.of = 156 /* OfKeyword */, + _a.of = 155 /* OfKeyword */, _a); var textToKeyword = new ts.Map(ts.getEntries(textToKeywordObj)); var textToToken = new ts.Map(ts.getEntries(__assign(__assign({}, textToKeywordObj), { "{": 18 /* OpenBraceToken */, "}": 19 /* CloseBraceToken */, "(": 20 /* OpenParenToken */, ")": 21 /* CloseParenToken */, "[": 22 /* OpenBracketToken */, "]": 23 /* CloseBracketToken */, ".": 24 /* DotToken */, "...": 25 /* DotDotDotToken */, ";": 26 /* SemicolonToken */, ",": 27 /* CommaToken */, "<": 29 /* LessThanToken */, ">": 31 /* GreaterThanToken */, "<=": 32 /* LessThanEqualsToken */, ">=": 33 /* GreaterThanEqualsToken */, "==": 34 /* EqualsEqualsToken */, "!=": 35 /* ExclamationEqualsToken */, "===": 36 /* EqualsEqualsEqualsToken */, "!==": 37 /* ExclamationEqualsEqualsToken */, "=>": 38 /* EqualsGreaterThanToken */, "+": 39 /* PlusToken */, "-": 40 /* MinusToken */, "**": 42 /* AsteriskAsteriskToken */, "*": 41 /* AsteriskToken */, "/": 43 /* SlashToken */, "%": 44 /* PercentToken */, "++": 45 /* PlusPlusToken */, "--": 46 /* MinusMinusToken */, "<<": 47 /* LessThanLessThanToken */, ">": 48 /* GreaterThanGreaterThanToken */, ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, "&": 50 /* AmpersandToken */, "|": 51 /* BarToken */, "^": 52 /* CaretToken */, "!": 53 /* ExclamationToken */, "~": 54 /* TildeToken */, "&&": 55 /* AmpersandAmpersandToken */, "||": 56 /* BarBarToken */, "?": 57 /* QuestionToken */, "??": 60 /* QuestionQuestionToken */, "?.": 28 /* QuestionDotToken */, ":": 58 /* ColonToken */, "=": 62 /* EqualsToken */, "+=": 63 /* PlusEqualsToken */, "-=": 64 /* MinusEqualsToken */, "*=": 65 /* AsteriskEqualsToken */, "**=": 66 /* AsteriskAsteriskEqualsToken */, "/=": 67 /* SlashEqualsToken */, "%=": 68 /* PercentEqualsToken */, "<<=": 69 /* LessThanLessThanEqualsToken */, ">>=": 70 /* GreaterThanGreaterThanEqualsToken */, ">>>=": 71 /* GreaterThanGreaterThanGreaterThanEqualsToken */, "&=": 72 /* AmpersandEqualsToken */, "|=": 73 /* BarEqualsToken */, "^=": 77 /* CaretEqualsToken */, "||=": 74 /* BarBarEqualsToken */, "&&=": 75 /* AmpersandAmpersandEqualsToken */, "??=": 76 /* QuestionQuestionEqualsToken */, "@": 59 /* AtToken */, "`": 61 /* BacktickToken */ }))); @@ -10271,9 +9687,9 @@ var ts; return result; } function getIdentifierToken() { - // Reserved words are between 2 and 12 characters long and start with a lowercase letter + // Reserved words are between 2 and 11 characters long and start with a lowercase letter var len = tokenValue.length; - if (len >= 2 && len <= 12) { + if (len >= 2 && len <= 11) { var ch = tokenValue.charCodeAt(0); if (ch >= 97 /* a */ && ch <= 122 /* z */) { var keyword = textToKeyword.get(tokenValue); @@ -11476,9 +10892,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 159 /* TypeParameter */) { + if (d && d.kind === 158 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (isFunctionLike(current) || isClassLike(current) || current.kind === 253 /* InterfaceDeclaration */) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 250 /* InterfaceDeclaration */) { return current; } } @@ -11486,7 +10902,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node, parent) { - return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 166 /* Constructor */; + return ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */) && parent.kind === 165 /* Constructor */; } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -11516,14 +10932,14 @@ var ts; node = walkUpBindingElementsAndPatterns(node); } var flags = getFlags(node); - if (node.kind === 249 /* VariableDeclaration */) { + if (node.kind === 246 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 250 /* VariableDeclarationList */) { + if (node && node.kind === 247 /* VariableDeclarationList */) { flags |= getFlags(node); node = node.parent; } - if (node && node.kind === 232 /* VariableStatement */) { + if (node && node.kind === 229 /* VariableStatement */) { flags |= getFlags(node); } return flags; @@ -11614,20 +11030,6 @@ var ts; return !nodeTest || nodeTest(node) ? node : undefined; } ts.getOriginalNode = getOriginalNode; - function findAncestor(node, callback) { - while (node) { - var result = callback(node); - if (result === "quit") { - return undefined; - } - else if (result) { - return node; - } - node = node.parent; - } - return undefined; - } - ts.findAncestor = findAncestor; /** * Gets a value indicating whether a node originated in the parse tree. * @@ -11693,30 +11095,30 @@ var ts; } // Covers remaining cases (returning undefined if none match). switch (hostNode.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } break; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: var expr = hostNode.expression; - if (expr.kind === 216 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { + if (expr.kind === 213 /* BinaryExpression */ && expr.operatorToken.kind === 62 /* EqualsToken */) { expr = expr.left; } switch (expr.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return expr.name; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; } } break; - case 207 /* ParenthesizedExpression */: { + case 204 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 245 /* LabeledStatement */: { + case 242 /* LabeledStatement */: { if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -11753,16 +11155,16 @@ var ts; switch (declaration.kind) { case 78 /* Identifier */: return declaration; - case 333 /* JSDocPropertyTag */: - case 326 /* JSDocParameterTag */: { + case 328 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 157 /* QualifiedName */) { + if (name.kind === 156 /* QualifiedName */) { return name.right; } break; } - case 203 /* CallExpression */: - case 216 /* BinaryExpression */: { + case 200 /* CallExpression */: + case 213 /* BinaryExpression */: { var expr_1 = declaration; switch (ts.getAssignmentDeclarationKind(expr_1)) { case 1 /* ExportsProperty */: @@ -11778,15 +11180,15 @@ var ts; return undefined; } } - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 325 /* JSDocEnumTag */: + case 321 /* JSDocEnumTag */: return nameForNamelessJSDocTypedef(declaration); - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = declaration; if (ts.isBindableStaticElementAccessExpression(expr)) { return expr.argumentExpression; @@ -12081,7 +11483,7 @@ var ts; return ts.emptyArray; } if (ts.isJSDocTypeAlias(node)) { - ts.Debug.assert(node.parent.kind === 311 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 307 /* JSDocComment */); return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; }); } if (node.typeParameters) { @@ -12113,7 +11515,7 @@ var ts; ts.isIdentifierOrPrivateIdentifier = isIdentifierOrPrivateIdentifier; /* @internal */ function isGetOrSetAccessorDeclaration(node) { - return node.kind === 168 /* SetAccessor */ || node.kind === 167 /* GetAccessor */; + return node.kind === 167 /* SetAccessor */ || node.kind === 166 /* GetAccessor */; } ts.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; function isPropertyAccessChain(node) { @@ -12131,10 +11533,10 @@ var ts; function isOptionalChain(node) { var kind = node.kind; return !!(node.flags & 32 /* OptionalChain */) && - (kind === 201 /* PropertyAccessExpression */ - || kind === 202 /* ElementAccessExpression */ - || kind === 203 /* CallExpression */ - || kind === 225 /* NonNullExpression */); + (kind === 198 /* PropertyAccessExpression */ + || kind === 199 /* ElementAccessExpression */ + || kind === 200 /* CallExpression */ + || kind === 222 /* NonNullExpression */); } ts.isOptionalChain = isOptionalChain; /* @internal */ @@ -12169,7 +11571,7 @@ var ts; } ts.isOutermostOptionalChain = isOutermostOptionalChain; function isNullishCoalesce(node) { - return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; + return node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; } ts.isNullishCoalesce = isNullishCoalesce; function isConstTypeReference(node) { @@ -12186,17 +11588,17 @@ var ts; } ts.isNonNullChain = isNonNullChain; function isBreakOrContinueStatement(node) { - return node.kind === 241 /* BreakStatement */ || node.kind === 240 /* ContinueStatement */; + return node.kind === 238 /* BreakStatement */ || node.kind === 237 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isNamedExportBindings(node) { - return node.kind === 269 /* NamespaceExport */ || node.kind === 268 /* NamedExports */; + return node.kind === 266 /* NamespaceExport */ || node.kind === 265 /* NamedExports */; } ts.isNamedExportBindings = isNamedExportBindings; function isUnparsedTextLike(node) { switch (node.kind) { - case 294 /* UnparsedText */: - case 295 /* UnparsedInternalText */: + case 291 /* UnparsedText */: + case 292 /* UnparsedInternalText */: return true; default: return false; @@ -12205,12 +11607,12 @@ var ts; ts.isUnparsedTextLike = isUnparsedTextLike; function isUnparsedNode(node) { return isUnparsedTextLike(node) || - node.kind === 292 /* UnparsedPrologue */ || - node.kind === 296 /* UnparsedSyntheticReference */; + node.kind === 289 /* UnparsedPrologue */ || + node.kind === 293 /* UnparsedSyntheticReference */; } ts.isUnparsedNode = isUnparsedNode; function isJSDocPropertyLikeTag(node) { - return node.kind === 333 /* JSDocPropertyTag */ || node.kind === 326 /* JSDocParameterTag */; + return node.kind === 328 /* JSDocPropertyTag */ || node.kind === 322 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; // #endregion @@ -12226,7 +11628,7 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 157 /* FirstNode */; + return kind >= 156 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** @@ -12235,7 +11637,7 @@ var ts; * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 156 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 155 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -12276,12 +11678,12 @@ var ts; ts.isImportOrExportSpecifier = isImportOrExportSpecifier; function isTypeOnlyImportOrExportDeclaration(node) { switch (node.kind) { - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return node.parent.isTypeOnly; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.isTypeOnly; default: return false; @@ -12322,7 +11724,7 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 123 /* StaticKeyword */: return true; } @@ -12345,7 +11747,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 157 /* QualifiedName */ + return kind === 156 /* QualifiedName */ || kind === 78 /* Identifier */; } ts.isEntityName = isEntityName; @@ -12355,14 +11757,14 @@ var ts; || kind === 79 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 158 /* ComputedPropertyName */; + || kind === 157 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 78 /* Identifier */ - || kind === 196 /* ObjectBindingPattern */ - || kind === 197 /* ArrayBindingPattern */; + || kind === 193 /* ObjectBindingPattern */ + || kind === 194 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12377,13 +11779,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; default: return false; @@ -12392,14 +11794,14 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 174 /* FunctionType */: - case 308 /* JSDocFunctionType */: - case 175 /* ConstructorType */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 173 /* FunctionType */: + case 304 /* JSDocFunctionType */: + case 174 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12414,29 +11816,29 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 166 /* Constructor */ - || kind === 163 /* PropertyDeclaration */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 171 /* IndexSignature */ - || kind === 229 /* SemicolonClassElement */; + return kind === 165 /* Constructor */ + || kind === 162 /* PropertyDeclaration */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 170 /* IndexSignature */ + || kind === 226 /* SemicolonClassElement */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */); + return node && (node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */); + return node && (node.kind === 166 /* GetAccessor */ || node.kind === 167 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return true; default: return false; @@ -12446,11 +11848,11 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 170 /* ConstructSignature */ - || kind === 169 /* CallSignature */ - || kind === 162 /* PropertySignature */ - || kind === 164 /* MethodSignature */ - || kind === 171 /* IndexSignature */; + return kind === 169 /* ConstructSignature */ + || kind === 168 /* CallSignature */ + || kind === 161 /* PropertySignature */ + || kind === 163 /* MethodSignature */ + || kind === 170 /* IndexSignature */; } ts.isTypeElement = isTypeElement; function isClassOrTypeElement(node) { @@ -12459,12 +11861,12 @@ var ts; ts.isClassOrTypeElement = isClassOrTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 288 /* PropertyAssignment */ - || kind === 289 /* ShorthandPropertyAssignment */ - || kind === 290 /* SpreadAssignment */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 285 /* PropertyAssignment */ + || kind === 286 /* ShorthandPropertyAssignment */ + || kind === 287 /* SpreadAssignment */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type @@ -12479,8 +11881,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return true; } return false; @@ -12491,8 +11893,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 197 /* ArrayBindingPattern */ - || kind === 196 /* ObjectBindingPattern */; + return kind === 194 /* ArrayBindingPattern */ + || kind === 193 /* ObjectBindingPattern */; } return false; } @@ -12500,15 +11902,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 199 /* ArrayLiteralExpression */ - || kind === 200 /* ObjectLiteralExpression */; + return kind === 196 /* ArrayLiteralExpression */ + || kind === 197 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 198 /* BindingElement */ - || kind === 222 /* OmittedExpression */; + return kind === 195 /* BindingElement */ + || kind === 219 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12517,9 +11919,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: return true; } return false; @@ -12540,8 +11942,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 196 /* ObjectBindingPattern */: - case 200 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 197 /* ObjectLiteralExpression */: return true; } return false; @@ -12553,8 +11955,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: return true; } return false; @@ -12563,26 +11965,26 @@ var ts; /* @internal */ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { var kind = node.kind; - return kind === 201 /* PropertyAccessExpression */ - || kind === 157 /* QualifiedName */ - || kind === 195 /* ImportType */; + return kind === 198 /* PropertyAccessExpression */ + || kind === 156 /* QualifiedName */ + || kind === 192 /* ImportType */; } ts.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 201 /* PropertyAccessExpression */ - || kind === 157 /* QualifiedName */; + return kind === 198 /* PropertyAccessExpression */ + || kind === 156 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 161 /* Decorator */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 160 /* Decorator */: return true; default: return false; @@ -12590,12 +11992,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 203 /* CallExpression */ || node.kind === 204 /* NewExpression */; + return node.kind === 200 /* CallExpression */ || node.kind === 201 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 218 /* TemplateExpression */ + return kind === 215 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12606,33 +12008,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 204 /* NewExpression */: - case 203 /* CallExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: - case 205 /* TaggedTemplateExpression */: - case 199 /* ArrayLiteralExpression */: - case 207 /* ParenthesizedExpression */: - case 200 /* ObjectLiteralExpression */: - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 201 /* NewExpression */: + case 200 /* CallExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: + case 202 /* TaggedTemplateExpression */: + case 196 /* ArrayLiteralExpression */: + case 204 /* ParenthesizedExpression */: + case 197 /* ObjectLiteralExpression */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: case 78 /* Identifier */: case 13 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: case 94 /* FalseKeyword */: case 103 /* NullKeyword */: case 107 /* ThisKeyword */: case 109 /* TrueKeyword */: case 105 /* SuperKeyword */: - case 225 /* NonNullExpression */: - case 226 /* MetaProperty */: + case 222 /* NonNullExpression */: + case 223 /* MetaProperty */: case 99 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: @@ -12646,13 +12048,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: - case 210 /* DeleteExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 213 /* AwaitExpression */: - case 206 /* TypeAssertionExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 207 /* DeleteExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 210 /* AwaitExpression */: + case 203 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12661,9 +12063,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return true; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; default: @@ -12682,15 +12084,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 217 /* ConditionalExpression */: - case 219 /* YieldExpression */: - case 209 /* ArrowFunction */: - case 216 /* BinaryExpression */: - case 220 /* SpreadElement */: - case 224 /* AsExpression */: - case 222 /* OmittedExpression */: - case 337 /* CommaListExpression */: - case 336 /* PartiallyEmittedExpression */: + case 214 /* ConditionalExpression */: + case 216 /* YieldExpression */: + case 206 /* ArrowFunction */: + case 213 /* BinaryExpression */: + case 217 /* SpreadElement */: + case 221 /* AsExpression */: + case 219 /* OmittedExpression */: + case 332 /* CommaListExpression */: + case 331 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12698,8 +12100,8 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 206 /* TypeAssertionExpression */ - || kind === 224 /* AsExpression */; + return kind === 203 /* TypeAssertionExpression */ + || kind === 221 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ @@ -12710,13 +12112,13 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return true; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12745,7 +12147,7 @@ var ts; ts.isExternalModuleIndicator = isExternalModuleIndicator; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 238 /* ForInStatement */ || node.kind === 239 /* ForOfStatement */; + return node.kind === 235 /* ForInStatement */ || node.kind === 236 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12769,114 +12171,114 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 257 /* ModuleBlock */ - || kind === 256 /* ModuleDeclaration */ + return kind === 254 /* ModuleBlock */ + || kind === 253 /* ModuleDeclaration */ || kind === 78 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 257 /* ModuleBlock */ - || kind === 256 /* ModuleDeclaration */; + return kind === 254 /* ModuleBlock */ + || kind === 253 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 78 /* Identifier */ - || kind === 256 /* ModuleDeclaration */; + || kind === 253 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 264 /* NamedImports */ - || kind === 263 /* NamespaceImport */; + return kind === 261 /* NamedImports */ + || kind === 260 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */ || node.kind === 255 /* EnumDeclaration */; + return node.kind === 253 /* ModuleDeclaration */ || node.kind === 252 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 209 /* ArrowFunction */ - || kind === 198 /* BindingElement */ - || kind === 252 /* ClassDeclaration */ - || kind === 221 /* ClassExpression */ - || kind === 166 /* Constructor */ - || kind === 255 /* EnumDeclaration */ - || kind === 291 /* EnumMember */ - || kind === 270 /* ExportSpecifier */ - || kind === 251 /* FunctionDeclaration */ - || kind === 208 /* FunctionExpression */ - || kind === 167 /* GetAccessor */ - || kind === 262 /* ImportClause */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 265 /* ImportSpecifier */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 280 /* JsxAttribute */ - || kind === 165 /* MethodDeclaration */ - || kind === 164 /* MethodSignature */ - || kind === 256 /* ModuleDeclaration */ - || kind === 259 /* NamespaceExportDeclaration */ - || kind === 263 /* NamespaceImport */ - || kind === 269 /* NamespaceExport */ - || kind === 160 /* Parameter */ - || kind === 288 /* PropertyAssignment */ - || kind === 163 /* PropertyDeclaration */ - || kind === 162 /* PropertySignature */ - || kind === 168 /* SetAccessor */ - || kind === 289 /* ShorthandPropertyAssignment */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 159 /* TypeParameter */ - || kind === 249 /* VariableDeclaration */ - || kind === 331 /* JSDocTypedefTag */ - || kind === 324 /* JSDocCallbackTag */ - || kind === 333 /* JSDocPropertyTag */; + return kind === 206 /* ArrowFunction */ + || kind === 195 /* BindingElement */ + || kind === 249 /* ClassDeclaration */ + || kind === 218 /* ClassExpression */ + || kind === 165 /* Constructor */ + || kind === 252 /* EnumDeclaration */ + || kind === 288 /* EnumMember */ + || kind === 267 /* ExportSpecifier */ + || kind === 248 /* FunctionDeclaration */ + || kind === 205 /* FunctionExpression */ + || kind === 166 /* GetAccessor */ + || kind === 259 /* ImportClause */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 262 /* ImportSpecifier */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 277 /* JsxAttribute */ + || kind === 164 /* MethodDeclaration */ + || kind === 163 /* MethodSignature */ + || kind === 253 /* ModuleDeclaration */ + || kind === 256 /* NamespaceExportDeclaration */ + || kind === 260 /* NamespaceImport */ + || kind === 266 /* NamespaceExport */ + || kind === 159 /* Parameter */ + || kind === 285 /* PropertyAssignment */ + || kind === 162 /* PropertyDeclaration */ + || kind === 161 /* PropertySignature */ + || kind === 167 /* SetAccessor */ + || kind === 286 /* ShorthandPropertyAssignment */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 158 /* TypeParameter */ + || kind === 246 /* VariableDeclaration */ + || kind === 327 /* JSDocTypedefTag */ + || kind === 320 /* JSDocCallbackTag */ + || kind === 328 /* JSDocPropertyTag */; } function isDeclarationStatementKind(kind) { - return kind === 251 /* FunctionDeclaration */ - || kind === 271 /* MissingDeclaration */ - || kind === 252 /* ClassDeclaration */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 255 /* EnumDeclaration */ - || kind === 256 /* ModuleDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 267 /* ExportDeclaration */ - || kind === 266 /* ExportAssignment */ - || kind === 259 /* NamespaceExportDeclaration */; + return kind === 248 /* FunctionDeclaration */ + || kind === 268 /* MissingDeclaration */ + || kind === 249 /* ClassDeclaration */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 252 /* EnumDeclaration */ + || kind === 253 /* ModuleDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 264 /* ExportDeclaration */ + || kind === 263 /* ExportAssignment */ + || kind === 256 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 241 /* BreakStatement */ - || kind === 240 /* ContinueStatement */ - || kind === 248 /* DebuggerStatement */ - || kind === 235 /* DoStatement */ - || kind === 233 /* ExpressionStatement */ - || kind === 231 /* EmptyStatement */ - || kind === 238 /* ForInStatement */ - || kind === 239 /* ForOfStatement */ - || kind === 237 /* ForStatement */ - || kind === 234 /* IfStatement */ - || kind === 245 /* LabeledStatement */ - || kind === 242 /* ReturnStatement */ - || kind === 244 /* SwitchStatement */ - || kind === 246 /* ThrowStatement */ - || kind === 247 /* TryStatement */ - || kind === 232 /* VariableStatement */ - || kind === 236 /* WhileStatement */ - || kind === 243 /* WithStatement */ - || kind === 335 /* NotEmittedStatement */ - || kind === 339 /* EndOfDeclarationMarker */ - || kind === 338 /* MergeDeclarationMarker */; + return kind === 238 /* BreakStatement */ + || kind === 237 /* ContinueStatement */ + || kind === 245 /* DebuggerStatement */ + || kind === 232 /* DoStatement */ + || kind === 230 /* ExpressionStatement */ + || kind === 228 /* EmptyStatement */ + || kind === 235 /* ForInStatement */ + || kind === 236 /* ForOfStatement */ + || kind === 234 /* ForStatement */ + || kind === 231 /* IfStatement */ + || kind === 242 /* LabeledStatement */ + || kind === 239 /* ReturnStatement */ + || kind === 241 /* SwitchStatement */ + || kind === 243 /* ThrowStatement */ + || kind === 244 /* TryStatement */ + || kind === 229 /* VariableStatement */ + || kind === 233 /* WhileStatement */ + || kind === 240 /* WithStatement */ + || kind === 330 /* NotEmittedStatement */ + || kind === 334 /* EndOfDeclarationMarker */ + || kind === 333 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 159 /* TypeParameter */) { - return (node.parent && node.parent.kind !== 330 /* JSDocTemplateTag */) || ts.isInJSFile(node); + if (node.kind === 158 /* TypeParameter */) { + return (node.parent && node.parent.kind !== 326 /* JSDocTemplateTag */) || ts.isInJSFile(node); } return isDeclarationKind(node.kind); } @@ -12903,10 +12305,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 230 /* Block */) + if (node.kind !== 227 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 247 /* TryStatement */ || node.parent.kind === 287 /* CatchClause */) { + if (node.parent.kind === 244 /* TryStatement */ || node.parent.kind === 284 /* CatchClause */) { return false; } } @@ -12920,15 +12322,15 @@ var ts; var kind = node.kind; return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) - || kind === 230 /* Block */; + || kind === 227 /* Block */; } ts.isStatementOrBlock = isStatementOrBlock; // Module references /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 272 /* ExternalModuleReference */ - || kind === 157 /* QualifiedName */ + return kind === 269 /* ExternalModuleReference */ + || kind === 156 /* QualifiedName */ || kind === 78 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12938,70 +12340,70 @@ var ts; var kind = node.kind; return kind === 107 /* ThisKeyword */ || kind === 78 /* Identifier */ - || kind === 201 /* PropertyAccessExpression */; + || kind === 198 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 273 /* JsxElement */ - || kind === 283 /* JsxExpression */ - || kind === 274 /* JsxSelfClosingElement */ + return kind === 270 /* JsxElement */ + || kind === 280 /* JsxExpression */ + || kind === 271 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ - || kind === 277 /* JsxFragment */; + || kind === 274 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 280 /* JsxAttribute */ - || kind === 282 /* JsxSpreadAttribute */; + return kind === 277 /* JsxAttribute */ + || kind === 279 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 10 /* StringLiteral */ - || kind === 283 /* JsxExpression */; + || kind === 280 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 275 /* JsxOpeningElement */ - || kind === 274 /* JsxSelfClosingElement */; + return kind === 272 /* JsxOpeningElement */ + || kind === 271 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 284 /* CaseClause */ - || kind === 285 /* DefaultClause */; + return kind === 281 /* CaseClause */ + || kind === 282 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 301 /* FirstJSDocNode */ && node.kind <= 333 /* LastJSDocNode */; + return node.kind >= 298 /* FirstJSDocNode */ && node.kind <= 328 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 311 /* JSDocComment */ || node.kind === 310 /* JSDocNamepathType */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node); + return node.kind === 307 /* JSDocComment */ || node.kind === 306 /* JSDocNamepathType */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node) || ts.isJSDocSignature(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 314 /* FirstJSDocTagNode */ && node.kind <= 333 /* LastJSDocTagNode */; + return node.kind >= 310 /* FirstJSDocTagNode */ && node.kind <= 328 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 168 /* SetAccessor */; + return node.kind === 167 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 167 /* GetAccessor */; + return node.kind === 166 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -13027,13 +12429,13 @@ var ts; /** True if has initializer node attached to it. */ function hasOnlyExpressionInitializer(node) { switch (node.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 162 /* PropertySignature */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: - case 291 /* EnumMember */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 161 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: + case 288 /* EnumMember */: return true; default: return false; @@ -13041,12 +12443,12 @@ var ts; } ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { - return node.kind === 280 /* JsxAttribute */ || node.kind === 282 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); + return node.kind === 277 /* JsxAttribute */ || node.kind === 279 /* JsxSpreadAttribute */ || isObjectLiteralElementLike(node); } ts.isObjectLiteralElement = isObjectLiteralElement; /* @internal */ function isTypeReferenceType(node) { - return node.kind === 173 /* TypeReference */ || node.kind === 223 /* ExpressionWithTypeArguments */; + return node.kind === 172 /* TypeReference */ || node.kind === 220 /* ExpressionWithTypeArguments */; } ts.isTypeReferenceType = isTypeReferenceType; var MAX_SMI_X86 = 1073741823; @@ -13179,6 +12581,20 @@ var ts; }); } ts.optionsHaveModuleResolutionChanges = optionsHaveModuleResolutionChanges; + function findAncestor(node, callback) { + while (node) { + var result = callback(node); + if (result === "quit") { + return undefined; + } + else if (result) { + return node; + } + node = node.parent; + } + return undefined; + } + ts.findAncestor = findAncestor; function forEachAncestor(node, callback) { while (true) { var res = callback(node); @@ -13327,7 +12743,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 297 /* SourceFile */) { + while (node && node.kind !== 294 /* SourceFile */) { node = node.parent; } return node; @@ -13335,11 +12751,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 230 /* Block */: - case 258 /* CaseBlock */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return true; } return false; @@ -13535,7 +12951,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 334 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 329 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -13554,12 +12970,8 @@ var ts; } ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile; function isJSDocTypeExpressionOrChild(node) { - return !!ts.findAncestor(node, ts.isJSDocTypeExpression); + return !!findAncestor(node, ts.isJSDocTypeExpression); } - function isExportNamespaceAsDefaultDeclaration(node) { - return !!(ts.isExportDeclaration(node) && node.exportClause && ts.isNamespaceExport(node.exportClause) && node.exportClause.name.escapedText === "default"); - } - ts.isExportNamespaceAsDefaultDeclaration = isExportNamespaceAsDefaultDeclaration; function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) { if (includeTrivia === void 0) { includeTrivia = false; } if (nodeIsMissing(node)) { @@ -13597,85 +13009,10 @@ var ts; return emitNode && emitNode.flags || 0; } ts.getEmitFlags = getEmitFlags; - ; - function getScriptTargetFeatures() { - return { - es2015: { - Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"], - RegExp: ["flags", "sticky", "unicode"], - Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"], - ArrayConstructor: ["from", "of"], - ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"], - NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"], - Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"], - Map: ["entries", "keys", "values"], - Set: ["entries", "keys", "values"], - Promise: ts.emptyArray, - PromiseConstructor: ["all", "race", "reject", "resolve"], - Symbol: ["for", "keyFor"], - WeakMap: ["entries", "keys", "values"], - WeakSet: ["entries", "keys", "values"], - Iterator: ts.emptyArray, - AsyncIterator: ts.emptyArray, - String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"], - StringConstructor: ["fromCodePoint", "raw"] - }, - es2016: { - Array: ["includes"] - }, - es2017: { - Atomics: ts.emptyArray, - SharedArrayBuffer: ts.emptyArray, - String: ["padStart", "padEnd"], - ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"], - DateTimeFormat: ["formatToParts"] - }, - es2018: { - Promise: ["finally"], - RegExpMatchArray: ["groups"], - RegExpExecArray: ["groups"], - RegExp: ["dotAll"], - Intl: ["PluralRules"], - AsyncIterable: ts.emptyArray, - AsyncIterableIterator: ts.emptyArray, - AsyncGenerator: ts.emptyArray, - AsyncGeneratorFunction: ts.emptyArray, - }, - es2019: { - Array: ["flat", "flatMap"], - ObjectConstructor: ["fromEntries"], - String: ["trimStart", "trimEnd", "trimLeft", "trimRight"], - Symbol: ["description"] - }, - es2020: { - BigInt: ts.emptyArray, - BigInt64Array: ts.emptyArray, - BigUint64Array: ts.emptyArray, - PromiseConstructor: ["allSettled"], - SymbolConstructor: ["matchAll"], - String: ["matchAll"], - DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"], - RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"] - }, - esnext: { - PromiseConstructor: ["any"], - String: ["replaceAll"], - NumberFormat: ["formatToParts"] - } - }; - } - ts.getScriptTargetFeatures = getScriptTargetFeatures; - var GetLiteralTextFlags; - (function (GetLiteralTextFlags) { - GetLiteralTextFlags[GetLiteralTextFlags["None"] = 0] = "None"; - GetLiteralTextFlags[GetLiteralTextFlags["NeverAsciiEscape"] = 1] = "NeverAsciiEscape"; - GetLiteralTextFlags[GetLiteralTextFlags["JsxAttributeEscape"] = 2] = "JsxAttributeEscape"; - GetLiteralTextFlags[GetLiteralTextFlags["TerminateUnterminatedLiterals"] = 4] = "TerminateUnterminatedLiterals"; - })(GetLiteralTextFlags = ts.GetLiteralTextFlags || (ts.GetLiteralTextFlags = {})); - function getLiteralText(node, sourceFile, flags) { + function getLiteralText(node, sourceFile, neverAsciiEscape, jsxAttributeEscape) { // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. - if (!nodeIsSynthesized(node) && node.parent && !(flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) || + if (!nodeIsSynthesized(node) && node.parent && !((ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) || ts.isBigIntLiteral(node))) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); } @@ -13683,8 +13020,8 @@ var ts; // or a (possibly escaped) quoted form of the original text if it's string-like. switch (node.kind) { case 10 /* StringLiteral */: { - var escapeText = flags & 2 /* JsxAttributeEscape */ ? escapeJsxAttributeString : - flags & 1 /* NeverAsciiEscape */ || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : + var escapeText = jsxAttributeEscape ? escapeJsxAttributeString : + neverAsciiEscape || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : escapeNonAsciiString; if (node.singleQuote) { return "'" + escapeText(node.text, 39 /* singleQuote */) + "'"; @@ -13699,7 +13036,7 @@ var ts; case 17 /* TemplateTail */: { // If a NoSubstitutionTemplateLiteral appears to have a substitution in it, the original text // had to include a backslash: `not \${a} substitution`. - var escapeText = flags & 1 /* NeverAsciiEscape */ || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : + var escapeText = neverAsciiEscape || (getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? escapeString : escapeNonAsciiString; var rawText = node.rawText || escapeTemplateSubstitution(escapeText(node.text, 96 /* backtick */)); switch (node.kind) { @@ -13716,11 +13053,7 @@ var ts; } case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: - return node.text; case 13 /* RegularExpressionLiteral */: - if (flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) { - return node.text + (node.text.charCodeAt(node.text.length - 1) === 92 /* backslash */ ? " /" : "/"); - } return node.text; } return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); @@ -13743,7 +13076,7 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 249 /* VariableDeclaration */ && node.parent.kind === 287 /* CatchClause */; + return node.kind === 246 /* VariableDeclaration */ && node.parent.kind === 284 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { @@ -13775,11 +13108,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 256 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 253 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 297 /* SourceFile */ || - node.kind === 256 /* ModuleDeclaration */ || + return node.kind === 294 /* SourceFile */ || + node.kind === 253 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -13796,9 +13129,9 @@ var ts; // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module switch (node.parent.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: return ts.isExternalModule(node.parent); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -13851,22 +13184,22 @@ var ts; ts.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; function isBlockScope(node, parentNode) { switch (node.kind) { - case 297 /* SourceFile */: - case 258 /* CaseBlock */: - case 287 /* CatchClause */: - case 256 /* ModuleDeclaration */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 294 /* SourceFile */: + case 255 /* CaseBlock */: + case 284 /* CatchClause */: + case 253 /* ModuleDeclaration */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; - case 230 /* Block */: + case 227 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return !ts.isFunctionLike(parentNode); @@ -13876,9 +13209,9 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 313 /* JSDocSignature */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 309 /* JSDocSignature */: return true; default: ts.assertType(node); @@ -13888,25 +13221,25 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isDeclarationWithTypeParameterChildren(node) { switch (node.kind) { - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 308 /* JSDocFunctionType */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 304 /* JSDocFunctionType */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; default: ts.assertType(node); @@ -13916,8 +13249,8 @@ var ts; ts.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; function isAnyImportSyntax(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: return true; default: return false; @@ -13926,15 +13259,15 @@ var ts; ts.isAnyImportSyntax = isAnyImportSyntax; function isLateVisibilityPaintedStatement(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 232 /* VariableStatement */: - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 229 /* VariableStatement */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: return true; default: return false; @@ -13948,7 +13281,7 @@ var ts; // Gets the nearest enclosing block scope container that has the provided node // as a descendant, that is not the provided node. function getEnclosingBlockScopeContainer(node) { - return ts.findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); }); + return findAncestor(node.parent, function (current) { return isBlockScope(current, current.parent); }); } ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; // Return display name of an identifier @@ -13963,7 +13296,7 @@ var ts; } ts.getNameFromIndexInfo = getNameFromIndexInfo; function isComputedNonLiteralName(name) { - return name.kind === 158 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); + return name.kind === 157 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); } ts.isComputedNonLiteralName = isComputedNonLiteralName; function getTextOfPropertyName(name) { @@ -13975,7 +13308,7 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: if (isStringOrNumericLiteralLike(name.expression)) return ts.escapeLeadingUnderscores(name.expression.text); return ts.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames"); @@ -13991,9 +13324,9 @@ var ts; case 79 /* PrivateIdentifier */: case 78 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (ts.isIdentifier(name.name) || ts.isPrivateIdentifier(name.name)) { return entityNameToString(name.expression) + "." + entityNameToString(name.name); } @@ -14034,18 +13367,6 @@ var ts; }; } ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; - function createDiagnosticForFileFromMessageChain(sourceFile, messageChain, relatedInformation) { - return { - file: sourceFile, - start: 0, - length: 0, - code: messageChain.code, - category: messageChain.category, - messageText: messageChain.next ? messageChain : messageChain.messageText, - relatedInformation: relatedInformation - }; - } - ts.createDiagnosticForFileFromMessageChain = createDiagnosticForFileFromMessageChain; function createDiagnosticForRange(sourceFile, range, message) { return { file: sourceFile, @@ -14066,7 +13387,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 230 /* Block */) { + if (node.body && node.body.kind === 227 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -14080,7 +13401,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -14089,28 +13410,28 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 254 /* TypeAliasDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 251 /* TypeAliasDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: errorNode = node.name; break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: var start = ts.skipTrivia(sourceFile.text, node.pos); var end = node.statements.length > 0 ? node.statements[0].pos : node.end; return ts.createTextSpanFromBounds(start, end); @@ -14162,11 +13483,11 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 203 /* CallExpression */ && n.expression.kind === 105 /* SuperKeyword */; + return n.kind === 200 /* CallExpression */ && n.expression.kind === 105 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 203 /* CallExpression */ && n.expression.kind === 99 /* ImportKeyword */; + return n.kind === 200 /* CallExpression */ && n.expression.kind === 99 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isImportMeta(n) { @@ -14180,7 +13501,7 @@ var ts; } ts.isLiteralImportTypeNode = isLiteralImportTypeNode; function isPrologueDirective(node) { - return node.kind === 233 /* ExpressionStatement */ + return node.kind === 230 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -14208,11 +13529,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 160 /* Parameter */ || - node.kind === 159 /* TypeParameter */ || - node.kind === 208 /* FunctionExpression */ || - node.kind === 209 /* ArrowFunction */ || - node.kind === 207 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 159 /* Parameter */ || + node.kind === 158 /* TypeParameter */ || + node.kind === 205 /* FunctionExpression */ || + node.kind === 206 /* ArrowFunction */ || + node.kind === 204 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -14228,48 +13549,48 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (172 /* FirstTypeNode */ <= node.kind && node.kind <= 195 /* LastTypeNode */) { + if (171 /* FirstTypeNode */ <= node.kind && node.kind <= 192 /* LastTypeNode */) { return true; } switch (node.kind) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 147 /* StringKeyword */: + case 151 /* UnknownKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 146 /* StringKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: - case 145 /* ObjectKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: + case 147 /* SymbolKeyword */: + case 144 /* ObjectKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: return true; case 113 /* VoidKeyword */: - return node.parent.kind !== 212 /* VoidExpression */; - case 223 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 209 /* VoidExpression */; + case 220 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); - case 159 /* TypeParameter */: - return node.parent.kind === 190 /* MappedType */ || node.parent.kind === 185 /* InferType */; + case 158 /* TypeParameter */: + return node.parent.kind === 189 /* MappedType */ || node.parent.kind === 184 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 78 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 156 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */ || node.kind === 201 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 78 /* Identifier */ || node.kind === 156 /* QualifiedName */ || node.kind === 198 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 157 /* QualifiedName */: - case 201 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: case 107 /* ThisKeyword */: { var parent = node.parent; - if (parent.kind === 176 /* TypeQuery */) { + if (parent.kind === 175 /* TypeQuery */) { return false; } - if (parent.kind === 195 /* ImportType */) { + if (parent.kind === 192 /* ImportType */) { return !parent.isTypeOf; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -14278,40 +13599,40 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (172 /* FirstTypeNode */ <= parent.kind && parent.kind <= 195 /* LastTypeNode */) { + if (171 /* FirstTypeNode */ <= parent.kind && parent.kind <= 192 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return node === parent.constraint; - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return node === parent.constraint; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 160 /* Parameter */: - case 249 /* VariableDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 159 /* Parameter */: + case 246 /* VariableDeclaration */: return node === parent.type; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return node === parent.type; - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return node === parent.type; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return node === parent.type; - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -14336,23 +13657,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitor(node); - case 258 /* CaseBlock */: - case 230 /* Block */: - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 243 /* WithStatement */: - case 244 /* SwitchStatement */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 245 /* LabeledStatement */: - case 247 /* TryStatement */: - case 287 /* CatchClause */: + case 255 /* CaseBlock */: + case 227 /* Block */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 240 /* WithStatement */: + case 241 /* SwitchStatement */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 242 /* LabeledStatement */: + case 244 /* TryStatement */: + case 284 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -14362,23 +13683,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 255 /* EnumDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, skip them to avoid the work. return; default: if (ts.isFunctionLike(node)) { - if (node.name && node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 157 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. traverse(node.name.expression); @@ -14401,10 +13722,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 178 /* ArrayType */) { + if (node && node.kind === 177 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 173 /* TypeReference */) { + else if (node && node.kind === 172 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -14414,12 +13735,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 177 /* TypeLiteral */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 176 /* TypeLiteral */: return node.members; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return node.properties; } } @@ -14427,14 +13748,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 198 /* BindingElement */: - case 291 /* EnumMember */: - case 160 /* Parameter */: - case 288 /* PropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 289 /* ShorthandPropertyAssignment */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 288 /* EnumMember */: + case 159 /* Parameter */: + case 285 /* PropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 286 /* ShorthandPropertyAssignment */: + case 246 /* VariableDeclaration */: return true; } } @@ -14446,8 +13767,8 @@ var ts; } ts.isVariableLikeOrAccessor = isVariableLikeOrAccessor; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 250 /* VariableDeclarationList */ - && node.parent.parent.kind === 232 /* VariableStatement */; + return node.parent.kind === 247 /* VariableDeclarationList */ + && node.parent.parent.kind === 229 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -14458,13 +13779,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return true; } return false; @@ -14475,7 +13796,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 245 /* LabeledStatement */) { + if (node.statement.kind !== 242 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -14483,17 +13804,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 230 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 227 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 165 /* MethodDeclaration */ && node.parent.kind === 200 /* ObjectLiteralExpression */; + return node && node.kind === 164 /* MethodDeclaration */ && node.parent.kind === 197 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 165 /* MethodDeclaration */ && - (node.parent.kind === 200 /* ObjectLiteralExpression */ || - node.parent.kind === 221 /* ClassExpression */); + return node.kind === 164 /* MethodDeclaration */ && + (node.parent.kind === 197 /* ObjectLiteralExpression */ || + node.parent.kind === 218 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -14506,7 +13827,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return objectLiteral.properties.filter(function (property) { - if (property.kind === 288 /* PropertyAssignment */) { + if (property.kind === 285 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (!!key2 && key2 === propName); } @@ -14535,26 +13856,26 @@ var ts; } ts.getTsConfigPropArray = getTsConfigPropArray; function getContainingFunction(node) { - return ts.findAncestor(node.parent, ts.isFunctionLike); + return findAncestor(node.parent, ts.isFunctionLike); } ts.getContainingFunction = getContainingFunction; function getContainingFunctionDeclaration(node) { - return ts.findAncestor(node.parent, ts.isFunctionLikeDeclaration); + return findAncestor(node.parent, ts.isFunctionLikeDeclaration); } ts.getContainingFunctionDeclaration = getContainingFunctionDeclaration; function getContainingClass(node) { - return ts.findAncestor(node.parent, ts.isClassLike); + return findAncestor(node.parent, ts.isClassLike); } ts.getContainingClass = getContainingClass; function getThisContainer(node, includeArrowFunctions) { - ts.Debug.assert(node.kind !== 297 /* SourceFile */); + ts.Debug.assert(node.kind !== 294 /* SourceFile */); while (true) { node = node.parent; if (!node) { return ts.Debug.fail(); // If we never pass in a SourceFile, this should be unreachable, since we'll stop when we reach that. } switch (node.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -14569,9 +13890,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 159 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14582,26 +13903,26 @@ var ts; node = node.parent; } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 256 /* ModuleDeclaration */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 255 /* EnumDeclaration */: - case 297 /* SourceFile */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 253 /* ModuleDeclaration */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 252 /* EnumDeclaration */: + case 294 /* SourceFile */: return node; } } @@ -14620,9 +13941,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: return container; } } @@ -14644,27 +13965,27 @@ var ts; return node; } switch (node.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: node = node.parent; break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return node; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 160 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 159 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -14680,14 +14001,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 208 /* FunctionExpression */ || func.kind === 209 /* ArrowFunction */) { + if (func.kind === 205 /* FunctionExpression */ || func.kind === 206 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 207 /* ParenthesizedExpression */) { + while (parent.kind === 204 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 203 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 200 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -14703,7 +14024,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */) + return (kind === 198 /* PropertyAccessExpression */ || kind === 199 /* ElementAccessExpression */) && node.expression.kind === 105 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -14712,26 +14033,21 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 201 /* PropertyAccessExpression */ || kind === 202 /* ElementAccessExpression */) + return (kind === 198 /* PropertyAccessExpression */ || kind === 199 /* ElementAccessExpression */) && node.expression.kind === 107 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; - function isThisInitializedDeclaration(node) { - var _a; - return !!node && ts.isVariableDeclaration(node) && ((_a = node.initializer) === null || _a === void 0 ? void 0 : _a.kind) === 107 /* ThisKeyword */; - } - ts.isThisInitializedDeclaration = isThisInitializedDeclaration; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 78 /* Identifier */: - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return node; } return undefined; @@ -14739,10 +14055,10 @@ var ts; ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { switch (node.kind) { - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return node.tag; - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return node.tagName; default: return node.expression; @@ -14755,25 +14071,25 @@ var ts; return false; } switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: // classes are valid targets return true; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 252 /* ClassDeclaration */; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + return parent.kind === 249 /* ClassDeclaration */; + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 252 /* ClassDeclaration */; - case 160 /* Parameter */: + && parent.kind === 249 /* ClassDeclaration */; + case 159 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 166 /* Constructor */ - || parent.kind === 165 /* MethodDeclaration */ - || parent.kind === 168 /* SetAccessor */) - && grandparent.kind === 252 /* ClassDeclaration */; + && (parent.kind === 165 /* Constructor */ + || parent.kind === 164 /* MethodDeclaration */ + || parent.kind === 167 /* SetAccessor */) + && grandparent.kind === 249 /* ClassDeclaration */; } return false; } @@ -14789,10 +14105,10 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return ts.some(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); // TODO: GH#18217 - case 165 /* MethodDeclaration */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 167 /* SetAccessor */: return ts.some(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); // TODO: GH#18217 default: return false; @@ -14801,9 +14117,9 @@ var ts; ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 275 /* JsxOpeningElement */ || - parent.kind === 274 /* JsxSelfClosingElement */ || - parent.kind === 276 /* JsxClosingElement */) { + if (parent.kind === 272 /* JsxOpeningElement */ || + parent.kind === 271 /* JsxSelfClosingElement */ || + parent.kind === 273 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -14816,44 +14132,44 @@ var ts; case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: case 13 /* RegularExpressionLiteral */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 224 /* AsExpression */: - case 206 /* TypeAssertionExpression */: - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: - case 209 /* ArrowFunction */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 211 /* TypeOfExpression */: - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: - case 216 /* BinaryExpression */: - case 217 /* ConditionalExpression */: - case 220 /* SpreadElement */: - case 218 /* TemplateExpression */: - case 222 /* OmittedExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: - case 219 /* YieldExpression */: - case 213 /* AwaitExpression */: - case 226 /* MetaProperty */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 221 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 208 /* TypeOfExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 213 /* BinaryExpression */: + case 214 /* ConditionalExpression */: + case 217 /* SpreadElement */: + case 215 /* TemplateExpression */: + case 219 /* OmittedExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: + case 216 /* YieldExpression */: + case 210 /* AwaitExpression */: + case 223 /* MetaProperty */: return true; - case 157 /* QualifiedName */: - while (node.parent.kind === 157 /* QualifiedName */) { + case 156 /* QualifiedName */: + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 175 /* TypeQuery */ || isJSXTagName(node); case 78 /* Identifier */: - if (node.parent.kind === 176 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 175 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -14871,49 +14187,49 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 291 /* EnumMember */: - case 288 /* PropertyAssignment */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 288 /* EnumMember */: + case 285 /* PropertyAssignment */: + case 195 /* BindingElement */: return parent.initializer === node; - case 233 /* ExpressionStatement */: - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 242 /* ReturnStatement */: - case 243 /* WithStatement */: - case 244 /* SwitchStatement */: - case 284 /* CaseClause */: - case 246 /* ThrowStatement */: + case 230 /* ExpressionStatement */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 239 /* ReturnStatement */: + case 240 /* WithStatement */: + case 241 /* SwitchStatement */: + case 281 /* CaseClause */: + case 243 /* ThrowStatement */: return parent.expression === node; - case 237 /* ForStatement */: + case 234 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 250 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 247 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 250 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 247 /* VariableDeclarationList */) || forInStatement.expression === node; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return node === parent.expression; - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return node === parent.expression; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return node === parent.expression; - case 161 /* Decorator */: - case 283 /* JsxExpression */: - case 282 /* JsxSpreadAttribute */: - case 290 /* SpreadAssignment */: + case 160 /* Decorator */: + case 280 /* JsxExpression */: + case 279 /* JsxSpreadAttribute */: + case 287 /* SpreadAssignment */: return true; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return parent.objectAssignmentInitializer === node; default: return isExpressionNode(parent); @@ -14921,14 +14237,14 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isPartOfTypeQuery(node) { - while (node.kind === 157 /* QualifiedName */ || node.kind === 78 /* Identifier */) { + while (node.kind === 156 /* QualifiedName */ || node.kind === 78 /* Identifier */) { node = node.parent; } - return node.kind === 176 /* TypeQuery */; + return node.kind === 175 /* TypeQuery */; } ts.isPartOfTypeQuery = isPartOfTypeQuery; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 272 /* ExternalModuleReference */; + return node.kind === 257 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 269 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -14936,13 +14252,8 @@ var ts; return node.moduleReference.expression; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; - function getExternalModuleRequireArgument(node) { - return isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true) - && getLeftmostAccessExpression(node.initializer).arguments[0]; - } - ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 272 /* ExternalModuleReference */; + return node.kind === 257 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 269 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJS(file) { @@ -14974,11 +14285,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 147 /* StringKeyword */ || node.typeArguments[0].kind === 144 /* NumberKeyword */); + (node.typeArguments[0].kind === 146 /* StringKeyword */ || node.typeArguments[0].kind === 143 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, requireStringLiteralLikeArgument) { - if (callExpression.kind !== 203 /* CallExpression */) { + if (callExpression.kind !== 200 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -14993,10 +14304,7 @@ var ts; } ts.isRequireCall = isRequireCall; function isRequireVariableDeclaration(node, requireStringLiteralLikeArgument) { - if (node.kind === 198 /* BindingElement */) { - node = node.parent.parent; - } - return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(getLeftmostAccessExpression(node.initializer), requireStringLiteralLikeArgument); + return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(node.initializer, requireStringLiteralLikeArgument); } ts.isRequireVariableDeclaration = isRequireVariableDeclaration; function isRequireVariableStatement(node, requireStringLiteralLikeArgument) { @@ -15014,6 +14322,46 @@ var ts; return getSourceTextOfNodeFromSourceFile(sourceFile, str).charCodeAt(0) === 34 /* doubleQuote */; } ts.isStringDoubleQuoted = isStringDoubleQuoted; + function getDeclarationOfExpando(node) { + if (!node.parent) { + return undefined; + } + var name; + var decl; + if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) { + if (!isInJSFile(node) && !isVarConst(node.parent)) { + return undefined; + } + name = node.parent.name; + decl = node.parent; + } + else if (ts.isBinaryExpression(node.parent)) { + var parentNode = node.parent; + var parentNodeOperator = node.parent.operatorToken.kind; + if (parentNodeOperator === 62 /* EqualsToken */ && parentNode.right === node) { + name = parentNode.left; + decl = name; + } + else if (parentNodeOperator === 56 /* BarBarToken */ || parentNodeOperator === 60 /* QuestionQuestionToken */) { + if (ts.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { + name = parentNode.parent.name; + decl = parentNode.parent; + } + else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 /* EqualsToken */ && parentNode.parent.right === parentNode) { + name = parentNode.parent.left; + decl = name; + } + if (!name || !isBindableStaticNameExpression(name) || !isSameEntityName(name, parentNode.left)) { + return undefined; + } + } + } + if (!name || !getExpandoInitializer(node, isPrototypeAccess(name))) { + return undefined; + } + return decl; + } + ts.getDeclarationOfExpando = getDeclarationOfExpando; function isAssignmentDeclaration(decl) { return ts.isBinaryExpression(decl) || isAccessExpression(decl) || ts.isIdentifier(decl) || ts.isCallExpression(decl); } @@ -15075,11 +14423,11 @@ var ts; function getExpandoInitializer(initializer, isPrototypeAssignment) { if (ts.isCallExpression(initializer)) { var e = skipParentheses(initializer.expression); - return e.kind === 208 /* FunctionExpression */ || e.kind === 209 /* ArrowFunction */ ? initializer : undefined; + return e.kind === 205 /* FunctionExpression */ || e.kind === 206 /* ArrowFunction */ ? initializer : undefined; } - if (initializer.kind === 208 /* FunctionExpression */ || - initializer.kind === 221 /* ClassExpression */ || - initializer.kind === 209 /* ArrowFunction */) { + if (initializer.kind === 205 /* FunctionExpression */ || + initializer.kind === 218 /* ClassExpression */ || + initializer.kind === 206 /* ArrowFunction */) { return initializer; } if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { @@ -15154,7 +14502,6 @@ var ts; } return false; } - ts.isSameEntityName = isSameEntityName; function getRightMostAssignedExpression(node) { while (isAssignmentExpression(node, /*excludeCompoundAssignments*/ true)) { node = node.right; @@ -15333,7 +14680,7 @@ var ts; ts.isPrototypePropertyAssignment = isPrototypePropertyAssignment; function isSpecialPropertyDeclaration(expr) { return isInJSFile(expr) && - expr.parent && expr.parent.kind === 233 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 230 /* ExpressionStatement */ && (!ts.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts.getJSDocTypeTag(expr.parent); } @@ -15354,7 +14701,7 @@ var ts; return false; } var decl = symbol.valueDeclaration; - return decl.kind === 251 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); + return decl.kind === 248 /* FunctionDeclaration */ || ts.isVariableDeclaration(decl) && decl.initializer && ts.isFunctionLike(decl.initializer); } ts.isFunctionSymbol = isFunctionSymbol; function importFromModuleSpecifier(node) { @@ -15363,14 +14710,14 @@ var ts; ts.importFromModuleSpecifier = importFromModuleSpecifier; function tryGetImportFromModuleSpecifier(node) { switch (node.parent.kind) { - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return node.parent; - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return node.parent.parent; - case 203 /* CallExpression */: + case 200 /* CallExpression */: return isImportCall(node.parent) || isRequireCall(node.parent, /*checkArg*/ false) ? node.parent : undefined; - case 191 /* LiteralType */: + case 190 /* LiteralType */: ts.Debug.assert(ts.isStringLiteral(node)); return ts.tryCast(node.parent.parent, ts.isImportTypeNode); default: @@ -15380,12 +14727,12 @@ var ts; ts.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; function getExternalModuleName(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return node.moduleSpecifier; - case 260 /* ImportEqualsDeclaration */: - return node.moduleReference.kind === 272 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; - case 195 /* ImportType */: + case 257 /* ImportEqualsDeclaration */: + return node.moduleReference.kind === 269 /* ExternalModuleReference */ ? node.moduleReference.expression : undefined; + case 192 /* ImportType */: return isLiteralImportTypeNode(node) ? node.argument.literal : undefined; default: return ts.Debug.assertNever(node); @@ -15394,11 +14741,11 @@ var ts; ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return node.exportClause && ts.tryCast(node.exportClause, ts.isNamespaceExport); default: return ts.Debug.assertNever(node); @@ -15406,7 +14753,7 @@ var ts; } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 261 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; + return node.kind === 258 /* ImportDeclaration */ && !!node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function forEachImportClauseDeclaration(node, action) { @@ -15427,13 +14774,13 @@ var ts; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 160 /* Parameter */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 289 /* ShorthandPropertyAssignment */: - case 288 /* PropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 159 /* Parameter */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 286 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -15447,7 +14794,7 @@ var ts; } ts.isJSDocConstructSignature = isJSDocConstructSignature; function isJSDocTypeAlias(node) { - return node.kind === 331 /* JSDocTypedefTag */ || node.kind === 324 /* JSDocCallbackTag */ || node.kind === 325 /* JSDocEnumTag */; + return node.kind === 327 /* JSDocTypedefTag */ || node.kind === 320 /* JSDocCallbackTag */ || node.kind === 321 /* JSDocEnumTag */; } ts.isJSDocTypeAlias = isJSDocTypeAlias; function isTypeAlias(node) { @@ -15472,12 +14819,12 @@ var ts; } function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: var v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return node.initializer; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return node.initializer; } } @@ -15489,7 +14836,7 @@ var ts; function getNestedModuleDeclaration(node) { return ts.isModuleDeclaration(node) && node.body && - node.body.kind === 256 /* ModuleDeclaration */ + node.body.kind === 253 /* ModuleDeclaration */ ? node.body : undefined; } @@ -15504,11 +14851,11 @@ var ts; if (ts.hasJSDocNodes(node)) { result = ts.append(result, ts.last(node.jsDoc)); } - if (node.kind === 160 /* Parameter */) { + if (node.kind === 159 /* Parameter */) { result = ts.addRange(result, (noCache ? ts.getJSDocParameterTagsNoCache : ts.getJSDocParameterTags)(node)); break; } - if (node.kind === 159 /* TypeParameter */) { + if (node.kind === 158 /* TypeParameter */) { result = ts.addRange(result, (noCache ? ts.getJSDocTypeParameterTagsNoCache : ts.getJSDocTypeParameterTags)(node)); break; } @@ -15519,10 +14866,10 @@ var ts; ts.getJSDocCommentsAndTags = getJSDocCommentsAndTags; function getNextJSDocCommentLocation(node) { var parent = node.parent; - if (parent.kind === 288 /* PropertyAssignment */ || - parent.kind === 266 /* ExportAssignment */ || - parent.kind === 163 /* PropertyDeclaration */ || - parent.kind === 233 /* ExpressionStatement */ && node.kind === 201 /* PropertyAccessExpression */ || + if (parent.kind === 285 /* PropertyAssignment */ || + parent.kind === 263 /* ExportAssignment */ || + parent.kind === 162 /* PropertyDeclaration */ || + parent.kind === 230 /* ExpressionStatement */ && node.kind === 198 /* PropertyAccessExpression */ || getNestedModuleDeclaration(parent) || ts.isBinaryExpression(node) && node.operatorToken.kind === 62 /* EqualsToken */) { return parent; @@ -15580,7 +14927,7 @@ var ts; ts.getEffectiveJSDocHost = getEffectiveJSDocHost; /** Use getEffectiveJSDocHost if you additionally need to look for jsdoc on parent nodes, like assignments. */ function getJSDocHost(node) { - return ts.Debug.checkDefined(ts.findAncestor(node.parent, ts.isJSDoc)).parent; + return ts.Debug.checkDefined(findAncestor(node.parent, ts.isJSDoc)).parent; } ts.getJSDocHost = getJSDocHost; function getTypeParameterFromJsDoc(node) { @@ -15596,7 +14943,7 @@ var ts; ts.hasRestParameter = hasRestParameter; function isRestParameter(node) { var type = ts.isJSDocParameterTag(node) ? (node.typeExpression && node.typeExpression.type) : node.type; - return node.dotDotDotToken !== undefined || !!type && type.kind === 309 /* JSDocVariadicType */; + return node.dotDotDotToken !== undefined || !!type && type.kind === 305 /* JSDocVariadicType */; } ts.isRestParameter = isRestParameter; function hasTypeArguments(node) { @@ -15613,31 +14960,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 62 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 207 /* ParenthesizedExpression */: - case 199 /* ArrayLiteralExpression */: - case 220 /* SpreadElement */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 196 /* ArrayLiteralExpression */: + case 217 /* SpreadElement */: + case 222 /* NonNullExpression */: node = parent; break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -15664,22 +15011,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 230 /* Block */: - case 232 /* VariableStatement */: - case 243 /* WithStatement */: - case 234 /* IfStatement */: - case 244 /* SwitchStatement */: - case 258 /* CaseBlock */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 245 /* LabeledStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 247 /* TryStatement */: - case 287 /* CatchClause */: + case 227 /* Block */: + case 229 /* VariableStatement */: + case 240 /* WithStatement */: + case 231 /* IfStatement */: + case 241 /* SwitchStatement */: + case 255 /* CaseBlock */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 242 /* LabeledStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 244 /* TryStatement */: + case 284 /* CatchClause */: return true; } return false; @@ -15696,44 +15043,30 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 186 /* ParenthesizedType */); + return walkUp(node, 185 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 207 /* ParenthesizedExpression */); + return walkUp(node, 204 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; - /** - * Walks up parenthesized types. - * It returns both the outermost parenthesized type and its parent. - * If given node is not a parenthesiezd type, undefined is return as the former. - */ - function walkUpParenthesizedTypesAndGetParentAndChild(node) { - var child; - while (node && node.kind === 186 /* ParenthesizedType */) { - child = node; - node = node.parent; - } - return [child, node]; - } - ts.walkUpParenthesizedTypesAndGetParentAndChild = walkUpParenthesizedTypesAndGetParentAndChild; function skipParentheses(node) { return ts.skipOuterExpressions(node, 1 /* Parentheses */); } ts.skipParentheses = skipParentheses; function skipParenthesesUp(node) { - while (node.kind === 207 /* ParenthesizedExpression */) { + while (node.kind === 204 /* ParenthesizedExpression */) { node = node.parent; } return node; } // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 201 /* PropertyAccessExpression */ && node.kind !== 202 /* ElementAccessExpression */) { + if (node.kind !== 198 /* PropertyAccessExpression */ && node.kind !== 199 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 210 /* DeleteExpression */; + return node && node.kind === 207 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -15786,7 +15119,7 @@ var ts; ts.getDeclarationFromName = getDeclarationFromName; function isLiteralComputedPropertyDeclarationName(node) { return isStringOrNumericLiteralLike(node) && - node.parent.kind === 158 /* ComputedPropertyName */ && + node.parent.kind === 157 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -15794,26 +15127,26 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 291 /* EnumMember */: - case 288 /* PropertyAssignment */: - case 201 /* PropertyAccessExpression */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 288 /* EnumMember */: + case 285 /* PropertyAssignment */: + case 198 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: // Name on right hand side of dot in a type query or type reference return parent.right === node; - case 198 /* BindingElement */: - case 265 /* ImportSpecifier */: + case 195 /* BindingElement */: + case 262 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 270 /* ExportSpecifier */: - case 280 /* JsxAttribute */: + case 267 /* ExportSpecifier */: + case 277 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -15833,33 +15166,33 @@ var ts; // {} // {name: } function isAliasSymbolDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ || - node.kind === 259 /* NamespaceExportDeclaration */ || - node.kind === 262 /* ImportClause */ && !!node.name || - node.kind === 263 /* NamespaceImport */ || - node.kind === 269 /* NamespaceExport */ || - node.kind === 265 /* ImportSpecifier */ || - node.kind === 270 /* ExportSpecifier */ || - node.kind === 266 /* ExportAssignment */ && exportAssignmentIsAlias(node) || + return node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 256 /* NamespaceExportDeclaration */ || + node.kind === 259 /* ImportClause */ && !!node.name || + node.kind === 260 /* NamespaceImport */ || + node.kind === 266 /* NamespaceExport */ || + node.kind === 262 /* ImportSpecifier */ || + node.kind === 267 /* ExportSpecifier */ || + node.kind === 263 /* ExportAssignment */ && exportAssignmentIsAlias(node) || ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && exportAssignmentIsAlias(node) || ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ && isAliasableExpression(node.parent.right) || - node.kind === 289 /* ShorthandPropertyAssignment */ || - node.kind === 288 /* PropertyAssignment */ && isAliasableExpression(node.initializer); + node.kind === 286 /* ShorthandPropertyAssignment */ || + node.kind === 285 /* PropertyAssignment */ && isAliasableExpression(node.initializer); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function getAliasDeclarationFromName(node) { switch (node.parent.kind) { - case 262 /* ImportClause */: - case 265 /* ImportSpecifier */: - case 263 /* NamespaceImport */: - case 270 /* ExportSpecifier */: - case 266 /* ExportAssignment */: - case 260 /* ImportEqualsDeclaration */: + case 259 /* ImportClause */: + case 262 /* ImportSpecifier */: + case 260 /* NamespaceImport */: + case 267 /* ExportSpecifier */: + case 263 /* ExportAssignment */: + case 257 /* ImportEqualsDeclaration */: return node.parent; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.parent; - } while (node.parent.kind === 157 /* QualifiedName */); + } while (node.parent.kind === 156 /* QualifiedName */); return getAliasDeclarationFromName(node); } } @@ -15878,7 +15211,7 @@ var ts; } ts.getExportAssignmentExpression = getExportAssignmentExpression; function getPropertyAssignmentAliasLikeExpression(node) { - return node.kind === 289 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 288 /* PropertyAssignment */ ? node.initializer : + return node.kind === 286 /* ShorthandPropertyAssignment */ ? node.name : node.kind === 285 /* PropertyAssignment */ ? node.initializer : node.parent.right; } ts.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; @@ -15944,11 +15277,11 @@ var ts; } ts.getAncestor = getAncestor; function isKeyword(token) { - return 80 /* FirstKeyword */ <= token && token <= 156 /* LastKeyword */; + return 80 /* FirstKeyword */ <= token && token <= 155 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 125 /* FirstContextualKeyword */ <= token && token <= 156 /* LastContextualKeyword */; + return 125 /* FirstContextualKeyword */ <= token && token <= 155 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -15992,14 +15325,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 164 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: if (hasSyntacticModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -16013,10 +15346,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasSyntacticModifier(node, 256 /* Async */); @@ -16049,7 +15382,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - if (!(name.kind === 158 /* ComputedPropertyName */ || name.kind === 202 /* ElementAccessExpression */)) { + if (!(name.kind === 157 /* ComputedPropertyName */ || name.kind === 199 /* ElementAccessExpression */)) { return false; } var expr = ts.isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression; @@ -16075,7 +15408,7 @@ var ts; case 10 /* StringLiteral */: case 8 /* NumericLiteral */: return ts.escapeLeadingUnderscores(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -16144,11 +15477,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 160 /* Parameter */; + return root.kind === 159 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 198 /* BindingElement */) { + while (node.kind === 195 /* BindingElement */) { node = node.parent.parent; } return node; @@ -16156,15 +15489,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 166 /* Constructor */ - || kind === 208 /* FunctionExpression */ - || kind === 251 /* FunctionDeclaration */ - || kind === 209 /* ArrowFunction */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 256 /* ModuleDeclaration */ - || kind === 297 /* SourceFile */; + return kind === 165 /* Constructor */ + || kind === 205 /* FunctionExpression */ + || kind === 248 /* FunctionDeclaration */ + || kind === 206 /* ArrowFunction */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 253 /* ModuleDeclaration */ + || kind === 294 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -16183,23 +15516,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 201 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 204 /* NewExpression */: + case 201 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 214 /* PrefixUnaryExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 213 /* AwaitExpression */: - case 217 /* ConditionalExpression */: - case 219 /* YieldExpression */: + case 211 /* PrefixUnaryExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 210 /* AwaitExpression */: + case 214 /* ConditionalExpression */: + case 216 /* YieldExpression */: return 1 /* Right */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (operator) { case 42 /* AsteriskAsteriskToken */: case 62 /* EqualsToken */: @@ -16226,15 +15559,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 204 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 201 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 216 /* BinaryExpression */) { + if (expression.kind === 213 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 214 /* PrefixUnaryExpression */ || expression.kind === 215 /* PostfixUnaryExpression */) { + else if (expression.kind === 211 /* PrefixUnaryExpression */ || expression.kind === 212 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -16413,15 +15746,15 @@ var ts; })(OperatorPrecedence = ts.OperatorPrecedence || (ts.OperatorPrecedence = {})); function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { switch (nodeKind) { - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return 0 /* Comma */; - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return 1 /* Spread */; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return 2 /* Yield */; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return 4 /* Conditional */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (operatorKind) { case 27 /* CommaToken */: return 0 /* Comma */; @@ -16447,21 +15780,21 @@ var ts; } // TODO: Should prefix `++` and `--` be moved to the `Update` precedence? // TODO: We are missing `TypeAssertionExpression` - case 214 /* PrefixUnaryExpression */: - case 211 /* TypeOfExpression */: - case 212 /* VoidExpression */: - case 210 /* DeleteExpression */: - case 213 /* AwaitExpression */: + case 211 /* PrefixUnaryExpression */: + case 208 /* TypeOfExpression */: + case 209 /* VoidExpression */: + case 207 /* DeleteExpression */: + case 210 /* AwaitExpression */: return 16 /* Unary */; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return 17 /* Update */; - case 203 /* CallExpression */: + case 200 /* CallExpression */: return 18 /* LeftHandSide */; - case 204 /* NewExpression */: + case 201 /* NewExpression */: return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */; - case 205 /* TaggedTemplateExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 202 /* TaggedTemplateExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return 19 /* Member */; case 107 /* ThisKeyword */: case 105 /* SuperKeyword */: @@ -16472,19 +15805,19 @@ var ts; case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 221 /* ClassExpression */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 218 /* ClassExpression */: case 13 /* RegularExpressionLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: - case 218 /* TemplateExpression */: - case 207 /* ParenthesizedExpression */: - case 222 /* OmittedExpression */: - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: + case 215 /* TemplateExpression */: + case 204 /* ParenthesizedExpression */: + case 219 /* OmittedExpression */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: return 20 /* Primary */; default: return -1 /* Invalid */; @@ -16537,19 +15870,6 @@ var ts; return -1; } ts.getBinaryOperatorPrecedence = getBinaryOperatorPrecedence; - function getSemanticJsxChildren(children) { - return ts.filter(children, function (i) { - switch (i.kind) { - case 283 /* JsxExpression */: - return !!i.expression; - case 11 /* JsxText */: - return !i.containsOnlyTriviaWhiteSpaces; - default: - return true; - } - }); - } - ts.getSemanticJsxChildren = getSemanticJsxChildren; function createDiagnosticCollection() { var nonFileDiagnostics = []; // See GH#19873 var filesWithDiagnostics = []; @@ -16744,10 +16064,8 @@ var ts; ts.isIntrinsicJsxName = isIntrinsicJsxName; var indentStrings = ["", " "]; function getIndentString(level) { - // prepopulate cache - var singleLevel = indentStrings[1]; - for (var current = indentStrings.length; current <= level; current++) { - indentStrings.push(indentStrings[current - 1] + singleLevel); + if (indentStrings[level] === undefined) { + indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; } return indentStrings[level]; } @@ -16986,14 +16304,6 @@ var ts; return options.outFile || options.out; } ts.outFile = outFile; - /** Returns 'undefined' if and only if 'options.paths' is undefined. */ - function getPathsBasePath(options, host) { - var _a, _b; - if (!options.paths) - return undefined; - return (_a = options.baseUrl) !== null && _a !== void 0 ? _a : ts.Debug.checkDefined(options.pathsBasePath || ((_b = host.getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(host)), "Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'."); - } - ts.getPathsBasePath = getPathsBasePath; /** * Gets the source files that are expected to have an emit output. * @@ -17122,10 +16432,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 167 /* GetAccessor */) { + if (accessor.kind === 166 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 168 /* SetAccessor */) { + else if (accessor.kind === 167 /* SetAccessor */) { setAccessor = accessor; } else { @@ -17145,10 +16455,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 167 /* GetAccessor */ && !getAccessor) { + if (member.kind === 166 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 168 /* SetAccessor */ && !setAccessor) { + if (member.kind === 167 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -17197,7 +16507,7 @@ var ts; ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** template tags are only available when a typedef isn't already using them */ function isNonTypeAliasTemplate(tag) { - return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 311 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); + return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 307 /* JSDocComment */ && tag.parent.tags.some(isJSDocTypeAlias)); } /** * Gets the effective type annotation of the value parameter of a set accessor. If the node @@ -17433,7 +16743,7 @@ var ts; } ts.getSelectedSyntacticModifierFlags = getSelectedSyntacticModifierFlags; function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) { - if (node.kind >= 0 /* FirstToken */ && node.kind <= 156 /* LastToken */) { + if (node.kind >= 0 /* FirstToken */ && node.kind <= 155 /* LastToken */) { return 0 /* None */; } if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) { @@ -17529,7 +16839,7 @@ var ts; case 84 /* ConstKeyword */: return 2048 /* Const */; case 87 /* DefaultKeyword */: return 512 /* Default */; case 129 /* AsyncKeyword */: return 256 /* Async */; - case 142 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 141 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -17579,8 +16889,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 200 /* ObjectLiteralExpression */ - || kind === 199 /* ArrayLiteralExpression */; + return kind === 197 /* ObjectLiteralExpression */ + || kind === 196 /* ArrayLiteralExpression */; } return false; } @@ -17597,12 +16907,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.left; } while (node.kind !== 78 /* Identifier */); return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 78 /* Identifier */); @@ -17612,8 +16922,8 @@ var ts; ts.getFirstIdentifier = getFirstIdentifier; function isDottedName(node) { return node.kind === 78 /* Identifier */ || node.kind === 107 /* ThisKeyword */ || node.kind === 105 /* SuperKeyword */ || - node.kind === 201 /* PropertyAccessExpression */ && isDottedName(node.expression) || - node.kind === 207 /* ParenthesizedExpression */ && isDottedName(node.expression); + node.kind === 198 /* PropertyAccessExpression */ && isDottedName(node.expression) || + node.kind === 204 /* ParenthesizedExpression */ && isDottedName(node.expression); } ts.isDottedName = isDottedName; function isPropertyAccessEntityNameExpression(node) { @@ -17638,17 +16948,17 @@ var ts; } ts.isPrototypeAccess = isPrototypeAccess; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 157 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 156 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 200 /* ObjectLiteralExpression */ && + return expression.kind === 197 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 199 /* ArrayLiteralExpression */ && + return expression.kind === 196 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -17980,8 +17290,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 255 /* EnumDeclaration */: - case 256 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -18058,35 +17368,35 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return accessKind(parent); - case 215 /* PostfixUnaryExpression */: - case 214 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 62 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); - case 288 /* PropertyAssignment */: { + case 285 /* PropertyAssignment */: { var parentAccess = accessKind(parent.parent); // In `({ x: varname }) = { x: 1 }`, the left `x` is a read, the right `x` is a write. return node === parent.name ? reverseAccessKind(parentAccess) : parentAccess; } - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: // Assume it's the local variable being accessed, since we don't check public properties for --noUnusedLocals. return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && skipParenthesesUp(parent.parent).kind === 233 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && skipParenthesesUp(parent.parent).kind === 230 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function reverseAccessKind(a) { @@ -18235,37 +17545,37 @@ var ts; } ts.isObjectTypeDeclaration = isObjectTypeDeclaration; function isTypeNodeKind(kind) { - return (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */) + return (kind >= 171 /* FirstTypeNode */ && kind <= 192 /* LastTypeNode */) || kind === 128 /* AnyKeyword */ - || kind === 152 /* UnknownKeyword */ - || kind === 144 /* NumberKeyword */ - || kind === 155 /* BigIntKeyword */ - || kind === 145 /* ObjectKeyword */ + || kind === 151 /* UnknownKeyword */ + || kind === 143 /* NumberKeyword */ + || kind === 154 /* BigIntKeyword */ + || kind === 144 /* ObjectKeyword */ || kind === 131 /* BooleanKeyword */ - || kind === 147 /* StringKeyword */ - || kind === 148 /* SymbolKeyword */ + || kind === 146 /* StringKeyword */ + || kind === 147 /* SymbolKeyword */ || kind === 113 /* VoidKeyword */ - || kind === 150 /* UndefinedKeyword */ - || kind === 141 /* NeverKeyword */ - || kind === 223 /* ExpressionWithTypeArguments */ - || kind === 303 /* JSDocAllType */ - || kind === 304 /* JSDocUnknownType */ - || kind === 305 /* JSDocNullableType */ - || kind === 306 /* JSDocNonNullableType */ - || kind === 307 /* JSDocOptionalType */ - || kind === 308 /* JSDocFunctionType */ - || kind === 309 /* JSDocVariadicType */; + || kind === 149 /* UndefinedKeyword */ + || kind === 140 /* NeverKeyword */ + || kind === 220 /* ExpressionWithTypeArguments */ + || kind === 299 /* JSDocAllType */ + || kind === 300 /* JSDocUnknownType */ + || kind === 301 /* JSDocNullableType */ + || kind === 302 /* JSDocNonNullableType */ + || kind === 303 /* JSDocOptionalType */ + || kind === 304 /* JSDocFunctionType */ + || kind === 305 /* JSDocVariadicType */; } ts.isTypeNodeKind = isTypeNodeKind; function isAccessExpression(node) { - return node.kind === 201 /* PropertyAccessExpression */ || node.kind === 202 /* ElementAccessExpression */; + return node.kind === 198 /* PropertyAccessExpression */ || node.kind === 199 /* ElementAccessExpression */; } ts.isAccessExpression = isAccessExpression; function getNameOfAccessExpression(node) { - if (node.kind === 201 /* PropertyAccessExpression */) { + if (node.kind === 198 /* PropertyAccessExpression */) { return node.name; } - ts.Debug.assert(node.kind === 202 /* ElementAccessExpression */); + ts.Debug.assert(node.kind === 199 /* ElementAccessExpression */); return node.argumentExpression; } ts.getNameOfAccessExpression = getNameOfAccessExpression; @@ -18280,41 +17590,34 @@ var ts; } ts.isBundleFileTextLike = isBundleFileTextLike; function isNamedImportsOrExports(node) { - return node.kind === 264 /* NamedImports */ || node.kind === 268 /* NamedExports */; + return node.kind === 261 /* NamedImports */ || node.kind === 265 /* NamedExports */; } ts.isNamedImportsOrExports = isNamedImportsOrExports; - function getLeftmostAccessExpression(expr) { - while (isAccessExpression(expr)) { - expr = expr.expression; - } - return expr; - } - ts.getLeftmostAccessExpression = getLeftmostAccessExpression; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: node = node.operand; continue; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: node = node.left; continue; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: node = node.condition; continue; - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: node = node.tag; continue; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 224 /* AsExpression */: - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: - case 225 /* NonNullExpression */: - case 336 /* PartiallyEmittedExpression */: + case 221 /* AsExpression */: + case 199 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 222 /* NonNullExpression */: + case 331 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -18333,7 +17636,7 @@ var ts; } function Type(checker, flags) { this.flags = flags; - if (ts.Debug.isDebugging || ts.tracing.isTracing()) { + if (ts.Debug.isDebugging) { this.checker = checker; } } @@ -18690,10 +17993,6 @@ var ts; return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag]; } ts.getStrictOptionValue = getStrictOptionValue; - function getAllowJSCompilerOption(compilerOptions) { - return compilerOptions.allowJs === undefined ? !!compilerOptions.checkJs : compilerOptions.allowJs; - } - ts.getAllowJSCompilerOption = getAllowJSCompilerOption; function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) { return oldOptions !== newOptions && ts.semanticDiagnosticsOptionDeclarations.some(function (option) { return !isJsonEqual(getCompilerOptionValue(oldOptions, option), getCompilerOptionValue(newOptions, option)); }); @@ -18708,26 +18007,6 @@ var ts; return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name]; } ts.getCompilerOptionValue = getCompilerOptionValue; - function getJSXTransformEnabled(options) { - var jsx = options.jsx; - return jsx === 2 /* React */ || jsx === 4 /* ReactJSX */ || jsx === 5 /* ReactJSXDev */; - } - ts.getJSXTransformEnabled = getJSXTransformEnabled; - function getJSXImplicitImportBase(compilerOptions, file) { - var jsxImportSourcePragmas = file === null || file === void 0 ? void 0 : file.pragmas.get("jsximportsource"); - var jsxImportSourcePragma = ts.isArray(jsxImportSourcePragmas) ? jsxImportSourcePragmas[0] : jsxImportSourcePragmas; - return compilerOptions.jsx === 4 /* ReactJSX */ || - compilerOptions.jsx === 5 /* ReactJSXDev */ || - compilerOptions.jsxImportSource || - jsxImportSourcePragma ? - (jsxImportSourcePragma === null || jsxImportSourcePragma === void 0 ? void 0 : jsxImportSourcePragma.arguments.factory) || compilerOptions.jsxImportSource || "react" : - undefined; - } - ts.getJSXImplicitImportBase = getJSXImplicitImportBase; - function getJSXRuntimeImport(base, options) { - return base ? base + "/" + (options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined; - } - ts.getJSXRuntimeImport = getJSXRuntimeImport; function hasZeroOrOneAsteriskCharacter(str) { var seenAsterisk = false; for (var i = 0; i < str.length; i++) { @@ -19107,7 +18386,7 @@ var ts; var allSupportedExtensions = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions); var allSupportedExtensionsWithJson = __spreadArrays(ts.supportedTSExtensions, ts.supportedJSExtensions, [".json" /* Json */]); function getSupportedExtensions(options, extraFileExtensions) { - var needJsExtensions = options && getAllowJSCompilerOption(options); + var needJsExtensions = options && options.allowJs; if (!extraFileExtensions || extraFileExtensions.length === 0) { return needJsExtensions ? allSupportedExtensions : ts.supportedTSExtensions; } @@ -19318,7 +18597,6 @@ var ts; if (!diagnostic.relatedInformation) { diagnostic.relatedInformation = []; } - ts.Debug.assert(diagnostic.relatedInformation !== ts.emptyArray, "Diagnostic had empty array singleton for related info, but is still being constructed!"); (_a = diagnostic.relatedInformation).push.apply(_a, relatedInformation); return diagnostic; } @@ -19447,38 +18725,38 @@ var ts; } ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; function typeOnlyDeclarationIsExport(typeOnlyDeclaration) { - return typeOnlyDeclaration.kind === 270 /* ExportSpecifier */; + return typeOnlyDeclaration.kind === 267 /* ExportSpecifier */; } ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport; function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { - while (node.kind === 78 /* Identifier */ || node.kind === 201 /* PropertyAccessExpression */) { + while (node.kind === 78 /* Identifier */ || node.kind === 198 /* PropertyAccessExpression */) { node = node.parent; } - if (node.kind !== 158 /* ComputedPropertyName */) { + if (node.kind !== 157 /* ComputedPropertyName */) { return false; } if (hasSyntacticModifier(node.parent, 128 /* Abstract */)) { return true; } var containerKind = node.parent.parent.kind; - return containerKind === 253 /* InterfaceDeclaration */ || containerKind === 177 /* TypeLiteral */; + return containerKind === 250 /* InterfaceDeclaration */ || containerKind === 176 /* TypeLiteral */; } /** Returns true for an identifier in 1) an `implements` clause, and 2) an `extends` clause of an interface. */ function isIdentifierInNonEmittingHeritageClause(node) { if (node.kind !== 78 /* Identifier */) return false; - var heritageClause = ts.findAncestor(node.parent, function (parent) { + var heritageClause = findAncestor(node.parent, function (parent) { switch (parent.kind) { - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return true; - case 201 /* PropertyAccessExpression */: - case 223 /* ExpressionWithTypeArguments */: + case 198 /* PropertyAccessExpression */: + case 220 /* ExpressionWithTypeArguments */: return false; default: return "quit"; } }); - return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 253 /* InterfaceDeclaration */; + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 116 /* ImplementsKeyword */ || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 250 /* InterfaceDeclaration */; } function isIdentifierTypeReference(node) { return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName); @@ -19672,10 +18950,10 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(216 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(213 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(213 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); - if (!isLeftSideOfBinary && operand.kind === 209 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { + if (!isLeftSideOfBinary && operand.kind === 206 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { // We need to parenthesize arrow functions on the right side to avoid it being // parsed as parenthesized expression: `a && (() => {})` return true; @@ -19687,7 +18965,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 219 /* YieldExpression */) { + && operand.kind === 216 /* YieldExpression */) { return false; } return true; @@ -19775,7 +19053,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { + if (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -19801,7 +19079,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 207 /* ParenthesizedExpression */) { + if (skipped.kind === 204 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -19818,7 +19096,7 @@ var ts; return ts.isCommaSequence(expression) ? factory.createParenthesizedExpression(expression) : expression; } function parenthesizeConditionOfConditionalExpression(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(217 /* ConditionalExpression */, 57 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(214 /* ConditionalExpression */, 57 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { @@ -19851,8 +19129,8 @@ var ts; var needsParens = ts.isCommaSequence(check); if (!needsParens) { switch (ts.getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: needsParens = true; } } @@ -19865,9 +19143,9 @@ var ts; function parenthesizeExpressionOfNew(expression) { var leftmostExpr = ts.getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: return factory.createParenthesizedExpression(expression); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return !leftmostExpr.arguments ? factory.createParenthesizedExpression(expression) : expression; // TODO(rbuckton): Verify this assertion holds @@ -19887,7 +19165,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 204 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 201 /* NewExpression */ || emittedExpression.arguments)) { // TODO(rbuckton): Verify whether this assertion holds. return expression; } @@ -19909,7 +19187,7 @@ var ts; function parenthesizeExpressionForDisallowedComma(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(216 /* BinaryExpression */, 27 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(213 /* BinaryExpression */, 27 /* CommaToken */); // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(factory.createParenthesizedExpression(expression), expression); } @@ -19918,44 +19196,44 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 208 /* FunctionExpression */ || kind === 209 /* ArrowFunction */) { + if (kind === 205 /* FunctionExpression */ || kind === 206 /* ArrowFunction */) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. var updated = factory.updateCallExpression(emittedExpression, ts.setTextRange(factory.createParenthesizedExpression(callee), callee), emittedExpression.typeArguments, emittedExpression.arguments); return factory.restoreOuterExpressions(expression, updated, 8 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = ts.getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 200 /* ObjectLiteralExpression */ || leftmostExpressionKind === 208 /* FunctionExpression */) { + if (leftmostExpressionKind === 197 /* ObjectLiteralExpression */ || leftmostExpressionKind === 205 /* FunctionExpression */) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return ts.setTextRange(factory.createParenthesizedExpression(expression), expression); } return expression; } function parenthesizeConciseBodyOfArrowFunction(body) { - if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 200 /* ObjectLiteralExpression */)) { + if (!ts.isBlock(body) && (ts.isCommaSequence(body) || ts.getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 197 /* ObjectLiteralExpression */)) { // TODO(rbuckton): Verifiy whether `setTextRange` is needed. return ts.setTextRange(factory.createParenthesizedExpression(body), body); } return body; } function parenthesizeMemberOfConditionalType(member) { - return member.kind === 184 /* ConditionalType */ ? factory.createParenthesizedType(member) : member; + return member.kind === 183 /* ConditionalType */ ? factory.createParenthesizedType(member) : member; } function parenthesizeMemberOfElementType(member) { switch (member.kind) { - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return factory.createParenthesizedType(member); } return parenthesizeMemberOfConditionalType(member); } function parenthesizeElementTypeOfArrayType(member) { switch (member.kind) { - case 176 /* TypeQuery */: - case 188 /* TypeOperator */: - case 185 /* InferType */: + case 175 /* TypeQuery */: + case 187 /* TypeOperator */: + case 184 /* InferType */: return factory.createParenthesizedType(member); } return parenthesizeMemberOfElementType(member); @@ -20059,11 +19337,11 @@ var ts; } function convertToAssignmentPattern(node) { switch (node.kind) { - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 196 /* ObjectBindingPattern */: - case 200 /* ObjectLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 197 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -20191,8 +19469,6 @@ var ts; updateConstructSignature: updateConstructSignature, createIndexSignature: createIndexSignature, updateIndexSignature: updateIndexSignature, - createTemplateLiteralTypeSpan: createTemplateLiteralTypeSpan, - updateTemplateLiteralTypeSpan: updateTemplateLiteralTypeSpan, createKeywordTypeNode: createKeywordTypeNode, createTypePredicateNode: createTypePredicateNode, updateTypePredicateNode: updateTypePredicateNode, @@ -20237,8 +19513,6 @@ var ts; updateMappedTypeNode: updateMappedTypeNode, createLiteralTypeNode: createLiteralTypeNode, updateLiteralTypeNode: updateLiteralTypeNode, - createTemplateLiteralType: createTemplateLiteralType, - updateTemplateLiteralType: updateTemplateLiteralType, createObjectBindingPattern: createObjectBindingPattern, updateObjectBindingPattern: updateObjectBindingPattern, createArrayBindingPattern: createArrayBindingPattern, @@ -20404,18 +19678,18 @@ var ts; createExternalModuleReference: createExternalModuleReference, updateExternalModuleReference: updateExternalModuleReference, // lazily load factory members for JSDoc types with similar structure - get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(303 /* JSDocAllType */); }, - get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(304 /* JSDocUnknownType */); }, - get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(306 /* JSDocNonNullableType */); }, - get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(306 /* JSDocNonNullableType */); }, - get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(305 /* JSDocNullableType */); }, - get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(305 /* JSDocNullableType */); }, - get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(307 /* JSDocOptionalType */); }, - get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(307 /* JSDocOptionalType */); }, - get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(309 /* JSDocVariadicType */); }, - get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(309 /* JSDocVariadicType */); }, - get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(310 /* JSDocNamepathType */); }, - get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(310 /* JSDocNamepathType */); }, + get createJSDocAllType() { return getJSDocPrimaryTypeCreateFunction(299 /* JSDocAllType */); }, + get createJSDocUnknownType() { return getJSDocPrimaryTypeCreateFunction(300 /* JSDocUnknownType */); }, + get createJSDocNonNullableType() { return getJSDocUnaryTypeCreateFunction(302 /* JSDocNonNullableType */); }, + get updateJSDocNonNullableType() { return getJSDocUnaryTypeUpdateFunction(302 /* JSDocNonNullableType */); }, + get createJSDocNullableType() { return getJSDocUnaryTypeCreateFunction(301 /* JSDocNullableType */); }, + get updateJSDocNullableType() { return getJSDocUnaryTypeUpdateFunction(301 /* JSDocNullableType */); }, + get createJSDocOptionalType() { return getJSDocUnaryTypeCreateFunction(303 /* JSDocOptionalType */); }, + get updateJSDocOptionalType() { return getJSDocUnaryTypeUpdateFunction(303 /* JSDocOptionalType */); }, + get createJSDocVariadicType() { return getJSDocUnaryTypeCreateFunction(305 /* JSDocVariadicType */); }, + get updateJSDocVariadicType() { return getJSDocUnaryTypeUpdateFunction(305 /* JSDocVariadicType */); }, + get createJSDocNamepathType() { return getJSDocUnaryTypeCreateFunction(306 /* JSDocNamepathType */); }, + get updateJSDocNamepathType() { return getJSDocUnaryTypeUpdateFunction(306 /* JSDocNamepathType */); }, createJSDocFunctionType: createJSDocFunctionType, updateJSDocFunctionType: updateJSDocFunctionType, createJSDocTypeLiteral: createJSDocTypeLiteral, @@ -20438,33 +19712,29 @@ var ts; updateJSDocAugmentsTag: updateJSDocAugmentsTag, createJSDocImplementsTag: createJSDocImplementsTag, updateJSDocImplementsTag: updateJSDocImplementsTag, - createJSDocSeeTag: createJSDocSeeTag, - updateJSDocSeeTag: updateJSDocSeeTag, - createJSDocNameReference: createJSDocNameReference, - updateJSDocNameReference: updateJSDocNameReference, // lazily load factory members for JSDoc tags with similar structure - get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(329 /* JSDocTypeTag */); }, - get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(329 /* JSDocTypeTag */); }, - get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(327 /* JSDocReturnTag */); }, - get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(327 /* JSDocReturnTag */); }, - get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(328 /* JSDocThisTag */); }, - get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(328 /* JSDocThisTag */); }, - get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(325 /* JSDocEnumTag */); }, - get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(325 /* JSDocEnumTag */); }, - get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(317 /* JSDocAuthorTag */); }, - get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(317 /* JSDocAuthorTag */); }, - get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(319 /* JSDocClassTag */); }, - get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(319 /* JSDocClassTag */); }, - get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(320 /* JSDocPublicTag */); }, - get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(320 /* JSDocPublicTag */); }, - get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(321 /* JSDocPrivateTag */); }, - get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(321 /* JSDocPrivateTag */); }, - get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(322 /* JSDocProtectedTag */); }, - get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(322 /* JSDocProtectedTag */); }, - get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(323 /* JSDocReadonlyTag */); }, - get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(323 /* JSDocReadonlyTag */); }, - get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(318 /* JSDocDeprecatedTag */); }, - get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(318 /* JSDocDeprecatedTag */); }, + get createJSDocTypeTag() { return getJSDocTypeLikeTagCreateFunction(325 /* JSDocTypeTag */); }, + get updateJSDocTypeTag() { return getJSDocTypeLikeTagUpdateFunction(325 /* JSDocTypeTag */); }, + get createJSDocReturnTag() { return getJSDocTypeLikeTagCreateFunction(323 /* JSDocReturnTag */); }, + get updateJSDocReturnTag() { return getJSDocTypeLikeTagUpdateFunction(323 /* JSDocReturnTag */); }, + get createJSDocThisTag() { return getJSDocTypeLikeTagCreateFunction(324 /* JSDocThisTag */); }, + get updateJSDocThisTag() { return getJSDocTypeLikeTagUpdateFunction(324 /* JSDocThisTag */); }, + get createJSDocEnumTag() { return getJSDocTypeLikeTagCreateFunction(321 /* JSDocEnumTag */); }, + get updateJSDocEnumTag() { return getJSDocTypeLikeTagUpdateFunction(321 /* JSDocEnumTag */); }, + get createJSDocAuthorTag() { return getJSDocSimpleTagCreateFunction(313 /* JSDocAuthorTag */); }, + get updateJSDocAuthorTag() { return getJSDocSimpleTagUpdateFunction(313 /* JSDocAuthorTag */); }, + get createJSDocClassTag() { return getJSDocSimpleTagCreateFunction(315 /* JSDocClassTag */); }, + get updateJSDocClassTag() { return getJSDocSimpleTagUpdateFunction(315 /* JSDocClassTag */); }, + get createJSDocPublicTag() { return getJSDocSimpleTagCreateFunction(316 /* JSDocPublicTag */); }, + get updateJSDocPublicTag() { return getJSDocSimpleTagUpdateFunction(316 /* JSDocPublicTag */); }, + get createJSDocPrivateTag() { return getJSDocSimpleTagCreateFunction(317 /* JSDocPrivateTag */); }, + get updateJSDocPrivateTag() { return getJSDocSimpleTagUpdateFunction(317 /* JSDocPrivateTag */); }, + get createJSDocProtectedTag() { return getJSDocSimpleTagCreateFunction(318 /* JSDocProtectedTag */); }, + get updateJSDocProtectedTag() { return getJSDocSimpleTagUpdateFunction(318 /* JSDocProtectedTag */); }, + get createJSDocReadonlyTag() { return getJSDocSimpleTagCreateFunction(319 /* JSDocReadonlyTag */); }, + get updateJSDocReadonlyTag() { return getJSDocSimpleTagUpdateFunction(319 /* JSDocReadonlyTag */); }, + get createJSDocDeprecatedTag() { return getJSDocSimpleTagCreateFunction(314 /* JSDocDeprecatedTag */); }, + get updateJSDocDeprecatedTag() { return getJSDocSimpleTagUpdateFunction(314 /* JSDocDeprecatedTag */); }, createJSDocUnknownTag: createJSDocUnknownTag, updateJSDocUnknownTag: updateJSDocUnknownTag, createJSDocComment: createJSDocComment, @@ -20609,7 +19879,6 @@ var ts; if (elements.transformFlags === undefined) { aggregateChildrenFlags(elements); } - ts.Debug.attachNodeArrayDebugInfo(elements); return elements; } // Since the element list of a node array is typically created by starting with an empty array and @@ -20620,7 +19889,6 @@ var ts; ts.setTextRangePosEnd(array, -1, -1); array.hasTrailingComma = !!hasTrailingComma; aggregateChildrenFlags(array); - ts.Debug.attachNodeArrayDebugInfo(array); return array; } function createBaseNode(kind) { @@ -20650,11 +19918,11 @@ var ts; // don't propagate child flags. if (name) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 288 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 285 /* PropertyAssignment */: if (ts.isIdentifier(name)) { node.transformFlags |= propagateIdentifierNameFlags(name); break; @@ -20882,7 +20150,7 @@ var ts; return baseFactory.createBaseTokenNode(kind); } function createToken(token) { - ts.Debug.assert(token >= 0 /* FirstToken */ && token <= 156 /* LastToken */, "Invalid token"); + ts.Debug.assert(token >= 0 /* FirstToken */ && token <= 155 /* LastToken */, "Invalid token"); ts.Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); ts.Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals."); ts.Debug.assert(token !== 78 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers"); @@ -20898,21 +20166,21 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 125 /* AbstractKeyword */: case 133 /* DeclareKeyword */: case 84 /* ConstKeyword */: case 128 /* AnyKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 141 /* NeverKeyword */: - case 145 /* ObjectKeyword */: - case 147 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 140 /* NeverKeyword */: + case 144 /* ObjectKeyword */: + case 146 /* StringKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: case 113 /* VoidKeyword */: - case 152 /* UnknownKeyword */: - case 150 /* UndefinedKeyword */: // `undefined` is an Identifier in the expression case. + case 151 /* UnknownKeyword */: + case 149 /* UndefinedKeyword */: // `undefined` is an Identifier in the expression case. transformFlags = 1 /* ContainsTypeScript */; break; case 123 /* StaticKeyword */: @@ -20990,7 +20258,7 @@ var ts; result.push(createModifier(123 /* StaticKeyword */)); } if (flags & 64 /* Readonly */) { - result.push(createModifier(142 /* ReadonlyKeyword */)); + result.push(createModifier(141 /* ReadonlyKeyword */)); } if (flags & 256 /* Async */) { result.push(createModifier(129 /* AsyncKeyword */)); @@ -21002,7 +20270,7 @@ var ts; // // @api function createQualifiedName(left, right) { - var node = createBaseNode(157 /* QualifiedName */); + var node = createBaseNode(156 /* QualifiedName */); node.left = left; node.right = asName(right); node.transformFlags |= @@ -21019,7 +20287,7 @@ var ts; } // @api function createComputedPropertyName(expression) { - var node = createBaseNode(158 /* ComputedPropertyName */); + var node = createBaseNode(157 /* ComputedPropertyName */); node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -21038,7 +20306,7 @@ var ts; // // @api function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createBaseNamedDeclaration(159 /* TypeParameter */, + var node = createBaseNamedDeclaration(158 /* TypeParameter */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.constraint = constraint; @@ -21056,7 +20324,7 @@ var ts; } // @api function createParameterDeclaration(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(160 /* Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); + var node = createBaseVariableLikeDeclaration(159 /* Parameter */, decorators, modifiers, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); node.dotDotDotToken = dotDotDotToken; node.questionToken = questionToken; if (ts.isThisIdentifier(node.name)) { @@ -21089,7 +20357,7 @@ var ts; } // @api function createDecorator(expression) { - var node = createBaseNode(161 /* Decorator */); + var node = createBaseNode(160 /* Decorator */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -21108,7 +20376,7 @@ var ts; // // @api function createPropertySignature(modifiers, name, questionToken, type) { - var node = createBaseNamedDeclaration(162 /* PropertySignature */, + var node = createBaseNamedDeclaration(161 /* PropertySignature */, /*decorators*/ undefined, modifiers, name); node.type = type; node.questionToken = questionToken; @@ -21126,7 +20394,7 @@ var ts; } // @api function createPropertyDeclaration(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(163 /* PropertyDeclaration */, decorators, modifiers, name, type, initializer); + var node = createBaseVariableLikeDeclaration(162 /* PropertyDeclaration */, decorators, modifiers, name, type, initializer); node.questionToken = questionOrExclamationToken && ts.isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined; node.exclamationToken = questionOrExclamationToken && ts.isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : undefined; node.transformFlags |= @@ -21155,7 +20423,7 @@ var ts; } // @api function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(164 /* MethodSignature */, + var node = createBaseSignatureDeclaration(163 /* MethodSignature */, /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type); node.questionToken = questionToken; node.transformFlags = 1 /* ContainsTypeScript */; @@ -21174,7 +20442,7 @@ var ts; } // @api function createMethodDeclaration(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(165 /* MethodDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); + var node = createBaseFunctionLikeDeclaration(164 /* MethodDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; node.questionToken = questionToken; node.transformFlags |= @@ -21213,7 +20481,7 @@ var ts; } // @api function createConstructorDeclaration(decorators, modifiers, parameters, body) { - var node = createBaseFunctionLikeDeclaration(166 /* Constructor */, decorators, modifiers, + var node = createBaseFunctionLikeDeclaration(165 /* Constructor */, decorators, modifiers, /*name*/ undefined, /*typeParameters*/ undefined, parameters, /*type*/ undefined, body); @@ -21231,7 +20499,7 @@ var ts; } // @api function createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) { - return createBaseFunctionLikeDeclaration(167 /* GetAccessor */, decorators, modifiers, name, + return createBaseFunctionLikeDeclaration(166 /* GetAccessor */, decorators, modifiers, name, /*typeParameters*/ undefined, parameters, type, body); } // @api @@ -21247,7 +20515,7 @@ var ts; } // @api function createSetAccessorDeclaration(decorators, modifiers, name, parameters, body) { - return createBaseFunctionLikeDeclaration(168 /* SetAccessor */, decorators, modifiers, name, + return createBaseFunctionLikeDeclaration(167 /* SetAccessor */, decorators, modifiers, name, /*typeParameters*/ undefined, parameters, /*type*/ undefined, body); } @@ -21263,7 +20531,7 @@ var ts; } // @api function createCallSignature(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(169 /* CallSignature */, + var node = createBaseSignatureDeclaration(168 /* CallSignature */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21280,7 +20548,7 @@ var ts; } // @api function createConstructSignature(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(170 /* ConstructSignature */, + var node = createBaseSignatureDeclaration(169 /* ConstructSignature */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21297,7 +20565,7 @@ var ts; } // @api function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createBaseSignatureDeclaration(171 /* IndexSignature */, decorators, modifiers, + var node = createBaseSignatureDeclaration(170 /* IndexSignature */, decorators, modifiers, /*name*/ undefined, /*typeParameters*/ undefined, parameters, type); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21312,21 +20580,6 @@ var ts; ? updateBaseSignatureDeclaration(createIndexSignature(decorators, modifiers, parameters, type), node) : node; } - // @api - function createTemplateLiteralTypeSpan(type, literal) { - var node = createBaseNode(194 /* TemplateLiteralTypeSpan */); - node.type = type; - node.literal = literal; - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - // @api - function updateTemplateLiteralTypeSpan(node, type, literal) { - return node.type !== type - || node.literal !== literal - ? update(createTemplateLiteralTypeSpan(type, literal), node) - : node; - } // // Types // @@ -21336,7 +20589,7 @@ var ts; } // @api function createTypePredicateNode(assertsModifier, parameterName, type) { - var node = createBaseNode(172 /* TypePredicate */); + var node = createBaseNode(171 /* TypePredicate */); node.assertsModifier = assertsModifier; node.parameterName = asName(parameterName); node.type = type; @@ -21353,7 +20606,7 @@ var ts; } // @api function createTypeReferenceNode(typeName, typeArguments) { - var node = createBaseNode(173 /* TypeReference */); + var node = createBaseNode(172 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21368,7 +20621,7 @@ var ts; } // @api function createFunctionTypeNode(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(174 /* FunctionType */, + var node = createBaseSignatureDeclaration(173 /* FunctionType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21385,7 +20638,7 @@ var ts; } // @api function createConstructorTypeNode(typeParameters, parameters, type) { - var node = createBaseSignatureDeclaration(175 /* ConstructorType */, + var node = createBaseSignatureDeclaration(174 /* ConstructorType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, typeParameters, parameters, type); @@ -21402,7 +20655,7 @@ var ts; } // @api function createTypeQueryNode(exprName) { - var node = createBaseNode(176 /* TypeQuery */); + var node = createBaseNode(175 /* TypeQuery */); node.exprName = exprName; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21415,7 +20668,7 @@ var ts; } // @api function createTypeLiteralNode(members) { - var node = createBaseNode(177 /* TypeLiteral */); + var node = createBaseNode(176 /* TypeLiteral */); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21428,7 +20681,7 @@ var ts; } // @api function createArrayTypeNode(elementType) { - var node = createBaseNode(178 /* ArrayType */); + var node = createBaseNode(177 /* ArrayType */); node.elementType = parenthesizerRules().parenthesizeElementTypeOfArrayType(elementType); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21441,7 +20694,7 @@ var ts; } // @api function createTupleTypeNode(elements) { - var node = createBaseNode(179 /* TupleType */); + var node = createBaseNode(178 /* TupleType */); node.elements = createNodeArray(elements); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21454,7 +20707,7 @@ var ts; } // @api function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { - var node = createBaseNode(192 /* NamedTupleMember */); + var node = createBaseNode(191 /* NamedTupleMember */); node.dotDotDotToken = dotDotDotToken; node.name = name; node.questionToken = questionToken; @@ -21473,7 +20726,7 @@ var ts; } // @api function createOptionalTypeNode(type) { - var node = createBaseNode(180 /* OptionalType */); + var node = createBaseNode(179 /* OptionalType */); node.type = parenthesizerRules().parenthesizeElementTypeOfArrayType(type); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21486,7 +20739,7 @@ var ts; } // @api function createRestTypeNode(type) { - var node = createBaseNode(181 /* RestType */); + var node = createBaseNode(180 /* RestType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21510,7 +20763,7 @@ var ts; } // @api function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(182 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(181 /* UnionType */, types); } // @api function updateUnionTypeNode(node, types) { @@ -21518,7 +20771,7 @@ var ts; } // @api function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(183 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(182 /* IntersectionType */, types); } // @api function updateIntersectionTypeNode(node, types) { @@ -21526,7 +20779,7 @@ var ts; } // @api function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { - var node = createBaseNode(184 /* ConditionalType */); + var node = createBaseNode(183 /* ConditionalType */); node.checkType = parenthesizerRules().parenthesizeMemberOfConditionalType(checkType); node.extendsType = parenthesizerRules().parenthesizeMemberOfConditionalType(extendsType); node.trueType = trueType; @@ -21545,7 +20798,7 @@ var ts; } // @api function createInferTypeNode(typeParameter) { - var node = createBaseNode(185 /* InferType */); + var node = createBaseNode(184 /* InferType */); node.typeParameter = typeParameter; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21557,24 +20810,9 @@ var ts; : node; } // @api - function createTemplateLiteralType(head, templateSpans) { - var node = createBaseNode(193 /* TemplateLiteralType */); - node.head = head; - node.templateSpans = createNodeArray(templateSpans); - node.transformFlags = 1 /* ContainsTypeScript */; - return node; - } - // @api - function updateTemplateLiteralType(node, head, templateSpans) { - return node.head !== head - || node.templateSpans !== templateSpans - ? update(createTemplateLiteralType(head, templateSpans), node) - : node; - } - // @api function createImportTypeNode(argument, qualifier, typeArguments, isTypeOf) { if (isTypeOf === void 0) { isTypeOf = false; } - var node = createBaseNode(195 /* ImportType */); + var node = createBaseNode(192 /* ImportType */); node.argument = argument; node.qualifier = qualifier; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); @@ -21594,7 +20832,7 @@ var ts; } // @api function createParenthesizedType(type) { - var node = createBaseNode(186 /* ParenthesizedType */); + var node = createBaseNode(185 /* ParenthesizedType */); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21607,13 +20845,13 @@ var ts; } // @api function createThisTypeNode() { - var node = createBaseNode(187 /* ThisType */); + var node = createBaseNode(186 /* ThisType */); node.transformFlags = 1 /* ContainsTypeScript */; return node; } // @api function createTypeOperatorNode(operator, type) { - var node = createBaseNode(188 /* TypeOperator */); + var node = createBaseNode(187 /* TypeOperator */); node.operator = operator; node.type = parenthesizerRules().parenthesizeMemberOfElementType(type); node.transformFlags = 1 /* ContainsTypeScript */; @@ -21627,7 +20865,7 @@ var ts; } // @api function createIndexedAccessTypeNode(objectType, indexType) { - var node = createBaseNode(189 /* IndexedAccessType */); + var node = createBaseNode(188 /* IndexedAccessType */); node.objectType = parenthesizerRules().parenthesizeMemberOfElementType(objectType); node.indexType = indexType; node.transformFlags = 1 /* ContainsTypeScript */; @@ -21641,29 +20879,27 @@ var ts; : node; } // @api - function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type) { - var node = createBaseNode(190 /* MappedType */); + function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { + var node = createBaseNode(189 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; - node.nameType = nameType; node.questionToken = questionToken; node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; } // @api - function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type) { + function updateMappedTypeNode(node, readonlyToken, typeParameter, questionToken, type) { return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter - || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type - ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), node) + ? update(createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), node) : node; } // @api function createLiteralTypeNode(literal) { - var node = createBaseNode(191 /* LiteralType */); + var node = createBaseNode(190 /* LiteralType */); node.literal = literal; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -21679,7 +20915,7 @@ var ts; // // @api function createObjectBindingPattern(elements) { - var node = createBaseNode(196 /* ObjectBindingPattern */); + var node = createBaseNode(193 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | @@ -21700,7 +20936,7 @@ var ts; } // @api function createArrayBindingPattern(elements) { - var node = createBaseNode(197 /* ArrayBindingPattern */); + var node = createBaseNode(194 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements) | @@ -21716,7 +20952,7 @@ var ts; } // @api function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createBaseBindingLikeDeclaration(198 /* BindingElement */, + var node = createBaseBindingLikeDeclaration(195 /* BindingElement */, /*decorators*/ undefined, /*modifiers*/ undefined, name, initializer); node.propertyName = asName(propertyName); @@ -21752,7 +20988,7 @@ var ts; } // @api function createArrayLiteralExpression(elements, multiLine) { - var node = createBaseExpression(199 /* ArrayLiteralExpression */); + var node = createBaseExpression(196 /* ArrayLiteralExpression */); node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(elements)); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.elements); @@ -21766,7 +21002,7 @@ var ts; } // @api function createObjectLiteralExpression(properties, multiLine) { - var node = createBaseExpression(200 /* ObjectLiteralExpression */); + var node = createBaseExpression(197 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.properties); @@ -21780,7 +21016,7 @@ var ts; } // @api function createPropertyAccessExpression(expression, name) { - var node = createBaseExpression(201 /* PropertyAccessExpression */); + var node = createBaseExpression(198 /* PropertyAccessExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.name = asName(name); node.transformFlags = @@ -21809,7 +21045,7 @@ var ts; } // @api function createPropertyAccessChain(expression, questionDotToken, name) { - var node = createBaseExpression(201 /* PropertyAccessExpression */); + var node = createBaseExpression(198 /* PropertyAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -21836,7 +21072,7 @@ var ts; } // @api function createElementAccessExpression(expression, index) { - var node = createBaseExpression(202 /* ElementAccessExpression */); + var node = createBaseExpression(199 /* ElementAccessExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.argumentExpression = asExpression(index); node.transformFlags |= @@ -21863,7 +21099,7 @@ var ts; } // @api function createElementAccessChain(expression, questionDotToken, index) { - var node = createBaseExpression(202 /* ElementAccessExpression */); + var node = createBaseExpression(199 /* ElementAccessExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -21888,7 +21124,7 @@ var ts; } // @api function createCallExpression(expression, typeArguments, argumentsArray) { - var node = createBaseExpression(203 /* CallExpression */); + var node = createBaseExpression(200 /* CallExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)); @@ -21920,7 +21156,7 @@ var ts; } // @api function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { - var node = createBaseExpression(203 /* CallExpression */); + var node = createBaseExpression(200 /* CallExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.questionDotToken = questionDotToken; @@ -21952,7 +21188,7 @@ var ts; } // @api function createNewExpression(expression, typeArguments, argumentsArray) { - var node = createBaseExpression(204 /* NewExpression */); + var node = createBaseExpression(201 /* NewExpression */); node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : undefined; @@ -21976,7 +21212,7 @@ var ts; } // @api function createTaggedTemplateExpression(tag, typeArguments, template) { - var node = createBaseExpression(205 /* TaggedTemplateExpression */); + var node = createBaseExpression(202 /* TaggedTemplateExpression */); node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag); node.typeArguments = asNodeArray(typeArguments); node.template = template; @@ -22003,7 +21239,7 @@ var ts; } // @api function createTypeAssertion(type, expression) { - var node = createBaseExpression(206 /* TypeAssertionExpression */); + var node = createBaseExpression(203 /* TypeAssertionExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.type = type; node.transformFlags |= @@ -22021,7 +21257,7 @@ var ts; } // @api function createParenthesizedExpression(expression) { - var node = createBaseExpression(207 /* ParenthesizedExpression */); + var node = createBaseExpression(204 /* ParenthesizedExpression */); node.expression = expression; node.transformFlags = propagateChildFlags(node.expression); return node; @@ -22034,7 +21270,7 @@ var ts; } // @api function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(208 /* FunctionExpression */, + var node = createBaseFunctionLikeDeclaration(205 /* FunctionExpression */, /*decorators*/ undefined, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; node.transformFlags |= propagateChildFlags(node.asteriskToken); @@ -22068,7 +21304,7 @@ var ts; } // @api function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createBaseFunctionLikeDeclaration(209 /* ArrowFunction */, + var node = createBaseFunctionLikeDeclaration(206 /* ArrowFunction */, /*decorators*/ undefined, modifiers, /*name*/ undefined, typeParameters, parameters, type, parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body)); node.equalsGreaterThanToken = equalsGreaterThanToken !== null && equalsGreaterThanToken !== void 0 ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */); @@ -22093,7 +21329,7 @@ var ts; } // @api function createDeleteExpression(expression) { - var node = createBaseExpression(210 /* DeleteExpression */); + var node = createBaseExpression(207 /* DeleteExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22106,7 +21342,7 @@ var ts; } // @api function createTypeOfExpression(expression) { - var node = createBaseExpression(211 /* TypeOfExpression */); + var node = createBaseExpression(208 /* TypeOfExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22119,7 +21355,7 @@ var ts; } // @api function createVoidExpression(expression) { - var node = createBaseExpression(212 /* VoidExpression */); + var node = createBaseExpression(209 /* VoidExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22132,7 +21368,7 @@ var ts; } // @api function createAwaitExpression(expression) { - var node = createBaseExpression(213 /* AwaitExpression */); + var node = createBaseExpression(210 /* AwaitExpression */); node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22149,7 +21385,7 @@ var ts; } // @api function createPrefixUnaryExpression(operator, operand) { - var node = createBaseExpression(214 /* PrefixUnaryExpression */); + var node = createBaseExpression(211 /* PrefixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand); node.transformFlags |= propagateChildFlags(node.operand); @@ -22163,7 +21399,7 @@ var ts; } // @api function createPostfixUnaryExpression(operand, operator) { - var node = createBaseExpression(215 /* PostfixUnaryExpression */); + var node = createBaseExpression(212 /* PostfixUnaryExpression */); node.operator = operator; node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand); node.transformFlags = propagateChildFlags(node.operand); @@ -22177,7 +21413,7 @@ var ts; } // @api function createBinaryExpression(left, operator, right) { - var node = createBaseExpression(216 /* BinaryExpression */); + var node = createBaseExpression(213 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left); @@ -22195,14 +21431,12 @@ var ts; node.transformFlags |= 256 /* ContainsES2015 */ | 32 /* ContainsES2018 */ | - 1024 /* ContainsDestructuringAssignment */ | - propagateAssignmentPatternFlags(node.left); + 1024 /* ContainsDestructuringAssignment */; } else if (ts.isArrayLiteralExpression(node.left)) { node.transformFlags |= 256 /* ContainsES2015 */ | - 1024 /* ContainsDestructuringAssignment */ | - propagateAssignmentPatternFlags(node.left); + 1024 /* ContainsDestructuringAssignment */; } } else if (operatorKind === 42 /* AsteriskAsteriskToken */ || operatorKind === 66 /* AsteriskAsteriskEqualsToken */) { @@ -22213,29 +21447,6 @@ var ts; } return node; } - function propagateAssignmentPatternFlags(node) { - if (node.transformFlags & 16384 /* ContainsObjectRestOrSpread */) - return 16384 /* ContainsObjectRestOrSpread */; - if (node.transformFlags & 32 /* ContainsES2018 */) { - // check for nested spread assignments, otherwise '{ x: { a, ...b } = foo } = c' - // will not be correctly interpreted by the ES2018 transformer - for (var _i = 0, _a = ts.getElementsOfBindingOrAssignmentPattern(node); _i < _a.length; _i++) { - var element = _a[_i]; - var target = ts.getTargetOfBindingOrAssignmentElement(element); - if (target && ts.isAssignmentPattern(target)) { - if (target.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { - return 16384 /* ContainsObjectRestOrSpread */; - } - if (target.transformFlags & 32 /* ContainsES2018 */) { - var flags_1 = propagateAssignmentPatternFlags(target); - if (flags_1) - return flags_1; - } - } - } - } - return 0 /* None */; - } // @api function updateBinaryExpression(node, left, operator, right) { return node.left !== left @@ -22246,7 +21457,7 @@ var ts; } // @api function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { - var node = createBaseExpression(217 /* ConditionalExpression */); + var node = createBaseExpression(214 /* ConditionalExpression */); node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); node.questionToken = questionToken !== null && questionToken !== void 0 ? questionToken : createToken(57 /* QuestionToken */); node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); @@ -22272,7 +21483,7 @@ var ts; } // @api function createTemplateExpression(head, templateSpans) { - var node = createBaseExpression(218 /* TemplateExpression */); + var node = createBaseExpression(215 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); node.transformFlags |= @@ -22342,7 +21553,7 @@ var ts; // @api function createYieldExpression(asteriskToken, expression) { ts.Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression."); - var node = createBaseExpression(219 /* YieldExpression */); + var node = createBaseExpression(216 /* YieldExpression */); node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.asteriskToken = asteriskToken; node.transformFlags |= @@ -22362,7 +21573,7 @@ var ts; } // @api function createSpreadElement(expression) { - var node = createBaseExpression(220 /* SpreadElement */); + var node = createBaseExpression(217 /* SpreadElement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22378,7 +21589,7 @@ var ts; } // @api function createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseClassLikeDeclaration(221 /* ClassExpression */, decorators, modifiers, name, typeParameters, heritageClauses, members); + var node = createBaseClassLikeDeclaration(218 /* ClassExpression */, decorators, modifiers, name, typeParameters, heritageClauses, members); node.transformFlags |= 256 /* ContainsES2015 */; return node; } @@ -22395,11 +21606,11 @@ var ts; } // @api function createOmittedExpression() { - return createBaseExpression(222 /* OmittedExpression */); + return createBaseExpression(219 /* OmittedExpression */); } // @api function createExpressionWithTypeArguments(expression, typeArguments) { - var node = createBaseNode(223 /* ExpressionWithTypeArguments */); + var node = createBaseNode(220 /* ExpressionWithTypeArguments */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.transformFlags |= @@ -22417,7 +21628,7 @@ var ts; } // @api function createAsExpression(expression, type) { - var node = createBaseExpression(224 /* AsExpression */); + var node = createBaseExpression(221 /* AsExpression */); node.expression = expression; node.type = type; node.transformFlags |= @@ -22435,7 +21646,7 @@ var ts; } // @api function createNonNullExpression(expression) { - var node = createBaseExpression(225 /* NonNullExpression */); + var node = createBaseExpression(222 /* NonNullExpression */); node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -22453,7 +21664,7 @@ var ts; } // @api function createNonNullChain(expression) { - var node = createBaseExpression(225 /* NonNullExpression */); + var node = createBaseExpression(222 /* NonNullExpression */); node.flags |= 32 /* OptionalChain */; node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression); node.transformFlags |= @@ -22470,7 +21681,7 @@ var ts; } // @api function createMetaProperty(keywordToken, name) { - var node = createBaseExpression(226 /* MetaProperty */); + var node = createBaseExpression(223 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; node.transformFlags |= propagateChildFlags(node.name); @@ -22497,7 +21708,7 @@ var ts; // // @api function createTemplateSpan(expression, literal) { - var node = createBaseNode(228 /* TemplateSpan */); + var node = createBaseNode(225 /* TemplateSpan */); node.expression = expression; node.literal = literal; node.transformFlags |= @@ -22515,7 +21726,7 @@ var ts; } // @api function createSemicolonClassElement() { - var node = createBaseNode(229 /* SemicolonClassElement */); + var node = createBaseNode(226 /* SemicolonClassElement */); node.transformFlags |= 256 /* ContainsES2015 */; return node; } @@ -22524,7 +21735,7 @@ var ts; // // @api function createBlock(statements, multiLine) { - var node = createBaseNode(230 /* Block */); + var node = createBaseNode(227 /* Block */); node.statements = createNodeArray(statements); node.multiLine = multiLine; node.transformFlags |= propagateChildrenFlags(node.statements); @@ -22538,7 +21749,7 @@ var ts; } // @api function createVariableStatement(modifiers, declarationList) { - var node = createBaseDeclaration(232 /* VariableStatement */, /*decorators*/ undefined, modifiers); + var node = createBaseDeclaration(229 /* VariableStatement */, /*decorators*/ undefined, modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; node.transformFlags |= propagateChildFlags(node.declarationList); @@ -22556,11 +21767,11 @@ var ts; } // @api function createEmptyStatement() { - return createBaseNode(231 /* EmptyStatement */); + return createBaseNode(228 /* EmptyStatement */); } // @api function createExpressionStatement(expression) { - var node = createBaseNode(233 /* ExpressionStatement */); + var node = createBaseNode(230 /* ExpressionStatement */); node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22573,7 +21784,7 @@ var ts; } // @api function createIfStatement(expression, thenStatement, elseStatement) { - var node = createBaseNode(234 /* IfStatement */); + var node = createBaseNode(231 /* IfStatement */); node.expression = expression; node.thenStatement = asEmbeddedStatement(thenStatement); node.elseStatement = asEmbeddedStatement(elseStatement); @@ -22593,7 +21804,7 @@ var ts; } // @api function createDoStatement(statement, expression) { - var node = createBaseNode(235 /* DoStatement */); + var node = createBaseNode(232 /* DoStatement */); node.statement = asEmbeddedStatement(statement); node.expression = expression; node.transformFlags |= @@ -22610,7 +21821,7 @@ var ts; } // @api function createWhileStatement(expression, statement) { - var node = createBaseNode(236 /* WhileStatement */); + var node = createBaseNode(233 /* WhileStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22627,7 +21838,7 @@ var ts; } // @api function createForStatement(initializer, condition, incrementor, statement) { - var node = createBaseNode(237 /* ForStatement */); + var node = createBaseNode(234 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -22650,7 +21861,7 @@ var ts; } // @api function createForInStatement(initializer, expression, statement) { - var node = createBaseNode(238 /* ForInStatement */); + var node = createBaseNode(235 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = asEmbeddedStatement(statement); @@ -22670,7 +21881,7 @@ var ts; } // @api function createForOfStatement(awaitModifier, initializer, expression, statement) { - var node = createBaseNode(239 /* ForOfStatement */); + var node = createBaseNode(236 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); @@ -22696,7 +21907,7 @@ var ts; } // @api function createContinueStatement(label) { - var node = createBaseNode(240 /* ContinueStatement */); + var node = createBaseNode(237 /* ContinueStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | @@ -22711,7 +21922,7 @@ var ts; } // @api function createBreakStatement(label) { - var node = createBaseNode(241 /* BreakStatement */); + var node = createBaseNode(238 /* BreakStatement */); node.label = asName(label); node.transformFlags |= propagateChildFlags(node.label) | @@ -22726,7 +21937,7 @@ var ts; } // @api function createReturnStatement(expression) { - var node = createBaseNode(242 /* ReturnStatement */); + var node = createBaseNode(239 /* ReturnStatement */); node.expression = expression; // return in an ES2018 async generator must be awaited node.transformFlags |= @@ -22743,7 +21954,7 @@ var ts; } // @api function createWithStatement(expression, statement) { - var node = createBaseNode(243 /* WithStatement */); + var node = createBaseNode(240 /* WithStatement */); node.expression = expression; node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22760,7 +21971,7 @@ var ts; } // @api function createSwitchStatement(expression, caseBlock) { - var node = createBaseNode(244 /* SwitchStatement */); + var node = createBaseNode(241 /* SwitchStatement */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.caseBlock = caseBlock; node.transformFlags |= @@ -22777,7 +21988,7 @@ var ts; } // @api function createLabeledStatement(label, statement) { - var node = createBaseNode(245 /* LabeledStatement */); + var node = createBaseNode(242 /* LabeledStatement */); node.label = asName(label); node.statement = asEmbeddedStatement(statement); node.transformFlags |= @@ -22794,7 +22005,7 @@ var ts; } // @api function createThrowStatement(expression) { - var node = createBaseNode(246 /* ThrowStatement */); + var node = createBaseNode(243 /* ThrowStatement */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); return node; @@ -22807,7 +22018,7 @@ var ts; } // @api function createTryStatement(tryBlock, catchClause, finallyBlock) { - var node = createBaseNode(247 /* TryStatement */); + var node = createBaseNode(244 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -22827,11 +22038,11 @@ var ts; } // @api function createDebuggerStatement() { - return createBaseNode(248 /* DebuggerStatement */); + return createBaseNode(245 /* DebuggerStatement */); } // @api function createVariableDeclaration(name, exclamationToken, type, initializer) { - var node = createBaseVariableLikeDeclaration(249 /* VariableDeclaration */, + var node = createBaseVariableLikeDeclaration(246 /* VariableDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined, name, type, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); node.exclamationToken = exclamationToken; @@ -22853,7 +22064,7 @@ var ts; // @api function createVariableDeclarationList(declarations, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createBaseNode(250 /* VariableDeclarationList */); + var node = createBaseNode(247 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); node.transformFlags |= @@ -22874,7 +22085,7 @@ var ts; } // @api function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createBaseFunctionLikeDeclaration(251 /* FunctionDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); + var node = createBaseFunctionLikeDeclaration(248 /* FunctionDeclaration */, decorators, modifiers, name, typeParameters, parameters, type, body); node.asteriskToken = asteriskToken; if (!node.body || ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; @@ -22912,7 +22123,7 @@ var ts; } // @api function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseClassLikeDeclaration(252 /* ClassDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses, members); + var node = createBaseClassLikeDeclaration(249 /* ClassDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses, members); if (ts.modifiersToFlags(node.modifiers) & 2 /* Ambient */) { node.transformFlags = 1 /* ContainsTypeScript */; } @@ -22937,7 +22148,7 @@ var ts; } // @api function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createBaseInterfaceOrClassLikeDeclaration(253 /* InterfaceDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses); + var node = createBaseInterfaceOrClassLikeDeclaration(250 /* InterfaceDeclaration */, decorators, modifiers, name, typeParameters, heritageClauses); node.members = createNodeArray(members); node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -22955,7 +22166,7 @@ var ts; } // @api function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createBaseGenericNamedDeclaration(254 /* TypeAliasDeclaration */, decorators, modifiers, name, typeParameters); + var node = createBaseGenericNamedDeclaration(251 /* TypeAliasDeclaration */, decorators, modifiers, name, typeParameters); node.type = type; node.transformFlags = 1 /* ContainsTypeScript */; return node; @@ -22972,7 +22183,7 @@ var ts; } // @api function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createBaseNamedDeclaration(255 /* EnumDeclaration */, decorators, modifiers, name); + var node = createBaseNamedDeclaration(252 /* EnumDeclaration */, decorators, modifiers, name); node.members = createNodeArray(members); node.transformFlags |= propagateChildrenFlags(node.members) | @@ -22992,7 +22203,7 @@ var ts; // @api function createModuleDeclaration(decorators, modifiers, name, body, flags) { if (flags === void 0) { flags = 0 /* None */; } - var node = createBaseDeclaration(256 /* ModuleDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(253 /* ModuleDeclaration */, decorators, modifiers); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); node.name = name; node.body = body; @@ -23019,7 +22230,7 @@ var ts; } // @api function createModuleBlock(statements) { - var node = createBaseNode(257 /* ModuleBlock */); + var node = createBaseNode(254 /* ModuleBlock */); node.statements = createNodeArray(statements); node.transformFlags |= propagateChildrenFlags(node.statements); return node; @@ -23032,7 +22243,7 @@ var ts; } // @api function createCaseBlock(clauses) { - var node = createBaseNode(258 /* CaseBlock */); + var node = createBaseNode(255 /* CaseBlock */); node.clauses = createNodeArray(clauses); node.transformFlags |= propagateChildrenFlags(node.clauses); return node; @@ -23045,7 +22256,7 @@ var ts; } // @api function createNamespaceExportDeclaration(name) { - var node = createBaseNamedDeclaration(259 /* NamespaceExportDeclaration */, + var node = createBaseNamedDeclaration(256 /* NamespaceExportDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.transformFlags = 1 /* ContainsTypeScript */; @@ -23059,7 +22270,7 @@ var ts; } // @api function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createBaseNamedDeclaration(260 /* ImportEqualsDeclaration */, decorators, modifiers, name); + var node = createBaseNamedDeclaration(257 /* ImportEqualsDeclaration */, decorators, modifiers, name); node.moduleReference = moduleReference; node.transformFlags |= propagateChildFlags(node.moduleReference); if (!ts.isExternalModuleReference(node.moduleReference)) @@ -23078,7 +22289,7 @@ var ts; } // @api function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createBaseDeclaration(261 /* ImportDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(258 /* ImportDeclaration */, decorators, modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; node.transformFlags |= @@ -23098,7 +22309,7 @@ var ts; } // @api function createImportClause(isTypeOnly, name, namedBindings) { - var node = createBaseNode(262 /* ImportClause */); + var node = createBaseNode(259 /* ImportClause */); node.isTypeOnly = isTypeOnly; node.name = name; node.namedBindings = namedBindings; @@ -23121,7 +22332,7 @@ var ts; } // @api function createNamespaceImport(name) { - var node = createBaseNode(263 /* NamespaceImport */); + var node = createBaseNode(260 /* NamespaceImport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23135,7 +22346,7 @@ var ts; } // @api function createNamespaceExport(name) { - var node = createBaseNode(269 /* NamespaceExport */); + var node = createBaseNode(266 /* NamespaceExport */); node.name = name; node.transformFlags |= propagateChildFlags(node.name) | @@ -23151,7 +22362,7 @@ var ts; } // @api function createNamedImports(elements) { - var node = createBaseNode(264 /* NamedImports */); + var node = createBaseNode(261 /* NamedImports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23165,7 +22376,7 @@ var ts; } // @api function createImportSpecifier(propertyName, name) { - var node = createBaseNode(265 /* ImportSpecifier */); + var node = createBaseNode(262 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; node.transformFlags |= @@ -23183,7 +22394,7 @@ var ts; } // @api function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createBaseDeclaration(266 /* ExportAssignment */, decorators, modifiers); + var node = createBaseDeclaration(263 /* ExportAssignment */, decorators, modifiers); node.isExportEquals = isExportEquals; node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary(62 /* EqualsToken */, /*leftSide*/ undefined, expression) @@ -23202,7 +22413,7 @@ var ts; } // @api function createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier) { - var node = createBaseDeclaration(267 /* ExportDeclaration */, decorators, modifiers); + var node = createBaseDeclaration(264 /* ExportDeclaration */, decorators, modifiers); node.isTypeOnly = isTypeOnly; node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; @@ -23224,7 +22435,7 @@ var ts; } // @api function createNamedExports(elements) { - var node = createBaseNode(268 /* NamedExports */); + var node = createBaseNode(265 /* NamedExports */); node.elements = createNodeArray(elements); node.transformFlags |= propagateChildrenFlags(node.elements); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23238,7 +22449,7 @@ var ts; } // @api function createExportSpecifier(propertyName, name) { - var node = createBaseNode(270 /* ExportSpecifier */); + var node = createBaseNode(267 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); node.transformFlags |= @@ -23256,7 +22467,7 @@ var ts; } // @api function createMissingDeclaration() { - var node = createBaseDeclaration(271 /* MissingDeclaration */, + var node = createBaseDeclaration(268 /* MissingDeclaration */, /*decorators*/ undefined, /*modifiers*/ undefined); return node; @@ -23266,7 +22477,7 @@ var ts; // // @api function createExternalModuleReference(expression) { - var node = createBaseNode(272 /* ExternalModuleReference */); + var node = createBaseNode(269 /* ExternalModuleReference */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression); node.transformFlags &= ~8388608 /* ContainsPossibleTopLevelAwait */; // always parsed in an Await context @@ -23311,7 +22522,7 @@ var ts; } // @api function createJSDocFunctionType(parameters, type) { - var node = createBaseSignatureDeclaration(308 /* JSDocFunctionType */, + var node = createBaseSignatureDeclaration(304 /* JSDocFunctionType */, /*decorators*/ undefined, /*modifiers*/ undefined, /*name*/ undefined, @@ -23328,7 +22539,7 @@ var ts; // @api function createJSDocTypeLiteral(propertyTags, isArrayType) { if (isArrayType === void 0) { isArrayType = false; } - var node = createBaseNode(312 /* JSDocTypeLiteral */); + var node = createBaseNode(308 /* JSDocTypeLiteral */); node.jsDocPropertyTags = asNodeArray(propertyTags); node.isArrayType = isArrayType; return node; @@ -23342,7 +22553,7 @@ var ts; } // @api function createJSDocTypeExpression(type) { - var node = createBaseNode(301 /* JSDocTypeExpression */); + var node = createBaseNode(298 /* JSDocTypeExpression */); node.type = type; return node; } @@ -23354,7 +22565,7 @@ var ts; } // @api function createJSDocSignature(typeParameters, parameters, type) { - var node = createBaseNode(313 /* JSDocSignature */); + var node = createBaseNode(309 /* JSDocSignature */); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); node.type = type; @@ -23383,7 +22594,7 @@ var ts; } // @api function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { - var node = createBaseJSDocTag(330 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment); + var node = createBaseJSDocTag(326 /* JSDocTemplateTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment); node.constraint = constraint; node.typeParameters = createNodeArray(typeParameters); return node; @@ -23400,7 +22611,7 @@ var ts; } // @api function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { - var node = createBaseJSDocTag(331 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment); + var node = createBaseJSDocTag(327 /* JSDocTypedefTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = ts.getJSDocTypeAliasName(fullName); @@ -23418,7 +22629,7 @@ var ts; } // @api function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - var node = createBaseJSDocTag(326 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment); + var node = createBaseJSDocTag(322 /* JSDocParameterTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -23439,7 +22650,7 @@ var ts; } // @api function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { - var node = createBaseJSDocTag(333 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment); + var node = createBaseJSDocTag(328 /* JSDocPropertyTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment); node.typeExpression = typeExpression; node.name = name; node.isNameFirst = !!isNameFirst; @@ -23460,7 +22671,7 @@ var ts; } // @api function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { - var node = createBaseJSDocTag(324 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment); + var node = createBaseJSDocTag(320 /* JSDocCallbackTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment); node.typeExpression = typeExpression; node.fullName = fullName; node.name = ts.getJSDocTypeAliasName(fullName); @@ -23478,7 +22689,7 @@ var ts; } // @api function createJSDocAugmentsTag(tagName, className, comment) { - var node = createBaseJSDocTag(315 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment); + var node = createBaseJSDocTag(311 /* JSDocAugmentsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment); node.class = className; return node; } @@ -23493,37 +22704,11 @@ var ts; } // @api function createJSDocImplementsTag(tagName, className, comment) { - var node = createBaseJSDocTag(316 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment); + var node = createBaseJSDocTag(312 /* JSDocImplementsTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment); node.class = className; return node; } // @api - function createJSDocSeeTag(tagName, name, comment) { - var node = createBaseJSDocTag(332 /* JSDocSeeTag */, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("see"), comment); - node.name = name; - return node; - } - // @api - function updateJSDocSeeTag(node, tagName, name, comment) { - return node.tagName !== tagName - || node.name !== name - || node.comment !== comment - ? update(createJSDocSeeTag(tagName, name, comment), node) - : node; - } - // @api - function createJSDocNameReference(name) { - var node = createBaseNode(302 /* JSDocNameReference */); - node.name = name; - return node; - } - // @api - function updateJSDocNameReference(node, name) { - return node.name !== name - ? update(createJSDocNameReference(name), node) - : node; - } - // @api function updateJSDocImplementsTag(node, tagName, className, comment) { if (tagName === void 0) { tagName = getDefaultTagName(node); } return node.tagName !== tagName @@ -23584,7 +22769,7 @@ var ts; } // @api function createJSDocUnknownTag(tagName, comment) { - var node = createBaseJSDocTag(314 /* JSDocTag */, tagName, comment); + var node = createBaseJSDocTag(310 /* JSDocTag */, tagName, comment); return node; } // @api @@ -23596,7 +22781,7 @@ var ts; } // @api function createJSDocComment(comment, tags) { - var node = createBaseNode(311 /* JSDocComment */); + var node = createBaseNode(307 /* JSDocComment */); node.comment = comment; node.tags = asNodeArray(tags); return node; @@ -23613,7 +22798,7 @@ var ts; // // @api function createJsxElement(openingElement, children, closingElement) { - var node = createBaseNode(273 /* JsxElement */); + var node = createBaseNode(270 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -23634,7 +22819,7 @@ var ts; } // @api function createJsxSelfClosingElement(tagName, typeArguments, attributes) { - var node = createBaseNode(274 /* JsxSelfClosingElement */); + var node = createBaseNode(271 /* JsxSelfClosingElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -23658,7 +22843,7 @@ var ts; } // @api function createJsxOpeningElement(tagName, typeArguments, attributes) { - var node = createBaseNode(275 /* JsxOpeningElement */); + var node = createBaseNode(272 /* JsxOpeningElement */); node.tagName = tagName; node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; @@ -23682,7 +22867,7 @@ var ts; } // @api function createJsxClosingElement(tagName) { - var node = createBaseNode(276 /* JsxClosingElement */); + var node = createBaseNode(273 /* JsxClosingElement */); node.tagName = tagName; node.transformFlags |= propagateChildFlags(node.tagName) | @@ -23697,7 +22882,7 @@ var ts; } // @api function createJsxFragment(openingFragment, children, closingFragment) { - var node = createBaseNode(277 /* JsxFragment */); + var node = createBaseNode(274 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -23733,19 +22918,19 @@ var ts; } // @api function createJsxOpeningFragment() { - var node = createBaseNode(278 /* JsxOpeningFragment */); + var node = createBaseNode(275 /* JsxOpeningFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } // @api function createJsxJsxClosingFragment() { - var node = createBaseNode(279 /* JsxClosingFragment */); + var node = createBaseNode(276 /* JsxClosingFragment */); node.transformFlags |= 2 /* ContainsJsx */; return node; } // @api function createJsxAttribute(name, initializer) { - var node = createBaseNode(280 /* JsxAttribute */); + var node = createBaseNode(277 /* JsxAttribute */); node.name = name; node.initializer = initializer; node.transformFlags |= @@ -23763,7 +22948,7 @@ var ts; } // @api function createJsxAttributes(properties) { - var node = createBaseNode(281 /* JsxAttributes */); + var node = createBaseNode(278 /* JsxAttributes */); node.properties = createNodeArray(properties); node.transformFlags |= propagateChildrenFlags(node.properties) | @@ -23778,7 +22963,7 @@ var ts; } // @api function createJsxSpreadAttribute(expression) { - var node = createBaseNode(282 /* JsxSpreadAttribute */); + var node = createBaseNode(279 /* JsxSpreadAttribute */); node.expression = expression; node.transformFlags |= propagateChildFlags(node.expression) | @@ -23793,7 +22978,7 @@ var ts; } // @api function createJsxExpression(dotDotDotToken, expression) { - var node = createBaseNode(283 /* JsxExpression */); + var node = createBaseNode(280 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; node.transformFlags |= @@ -23813,7 +22998,7 @@ var ts; // // @api function createCaseClause(expression, statements) { - var node = createBaseNode(284 /* CaseClause */); + var node = createBaseNode(281 /* CaseClause */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.statements = createNodeArray(statements); node.transformFlags |= @@ -23830,7 +23015,7 @@ var ts; } // @api function createDefaultClause(statements) { - var node = createBaseNode(285 /* DefaultClause */); + var node = createBaseNode(282 /* DefaultClause */); node.statements = createNodeArray(statements); node.transformFlags = propagateChildrenFlags(node.statements); return node; @@ -23843,7 +23028,7 @@ var ts; } // @api function createHeritageClause(token, types) { - var node = createBaseNode(286 /* HeritageClause */); + var node = createBaseNode(283 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); node.transformFlags |= propagateChildrenFlags(node.types); @@ -23867,7 +23052,7 @@ var ts; } // @api function createCatchClause(variableDeclaration, block) { - var node = createBaseNode(287 /* CatchClause */); + var node = createBaseNode(284 /* CatchClause */); variableDeclaration = !ts.isString(variableDeclaration) ? variableDeclaration : createVariableDeclaration(variableDeclaration, /*exclamationToken*/ undefined, /*type*/ undefined, @@ -23893,7 +23078,7 @@ var ts; // // @api function createPropertyAssignment(name, initializer) { - var node = createBaseNamedDeclaration(288 /* PropertyAssignment */, + var node = createBaseNamedDeclaration(285 /* PropertyAssignment */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); @@ -23923,7 +23108,7 @@ var ts; } // @api function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createBaseNamedDeclaration(289 /* ShorthandPropertyAssignment */, + var node = createBaseNamedDeclaration(286 /* ShorthandPropertyAssignment */, /*decorators*/ undefined, /*modifiers*/ undefined, name); node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); @@ -23955,7 +23140,7 @@ var ts; } // @api function createSpreadAssignment(expression) { - var node = createBaseNode(290 /* SpreadAssignment */); + var node = createBaseNode(287 /* SpreadAssignment */); node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); node.transformFlags |= propagateChildFlags(node.expression) | @@ -23974,7 +23159,7 @@ var ts; // // @api function createEnumMember(name, initializer) { - var node = createBaseNode(291 /* EnumMember */); + var node = createBaseNode(288 /* EnumMember */); node.name = asName(name); node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); node.transformFlags |= @@ -23995,7 +23180,7 @@ var ts; // // @api function createSourceFile(statements, endOfFileToken, flags) { - var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */); + var node = baseFactory.createBaseSourceFileNode(294 /* SourceFile */); node.statements = createNodeArray(statements); node.endOfFileToken = endOfFileToken; node.flags |= flags; @@ -24012,7 +23197,7 @@ var ts; return node; } function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) { - var node = baseFactory.createBaseSourceFileNode(297 /* SourceFile */); + var node = baseFactory.createBaseSourceFileNode(294 /* SourceFile */); for (var p in source) { if (p === "emitNode" || ts.hasProperty(node, p) || !ts.hasProperty(source, p)) continue; @@ -24050,7 +23235,7 @@ var ts; // @api function createBundle(sourceFiles, prepends) { if (prepends === void 0) { prepends = ts.emptyArray; } - var node = createBaseNode(298 /* Bundle */); + var node = createBaseNode(295 /* Bundle */); node.prepends = prepends; node.sourceFiles = sourceFiles; return node; @@ -24065,7 +23250,7 @@ var ts; } // @api function createUnparsedSource(prologues, syntheticReferences, texts) { - var node = createBaseNode(299 /* UnparsedSource */); + var node = createBaseNode(296 /* UnparsedSource */); node.prologues = prologues; node.syntheticReferences = syntheticReferences; node.texts = texts; @@ -24083,28 +23268,28 @@ var ts; } // @api function createUnparsedPrologue(data) { - return createBaseUnparsedNode(292 /* UnparsedPrologue */, data); + return createBaseUnparsedNode(289 /* UnparsedPrologue */, data); } // @api function createUnparsedPrepend(data, texts) { - var node = createBaseUnparsedNode(293 /* UnparsedPrepend */, data); + var node = createBaseUnparsedNode(290 /* UnparsedPrepend */, data); node.texts = texts; return node; } // @api function createUnparsedTextLike(data, internal) { - return createBaseUnparsedNode(internal ? 295 /* UnparsedInternalText */ : 294 /* UnparsedText */, data); + return createBaseUnparsedNode(internal ? 292 /* UnparsedInternalText */ : 291 /* UnparsedText */, data); } // @api function createUnparsedSyntheticReference(section) { - var node = createBaseNode(296 /* UnparsedSyntheticReference */); + var node = createBaseNode(293 /* UnparsedSyntheticReference */); node.data = section.data; node.section = section; return node; } // @api function createInputFiles() { - var node = createBaseNode(300 /* InputFiles */); + var node = createBaseNode(297 /* InputFiles */); node.javascriptText = ""; node.declarationText = ""; return node; @@ -24115,7 +23300,7 @@ var ts; // @api function createSyntheticExpression(type, isSpread, tupleNameSource) { if (isSpread === void 0) { isSpread = false; } - var node = createBaseNode(227 /* SyntheticExpression */); + var node = createBaseNode(224 /* SyntheticExpression */); node.type = type; node.isSpread = isSpread; node.tupleNameSource = tupleNameSource; @@ -24123,7 +23308,7 @@ var ts; } // @api function createSyntaxList(children) { - var node = createBaseNode(334 /* SyntaxList */); + var node = createBaseNode(329 /* SyntaxList */); node._children = children; return node; } @@ -24138,7 +23323,7 @@ var ts; */ // @api function createNotEmittedStatement(original) { - var node = createBaseNode(335 /* NotEmittedStatement */); + var node = createBaseNode(330 /* NotEmittedStatement */); node.original = original; ts.setTextRange(node, original); return node; @@ -24152,7 +23337,7 @@ var ts; */ // @api function createPartiallyEmittedExpression(expression, original) { - var node = createBaseNode(336 /* PartiallyEmittedExpression */); + var node = createBaseNode(331 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; node.transformFlags |= @@ -24180,7 +23365,7 @@ var ts; } // @api function createCommaListExpression(elements) { - var node = createBaseNode(337 /* CommaListExpression */); + var node = createBaseNode(332 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); node.transformFlags |= propagateChildrenFlags(node.elements); return node; @@ -24197,7 +23382,7 @@ var ts; */ // @api function createEndOfDeclarationMarker(original) { - var node = createBaseNode(339 /* EndOfDeclarationMarker */); + var node = createBaseNode(334 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -24208,14 +23393,14 @@ var ts; */ // @api function createMergeDeclarationMarker(original) { - var node = createBaseNode(338 /* MergeDeclarationMarker */); + var node = createBaseNode(333 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; } // @api function createSyntheticReferenceExpression(expression, thisArg) { - var node = createBaseNode(340 /* SyntheticReferenceExpression */); + var node = createBaseNode(335 /* SyntheticReferenceExpression */); node.expression = expression; node.thisArg = thisArg; node.transformFlags |= @@ -24237,7 +23422,7 @@ var ts; if (node === undefined) { return node; } - var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(297 /* SourceFile */) : + var clone = ts.isSourceFile(node) ? baseFactory.createBaseSourceFileNode(294 /* SourceFile */) : ts.isIdentifier(node) ? baseFactory.createBaseIdentifierNode(78 /* Identifier */) : ts.isPrivateIdentifier(node) ? baseFactory.createBasePrivateIdentifierNode(79 /* PrivateIdentifier */) : !ts.isNodeKind(node.kind) ? baseFactory.createBaseTokenNode(node.kind) : @@ -24344,11 +23529,11 @@ var ts; } function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 207 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); - case 206 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 224 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type); - case 225 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); - case 336 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); + case 204 /* ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression); + case 203 /* TypeAssertionExpression */: return updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 221 /* AsExpression */: return updateAsExpression(outerExpression, expression, outerExpression.type); + case 222 /* NonNullExpression */: return updateNonNullExpression(outerExpression, expression); + case 331 /* PartiallyEmittedExpression */: return updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -24402,13 +23587,13 @@ var ts; case 9 /* BigIntLiteral */: case 10 /* StringLiteral */: return false; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -24811,23 +23996,23 @@ var ts; } function getDefaultTagNameForKind(kind) { switch (kind) { - case 329 /* JSDocTypeTag */: return "type"; - case 327 /* JSDocReturnTag */: return "returns"; - case 328 /* JSDocThisTag */: return "this"; - case 325 /* JSDocEnumTag */: return "enum"; - case 317 /* JSDocAuthorTag */: return "author"; - case 319 /* JSDocClassTag */: return "class"; - case 320 /* JSDocPublicTag */: return "public"; - case 321 /* JSDocPrivateTag */: return "private"; - case 322 /* JSDocProtectedTag */: return "protected"; - case 323 /* JSDocReadonlyTag */: return "readonly"; - case 330 /* JSDocTemplateTag */: return "template"; - case 331 /* JSDocTypedefTag */: return "typedef"; - case 326 /* JSDocParameterTag */: return "param"; - case 333 /* JSDocPropertyTag */: return "prop"; - case 324 /* JSDocCallbackTag */: return "callback"; - case 315 /* JSDocAugmentsTag */: return "augments"; - case 316 /* JSDocImplementsTag */: return "implements"; + case 325 /* JSDocTypeTag */: return "type"; + case 323 /* JSDocReturnTag */: return "returns"; + case 324 /* JSDocThisTag */: return "this"; + case 321 /* JSDocEnumTag */: return "enum"; + case 313 /* JSDocAuthorTag */: return "author"; + case 315 /* JSDocClassTag */: return "class"; + case 316 /* JSDocPublicTag */: return "public"; + case 317 /* JSDocPrivateTag */: return "private"; + case 318 /* JSDocProtectedTag */: return "protected"; + case 319 /* JSDocReadonlyTag */: return "readonly"; + case 326 /* JSDocTemplateTag */: return "template"; + case 327 /* JSDocTypedefTag */: return "typedef"; + case 322 /* JSDocParameterTag */: return "param"; + case 328 /* JSDocPropertyTag */: return "prop"; + case 320 /* JSDocCallbackTag */: return "callback"; + case 311 /* JSDocAugmentsTag */: return "augments"; + case 312 /* JSDocImplementsTag */: return "implements"; default: return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind)); } @@ -24907,69 +24092,69 @@ var ts; */ /* @internal */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 172 /* FirstTypeNode */ && kind <= 195 /* LastTypeNode */) { + if (kind >= 171 /* FirstTypeNode */ && kind <= 192 /* LastTypeNode */) { return -2 /* TypeExcludes */; } switch (kind) { - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 199 /* ArrayLiteralExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 196 /* ArrayLiteralExpression */: return 536879104 /* ArrayLiteralOrCallOrNewExcludes */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return 546379776 /* ModuleExcludes */; - case 160 /* Parameter */: + case 159 /* Parameter */: return 536870912 /* ParameterExcludes */; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return 547309568 /* ArrowFunctionExcludes */; - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: return 547313664 /* FunctionExcludes */; - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return 537018368 /* VariableDeclarationListExcludes */; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return 536905728 /* ClassExcludes */; - case 166 /* Constructor */: + case 165 /* Constructor */: return 547311616 /* ConstructorExcludes */; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return 536875008 /* PropertyExcludes */; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return 538923008 /* MethodOrAccessorExcludes */; case 128 /* AnyKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 141 /* NeverKeyword */: - case 147 /* StringKeyword */: - case 145 /* ObjectKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 140 /* NeverKeyword */: + case 146 /* StringKeyword */: + case 144 /* ObjectKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: case 113 /* VoidKeyword */: - case 159 /* TypeParameter */: - case 162 /* PropertySignature */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 158 /* TypeParameter */: + case 161 /* PropertySignature */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return -2 /* TypeExcludes */; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return 536922112 /* ObjectLiteralExcludes */; - case 287 /* CatchClause */: + case 284 /* CatchClause */: return 536887296 /* CatchClauseExcludes */; - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return 536879104 /* BindingPatternExcludes */; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: - case 336 /* PartiallyEmittedExpression */: - case 207 /* ParenthesizedExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: + case 331 /* PartiallyEmittedExpression */: + case 204 /* ParenthesizedExpression */: case 105 /* SuperKeyword */: return 536870912 /* OuterExpressionExcludes */; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return 536870912 /* PropertyAccessExcludes */; default: return 536870912 /* NodeExcludes */; @@ -25268,7 +24453,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = (_a = ts.getSourceFileOfNode(ts.getParseTreeNode(ts.getSourceFileOfNode(node)))) !== null && _a !== void 0 ? _a : ts.Debug.fail("Could not determine parsed source file."); @@ -26125,11 +25310,11 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 157 /* QualifiedName */; + return node.kind === 156 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 158 /* ComputedPropertyName */; + return node.kind === 157 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; function isPrivateIdentifier(node) { @@ -26164,580 +25349,572 @@ var ts; ts.isExclamationToken = isExclamationToken; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 159 /* TypeParameter */; + return node.kind === 158 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; // TODO(rbuckton): Rename to 'isParameterDeclaration' function isParameter(node) { - return node.kind === 160 /* Parameter */; + return node.kind === 159 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 161 /* Decorator */; + return node.kind === 160 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 162 /* PropertySignature */; + return node.kind === 161 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 163 /* PropertyDeclaration */; + return node.kind === 162 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 164 /* MethodSignature */; + return node.kind === 163 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 165 /* MethodDeclaration */; + return node.kind === 164 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 166 /* Constructor */; + return node.kind === 165 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 167 /* GetAccessor */; + return node.kind === 166 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 168 /* SetAccessor */; + return node.kind === 167 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 169 /* CallSignature */; + return node.kind === 168 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 170 /* ConstructSignature */; + return node.kind === 169 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 171 /* IndexSignature */; + return node.kind === 170 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 172 /* TypePredicate */; + return node.kind === 171 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 173 /* TypeReference */; + return node.kind === 172 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 174 /* FunctionType */; + return node.kind === 173 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 175 /* ConstructorType */; + return node.kind === 174 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 176 /* TypeQuery */; + return node.kind === 175 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 177 /* TypeLiteral */; + return node.kind === 176 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 178 /* ArrayType */; + return node.kind === 177 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 179 /* TupleType */; + return node.kind === 178 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isNamedTupleMember(node) { - return node.kind === 192 /* NamedTupleMember */; + return node.kind === 191 /* NamedTupleMember */; } ts.isNamedTupleMember = isNamedTupleMember; function isOptionalTypeNode(node) { - return node.kind === 180 /* OptionalType */; + return node.kind === 179 /* OptionalType */; } ts.isOptionalTypeNode = isOptionalTypeNode; function isRestTypeNode(node) { - return node.kind === 181 /* RestType */; + return node.kind === 180 /* RestType */; } ts.isRestTypeNode = isRestTypeNode; function isUnionTypeNode(node) { - return node.kind === 182 /* UnionType */; + return node.kind === 181 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 183 /* IntersectionType */; + return node.kind === 182 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; function isConditionalTypeNode(node) { - return node.kind === 184 /* ConditionalType */; + return node.kind === 183 /* ConditionalType */; } ts.isConditionalTypeNode = isConditionalTypeNode; function isInferTypeNode(node) { - return node.kind === 185 /* InferType */; + return node.kind === 184 /* InferType */; } ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 186 /* ParenthesizedType */; + return node.kind === 185 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 187 /* ThisType */; + return node.kind === 186 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 188 /* TypeOperator */; + return node.kind === 187 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 189 /* IndexedAccessType */; + return node.kind === 188 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 190 /* MappedType */; + return node.kind === 189 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 191 /* LiteralType */; + return node.kind === 190 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; function isImportTypeNode(node) { - return node.kind === 195 /* ImportType */; + return node.kind === 192 /* ImportType */; } ts.isImportTypeNode = isImportTypeNode; - function isTemplateLiteralTypeSpan(node) { - return node.kind === 194 /* TemplateLiteralTypeSpan */; - } - ts.isTemplateLiteralTypeSpan = isTemplateLiteralTypeSpan; - function isTemplateLiteralTypeNode(node) { - return node.kind === 193 /* TemplateLiteralType */; - } - ts.isTemplateLiteralTypeNode = isTemplateLiteralTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 196 /* ObjectBindingPattern */; + return node.kind === 193 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 197 /* ArrayBindingPattern */; + return node.kind === 194 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 198 /* BindingElement */; + return node.kind === 195 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 199 /* ArrayLiteralExpression */; + return node.kind === 196 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 200 /* ObjectLiteralExpression */; + return node.kind === 197 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 201 /* PropertyAccessExpression */; + return node.kind === 198 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 202 /* ElementAccessExpression */; + return node.kind === 199 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 203 /* CallExpression */; + return node.kind === 200 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 204 /* NewExpression */; + return node.kind === 201 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 205 /* TaggedTemplateExpression */; + return node.kind === 202 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertionExpression(node) { - return node.kind === 206 /* TypeAssertionExpression */; + return node.kind === 203 /* TypeAssertionExpression */; } ts.isTypeAssertionExpression = isTypeAssertionExpression; function isParenthesizedExpression(node) { - return node.kind === 207 /* ParenthesizedExpression */; + return node.kind === 204 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function isFunctionExpression(node) { - return node.kind === 208 /* FunctionExpression */; + return node.kind === 205 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 209 /* ArrowFunction */; + return node.kind === 206 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 210 /* DeleteExpression */; + return node.kind === 207 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 211 /* TypeOfExpression */; + return node.kind === 208 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 212 /* VoidExpression */; + return node.kind === 209 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 213 /* AwaitExpression */; + return node.kind === 210 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 214 /* PrefixUnaryExpression */; + return node.kind === 211 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 215 /* PostfixUnaryExpression */; + return node.kind === 212 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 216 /* BinaryExpression */; + return node.kind === 213 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 217 /* ConditionalExpression */; + return node.kind === 214 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 218 /* TemplateExpression */; + return node.kind === 215 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 219 /* YieldExpression */; + return node.kind === 216 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 220 /* SpreadElement */; + return node.kind === 217 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 221 /* ClassExpression */; + return node.kind === 218 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 222 /* OmittedExpression */; + return node.kind === 219 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 223 /* ExpressionWithTypeArguments */; + return node.kind === 220 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 224 /* AsExpression */; + return node.kind === 221 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 225 /* NonNullExpression */; + return node.kind === 222 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 226 /* MetaProperty */; + return node.kind === 223 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; function isSyntheticExpression(node) { - return node.kind === 227 /* SyntheticExpression */; + return node.kind === 224 /* SyntheticExpression */; } ts.isSyntheticExpression = isSyntheticExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 336 /* PartiallyEmittedExpression */; + return node.kind === 331 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isCommaListExpression(node) { - return node.kind === 337 /* CommaListExpression */; + return node.kind === 332 /* CommaListExpression */; } ts.isCommaListExpression = isCommaListExpression; // Misc function isTemplateSpan(node) { - return node.kind === 228 /* TemplateSpan */; + return node.kind === 225 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 229 /* SemicolonClassElement */; + return node.kind === 226 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Elements function isBlock(node) { - return node.kind === 230 /* Block */; + return node.kind === 227 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 232 /* VariableStatement */; + return node.kind === 229 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 231 /* EmptyStatement */; + return node.kind === 228 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 233 /* ExpressionStatement */; + return node.kind === 230 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 234 /* IfStatement */; + return node.kind === 231 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 235 /* DoStatement */; + return node.kind === 232 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 236 /* WhileStatement */; + return node.kind === 233 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 237 /* ForStatement */; + return node.kind === 234 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 238 /* ForInStatement */; + return node.kind === 235 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 239 /* ForOfStatement */; + return node.kind === 236 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 240 /* ContinueStatement */; + return node.kind === 237 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 241 /* BreakStatement */; + return node.kind === 238 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isReturnStatement(node) { - return node.kind === 242 /* ReturnStatement */; + return node.kind === 239 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 243 /* WithStatement */; + return node.kind === 240 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 244 /* SwitchStatement */; + return node.kind === 241 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 245 /* LabeledStatement */; + return node.kind === 242 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 246 /* ThrowStatement */; + return node.kind === 243 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 247 /* TryStatement */; + return node.kind === 244 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 248 /* DebuggerStatement */; + return node.kind === 245 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 249 /* VariableDeclaration */; + return node.kind === 246 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 250 /* VariableDeclarationList */; + return node.kind === 247 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 251 /* FunctionDeclaration */; + return node.kind === 248 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 252 /* ClassDeclaration */; + return node.kind === 249 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 253 /* InterfaceDeclaration */; + return node.kind === 250 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 254 /* TypeAliasDeclaration */; + return node.kind === 251 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 255 /* EnumDeclaration */; + return node.kind === 252 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 256 /* ModuleDeclaration */; + return node.kind === 253 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 257 /* ModuleBlock */; + return node.kind === 254 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 258 /* CaseBlock */; + return node.kind === 255 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 259 /* NamespaceExportDeclaration */; + return node.kind === 256 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */; + return node.kind === 257 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 261 /* ImportDeclaration */; + return node.kind === 258 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 262 /* ImportClause */; + return node.kind === 259 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 263 /* NamespaceImport */; + return node.kind === 260 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamespaceExport(node) { - return node.kind === 269 /* NamespaceExport */; + return node.kind === 266 /* NamespaceExport */; } ts.isNamespaceExport = isNamespaceExport; function isNamedImports(node) { - return node.kind === 264 /* NamedImports */; + return node.kind === 261 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 265 /* ImportSpecifier */; + return node.kind === 262 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 266 /* ExportAssignment */; + return node.kind === 263 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 267 /* ExportDeclaration */; + return node.kind === 264 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 268 /* NamedExports */; + return node.kind === 265 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 270 /* ExportSpecifier */; + return node.kind === 267 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 271 /* MissingDeclaration */; + return node.kind === 268 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; function isNotEmittedStatement(node) { - return node.kind === 335 /* NotEmittedStatement */; + return node.kind === 330 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ function isSyntheticReference(node) { - return node.kind === 340 /* SyntheticReferenceExpression */; + return node.kind === 335 /* SyntheticReferenceExpression */; } ts.isSyntheticReference = isSyntheticReference; /* @internal */ function isMergeDeclarationMarker(node) { - return node.kind === 338 /* MergeDeclarationMarker */; + return node.kind === 333 /* MergeDeclarationMarker */; } ts.isMergeDeclarationMarker = isMergeDeclarationMarker; /* @internal */ function isEndOfDeclarationMarker(node) { - return node.kind === 339 /* EndOfDeclarationMarker */; + return node.kind === 334 /* EndOfDeclarationMarker */; } ts.isEndOfDeclarationMarker = isEndOfDeclarationMarker; // Module References function isExternalModuleReference(node) { - return node.kind === 272 /* ExternalModuleReference */; + return node.kind === 269 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 273 /* JsxElement */; + return node.kind === 270 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 274 /* JsxSelfClosingElement */; + return node.kind === 271 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 275 /* JsxOpeningElement */; + return node.kind === 272 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 276 /* JsxClosingElement */; + return node.kind === 273 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 277 /* JsxFragment */; + return node.kind === 274 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 278 /* JsxOpeningFragment */; + return node.kind === 275 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 279 /* JsxClosingFragment */; + return node.kind === 276 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 280 /* JsxAttribute */; + return node.kind === 277 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 281 /* JsxAttributes */; + return node.kind === 278 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 282 /* JsxSpreadAttribute */; + return node.kind === 279 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 283 /* JsxExpression */; + return node.kind === 280 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 284 /* CaseClause */; + return node.kind === 281 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 285 /* DefaultClause */; + return node.kind === 282 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 286 /* HeritageClause */; + return node.kind === 283 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 287 /* CatchClause */; + return node.kind === 284 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 288 /* PropertyAssignment */; + return node.kind === 285 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 289 /* ShorthandPropertyAssignment */; + return node.kind === 286 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 290 /* SpreadAssignment */; + return node.kind === 287 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 291 /* EnumMember */; + return node.kind === 288 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Unparsed // TODO(rbuckton): isUnparsedPrologue function isUnparsedPrepend(node) { - return node.kind === 293 /* UnparsedPrepend */; + return node.kind === 290 /* UnparsedPrepend */; } ts.isUnparsedPrepend = isUnparsedPrepend; // TODO(rbuckton): isUnparsedText @@ -26745,152 +25922,148 @@ var ts; // TODO(rbuckton): isUnparsedSyntheticReference // Top-level nodes function isSourceFile(node) { - return node.kind === 297 /* SourceFile */; + return node.kind === 294 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 298 /* Bundle */; + return node.kind === 295 /* Bundle */; } ts.isBundle = isBundle; function isUnparsedSource(node) { - return node.kind === 299 /* UnparsedSource */; + return node.kind === 296 /* UnparsedSource */; } ts.isUnparsedSource = isUnparsedSource; // TODO(rbuckton): isInputFiles // JSDoc Elements function isJSDocTypeExpression(node) { - return node.kind === 301 /* JSDocTypeExpression */; + return node.kind === 298 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; - function isJSDocNameReference(node) { - return node.kind === 302 /* JSDocNameReference */; - } - ts.isJSDocNameReference = isJSDocNameReference; function isJSDocAllType(node) { - return node.kind === 303 /* JSDocAllType */; + return node.kind === 299 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 304 /* JSDocUnknownType */; + return node.kind === 300 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 305 /* JSDocNullableType */; + return node.kind === 301 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 306 /* JSDocNonNullableType */; + return node.kind === 302 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 307 /* JSDocOptionalType */; + return node.kind === 303 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 308 /* JSDocFunctionType */; + return node.kind === 304 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 309 /* JSDocVariadicType */; + return node.kind === 305 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDocNamepathType(node) { - return node.kind === 310 /* JSDocNamepathType */; + return node.kind === 306 /* JSDocNamepathType */; } ts.isJSDocNamepathType = isJSDocNamepathType; function isJSDoc(node) { - return node.kind === 311 /* JSDocComment */; + return node.kind === 307 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocTypeLiteral(node) { - return node.kind === 312 /* JSDocTypeLiteral */; + return node.kind === 308 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; function isJSDocSignature(node) { - return node.kind === 313 /* JSDocSignature */; + return node.kind === 309 /* JSDocSignature */; } ts.isJSDocSignature = isJSDocSignature; // JSDoc Tags function isJSDocAugmentsTag(node) { - return node.kind === 315 /* JSDocAugmentsTag */; + return node.kind === 311 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocAuthorTag(node) { - return node.kind === 317 /* JSDocAuthorTag */; + return node.kind === 313 /* JSDocAuthorTag */; } ts.isJSDocAuthorTag = isJSDocAuthorTag; function isJSDocClassTag(node) { - return node.kind === 319 /* JSDocClassTag */; + return node.kind === 315 /* JSDocClassTag */; } ts.isJSDocClassTag = isJSDocClassTag; function isJSDocCallbackTag(node) { - return node.kind === 324 /* JSDocCallbackTag */; + return node.kind === 320 /* JSDocCallbackTag */; } ts.isJSDocCallbackTag = isJSDocCallbackTag; function isJSDocPublicTag(node) { - return node.kind === 320 /* JSDocPublicTag */; + return node.kind === 316 /* JSDocPublicTag */; } ts.isJSDocPublicTag = isJSDocPublicTag; function isJSDocPrivateTag(node) { - return node.kind === 321 /* JSDocPrivateTag */; + return node.kind === 317 /* JSDocPrivateTag */; } ts.isJSDocPrivateTag = isJSDocPrivateTag; function isJSDocProtectedTag(node) { - return node.kind === 322 /* JSDocProtectedTag */; + return node.kind === 318 /* JSDocProtectedTag */; } ts.isJSDocProtectedTag = isJSDocProtectedTag; function isJSDocReadonlyTag(node) { - return node.kind === 323 /* JSDocReadonlyTag */; + return node.kind === 319 /* JSDocReadonlyTag */; } ts.isJSDocReadonlyTag = isJSDocReadonlyTag; function isJSDocDeprecatedTag(node) { - return node.kind === 318 /* JSDocDeprecatedTag */; + return node.kind === 314 /* JSDocDeprecatedTag */; } ts.isJSDocDeprecatedTag = isJSDocDeprecatedTag; function isJSDocEnumTag(node) { - return node.kind === 325 /* JSDocEnumTag */; + return node.kind === 321 /* JSDocEnumTag */; } ts.isJSDocEnumTag = isJSDocEnumTag; function isJSDocParameterTag(node) { - return node.kind === 326 /* JSDocParameterTag */; + return node.kind === 322 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 327 /* JSDocReturnTag */; + return node.kind === 323 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocThisTag(node) { - return node.kind === 328 /* JSDocThisTag */; + return node.kind === 324 /* JSDocThisTag */; } ts.isJSDocThisTag = isJSDocThisTag; function isJSDocTypeTag(node) { - return node.kind === 329 /* JSDocTypeTag */; + return node.kind === 325 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 330 /* JSDocTemplateTag */; + return node.kind === 326 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 331 /* JSDocTypedefTag */; + return node.kind === 327 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocUnknownTag(node) { - return node.kind === 314 /* JSDocTag */; + return node.kind === 310 /* JSDocTag */; } ts.isJSDocUnknownTag = isJSDocUnknownTag; function isJSDocPropertyTag(node) { - return node.kind === 333 /* JSDocPropertyTag */; + return node.kind === 328 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocImplementsTag(node) { - return node.kind === 316 /* JSDocImplementsTag */; + return node.kind === 312 /* JSDocImplementsTag */; } ts.isJSDocImplementsTag = isJSDocImplementsTag; // Synthesized list /* @internal */ function isSyntaxList(n) { - return n.kind === 334 /* SyntaxList */; + return n.kind === 329 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; })(ts || (ts = {})); @@ -26941,13 +26114,12 @@ var ts; createJsxFactoryExpressionFromEntityName(factory, jsxFactoryEntity, parent) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), "createElement"); } - ts.createJsxFactoryExpression = createJsxFactoryExpression; function createJsxFragmentFactoryExpression(factory, jsxFragmentFactoryEntity, reactNamespace, parent) { return jsxFragmentFactoryEntity ? createJsxFactoryExpressionFromEntityName(factory, jsxFragmentFactoryEntity, parent) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent), "Fragment"); } - function createExpressionForJsxElement(factory, callee, tagName, props, children, location) { + function createExpressionForJsxElement(factory, jsxFactoryEntity, reactNamespace, tagName, props, children, parentElement, location) { var argumentsList = [tagName]; if (props) { argumentsList.push(props); @@ -26967,7 +26139,7 @@ var ts; argumentsList.push(children[0]); } } - return ts.setTextRange(factory.createCallExpression(callee, + return ts.setTextRange(factory.createCallExpression(createJsxFactoryExpression(factory, jsxFactoryEntity, reactNamespace, parentElement), /*typeArguments*/ undefined, argumentsList), location); } ts.createExpressionForJsxElement = createExpressionForJsxElement; @@ -27089,14 +26261,14 @@ var ts; ts.Debug.failBadSyntaxKind(property.name, "Private identifiers are not allowed in object literals."); } switch (property.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return createExpressionForAccessorDeclaration(factory, node.properties, property, receiver, !!node.multiLine); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return createExpressionForPropertyAssignment(factory, property, receiver); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(factory, property, receiver); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return createExpressionForMethodDeclaration(factory, property, receiver); } } @@ -27149,21 +26321,21 @@ var ts; } ts.startsWithUseStrict = startsWithUseStrict; function isCommaSequence(node) { - return node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || - node.kind === 337 /* CommaListExpression */; + return node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || + node.kind === 332 /* CommaListExpression */; } ts.isCommaSequence = isCommaSequence; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 15 /* All */; } switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return (kinds & 2 /* TypeAssertions */) !== 0; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return (kinds & 4 /* NonNullAssertions */) !== 0; - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -27280,14 +26452,14 @@ var ts; */ function getLocalNameForExternalImport(factory, node, sourceFile) { var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); - if (namespaceDeclaration && !ts.isDefaultImport(node) && !ts.isExportNamespaceAsDefaultDeclaration(node)) { + if (namespaceDeclaration && !ts.isDefaultImport(node)) { var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : factory.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 261 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 258 /* ImportDeclaration */ && node.importClause) { return factory.getGeneratedNameForNode(node); } - if (node.kind === 267 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 264 /* ExportDeclaration */ && node.moduleSpecifier) { return factory.getGeneratedNameForNode(node); } return undefined; @@ -27406,7 +26578,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -27418,11 +26590,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -27454,12 +26626,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 160 /* Parameter */: - case 198 /* BindingElement */: + case 159 /* Parameter */: + case 195 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 220 /* SpreadElement */: - case 290 /* SpreadAssignment */: + case 217 /* SpreadElement */: + case 287 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -27477,7 +26649,7 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 198 /* BindingElement */: + case 195 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -27492,7 +26664,7 @@ var ts; : propertyName; } break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -27507,7 +26679,7 @@ var ts; : propertyName; } break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` if (bindingElement.name && ts.isPrivateIdentifier(bindingElement.name)) { return ts.Debug.failBadSyntaxKind(bindingElement.name); @@ -27530,13 +26702,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: - case 199 /* ArrayLiteralExpression */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 196 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -27557,29 +26729,29 @@ var ts; ts.getJSDocTypeAliasName = getJSDocTypeAliasName; function canHaveModifiers(node) { var kind = node.kind; - return kind === 160 /* Parameter */ - || kind === 162 /* PropertySignature */ - || kind === 163 /* PropertyDeclaration */ - || kind === 164 /* MethodSignature */ - || kind === 165 /* MethodDeclaration */ - || kind === 166 /* Constructor */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 171 /* IndexSignature */ - || kind === 208 /* FunctionExpression */ - || kind === 209 /* ArrowFunction */ - || kind === 221 /* ClassExpression */ - || kind === 232 /* VariableStatement */ - || kind === 251 /* FunctionDeclaration */ - || kind === 252 /* ClassDeclaration */ - || kind === 253 /* InterfaceDeclaration */ - || kind === 254 /* TypeAliasDeclaration */ - || kind === 255 /* EnumDeclaration */ - || kind === 256 /* ModuleDeclaration */ - || kind === 260 /* ImportEqualsDeclaration */ - || kind === 261 /* ImportDeclaration */ - || kind === 266 /* ExportAssignment */ - || kind === 267 /* ExportDeclaration */; + return kind === 159 /* Parameter */ + || kind === 161 /* PropertySignature */ + || kind === 162 /* PropertyDeclaration */ + || kind === 163 /* MethodSignature */ + || kind === 164 /* MethodDeclaration */ + || kind === 165 /* Constructor */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 170 /* IndexSignature */ + || kind === 205 /* FunctionExpression */ + || kind === 206 /* ArrowFunction */ + || kind === 218 /* ClassExpression */ + || kind === 229 /* VariableStatement */ + || kind === 248 /* FunctionDeclaration */ + || kind === 249 /* ClassDeclaration */ + || kind === 250 /* InterfaceDeclaration */ + || kind === 251 /* TypeAliasDeclaration */ + || kind === 252 /* EnumDeclaration */ + || kind === 253 /* ModuleDeclaration */ + || kind === 257 /* ImportEqualsDeclaration */ + || kind === 258 /* ImportDeclaration */ + || kind === 263 /* ExportAssignment */ + || kind === 264 /* ExportDeclaration */; } ts.canHaveModifiers = canHaveModifiers; /* @internal */ @@ -27678,19 +26850,19 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 156 /* LastToken */) { + if (!node || node.kind <= 155 /* LastToken */) { return; } switch (node.kind) { - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -27698,9 +26870,9 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -27708,7 +26880,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -27716,51 +26888,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -27772,374 +26944,364 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 179 /* TupleType */: + case 178 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elements); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); - case 185 /* InferType */: + case 184 /* InferType */: return visitNode(cbNode, node.typeParameter); - case 195 /* ImportType */: + case 192 /* ImportType */: return visitNode(cbNode, node.argument) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 186 /* ParenthesizedType */: - case 188 /* TypeOperator */: + case 185 /* ParenthesizedType */: + case 187 /* TypeOperator */: return visitNode(cbNode, node.type); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 190 /* MappedType */: + case 189 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || - visitNode(cbNode, node.nameType) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return visitNode(cbNode, node.literal); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); - case 203 /* CallExpression */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 224 /* AsExpression */: + case 221 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return visitNode(cbNode, node.name); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 297 /* SourceFile */: + case 294 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: return visitNode(cbNode, node.label); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 284 /* CaseClause */: + case 281 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 161 /* Decorator */: + case 160 /* Decorator */: return visitNode(cbNode, node.expression); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 291 /* EnumMember */: + case 288 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return visitNode(cbNode, node.name); - case 264 /* NamedImports */: - case 268 /* NamedExports */: + case 261 /* NamedImports */: + case 265 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 193 /* TemplateLiteralType */: - return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 194 /* TemplateLiteralTypeSpan */: - return visitNode(cbNode, node.type) || visitNode(cbNode, node.literal); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 180 /* OptionalType */: - case 181 /* RestType */: - case 301 /* JSDocTypeExpression */: - case 306 /* JSDocNonNullableType */: - case 305 /* JSDocNullableType */: - case 307 /* JSDocOptionalType */: - case 309 /* JSDocVariadicType */: + case 179 /* OptionalType */: + case 180 /* RestType */: + case 298 /* JSDocTypeExpression */: + case 302 /* JSDocNonNullableType */: + case 301 /* JSDocNullableType */: + case 303 /* JSDocOptionalType */: + case 305 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 311 /* JSDocComment */: + case 307 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 332 /* JSDocSeeTag */: - return visitNode(cbNode, node.tagName) || - visitNode(cbNode, node.name); - case 302 /* JSDocNameReference */: - return visitNode(cbNode, node.name); - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)); - case 317 /* JSDocAuthorTag */: + case 313 /* JSDocAuthorTag */: return visitNode(cbNode, node.tagName); - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters); - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return visitNode(cbNode, node.tagName) || (node.typeExpression && - node.typeExpression.kind === 301 /* JSDocTypeExpression */ + node.typeExpression.kind === 298 /* JSDocTypeExpression */ ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression)); - case 324 /* JSDocCallbackTag */: + case 320 /* JSDocCallbackTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 328 /* JSDocThisTag */: - case 325 /* JSDocEnumTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 324 /* JSDocThisTag */: + case 321 /* JSDocEnumTag */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression); - case 313 /* JSDocSignature */: + case 309 /* JSDocSignature */: return ts.forEach(node.typeParameters, cbNode) || ts.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); - case 312 /* JSDocTypeLiteral */: + case 308 /* JSDocTypeLiteral */: return ts.forEach(node.jsDocPropertyTags, cbNode); - case 314 /* JSDocTag */: - case 319 /* JSDocClassTag */: - case 320 /* JSDocPublicTag */: - case 321 /* JSDocPrivateTag */: - case 322 /* JSDocProtectedTag */: - case 323 /* JSDocReadonlyTag */: + case 310 /* JSDocTag */: + case 315 /* JSDocClassTag */: + case 316 /* JSDocPublicTag */: + case 317 /* JSDocPrivateTag */: + case 318 /* JSDocProtectedTag */: + case 319 /* JSDocReadonlyTag */: return visitNode(cbNode, node.tagName); - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -28214,8 +27376,6 @@ var ts; ts.forEachChildRecursively = forEachChildRecursively; function createSourceFile(fileName, sourceText, languageVersion, setParentNodes, scriptKind) { if (setParentNodes === void 0) { setParentNodes = false; } - var tracingData = ["parse" /* Parse */, "createSourceFile", { path: fileName }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeParse"); var result; ts.perfLogger.logStartParseSourceFile(fileName); @@ -28228,7 +27388,6 @@ var ts; ts.perfLogger.logStopParseSourceFile(); ts.performance.mark("afterParse"); ts.performance.measure("Parse", "beforeParse", "afterParse"); - ts.tracing.end.apply(ts.tracing, tracingData); return result; } ts.createSourceFile = createSourceFile; @@ -29089,7 +28248,7 @@ var ts; ts.isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode(kind, "", "", /*templateFlags*/ undefined) : kind === 8 /* NumericLiteral */ ? factory.createNumericLiteral("", /*numericLiteralFlags*/ undefined) : kind === 10 /* StringLiteral */ ? factory.createStringLiteral("", /*isSingleQuote*/ undefined) : - kind === 271 /* MissingDeclaration */ ? factory.createMissingDeclaration() : + kind === 268 /* MissingDeclaration */ ? factory.createMissingDeclaration() : factory.createToken(kind); return finishNode(result, pos); } @@ -29203,7 +28362,7 @@ var ts; if (token() === 87 /* DefaultKeyword */) { return lookAhead(nextTokenCanFollowDefaultKeyword); } - if (token() === 149 /* TypeKeyword */) { + if (token() === 148 /* TypeKeyword */) { return lookAhead(nextTokenCanFollowExportModifier); } return canFollowExportModifier(); @@ -29211,7 +28370,7 @@ var ts; return nextTokenCanFollowDefaultKeyword(); case 123 /* StaticKeyword */: case 134 /* GetKeyword */: - case 146 /* SetKeyword */: + case 145 /* SetKeyword */: nextToken(); return canFollowModifier(); default: @@ -29621,14 +28780,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 166 /* Constructor */: - case 171 /* IndexSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 229 /* SemicolonClassElement */: + case 165 /* Constructor */: + case 170 /* IndexSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 226 /* SemicolonClassElement */: return true; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -29643,8 +28802,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: return true; } } @@ -29653,58 +28812,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 232 /* VariableStatement */: - case 230 /* Block */: - case 234 /* IfStatement */: - case 233 /* ExpressionStatement */: - case 246 /* ThrowStatement */: - case 242 /* ReturnStatement */: - case 244 /* SwitchStatement */: - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 237 /* ForStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 231 /* EmptyStatement */: - case 247 /* TryStatement */: - case 245 /* LabeledStatement */: - case 235 /* DoStatement */: - case 248 /* DebuggerStatement */: - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 248 /* FunctionDeclaration */: + case 229 /* VariableStatement */: + case 227 /* Block */: + case 231 /* IfStatement */: + case 230 /* ExpressionStatement */: + case 243 /* ThrowStatement */: + case 239 /* ReturnStatement */: + case 241 /* SwitchStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 234 /* ForStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 228 /* EmptyStatement */: + case 244 /* TryStatement */: + case 242 /* LabeledStatement */: + case 232 /* DoStatement */: + case 245 /* DebuggerStatement */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 291 /* EnumMember */; + return node.kind === 288 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 162 /* PropertySignature */: - case 169 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 161 /* PropertySignature */: + case 168 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 249 /* VariableDeclaration */) { + if (node.kind !== 246 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -29725,7 +28884,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 160 /* Parameter */) { + if (node.kind !== 159 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -29734,7 +28893,7 @@ var ts; } // Returns true if we should abort parsing. function abortParsingListOrMoveToNextToken(kind) { - parsingContextErrors(kind); + parseErrorAtCurrentToken(parsingContextErrors(kind)); if (isInSomeParsingContext()) { return true; } @@ -29743,34 +28902,31 @@ var ts; } function parsingContextErrors(context) { switch (context) { - case 0 /* SourceElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); - case 1 /* BlockStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Declaration_or_statement_expected); - case 2 /* SwitchClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.case_or_default_expected); - case 3 /* SwitchClauseStatements */: return parseErrorAtCurrentToken(ts.Diagnostics.Statement_expected); + case 0 /* SourceElements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 1 /* BlockStatements */: return ts.Diagnostics.Declaration_or_statement_expected; + case 2 /* SwitchClauses */: return ts.Diagnostics.case_or_default_expected; + case 3 /* SwitchClauseStatements */: return ts.Diagnostics.Statement_expected; case 18 /* RestProperties */: // fallthrough - case 4 /* TypeMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_or_signature_expected); - case 5 /* ClassMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); - case 6 /* EnumMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Enum_member_expected); - case 7 /* HeritageClauseElement */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_expected); - case 8 /* VariableDeclarations */: - return ts.isKeyword(token()) - ? parseErrorAtCurrentToken(ts.Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, ts.tokenToString(token())) - : parseErrorAtCurrentToken(ts.Diagnostics.Variable_declaration_expected); - case 9 /* ObjectBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_destructuring_pattern_expected); - case 10 /* ArrayBindingElements */: return parseErrorAtCurrentToken(ts.Diagnostics.Array_element_destructuring_pattern_expected); - case 11 /* ArgumentExpressions */: return parseErrorAtCurrentToken(ts.Diagnostics.Argument_expression_expected); - case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_assignment_expected); - case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_or_comma_expected); - case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); - case 16 /* Parameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected); - case 19 /* TypeParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_parameter_declaration_expected); - case 20 /* TypeArguments */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_argument_expected); - case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_expected); - case 22 /* HeritageClauses */: return parseErrorAtCurrentToken(ts.Diagnostics.Unexpected_token_expected); - case 23 /* ImportOrExportSpecifiers */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - case 13 /* JsxAttributes */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - case 14 /* JsxChildren */: return parseErrorAtCurrentToken(ts.Diagnostics.Identifier_expected); - default: return [undefined]; // TODO: GH#18217 `default: Debug.assertNever(context);` + case 4 /* TypeMembers */: return ts.Diagnostics.Property_or_signature_expected; + case 5 /* ClassMembers */: return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; + case 6 /* EnumMembers */: return ts.Diagnostics.Enum_member_expected; + case 7 /* HeritageClauseElement */: return ts.Diagnostics.Expression_expected; + case 8 /* VariableDeclarations */: return ts.Diagnostics.Variable_declaration_expected; + case 9 /* ObjectBindingElements */: return ts.Diagnostics.Property_destructuring_pattern_expected; + case 10 /* ArrayBindingElements */: return ts.Diagnostics.Array_element_destructuring_pattern_expected; + case 11 /* ArgumentExpressions */: return ts.Diagnostics.Argument_expression_expected; + case 12 /* ObjectLiteralMembers */: return ts.Diagnostics.Property_assignment_expected; + case 15 /* ArrayLiteralMembers */: return ts.Diagnostics.Expression_or_comma_expected; + case 17 /* JSDocParameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 16 /* Parameters */: return ts.Diagnostics.Parameter_declaration_expected; + case 19 /* TypeParameters */: return ts.Diagnostics.Type_parameter_declaration_expected; + case 20 /* TypeArguments */: return ts.Diagnostics.Type_argument_expected; + case 21 /* TupleElementTypes */: return ts.Diagnostics.Type_expected; + case 22 /* HeritageClauses */: return ts.Diagnostics.Unexpected_token_expected; + case 23 /* ImportOrExportSpecifiers */: return ts.Diagnostics.Identifier_expected; + case 13 /* JsxAttributes */: return ts.Diagnostics.Identifier_expected; + case 14 /* JsxChildren */: return ts.Diagnostics.Identifier_expected; + default: return undefined; // TODO: GH#18217 `default: Debug.assertNever(context);` } } // Parses a comma-delimited list of elements @@ -29915,24 +29071,6 @@ var ts; var pos = getNodePos(); return finishNode(factory.createTemplateExpression(parseTemplateHead(isTaggedTemplate), parseTemplateSpans(isTaggedTemplate)), pos); } - function parseTemplateType() { - var pos = getNodePos(); - return finishNode(factory.createTemplateLiteralType(parseTemplateHead(/*isTaggedTemplate*/ false), parseTemplateTypeSpans()), pos); - } - function parseTemplateTypeSpans() { - var pos = getNodePos(); - var list = []; - var node; - do { - node = parseTemplateTypeSpan(); - list.push(node); - } while (node.literal.kind === 16 /* TemplateMiddle */); - return createNodeArray(list, pos); - } - function parseTemplateTypeSpan() { - var pos = getNodePos(); - return finishNode(factory.createTemplateLiteralTypeSpan(parseType(), parseLiteralOfTemplateSpan(/*isTaggedTemplate*/ false)), pos); - } function parseLiteralOfTemplateSpan(isTaggedTemplate) { if (token() === 19 /* CloseBraceToken */) { reScanTemplateToken(isTaggedTemplate); @@ -30006,14 +29144,14 @@ var ts; // If true, we should abort parsing an error function. function typeHasArrowFunctionBlockingParseError(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return ts.nodeIsMissing(node.typeName); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: { + case 173 /* FunctionType */: + case 174 /* ConstructorType */: { var _a = node, parameters = _a.parameters, type = _a.type; return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); } - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return typeHasArrowFunctionBlockingParseError(node.type); default: return false; @@ -30093,7 +29231,7 @@ var ts; function parseJSDocType() { scanner.setInJSDocType(true); var pos = getNodePos(); - if (parseOptional(139 /* ModuleKeyword */)) { + if (parseOptional(138 /* ModuleKeyword */)) { // TODO(rbuckton): We never set the type for a JSDocNamepathType. What should we put here? var moduleTag = factory.createJSDocNamepathType(/*type*/ undefined); terminate: while (true) { @@ -30293,14 +29431,14 @@ var ts; function parseSignatureMember(kind) { var pos = getNodePos(); var hasJSDoc = hasPrecedingJSDocComment(); - if (kind === 170 /* ConstructSignature */) { + if (kind === 169 /* ConstructSignature */) { parseExpected(102 /* NewKeyword */); } var typeParameters = parseTypeParameters(); var parameters = parseParameters(4 /* Type */); var type = parseReturnType(58 /* ColonToken */, /*isType*/ true); parseTypeMemberSemicolon(); - var node = kind === 169 /* CallSignature */ + var node = kind === 168 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, type) : factory.createConstructSignature(typeParameters, parameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -30423,10 +29561,10 @@ var ts; } function parseTypeMember() { if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { - return parseSignatureMember(169 /* CallSignature */); + return parseSignatureMember(168 /* CallSignature */); } if (token() === 102 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(170 /* ConstructSignature */); + return parseSignatureMember(169 /* ConstructSignature */); } var pos = getNodePos(); var hasJSDoc = hasPrecedingJSDocComment(); @@ -30470,9 +29608,9 @@ var ts; function isStartOfMappedType() { nextToken(); if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { - return nextToken() === 142 /* ReadonlyKeyword */; + return nextToken() === 141 /* ReadonlyKeyword */; } - if (token() === 142 /* ReadonlyKeyword */) { + if (token() === 141 /* ReadonlyKeyword */) { nextToken(); } return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 100 /* InKeyword */; @@ -30488,15 +29626,14 @@ var ts; var pos = getNodePos(); parseExpected(18 /* OpenBraceToken */); var readonlyToken; - if (token() === 142 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { + if (token() === 141 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { readonlyToken = parseTokenNode(); - if (readonlyToken.kind !== 142 /* ReadonlyKeyword */) { - parseExpected(142 /* ReadonlyKeyword */); + if (readonlyToken.kind !== 141 /* ReadonlyKeyword */) { + parseExpected(141 /* ReadonlyKeyword */); } } parseExpected(22 /* OpenBracketToken */); var typeParameter = parseMappedTypeParameter(); - var nameType = parseOptional(126 /* AsKeyword */) ? parseType() : undefined; parseExpected(23 /* CloseBracketToken */); var questionToken; if (token() === 57 /* QuestionToken */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { @@ -30508,7 +29645,7 @@ var ts; var type = parseTypeAnnotation(); parseSemicolon(); parseExpected(19 /* CloseBraceToken */); - return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type), pos); + return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, questionToken, type), pos); } function parseTupleElementType() { var pos = getNodePos(); @@ -30610,15 +29747,15 @@ var ts; function parseNonArrayType() { switch (token()) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: - case 148 /* SymbolKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: + case 147 /* SymbolKeyword */: case 131 /* BooleanKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: - case 145 /* ObjectKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: + case 144 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 65 /* AsteriskEqualsToken */: @@ -30651,7 +29788,7 @@ var ts; return parseTokenNode(); case 107 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 136 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -30670,8 +29807,6 @@ var ts; return parseImportType(); case 127 /* AssertsKeyword */: return lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine) ? parseAssertsTypePredicate() : parseTypeReference(); - case 15 /* TemplateHead */: - return parseTemplateType(); default: return parseTypeReference(); } @@ -30679,20 +29814,20 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: - case 142 /* ReadonlyKeyword */: - case 148 /* SymbolKeyword */: - case 151 /* UniqueKeyword */: + case 141 /* ReadonlyKeyword */: + case 147 /* SymbolKeyword */: + case 150 /* UniqueKeyword */: case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: case 103 /* NullKeyword */: case 107 /* ThisKeyword */: case 111 /* TypeOfKeyword */: - case 141 /* NeverKeyword */: + case 140 /* NeverKeyword */: case 18 /* OpenBraceToken */: case 22 /* OpenBracketToken */: case 29 /* LessThanToken */: @@ -30704,7 +29839,7 @@ var ts; case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: case 41 /* AsteriskToken */: case 57 /* QuestionToken */: case 53 /* ExclamationToken */: @@ -30712,8 +29847,6 @@ var ts; case 135 /* InferKeyword */: case 99 /* ImportKeyword */: case 127 /* AssertsKeyword */: - case 14 /* NoSubstitutionTemplateLiteral */: - case 15 /* TemplateHead */: return true; case 97 /* FunctionKeyword */: return !inStartOfParameter; @@ -30785,9 +29918,9 @@ var ts; function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 138 /* KeyOfKeyword */: - case 151 /* UniqueKeyword */: - case 142 /* ReadonlyKeyword */: + case 137 /* KeyOfKeyword */: + case 150 /* UniqueKeyword */: + case 141 /* ReadonlyKeyword */: return parseTypeOperator(operator); case 135 /* InferKeyword */: return parseInferType(); @@ -30904,7 +30037,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 137 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 136 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -30913,7 +30046,7 @@ var ts; var pos = getNodePos(); var assertsModifier = parseExpectedToken(127 /* AssertsKeyword */); var parameterName = token() === 107 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); - var type = parseOptional(137 /* IsKeyword */) ? parseType() : undefined; + var type = parseOptional(136 /* IsKeyword */) ? parseType() : undefined; return finishNode(factory.createTypePredicateNode(assertsModifier, parameterName, type), pos); } function parseType() { @@ -31445,7 +30578,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand, pos); } function isInOrOfKeyword(t) { - return t === 100 /* InKeyword */ || t === 156 /* OfKeyword */; + return t === 100 /* InKeyword */ || t === 155 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand, pos) { while (true) { @@ -31585,7 +30718,7 @@ var ts; if (token() === 42 /* AsteriskAsteriskToken */) { var pos = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); var end = simpleUnaryExpression.end; - if (simpleUnaryExpression.kind === 206 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 203 /* TypeAssertionExpression */) { parseErrorAt(pos, end, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -31836,7 +30969,7 @@ var ts; var pos = getNodePos(); var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 275 /* JsxOpeningElement */) { + if (opening.kind === 272 /* JsxOpeningElement */) { var children = parseJsxChildren(opening); var closingElement = parseJsxClosingElement(inExpressionContext); if (!tagNamesAreEquivalent(opening.tagName, closingElement.tagName)) { @@ -31844,11 +30977,11 @@ var ts; } result = finishNode(factory.createJsxElement(opening, children, closingElement), pos); } - else if (opening.kind === 278 /* JsxOpeningFragment */) { + else if (opening.kind === 275 /* JsxOpeningFragment */) { result = finishNode(factory.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos); } else { - ts.Debug.assert(opening.kind === 274 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 271 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -32343,10 +31476,10 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(); if (parseContextualModifier(134 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */); + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 166 /* GetAccessor */); } - if (parseContextualModifier(146 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */); + if (parseContextualModifier(145 /* SetKeyword */)) { + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* SetAccessor */); } var asteriskToken = parseOptionalToken(41 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -32557,7 +31690,7 @@ var ts; } } var node; - if (awaitToken ? parseExpected(156 /* OfKeyword */) : parseOptional(156 /* OfKeyword */)) { + if (awaitToken ? parseExpected(155 /* OfKeyword */) : parseOptional(155 /* OfKeyword */)) { var expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(21 /* CloseParenToken */); node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement()); @@ -32583,10 +31716,10 @@ var ts; } function parseBreakOrContinueStatement(kind) { var pos = getNodePos(); - parseExpected(kind === 241 /* BreakStatement */ ? 80 /* BreakKeyword */ : 85 /* ContinueKeyword */); + parseExpected(kind === 238 /* BreakStatement */ ? 80 /* BreakKeyword */ : 85 /* ContinueKeyword */); var label = canParseSemicolon() ? undefined : parseIdentifier(); parseSemicolon(); - var node = kind === 241 /* BreakStatement */ + var node = kind === 238 /* BreakStatement */ ? factory.createBreakStatement(label) : factory.createContinueStatement(label); return finishNode(node, pos); @@ -32765,10 +31898,10 @@ var ts; // // could be legal, it would add complexity for very little gain. case 117 /* InterfaceKeyword */: - case 149 /* TypeKeyword */: + case 148 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 125 /* AbstractKeyword */: case 129 /* AsyncKeyword */: @@ -32776,14 +31909,14 @@ var ts; case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 122 /* PublicKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 154 /* GlobalKeyword */: + case 153 /* GlobalKeyword */: nextToken(); return token() === 18 /* OpenBraceToken */ || token() === 78 /* Identifier */ || token() === 92 /* ExportKeyword */; case 99 /* ImportKeyword */: @@ -32792,7 +31925,7 @@ var ts; token() === 18 /* OpenBraceToken */ || ts.tokenIsIdentifierOrKeyword(token()); case 92 /* ExportKeyword */: var currentToken_1 = nextToken(); - if (currentToken_1 === 149 /* TypeKeyword */) { + if (currentToken_1 === 148 /* TypeKeyword */) { currentToken_1 = lookAhead(nextToken); } if (currentToken_1 === 62 /* EqualsToken */ || currentToken_1 === 41 /* AsteriskToken */ || @@ -32848,17 +31981,17 @@ var ts; case 129 /* AsyncKeyword */: case 133 /* DeclareKeyword */: case 117 /* InterfaceKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: - case 149 /* TypeKeyword */: - case 154 /* GlobalKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: + case 148 /* TypeKeyword */: + case 153 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: case 123 /* StaticKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -32901,9 +32034,9 @@ var ts; case 96 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 85 /* ContinueKeyword */: - return parseBreakOrContinueStatement(240 /* ContinueStatement */); + return parseBreakOrContinueStatement(237 /* ContinueStatement */); case 80 /* BreakKeyword */: - return parseBreakOrContinueStatement(241 /* BreakStatement */); + return parseBreakOrContinueStatement(238 /* BreakStatement */); case 104 /* ReturnKeyword */: return parseReturnStatement(); case 115 /* WithKeyword */: @@ -32924,9 +32057,9 @@ var ts; return parseDeclaration(); case 129 /* AsyncKeyword */: case 117 /* InterfaceKeyword */: - case 149 /* TypeKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 148 /* TypeKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: case 133 /* DeclareKeyword */: case 84 /* ConstKeyword */: case 91 /* EnumKeyword */: @@ -32937,8 +32070,8 @@ var ts; case 122 /* PublicKeyword */: case 125 /* AbstractKeyword */: case 123 /* StaticKeyword */: - case 142 /* ReadonlyKeyword */: - case 154 /* GlobalKeyword */: + case 141 /* ReadonlyKeyword */: + case 153 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -32998,13 +32131,13 @@ var ts; return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers); case 117 /* InterfaceKeyword */: return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers); - case 149 /* TypeKeyword */: + case 148 /* TypeKeyword */: return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers); case 91 /* EnumKeyword */: return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers); - case 154 /* GlobalKeyword */: - case 139 /* ModuleKeyword */: - case 140 /* NamespaceKeyword */: + case 153 /* GlobalKeyword */: + case 138 /* ModuleKeyword */: + case 139 /* NamespaceKeyword */: return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers); case 99 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers); @@ -33023,7 +32156,7 @@ var ts; if (decorators || modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(271 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(268 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); ts.setTextRangePos(missing, pos); missing.decorators = decorators; missing.modifiers = modifiers; @@ -33142,7 +32275,7 @@ var ts; // this context. // The checker will then give an error that there is an empty declaration list. var declarations; - if (token() === 156 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 155 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { declarations = createMissingList(); } else { @@ -33246,12 +32379,12 @@ var ts; var parameters = parseParameters(0 /* None */); var type = parseReturnType(58 /* ColonToken */, /*isType*/ false); var body = parseFunctionBlockOrSemicolon(0 /* None */); - var node = kind === 167 /* GetAccessor */ + var node = kind === 166 /* GetAccessor */ ? factory.createGetAccessorDeclaration(decorators, modifiers, name, parameters, type, body) : factory.createSetAccessorDeclaration(decorators, modifiers, name, parameters, body); // Keep track of `typeParameters` (for both) and `type` (for setters) if they were parsed those indicate grammar errors node.typeParameters = typeParameters; - if (type && node.kind === 168 /* SetAccessor */) + if (type && node.kind === 167 /* SetAccessor */) node.type = type; return withJSDoc(finishNode(node, pos), hasJSDoc); } @@ -33290,7 +32423,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 146 /* SetKeyword */ || idToken === 134 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 145 /* SetKeyword */ || idToken === 134 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -33394,10 +32527,10 @@ var ts; var decorators = parseDecorators(); var modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); if (parseContextualModifier(134 /* GetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* GetAccessor */); + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 166 /* GetAccessor */); } - if (parseContextualModifier(146 /* SetKeyword */)) { - return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 168 /* SetAccessor */); + if (parseContextualModifier(145 /* SetKeyword */)) { + return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 167 /* SetAccessor */); } if (token() === 132 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { var constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers); @@ -33436,10 +32569,10 @@ var ts; return ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, 221 /* ClassExpression */); + return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), /*decorators*/ undefined, /*modifiers*/ undefined, 218 /* ClassExpression */); } function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) { - return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 252 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 249 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) { var savedAwaitContext = inAwaitContext(); @@ -33461,7 +32594,7 @@ var ts; members = createMissingList(); } setAwaitContext(savedAwaitContext); - var node = kind === 252 /* ClassDeclaration */ + var node = kind === 249 /* ClassDeclaration */ ? factory.createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) : factory.createClassExpression(decorators, modifiers, name, typeParameters, heritageClauses, members); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -33521,11 +32654,11 @@ var ts; return withJSDoc(finishNode(node, pos), hasJSDoc); } function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) { - parseExpected(149 /* TypeKeyword */); + parseExpected(148 /* TypeKeyword */); var name = parseIdentifier(); var typeParameters = parseTypeParameters(); parseExpected(62 /* EqualsToken */); - var type = token() === 136 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType(); + var type = parseType(); parseSemicolon(); var node = factory.createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type); return withJSDoc(finishNode(node, pos), hasJSDoc); @@ -33581,7 +32714,7 @@ var ts; function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { var flags = 0; var name; - if (token() === 154 /* GlobalKeyword */) { + if (token() === 153 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation name = parseIdentifier(); flags |= 1024 /* GlobalAugmentation */; @@ -33602,15 +32735,15 @@ var ts; } function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { var flags = 0; - if (token() === 154 /* GlobalKeyword */) { + if (token() === 153 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); } - else if (parseOptional(140 /* NamespaceKeyword */)) { + else if (parseOptional(139 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(139 /* ModuleKeyword */); + parseExpected(138 /* ModuleKeyword */); if (token() === 10 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); } @@ -33618,7 +32751,7 @@ var ts; return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags); } function isExternalModuleReference() { - return token() === 143 /* RequireKeyword */ && + return token() === 142 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -33629,7 +32762,7 @@ var ts; } function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) { parseExpected(126 /* AsKeyword */); - parseExpected(140 /* NamespaceKeyword */); + parseExpected(139 /* NamespaceKeyword */); var name = parseIdentifier(); parseSemicolon(); var node = factory.createNamespaceExportDeclaration(name); @@ -33647,7 +32780,7 @@ var ts; identifier = parseIdentifier(); } var isTypeOnly = false; - if (token() !== 153 /* FromKeyword */ && + if (token() !== 152 /* FromKeyword */ && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { isTypeOnly = true; @@ -33665,7 +32798,7 @@ var ts; token() === 18 /* OpenBraceToken */ // import { ) { importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); - parseExpected(153 /* FromKeyword */); + parseExpected(152 /* FromKeyword */); } var moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); @@ -33678,7 +32811,7 @@ var ts; function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { // In `import id ___`, the current token decides whether to produce // an ImportDeclaration or ImportEqualsDeclaration. - return token() === 27 /* CommaToken */ || token() === 153 /* FromKeyword */; + return token() === 27 /* CommaToken */ || token() === 152 /* FromKeyword */; } function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) { parseExpected(62 /* EqualsToken */); @@ -33703,7 +32836,7 @@ var ts; var namedBindings; if (!identifier || parseOptional(27 /* CommaToken */)) { - namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(264 /* NamedImports */); + namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(261 /* NamedImports */); } return finishNode(factory.createImportClause(isTypeOnly, identifier, namedBindings), pos); } @@ -33714,7 +32847,7 @@ var ts; } function parseExternalModuleReference() { var pos = getNodePos(); - parseExpected(143 /* RequireKeyword */); + parseExpected(142 /* RequireKeyword */); parseExpected(20 /* OpenParenToken */); var expression = parseModuleSpecifier(); parseExpected(21 /* CloseParenToken */); @@ -33751,16 +32884,16 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - var node = kind === 264 /* NamedImports */ + var node = kind === 261 /* NamedImports */ ? factory.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); return finishNode(node, pos); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(270 /* ExportSpecifier */); + return parseImportOrExportSpecifier(267 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(265 /* ImportSpecifier */); + return parseImportOrExportSpecifier(262 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var pos = getNodePos(); @@ -33787,38 +32920,38 @@ var ts; else { name = identifierName; } - if (kind === 265 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 262 /* ImportSpecifier */ && checkIdentifierIsKeyword) { parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected); } - var node = kind === 265 /* ImportSpecifier */ + var node = kind === 262 /* ImportSpecifier */ ? factory.createImportSpecifier(propertyName, name) : factory.createExportSpecifier(propertyName, name); return finishNode(node, pos); } function parseNamespaceExport(pos) { - return finishNode(factory.createNamespaceExport(parseIdentifierName()), pos); + return finishNode(factory.createNamespaceExport(parseIdentifier()), pos); } function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) { var savedAwaitContext = inAwaitContext(); setAwaitContext(/*value*/ true); var exportClause; var moduleSpecifier; - var isTypeOnly = parseOptional(149 /* TypeKeyword */); + var isTypeOnly = parseOptional(148 /* TypeKeyword */); var namespaceExportPos = getNodePos(); if (parseOptional(41 /* AsteriskToken */)) { if (parseOptional(126 /* AsKeyword */)) { exportClause = parseNamespaceExport(namespaceExportPos); } - parseExpected(153 /* FromKeyword */); + parseExpected(152 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } else { - exportClause = parseNamedImportsOrExports(268 /* NamedExports */); + exportClause = parseNamedImportsOrExports(265 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 153 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(153 /* FromKeyword */); + if (token() === 152 /* FromKeyword */ || (token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(152 /* FromKeyword */); moduleSpecifier = parseModuleSpecifier(); } } @@ -33935,18 +33068,6 @@ var ts; return finishNode(result, pos); } JSDocParser.parseJSDocTypeExpression = parseJSDocTypeExpression; - function parseJSDocNameReference() { - var pos = getNodePos(); - var hasBrace = parseOptional(18 /* OpenBraceToken */); - var entityName = parseEntityName(/* allowReservedWords*/ false); - if (hasBrace) { - parseExpectedJSDoc(19 /* CloseBraceToken */); - } - var result = factory.createJSDocNameReference(entityName); - fixupParentReferences(result); - return finishNode(result, pos); - } - JSDocParser.parseJSDocNameReference = parseJSDocNameReference; function parseIsolatedJSDocComment(content, start, length) { initializeState("", content, 99 /* Latest */, /*_syntaxCursor:*/ undefined, 1 /* JS */); var jsDoc = doInsideOfContext(4194304 /* JSDoc */, function () { return parseJSDocCommentWorker(start, length); }); @@ -34010,8 +33131,7 @@ var ts; var state = 1 /* SawAsterisk */; var margin; // + 4 for leading '/** ' - // + 1 because the last index of \n is always one index before the first character in the line and coincidentally, if there is no \n before start, it is -1, which is also one index before the first character - var indent = start - (content.lastIndexOf("\n", start) + 1) + 4; + var indent = start - Math.max(content.lastIndexOf("\n", start), 0) + 4; function pushComment(text) { if (!margin) { margin = indent; @@ -34067,7 +33187,7 @@ var ts; comments.push(whitespace); } else if (margin !== undefined && indent + whitespace.length > margin) { - comments.push(whitespace.slice(margin - indent)); + comments.push(whitespace.slice(margin - indent - 1)); } indent += whitespace.length; break; @@ -34211,9 +33331,6 @@ var ts; case "callback": tag = parseCallbackTag(start, tagName, margin, indentText); break; - case "see": - tag = parseSeeTag(start, tagName, margin, indentText); - break; default: tag = parseUnknownTag(start, tagName, margin, indentText); break; @@ -34363,9 +33480,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return true; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; @@ -34397,12 +33514,12 @@ var ts; var child = void 0; var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(target, indent, name); })) { - if (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) { + if (child.kind === 322 /* JSDocParameterTag */ || child.kind === 328 /* JSDocPropertyTag */) { children = ts.append(children, child); } } if (children) { - var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 178 /* ArrayType */), pos); + var literal = finishNode(factory.createJSDocTypeLiteral(children, typeExpression.type.kind === 177 /* ArrayType */), pos); return finishNode(factory.createJSDocTypeExpression(literal), pos); } } @@ -34424,12 +33541,6 @@ var ts; var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined; return finishNode(factory.createJSDocTypeTag(tagName, typeExpression, comments), start, end); } - function parseSeeTag(start, tagName, indent, indentText) { - var nameExpression = parseJSDocNameReference(); - var end = getNodePos(); - var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, end, indent, indentText) : undefined; - return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start, end); - } function parseAuthorTag(start, tagName, indent, indentText) { var authorInfoWithEmail = tryParse(function () { return tryParseAuthorNameAndEmail(); }); if (!authorInfoWithEmail) { @@ -34545,7 +33656,7 @@ var ts; var hasChildren = false; while (child = tryParse(function () { return parseChildPropertyTag(indent); })) { hasChildren = true; - if (child.kind === 329 /* JSDocTypeTag */) { + if (child.kind === 325 /* JSDocTypeTag */) { if (childTypeTag) { parseErrorAtCurrentToken(ts.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); var lastError = ts.lastOrUndefined(parseDiagnostics); @@ -34563,7 +33674,7 @@ var ts; } } if (hasChildren) { - var isArrayType = typeExpression && typeExpression.type.kind === 178 /* ArrayType */; + var isArrayType = typeExpression && typeExpression.type.kind === 177 /* ArrayType */; var jsdocTypeLiteral = factory.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType); typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : @@ -34616,7 +33727,7 @@ var ts; var returnTag = tryParse(function () { if (parseOptionalJsdoc(59 /* AtToken */)) { var tag = parseTag(indent); - if (tag && tag.kind === 327 /* JSDocReturnTag */) { + if (tag && tag.kind === 323 /* JSDocReturnTag */) { return tag; } } @@ -34651,7 +33762,7 @@ var ts; case 59 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target, indent); - if (child && (child.kind === 326 /* JSDocParameterTag */ || child.kind === 333 /* JSDocPropertyTag */) && + if (child && (child.kind === 322 /* JSDocParameterTag */ || child.kind === 328 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; @@ -35397,8 +34508,6 @@ var ts; } case "jsx": case "jsxfrag": - case "jsximportsource": - case "jsxruntime": return; // Accessed directly default: ts.Debug.fail("Unhandled pragma kind"); // Can this be made into an assertNever in the future? } @@ -35523,18 +34632,6 @@ var ts; (function (ts) { /* @internal */ ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" }; - var jsxOptionMap = new ts.Map(ts.getEntries({ - "preserve": 1 /* Preserve */, - "react-native": 3 /* ReactNative */, - "react": 2 /* React */, - "react-jsx": 4 /* ReactJSX */, - "react-jsxdev": 5 /* ReactJSXDev */, - })); - /* @internal */ - ts.inverseJsxOptionMap = new ts.Map(ts.arrayFrom(ts.mapIterator(jsxOptionMap.entries(), function (_a) { - var key = _a[0], value = _a[1]; - return ["" + value, key]; - }))); // NOTE: The order here is important to default lib ordering as entries will have the same // order in the generated program (see `getDefaultLibPriority` in program.ts). This // order also affects overload resolution when a type declared in one lib is @@ -35556,7 +34653,6 @@ var ts; ["dom.iterable", "lib.dom.iterable.d.ts"], ["webworker", "lib.webworker.d.ts"], ["webworker.importscripts", "lib.webworker.importscripts.d.ts"], - ["webworker.iterable", "lib.webworker.iterable.d.ts"], ["scripthost", "lib.scripthost.d.ts"], // ES2015 Or ESNext By-feature options ["es2015.core", "lib.es2015.core.d.ts"], @@ -35585,7 +34681,6 @@ var ts; ["es2019.symbol", "lib.es2019.symbol.d.ts"], ["es2020.bigint", "lib.es2020.bigint.d.ts"], ["es2020.promise", "lib.es2020.promise.d.ts"], - ["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"], ["es2020.string", "lib.es2020.string.d.ts"], ["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"], ["es2020.intl", "lib.es2020.intl.d.ts"], @@ -35595,8 +34690,7 @@ var ts; ["esnext.intl", "lib.esnext.intl.d.ts"], ["esnext.bigint", "lib.es2020.bigint.d.ts"], ["esnext.string", "lib.esnext.string.d.ts"], - ["esnext.promise", "lib.esnext.promise.d.ts"], - ["esnext.weakref", "lib.esnext.weakref.d.ts"] + ["esnext.promise", "lib.esnext.promise.d.ts"] ]; /** * An array of supported "lib" reference file names used to determine the order for inclusion @@ -35728,15 +34822,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Generates_a_CPU_profile }, - { - name: "generateTrace", - type: "string", - isFilePath: true, - isCommandLineOnly: true, - paramType: ts.Diagnostics.DIRECTORY, - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Generates_an_event_trace_and_a_list_of_types - }, { name: "incremental", shortName: "i", @@ -35892,10 +34977,12 @@ var ts; }, { name: "jsx", - type: jsxOptionMap, + type: new ts.Map(ts.getEntries({ + "preserve": 1 /* Preserve */, + "react-native": 3 /* ReactNative */, + "react": 2 /* React */ + })), affectsSourceFile: true, - affectsEmit: true, - affectsModuleResolution: true, paramType: ts.Diagnostics.KIND, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, @@ -36138,14 +35225,6 @@ var ts; category: ts.Diagnostics.Additional_Checks, description: ts.Diagnostics.Report_errors_for_fallthrough_cases_in_switch_statement }, - { - name: "noUncheckedIndexedAccess", - type: "boolean", - affectsSemanticDiagnostics: true, - showInSimplifiedHelpView: false, - category: ts.Diagnostics.Additional_Checks, - description: ts.Diagnostics.Include_undefined_in_index_signature_results - }, // Module Resolution { name: "moduleResolution", @@ -36307,15 +35386,6 @@ var ts; category: ts.Diagnostics.Advanced_Options, description: ts.Diagnostics.Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment }, - { - name: "jsxImportSource", - type: "string", - affectsSemanticDiagnostics: true, - affectsEmit: true, - affectsModuleResolution: true, - category: ts.Diagnostics.Advanced_Options, - description: ts.Diagnostics.Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react - }, { name: "resolveJsonModule", type: "boolean", @@ -36627,11 +35697,7 @@ var ts; name: "exclude", type: "string" } - }, - { - name: "disableFilenameBasedTypeAcquisition", - type: "boolean", - }, + } ]; /*@internal*/ function createOptionNameMap(optionDeclarations) { @@ -36986,7 +36052,7 @@ var ts; */ function readJsonConfigFile(fileName, readFile) { var textOrDiagnostic = tryReadFile(fileName, readFile); - return ts.isString(textOrDiagnostic) ? ts.parseJsonText(fileName, textOrDiagnostic) : { fileName: fileName, parseDiagnostics: [textOrDiagnostic] }; + return ts.isString(textOrDiagnostic) ? ts.parseJsonText(fileName, textOrDiagnostic) : { parseDiagnostics: [textOrDiagnostic] }; } ts.readJsonConfigFile = readJsonConfigFile; /*@internal*/ @@ -37129,7 +36195,7 @@ var ts; function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { var result = returnValue ? {} : undefined; var _loop_4 = function (element) { - if (element.kind !== 288 /* PropertyAssignment */) { + if (element.kind !== 285 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); return "continue"; } @@ -37220,13 +36286,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -37243,7 +36309,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -37728,7 +36794,6 @@ var ts; * It does *not* resolve the included files. */ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache) { - var _a; basePath = ts.normalizeSlashes(basePath); var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { @@ -37738,13 +36803,6 @@ var ts; var ownConfig = json ? parseOwnConfigOfJson(json, host, basePath, configFileName, errors) : parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); - if ((_a = ownConfig.options) === null || _a === void 0 ? void 0 : _a.paths) { - // If we end up needing to resolve relative paths from 'paths' relative to - // the config file location, we'll need to know where that config file was. - // Since 'paths' can be inherited from an extended config in another directory, - // we wouldn't know which directory to use unless we store it here. - ownConfig.options.pathsBasePath = basePath; - } if (ownConfig.extendedConfigPath) { // copy the resolution stack so it is never reused between branches in potential diamond-problem scenarios. resolutionStack = resolutionStack.concat([resolvedPath]); @@ -39044,15 +38102,12 @@ var ts; } function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) { var _a = state.compilerOptions, baseUrl = _a.baseUrl, paths = _a.paths; - if (paths && !ts.pathIsRelative(moduleName)) { + if (baseUrl && paths && !ts.pathIsRelative(moduleName)) { if (state.traceEnabled) { - if (baseUrl) { - trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); - } + trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName); } - var baseDirectory = ts.getPathsBasePath(state.compilerOptions, state.host); // Always defined when 'paths' is defined - return tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, loader, /*onlyRecordFailures*/ false, state); + return tryLoadModuleUsingPaths(extensions, moduleName, baseUrl, paths, loader, /*onlyRecordFailures*/ false, state); } } function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state) { @@ -39551,7 +38606,6 @@ var ts; } var resolved = ts.forEach(paths[matchedPatternText], function (subst) { var path = matchedStar_1 ? subst.replace("*", matchedStar_1) : subst; - // When baseUrl is not specified, the command line parser resolves relative paths to the config file location. var candidate = ts.normalizePath(ts.combinePaths(baseDirectory, path)); if (state.traceEnabled) { trace(state.host, ts.Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path); @@ -39717,26 +38771,26 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (ts.isEnumConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: if (!(ts.hasSyntacticModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportDeclaration = node; - if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 268 /* NamedExports */) { + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 265 /* NamedExports */) { var state = 0 /* NonInstantiated */; for (var _i = 0, _a = exportDeclaration.exportClause.elements; _i < _a.length; _i++) { var specifier = _a[_i]; @@ -39752,7 +38806,7 @@ var ts; } break; // 5. other uninstantiated module declarations. - case 257 /* ModuleBlock */: { + case 254 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateCached(n, visited); @@ -39774,7 +38828,7 @@ var ts; }); return state_1; } - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return getModuleInstanceState(node, visited); case 78 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -39846,15 +38900,12 @@ var ts; } var binder = createBinder(); function bindSourceFile(file, options) { - var tracingData = ["bind" /* Bind */, "bindSourceFile", { path: file.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeBind"); ts.perfLogger.logStartBindFile("" + file.fileName); binder(file, options); ts.perfLogger.logStopBindFile(); ts.performance.mark("afterBind"); ts.performance.measure("Bind", "beforeBind", "afterBind"); - ts.tracing.end.apply(ts.tracing, tracingData); } ts.bindSourceFile = bindSourceFile; function createBinder() { @@ -39886,8 +38937,6 @@ var ts; // not depending on if we see "use strict" in certain places or if we hit a class/namespace // or if compiler options contain alwaysStrict. var inStrictMode; - // If we are binding an assignment pattern, we will bind certain expressions differently. - var inAssignmentPattern = false; var symbolCount = 0; var Symbol; var classifiableNames; @@ -39937,7 +38986,6 @@ var ts; currentExceptionTarget = undefined; activeLabelList = undefined; hasExplicitReturn = false; - inAssignmentPattern = false; emitFlags = 0 /* None */; } return bindSourceFile; @@ -39975,7 +39023,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 266 /* ExportAssignment */) { + if (node.kind === 263 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -39984,7 +39032,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 158 /* ComputedPropertyName */) { + if (name.kind === 157 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteralLike(nameExpression)) { @@ -40012,36 +39060,36 @@ var ts; return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return "__constructor" /* Constructor */; - case 174 /* FunctionType */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: + case 173 /* FunctionType */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: return "__call" /* Call */; - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: return "__new" /* New */; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return "__index" /* Index */; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: // json file should behave as // module.exports = ... return "export=" /* ExportEquals */; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 160 /* Parameter */: + case 159 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 308 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); + ts.Debug.assert(node.parent.kind === 304 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; @@ -40141,7 +39189,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (node.kind === 266 /* ExportAssignment */ && !node.isExportEquals)) { + (node.kind === 263 /* ExportAssignment */ && !node.isExportEquals)) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; messageNeedsName_1 = false; multipleDefaultExports_1 = true; @@ -40178,9 +39226,9 @@ var ts; return symbol; } function declareModuleMember(node, symbolFlags, symbolExcludes) { - var hasExportModifier = !!(ts.getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node); + var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 270 /* ExportSpecifier */ || (node.kind === 260 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 267 /* ExportSpecifier */ || (node.kind === 257 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -40204,7 +39252,7 @@ var ts; // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. if (ts.isJSDocTypeAlias(node)) ts.Debug.assert(ts.isInJSFile(node)); // We shouldn't add symbols for JSDoc nodes if not in a JS file. - if (!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) { + if ((!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) || ts.isJSDocTypeAlias(node)) { if (!container.locals || (ts.hasSyntacticModifier(node, 512 /* Default */) && !getDeclarationName(node))) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); // No local symbol for an unnamed default! } @@ -40219,28 +39267,6 @@ var ts; } } } - function jsdocTreatAsExported(node) { - if (node.parent && ts.isModuleDeclaration(node)) { - node = node.parent; - } - if (!ts.isJSDocTypeAlias(node)) - return false; - // jsdoc typedef handling is a bit of a doozy, but to summarize, treat the typedef as exported if: - // 1. It has an explicit name (since by default typedefs are always directly exported, either at the top level or in a container), or - if (!ts.isJSDocEnumTag(node) && !!node.fullName) - return true; - // 2. The thing a nameless typedef pulls its name from is implicitly a direct export (either by assignment or actual export flag). - var declName = ts.getNameOfDeclaration(node); - if (!declName) - return false; - if (ts.isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent)) - return true; - if (ts.isDeclaration(declName.parent) && ts.getCombinedModifierFlags(declName.parent) & 1 /* Export */) - return true; - // This could potentially be simplified by having `delayedBindJSDocTypedefTag` pass in an override for `hasExportModifier`, since it should - // already have calculated and branched on most of this. - return false; - } // All container nodes are kept on a linked list in declaration order. This list is used by // the getLocalNameOfContainer function in the type checker to validate that the local name // used for a container is unique. @@ -40269,7 +39295,7 @@ var ts; // for it. We must clear this so we don't accidentally move any stale data forward from // a previous compilation. if (containerFlags & 1 /* IsContainer */) { - if (node.kind !== 209 /* ArrowFunction */) { + if (node.kind !== 206 /* ArrowFunction */) { thisParentContainer = container; } container = blockScopeContainer = node; @@ -40302,7 +39328,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property initialization checks. - currentReturnTarget = isIIFE || node.kind === 166 /* Constructor */ || (ts.isInJSFile && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 165 /* Constructor */ || (ts.isInJSFile && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */)) ? createBranchLabel() : undefined; currentExceptionTarget = undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; @@ -40317,13 +39343,13 @@ var ts; node.flags |= 512 /* HasExplicitReturn */; node.endFlowNode = currentFlow; } - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 166 /* Constructor */ || (ts.isInJSFile && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */))) { + if (node.kind === 165 /* Constructor */ || (ts.isInJSFile && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */))) { node.returnFlowNode = currentFlow; } } @@ -40350,8 +39376,8 @@ var ts; blockScopeContainer = savedBlockScopeContainer; } function bindEachFunctionsFirst(nodes) { - bindEach(nodes, function (n) { return n.kind === 251 /* FunctionDeclaration */ ? bind(n) : undefined; }); - bindEach(nodes, function (n) { return n.kind !== 251 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind === 248 /* FunctionDeclaration */ ? bind(n) : undefined; }); + bindEach(nodes, function (n) { return n.kind !== 248 /* FunctionDeclaration */ ? bind(n) : undefined; }); } function bindEach(nodes, bindFunction) { if (bindFunction === void 0) { bindFunction = bind; } @@ -40364,156 +39390,129 @@ var ts; ts.forEachChild(node, bind, bindEach); } function bindChildren(node) { - var saveInAssignmentPattern = inAssignmentPattern; - // Most nodes aren't valid in an assignment pattern, so we clear the value here - // and set it before we descend into nodes that could actually be part of an assignment pattern. - inAssignmentPattern = false; if (checkUnreachable(node)) { bindEachChild(node); bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; return; } - if (node.kind >= 232 /* FirstStatement */ && node.kind <= 248 /* LastStatement */ && !options.allowUnreachableCode) { + if (node.kind >= 229 /* FirstStatement */ && node.kind <= 245 /* LastStatement */ && !options.allowUnreachableCode) { node.flowNode = currentFlow; } switch (node.kind) { - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: bindWhileStatement(node); break; - case 235 /* DoStatement */: + case 232 /* DoStatement */: bindDoStatement(node); break; - case 237 /* ForStatement */: + case 234 /* ForStatement */: bindForStatement(node); break; - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 234 /* IfStatement */: + case 231 /* IfStatement */: bindIfStatement(node); break; - case 242 /* ReturnStatement */: - case 246 /* ThrowStatement */: + case 239 /* ReturnStatement */: + case 243 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: bindTryStatement(node); break; - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: bindSwitchStatement(node); break; - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: bindCaseBlock(node); break; - case 284 /* CaseClause */: + case 281 /* CaseClause */: bindCaseClause(node); break; - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: bindExpressionStatement(node); break; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: bindLabeledStatement(node); break; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 216 /* BinaryExpression */: - if (ts.isDestructuringAssignment(node)) { - // Carry over whether we are in an assignment pattern to - // binary expressions that could actually be an initializer - inAssignmentPattern = saveInAssignmentPattern; - bindDestructuringAssignmentFlow(node); - return; - } + case 213 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: bindAccessExpressionFlow(node); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: bindCallExpressionFlow(node); break; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: bindNonNullExpressionFlow(node); break; - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: bindJSDocTypeAlias(node); break; // In source files and blocks, bind functions first to match hoisting that occurs at runtime - case 297 /* SourceFile */: { + case 294 /* SourceFile */: { bindEachFunctionsFirst(node.statements); bind(node.endOfFileToken); break; } - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: bindEachFunctionsFirst(node.statements); break; - case 198 /* BindingElement */: - bindBindingElementFlow(node); - break; - case 200 /* ObjectLiteralExpression */: - case 199 /* ArrayLiteralExpression */: - case 288 /* PropertyAssignment */: - case 220 /* SpreadElement */: - // Carry over whether we are in an assignment pattern of Object and Array literals - // as well as their children that are valid assignment targets. - inAssignmentPattern = saveInAssignmentPattern; - // falls through default: bindEachChild(node); break; } bindJSDoc(node); - inAssignmentPattern = saveInAssignmentPattern; } function isNarrowingExpression(expr) { switch (expr.kind) { case 78 /* Identifier */: - case 79 /* PrivateIdentifier */: case 107 /* ThisKeyword */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return containsNarrowableReference(expr); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return hasNarrowableArgument(expr); - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return isNarrowingExpression(expr.expression); } return false; } function isNarrowableReference(expr) { - return expr.kind === 78 /* Identifier */ || expr.kind === 79 /* PrivateIdentifier */ || expr.kind === 107 /* ThisKeyword */ || expr.kind === 105 /* SuperKeyword */ || + return expr.kind === 78 /* Identifier */ || expr.kind === 107 /* ThisKeyword */ || expr.kind === 105 /* SuperKeyword */ || (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) || - ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right) || ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression) || ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left); } @@ -40529,7 +39528,7 @@ var ts; } } } - if (expr.expression.kind === 201 /* PropertyAccessExpression */ && + if (expr.expression.kind === 198 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { return true; } @@ -40565,9 +39564,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 62 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -40643,26 +39642,26 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 234 /* IfStatement */: - case 236 /* WhileStatement */: - case 235 /* DoStatement */: + case 231 /* IfStatement */: + case 233 /* WhileStatement */: + case 232 /* DoStatement */: return parent.expression === node; - case 237 /* ForStatement */: - case 217 /* ConditionalExpression */: + case 234 /* ForStatement */: + case 214 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 207 /* ParenthesizedExpression */) { + if (node.kind === 204 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 214 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { + else if (node.kind === 211 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || + return node.kind === 213 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); } @@ -40709,7 +39708,7 @@ var ts; } function setContinueTarget(node, target) { var label = activeLabelList; - while (label && node.parent.kind === 245 /* LabeledStatement */) { + while (label && node.parent.kind === 242 /* LabeledStatement */) { label.continueTarget = target; label = label.next; node = node.parent; @@ -40760,12 +39759,12 @@ var ts; bind(node.expression); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 239 /* ForOfStatement */) { + if (node.kind === 236 /* ForOfStatement */) { bind(node.awaitModifier); } addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 250 /* VariableDeclarationList */) { + if (node.initializer.kind !== 247 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -40787,7 +39786,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 242 /* ReturnStatement */) { + if (node.kind === 239 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -40804,7 +39803,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 241 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 238 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -40909,7 +39908,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 285 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 282 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). Note, we no longer need // this property in control flow analysis, it's there only for backwards compatibility. @@ -40952,13 +39951,10 @@ var ts; } function bindExpressionStatement(node) { bind(node.expression); - maybeBindExpressionFlowIfCall(node.expression); - } - function maybeBindExpressionFlowIfCall(node) { - // A top level or LHS of comma expression call expression with a dotted function name and at least one argument + // A top level call expression with a dotted function name and at least one argument // is potentially an assertion and is therefore included in the control flow. - if (node.kind === 203 /* CallExpression */) { - var call = node; + if (node.expression.kind === 200 /* CallExpression */) { + var call = node.expression; if (ts.isDottedName(call.expression) && call.expression.kind !== 105 /* SuperKeyword */) { currentFlow = createFlowCall(currentFlow, call); } @@ -40983,7 +39979,7 @@ var ts; currentFlow = finishFlowLabel(postStatementLabel); } function bindDestructuringTargetFlow(node) { - if (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { + if (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -40994,10 +39990,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); } - else if (node.kind === 199 /* ArrayLiteralExpression */) { + else if (node.kind === 196 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 220 /* SpreadElement */) { + if (e.kind === 217 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -41005,16 +40001,16 @@ var ts; } } } - else if (node.kind === 200 /* ObjectLiteralExpression */) { + else if (node.kind === 197 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 288 /* PropertyAssignment */) { + if (p.kind === 285 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 289 /* ShorthandPropertyAssignment */) { + else if (p.kind === 286 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 290 /* SpreadAssignment */) { + else if (p.kind === 287 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -41062,23 +40058,6 @@ var ts; bindAssignmentTargetFlow(node.operand); } } - function bindDestructuringAssignmentFlow(node) { - if (inAssignmentPattern) { - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - inAssignmentPattern = true; - bind(node.left); - } - else { - inAssignmentPattern = true; - bind(node.left); - inAssignmentPattern = false; - bind(node.operatorToken); - bind(node.right); - } - bindAssignmentTargetFlow(node.left); - } var BindBinaryExpressionFlowState; (function (BindBinaryExpressionFlowState) { BindBinaryExpressionFlowState[BindBinaryExpressionFlowState["BindThenBindChildren"] = 0] = "BindThenBindChildren"; @@ -41133,9 +40112,6 @@ var ts; break; } case 2 /* BindToken */: { - if (node.operatorToken.kind === 27 /* CommaToken */) { - maybeBindExpressionFlowIfCall(node.left); - } advanceState(3 /* BindRight */); maybeBind(node.operatorToken); break; @@ -41149,7 +40125,7 @@ var ts; var operator = node.operatorToken.kind; if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 62 /* EqualsToken */ && node.left.kind === 202 /* ElementAccessExpression */) { + if (operator === 62 /* EqualsToken */ && node.left.kind === 199 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -41186,7 +40162,7 @@ var ts; * If `node` is a BinaryExpression, adds it to the local work stack, otherwise recursively binds it */ function maybeBind(node) { - if (node && ts.isBinaryExpression(node) && !ts.isDestructuringAssignment(node)) { + if (node && ts.isBinaryExpression(node)) { stackIndex++; workStacks.expr[stackIndex] = node; workStacks.state[stackIndex] = 0 /* BindThenBindChildren */; @@ -41200,7 +40176,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 201 /* PropertyAccessExpression */) { + if (node.expression.kind === 198 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -41237,27 +40213,9 @@ var ts; bindInitializedVariableFlow(node); } } - function bindBindingElementFlow(node) { - if (ts.isBindingPattern(node.name)) { - // When evaluating a binding pattern, the initializer is evaluated before the binding pattern, per: - // - https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-iteratorbindinginitialization - // - `BindingElement: BindingPattern Initializer?` - // - https://tc39.es/ecma262/#sec-runtime-semantics-keyedbindinginitialization - // - `BindingElement: BindingPattern Initializer?` - bindEach(node.decorators); - bindEach(node.modifiers); - bind(node.dotDotDotToken); - bind(node.propertyName); - bind(node.initializer); - bind(node.name); - } - else { - bindEachChild(node); - } - } function bindJSDocTypeAlias(node) { ts.setParent(node.tagName, node); - if (node.kind !== 325 /* JSDocEnumTag */ && node.fullName) { + if (node.kind !== 321 /* JSDocEnumTag */ && node.fullName) { ts.setParent(node.fullName, node); ts.setParentRecursive(node.fullName, /*incremental*/ false); } @@ -41265,7 +40223,7 @@ var ts; function bindJSDocClassTag(node) { bindEachChild(node); var host = ts.getHostSignatureFromJSDoc(node); - if (host && host.kind !== 165 /* MethodDeclaration */) { + if (host && host.kind !== 164 /* MethodDeclaration */) { addDeclarationToSymbol(host.symbol, host, 32 /* Class */); } } @@ -41278,15 +40236,15 @@ var ts; } function bindOptionalChainRest(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: bind(node.questionDotToken); bind(node.name); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: bind(node.questionDotToken); bind(node.argumentExpression); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: bind(node.questionDotToken); bindEach(node.typeArguments); bindEach(node.arguments); @@ -41351,7 +40309,7 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = ts.skipParentheses(node.expression); - if (expr.kind === 208 /* FunctionExpression */ || expr.kind === 209 /* ArrowFunction */) { + if (expr.kind === 205 /* FunctionExpression */ || expr.kind === 206 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -41363,7 +40321,7 @@ var ts; } } } - if (node.expression.kind === 201 /* PropertyAccessExpression */) { + if (node.expression.kind === 198 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (ts.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); @@ -41372,54 +40330,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 200 /* ObjectLiteralExpression */: - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 281 /* JsxAttributes */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 197 /* ObjectLiteralExpression */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 278 /* JsxAttributes */: return 1 /* IsContainer */; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 190 /* MappedType */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 189 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 166 /* Constructor */: - case 251 /* FunctionDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 169 /* CallSignature */: - case 313 /* JSDocSignature */: - case 308 /* JSDocFunctionType */: - case 174 /* FunctionType */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: - case 175 /* ConstructorType */: + case 165 /* Constructor */: + case 248 /* FunctionDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 168 /* CallSignature */: + case 309 /* JSDocSignature */: + case 304 /* JSDocFunctionType */: + case 173 /* FunctionType */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: + case 174 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 287 /* CatchClause */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: - case 258 /* CaseBlock */: + case 284 /* CatchClause */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: + case 255 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 230 /* Block */: + case 227 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -41452,45 +40410,45 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 297 /* SourceFile */: + case 294 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 200 /* ObjectLiteralExpression */: - case 253 /* InterfaceDeclaration */: - case 281 /* JsxAttributes */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 197 /* ObjectLiteralExpression */: + case 250 /* InterfaceDeclaration */: + case 278 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 313 /* JSDocSignature */: - case 171 /* IndexSignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 308 /* JSDocFunctionType */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 254 /* TypeAliasDeclaration */: - case 190 /* MappedType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 309 /* JSDocSignature */: + case 170 /* IndexSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 304 /* JSDocFunctionType */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 251 /* TypeAliasDeclaration */: + case 189 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -41591,7 +40549,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 290 /* SpreadAssignment */ || prop.name.kind !== 78 /* Identifier */) { + if (prop.kind === 287 /* SpreadAssignment */ || prop.name.kind !== 78 /* Identifier */) { continue; } var identifier = prop.name; @@ -41603,7 +40561,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 288 /* PropertyAssignment */ || prop.kind === 289 /* ShorthandPropertyAssignment */ || prop.kind === 165 /* MethodDeclaration */ + var currentKind = prop.kind === 285 /* PropertyAssignment */ || prop.kind === 286 /* ShorthandPropertyAssignment */ || prop.kind === 164 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -41635,10 +40593,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (ts.isExternalOrCommonJsModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -41837,8 +40795,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 297 /* SourceFile */ && - blockScopeContainer.kind !== 256 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 294 /* SourceFile */ && + blockScopeContainer.kind !== 253 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -41933,7 +40891,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 156 /* LastToken */) { + if (node.kind > 155 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -42009,7 +40967,7 @@ var ts; } // falls through case 107 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 289 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 286 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkContextualIdentifier(node); @@ -42018,8 +40976,8 @@ var ts; break; case 79 /* PrivateIdentifier */: return checkPrivateIdentifier(node); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = node; if (currentFlow && isNarrowableReference(expr)) { expr.flowNode = currentFlow; @@ -42030,11 +40988,11 @@ var ts; if (ts.isInJSFile(expr) && file.commonJsModuleIndicator && ts.isModuleExportsAccessExpression(expr) && - !lookupSymbolForName(blockScopeContainer, "module")) { + !lookupSymbolForNameWorker(blockScopeContainer, "module")) { declareSymbol(file.locals, /*parent*/ undefined, expr.expression, 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 111550 /* FunctionScopedVariableExcludes */); } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var specialKind = ts.getAssignmentDeclarationKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -42053,14 +41011,6 @@ var ts; bindThisPropertyAssignment(node); break; case 5 /* Property */: - var expression = node.left.expression; - if (ts.isInJSFile(node) && ts.isIdentifier(expression)) { - var symbol = lookupSymbolForName(blockScopeContainer, expression.escapedText); - if (ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration)) { - bindThisPropertyAssignment(node); - break; - } - } bindSpecialPropertyAssignment(node); break; case 0 /* None */: @@ -42070,78 +41020,78 @@ var ts; ts.Debug.fail("Unknown binary expression special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return checkStrictModeCatchClause(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return checkStrictModeWithStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return checkStrictModeLabeledStatement(node); - case 187 /* ThisType */: + case 186 /* ThisType */: seenThisKeyword = true; return; - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: break; // Binding the children will handle everything - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return bindTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return bindParameter(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return bindPropertyWorker(node); - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 291 /* EnumMember */: + case 288 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); - case 174 /* FunctionType */: - case 308 /* JSDocFunctionType */: - case 313 /* JSDocSignature */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 304 /* JSDocFunctionType */: + case 309 /* JSDocSignature */: + case 174 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 190 /* MappedType */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 189 /* MappedType */: return bindAnonymousTypeWorker(node); - case 319 /* JSDocClassTag */: + case 315 /* JSDocClassTag */: return bindJSDocClassTag(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return bindFunctionExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: var assignmentKind = ts.getAssignmentDeclarationKind(node); switch (assignmentKind) { case 7 /* ObjectDefinePropertyValue */: @@ -42160,65 +41110,65 @@ var ts; } break; // Members of classes, interfaces, and modules - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return bindJsxAttributes(node); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return bindImportClause(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return bindExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return bindExportAssignment(node); - case 297 /* SourceFile */: + case 294 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 230 /* Block */: + case 227 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 326 /* JSDocParameterTag */: - if (node.parent.kind === 313 /* JSDocSignature */) { + case 322 /* JSDocParameterTag */: + if (node.parent.kind === 309 /* JSDocSignature */) { return bindParameter(node); } - if (node.parent.kind !== 312 /* JSDocTypeLiteral */) { + if (node.parent.kind !== 308 /* JSDocTypeLiteral */) { break; } // falls through - case 333 /* JSDocPropertyTag */: + case 328 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 307 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 303 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); } } @@ -42339,9 +41289,9 @@ var ts; return symbol; }); if (symbol) { - var isAlias = ts.isAliasableExpression(node.right) && (ts.isExportsIdentifier(node.left.expression) || ts.isModuleExportsAccessExpression(node.left.expression)); - var flags = isAlias ? 2097152 /* Alias */ : 4 /* Property */ | 1048576 /* ExportValue */; - ts.setParent(node.left, node); + var flags = ts.isClassExpression(node.right) ? + 4 /* Property */ | 1048576 /* ExportValue */ | 32 /* Class */ : + 4 /* Property */ | 1048576 /* ExportValue */; declareSymbol(symbol.exports, symbol, node.left, flags, 0 /* None */); } } @@ -42357,10 +41307,6 @@ var ts; if (ts.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { return; } - if (ts.isObjectLiteralExpression(assignedExpression) && ts.every(assignedExpression.properties, ts.isShorthandPropertyAssignment)) { - ts.forEach(assignedExpression.properties, bindExportAssignedObjectMemberAlias); - return; - } // 'module.exports = expr' assignment var flags = ts.exportAssignmentIsAlias(node) ? 2097152 /* Alias */ @@ -42368,9 +41314,6 @@ var ts; var symbol = declareSymbol(file.symbol.exports, file.symbol, node, flags | 67108864 /* Assignment */, 0 /* None */); ts.setValueDeclaration(symbol, node); } - function bindExportAssignedObjectMemberAlias(node) { - declareSymbol(file.symbol.exports, file.symbol, node, 2097152 /* Alias */ | 67108864 /* Assignment */, 0 /* None */); - } function bindThisPropertyAssignment(node) { ts.Debug.assert(ts.isInJSFile(node)); // private identifiers *must* be declared (even in JS files) @@ -42381,8 +41324,8 @@ var ts; } var thisContainer = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (thisContainer.kind) { - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: var constructorSymbol = thisContainer.symbol; // For `f.prototype.m = function() { this.x = 0; }`, `this.x = 0` should modify `f`'s members, not the function expression. if (ts.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -42404,11 +41347,11 @@ var ts; addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); } break; - case 166 /* Constructor */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 165 /* Constructor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = thisContainer.parent; @@ -42420,7 +41363,7 @@ var ts; declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, /*isReplaceableByMethod*/ true); } break; - case 297 /* SourceFile */: + case 294 /* SourceFile */: // this.property = assignment in a source file -- declare symbol in exports for a module, in locals for a script if (ts.hasDynamicName(node)) { break; @@ -42449,7 +41392,7 @@ var ts; if (node.expression.kind === 107 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 297 /* SourceFile */) { + else if (ts.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 294 /* SourceFile */) { if (ts.isPrototypeAccess(node.expression)) { bindPrototypePropertyAssignment(node, node.parent); } @@ -42489,21 +41432,16 @@ var ts; } function bindObjectDefinePropertyAssignment(node) { var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); - var isToplevel = node.parent.parent.kind === 297 /* SourceFile */; + var isToplevel = node.parent.parent.kind === 294 /* SourceFile */; namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, /*isPrototypeProperty*/ false); } function bindSpecialPropertyAssignment(node) { - var _a; // Class declarations in Typescript do not allow property declarations var parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, container) || lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer); if (!ts.isInJSFile(node) && !ts.isFunctionSymbol(parentSymbol)) { return; } - var rootExpr = ts.getLeftmostAccessExpression(node.left); - if (ts.isIdentifier(rootExpr) && ((_a = lookupSymbolForName(container, rootExpr.escapedText)) === null || _a === void 0 ? void 0 : _a.flags) & 2097152 /* Alias */) { - return; - } // Fix up parent pointers since we're going to use these nodes before we bind into them ts.setParent(node.left, node); ts.setParent(node.right, node); @@ -42537,17 +41475,17 @@ var ts; } if (isToplevel && !isPrototypeProperty) { // make symbols or add declarations for intermediate containers - var flags_2 = 1536 /* Module */ | 67108864 /* Assignment */; + var flags_1 = 1536 /* Module */ | 67108864 /* Assignment */; var excludeFlags_1 = 110735 /* ValueModuleExcludes */ & ~67108864 /* Assignment */; namespaceSymbol = forEachIdentifierInEntityName(entityName, namespaceSymbol, function (id, symbol, parent) { if (symbol) { - addDeclarationToSymbol(symbol, id, flags_2); + addDeclarationToSymbol(symbol, id, flags_1); return symbol; } else { var table = parent ? parent.exports : file.jsGlobalAugmentations || (file.jsGlobalAugmentations = ts.createSymbolTable()); - return declareSymbol(table, parent, id, flags_2, excludeFlags_1); + return declareSymbol(table, parent, id, flags_1, excludeFlags_1); } }); } @@ -42598,8 +41536,8 @@ var ts; } function isTopLevelNamespaceAssignment(propertyAccess) { return ts.isBinaryExpression(propertyAccess.parent) - ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 297 /* SourceFile */ - : propertyAccess.parent.parent.kind === 297 /* SourceFile */; + ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 294 /* SourceFile */ + : propertyAccess.parent.parent.kind === 294 /* SourceFile */; } function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { var namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer); @@ -42646,7 +41584,7 @@ var ts; function lookupSymbolForPropertyAccess(node, lookupContainer) { if (lookupContainer === void 0) { lookupContainer = container; } if (ts.isIdentifier(node)) { - return lookupSymbolForName(lookupContainer, node.escapedText); + return lookupSymbolForNameWorker(lookupContainer, node.escapedText); } else { var symbol = lookupSymbolForPropertyAccess(node.expression); @@ -42678,7 +41616,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 252 /* ClassDeclaration */) { + if (node.kind === 249 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); } else { @@ -42720,10 +41658,7 @@ var ts; checkStrictModeEvalOrArguments(node, node.name); } if (!ts.isBindingPattern(node.name)) { - if (ts.isInJSFile(node) && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true) && !ts.getJSDocTypeTag(node)) { - declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - } - else if (ts.isBlockOrCatchScoped(node)) { + if (ts.isBlockOrCatchScoped(node)) { bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */); } else if (ts.isParameterDeclaration(node)) { @@ -42744,7 +41679,7 @@ var ts; } } function bindParameter(node) { - if (node.kind === 326 /* JSDocParameterTag */ && container.kind !== 313 /* JSDocSignature */) { + if (node.kind === 322 /* JSDocParameterTag */ && container.kind !== 309 /* JSDocSignature */) { return; } if (inStrictMode && !(node.flags & 8388608 /* Ambient */)) { @@ -42821,7 +41756,7 @@ var ts; declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); } } - else if (node.parent.kind === 185 /* InferType */) { + else if (node.parent.kind === 184 /* InferType */) { var container_2 = getInferTypeContainer(node.parent); if (container_2) { if (!container_2.locals) { @@ -42849,11 +41784,11 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 231 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 228 /* EmptyStatement */) || // report error on class declarations - node.kind === 252 /* ClassDeclaration */ || + node.kind === 249 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 256 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); + (node.kind === 253 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)); if (reportError) { currentFlow = reportedUnreachableFlow; if (!options.allowUnreachableCode) { @@ -42897,12 +41832,12 @@ var ts; } function isPurelyTypeDeclaration(s) { switch (s.kind) { - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return getModuleInstanceState(s) !== 1 /* Instantiated */; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return ts.hasSyntacticModifier(s, 2048 /* Const */); default: return false; @@ -42918,7 +41853,7 @@ var ts; return true; } else if (ts.isIdentifier(node)) { - var symbol = lookupSymbolForName(sourceFile, node.escapedText); + var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText); if (!!symbol && !!symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) { var init = symbol.valueDeclaration.initializer; q.push(init); @@ -42932,7 +41867,7 @@ var ts; return false; } ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias; - function lookupSymbolForName(container, name) { + function lookupSymbolForNameWorker(container, name) { var local = container.locals && container.locals.get(name); if (local) { return local.exportSymbol || local; @@ -43102,7 +42037,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 176 /* TypeQuery */) { + if (d.type && d.type.kind === 175 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -43132,7 +42067,6 @@ var ts; IterationUse[IterationUse["YieldStarFlag"] = 16] = "YieldStarFlag"; IterationUse[IterationUse["SpreadFlag"] = 32] = "SpreadFlag"; IterationUse[IterationUse["DestructuringFlag"] = 64] = "DestructuringFlag"; - IterationUse[IterationUse["PossiblyOutOfBounds"] = 128] = "PossiblyOutOfBounds"; // Spread, Destructuring, Array element assignment IterationUse[IterationUse["Element"] = 1] = "Element"; IterationUse[IterationUse["Spread"] = 33] = "Spread"; @@ -43279,7 +42213,6 @@ var ts; AccessFlags[AccessFlags["Writing"] = 2] = "Writing"; AccessFlags[AccessFlags["CacheSymbol"] = 4] = "CacheSymbol"; AccessFlags[AccessFlags["NoTupleBoundsCheck"] = 8] = "NoTupleBoundsCheck"; - AccessFlags[AccessFlags["ExpressionPosition"] = 16] = "ExpressionPosition"; })(AccessFlags || (AccessFlags = {})); var SignatureCheckMode; (function (SignatureCheckMode) { @@ -43338,25 +42271,6 @@ var ts; DeclarationSpaces[DeclarationSpaces["ExportType"] = 2] = "ExportType"; DeclarationSpaces[DeclarationSpaces["ExportNamespace"] = 4] = "ExportNamespace"; })(DeclarationSpaces || (DeclarationSpaces = {})); - var MinArgumentCountFlags; - (function (MinArgumentCountFlags) { - MinArgumentCountFlags[MinArgumentCountFlags["None"] = 0] = "None"; - MinArgumentCountFlags[MinArgumentCountFlags["StrongArityForUntypedJS"] = 1] = "StrongArityForUntypedJS"; - MinArgumentCountFlags[MinArgumentCountFlags["VoidIsNonOptional"] = 2] = "VoidIsNonOptional"; - })(MinArgumentCountFlags || (MinArgumentCountFlags = {})); - var IntrinsicTypeKind; - (function (IntrinsicTypeKind) { - IntrinsicTypeKind[IntrinsicTypeKind["Uppercase"] = 0] = "Uppercase"; - IntrinsicTypeKind[IntrinsicTypeKind["Lowercase"] = 1] = "Lowercase"; - IntrinsicTypeKind[IntrinsicTypeKind["Capitalize"] = 2] = "Capitalize"; - IntrinsicTypeKind[IntrinsicTypeKind["Uncapitalize"] = 3] = "Uncapitalize"; - })(IntrinsicTypeKind || (IntrinsicTypeKind = {})); - var intrinsicTypeKinds = new ts.Map(ts.getEntries({ - Uppercase: 0 /* Uppercase */, - Lowercase: 1 /* Lowercase */, - Capitalize: 2 /* Capitalize */, - Uncapitalize: 3 /* Uncapitalize */ - })); function SymbolLinks() { } function NodeLinks() { @@ -43420,7 +42334,6 @@ var ts; var instantiationDepth = 0; var constraintDepth = 0; var currentNode; - var typeCatalog = []; // NB: id is index + 1 var emptySymbols = ts.createSymbolTable(); var arrayVariances = [1 /* Covariant */]; var compilerOptions = host.getCompilerOptions(); @@ -43457,7 +42370,6 @@ var ts; getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount") + symbolCount; }, - getTypeCatalog: function () { return typeCatalog; }, getTypeCount: function () { return typeCount; }, getInstantiationCount: function () { return totalInstantiationCount; }, getRelationCacheSizes: function () { return ({ @@ -43472,7 +42384,6 @@ var ts; getMergedSymbol: getMergedSymbol, getDiagnostics: getDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, - getRecursionIdentity: getRecursionIdentity, getTypeOfSymbolAtLocation: function (symbol, locationIn) { var location = ts.getParseTreeNode(locationIn); return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType; @@ -43581,7 +42492,6 @@ var ts; }, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, - getSymbolOfExpando: getSymbolOfExpando, getContextualType: function (nodeIn, contextFlags) { var node = ts.getParseTreeNode(nodeIn, ts.isExpression); if (!node) { @@ -43775,8 +42685,6 @@ var ts; var intersectionTypes = new ts.Map(); var literalTypes = new ts.Map(); var indexedAccessTypes = new ts.Map(); - var templateLiteralTypes = new ts.Map(); - var stringMappingTypes = new ts.Map(); var substitutionTypes = new ts.Map(); var evolvingArrayTypes = []; var undefinedProperties = new ts.Map(); @@ -43787,7 +42695,6 @@ var ts; var wildcardType = createIntrinsicType(1 /* Any */, "any"); var errorType = createIntrinsicType(1 /* Any */, "error"); var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 524288 /* ContainsWideningType */); - var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic"); var unknownType = createIntrinsicType(2 /* Unknown */, "unknown"); var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined"); var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 524288 /* ContainsWideningType */); @@ -43826,7 +42733,6 @@ var ts; var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]); var keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; var numberOrBigIntType = getUnionType([numberType, bigintType]); - var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]); var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; }); var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; }); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -44098,16 +43004,6 @@ var ts; } } function errorOrSuggestion(isError, location, message, arg0, arg1, arg2, arg3) { - // Pseudo-synthesized input node - if (location.pos < 0 || location.end < 0) { - if (!isError) { - return; // Drop suggestions (we have no span to suggest on) - } - // Issue errors globally - var file = ts.getSourceFileOfNode(location); - addErrorOrSuggestion(isError, "message" in message ? ts.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForFileFromMessageChain(file, message)); // eslint-disable-line no-in-operator - return; - } addErrorOrSuggestion(isError, "message" in message ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3) : ts.createDiagnosticForNodeFromMessageChain(location, message)); // eslint-disable-line no-in-operator } function errorAndMaybeSuggestAwait(location, maybeMissingAwait, message, arg0, arg1, arg2, arg3) { @@ -44397,7 +43293,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); } function isGlobalSourceFile(node) { - return node.kind === 297 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 294 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -44456,17 +43352,17 @@ var ts; } if (declaration.pos <= usage.pos && !(ts.isPropertyDeclaration(declaration) && ts.isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) { // declaration is before usage - if (declaration.kind === 198 /* BindingElement */) { + if (declaration.kind === 195 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 198 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 195 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 249 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 246 /* VariableDeclaration */), usage); } - else if (declaration.kind === 249 /* VariableDeclaration */) { + else if (declaration.kind === 246 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -44496,12 +43392,12 @@ var ts; // or if usage is in a type context: // 1. inside a type query (typeof in type position) // 2. inside a jsdoc comment - if (usage.parent.kind === 270 /* ExportSpecifier */ || (usage.parent.kind === 266 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 267 /* ExportSpecifier */ || (usage.parent.kind === 263 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 266 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 263 /* ExportAssignment */ && usage.isExportEquals) { return true; } if (!!(usage.flags & 4194304 /* JSDoc */) || isInTypeQuery(usage) || usageInTypeDeclaration()) { @@ -44523,9 +43419,9 @@ var ts; } function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { switch (declaration.parent.parent.kind) { - case 232 /* VariableStatement */: - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: + case 229 /* VariableStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, declContainer)) { @@ -44546,16 +43442,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 163 /* PropertyDeclaration */ && + current.parent.kind === 162 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasSyntacticModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 165 /* MethodDeclaration */) { + if (declaration.kind === 164 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -44577,19 +43473,19 @@ var ts; return "quit"; } switch (node.kind) { - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return true; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // even when stopping at any property declaration, they need to come from the same class return stopAtAnyPropertyDeclaration && (ts.isPropertyDeclaration(declaration) && node.parent === declaration.parent || ts.isParameterPropertyDeclaration(declaration, declaration.parent) && node.parent === declaration.parent.parent) ? "quit" : true; - case 230 /* Block */: + case 227 /* Block */: switch (node.parent.kind) { - case 167 /* GetAccessor */: - case 165 /* MethodDeclaration */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 164 /* MethodDeclaration */: + case 167 /* SetAccessor */: return true; default: return false; @@ -44625,18 +43521,18 @@ var ts; } function requiresScopeChangeWorker(node) { switch (node.kind) { - case 209 /* ArrowFunction */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 166 /* Constructor */: + case 206 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 165 /* Constructor */: // do not descend into these return false; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 288 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 285 /* PropertyAssignment */: return requiresScopeChangeWorker(node.name); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // static properties in classes introduce temporary variables if (ts.hasStaticModifier(node)) { return target < 99 /* ESNext */ || !compilerOptions.useDefineForClassFields; @@ -44690,12 +43586,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 311 /* JSDocComment */) { + if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 307 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 160 /* Parameter */ || - lastLocation.kind === 159 /* TypeParameter */ + lastLocation.kind === 159 /* Parameter */ || + lastLocation.kind === 158 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -44710,13 +43606,13 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 160 /* Parameter */ || + lastLocation.kind === 159 /* Parameter */ || (lastLocation === location.type && !!ts.findAncestor(result.valueDeclaration, ts.isParameter)); } } } - else if (location.kind === 184 /* ConditionalType */) { + else if (location.kind === 183 /* ConditionalType */) { // A type parameter declared using 'infer T' in a conditional type is visible only in // the true branch of the conditional type. useResult = lastLocation === location.trueType; @@ -44731,14 +43627,14 @@ var ts; } withinDeferredContext = withinDeferredContext || getIsDeferredContext(location, lastLocation); switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports || emptySymbols; - if (location.kind === 297 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { + if (location.kind === 294 /* SourceFile */ || (ts.isModuleDeclaration(location) && location.flags & 8388608 /* Ambient */ && !ts.isGlobalScopeAugmentation(location))) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -44762,7 +43658,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - (ts.getDeclarationOfKind(moduleExport, 270 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 269 /* NamespaceExport */))) { + (ts.getDeclarationOfKind(moduleExport, 267 /* ExportSpecifier */) || ts.getDeclarationOfKind(moduleExport, 266 /* NamespaceExport */))) { break; } } @@ -44776,12 +43672,12 @@ var ts; } } break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -44798,9 +43694,9 @@ var ts; } } break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: // The below is used to lookup type parameters within a class or interface, as they are added to the class/interface locals // These can never be latebound, so the symbol's raw members are sufficient. `getMembersOfNode` cannot be used, as it would // trigger resolving late-bound names, which we may already be in the process of doing while we're here! @@ -44819,7 +43715,7 @@ var ts; } break loop; } - if (location.kind === 221 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 218 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -44827,7 +43723,7 @@ var ts; } } break; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 93 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -44847,9 +43743,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 253 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 250 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -44857,24 +43753,24 @@ var ts; } } break; - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // when targeting ES6 or higher there is no 'arguments' in an arrow function // for lower compile targets the resolved symbol is used to emit an error if (compilerOptions.target >= 2 /* ES2015 */) { break; } // falls through - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 251 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 248 /* FunctionDeclaration */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -44887,7 +43783,7 @@ var ts; } } break; - case 161 /* Decorator */: + case 160 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -44896,7 +43792,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 160 /* Parameter */) { + if (location.parent && location.parent.kind === 159 /* Parameter */) { location = location.parent; } // @@ -44911,17 +43807,17 @@ var ts; // declare function y(x: T): any; // @param(1 as T) // <-- T should resolve to the type alias outside of class C // class C {} - if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 252 /* ClassDeclaration */)) { + if (location.parent && (ts.isClassElement(location.parent) || location.parent.kind === 249 /* ClassDeclaration */)) { location = location.parent; } break; - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: // js type aliases do not resolve names from their host, so skip past it location = ts.getJSDocHost(location); break; - case 160 /* Parameter */: + case 159 /* Parameter */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && ts.isBindingPattern(lastLocation))) { if (!associatedDeclarationForContainingInitializerOrBindingName) { @@ -44929,20 +43825,14 @@ var ts; } } break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: if (lastLocation && (lastLocation === location.initializer || lastLocation === location.name && ts.isBindingPattern(lastLocation))) { - if (ts.isParameterDeclaration(location) && !associatedDeclarationForContainingInitializerOrBindingName) { - associatedDeclarationForContainingInitializerOrBindingName = location; - } - } - break; - case 185 /* InferType */: - if (meaning & 262144 /* TypeParameter */) { - var parameterName = location.typeParameter.name; - if (parameterName && name === parameterName.escapedText) { - result = location.typeParameter.symbol; - break loop; + var root = ts.getRootDeclaration(location); + if (root.kind === 159 /* Parameter */) { + if (!associatedDeclarationForContainingInitializerOrBindingName) { + associatedDeclarationForContainingInitializerOrBindingName = location; + } } } break; @@ -44961,7 +43851,7 @@ var ts; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 297 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 294 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports" && meaning & lastLocation.symbol.flags) { return lastLocation.symbol; } @@ -44999,15 +43889,7 @@ var ts; } } if (!suggestion) { - if (nameArg) { - var lib = getSuggestedLibForNonExistentName(nameArg); - if (lib) { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg), lib); - } - else { - error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); - } - } + error(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); } suggestionCount++; } @@ -45086,10 +43968,10 @@ var ts; } } function getIsDeferredContext(location, lastLocation) { - if (location.kind !== 209 /* ArrowFunction */ && location.kind !== 208 /* FunctionExpression */) { + if (location.kind !== 206 /* ArrowFunction */ && location.kind !== 205 /* FunctionExpression */) { // initializers in instance property declaration of class like entities are executed in constructor and thus deferred return ts.isTypeQueryNode(location) || ((ts.isFunctionLikeDeclaration(location) || - (location.kind === 163 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred + (location.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(location, 32 /* Static */))) && (!lastLocation || lastLocation !== location.name)); // A name is evaluated within the enclosing scope - so it shouldn't count as deferred } if (lastLocation && lastLocation === location.name) { return false; @@ -45102,12 +43984,12 @@ var ts; } function isSelfReferenceLocation(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 256 /* ModuleDeclaration */: // For `namespace N { N; }` + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 253 /* ModuleDeclaration */: // For `namespace N { N; }` return true; default: return false; @@ -45119,7 +44001,7 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 159 /* TypeParameter */) { + if (decl.kind === 158 /* TypeParameter */) { var parent = ts.isJSDocTemplateTag(decl.parent) ? ts.getJSDocHost(decl.parent) : decl.parent; if (parent === container) { return !(ts.isJSDocTemplateTag(decl.parent) && ts.find(decl.parent.parent.tags, ts.isJSDocTypeAlias)); // TODO: GH#18217 @@ -45175,9 +44057,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 78 /* Identifier */: - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -45221,7 +44103,7 @@ var ts; return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown"; } function checkAndReportErrorForExportingPrimitiveType(errorLocation, name) { - if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 270 /* ExportSpecifier */) { + if (isPrimitiveTypeName(name) && errorLocation.parent.kind === 267 /* ExportSpecifier */) { error(errorLocation, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name); return true; } @@ -45235,31 +44117,15 @@ var ts; } var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 /* Type */ & ~111551 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol && !(symbol.flags & 1024 /* NamespaceModule */)) { - var rawName = ts.unescapeLeadingUnderscores(name); - if (isES2015OrLaterConstructorName(name)) { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName); - } - else if (maybeMappedType(errorLocation, symbol)) { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0, rawName, rawName === "K" ? "P" : "K"); - } - else { - error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, rawName); - } + var message = isES2015OrLaterConstructorName(name) + ? ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later + : ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here; + error(errorLocation, message, ts.unescapeLeadingUnderscores(name)); return true; } } return false; } - function maybeMappedType(node, symbol) { - var container = ts.findAncestor(node.parent, function (n) { - return ts.isComputedPropertyName(n) || ts.isPropertySignature(n) ? false : ts.isTypeLiteralNode(n) || "quit"; - }); - if (container && container.members.length === 1) { - var type = getDeclaredTypeOfSymbol(symbol); - return !!(type.flags & 1048576 /* Union */) && allTypesAssignableToKind(type, 384 /* StringOrNumberLiteral */, /*strict*/ true); - } - return false; - } function isES2015OrLaterConstructorName(n) { switch (n) { case "Promise": @@ -45296,7 +44162,7 @@ var ts; return; } // Block-scoped variables cannot be used before their definition - var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 255 /* EnumDeclaration */); }); + var declaration = ts.find(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 252 /* EnumDeclaration */); }); if (declaration === undefined) return ts.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); if (!(declaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { @@ -45331,13 +44197,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return node; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.parent; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return node.parent.parent; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -45361,37 +44227,29 @@ var ts; * {name: } */ function isAliasSymbolDeclaration(node) { - return node.kind === 260 /* ImportEqualsDeclaration */ - || node.kind === 259 /* NamespaceExportDeclaration */ - || node.kind === 262 /* ImportClause */ && !!node.name - || node.kind === 263 /* NamespaceImport */ - || node.kind === 269 /* NamespaceExport */ - || node.kind === 265 /* ImportSpecifier */ - || node.kind === 270 /* ExportSpecifier */ - || node.kind === 266 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) - || ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) - || ts.isAccessExpression(node) + return node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 256 /* NamespaceExportDeclaration */ || + node.kind === 259 /* ImportClause */ && !!node.name || + node.kind === 260 /* NamespaceImport */ || + node.kind === 266 /* NamespaceExport */ || + node.kind === 262 /* ImportSpecifier */ || + node.kind === 267 /* ExportSpecifier */ || + node.kind === 263 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) || + ts.isBinaryExpression(node) && ts.getAssignmentDeclarationKind(node) === 2 /* ModuleExports */ && ts.exportAssignmentIsAlias(node) || + ts.isPropertyAccessExpression(node) && ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */ - && isAliasableOrJsExpression(node.parent.right) - || node.kind === 289 /* ShorthandPropertyAssignment */ - || node.kind === 288 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer) - || ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true); + && isAliasableOrJsExpression(node.parent.right) || + node.kind === 286 /* ShorthandPropertyAssignment */ || + node.kind === 285 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer); } function isAliasableOrJsExpression(e) { return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - var commonJSPropertyAccess = getCommonJSPropertyAccess(node); - if (commonJSPropertyAccess) { - var name = ts.getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0]; - return ts.isIdentifier(commonJSPropertyAccess.name) - ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText)) - : undefined; - } - if (ts.isVariableDeclaration(node) || node.moduleReference.kind === 272 /* ExternalModuleReference */) { - var immediate = resolveExternalModuleName(node, ts.getExternalModuleRequireArgument(node) || ts.getExternalModuleImportEqualsDeclarationExpression(node)); + if (node.moduleReference.kind === 269 /* ExternalModuleReference */) { + var immediate = resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node)); var resolved_4 = resolveExternalModuleSymbol(immediate); markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false); return resolved_4; @@ -45418,7 +44276,10 @@ var ts; } function resolveExportByName(moduleSymbol, name, sourceNode, dontResolveAlias) { var exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */); - var exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports.get(name); + if (exportValue) { + return getPropertyOfType(getTypeOfSymbol(exportValue), name); + } + var exportSymbol = moduleSymbol.exports.get(name); var resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(sourceNode, exportSymbol, resolved, /*overwriteEmpty*/ false); return resolved; @@ -45559,9 +44420,11 @@ var ts; result.exports = new ts.Map(valueSymbol.exports); return result; } - function getExportOfModule(symbol, name, specifier, dontResolveAlias) { + function getExportOfModule(symbol, specifier, dontResolveAlias) { + var _a; if (symbol.flags & 1536 /* Module */) { - var exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText); + var name = ((_a = specifier.propertyName) !== null && _a !== void 0 ? _a : specifier.name).escapedText; + var exportSymbol = getExportsOfSymbol(symbol).get(name); var resolved = resolveSymbol(exportSymbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(specifier, exportSymbol, resolved, /*overwriteEmpty*/ false); return resolved; @@ -45578,14 +44441,10 @@ var ts; function getExternalModuleMember(node, specifier, dontResolveAlias) { var _a; if (dontResolveAlias === void 0) { dontResolveAlias = false; } - var moduleSpecifier = ts.getExternalModuleRequireArgument(node) || node.moduleSpecifier; - var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); // TODO: GH#18217 - var name = !ts.isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name; - if (!ts.isIdentifier(name)) { - return undefined; - } + var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); + var name = specifier.propertyName || specifier.name; var suppressInteropError = name.escapedText === "default" /* Default */ && !!(compilerOptions.allowSyntheticDefaultImports || compilerOptions.esModuleInterop); - var targetSymbol = resolveESModuleSymbol(moduleSymbol, moduleSpecifier, dontResolveAlias, suppressInteropError); + var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias, suppressInteropError); if (targetSymbol) { if (name.escapedText) { if (ts.isShorthandAmbientModuleSymbol(moduleSymbol)) { @@ -45601,7 +44460,7 @@ var ts; } // if symbolFromVariable is export - get its final target symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); - var symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias); + var symbolFromModule = getExportOfModule(targetSymbol, specifier, dontResolveAlias); if (symbolFromModule === undefined && name.escapedText === "default" /* Default */) { var file = ts.find(moduleSymbol.declarations, ts.isSourceFile); if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias)) { @@ -45617,7 +44476,7 @@ var ts; var suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol); if (suggestion !== undefined) { var suggestionName = symbolToString(suggestion); - var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName); + var diagnostic = error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2, moduleName, declarationName, suggestionName); if (suggestion.valueDeclaration) { ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName)); } @@ -45678,21 +44537,10 @@ var ts; } } function getTargetOfImportSpecifier(node, dontResolveAlias) { - var root = ts.isBindingElement(node) ? ts.getRootDeclaration(node) : node.parent.parent.parent; - var commonJSPropertyAccess = getCommonJSPropertyAccess(root); - var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias); - var name = node.propertyName || node.name; - if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) { - return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias); - } + var resolved = getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false); return resolved; } - function getCommonJSPropertyAccess(node) { - if (ts.isVariableDeclaration(node) && node.initializer && ts.isPropertyAccessExpression(node.initializer)) { - return node.initializer; - } - } function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { var resolved = resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false); @@ -45729,7 +44577,7 @@ var ts; var expression = node.initializer; return getTargetOfAliasLikeExpression(expression, dontRecursivelyResolve); } - function getTargetOfAccessExpression(node, dontRecursivelyResolve) { + function getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve) { if (!(ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 62 /* EqualsToken */)) { return undefined; } @@ -45738,32 +44586,29 @@ var ts; function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { if (dontRecursivelyResolve === void 0) { dontRecursivelyResolve = false; } switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: - case 249 /* VariableDeclaration */: + case 257 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return getTargetOfNamespaceExport(node, dontRecursivelyResolve); - case 265 /* ImportSpecifier */: - case 198 /* BindingElement */: + case 262 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 266 /* ExportAssignment */: - case 216 /* BinaryExpression */: + case 263 /* ExportAssignment */: + case 213 /* BinaryExpression */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return resolveEntityName(node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ true, dontRecursivelyResolve); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getTargetOfPropertyAssignment(node, dontRecursivelyResolve); - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: - return getTargetOfAccessExpression(node, dontRecursivelyResolve); + case 198 /* PropertyAccessExpression */: + return getTargetOfPropertyAccessExpression(node, dontRecursivelyResolve); default: return ts.Debug.fail(); } @@ -45830,7 +44675,7 @@ var ts; * @param overwriteEmpty Checks `resolvesToSymbol` for type-only declarations even if `aliasDeclaration` */ function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) { - if (!aliasDeclaration || ts.isPropertyAccessExpression(aliasDeclaration)) + if (!aliasDeclaration) return false; // If the declaration itself is type-only, mark it and return. // No need to check what it resolves to. @@ -45914,13 +44759,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 78 /* Identifier */ || entityName.parent.kind === 157 /* QualifiedName */) { + if (entityName.kind === 78 /* Identifier */ || entityName.parent.kind === 156 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 260 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 257 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -45944,9 +44789,9 @@ var ts; return getMergedSymbol(symbolFromJSPrototype); } } - else if (name.kind === 157 /* QualifiedName */ || name.kind === 201 /* PropertyAccessExpression */) { - var left = name.kind === 157 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 157 /* QualifiedName */ ? name.right : name.name; + else if (name.kind === 156 /* QualifiedName */ || name.kind === 198 /* PropertyAccessExpression */) { + var left = name.kind === 156 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 156 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -45972,12 +44817,7 @@ var ts; symbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, meaning)); if (!symbol) { if (!ignoreErrors) { - var namespaceName = getFullyQualifiedName(namespace); - var declarationName = ts.declarationNameToString(right); - var suggestion = getSuggestedSymbolForNonexistentModule(right, namespace); - suggestion ? - error(right, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestion)) : - error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName); + error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); } return undefined; } @@ -45986,7 +44826,7 @@ var ts; throw ts.Debug.assertNever(name, "Unknown entity name kind."); } ts.Debug.assert((ts.getCheckFlags(symbol) & 1 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 266 /* ExportAssignment */)) { + if (!ts.nodeIsSynthesized(name) && ts.isEntityName(name) && (symbol.flags & 2097152 /* Alias */ || name.parent.kind === 263 /* ExportAssignment */)) { markSymbolOfAliasDeclarationIfTypeOnly(ts.getAliasDeclarationFromName(name), symbol, /*finalTarget*/ undefined, /*overwriteEmpty*/ true); } return (symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol); @@ -46170,7 +45010,7 @@ var ts; ? ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, packageId.name, ts.mangleScopedPackageName(packageId.name)) : ts.chainDiagnosticMessages( - /*details*/ undefined, ts.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name)) + /*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference, ts.mangleScopedPackageName(packageId.name)) : undefined; errorOrSuggestion(isError, errorNode, ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedFileName)); } @@ -46212,7 +45052,7 @@ var ts; function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); if (!dontResolveAlias && symbol) { - if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 297 /* SourceFile */)) { + if (!suppressInteropError && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */)) && !ts.getDeclarationOfKind(symbol, 294 /* SourceFile */)) { var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; @@ -46514,7 +45354,7 @@ var ts; var members = node.members; for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { var member = members_3[_i]; - if (member.kind === 166 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 165 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -46523,7 +45363,6 @@ var ts; var result = new Type(checker, flags); typeCount++; result.id = typeCount; - typeCatalog.push(result); return result; } function createIntrinsicType(kind, intrinsicName, objectFlags) { @@ -46602,12 +45441,12 @@ var ts; } } switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: var sym = getSymbolOfNode(location); // `sym` may not have exports if this module declaration is backed by the symbol for a `const` that's being rewritten // into a namespace - in such cases, it's best to just let the namespace appear empty (the const members couldn't have referred @@ -46616,9 +45455,9 @@ var ts; return { value: result }; } break; - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: // Type parameters are bound into `members` lists so they can merge across declarations // This is troublesome, since in all other respects, they behave like locals :cries: // TODO: the below is shared with similar code in `resolveName` - in fact, rephrasing all this symbol @@ -46701,7 +45540,7 @@ var ts; && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) // While exports are generally considered to be in scope, export-specifier declared symbols are _not_ // See similar comment in `resolveName` for details - && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */))) { + && (ignoreQualification || !ts.getDeclarationOfKind(symbolFromSymbolTable, 267 /* ExportSpecifier */))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); if (candidate) { @@ -46745,7 +45584,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 270 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 267 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -46760,10 +45599,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: continue; default: return false; @@ -46892,10 +45731,10 @@ var ts; return node && getSymbolOfNode(node); } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { - return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isModuleWithStringLiteralName(declaration) || (declaration.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -46904,7 +45743,6 @@ var ts; } return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: aliasesToMakeVisible }; function getIsDeclarationVisible(declaration) { - var _a, _b; if (!isDeclarationVisible(declaration)) { // Mark the unexported alias as visible if its parent is visible // because these kind of aliases can be used to name types in declaration file @@ -46924,14 +45762,6 @@ var ts; && isDeclarationVisible(declaration.parent)) { return addVisibleAlias(declaration, declaration); } - else if (symbol.flags & 2097152 /* Alias */ && ts.isBindingElement(declaration) && ts.isInJSFile(declaration) && ((_a = declaration.parent) === null || _a === void 0 ? void 0 : _a.parent) // exported import-like top-level JS require statement - && ts.isVariableDeclaration(declaration.parent.parent) - && ((_b = declaration.parent.parent.parent) === null || _b === void 0 ? void 0 : _b.parent) && ts.isVariableStatement(declaration.parent.parent.parent.parent) - && !ts.hasSyntacticModifier(declaration.parent.parent.parent.parent, 1 /* Export */) - && declaration.parent.parent.parent.parent.parent // check if the thing containing the variable statement is visible (ie, the file) - && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) { - return addVisibleAlias(declaration, declaration.parent.parent.parent.parent); - } // Declaration is not visible return false; } @@ -46951,14 +45781,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 176 /* TypeQuery */ || + if (entityName.parent.kind === 175 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 158 /* ComputedPropertyName */) { + entityName.parent.kind === 157 /* ComputedPropertyName */) { // Typeof value meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 157 /* QualifiedName */ || entityName.kind === 201 /* PropertyAccessExpression */ || - entityName.parent.kind === 260 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 156 /* QualifiedName */ || entityName.kind === 198 /* PropertyAccessExpression */ || + entityName.parent.kind === 257 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -46999,7 +45829,7 @@ var ts; function symbolToStringWorker(writer) { var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217 // add neverAsciiEscape for GH#39027 - var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 297 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true }); + var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 294 /* SourceFile */ ? ts.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts.createPrinter({ removeComments: true }); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, entity, /*sourceFile*/ sourceFile, writer); return writer; @@ -47011,10 +45841,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 175 /* ConstructorType */ : 174 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 174 /* ConstructorType */ : 173 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 170 /* ConstructSignature */ : 169 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 169 /* ConstructSignature */ : 168 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -47060,9 +45890,6 @@ var ts; if (flags === void 0) { flags = 0 /* None */; } return flags & 814775659 /* NodeBuilderFlagsMask */; } - function isClassInstanceSide(type) { - return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(ts.getObjectFlags(type) & 1073741824 /* IsClassInstanceClone */)); - } function createNodeBuilder() { return { typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) { @@ -47094,7 +45921,6 @@ var ts; }, }; function withContext(enclosingDeclaration, flags, tracker, cb) { - var _a, _b; ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); var context = { enclosingDeclaration: enclosingDeclaration, @@ -47118,9 +45944,6 @@ var ts; approximateLength: 0 }; var resultingNode = cb(context); - if (context.truncating && context.flags & 1 /* NoTruncation */) { - (_b = (_a = context.tracker) === null || _a === void 0 ? void 0 : _a.reportTruncationError) === null || _b === void 0 ? void 0 : _b.call(_a); - } return context.encounteredError ? undefined : resultingNode; } function checkTruncationLength(context) { @@ -47147,22 +45970,22 @@ var ts; } if (type.flags & 1 /* Any */) { context.approximateLength += 3; - return ts.factory.createKeywordTypeNode(type === intrinsicMarkerType ? 136 /* IntrinsicKeyword */ : 128 /* AnyKeyword */); + return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } if (type.flags & 2 /* Unknown */) { - return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */); + return ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */); } if (type.flags & 4 /* String */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(147 /* StringKeyword */); + return ts.factory.createKeywordTypeNode(146 /* StringKeyword */); } if (type.flags & 8 /* Number */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(144 /* NumberKeyword */); + return ts.factory.createKeywordTypeNode(143 /* NumberKeyword */); } if (type.flags & 64 /* BigInt */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(155 /* BigIntKeyword */); + return ts.factory.createKeywordTypeNode(154 /* BigIntKeyword */); } if (type.flags & 16 /* Boolean */) { context.approximateLength += 7; @@ -47171,23 +45994,10 @@ var ts; if (type.flags & 1024 /* EnumLiteral */ && !(type.flags & 1048576 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); var parentName = symbolToTypeNode(parentSymbol, context, 788968 /* Type */); - if (getDeclaredTypeOfSymbol(parentSymbol) === type) { - return parentName; - } - var memberName = ts.symbolName(type.symbol); - if (ts.isIdentifierText(memberName, 0 /* ES3 */)) { - return appendReferenceToType(parentName, ts.factory.createTypeReferenceNode(memberName, /*typeArguments*/ undefined)); - } - if (ts.isImportTypeNode(parentName)) { - parentName.isTypeOf = true; // mutably update, node is freshly manufactured anyhow - return ts.factory.createIndexedAccessTypeNode(parentName, ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName))); - } - else if (ts.isTypeReferenceNode(parentName)) { - return ts.factory.createIndexedAccessTypeNode(ts.factory.createTypeQueryNode(parentName.typeName), ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(memberName))); - } - else { - return ts.Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`."); - } + var enumLiteralName = getDeclaredTypeOfSymbol(parentSymbol) === type + ? parentName + : appendReferenceToType(parentName, ts.factory.createTypeReferenceNode(ts.symbolName(type.symbol), /*typeArguments*/ undefined)); + return enumLiteralName; } if (type.flags & 1056 /* EnumLike */) { return symbolToTypeNode(type.symbol, context, 788968 /* Type */); @@ -47220,7 +46030,7 @@ var ts; } } context.approximateLength += 13; - return ts.factory.createTypeOperatorNode(151 /* UniqueKeyword */, ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */)); + return ts.factory.createTypeOperatorNode(150 /* UniqueKeyword */, ts.factory.createKeywordTypeNode(147 /* SymbolKeyword */)); } if (type.flags & 16384 /* Void */) { context.approximateLength += 4; @@ -47228,7 +46038,7 @@ var ts; } if (type.flags & 32768 /* Undefined */) { context.approximateLength += 9; - return ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */); + return ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */); } if (type.flags & 65536 /* Null */) { context.approximateLength += 4; @@ -47236,15 +46046,15 @@ var ts; } if (type.flags & 131072 /* Never */) { context.approximateLength += 5; - return ts.factory.createKeywordTypeNode(141 /* NeverKeyword */); + return ts.factory.createKeywordTypeNode(140 /* NeverKeyword */); } if (type.flags & 4096 /* ESSymbol */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(148 /* SymbolKeyword */); + return ts.factory.createKeywordTypeNode(147 /* SymbolKeyword */); } if (type.flags & 67108864 /* NonPrimitive */) { context.approximateLength += 6; - return ts.factory.createKeywordTypeNode(145 /* ObjectKeyword */); + return ts.factory.createKeywordTypeNode(144 /* ObjectKeyword */); } if (isThisTypeParameter(type)) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -47312,19 +46122,7 @@ var ts; var indexedType = type.type; context.approximateLength += 6; var indexTypeNode = typeToTypeNodeHelper(indexedType, context); - return ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, indexTypeNode); - } - if (type.flags & 134217728 /* TemplateLiteral */) { - var texts_1 = type.texts; - var types_1 = type.types; - var templateHead = ts.factory.createTemplateHead(texts_1[0]); - var templateSpans = ts.factory.createNodeArray(ts.map(types_1, function (t, i) { return ts.factory.createTemplateLiteralTypeSpan(typeToTypeNodeHelper(t, context), (i < types_1.length - 1 ? ts.factory.createTemplateMiddle : ts.factory.createTemplateTail)(texts_1[i + 1])); })); - context.approximateLength += 2; - return ts.factory.createTemplateLiteralType(templateHead, templateSpans); - } - if (type.flags & 268435456 /* StringMapping */) { - var typeNode = typeToTypeNodeHelper(type.type, context); - return symbolToTypeNode(type.symbol, context, 788968 /* Type */, [typeNode]); + return ts.factory.createTypeOperatorNode(137 /* KeyOfKeyword */, indexTypeNode); } if (type.flags & 8388608 /* IndexedAccess */) { var objectTypeNode = typeToTypeNodeHelper(type.objectType, context); @@ -47369,15 +46167,14 @@ var ts; if (isMappedTypeWithKeyofConstraintDeclaration(type)) { // We have a { [P in keyof T]: X } // We do this to ensure we retain the toplevel keyof-ness of the type which may be lost due to keyof distribution during `getConstraintTypeFromMappedType` - appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(138 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context)); + appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(137 /* KeyOfKeyword */, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context)); } else { appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type), context); } var typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type), context, appropriateConstraintTypeNode); - var nameTypeNode = type.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type), context) : undefined; var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); - var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode); + var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); context.approximateLength += 10; return ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */); } @@ -47386,16 +46183,16 @@ var ts; var typeId = type.id; var symbol = type.symbol; if (symbol) { - var isInstanceType = isClassInstanceSide(type) ? 788968 /* Type */ : 111551 /* Value */; if (isJSConstructor(symbol.valueDeclaration)) { // Instance and static types share the same symbol; only add 'typeof' for the static side. + var isInstanceType = type === getDeclaredTypeOfClassOrInterface(symbol) ? 788968 /* Type */ : 111551 /* Value */; return symbolToTypeNode(symbol, context, isInstanceType); } // Always use 'typeof T' for type of class, enum, and module objects - else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 221 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + else if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 218 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { - return symbolToTypeNode(symbol, context, isInstanceType); + return symbolToTypeNode(symbol, context, 111551 /* Value */); } else if ((_a = context.visitedTypes) === null || _a === void 0 ? void 0 : _a.has(typeId)) { // If type is an anonymous type literal in a type alias declaration, use type alias name @@ -47423,7 +46220,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 297 /* SourceFile */ || declaration.parent.kind === 257 /* ModuleBlock */; + return declaration.parent.kind === 294 /* SourceFile */ || declaration.parent.kind === 254 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -47474,12 +46271,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 174 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 173 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 175 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 174 /* ConstructorType */, context); return signatureNode; } } @@ -47500,7 +46297,7 @@ var ts; } var elementType = typeToTypeNodeHelper(typeArguments[0], context); var arrayType = ts.factory.createArrayTypeNode(elementType); - return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, arrayType); + return type.target === globalArrayType ? arrayType : ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, arrayType); } else if (type.target.objectFlags & 8 /* Tuple */) { if (typeArguments.length > 0) { @@ -47524,12 +46321,12 @@ var ts; } } var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode(tupleConstituentNodes), 1 /* SingleLine */); - return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } } if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { var tupleTypeNode = ts.setEmitFlags(ts.factory.createTupleTypeNode([]), 1 /* SingleLine */); - return type.target.readonly ? ts.factory.createTypeOperatorNode(142 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; + return type.target.readonly ? ts.factory.createTypeOperatorNode(141 /* ReadonlyKeyword */, tupleTypeNode) : tupleTypeNode; } context.encounteredError = true; return undefined; // TODO: GH#18217 @@ -47557,10 +46354,10 @@ var ts; // the default outer type arguments), we don't show the group. if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { var typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start, i), context); - var flags_3 = context.flags; + var flags_2 = context.flags; context.flags |= 16 /* ForbidIndexedAccessSymbolReferences */; var ref = symbolToTypeNode(parent, context, 788968 /* Type */, typeArgumentSlice); - context.flags = flags_3; + context.flags = flags_2; resultType = !resultType ? ref : appendReferenceToType(resultType, ref); } } @@ -47636,11 +46433,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 169 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 168 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 170 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 169 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexSignature = void 0; @@ -47716,7 +46513,7 @@ var ts; var signatures = getSignaturesOfType(filterType(propertyType, function (t) { return !(t.flags & 32768 /* Undefined */); }), 0 /* Call */); for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { var signature = signatures_1[_i]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 164 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 163 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken }); typeElements.push(preserveCommentsOn(methodDeclaration)); } } @@ -47731,7 +46528,7 @@ var ts; propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } context.flags = savedFlags; - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.factory.createToken(141 /* ReadonlyKeyword */)] : undefined; if (modifiers) { context.approximateLength += 9; } @@ -47739,8 +46536,8 @@ var ts; typeElements.push(preserveCommentsOn(propertySignature)); } function preserveCommentsOn(node) { - if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; })) { - var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 333 /* JSDocPropertyTag */; }); + if (ts.some(propertySymbol.declarations, function (d) { return d.kind === 328 /* JSDocPropertyTag */; })) { + var d = ts.find(propertySymbol.declarations, function (d) { return d.kind === 328 /* JSDocPropertyTag */; }); var commentText = d.comment; if (commentText) { ts.setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); @@ -47772,8 +46569,8 @@ var ts; var seenNames = mayHaveNameCollisions ? ts.createUnderscoreEscapedMultiMap() : undefined; var result_4 = []; var i = 0; - for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { - var type = types_2[_i]; + for (var _i = 0, types_1 = types; _i < types_1.length; _i++) { + var type = types_1[_i]; i++; if (checkTruncationLength(context) && (i + 2 < types.length - 1)) { result_4.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", /*typeArguments*/ undefined)); @@ -47808,8 +46605,8 @@ var ts; var b = _b[0]; return typesAreSameReference(a, b); })) { - for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { - var _a = types_3[_i], type = _a[0], resultIndex = _a[1]; + for (var _i = 0, types_2 = types; _i < types_2.length; _i++) { + var _a = types_2[_i], type = _a[0], resultIndex = _a[1]; result_4[resultIndex] = typeToTypeNodeHelper(type, context); } } @@ -47826,7 +46623,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context, typeNode) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 /* String */ ? 147 /* StringKeyword */ : 144 /* NumberKeyword */); + var indexerTypeNode = ts.factory.createKeywordTypeNode(kind === 0 /* String */ ? 146 /* StringKeyword */ : 143 /* NumberKeyword */); var indexingParameter = ts.factory.createParameterDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -47841,7 +46638,7 @@ var ts; } context.approximateLength += (name.length + 4); return ts.factory.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.factory.createToken(142 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.factory.createToken(141 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context, options) { var _a, _b, _c, _d; @@ -47856,9 +46653,7 @@ var ts; else { typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); } - var expandedParams = getExpandedParameters(signature, /*skipUnionExpanding*/ true)[0]; - // If the expanded parameter list had a variadic in a non-trailing position, don't expand it - var parameters = (ts.some(expandedParams, function (p) { return p !== expandedParams[expandedParams.length - 1] && !!(ts.getCheckFlags(p) & 32768 /* RestParameter */); }) ? signature.parameters : expandedParams).map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 166 /* Constructor */, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); }); + var parameters = getExpandedParameters(signature, /*skipUnionExpanding*/ true)[0].map(function (parameter) { return symbolToParameterDeclaration(parameter, context, kind === 165 /* Constructor */, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); @@ -47885,20 +46680,20 @@ var ts; } } context.approximateLength += 3; // Usually a signature contributes a few more characters than this, but 3 is the minimum - var node = kind === 169 /* CallSignature */ ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) : - kind === 170 /* ConstructSignature */ ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : - kind === 164 /* MethodSignature */ ? ts.factory.createMethodSignature(options === null || options === void 0 ? void 0 : options.modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : - kind === 165 /* MethodDeclaration */ ? ts.factory.createMethodDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) : - kind === 166 /* Constructor */ ? ts.factory.createConstructorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, /*body*/ undefined) : - kind === 167 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) : - kind === 168 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, /*body*/ undefined) : - kind === 171 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, returnTypeNode) : - kind === 308 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) : - kind === 174 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : - kind === 175 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : - kind === 251 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) : - kind === 208 /* FunctionExpression */ ? ts.factory.createFunctionExpression(options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) : - kind === 209 /* ArrowFunction */ ? ts.factory.createArrowFunction(options === null || options === void 0 ? void 0 : options.modifiers, typeParameters, parameters, returnTypeNode, /*equalsGreaterThanToken*/ undefined, ts.factory.createBlock([])) : + var node = kind === 168 /* CallSignature */ ? ts.factory.createCallSignature(typeParameters, parameters, returnTypeNode) : + kind === 169 /* ConstructSignature */ ? ts.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : + kind === 163 /* MethodSignature */ ? ts.factory.createMethodSignature(options === null || options === void 0 ? void 0 : options.modifiers, (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : ts.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : + kind === 164 /* MethodDeclaration */ ? ts.factory.createMethodDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts.factory.createIdentifier(""), /*questionToken*/ undefined, typeParameters, parameters, returnTypeNode, /*body*/ undefined) : + kind === 165 /* Constructor */ ? ts.factory.createConstructorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, /*body*/ undefined) : + kind === 166 /* GetAccessor */ ? ts.factory.createGetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts.factory.createIdentifier(""), parameters, returnTypeNode, /*body*/ undefined) : + kind === 167 /* SetAccessor */ ? ts.factory.createSetAccessorDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts.factory.createIdentifier(""), parameters, /*body*/ undefined) : + kind === 170 /* IndexSignature */ ? ts.factory.createIndexSignature(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, parameters, returnTypeNode) : + kind === 304 /* JSDocFunctionType */ ? ts.factory.createJSDocFunctionType(parameters, returnTypeNode) : + kind === 173 /* FunctionType */ ? ts.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : + kind === 174 /* ConstructorType */ ? ts.factory.createConstructorTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(""))) : + kind === 248 /* FunctionDeclaration */ ? ts.factory.createFunctionDeclaration(/*decorators*/ undefined, options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, /*body*/ undefined) : + kind === 205 /* FunctionExpression */ ? ts.factory.createFunctionExpression(options === null || options === void 0 ? void 0 : options.modifiers, /*asteriskToken*/ undefined, (options === null || options === void 0 ? void 0 : options.name) ? ts.cast(options.name, ts.isIdentifier) : ts.factory.createIdentifier(""), typeParameters, parameters, returnTypeNode, ts.factory.createBlock([])) : + kind === 206 /* ArrowFunction */ ? ts.factory.createArrowFunction(options === null || options === void 0 ? void 0 : options.modifiers, typeParameters, parameters, returnTypeNode, /*equalsGreaterThanToken*/ undefined, ts.factory.createBlock([])) : ts.Debug.assertNever(kind); if (typeArguments) { node.typeArguments = ts.factory.createNodeArray(typeArguments); @@ -47920,9 +46715,9 @@ var ts; return typeParameterToDeclarationWithConstraint(type, context, constraintNode); } function symbolToParameterDeclaration(parameterSymbol, context, preserveModifierFlags, privateSymbolVisitor, bundledImports) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 160 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 159 /* Parameter */); if (!parameterDeclaration && !ts.isTransientSymbol(parameterSymbol)) { - parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 326 /* JSDocParameterTag */); + parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 322 /* JSDocParameterTag */); } var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -47937,7 +46732,7 @@ var ts; var dotDotDotToken = isRest ? ts.factory.createToken(25 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 78 /* Identifier */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name), 16777216 /* NoAsciiEscaping */) : - parameterDeclaration.name.kind === 157 /* QualifiedName */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : + parameterDeclaration.name.kind === 156 /* QualifiedName */ ? ts.setEmitFlags(ts.factory.cloneNode(parameterDeclaration.name.right), 16777216 /* NoAsciiEscaping */) : cloneBindingName(parameterDeclaration.name) : ts.symbolName(parameterSymbol) : ts.symbolName(parameterSymbol); @@ -48102,11 +46897,11 @@ var ts; } function getSpecifierForModuleSymbol(symbol, context) { var _a; - var file = ts.getDeclarationOfKind(symbol, 297 /* SourceFile */); + var file = ts.getDeclarationOfKind(symbol, 294 /* SourceFile */); if (!file) { var equivalentFileSymbol = ts.firstDefined(symbol.declarations, function (d) { return getFileSymbolIfFileSymbolExportEqualsContainer(d, symbol); }); if (equivalentFileSymbol) { - file = ts.getDeclarationOfKind(equivalentFileSymbol, 297 /* SourceFile */); + file = ts.getDeclarationOfKind(equivalentFileSymbol, 294 /* SourceFile */); } } if (file && file.moduleName !== undefined) { @@ -48145,7 +46940,7 @@ var ts; // specifier preference var moduleResolverHost = context.tracker.moduleResolverHost; var specifierCompilerOptions = isBundle_1 ? __assign(__assign({}, compilerOptions), { baseUrl: moduleResolverHost.getCommonSourceDirectory() }) : compilerOptions; - specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative", importModuleSpecifierEnding: isBundle_1 ? "minimal" : undefined })); + specifier = ts.first(ts.moduleSpecifiers.getModuleSpecifiers(symbol, specifierCompilerOptions, contextFile, moduleResolverHost, { importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "relative" })); (_a = links.specifierCache) !== null && _a !== void 0 ? _a : (links.specifierCache = new ts.Map()); links.specifierCache.set(contextFile.path, specifier); } @@ -48451,7 +47246,7 @@ var ts; } var oldFlags = context.flags; if (type.flags & 8192 /* UniqueESSymbol */ && - type.symbol === symbol && (!context.enclosingDeclaration || ts.some(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === ts.getSourceFileOfNode(context.enclosingDeclaration); }))) { + type.symbol === symbol) { context.flags |= 1048576 /* AllowUniqueESSymbolType */; } var result = typeToTypeNodeHelper(type, context); @@ -48484,17 +47279,17 @@ var ts; function visitExistingNodeTreeSymbols(node) { var _a, _b; // We don't _actually_ support jsdoc namepath types, emit `any` instead - if (ts.isJSDocAllType(node) || node.kind === 310 /* JSDocNamepathType */) { + if (ts.isJSDocAllType(node) || node.kind === 306 /* JSDocNamepathType */) { return ts.factory.createKeywordTypeNode(128 /* AnyKeyword */); } if (ts.isJSDocUnknownType(node)) { - return ts.factory.createKeywordTypeNode(152 /* UnknownKeyword */); + return ts.factory.createKeywordTypeNode(151 /* UnknownKeyword */); } if (ts.isJSDocNullableType(node)) { return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createLiteralTypeNode(ts.factory.createNull())]); } if (ts.isJSDocOptionalType(node)) { - return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(150 /* UndefinedKeyword */)]); + return ts.factory.createUnionTypeNode([ts.visitNode(node.type, visitExistingNodeTreeSymbols), ts.factory.createKeywordTypeNode(149 /* UndefinedKeyword */)]); } if (ts.isJSDocNonNullableType(node)) { return ts.visitNode(node.type, visitExistingNodeTreeSymbols); @@ -48608,8 +47403,8 @@ var ts; } } function symbolTableToDeclarationStatements(symbolTable, context, bundled) { - var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 165 /* MethodDeclaration */, /*useAcessors*/ true); - var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 164 /* MethodSignature */, /*useAcessors*/ false); + var serializePropertySymbolForClass = makeSerializePropertySymbol(ts.factory.createPropertyDeclaration, 164 /* MethodDeclaration */, /*useAcessors*/ true); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol(function (_decorators, mods, name, question, type) { return ts.factory.createPropertySignature(mods, name, question, type); }, 163 /* MethodSignature */, /*useAcessors*/ false); // TODO: Use `setOriginalNode` on original declaration names where possible so these declarations see some kind of // declaration mapping // We save the enclosing declaration off here so it's not adjusted by well-meaning declaration @@ -48888,50 +47683,38 @@ var ts; if (textRange && ts.isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) { textRange = textRange.parent.parent; } - var propertyAccessRequire = ts.find(symbol.declarations, ts.isPropertyAccessExpression); - if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right) - && type.symbol && ts.isSourceFile(type.symbol.valueDeclaration)) { - var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right; + var statement = ts.setTextRange(ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ + ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) + ], flags)), textRange); + addResult(statement, name !== localName ? modifierFlags & ~1 /* Export */ : modifierFlags); + if (name !== localName && !isPrivate) { + // We rename the variable declaration we generate for Property symbols since they may have a name which + // conflicts with a local declaration. For example, given input: + // ``` + // function g() {} + // module.exports.g = g + // ``` + // In such a situation, we have a local variable named `g`, and a separate exported variable named `g`. + // Naively, we would emit + // ``` + // function g() {} + // export const g: typeof g; + // ``` + // That's obviously incorrect - the `g` in the type annotation needs to refer to the local `g`, but + // the export declaration shadows it. + // To work around that, we instead write + // ``` + // function g() {} + // const g_1: typeof g; + // export { g_1 as g }; + // ``` + // To create an export named `g` that does _not_ shadow the local `g` addResult(ts.factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(alias, localName)])), 0 /* None */); - context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551 /* Value */); - } - else { - var statement = ts.setTextRange(ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ - ts.factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) - ], flags)), textRange); - addResult(statement, name !== localName ? modifierFlags & ~1 /* Export */ : modifierFlags); - if (name !== localName && !isPrivate) { - // We rename the variable declaration we generate for Property symbols since they may have a name which - // conflicts with a local declaration. For example, given input: - // ``` - // function g() {} - // module.exports.g = g - // ``` - // In such a situation, we have a local variable named `g`, and a separate exported variable named `g`. - // Naively, we would emit - // ``` - // function g() {} - // export const g: typeof g; - // ``` - // That's obviously incorrect - the `g` in the type annotation needs to refer to the local `g`, but - // the export declaration shadows it. - // To work around that, we instead write - // ``` - // function g() {} - // const g_1: typeof g; - // export { g_1 as g }; - // ``` - // To create an export named `g` that does _not_ shadow the local `g` - addResult(ts.factory.createExportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, - /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0 /* None */); - needsExportDeclaration = false; - needsPostExportDefault = false; - } + /*isTypeOnly*/ false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0 /* None */); + needsExportDeclaration = false; + needsPostExportDefault = false; } } } @@ -48953,8 +47736,7 @@ var ts; if ((symbol.flags & (512 /* ValueModule */ | 1024 /* NamespaceModule */) && (!isConstMergedWithNS || isTypeOnlyNamespace(symbol))) || isConstMergedWithNSPrintableAsSignatureMerge) { serializeModule(symbol, symbolName, modifierFlags); } - // The class meaning serialization should handle serializing all interface members - if (symbol.flags & 64 /* Interface */ && !(symbol.flags & 32 /* Class */)) { + if (symbol.flags & 64 /* Interface */) { serializeInterface(symbol, symbolName, modifierFlags); } if (symbol.flags & 2097152 /* Alias */) { @@ -49049,8 +47831,8 @@ var ts; var baseTypes = getBaseTypes(interfaceType); var baseType = ts.length(baseTypes) ? getIntersectionType(baseTypes) : undefined; var members = ts.flatMap(getPropertiesOfType(interfaceType), function (p) { return serializePropertySymbolForInterface(p, baseType); }); - var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 169 /* CallSignature */); - var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 170 /* ConstructSignature */); + var callSignatures = serializeSignatures(0 /* Call */, interfaceType, baseType, 168 /* CallSignature */); + var constructSignatures = serializeSignatures(1 /* Construct */, interfaceType, baseType, 169 /* ConstructSignature */); var indexSignatures = serializeIndexSignatures(interfaceType, baseType); var heritageClauses = !ts.length(baseTypes) ? undefined : [ts.factory.createHeritageClause(93 /* ExtendsKeyword */, ts.mapDefined(baseTypes, function (b) { return trySerializeAsTypeReference(b, 111551 /* Value */); }))]; addResult(ts.factory.createInterfaceDeclaration( @@ -49119,7 +47901,7 @@ var ts; for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { var sig = signatures_2[_i]; // Each overload becomes a separate function declaration, in order - var decl = signatureToSignatureDeclarationHelper(sig, 251 /* FunctionDeclaration */, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); + var decl = signatureToSignatureDeclarationHelper(sig, 248 /* FunctionDeclaration */, context, { name: ts.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); // for expressions assigned to `var`s, use the `var` as the text range addResult(ts.setTextRange(decl, sig.declaration && ts.isVariableDeclaration(sig.declaration.parent) && sig.declaration.parent.parent || sig.declaration), modifierFlags); } @@ -49182,7 +47964,7 @@ var ts; } function isNamespaceMember(p) { return !!(p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) || - !(p.flags & 4194304 /* Prototype */ || p.escapedName === "prototype" || p.valueDeclaration && ts.getEffectiveModifierFlags(p.valueDeclaration) & 32 /* Static */ && ts.isClassLike(p.valueDeclaration.parent)); + !(p.flags & 4194304 /* Prototype */ || p.escapedName === "prototype" || p.valueDeclaration && ts.isClassLike(p.valueDeclaration.parent)); } function serializeAsClass(symbol, localName, modifierFlags) { var _a; @@ -49233,14 +48015,13 @@ var ts; !ts.some(getSignaturesOfType(staticType, 1 /* Construct */)); var constructors = isNonConstructableClassLikeInJsFile ? [ts.factory.createConstructorDeclaration(/*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags(8 /* Private */), [], /*body*/ undefined)] : - serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 166 /* Constructor */); + serializeSignatures(1 /* Construct */, staticType, baseTypes[0], 165 /* Constructor */); var indexSignatures = serializeIndexSignatures(classType, baseTypes[0]); addResult(ts.setTextRange(ts.factory.createClassDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, localName, typeParamDecls, heritageClauses, __spreadArrays(indexSignatures, staticMembers, constructors, publicProperties, privateProperties)), symbol.declarations && ts.filter(symbol.declarations, function (d) { return ts.isClassDeclaration(d) || ts.isClassExpression(d); })[0]), modifierFlags); } function serializeAsAlias(symbol, localName, modifierFlags) { - var _a, _b, _c, _d, _e; // synthesize an alias, eg `export { symbolName as Name }` // need to mark the alias `symbol` points at // as something we need to serialize as a private declaration as well @@ -49259,66 +48040,23 @@ var ts; var targetName = getInternalSymbolName(target, verbatimTargetName); includePrivateSymbol(target); // the target may be within the same scope - attempt to serialize it first switch (node.kind) { - case 198 /* BindingElement */: - if (((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.kind) === 249 /* VariableDeclaration */) { - // const { SomeClass } = require('./lib'); - var specifier_1 = getSpecifierForModuleSymbol(target.parent || target, context); // './lib' - var propertyName = node.propertyName; - addResult(ts.factory.createImportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1)), 0 /* None */); - break; - } - // We don't know how to serialize this (nested?) binding element - ts.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization"); - break; - case 289 /* ShorthandPropertyAssignment */: - if (((_e = (_d = node.parent) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.kind) === 216 /* BinaryExpression */) { - // module.exports = { SomeClass } - serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), targetName); - } - break; - case 249 /* VariableDeclaration */: - // commonjs require: const x = require('y') - if (ts.isPropertyAccessExpression(node.initializer)) { - // const x = require('y').z - var initializer = node.initializer; // require('y').z - var uniqueName = ts.factory.createUniqueName(localName); // _x - var specifier_2 = getSpecifierForModuleSymbol(target.parent || target, context); // 'y' - // import _x = require('y'); - addResult(ts.factory.createImportEqualsDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, uniqueName, ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(specifier_2))), 0 /* None */); - // import x = _x.z - addResult(ts.factory.createImportEqualsDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.factory.createIdentifier(localName), ts.factory.createQualifiedName(uniqueName, initializer.name)), modifierFlags); - break; - } - // else fall through and treat commonjs require just like import= - case 260 /* ImportEqualsDeclaration */: - // This _specifically_ only exists to handle json declarations - where we make aliases, but since - // we emit no declarations for the json document, must not refer to it in the declarations - if (target.escapedName === "export=" /* ExportEquals */ && ts.some(target.declarations, ts.isJsonSourceFile)) { - serializeMaybeAliasAssignment(symbol); - break; - } + case 257 /* ImportEqualsDeclaration */: // Could be a local `import localName = ns.member` or // an external `import localName = require("whatever")` - var isLocalImport = !(target.flags & 512 /* ValueModule */) && !ts.isVariableDeclaration(node); + var isLocalImport = !(target.flags & 512 /* ValueModule */); addResult(ts.factory.createImportEqualsDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createIdentifier(localName), isLocalImport ? symbolToName(target, context, 67108863 /* All */, /*expectsIdentifier*/ false) - : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context)))), isLocalImport ? modifierFlags : 0 /* None */); + : ts.factory.createExternalModuleReference(ts.factory.createStringLiteral(getSpecifierForModuleSymbol(symbol, context)))), isLocalImport ? modifierFlags : 0 /* None */); break; - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: // export as namespace foo // TODO: Not part of a file's local or export symbol tables // Is bound into file.symbol.globalExports instead, which we don't currently traverse addResult(ts.factory.createNamespaceExportDeclaration(ts.idText(node.name)), 0 /* None */); break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, ts.factory.createIdentifier(localName), /*namedBindings*/ undefined), @@ -49327,18 +48065,18 @@ var ts; // In such cases, the `target` refers to the module itself already ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause(/*isTypeOnly*/ false, /*importClause*/ undefined, ts.factory.createNamespaceImport(ts.factory.createIdentifier(localName))), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: addResult(ts.factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, ts.factory.createNamespaceExport(ts.factory.createIdentifier(localName)), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context))), 0 /* None */); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: addResult(ts.factory.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.factory.createImportClause( @@ -49347,7 +48085,7 @@ var ts; ts.factory.createImportSpecifier(localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName)) ])), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context))), 0 /* None */); break; - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: // does not use localName because the symbol name in this case refers to the name in the exports table, // which we must exactly preserve var specifier = node.parent.parent.moduleSpecifier; @@ -49355,12 +48093,11 @@ var ts; // another file serializeExportSpecifier(ts.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts.isStringLiteralLike(specifier) ? ts.factory.createStringLiteral(specifier.text) : undefined); break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: serializeMaybeAliasAssignment(symbol); break; - case 216 /* BinaryExpression */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 213 /* BinaryExpression */: + case 198 /* PropertyAccessExpression */: // Could be best encoded as though an export specifier or as though an export assignment // If name is default or export=, do an export assignment // Otherwise do an export specifier @@ -49391,7 +48128,7 @@ var ts; var name = ts.unescapeLeadingUnderscores(symbol.escapedName); var isExportEquals = name === "export=" /* ExportEquals */; var isDefault = name === "default" /* Default */; - var isExportAssignmentCompatibleSymbolName = isExportEquals || isDefault; + var isExportAssignment = isExportEquals || isDefault; // synthesize export = ref // ref should refer to either be a locally scoped symbol which we need to emit, or // a reference to another namespace/module which we may need to emit an `import` statement for @@ -49403,8 +48140,8 @@ var ts; // In case `target` refers to a namespace member, look at the declaration and serialize the leftmost symbol in it // eg, `namespace A { export class B {} }; exports = A.B;` // Technically, this is all that's required in the case where the assignment is an entity name expression - var expr = aliasDecl && ((ts.isExportAssignment(aliasDecl) || ts.isBinaryExpression(aliasDecl)) ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl)); - var first_1 = expr && ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; + var expr = isExportAssignment ? ts.getExportAssignmentExpression(aliasDecl) : ts.getPropertyAssignmentAliasLikeExpression(aliasDecl); + var first_1 = ts.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : undefined; var referenced = first_1 && resolveEntityName(first_1, 67108863 /* All */, /*ignoreErrors*/ true, /*dontResolveAlias*/ true, enclosingDeclaration); if (referenced || target) { includePrivateSymbol(referenced || target); @@ -49416,17 +48153,17 @@ var ts; // into the containing scope anyway, so we want to skip the visibility checks. var oldTrack = context.tracker.trackSymbol; context.tracker.trackSymbol = ts.noop; - if (isExportAssignmentCompatibleSymbolName) { + if (isExportAssignment) { results.push(ts.factory.createExportAssignment( /*decorators*/ undefined, /*modifiers*/ undefined, isExportEquals, symbolToExpression(target, context, 67108863 /* All */))); } else { - if (first_1 === expr && first_1) { + if (first_1 === expr) { // serialize as `export {target as name}` serializeExportSpecifier(name, ts.idText(first_1)); } - else if (expr && ts.isClassExpression(expr)) { + else if (ts.isClassExpression(expr)) { serializeExportSpecifier(name, getInternalSymbolName(target, ts.symbolName(target))); } else { @@ -49449,19 +48186,15 @@ var ts; var typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol))); if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) { // If there are no index signatures and `typeToSerialize` is an object type, emit as a namespace instead of a const - serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 1 /* Export */); + serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignment ? 0 /* None */ : 1 /* Export */); } else { var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([ ts.factory.createVariableDeclaration(varName, /*exclamationToken*/ undefined, serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)) ], 2 /* Const */)); - // Inlined JSON types exported with [module.]exports= will already emit an export=, so should use `declare`. - // Otherwise, the type itself should be exported. - addResult(statement, target && target.flags & 4 /* Property */ && target.escapedName === "export=" /* ExportEquals */ ? 2 /* Ambient */ - : name === varName ? 1 /* Export */ - : 0 /* None */); + addResult(statement, name === varName ? 1 /* Export */ : 0 /* None */); } - if (isExportAssignmentCompatibleSymbolName) { + if (isExportAssignment) { results.push(ts.factory.createExportAssignment( /*decorators*/ undefined, /*modifiers*/ undefined, isExportEquals, ts.factory.createIdentifier(varName))); @@ -49482,8 +48215,7 @@ var ts; return ts.getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !getIndexInfoOfType(typeToSerialize, 0 /* String */) && !getIndexInfoOfType(typeToSerialize, 1 /* Number */) && - !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class - !!(ts.length(ts.filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || ts.length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && + !!(ts.length(getPropertiesOfType(typeToSerialize)) || ts.length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !ts.length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && ts.some(typeToSerialize.symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== ctxSrc; })) && @@ -49531,7 +48263,7 @@ var ts; } // This is an else/if as accessors and properties can't merge in TS, but might in JS // If this happens, we assume the accessor takes priority, as it imposes more constraints - else if (p.flags & (4 /* Property */ | 3 /* Variable */ | 98304 /* Accessor */)) { + else if (p.flags & (4 /* Property */ | 3 /* Variable */)) { return ts.setTextRange(createProperty( /*decorators*/ undefined, ts.factory.createModifiersFromModifierFlags((isReadonlySymbol(p) ? 64 /* Readonly */ : 0) | flag), name, p.flags & 16777216 /* Optional */ ? ts.factory.createToken(57 /* QuestionToken */) : undefined, isPrivate ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled), // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357 @@ -49774,7 +48506,7 @@ var ts; function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { var node = ts.walkUpParenthesizedTypes(type.symbol.declarations[0].parent); - if (node.kind === 254 /* TypeAliasDeclaration */) { + if (node.kind === 251 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -49782,11 +48514,11 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 257 /* ModuleBlock */ && + node.parent.kind === 254 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function isDefaultBindingContext(location) { - return location.kind === 297 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 294 /* SourceFile */ || ts.isAmbientModule(location); } function getNameOfSymbolFromNameType(symbol, context) { var nameType = getSymbolLinks(symbol).nameType; @@ -49845,17 +48577,17 @@ var ts; if (!declaration) { declaration = symbol.declarations[0]; // Declaration may be nameless, but we'll try anyway } - if (declaration.parent && declaration.parent.kind === 249 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 246 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } switch (declaration.kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } - return declaration.kind === 221 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; + return declaration.kind === 218 /* ClassExpression */ ? "(Anonymous class)" : "(Anonymous function)"; } } var name = getNameOfSymbolFromNameType(symbol, context); @@ -49872,28 +48604,28 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 324 /* JSDocCallbackTag */: - case 331 /* JSDocTypedefTag */: - case 325 /* JSDocEnumTag */: + case 320 /* JSDocCallbackTag */: + case 327 /* JSDocTypedefTag */: + case 321 /* JSDocEnumTag */: // Top-level jsdoc type aliases are considered exported // First parent is comment node, second is hosting declaration or token; we only care about those tokens or declarations whose parent is a source file return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts.isSourceFile(node.parent.parent.parent)); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 251 /* FunctionDeclaration */: - case 255 /* EnumDeclaration */: - case 260 /* ImportEqualsDeclaration */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 248 /* FunctionDeclaration */: + case 252 /* EnumDeclaration */: + case 257 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -49901,55 +48633,55 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 260 /* ImportEqualsDeclaration */ && parent.kind !== 297 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { + !(node.kind !== 257 /* ImportEqualsDeclaration */ && parent.kind !== 294 /* SourceFile */ && parent.flags & 8388608 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasEffectiveModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 166 /* Constructor */: - case 170 /* ConstructSignature */: - case 169 /* CallSignature */: - case 171 /* IndexSignature */: - case 160 /* Parameter */: - case 257 /* ModuleBlock */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 177 /* TypeLiteral */: - case 173 /* TypeReference */: - case 178 /* ArrayType */: - case 179 /* TupleType */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: + case 165 /* Constructor */: + case 169 /* ConstructSignature */: + case 168 /* CallSignature */: + case 170 /* IndexSignature */: + case 159 /* Parameter */: + case 254 /* ModuleBlock */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 176 /* TypeLiteral */: + case 172 /* TypeReference */: + case 177 /* ArrayType */: + case 178 /* TupleType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: return false; // Type parameters are always visible - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: // Source file and namespace export are always visible // falls through - case 297 /* SourceFile */: - case 259 /* NamespaceExportDeclaration */: + case 294 /* SourceFile */: + case 256 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return false; default: return false; @@ -49958,10 +48690,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 266 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 263 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 270 /* ExportSpecifier */) { + else if (node.parent.kind === 267 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -50066,12 +48798,12 @@ var ts; function getDeclarationContainer(node) { return ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 249 /* VariableDeclaration */: - case 250 /* VariableDeclarationList */: - case 265 /* ImportSpecifier */: - case 264 /* NamedImports */: - case 263 /* NamespaceImport */: - case 262 /* ImportClause */: + case 246 /* VariableDeclaration */: + case 247 /* VariableDeclarationList */: + case 262 /* ImportSpecifier */: + case 261 /* NamedImports */: + case 260 /* NamespaceImport */: + case 259 /* ImportClause */: return false; default: return true; @@ -50156,13 +48888,9 @@ var ts; var propName = getDestructuringPropertyName(node); if (propName) { var literal = ts.setTextRange(ts.parseNodeFactory.createStringLiteral(propName), node); - var lhsExpr = ts.isLeftHandSideExpression(parentAccess) ? parentAccess : ts.parseNodeFactory.createParenthesizedExpression(parentAccess); - var result = ts.setTextRange(ts.parseNodeFactory.createElementAccessExpression(lhsExpr, literal), node); + var result = ts.setTextRange(ts.parseNodeFactory.createElementAccessExpression(parentAccess, literal), node); ts.setParent(literal, result); ts.setParent(result, node); - if (lhsExpr !== parentAccess) { - ts.setParent(lhsExpr, result); - } result.flowNode = parentAccess.flowNode; return result; } @@ -50171,23 +48899,23 @@ var ts; function getParentElementAccess(node) { var ancestor = node.parent.parent; switch (ancestor.kind) { - case 198 /* BindingElement */: - case 288 /* PropertyAssignment */: + case 195 /* BindingElement */: + case 285 /* PropertyAssignment */: return getSyntheticElementAccess(ancestor); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getSyntheticElementAccess(node.parent); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return ancestor.initializer; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return ancestor.right; } } function getDestructuringPropertyName(node) { var parent = node.parent; - if (node.kind === 198 /* BindingElement */ && parent.kind === 196 /* ObjectBindingPattern */) { + if (node.kind === 195 /* BindingElement */ && parent.kind === 193 /* ObjectBindingPattern */) { return getLiteralPropertyNameText(node.propertyName || node.name); } - if (node.kind === 288 /* PropertyAssignment */ || node.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.kind === 285 /* PropertyAssignment */ || node.kind === 286 /* ShorthandPropertyAssignment */) { return getLiteralPropertyNameText(node.name); } return "" + parent.elements.indexOf(node); @@ -50213,7 +48941,7 @@ var ts; parentType = getTypeWithFacts(parentType, 524288 /* NEUndefined */); } var type; - if (pattern.kind === 196 /* ObjectBindingPattern */) { + if (pattern.kind === 193 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { parentType = getReducedType(parentType); if (parentType.flags & 2 /* Unknown */ || !isValidSpreadType(parentType)) { @@ -50233,7 +48961,7 @@ var ts; // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) var name = declaration.propertyName || declaration.name; var indexType = getLiteralTypeFromPropertyName(name); - var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */), declaration.name); + var declaredType = getConstraintForLocation(getIndexedAccessType(parentType, indexType, name), declaration.name); type = getFlowTypeOfDestructuring(declaration, declaredType); } } @@ -50241,7 +48969,7 @@ var ts; // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern); + var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */, parentType, undefinedType, pattern); var index_2 = pattern.elements.indexOf(declaration); if (declaration.dotDotDotToken) { // If the parent is a tuple type, the rest element has a tuple type of the @@ -50254,7 +48982,7 @@ var ts; else if (isArrayLikeType(parentType)) { var indexType = getLiteralType(index_2); var accessFlags = hasDefaultValue(declaration) ? 8 /* NoTupleBoundsCheck */ : 0; - var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, declaration.name, accessFlags | 16 /* ExpressionPosition */) || errorType, declaration.name); + var declaredType = getConstraintForLocation(getIndexedAccessTypeOrUndefined(parentType, indexType, declaration.name, accessFlags) || errorType, declaration.name); type = getFlowTypeOfDestructuring(declaration, declaredType); } else { @@ -50286,7 +49014,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 199 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 196 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -50296,11 +49024,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 238 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 235 /* ForInStatement */) { var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression))); return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 236 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -50337,8 +49065,8 @@ var ts; if (ts.isParameter(declaration)) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 168 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 167 /* GetAccessor */); + if (func.kind === 167 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 166 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -50405,11 +49133,10 @@ var ts; if (symbol.valueDeclaration && ts.isBinaryExpression(symbol.valueDeclaration)) { var links = getSymbolLinks(symbol); if (links.isConstructorDeclaredProperty === undefined) { - links.isConstructorDeclaredProperty = false; links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && ts.every(symbol.declarations, function (declaration) { return ts.isBinaryExpression(declaration) && - isPossiblyAliasedThisProperty(declaration) && - (declaration.left.kind !== 202 /* ElementAccessExpression */ || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && + ts.getAssignmentDeclarationKind(declaration) === 4 /* ThisProperty */ && + (declaration.left.kind !== 199 /* ElementAccessExpression */ || ts.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration(/*declaredType*/ undefined, declaration, symbol, declaration); }); } @@ -50428,16 +49155,13 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; var container = ts.getThisContainer(declaration, /*includeArrowFunctions*/ false); - if (container && (container.kind === 166 /* Constructor */ || isJSConstructor(container))) { + if (container && (container.kind === 165 /* Constructor */ || isJSConstructor(container))) { return container; } } } function getFlowTypeInConstructor(symbol, constructor) { - var accessName = ts.startsWith(symbol.escapedName, "__#") - ? ts.factory.createPrivateIdentifier(symbol.escapedName.split("@")[1]) - : ts.unescapeLeadingUnderscores(symbol.escapedName); - var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), accessName); + var reference = ts.factory.createPropertyAccessExpression(ts.factory.createThis(), ts.unescapeLeadingUnderscores(symbol.escapedName)); ts.setParent(reference.expression, reference); ts.setParent(reference, constructor); reference.flowNode = constructor.returnFlowNode; @@ -50485,7 +49209,7 @@ var ts; var kind = ts.isAccessExpression(expression) ? ts.getAssignmentDeclarationPropertyAccessKind(expression) : ts.getAssignmentDeclarationKind(expression); - if (kind === 4 /* ThisProperty */ || ts.isBinaryExpression(expression) && isPossiblyAliasedThisProperty(expression, kind)) { + if (kind === 4 /* ThisProperty */) { if (isDeclarationInConstructor(expression)) { definedInConstructor = true; } @@ -50602,7 +49326,6 @@ var ts; var exportedType = resolveStructuredTypeMembers(type); var members_4 = ts.createSymbolTable(); ts.copyEntries(exportedType.members, members_4); - var initialSize = members_4.size; if (resolvedSymbol && !resolvedSymbol.exports) { resolvedSymbol.exports = ts.createSymbolTable(); } @@ -50641,12 +49364,8 @@ var ts; members_4.set(name, s); } }); - var result = createAnonymousType(initialSize !== members_4.size ? undefined : exportedType.symbol, // Only set the type's symbol if it looks to be the same as the original type - members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo); + var result = createAnonymousType(exportedType.symbol, members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.stringIndexInfo, exportedType.numberIndexInfo); result.objectFlags |= (ts.getObjectFlags(type) & 16384 /* JSLiteral */); // Propagate JSLiteral flag - if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) { - result.objectFlags |= 1073741824 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type - } return result; } if (isEmptyArrayLiteralType(type)) { @@ -50664,9 +49383,9 @@ var ts; var thisContainer = ts.getThisContainer(expression, /*includeArrowFunctions*/ false); // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added. // Function expressions that are assigned to the prototype count as methods. - return thisContainer.kind === 166 /* Constructor */ || - thisContainer.kind === 251 /* FunctionDeclaration */ || - (thisContainer.kind === 208 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); + return thisContainer.kind === 165 /* Constructor */ || + thisContainer.kind === 248 /* FunctionDeclaration */ || + (thisContainer.kind === 205 /* FunctionExpression */ && !ts.isPrototypePropertyAssignment(thisContainer.parent)); } function getConstructorDefinedThisAssignmentTypes(types, declarations) { ts.Debug.assert(types.length === declarations.length); @@ -50736,7 +49455,7 @@ var ts; function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; var lastElement = ts.lastOrUndefined(elements); - var restElement = lastElement && lastElement.kind === 198 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : undefined; + var restElement = lastElement && lastElement.kind === 195 /* BindingElement */ && lastElement.dotDotDotToken ? lastElement : undefined; if (elements.length === 0 || elements.length === 1 && restElement) { return languageVersion >= 2 /* ES2015 */ ? createIterableType(anyType) : anyArrayType; } @@ -50761,7 +49480,7 @@ var ts; function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { if (includePatternInType === void 0) { includePatternInType = false; } if (reportErrors === void 0) { reportErrors = false; } - return pattern.kind === 196 /* ObjectBindingPattern */ + return pattern.kind === 193 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -50800,7 +49519,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 160 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 159 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -50863,7 +49582,7 @@ var ts; return reportCircularityError(symbol); } var type; - if (declaration.kind === 266 /* ExportAssignment */) { + if (declaration.kind === 263 /* ExportAssignment */) { type = widenTypeForVariableLikeDeclaration(checkExpressionCached(declaration.expression), declaration); } else if (ts.isBinaryExpression(declaration) || @@ -50934,7 +49653,7 @@ var ts; } function getAnnotatedAccessorTypeNode(accessor) { if (accessor) { - if (accessor.kind === 167 /* GetAccessor */) { + if (accessor.kind === 166 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation; } @@ -50968,15 +49687,15 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 166 /* GetAccessor */); error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } return type; } function resolveTypeOfAccessors(symbol) { - var getter = ts.getDeclarationOfKind(symbol, 167 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 168 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 166 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 167 /* SetAccessor */); if (getter && ts.isInJSFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -51027,9 +49746,9 @@ var ts; var links = getSymbolLinks(symbol); var originalLinks = links; if (!links.type) { - var expando = symbol.valueDeclaration && getSymbolOfExpando(symbol.valueDeclaration, /*allowDeclaration*/ false); - if (expando) { - var merged = mergeJSSymbols(symbol, expando); + var jsDeclaration = symbol.valueDeclaration && ts.getDeclarationOfExpando(symbol.valueDeclaration); + if (jsDeclaration) { + var merged = mergeJSSymbols(symbol, getSymbolOfNode(jsDeclaration)); if (merged) { // note:we overwrite links because we just cloned the symbol symbol = links = merged; @@ -51044,9 +49763,9 @@ var ts; if (symbol.flags & 1536 /* Module */ && ts.isShorthandAmbientModuleSymbol(symbol)) { return anyType; } - else if (declaration && (declaration.kind === 216 /* BinaryExpression */ || + else if (declaration && (declaration.kind === 213 /* BinaryExpression */ || ts.isAccessExpression(declaration) && - declaration.parent.kind === 216 /* BinaryExpression */)) { + declaration.parent.kind === 213 /* BinaryExpression */)) { return getWidenedTypeForAssignmentDeclaration(symbol); } else if (symbol.flags & 512 /* ValueModule */ && declaration && ts.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { @@ -51113,7 +49832,7 @@ var ts; return errorType; } // Check if variable has initializer that circularly references the variable itself - if (noImplicitAny && (declaration.kind !== 160 /* Parameter */ || declaration.initializer)) { + if (noImplicitAny && (declaration.kind !== 159 /* Parameter */ || declaration.initializer)) { error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); } // Circularities could also result from parameters in function expressions that end up @@ -51212,43 +49931,43 @@ var ts; return undefined; } switch (node.kind) { - case 232 /* VariableStatement */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 253 /* InterfaceDeclaration */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 164 /* MethodSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 308 /* JSDocFunctionType */: - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 254 /* TypeAliasDeclaration */: - case 330 /* JSDocTemplateTag */: - case 331 /* JSDocTypedefTag */: - case 325 /* JSDocEnumTag */: - case 324 /* JSDocCallbackTag */: - case 190 /* MappedType */: - case 184 /* ConditionalType */: + case 229 /* VariableStatement */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 250 /* InterfaceDeclaration */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 163 /* MethodSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 304 /* JSDocFunctionType */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 251 /* TypeAliasDeclaration */: + case 326 /* JSDocTemplateTag */: + case 327 /* JSDocTypedefTag */: + case 321 /* JSDocEnumTag */: + case 320 /* JSDocCallbackTag */: + case 189 /* MappedType */: + case 183 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 190 /* MappedType */) { + if (node.kind === 189 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } - else if (node.kind === 184 /* ConditionalType */) { + else if (node.kind === 183 /* ConditionalType */) { return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); } - else if (node.kind === 232 /* VariableStatement */ && !ts.isInJSFile(node)) { + else if (node.kind === 229 /* VariableStatement */ && !ts.isInJSFile(node)) { break; } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node)); var thisType = includeThisTypes && - (node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */ || node.kind === 253 /* InterfaceDeclaration */ || isJSConstructor(node)) && + (node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */ || node.kind === 250 /* InterfaceDeclaration */ || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: var paramSymbol = ts.getParameterSymbolFromJSDoc(node); if (paramSymbol) { node = paramSymbol.valueDeclaration; @@ -51259,7 +49978,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 250 /* InterfaceDeclaration */); ts.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); return getOuterTypeParameters(declaration); } @@ -51269,9 +49988,9 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 253 /* InterfaceDeclaration */ || - node.kind === 252 /* ClassDeclaration */ || - node.kind === 221 /* ClassExpression */ || + if (node.kind === 250 /* InterfaceDeclaration */ || + node.kind === 249 /* ClassDeclaration */ || + node.kind === 218 /* ClassExpression */ || isJSConstructor(node) || ts.isTypeAlias(node)) { var declaration = node; @@ -51415,7 +50134,7 @@ var ts; if (!popTypeResolution()) { for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 252 /* ClassDeclaration */ || declaration.kind === 253 /* InterfaceDeclaration */) { + if (declaration.kind === 249 /* ClassDeclaration */ || declaration.kind === 250 /* InterfaceDeclaration */) { reportCircularBaseType(declaration, type); } } @@ -51510,7 +50229,7 @@ var ts; type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 253 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 250 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getReducedType(getTypeFromTypeNode(node)); @@ -51546,7 +50265,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 253 /* InterfaceDeclaration */) { + if (declaration.kind === 250 /* InterfaceDeclaration */) { if (declaration.flags & 128 /* ContainsThis */) { return false; } @@ -51634,7 +50353,7 @@ var ts; if (ts.isStringLiteralLike(expr)) { return true; } - else if (expr.kind === 216 /* BinaryExpression */) { + else if (expr.kind === 213 /* BinaryExpression */) { return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); } return false; @@ -51649,12 +50368,12 @@ var ts; case 8 /* NumericLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return true; - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 78 /* Identifier */: return ts.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return isStringConcatExpression(expr); default: return false; @@ -51668,7 +50387,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 255 /* EnumDeclaration */) { + if (declaration.kind === 252 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && ts.isStringLiteralLike(member.initializer)) { @@ -51695,7 +50414,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 255 /* EnumDeclaration */) { + if (declaration.kind === 252 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var value = getEnumMemberValue(member); @@ -51768,21 +50487,21 @@ var ts; function isThislessType(node) { switch (node.kind) { case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 155 /* BigIntKeyword */: + case 151 /* UnknownKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 154 /* BigIntKeyword */: case 131 /* BooleanKeyword */: - case 148 /* SymbolKeyword */: - case 145 /* ObjectKeyword */: + case 147 /* SymbolKeyword */: + case 144 /* ObjectKeyword */: case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: - case 191 /* LiteralType */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: + case 190 /* LiteralType */: return true; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return isThislessType(node.elementType); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -51808,7 +50527,7 @@ var ts; function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); var typeParameters = ts.getEffectiveTypeParameterDeclarations(node); - return (node.kind === 166 /* Constructor */ || (!!returnType && isThislessType(returnType))) && + return (node.kind === 165 /* Constructor */ || (!!returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); } @@ -51824,14 +50543,14 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -52036,7 +50755,7 @@ var ts; links[resolutionKind] = earlySymbols || emptySymbols; // fill in any as-yet-unresolved late-bound members. var lateSymbols = ts.createSymbolTable(); - for (var _i = 0, _a = symbol.declarations || ts.emptyArray; _i < _a.length; _i++) { + for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; var members = ts.getMembersOfDeclaration(decl); if (members) { @@ -52055,7 +50774,7 @@ var ts; var member = decls_1[_c]; var assignmentKind = ts.getAssignmentDeclarationKind(member); var isInstanceMember = assignmentKind === 3 /* PrototypeProperty */ - || ts.isBinaryExpression(member) && isPossiblyAliasedThisProperty(member, assignmentKind) + || assignmentKind === 4 /* ThisProperty */ || assignmentKind === 9 /* ObjectDefinePrototypeProperty */ || assignmentKind === 6 /* Prototype */; // A straight `Prototype` assignment probably can never have a computed name if (isStatic === !isInstanceMember && hasLateBindableName(member)) { @@ -52178,7 +50897,6 @@ var ts; sig.resolvedReturnType = resolvedReturnType; sig.resolvedTypePredicate = resolvedTypePredicate; sig.minArgumentCount = minArgumentCount; - sig.resolvedMinArgumentCount = undefined; sig.target = undefined; sig.mapper = undefined; sig.unionSignatures = undefined; @@ -52422,8 +51140,8 @@ var ts; function getUnionIndexInfo(types, kind) { var indexTypes = []; var isAnyReadonly = false; - for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { - var type = types_4[_i]; + for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { + var type = types_3[_i]; var indexInfo = getIndexInfoOfType(getApparentType(type), kind); if (!indexInfo) { return undefined; @@ -52622,6 +51340,9 @@ var ts; // bound includes those keys that are known to always be present, for example because // because of constraints on type parameters (e.g. 'keyof T' for a constrained T). function getLowerBoundOfKeyType(type) { + if (type.flags & (1 /* Any */ | 131068 /* Primitive */)) { + return type; + } if (type.flags & 4194304 /* Index */) { var t = getApparentType(type.type); return isGenericTupleType(t) ? getKnownKeysOfTupleType(t) : getIndexType(t); @@ -52642,7 +51363,7 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return getIntersectionType(ts.sameMap(type.types, getLowerBoundOfKeyType)); } - return type; + return neverType; } /** Resolve the members of a mapped type { [P in K]: T } */ function resolveMappedTypeMembers(type) { @@ -52655,7 +51376,6 @@ var ts; // and T as the template type. var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); - var nameType = getNameTypeFromMappedType(type.target || type); var templateType = getTemplateTypeFromMappedType(type.target || type); var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' var templateModifiers = getMappedTypeModifiers(type); @@ -52677,25 +51397,25 @@ var ts; forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType); } setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); - function addMemberForKeyType(keyType) { - var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType; - forEachType(propNameType, function (t) { return addMemberForKeyTypeWorker(keyType, t); }); - } - function addMemberForKeyTypeWorker(keyType, propNameType) { + function addMemberForKeyType(t) { + // Create a mapper from T to the current iteration type constituent. Then, if the + // mapped type is itself an instantiated type, combine the iteration mapper with the + // instantiation mapper. + var templateMapper = appendTypeMapping(type.mapper, typeParameter, t); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. - if (isTypeUsableAsPropertyName(propNameType)) { - var propName = getPropertyNameFromType(propNameType); + if (isTypeUsableAsPropertyName(t)) { + var propName = getPropertyNameFromType(t); // String enum members from separate enums with identical values // are distinct types with the same property name. Make the resulting // property symbol's name type be the union of those enum member types. var existingProp = members.get(propName); if (existingProp) { - existingProp.nameType = getUnionType([existingProp.nameType, propNameType]); - existingProp.keyType = getUnionType([existingProp.keyType, keyType]); + existingProp.nameType = getUnionType([existingProp.nameType, t]); + existingProp.mapper = appendTypeMapping(type.mapper, typeParameter, existingProp.nameType); } else { - var modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : undefined; + var modifiersProp = getPropertyOfType(modifiersType, propName); var isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */); var isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || @@ -52703,19 +51423,19 @@ var ts; var stripOptional = strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */; var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0)); prop.mappedType = type; - prop.nameType = propNameType; - prop.keyType = keyType; if (modifiersProp) { prop.syntheticOrigin = modifiersProp; prop.declarations = modifiersProp.declarations; } + prop.nameType = t; + prop.mapper = templateMapper; members.set(propName, prop); } } - else if (propNameType.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 32 /* Enum */)) { - var propType = instantiateType(templateType, appendTypeMapping(type.mapper, typeParameter, keyType)); - if (propNameType.flags & (1 /* Any */ | 4 /* String */)) { - stringIndexInfo = createIndexInfo(stringIndexInfo ? getUnionType([stringIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */)); + else if (t.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 32 /* Enum */)) { + var propType = instantiateType(templateType, templateMapper); + if (t.flags & (1 /* Any */ | 4 /* String */)) { + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1 /* IncludeReadonly */)); } else { numberIndexInfo = createIndexInfo(numberIndexInfo ? getUnionType([numberIndexInfo.type, propType]) : propType, !!(templateModifiers & 1 /* IncludeReadonly */)); @@ -52725,14 +51445,12 @@ var ts; } function getTypeOfMappedSymbol(symbol) { if (!symbol.type) { - var mappedType = symbol.mappedType; if (!pushTypeResolution(symbol, 0 /* Type */)) { - mappedType.containsError = true; + symbol.mappedType.containsError = true; return errorType; } - var templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType); - var mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.keyType); - var propType = instantiateType(templateType, mapper); + var templateType = getTemplateTypeFromMappedType(symbol.mappedType.target || symbol.mappedType); + var propType = instantiateType(templateType, symbol.mapper); // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks // mode, if the underlying property is optional we remove 'undefined' from the type. @@ -52740,10 +51458,11 @@ var ts; symbol.checkFlags & 524288 /* StripOptional */ ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType; if (!popTypeResolution()) { - error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType)); + error(currentNode, ts.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(symbol.mappedType)); type = errorType; } symbol.type = type; + symbol.mapper = undefined; } return symbol.type; } @@ -52755,11 +51474,6 @@ var ts; return type.constraintType || (type.constraintType = getConstraintOfTypeParameter(getTypeParameterFromMappedType(type)) || errorType); } - function getNameTypeFromMappedType(type) { - return type.declaration.nameType ? - type.nameType || (type.nameType = instantiateType(getTypeFromTypeNode(type.declaration.nameType), type.mapper)) : - undefined; - } function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? @@ -52771,8 +51485,8 @@ var ts; } function isMappedTypeWithKeyofConstraintDeclaration(type) { var constraintDeclaration = getConstraintDeclarationForMappedType(type); // TODO: GH#18217 - return constraintDeclaration.kind === 188 /* TypeOperator */ && - constraintDeclaration.operator === 138 /* KeyOfKeyword */; + return constraintDeclaration.kind === 187 /* TypeOperator */ && + constraintDeclaration.operator === 137 /* KeyOfKeyword */; } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { @@ -52906,8 +51620,8 @@ var ts; return getAugmentedPropertiesOfType(unionType); } var props = ts.createSymbolTable(); - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var memberType = types_5[_i]; + for (var _i = 0, types_4 = types; _i < types_4.length; _i++) { + var memberType = types_4[_i]; for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) { var escapedName = _b[_a].escapedName; if (!props.has(escapedName)) { @@ -52939,14 +51653,14 @@ var ts; function getConstraintFromIndexedAccess(type) { var indexConstraint = getSimplifiedTypeOrConstraint(type.indexType); if (indexConstraint && indexConstraint !== type.indexType) { - var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.noUncheckedIndexedAccessCandidate); + var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint); if (indexedAccess) { return indexedAccess; } } var objectConstraint = getSimplifiedTypeOrConstraint(type.objectType); if (objectConstraint && objectConstraint !== type.objectType) { - return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType, type.noUncheckedIndexedAccessCandidate); + return getIndexedAccessTypeOrUndefined(objectConstraint, type.indexType); } return undefined; } @@ -52995,9 +51709,9 @@ var ts; function getEffectiveConstraintOfIntersection(types, targetIsUnion) { var constraints; var hasDisjointDomainType = false; - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var t = types_6[_i]; - if (t.flags & 465829888 /* Instantiable */) { + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var t = types_5[_i]; + if (t.flags & 63176704 /* Instantiable */) { // We keep following constraints as long as we have an instantiable type that is known // not to be circular or infinite (hence we stop on index access types). var constraint = getConstraintOfType(t); @@ -53011,7 +51725,7 @@ var ts; } } } - else if (t.flags & 469892092 /* DisjointDomains */) { + else if (t.flags & 67238908 /* DisjointDomains */) { hasDisjointDomainType = true; } } @@ -53021,9 +51735,9 @@ var ts; if (hasDisjointDomainType) { // We add any types belong to one of the disjoint domains because they might cause the final // intersection operation to reduce the union constraints. - for (var _a = 0, types_7 = types; _a < types_7.length; _a++) { - var t = types_7[_a]; - if (t.flags & 469892092 /* DisjointDomains */) { + for (var _a = 0, types_6 = types; _a < types_6.length; _a++) { + var t = types_6[_a]; + if (t.flags & 67238908 /* DisjointDomains */) { constraints = ts.append(constraints, t); } } @@ -53033,7 +51747,7 @@ var ts; return undefined; } function getBaseConstraintOfType(type) { - if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) { + if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : undefined; } @@ -53055,12 +51769,9 @@ var ts; * circularly references the type variable. */ function getResolvedBaseConstraint(type) { - if (type.resolvedBaseConstraint) { - return type.resolvedBaseConstraint; - } var nonTerminating = false; - var stack = []; - return type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type); + return type.resolvedBaseConstraint || + (type.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type), type)); function getImmediateBaseConstraint(t) { if (!t.immediateBaseConstraint) { if (!pushTypeResolution(t, 4 /* ImmediateBaseConstraint */)) { @@ -53071,19 +51782,13 @@ var ts; // very high likelihood we're dealing with an infinite generic type that perpetually generates // new type identities as we descend into it. We stop the recursion here and mark this type // and the outer types as having circular constraints. - ts.tracing.instant("check" /* Check */, "getImmediateBaseConstraint_DepthLimit", { typeId: t.id, originalTypeId: type.id, depth: constraintDepth }); error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); nonTerminating = true; return t.immediateBaseConstraint = noConstraintType; } - var result = void 0; - if (!isDeeplyNestedType(t, stack, stack.length)) { - stack.push(t); - constraintDepth++; - result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false)); - constraintDepth--; - stack.pop(); - } + constraintDepth++; + var result = computeBaseConstraint(getSimplifiedType(t, /*writing*/ false)); + constraintDepth--; if (!popTypeResolution()) { if (t.flags & 262144 /* TypeParameter */) { var errorNode = getConstraintDeclaration(t); @@ -53117,8 +51822,8 @@ var ts; if (t.flags & 3145728 /* UnionOrIntersection */) { var types = t.types; var baseTypes = []; - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var type_3 = types_8[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var type_3 = types_7[_i]; var baseType = getBaseConstraint(type_3); if (baseType) { baseTypes.push(baseType); @@ -53131,19 +51836,10 @@ var ts; if (t.flags & 4194304 /* Index */) { return keyofConstraintType; } - if (t.flags & 134217728 /* TemplateLiteral */) { - var types = t.types; - var constraints = ts.mapDefined(types, getBaseConstraint); - return constraints.length === types.length ? getTemplateLiteralType(t.texts, constraints) : stringType; - } - if (t.flags & 268435456 /* StringMapping */) { - var constraint = getBaseConstraint(t.type); - return constraint ? getStringMappingType(t.symbol, constraint) : stringType; - } if (t.flags & 8388608 /* IndexedAccess */) { var baseObjectType = getBaseConstraint(t.objectType); var baseIndexType = getBaseConstraint(t.indexType); - var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t.noUncheckedIndexedAccessCandidate); + var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType); return baseIndexedAccess && getBaseConstraint(baseIndexedAccess); } if (t.flags & 16777216 /* Conditional */) { @@ -53210,7 +51906,7 @@ var ts; } function getResolvedApparentTypeOfMappedType(type) { var typeVariable = getHomomorphicTypeVariable(type); - if (typeVariable && !type.declaration.nameType) { + if (typeVariable) { var constraint = getConstraintOfTypeParameter(typeVariable); if (constraint && (isArrayType(constraint) || isTupleType(constraint))) { return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper)); @@ -53224,10 +51920,10 @@ var ts; * type itself. */ function getApparentType(type) { - var t = type.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; + var t = type.flags & 63176704 /* Instantiable */ ? getBaseConstraintOfType(type) || unknownType : type; return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : - t.flags & 402653316 /* StringLike */ ? globalStringType : + t.flags & 132 /* StringLike */ ? globalStringType : t.flags & 296 /* NumberLike */ ? globalNumberType : t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType(/*reportErrors*/ languageVersion >= 7 /* ES2020 */) : t.flags & 528 /* BooleanLike */ ? globalBooleanType : @@ -53552,10 +52248,10 @@ var ts; function isJSDocOptionalParameter(node) { return ts.isInJSFile(node) && ( // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType - node.type && node.type.kind === 307 /* JSDocOptionalType */ + node.type && node.type.kind === 303 /* JSDocOptionalType */ || ts.getJSDocParameterTags(node).some(function (_a) { var isBracketed = _a.isBracketed, typeExpression = _a.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 303 /* JSDocOptionalType */; })); } function tryFindAmbientModule(moduleName, withAugmentations) { @@ -53574,10 +52270,7 @@ var ts; var signature = getSignatureFromDeclaration(node.parent); var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); - // Only consider syntactic or instantiated parameters as optional, not `void` parameters as this function is used - // in grammar checks and checking for `void` too early results in parameter types widening too early - // and causes some noImplicitAny errors to be lost. - return parameterIndex >= getMinArgumentCount(signature, 1 /* StrongArityForUntypedJS */ | 2 /* VoidIsNonOptional */); + return parameterIndex >= getMinArgumentCount(signature, /*strongArityForUntypedJS*/ true); } var iife = ts.getImmediatelyInvokedFunctionExpression(node.parent); if (iife) { @@ -53592,7 +52285,7 @@ var ts; return false; } var isBracketed = node.isBracketed, typeExpression = node.typeExpression; - return isBracketed || !!typeExpression && typeExpression.type.kind === 307 /* JSDocOptionalType */; + return isBracketed || !!typeExpression && typeExpression.type.kind === 303 /* JSDocOptionalType */; } function createTypePredicate(kind, parameterName, parameterIndex, type) { return { kind: kind, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; @@ -53674,7 +52367,7 @@ var ts; else { parameters.push(paramSymbol); } - if (type && type.kind === 191 /* LiteralType */) { + if (type && type.kind === 190 /* LiteralType */) { flags |= 2 /* HasLiteralTypes */; } // Record a new minimum argument count if this is not an optional parameter @@ -53687,16 +52380,16 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 167 /* GetAccessor */ || declaration.kind === 168 /* SetAccessor */) && + if ((declaration.kind === 166 /* GetAccessor */ || declaration.kind === 167 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + var otherKind = declaration.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 166 /* Constructor */ ? + var classType = declaration.kind === 165 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -53761,11 +52454,11 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - return node.name.kind === 158 /* ComputedPropertyName */ + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + return node.name.kind === 157 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse); @@ -53837,7 +52530,7 @@ var ts; function createTypePredicateFromTypePredicateNode(node, signature) { var parameterName = node.parameterName; var type = node.type && getTypeFromTypeNode(node.type); - return parameterName.kind === 187 /* ThisType */ ? + return parameterName.kind === 186 /* ThisType */ ? createTypePredicate(node.assertsModifier ? 2 /* AssertsThis */ : 0 /* This */, /*parameterName*/ undefined, /*parameterIndex*/ undefined, type) : createTypePredicate(node.assertsModifier ? 3 /* AssertsIdentifier */ : 1 /* Identifier */, parameterName.escapedText, ts.findIndex(signature.parameters, function (p) { return p.escapedName === parameterName.escapedText; }), type); } @@ -53880,7 +52573,7 @@ var ts; return signature.resolvedReturnType; } function getReturnTypeFromAnnotation(declaration) { - if (declaration.kind === 166 /* Constructor */) { + if (declaration.kind === 165 /* Constructor */) { return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); } if (ts.isJSDocConstructSignature(declaration)) { @@ -53890,12 +52583,12 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 167 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + if (declaration.kind === 166 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { var jsDocType = ts.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); if (jsDocType) { return jsDocType; } - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 168 /* SetAccessor */); + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 167 /* SetAccessor */); var setterType = getAnnotatedAccessorType(setter); if (setterType) { return setterType; @@ -53985,7 +52678,7 @@ var ts; // will result in a different declaration kind. if (!signature.isolatedSignatureType) { var kind = signature.declaration ? signature.declaration.kind : 0 /* Unknown */; - var isConstructor = kind === 166 /* Constructor */ || kind === 170 /* ConstructSignature */ || kind === 175 /* ConstructorType */; + var isConstructor = kind === 165 /* Constructor */ || kind === 169 /* ConstructSignature */ || kind === 174 /* ConstructorType */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -53999,7 +52692,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 144 /* NumberKeyword */ : 147 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 143 /* NumberKeyword */ : 146 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -54033,17 +52726,17 @@ var ts; if (typeParameter.symbol) { for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.parent.kind === 185 /* InferType */) { + if (declaration.parent.kind === 184 /* InferType */) { // When an 'infer T' declaration is immediately contained in a type reference node // (such as 'Foo'), T's constraint is inferred from the constraint of the // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are // present, we form an intersection of the inferred constraint types. - var _b = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _c = _b[0], childTypeParameter = _c === void 0 ? declaration.parent : _c, grandParent = _b[1]; - if (grandParent.kind === 173 /* TypeReference */) { + var grandParent = declaration.parent.parent; + if (grandParent.kind === 172 /* TypeReference */) { var typeReference = grandParent; var typeParameters = getTypeParametersForTypeReference(typeReference); if (typeParameters) { - var index = typeReference.typeArguments.indexOf(childTypeParameter); + var index = typeReference.typeArguments.indexOf(declaration.parent); if (index < typeParameters.length) { var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); if (declaredConstraint) { @@ -54064,16 +52757,11 @@ var ts; } // When an 'infer T' declaration is immediately contained in a rest parameter declaration, a rest type // or a named rest tuple element, we infer an 'unknown[]' constraint. - else if (grandParent.kind === 160 /* Parameter */ && grandParent.dotDotDotToken || - grandParent.kind === 181 /* RestType */ || - grandParent.kind === 192 /* NamedTupleMember */ && grandParent.dotDotDotToken) { + else if (grandParent.kind === 159 /* Parameter */ && grandParent.dotDotDotToken || + grandParent.kind === 180 /* RestType */ || + grandParent.kind === 191 /* NamedTupleMember */ && grandParent.dotDotDotToken) { inferences = ts.append(inferences, createArrayType(unknownType)); } - // When an 'infer T' declaration is immediately contained in a string template type, we infer a 'string' - // constraint. - else if (grandParent.kind === 194 /* TemplateLiteralTypeSpan */) { - inferences = ts.append(inferences, stringType); - } } } } @@ -54096,7 +52784,7 @@ var ts; if (type.flags & 1 /* Any */ && type !== errorType) { // Allow errorType to propegate to keep downstream errors suppressed // use keyofConstraintType as the base constraint for mapped type key constraints (unknown isn;t assignable to that, but `any` was), // use unknown otherwise - type = constraintDeclaration.parent.parent.kind === 190 /* MappedType */ ? keyofConstraintType : unknownType; + type = constraintDeclaration.parent.parent.kind === 189 /* MappedType */ ? keyofConstraintType : unknownType; } typeParameter.constraint = type; } @@ -54105,7 +52793,7 @@ var ts; return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - var tp = ts.getDeclarationOfKind(typeParameter.symbol, 159 /* TypeParameter */); + var tp = ts.getDeclarationOfKind(typeParameter.symbol, 158 /* TypeParameter */); var host = ts.isJSDocTemplateTag(tp.parent) ? ts.getHostSignatureFromJSDoc(tp.parent) : tp.parent; return host && getSymbolOfNode(host); } @@ -54138,8 +52826,8 @@ var ts; // that care about the presence of such types at arbitrary depth in a containing type. function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var type = types_9[_i]; + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; if (!(type.flags & excludeKinds)) { result |= ts.getObjectFlags(type); } @@ -54185,8 +52873,8 @@ var ts; } var node = type.node; var typeArguments = !node ? ts.emptyArray : - node.kind === 173 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : - node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : + node.kind === 172 /* TypeReference */ ? ts.concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : + node.kind === 177 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); if (popTypeResolution()) { type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments; @@ -54228,7 +52916,7 @@ var ts; return errorType; } } - if (node.kind === 173 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { + if (node.kind === 172 /* TypeReference */ && isDeferredTypeReferenceNode(node, ts.length(node.typeArguments) !== typeParameters.length)) { return createDeferredTypeReference(type, node, /*mapper*/ undefined); } // In a type reference, the outer type parameters of the referenced class or interface are automatically @@ -54241,9 +52929,6 @@ var ts; } function getTypeAliasInstantiation(symbol, typeArguments) { var type = getDeclaredTypeOfSymbol(symbol); - if (type === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName) && typeArguments && typeArguments.length === 1) { - return getStringMappingType(symbol, typeArguments[0]); - } var links = getSymbolLinks(symbol); var typeParameters = links.typeParameters; var id = getTypeListId(typeArguments); @@ -54276,9 +52961,9 @@ var ts; } function getTypeReferenceName(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -54326,7 +53011,8 @@ var ts; } /** * A JSdoc TypeReference may be to a value, but resolve it as a type anyway. - * Example: import('./b').ConstructorFunction + * Note: If the value is imported from commonjs, it should really be an alias, + * but this function's special-case code fakes alias resolution as well. */ function getTypeFromJSDocValueReference(node, symbol) { var links = getNodeLinks(node); @@ -54334,9 +53020,19 @@ var ts; var valueType = getTypeOfSymbol(symbol); var typeType = valueType; if (symbol.valueDeclaration) { - var isImportTypeWithQualifier = node.kind === 195 /* ImportType */ && node.qualifier; + var decl = ts.getRootDeclaration(symbol.valueDeclaration); + var isRequireAlias = false; + if (ts.isVariableDeclaration(decl) && decl.initializer) { + var expr = decl.initializer; + // skip past entity names, eg `require("x").a.b.c` + while (ts.isPropertyAccessExpression(expr)) { + expr = expr.expression; + } + isRequireAlias = ts.isCallExpression(expr) && ts.isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol; + } + var isImportTypeWithQualifier = node.kind === 192 /* ImportType */ && node.qualifier; // valueType might not have a symbol, eg, {import('./b').STRING_LITERAL} - if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) { + if (valueType.symbol && (isRequireAlias || isImportTypeWithQualifier)) { typeType = getTypeReferenceType(node, valueType.symbol); } } @@ -54360,7 +53056,7 @@ var ts; return result; } function isUnaryTupleTypeNode(node) { - return node.kind === 179 /* TupleType */ && node.elements.length === 1; + return node.kind === 178 /* TupleType */ && node.elements.length === 1; } function getImpliedConstraint(type, checkNode, extendsNode) { return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) : @@ -54369,9 +53065,9 @@ var ts; } function getConditionalFlowTypeOfType(type, node) { var constraints; - while (node && !ts.isStatement(node) && node.kind !== 311 /* JSDocComment */) { + while (node && !ts.isStatement(node) && node.kind !== 307 /* JSDocComment */) { var parent = node.parent; - if (parent.kind === 184 /* ConditionalType */ && node === parent.trueType) { + if (parent.kind === 183 /* ConditionalType */ && node === parent.trueType) { var constraint = getImpliedConstraint(type, parent.checkType, parent.extendsType); if (constraint) { constraints = ts.append(constraints, constraint); @@ -54382,7 +53078,7 @@ var ts; return constraints ? getSubstitutionType(type, getIntersectionType(ts.append(constraints, type))) : type; } function isJSDocTypeReference(node) { - return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 173 /* TypeReference */ || node.kind === 195 /* ImportType */); + return !!(node.flags & 4194304 /* JSDoc */) && (node.kind === 172 /* TypeReference */ || node.kind === 192 /* ImportType */); } function checkNoTypeArguments(node, symbol) { if (node.typeArguments) { @@ -54495,9 +53191,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 255 /* EnumDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 252 /* EnumDeclaration */: return declaration; } } @@ -54618,11 +53314,11 @@ var ts; } function getTupleElementFlags(node) { switch (node.kind) { - case 180 /* OptionalType */: + case 179 /* OptionalType */: return 2 /* Optional */; - case 181 /* RestType */: + case 180 /* RestType */: return getRestTypeElementFlags(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return node.questionToken ? 2 /* Optional */ : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1 /* Required */; @@ -54640,14 +53336,14 @@ var ts; return readonly ? globalReadonlyArrayType : globalArrayType; } var elementFlags = ts.map(node.elements, getTupleElementFlags); - var missingName = ts.some(node.elements, function (e) { return e.kind !== 192 /* NamedTupleMember */; }); + var missingName = ts.some(node.elements, function (e) { return e.kind !== 191 /* NamedTupleMember */; }); return getTupleTargetType(elementFlags, readonly, /*associatedNames*/ missingName ? undefined : node.elements); } // Return true if the given type reference node is directly aliased or if it needs to be deferred // because it is possibly contained in a circular chain of eagerly resolved types. function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { - return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 178 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : - node.kind === 179 /* TupleType */ ? ts.some(node.elements, mayResolveTypeAlias) : + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 177 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : + node.kind === 178 /* TupleType */ ? ts.some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || ts.some(node.typeArguments, mayResolveTypeAlias)); } // Return true when the given node is transitively contained in type constructs that eagerly @@ -54656,18 +53352,18 @@ var ts; function isResolvedByTypeAlias(node) { var parent = node.parent; switch (parent.kind) { - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: - case 173 /* TypeReference */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 189 /* IndexedAccessType */: - case 184 /* ConditionalType */: - case 188 /* TypeOperator */: - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: + case 172 /* TypeReference */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 188 /* IndexedAccessType */: + case 183 /* ConditionalType */: + case 187 /* TypeOperator */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return isResolvedByTypeAlias(parent); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return true; } return false; @@ -54676,28 +53372,28 @@ var ts; // of a type alias. function mayResolveTypeAlias(node) { switch (node.kind) { - case 173 /* TypeReference */: + case 172 /* TypeReference */: return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node.typeName, 788968 /* Type */).flags & 524288 /* TypeAlias */); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return true; - case 188 /* TypeOperator */: - return node.operator !== 151 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); - case 186 /* ParenthesizedType */: - case 180 /* OptionalType */: - case 192 /* NamedTupleMember */: - case 307 /* JSDocOptionalType */: - case 305 /* JSDocNullableType */: - case 306 /* JSDocNonNullableType */: - case 301 /* JSDocTypeExpression */: + case 187 /* TypeOperator */: + return node.operator !== 150 /* UniqueKeyword */ && mayResolveTypeAlias(node.type); + case 185 /* ParenthesizedType */: + case 179 /* OptionalType */: + case 191 /* NamedTupleMember */: + case 303 /* JSDocOptionalType */: + case 301 /* JSDocNullableType */: + case 302 /* JSDocNonNullableType */: + case 298 /* JSDocTypeExpression */: return mayResolveTypeAlias(node.type); - case 181 /* RestType */: - return node.type.kind !== 178 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 180 /* RestType */: + return node.type.kind !== 177 /* ArrayType */ || mayResolveTypeAlias(node.type.elementType); + case 181 /* UnionType */: + case 182 /* IntersectionType */: return ts.some(node.types, mayResolveTypeAlias); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); } @@ -54710,19 +53406,19 @@ var ts; if (target === emptyGenericType) { links.resolvedType = emptyObjectType; } - else if (!(node.kind === 179 /* TupleType */ && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8 /* Variadic */); })) && isDeferredTypeReferenceNode(node)) { - links.resolvedType = node.kind === 179 /* TupleType */ && node.elements.length === 0 ? target : + else if (!(node.kind === 178 /* TupleType */ && ts.some(node.elements, function (e) { return !!(getTupleElementFlags(e) & 8 /* Variadic */); })) && isDeferredTypeReferenceNode(node)) { + links.resolvedType = node.kind === 178 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(target, node, /*mapper*/ undefined); } else { - var elementTypes = node.kind === 178 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); + var elementTypes = node.kind === 177 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : ts.map(node.elements, getTypeFromTypeNode); links.resolvedType = createNormalizedTypeReference(target, elementTypes); } } return links.resolvedType; } function isReadonlyTypeOperator(node) { - return ts.isTypeOperatorNode(node) && node.operator === 142 /* ReadonlyKeyword */; + return ts.isTypeOperatorNode(node) && node.operator === 141 /* ReadonlyKeyword */; } function createTupleType(elementTypes, elementFlags, readonly, namedMemberDeclarations) { if (readonly === void 0) { readonly = false; } @@ -54819,9 +53515,7 @@ var ts; // Transform [A, ...(X | Y | Z)] into [A, ...X] | [A, ...Y] | [A, ...Z] var unionIndex = ts.findIndex(elementTypes, function (t, i) { return !!(target.elementFlags[i] & 8 /* Variadic */ && t.flags & (131072 /* Never */ | 1048576 /* Union */)); }); if (unionIndex >= 0) { - return checkCrossProductUnion(ts.map(elementTypes, function (t, i) { return target.elementFlags[i] & 8 /* Variadic */ ? t : unknownType; })) ? - mapType(elementTypes[unionIndex], function (t) { return createNormalizedTupleType(target, ts.replaceElement(elementTypes, unionIndex, t)); }) : - errorType; + return mapType(elementTypes[unionIndex], function (t) { return createNormalizedTupleType(target, ts.replaceElement(elementTypes, unionIndex, t)); }); } // If there are no variadic elements with non-generic types, just create a type reference with the same target type. var spreadIndex = ts.findIndex(elementTypes, function (t, i) { return !!(target.elementFlags[i] & 8 /* Variadic */) && !(t.flags & 58982400 /* InstantiableNonPrimitive */) && !isGenericMappedType(t); }); @@ -54935,8 +53629,8 @@ var ts; } // We ignore 'never' types in unions if (!(flags & 131072 /* Never */)) { - includes |= flags & 205258751 /* IncludesMask */; - if (flags & 469499904 /* StructuredOrInstantiable */) + includes |= flags & 71041023 /* IncludesMask */; + if (flags & 66846720 /* StructuredOrInstantiable */) includes |= 262144 /* IncludesStructuredOrInstantiable */; if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */; @@ -54957,8 +53651,8 @@ var ts; // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. function addTypesToUnion(typeSet, includes, types) { - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var type = types_10[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var type = types_9[_i]; includes = addTypeToUnion(typeSet, includes, type); } return includes; @@ -54987,8 +53681,8 @@ var ts; while (i > 0) { i--; var source = types[i]; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var target = types_11[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var target = types_10[_i]; if (source !== target) { if (count === 100000) { // After 100000 subtype checks we estimate the remaining amount of work by assuming the @@ -54998,7 +53692,6 @@ var ts; // caps union types at 5000 unique literal types and 1000 unique object types. var estimatedCount = (count / (len - i)) * len; if (estimatedCount > (primitivesOnly ? 25000000 : 1000000)) { - ts.tracing.instant("check" /* Check */, "removeSubtypes_DepthLimit", { typeIds: types.map(function (t) { return t.id; }) }); error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return false; } @@ -55030,22 +53723,6 @@ var ts; } } } - function removeStringLiteralsMatchedByTemplateLiterals(types) { - var templates = ts.filter(types, isPatternLiteralType); - if (templates.length) { - var i = types.length; - var _loop_14 = function () { - i--; - var t = types[i]; - if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeSubtypeOf(t, template); })) { - ts.orderedRemoveItemAt(types, i); - } - }; - while (i > 0) { - _loop_14(); - } - } - } // We sort and deduplicate the constituent types based on object identity. If the subtypeReduction // flag is specified we also reduce the constituent type set to only include types that aren't subtypes // of other types. Subtype reduction is expensive for large union types and is possible only when union @@ -55072,9 +53749,6 @@ var ts; if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */)) { removeRedundantLiteralTypes(typeSet, includes); } - if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) { - removeStringLiteralsMatchedByTemplateLiterals(typeSet); - } break; case 2 /* Subtype */: if (!removeSubtypes(typeSet, !(includes & 262144 /* IncludesStructuredOrInstantiable */))) { @@ -55088,7 +53762,7 @@ var ts; neverType; } } - var objectFlags = (includes & 469647395 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | + var objectFlags = (includes & 66994211 /* NotPrimitiveUnion */ ? 0 : 262144 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 268435456 /* ContainsIntersections */ : 0); return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); } @@ -55180,15 +53854,15 @@ var ts; } typeSet.set(type.id.toString(), type); } - includes |= flags & 205258751 /* IncludesMask */; + includes |= flags & 71041023 /* IncludesMask */; } return includes; } // Add the given types to the given type set. Order is preserved, freshness is removed from literal // types, duplicates are removed, and nested types of the given kind are flattened into the set. function addTypesToIntersection(typeSet, includes, types) { - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var type = types_12[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var type = types_11[_i]; includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); } return includes; @@ -55226,31 +53900,6 @@ var ts; } return true; } - /** - * Returns `true` if the intersection of the template literals and string literals is the empty set, eg `get${string}` & "setX", and should reduce to `never` - */ - function extractRedundantTemplateLiterals(types) { - var i = types.length; - var literals = ts.filter(types, function (t) { return !!(t.flags & 128 /* StringLiteral */); }); - while (i > 0) { - i--; - var t = types[i]; - if (!(t.flags & 134217728 /* TemplateLiteral */)) - continue; - for (var _i = 0, literals_1 = literals; _i < literals_1.length; _i++) { - var t2 = literals_1[_i]; - if (isTypeSubtypeOf(t2, t)) { - // eg, ``get${T}` & "getX"` is just `"getX"` - ts.orderedRemoveItemAt(types, i); - break; - } - else if (isPatternLiteralType(t)) { - return true; - } - } - } - return false; - } function extractIrreducible(types, flag) { if (ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) { for (var i = 0; i < types.length; i++) { @@ -55339,15 +53988,12 @@ var ts; // a non-primitive type and a type known to be primitive. if (includes & 131072 /* Never */ || strictNullChecks && includes & 98304 /* Nullable */ && includes & (524288 /* Object */ | 67108864 /* NonPrimitive */ | 16777216 /* IncludesEmptyObject */) || - includes & 67108864 /* NonPrimitive */ && includes & (469892092 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || - includes & 402653316 /* StringLike */ && includes & (469892092 /* DisjointDomains */ & ~402653316 /* StringLike */) || - includes & 296 /* NumberLike */ && includes & (469892092 /* DisjointDomains */ & ~296 /* NumberLike */) || - includes & 2112 /* BigIntLike */ && includes & (469892092 /* DisjointDomains */ & ~2112 /* BigIntLike */) || - includes & 12288 /* ESSymbolLike */ && includes & (469892092 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || - includes & 49152 /* VoidLike */ && includes & (469892092 /* DisjointDomains */ & ~49152 /* VoidLike */)) { - return neverType; - } - if (includes & 134217728 /* TemplateLiteral */ && includes & 128 /* StringLiteral */ && extractRedundantTemplateLiterals(typeSet)) { + includes & 67108864 /* NonPrimitive */ && includes & (67238908 /* DisjointDomains */ & ~67108864 /* NonPrimitive */) || + includes & 132 /* StringLike */ && includes & (67238908 /* DisjointDomains */ & ~132 /* StringLike */) || + includes & 296 /* NumberLike */ && includes & (67238908 /* DisjointDomains */ & ~296 /* NumberLike */) || + includes & 2112 /* BigIntLike */ && includes & (67238908 /* DisjointDomains */ & ~2112 /* BigIntLike */) || + includes & 12288 /* ESSymbolLike */ && includes & (67238908 /* DisjointDomains */ & ~12288 /* ESSymbolLike */) || + includes & 49152 /* VoidLike */ && includes & (67238908 /* DisjointDomains */ & ~49152 /* VoidLike */)) { return neverType; } if (includes & 1 /* Any */) { @@ -55391,7 +54037,9 @@ var ts; // We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of // the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain. // If the estimated size of the resulting union type exceeds 100000 constituents, report an error. - if (!checkCrossProductUnion(typeSet)) { + var size = ts.reduceLeft(typeSet, function (n, t) { return n * (t.flags & 1048576 /* Union */ ? t.types.length : 1); }, 1); + if (size >= 100000) { + error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); return errorType; } var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 1048576 /* Union */) !== 0; }); @@ -55406,15 +54054,6 @@ var ts; } return result; } - function checkCrossProductUnion(types) { - var size = ts.reduceLeft(types, function (n, t) { return n * (t.flags & 1048576 /* Union */ ? t.types.length : t.flags & 131072 /* Never */ ? 0 : 1); }, 1); - if (size >= 100000) { - ts.tracing.instant("check" /* Check */, "checkCrossProductUnion_DepthLimit", { typeIds: types.map(function (t) { return t.id; }), size: size }); - error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); - return false; - } - return true; - } function getTypeFromIntersectionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -55434,24 +54073,6 @@ var ts; type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, /*stringsOnly*/ true)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, /*stringsOnly*/ false)); } - function getIndexTypeForMappedType(type, noIndexSignatures) { - var constraint = filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }); - var nameType = type.declaration.nameType && getTypeFromTypeNode(type.declaration.nameType); - return nameType ? - mapType(constraint, function (t) { return instantiateType(nameType, appendTypeMapping(type.mapper, getTypeParameterFromMappedType(type), t)); }) : - constraint; - } - // Ordinarily we reduce a keyof M where M is a mapped type { [P in K as N

]: X } to simply N. This however presumes - // that N distributes over union types, i.e. that N is equivalent to N | N | N. That presumption is - // generally true, except when N is a non-distributive conditional type or an instantiable type with non-distributive - // conditional type as a constituent. In those cases, we cannot reduce keyof M and need to preserve it as is. - function isNonDistributiveNameType(type) { - return !!(type && (type.flags & 16777216 /* Conditional */ && !type.root.isDistributive || - type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && ts.some(type.types, isNonDistributiveNameType) || - type.flags & (4194304 /* Index */ | 268435456 /* StringMapping */) && isNonDistributiveNameType(type.type) || - type.flags & 8388608 /* IndexedAccess */ && isNonDistributiveNameType(type.indexType) || - type.flags & 33554432 /* Substitution */ && isNonDistributiveNameType(type.substitute))); - } function getLiteralTypeFromPropertyName(name) { if (ts.isPrivateIdentifier(name)) { return neverType; @@ -55495,8 +54116,8 @@ var ts; type = getReducedType(type); return type.flags & 1048576 /* Union */ ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) : - type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && isNonDistributiveNameType(getNameTypeFromMappedType(type)) ? getIndexTypeForGenericType(type, stringsOnly) : - ts.getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, noIndexSignatures) : + type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) ? getIndexTypeForGenericType(type, stringsOnly) : + ts.getObjectFlags(type) & 32 /* Mapped */ ? filterType(getConstraintTypeFromMappedType(type), function (t) { return !(noIndexSignatures && t.flags & (1 /* Any */ | 4 /* String */)); }) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : @@ -55520,15 +54141,15 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 138 /* KeyOfKeyword */: + case 137 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 151 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 148 /* SymbolKeyword */ + case 150 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 147 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : errorType; break; - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: links.resolvedType = getTypeFromTypeNode(node.type); break; default: @@ -55537,115 +54158,12 @@ var ts; } return links.resolvedType; } - function getTypeFromTemplateTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getTemplateLiteralType(__spreadArrays([node.head.text], ts.map(node.templateSpans, function (span) { return span.literal.text; })), ts.map(node.templateSpans, function (span) { return getTypeFromTypeNode(span.type); })); - } - return links.resolvedType; - } - function getTemplateLiteralType(texts, types) { - var unionIndex = ts.findIndex(types, function (t) { return !!(t.flags & (131072 /* Never */ | 1048576 /* Union */)); }); - if (unionIndex >= 0) { - return checkCrossProductUnion(types) ? - mapType(types[unionIndex], function (t) { return getTemplateLiteralType(texts, ts.replaceElement(types, unionIndex, t)); }) : - errorType; - } - if (ts.contains(types, wildcardType)) { - return wildcardType; - } - var newTypes = []; - var newTexts = []; - var text = texts[0]; - if (!addSpans(texts, types)) { - return stringType; - } - if (newTypes.length === 0) { - return getLiteralType(text); - } - newTexts.push(text); - var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join(""); - var type = templateLiteralTypes.get(id); - if (!type) { - templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes)); - } - return type; - function addSpans(texts, types) { - for (var i = 0; i < types.length; i++) { - var t = types[i]; - if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) { - text += getTemplateStringForType(t) || ""; - text += texts[i + 1]; - } - else if (t.flags & 134217728 /* TemplateLiteral */) { - text += t.texts[0]; - if (!addSpans(t.texts, t.types)) - return false; - text += texts[i + 1]; - } - else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) { - newTypes.push(t); - newTexts.push(text); - text = texts[i + 1]; - } - else { - return false; - } - } - return true; - } - } - function getTemplateStringForType(type) { - return type.flags & 128 /* StringLiteral */ ? type.value : - type.flags & 256 /* NumberLiteral */ ? "" + type.value : - type.flags & 2048 /* BigIntLiteral */ ? ts.pseudoBigIntToString(type.value) : - type.flags & 512 /* BooleanLiteral */ ? type.intrinsicName : - type.flags & 65536 /* Null */ ? "null" : - type.flags & 32768 /* Undefined */ ? "undefined" : - undefined; - } - function createTemplateLiteralType(texts, types) { - var type = createType(134217728 /* TemplateLiteral */); - type.texts = texts; - type.types = types; - return type; - } - function getStringMappingType(symbol, type) { - return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) : - isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) : - type.flags & 128 /* StringLiteral */ ? getLiteralType(applyStringMapping(symbol, type.value)) : - type; - } - function applyStringMapping(symbol, str) { - switch (intrinsicTypeKinds.get(symbol.escapedName)) { - case 0 /* Uppercase */: return str.toUpperCase(); - case 1 /* Lowercase */: return str.toLowerCase(); - case 2 /* Capitalize */: return str.charAt(0).toUpperCase() + str.slice(1); - case 3 /* Uncapitalize */: return str.charAt(0).toLowerCase() + str.slice(1); - } - return str; - } - function getStringMappingTypeForGenericType(symbol, type) { - var id = getSymbolId(symbol) + "," + getTypeId(type); - var result = stringMappingTypes.get(id); - if (!result) { - stringMappingTypes.set(id, result = createStringMappingType(symbol, type)); - } - return result; - } - function createStringMappingType(symbol, type) { - var result = createType(268435456 /* StringMapping */); - result.symbol = symbol; - result.type = type; - return result; - } - function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined) { + function createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments) { var type = createType(8388608 /* IndexedAccess */); type.objectType = objectType; type.indexType = indexType; type.aliasSymbol = aliasSymbol; type.aliasTypeArguments = aliasTypeArguments; - type.noUncheckedIndexedAccessCandidate = shouldIncludeUndefined; return type; } /** @@ -55670,13 +54188,13 @@ var ts; if (type.flags & 2097152 /* Intersection */) { return ts.some(type.types, isJSLiteralType); } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return isJSLiteralType(getResolvedBaseConstraint(type)); } return false; } function getPropertyNameFromIndex(indexType, accessNode) { - var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode : undefined; return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? @@ -55691,15 +54209,15 @@ var ts; || !ts.isCallLikeExpression(ts.findAncestor(node, function (n) { return !ts.isAccessExpression(n); }) || node.parent) && ts.every(symbol.declarations, function (d) { return !ts.isFunctionLike(d) || !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }); } - function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, noUncheckedIndexedAccessCandidate, reportDeprecated) { - var _a; - var accessExpression = accessNode && accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode : undefined; + function getPropertyTypeForIndexType(originalObjectType, objectType, indexType, fullIndexType, suppressNoImplicitAnyError, accessNode, accessFlags, reportDeprecated) { + var _a, _b; + var accessExpression = accessNode && accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode : undefined; var propName = accessNode && ts.isPrivateIdentifier(accessNode) ? undefined : getPropertyNameFromIndex(indexType, accessNode); if (propName !== undefined) { var prop = getPropertyOfType(objectType, propName); if (prop) { - if (reportDeprecated && accessNode && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) { - var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); + if (reportDeprecated && accessNode && ((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.flags) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) { + var deprecatedNode = (_b = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _b !== void 0 ? _b : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); errorOrSuggestion(/* isError */ false, deprecatedNode, ts.Diagnostics._0_is_deprecated, propName); } if (accessExpression) { @@ -55731,13 +54249,10 @@ var ts; } } errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType, 1 /* Number */)); - return mapType(objectType, function (t) { - var restType = getRestTypeOfTupleType(t) || undefinedType; - return noUncheckedIndexedAccessCandidate ? getUnionType([restType, undefinedType]) : restType; - }); + return mapType(objectType, function (t) { return getRestTypeOfTupleType(t) || undefinedType; }); } } - if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) { + if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) { if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) { return objectType; } @@ -55753,10 +54268,10 @@ var ts; if (accessNode && !isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) { var indexNode = getIndexNodeForAccessExpression(accessNode); error(indexNode, ts.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); - return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + return indexInfo.type; } errorIfWritingToReadonlyIndex(indexInfo); - return noUncheckedIndexedAccessCandidate ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + return indexInfo.type; } if (indexType.flags & 131072 /* Never */) { return neverType; @@ -55840,17 +54355,11 @@ var ts; } } function getIndexNodeForAccessExpression(accessNode) { - return accessNode.kind === 202 /* ElementAccessExpression */ ? accessNode.argumentExpression : - accessNode.kind === 189 /* IndexedAccessType */ ? accessNode.indexType : - accessNode.kind === 158 /* ComputedPropertyName */ ? accessNode.expression : + return accessNode.kind === 199 /* ElementAccessExpression */ ? accessNode.argumentExpression : + accessNode.kind === 188 /* IndexedAccessType */ ? accessNode.indexType : + accessNode.kind === 157 /* ComputedPropertyName */ ? accessNode.expression : accessNode; } - function isPatternLiteralPlaceholderType(type) { - return templateConstraintType.types.indexOf(type) !== -1 || !!(type.flags & 1 /* Any */); - } - function isPatternLiteralType(type) { - return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType); - } function isGenericObjectType(type) { if (type.flags & 3145728 /* UnionOrIntersection */) { if (!(type.objectFlags & 4194304 /* IsGenericObjectTypeComputed */)) { @@ -55869,7 +54378,7 @@ var ts; } return !!(type.objectFlags & 33554432 /* IsGenericIndexType */); } - return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) && !isPatternLiteralType(type); + return !!(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */)); } function isThisTypeParameter(type) { return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType); @@ -55922,7 +54431,7 @@ var ts; return type[cache] = distributedOverIndex; } // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again - if (!(indexType.flags & 465829888 /* Instantiable */)) { + if (!(indexType.flags & 63176704 /* Instantiable */)) { // (T | U)[K] -> T[K] | U[K] (reading) // (T | U)[K] -> T[K] & U[K] (writing) // (T & U)[K] -> T[K] & U[K] @@ -55985,9 +54494,8 @@ var ts; var templateMapper = combineTypeMappers(objectType.mapper, mapper); return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); } - function getIndexedAccessType(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, aliasSymbol, aliasTypeArguments, accessFlags) { - if (accessFlags === void 0) { accessFlags = 0 /* None */; } - return getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType); + function getIndexedAccessType(objectType, indexType, accessNode, aliasSymbol, aliasTypeArguments) { + return getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, 0 /* None */, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType); } function indexTypeLessThan(indexType, limit) { return everyType(indexType, function (t) { @@ -56001,14 +54509,11 @@ var ts; return false; }); } - function getIndexedAccessTypeOrUndefined(objectType, indexType, noUncheckedIndexedAccessCandidate, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) { + function getIndexedAccessTypeOrUndefined(objectType, indexType, accessNode, accessFlags, aliasSymbol, aliasTypeArguments) { if (accessFlags === void 0) { accessFlags = 0 /* None */; } if (objectType === wildcardType || indexType === wildcardType) { return wildcardType; } - var shouldIncludeUndefined = noUncheckedIndexedAccessCandidate || - (!!compilerOptions.noUncheckedIndexedAccess && - (accessFlags & (2 /* Writing */ | 16 /* ExpressionPosition */)) === 16 /* ExpressionPosition */); // If the object type has a string index signature and no other members we know that the result will // always be the type of that index signature and we can simplify accordingly. if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) { @@ -56020,17 +54525,17 @@ var ts; // for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in an expression. This is to // preserve backwards compatibility. For example, an element access 'this["foo"]' has always been resolved // eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 189 /* IndexedAccessType */ ? + if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 188 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) { if (objectType.flags & 3 /* AnyOrUnknown */) { return objectType; } // Defer the operation by creating an indexed access type. - var id = objectType.id + "," + indexType.id + (shouldIncludeUndefined ? "?" : ""); + var id = objectType.id + "," + indexType.id; var type = indexedAccessTypes.get(id); if (!type) { - indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments, shouldIncludeUndefined)); + indexedAccessTypes.set(id, type = createIndexedAccessType(objectType, indexType, aliasSymbol, aliasTypeArguments)); } return type; } @@ -56043,7 +54548,7 @@ var ts; var wasMissingProp = false; for (var _i = 0, _a = indexType.types; _i < _a.length; _i++) { var t = _a[_i]; - var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags, shouldIncludeUndefined); + var propType = getPropertyTypeForIndexType(objectType, apparentObjectType, t, indexType, wasMissingProp, accessNode, accessFlags); if (propType) { propTypes.push(propType); } @@ -56059,11 +54564,9 @@ var ts; if (wasMissingProp) { return undefined; } - return accessFlags & 2 /* Writing */ - ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) - : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments); + return accessFlags & 2 /* Writing */ ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1 /* Literal */, aliasSymbol, aliasTypeArguments); } - return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, /* supressNoImplicitAnyError */ false, accessNode, accessFlags | 4 /* CacheSymbol */, shouldIncludeUndefined, /* reportDeprecated */ true); + return getPropertyTypeForIndexType(objectType, apparentObjectType, indexType, indexType, /* supressNoImplicitAnyError */ false, accessNode, accessFlags | 4 /* CacheSymbol */, /* reportDeprecated */ true); } function getTypeFromIndexedAccessTypeNode(node) { var links = getNodeLinks(node); @@ -56071,7 +54574,7 @@ var ts; var objectType = getTypeFromTypeNode(node.objectType); var indexType = getTypeFromTypeNode(node.indexType); var potentialAlias = getAliasSymbolForTypeNode(node); - var resolved = getIndexedAccessType(objectType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); + var resolved = getIndexedAccessType(objectType, indexType, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); links.resolvedType = resolved.flags & 8388608 /* IndexedAccess */ && resolved.objectType === objectType && resolved.indexType === indexType ? @@ -56106,7 +54609,7 @@ var ts; function getConditionalType(root, mapper) { var result; var extraTypes; - var _loop_15 = function () { + var _loop_14 = function () { var checkType = instantiateType(root.checkType, mapper); var checkTypeInstantiable = isGenericObjectType(checkType) || isGenericIndexType(checkType); var extendsType = instantiateType(root.extendsType, mapper); @@ -56139,11 +54642,11 @@ var ts; if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) { // Return union of trueType and falseType for 'any' since it matches anything if (checkType.flags & 1 /* Any */) { - (extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper)); + (extraTypes || (extraTypes = [])).push(instantiateTypeWithoutDepthIncrease(root.trueType, combinedMapper || mapper)); } // If falseType is an immediately nested conditional type that isn't distributive or has an // identical checkType, switch to that type and loop. - var falseType_1 = getTypeFromTypeNode(root.node.falseType); + var falseType_1 = root.falseType; if (falseType_1.flags & 16777216 /* Conditional */) { var newRoot = falseType_1.root; if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) { @@ -56151,7 +54654,7 @@ var ts; return "continue"; } } - result = instantiateType(falseType_1, mapper); + result = instantiateTypeWithoutDepthIncrease(falseType_1, mapper); return "break"; } // Return trueType for a definitely true extends check. We check instantiations of the two @@ -56160,7 +54663,7 @@ var ts; // type Foo = T extends { x: string } ? string : number // doesn't immediately resolve to 'string' instead of being deferred. if (inferredExtendsType.flags & 3 /* AnyOrUnknown */ || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) { - result = instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper); + result = instantiateTypeWithoutDepthIncrease(root.trueType, combinedMapper || mapper); return "break"; } } @@ -56180,7 +54683,7 @@ var ts; // types of the form 'A extends B ? X : C extends D ? Y : E extends F ? Z : ...' as a single construct for // purposes of resolution. This means such types aren't subject to the instatiation depth limiter. while (true) { - var state_4 = _loop_15(); + var state_4 = _loop_14(); if (typeof state_4 === "object") return state_4.value; if (state_4 === "break") @@ -56189,13 +54692,13 @@ var ts; return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result; } function getTrueTypeFromConditionalType(type) { - return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.mapper)); + return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(type.root.trueType, type.mapper)); } function getFalseTypeFromConditionalType(type) { - return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(getTypeFromTypeNode(type.root.node.falseType), type.mapper)); + return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(type.root.falseType, type.mapper)); } function getInferredTrueTypeFromConditionalType(type) { - return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(getTypeFromTypeNode(type.root.node.trueType), type.combinedMapper) : getTrueTypeFromConditionalType(type)); + return type.resolvedInferredTrueType || (type.resolvedInferredTrueType = type.combinedMapper ? instantiateType(type.root.trueType, type.combinedMapper) : getTrueTypeFromConditionalType(type)); } function getInferTypeParameters(node) { var result; @@ -56220,6 +54723,8 @@ var ts; node: node, checkType: checkType, extendsType: getTypeFromTypeNode(node.extendsType), + trueType: getTypeFromTypeNode(node.trueType), + falseType: getTypeFromTypeNode(node.falseType), isDistributive: !!(checkType.flags & 262144 /* TypeParameter */), inferTypeParameters: getInferTypeParameters(node), outerTypeParameters: outerTypeParameters, @@ -56277,13 +54782,7 @@ var ts; var current = void 0; while (current = nameStack.shift()) { var meaning = nameStack.length ? 1920 /* Namespace */ : targetMeaning; - // typeof a.b.c is normally resolved using `checkExpression` which in turn defers to `checkQualifiedName` - // That, in turn, ultimately uses `getPropertyOfType` on the type of the symbol, which differs slightly from - // the `exports` lookup process that only looks up namespace members which is used for most type references - var mergedResolvedSymbol = getMergedSymbol(resolveSymbol(currentNamespace)); - var next = node.isTypeOf - ? getPropertyOfType(getTypeOfSymbol(mergedResolvedSymbol), current.escapedText) - : getSymbol(getExportsOfSymbol(mergedResolvedSymbol), current.escapedText, meaning); + var next = getSymbol(getExportsOfSymbol(getMergedSymbol(resolveSymbol(currentNamespace))), current.escapedText, meaning); if (!next) { error(current, ts.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName(currentNamespace), ts.declarationNameToString(current)); return links.resolvedType = errorType; @@ -56342,7 +54841,7 @@ var ts; } function getAliasSymbolForTypeNode(node) { var host = node.parent; - while (ts.isParenthesizedTypeNode(host) || ts.isJSDocTypeExpression(host) || ts.isTypeOperatorNode(host) && host.operator === 142 /* ReadonlyKeyword */) { + while (ts.isParenthesizedTypeNode(host) || ts.isTypeOperatorNode(host) && host.operator === 141 /* ReadonlyKeyword */) { host = host.parent; } return ts.isTypeAlias(host) ? getSymbolOfNode(host) : undefined; @@ -56354,7 +54853,12 @@ var ts; return !!(type.flags & 524288 /* Object */) && !isGenericMappedType(type); } function isEmptyObjectTypeOrSpreadsIntoEmptyObject(type) { - return isEmptyObjectType(type) || !!(type.flags & (65536 /* Null */ | 32768 /* Undefined */ | 528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)); + return isEmptyObjectType(type) || !!(type.flags & (65536 /* Null */ | 32768 /* Undefined */ | 528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)); + } + function isSinglePropertyAnonymousObjectType(type) { + return !!(type.flags & 524288 /* Object */) && + !!(ts.getObjectFlags(type) & 16 /* Anonymous */) && + (ts.length(getPropertiesOfType(type)) === 1 || ts.every(getPropertiesOfType(type), function (p) { return !!(p.flags & 16777216 /* Optional */); })); } function tryMergeUnionOfObjectTypeAndEmptyObject(type, readonly) { if (type.types.length === 2) { @@ -56363,10 +54867,10 @@ var ts; if (ts.every(type.types, isEmptyObjectTypeOrSpreadsIntoEmptyObject)) { return isEmptyObjectType(firstType) ? firstType : isEmptyObjectType(secondType) ? secondType : emptyObjectType; } - if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(firstType)) { + if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(firstType) && isSinglePropertyAnonymousObjectType(secondType)) { return getAnonymousPartialType(secondType); } - if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(secondType)) { + if (isEmptyObjectTypeOrSpreadsIntoEmptyObject(secondType) && isSinglePropertyAnonymousObjectType(firstType)) { return getAnonymousPartialType(firstType); } } @@ -56417,20 +54921,16 @@ var ts; if (merged) { return getSpreadType(merged, right, symbol, objectFlags, readonly); } - return checkCrossProductUnion([left, right]) - ? mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }) - : errorType; + return mapType(left, function (t) { return getSpreadType(t, right, symbol, objectFlags, readonly); }); } if (right.flags & 1048576 /* Union */) { var merged = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); if (merged) { return getSpreadType(left, merged, symbol, objectFlags, readonly); } - return checkCrossProductUnion([left, right]) - ? mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }) - : errorType; + return mapType(right, function (t) { return getSpreadType(left, t, symbol, objectFlags, readonly); }); } - if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { + if (right.flags & (528 /* BooleanLike */ | 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 1056 /* EnumLike */ | 67108864 /* NonPrimitive */ | 4194304 /* Index */)) { return left; } if (isGenericObjectType(left) || isGenericObjectType(right)) { @@ -56591,7 +55091,7 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 253 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 250 /* InterfaceDeclaration */)) { if (!ts.hasSyntacticModifier(container, 32 /* Static */) && (!ts.isConstructorDeclaration(container) || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; @@ -56626,17 +55126,17 @@ var ts; } function getArrayElementTypeNode(node) { switch (node.kind) { - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return getArrayElementTypeNode(node.type); - case 179 /* TupleType */: + case 178 /* TupleType */: if (node.elements.length === 1) { node = node.elements[0]; - if (node.kind === 181 /* RestType */ || node.kind === 192 /* NamedTupleMember */ && node.dotDotDotToken) { + if (node.kind === 180 /* RestType */ || node.kind === 191 /* NamedTupleMember */ && node.dotDotDotToken) { return getArrayElementTypeNode(node.type); } } break; - case 178 /* ArrayType */: + case 177 /* ArrayType */: return node.elementType; } return undefined; @@ -56654,98 +55154,94 @@ var ts; function getTypeFromTypeNodeWorker(node) { switch (node.kind) { case 128 /* AnyKeyword */: - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: return anyType; - case 152 /* UnknownKeyword */: + case 151 /* UnknownKeyword */: return unknownType; - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: return stringType; - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: return numberType; - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: return bigintType; case 131 /* BooleanKeyword */: return booleanType; - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: return esSymbolType; case 113 /* VoidKeyword */: return voidType; - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: return undefinedType; case 103 /* NullKeyword */: // TODO(rbuckton): `NullKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service. return nullType; - case 141 /* NeverKeyword */: + case 140 /* NeverKeyword */: return neverType; - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return node.flags & 131072 /* JavaScriptFile */ && !noImplicitAny ? anyType : nonPrimitiveType; - case 136 /* IntrinsicKeyword */: - return intrinsicMarkerType; - case 187 /* ThisType */: + case 186 /* ThisType */: case 107 /* ThisKeyword */: // TODO(rbuckton): `ThisKeyword` is no longer a `TypeNode`, but we defensively allow it here because of incorrect casts in the Language Service and because of `isPartOfTypeNode`. return getTypeFromThisTypeNode(node); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return getTypeFromTypeReference(node); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return node.assertsModifier ? voidType : booleanType; - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return getTypeFromArrayOrTupleTypeNode(node); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return getTypeFromOptionalTypeNode(node); - case 182 /* UnionType */: + case 181 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return addOptionality(getTypeFromTypeNode(node.type)); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return getTypeFromNamedTupleTypeNode(node); - case 186 /* ParenthesizedType */: - case 306 /* JSDocNonNullableType */: - case 301 /* JSDocTypeExpression */: + case 185 /* ParenthesizedType */: + case 302 /* JSDocNonNullableType */: + case 298 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 181 /* RestType */: + case 180 /* RestType */: return getTypeFromRestTypeNode(node); - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 177 /* TypeLiteral */: - case 312 /* JSDocTypeLiteral */: - case 308 /* JSDocFunctionType */: - case 313 /* JSDocSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 176 /* TypeLiteral */: + case 308 /* JSDocTypeLiteral */: + case 304 /* JSDocFunctionType */: + case 309 /* JSDocSignature */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return getTypeFromMappedTypeNode(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return getTypeFromConditionalTypeNode(node); - case 185 /* InferType */: + case 184 /* InferType */: return getTypeFromInferTypeNode(node); - case 193 /* TemplateLiteralType */: - return getTypeFromTemplateTypeNode(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return getTypeFromImportTypeNode(node); // This function assumes that an identifier, qualified name, or property access expression is a type expression // Callers should first ensure this by calling `isPartOfTypeNode` // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s. case 78 /* Identifier */: - case 157 /* QualifiedName */: - case 201 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: var symbol = getSymbolAtLocation(node); return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: @@ -56899,10 +55395,9 @@ var ts; return result; } function getObjectTypeInstantiation(type, mapper) { + var target = type.objectFlags & 64 /* Instantiated */ ? type.target : type; var declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.symbol.declarations[0]; var links = getNodeLinks(declaration); - var target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : - type.objectFlags & 64 /* Instantiated */ ? type.target : type; var typeParameters = links.outerTypeParameters; if (!typeParameters) { // The first time an anonymous type is instantiated we compute and store a list of the type @@ -56919,6 +55414,10 @@ var ts; ts.filter(typeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration); }) : typeParameters; links.outerTypeParameters = typeParameters; + if (typeParameters.length) { + links.instantiations = new ts.Map(); + links.instantiations.set(getTypeListId(typeParameters), target); + } } if (typeParameters.length) { // We are instantiating an anonymous type that has one or more type parameters in scope. Apply the @@ -56927,26 +55426,22 @@ var ts; var combinedMapper_1 = combineTypeMappers(type.mapper, mapper); var typeArguments = ts.map(typeParameters, function (t) { return getMappedType(t, combinedMapper_1); }); var id = getTypeListId(typeArguments); - if (!target.instantiations) { - target.instantiations = new ts.Map(); - target.instantiations.set(getTypeListId(typeParameters), target); - } - var result = target.instantiations.get(id); + var result = links.instantiations.get(id); if (!result) { var newMapper = createTypeMapper(typeParameters, typeArguments); result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper) : instantiateAnonymousType(target, newMapper); - target.instantiations.set(id, result); + links.instantiations.set(id, result); } return result; } return type; } function maybeTypeParameterReference(node) { - return !(node.kind === 157 /* QualifiedName */ || - node.parent.kind === 173 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || - node.parent.kind === 195 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); + return !(node.kind === 156 /* QualifiedName */ || + node.parent.kind === 172 /* TypeReference */ && node.parent.typeArguments && node === node.parent.typeName || + node.parent.kind === 192 /* ImportType */ && node.parent.typeArguments && node === node.parent.qualifier); } function isTypeParameterPossiblyReferenced(tp, node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks @@ -56955,7 +55450,7 @@ var ts; if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container = tp.symbol.declarations[0].parent; for (var n = node; n !== container; n = n.parent) { - if (!n || n.kind === 230 /* Block */ || n.kind === 184 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { + if (!n || n.kind === 227 /* Block */ || n.kind === 183 /* ConditionalType */ && ts.forEachChild(n.extendsType, containsReference)) { return true; } } @@ -56964,12 +55459,12 @@ var ts; return true; function containsReference(node) { switch (node.kind) { - case 187 /* ThisType */: + case 186 /* ThisType */: return !!tp.isThisType; case 78 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) && getTypeFromTypeNodeWorker(node) === tp; // use worker because we're looking for === equality - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return true; } return !!ts.forEachChild(node, containsReference); @@ -57002,18 +55497,13 @@ var ts; if (typeVariable !== mappedTypeVariable) { return mapType(getReducedType(mappedTypeVariable), function (t) { if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && t !== errorType) { - if (!type.declaration.nameType) { - if (isArrayType(t)) { - return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper)); - } - if (isGenericTupleType(t)) { - return instantiateMappedGenericTupleType(t, type, typeVariable, mapper); - } - if (isTupleType(t)) { - return instantiateMappedTupleType(t, type, prependTypeMapping(typeVariable, t, mapper)); - } + if (isGenericTupleType(t)) { + return instantiateMappedGenericTupleType(t, type, typeVariable, mapper); } - return instantiateAnonymousType(type, prependTypeMapping(typeVariable, t, mapper)); + var replacementMapper = prependTypeMapping(typeVariable, t, mapper); + return isArrayType(t) ? instantiateMappedArrayType(t, type, replacementMapper) : + isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : + instantiateAnonymousType(type, replacementMapper); } return t; }); @@ -57122,7 +55612,6 @@ var ts; // We have reached 50 recursive type instantiations and there is a very high likelyhood we're dealing // with a combination of infinite generic types that perpetually generate new type identities. We stop // the recursion here by yielding the error type. - ts.tracing.instant("check" /* Check */, "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth: instantiationDepth, instantiationCount: instantiationCount }); error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); return errorType; } @@ -57133,6 +55622,16 @@ var ts; instantiationDepth--; return result; } + /** + * This can be used to avoid the penalty on instantiation depth for types which result from immediate + * simplification. It essentially removes the depth increase done in `instantiateType`. + */ + function instantiateTypeWithoutDepthIncrease(type, mapper) { + instantiationDepth--; + var result = instantiateType(type, mapper); + instantiationDepth++; + return result; + } function instantiateTypeWorker(type, mapper) { var flags = type.flags; if (flags & 262144 /* TypeParameter */) { @@ -57161,14 +55660,8 @@ var ts; if (flags & 4194304 /* Index */) { return getIndexType(instantiateType(type.type, mapper)); } - if (flags & 134217728 /* TemplateLiteral */) { - return getTemplateLiteralType(type.texts, instantiateTypes(type.types, mapper)); - } - if (flags & 268435456 /* StringMapping */) { - return getStringMappingType(type.symbol, instantiateType(type.type, mapper)); - } if (flags & 8388608 /* IndexedAccess */) { - return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), type.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper), /*accessNode*/ undefined, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); } if (flags & 16777216 /* Conditional */) { return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); @@ -57214,35 +55707,35 @@ var ts; // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: // Function declarations can have context when annotated with a jsdoc @type return isContextSensitiveFunctionLikeDeclaration(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return ts.some(node.properties, isContextSensitive); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return ts.some(node.elements, isContextSensitive); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return (node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */) && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return ts.some(node.properties, isContextSensitive) || ts.isJsxOpeningElement(node.parent) && ts.some(node.parent.parent.children, isContextSensitive); - case 280 /* JsxAttribute */: { + case 277 /* JsxAttribute */: { // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. var initializer = node.initializer; return !!initializer && isContextSensitive(initializer); } - case 283 /* JsxExpression */: { + case 280 /* JsxExpression */: { // It is possible to that node.expression is undefined (e.g

) var expression = node.expression; return !!expression && isContextSensitive(expression); @@ -57261,7 +55754,7 @@ var ts; if (ts.some(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 209 /* ArrowFunction */) { + if (node.kind !== 206 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -57274,7 +55767,7 @@ var ts; } function hasContextSensitiveReturnExpression(node) { // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 230 /* Block */ && isContextSensitive(node.body); + return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 227 /* Block */ && isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && @@ -57330,7 +55823,7 @@ var ts; source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : - hasBaseType(source, getTargetType(target)) || (isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType)); + hasBaseType(source, getTargetType(target)); } /** * This is *not* a bi-directional relationship. @@ -57377,23 +55870,23 @@ var ts; return true; } switch (node.kind) { - case 283 /* JsxExpression */: - case 207 /* ParenthesizedExpression */: + case 280 /* JsxExpression */: + case 204 /* ParenthesizedExpression */: return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 27 /* CommaToken */: return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); } break; - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); } return false; @@ -57593,7 +56086,7 @@ var ts; } function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { switch (child.kind) { - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: // child is of the type of the expression return { errorNode: child, innerExpression: child.expression, nameType: nameType }; case 11 /* JsxText */: @@ -57602,15 +56095,18 @@ var ts; } // child is a string return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() }; - case 273 /* JsxElement */: - case 274 /* JsxSelfClosingElement */: - case 277 /* JsxFragment */: + case 270 /* JsxElement */: + case 271 /* JsxSelfClosingElement */: + case 274 /* JsxFragment */: // child is of type JSX.Element return { errorNode: child, innerExpression: child, nameType: nameType }; default: return ts.Debug.assertNever(child, "Found invalid jsx child"); } } + function getSemanticJsxChildren(children) { + return ts.filter(children, function (i) { return !ts.isJsxText(i) || !i.containsOnlyTriviaWhiteSpaces; }); + } function elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer) { var result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer); var invalidTextDiagnostic; @@ -57620,7 +56116,7 @@ var ts; var childrenPropName = childPropName === undefined ? "children" : ts.unescapeLeadingUnderscores(childPropName); var childrenNameType = getLiteralType(childrenPropName); var childrenTargetType = getIndexedAccessType(target, childrenNameType); - var validChildren = ts.getSemanticJsxChildren(containingElement.children); + var validChildren = getSemanticJsxChildren(containingElement.children); if (!ts.length(validChildren)) { return result; } @@ -57752,11 +56248,11 @@ var ts; } _b = prop.kind; switch (_b) { - case 168 /* SetAccessor */: return [3 /*break*/, 2]; - case 167 /* GetAccessor */: return [3 /*break*/, 2]; - case 165 /* MethodDeclaration */: return [3 /*break*/, 2]; - case 289 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; - case 288 /* PropertyAssignment */: return [3 /*break*/, 4]; + case 167 /* SetAccessor */: return [3 /*break*/, 2]; + case 166 /* GetAccessor */: return [3 /*break*/, 2]; + case 164 /* MethodDeclaration */: return [3 /*break*/, 2]; + case 286 /* ShorthandPropertyAssignment */: return [3 /*break*/, 2]; + case 285 /* PropertyAssignment */: return [3 /*break*/, 4]; } return [3 /*break*/, 6]; case 2: return [4 /*yield*/, { errorNode: prop.name, innerExpression: undefined, nameType: type }]; @@ -57833,8 +56329,8 @@ var ts; return 0 /* False */; } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 165 /* MethodDeclaration */ && - kind !== 164 /* MethodSignature */ && kind !== 166 /* Constructor */; + var strictVariance = !(checkMode & 3 /* Callback */) && strictFunctionTypes && kind !== 164 /* MethodDeclaration */ && + kind !== 163 /* MethodSignature */ && kind !== 165 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -57855,36 +56351,34 @@ var ts; var paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount); var restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1; for (var i = 0; i < paramCount; i++) { - var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i); - var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i); - if (sourceType && targetType) { - // In order to ensure that any generic type Foo is at least co-variant with respect to T no matter - // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions, - // they naturally relate only contra-variantly). However, if the source and target parameters both have - // function types with a single call signature, we know we are relating two callback parameters. In - // that case it is sufficient to only relate the parameters of the signatures co-variantly because, - // similar to return values, callback parameters are output positions. This means that a Promise, - // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) - // with respect to T. - var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); - var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType)); - var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && - (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */); - var related = callbacks ? - compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : - !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); - // With strict arity, (x: number | undefined) => void is a subtype of (x?: number | undefined) => void - if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, /*reportErrors*/ false)) { - related = 0 /* False */; - } - if (!related) { - if (reportErrors) { - errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), ts.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); - } - return 0 /* False */; - } - result &= related; + var sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : getTypeAtPosition(source, i); + var targetType = i === restIndex ? getRestTypeAtPosition(target, i) : getTypeAtPosition(target, i); + // In order to ensure that any generic type Foo is at least co-variant with respect to T no matter + // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions, + // they naturally relate only contra-variantly). However, if the source and target parameters both have + // function types with a single call signature, we know we are relating two callback parameters. In + // that case it is sufficient to only relate the parameters of the signatures co-variantly because, + // similar to return values, callback parameters are output positions. This means that a Promise, + // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) + // with respect to T. + var sourceSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); + var targetSig = checkMode & 3 /* Callback */ ? undefined : getSingleCallSignature(getNonNullableType(targetType)); + var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && + (getFalsyFlags(sourceType) & 98304 /* Nullable */) === (getFalsyFlags(targetType) & 98304 /* Nullable */); + var related = callbacks ? + compareSignaturesRelated(targetSig, sourceSig, (checkMode & 8 /* StrictArity */) | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : + !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); + // With strict arity, (x: number | undefined) => void is a subtype of (x?: number | undefined) => void + if (related && checkMode & 8 /* StrictArity */ && i >= getMinArgumentCount(source) && i < getMinArgumentCount(target) && compareTypes(sourceType, targetType, /*reportErrors*/ false)) { + related = 0 /* False */; } + if (!related) { + if (reportErrors) { + errorReporter(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i)), ts.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i))); + } + return 0 /* False */; + } + result &= related; } if (!(checkMode & 4 /* IgnoreReturnTypes */)) { // If a signature resolution is already in-flight, skip issuing a circularity error @@ -58027,7 +56521,7 @@ var ts; return true; if (t & 131072 /* Never */) return false; - if (s & 402653316 /* StringLike */ && t & 4 /* String */) + if (s & 132 /* StringLike */ && t & 4 /* String */) return true; if (s & 128 /* StringLiteral */ && s & 1024 /* EnumLiteral */ && t & 128 /* StringLiteral */ && !(t & 1024 /* EnumLiteral */) && @@ -58089,7 +56583,7 @@ var ts; } else { if (!(source.flags & 3145728 /* UnionOrIntersection */) && !(target.flags & 3145728 /* UnionOrIntersection */) && - source.flags !== target.flags && !(source.flags & 469237760 /* Substructure */)) + source.flags !== target.flags && !(source.flags & 66584576 /* Substructure */)) return false; } if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) { @@ -58098,7 +56592,7 @@ var ts; return !!(related & 1 /* Succeeded */); } } - if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) { + if (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; @@ -58151,7 +56645,6 @@ var ts; reportIncompatibleStack(); } if (overflow) { - ts.tracing.instant("check" /* Check */, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: depth }); var diag = error(errorNode || currentNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); if (errorOutputContainer) { (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); @@ -58526,7 +57019,7 @@ var ts; // breaking the intersection apart. result = someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */); } - if (!result && (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */)) { + if (!result && (source.flags & 66846720 /* StructuredOrInstantiable */ || target.flags & 66846720 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) { resetErrorInfo(saveErrorInfo); } @@ -58624,7 +57117,7 @@ var ts; } function isIdenticalTo(source, target) { var flags = source.flags & target.flags; - if (!(flags & 469237760 /* Substructure */)) { + if (!(flags & 66584576 /* Substructure */)) { return 0 /* False */; } if (flags & 3145728 /* UnionOrIntersection */) { @@ -58660,7 +57153,7 @@ var ts; reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target); checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget]; } - var _loop_16 = function (prop) { + var _loop_15 = function (prop) { if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) { if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) { if (reportErrors) { @@ -58723,7 +57216,7 @@ var ts; }; for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; - var state_5 = _loop_16(prop); + var state_5 = _loop_15(prop); if (typeof state_5 === "object") return state_5.value; } @@ -58909,7 +57402,7 @@ var ts; for (var i = 0; i < maybeCount; i++) { // If source and target are already being compared, consider them related with assumptions if (id === maybeKeys[i]) { - return 3 /* Maybe */; + return 1 /* Maybe */; } } if (depth === 100) { @@ -58937,16 +57430,7 @@ var ts; return originalHandler(onlyUnreliable); }; } - if (expandingFlags === 3 /* Both */) { - ts.tracing.instant("check" /* Check */, "recursiveTypeRelatedTo_DepthLimit", { - sourceId: source.id, - sourceIdStack: sourceStack.map(function (t) { return t.id; }), - targetId: target.id, - targetIdStack: targetStack.map(function (t) { return t.id; }), - depth: depth, - }); - } - var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3 /* Maybe */; + var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 1 /* Maybe */; if (outofbandVarianceMarkerHandler) { outofbandVarianceMarkerHandler = originalHandler; } @@ -58954,12 +57438,9 @@ var ts; depth--; if (result) { if (result === -1 /* True */ || depth === 0) { - if (result === -1 /* True */ || result === 3 /* Maybe */) { - // If result is definitely true, record all maybe keys as having succeeded. Also, record Ternary.Maybe - // results as having succeeded once we reach depth 0, but never record Ternary.Unknown results. - for (var i = maybeStart; i < maybeCount; i++) { - relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags); - } + // If result is definitely true, record all maybe keys as having succeeded + for (var i = maybeStart; i < maybeCount; i++) { + relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags); } maybeCount = maybeStart; } @@ -58973,12 +57454,6 @@ var ts; return result; } function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) { - ts.tracing.push("check" /* Check */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id }); - var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState); - ts.tracing.pop(); - return result; - } - function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) { if (intersectionState & 4 /* PropertyCheck */) { return propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */); } @@ -59025,7 +57500,7 @@ var ts; !(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) { var variances = getAliasVariances(source.aliasSymbol); if (variances === ts.emptyArray) { - return 1 /* Unknown */; + return 1 /* Maybe */; } var varianceResult = relateVariances(source.aliasTypeArguments, target.aliasTypeArguments, variances, intersectionState); if (varianceResult !== undefined) { @@ -59040,7 +57515,7 @@ var ts; } if (target.flags & 262144 /* TypeParameter */) { // A source type { [P in Q]: X } is related to a target type T if keyof T is related to Q and X is related to T[Q]. - if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) { + if (ts.getObjectFlags(source) & 32 /* Mapped */ && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) { if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) { var templateType = getTemplateTypeFromMappedType(source); var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); @@ -59090,14 +57565,14 @@ var ts; var baseIndexType = getBaseConstraintOfType(indexType) || indexType; if (!isGenericObjectType(baseObjectType) && !isGenericIndexType(baseIndexType)) { var accessFlags = 2 /* Writing */ | (baseObjectType !== objectType ? 1 /* NoIndexSignatures */ : 0); - var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, target.noUncheckedIndexedAccessCandidate, /*accessNode*/ undefined, accessFlags); + var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, /*accessNode*/ undefined, accessFlags); if (constraint && (result = isRelatedTo(source, constraint, reportErrors))) { return result; } } } } - else if (isGenericMappedType(target) && !target.declaration.nameType) { + else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } var template = getTemplateTypeFromMappedType(target); var modifiers = getMappedTypeModifiers(target); @@ -59139,15 +57614,6 @@ var ts; } } } - else if (target.flags & 134217728 /* TemplateLiteral */ && source.flags & 128 /* StringLiteral */) { - if (isPatternLiteralType(target)) { - // match all non-`string` segments - var result_8 = inferLiteralsFromTemplateLiteralType(source, target); - if (result_8 && ts.every(result_8, function (r, i) { return isStringLiteralTypeValueParsableAsType(r, target.types[i]); })) { - return -1 /* True */; - } - } - } if (source.flags & 8650752 /* TypeVariable */) { if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) { // A type S[K] is related to a type T[J] if S is related to T and K is related to J. @@ -59186,35 +57652,6 @@ var ts; return result; } } - else if (source.flags & 134217728 /* TemplateLiteral */) { - if (target.flags & 134217728 /* TemplateLiteral */ && - source.texts.length === target.texts.length && - source.types.length === target.types.length && - ts.every(source.texts, function (t, i) { return t === target.texts[i]; }) && - ts.every(instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)).types, function (t, i) { return !!(target.types[i].flags & (1 /* Any */ | 4 /* String */)) || !!isRelatedTo(t, target.types[i], /*reportErrors*/ false); })) { - return -1 /* True */; - } - var constraint = getBaseConstraintOfType(source); - if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, reportErrors))) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - else if (source.flags & 268435456 /* StringMapping */) { - if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) { - if (result = isRelatedTo(source.type, target.type, reportErrors)) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - else { - var constraint = getBaseConstraintOfType(source); - if (constraint && (result = isRelatedTo(constraint, target, reportErrors))) { - resetErrorInfo(saveErrorInfo); - return result; - } - } - } else if (source.flags & 16777216 /* Conditional */) { if (target.flags & 16777216 /* Conditional */) { // Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if @@ -59293,7 +57730,7 @@ var ts; // effectively means we measure variance only from type parameter occurrences that aren't nested in // recursive instantiations of the generic type. if (variances === ts.emptyArray) { - return 1 /* Unknown */; + return 1 /* Maybe */; } var varianceResult = relateVariances(getTypeArguments(source), getTypeArguments(target), variances, intersectionState); if (varianceResult !== undefined) { @@ -59350,9 +57787,9 @@ var ts; if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) { var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */); if (objectOnlyTarget.flags & 1048576 /* Union */) { - var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget); - if (result_9) { - return result_9; + var result_8 = typeRelatedToDiscriminatedType(source, objectOnlyTarget); + if (result_8) { + return result_8; } } } @@ -59419,14 +57856,12 @@ var ts; var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { - var result_10; + var result_9; var targetConstraint = getConstraintTypeFromMappedType(target); var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers)); - if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { + if (result_9 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) { var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); - if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) { - return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); - } + return result_9 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); } } return 0 /* False */; @@ -59456,7 +57891,6 @@ var ts; numCombinations *= countTypes(getTypeOfSymbol(sourceProperty)); if (numCombinations > 25) { // We've reached the complexity limit. - ts.tracing.instant("check" /* Check */, "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source.id, targetId: target.id, numCombinations: numCombinations }); return 0 /* False */; } } @@ -59475,11 +57909,11 @@ var ts; // constituents of 'target'. If any combination does not have a match then 'source' is not relatable. var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes); var matchingTypes = []; - var _loop_17 = function (combination) { + var _loop_16 = function (combination) { var hasMatch = false; outer: for (var _i = 0, _a = target.types; _i < _a.length; _i++) { var type = _a[_i]; - var _loop_18 = function (i) { + var _loop_17 = function (i) { var sourceProperty = sourcePropertiesFiltered[i]; var targetProperty = getPropertyOfType(type, sourceProperty.escapedName); if (!targetProperty) @@ -59495,7 +57929,7 @@ var ts; } }; for (var i = 0; i < sourcePropertiesFiltered.length; i++) { - var state_7 = _loop_18(i); + var state_7 = _loop_17(i); switch (state_7) { case "continue-outer": continue outer; } @@ -59509,7 +57943,7 @@ var ts; }; for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) { var combination = discriminantCombinations_1[_a]; - var state_6 = _loop_17(combination); + var state_6 = _loop_16(combination); if (typeof state_6 === "object") return state_6.value; } @@ -59565,7 +57999,7 @@ var ts; ts.Debug.assertIsDefined(links.deferralParent); ts.Debug.assertIsDefined(links.deferralConstituents); var unionParent = !!(links.deferralParent.flags & 1048576 /* Union */); - var result_11 = unionParent ? 0 /* False */ : -1 /* True */; + var result_10 = unionParent ? 0 /* False */ : -1 /* True */; var targetTypes = links.deferralConstituents; for (var _i = 0, targetTypes_3 = targetTypes; _i < targetTypes_3.length; _i++) { var targetType = targetTypes_3[_i]; @@ -59575,7 +58009,7 @@ var ts; // Can't assign to a target individually - have to fallback to assigning to the _whole_ intersection (which forces normalization) return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors); } - result_11 &= related; + result_10 &= related; } else { if (related) { @@ -59583,17 +58017,17 @@ var ts; } } } - if (unionParent && !result_11 && targetIsOptional) { - result_11 = isRelatedTo(source, undefinedType); + if (unionParent && !result_10 && targetIsOptional) { + result_10 = isRelatedTo(source, undefinedType); } - if (unionParent && !result_11 && reportErrors) { + if (unionParent && !result_10 && reportErrors) { // The easiest way to get the right errors here is to un-defer (which may be costly) // If it turns out this is too costly too often, we can replicate the error handling logic within // typeRelatedToSomeType without the discriminatable type branch (as that requires a manifest union // type on which to hand discriminable properties, which we are expressly trying to avoid here) return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors); } - return result_11; + return result_10; } else { return isRelatedTo(source, addOptionality(getTypeOfSymbol(targetProp), targetIsOptional), reportErrors, /*headMessage*/ undefined, intersectionState); @@ -59853,7 +58287,6 @@ var ts; return result; } function signaturesRelatedTo(source, target, kind, reportErrors) { - var _a, _b; if (relation === identityRelation) { return signaturesIdenticalTo(source, target, kind); } @@ -59884,9 +58317,7 @@ var ts; var result = -1 /* True */; var saveErrorInfo = captureErrorCalculationState(); var incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn; - var sourceObjectFlags = ts.getObjectFlags(source); - var targetObjectFlags = ts.getObjectFlags(target); - if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source.symbol === target.symbol) { + if (ts.getObjectFlags(source) & 64 /* Instantiated */ && ts.getObjectFlags(target) & 64 /* Instantiated */ && source.symbol === target.symbol) { // We have instantiations of the same anonymous type (which typically will be the type of a // method). Simply do a pairwise comparison of the signatures in the two signature lists instead // of the much more expensive N * M comparison matrix we explore below. We erase type parameters @@ -59906,26 +58337,15 @@ var ts; // this regardless of the number of signatures, but the potential costs are prohibitive due // to the quadratic nature of the logic below. var eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; - var sourceSignature = ts.first(sourceSignatures); - var targetSignature = ts.first(targetSignatures); - result = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors, incompatibleReporter(sourceSignature, targetSignature)); - if (!result && reportErrors && kind === 1 /* Construct */ && (sourceObjectFlags & targetObjectFlags) && - (((_a = targetSignature.declaration) === null || _a === void 0 ? void 0 : _a.kind) === 166 /* Constructor */ || ((_b = sourceSignature.declaration) === null || _b === void 0 ? void 0 : _b.kind) === 166 /* Constructor */)) { - var constructSignatureToString = function (signature) { - return signatureToString(signature, /*enclosingDeclaration*/ undefined, 262144 /* WriteArrowStyleSignature */, kind); - }; - reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature)); - reportError(ts.Diagnostics.Types_of_construct_signatures_are_incompatible); - return result; - } + result = signatureRelatedTo(sourceSignatures[0], targetSignatures[0], eraseGenerics, reportErrors, incompatibleReporter(sourceSignatures[0], targetSignatures[0])); } else { outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) { var t = targetSignatures_1[_i]; // Only elaborate errors from the first failure var shouldElaborateErrors = reportErrors; - for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) { - var s = sourceSignatures_1[_c]; + for (var _a = 0, sourceSignatures_1 = sourceSignatures; _a < sourceSignatures_1.length; _a++) { + var s = sourceSignatures_1[_a]; var related = signatureRelatedTo(s, t, /*erase*/ true, shouldElaborateErrors, incompatibleReporter(s, t)); if (related) { result &= related; @@ -60089,13 +58509,13 @@ var ts; if (type.flags & 3145728 /* UnionOrIntersection */) { return !!ts.forEach(type.types, typeCouldHaveTopLevelSingletonTypes); } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getConstraintOfType(type); - if (constraint && constraint !== type) { + if (constraint) { return typeCouldHaveTopLevelSingletonTypes(constraint); } } - return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */); + return isUnitType(type); } function getBestMatchingType(source, target, isRelatedTo) { if (isRelatedTo === void 0) { isRelatedTo = compareTypesAssignable; } @@ -60129,18 +58549,8 @@ var ts; } } var match = discriminable.indexOf(/*searchElement*/ true); - if (match === -1) { - return defaultValue; - } // make sure exactly 1 matches before returning it - var nextMatch = discriminable.indexOf(/*searchElement*/ true, match + 1); - while (nextMatch !== -1) { - if (!isTypeIdenticalTo(target.types[match], target.types[nextMatch])) { - return defaultValue; - } - nextMatch = discriminable.indexOf(/*searchElement*/ true, nextMatch + 1); - } - return target.types[match]; + return match === -1 || discriminable.indexOf(/*searchElement*/ true, match + 1) !== -1 ? defaultValue : target.types[match]; } /** * A type is 'weak' if it is an object type with at least one optional property @@ -60189,15 +58599,13 @@ var ts; // instantiations of the generic type for type arguments with known relations. The function // returns the emptyArray singleton when invoked recursively for the given generic type. function getVariancesWorker(typeParameters, cache, createMarkerType) { - var _a, _b, _c; if (typeParameters === void 0) { typeParameters = ts.emptyArray; } var variances = cache.variances; if (!variances) { - ts.tracing.push("check" /* Check */, "getVariancesWorker", { arity: typeParameters.length, id: (_c = (_a = cache.id) !== null && _a !== void 0 ? _a : (_b = cache.declaredType) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : -1 }); // The emptyArray singleton is used to signal a recursive invocation. cache.variances = ts.emptyArray; variances = []; - var _loop_19 = function (tp) { + var _loop_18 = function (tp) { var unmeasurable = false; var unreliable = false; var oldHandler = outofbandVarianceMarkerHandler; @@ -60229,10 +58637,9 @@ var ts; }; for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) { var tp = typeParameters_1[_i]; - _loop_19(tp); + _loop_18(tp); } cache.variances = variances; - ts.tracing.pop(); } return variances; } @@ -60363,54 +58770,58 @@ var ts; // has expanded into `[A>>>>>]` // in such cases we need to terminate the expansion, and we do so here. function isDeeplyNestedType(type, stack, depth) { - if (depth >= 5) { - var identity_1 = getRecursionIdentity(type); - if (identity_1) { - var count = 0; - for (var i = 0; i < depth; i++) { - if (getRecursionIdentity(stack[i]) === identity_1) { - count++; - if (count >= 5) { - return true; + // We track all object types that have an associated symbol (representing the origin of the type) + if (depth >= 5 && type.flags & 524288 /* Object */) { + if (!isObjectOrArrayLiteralType(type)) { + var symbol = type.symbol; + if (symbol) { + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (t.flags & 524288 /* Object */ && t.symbol === symbol) { + count++; + if (count >= 5) + return true; } } } } + if (ts.getObjectFlags(type) && 4 /* Reference */ && !!type.node) { + var root = type.target; + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (ts.getObjectFlags(t) && 4 /* Reference */ && !!t.node && t.target === root) { + count++; + if (count >= 5) + return true; + } + } + } + } + if (depth >= 5 && type.flags & 8388608 /* IndexedAccess */) { + var root = getRootObjectTypeFromIndexedAccessChain(type); + var count = 0; + for (var i = 0; i < depth; i++) { + var t = stack[i]; + if (getRootObjectTypeFromIndexedAccessChain(t) === root) { + count++; + if (count >= 5) + return true; + } + } } return false; } - // Types with constituents that could circularly reference the type have a recursion identity. The recursion - // identity is some object that is common to instantiations of the type with the same origin. - function getRecursionIdentity(type) { - if (type.flags & 524288 /* Object */ && !isObjectOrArrayLiteralType(type)) { - if (ts.getObjectFlags(type) && 4 /* Reference */ && type.node) { - // Deferred type references are tracked through their associated AST node. This gives us finer - // granularity than using their associated target because each manifest type reference has a - // unique AST node. - return type.node; - } - if (type.symbol && !(ts.getObjectFlags(type) & 16 /* Anonymous */ && type.symbol.flags & 32 /* Class */)) { - // We track all object types that have an associated symbol (representing the origin of the type), but - // exclude the static side of classes from this check since it shares its symbol with the instance side. - return type.symbol; - } - if (isTupleType(type)) { - // Tuple types are tracked through their target type - return type.target; - } + /** + * Gets the leftmost object type in a chain of indexed accesses, eg, in A[P][Q], returns A + */ + function getRootObjectTypeFromIndexedAccessChain(type) { + var t = type; + while (t.flags & 8388608 /* IndexedAccess */) { + t = t.objectType; } - if (type.flags & 8388608 /* IndexedAccess */) { - // Identity is the leftmost object type in a chain of indexed accesses, eg, in A[P][Q] it is A - do { - type = type.objectType; - } while (type.flags & 8388608 /* IndexedAccess */); - return type; - } - if (type.flags & 16777216 /* Conditional */) { - // The root object represents the origin of the conditional type - return type.root; - } - return undefined; + return t; } function isPropertyIdenticalTo(sourceProp, targetProp) { return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0 /* False */; @@ -60533,8 +58944,8 @@ var ts; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var t = types_13[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -60708,8 +59119,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var t = types_14[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var t = types_13[_i]; result |= getFalsyFlags(t); } return result; @@ -60739,7 +59150,7 @@ var ts; type.flags & 64 /* BigInt */ ? zeroBigIntType : type === regularFalseType || type === falseType || - type.flags & (16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */ | 3 /* AnyOrUnknown */) || + type.flags & (16384 /* Void */ | 32768 /* Undefined */ | 65536 /* Null */) || type.flags & 128 /* StringLiteral */ && type.value === "" || type.flags & 256 /* NumberLiteral */ && type.value === 0 || type.flags & 2048 /* BigIntLiteral */ && isZeroBigInt(type) ? type : @@ -61042,12 +59453,12 @@ var ts; } var diagnostic; switch (declaration.kind) { - case 216 /* BinaryExpression */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 213 /* BinaryExpression */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: diagnostic = noImplicitAny ? ts.Diagnostics.Member_0_implicitly_has_an_1_type : ts.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 160 /* Parameter */: + case 159 /* Parameter */: var param = declaration; if (ts.isIdentifier(param.name) && (ts.isCallSignatureDeclaration(param.parent) || ts.isMethodSignature(param.parent) || ts.isFunctionTypeNode(param.parent)) && @@ -61062,23 +59473,23 @@ var ts; noImplicitAny ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; break; - case 198 /* BindingElement */: + case 195 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; if (!noImplicitAny) { // Don't issue a suggestion for binding elements since the codefix doesn't yet support them. return; } break; - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: error(declaration, ts.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; - case 251 /* FunctionDeclaration */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 248 /* FunctionDeclaration */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: if (noImplicitAny && !declaration.name) { if (wideningKind === 3 /* GeneratorYield */) { error(declaration, ts.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); @@ -61092,7 +59503,7 @@ var ts; wideningKind === 3 /* GeneratorYield */ ? ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 190 /* MappedType */: + case 189 /* MappedType */: if (noImplicitAny) { error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); } @@ -61222,7 +59633,7 @@ var ts; if (objectFlags & 67108864 /* CouldContainTypeVariablesComputed */) { return !!(objectFlags & 134217728 /* CouldContainTypeVariables */); } - var result = !!(type.flags & 465829888 /* Instantiable */ || + var result = !!(type.flags & 63176704 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 131072 /* ObjectRestType */)) || @@ -61234,15 +59645,16 @@ var ts; } function isNonGenericTopLevelType(type) { if (type.aliasSymbol && !type.aliasTypeArguments) { - var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 254 /* TypeAliasDeclaration */); - return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 297 /* SourceFile */ ? true : n.kind === 256 /* ModuleDeclaration */ ? false : "quit"; })); + var declaration = ts.getDeclarationOfKind(type.aliasSymbol, 251 /* TypeAliasDeclaration */); + return !!(declaration && ts.findAncestor(declaration.parent, function (n) { return n.kind === 294 /* SourceFile */ ? true : n.kind === 253 /* ModuleDeclaration */ ? false : "quit"; })); } return false; } function isTypeParameterAtTopLevel(type, typeParameter) { return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && ts.some(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }) || - type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter)); + type.flags & 16777216 /* Conditional */ && (isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type), typeParameter) || + isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type), typeParameter))); } /** Create an object with properties named in the string literal type. Every property has type `any` */ function createEmptyObjectTypeFromStringLiteral(type) { @@ -61289,8 +59701,7 @@ var ts; // arrow function, but is considered partially inferable because property 'a' has an inferable type. function isPartiallyInferableType(type) { return !(ts.getObjectFlags(type) & 2097152 /* NonInferrableType */) || - isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }) || - isTupleType(type) && ts.some(getTypeArguments(type), isPartiallyInferableType); + isObjectLiteralType(type) && ts.some(getPropertiesOfType(type), function (prop) { return isPartiallyInferableType(getTypeOfSymbol(prop)); }); } function createReverseMappedType(source, target, constraint) { // We consider a source type reverse mappable if it has a string index signature or if @@ -61394,73 +59805,17 @@ var ts; function isFromInferenceBlockedSource(type) { return !!(type.symbol && ts.some(type.symbol.declarations, hasSkipDirectInferenceFlag)); } - function isValidBigIntString(s) { - var scanner = ts.createScanner(99 /* ESNext */, /*skipTrivia*/ false); - var success = true; - scanner.setOnError(function () { return success = false; }); - scanner.setText(s + "n"); - var result = scanner.scan(); - if (result === 40 /* MinusToken */) { - result = scanner.scan(); - } - var flags = scanner.getTokenFlags(); - // validate that - // * scanning proceeded without error - // * a bigint can be scanned, and that when it is scanned, it is - // * the full length of the input string (so the scanner is one character beyond the augmented input length) - // * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input) - return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === (s.length + 1) && !(flags & 512 /* ContainsSeparator */); - } - function isStringLiteralTypeValueParsableAsType(s, target) { - if (target.flags & 1048576 /* Union */) { - return !!forEachType(target, function (t) { return isStringLiteralTypeValueParsableAsType(s, t); }); - } - switch (target) { - case stringType: return true; - case numberType: return s.value !== "" && isFinite(+(s.value)); - case bigintType: return s.value !== "" && isValidBigIntString(s.value); - // the next 4 should be handled in `getTemplateLiteralType`, as they are all exactly one value, but are here for completeness, just in case - // this function is ever used on types which don't come from template literal holes - case trueType: return s.value === "true"; - case falseType: return s.value === "false"; - case undefinedType: return s.value === "undefined"; - case nullType: return s.value === "null"; - default: return !!(target.flags & 1 /* Any */); - } - } - function inferLiteralsFromTemplateLiteralType(source, target) { - var value = source.value; - var texts = target.texts; - var lastIndex = texts.length - 1; - var startText = texts[0]; - var endText = texts[lastIndex]; - if (!(value.startsWith(startText) && value.slice(startText.length).endsWith(endText))) - return undefined; - var matches = []; - var str = value.slice(startText.length, value.length - endText.length); - var pos = 0; - for (var i = 1; i < lastIndex; i++) { - var delim = texts[i]; - var delimPos = delim.length > 0 ? str.indexOf(delim, pos) : pos < str.length ? pos + 1 : -1; - if (delimPos < 0) - return undefined; - matches.push(getLiteralType(str.slice(pos, delimPos))); - pos = delimPos + delim.length; - } - matches.push(getLiteralType(str.slice(pos))); - return matches; - } function inferTypes(inferences, originalSource, originalTarget, priority, contravariant) { if (priority === void 0) { priority = 0; } if (contravariant === void 0) { contravariant = false; } + var symbolOrTypeStack; + var visited; var bivariant = false; var propagationType; var inferencePriority = 1024 /* MaxValue */; var allowComplexConstraintInference = true; - var visited; - var sourceStack; - var targetStack; - var expandingFlags = 0 /* None */; + var objectTypeComparisonDepth = 0; + var targetStack = []; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { if (!couldContainTypeVariables(target)) { @@ -61588,7 +59943,7 @@ var ts; var indexType = getSimplifiedType(target.indexType, /*writing*/ false); // Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider // that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can. - if (indexType.flags & 465829888 /* Instantiable */) { + if (indexType.flags & 63176704 /* Instantiable */) { var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false); if (simplified_1 && simplified_1 !== target) { invokeOnce(source, simplified_1, inferFromTypes); @@ -61617,13 +59972,18 @@ var ts; inferFromTypes(source.objectType, target.objectType); inferFromTypes(source.indexType, target.indexType); } - else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) { - if (source.symbol === target.symbol) { - inferFromTypes(source.type, target.type); - } + else if (source.flags & 16777216 /* Conditional */ && target.flags & 16777216 /* Conditional */) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); + inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } else if (target.flags & 16777216 /* Conditional */) { - invokeOnce(source, target, inferToConditionalType); + var savePriority = priority; + priority |= contravariant ? 32 /* ContravariantConditional */ : 0; + var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; + inferToMultipleTypes(source, targetTypes, target.flags); + priority = savePriority; } else if (target.flags & 3145728 /* UnionOrIntersection */) { inferToMultipleTypes(source, target.types, target.flags); @@ -61636,12 +59996,9 @@ var ts; inferFromTypes(sourceType, target); } } - else if (target.flags & 134217728 /* TemplateLiteral */) { - inferToTemplateLiteralType(source, target); - } else { source = getReducedType(source); - if (!(priority & 256 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) { + if (!(priority & 256 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 63176704 /* Instantiable */))) { var apparentSource = getApparentType(source); // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` @@ -61686,30 +60043,7 @@ var ts; (visited || (visited = new ts.Map())).set(key, -1 /* Circularity */); var saveInferencePriority = inferencePriority; inferencePriority = 1024 /* MaxValue */; - // We stop inferring and report a circularity if we encounter duplicate recursion identities on both - // the source side and the target side. - var saveExpandingFlags = expandingFlags; - var sourceIdentity = getRecursionIdentity(source) || source; - var targetIdentity = getRecursionIdentity(target) || target; - if (sourceIdentity && ts.contains(sourceStack, sourceIdentity)) - expandingFlags |= 1 /* Source */; - if (targetIdentity && ts.contains(targetStack, targetIdentity)) - expandingFlags |= 2 /* Target */; - if (expandingFlags !== 3 /* Both */) { - if (sourceIdentity) - (sourceStack || (sourceStack = [])).push(sourceIdentity); - if (targetIdentity) - (targetStack || (targetStack = [])).push(targetIdentity); - action(source, target); - if (targetIdentity) - targetStack.pop(); - if (sourceIdentity) - sourceStack.pop(); - } - else { - inferencePriority = -1 /* Circularity */; - } - expandingFlags = saveExpandingFlags; + action(source, target); visited.set(key, inferencePriority); inferencePriority = Math.min(inferencePriority, saveInferencePriority); } @@ -61766,8 +60100,8 @@ var ts; } function getSingleTypeVariableFromIntersectionTypes(types) { var typeVariable; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var type = types_15[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var type = types_14[_i]; var t = type.flags & 2097152 /* Intersection */ && ts.find(type.types, function (t) { return !!getInferenceInfoForType(t); }); if (!t || typeVariable && t !== typeVariable) { return undefined; @@ -61905,31 +60239,40 @@ var ts; } return false; } - function inferToConditionalType(source, target) { - if (source.flags & 16777216 /* Conditional */) { - inferFromTypes(source.checkType, target.checkType); - inferFromTypes(source.extendsType, target.extendsType); - inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); - inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); + function inferFromObjectTypes(source, target) { + // If we are already processing another target type with the same associated symbol (such as + // an instantiation of the same generic type), we do not explore this target as it would yield + // no further inferences. We exclude the static side of classes from this check since it shares + // its symbol with the instance side which would lead to false positives. + var isNonConstructorObject = target.flags & 524288 /* Object */ && + !(ts.getObjectFlags(target) & 16 /* Anonymous */ && target.symbol && target.symbol.flags & 32 /* Class */); + var symbolOrType = ts.getObjectFlags(target) & 4 /* Reference */ && target.node ? getNormalizedType(target, /*writing*/ false) : isNonConstructorObject ? isTupleType(target) ? target.target : target.symbol : undefined; + if (symbolOrType) { + if (ts.contains(symbolOrTypeStack, symbolOrType)) { + if (ts.getObjectFlags(target) & 4 /* Reference */ && target.node) { + // Don't set the circularity flag for re-encountered recursive type references just because we're already exploring them + return; + } + inferencePriority = -1 /* Circularity */; + return; + } + targetStack[objectTypeComparisonDepth] = target; + objectTypeComparisonDepth++; + if (isDeeplyNestedType(target, targetStack, objectTypeComparisonDepth)) { + inferencePriority = -1 /* Circularity */; + objectTypeComparisonDepth--; + return; + } + (symbolOrTypeStack || (symbolOrTypeStack = [])).push(symbolOrType); + inferFromObjectTypesWorker(source, target); + symbolOrTypeStack.pop(); + objectTypeComparisonDepth--; } else { - var savePriority = priority; - priority |= contravariant ? 32 /* ContravariantConditional */ : 0; - var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; - inferToMultipleTypes(source, targetTypes, target.flags); - priority = savePriority; + inferFromObjectTypesWorker(source, target); } } - function inferToTemplateLiteralType(source, target) { - var matches = source.flags & 128 /* StringLiteral */ ? inferLiteralsFromTemplateLiteralType(source, target) : - source.flags & 134217728 /* TemplateLiteral */ && ts.arraysEqual(source.texts, target.texts) ? source.types : - undefined; - var types = target.types; - for (var i = 0; i < types.length; i++) { - inferFromTypes(matches ? matches[i] : neverType, types[i]); - } - } - function inferFromObjectTypes(source, target) { + function inferFromObjectTypesWorker(source, target) { if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) { // If source and target are references to the same generic type, infer from type arguments inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target)); @@ -61940,12 +60283,8 @@ var ts; // from S to T and from X to Y. inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target)); inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); - var sourceNameType = getNameTypeFromMappedType(source); - var targetNameType = getNameTypeFromMappedType(target); - if (sourceNameType && targetNameType) - inferFromTypes(sourceNameType, targetNameType); } - if (ts.getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) { + if (ts.getObjectFlags(target) & 32 /* Mapped */) { var constraintType = getConstraintTypeFromMappedType(target); if (inferToMappedType(source, target, constraintType)) { return; @@ -62053,7 +60392,7 @@ var ts; var saveBivariant = bivariant; var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; // Once we descend into a bivariant signature we remain bivariant for all nested inferences - bivariant = bivariant || kind === 165 /* MethodDeclaration */ || kind === 164 /* MethodSignature */ || kind === 166 /* Constructor */; + bivariant = bivariant || kind === 164 /* MethodDeclaration */ || kind === 163 /* MethodSignature */ || kind === 165 /* Constructor */; applyToParameterTypes(source, target, inferFromContravariantTypes); bivariant = saveBivariant; } @@ -62088,7 +60427,7 @@ var ts; } function hasPrimitiveConstraint(type) { var constraint = getConstraintOfTypeParameter(type); - return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 131068 /* Primitive */ | 4194304 /* Index */); } function isObjectLiteralType(type) { return !!(ts.getObjectFlags(type) & 128 /* ObjectLiteral */); @@ -62197,22 +60536,22 @@ var ts; return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom; case "$": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery; case "describe": case "suite": case "it": case "test": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashjest_or_npm_i_types_Slashmocha; case "process": case "require": case "Buffer": case "module": return compilerOptions.types - ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig - : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode; + ? ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig + : ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode; case "Map": case "Set": case "Promise": @@ -62221,19 +60560,9 @@ var ts; case "WeakSet": case "Iterator": case "AsyncIterator": - case "SharedArrayBuffer": - case "Atomics": - case "AsyncIterable": - case "AsyncIterableIterator": - case "AsyncGenerator": - case "AsyncGeneratorFunction": - case "BigInt": - case "Reflect": - case "BigInt64Array": - case "BigUint64Array": - return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later; + return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later; default: - if (node.parent.kind === 289 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 286 /* ShorthandPropertyAssignment */) { return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; } else { @@ -62254,7 +60583,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 176 /* TypeQuery */ ? true : n.kind === 78 /* Identifier */ || n.kind === 157 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 175 /* TypeQuery */ ? true : n.kind === 78 /* Identifier */ || n.kind === 156 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -62269,11 +60598,11 @@ var ts; return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; case 107 /* ThisKeyword */: return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType); - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var propName = getAccessedPropertyName(node); if (propName !== undefined) { var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); @@ -62284,28 +60613,26 @@ var ts; } function isMatchingReference(source, target) { switch (target.kind) { - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: return isMatchingReference(source, target.expression); - case 216 /* BinaryExpression */: - return (ts.isAssignmentExpression(target) && isMatchingReference(source, target.left)) || - (ts.isBinaryExpression(target) && target.operatorToken.kind === 27 /* CommaToken */ && isMatchingReference(source, target.right)); + case 213 /* BinaryExpression */: + return ts.isAssignmentExpression(target) && isMatchingReference(source, target.left); } switch (source.kind) { case 78 /* Identifier */: - case 79 /* PrivateIdentifier */: return target.kind === 78 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 249 /* VariableDeclaration */ || target.kind === 198 /* BindingElement */) && + (target.kind === 246 /* VariableDeclaration */ || target.kind === 195 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 107 /* ThisKeyword */: return target.kind === 107 /* ThisKeyword */; case 105 /* SuperKeyword */: return target.kind === 105 /* SuperKeyword */; - case 225 /* NonNullExpression */: - case 207 /* ParenthesizedExpression */: + case 222 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return isMatchingReference(source.expression, target); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return ts.isAccessExpression(target) && getAccessedPropertyName(source) === getAccessedPropertyName(target) && isMatchingReference(source.expression, target.expression); @@ -62315,11 +60642,11 @@ var ts; // Given a source x, check if target matches x or is an && operation with an operand that matches x. function containsTruthyCheck(source, target) { return isMatchingReference(source, target) || - (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && + (target.kind === 213 /* BinaryExpression */ && target.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (containsTruthyCheck(source, target.left) || containsTruthyCheck(source, target.right))); } function getAccessedPropertyName(access) { - return access.kind === 201 /* PropertyAccessExpression */ ? access.name.escapedText : + return access.kind === 198 /* PropertyAccessExpression */ ? access.name.escapedText : ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) : undefined; } @@ -62348,7 +60675,7 @@ var ts; if (prop.isDiscriminantProperty === undefined) { prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && - !maybeTypeOfKind(getTypeOfSymbol(prop), 465829888 /* Instantiable */); + !maybeTypeOfKind(getTypeOfSymbol(prop), 63176704 /* Instantiable */); } return !!prop.isDiscriminantProperty; } @@ -62381,7 +60708,7 @@ var ts; } } } - if (callExpression.expression.kind === 201 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 198 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -62430,8 +60757,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0 /* None */; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var t = types_16[_i]; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var t = types_15[_i]; result |= getTypeFacts(t); } return result; @@ -62502,7 +60829,7 @@ var ts; if (flags & 131072 /* Never */) { return 0 /* None */; } - if (flags & 465829888 /* Instantiable */) { + if (flags & 63176704 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || unknownType); } if (flags & 3145728 /* UnionOrIntersection */) { @@ -62526,35 +60853,28 @@ var ts; return errorType; var text = getPropertyNameFromType(nameType); return getConstraintForLocation(getTypeOfPropertyOfType(type, text), name) || - isNumericLiteralName(text) && includeUndefinedInIndexSignature(getIndexTypeOfType(type, 1 /* Number */)) || - includeUndefinedInIndexSignature(getIndexTypeOfType(type, 0 /* String */)) || + isNumericLiteralName(text) && getIndexTypeOfType(type, 1 /* Number */) || + getIndexTypeOfType(type, 0 /* String */) || errorType; } function getTypeOfDestructuredArrayElement(type, index) { return everyType(type, isTupleLikeType) && getTupleElementType(type, index) || - includeUndefinedInIndexSignature(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined)) || + checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType; } - function includeUndefinedInIndexSignature(type) { - if (!type) - return type; - return compilerOptions.noUncheckedIndexedAccess ? - getUnionType([type, undefinedType]) : - type; - } function getTypeOfDestructuredSpreadExpression(type) { return createArrayType(checkIteratedTypeOrElementType(65 /* Destructuring */, type, undefinedType, /*errorNode*/ undefined) || errorType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 199 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 288 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 196 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 285 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 216 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 239 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 213 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 236 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -62571,21 +60891,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return stringType; - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return checkRightHandSideOfForOf(parent) || errorType; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return undefinedType; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return errorType; @@ -62593,7 +60913,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 196 /* ObjectBindingPattern */ ? + var type = pattern.kind === 193 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -62611,30 +60931,30 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 238 /* ForInStatement */) { + if (node.parent.parent.kind === 235 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 239 /* ForOfStatement */) { + if (node.parent.parent.kind === 236 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent) || errorType; } return errorType; } function getInitialType(node) { - return node.kind === 249 /* VariableDeclaration */ ? + return node.kind === 246 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function isEmptyArrayAssignment(node) { - return node.kind === 249 /* VariableDeclaration */ && node.initializer && + return node.kind === 246 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 198 /* BindingElement */ && node.parent.kind === 216 /* BinaryExpression */ && + node.kind !== 195 /* BindingElement */ && node.parent.kind === 213 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: switch (node.operatorToken.kind) { case 62 /* EqualsToken */: case 74 /* BarBarEqualsToken */: @@ -62649,13 +60969,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 207 /* ParenthesizedExpression */ || - parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || - parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? + return parent.kind === 204 /* ParenthesizedExpression */ || + parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */ && parent.left === node || + parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 27 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); } return neverType; @@ -62675,7 +60995,7 @@ var ts; var witnesses = []; for (var _i = 0, _a = switchStatement.caseBlock.clauses; _i < _a.length; _i++) { var clause = _a[_i]; - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { if (ts.isStringLiteralLike(clause.expression)) { witnesses.push(clause.expression.text); continue; @@ -62812,8 +61132,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { - var t = types_17[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var t = types_16[_i]; if (!(t.flags & 131072 /* Never */)) { if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) { return false; @@ -62837,12 +61157,12 @@ var ts; var root = getReferenceRoot(node); var parent = root.parent; var isLengthPushOrUnshift = ts.isPropertyAccessExpression(parent) && (parent.name.escapedText === "length" || - parent.parent.kind === 203 /* CallExpression */ + parent.parent.kind === 200 /* CallExpression */ && ts.isIdentifier(parent.name) && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 202 /* ElementAccessExpression */ && + var isElementAssignment = parent.kind === 199 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 216 /* BinaryExpression */ && + parent.parent.kind === 213 /* BinaryExpression */ && parent.parent.operatorToken.kind === 62 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -62850,8 +61170,8 @@ var ts; return isLengthPushOrUnshift || isElementAssignment; } function isDeclarationWithExplicitTypeAnnotation(declaration) { - return (declaration.kind === 249 /* VariableDeclaration */ || declaration.kind === 160 /* Parameter */ || - declaration.kind === 163 /* PropertyDeclaration */ || declaration.kind === 162 /* PropertySignature */) && + return (declaration.kind === 246 /* VariableDeclaration */ || declaration.kind === 159 /* Parameter */ || + declaration.kind === 162 /* PropertyDeclaration */ || declaration.kind === 161 /* PropertySignature */) && !!ts.getEffectiveTypeAnnotationNode(declaration); } function getExplicitTypeOfSymbol(symbol, diagnostic) { @@ -62859,18 +61179,12 @@ var ts; return getTypeOfSymbol(symbol); } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { - if (ts.getCheckFlags(symbol) & 262144 /* Mapped */) { - var origin = symbol.syntheticOrigin; - if (origin && getExplicitTypeOfSymbol(origin)) { - return getTypeOfSymbol(symbol); - } - } var declaration = symbol.valueDeclaration; if (declaration) { if (isDeclarationWithExplicitTypeAnnotation(declaration)) { return getTypeOfSymbol(symbol); } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 239 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 236 /* ForOfStatement */) { var statement = declaration.parent.parent; var expressionType = getTypeOfDottedName(statement.expression, /*diagnostic*/ undefined); if (expressionType) { @@ -62898,11 +61212,11 @@ var ts; return getExplicitThisType(node); case 105 /* SuperKeyword */: return checkSuperExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: var type = getTypeOfDottedName(node.expression, diagnostic); var prop = type && getPropertyOfType(type, node.name.escapedText); return prop && getExplicitTypeOfSymbol(prop, diagnostic); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return getTypeOfDottedName(node.expression, diagnostic); } } @@ -62916,7 +61230,7 @@ var ts; // circularities in control flow analysis, we use getTypeOfDottedName when resolving the call // target expression of an assertion. var funcType = void 0; - if (node.parent.kind === 233 /* ExpressionStatement */) { + if (node.parent.kind === 230 /* ExpressionStatement */) { funcType = getTypeOfDottedName(node.expression, /*diagnostic*/ undefined); } else if (node.expression.kind !== 105 /* SuperKeyword */) { @@ -62960,7 +61274,7 @@ var ts; } function isFalseExpression(expr) { var node = ts.skipParentheses(expr); - return node.kind === 94 /* FalseKeyword */ || node.kind === 216 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || + return node.kind === 94 /* FalseKeyword */ || node.kind === 213 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 /* BarBarToken */ && isFalseExpression(node.left) && isFalseExpression(node.right)); } function isReachableFlowNodeWorker(flow, noCacheCheck) { @@ -63079,7 +61393,7 @@ var ts; if (flowAnalysisDisabled) { return errorType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 536624127 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 133970943 /* Narrowable */)) { return declaredType; } flowInvocationCount++; @@ -63091,7 +61405,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); - if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 225 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 222 /* NonNullExpression */ && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) { return declaredType; } return resultType; @@ -63106,13 +61420,11 @@ var ts; if (flowDepth === 2000) { // We have made 2000 recursive invocations. To avoid overflowing the call stack we report an error // and disable further control flow analysis in the containing function or module body. - ts.tracing.instant("check" /* Check */, "getTypeAtFlowNode_DepthLimit", { flowId: flow.id }); flowAnalysisDisabled = true; reportFlowControlError(reference); return errorType; } flowDepth++; - var sharedFlow; while (true) { var flags = flow.flags; if (flags & 4096 /* Shared */) { @@ -63125,7 +61437,6 @@ var ts; return sharedFlowTypes[i]; } } - sharedFlow = flow; } var type = void 0; if (flags & 16 /* Assignment */) { @@ -63175,8 +61486,8 @@ var ts; // Check if we should continue with the control flow of the containing function. var container = flow.node; if (container && container !== flowContainer && - reference.kind !== 201 /* PropertyAccessExpression */ && - reference.kind !== 202 /* ElementAccessExpression */ && + reference.kind !== 198 /* PropertyAccessExpression */ && + reference.kind !== 199 /* ElementAccessExpression */ && reference.kind !== 107 /* ThisKeyword */) { flow = container.flowNode; continue; @@ -63189,9 +61500,9 @@ var ts; // simply return the non-auto declared type to reduce follow-on errors. type = convertAutoToAny(declaredType); } - if (sharedFlow) { + if (flags & 4096 /* Shared */) { // Record visited node and the associated type in the cache. - sharedFlowNodes[sharedFlowCount] = sharedFlow; + sharedFlowNodes[sharedFlowCount] = flow; sharedFlowTypes[sharedFlowCount] = type; sharedFlowCount++; } @@ -63201,7 +61512,7 @@ var ts; } function getInitialOrAssignedType(flow) { var node = flow.node; - return getConstraintForLocation(node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */ ? + return getConstraintForLocation(node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */ ? getInitialType(node) : getAssignedType(node), reference); } @@ -63241,14 +61552,14 @@ var ts; // in which case we continue control flow analysis back to the function's declaration if (ts.isVariableDeclaration(node) && (ts.isInJSFile(node) || ts.isVarConst(node))) { var init = ts.getDeclaredExpandoInitializer(node); - if (init && (init.kind === 208 /* FunctionExpression */ || init.kind === 209 /* ArrowFunction */)) { + if (init && (init.kind === 205 /* FunctionExpression */ || init.kind === 206 /* ArrowFunction */)) { return getTypeAtFlowNode(flow.antecedent); } } return declaredType; } // for (const _ in ref) acts as a nonnull on ref - if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 238 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { + if (ts.isVariableDeclaration(node) && node.parent.parent.kind === 235 /* ForInStatement */ && isMatchingReference(reference, node.parent.parent.expression)) { return getNonNullableTypeIfNeeded(getTypeFromFlowType(getTypeAtFlowNode(flow.antecedent))); } // Assignment doesn't affect reference @@ -63259,7 +61570,7 @@ var ts; if (node.kind === 94 /* FalseKeyword */) { return unreachableNeverType; } - if (node.kind === 216 /* BinaryExpression */) { + if (node.kind === 213 /* BinaryExpression */) { if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */) { return narrowTypeByAssertion(narrowTypeByAssertion(type, node.left), node.right); } @@ -63290,7 +61601,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 203 /* CallExpression */ ? + var expr = node.kind === 200 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -63298,7 +61609,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -63346,7 +61657,7 @@ var ts; if (isMatchingReference(reference, expr)) { type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } - else if (expr.kind === 211 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { + else if (expr.kind === 208 /* TypeOfExpression */ && isMatchingReference(reference, expr.expression)) { type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd); } else { @@ -63354,7 +61665,7 @@ var ts; if (optionalChainContainsReference(expr, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & (32768 /* Undefined */ | 131072 /* Never */)); }); } - else if (expr.kind === 211 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { + else if (expr.kind === 208 /* TypeOfExpression */ && optionalChainContainsReference(expr.expression, reference)) { type = narrowTypeBySwitchOptionalChainContainment(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd, function (t) { return !(t.flags & 131072 /* Never */ || t.flags & 128 /* StringLiteral */ && t.value === "undefined"); }); } } @@ -63572,10 +61883,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { + if (left_1.kind === 208 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 211 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { + if (right_1.kind === 208 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -63695,7 +62006,7 @@ var ts; if (assumeTrue && type.flags & 2 /* Unknown */ && literal.text === "object") { // The pattern x && typeof x === 'object', where x is of type unknown, narrows x to type object. We don't // need to check for the reverse typeof x === 'object' && x since that already narrows correctly. - if (typeOfExpr.parent.parent.kind === 216 /* BinaryExpression */) { + if (typeOfExpr.parent.parent.kind === 213 /* BinaryExpression */) { var expr = typeOfExpr.parent.parent; if (expr.operatorToken.kind === 55 /* AmpersandAmpersandToken */ && expr.right === typeOfExpr.parent && containsTruthyCheck(reference, expr.left)) { return nonPrimitiveType; @@ -63778,7 +62089,7 @@ var ts; if (isTypeSubtypeOf(candidate, type)) { return candidate; } - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(candidate, constraint)) { return getIntersectionType([type, candidate]); @@ -63943,10 +62254,15 @@ var ts; return assignableType; } } - // If the candidate type is a subtype of the target type, narrow to the candidate type, - // if the target type is a subtype of the candidate type, narrow to the target type, - // otherwise, narrow to an intersection of the two types. - return isTypeSubtypeOf(candidate, type) ? candidate : isTypeSubtypeOf(type, candidate) ? type : getIntersectionType([type, candidate]); + // If the candidate type is a subtype of the target type, narrow to the candidate type. + // Otherwise, if the target type is assignable to the candidate type, keep the target type. + // Otherwise, if the candidate type is assignable to the target type, narrow to the candidate + // type. Otherwise, the types are completely unrelated, so narrow to an intersection of the + // two types. + return isTypeSubtypeOf(candidate, type) ? candidate : + isTypeAssignableTo(type, candidate) ? type : + isTypeAssignableTo(candidate, type) ? candidate : + getIntersectionType([type, candidate]); } function narrowTypeByCallExpression(type, callExpression, assumeTrue) { if (hasMatchingArgument(callExpression, reference)) { @@ -63989,17 +62305,16 @@ var ts; case 78 /* Identifier */: case 107 /* ThisKeyword */: case 105 /* SuperKeyword */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return narrowTypeByCallExpression(type, expr, assumeTrue); - case 207 /* ParenthesizedExpression */: - case 225 /* NonNullExpression */: + case 204 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: if (expr.operator === 53 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -64044,9 +62359,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 257 /* ModuleBlock */ || - node.kind === 297 /* SourceFile */ || - node.kind === 163 /* PropertyDeclaration */; + node.kind === 254 /* ModuleBlock */ || + node.kind === 294 /* SourceFile */ || + node.kind === 162 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -64068,7 +62383,7 @@ var ts; if (node.kind === 78 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 160 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 159 /* Parameter */) { symbol.isAssigned = true; } } @@ -64084,7 +62399,7 @@ var ts; function removeOptionalityFromDeclaredType(declaredType, declaration) { if (pushTypeResolution(declaration.symbol, 2 /* DeclaredType */)) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 160 /* Parameter */ && + declaration.kind === 159 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 32768 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 32768 /* Undefined */); @@ -64098,10 +62413,10 @@ var ts; } function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 201 /* PropertyAccessExpression */ || - parent.kind === 203 /* CallExpression */ && parent.expression === node || - parent.kind === 202 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 198 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 198 /* PropertyAccessExpression */ || + parent.kind === 200 /* CallExpression */ && parent.expression === node || + parent.kind === 199 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 195 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { return type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 98304 /* Nullable */); @@ -64143,7 +62458,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 209 /* ArrowFunction */) { + if (container.kind === 206 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasSyntacticModifier(container, 256 /* Async */)) { @@ -64159,16 +62474,16 @@ var ts; markAliasReferenced(symbol, node); } var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - var sourceSymbol = localOrExportSymbol.flags & 2097152 /* Alias */ ? resolveAlias(localOrExportSymbol) : localOrExportSymbol; - if (getDeclarationNodeFlagsFromSymbol(sourceSymbol) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node.parent, sourceSymbol)) { - errorOrSuggestion(/* isError */ false, node, ts.Diagnostics._0_is_deprecated, node.escapedText); - } var declaration = localOrExportSymbol.valueDeclaration; + if (declaration && ts.getCombinedNodeFlags(declaration) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node.parent, localOrExportSymbol)) { + errorOrSuggestion(/* isError */ false, node, ts.Diagnostics._0_is_deprecated, node.escapedText); + ; + } if (localOrExportSymbol.flags & 32 /* Class */) { // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 252 /* ClassDeclaration */ + if (declaration.kind === 249 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -64180,14 +62495,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 221 /* ClassExpression */) { + else if (declaration.kind === 218 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); - while (container.kind !== 297 /* SourceFile */) { + while (container.kind !== 294 /* SourceFile */) { if (container.parent === declaration) { - if (container.kind === 163 /* PropertyDeclaration */ && ts.hasSyntacticModifier(container, 32 /* Static */)) { + if (container.kind === 162 /* PropertyDeclaration */ && ts.hasSyntacticModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 16777216 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 33554432 /* ConstructorReferenceInClass */; } @@ -64236,7 +62551,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 160 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 159 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -64245,8 +62560,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 208 /* FunctionExpression */ || - flowContainer.kind === 209 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 205 /* FunctionExpression */ || + flowContainer.kind === 206 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -64255,9 +62570,9 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || - isInTypeQuery(node) || node.parent.kind === 270 /* ExportSpecifier */) || - node.parent.kind === 225 /* NonNullExpression */ || - declaration.kind === 249 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 267 /* ExportSpecifier */) || + node.parent.kind === 222 /* NonNullExpression */ || + declaration.kind === 246 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 8388608 /* Ambient */; var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : @@ -64292,7 +62607,7 @@ var ts; if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || ts.isSourceFile(symbol.valueDeclaration) || - symbol.valueDeclaration.parent.kind === 287 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 284 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -64315,7 +62630,7 @@ var ts; // mark iteration statement as containing block-scoped binding captured in some function var capturesBlockScopeBindingInLoopBody = true; if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 247 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container) { var part = getPartOfForStatementContainingNode(node.parent, container); if (part) { @@ -64336,7 +62651,7 @@ var ts; // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. if (ts.isForStatement(container)) { - var varDeclList = ts.getAncestor(symbol.valueDeclaration, 250 /* VariableDeclarationList */); + var varDeclList = ts.getAncestor(symbol.valueDeclaration, 247 /* VariableDeclarationList */); if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 4194304 /* NeedsLoopOutParameter */; } @@ -64355,7 +62670,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 207 /* ParenthesizedExpression */) { + while (current.parent.kind === 204 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -64363,7 +62678,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 214 /* PrefixUnaryExpression */ || current.parent.kind === 215 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 211 /* PrefixUnaryExpression */ || current.parent.kind === 212 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 45 /* PlusPlusToken */ || expr.operator === 46 /* MinusMinusToken */; } @@ -64376,7 +62691,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 163 /* PropertyDeclaration */ || container.kind === 166 /* Constructor */) { + if (container.kind === 162 /* PropertyDeclaration */ || container.kind === 165 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -64416,37 +62731,37 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var capturedByArrowFunction = false; - if (container.kind === 166 /* Constructor */) { + if (container.kind === 165 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 209 /* ArrowFunction */) { + if (container.kind === 206 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); capturedByArrowFunction = true; } switch (container.kind) { - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 166 /* Constructor */: + case 165 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: if (ts.hasSyntacticModifier(container, 32 /* Static */) && !(compilerOptions.target === 99 /* ESNext */ && compilerOptions.useDefineForClassFields)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -64534,7 +62849,7 @@ var ts; } function getClassNameFromPrototypeMethod(container) { // Check if it's the RHS of a x.prototype.y = function [name]() { .... } - if (container.kind === 208 /* FunctionExpression */ && + if (container.kind === 205 /* FunctionExpression */ && ts.isBinaryExpression(container.parent) && ts.getAssignmentDeclarationKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = container' @@ -64544,16 +62859,16 @@ var ts; .expression; // x } // x.prototype = { method() { } } - else if (container.kind === 165 /* MethodDeclaration */ && - container.parent.kind === 200 /* ObjectLiteralExpression */ && + else if (container.kind === 164 /* MethodDeclaration */ && + container.parent.kind === 197 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent) === 6 /* Prototype */) { return container.parent.parent.left.expression; } // x.prototype = { method: function() { } } - else if (container.kind === 208 /* FunctionExpression */ && - container.parent.kind === 288 /* PropertyAssignment */ && - container.parent.parent.kind === 200 /* ObjectLiteralExpression */ && + else if (container.kind === 205 /* FunctionExpression */ && + container.parent.kind === 285 /* PropertyAssignment */ && + container.parent.parent.kind === 197 /* ObjectLiteralExpression */ && ts.isBinaryExpression(container.parent.parent.parent) && ts.getAssignmentDeclarationKind(container.parent.parent.parent) === 6 /* Prototype */) { return container.parent.parent.parent.left.expression; @@ -64561,7 +62876,7 @@ var ts; // Object.defineProperty(x, "method", { value: function() { } }); // Object.defineProperty(x, "method", { set: (x: () => void) => void }); // Object.defineProperty(x, "method", { get: () => function() { }) }); - else if (container.kind === 208 /* FunctionExpression */ && + else if (container.kind === 205 /* FunctionExpression */ && ts.isPropertyAssignment(container.parent) && ts.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && @@ -64586,7 +62901,7 @@ var ts; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 308 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 304 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -64600,16 +62915,16 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 160 /* Parameter */ && n.parent === constructorDecl; }); + return !!ts.findAncestor(node, function (n) { return ts.isFunctionLikeDeclaration(n) ? "quit" : n.kind === 159 /* Parameter */ && n.parent === constructorDecl; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 203 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 200 /* CallExpression */ && node.parent.expression === node; var immediateContainer = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var container = immediateContainer; var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 209 /* ArrowFunction */) { + while (container && container.kind === 206 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -64622,14 +62937,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 158 /* ComputedPropertyName */; }); - if (current && current.kind === 158 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 157 /* ComputedPropertyName */; }); + if (current && current.kind === 157 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 197 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -64637,7 +62952,7 @@ var ts; } return errorType; } - if (!isCallExpression && immediateContainer.kind === 166 /* Constructor */) { + if (!isCallExpression && immediateContainer.kind === 165 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasSyntacticModifier(container, 32 /* Static */) || isCallExpression) { @@ -64706,7 +63021,7 @@ var ts; // as a call expression cannot be used as the target of a destructuring assignment while a property access can. // // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations. - if (container.kind === 165 /* MethodDeclaration */ && ts.hasSyntacticModifier(container, 256 /* Async */)) { + if (container.kind === 164 /* MethodDeclaration */ && ts.hasSyntacticModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -64720,7 +63035,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 200 /* ObjectLiteralExpression */) { + if (container.parent.kind === 197 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return errorType; @@ -64741,7 +63056,7 @@ var ts; if (!baseClassType) { return errorType; } - if (container.kind === 166 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 165 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return errorType; @@ -64756,7 +63071,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 166 /* Constructor */; + return container.kind === 165 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -64764,21 +63079,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 200 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 197 /* ObjectLiteralExpression */) { if (ts.hasSyntacticModifier(container, 32 /* Static */)) { - return container.kind === 165 /* MethodDeclaration */ || - container.kind === 164 /* MethodSignature */ || - container.kind === 167 /* GetAccessor */ || - container.kind === 168 /* SetAccessor */; + return container.kind === 164 /* MethodDeclaration */ || + container.kind === 163 /* MethodSignature */ || + container.kind === 166 /* GetAccessor */ || + container.kind === 167 /* SetAccessor */; } else { - return container.kind === 165 /* MethodDeclaration */ || - container.kind === 164 /* MethodSignature */ || - container.kind === 167 /* GetAccessor */ || - container.kind === 168 /* SetAccessor */ || - container.kind === 163 /* PropertyDeclaration */ || - container.kind === 162 /* PropertySignature */ || - container.kind === 166 /* Constructor */; + return container.kind === 164 /* MethodDeclaration */ || + container.kind === 163 /* MethodSignature */ || + container.kind === 166 /* GetAccessor */ || + container.kind === 167 /* SetAccessor */ || + container.kind === 162 /* PropertyDeclaration */ || + container.kind === 161 /* PropertySignature */ || + container.kind === 165 /* Constructor */; } } } @@ -64786,10 +63101,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 165 /* MethodDeclaration */ || - func.kind === 167 /* GetAccessor */ || - func.kind === 168 /* SetAccessor */) && func.parent.kind === 200 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 208 /* FunctionExpression */ && func.parent.kind === 288 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 164 /* MethodDeclaration */ || + func.kind === 166 /* GetAccessor */ || + func.kind === 167 /* SetAccessor */) && func.parent.kind === 197 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 205 /* FunctionExpression */ && func.parent.kind === 285 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -64801,7 +63116,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 209 /* ArrowFunction */) { + if (func.kind === 206 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -64828,7 +63143,7 @@ var ts; if (thisType) { return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); } - if (literal.parent.kind !== 288 /* PropertyAssignment */) { + if (literal.parent.kind !== 285 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -64842,7 +63157,7 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = ts.walkUpParenthesizedExpressions(func.parent); - if (parent.kind === 216 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { + if (parent.kind === 213 /* BinaryExpression */ && parent.operatorToken.kind === 62 /* EqualsToken */) { var target = parent.left; if (ts.isAccessExpression(target)) { var expression = target.expression; @@ -64895,41 +63210,25 @@ var ts; return getTypeFromTypeNode(typeNode); } switch (declaration.kind) { - case 160 /* Parameter */: + case 159 /* Parameter */: return getContextuallyTypedParameterType(declaration); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return getContextualTypeForBindingElement(declaration); - case 163 /* PropertyDeclaration */: - if (ts.hasSyntacticModifier(declaration, 32 /* Static */)) { - return getContextualTypeForStaticPropertyDeclaration(declaration); - } - // By default, do nothing and return undefined - only the above cases have context implied by a parent + // By default, do nothing and return undefined - only parameters and binding elements have context implied by a parent } } function getContextualTypeForBindingElement(declaration) { var parent = declaration.parent.parent; var name = declaration.propertyName || declaration.name; var parentType = getContextualTypeForVariableLikeDeclaration(parent) || - parent.kind !== 198 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); - if (!parentType || ts.isBindingPattern(name) || ts.isComputedNonLiteralName(name)) - return undefined; - if (parent.name.kind === 197 /* ArrayBindingPattern */) { - var index = ts.indexOfNode(declaration.parent.elements, declaration); - if (index < 0) - return undefined; - return getContextualTypeForElementExpression(parentType, index); + parent.kind !== 195 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent); + if (parentType && !ts.isBindingPattern(name) && !ts.isComputedNonLiteralName(name)) { + var nameType = getLiteralTypeFromPropertyName(name); + if (isTypeUsableAsPropertyName(nameType)) { + var text = getPropertyNameFromType(nameType); + return getTypeOfPropertyOfType(parentType, text); + } } - var nameType = getLiteralTypeFromPropertyName(name); - if (isTypeUsableAsPropertyName(nameType)) { - var text = getPropertyNameFromType(nameType); - return getTypeOfPropertyOfType(parentType, text); - } - } - function getContextualTypeForStaticPropertyDeclaration(declaration) { - var parentType = ts.isExpression(declaration.parent) && getContextualType(declaration.parent); - if (!parentType) - return undefined; - return getTypeOfPropertyOfContextualType(parentType, getSymbolOfNode(declaration).escapedName); } // In a variable, parameter or property declaration with a type annotation, // the contextual type of an initializer expression is the type of the variable, parameter or property. @@ -65050,7 +63349,7 @@ var ts; return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 205 /* TaggedTemplateExpression */) { + if (template.parent.kind === 202 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -65063,7 +63362,14 @@ var ts; case 75 /* AmpersandAmpersandEqualsToken */: case 74 /* BarBarEqualsToken */: case 76 /* QuestionQuestionEqualsToken */: - return node === right ? getContextualTypeForAssignmentDeclaration(binaryExpression) : undefined; + if (node !== right) { + return undefined; + } + var contextSensitive = getIsContextSensitiveAssignmentOrContextType(binaryExpression); + if (!contextSensitive) { + return undefined; + } + return contextSensitive === true ? getTypeOfExpression(left) : contextSensitive; case 56 /* BarBarToken */: case 60 /* QuestionQuestionToken */: // When an || expression has a contextual type, the operands are contextually typed by that type, except @@ -65083,27 +63389,24 @@ var ts; } // In an assignment expression, the right operand is contextually typed by the type of the left operand. // Don't do this for assignment declarations unless there is a type tag on the assignment, to avoid circularity from checking the right operand. - function getContextualTypeForAssignmentDeclaration(binaryExpression) { + function getIsContextSensitiveAssignmentOrContextType(binaryExpression) { var kind = ts.getAssignmentDeclarationKind(binaryExpression); switch (kind) { case 0 /* None */: - return getTypeOfExpression(binaryExpression.left); + return true; case 5 /* Property */: case 1 /* ExportsProperty */: case 6 /* Prototype */: case 3 /* PrototypeProperty */: - if (isPossiblyAliasedThisProperty(binaryExpression, kind)) { - return getContextualTypeForThisPropertyAssignment(binaryExpression, kind); - } // If `binaryExpression.left` was assigned a symbol, then this is a new declaration; otherwise it is an assignment to an existing declaration. // See `bindStaticPropertyAssignment` in `binder.ts`. - else if (!binaryExpression.left.symbol) { - return getTypeOfExpression(binaryExpression.left); + if (!binaryExpression.left.symbol) { + return true; } else { var decl = binaryExpression.left.symbol.valueDeclaration; if (!decl) { - return undefined; + return false; } var lhs = ts.cast(binaryExpression.left, ts.isAccessExpression); var overallAnnotation = ts.getEffectiveTypeAnnotationNode(decl); @@ -65116,19 +63419,39 @@ var ts; if (parentSymbol) { var annotated = parentSymbol.valueDeclaration && ts.getEffectiveTypeAnnotationNode(parentSymbol.valueDeclaration); if (annotated) { - var nameStr = ts.getElementOrPropertyAccessName(lhs); - if (nameStr !== undefined) { - return getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr); + var nameStr_1 = ts.getElementOrPropertyAccessName(lhs); + if (nameStr_1 !== undefined) { + var type = getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated), nameStr_1); + return type || false; } } - return undefined; + return false; } } - return ts.isInJSFile(decl) ? undefined : getTypeOfExpression(binaryExpression.left); + return !ts.isInJSFile(decl); } case 2 /* ModuleExports */: case 4 /* ThisProperty */: - return getContextualTypeForThisPropertyAssignment(binaryExpression, kind); + if (!binaryExpression.symbol) + return true; + if (binaryExpression.symbol.valueDeclaration) { + var annotated = ts.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); + if (annotated) { + var type = getTypeFromTypeNode(annotated); + if (type) { + return type; + } + } + } + if (kind === 2 /* ModuleExports */) + return false; + var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression); + if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, /*includeArrowFunctions*/ false))) { + return false; + } + var thisType = checkThisExpression(thisAccess.expression); + var nameStr = ts.getElementOrPropertyAccessName(thisAccess); + return nameStr !== undefined && thisType && getTypeOfPropertyOfContextualType(thisType, nameStr) || false; case 7 /* ObjectDefinePropertyValue */: case 8 /* ObjectDefinePropertyExports */: case 9 /* ObjectDefinePrototypeProperty */: @@ -65137,40 +63460,6 @@ var ts; return ts.Debug.assertNever(kind); } } - function isPossiblyAliasedThisProperty(declaration, kind) { - if (kind === void 0) { kind = ts.getAssignmentDeclarationKind(declaration); } - if (kind === 4 /* ThisProperty */) { - return true; - } - if (!ts.isInJSFile(declaration) || kind !== 5 /* Property */ || !ts.isIdentifier(declaration.left.expression)) { - return false; - } - var name = declaration.left.expression.escapedText; - var symbol = resolveName(declaration.left, name, 111551 /* Value */, undefined, undefined, /*isUse*/ true, /*excludeGlobals*/ true); - return ts.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration); - } - function getContextualTypeForThisPropertyAssignment(binaryExpression, kind) { - if (!binaryExpression.symbol) - return getTypeOfExpression(binaryExpression.left); - if (binaryExpression.symbol.valueDeclaration) { - var annotated = ts.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); - if (annotated) { - var type = getTypeFromTypeNode(annotated); - if (type) { - return type; - } - } - } - if (kind === 2 /* ModuleExports */) - return undefined; - var thisAccess = ts.cast(binaryExpression.left, ts.isAccessExpression); - if (!ts.isObjectLiteralMethod(ts.getThisContainer(thisAccess.expression, /*includeArrowFunctions*/ false))) { - return undefined; - } - var thisType = checkThisExpression(thisAccess.expression); - var nameStr = ts.getElementOrPropertyAccessName(thisAccess); - return nameStr !== undefined && getTypeOfPropertyOfContextualType(thisType, nameStr) || undefined; - } function isCircularMappedProperty(symbol) { return !!(ts.getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0); } @@ -65240,8 +63529,7 @@ var ts; // type of T. function getContextualTypeForElementExpression(arrayContextualType, index) { return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) - || mapType(arrayContextualType, function (t) { return getIteratedTypeOrElementType(1 /* Element */, t, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false); }, - /*noReductions*/ true)); + || getIteratedTypeOrElementType(1 /* Element */, arrayContextualType, undefinedType, /*errorNode*/ undefined, /*checkAssignability*/ false)); } // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type. function getContextualTypeForConditionalOperand(node, contextFlags) { @@ -65255,7 +63543,7 @@ var ts; if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) { return undefined; } - var realChildren = ts.getSemanticJsxChildren(node.children); + var realChildren = getSemanticJsxChildren(node.children); var childIndex = realChildren.indexOf(child); var childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName); return childFieldType && (realChildren.length === 1 ? childFieldType : mapType(childFieldType, function (t) { @@ -65303,21 +63591,21 @@ var ts; case 94 /* FalseKeyword */: case 103 /* NullKeyword */: case 78 /* Identifier */: - case 150 /* UndefinedKeyword */: + case 149 /* UndefinedKeyword */: return true; - case 201 /* PropertyAccessExpression */: - case 207 /* ParenthesizedExpression */: + case 198 /* PropertyAccessExpression */: + case 204 /* ParenthesizedExpression */: return isPossiblyDiscriminantValue(node.expression); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return !node.expression || isPossiblyDiscriminantValue(node.expression); } return false; } function discriminateContextualTypeByObjectMembers(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 288 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 285 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return checkExpression(prop.initializer); }, prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } function discriminateContextualTypeByJSXAttributes(node, contextualType) { - return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 280 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); + return discriminateTypeByDiscriminableItems(contextualType, ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 277 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return checkExpression(prop.initializer); }), prop.symbol.escapedName]; }), isTypeAssignableTo, contextualType); } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily // be "pushed" onto a node using the contextualType property. @@ -65342,7 +63630,7 @@ var ts; // If the given contextual type contains instantiable types and if a mapper representing // return type inferences is available, instantiate those types using that mapper. function instantiateContextualType(contextualType, node, contextFlags) { - if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) { + if (contextualType && maybeTypeOfKind(contextualType, 63176704 /* Instantiable */)) { var inferenceContext = getInferenceContext(node); // If no inferences have been made, nothing is gained from instantiating as type parameters // would just be replaced with their defaults similar to the apparent type. @@ -65365,7 +63653,7 @@ var ts; // are classified as instantiable (i.e. it doesn't instantiate object types), and (b) it performs // no reductions on instantiated union types. function instantiateInstantiableTypes(type, mapper) { - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { return instantiateType(type, mapper); } if (type.flags & 1048576 /* Union */) { @@ -65403,58 +63691,58 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 198 /* BindingElement */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 195 /* BindingElement */: return getContextualTypeForInitializerExpression(node, contextFlags); - case 209 /* ArrowFunction */: - case 242 /* ReturnStatement */: + case 206 /* ArrowFunction */: + case 239 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return getContextualTypeForAwaitOperand(parent, contextFlags); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (parent.expression.kind === 99 /* ImportKeyword */) { return stringType; } /* falls through */ - case 204 /* NewExpression */: + case 201 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return ts.isConstTypeReference(parent.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(parent.type); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node, contextFlags); - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent, contextFlags); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent, contextFlags); - case 199 /* ArrayLiteralExpression */: { + case 196 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral, contextFlags); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node, contextFlags); - case 228 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 218 /* TemplateExpression */); + case 225 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 215 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 207 /* ParenthesizedExpression */: { + case 204 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJSFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent, contextFlags); } - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 280 /* JsxAttribute */: - case 282 /* JsxSpreadAttribute */: + case 277 /* JsxAttribute */: + case 279 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent, contextFlags); } return undefined; @@ -65617,7 +63905,7 @@ var ts; return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 208 /* FunctionExpression */ || node.kind === 209 /* ArrowFunction */; + return node.kind === 205 /* FunctionExpression */ || node.kind === 206 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -65631,7 +63919,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var typeTagSignature = getSignatureOfTypeTag(node); if (typeTagSignature) { return typeTagSignature; @@ -65645,8 +63933,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var current = types_18[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var current = types_17[_i]; var signature = getContextualCallSignature(current, node); if (signature) { if (!signatureList) { @@ -65679,8 +63967,8 @@ var ts; return node.isSpread ? getIndexedAccessType(node.type, numberType) : node.type; } function hasDefaultValue(node) { - return (node.kind === 198 /* BindingElement */ && !!node.initializer) || - (node.kind === 216 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); + return (node.kind === 195 /* BindingElement */ && !!node.initializer) || + (node.kind === 213 /* BinaryExpression */ && node.operatorToken.kind === 62 /* EqualsToken */); } function checkArrayLiteral(node, checkMode, forceTuple) { var elements = node.elements; @@ -65692,7 +63980,7 @@ var ts; var inConstContext = isConstContext(node); for (var i = 0; i < elementCount; i++) { var e = elements[i]; - if (e.kind === 220 /* SpreadElement */) { + if (e.kind === 217 /* SpreadElement */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 2048 /* SpreadArrays */); } @@ -65755,7 +64043,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return isNumericComputedName(name); case 78 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -65805,7 +64093,7 @@ var ts; // This will allow types number, string, symbol or any. It will also allow enums, the unknown // type, and any union of these types (like string | number). if (links.resolvedType.flags & 98304 /* Nullable */ || - !isTypeAssignableToKind(links.resolvedType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && + !isTypeAssignableToKind(links.resolvedType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) { error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); } @@ -65851,7 +64139,7 @@ var ts; var spread = emptyObjectType; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 196 /* ObjectBindingPattern */ || contextualType.pattern.kind === 200 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 193 /* ObjectBindingPattern */ || contextualType.pattern.kind === 197 /* ObjectLiteralExpression */); var inConstContext = isConstContext(node); var checkFlags = inConstContext ? 8 /* Readonly */ : 0; var isInJavascript = ts.isInJSFile(node) && !ts.isInJsonFile(node); @@ -65874,16 +64162,16 @@ var ts; for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var memberDecl = _c[_b]; var member = getSymbolOfNode(memberDecl); - var computedNameType = memberDecl.name && memberDecl.name.kind === 158 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? + var computedNameType = memberDecl.name && memberDecl.name.kind === 157 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(memberDecl.name.expression) ? checkComputedPropertyName(memberDecl.name) : undefined; - if (memberDecl.kind === 288 /* PropertyAssignment */ || - memberDecl.kind === 289 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 285 /* PropertyAssignment */ || + memberDecl.kind === 286 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { - var type = memberDecl.kind === 288 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : + var type = memberDecl.kind === 285 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`. // we don't want to say "could not find 'a'". - memberDecl.kind === 289 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : + memberDecl.kind === 286 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode); if (isInJavascript) { var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); @@ -65906,8 +64194,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 288 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 289 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 285 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 286 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -65933,7 +64221,7 @@ var ts; member = prop; allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop); } - else if (memberDecl.kind === 290 /* SpreadAssignment */) { + else if (memberDecl.kind === 287 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } @@ -65962,7 +64250,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 167 /* GetAccessor */ || memberDecl.kind === 168 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 166 /* GetAccessor */ || memberDecl.kind === 167 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (computedNameType && !(computedNameType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) { @@ -65987,7 +64275,7 @@ var ts; // type with those properties for which the binding pattern specifies a default value. // If the object literal is spread into another object literal, skip this step and let the top-level object // literal handle it instead. - if (contextualTypeHasPattern && node.parent.kind !== 290 /* SpreadAssignment */) { + if (contextualTypeHasPattern && node.parent.kind !== 287 /* SpreadAssignment */) { for (var _d = 0, _e = getPropertiesOfType(contextualType); _d < _e.length; _d++) { var prop = _e[_d]; if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) { @@ -66029,7 +64317,7 @@ var ts; } } function isValidSpreadType(type) { - if (type.flags & 465829888 /* Instantiable */) { + if (type.flags & 63176704 /* Instantiable */) { var constraint = getBaseConstraintOfType(type); if (constraint !== undefined) { return isValidSpreadType(constraint); @@ -66041,6 +64329,7 @@ var ts; } function checkJsxSelfClosingElementDeferred(node) { checkJsxOpeningLikeElementOrOpeningFragment(node); + resolveUntypedCall(node); // ensure type arguments and parameters are typechecked, even if there is an arity error } function checkJsxSelfClosingElement(node, _checkMode) { checkNodeDeferred(node); @@ -66067,7 +64356,7 @@ var ts; // by default, jsx:'react' will use jsxFactory = React.createElement and jsxFragmentFactory = React.Fragment // if jsxFactory compiler option is provided, ensure jsxFragmentFactory compiler option or @jsxFrag pragma is provided too var nodeSourceFile = ts.getSourceFileOfNode(node); - if (ts.getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) + if (compilerOptions.jsx === 2 /* React */ && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) && !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) { error(node, compilerOptions.jsxFactory ? ts.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option @@ -66119,7 +64408,7 @@ var ts; if (ts.isJsxAttribute(attributeDecl)) { var exprType = checkJsxAttribute(attributeDecl, checkMode); objectFlags |= ts.getObjectFlags(exprType) & 3670016 /* PropagatingFlags */; - var attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName); + var attributeSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */ | member.flags, member.escapedName); attributeSymbol.declarations = member.declarations; attributeSymbol.parent = member.parent; if (member.valueDeclaration) { @@ -66134,7 +64423,7 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 282 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 279 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, objectFlags, /*readonly*/ false); attributesTable = ts.createSymbolTable(); @@ -66160,7 +64449,7 @@ var ts; } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 273 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 270 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -66174,7 +64463,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(openingLikeElement.attributes); var childrenContextualType = contextualType && getTypeOfPropertyOfContextualType(contextualType, jsxChildrenPropertyName); // If there are children in the body of JSX element, create dummy attribute "children" with the union of children types so that it will pass the attribute checking process - var childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName); + var childrenPropSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */, jsxChildrenPropertyName); childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && forEachType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes)); @@ -66217,9 +64506,6 @@ var ts; childrenTypes.push(stringType); } } - else if (child.kind === 283 /* JsxExpression */ && !child.expression) { - continue; // empty jsx expressions don't *really* count as present children - } else { childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); } @@ -66289,60 +64575,29 @@ var ts; } return links.resolvedSymbol; } - function getJsxNamespaceContainerForImplicitImport(location) { - var file = location && ts.getSourceFileOfNode(location); - var links = file && getNodeLinks(file); - if (links && links.jsxImplicitImportContainer === false) { - return undefined; - } - if (links && links.jsxImplicitImportContainer) { - return links.jsxImplicitImportContainer; - } - var runtimeImportSpecifier = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(compilerOptions, file), compilerOptions); - if (!runtimeImportSpecifier) { - return undefined; - } - var isClassic = ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Classic; - var errorMessage = isClassic - ? ts.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option - : ts.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations; - var mod = resolveExternalModule(location, runtimeImportSpecifier, errorMessage, location); - var result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : undefined; - if (links) { - links.jsxImplicitImportContainer = result || false; - } - return result; - } function getJsxNamespaceAt(location) { var links = location && getNodeLinks(location); if (links && links.jsxNamespace) { return links.jsxNamespace; } if (!links || links.jsxNamespace !== false) { - var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location); - if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { - var namespaceName = getJsxNamespace(location); - resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); - } + var namespaceName = getJsxNamespace(location); + var resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); if (resolvedNamespace) { var candidate = resolveSymbol(getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */)); - if (candidate && candidate !== unknownSymbol) { + if (candidate) { if (links) { links.jsxNamespace = candidate; } return candidate; } - } - if (links) { - links.jsxNamespace = false; + if (links) { + links.jsxNamespace = false; + } } } // JSX global fallback - var s = resolveSymbol(getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined)); - if (s === unknownSymbol) { - return undefined; // TODO: GH#18217 - } - return s; // TODO: GH#18217 + return getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined); // TODO: GH#18217 } /** * Look into JSX namespace and then look for container with matching name as nameOfAttribPropContainer. @@ -66529,25 +64784,23 @@ var ts; checkGrammarJsxElement(node); } checkJsxPreconditions(node); - if (!getJsxNamespaceContainerForImplicitImport(node)) { - // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. - // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. - var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var jsxFactoryNamespace = getJsxNamespace(node); - var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; - // allow null as jsxFragmentFactory - var jsxFactorySym = void 0; - if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { - jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); - } - if (jsxFactorySym) { - // Mark local symbol as referenced here because it might not have been marked - // if jsx emit was not jsxFactory as there wont be error being emitted - jsxFactorySym.isReferenced = 67108863 /* All */; - // If react/jsxFactory symbol is alias, mark it as refereced - if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { - markAliasSymbolAsReferenced(jsxFactorySym); - } + // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. + // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. + var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; + var jsxFactoryNamespace = getJsxNamespace(node); + var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + // allow null as jsxFragmentFactory + var jsxFactorySym; + if (!(ts.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName(jsxFactoryLocation, jsxFactoryNamespace, 111551 /* Value */, jsxFactoryRefErr, jsxFactoryNamespace, /*isUse*/ true); + } + if (jsxFactorySym) { + // Mark local symbol as referenced here because it might not have been marked + // if jsx emit was not jsxFactory as there wont be error being emitted + jsxFactorySym.isReferenced = 67108863 /* All */; + // If react/jsxFactory symbol is alias, mark it as refereced + if (jsxFactorySym.flags & 2097152 /* Alias */ && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); } } if (isNodeOpeningLikeElement) { @@ -66637,7 +64890,7 @@ var ts; */ function checkPropertyAccessibility(node, isSuper, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 157 /* QualifiedName */ ? node.right : node.kind === 195 /* ImportType */ ? node : node.name; + var errorNode = node.kind === 156 /* QualifiedName */ ? node.right : node.kind === 192 /* ImportType */ ? node : node.name; if (isSuper) { // TS 1.0 spec (April 2014): 4.8.2 // - In a constructor, instance member function, instance member accessor, or @@ -66791,7 +65044,7 @@ var ts; return checkPropertyAccessExpressionOrQualifiedName(node, node.left, checkNonNullExpression(node.left), node.right); } function isMethodAccessForCall(node) { - while (node.parent.kind === 207 /* ParenthesizedExpression */) { + while (node.parent.kind === 204 /* ParenthesizedExpression */) { node = node.parent; } return ts.isCallOrNewExpression(node.parent) && node.parent.expression === node; @@ -66849,10 +65102,10 @@ var ts; return false; } function isThisPropertyAccessInConstructor(node, prop) { - return (isConstructorDeclaredProperty(prop) || ts.isThisProperty(node) && isAutoTypedProperty(prop)) - && ts.getThisContainer(node, /*includeArrowFunctions*/ true) === getDeclaringConstructor(prop); + return ts.isThisProperty(node) && (isAutoTypedProperty(prop) || isConstructorDeclaredProperty(prop)) && ts.getThisContainer(node, /*includeArrowFunctions*/ true) === getDeclaringConstructor(prop); } function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right) { + var _a; var parentSymbol = getNodeLinks(left).resolvedSymbol; var assignmentKind = ts.getAssignmentTargetKind(node); var apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType); @@ -66914,10 +65167,10 @@ var ts; if (indexInfo.isReadonly && (ts.isAssignmentTarget(node) || ts.isDeleteTarget(node))) { error(node, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); } - propType = (compilerOptions.noUncheckedIndexedAccess && !ts.isAssignmentTarget(node)) ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type; + propType = indexInfo.type; } else { - if (getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) { + if (((_a = prop.valueDeclaration) === null || _a === void 0 ? void 0 : _a.flags) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) { errorOrSuggestion(/* isError */ false, right, ts.Diagnostics._0_is_deprecated, right.escapedText); } checkPropertyNotUsedBeforeDeclaration(prop, node, right); @@ -66954,7 +65207,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 166 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { + if (flowContainer.kind === 165 /* Constructor */ && flowContainer.parent === declaration.parent && !(declaration.flags & 8388608 /* Ambient */)) { assumeUninitialized = true; } } @@ -66986,8 +65239,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { diagnosticMessage = error(right, ts.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); } - else if (valueDeclaration.kind === 252 /* ClassDeclaration */ && - node.parent.kind !== 173 /* TypeReference */ && + else if (valueDeclaration.kind === 249 /* ClassDeclaration */ && + node.parent.kind !== 172 /* TypeReference */ && !(valueDeclaration.flags & 8388608 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName); @@ -66999,22 +65252,22 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return true; - case 288 /* PropertyAssignment */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 290 /* SpreadAssignment */: - case 158 /* ComputedPropertyName */: - case 228 /* TemplateSpan */: - case 283 /* JsxExpression */: - case 280 /* JsxAttribute */: - case 281 /* JsxAttributes */: - case 282 /* JsxSpreadAttribute */: - case 275 /* JsxOpeningElement */: - case 223 /* ExpressionWithTypeArguments */: - case 286 /* HeritageClause */: + case 285 /* PropertyAssignment */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 287 /* SpreadAssignment */: + case 157 /* ComputedPropertyName */: + case 225 /* TemplateSpan */: + case 280 /* JsxExpression */: + case 277 /* JsxAttribute */: + case 278 /* JsxAttributes */: + case 279 /* JsxSpreadAttribute */: + case 272 /* JsxOpeningElement */: + case 220 /* ExpressionWithTypeArguments */: + case 283 /* HeritageClause */: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -67070,22 +65323,14 @@ var ts; relatedInfo = ts.createDiagnosticForNode(propNode, ts.Diagnostics.Did_you_forget_to_use_await); } else { - var missingProperty = ts.declarationNameToString(propNode); - var container = typeToString(containingType); - var libSuggestion = getSuggestedLibForNonExistentProperty(missingProperty, containingType); - if (libSuggestion !== undefined) { - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later, missingProperty, container, libSuggestion); + var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); + if (suggestion !== undefined) { + var suggestedName = ts.symbolName(suggestion); + errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, ts.declarationNameToString(propNode), typeToString(containingType), suggestedName); + relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName); } else { - var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); - if (suggestion !== undefined) { - var suggestedName = ts.symbolName(suggestion); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, missingProperty, container, suggestedName); - relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName); - } - else { - errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, missingProperty, container); - } + errorInfo = ts.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(propNode), typeToString(containingType)); } } } @@ -67099,34 +65344,6 @@ var ts; var prop = containingType.symbol && getPropertyOfType(getTypeOfSymbol(containingType.symbol), propName); return prop !== undefined && prop.valueDeclaration && ts.hasSyntacticModifier(prop.valueDeclaration, 32 /* Static */); } - function getSuggestedLibForNonExistentName(name) { - var missingName = diagnosticName(name); - var allFeatures = ts.getScriptTargetFeatures(); - var libTargets = ts.getOwnKeys(allFeatures); - for (var _i = 0, libTargets_1 = libTargets; _i < libTargets_1.length; _i++) { - var libTarget = libTargets_1[_i]; - var containingTypes = ts.getOwnKeys(allFeatures[libTarget]); - if (containingTypes !== undefined && ts.contains(containingTypes, missingName)) { - return libTarget; - } - } - } - function getSuggestedLibForNonExistentProperty(missingProperty, containingType) { - var container = getApparentType(containingType).symbol; - if (!container) { - return undefined; - } - var allFeatures = ts.getScriptTargetFeatures(); - var libTargets = ts.getOwnKeys(allFeatures); - for (var _i = 0, libTargets_2 = libTargets; _i < libTargets_2.length; _i++) { - var libTarget = libTargets_2[_i]; - var featuresOfLib = allFeatures[libTarget]; - var featuresOfContainingType = featuresOfLib[ts.symbolName(container)]; - if (featuresOfContainingType !== undefined && ts.contains(featuresOfContainingType, missingProperty)) { - return libTarget; - } - } - } function getSuggestedSymbolForNonexistentProperty(name, containingType) { return getSpellingSuggestionForName(ts.isString(name) ? name : ts.idText(name), getPropertiesOfType(containingType), 111551 /* Value */); } @@ -67247,16 +65464,16 @@ var ts; } function isValidPropertyAccess(node, propertyName) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return isValidPropertyAccessWithType(node, node.expression.kind === 105 /* SuperKeyword */, propertyName, getWidenedType(checkExpression(node.expression))); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getWidenedType(checkExpression(node.left))); - case 195 /* ImportType */: + case 192 /* ImportType */: return isValidPropertyAccessWithType(node, /*isSuper*/ false, propertyName, getTypeFromTypeNode(node)); } } function isValidPropertyAccessForCompletions(node, type, property) { - return isValidPropertyAccessWithType(node, node.kind === 201 /* PropertyAccessExpression */ && node.expression.kind === 105 /* SuperKeyword */, property.escapedName, type); + return isValidPropertyAccessWithType(node, node.kind === 198 /* PropertyAccessExpression */ && node.expression.kind === 105 /* SuperKeyword */, property.escapedName, type); // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context. } function isValidPropertyAccessWithType(node, isSuper, propertyName, type) { @@ -67279,7 +65496,7 @@ var ts; */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 250 /* VariableDeclarationList */) { + if (initializer.kind === 247 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -67308,7 +65525,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 238 /* ForInStatement */ && + if (node.kind === 235 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -67345,7 +65562,7 @@ var ts; var accessFlags = ts.isAssignmentTarget(node) ? 2 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 1 /* NoIndexSignatures */ : 0) : 0 /* None */; - var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, /*noUncheckedIndexedAccessCandidate*/ undefined, node, accessFlags | 16 /* ExpressionPosition */) || errorType; + var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType; return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node); } function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { @@ -67392,13 +65609,13 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { checkExpression(node.template); } else if (ts.isJsxOpeningLikeElement(node)) { checkExpression(node.attributes); } - else if (node.kind !== 161 /* Decorator */) { + else if (node.kind !== 160 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -67462,7 +65679,7 @@ var ts; } } function isSpreadArgument(arg) { - return !!arg && (arg.kind === 220 /* SpreadElement */ || arg.kind === 227 /* SyntheticExpression */ && arg.isSpread); + return !!arg && (arg.kind === 217 /* SpreadElement */ || arg.kind === 224 /* SyntheticExpression */ && arg.isSpread); } function getSpreadArgumentIndex(args) { return ts.findIndex(args, isSpreadArgument); @@ -67470,18 +65687,15 @@ var ts; function acceptsVoid(t) { return !!(t.flags & 16384 /* Void */); } - function acceptsVoidUndefinedUnknownOrAny(t) { - return !!(t.flags & (16384 /* Void */ | 32768 /* Undefined */ | 2 /* Unknown */ | 1 /* Any */)); - } function hasCorrectArity(node, args, signature, signatureHelpTrailingComma) { if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } var argCount; var callIsIncomplete = false; // In incomplete call we want to be lenient when we have too few arguments var effectiveParameterCount = getParameterCount(signature); var effectiveMinimumArguments = getMinArgumentCount(signature); - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { argCount = args.length; - if (node.template.kind === 218 /* TemplateExpression */) { + if (node.template.kind === 215 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. var lastSpan = ts.last(node.template.templateSpans); // we should always have at least one span. @@ -67496,7 +65710,7 @@ var ts; callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 161 /* Decorator */) { + else if (node.kind === 160 /* Decorator */) { argCount = getDecoratorArgumentCount(node, signature); } else if (ts.isJsxOpeningLikeElement(node)) { @@ -67510,7 +65724,7 @@ var ts; } else if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(node.kind === 204 /* NewExpression */); + ts.Debug.assert(node.kind === 201 /* NewExpression */); return getMinArgumentCount(signature) === 0; } else { @@ -67534,7 +65748,7 @@ var ts; } for (var i = argCount; i < effectiveMinimumArguments; i++) { var type = getTypeAtPosition(signature, i); - if (filterType(type, ts.isInJSFile(node) && !strictNullChecks ? acceptsVoidUndefinedUnknownOrAny : acceptsVoid).flags & 131072 /* Never */) { + if (filterType(type, acceptsVoid).flags & 131072 /* Never */) { return false; } } @@ -67604,7 +65818,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 161 /* Decorator */) { + if (node.kind !== 160 /* Decorator */) { var contextualType = getContextualType(node, ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); }) ? 8 /* SkipBindingPatterns */ : 0 /* None */); if (contextualType) { // We clone the inference context to avoid disturbing a resolution in progress for an @@ -67653,7 +65867,7 @@ var ts; } for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 222 /* OmittedExpression */) { + if (arg.kind !== 219 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode); inferTypes(context.inferences, argType, paramType); @@ -67677,7 +65891,7 @@ var ts; if (isSpreadArgument(arg)) { // We are inferring from a spread expression in the last argument position, i.e. both the parameter // and the argument are ...x forms. - return getMutableArrayOrTupleType(arg.kind === 227 /* SyntheticExpression */ ? arg.type : + return getMutableArrayOrTupleType(arg.kind === 224 /* SyntheticExpression */ ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context, checkMode)); } } @@ -67687,24 +65901,24 @@ var ts; for (var i = index; i < argCount; i++) { var arg = args[i]; if (isSpreadArgument(arg)) { - var spreadType = arg.kind === 227 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); + var spreadType = arg.kind === 224 /* SyntheticExpression */ ? arg.type : checkExpression(arg.expression); if (isArrayLikeType(spreadType)) { types.push(spreadType); flags.push(8 /* Variadic */); } else { - types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 220 /* SpreadElement */ ? arg.expression : arg)); + types.push(checkIteratedTypeOrElementType(33 /* Spread */, spreadType, undefinedType, arg.kind === 217 /* SpreadElement */ ? arg.expression : arg)); flags.push(4 /* Rest */); } } else { var contextualType = getIndexedAccessType(restType, getLiteralType(i - index)); var argType = checkExpressionWithContextualType(arg, contextualType, context, checkMode); - var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */); + var hasPrimitiveContextualType = maybeTypeOfKind(contextualType, 131068 /* Primitive */ | 4194304 /* Index */); types.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); flags.push(1 /* Required */); } - if (arg.kind === 227 /* SyntheticExpression */ && arg.tupleNameSource) { + if (arg.kind === 224 /* SyntheticExpression */ && arg.tupleNameSource) { names.push(arg.tupleNameSource); } } @@ -67845,7 +66059,7 @@ var ts; return undefined; } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 204 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 201 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -67875,7 +66089,7 @@ var ts; var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; for (var i = 0; i < argCount; i++) { var arg = args[i]; - if (arg.kind !== 222 /* OmittedExpression */) { + if (arg.kind !== 219 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = checkExpressionWithContextualType(arg, paramType, /*inferenceContext*/ undefined, checkMode); // If one or more arguments are still excluded (as indicated by CheckMode.SkipContextSensitive), @@ -67916,7 +66130,7 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 203 /* CallExpression */) { + if (node.kind === 200 /* CallExpression */) { var callee = ts.skipOuterExpressions(node.expression); if (ts.isAccessExpression(callee)) { return callee.expression; @@ -67933,17 +66147,17 @@ var ts; * Returns the effective arguments for an expression that works like a function invocation. */ function getEffectiveCallArguments(node) { - if (node.kind === 205 /* TaggedTemplateExpression */) { + if (node.kind === 202 /* TaggedTemplateExpression */) { var template = node.template; var args_3 = [createSyntheticExpression(template, getGlobalTemplateStringsArrayType())]; - if (template.kind === 218 /* TemplateExpression */) { + if (template.kind === 215 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_3.push(span.expression); }); } return args_3; } - if (node.kind === 161 /* Decorator */) { + if (node.kind === 160 /* Decorator */) { return getEffectiveDecoratorArguments(node); } if (ts.isJsxOpeningLikeElement(node)) { @@ -67954,10 +66168,10 @@ var ts; if (spreadIndex >= 0) { // Create synthetic arguments from spreads of tuple types. var effectiveArgs_1 = args.slice(0, spreadIndex); - var _loop_20 = function (i) { + var _loop_19 = function (i) { var arg = args[i]; // We can call checkExpressionCached because spread expressions never have a contextual type. - var spreadType = arg.kind === 220 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); + var spreadType = arg.kind === 217 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); if (spreadType && isTupleType(spreadType)) { ts.forEach(getTypeArguments(spreadType), function (t, i) { var _a; @@ -67971,7 +66185,7 @@ var ts; } }; for (var i = spreadIndex; i < args.length; i++) { - _loop_20(i); + _loop_19(i); } return effectiveArgs_1; } @@ -67984,30 +66198,30 @@ var ts; var parent = node.parent; var expr = node.expression; switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class). return [ createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent))) ]; - case 160 /* Parameter */: + case 159 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). var func = parent.parent; return [ - createSyntheticExpression(expr, parent.parent.kind === 166 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, parent.parent.kind === 165 /* Constructor */ ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), createSyntheticExpression(expr, anyType), createSyntheticExpression(expr, numberType) ]; - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts). If we are emitting decorators // for ES3, we will only pass two arguments. - var hasPropDesc = parent.kind !== 163 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; + var hasPropDesc = parent.kind !== 162 /* PropertyDeclaration */ && languageVersion !== 0 /* ES3 */; return [ createSyntheticExpression(expr, getParentTypeOfClassElement(parent)), createSyntheticExpression(expr, getClassElementPropertyKeyType(parent)), @@ -68021,17 +66235,17 @@ var ts; */ function getDecoratorArgumentCount(node, signature) { switch (node.parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return 1; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return 2; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // For ES3 or decorators with only two parameters we supply only two arguments return languageVersion === 0 /* ES3 */ || signature.parameters.length <= 2 ? 2 : 3; - case 160 /* Parameter */: + case 159 /* Parameter */: return 3; default: return ts.Debug.fail(); @@ -68062,20 +66276,6 @@ var ts; return ts.createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); } } - function isPromiseResolveArityError(node) { - if (!ts.isCallExpression(node) || !ts.isIdentifier(node.expression)) - return false; - var symbol = resolveName(node.expression, node.expression.escapedText, 111551 /* Value */, undefined, undefined, false); - var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration; - if (!decl || !ts.isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !ts.isNewExpression(decl.parent.parent) || !ts.isIdentifier(decl.parent.parent.expression)) { - return false; - } - var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(/*reportErrors*/ false); - if (!globalPromiseSymbol) - return false; - var constructorSymbol = getSymbolAtLocation(decl.parent.parent.expression, /*ignoreErrors*/ true); - return constructorSymbol === globalPromiseSymbol; - } function getArgumentArityError(node, signatures, args) { var min = Number.POSITIVE_INFINITY; var max = Number.NEGATIVE_INFINITY; @@ -68107,15 +66307,9 @@ var ts; } var spanArray; var related; - var error = hasRestParameter || hasSpreadArgument ? - hasRestParameter && hasSpreadArgument ? - ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more : - hasRestParameter ? - ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 : - ts.Diagnostics.Expected_0_arguments_but_got_1_or_more : - paramRange === 1 && argCount === 0 && isPromiseResolveArityError(node) ? - ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : - ts.Diagnostics.Expected_0_arguments_but_got_1; + var error = hasRestParameter || hasSpreadArgument ? hasRestParameter && hasSpreadArgument ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1_or_more : + hasRestParameter ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1 : + ts.Diagnostics.Expected_0_arguments_but_got_1_or_more : ts.Diagnostics.Expected_0_arguments_but_got_1; if (closestSignature && getMinArgumentCount(closestSignature) > argCount && closestSignature.declaration) { var paramDecl = closestSignature.declaration.parameters[closestSignature.thisParameter ? argCount + 1 : argCount]; if (paramDecl) { @@ -68178,8 +66372,8 @@ var ts; return ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); } function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { - var isTaggedTemplate = node.kind === 205 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 161 /* Decorator */; + var isTaggedTemplate = node.kind === 202 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 160 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var reportErrors = !candidatesOutArray && produceDiagnostics; var typeArguments; @@ -68241,7 +66435,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 203 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 200 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -68253,10 +66447,10 @@ var ts; // is just important for choosing the best signature. So in the case where there is only one // signature, the subtype pass is useless. So skipping it is an optimization. if (candidates.length > 1) { - result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma); } if (!result) { - result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + result = chooseOverload(candidates, assignableRelation, signatureHelpTrailingComma); } if (result) { return result; @@ -68281,7 +66475,6 @@ var ts; if (last_2.declaration && candidatesForArgumentError.length > 3) { ts.addRelatedInfo(d, ts.createDiagnosticForNode(last_2.declaration, ts.Diagnostics.The_last_overload_is_declared_here)); } - addImplementationSuccessElaboration(last_2, d); diagnostics.add(d); } } @@ -68295,7 +66488,7 @@ var ts; var min_3 = Number.MAX_VALUE; var minIndex = 0; var i_1 = 0; - var _loop_21 = function (c) { + var _loop_20 = function (c) { var chain_2 = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); }; var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* Normal */, /*reportErrors*/ true, chain_2); if (diags_2) { @@ -68313,24 +66506,19 @@ var ts; }; for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) { var c = candidatesForArgumentError_1[_a]; - _loop_21(c); + _loop_20(c); } var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics); ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures"); var chain = ts.chainDiagnosticMessages(ts.map(diags_3, function (d) { return typeof d.messageText === "string" ? d : d.messageText; }), ts.Diagnostics.No_overload_matches_this_call); - // The below is a spread to guarantee we get a new (mutable) array - our `flatMap` helper tries to do "smart" optimizations where it reuses input - // arrays and the emptyArray singleton where possible, which is decidedly not what we want while we're still constructing this diagnostic - var related = __spreadArrays(ts.flatMap(diags_3, function (d) { return d.relatedInformation; })); - var diag = void 0; + var related = ts.flatMap(diags_3, function (d) { return d.relatedInformation; }); if (ts.every(diags_3, function (d) { return d.start === diags_3[0].start && d.length === diags_3[0].length && d.file === diags_3[0].file; })) { var _b = diags_3[0], file = _b.file, start = _b.start, length_6 = _b.length; - diag = { file: file, start: start, length: length_6, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }; + diagnostics.add({ file: file, start: start, length: length_6, code: chain.code, category: chain.category, messageText: chain, relatedInformation: related }); } else { - diag = ts.createDiagnosticForNodeFromMessageChain(node, chain, related); + diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(node, chain, related)); } - addImplementationSuccessElaboration(candidatesForArgumentError[0], diag); - diagnostics.add(diag); } } else if (candidateForArgumentArityError) { @@ -68353,26 +66541,7 @@ var ts; } } return getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray); - function addImplementationSuccessElaboration(failed, diagnostic) { - var _a, _b; - var oldCandidatesForArgumentError = candidatesForArgumentError; - var oldCandidateForArgumentArityError = candidateForArgumentArityError; - var oldCandidateForTypeArgumentError = candidateForTypeArgumentError; - var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray; - var isOverload = failedSignatureDeclarations.length > 1; - var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined; - if (implDecl) { - var candidate = getSignatureFromDeclaration(implDecl); - var isSingleNonGenericCandidate_1 = !candidate.typeParameters; - if (chooseOverload([candidate], assignableRelation, isSingleNonGenericCandidate_1)) { - ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(implDecl, ts.Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible)); - } - } - candidatesForArgumentError = oldCandidatesForArgumentError; - candidateForArgumentArityError = oldCandidateForArgumentArityError; - candidateForTypeArgumentError = oldCandidateForTypeArgumentError; - } - function chooseOverload(candidates, relation, isSingleNonGenericCandidate, signatureHelpTrailingComma) { + function chooseOverload(candidates, relation, signatureHelpTrailingComma) { if (signatureHelpTrailingComma === void 0) { signatureHelpTrailingComma = false; } candidatesForArgumentError = undefined; candidateForArgumentArityError = undefined; @@ -68471,7 +66640,7 @@ var ts; } var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max; var parameters = []; - var _loop_22 = function (i) { + var _loop_21 = function (i) { var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ? i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) : i < s.parameters.length ? s.parameters[i] : undefined; }); @@ -68479,7 +66648,7 @@ var ts; parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); }))); }; for (var i = 0; i < maxNonRestParam; i++) { - _loop_22(i); + _loop_21(i); } var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; }); var flags = 0 /* None */; @@ -68782,7 +66951,7 @@ var ts; var declaration = signature.declaration; var modifiers = ts.getSelectedEffectiveModifierFlags(declaration, 24 /* NonPublicAccessibilityModifier */); // (1) Public constructors and (2) constructor functions are always accessible. - if (!modifiers || declaration.kind !== 166 /* Constructor */) { + if (!modifiers || declaration.kind !== 165 /* Constructor */) { return true; } var declaringClassDeclaration = ts.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); @@ -68814,8 +66983,8 @@ var ts; if (apparentType.flags & 1048576 /* Union */) { var types = apparentType.types; var hasSignatures = false; - for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { - var constituent = types_19[_i]; + for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { + var constituent = types_18[_i]; var signatures = getSignaturesOfType(constituent, kind); if (signatures.length !== 0) { hasSignatures = true; @@ -68911,11 +67080,6 @@ var ts; return resolveUntypedCall(node); } if (!callSignatures.length) { - if (ts.isArrayLiteralExpression(node.parent)) { - var diagnostic = ts.createDiagnosticForNode(node.tag, ts.Diagnostics.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked); - diagnostics.add(diagnostic); - return resolveErrorCall(node); - } invocationError(node.tag, apparentType, 0 /* Call */); return resolveErrorCall(node); } @@ -68926,16 +67090,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 160 /* Parameter */: + case 159 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; default: return ts.Debug.fail(); @@ -68994,10 +67158,6 @@ var ts; var result = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); var fakeSignature = createSignatureForJSXIntrinsic(node, result); checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType(node.attributes, getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), /*mapper*/ undefined, 0 /* Normal */), result, node.tagName, node.attributes); - if (ts.length(node.typeArguments)) { - ts.forEach(node.typeArguments, checkSourceElement); - diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), node.typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, 0, ts.length(node.typeArguments))); - } return fakeSignature; } var exprTypes = checkExpression(node.tagName); @@ -69030,16 +67190,16 @@ var ts; } function resolveSignature(node, candidatesOutArray, checkMode) { switch (node.kind) { - case 203 /* CallExpression */: + case 200 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray, checkMode); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray, checkMode); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); - case 161 /* Decorator */: + case 160 /* Decorator */: return resolveDecorator(node, candidatesOutArray, checkMode); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); } throw ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -69117,61 +67277,20 @@ var ts; } } function getAssignedClassSymbol(decl) { - var _a; - var assignmentSymbol = decl && getSymbolOfExpando(decl, /*allowDeclaration*/ true); - var prototype = (_a = assignmentSymbol === null || assignmentSymbol === void 0 ? void 0 : assignmentSymbol.exports) === null || _a === void 0 ? void 0 : _a.get("prototype"); - var init = (prototype === null || prototype === void 0 ? void 0 : prototype.valueDeclaration) && getAssignedJSPrototype(prototype.valueDeclaration); + var assignmentSymbol = decl && decl.parent && + (ts.isFunctionDeclaration(decl) && getSymbolOfNode(decl) || + ts.isBinaryExpression(decl.parent) && getSymbolOfNode(decl.parent.left) || + ts.isVariableDeclaration(decl.parent) && getSymbolOfNode(decl.parent)); + var prototype = assignmentSymbol && assignmentSymbol.exports && assignmentSymbol.exports.get("prototype"); + var init = prototype && prototype.valueDeclaration && getAssignedJSPrototype(prototype.valueDeclaration); return init ? getSymbolOfNode(init) : undefined; } - function getSymbolOfExpando(node, allowDeclaration) { - if (!node.parent) { - return undefined; - } - var name; - var decl; - if (ts.isVariableDeclaration(node.parent) && node.parent.initializer === node) { - if (!ts.isInJSFile(node) && !(ts.isVarConst(node.parent) && ts.isFunctionLikeDeclaration(node))) { - return undefined; - } - name = node.parent.name; - decl = node.parent; - } - else if (ts.isBinaryExpression(node.parent)) { - var parentNode = node.parent; - var parentNodeOperator = node.parent.operatorToken.kind; - if (parentNodeOperator === 62 /* EqualsToken */ && (allowDeclaration || parentNode.right === node)) { - name = parentNode.left; - decl = name; - } - else if (parentNodeOperator === 56 /* BarBarToken */ || parentNodeOperator === 60 /* QuestionQuestionToken */) { - if (ts.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { - name = parentNode.parent.name; - decl = parentNode.parent; - } - else if (ts.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 62 /* EqualsToken */ && (allowDeclaration || parentNode.parent.right === parentNode)) { - name = parentNode.parent.left; - decl = name; - } - if (!name || !ts.isBindableStaticNameExpression(name) || !ts.isSameEntityName(name, parentNode.left)) { - return undefined; - } - } - } - else if (allowDeclaration && ts.isFunctionDeclaration(node)) { - name = node.name; - decl = node; - } - if (!decl || !name || (!allowDeclaration && !ts.getExpandoInitializer(node, ts.isPrototypeAccess(name)))) { - return undefined; - } - return getSymbolOfNode(decl); - } function getAssignedJSPrototype(node) { if (!node.parent) { return false; } var parent = node.parent; - while (parent && parent.kind === 201 /* PropertyAccessExpression */) { + while (parent && parent.kind === 198 /* PropertyAccessExpression */) { parent = parent.parent; } if (parent && ts.isBinaryExpression(parent) && ts.isPrototypeAccess(parent.left) && parent.operatorToken.kind === 62 /* EqualsToken */) { @@ -69198,12 +67317,12 @@ var ts; if (node.expression.kind === 105 /* SuperKeyword */) { return voidType; } - if (node.kind === 204 /* NewExpression */) { + if (node.kind === 201 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 166 /* Constructor */ && - declaration.kind !== 170 /* ConstructSignature */ && - declaration.kind !== 175 /* ConstructorType */ && + declaration.kind !== 165 /* Constructor */ && + declaration.kind !== 169 /* ConstructSignature */ && + declaration.kind !== 174 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any @@ -69223,7 +67342,7 @@ var ts; if (returnType.flags & 12288 /* ESSymbolLike */ && isSymbolOrSymbolForCall(node)) { return getESSymbolLikeTypeForNode(ts.walkUpParenthesizedExpressions(node.parent)); } - if (node.kind === 203 /* CallExpression */ && node.parent.kind === 233 /* ExpressionStatement */ && + if (node.kind === 200 /* CallExpression */ && node.parent.kind === 230 /* ExpressionStatement */ && returnType.flags & 16384 /* Void */ && getTypePredicateOfSignature(signature)) { if (!ts.isDottedName(node.expression)) { error(node.expression, ts.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); @@ -69234,11 +67353,14 @@ var ts; } } if (ts.isInJSFile(node)) { - var jsSymbol = getSymbolOfExpando(node, /*allowDeclaration*/ false); - if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) { - var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined); - jsAssignmentType.objectFlags |= 16384 /* JSLiteral */; - return getIntersectionType([returnType, jsAssignmentType]); + var decl = ts.getDeclarationOfExpando(node); + if (decl) { + var jsSymbol = getSymbolOfNode(decl); + if ((_a = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a === void 0 ? void 0 : _a.size) { + var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts.emptyArray, ts.emptyArray, undefined, undefined); + jsAssignmentType.objectFlags |= 16384 /* JSLiteral */; + return getIntersectionType([returnType, jsAssignmentType]); + } } } return returnType; @@ -69252,20 +67374,20 @@ var ts; function getDeprecatedSuggestionNode(node) { node = ts.skipParentheses(node); switch (node.kind) { - case 203 /* CallExpression */: - case 161 /* Decorator */: - case 204 /* NewExpression */: + case 200 /* CallExpression */: + case 160 /* Decorator */: + case 201 /* NewExpression */: return getDeprecatedSuggestionNode(node.expression); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return getDeprecatedSuggestionNode(node.tag); - case 275 /* JsxOpeningElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 271 /* JsxSelfClosingElement */: return getDeprecatedSuggestionNode(node.tagName); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return node.argumentExpression; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.name; - case 173 /* TypeReference */: + case 172 /* TypeReference */: var typeReference = node; return ts.isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference; default: @@ -69324,7 +67446,6 @@ var ts; if (hasSyntheticDefault) { var memberTable = ts.createSymbolTable(); var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */); - newSymbol.parent = originalSymbol; newSymbol.nameType = getLiteralType("default"); newSymbol.target = resolveSymbol(symbol); memberTable.set("default" /* Default */, newSymbol); @@ -69357,9 +67478,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 251 /* FunctionDeclaration */ + ? 248 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 249 /* VariableDeclaration */ + ? 246 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -69389,19 +67510,18 @@ var ts; case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 218 /* TemplateExpression */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return true; - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return isValidConstAssertionArgument(node.expression); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var op = node.operator; var arg = node.operand; return op === 40 /* MinusToken */ && (arg.kind === 8 /* NumericLiteral */ || arg.kind === 9 /* BigIntLiteral */) || op === 39 /* PlusToken */ && arg.kind === 8 /* NumericLiteral */; - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: var expr = node.expression; if (ts.isIdentifier(expr)) { var symbol = getSymbolAtLocation(expr); @@ -69457,7 +67577,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return errorType; } - else if (container.kind === 166 /* Constructor */) { + else if (container.kind === 165 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -69467,8 +67587,8 @@ var ts; } } function checkImportMetaProperty(node) { - if (moduleKind !== ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) { - error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system); + if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System) { + error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system); } var file = ts.getSourceFileOfNode(node); ts.Debug.assert(!!(file.flags & 2097152 /* PossiblyContainsImportMeta */), "Containing file is missing import meta node flag."); @@ -69504,7 +67624,7 @@ var ts; return restParameter.escapedName; } function isValidDeclarationForTupleLabel(d) { - return d.kind === 192 /* NamedTupleMember */ || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name)); + return d.kind === 191 /* NamedTupleMember */ || (ts.isParameter(d) && d.name && ts.isIdentifier(d.name)); } function getNameableDeclarationAtPosition(signature, pos) { var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); @@ -69577,40 +67697,21 @@ var ts; } return length; } - function getMinArgumentCount(signature, flags) { - var strongArityForUntypedJS = flags & 1 /* StrongArityForUntypedJS */; - var voidIsNonOptional = flags & 2 /* VoidIsNonOptional */; - if (voidIsNonOptional || signature.resolvedMinArgumentCount === undefined) { - var minArgumentCount = void 0; - if (signatureHasRestParameter(signature)) { - var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - if (isTupleType(restType)) { - var firstOptionalIndex = ts.findIndex(restType.target.elementFlags, function (f) { return !(f & 1 /* Required */); }); - var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; - if (requiredCount > 0) { - minArgumentCount = signature.parameters.length - 1 + requiredCount; - } + function getMinArgumentCount(signature, strongArityForUntypedJS) { + if (signatureHasRestParameter(signature)) { + var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + if (isTupleType(restType)) { + var firstOptionalIndex = ts.findIndex(restType.target.elementFlags, function (f) { return !(f & 1 /* Required */); }); + var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; + if (requiredCount > 0) { + return signature.parameters.length - 1 + requiredCount; } } - if (minArgumentCount === undefined) { - if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { - return 0; - } - minArgumentCount = signature.minArgumentCount; - } - if (voidIsNonOptional) { - return minArgumentCount; - } - for (var i = minArgumentCount - 1; i >= 0; i--) { - var type = getTypeAtPosition(signature, i); - if (filterType(type, acceptsVoid).flags & 131072 /* Never */) { - break; - } - minArgumentCount = i; - } - signature.resolvedMinArgumentCount = minArgumentCount; } - return signature.resolvedMinArgumentCount; + if (!strongArityForUntypedJS && signature.flags & 16 /* IsUntypedSignatureInJSFile */) { + return 0; + } + return signature.minArgumentCount; } function hasEffectiveRestParameter(signature) { if (signatureHasRestParameter(signature)) { @@ -69776,7 +67877,7 @@ var ts; var yieldType; var nextType; var fallbackReturnType = voidType; - if (func.body.kind !== 230 /* Block */) { // Async or normal arrow function + if (func.body.kind !== 227 /* Block */) { // Async or normal arrow function returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */); if (isAsync) { // From within an async function you can return either a non-promise value or a promise. Any @@ -69961,7 +68062,7 @@ var ts; return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node)); } function computeExhaustiveSwitchStatement(node) { - if (node.expression.kind === 211 /* TypeOfExpression */) { + if (node.expression.kind === 208 /* TypeOfExpression */) { var operandType = getTypeOfExpression(node.expression.expression); var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false); // notEqualFacts states that the type of the switched value is not equal to every type in the switch. @@ -70024,11 +68125,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return true; - case 165 /* MethodDeclaration */: - return func.parent.kind === 200 /* ObjectLiteralExpression */; + case 164 /* MethodDeclaration */: + return func.parent.kind === 197 /* ObjectLiteralExpression */; default: return false; } @@ -70054,7 +68155,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (func.kind === 164 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 230 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 163 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 227 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 512 /* HasExplicitReturn */; @@ -70087,7 +68188,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); checkNodeDeferred(node); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode && checkMode & 4 /* SkipContextSensitive */ && isContextSensitive(node)) { @@ -70111,7 +68212,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 208 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 205 /* FunctionExpression */) { checkGrammarForGenerator(node); } contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -70157,7 +68258,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 165 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 164 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnType = getReturnTypeFromAnnotation(node); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); @@ -70170,7 +68271,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 230 /* Block */) { + if (node.body.kind === 227 /* Block */) { checkSourceElement(node.body); } else { @@ -70260,7 +68361,7 @@ var ts; expr.expression.kind === 107 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var ctor = ts.getContainingFunction(expr); - if (!(ctor && (ctor.kind === 166 /* Constructor */ || isJSConstructor(ctor)))) { + if (!(ctor && (ctor.kind === 165 /* Constructor */ || isJSConstructor(ctor)))) { return true; } if (symbol.valueDeclaration) { @@ -70285,7 +68386,7 @@ var ts; var symbol_2 = getNodeLinks(node).resolvedSymbol; if (symbol_2.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol_2); - return !!declaration && declaration.kind === 263 /* NamespaceImport */; + return !!declaration && declaration.kind === 260 /* NamespaceImport */; } } } @@ -70366,7 +68467,7 @@ var ts; var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); var func = ts.getContainingFunction(node); - if (func && func.kind !== 166 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { + if (func && func.kind !== 165 /* Constructor */ && (ts.getFunctionFlags(func) & 2 /* Async */) === 0) { var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); } @@ -70468,8 +68569,8 @@ var ts; } if (type.flags & 3145728 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { - var t = types_20[_i]; + for (var _i = 0, types_19 = types; _i < types_19.length; _i++) { + var t = types_19[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -70486,7 +68587,7 @@ var ts; } return !!(kind & 296 /* NumberLike */) && isTypeAssignableTo(source, numberType) || !!(kind & 2112 /* BigIntLike */) && isTypeAssignableTo(source, bigintType) || - !!(kind & 402653316 /* StringLike */) && isTypeAssignableTo(source, stringType) || + !!(kind & 132 /* StringLike */) && isTypeAssignableTo(source, stringType) || !!(kind & 528 /* BooleanLike */) && isTypeAssignableTo(source, booleanType) || !!(kind & 16384 /* Void */) && isTypeAssignableTo(source, voidType) || !!(kind & 131072 /* Never */) && isTypeAssignableTo(source, neverType) || @@ -70535,8 +68636,8 @@ var ts; // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, // and the right operand to be of type Any, an object type, or a type parameter type. // The result is always of the Boolean primitive type. - if (!(allTypesAssignableToKind(leftType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) || - isTypeAssignableToKind(leftType, 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */ | 262144 /* TypeParameter */))) { + if (!(allTypesAssignableToKind(leftType, 132 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) || + isTypeAssignableToKind(leftType, 4194304 /* Index */ | 262144 /* TypeParameter */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } if (!allTypesAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) { @@ -70559,7 +68660,7 @@ var ts; if (rightIsThis === void 0) { rightIsThis = false; } var properties = node.properties; var property = properties[propertyIndex]; - if (property.kind === 288 /* PropertyAssignment */ || property.kind === 289 /* ShorthandPropertyAssignment */) { + if (property.kind === 285 /* PropertyAssignment */ || property.kind === 286 /* ShorthandPropertyAssignment */) { var name = property.name; var exprType = getLiteralTypeFromPropertyName(name); if (isTypeUsableAsPropertyName(exprType)) { @@ -70570,11 +68671,11 @@ var ts; checkPropertyAccessibility(property, /*isSuper*/ false, objectLiteralType, prop); } } - var elementType = getIndexedAccessType(objectLiteralType, exprType, /*noUncheckedIndexedAccessCandidate*/ undefined, name, /*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, 16 /* ExpressionPosition */); + var elementType = getIndexedAccessType(objectLiteralType, exprType, name); var type = getFlowTypeOfDestructuring(property, elementType); - return checkDestructuringAssignment(property.kind === 289 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); + return checkDestructuringAssignment(property.kind === 286 /* ShorthandPropertyAssignment */ ? property : property.initializer, type); } - else if (property.kind === 290 /* SpreadAssignment */) { + else if (property.kind === 287 /* SpreadAssignment */) { if (propertyIndex < properties.length - 1) { error(property, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -70608,28 +68709,23 @@ var ts; // This elementType will be used if the specific property corresponding to this index is not // present (aka the tuple element property). This call also checks that the parentType is in // fact an iterable or array (depending on target language). - var possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType; - var inBoundsType = compilerOptions.noUncheckedIndexedAccess ? undefined : possiblyOutOfBoundsType; + var elementType = checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType; for (var i = 0; i < elements.length; i++) { - var type = possiblyOutOfBoundsType; - if (node.elements[i].kind === 220 /* SpreadElement */) { - type = inBoundsType = inBoundsType !== null && inBoundsType !== void 0 ? inBoundsType : (checkIteratedTypeOrElementType(65 /* Destructuring */, sourceType, undefinedType, node) || errorType); - } - checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, type, checkMode); + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i, elementType, checkMode); } return sourceType; } function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 222 /* OmittedExpression */) { - if (element.kind !== 220 /* SpreadElement */) { + if (element.kind !== 219 /* OmittedExpression */) { + if (element.kind !== 217 /* SpreadElement */) { var indexType = getLiteralType(elementIndex); if (isArrayLikeType(sourceType)) { // We create a synthetic expression so that getIndexedAccessType doesn't get confused // when the element is a SyntaxKind.ElementAccessExpression. - var accessFlags = 16 /* ExpressionPosition */ | (hasDefaultValue(element) ? 8 /* NoTupleBoundsCheck */ : 0); - var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, /*noUncheckedIndexedAccessCandidate*/ undefined, createSyntheticExpression(element, indexType), accessFlags) || errorType; + var accessFlags = hasDefaultValue(element) ? 8 /* NoTupleBoundsCheck */ : 0; + var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, createSyntheticExpression(element, indexType), accessFlags) || errorType; var assignedType = hasDefaultValue(element) ? getTypeWithFacts(elementType_2, 524288 /* NEUndefined */) : elementType_2; var type = getFlowTypeOfDestructuring(element, assignedType); return checkDestructuringAssignment(element, type, checkMode); @@ -70641,7 +68737,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 216 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { + if (restExpression.kind === 213 /* BinaryExpression */ && restExpression.operatorToken.kind === 62 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -70657,7 +68753,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { var target; - if (exprOrAssignment.kind === 289 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 286 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -70673,24 +68769,24 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 216 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { + if (target.kind === 213 /* BinaryExpression */ && target.operatorToken.kind === 62 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 200 /* ObjectLiteralExpression */) { + if (target.kind === 197 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType, rightIsThis); } - if (target.kind === 199 /* ArrayLiteralExpression */) { + if (target.kind === 196 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 290 /* SpreadAssignment */ ? + var error = target.parent.kind === 287 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; - var optionalError = target.parent.kind === 290 /* SpreadAssignment */ ? + var optionalError = target.parent.kind === 287 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; if (checkReferenceExpression(target, error, optionalError)) { @@ -70715,36 +68811,36 @@ var ts; case 78 /* Identifier */: case 10 /* StringLiteral */: case 13 /* RegularExpressionLiteral */: - case 205 /* TaggedTemplateExpression */: - case 218 /* TemplateExpression */: + case 202 /* TaggedTemplateExpression */: + case 215 /* TemplateExpression */: case 14 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 9 /* BigIntLiteral */: case 109 /* TrueKeyword */: case 94 /* FalseKeyword */: case 103 /* NullKeyword */: - case 150 /* UndefinedKeyword */: - case 208 /* FunctionExpression */: - case 221 /* ClassExpression */: - case 209 /* ArrowFunction */: - case 199 /* ArrayLiteralExpression */: - case 200 /* ObjectLiteralExpression */: - case 211 /* TypeOfExpression */: - case 225 /* NonNullExpression */: - case 274 /* JsxSelfClosingElement */: - case 273 /* JsxElement */: + case 149 /* UndefinedKeyword */: + case 205 /* FunctionExpression */: + case 218 /* ClassExpression */: + case 206 /* ArrowFunction */: + case 196 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 208 /* TypeOfExpression */: + case 222 /* NonNullExpression */: + case 271 /* JsxSelfClosingElement */: + case 270 /* JsxElement */: return true; - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -70756,9 +68852,9 @@ var ts; } return false; // Some forms listed here for clarity - case 212 /* VoidExpression */: // Explicit opt-out - case 206 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 224 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 209 /* VoidExpression */: // Explicit opt-out + case 203 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 221 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -70790,7 +68886,7 @@ var ts; } checkGrammarNullishCoalesceWithLogicalExpression(node); var operator = node.operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (node.left.kind === 200 /* ObjectLiteralExpression */ || node.left.kind === 199 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (node.left.kind === 197 /* ObjectLiteralExpression */ || node.left.kind === 196 /* ArrayLiteralExpression */)) { finishInvocation(checkDestructuringAssignment(node.left, checkExpression(node.right, checkMode), checkMode, node.right.kind === 107 /* ThisKeyword */)); break; } @@ -70857,7 +68953,7 @@ var ts; // expression-wide checks and does not use a work stack to fold nested binary expressions into the same callstack frame function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 62 /* EqualsToken */ && (left.kind === 200 /* ObjectLiteralExpression */ || left.kind === 199 /* ArrayLiteralExpression */)) { + if (operator === 62 /* EqualsToken */ && (left.kind === 197 /* ObjectLiteralExpression */ || left.kind === 196 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode, right.kind === 107 /* ThisKeyword */); } var leftType; @@ -70950,7 +69046,7 @@ var ts; if (leftType === silentNeverType || rightType === silentNeverType) { return silentNeverType; } - if (!isTypeAssignableToKind(leftType, 402653316 /* StringLike */) && !isTypeAssignableToKind(rightType, 402653316 /* StringLike */)) { + if (!isTypeAssignableToKind(leftType, 132 /* StringLike */) && !isTypeAssignableToKind(rightType, 132 /* StringLike */)) { leftType = checkNonNullType(leftType, left); rightType = checkNonNullType(rightType, right); } @@ -70964,7 +69060,7 @@ var ts; // If both operands are of the BigInt primitive type, the result is of the BigInt primitive type. resultType = bigintType; } - else if (isTypeAssignableToKind(leftType, 402653316 /* StringLike */, /*strict*/ true) || isTypeAssignableToKind(rightType, 402653316 /* StringLike */, /*strict*/ true)) { + else if (isTypeAssignableToKind(leftType, 132 /* StringLike */, /*strict*/ true) || isTypeAssignableToKind(rightType, 132 /* StringLike */, /*strict*/ true)) { // If one or both operands are of the String primitive type, the result is of the String primitive type. resultType = stringType; } @@ -70982,7 +69078,7 @@ var ts; // If both types have an awaited type of one of these, we'll assume the user // might be missing an await without doing an exhaustive check that inserting // await(s) will actually be a completely valid binary expression. - var closeEnoughKind_1 = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 402653316 /* StringLike */ | 3 /* AnyOrUnknown */; + var closeEnoughKind_1 = 296 /* NumberLike */ | 2112 /* BigIntLike */ | 132 /* StringLike */ | 3 /* AnyOrUnknown */; reportOperatorError(function (left, right) { return isTypeAssignableToKind(left, closeEnoughKind_1) && isTypeAssignableToKind(right, closeEnoughKind_1); @@ -71283,21 +69379,20 @@ var ts; return getUnionType([type1, type2], 2 /* Subtype */); } function checkTemplateExpression(node) { - var texts = [node.head.text]; - var types = []; - for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) { - var span = _a[_i]; - var type = checkExpression(span.expression); - if (maybeTypeOfKind(type, 12288 /* ESSymbolLike */)) { - error(span.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); + // We just want to check each expressions, but we are unconcerned with + // the type of each expression, as any value may be coerced into a string. + // It is worth asking whether this is what we really want though. + // A place where we actually *are* concerned with the expressions' types are + // in tagged templates. + ts.forEach(node.templateSpans, function (templateSpan) { + if (maybeTypeOfKind(checkExpression(templateSpan.expression), 12288 /* ESSymbolLike */)) { + error(templateSpan.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); } - texts.push(span.literal.text); - types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType); - } - return isConstContext(node) ? getTemplateLiteralType(texts, types) : stringType; + }); + return stringType; } function getContextNode(node) { - if (node.kind === 281 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { + if (node.kind === 278 /* JsxAttributes */ && !ts.isJsxSelfClosingElement(node.parent)) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -71346,13 +69441,13 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 206 /* TypeAssertionExpression */ || node.kind === 224 /* AsExpression */; + return node.kind === 203 /* TypeAssertionExpression */ || node.kind === 221 /* AsExpression */; } function checkDeclarationInitializer(declaration, contextualType) { var initializer = ts.getEffectiveInitializer(declaration); var type = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, 0 /* Normal */) : checkExpressionCached(initializer)); - return ts.isParameter(declaration) && declaration.name.kind === 197 /* ArrayBindingPattern */ && + return ts.isParameter(declaration) && declaration.name.kind === 194 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type; } @@ -71362,7 +69457,7 @@ var ts; var elementFlags = type.target.elementFlags.slice(); for (var i = getTypeReferenceArity(type); i < patternElements.length; i++) { var e = patternElements[i]; - if (i < patternElements.length - 1 || !(e.kind === 198 /* BindingElement */ && e.dotDotDotToken)) { + if (i < patternElements.length - 1 || !(e.kind === 195 /* BindingElement */ && e.dotDotDotToken)) { elementTypes.push(!ts.isOmittedExpression(e) && hasDefaultValue(e) ? getTypeFromBindingElement(e, /*includePatternInType*/ false, /*reportErrors*/ false) : anyType); elementFlags.push(2 /* Optional */); if (!ts.isOmittedExpression(e) && !hasDefaultValue(e)) { @@ -71405,7 +69500,7 @@ var ts; } // If the contextual type is a literal of a particular primitive type, we consider this a // literal context for all literals of that primitive type. - return !!(contextualType.flags & (128 /* StringLiteral */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || + return !!(contextualType.flags & (128 /* StringLiteral */ | 4194304 /* Index */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || contextualType.flags & 256 /* NumberLiteral */ && maybeTypeOfKind(candidateType, 256 /* NumberLiteral */) || contextualType.flags & 2048 /* BigIntLiteral */ && maybeTypeOfKind(candidateType, 2048 /* BigIntLiteral */) || contextualType.flags & 512 /* BooleanLiteral */ && maybeTypeOfKind(candidateType, 512 /* BooleanLiteral */) || @@ -71417,7 +69512,7 @@ var ts; var parent = node.parent; return ts.isAssertionExpression(parent) && ts.isConstTypeReference(parent.type) || (ts.isParenthesizedExpression(parent) || ts.isArrayLiteralExpression(parent) || ts.isSpreadElement(parent)) && isConstContext(parent) || - (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent) || ts.isTemplateSpan(parent)) && isConstContext(parent.parent); + (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent)) && isConstContext(parent.parent); } function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) { var type = checkExpression(node, checkMode, forceTuple); @@ -71429,7 +69524,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -71440,7 +69535,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -71658,7 +69753,6 @@ var ts; } } function checkExpression(node, checkMode, forceTuple) { - ts.tracing.push("check" /* Check */, "checkExpression", { kind: node.kind, pos: node.pos, end: node.end }); var saveCurrentNode = currentNode; currentNode = node; instantiationCount = 0; @@ -71668,7 +69762,6 @@ var ts; checkConstEnumAccess(node, type); } currentNode = saveCurrentNode; - ts.tracing.pop(); return type; } function checkConstEnumAccess(node, type) { @@ -71676,11 +69769,11 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 201 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 202 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 78 /* Identifier */ || node.kind === 157 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 176 /* TypeQuery */ && node.parent.exprName === node)) || - (node.parent.kind === 270 /* ExportSpecifier */); // We allow reexporting const enums + var ok = (node.parent.kind === 198 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 199 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 78 /* Identifier */ || node.kind === 156 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 175 /* TypeQuery */ && node.parent.exprName === node)) || + (node.parent.kind === 267 /* ExportSpecifier */); // We allow reexporting const enums if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -71705,9 +69798,9 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 221 /* ClassExpression */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 218 /* ClassExpression */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: cancellationToken.throwIfCancellationRequested(); } } @@ -71733,78 +69826,78 @@ var ts; return trueType; case 94 /* FalseKeyword */: return falseType; - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return checkTemplateExpression(node); case 13 /* RegularExpressionLiteral */: return globalRegExpType; - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode, forceTuple); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return checkQualifiedName(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (node.expression.kind === 99 /* ImportKeyword */) { return checkImportCallExpression(node); } // falls through - case 204 /* NewExpression */: + case 201 /* NewExpression */: return checkCallExpression(node, checkMode); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return checkClassExpression(node); - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: return checkAssertion(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return checkNonNullAssertion(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return checkMetaProperty(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return checkDeleteExpression(node); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return checkVoidExpression(node); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return checkAwaitExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 222 /* OmittedExpression */: + case 219 /* OmittedExpression */: return undefinedWideningType; - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return checkYieldExpression(node); - case 227 /* SyntheticExpression */: + case 224 /* SyntheticExpression */: return checkSyntheticExpression(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return checkJsxElement(node, checkMode); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return checkJsxFragment(node); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return errorType; @@ -71841,10 +69934,10 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasSyntacticModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 166 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 165 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } - if (func.kind === 166 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { + if (func.kind === 165 /* Constructor */ && ts.isIdentifier(node.name) && node.name.escapedText === "constructor") { error(node.name, ts.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); } } @@ -71855,13 +69948,13 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 166 /* Constructor */ || func.kind === 170 /* ConstructSignature */ || func.kind === 175 /* ConstructorType */) { + if (func.kind === 165 /* Constructor */ || func.kind === 169 /* ConstructSignature */ || func.kind === 174 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } - if (func.kind === 209 /* ArrowFunction */) { + if (func.kind === 206 /* ArrowFunction */) { error(node, ts.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); } - if (func.kind === 167 /* GetAccessor */ || func.kind === 168 /* SetAccessor */) { + if (func.kind === 166 /* GetAccessor */ || func.kind === 167 /* SetAccessor */) { error(node, ts.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); } } @@ -71919,13 +70012,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 209 /* ArrowFunction */: - case 169 /* CallSignature */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 174 /* FunctionType */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 206 /* ArrowFunction */: + case 168 /* CallSignature */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 173 /* FunctionType */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -71943,7 +70036,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 197 /* ArrayBindingPattern */ || name.kind === 196 /* ObjectBindingPattern */) { + else if (name.kind === 194 /* ArrayBindingPattern */ || name.kind === 193 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -71952,13 +70045,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 171 /* IndexSignature */) { + if (node.kind === 170 /* IndexSignature */) { checkGrammarIndexSignature(node); } // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled - else if (node.kind === 174 /* FunctionType */ || node.kind === 251 /* FunctionDeclaration */ || node.kind === 175 /* ConstructorType */ || - node.kind === 169 /* CallSignature */ || node.kind === 166 /* Constructor */ || - node.kind === 170 /* ConstructSignature */) { + else if (node.kind === 173 /* FunctionType */ || node.kind === 248 /* FunctionDeclaration */ || node.kind === 174 /* ConstructorType */ || + node.kind === 168 /* CallSignature */ || node.kind === 165 /* Constructor */ || + node.kind === 169 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -71988,10 +70081,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -72021,7 +70114,7 @@ var ts; checkAsyncFunctionReturnType(node, returnTypeNode); } } - if (node.kind !== 171 /* IndexSignature */ && node.kind !== 308 /* JSDocFunctionType */) { + if (node.kind !== 170 /* IndexSignature */ && node.kind !== 304 /* JSDocFunctionType */) { registerForUnusedIdentifiersCheck(node); } } @@ -72033,7 +70126,7 @@ var ts; var privateIdentifiers = new ts.Map(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 166 /* Constructor */) { + if (member.kind === 165 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param, member) && !ts.isBindingPattern(param.name)) { @@ -72053,16 +70146,16 @@ var ts; var memberName = name && ts.getPropertyNameForPropertyNameNode(name); if (memberName) { switch (member.kind) { - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: addName(names, name, memberName, 1 /* GetAccessor */); break; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: addName(names, name, memberName, 2 /* SetAccessor */); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: addName(names, name, memberName, 3 /* GetOrSetAccessor */); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: addName(names, name, memberName, 8 /* Method */); break; } @@ -72125,7 +70218,7 @@ var ts; var names = new ts.Map(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 162 /* PropertySignature */) { + if (member.kind === 161 /* PropertySignature */) { var memberName = void 0; var name = member.name; switch (name.kind) { @@ -72150,7 +70243,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 253 /* InterfaceDeclaration */) { + if (node.kind === 250 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -72170,7 +70263,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -72178,7 +70271,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -72220,7 +70313,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 165 /* MethodDeclaration */ && node.body) { + if (ts.hasSyntacticModifier(node, 128 /* Abstract */) && node.kind === 164 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -72248,7 +70341,7 @@ var ts; if (ts.isPrivateIdentifierPropertyDeclaration(n)) { return true; } - return n.kind === 163 /* PropertyDeclaration */ && + return n.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(n, 32 /* Static */) && !!n.initializer; } @@ -72279,7 +70372,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_4 = statements; _i < statements_4.length; _i++) { var statement = statements_4[_i]; - if (statement.kind === 233 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 230 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -72304,7 +70397,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { if (!(node.flags & 8388608 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 256 /* HasImplicitReturn */)) { if (!(node.flags & 512 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -72314,7 +70407,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (ts.isPrivateIdentifier(node.name)) { @@ -72323,7 +70416,7 @@ var ts; if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + var otherKind = node.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getEffectiveModifierFlags(node); @@ -72341,7 +70434,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -72389,7 +70482,7 @@ var ts; } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 173 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 172 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJSFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } ts.forEach(node.typeArguments, checkSourceElement); @@ -72438,27 +70531,28 @@ var ts; function checkTupleType(node) { var elementTypes = node.elements; var seenOptionalElement = false; - var seenRestElement = false; - var hasNamedElement = ts.some(elementTypes, ts.isNamedTupleMember); + var seenNamedElement = false; for (var i = 0; i < elementTypes.length; i++) { var e = elementTypes[i]; - if (e.kind !== 192 /* NamedTupleMember */ && hasNamedElement) { + if (e.kind === 191 /* NamedTupleMember */) { + seenNamedElement = true; + } + else if (seenNamedElement) { grammarErrorOnNode(e, ts.Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names); break; } var flags = getTupleElementFlags(e); if (flags & 8 /* Variadic */) { - var type = getTypeFromTypeNode(e.type); - if (!isArrayLikeType(type)) { + if (!isArrayLikeType(getTypeFromTypeNode(e.type))) { error(e, ts.Diagnostics.A_rest_element_type_must_be_an_array_type); break; } - if (isArrayType(type) || isTupleType(type) && type.target.combinedFlags & 4 /* Rest */) { - seenRestElement = true; - } } else if (flags & 4 /* Rest */) { - seenRestElement = true; + if (i !== elementTypes.length - 1) { + grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); + break; + } } else if (flags & 2 /* Optional */) { seenOptionalElement = true; @@ -72467,17 +70561,11 @@ var ts; grammarErrorOnNode(e, ts.Diagnostics.A_required_element_cannot_follow_an_optional_element); break; } - if (seenRestElement && i !== elementTypes.length - 1) { - grammarErrorOnNode(e, ts.Diagnostics.A_rest_element_must_be_last_in_a_tuple_type); - break; - } } ts.forEach(node.elements, checkSourceElement); - getTypeFromTypeNode(node); } function checkUnionOrIntersectionType(node) { ts.forEach(node.types, checkSourceElement); - getTypeFromTypeNode(node); } function checkIndexedAccessIndexType(type, accessNode) { if (!(type.flags & 8388608 /* IndexedAccess */)) { @@ -72487,7 +70575,7 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType, /*stringsOnly*/ false))) { - if (accessNode.kind === 202 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + if (accessNode.kind === 199 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } @@ -72519,20 +70607,13 @@ var ts; } function checkMappedType(node) { checkSourceElement(node.typeParameter); - checkSourceElement(node.nameType); checkSourceElement(node.type); if (!node.type) { reportImplicitAny(node, anyType); } var type = getTypeFromMappedTypeNode(node); - var nameType = getNameTypeFromMappedType(type); - if (nameType) { - checkTypeAssignableTo(nameType, keyofConstraintType, node.nameType); - } - else { - var constraintType = getConstraintTypeFromMappedType(type); - checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter)); - } + var constraintType = getConstraintTypeFromMappedType(type); + checkTypeAssignableTo(constraintType, keyofConstraintType, ts.getEffectiveConstraintOfTypeParameter(node.typeParameter)); } function checkThisType(node) { getTypeFromThisTypeNode(node); @@ -72545,21 +70626,12 @@ var ts; ts.forEachChild(node, checkSourceElement); } function checkInferType(node) { - if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 184 /* ConditionalType */ && n.parent.extendsType === n; })) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 183 /* ConditionalType */ && n.parent.extendsType === n; })) { grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); registerForUnusedIdentifiersCheck(node); } - function checkTemplateLiteralType(node) { - for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) { - var span = _a[_i]; - checkSourceElement(span.type); - var type = getTypeFromTypeNode(span.type); - checkTypeAssignableTo(type, templateConstraintType, span.type); - } - getTypeFromTypeNode(node); - } function checkImportType(node) { checkSourceElement(node.argument); getTypeFromTypeNode(node); @@ -72568,10 +70640,10 @@ var ts; if (node.dotDotDotToken && node.questionToken) { grammarErrorOnNode(node, ts.Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest); } - if (node.type.kind === 180 /* OptionalType */) { + if (node.type.kind === 179 /* OptionalType */) { grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type); } - if (node.type.kind === 181 /* RestType */) { + if (node.type.kind === 180 /* RestType */) { grammarErrorOnNode(node.type, ts.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type); } checkSourceElement(node.type); @@ -72584,9 +70656,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 253 /* InterfaceDeclaration */ && - n.parent.kind !== 252 /* ClassDeclaration */ && - n.parent.kind !== 221 /* ClassExpression */ && + if (n.parent.kind !== 250 /* InterfaceDeclaration */ && + n.parent.kind !== 249 /* ClassDeclaration */ && + n.parent.kind !== 218 /* ClassExpression */ && n.flags & 8388608 /* Ambient */) { if (!(flags & 2 /* Ambient */) && !(ts.isModuleBlock(n.parent) && ts.isModuleDeclaration(n.parent.parent) && ts.isGlobalScopeAugmentation(n.parent.parent))) { // It is nested in an ambient context, which means it is automatically exported @@ -72682,7 +70754,7 @@ var ts; // Both are literal property names that are the same. ts.isPropertyNameLiteral(node.name) && ts.isPropertyNameLiteral(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */) && + var reportError = (node.kind === 164 /* MethodDeclaration */ || node.kind === 163 /* MethodSignature */) && ts.hasSyntacticModifier(node, 32 /* Static */) !== ts.hasSyntacticModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -72723,7 +70795,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 8388608 /* Ambient */; - var inAmbientContextOrInterface = node.parent && (node.parent.kind === 253 /* InterfaceDeclaration */ || node.parent.kind === 177 /* TypeLiteral */) || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 250 /* InterfaceDeclaration */ || node.parent.kind === 176 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -72734,10 +70806,10 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if ((node.kind === 252 /* ClassDeclaration */ || node.kind === 221 /* ClassExpression */) && !inAmbientContext) { + if ((node.kind === 249 /* ClassDeclaration */ || node.kind === 218 /* ClassExpression */) && !inAmbientContext) { hasNonAmbientClass = true; } - if (node.kind === 251 /* FunctionDeclaration */ || node.kind === 165 /* MethodDeclaration */ || node.kind === 164 /* MethodSignature */ || node.kind === 166 /* Constructor */) { + if (node.kind === 248 /* FunctionDeclaration */ || node.kind === 164 /* MethodDeclaration */ || node.kind === 163 /* MethodSignature */ || node.kind === 165 /* Constructor */) { functionDeclarations.push(node); var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; @@ -72870,25 +70942,25 @@ var ts; function getDeclarationSpaces(decl) { var d = decl; switch (d.kind) { - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: // A jsdoc typedef and callback are, by definition, type aliases. // falls through - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return 2 /* ExportType */; - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 291 /* EnumMember */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 288 /* EnumMember */: return 2 /* ExportType */ | 1 /* ExportValue */; - case 297 /* SourceFile */: + case 294 /* SourceFile */: return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: // Export assigned entity name expressions act as aliases and should fall through, otherwise they export values if (!ts.isEntityNameExpression(d.expression)) { return 1 /* ExportValue */; @@ -72896,17 +70968,17 @@ var ts; d = d.expression; // The below options all declare an Alias, which is allowed to merge with other values within the importing module. // falls through - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 262 /* ImportClause */: - var result_12 = 0 /* None */; + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 259 /* ImportClause */: + var result_11 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result_12 |= getDeclarationSpaces(d); }); - return result_12; - case 249 /* VariableDeclaration */: - case 198 /* BindingElement */: - case 251 /* FunctionDeclaration */: - case 265 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 + ts.forEach(target.declarations, function (d) { result_11 |= getDeclarationSpaces(d); }); + return result_11; + case 246 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 248 /* FunctionDeclaration */: + case 262 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 case 78 /* Identifier */: // https://github.com/microsoft/TypeScript/issues/36098 // Identifiers are used as declarations of assignment declarations whose parents may be // SyntaxKind.CallExpression - `Object.defineProperty(thing, "aField", {value: 42});` @@ -73199,24 +71271,24 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 160 /* Parameter */: + case 159 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages( /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -73263,30 +71335,30 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 183 /* IntersectionType */: - case 182 /* UnionType */: + case 182 /* IntersectionType */: + case 181 /* UnionType */: return getEntityNameForDecoratorMetadataFromTypeList(node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); - case 186 /* ParenthesizedType */: - case 192 /* NamedTupleMember */: + case 185 /* ParenthesizedType */: + case 191 /* NamedTupleMember */: return getEntityNameForDecoratorMetadata(node.type); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return node.typeName; } } } function getEntityNameForDecoratorMetadataFromTypeList(types) { var commonEntityName; - for (var _i = 0, types_21 = types; _i < types_21.length; _i++) { - var typeNode = types_21[_i]; - while (typeNode.kind === 186 /* ParenthesizedType */ || typeNode.kind === 192 /* NamedTupleMember */) { + for (var _i = 0, types_20 = types; _i < types_20.length; _i++) { + var typeNode = types_20[_i]; + while (typeNode.kind === 185 /* ParenthesizedType */ || typeNode.kind === 191 /* NamedTupleMember */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 141 /* NeverKeyword */) { + if (typeNode.kind === 140 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 190 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 149 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -73332,14 +71404,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 160 /* Parameter */) { + if (node.kind === 159 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -73348,23 +71420,23 @@ var ts; } } break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - var otherKind = node.kind === 167 /* GetAccessor */ ? 168 /* SetAccessor */ : 167 /* GetAccessor */; + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + var otherKind = node.kind === 166 /* GetAccessor */ ? 167 /* SetAccessor */ : 166 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 160 /* Parameter */: + case 159 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -73427,7 +71499,7 @@ var ts; else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && node.typeExpression && node.typeExpression.type && !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 157 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 156 /* QualifiedName */ ? node.name.right : node.name)); } } } @@ -73471,7 +71543,7 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -73484,7 +71556,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 157 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -73506,11 +71578,14 @@ var ts; checkFunctionOrConstructorSymbol(localSymbol); } if (symbol.parent) { - // run check on export symbol to check that modifiers agree across all exported declarations - checkFunctionOrConstructorSymbol(symbol); + // run check once for the first declaration + if (ts.getDeclarationOfKind(symbol, node.kind) === node) { + // run check on export symbol to check that modifiers agree across all exported declarations + checkFunctionOrConstructorSymbol(symbol); + } } } - var body = node.kind === 164 /* MethodSignature */ ? undefined : node.body; + var body = node.kind === 163 /* MethodSignature */ ? undefined : node.body; checkSourceElement(body); checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); if (produceDiagnostics && !ts.getEffectiveReturnTypeNode(node)) { @@ -73552,42 +71627,42 @@ var ts; for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { var node = potentiallyUnusedIdentifiers_1[_i]; switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: checkUnusedClassMembers(node, addDiagnostic); checkUnusedTypeParameters(node, addDiagnostic); break; - case 297 /* SourceFile */: - case 256 /* ModuleDeclaration */: - case 230 /* Block */: - case 258 /* CaseBlock */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 294 /* SourceFile */: + case 253 /* ModuleDeclaration */: + case 227 /* Block */: + case 255 /* CaseBlock */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: checkUnusedLocalsAndParameters(node, addDiagnostic); break; - case 166 /* Constructor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 165 /* Constructor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: if (node.body) { // Don't report unused parameters in overloads checkUnusedLocalsAndParameters(node, addDiagnostic); } checkUnusedTypeParameters(node, addDiagnostic); break; - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 254 /* TypeAliasDeclaration */: - case 253 /* InterfaceDeclaration */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 251 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: checkUnusedTypeParameters(node, addDiagnostic); break; - case 185 /* InferType */: + case 184 /* InferType */: checkUnusedInferTypeParameter(node, addDiagnostic); break; default: @@ -73607,11 +71682,11 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 165 /* MethodDeclaration */: - case 163 /* PropertyDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - if (member.kind === 168 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 164 /* MethodDeclaration */: + case 162 /* PropertyDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + if (member.kind === 167 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -73622,7 +71697,7 @@ var ts; addDiagnostic(member, 0 /* Local */, ts.createDiagnosticForNode(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol))); } break; - case 166 /* Constructor */: + case 165 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasSyntacticModifier(parameter, 8 /* Private */)) { @@ -73630,8 +71705,8 @@ var ts; } } break; - case 171 /* IndexSignature */: - case 229 /* SemicolonClassElement */: + case 170 /* IndexSignature */: + case 226 /* SemicolonClassElement */: // Can't be private break; default: @@ -73658,7 +71733,7 @@ var ts; continue; var name = ts.idText(typeParameter.name); var parent = typeParameter.parent; - if (parent.kind !== 185 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { + if (parent.kind !== 184 /* InferType */ && parent.typeParameters.every(isTypeParameterUnused)) { if (ts.tryAddToSet(seenParentsWithEveryUnused, parent)) { var range = ts.isJSDocTemplateTag(parent) // Whole @template tag @@ -73750,7 +71825,7 @@ var ts; var importDecl = importClause.parent; var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? - (importClause.namedBindings.kind === 263 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) + (importClause.namedBindings.kind === 260 /* NamespaceImport */ ? 1 : importClause.namedBindings.elements.length) : 0); if (nDeclarations === unuseds.length) { addDiagnostic(importDecl, 0 /* Local */, unuseds.length === 1 @@ -73768,7 +71843,7 @@ var ts; var bindingPattern = _a[0], bindingElements = _a[1]; var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 /* Parameter */ : 0 /* Local */; if (bindingPattern.elements.length === bindingElements.length) { - if (bindingElements.length === 1 && bindingPattern.parent.kind === 249 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 250 /* VariableDeclarationList */) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 246 /* VariableDeclaration */ && bindingPattern.parent.parent.kind === 247 /* VariableDeclarationList */) { addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); } else { @@ -73789,7 +71864,7 @@ var ts; if (declarationList.declarations.length === declarations.length) { addDiagnostic(declarationList, 0 /* Local */, declarations.length === 1 ? ts.createDiagnosticForNode(ts.first(declarations).name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts.first(declarations).name)) - : ts.createDiagnosticForNode(declarationList.parent.kind === 232 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); + : ts.createDiagnosticForNode(declarationList.parent.kind === 229 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused)); } else { for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { @@ -73803,22 +71878,22 @@ var ts; switch (name.kind) { case 78 /* Identifier */: return ts.idText(name); - case 197 /* ArrayBindingPattern */: - case 196 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: return bindingNameText(ts.cast(ts.first(name.elements), ts.isBindingElement).name); default: return ts.Debug.assertNever(name); } } function isImportedDeclaration(node) { - return node.kind === 262 /* ImportClause */ || node.kind === 265 /* ImportSpecifier */ || node.kind === 263 /* NamespaceImport */; + return node.kind === 259 /* ImportClause */ || node.kind === 262 /* ImportSpecifier */ || node.kind === 260 /* NamespaceImport */; } function importClauseFromImported(decl) { - return decl.kind === 262 /* ImportClause */ ? decl : decl.kind === 263 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + return decl.kind === 259 /* ImportClause */ ? decl : decl.kind === 260 /* NamespaceImport */ ? decl.parent : decl.parent.parent; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 230 /* Block */) { + if (node.kind === 227 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -73848,12 +71923,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 163 /* PropertyDeclaration */ || - node.kind === 162 /* PropertySignature */ || - node.kind === 165 /* MethodDeclaration */ || - node.kind === 164 /* MethodSignature */ || - node.kind === 167 /* GetAccessor */ || - node.kind === 168 /* SetAccessor */) { + if (node.kind === 162 /* PropertyDeclaration */ || + node.kind === 161 /* PropertySignature */ || + node.kind === 164 /* MethodDeclaration */ || + node.kind === 163 /* MethodSignature */ || + node.kind === 166 /* GetAccessor */ || + node.kind === 167 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -73862,7 +71937,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 160 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 159 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -73919,7 +71994,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -73934,7 +72009,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 297 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { + if (parent.kind === 294 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 2048 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. errorSkippedOn("noEmit", name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -73969,7 +72044,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 249 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 246 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -73981,17 +72056,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 250 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 232 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 247 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 229 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 230 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 257 /* ModuleBlock */ || - container.kind === 256 /* ModuleDeclaration */ || - container.kind === 297 /* SourceFile */); + (container.kind === 227 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 254 /* ModuleBlock */ || + container.kind === 253 /* ModuleDeclaration */ || + container.kind === 294 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -74022,18 +72097,18 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 158 /* ComputedPropertyName */) { + if (node.name.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 198 /* BindingElement */) { - if (node.parent.kind === 196 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { + if (node.kind === 195 /* BindingElement */) { + if (node.parent.kind === 193 /* ObjectBindingPattern */ && languageVersion < 99 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 158 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 157 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access @@ -74054,19 +72129,19 @@ var ts; } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 197 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 194 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.isParameterDeclaration(node) && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 159 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { - var needCheckInitializer = node.initializer && node.parent.parent.kind !== 238 /* ForInStatement */; + var needCheckInitializer = node.initializer && node.parent.parent.kind !== 235 /* ForInStatement */; var needCheckWidenedType = node.name.elements.length === 0; if (needCheckInitializer || needCheckWidenedType) { // Don't validate for-in initializer as it is already an error @@ -74092,12 +72167,7 @@ var ts; } return; } - // For a commonjs `const x = require`, validate the alias and exit var symbol = getSymbolOfNode(node); - if (symbol.flags & 2097152 /* Alias */ && ts.isRequireVariableDeclaration(node, /*requireStringLiteralLikeArgument*/ true)) { - checkAliasSymbol(node); - return; - } var type = convertAutoToAny(getTypeOfSymbol(symbol)); if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer @@ -74108,7 +72178,7 @@ var ts; ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts.isPrototypeAccess(node.name)) && !!((_a = symbol.exports) === null || _a === void 0 ? void 0 : _a.size); - if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 238 /* ForInStatement */) { + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 235 /* ForInStatement */) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(initializer), type, node, initializer, /*headMessage*/ undefined); } } @@ -74134,10 +72204,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */) { + if (node.kind !== 162 /* PropertyDeclaration */ && node.kind !== 161 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithRequireExportsInGeneratedCode(node, node.name); @@ -74149,7 +72219,7 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 163 /* PropertyDeclaration */ || nextDeclaration.kind === 162 /* PropertySignature */ + var message = nextDeclaration.kind === 162 /* PropertyDeclaration */ || nextDeclaration.kind === 161 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; var declName = ts.declarationNameToString(nextDeclarationName); @@ -74159,8 +72229,8 @@ var ts; } } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 160 /* Parameter */ && right.kind === 249 /* VariableDeclaration */) || - (left.kind === 249 /* VariableDeclaration */ && right.kind === 160 /* Parameter */)) { + if ((left.kind === 159 /* Parameter */ && right.kind === 246 /* VariableDeclaration */) || + (left.kind === 246 /* VariableDeclaration */ && right.kind === 159 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -74176,10 +72246,8 @@ var ts; return ts.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts.getSelectedEffectiveModifierFlags(right, interestingFlags); } function checkVariableDeclaration(node) { - ts.tracing.push("check" /* Check */, "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end }); checkGrammarVariableDeclaration(node); - checkVariableLikeDeclaration(node); - ts.tracing.pop(); + return checkVariableLikeDeclaration(node); } function checkBindingElement(node) { checkGrammarBindingElement(node); @@ -74202,7 +72270,7 @@ var ts; var type = checkTruthinessExpression(node.expression); checkTestingKnownTruthyCallableType(node.expression, node.thenStatement, type); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 231 /* EmptyStatement */) { + if (node.thenStatement.kind === 228 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -74295,12 +72363,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 247 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -74334,14 +72402,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node); // There may be a destructuring assignment on the left side - if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) { + if (varExpr.kind === 196 /* ArrayLiteralExpression */ || varExpr.kind === 197 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -74373,7 +72441,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 250 /* VariableDeclarationList */) { + if (node.initializer.kind === 247 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -74387,7 +72455,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 199 /* ArrayLiteralExpression */ || varExpr.kind === 200 /* ObjectLiteralExpression */) { + if (varExpr.kind === 196 /* ArrayLiteralExpression */ || varExpr.kind === 197 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -74439,7 +72507,6 @@ var ts; } var uplevelIteration = languageVersion >= 2 /* ES2015 */; var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; - var possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & 128 /* PossiblyOutOfBounds */); // Get the iterated type of an `Iterable` or `IterableIterator` only in ES2015 // or higher, when inside of an async generator or for-await-if, or when // downlevelIteration is requested. @@ -74459,7 +72526,7 @@ var ts; } } if (iterationTypes || uplevelIteration) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType) : (iterationTypes && iterationTypes.yieldType); + return iterationTypes && iterationTypes.yieldType; } } var arrayType = inputType; @@ -74473,12 +72540,12 @@ var ts; // After we remove all types that are StringLike, we will know if there was a string constituent // based on whether the result of filter is a new array. var arrayTypes = inputType.types; - var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 402653316 /* StringLike */); }); + var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 132 /* StringLike */); }); if (filteredTypes !== arrayTypes) { arrayType = getUnionType(filteredTypes, 2 /* Subtype */); } } - else if (arrayType.flags & 402653316 /* StringLike */) { + else if (arrayType.flags & 132 /* StringLike */) { arrayType = neverType; } hasStringConstituent = arrayType !== inputType; @@ -74492,7 +72559,7 @@ var ts; // Now that we've removed all the StringLike types, if no constituents remain, then the entire // arrayOrStringType was a string. if (arrayType.flags & 131072 /* Never */) { - return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType; + return stringType; } } } @@ -74517,17 +72584,17 @@ var ts; : [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true], defaultDiagnostic = _a[0], maybeMissingAwait = _a[1]; errorAndMaybeSuggestAwait(errorNode, maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType), defaultDiagnostic, typeToString(arrayType)); } - return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType) : stringType : undefined; + return hasStringConstituent ? stringType : undefined; } var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */); if (hasStringConstituent && arrayElementType) { // This is just an optimization for the case where arrayOrStringType is string | string[] - if (arrayElementType.flags & 402653316 /* StringLike */ && !compilerOptions.noUncheckedIndexedAccess) { + if (arrayElementType.flags & 132 /* StringLike */) { return stringType; } - return getUnionType(possibleOutOfBounds ? [arrayElementType, stringType, undefinedType] : [arrayElementType, stringType], 2 /* Subtype */); + return getUnionType([arrayElementType, stringType], 2 /* Subtype */); } - return (use & 128 /* PossiblyOutOfBounds */) ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType; + return arrayElementType; } /** * Gets the requested "iteration type" from an `Iterable`-like or `AsyncIterable`-like type. @@ -74643,9 +72710,8 @@ var ts; if (iterationTypes_2 === noIterationTypes) { if (errorNode) { reportTypeNotIterableError(errorNode, type, !!(use & 2 /* AllowsAsyncIterablesFlag */)); + errorNode = undefined; } - setCachedIterationTypes(type, cacheKey, noIterationTypes); - return undefined; } else { allIterationTypes = ts.append(allIterationTypes, iterationTypes_2); @@ -74923,7 +72989,6 @@ var ts; * record is returned. Otherwise, we return `undefined`. */ function getIterationTypesOfMethod(type, resolver, methodName, errorNode) { - var _a, _b, _c, _d; var method = getPropertyOfType(type, methodName); // Ignore 'return' or 'throw' if they are missing. if (!method && methodName !== "next") { @@ -74947,24 +73012,6 @@ var ts; } return methodName === "next" ? anyIterationTypes : undefined; } - // If the method signature comes exclusively from the global iterator or generator type, - // create iteration types from its type arguments like `getIterationTypesOfIteratorFast` - // does (so as to remove `undefined` from the next and return types). We arrive here when - // a contextual type for a generator was not a direct reference to one of those global types, - // but looking up `methodType` referred to one of them (and nothing else). E.g., in - // `interface SpecialIterator extends Iterator {}`, `SpecialIterator` is not a - // reference to `Iterator`, but its `next` member derives exclusively from `Iterator`. - if ((methodType === null || methodType === void 0 ? void 0 : methodType.symbol) && methodSignatures.length === 1) { - var globalGeneratorType = resolver.getGlobalGeneratorType(/*reportErrors*/ false); - var globalIteratorType = resolver.getGlobalIteratorType(/*reportErrors*/ false); - var isGeneratorMethod = ((_b = (_a = globalGeneratorType.symbol) === null || _a === void 0 ? void 0 : _a.members) === null || _b === void 0 ? void 0 : _b.get(methodName)) === methodType.symbol; - var isIteratorMethod = !isGeneratorMethod && ((_d = (_c = globalIteratorType.symbol) === null || _c === void 0 ? void 0 : _c.members) === null || _d === void 0 ? void 0 : _d.get(methodName)) === methodType.symbol; - if (isGeneratorMethod || isIteratorMethod) { - var globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType; - var mapper = methodType.mapper; - return createIterationTypes(getMappedType(globalType.typeParameters[0], mapper), getMappedType(globalType.typeParameters[1], mapper), methodName === "next" ? getMappedType(globalType.typeParameters[2], mapper) : undefined); - } - } // Extract the first parameter and return type of each signature. var methodParameterTypes; var methodReturnTypes; @@ -75082,12 +73129,12 @@ var ts; var functionFlags = ts.getFunctionFlags(func); if (strictNullChecks || node.expression || returnType.flags & 131072 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 168 /* SetAccessor */) { + if (func.kind === 167 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 166 /* Constructor */) { + else if (func.kind === 165 /* Constructor */) { if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } @@ -75105,7 +73152,7 @@ var ts; } } } - else if (func.kind !== 166 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { + else if (func.kind !== 165 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -75134,7 +73181,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 285 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 282 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -75143,7 +73190,7 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 284 /* CaseClause */) { + if (produceDiagnostics && clause.kind === 281 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. @@ -75175,7 +73222,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 245 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 242 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } @@ -75204,15 +73251,11 @@ var ts; if (catchClause) { // Grammar checking if (catchClause.variableDeclaration) { - var declaration = catchClause.variableDeclaration; - if (declaration.type) { - var type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ false); - if (type && !(type.flags & 3 /* AnyOrUnknown */)) { - grammarErrorOnFirstToken(declaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); - } + if (catchClause.variableDeclaration.type && getTypeOfNode(catchClause.variableDeclaration) === errorType) { + grammarErrorOnFirstToken(catchClause.variableDeclaration.type, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); } - else if (declaration.initializer) { - grammarErrorOnFirstToken(declaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); + else if (catchClause.variableDeclaration.initializer) { + grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); } else { var blockLocals_1 = catchClause.block.locals; @@ -75289,8 +73332,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && name && - (propDeclaration.kind === 216 /* BinaryExpression */ || - name.kind === 158 /* ComputedPropertyName */ || + (propDeclaration.kind === 213 /* BinaryExpression */ || + name.kind === 157 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -75367,7 +73410,7 @@ var ts; function checkTypeParametersNotReferenced(root, typeParameters, index) { visit(root); function visit(node) { - if (node.kind === 173 /* TypeReference */) { + if (node.kind === 172 /* TypeReference */) { var type = getTypeFromTypeReference(node); if (type.flags & 262144 /* TypeParameter */) { for (var i = index; i < typeParameters.length; i++) { @@ -75478,7 +73521,6 @@ var ts; var typeWithThis = getTypeWithThisArgument(type); var staticType = getTypeOfSymbol(symbol); checkTypeParameterListsIdentical(symbol); - checkFunctionOrConstructorSymbol(symbol); checkClassForDuplicateDeclarations(node); // Only check for reserved static identifiers on non-ambient context. if (!(node.flags & 8388608 /* Ambient */)) { @@ -75569,7 +73611,7 @@ var ts; function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible var issuedMemberError = false; - var _loop_23 = function (member) { + var _loop_22 = function (member) { if (ts.hasStaticModifier(member)) { return "continue"; } @@ -75588,7 +73630,7 @@ var ts; }; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - _loop_23(member); + _loop_22(member); } if (!issuedMemberError) { // check again with diagnostics to generate a less-specific error @@ -75614,7 +73656,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 252 /* ClassDeclaration */ || d.kind === 253 /* InterfaceDeclaration */; + return d.kind === 249 /* ClassDeclaration */ || d.kind === 250 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -75669,7 +73711,7 @@ var ts; continue basePropertyCheck; } } - if (derivedClassDecl.kind === 221 /* ClassExpression */) { + if (derivedClassDecl.kind === 218 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -75690,7 +73732,7 @@ var ts; if (basePropertyFlags && derivedPropertyFlags) { // property/accessor is overridden with property/accessor if (baseDeclarationFlags & 128 /* Abstract */ && !(base.valueDeclaration && ts.isPropertyDeclaration(base.valueDeclaration) && base.valueDeclaration.initializer) - || base.valueDeclaration && base.valueDeclaration.parent.kind === 253 /* InterfaceDeclaration */ + || base.valueDeclaration && base.valueDeclaration.parent.kind === 250 /* InterfaceDeclaration */ || derived.valueDeclaration && ts.isBinaryExpression(derived.valueDeclaration)) { // when the base property is abstract or from an interface, base/derived flags don't need to match // same when the derived property is from an assignment @@ -75705,7 +73747,7 @@ var ts; error(ts.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString(base), typeToString(baseType), typeToString(type)); } else if (compilerOptions.useDefineForClassFields) { - var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 163 /* PropertyDeclaration */ && !d.initializer; }); + var uninitialized = ts.find(derived.declarations, function (d) { return d.kind === 162 /* PropertyDeclaration */ && !d.initializer; }); if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 128 /* Abstract */) @@ -75821,7 +73863,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 163 /* PropertyDeclaration */ && + return node.kind === 162 /* PropertyDeclaration */ && !ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -75845,7 +73887,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 253 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 250 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -75878,15 +73920,8 @@ var ts; checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); checkExportsOnMergedDeclarations(node); checkTypeParameters(node.typeParameters); - if (node.type.kind === 136 /* IntrinsicKeyword */) { - if (!intrinsicTypeKinds.has(node.name.escapedText) || ts.length(node.typeParameters) !== 1) { - error(node.type, ts.Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types); - } - } - else { - checkSourceElement(node.type); - registerForUnusedIdentifiersCheck(node); - } + checkSourceElement(node.type); + registerForUnusedIdentifiersCheck(node); } function computeEnumMemberValues(node) { var nodeLinks = getNodeLinks(node); @@ -75964,7 +73999,7 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: var value_2 = evaluate(expr.operand); if (typeof value_2 === "number") { switch (expr.operator) { @@ -75974,7 +74009,7 @@ var ts; } } break; - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -76003,7 +74038,7 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return evaluate(expr.expression); case 78 /* Identifier */: var identifier = expr; @@ -76011,14 +74046,14 @@ var ts; return +(identifier.escapedText); } return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); - case 202 /* ElementAccessExpression */: - case 201 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 201 /* PropertyAccessExpression */) { + if (ex.kind === 198 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -76051,8 +74086,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 78 /* Identifier */ || - node.kind === 201 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 202 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 198 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 199 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && ts.isStringLiteralLike(node.argumentExpression); } function checkEnumDeclaration(node) { @@ -76088,7 +74123,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 255 /* EnumDeclaration */) { + if (declaration.kind !== 252 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -76116,8 +74151,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { var declaration = declarations_8[_i]; - if ((declaration.kind === 252 /* ClassDeclaration */ || - (declaration.kind === 251 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 249 /* ClassDeclaration */ || + (declaration.kind === 248 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 8388608 /* Ambient */)) { return declaration; } @@ -76180,7 +74215,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 252 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 249 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -76230,23 +74265,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 198 /* BindingElement */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 246 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -76257,12 +74292,12 @@ var ts; break; } // falls through - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 251 /* FunctionDeclaration */: - case 253 /* InterfaceDeclaration */: - case 256 /* ModuleDeclaration */: - case 254 /* TypeAliasDeclaration */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 248 /* FunctionDeclaration */: + case 250 /* InterfaceDeclaration */: + case 253 /* ModuleDeclaration */: + case 251 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -76285,12 +74320,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return node; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: do { node = node.left; } while (node.kind !== 78 /* Identifier */); return node; - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: do { if (ts.isModuleExportsAccessExpression(node.expression) && !ts.isPrivateIdentifier(node.name)) { return node.name; @@ -76310,9 +74345,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 267 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 254 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 294 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 264 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -76346,14 +74381,14 @@ var ts; (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 270 /* ExportSpecifier */ ? + var message = node.kind === 267 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 270 /* ExportSpecifier */ + && node.kind === 267 /* ExportSpecifier */ && !node.parent.parent.isTypeOnly && !(target.flags & 111551 /* Value */) && !(node.flags & 8388608 /* Ambient */)) { @@ -76368,7 +74403,7 @@ var ts; checkCollisionWithRequireExportsInGeneratedCode(node, node.name); checkCollisionWithGlobalPromiseInGeneratedCode(node, node.name); checkAliasSymbol(node); - if (node.kind === 265 /* ImportSpecifier */ && + if (node.kind === 262 /* ImportSpecifier */ && ts.idText(node.propertyName || node.name) === "default" && compilerOptions.esModuleInterop && moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015) { @@ -76390,7 +74425,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 260 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); if (moduleKind !== ts.ModuleKind.System && moduleKind < ts.ModuleKind.ES2015 && compilerOptions.esModuleInterop) { // import * as ns from "foo"; @@ -76418,7 +74453,7 @@ var ts; if (ts.hasSyntacticModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 272 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 269 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 111551 /* Value */) { @@ -76458,10 +74493,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 257 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 257 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 254 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 254 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 8388608 /* Ambient */; - if (node.parent.kind !== 297 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 294 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -76494,14 +74529,14 @@ var ts; } function checkGrammarExportDeclaration(node) { var _a; - var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 268 /* NamedExports */; + var isTypeOnlyExportStar = node.isTypeOnly && ((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) !== 265 /* NamedExports */; if (isTypeOnlyExportStar) { grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type); } return !isTypeOnlyExportStar; } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 297 /* SourceFile */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 256 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 294 /* SourceFile */ || node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 253 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -76565,8 +74600,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 294 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 253 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -76591,9 +74626,6 @@ var ts; checkExpressionCached(node.expression); } } - else { - checkExpressionCached(node.expression); // doesn't resolve, check as expression to mark as error - } if (ts.getEmitDeclarations(compilerOptions)) { collectLinkedAliases(node.expression, /*setVisibility*/ true); } @@ -76683,171 +74715,169 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 256 /* ModuleDeclaration */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 251 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 248 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } - if (kind >= 232 /* FirstStatement */ && kind <= 248 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { + if (kind >= 229 /* FirstStatement */ && kind <= 245 /* LastStatement */ && node.flowNode && !isReachableFlowNode(node.flowNode)) { errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts.Diagnostics.Unreachable_code_detected); } switch (kind) { - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return checkTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return checkParameter(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return checkPropertyDeclaration(node); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return checkPropertySignature(node); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 169 /* CallSignature */: - case 170 /* ConstructSignature */: - case 171 /* IndexSignature */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 168 /* CallSignature */: + case 169 /* ConstructSignature */: + case 170 /* IndexSignature */: return checkSignatureDeclaration(node); - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: return checkMethodDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return checkConstructorDeclaration(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return checkAccessorDeclaration(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return checkTypeReferenceNode(node); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return checkTypePredicate(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return checkTypeQuery(node); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return checkTypeLiteral(node); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return checkArrayType(node); - case 179 /* TupleType */: + case 178 /* TupleType */: return checkTupleType(node); - case 182 /* UnionType */: - case 183 /* IntersectionType */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 186 /* ParenthesizedType */: - case 180 /* OptionalType */: - case 181 /* RestType */: + case 185 /* ParenthesizedType */: + case 179 /* OptionalType */: + case 180 /* RestType */: return checkSourceElement(node.type); - case 187 /* ThisType */: + case 186 /* ThisType */: return checkThisType(node); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return checkTypeOperator(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return checkConditionalType(node); - case 185 /* InferType */: + case 184 /* InferType */: return checkInferType(node); - case 193 /* TemplateLiteralType */: - return checkTemplateLiteralType(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return checkImportType(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return checkNamedTupleMember(node); - case 315 /* JSDocAugmentsTag */: + case 311 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 316 /* JSDocImplementsTag */: + case 312 /* JSDocImplementsTag */: return checkJSDocImplementsTag(node); - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return checkJSDocTypeAliasTag(node); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return checkJSDocTemplateTag(node); - case 329 /* JSDocTypeTag */: + case 325 /* JSDocTypeTag */: return checkJSDocTypeTag(node); - case 326 /* JSDocParameterTag */: + case 322 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 333 /* JSDocPropertyTag */: + case 328 /* JSDocPropertyTag */: return checkJSDocPropertyTag(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: checkJSDocFunctionType(node); // falls through - case 306 /* JSDocNonNullableType */: - case 305 /* JSDocNullableType */: - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: - case 312 /* JSDocTypeLiteral */: + case 302 /* JSDocNonNullableType */: + case 301 /* JSDocNullableType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: + case 308 /* JSDocTypeLiteral */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 309 /* JSDocVariadicType */: + case 305 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 301 /* JSDocTypeExpression */: + case 298 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return checkMappedType(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 230 /* Block */: - case 257 /* ModuleBlock */: + case 227 /* Block */: + case 254 /* ModuleBlock */: return checkBlock(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return checkVariableStatement(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return checkExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return checkIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return checkDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return checkWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return checkForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return checkForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return checkForOfStatement(node); - case 240 /* ContinueStatement */: - case 241 /* BreakStatement */: + case 237 /* ContinueStatement */: + case 238 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return checkReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return checkWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return checkSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return checkLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return checkThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return checkTryStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return checkBindingElement(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return checkClassDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return checkImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return checkExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return checkExportAssignment(node); - case 231 /* EmptyStatement */: - case 248 /* DebuggerStatement */: + case 228 /* EmptyStatement */: + case 245 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -76942,46 +74972,43 @@ var ts; currentNode = node; instantiationCount = 0; switch (node.kind) { - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 205 /* TaggedTemplateExpression */: - case 161 /* Decorator */: - case 275 /* JsxOpeningElement */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 202 /* TaggedTemplateExpression */: + case 160 /* Decorator */: + case 272 /* JsxOpeningElement */: // These node kinds are deferred checked when overload resolution fails // To save on work, we ensure the arguments are checked just once, in // a deferred way resolveUntypedCall(node); break; - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: checkClassExpressionDeferred(node); break; - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: checkJsxSelfClosingElementDeferred(node); break; - case 273 /* JsxElement */: + case 270 /* JsxElement */: checkJsxElementDeferred(node); break; } currentNode = saveCurrentNode; } function checkSourceFile(node) { - var tracingData = ["check" /* Check */, "checkSourceFile", { path: node.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeCheck"); checkSourceFileWorker(node); ts.performance.mark("afterCheck"); ts.performance.measure("Check", "beforeCheck", "afterCheck"); - ts.tracing.end.apply(ts.tracing, tracingData); } function unusedIsError(kind, isAmbient) { if (isAmbient) { @@ -77114,17 +75141,17 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 297 /* SourceFile */: + case 294 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; // falls through - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -77132,8 +75159,8 @@ var ts; // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration. // falls through - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -77142,7 +75169,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 788968 /* Type */); } break; - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -77190,19 +75217,19 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 159 /* TypeParameter */: - case 252 /* ClassDeclaration */: - case 253 /* InterfaceDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 331 /* JSDocTypedefTag */: - case 324 /* JSDocCallbackTag */: - case 325 /* JSDocEnumTag */: + case 158 /* TypeParameter */: + case 249 /* ClassDeclaration */: + case 250 /* InterfaceDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 327 /* JSDocTypedefTag */: + case 320 /* JSDocCallbackTag */: + case 321 /* JSDocEnumTag */: return true; - case 262 /* ImportClause */: + case 259 /* ImportClause */: return node.isTypeOnly; - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return node.parent.parent.isTypeOnly; default: return false; @@ -77210,25 +75237,16 @@ var ts; } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(node) { - while (node.parent.kind === 157 /* QualifiedName */) { + while (node.parent.kind === 156 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 173 /* TypeReference */; + return node.parent.kind === 172 /* TypeReference */; } function isHeritageClauseElementIdentifier(node) { - while (node.parent.kind === 201 /* PropertyAccessExpression */) { + while (node.parent.kind === 198 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent.kind === 223 /* ExpressionWithTypeArguments */; - } - function isJSDocEntryNameReference(node) { - while (node.parent.kind === 157 /* QualifiedName */) { - node = node.parent; - } - while (node.parent.kind === 201 /* PropertyAccessExpression */) { - node = node.parent; - } - return node.parent.kind === 302 /* JSDocNameReference */; + return node.parent.kind === 220 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -77256,13 +75274,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 157 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 156 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 260 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 257 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } - if (nodeOnRightSide.parent.kind === 266 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 263 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : undefined; } return undefined; @@ -77288,7 +75306,7 @@ var ts; node = parent; parent = parent.parent; } - if (parent && parent.kind === 195 /* ImportType */ && parent.qualifier === node) { + if (parent && parent.kind === 192 /* ImportType */ && parent.qualifier === node) { return parent; } return undefined; @@ -77298,7 +75316,7 @@ var ts; return getSymbolOfNode(name.parent); } if (ts.isInJSFile(name) && - name.parent.kind === 201 /* PropertyAccessExpression */ && + name.parent.kind === 198 /* PropertyAccessExpression */ && name.parent === name.parent.parent.left) { // Check if this is a special property assignment if (!ts.isPrivateIdentifier(name)) { @@ -77308,7 +75326,7 @@ var ts; } } } - if (name.parent.kind === 266 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { + if (name.parent.kind === 263 /* ExportAssignment */ && ts.isEntityNameExpression(name)) { // Even an entity name expression that doesn't resolve as an entityname may still typecheck as a property access expression var success = resolveEntityName(name, /*all meanings*/ 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*ignoreErrors*/ true); @@ -77318,7 +75336,7 @@ var ts; } else if (!ts.isPropertyAccessExpression(name) && !ts.isPrivateIdentifier(name) && isInRightSideOfImportOrExportAssignment(name)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(name, 260 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(name, 257 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(name, /*dontResolveAlias*/ true); } @@ -77336,7 +75354,7 @@ var ts; if (isHeritageClauseElementIdentifier(name)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (name.parent.kind === 223 /* ExpressionWithTypeArguments */) { + if (name.parent.kind === 220 /* ExpressionWithTypeArguments */) { meaning = 788968 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(name.parent)) { @@ -77352,10 +75370,10 @@ var ts; return entityNameSymbol; } } - if (name.parent.kind === 326 /* JSDocParameterTag */) { + if (name.parent.kind === 322 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(name.parent); } - if (name.parent.kind === 159 /* TypeParameter */ && name.parent.parent.kind === 330 /* JSDocTemplateTag */) { + if (name.parent.kind === 158 /* TypeParameter */ && name.parent.parent.kind === 326 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJSFile(name)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(name.parent); return typeParameter && typeParameter.symbol; @@ -77372,12 +75390,12 @@ var ts; } return resolveEntityName(name, 111551 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (name.kind === 201 /* PropertyAccessExpression */ || name.kind === 157 /* QualifiedName */) { + else if (name.kind === 198 /* PropertyAccessExpression */ || name.kind === 156 /* QualifiedName */) { var links = getNodeLinks(name); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (name.kind === 201 /* PropertyAccessExpression */) { + if (name.kind === 198 /* PropertyAccessExpression */) { checkPropertyAccessExpression(name); } else { @@ -77387,21 +75405,17 @@ var ts; } } else if (isTypeReferenceIdentifier(name)) { - var meaning = name.parent.kind === 173 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; + var meaning = name.parent.kind === 172 /* TypeReference */ ? 788968 /* Type */ : 1920 /* Namespace */; return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (isJSDocEntryNameReference(name)) { - var meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */; - return resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true, ts.getHostSignatureFromJSDoc(name)); - } - if (name.parent.kind === 172 /* TypePredicate */) { + if (name.parent.kind === 171 /* TypePredicate */) { return resolveEntityName(name, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node, ignoreErrors) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } var parent = node.parent; @@ -77424,8 +75438,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfNameOrPropertyAccessExpression(node); } - else if (parent.kind === 198 /* BindingElement */ && - grandParent.kind === 196 /* ObjectBindingPattern */ && + else if (parent.kind === 195 /* BindingElement */ && + grandParent.kind === 193 /* ObjectBindingPattern */ && node === parent.propertyName) { var typeOfPattern = getTypeOfNode(grandParent); var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); @@ -77437,8 +75451,8 @@ var ts; switch (node.kind) { case 78 /* Identifier */: case 79 /* PrivateIdentifier */: - case 201 /* PropertyAccessExpression */: - case 157 /* QualifiedName */: + case 198 /* PropertyAccessExpression */: + case 156 /* QualifiedName */: return getSymbolOfNameOrPropertyAccessExpression(node); case 107 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -77452,14 +75466,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 187 /* ThisType */: + case 186 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 105 /* SuperKeyword */: return checkExpression(node).symbol; case 132 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 166 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 165 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -77470,7 +75484,7 @@ var ts; // 3). Dynamic import call or require in javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 261 /* ImportDeclaration */ || node.parent.kind === 267 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 258 /* ImportDeclaration */ || node.parent.kind === 264 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJSFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteralLike*/ false)) || ts.isImportCall(node.parent)) || (ts.isLiteralTypeNode(node.parent) && ts.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent)) { return resolveExternalModuleName(node, node, ignoreErrors); @@ -77492,7 +75506,7 @@ var ts; case 38 /* EqualsGreaterThanToken */: case 83 /* ClassKeyword */: return getSymbolOfNode(node.parent); - case 195 /* ImportType */: + case 192 /* ImportType */: return ts.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : undefined; case 92 /* ExportKeyword */: return ts.isExportAssignment(node.parent) ? ts.Debug.checkDefined(node.parent.symbol) : undefined; @@ -77501,26 +75515,18 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 289 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 286 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 111551 /* Value */ | 2097152 /* Alias */); } return undefined; } /** Returns the target of an export specifier without following aliases */ function getExportSpecifierLocalTargetSymbol(node) { - if (ts.isExportSpecifier(node)) { - return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); - } - else { - return resolveEntityName(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); - } + return node.parent.parent.moduleSpecifier ? + getExternalModuleMember(node.parent.parent, node) : + resolveEntityName(node.propertyName || node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } function getTypeOfNode(node) { - if (ts.isSourceFile(node) && !ts.isExternalModule(node)) { - return errorType; - } if (node.flags & 16777216 /* InWithStatement */) { // We cannot answer semantic questions within a with block, do not proceed any further return errorType; @@ -77580,23 +75586,23 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfAssignmentPattern(expr) { - ts.Debug.assert(expr.kind === 200 /* ObjectLiteralExpression */ || expr.kind === 199 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 197 /* ObjectLiteralExpression */ || expr.kind === 196 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 239 /* ForOfStatement */) { + if (expr.parent.kind === 236 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 216 /* BinaryExpression */) { + if (expr.parent.kind === 213 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || errorType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 288 /* PropertyAssignment */) { + if (expr.parent.kind === 285 /* PropertyAssignment */) { var node_2 = ts.cast(expr.parent.parent, ts.isObjectLiteralExpression); var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_2) || errorType; var propertyIndex = ts.indexOfNode(node_2.properties, expr.parent); @@ -77644,7 +75650,7 @@ var ts; case 8 /* NumericLiteral */: case 10 /* StringLiteral */: return getLiteralType(name.text); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(name); return isTypeAssignableToKind(nameType, 12288 /* ESSymbolLike */) ? nameType : stringType; default: @@ -77761,7 +75767,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 297 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 294 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -77776,9 +75782,6 @@ var ts; // When resolved as an expression identifier, if the given node references an import, return the declaration of // that import. Otherwise, return undefined. function getReferencedImportDeclaration(nodeIn) { - if (nodeIn.generatedImportReference) { - return nodeIn.generatedImportReference; - } var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier); if (node) { var symbol = getReferencedValueSymbol(node); @@ -77792,7 +75795,7 @@ var ts; } function isSymbolOfDestructuredElementOfCatchBinding(symbol) { return ts.isBindingElement(symbol.valueDeclaration) - && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 287 /* CatchClause */; + && ts.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 284 /* CatchClause */; } function isSymbolOfDeclarationWithCollidingName(symbol) { if (symbol.flags & 418 /* BlockScoped */ && !ts.isSourceFile(symbol.valueDeclaration)) { @@ -77823,7 +75826,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 524288 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 230 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 227 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -77864,19 +75867,19 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 262 /* ImportClause */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 259 /* ImportClause */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: var symbol = getSymbolOfNode(node) || unknownSymbol; return isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportClause = node.exportClause; return !!exportClause && (ts.isNamespaceExport(exportClause) || ts.some(exportClause.elements, isValueAliasDeclaration)); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return node.expression && node.expression.kind === 78 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) : true; @@ -77885,7 +75888,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(nodeIn) { var node = ts.getParseTreeNode(nodeIn, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 297 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 294 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -77992,15 +75995,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 291 /* EnumMember */: - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 288 /* EnumMember */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 291 /* EnumMember */) { + if (node.kind === 288 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -78066,7 +76069,7 @@ var ts; else if (isTypeAssignableToKind(type, 2112 /* BigIntLike */)) { return ts.TypeReferenceSerializationKind.BigIntLikeType; } - else if (isTypeAssignableToKind(type, 402653316 /* StringLike */)) { + else if (isTypeAssignableToKind(type, 132 /* StringLike */)) { return ts.TypeReferenceSerializationKind.StringLikeType; } else if (isTupleType(type)) { @@ -78269,12 +76272,12 @@ var ts; getJsxFragmentFactoryEntity: getJsxFragmentFactoryEntity, getAllAccessorDeclarations: function (accessor) { accessor = ts.getParseTreeNode(accessor, ts.isGetOrSetAccessorDeclaration); // TODO: GH#18217 - var otherKind = accessor.kind === 168 /* SetAccessor */ ? 167 /* GetAccessor */ : 168 /* SetAccessor */; + var otherKind = accessor.kind === 167 /* SetAccessor */ ? 166 /* GetAccessor */ : 167 /* SetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); var firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; var secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - var setAccessor = accessor.kind === 168 /* SetAccessor */ ? accessor : otherAccessor; - var getAccessor = accessor.kind === 167 /* GetAccessor */ ? accessor : otherAccessor; + var setAccessor = accessor.kind === 167 /* SetAccessor */ ? accessor : otherAccessor; + var getAccessor = accessor.kind === 166 /* GetAccessor */ ? accessor : otherAccessor; return { firstAccessor: firstAccessor, secondAccessor: secondAccessor, @@ -78290,7 +76293,7 @@ var ts; }, getDeclarationStatementsForSourceFile: function (node, flags, tracker, bundled) { var n = ts.getParseTreeNode(node); - ts.Debug.assert(n && n.kind === 297 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + ts.Debug.assert(n && n.kind === 294 /* SourceFile */, "Non-sourcefile node passed into getDeclarationsForSourceFile"); var sym = getSymbolOfNode(node); if (!sym) { return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); @@ -78325,7 +76328,7 @@ var ts; return false; } function isInHeritageClause(node) { - return node.parent && node.parent.kind === 223 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 286 /* HeritageClause */; + return node.parent && node.parent.kind === 220 /* ExpressionWithTypeArguments */ && node.parent.parent && node.parent.parent.kind === 283 /* HeritageClause */; } // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -78337,7 +76340,7 @@ var ts; // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries var meaning = 788968 /* Type */ | 1920 /* Namespace */; - if ((node.kind === 78 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 201 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { + if ((node.kind === 78 /* Identifier */ && isInTypeQuery(node)) || (node.kind === 198 /* PropertyAccessExpression */ && !isInHeritageClause(node))) { meaning = 111551 /* Value */ | 1048576 /* ExportValue */; } var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -78388,7 +76391,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 297 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 294 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -78416,12 +76419,12 @@ var ts; } } function getExternalModuleFileFromDeclaration(declaration) { - var specifier = declaration.kind === 256 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); + var specifier = declaration.kind === 253 /* ModuleDeclaration */ ? ts.tryCast(declaration.name, ts.isStringLiteral) : ts.getExternalModuleName(declaration); var moduleSymbol = resolveExternalModuleNameWorker(specifier, specifier, /*moduleNotFoundError*/ undefined); // TODO: GH#18217 if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 297 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 294 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -78615,14 +76618,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 165 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 164 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 167 /* GetAccessor */ || node.kind === 168 /* SetAccessor */) { + else if (node.kind === 166 /* GetAccessor */ || node.kind === 167 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -78639,17 +76642,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 142 /* ReadonlyKeyword */) { - if (node.kind === 162 /* PropertySignature */ || node.kind === 164 /* MethodSignature */) { + if (modifier.kind !== 141 /* ReadonlyKeyword */) { + if (node.kind === 161 /* PropertySignature */ || node.kind === 163 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 171 /* IndexSignature */) { + if (node.kind === 170 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 84 /* ConstKeyword */: - if (node.kind !== 255 /* EnumDeclaration */) { + if (node.kind !== 252 /* EnumDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(84 /* ConstKeyword */)); } break; @@ -78669,7 +76672,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + else if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -78695,10 +76698,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + else if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -78710,11 +76713,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 163 /* PropertyDeclaration */ && node.kind !== 162 /* PropertySignature */ && node.kind !== 171 /* IndexSignature */ && node.kind !== 160 /* Parameter */) { + else if (node.kind !== 162 /* PropertyDeclaration */ && node.kind !== 161 /* PropertySignature */ && node.kind !== 170 /* IndexSignature */ && node.kind !== 159 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -78735,16 +76738,16 @@ var ts; return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } else if (ts.isClassLike(node.parent)) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 87 /* DefaultKeyword */: - var container = node.parent.kind === 297 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 256 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 294 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 253 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; @@ -78757,12 +76760,12 @@ var ts; return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } else if (ts.isClassLike(node.parent) && !ts.isPropertyDeclaration(node)) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); + return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 257 /* ModuleBlock */) { + else if ((node.parent.flags & 8388608 /* Ambient */) && node.parent.kind === 254 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } else if (ts.isPrivateIdentifierPropertyDeclaration(node)) { @@ -78775,14 +76778,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 252 /* ClassDeclaration */) { - if (node.kind !== 165 /* MethodDeclaration */ && - node.kind !== 163 /* PropertyDeclaration */ && - node.kind !== 167 /* GetAccessor */ && - node.kind !== 168 /* SetAccessor */) { + if (node.kind !== 249 /* ClassDeclaration */) { + if (node.kind !== 164 /* MethodDeclaration */ && + node.kind !== 162 /* PropertyDeclaration */ && + node.kind !== 166 /* GetAccessor */ && + node.kind !== 167 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 252 /* ClassDeclaration */ && ts.hasSyntacticModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 249 /* ClassDeclaration */ && ts.hasSyntacticModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -78791,9 +76794,6 @@ var ts; if (flags & 8 /* Private */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); } - if (flags & 256 /* Async */ && lastAsync) { - return grammarErrorOnNode(lastAsync, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } } if (ts.isNamedDeclaration(node) && node.name.kind === 79 /* PrivateIdentifier */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); @@ -78807,18 +76807,15 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 160 /* Parameter */) { + else if (node.kind === 159 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } - if (flags & 128 /* Abstract */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); - } flags |= 256 /* Async */; lastAsync = modifier; break; } } - if (node.kind === 166 /* Constructor */) { + if (node.kind === 165 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -78833,13 +76830,13 @@ var ts; } return false; } - else if ((node.kind === 261 /* ImportDeclaration */ || node.kind === 260 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 258 /* ImportDeclaration */ || node.kind === 257 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 159 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 160 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 159 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -78860,37 +76857,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: - case 171 /* IndexSignature */: - case 256 /* ModuleDeclaration */: - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: - case 160 /* Parameter */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: + case 170 /* IndexSignature */: + case 253 /* ModuleDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: + case 159 /* Parameter */: return false; default: - if (node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + if (node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { return false; } switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 129 /* AsyncKeyword */); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 125 /* AbstractKeyword */); - case 253 /* InterfaceDeclaration */: - case 232 /* VariableStatement */: - case 254 /* TypeAliasDeclaration */: + case 250 /* InterfaceDeclaration */: + case 229 /* VariableStatement */: + case 251 /* TypeAliasDeclaration */: return true; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 84 /* ConstKeyword */); default: ts.Debug.fail(); @@ -78903,10 +76900,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 165 /* MethodDeclaration */: - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: - case 209 /* ArrowFunction */: + case 164 /* MethodDeclaration */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: + case 206 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -79025,7 +77022,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 147 /* StringKeyword */ && parameter.type.kind !== 144 /* NumberKeyword */) { + if (parameter.type.kind !== 146 /* StringKeyword */ && parameter.type.kind !== 143 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 4 /* String */ || type.flags & 8 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(node.type ? getTypeFromTypeNode(node.type) : anyType)); @@ -79067,7 +77064,7 @@ var ts; if (args) { for (var _i = 0, args_4 = args; _i < args_4.length; _i++) { var arg = args_4[_i]; - if (arg.kind === 222 /* OmittedExpression */) { + if (arg.kind === 219 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -79144,20 +77141,20 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 158 /* ComputedPropertyName */) { + if (node.kind !== 157 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 216 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { + if (computedPropertyName.expression.kind === 213 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 27 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } return false; } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 251 /* FunctionDeclaration */ || - node.kind === 208 /* FunctionExpression */ || - node.kind === 165 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 248 /* FunctionDeclaration */ || + node.kind === 205 /* FunctionExpression */ || + node.kind === 164 /* MethodDeclaration */); if (node.flags & 8388608 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -79176,7 +77173,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 290 /* SpreadAssignment */) { + if (prop.kind === 287 /* SpreadAssignment */) { if (inDestructuring) { // a rest property cannot be destructured any further var expression = ts.skipParentheses(prop.expression); @@ -79187,11 +77184,11 @@ var ts; continue; } var name = prop.name; - if (name.kind === 158 /* ComputedPropertyName */) { + if (name.kind === 157 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 289 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 286 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern); @@ -79204,7 +77201,7 @@ var ts; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { // TODO: GH#19955 var mod = _c[_b]; - if (mod.kind !== 129 /* AsyncKeyword */ || prop.kind !== 165 /* MethodDeclaration */) { + if (mod.kind !== 129 /* AsyncKeyword */ || prop.kind !== 164 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -79219,10 +77216,10 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); // falls through - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { @@ -79230,13 +77227,13 @@ var ts; } currentKind = 4 /* PropertyAssignment */; break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: currentKind = 8 /* Method */; break; - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: currentKind = 1 /* GetAccessor */; break; - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: currentKind = 2 /* SetAccessor */; break; default: @@ -79275,7 +77272,7 @@ var ts; var seen = new ts.Map(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 282 /* JsxSpreadAttribute */) { + if (attr.kind === 279 /* JsxSpreadAttribute */) { continue; } var name = attr.name, initializer = attr.initializer; @@ -79285,7 +77282,7 @@ var ts; else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - if (initializer && initializer.kind === 283 /* JsxExpression */ && !initializer.expression) { + if (initializer && initializer.kind === 280 /* JsxExpression */ && !initializer.expression) { return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } @@ -79299,14 +77296,14 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 239 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 236 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 32768 /* AwaitContext */) === 0 /* None */) { // use of 'for-await-of' in non-async function var sourceFile = ts.getSourceFileOfNode(forInOrOfStatement); if (!hasParseDiagnostics(sourceFile)) { var diagnostic = ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); var func = ts.getContainingFunction(forInOrOfStatement); - if (func && func.kind !== 166 /* Constructor */) { + if (func && func.kind !== 165 /* Constructor */) { ts.Debug.assert((ts.getFunctionFlags(func) & 2 /* Async */) === 0, "Enclosing function should never be an async function."); var relatedInfo = ts.createDiagnosticForNode(func, ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async); ts.addRelatedInfo(diagnostic, relatedInfo); @@ -79317,7 +77314,7 @@ var ts; return false; } } - if (forInOrOfStatement.initializer.kind === 250 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 247 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -79332,20 +77329,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 238 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 235 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -79370,11 +77367,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, accessor.kind === 167 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, accessor.kind === 166 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - if (accessor.kind === 168 /* SetAccessor */) { + if (accessor.kind === 167 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -79396,17 +77393,17 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 166 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 167 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 166 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 151 /* UniqueKeyword */) { - if (node.type.kind !== 148 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(148 /* SymbolKeyword */)); + if (node.operator === 150 /* UniqueKeyword */) { + if (node.type.kind !== 147 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(147 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) { @@ -79417,7 +77414,7 @@ var ts; } } switch (parent.kind) { - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 78 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -79429,13 +77426,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: if (!ts.hasSyntacticModifier(parent, 32 /* Static */) || !ts.hasEffectiveModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: if (!ts.hasSyntacticModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -79444,9 +77441,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_are_not_allowed_here); } } - else if (node.operator === 142 /* ReadonlyKeyword */) { - if (node.type.kind !== 178 /* ArrayType */ && node.type.kind !== 179 /* TupleType */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(148 /* SymbolKeyword */)); + else if (node.operator === 141 /* ReadonlyKeyword */) { + if (node.type.kind !== 177 /* ArrayType */ && node.type.kind !== 178 /* TupleType */) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts.tokenToString(147 /* SymbolKeyword */)); } } } @@ -79459,8 +77456,8 @@ var ts; if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.kind === 165 /* MethodDeclaration */) { - if (node.parent.kind === 200 /* ObjectLiteralExpression */) { + if (node.kind === 164 /* MethodDeclaration */) { + if (node.parent.kind === 197 /* ObjectLiteralExpression */) { // We only disallow modifier on a method declaration if it is a property of object-literal-expression if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 129 /* AsyncKeyword */)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); @@ -79488,14 +77485,14 @@ var ts; if (node.flags & 8388608 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.kind === 165 /* MethodDeclaration */ && !node.body) { + else if (node.kind === 164 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 253 /* InterfaceDeclaration */) { + else if (node.parent.kind === 250 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 177 /* TypeLiteral */) { + else if (node.parent.kind === 176 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -79506,11 +77503,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 240 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 237 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -79518,8 +77515,8 @@ var ts; return false; } break; - case 244 /* SwitchStatement */: - if (node.kind === 241 /* BreakStatement */ && !node.label) { + case 241 /* SwitchStatement */: + if (node.kind === 238 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -79534,13 +77531,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 241 /* BreakStatement */ + var message = node.kind === 238 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 241 /* BreakStatement */ + var message = node.kind === 238 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -79564,12 +77561,12 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return ts.isStringOrNumericLiteralLike(expr) || - expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 211 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function isBigIntLiteralExpression(expr) { return expr.kind === 9 /* BigIntLiteral */ || - expr.kind === 214 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && + expr.kind === 211 /* PrefixUnaryExpression */ && expr.operator === 40 /* MinusToken */ && expr.operand.kind === 9 /* BigIntLiteral */; } function isSimpleLiteralEnumReference(expr) { @@ -79600,7 +77597,7 @@ var ts; } } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 238 /* ForInStatement */ && node.parent.parent.kind !== 239 /* ForOfStatement */) { + if (node.parent.parent.kind !== 235 /* ForInStatement */ && node.parent.parent.kind !== 236 /* ForOfStatement */) { if (node.flags & 8388608 /* Ambient */) { checkAmbientInitializer(node); } @@ -79613,11 +77610,8 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 232 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { - var message = node.initializer - ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions - : ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations; - return grammarErrorOnNode(node.exclamationToken, message); + if (node.exclamationToken && (node.parent.parent.kind !== 229 /* VariableStatement */ || !node.type || node.initializer || node.flags & 8388608 /* Ambient */)) { + return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation); } var moduleKind = ts.getEmitModuleKind(compilerOptions); if (moduleKind < ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.System && @@ -79679,15 +77673,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 234 /* IfStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 243 /* WithStatement */: - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 231 /* IfStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 240 /* WithStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: return false; - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -79779,7 +77773,7 @@ var ts; return grammarErrorOnNode(node.name, ts.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); } } - else if (node.parent.kind === 253 /* InterfaceDeclaration */) { + else if (node.parent.kind === 250 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -79787,7 +77781,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 177 /* TypeLiteral */) { + else if (node.parent.kind === 176 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -79800,12 +77794,7 @@ var ts; } if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || node.flags & 8388608 /* Ambient */ || ts.hasSyntacticModifier(node, 32 /* Static */ | 128 /* Abstract */))) { - var message = node.initializer - ? ts.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions - : !node.type - ? ts.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations - : ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; - return grammarErrorOnNode(node.exclamationToken, message); + return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { @@ -79821,13 +77810,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 253 /* InterfaceDeclaration */ || - node.kind === 254 /* TypeAliasDeclaration */ || - node.kind === 261 /* ImportDeclaration */ || - node.kind === 260 /* ImportEqualsDeclaration */ || - node.kind === 267 /* ExportDeclaration */ || - node.kind === 266 /* ExportAssignment */ || - node.kind === 259 /* NamespaceExportDeclaration */ || + if (node.kind === 250 /* InterfaceDeclaration */ || + node.kind === 251 /* TypeAliasDeclaration */ || + node.kind === 258 /* ImportDeclaration */ || + node.kind === 257 /* ImportEqualsDeclaration */ || + node.kind === 264 /* ExportDeclaration */ || + node.kind === 263 /* ExportAssignment */ || + node.kind === 256 /* NamespaceExportDeclaration */ || ts.hasSyntacticModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -79836,7 +77825,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 232 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 229 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -79859,7 +77848,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 230 /* Block */ || node.parent.kind === 257 /* ModuleBlock */ || node.parent.kind === 297 /* SourceFile */) { + if (node.parent.kind === 227 /* Block */ || node.parent.kind === 254 /* ModuleBlock */ || node.parent.kind === 294 /* SourceFile */) { var links_2 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_2.hasReportedStatementInAmbientContext) { @@ -79881,10 +77870,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 191 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 190 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 291 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 288 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -80059,14 +78048,14 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 251 /* FunctionDeclaration */ && declaration.kind !== 165 /* MethodDeclaration */) || + return (declaration.kind !== 248 /* FunctionDeclaration */ && declaration.kind !== 164 /* MethodDeclaration */) || !!declaration.body; } /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 265 /* ImportSpecifier */: - case 270 /* ExportSpecifier */: + case 262 /* ImportSpecifier */: + case 267 /* ExportSpecifier */: return ts.isIdentifier(name); default: return ts.isDeclarationName(name); @@ -80074,14 +78063,14 @@ var ts; } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 262 /* ImportClause */: // For default import - case 260 /* ImportEqualsDeclaration */: - case 263 /* NamespaceImport */: - case 265 /* ImportSpecifier */: // For rename import `x as y` + case 259 /* ImportClause */: // For default import + case 257 /* ImportEqualsDeclaration */: + case 260 /* NamespaceImport */: + case 262 /* ImportSpecifier */: // For rename import `x as y` return true; case 78 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 265 /* ImportSpecifier */; + return decl.parent.kind === 262 /* ImportSpecifier */; default: return false; } @@ -80313,7 +78302,7 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 156 /* LastToken */) || kind === 187 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 155 /* LastToken */) || kind === 186 /* ThisType */) { return node; } var factory = context.factory; @@ -80321,291 +78310,287 @@ var ts; // Names case 78 /* Identifier */: return factory.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return factory.updateQualifiedName(node, nodeVisitor(node.left, visitor, ts.isEntityName), nodeVisitor(node.right, visitor, ts.isIdentifier)); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return factory.updateComputedPropertyName(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Signature elements - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return factory.updateTypeParameterDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.constraint, visitor, ts.isTypeNode), nodeVisitor(node.default, visitor, ts.isTypeNode)); - case 160 /* Parameter */: + case 159 /* Parameter */: return factory.updateParameterDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 161 /* Decorator */: + case 160 /* Decorator */: return factory.updateDecorator(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Type elements - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return factory.updatePropertyDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), // QuestionToken and ExclamationToken is uniqued in Property Declaration and the signature of 'updateProperty' is that too nodeVisitor(node.questionToken || node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 164 /* MethodSignature */: + case 163 /* MethodSignature */: return factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return factory.updateMethodDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 166 /* Constructor */: + case 165 /* Constructor */: return factory.updateConstructorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return factory.updateGetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return factory.updateSetAccessorDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 169 /* CallSignature */: + case 168 /* CallSignature */: return factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return factory.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); // Types - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return factory.updateTypePredicateNode(node, nodeVisitor(node.assertsModifier, visitor), nodeVisitor(node.parameterName, visitor), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return factory.updateTypeReferenceNode(node, nodeVisitor(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 174 /* FunctionType */: + case 173 /* FunctionType */: return factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 175 /* ConstructorType */: + case 174 /* ConstructorType */: return factory.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName)); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return factory.updateArrayTypeNode(node, nodeVisitor(node.elementType, visitor, ts.isTypeNode)); - case 179 /* TupleType */: + case 178 /* TupleType */: return factory.updateTupleTypeNode(node, nodesVisitor(node.elements, visitor, ts.isTypeNode)); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return factory.updateOptionalTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 181 /* RestType */: + case 180 /* RestType */: return factory.updateRestTypeNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 182 /* UnionType */: + case 181 /* UnionType */: return factory.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return factory.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return factory.updateConditionalTypeNode(node, nodeVisitor(node.checkType, visitor, ts.isTypeNode), nodeVisitor(node.extendsType, visitor, ts.isTypeNode), nodeVisitor(node.trueType, visitor, ts.isTypeNode), nodeVisitor(node.falseType, visitor, ts.isTypeNode)); - case 185 /* InferType */: + case 184 /* InferType */: return factory.updateInferTypeNode(node, nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); - case 195 /* ImportType */: + case 192 /* ImportType */: return factory.updateImportTypeNode(node, nodeVisitor(node.argument, visitor, ts.isTypeNode), nodeVisitor(node.qualifier, visitor, ts.isEntityName), visitNodes(node.typeArguments, visitor, ts.isTypeNode), node.isTypeOf); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return factory.updateNamedTupleMember(node, visitNode(node.dotDotDotToken, visitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return factory.updateParenthesizedType(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return factory.updateTypeOperatorNode(node, nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return factory.updateIndexedAccessTypeNode(node, nodeVisitor(node.objectType, visitor, ts.isTypeNode), nodeVisitor(node.indexType, visitor, ts.isTypeNode)); - case 190 /* MappedType */: - return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.nameType, visitor, ts.isTypeNode), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 191 /* LiteralType */: + case 189 /* MappedType */: + return factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode)); + case 190 /* LiteralType */: return factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.isExpression)); - case 193 /* TemplateLiteralType */: - return factory.updateTemplateLiteralType(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateLiteralTypeSpan)); - case 194 /* TemplateLiteralTypeSpan */: - return factory.updateTemplateLiteralTypeSpan(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Binding patterns - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: return factory.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return factory.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return factory.updateBindingElement(node, nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.propertyName, visitor, ts.isPropertyName), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.initializer, visitor, ts.isExpression)); // Expression - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return factory.updateArrayLiteralExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return factory.updateObjectLiteralExpression(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updatePropertyAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier)); } return factory.updatePropertyAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.name, visitor, ts.isIdentifierOrPrivateIdentifier)); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateElementAccessChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodeVisitor(node.argumentExpression, visitor, ts.isExpression)); } return factory.updateElementAccessExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.argumentExpression, visitor, ts.isExpression)); - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateCallChain(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); } return factory.updateCallExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return factory.updateNewExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return factory.updateTaggedTemplateExpression(node, nodeVisitor(node.tag, visitor, ts.isExpression), visitNodes(node.typeArguments, visitor, ts.isExpression), nodeVisitor(node.template, visitor, ts.isTemplateLiteral)); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return factory.updateTypeAssertion(node, nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return factory.updateParenthesizedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return factory.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return factory.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, ts.isToken), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return factory.updateDeleteExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return factory.updateTypeOfExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return factory.updateVoidExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return factory.updateAwaitExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return factory.updatePrefixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression)); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return factory.updatePostfixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts.isExpression)); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return factory.updateBinaryExpression(node, nodeVisitor(node.left, visitor, ts.isExpression), nodeVisitor(node.operatorToken, tokenVisitor, ts.isToken), nodeVisitor(node.right, visitor, ts.isExpression)); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return factory.updateConditionalExpression(node, nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenTrue, visitor, ts.isExpression), nodeVisitor(node.colonToken, tokenVisitor, ts.isToken), nodeVisitor(node.whenFalse, visitor, ts.isExpression)); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return factory.updateTemplateExpression(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return factory.updateYieldExpression(node, nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return factory.updateSpreadElement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return factory.updateClassExpression(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return factory.updateExpressionWithTypeArguments(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 224 /* AsExpression */: + case 221 /* AsExpression */: return factory.updateAsExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: if (node.flags & 32 /* OptionalChain */) { return factory.updateNonNullChain(node, nodeVisitor(node.expression, visitor, ts.isExpression)); } return factory.updateNonNullExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return factory.updateMetaProperty(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); // Misc - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return factory.updateTemplateSpan(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 230 /* Block */: + case 227 /* Block */: return factory.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return factory.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return factory.updateExpressionStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return factory.updateIfStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.thenStatement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.elseStatement, visitor, ts.isStatement, factory.liftToBlock)); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return factory.updateDoStatement(node, nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return factory.updateWhileStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return factory.updateForStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.condition, visitor, ts.isExpression), nodeVisitor(node.incrementor, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return factory.updateForInStatement(node, nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return factory.updateForOfStatement(node, nodeVisitor(node.awaitModifier, tokenVisitor, ts.isToken), nodeVisitor(node.initializer, visitor, ts.isForInitializer), nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return factory.updateContinueStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier)); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return factory.updateBreakStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier)); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return factory.updateReturnStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return factory.updateWithStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return factory.updateSwitchStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodeVisitor(node.caseBlock, visitor, ts.isCaseBlock)); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return factory.updateLabeledStatement(node, nodeVisitor(node.label, visitor, ts.isIdentifier), nodeVisitor(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return factory.updateThrowStatement(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return factory.updateTryStatement(node, nodeVisitor(node.tryBlock, visitor, ts.isBlock), nodeVisitor(node.catchClause, visitor, ts.isCatchClause), nodeVisitor(node.finallyBlock, visitor, ts.isBlock)); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return factory.updateVariableDeclaration(node, nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.exclamationToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return factory.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return factory.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isToken), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor)); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return factory.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return factory.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return factory.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode)); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return factory.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return factory.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.body, visitor, ts.isModuleBody)); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return factory.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return factory.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return factory.updateNamespaceExportDeclaration(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return factory.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.moduleReference, visitor, ts.isModuleReference)); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return factory.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.importClause, visitor, ts.isImportClause), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression)); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts.isNamedImportBindings)); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return factory.updateNamespaceImport(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return factory.updateNamespaceExport(node, nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 264 /* NamedImports */: + case 261 /* NamedImports */: return factory.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return factory.updateImportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier)); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return factory.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.expression, visitor, ts.isExpression)); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return factory.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, ts.isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, ts.isExpression)); - case 268 /* NamedExports */: + case 265 /* NamedExports */: return factory.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return factory.updateExportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier)); // Module references - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return factory.updateExternalModuleReference(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // JSX - case 273 /* JsxElement */: + case 270 /* JsxElement */: return factory.updateJsxElement(node, nodeVisitor(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingElement, visitor, ts.isJsxClosingElement)); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return factory.updateJsxSelfClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes)); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: return factory.updateJsxOpeningElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodeVisitor(node.attributes, visitor, ts.isJsxAttributes)); - case 276 /* JsxClosingElement */: + case 273 /* JsxClosingElement */: return factory.updateJsxClosingElement(node, nodeVisitor(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return factory.updateJsxFragment(node, nodeVisitor(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return factory.updateJsxAttribute(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return factory.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return factory.updateJsxSpreadAttribute(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return factory.updateJsxExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Clauses - case 284 /* CaseClause */: + case 281 /* CaseClause */: return factory.updateCaseClause(node, nodeVisitor(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return factory.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return factory.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return factory.updateCatchClause(node, nodeVisitor(node.variableDeclaration, visitor, ts.isVariableDeclaration), nodeVisitor(node.block, visitor, ts.isBlock)); // Property assignments - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return factory.updatePropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression)); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return factory.updateShorthandPropertyAssignment(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return factory.updateSpreadAssignment(node, nodeVisitor(node.expression, visitor, ts.isExpression)); // Enum - case 291 /* EnumMember */: + case 288 /* EnumMember */: return factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 297 /* SourceFile */: + case 294 /* SourceFile */: return factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression)); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return factory.updateCommaListExpression(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -81280,7 +79265,7 @@ var ts; function chainBundle(context, transformSourceFile) { return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - return node.kind === 297 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); + return node.kind === 294 /* SourceFile */ ? transformSourceFile(node) : transformBundle(node); } function transformBundle(node) { return context.factory.createBundle(ts.map(node.sourceFiles, transformSourceFile), node.prepends); @@ -81331,7 +79316,7 @@ var ts; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -81344,13 +79329,13 @@ var ts; hasImportDefault = true; } break; - case 260 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 272 /* ExternalModuleReference */) { + case 257 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 269 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -81381,13 +79366,13 @@ var ts; addExportedNamesForExportDeclaration(node); } break; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { for (var _b = 0, _c = node.declarationList.declarations; _b < _c.length; _b++) { var decl = _c[_b]; @@ -81395,7 +79380,7 @@ var ts; } } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { if (ts.hasSyntacticModifier(node, 512 /* Default */)) { // export default function() { } @@ -81415,7 +79400,7 @@ var ts; } } break; - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: if (ts.hasSyntacticModifier(node, 1 /* Export */)) { if (ts.hasSyntacticModifier(node, 512 /* Default */)) { // export default class { } @@ -81589,7 +79574,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member) { - return member.kind === 163 /* PropertyDeclaration */ + return member.kind === 162 /* PropertyDeclaration */ && member.initializer !== undefined; } ts.isInitializedProperty = isInitializedProperty; @@ -81808,27 +79793,18 @@ var ts; * for the element. */ function flattenBindingOrAssignmentElement(flattenContext, element, value, location, skipInitializer) { - var bindingTarget = ts.getTargetOfBindingOrAssignmentElement(element); // TODO: GH#18217 if (!skipInitializer) { var initializer = ts.visitNode(ts.getInitializerOfBindingOrAssignmentElement(element), flattenContext.visitor, ts.isExpression); if (initializer) { // Combine value and initializer - if (value) { - value = createDefaultValueCheck(flattenContext, value, initializer, location); - // If 'value' is not a simple expression, it could contain side-effecting code that should evaluate before an object or array binding pattern. - if (!ts.isSimpleInlineableExpression(initializer) && ts.isBindingOrAssignmentPattern(bindingTarget)) { - value = ensureIdentifier(flattenContext, value, /*reuseIdentifierExpressions*/ true, location); - } - } - else { - value = initializer; - } + value = value ? createDefaultValueCheck(flattenContext, value, initializer, location) : initializer; } else if (!value) { // Use 'void 0' in absence of value and initializer value = flattenContext.context.factory.createVoidZero(); } } + var bindingTarget = ts.getTargetOfBindingOrAssignmentElement(element); // TODO: GH#18217 if (ts.isObjectBindingOrAssignmentPattern(bindingTarget)) { flattenObjectBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value, location); } @@ -81933,8 +79909,7 @@ var ts; if (flattenContext.level >= 1 /* ObjectRest */) { // If an array pattern contains an ObjectRest, we must cache the result so that we // can perform the ObjectRest destructuring in a different declaration - if (element.transformFlags & 16384 /* ContainsObjectRestOrSpread */ || flattenContext.hasTransformedPriorElement && !isSimpleBindingOrAssignmentElement(element)) { - flattenContext.hasTransformedPriorElement = true; + if (element.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { var temp = flattenContext.context.factory.createTempVariable(/*recordTempVariable*/ undefined); if (flattenContext.hoistTempVariables) { flattenContext.context.hoistVariableDeclaration(temp); @@ -81968,20 +79943,6 @@ var ts; } } } - function isSimpleBindingOrAssignmentElement(element) { - var target = ts.getTargetOfBindingOrAssignmentElement(element); - if (!target || ts.isOmittedExpression(target)) - return true; - var propertyName = ts.tryGetPropertyNameOfBindingOrAssignmentElement(element); - if (propertyName && !ts.isPropertyNameLiteral(propertyName)) - return false; - var initializer = ts.getInitializerOfBindingOrAssignmentElement(element); - if (initializer && !ts.isSimpleInlineableExpression(initializer)) - return false; - if (ts.isBindingOrAssignmentPattern(target)) - return ts.every(ts.getElementsOfBindingOrAssignmentPattern(target), isSimpleBindingOrAssignmentElement); - return ts.isIdentifier(target); - } /** * Creates an expression used to provide a default value if a value is `undefined` at runtime. * @@ -82191,8 +80152,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -82218,14 +80179,14 @@ var ts; var applicableSubstitutions; return transformSourceFileOrBundle; function transformSourceFileOrBundle(node) { - if (node.kind === 298 /* Bundle */) { + if (node.kind === 295 /* Bundle */) { return transformBundle(node); } return transformSourceFile(node); } function transformBundle(node) { return factory.createBundle(node.sourceFiles.map(transformSourceFile), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 300 /* InputFiles */) { + if (prepend.kind === 297 /* InputFiles */) { return ts.createUnparsedSourceFile(prepend, "js"); } return prepend; @@ -82276,16 +80237,16 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 297 /* SourceFile */: - case 258 /* CaseBlock */: - case 257 /* ModuleBlock */: - case 230 /* Block */: + case 294 /* SourceFile */: + case 255 /* CaseBlock */: + case 254 /* ModuleBlock */: + case 227 /* Block */: currentLexicalScope = node; currentNameScope = undefined; currentScopeFirstDeclarationsOfName = undefined; break; - case 252 /* ClassDeclaration */: - case 251 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 248 /* FunctionDeclaration */: if (ts.hasSyntacticModifier(node, 2 /* Ambient */)) { break; } @@ -82297,7 +80258,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 252 /* ClassDeclaration */ || ts.hasSyntacticModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 249 /* ClassDeclaration */ || ts.hasSyntacticModifier(node, 512 /* Default */)); } if (ts.isClassDeclaration(node)) { // XXX: should probably also cover interfaces and type aliases that can have type variables? @@ -82340,10 +80301,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 266 /* ExportAssignment */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 263 /* ExportAssignment */: + case 264 /* ExportDeclaration */: return visitElidableStatement(node); default: return visitorWorker(node); @@ -82364,13 +80325,13 @@ var ts; return node; } switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -82390,11 +80351,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 267 /* ExportDeclaration */ || - node.kind === 261 /* ImportDeclaration */ || - node.kind === 262 /* ImportClause */ || - (node.kind === 260 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 272 /* ExternalModuleReference */)) { + if (node.kind === 264 /* ExportDeclaration */ || + node.kind === 258 /* ImportDeclaration */ || + node.kind === 259 /* ImportClause */ || + (node.kind === 257 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 269 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -82418,19 +80379,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return visitConstructor(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // Property declarations are not TypeScript syntax, but they must be visited // for the decorator transformation. return visitPropertyDeclaration(node); - case 171 /* IndexSignature */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + case 170 /* IndexSignature */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return node; default: return ts.Debug.failBadSyntaxKind(node); @@ -82467,61 +80428,61 @@ var ts; case 125 /* AbstractKeyword */: case 84 /* ConstKeyword */: case 133 /* DeclareKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided // falls through - case 178 /* ArrayType */: - case 179 /* TupleType */: - case 180 /* OptionalType */: - case 181 /* RestType */: - case 177 /* TypeLiteral */: - case 172 /* TypePredicate */: - case 159 /* TypeParameter */: + case 177 /* ArrayType */: + case 178 /* TupleType */: + case 179 /* OptionalType */: + case 180 /* RestType */: + case 176 /* TypeLiteral */: + case 171 /* TypePredicate */: + case 158 /* TypeParameter */: case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: + case 151 /* UnknownKeyword */: case 131 /* BooleanKeyword */: - case 147 /* StringKeyword */: - case 144 /* NumberKeyword */: - case 141 /* NeverKeyword */: + case 146 /* StringKeyword */: + case 143 /* NumberKeyword */: + case 140 /* NeverKeyword */: case 113 /* VoidKeyword */: - case 148 /* SymbolKeyword */: - case 175 /* ConstructorType */: - case 174 /* FunctionType */: - case 176 /* TypeQuery */: - case 173 /* TypeReference */: - case 182 /* UnionType */: - case 183 /* IntersectionType */: - case 184 /* ConditionalType */: - case 186 /* ParenthesizedType */: - case 187 /* ThisType */: - case 188 /* TypeOperator */: - case 189 /* IndexedAccessType */: - case 190 /* MappedType */: - case 191 /* LiteralType */: + case 147 /* SymbolKeyword */: + case 174 /* ConstructorType */: + case 173 /* FunctionType */: + case 175 /* TypeQuery */: + case 172 /* TypeReference */: + case 181 /* UnionType */: + case 182 /* IntersectionType */: + case 183 /* ConditionalType */: + case 185 /* ParenthesizedType */: + case 186 /* ThisType */: + case 187 /* TypeOperator */: + case 188 /* IndexedAccessType */: + case 189 /* MappedType */: + case 190 /* LiteralType */: // TypeScript type nodes are elided. // falls through - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // TypeScript index signatures are elided. // falls through - case 161 /* Decorator */: + case 160 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. // falls through - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 166 /* Constructor */: + case 165 /* Constructor */: return visitConstructor(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return factory.createNotEmittedStatement(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: // This may be a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -82531,7 +80492,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: // This may be a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -82541,35 +80502,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: // This may be a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 160 /* Parameter */: + case 159 /* Parameter */: // This may be a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -82579,40 +80540,40 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 206 /* TypeAssertionExpression */: - case 224 /* AsExpression */: + case 203 /* TypeAssertionExpression */: + case 221 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node); - case 275 /* JsxOpeningElement */: + case 272 /* JsxOpeningElement */: return visitJsxJsxOpeningElement(node); default: // node contains some other TypeScript syntax @@ -83021,12 +80982,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -83179,7 +81140,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 163 /* PropertyDeclaration */ + ? member.kind === 162 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? factory.createVoidZero() @@ -83303,10 +81264,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */ - || kind === 163 /* PropertyDeclaration */; + return kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */ + || kind === 162 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -83316,7 +81277,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 165 /* MethodDeclaration */; + return node.kind === 164 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -83327,12 +81288,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return true; } return false; @@ -83349,15 +81310,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: - case 160 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 159 /* Parameter */: return serializeTypeNode(node.type); - case 168 /* SetAccessor */: - case 167 /* GetAccessor */: + case 167 /* SetAccessor */: + case 166 /* GetAccessor */: return serializeTypeNode(getAccessorTypeNode(node)); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 165 /* MethodDeclaration */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 164 /* MethodDeclaration */: return factory.createIdentifier("Function"); default: return factory.createVoidZero(); @@ -83394,7 +81355,7 @@ var ts; return factory.createArrayLiteralExpression(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 167 /* GetAccessor */) { + if (container && node.kind === 166 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -83440,30 +81401,30 @@ var ts; } switch (node.kind) { case 113 /* VoidKeyword */: - case 150 /* UndefinedKeyword */: - case 141 /* NeverKeyword */: + case 149 /* UndefinedKeyword */: + case 140 /* NeverKeyword */: return factory.createVoidZero(); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 174 /* FunctionType */: - case 175 /* ConstructorType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: return factory.createIdentifier("Function"); - case 178 /* ArrayType */: - case 179 /* TupleType */: + case 177 /* ArrayType */: + case 178 /* TupleType */: return factory.createIdentifier("Array"); - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: case 131 /* BooleanKeyword */: return factory.createIdentifier("Boolean"); - case 147 /* StringKeyword */: + case 146 /* StringKeyword */: return factory.createIdentifier("String"); - case 145 /* ObjectKeyword */: + case 144 /* ObjectKeyword */: return factory.createIdentifier("Object"); - case 191 /* LiteralType */: + case 190 /* LiteralType */: switch (node.literal.kind) { case 10 /* StringLiteral */: case 14 /* NoSubstitutionTemplateLiteral */: return factory.createIdentifier("String"); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: case 8 /* NumericLiteral */: return factory.createIdentifier("Number"); case 9 /* BigIntLiteral */: @@ -83476,45 +81437,45 @@ var ts; default: return ts.Debug.failBadSyntaxKind(node.literal); } - case 144 /* NumberKeyword */: + case 143 /* NumberKeyword */: return factory.createIdentifier("Number"); - case 155 /* BigIntKeyword */: + case 154 /* BigIntKeyword */: return getGlobalBigIntNameWithFallback(); - case 148 /* SymbolKeyword */: + case 147 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : factory.createIdentifier("Symbol"); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return serializeTypeReferenceNode(node); - case 183 /* IntersectionType */: - case 182 /* UnionType */: + case 182 /* IntersectionType */: + case 181 /* UnionType */: return serializeTypeList(node.types); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return serializeTypeList([node.trueType, node.falseType]); - case 188 /* TypeOperator */: - if (node.operator === 142 /* ReadonlyKeyword */) { + case 187 /* TypeOperator */: + if (node.operator === 141 /* ReadonlyKeyword */) { return serializeTypeNode(node.type); } break; - case 176 /* TypeQuery */: - case 189 /* IndexedAccessType */: - case 190 /* MappedType */: - case 177 /* TypeLiteral */: + case 175 /* TypeQuery */: + case 188 /* IndexedAccessType */: + case 189 /* MappedType */: + case 176 /* TypeLiteral */: case 128 /* AnyKeyword */: - case 152 /* UnknownKeyword */: - case 187 /* ThisType */: - case 195 /* ImportType */: + case 151 /* UnknownKeyword */: + case 186 /* ThisType */: + case 192 /* ImportType */: break; // handle JSDoc types from an invalid parse - case 303 /* JSDocAllType */: - case 304 /* JSDocUnknownType */: - case 308 /* JSDocFunctionType */: - case 309 /* JSDocVariadicType */: - case 310 /* JSDocNamepathType */: + case 299 /* JSDocAllType */: + case 300 /* JSDocUnknownType */: + case 304 /* JSDocFunctionType */: + case 305 /* JSDocVariadicType */: + case 306 /* JSDocNamepathType */: break; - case 305 /* JSDocNullableType */: - case 306 /* JSDocNonNullableType */: - case 307 /* JSDocOptionalType */: + case 301 /* JSDocNullableType */: + case 302 /* JSDocNonNullableType */: + case 303 /* JSDocOptionalType */: return serializeTypeNode(node.type); default: return ts.Debug.failBadSyntaxKind(node); @@ -83525,15 +81486,15 @@ var ts; // Note when updating logic here also update getEntityNameForDecoratorMetadata // so that aliases can be marked as referenced var serializedUnion; - for (var _i = 0, types_22 = types; _i < types_22.length; _i++) { - var typeNode = types_22[_i]; - while (typeNode.kind === 186 /* ParenthesizedType */) { + for (var _i = 0, types_21 = types; _i < types_21.length; _i++) { + var typeNode = types_21[_i]; + while (typeNode.kind === 185 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 141 /* NeverKeyword */) { + if (typeNode.kind === 140 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 191 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 150 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 190 /* LiteralType */ && typeNode.literal.kind === 103 /* NullKeyword */ || typeNode.kind === 149 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -83643,7 +81604,7 @@ var ts; name.original = undefined; ts.setParent(name, ts.getParseTreeNode(currentLexicalScope)); // ensure the parent is set to a parse tree node. return name; - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return serializeQualifiedNameAsExpression(node); } } @@ -84217,12 +82178,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = factory.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), factory.createVariableDeclarationList([ factory.createVariableDeclaration(factory.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentLexicalScope.kind === 297 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentLexicalScope.kind === 294 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 255 /* EnumDeclaration */) { + if (node.kind === 252 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -84347,7 +82308,7 @@ var ts; var statementsLocation; var blockLocation; if (node.body) { - if (node.body.kind === 257 /* ModuleBlock */) { + if (node.body.kind === 254 /* ModuleBlock */) { saveStateAndInvoke(node.body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = node.body.statements; blockLocation = node.body; @@ -84394,13 +82355,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (!node.body || node.body.kind !== 257 /* ModuleBlock */) { + if (!node.body || node.body.kind !== 254 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 256 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 253 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -84450,7 +82411,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 263 /* NamespaceImport */) { + if (node.kind === 260 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -84699,16 +82660,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(78 /* Identifier */); - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(256 /* ModuleDeclaration */); + context.enableEmitNotification(253 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 256 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 253 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 255 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 252 /* EnumDeclaration */; } /** * Hook for node emit. @@ -84769,9 +82730,9 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -84809,9 +82770,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 297 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 256 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 255 /* EnumDeclaration */); + if (container && container.kind !== 294 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 253 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 252 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(container), node), /*location*/ node); @@ -84911,40 +82872,40 @@ var ts; if (!(node.transformFlags & 4194304 /* ContainsClassFields */)) return node; switch (node.kind) { - case 221 /* ClassExpression */: - case 252 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 249 /* ClassDeclaration */: return visitClassLike(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return visitPropertyAccessExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return visitPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return visitPostfixUnaryExpression(node, /*valueIsDiscarded*/ false); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); case 79 /* PrivateIdentifier */: return visitPrivateIdentifier(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); } return ts.visitEachChild(node, visitor, context); } function visitorDestructuringTarget(node) { switch (node.kind) { - case 200 /* ObjectLiteralExpression */: - case 199 /* ArrayLiteralExpression */: + case 197 /* ObjectLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitAssignmentPattern(node); default: return visitor(node); @@ -84967,20 +82928,20 @@ var ts; */ function classElementVisitor(node) { switch (node.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: // Constructors for classes using class fields are transformed in // `visitClassDeclaration` or `visitClassExpression`. return undefined; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 165 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 164 /* MethodDeclaration */: // Visit the name of the member (if it's a computed property name). return ts.visitEachChild(node, classElementVisitor, context); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return visitPropertyDeclaration(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return node; default: return visitor(node); @@ -85732,31 +83693,31 @@ var ts; case 129 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitAwaitExpression(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitMethodDeclaration, node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionDeclaration, node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitFunctionExpression, node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return doWithContext(1 /* NonTopLevel */, visitArrowFunction, node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return ts.visitEachChild(node, visitor, context); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 166 /* Constructor */: - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 165 /* Constructor */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return doWithContext(1 /* NonTopLevel */ | 2 /* HasLexicalThis */, visitDefault, node); default: return ts.visitEachChild(node, visitor, context); @@ -85765,27 +83726,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 230 /* Block */: - case 244 /* SwitchStatement */: - case 258 /* CaseBlock */: - case 284 /* CaseClause */: - case 285 /* DefaultClause */: - case 247 /* TryStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 234 /* IfStatement */: - case 243 /* WithStatement */: - case 245 /* LabeledStatement */: + case 227 /* Block */: + case 241 /* SwitchStatement */: + case 255 /* CaseBlock */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: + case 244 /* TryStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 231 /* IfStatement */: + case 240 /* WithStatement */: + case 242 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -85990,7 +83951,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 209 /* ArrowFunction */; + var isArrowFunction = node.kind === 206 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -86081,17 +84042,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(203 /* CallExpression */); - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(200 /* CallExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(252 /* ClassDeclaration */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(166 /* Constructor */); + context.enableEmitNotification(249 /* ClassDeclaration */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(165 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(232 /* VariableStatement */); + context.enableEmitNotification(229 /* VariableStatement */); } } /** @@ -86139,11 +84100,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -86175,11 +84136,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 252 /* ClassDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 249 /* ClassDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -86330,10 +84291,10 @@ var ts; return visited; } function visitor(node) { - return visitorWorker(node, /*expressionResultIsUnused*/ false); + return visitorWorker(node, /*noDestructuringValue*/ false); } - function visitorWithUnusedExpressionResult(node) { - return visitorWorker(node, /*expressionResultIsUnused*/ true); + function visitorNoDestructuringValue(node) { + return visitorWorker(node, /*noDestructuringValue*/ true); } function visitorNoAsyncModifier(node) { if (node.kind === 129 /* AsyncKeyword */) { @@ -86353,79 +84314,73 @@ var ts; function visitDefault(node) { return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitorWorker(node, expressionResultIsUnused) { + function visitorWorker(node, noDestructuringValue) { if ((node.transformFlags & 32 /* ContainsES2018 */) === 0) { return node; } switch (node.kind) { - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return visitAwaitExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 216 /* BinaryExpression */: - return visitBinaryExpression(node, expressionResultIsUnused); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node, expressionResultIsUnused); - case 287 /* CatchClause */: + case 213 /* BinaryExpression */: + return visitBinaryExpression(node, noDestructuringValue); + case 284 /* CatchClause */: return visitCatchClause(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 235 /* DoStatement */: - case 236 /* WhileStatement */: - case 238 /* ForInStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: + case 235 /* ForInStatement */: return doWithHierarchyFacts(visitDefault, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return doWithHierarchyFacts(visitForStatement, node, 0 /* IterationStatementExcludes */, 2 /* IterationStatementIncludes */); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return visitVoidExpression(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return doWithHierarchyFacts(visitConstructorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return doWithHierarchyFacts(visitMethodDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 167 /* GetAccessor */: + case 166 /* GetAccessor */: return doWithHierarchyFacts(visitGetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 168 /* SetAccessor */: + case 167 /* SetAccessor */: return doWithHierarchyFacts(visitSetAccessorDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return doWithHierarchyFacts(visitFunctionDeclaration, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return doWithHierarchyFacts(visitFunctionExpression, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return doWithHierarchyFacts(visitArrowFunction, node, 2 /* ArrowFunctionExcludes */, 0 /* ArrowFunctionIncludes */); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitParameter(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 207 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, expressionResultIsUnused); - case 205 /* TaggedTemplateExpression */: + case 204 /* ParenthesizedExpression */: + return visitParenthesizedExpression(node, noDestructuringValue); + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: if (capturedSuperProperties && ts.isPropertyAccessExpression(node) && node.expression.kind === 105 /* SuperKeyword */) { capturedSuperProperties.add(node.name.escapedText); } return ts.visitEachChild(node, visitor, context); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: if (capturedSuperProperties && node.expression.kind === 105 /* SuperKeyword */) { hasSuperElementAccess = true; } return ts.visitEachChild(node, visitor, context); - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: return doWithHierarchyFacts(visitDefault, node, 2 /* ClassOrFunctionExcludes */, 1 /* ClassOrFunctionIncludes */); default: return ts.visitEachChild(node, visitor, context); @@ -86461,7 +84416,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 239 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 236 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return factory.restoreEnclosingLabel(ts.visitNode(statement, visitor, ts.isStatement, factory.liftToBlock), node); @@ -86473,7 +84428,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 290 /* SpreadAssignment */) { + if (e.kind === 287 /* SpreadAssignment */) { if (chunkObject) { objects.push(factory.createObjectLiteralExpression(chunkObject)); chunkObject = undefined; @@ -86482,7 +84437,7 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - chunkObject = ts.append(chunkObject, e.kind === 288 /* PropertyAssignment */ + chunkObject = ts.append(chunkObject, e.kind === 285 /* PropertyAssignment */ ? factory.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } @@ -86516,7 +84471,7 @@ var ts; // If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we // end up with `{ a: 1, b: 2, c: 3 }` var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 200 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 197 /* ObjectLiteralExpression */) { objects.unshift(factory.createObjectLiteralExpression()); } var expression = objects[0]; @@ -86533,14 +84488,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitExpressionStatement(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + return ts.visitEachChild(node, visitorNoDestructuringValue, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitParenthesizedExpression(node, expressionResultIsUnused) { - return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context); + function visitParenthesizedExpression(node, noDestructuringValue) { + return ts.visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context); } function visitSourceFile(node) { var ancestorFacts = enterSubtree(2 /* SourceFileExcludes */, ts.isEffectiveStrictModeSourceFile(node, compilerOptions) ? @@ -86562,38 +84513,16 @@ var ts; * Visits a BinaryExpression that contains a destructuring assignment. * * @param node A BinaryExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). */ - function visitBinaryExpression(node, expressionResultIsUnused) { + function visitBinaryExpression(node, noDestructuringValue) { if (ts.isDestructuringAssignment(node) && node.left.transformFlags & 16384 /* ContainsObjectRestOrSpread */) { - return ts.flattenDestructuringAssignment(node, visitor, context, 1 /* ObjectRest */, !expressionResultIsUnused); + return ts.flattenDestructuringAssignment(node, visitor, context, 1 /* ObjectRest */, !noDestructuringValue); } - if (node.operatorToken.kind === 27 /* CommaToken */) { - return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression)); + else if (node.operatorToken.kind === 27 /* CommaToken */) { + return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorNoDestructuringValue, ts.isExpression), node.operatorToken, ts.visitNode(node.right, noDestructuringValue ? visitorNoDestructuringValue : visitor, ts.isExpression)); } return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitCommaListExpression(node, expressionResultIsUnused) { - if (expressionResultIsUnused) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - var result; - for (var i = 0; i < node.elements.length; i++) { - var element = node.elements[i]; - var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - result.push(visited); - } - } - var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements; - return factory.updateCommaListExpression(node, elements); - } function visitCatchClause(node) { if (node.variableDeclaration && ts.isBindingPattern(node.variableDeclaration.name) && @@ -86645,10 +84574,10 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitForStatement(node) { - return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement)); + return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorNoDestructuringValue, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement)); } function visitVoidExpression(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + return ts.visitEachChild(node, visitorNoDestructuringValue, context); } /** * Visits a ForOfStatement and converts it into a ES2015-compatible ForOfStatement. @@ -86929,17 +84858,17 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(203 /* CallExpression */); - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(202 /* ElementAccessExpression */); + context.enableSubstitution(200 /* CallExpression */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(199 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(252 /* ClassDeclaration */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(166 /* Constructor */); + context.enableEmitNotification(249 /* ClassDeclaration */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(165 /* Constructor */); // We need to be notified when entering the generated accessor arrow functions. - context.enableEmitNotification(232 /* VariableStatement */); + context.enableEmitNotification(229 /* VariableStatement */); } } /** @@ -86987,11 +84916,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -87023,11 +84952,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 252 /* ClassDeclaration */ - || kind === 166 /* Constructor */ - || kind === 165 /* MethodDeclaration */ - || kind === 167 /* GetAccessor */ - || kind === 168 /* SetAccessor */; + return kind === 249 /* ClassDeclaration */ + || kind === 165 /* Constructor */ + || kind === 164 /* MethodDeclaration */ + || kind === 166 /* GetAccessor */ + || kind === 167 /* SetAccessor */; } function createSuperElementAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -87059,7 +84988,7 @@ var ts; return node; } switch (node.kind) { - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -87091,21 +85020,21 @@ var ts; return node; } switch (node.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: - case 203 /* CallExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: + case 200 /* CallExpression */: if (node.flags & 32 /* OptionalChain */) { var updated = visitOptionalExpression(node, /*captureThisArg*/ false, /*isDelete*/ false); ts.Debug.assertNotNode(updated, ts.isSyntheticReference); return updated; } return ts.visitEachChild(node, visitor, context); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: if (node.operatorToken.kind === 60 /* QuestionQuestionToken */) { return transformNullishCoalescingExpression(node); } return ts.visitEachChild(node, visitor, context); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return visitDeleteExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -87148,7 +85077,7 @@ var ts; thisArg = expression; } } - expression = node.kind === 201 /* PropertyAccessExpression */ + expression = node.kind === 198 /* PropertyAccessExpression */ ? factory.updatePropertyAccessExpression(node, expression, ts.visitNode(node.name, visitor, ts.isIdentifier)) : factory.updateElementAccessExpression(node, expression, ts.visitNode(node.argumentExpression, visitor, ts.isExpression)); return thisArg ? factory.createSyntheticReferenceExpression(expression, thisArg) : expression; @@ -87162,10 +85091,10 @@ var ts; } function visitNonOptionalExpression(node, captureThisArg, isDelete) { switch (node.kind) { - case 207 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); - case 203 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); + case 204 /* ParenthesizedExpression */: return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 200 /* CallExpression */: return visitNonOptionalCallExpression(node, captureThisArg); default: return ts.visitNode(node, visitor, ts.isExpression); } } @@ -87185,8 +85114,8 @@ var ts; for (var i = 0; i < chain.length; i++) { var segment = chain[i]; switch (segment.kind) { - case 201 /* PropertyAccessExpression */: - case 202 /* ElementAccessExpression */: + case 198 /* PropertyAccessExpression */: + case 199 /* ElementAccessExpression */: if (i === chain.length - 1 && captureThisArg) { if (!ts.isSimpleCopiableExpression(rightExpression)) { thisArg = factory.createTempVariable(hoistVariableDeclaration); @@ -87197,11 +85126,11 @@ var ts; thisArg = rightExpression; } } - rightExpression = segment.kind === 201 /* PropertyAccessExpression */ + rightExpression = segment.kind === 198 /* PropertyAccessExpression */ ? factory.createPropertyAccessExpression(rightExpression, ts.visitNode(segment.name, visitor, ts.isIdentifier)) : factory.createElementAccessExpression(rightExpression, ts.visitNode(segment.argumentExpression, visitor, ts.isExpression)); break; - case 203 /* CallExpression */: + case 200 /* CallExpression */: if (i === 0 && leftThisArg) { rightExpression = factory.createFunctionCallCall(rightExpression, leftThisArg.kind === 105 /* SuperKeyword */ ? factory.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression)); } @@ -87258,7 +85187,7 @@ var ts; return node; } switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: var binaryExpression = node; if (ts.isLogicalOrCoalescingAssignmentExpression(binaryExpression)) { return transformLogicalAssignment(binaryExpression); @@ -87303,49 +85232,7 @@ var ts; var factory = context.factory, emitHelpers = context.getEmitHelperFactory; var compilerOptions = context.getCompilerOptions(); var currentSourceFile; - var currentFileState; return ts.chainBundle(context, transformSourceFile); - function getCurrentFileNameExpression() { - if (currentFileState.filenameDeclaration) { - return currentFileState.filenameDeclaration.name; - } - var declaration = factory.createVariableDeclaration(factory.createUniqueName("_jsxFileName", 16 /* Optimistic */ | 32 /* FileLevel */), /*exclaimationToken*/ undefined, /*type*/ undefined, factory.createStringLiteral(currentSourceFile.fileName)); - currentFileState.filenameDeclaration = declaration; - return currentFileState.filenameDeclaration.name; - } - function getJsxFactoryCalleePrimitive(childrenLength) { - return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" : childrenLength > 1 ? "jsxs" : "jsx"; - } - function getJsxFactoryCallee(childrenLength) { - var type = getJsxFactoryCalleePrimitive(childrenLength); - return getImplicitImportForName(type); - } - function getImplicitJsxFragmentReference() { - return getImplicitImportForName("Fragment"); - } - function getImplicitImportForName(name) { - var _a, _b; - var importSource = name === "createElement" - ? currentFileState.importSpecifier - : ts.getJSXRuntimeImport(currentFileState.importSpecifier, compilerOptions); - var existing = (_b = (_a = currentFileState.utilizedImplicitRuntimeImports) === null || _a === void 0 ? void 0 : _a.get(importSource)) === null || _b === void 0 ? void 0 : _b.get(name); - if (existing) { - return existing.name; - } - if (!currentFileState.utilizedImplicitRuntimeImports) { - currentFileState.utilizedImplicitRuntimeImports = ts.createMap(); - } - var specifierSourceImports = currentFileState.utilizedImplicitRuntimeImports.get(importSource); - if (!specifierSourceImports) { - specifierSourceImports = ts.createMap(); - currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports); - } - var generatedName = factory.createUniqueName("_" + name, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */); - var specifier = factory.createImportSpecifier(factory.createIdentifier(name), generatedName); - generatedName.generatedImportReference = specifier; - specifierSourceImports.set(name, specifier); - return generatedName; - } /** * Transform JSX-specific syntax in a SourceFile. * @@ -87356,42 +85243,8 @@ var ts; return node; } currentSourceFile = node; - currentFileState = {}; - currentFileState.importSpecifier = ts.getJSXImplicitImportBase(compilerOptions, node); var visited = ts.visitEachChild(node, visitor, context); ts.addEmitHelpers(visited, context.readEmitHelpers()); - var statements = visited.statements; - if (currentFileState.filenameDeclaration) { - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([currentFileState.filenameDeclaration], 2 /* Const */))); - } - if (currentFileState.utilizedImplicitRuntimeImports) { - for (var _i = 0, _a = ts.arrayFrom(currentFileState.utilizedImplicitRuntimeImports.entries()); _i < _a.length; _i++) { - var _b = _a[_i], importSource = _b[0], importSpecifiersMap = _b[1]; - if (ts.isExternalModule(node)) { - // Add `import` statement - var importStatement = factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, factory.createImportClause(/*typeOnly*/ false, /*name*/ undefined, factory.createNamedImports(ts.arrayFrom(importSpecifiersMap.values()))), factory.createStringLiteral(importSource)); - ts.setParentRecursive(importStatement, /*incremental*/ false); - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), importStatement); - } - else if (ts.isExternalOrCommonJsModule(node)) { - // Add `require` statement - var requireStatement = factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([ - factory.createVariableDeclaration(factory.createObjectBindingPattern(ts.map(ts.arrayFrom(importSpecifiersMap.values()), function (s) { return factory.createBindingElement(/*dotdotdot*/ undefined, s.propertyName, s.name); })), - /*exclaimationToken*/ undefined, - /*type*/ undefined, factory.createCallExpression(factory.createIdentifier("require"), /*typeArguments*/ undefined, [factory.createStringLiteral(importSource)])) - ], 2 /* Const */)); - ts.setParentRecursive(requireStatement, /*incremental*/ false); - statements = ts.insertStatementAfterCustomPrologue(statements.slice(), requireStatement); - } - else { - // Do nothing (script file) - consider an error in the checker? - } - } - } - if (statements !== visited.statements) { - visited = factory.updateSourceFile(visited, statements); - } - currentFileState = undefined; return visited; } function visitor(node) { @@ -87404,13 +85257,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -87420,122 +85273,28 @@ var ts; switch (node.kind) { case 11 /* JsxText */: return visitJsxText(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return visitJsxExpression(node); - case 273 /* JsxElement */: + case 270 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: return ts.Debug.failBadSyntaxKind(node); } } - /** - * The react jsx/jsxs transform falls back to `createElement` when an explicit `key` argument comes after a spread - */ - function hasKeyAfterPropsSpread(node) { - var spread = false; - for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { - var elem = _a[_i]; - if (ts.isJsxSpreadAttribute(elem)) { - spread = true; - } - else if (spread && ts.isJsxAttribute(elem) && elem.name.escapedText === "key") { - return true; - } - } - return false; - } - function shouldUseCreateElement(node) { - return currentFileState.importSpecifier === undefined || hasKeyAfterPropsSpread(node); - } function visitJsxElement(node, isChild) { - var tagTransform = shouldUseCreateElement(node.openingElement) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform(node.openingElement, node.children, isChild, /*location*/ node); + return visitJsxOpeningLikeElement(node.openingElement, node.children, isChild, /*location*/ node); } function visitJsxSelfClosingElement(node, isChild) { - var tagTransform = shouldUseCreateElement(node) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; - return tagTransform(node, /*children*/ undefined, isChild, /*location*/ node); + return visitJsxOpeningLikeElement(node, /*children*/ undefined, isChild, /*location*/ node); } function visitJsxFragment(node, isChild) { - var tagTransform = currentFileState.importSpecifier === undefined ? visitJsxOpeningFragmentCreateElement : visitJsxOpeningFragmentJSX; - return tagTransform(node.openingFragment, node.children, isChild, /*location*/ node); + return visitJsxOpeningFragment(node.openingFragment, node.children, isChild, /*location*/ node); } - function convertJsxChildrenToChildrenPropObject(children) { - var nonWhitespaceChildren = ts.getSemanticJsxChildren(children); - if (ts.length(nonWhitespaceChildren) === 1) { - var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]); - return result_13 && factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("children", result_13) - ]); - } - var result = ts.mapDefined(children, transformJsxChildToExpression); - return !result.length ? undefined : factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) - ]); - } - function visitJsxOpeningLikeElementJSX(node, children, isChild, location) { - var tagName = getTagName(node); - var objectProperties; - var keyAttr = ts.find(node.attributes.properties, function (p) { return !!p.name && ts.isIdentifier(p.name) && p.name.escapedText === "key"; }); - var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties; - var segments = []; - if (attrs.length) { - // Map spans of JsxAttribute nodes into object literals and spans - // of JsxSpreadAttribute nodes into expressions. - segments = ts.flatten(ts.spanMap(attrs, ts.isJsxSpreadAttribute, function (attrs, isSpread) { return isSpread - ? ts.map(attrs, transformJsxSpreadAttributeToExpression) - : factory.createObjectLiteralExpression(ts.map(attrs, transformJsxAttributeToObjectLiteralElement)); })); - if (ts.isJsxSpreadAttribute(attrs[0])) { - // We must always emit at least one object literal before a spread - // argument.factory.createObjectLiteral - segments.unshift(factory.createObjectLiteralExpression()); - } - } - if (children && children.length) { - var result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - segments.push(result); - } - } - if (segments.length === 0) { - objectProperties = factory.createObjectLiteralExpression([]); - // When there are no attributes, React wants {} - } - else { - // Either emit one big object literal (no spread attribs), or - // a call to the __assign helper. - objectProperties = ts.singleOrUndefined(segments) || emitHelpers().createAssignHelper(segments); - } - return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, ts.length(ts.getSemanticJsxChildren(children || ts.emptyArray)), isChild, location); - } - function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, childrenLength, isChild, location) { - var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)]; - if (compilerOptions.jsx === 5 /* ReactJSXDev */) { - var originalFile = ts.getOriginalNode(currentSourceFile); - if (originalFile && ts.isSourceFile(originalFile)) { - // isStaticChildren development flag - args.push(childrenLength > 1 ? factory.createTrue() : factory.createFalse()); - // __source development flag - var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos); - args.push(factory.createObjectLiteralExpression([ - factory.createPropertyAssignment("fileName", getCurrentFileNameExpression()), - factory.createPropertyAssignment("lineNumber", factory.createNumericLiteral(lineCol.line + 1)), - factory.createPropertyAssignment("columnNumber", factory.createNumericLiteral(lineCol.character + 1)) - ])); - // __self development flag - args.push(factory.createThis()); - } - } - var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(childrenLength), /*typeArguments*/ undefined, args), location); - if (isChild) { - ts.startOnNewLine(element); - } - return element; - } - function visitJsxOpeningLikeElementCreateElement(node, children, isChild, location) { + function visitJsxOpeningLikeElement(node, children, isChild, location) { var tagName = getTagName(node); var objectProperties; var attrs = node.attributes.properties; @@ -87561,28 +85320,14 @@ var ts; objectProperties = emitHelpers().createAssignHelper(segments); } } - var callee = currentFileState.importSpecifier === undefined - ? ts.createJsxFactoryExpression(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 - node) - : getImplicitImportForName("createElement"); - var element = ts.createExpressionForJsxElement(factory, callee, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), location); + var element = ts.createExpressionForJsxElement(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 + tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } return element; } - function visitJsxOpeningFragmentJSX(_node, children, isChild, location) { - var childrenProps; - if (children && children.length) { - var result = convertJsxChildrenToChildrenPropObject(children); - if (result) { - childrenProps = result; - } - } - return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]), - /*keyAttr*/ undefined, ts.length(ts.getSemanticJsxChildren(children)), isChild, location); - } - function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) { + function visitJsxOpeningFragment(node, children, isChild, location) { var element = ts.createExpressionForJsxFragment(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217 ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { @@ -87609,7 +85354,7 @@ var ts; var literal = factory.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote); return ts.setTextRange(literal, node); } - else if (node.kind === 283 /* JsxExpression */) { + else if (node.kind === 280 /* JsxExpression */) { if (node.expression === undefined) { return factory.createTrue(); } @@ -87703,7 +85448,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 273 /* JsxElement */) { + if (node.kind === 270 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -88009,7 +85754,7 @@ var ts; return node; } switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -88222,7 +85967,7 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return (hierarchyFacts & 8192 /* ConstructorWithCapturedSuper */) !== 0 - && node.kind === 242 /* ReturnStatement */ + && node.kind === 239 /* ReturnStatement */ && !node.expression; } function isOrMayContainReturnCompletion(node) { @@ -88248,10 +85993,12 @@ var ts; || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } function visitor(node) { - return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ false) : node; - } - function visitorWithUnusedExpressionResult(node) { - return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ true) : node; + if (shouldVisitNode(node)) { + return visitJavaScript(node); + } + else { + return node; + } } function callExpressionVisitor(node) { if (node.kind === 105 /* SuperKeyword */) { @@ -88259,70 +86006,68 @@ var ts; } return visitor(node); } - function visitorWorker(node, expressionResultIsUnused) { + function visitJavaScript(node) { switch (node.kind) { case 123 /* StaticKeyword */: return undefined; // elide static keyword - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return visitClassExpression(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return visitParameter(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return visitArrowFunction(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return visitVariableDeclaration(node); case 78 /* Identifier */: return visitIdentifier(node); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitCaseBlock(node); - case 230 /* Block */: + case 227 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 241 /* BreakStatement */: - case 240 /* ContinueStatement */: + case 238 /* BreakStatement */: + case 237 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return visitExpressionStatement(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); - case 207 /* ParenthesizedExpression */: - return visitParenthesizedExpression(node, expressionResultIsUnused); - case 216 /* BinaryExpression */: - return visitBinaryExpression(node, expressionResultIsUnused); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node, expressionResultIsUnused); + case 204 /* ParenthesizedExpression */: + return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); + case 213 /* BinaryExpression */: + return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 14 /* NoSubstitutionTemplateLiteral */: case 15 /* TemplateHead */: case 16 /* TemplateMiddle */: @@ -88332,31 +86077,29 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return visitTemplateExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return visitSpreadElement(node); case 105 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 107 /* ThisKeyword */: return visitThisKeyword(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return visitMetaProperty(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return visitAccessorDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); - case 212 /* VoidExpression */: - return visitVoidExpression(node); default: return ts.visitEachChild(node, visitor, context); } @@ -88427,9 +86170,6 @@ var ts; } return node; } - function visitVoidExpression(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } function visitIdentifier(node) { if (!convertedLoopState) { return node; @@ -88445,14 +86185,14 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 241 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 238 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; var label = node.label; if (!label) { - if (node.kind === 241 /* BreakStatement */) { + if (node.kind === 238 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -88463,7 +86203,7 @@ var ts; } } else { - if (node.kind === 241 /* BreakStatement */) { + if (node.kind === 238 /* BreakStatement */) { labelMarker = "break-" + label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker); } @@ -88615,17 +86355,16 @@ var ts; */ function transformClassBody(node, extendsClauseElement) { var statements = []; - var name = factory.getInternalName(node); - var constructorLikeName = ts.isIdentifierANonContextualKeyword(name) ? factory.getGeneratedNameForNode(name) : name; startLexicalEnvironment(); addExtendsHelperIfNeeded(statements, node, extendsClauseElement); - addConstructor(statements, node, constructorLikeName, extendsClauseElement); + addConstructor(statements, node, extendsClauseElement); addClassMembers(statements, node); // Create a synthetic text range for the return statement. var closingBraceLocation = ts.createTokenRange(ts.skipTrivia(currentText, node.members.end), 19 /* CloseBraceToken */); + var localName = factory.getInternalName(node); // The following partially-emitted expression exists purely to align our sourcemap // emit with the original emitter. - var outer = factory.createPartiallyEmittedExpression(constructorLikeName); + var outer = factory.createPartiallyEmittedExpression(localName); ts.setTextRangeEnd(outer, closingBraceLocation.end); ts.setEmitFlags(outer, 1536 /* NoComments */); var statement = factory.createReturnStatement(outer); @@ -88657,7 +86396,7 @@ var ts; * @param node The ClassExpression or ClassDeclaration node. * @param extendsClauseElement The expression for the class `extends` clause. */ - function addConstructor(statements, node, name, extendsClauseElement) { + function addConstructor(statements, node, extendsClauseElement) { var savedConvertedLoopState = convertedLoopState; convertedLoopState = undefined; var ancestorFacts = enterSubtree(16278 /* ConstructorExcludes */, 73 /* ConstructorIncludes */); @@ -88666,7 +86405,7 @@ var ts; var constructorFunction = factory.createFunctionDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*asteriskToken*/ undefined, name, + /*asteriskToken*/ undefined, factory.getInternalName(node), /*typeParameters*/ undefined, transformConstructorParameters(constructor, hasSynthesizedSuper), /*type*/ undefined, transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper)); ts.setTextRange(constructorFunction, constructor || node); @@ -88861,11 +86600,11 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 242 /* ReturnStatement */) { + if (statement.kind === 239 /* ReturnStatement */) { return true; } // An if-statement with two covered branches is covered. - else if (statement.kind === 234 /* IfStatement */) { + else if (statement.kind === 231 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && @@ -88873,7 +86612,7 @@ var ts; } } // A block is covered if it has a last statement which is covered. - else if (statement.kind === 230 /* Block */) { + else if (statement.kind === 227 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -89075,7 +86814,7 @@ var ts; * @param node A node. */ function insertCaptureThisForNodeIfNeeded(statements, node) { - if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 209 /* ArrowFunction */) { + if (hierarchyFacts & 32768 /* CapturedLexicalThis */ && node.kind !== 206 /* ArrowFunction */) { insertCaptureThisForNode(statements, node, factory.createThis()); return true; } @@ -89097,22 +86836,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return statements; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = factory.createVoidZero(); break; - case 166 /* Constructor */: + case 165 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = factory.createPropertyAccessExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 251 /* FunctionDeclaration */: - case 208 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 205 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = factory.createConditionalExpression(factory.createLogicalAnd(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), factory.createBinaryExpression(ts.setEmitFlags(factory.createThis(), 4 /* NoSubstitution */), 101 /* InstanceOfKeyword */, factory.getLocalName(node))), @@ -89147,20 +86886,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 166 /* Constructor */: + case 165 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -89363,7 +87102,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 251 /* FunctionDeclaration */ || node.kind === 208 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 248 /* FunctionDeclaration */ || node.kind === 205 /* FunctionExpression */)) { name = factory.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* FunctionSubtreeExcludes */, 0 /* None */); @@ -89409,7 +87148,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 209 /* ArrowFunction */); + ts.Debug.assert(node.kind === 206 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -89475,55 +87214,51 @@ var ts; * @param node An ExpressionStatement node. */ function visitExpressionStatement(node) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); + // If we are here it is most likely because our expression is a destructuring assignment. + switch (node.expression.kind) { + case 204 /* ParenthesizedExpression */: + return factory.updateExpressionStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); + case 213 /* BinaryExpression */: + return factory.updateExpressionStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); + } + return ts.visitEachChild(node, visitor, context); } /** * Visits a ParenthesizedExpression that may contain a destructuring assignment. * * @param node A ParenthesizedExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). + * @param needsDestructuringValue A value indicating whether we need to hold onto the rhs + * of a destructuring assignment. */ - function visitParenthesizedExpression(node, expressionResultIsUnused) { - return ts.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context); + function visitParenthesizedExpression(node, needsDestructuringValue) { + // If we are here it is most likely because our expression is a destructuring assignment. + if (!needsDestructuringValue) { + // By default we always emit the RHS at the end of a flattened destructuring + // expression. If we are in a state where we do not need the destructuring value, + // we pass that information along to the children that care about it. + switch (node.expression.kind) { + case 204 /* ParenthesizedExpression */: + return factory.updateParenthesizedExpression(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); + case 213 /* BinaryExpression */: + return factory.updateParenthesizedExpression(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); + } + } + return ts.visitEachChild(node, visitor, context); } /** * Visits a BinaryExpression that contains a destructuring assignment. * * @param node A BinaryExpression node. - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). + * @param needsDestructuringValue A value indicating whether we need to hold onto the rhs + * of a destructuring assignment. */ - function visitBinaryExpression(node, expressionResultIsUnused) { + function visitBinaryExpression(node, needsDestructuringValue) { // If we are here it is because this is a destructuring assignment. if (ts.isDestructuringAssignment(node)) { - return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, !expressionResultIsUnused); - } - if (node.operatorToken.kind === 27 /* CommaToken */) { - return factory.updateBinaryExpression(node, ts.visitNode(node.left, visitorWithUnusedExpressionResult, ts.isExpression), node.operatorToken, ts.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts.isExpression)); + return ts.flattenDestructuringAssignment(node, visitor, context, 0 /* All */, needsDestructuringValue); } return ts.visitEachChild(node, visitor, context); } - /** - * @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the - * expression of an `ExpressionStatement`). - */ - function visitCommaListExpression(node, expressionResultIsUnused) { - if (expressionResultIsUnused) { - return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context); - } - var result; - for (var i = 0; i < node.elements.length; i++) { - var element = node.elements[i]; - var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression); - if (result || visited !== element) { - result || (result = node.elements.slice(0, i)); - result.push(visited); - } - } - var elements = result ? ts.setTextRange(factory.createNodeArray(result), node.elements) : node.elements; - return factory.updateCommaListExpression(node, elements); - } function isVariableStatementOfTypeScriptClassWrapper(node) { return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer @@ -89716,14 +87451,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -89739,9 +87474,6 @@ var ts; function visitForStatement(node, outermostLabeledStatement) { return visitIterationStatementWithFacts(5056 /* ForStatementExcludes */, 3328 /* ForStatementIncludes */, node, outermostLabeledStatement); } - function visitEachChildOfForStatement(node) { - return factory.updateForStatement(node, ts.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock)); - } function visitForInStatement(node, outermostLabeledStatement) { return visitIterationStatementWithFacts(3008 /* ForInOrForOfStatementExcludes */, 5376 /* ForInOrForOfStatementIncludes */, node, outermostLabeledStatement); } @@ -89784,7 +87516,7 @@ var ts; // evaluated on every iteration. var assignment = factory.createAssignment(initializer, boundValue); if (ts.isDestructuringAssignment(assignment)) { - statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*expressionResultIsUnused*/ true))); + statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*needsDestructuringValue*/ false))); } else { ts.setTextRangeEnd(assignment, initializer.end); @@ -89909,7 +87641,7 @@ var ts; var property = properties[i]; if ((property.transformFlags & 262144 /* ContainsYield */ && hierarchyFacts & 4 /* AsyncFunctionBody */) - || (hasComputed = ts.Debug.checkDefined(property.name).kind === 158 /* ComputedPropertyName */)) { + || (hasComputed = ts.Debug.checkDefined(property.name).kind === 157 /* ComputedPropertyName */)) { numInitialProperties = i; break; } @@ -89985,7 +87717,7 @@ var ts; } var result = convert ? convert(node, outermostLabeledStatement, /*convertedLoopBodyStatements*/ undefined, ancestorFacts) - : factory.restoreEnclosingLabel(ts.isForStatement(node) ? visitEachChildOfForStatement(node) : ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); + : factory.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel); if (convertedLoopState) { convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; } @@ -90025,18 +87757,18 @@ var ts; } function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { switch (node.kind) { - case 237 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); - case 238 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); - case 239 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); - case 235 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); - case 236 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); + case 234 /* ForStatement */: return convertForStatement(node, initializerFunction, convertedLoopBody); + case 235 /* ForInStatement */: return convertForInStatement(node, convertedLoopBody); + case 236 /* ForOfStatement */: return convertForOfStatement(node, convertedLoopBody); + case 232 /* DoStatement */: return convertDoStatement(node, convertedLoopBody); + case 233 /* WhileStatement */: return convertWhileStatement(node, convertedLoopBody); default: return ts.Debug.failBadSyntaxKind(node, "IterationStatement expected"); } } function convertForStatement(node, initializerFunction, convertedLoopBody) { var shouldConvertCondition = node.condition && shouldConvertPartOfIterationStatement(node.condition); var shouldConvertIncrementor = shouldConvertCondition || node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); - return factory.updateForStatement(node, ts.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitorWithUnusedExpressionResult, ts.isForInitializer), ts.visitNode(shouldConvertCondition ? undefined : node.condition, visitor, ts.isExpression), ts.visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitorWithUnusedExpressionResult, ts.isExpression), convertedLoopBody); + return factory.updateForStatement(node, ts.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitor, ts.isForInitializer), ts.visitNode(shouldConvertCondition ? undefined : node.condition, visitor, ts.isExpression), ts.visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitor, ts.isExpression), convertedLoopBody); } function convertForOfStatement(node, convertedLoopBody) { return factory.updateForOfStatement(node, @@ -90054,11 +87786,11 @@ var ts; function createConvertedLoopState(node) { var loopInitializer; switch (node.kind) { - case 237 /* ForStatement */: - case 238 /* ForInStatement */: - case 239 /* ForOfStatement */: + case 234 /* ForStatement */: + case 235 /* ForInStatement */: + case 236 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 250 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 247 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -90466,20 +88198,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); } break; - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -90586,7 +88318,7 @@ var ts; var updated; var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 167 /* GetAccessor */) { + if (node.kind === 166 /* GetAccessor */) { updated = factory.updateGetAccessorDeclaration(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -91078,13 +88810,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(107 /* ThisKeyword */); - context.enableEmitNotification(166 /* Constructor */); - context.enableEmitNotification(165 /* MethodDeclaration */); - context.enableEmitNotification(167 /* GetAccessor */); - context.enableEmitNotification(168 /* SetAccessor */); - context.enableEmitNotification(209 /* ArrowFunction */); - context.enableEmitNotification(208 /* FunctionExpression */); - context.enableEmitNotification(251 /* FunctionDeclaration */); + context.enableEmitNotification(165 /* Constructor */); + context.enableEmitNotification(164 /* MethodDeclaration */); + context.enableEmitNotification(166 /* GetAccessor */); + context.enableEmitNotification(167 /* SetAccessor */); + context.enableEmitNotification(206 /* ArrowFunction */); + context.enableEmitNotification(205 /* FunctionExpression */); + context.enableEmitNotification(248 /* FunctionDeclaration */); } } /** @@ -91125,10 +88857,10 @@ var ts; */ function isNameOfDeclarationWithCollidingName(node) { switch (node.parent.kind) { - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: - case 255 /* EnumDeclaration */: - case 249 /* VariableDeclaration */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: + case 252 /* EnumDeclaration */: + case 246 /* VariableDeclaration */: return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); } @@ -91210,11 +88942,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 233 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 230 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 203 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 200 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -91222,7 +88954,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 220 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 217 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -91248,15 +88980,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(275 /* JsxOpeningElement */); - context.enableEmitNotification(276 /* JsxClosingElement */); - context.enableEmitNotification(274 /* JsxSelfClosingElement */); + context.enableEmitNotification(272 /* JsxOpeningElement */); + context.enableEmitNotification(273 /* JsxClosingElement */); + context.enableEmitNotification(271 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(201 /* PropertyAccessExpression */); - context.enableSubstitution(288 /* PropertyAssignment */); + context.enableSubstitution(198 /* PropertyAccessExpression */); + context.enableSubstitution(285 /* PropertyAssignment */); return ts.chainBundle(context, transformSourceFile); /** * Transforms an ES5 source file to ES3. @@ -91275,9 +89007,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 275 /* JsxOpeningElement */: - case 276 /* JsxClosingElement */: - case 274 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 273 /* JsxClosingElement */: + case 271 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -91612,13 +89344,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitWhileStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -91631,24 +89363,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return visitAccessorDeclaration(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return visitBreakStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return visitContinueStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 262144 /* ContainsYield */) { @@ -91669,23 +89401,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return visitBinaryExpression(node); - case 337 /* CommaListExpression */: - return visitCommaListExpression(node); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return visitConditionalExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return visitYieldExpression(node); - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return visitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -91698,9 +89428,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return visitFunctionExpression(node); default: return ts.Debug.failBadSyntaxKind(node); @@ -91908,7 +89638,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -91920,7 +89650,7 @@ var ts; // _a.b = %sent%; target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -91967,61 +89697,6 @@ var ts; } return ts.visitEachChild(node, visitor, context); } - /** - * Visits a comma expression containing `yield`. - * - * @param node The node to visit. - */ - function visitCommaExpression(node) { - // [source] - // x = a(), yield, b(); - // - // [intermediate] - // a(); - // .yield resumeLabel - // .mark resumeLabel - // x = %sent%, b(); - var pendingExpressions = []; - visit(node.left); - visit(node.right); - return factory.inlineExpressions(pendingExpressions); - function visit(node) { - if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { - visit(node.left); - visit(node.right); - } - else { - if (containsYield(node) && pendingExpressions.length > 0) { - emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); - pendingExpressions = []; - } - pendingExpressions.push(ts.visitNode(node, visitor, ts.isExpression)); - } - } - } - /** - * Visits a comma-list expression. - * - * @param node The node to visit. - */ - function visitCommaListExpression(node) { - // flattened version of `visitCommaExpression` - var pendingExpressions = []; - for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { - var elem = _a[_i]; - if (ts.isBinaryExpression(elem) && elem.operatorToken.kind === 27 /* CommaToken */) { - pendingExpressions.push(visitCommaExpression(elem)); - } - else { - if (containsYield(elem) && pendingExpressions.length > 0) { - emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); - pendingExpressions = []; - } - pendingExpressions.push(ts.visitNode(elem, visitor, ts.isExpression)); - } - } - return factory.inlineExpressions(pendingExpressions); - } /** * Visits a logical binary expression containing `yield`. * @@ -92071,6 +89746,38 @@ var ts; markLabel(resultLabel); return resultLocal; } + /** + * Visits a comma expression containing `yield`. + * + * @param node The node to visit. + */ + function visitCommaExpression(node) { + // [source] + // x = a(), yield, b(); + // + // [intermediate] + // a(); + // .yield resumeLabel + // .mark resumeLabel + // x = %sent%, b(); + var pendingExpressions = []; + visit(node.left); + visit(node.right); + return factory.inlineExpressions(pendingExpressions); + function visit(node) { + if (ts.isBinaryExpression(node) && node.operatorToken.kind === 27 /* CommaToken */) { + visit(node.left); + visit(node.right); + } + else { + if (containsYield(node) && pendingExpressions.length > 0) { + emitWorker(1 /* Statement */, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); + pendingExpressions = []; + } + pendingExpressions.push(ts.visitNode(node, visitor, ts.isExpression)); + } + } + } /** * Visits a conditional expression containing `yield`. * @@ -92314,35 +90021,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 230 /* Block */: + case 227 /* Block */: return transformAndEmitBlock(node); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return transformAndEmitIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return transformAndEmitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return transformAndEmitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return transformAndEmitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -92772,7 +90479,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 285 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 282 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -92785,7 +90492,7 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 284 /* CaseClause */) { + if (clause.kind === 281 /* CaseClause */) { if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } @@ -93946,11 +91653,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(213 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(211 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(212 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(294 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -94001,10 +91708,7 @@ var ts; ts.append(statements, createUnderscoreUnderscoreESModule()); } if (ts.length(currentModuleInfo.exportedNames)) { - var chunkSize = 50; - for (var i = 0; i < currentModuleInfo.exportedNames.length; i += chunkSize) { - ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames.slice(i, i + chunkSize), function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero()))); - } + ts.append(statements, factory.createExpressionStatement(ts.reduceLeft(currentModuleInfo.exportedNames, function (prev, nextId) { return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts.idText(nextId))), prev); }, factory.createVoidZero()))); } ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); @@ -94278,23 +91982,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 338 /* MergeDeclarationMarker */: + case 333 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 339 /* EndOfDeclarationMarker */: + case 334 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, moduleExpressionElementVisitor, context); @@ -94321,24 +92025,24 @@ var ts; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var elem = _a[_i]; switch (elem.kind) { - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: if (destructuringNeedsFlattening(elem.initializer)) { return true; } break; - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: if (destructuringNeedsFlattening(elem.name)) { return true; } break; - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: if (destructuringNeedsFlattening(elem.expression)) { return true; } break; - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return false; default: ts.Debug.assertNever(elem, "Unhandled object member kind"); } @@ -94673,11 +92377,9 @@ var ts; else if (node.exportClause) { var statements = []; // export * as ns from "mod"; - // export * as default from "mod"; statements.push(ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(createExportExpression(factory.cloneNode(node.exportClause.name), getHelperExpressionForExport(node, moduleKind !== ts.ModuleKind.AMD ? createRequireCall(node) : - ts.isExportNamespaceAsDefaultDeclaration(node) ? generatedName : - factory.createIdentifier(ts.idText(node.exportClause.name))))), node), node)); + factory.createIdentifier(ts.idText(node.exportClause.name))))), node), node)); return ts.singleOrMany(statements); } else { @@ -94770,7 +92472,6 @@ var ts; var expressions; if (ts.hasSyntacticModifier(node, 1 /* Export */)) { var modifiers = void 0; - var removeCommentsOnExpressions = false; // If we're exporting these variables, then these just become assignments to 'exports.x'. for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var variable = _a[_i]; @@ -94781,28 +92482,14 @@ var ts; variables = ts.append(variables, variable); } else if (variable.initializer) { - if (!ts.isBindingPattern(variable.name) && (ts.isArrowFunction(variable.initializer) || ts.isFunctionExpression(variable.initializer) || ts.isClassExpression(variable.initializer))) { - var expression = factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), variable.name), - /*location*/ variable.name), factory.createIdentifier(ts.getTextOfIdentifierOrLiteral(variable.name))); - var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, moduleExpressionElementVisitor)); - variables = ts.append(variables, updatedVariable); - expressions = ts.append(expressions, expression); - removeCommentsOnExpressions = true; - } - else { - expressions = ts.append(expressions, transformInitializedVariable(variable)); - } + expressions = ts.append(expressions, transformInitializedVariable(variable)); } } if (variables) { statements = ts.append(statements, factory.updateVariableStatement(node, modifiers, factory.updateVariableDeclarationList(node.declarationList, variables))); } if (expressions) { - var statement = ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node); - if (removeCommentsOnExpressions) { - ts.removeAllComments(statement); - } - statements = ts.append(statements, statement); + statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node)); } } else { @@ -94863,7 +92550,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 229 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -94918,10 +92605,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding, /* liveBinding */ true); @@ -95134,7 +92821,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -95198,10 +92885,10 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return substituteBinaryExpression(node); - case 215 /* PostfixUnaryExpression */: - case 214 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -95220,9 +92907,9 @@ var ts; } return node; } - if (!(ts.isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64 /* AllowNameSubstitution */)) && !ts.isLocalName(node)) { + if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 297 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 294 /* SourceFile */) { return ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.cloneNode(node)), /*location*/ node); } @@ -95297,7 +92984,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 215 /* PostfixUnaryExpression */ + var expression = node.kind === 212 /* PostfixUnaryExpression */ ? ts.setTextRange(factory.createBinaryExpression(node.operand, factory.createToken(node.operator === 45 /* PlusPlusToken */ ? 63 /* PlusEqualsToken */ : 64 /* MinusEqualsToken */), factory.createNumericLiteral(1)), /*location*/ node) : node; @@ -95349,12 +93036,12 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(78 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(289 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(216 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(214 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(215 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(226 /* MetaProperty */); // Substitutes 'import.meta' - context.enableEmitNotification(297 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(286 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(213 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(211 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(212 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(223 /* MetaProperty */); // Substitutes 'import.meta' + context.enableEmitNotification(294 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -95578,7 +93265,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 267 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 264 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -95668,19 +93355,19 @@ var ts; var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(factory, entry, currentSourceFile); // TODO: GH#18217 switch (entry.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(factory.createExpressionStatement(factory.createAssignment(importVariableName, parameterName))); break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { if (ts.isNamedExports(entry.exportClause)) { @@ -95739,13 +93426,13 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return visitImportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return visitExportDeclaration(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -95925,7 +93612,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 297 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 294 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -95989,7 +93676,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 232 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 229 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasSyntacticModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -96051,10 +93738,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -96234,43 +93921,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return visitVariableStatement(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return visitClassDeclaration(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return visitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return visitForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return visitForOfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return visitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return visitWhileStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return visitLabeledStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return visitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return visitSwitchStatement(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return visitCaseBlock(node); - case 284 /* CaseClause */: + case 281 /* CaseClause */: return visitCaseClause(node); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return visitDefaultClause(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return visitTryStatement(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return visitCatchClause(node); - case 230 /* Block */: + case 227 /* Block */: return visitBlock(node); - case 338 /* MergeDeclarationMarker */: + case 333 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 339 /* EndOfDeclarationMarker */: + case 334 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -96517,7 +94204,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 297 /* SourceFile */; + return container !== undefined && container.kind === 294 /* SourceFile */; } else { return false; @@ -96550,7 +94237,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 297 /* SourceFile */) { + if (node.kind === 294 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -96600,7 +94287,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -96636,12 +94323,12 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return substituteExpressionIdentifier(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return substituteBinaryExpression(node); - case 214 /* PrefixUnaryExpression */: - case 215 /* PostfixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return substituteMetaProperty(node); } return node; @@ -96734,14 +94421,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 215 /* PostfixUnaryExpression */ + var expression = node.kind === 212 /* PostfixUnaryExpression */ ? ts.setTextRange(factory.createPrefixUnaryExpression(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { var exportName = exportedNames_5[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 215 /* PostfixUnaryExpression */) { + if (node.kind === 212 /* PostfixUnaryExpression */) { expression = node.operator === 45 /* PlusPlusToken */ ? factory.createSubtract(preventSubstitution(expression), factory.createNumericLiteral(1)) : factory.createAdd(preventSubstitution(expression), factory.createNumericLiteral(1)); @@ -96769,7 +94456,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 297 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 294 /* SourceFile */) { exportedNames = ts.append(exportedNames, factory.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -96809,7 +94496,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(297 /* SourceFile */); + context.enableEmitNotification(294 /* SourceFile */); context.enableSubstitution(78 /* Identifier */); var helperNameSubstitutions; return ts.chainBundle(context, transformSourceFile); @@ -96841,12 +94528,12 @@ var ts; } function visitor(node) { switch (node.kind) { - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return visitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: var exportDecl = node; return visitExportDeclaration(exportDecl); } @@ -96873,7 +94560,7 @@ var ts; /*isTypeOnly*/ false, /*name*/ undefined, factory.createNamespaceImport(synthName)), node.moduleSpecifier); ts.setOriginalNode(importDecl, node.exportClause); - var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration( + var exportDecl = factory.createExportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, /*isTypeOnly*/ false, factory.createNamedExports([factory.createExportSpecifier(synthName, oldIdentifier)])); @@ -96980,7 +94667,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97009,7 +94696,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97056,7 +94743,7 @@ var ts; return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]); } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97065,8 +94752,8 @@ var ts; } // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. - else if (node.kind === 163 /* PropertyDeclaration */ || node.kind === 201 /* PropertyAccessExpression */ || node.kind === 162 /* PropertySignature */ || - (node.kind === 160 /* Parameter */ && ts.hasSyntacticModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 162 /* PropertyDeclaration */ || node.kind === 198 /* PropertyAccessExpression */ || node.kind === 161 /* PropertySignature */ || + (node.kind === 159 /* Parameter */ && ts.hasSyntacticModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasSyntacticModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -97075,7 +94762,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 252 /* ClassDeclaration */ || node.kind === 160 /* Parameter */) { + else if (node.parent.kind === 249 /* ClassDeclaration */ || node.kind === 159 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97100,7 +94787,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (node.kind === 168 /* SetAccessor */) { + if (node.kind === 167 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasSyntacticModifier(node, 32 /* Static */)) { @@ -97139,26 +94826,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -97166,7 +94853,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.kind === 249 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -97180,7 +94867,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -97205,30 +94892,30 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 166 /* Constructor */: + case 165 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 170 /* ConstructSignature */: - case 175 /* ConstructorType */: + case 169 /* ConstructSignature */: + case 174 /* ConstructorType */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 169 /* CallSignature */: + case 168 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -97236,7 +94923,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 249 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97249,15 +94936,15 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 251 /* FunctionDeclaration */: - case 174 /* FunctionType */: + case 248 /* FunctionDeclaration */: + case 173 /* FunctionType */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - case 168 /* SetAccessor */: - case 167 /* GetAccessor */: + case 167 /* SetAccessor */: + case 166 /* GetAccessor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -97271,39 +94958,39 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 190 /* MappedType */: + case 189 /* MappedType */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; break; - case 175 /* ConstructorType */: - case 170 /* ConstructSignature */: + case 174 /* ConstructorType */: + case 169 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 169 /* CallSignature */: + case 168 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 165 /* MethodDeclaration */: - case 164 /* MethodSignature */: + case 164 /* MethodDeclaration */: + case 163 /* MethodSignature */: if (ts.hasSyntacticModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 252 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 249 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 174 /* FunctionType */: - case 251 /* FunctionDeclaration */: + case 173 /* FunctionType */: + case 248 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -97367,7 +95054,7 @@ var ts; } function isInternalDeclaration(node, currentSourceFile) { var parseTreeNode = ts.getParseTreeNode(node); - if (parseTreeNode && parseTreeNode.kind === 160 /* Parameter */) { + if (parseTreeNode && parseTreeNode.kind === 159 /* Parameter */) { var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : undefined; var text = currentSourceFile.text; @@ -97422,7 +95109,6 @@ var ts; reportCyclicStructureError: reportCyclicStructureError, reportPrivateInBaseOfClassExpression: reportPrivateInBaseOfClassExpression, reportLikelyUnsafeImportRequiredError: reportLikelyUnsafeImportRequiredError, - reportTruncationError: reportTruncationError, moduleResolverHost: host, trackReferencedAmbientModule: trackReferencedAmbientModule, trackExternalModuleSymbolOfImportTypeNode: trackExternalModuleSymbolOfImportTypeNode, @@ -97522,11 +95208,6 @@ var ts; context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, ts.declarationNameToString(errorNameNode), specifier)); } } - function reportTruncationError() { - if (errorNameNode) { - context.addDiagnostic(ts.createDiagnosticForNode(errorNameNode, ts.Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed)); - } - } function reportNonlocalAugmentation(containingFile, parentSymbol, symbol) { var primaryDeclaration = ts.find(parentSymbol.declarations, function (d) { return ts.getSourceFileOfNode(d) === containingFile; }); var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; }); @@ -97548,10 +95229,10 @@ var ts; return result; } function transformRoot(node) { - if (node.kind === 297 /* SourceFile */ && node.isDeclarationFile) { + if (node.kind === 294 /* SourceFile */ && node.isDeclarationFile) { return node; } - if (node.kind === 298 /* Bundle */) { + if (node.kind === 295 /* Bundle */) { isBundledEmit = true; refs = new ts.Map(); libs = new ts.Map(); @@ -97581,7 +95262,7 @@ var ts; var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements); return factory.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []); }), ts.mapDefined(node.prepends, function (prepend) { - if (prepend.kind === 300 /* InputFiles */) { + if (prepend.kind === 297 /* InputFiles */) { var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal); hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; collectReferences(sourceFile, refs); @@ -97722,7 +95403,7 @@ var ts; return name; } else { - if (name.kind === 197 /* ArrayBindingPattern */) { + if (name.kind === 194 /* ArrayBindingPattern */) { return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement)); } else { @@ -97730,7 +95411,7 @@ var ts; } } function visitBindingElement(elem) { - if (elem.kind === 222 /* OmittedExpression */) { + if (elem.kind === 219 /* OmittedExpression */) { return elem; } return factory.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined); @@ -97768,7 +95449,7 @@ var ts; // Literal const declarations will have an initializer ensured rather than a type return; } - var shouldUseResolverType = node.kind === 160 /* Parameter */ && + var shouldUseResolverType = node.kind === 159 /* Parameter */ && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); if (type && !shouldUseResolverType) { @@ -97777,7 +95458,7 @@ var ts; if (!ts.getParseTreeNode(node)) { return type ? ts.visitNode(type, visitDeclarationSubtree) : factory.createKeywordTypeNode(128 /* AnyKeyword */); } - if (node.kind === 168 /* SetAccessor */) { + if (node.kind === 167 /* SetAccessor */) { // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now // (The inferred type here will be void, but the old declaration emitter printed `any`, so this replicates that) return factory.createKeywordTypeNode(128 /* AnyKeyword */); @@ -97788,12 +95469,12 @@ var ts; oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(node); } - if (node.kind === 249 /* VariableDeclaration */ || node.kind === 198 /* BindingElement */) { + if (node.kind === 246 /* VariableDeclaration */ || node.kind === 195 /* BindingElement */) { return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); } - if (node.kind === 160 /* Parameter */ - || node.kind === 163 /* PropertyDeclaration */ - || node.kind === 162 /* PropertySignature */) { + if (node.kind === 159 /* Parameter */ + || node.kind === 162 /* PropertyDeclaration */ + || node.kind === 161 /* PropertySignature */) { if (!node.initializer) return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); @@ -97810,20 +95491,20 @@ var ts; function isDeclarationAndNotVisible(node) { node = ts.getParseTreeNode(node); switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: return !resolver.isDeclarationVisible(node); // The following should be doing their own visibility checks based on filtering their members - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return !getBindingNameVisible(node); - case 260 /* ImportEqualsDeclaration */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: + case 257 /* ImportEqualsDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: return false; } return false; @@ -97904,7 +95585,7 @@ var ts; function rewriteModuleSpecifier(parent, input) { if (!input) return undefined; // TODO: GH#18217 - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 256 /* ModuleDeclaration */ && parent.kind !== 195 /* ImportType */); + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || (parent.kind !== 253 /* ModuleDeclaration */ && parent.kind !== 192 /* ImportType */); if (ts.isStringLiteralLike(input)) { if (isBundledEmit) { var newName = ts.getExternalModuleNameFromDeclaration(context.getEmitHost(), resolver, parent); @@ -97924,7 +95605,7 @@ var ts; function transformImportEqualsDeclaration(decl) { if (!resolver.isDeclarationVisible(decl)) return; - if (decl.moduleReference.kind === 272 /* ExternalModuleReference */) { + if (decl.moduleReference.kind === 269 /* ExternalModuleReference */) { // Rewrite external module names if necessary var specifier = ts.getExternalModuleImportEqualsDeclarationExpression(decl); return factory.updateImportEqualsDeclaration(decl, @@ -97951,7 +95632,7 @@ var ts; return visibleDefaultBinding && factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, /*namedBindings*/ undefined), rewriteModuleSpecifier(decl, decl.moduleSpecifier)); } - if (decl.importClause.namedBindings.kind === 263 /* NamespaceImport */) { + if (decl.importClause.namedBindings.kind === 260 /* NamespaceImport */) { // Namespace import (optionally with visible default) var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : /*namedBindings*/ undefined; return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, /*decorators*/ undefined, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier)) : undefined; @@ -98046,7 +95727,7 @@ var ts; // We'd see a TDZ violation at runtime var canProduceDiagnostic = ts.canProduceDiagnostics(input); var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; - var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 177 /* TypeLiteral */ || input.kind === 190 /* MappedType */) && input.parent.kind !== 254 /* TypeAliasDeclaration */); + var shouldEnterSuppressNewDiagnosticsContextContext = ((input.kind === 176 /* TypeLiteral */ || input.kind === 189 /* MappedType */) && input.parent.kind !== 251 /* TypeAliasDeclaration */); // Emit methods which are private as properties with no type information if (ts.isMethodDeclaration(input) || ts.isMethodSignature(input)) { if (ts.hasEffectiveModifier(input, 8 /* Private */)) { @@ -98067,21 +95748,21 @@ var ts; } if (isProcessedComponent(input)) { switch (input.kind) { - case 223 /* ExpressionWithTypeArguments */: { + case 220 /* ExpressionWithTypeArguments */: { if ((ts.isEntityName(input.expression) || ts.isEntityNameExpression(input.expression))) { checkEntityNameVisibility(input.expression, enclosingDeclaration); } var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments)); } - case 173 /* TypeReference */: { + case 172 /* TypeReference */: { checkEntityNameVisibility(input.typeName, enclosingDeclaration); var node = ts.visitEachChild(input, visitDeclarationSubtree, context); return cleanup(factory.updateTypeReferenceNode(node, node.typeName, node.typeArguments)); } - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return cleanup(factory.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); - case 166 /* Constructor */: { + case 165 /* Constructor */: { // A constructor declaration may not have a type annotation var ctor = factory.createConstructorDeclaration( /*decorators*/ undefined, @@ -98089,7 +95770,7 @@ var ts; /*body*/ undefined); return cleanup(ctor); } - case 165 /* MethodDeclaration */: { + case 164 /* MethodDeclaration */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98099,7 +95780,7 @@ var ts; /*body*/ undefined); return cleanup(sig); } - case 167 /* GetAccessor */: { + case 166 /* GetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98108,7 +95789,7 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), ensureType(input, accessorType), /*body*/ undefined)); } - case 168 /* SetAccessor */: { + case 167 /* SetAccessor */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } @@ -98116,31 +95797,31 @@ var ts; /*decorators*/ undefined, ensureModifiers(input), input.name, updateAccessorParamsList(input, ts.hasEffectiveModifier(input, 8 /* Private */)), /*body*/ undefined)); } - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updatePropertyDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type))); - case 164 /* MethodSignature */: { + case 163 /* MethodSignature */: { if (ts.isPrivateIdentifier(input.name)) { return cleanup(/*returnValue*/ undefined); } return cleanup(factory.updateMethodSignature(input, ensureModifiers(input), input.name, input.questionToken, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 169 /* CallSignature */: { + case 168 /* CallSignature */: { return cleanup(factory.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); } - case 171 /* IndexSignature */: { + case 170 /* IndexSignature */: { return cleanup(factory.updateIndexSignature(input, /*decorators*/ undefined, ensureModifiers(input), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree) || factory.createKeywordTypeNode(128 /* AnyKeyword */))); } - case 249 /* VariableDeclaration */: { + case 246 /* VariableDeclaration */: { if (ts.isBindingPattern(input.name)) { return recreateBindingPattern(input.name); } @@ -98148,13 +95829,13 @@ var ts; suppressNewDiagnosticContexts = true; // Variable declaration types also suppress new diagnostic contexts, provided the contexts wouldn't be made for binding pattern types return cleanup(factory.updateVariableDeclaration(input, input.name, /*exclamationToken*/ undefined, ensureType(input, input.type), ensureNoInitializer(input))); } - case 159 /* TypeParameter */: { + case 158 /* TypeParameter */: { if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { return cleanup(factory.updateTypeParameterDeclaration(input, input.name, /*constraint*/ undefined, /*defaultType*/ undefined)); } return cleanup(ts.visitEachChild(input, visitDeclarationSubtree, context)); } - case 184 /* ConditionalType */: { + case 183 /* ConditionalType */: { // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type. var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree); @@ -98166,13 +95847,13 @@ var ts; var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree); return cleanup(factory.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); } - case 174 /* FunctionType */: { + case 173 /* FunctionType */: { return cleanup(factory.updateFunctionTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 175 /* ConstructorType */: { + case 174 /* ConstructorType */: { return cleanup(factory.updateConstructorTypeNode(input, ts.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts.visitNode(input.type, visitDeclarationSubtree))); } - case 195 /* ImportType */: { + case 192 /* ImportType */: { if (!ts.isLiteralImportTypeNode(input)) return cleanup(input); return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf)); @@ -98204,7 +95885,7 @@ var ts; } } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 165 /* MethodDeclaration */ && ts.hasEffectiveModifier(node.parent, 8 /* Private */); + return node.parent.kind === 164 /* MethodDeclaration */ && ts.hasEffectiveModifier(node.parent, 8 /* Private */); } function visitDeclarationStatements(input) { if (!isPreservedDeclarationStatement(input)) { @@ -98214,7 +95895,7 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 267 /* ExportDeclaration */: { + case 264 /* ExportDeclaration */: { if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; } @@ -98224,7 +95905,7 @@ var ts; return factory.updateExportDeclaration(input, /*decorators*/ undefined, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier)); } - case 266 /* ExportAssignment */: { + case 263 /* ExportAssignment */: { // Always visible if the parent node isn't dropped for being not visible if (ts.isSourceFile(input.parent)) { resultHasExternalModuleIndicator = true; @@ -98263,10 +95944,10 @@ var ts; if (shouldStripInternal(input)) return; switch (input.kind) { - case 260 /* ImportEqualsDeclaration */: { + case 257 /* ImportEqualsDeclaration */: { return transformImportEqualsDeclaration(input); } - case 261 /* ImportDeclaration */: { + case 258 /* ImportDeclaration */: { return transformImportDeclaration(input); } } @@ -98287,14 +95968,14 @@ var ts; } var previousNeedsDeclare = needsDeclare; switch (input.kind) { - case 254 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all + case 251 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all return cleanup(factory.updateTypeAliasDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode))); - case 253 /* InterfaceDeclaration */: { + case 250 /* InterfaceDeclaration */: { return cleanup(factory.updateInterfaceDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree))); } - case 251 /* FunctionDeclaration */: { + case 248 /* FunctionDeclaration */: { // Generators lose their generator-ness, excepting their return type var clean = cleanup(factory.updateFunctionDeclaration(input, /*decorators*/ undefined, ensureModifiers(input), @@ -98361,10 +96042,10 @@ var ts; return clean; } } - case 256 /* ModuleDeclaration */: { + case 253 /* ModuleDeclaration */: { needsDeclare = false; var inner = input.body; - if (inner && inner.kind === 257 /* ModuleBlock */) { + if (inner && inner.kind === 254 /* ModuleBlock */) { var oldNeedsScopeFix = needsScopeFixMarker; var oldHasScopeFix = resultHasScopeMarker; resultHasScopeMarker = false; @@ -98407,7 +96088,7 @@ var ts; /*decorators*/ undefined, mods, input.name, body)); } } - case 252 /* ClassDeclaration */: { + case 249 /* ClassDeclaration */: { var modifiers = factory.createNodeArray(ensureModifiers(input)); var typeParameters = ensureTypeParams(input, input.typeParameters); var ctor = ts.getFirstConstructorWithBody(input); @@ -98488,10 +96169,10 @@ var ts; /*decorators*/ undefined, modifiers, input.name, typeParameters, heritageClauses, members)); } } - case 232 /* VariableStatement */: { + case 229 /* VariableStatement */: { return cleanup(transformVariableStatement(input)); } - case 255 /* EnumDeclaration */: { + case 252 /* EnumDeclaration */: { return cleanup(factory.updateEnumDeclaration(input, /*decorators*/ undefined, factory.createNodeArray(ensureModifiers(input)), input.name, factory.createNodeArray(ts.mapDefined(input.members, function (m) { if (shouldStripInternal(m)) return; @@ -98510,7 +96191,7 @@ var ts; if (canProdiceDiagnostic) { getSymbolAccessibilityDiagnostic = oldDiag; } - if (input.kind === 256 /* ModuleDeclaration */) { + if (input.kind === 253 /* ModuleDeclaration */) { needsDeclare = previousNeedsDeclare; } if (node === input) { @@ -98531,7 +96212,7 @@ var ts; return ts.flatten(ts.mapDefined(d.elements, function (e) { return recreateBindingElement(e); })); } function recreateBindingElement(e) { - if (e.kind === 222 /* OmittedExpression */) { + if (e.kind === 219 /* OmittedExpression */) { return; } if (e.name) { @@ -98581,7 +96262,7 @@ var ts; function ensureModifierFlags(node) { var mask = 11263 /* All */ ^ (4 /* Public */ | 256 /* Async */); // No async modifiers in declaration files var additions = (needsDeclare && !isAlwaysType(node)) ? 2 /* Ambient */ : 0 /* None */; - var parentIsFile = node.parent.kind === 297 /* SourceFile */; + var parentIsFile = node.parent.kind === 294 /* SourceFile */; if (!parentIsFile || (isBundledEmit && parentIsFile && ts.isExternalModule(node.parent))) { mask ^= 2 /* Ambient */; additions = 0 /* None */; @@ -98610,7 +96291,7 @@ var ts; } ts.transformDeclarations = transformDeclarations; function isAlwaysType(node) { - if (node.kind === 253 /* InterfaceDeclaration */) { + if (node.kind === 250 /* InterfaceDeclaration */) { return true; } return false; @@ -98635,7 +96316,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 167 /* GetAccessor */ + return accessor.kind === 166 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -98644,52 +96325,52 @@ var ts; } function canHaveLiteralInitializer(node) { switch (node.kind) { - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: return !ts.hasEffectiveModifier(node, 8 /* Private */); - case 160 /* Parameter */: - case 249 /* VariableDeclaration */: + case 159 /* Parameter */: + case 246 /* VariableDeclaration */: return true; } return false; } function isPreservedDeclarationStatement(node) { switch (node.kind) { - case 251 /* FunctionDeclaration */: - case 256 /* ModuleDeclaration */: - case 260 /* ImportEqualsDeclaration */: - case 253 /* InterfaceDeclaration */: - case 252 /* ClassDeclaration */: - case 254 /* TypeAliasDeclaration */: - case 255 /* EnumDeclaration */: - case 232 /* VariableStatement */: - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: - case 266 /* ExportAssignment */: + case 248 /* FunctionDeclaration */: + case 253 /* ModuleDeclaration */: + case 257 /* ImportEqualsDeclaration */: + case 250 /* InterfaceDeclaration */: + case 249 /* ClassDeclaration */: + case 251 /* TypeAliasDeclaration */: + case 252 /* EnumDeclaration */: + case 229 /* VariableStatement */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: + case 263 /* ExportAssignment */: return true; } return false; } function isProcessedComponent(node) { switch (node.kind) { - case 170 /* ConstructSignature */: - case 166 /* Constructor */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 163 /* PropertyDeclaration */: - case 162 /* PropertySignature */: - case 164 /* MethodSignature */: - case 169 /* CallSignature */: - case 171 /* IndexSignature */: - case 249 /* VariableDeclaration */: - case 159 /* TypeParameter */: - case 223 /* ExpressionWithTypeArguments */: - case 173 /* TypeReference */: - case 184 /* ConditionalType */: - case 174 /* FunctionType */: - case 175 /* ConstructorType */: - case 195 /* ImportType */: + case 169 /* ConstructSignature */: + case 165 /* Constructor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 162 /* PropertyDeclaration */: + case 161 /* PropertySignature */: + case 163 /* MethodSignature */: + case 168 /* CallSignature */: + case 170 /* IndexSignature */: + case 246 /* VariableDeclaration */: + case 158 /* TypeParameter */: + case 220 /* ExpressionWithTypeArguments */: + case 172 /* TypeReference */: + case 183 /* ConditionalType */: + case 173 /* FunctionType */: + case 174 /* ConstructorType */: + case 192 /* ImportType */: return true; } return false; @@ -98733,13 +96414,14 @@ var ts; function getScriptTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles) { if (emitOnlyDtsFiles) return ts.emptyArray; + var jsx = compilerOptions.jsx; var languageVersion = ts.getEmitScriptTarget(compilerOptions); var moduleKind = ts.getEmitModuleKind(compilerOptions); var transformers = []; ts.addRange(transformers, customTransformers && ts.map(customTransformers.before, wrapScriptTransformerFactory)); transformers.push(ts.transformTypeScript); transformers.push(ts.transformClassFields); - if (ts.getJSXTransformEnabled(compilerOptions)) { + if (jsx === 2 /* React */) { transformers.push(ts.transformJsx); } if (languageVersion < 99 /* ESNext */) { @@ -98821,7 +96503,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, factory, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(341 /* Count */); + var enabledSyntaxKindFeatures = new Array(336 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentStatements; @@ -98894,13 +96576,7 @@ var ts; // prevent modification of transformation hooks. state = 1 /* Initialized */; // Transform each node. - var transformed = []; - for (var _a = 0, nodes_3 = nodes; _a < nodes_3.length; _a++) { - var node = nodes_3[_a]; - ts.tracing.push("emit" /* Emit */, "transformNodes", node.kind === 297 /* SourceFile */ ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); - transformed.push((allowDtsFiles ? transformation : transformRoot)(node)); - ts.tracing.pop(); - } + var transformed = ts.map(nodes, allowDtsFiles ? transformation : transformRoot); // prevent modification of the lexical environment. state = 2 /* Completed */; ts.performance.mark("afterTransform"); @@ -99136,8 +96812,8 @@ var ts; function dispose() { if (state < 3 /* Disposed */) { // Clean up emit nodes on parse tree - for (var _i = 0, nodes_4 = nodes; _i < nodes_4.length; _i++) { - var node = nodes_4[_i]; + for (var _i = 0, nodes_3 = nodes; _i < nodes_3.length; _i++) { + var node = nodes_3[_i]; ts.disposeEmitNodes(ts.getSourceFileOfNode(ts.getParseTreeNode(node))); } // Release references to external entries for GC purposes. @@ -99269,7 +96945,7 @@ var ts; /*@internal*/ function getOutputPathsFor(sourceFile, host, forceDtsPaths) { var options = host.getCompilerOptions(); - if (sourceFile.kind === 298 /* Bundle */) { + if (sourceFile.kind === 295 /* Bundle */) { return getOutputPathsForBundle(options, forceDtsPaths); } else { @@ -99465,15 +97141,9 @@ var ts; sourceFiles: sourceFileOrBundle.sourceFiles.map(function (file) { return relativeToBuildInfo(ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory())); }) }; } - ts.tracing.push("emit" /* Emit */, "emitJsFileOrBundle", { jsFilePath: jsFilePath }); emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo); - ts.tracing.pop(); - ts.tracing.push("emit" /* Emit */, "emitDeclarationFileOrBundle", { declarationFilePath: declarationFilePath }); emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo); - ts.tracing.pop(); - ts.tracing.push("emit" /* Emit */, "emitBuildInfo", { buildInfoPath: buildInfoPath }); emitBuildInfo(bundleBuildInfo, buildInfoPath); - ts.tracing.pop(); if (!emitSkipped && emittedFilesList) { if (!emitOnlyDtsFiles) { if (jsFilePath) { @@ -99605,7 +97275,7 @@ var ts; mapRoot: compilerOptions.mapRoot, extendedDiagnostics: compilerOptions.extendedDiagnostics, }); - if (forceDtsEmit && declarationTransform.transformed[0].kind === 297 /* SourceFile */) { + if (forceDtsEmit && declarationTransform.transformed[0].kind === 294 /* SourceFile */) { var sourceFile = declarationTransform.transformed[0]; exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit; } @@ -99628,8 +97298,8 @@ var ts; ts.forEachChild(node, collectLinkedAliases); } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle, printer, mapOptions) { - var bundle = sourceFileOrBundle.kind === 298 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 297 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 295 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 294 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; var sourceMapGenerator; if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { @@ -99670,7 +97340,7 @@ var ts; } function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { return (mapOptions.sourceMap || mapOptions.inlineSourceMap) - && (sourceFileOrBundle.kind !== 297 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); + && (sourceFileOrBundle.kind !== 294 /* SourceFile */ || !ts.fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */)); } function getSourceRoot(mapOptions) { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the @@ -99714,16 +97384,16 @@ var ts; if (ts.getRootLength(sourceMapDir) === 0) { // The relative paths are relative to the common directory sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - return encodeURI(ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath + return ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath ts.combinePaths(sourceMapDir, sourceMapFile), // this is where user expects to see sourceMap host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ true)); + /*isAbsolutePathAnUrl*/ true); } else { - return encodeURI(ts.combinePaths(sourceMapDir, sourceMapFile)); + return ts.combinePaths(sourceMapDir, sourceMapFile); } } - return encodeURI(sourceMapFile); + return sourceMapFile; } } ts.emitFiles = emitFiles; @@ -99938,8 +97608,6 @@ var ts; var sourceMapGenerator; var sourceMapSource; var sourceMapSourceIndex = -1; - var mostRecentlyAddedSourceMapSource; - var mostRecentlyAddedSourceMapSourceIndex = -1; // Comments var containerPos = -1; var containerEnd = -1; @@ -99978,9 +97646,9 @@ var ts; break; } switch (node.kind) { - case 297 /* SourceFile */: return printFile(node); - case 298 /* Bundle */: return printBundle(node); - case 299 /* UnparsedSource */: return printUnparsedSource(node); + case 294 /* SourceFile */: return printFile(node); + case 295 /* Bundle */: return printBundle(node); + case 296 /* UnparsedSource */: return printUnparsedSource(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -100236,12 +97904,12 @@ var ts; } // falls through case 2 /* Comments */: - if (!commentsDisabled && node.kind !== 297 /* SourceFile */) { + if (!commentsDisabled && node.kind !== 294 /* SourceFile */) { return pipelineEmitWithComments; } // falls through case 3 /* SourceMaps */: - if (!sourceMapsDisabled && node.kind !== 297 /* SourceFile */ && !ts.isInJsonFile(node)) { + if (!sourceMapsDisabled && node.kind !== 294 /* SourceFile */ && !ts.isInJsonFile(node)) { return pipelineEmitWithSourceMap; } // falls through @@ -100283,15 +97951,15 @@ var ts; case 16 /* TemplateMiddle */: case 17 /* TemplateTail */: return emitLiteral(node, /*jsxAttributeEscape*/ false); - case 299 /* UnparsedSource */: - case 293 /* UnparsedPrepend */: + case 296 /* UnparsedSource */: + case 290 /* UnparsedPrepend */: return emitUnparsedSourceOrPrepend(node); - case 292 /* UnparsedPrologue */: + case 289 /* UnparsedPrologue */: return writeUnparsedNode(node); - case 294 /* UnparsedText */: - case 295 /* UnparsedInternalText */: + case 291 /* UnparsedText */: + case 292 /* UnparsedInternalText */: return emitUnparsedTextLike(node); - case 296 /* UnparsedSyntheticReference */: + case 293 /* UnparsedSyntheticReference */: return emitUnparsedSyntheticReference(node); // Identifiers case 78 /* Identifier */: @@ -100301,270 +97969,262 @@ var ts; return emitPrivateIdentifier(node); // Parse tree nodes // Names - case 157 /* QualifiedName */: + case 156 /* QualifiedName */: return emitQualifiedName(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 159 /* TypeParameter */: + case 158 /* TypeParameter */: return emitTypeParameter(node); - case 160 /* Parameter */: + case 159 /* Parameter */: return emitParameter(node); - case 161 /* Decorator */: + case 160 /* Decorator */: return emitDecorator(node); // Type members - case 162 /* PropertySignature */: + case 161 /* PropertySignature */: return emitPropertySignature(node); - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 164 /* MethodSignature */: + case 163 /* MethodSignature */: return emitMethodSignature(node); - case 165 /* MethodDeclaration */: + case 164 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 166 /* Constructor */: + case 165 /* Constructor */: return emitConstructor(node); - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return emitAccessorDeclaration(node); - case 169 /* CallSignature */: + case 168 /* CallSignature */: return emitCallSignature(node); - case 170 /* ConstructSignature */: + case 169 /* ConstructSignature */: return emitConstructSignature(node); - case 171 /* IndexSignature */: + case 170 /* IndexSignature */: return emitIndexSignature(node); - case 194 /* TemplateLiteralTypeSpan */: - return emitTemplateTypeSpan(node); // Types - case 172 /* TypePredicate */: + case 171 /* TypePredicate */: return emitTypePredicate(node); - case 173 /* TypeReference */: + case 172 /* TypeReference */: return emitTypeReference(node); - case 174 /* FunctionType */: + case 173 /* FunctionType */: return emitFunctionType(node); - case 308 /* JSDocFunctionType */: + case 304 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 175 /* ConstructorType */: + case 174 /* ConstructorType */: return emitConstructorType(node); - case 176 /* TypeQuery */: + case 175 /* TypeQuery */: return emitTypeQuery(node); - case 177 /* TypeLiteral */: + case 176 /* TypeLiteral */: return emitTypeLiteral(node); - case 178 /* ArrayType */: + case 177 /* ArrayType */: return emitArrayType(node); - case 179 /* TupleType */: + case 178 /* TupleType */: return emitTupleType(node); - case 180 /* OptionalType */: + case 179 /* OptionalType */: return emitOptionalType(node); - case 182 /* UnionType */: + case 181 /* UnionType */: return emitUnionType(node); - case 183 /* IntersectionType */: + case 182 /* IntersectionType */: return emitIntersectionType(node); - case 184 /* ConditionalType */: + case 183 /* ConditionalType */: return emitConditionalType(node); - case 185 /* InferType */: + case 184 /* InferType */: return emitInferType(node); - case 186 /* ParenthesizedType */: + case 185 /* ParenthesizedType */: return emitParenthesizedType(node); - case 223 /* ExpressionWithTypeArguments */: + case 220 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 187 /* ThisType */: + case 186 /* ThisType */: return emitThisType(); - case 188 /* TypeOperator */: + case 187 /* TypeOperator */: return emitTypeOperator(node); - case 189 /* IndexedAccessType */: + case 188 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 190 /* MappedType */: + case 189 /* MappedType */: return emitMappedType(node); - case 191 /* LiteralType */: + case 190 /* LiteralType */: return emitLiteralType(node); - case 193 /* TemplateLiteralType */: - return emitTemplateType(node); - case 195 /* ImportType */: + case 192 /* ImportType */: return emitImportTypeNode(node); - case 303 /* JSDocAllType */: + case 299 /* JSDocAllType */: writePunctuation("*"); return; - case 304 /* JSDocUnknownType */: + case 300 /* JSDocUnknownType */: writePunctuation("?"); return; - case 305 /* JSDocNullableType */: + case 301 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 306 /* JSDocNonNullableType */: + case 302 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 307 /* JSDocOptionalType */: + case 303 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 181 /* RestType */: - case 309 /* JSDocVariadicType */: + case 180 /* RestType */: + case 305 /* JSDocVariadicType */: return emitRestOrJSDocVariadicType(node); - case 192 /* NamedTupleMember */: + case 191 /* NamedTupleMember */: return emitNamedTupleMember(node); // Binding patterns - case 196 /* ObjectBindingPattern */: + case 193 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 197 /* ArrayBindingPattern */: + case 194 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 198 /* BindingElement */: + case 195 /* BindingElement */: return emitBindingElement(node); // Misc - case 228 /* TemplateSpan */: + case 225 /* TemplateSpan */: return emitTemplateSpan(node); - case 229 /* SemicolonClassElement */: + case 226 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 230 /* Block */: + case 227 /* Block */: return emitBlock(node); - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: return emitVariableStatement(node); - case 231 /* EmptyStatement */: + case 228 /* EmptyStatement */: return emitEmptyStatement(/*isEmbeddedStatement*/ false); - case 233 /* ExpressionStatement */: + case 230 /* ExpressionStatement */: return emitExpressionStatement(node); - case 234 /* IfStatement */: + case 231 /* IfStatement */: return emitIfStatement(node); - case 235 /* DoStatement */: + case 232 /* DoStatement */: return emitDoStatement(node); - case 236 /* WhileStatement */: + case 233 /* WhileStatement */: return emitWhileStatement(node); - case 237 /* ForStatement */: + case 234 /* ForStatement */: return emitForStatement(node); - case 238 /* ForInStatement */: + case 235 /* ForInStatement */: return emitForInStatement(node); - case 239 /* ForOfStatement */: + case 236 /* ForOfStatement */: return emitForOfStatement(node); - case 240 /* ContinueStatement */: + case 237 /* ContinueStatement */: return emitContinueStatement(node); - case 241 /* BreakStatement */: + case 238 /* BreakStatement */: return emitBreakStatement(node); - case 242 /* ReturnStatement */: + case 239 /* ReturnStatement */: return emitReturnStatement(node); - case 243 /* WithStatement */: + case 240 /* WithStatement */: return emitWithStatement(node); - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: return emitSwitchStatement(node); - case 245 /* LabeledStatement */: + case 242 /* LabeledStatement */: return emitLabeledStatement(node); - case 246 /* ThrowStatement */: + case 243 /* ThrowStatement */: return emitThrowStatement(node); - case 247 /* TryStatement */: + case 244 /* TryStatement */: return emitTryStatement(node); - case 248 /* DebuggerStatement */: + case 245 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 249 /* VariableDeclaration */: + case 246 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 252 /* ClassDeclaration */: + case 249 /* ClassDeclaration */: return emitClassDeclaration(node); - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 256 /* ModuleDeclaration */: + case 253 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 257 /* ModuleBlock */: + case 254 /* ModuleBlock */: return emitModuleBlock(node); - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: return emitCaseBlock(node); - case 259 /* NamespaceExportDeclaration */: + case 256 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: return emitImportDeclaration(node); - case 262 /* ImportClause */: + case 259 /* ImportClause */: return emitImportClause(node); - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: return emitNamespaceImport(node); - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: return emitNamespaceExport(node); - case 264 /* NamedImports */: + case 261 /* NamedImports */: return emitNamedImports(node); - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: return emitImportSpecifier(node); - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: return emitExportAssignment(node); - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: return emitExportDeclaration(node); - case 268 /* NamedExports */: + case 265 /* NamedExports */: return emitNamedExports(node); - case 270 /* ExportSpecifier */: + case 267 /* ExportSpecifier */: return emitExportSpecifier(node); - case 271 /* MissingDeclaration */: + case 268 /* MissingDeclaration */: return; // Module references - case 272 /* ExternalModuleReference */: + case 269 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 11 /* JsxText */: return emitJsxText(node); - case 275 /* JsxOpeningElement */: - case 278 /* JsxOpeningFragment */: + case 272 /* JsxOpeningElement */: + case 275 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 276 /* JsxClosingElement */: - case 279 /* JsxClosingFragment */: + case 273 /* JsxClosingElement */: + case 276 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 280 /* JsxAttribute */: + case 277 /* JsxAttribute */: return emitJsxAttribute(node); - case 281 /* JsxAttributes */: + case 278 /* JsxAttributes */: return emitJsxAttributes(node); - case 282 /* JsxSpreadAttribute */: + case 279 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 283 /* JsxExpression */: + case 280 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 284 /* CaseClause */: + case 281 /* CaseClause */: return emitCaseClause(node); - case 285 /* DefaultClause */: + case 282 /* DefaultClause */: return emitDefaultClause(node); - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: return emitHeritageClause(node); - case 287 /* CatchClause */: + case 284 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 288 /* PropertyAssignment */: + case 285 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 289 /* ShorthandPropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 290 /* SpreadAssignment */: + case 287 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 291 /* EnumMember */: + case 288 /* EnumMember */: return emitEnumMember(node); // JSDoc nodes (only used in codefixes currently) - case 326 /* JSDocParameterTag */: - case 333 /* JSDocPropertyTag */: + case 322 /* JSDocParameterTag */: + case 328 /* JSDocPropertyTag */: return emitJSDocPropertyLikeTag(node); - case 327 /* JSDocReturnTag */: - case 329 /* JSDocTypeTag */: - case 328 /* JSDocThisTag */: - case 325 /* JSDocEnumTag */: + case 323 /* JSDocReturnTag */: + case 325 /* JSDocTypeTag */: + case 324 /* JSDocThisTag */: + case 321 /* JSDocEnumTag */: return emitJSDocSimpleTypedTag(node); - case 316 /* JSDocImplementsTag */: - case 315 /* JSDocAugmentsTag */: + case 312 /* JSDocImplementsTag */: + case 311 /* JSDocAugmentsTag */: return emitJSDocHeritageTag(node); - case 330 /* JSDocTemplateTag */: + case 326 /* JSDocTemplateTag */: return emitJSDocTemplateTag(node); - case 331 /* JSDocTypedefTag */: + case 327 /* JSDocTypedefTag */: return emitJSDocTypedefTag(node); - case 324 /* JSDocCallbackTag */: + case 320 /* JSDocCallbackTag */: return emitJSDocCallbackTag(node); - case 313 /* JSDocSignature */: + case 309 /* JSDocSignature */: return emitJSDocSignature(node); - case 312 /* JSDocTypeLiteral */: + case 308 /* JSDocTypeLiteral */: return emitJSDocTypeLiteral(node); - case 319 /* JSDocClassTag */: - case 314 /* JSDocTag */: + case 315 /* JSDocClassTag */: + case 310 /* JSDocTag */: return emitJSDocSimpleTag(node); - case 332 /* JSDocSeeTag */: - return emitJSDocSeeTag(node); - case 302 /* JSDocNameReference */: - return emitJSDocNameReference(node); - case 311 /* JSDocComment */: + case 307 /* JSDocComment */: return emitJSDoc(node); // Transformation nodes (ignored) } @@ -100601,71 +98261,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 199 /* ArrayLiteralExpression */: + case 196 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 200 /* ObjectLiteralExpression */: + case 197 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 201 /* PropertyAccessExpression */: + case 198 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 202 /* ElementAccessExpression */: + case 199 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 203 /* CallExpression */: + case 200 /* CallExpression */: return emitCallExpression(node); - case 204 /* NewExpression */: + case 201 /* NewExpression */: return emitNewExpression(node); - case 205 /* TaggedTemplateExpression */: + case 202 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 207 /* ParenthesizedExpression */: + case 204 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 208 /* FunctionExpression */: + case 205 /* FunctionExpression */: return emitFunctionExpression(node); - case 209 /* ArrowFunction */: + case 206 /* ArrowFunction */: return emitArrowFunction(node); - case 210 /* DeleteExpression */: + case 207 /* DeleteExpression */: return emitDeleteExpression(node); - case 211 /* TypeOfExpression */: + case 208 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 212 /* VoidExpression */: + case 209 /* VoidExpression */: return emitVoidExpression(node); - case 213 /* AwaitExpression */: + case 210 /* AwaitExpression */: return emitAwaitExpression(node); - case 214 /* PrefixUnaryExpression */: + case 211 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 215 /* PostfixUnaryExpression */: + case 212 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 216 /* BinaryExpression */: + case 213 /* BinaryExpression */: return emitBinaryExpression(node); - case 217 /* ConditionalExpression */: + case 214 /* ConditionalExpression */: return emitConditionalExpression(node); - case 218 /* TemplateExpression */: + case 215 /* TemplateExpression */: return emitTemplateExpression(node); - case 219 /* YieldExpression */: + case 216 /* YieldExpression */: return emitYieldExpression(node); - case 220 /* SpreadElement */: + case 217 /* SpreadElement */: return emitSpreadExpression(node); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return emitClassExpression(node); - case 222 /* OmittedExpression */: + case 219 /* OmittedExpression */: return; - case 224 /* AsExpression */: + case 221 /* AsExpression */: return emitAsExpression(node); - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: return emitNonNullExpression(node); - case 226 /* MetaProperty */: + case 223 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 273 /* JsxElement */: + case 270 /* JsxElement */: return emitJsxElement(node); - case 274 /* JsxSelfClosingElement */: + case 271 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 277 /* JsxFragment */: + case 274 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 336 /* PartiallyEmittedExpression */: + case 331 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 337 /* CommaListExpression */: + case 332 /* CommaListExpression */: return emitCommaList(node); } } @@ -100707,7 +98367,7 @@ var ts; } function emitHelpers(node) { var helpersEmitted = false; - var bundle = node.kind === 298 /* Bundle */ ? node : undefined; + var bundle = node.kind === 295 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -100807,7 +98467,7 @@ var ts; var pos = getTextPosWithWriteLine(); writeUnparsedNode(unparsed); if (bundleFileInfo) { - updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 294 /* UnparsedText */ ? + updateOrPushBundleFileTextLike(pos, writer.getTextPos(), unparsed.kind === 291 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */); } @@ -100880,7 +98540,7 @@ var ts; emit(node.dotDotDotToken); emitNodeWithWriter(node.name, writeParameter); emit(node.questionToken); - if (node.parent && node.parent.kind === 308 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 304 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { @@ -100942,7 +98602,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 167 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 166 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -100976,10 +98636,6 @@ var ts; emitTypeAnnotation(node.type); writeTrailingSemicolon(); } - function emitTemplateTypeSpan(node) { - emit(node.type); - emit(node.literal); - } function emitSemicolonClassElement() { writeTrailingSemicolon(); } @@ -101138,19 +98794,13 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - if (node.readonlyToken.kind !== 142 /* ReadonlyKeyword */) { + if (node.readonlyToken.kind !== 141 /* ReadonlyKeyword */) { writeKeyword("readonly"); } writeSpace(); } writePunctuation("["); pipelineEmit(3 /* MappedTypeParameter */, node.typeParameter); - if (node.nameType) { - writeSpace(); - writeKeyword("as"); - writeSpace(); - emit(node.nameType); - } writePunctuation("]"); if (node.questionToken) { emit(node.questionToken); @@ -101174,10 +98824,6 @@ var ts; function emitLiteralType(node) { emitExpression(node.literal); } - function emitTemplateType(node) { - emit(node.head); - emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); - } function emitImportTypeNode(node) { if (node.isTypeOf) { writeKeyword("typeof"); @@ -101376,7 +99022,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 214 /* PrefixUnaryExpression */ + return operand.kind === 211 /* PrefixUnaryExpression */ && ((node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */)) || (node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */))); } @@ -101564,7 +99210,7 @@ var ts; if (node.elseStatement) { writeLineOrSpace(node, node.thenStatement, node.elseStatement); emitTokenWithComment(90 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 234 /* IfStatement */) { + if (node.elseStatement.kind === 231 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -101627,7 +99273,7 @@ var ts; emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - emitTokenWithComment(156 /* OfKeyword */, node.initializer.end, writeKeyword, node); + emitTokenWithComment(155 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); @@ -101635,7 +99281,7 @@ var ts; } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 250 /* VariableDeclarationList */) { + if (node.kind === 247 /* VariableDeclarationList */) { emit(node); } else { @@ -101931,7 +99577,7 @@ var ts; var body = node.body; if (!body) return writeTrailingSemicolon(); - while (body.kind === 256 /* ModuleDeclaration */) { + while (body.kind === 253 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -101976,7 +99622,7 @@ var ts; if (node.importClause) { emit(node.importClause); writeSpace(); - emitTokenWithComment(153 /* FromKeyword */, node.importClause.end, writeKeyword, node); + emitTokenWithComment(152 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -101984,7 +99630,7 @@ var ts; } function emitImportClause(node) { if (node.isTypeOnly) { - emitTokenWithComment(149 /* TypeKeyword */, node.pos, writeKeyword, node); + emitTokenWithComment(148 /* TypeKeyword */, node.pos, writeKeyword, node); writeSpace(); } emit(node.name); @@ -102024,7 +99670,7 @@ var ts; var nextPos = emitTokenWithComment(92 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isTypeOnly) { - nextPos = emitTokenWithComment(149 /* TypeKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(148 /* TypeKeyword */, nextPos, writeKeyword, node); writeSpace(); } if (node.exportClause) { @@ -102036,7 +99682,7 @@ var ts; if (node.moduleSpecifier) { writeSpace(); var fromPos = node.exportClause ? node.exportClause.end : nextPos; - emitTokenWithComment(153 /* FromKeyword */, fromPos, writeKeyword, node); + emitTokenWithComment(152 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -102047,7 +99693,7 @@ var ts; writeSpace(); nextPos = emitTokenWithComment(126 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - nextPos = emitTokenWithComment(140 /* NamespaceKeyword */, nextPos, writeKeyword, node); + nextPos = emitTokenWithComment(139 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeTrailingSemicolon(); @@ -102270,7 +99916,7 @@ var ts; } } if (node.tags) { - if (node.tags.length === 1 && node.tags[0].kind === 329 /* JSDocTypeTag */ && !node.comment) { + if (node.tags.length === 1 && node.tags[0].kind === 325 /* JSDocTypeTag */ && !node.comment) { writeSpace(); emit(node.tags[0]); } @@ -102286,17 +99932,6 @@ var ts; emitJSDocTypeExpression(tag.typeExpression); emitJSDocComment(tag.comment); } - function emitJSDocSeeTag(tag) { - emitJSDocTagName(tag.tagName); - emit(tag.name); - emitJSDocComment(tag.comment); - } - function emitJSDocNameReference(node) { - writeSpace(); - writePunctuation("{"); - emit(node.name); - writePunctuation("}"); - } function emitJSDocHeritageTag(tag) { emitJSDocTagName(tag.tagName); writeSpace(); @@ -102315,7 +99950,7 @@ var ts; function emitJSDocTypedefTag(tag) { emitJSDocTagName(tag.tagName); if (tag.typeExpression) { - if (tag.typeExpression.kind === 301 /* JSDocTypeExpression */) { + if (tag.typeExpression.kind === 298 /* JSDocTypeExpression */) { emitJSDocTypeExpression(tag.typeExpression); } else { @@ -102334,7 +99969,7 @@ var ts; emit(tag.fullName); } emitJSDocComment(tag.comment); - if (tag.typeExpression && tag.typeExpression.kind === 312 /* JSDocTypeLiteral */) { + if (tag.typeExpression && tag.typeExpression.kind === 308 /* JSDocTypeLiteral */) { emitJSDocTypeLiteral(tag.typeExpression); } } @@ -102468,8 +100103,8 @@ var ts; bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName }); writeLine(); } - for (var _d = 0, types_23 = types; _d < types_23.length; _d++) { - var directive = types_23[_d]; + for (var _d = 0, types_22 = types; _d < types_22.length; _d++) { + var directive = types_22[_d]; var pos = writer.getTextPos(); writeComment("/// "); if (bundleFileInfo) @@ -103198,7 +100833,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 207 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 204 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -103231,10 +100866,7 @@ var ts; return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape); } } - var flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) - | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) - | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0); - return ts.getLiteralText(node, currentSourceFile, flags); + return ts.getLiteralText(node, currentSourceFile, neverAsciiEscape, jsxAttributeEscape); } /** * Push a new name generation scope. @@ -103267,84 +100899,84 @@ var ts; if (!node) return; switch (node.kind) { - case 230 /* Block */: + case 227 /* Block */: ts.forEach(node.statements, generateNames); break; - case 245 /* LabeledStatement */: - case 243 /* WithStatement */: - case 235 /* DoStatement */: - case 236 /* WhileStatement */: + case 242 /* LabeledStatement */: + case 240 /* WithStatement */: + case 232 /* DoStatement */: + case 233 /* WhileStatement */: generateNames(node.statement); break; - case 234 /* IfStatement */: + case 231 /* IfStatement */: generateNames(node.thenStatement); generateNames(node.elseStatement); break; - case 237 /* ForStatement */: - case 239 /* ForOfStatement */: - case 238 /* ForInStatement */: + case 234 /* ForStatement */: + case 236 /* ForOfStatement */: + case 235 /* ForInStatement */: generateNames(node.initializer); generateNames(node.statement); break; - case 244 /* SwitchStatement */: + case 241 /* SwitchStatement */: generateNames(node.caseBlock); break; - case 258 /* CaseBlock */: + case 255 /* CaseBlock */: ts.forEach(node.clauses, generateNames); break; - case 284 /* CaseClause */: - case 285 /* DefaultClause */: + case 281 /* CaseClause */: + case 282 /* DefaultClause */: ts.forEach(node.statements, generateNames); break; - case 247 /* TryStatement */: + case 244 /* TryStatement */: generateNames(node.tryBlock); generateNames(node.catchClause); generateNames(node.finallyBlock); break; - case 287 /* CatchClause */: + case 284 /* CatchClause */: generateNames(node.variableDeclaration); generateNames(node.block); break; - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: generateNames(node.declarationList); break; - case 250 /* VariableDeclarationList */: + case 247 /* VariableDeclarationList */: ts.forEach(node.declarations, generateNames); break; - case 249 /* VariableDeclaration */: - case 160 /* Parameter */: - case 198 /* BindingElement */: - case 252 /* ClassDeclaration */: + case 246 /* VariableDeclaration */: + case 159 /* Parameter */: + case 195 /* BindingElement */: + case 249 /* ClassDeclaration */: generateNameIfNeeded(node.name); break; - case 251 /* FunctionDeclaration */: + case 248 /* FunctionDeclaration */: generateNameIfNeeded(node.name); if (ts.getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { ts.forEach(node.parameters, generateNames); generateNames(node.body); } break; - case 196 /* ObjectBindingPattern */: - case 197 /* ArrayBindingPattern */: + case 193 /* ObjectBindingPattern */: + case 194 /* ArrayBindingPattern */: ts.forEach(node.elements, generateNames); break; - case 261 /* ImportDeclaration */: + case 258 /* ImportDeclaration */: generateNames(node.importClause); break; - case 262 /* ImportClause */: + case 259 /* ImportClause */: generateNameIfNeeded(node.name); generateNames(node.namedBindings); break; - case 263 /* NamespaceImport */: + case 260 /* NamespaceImport */: generateNameIfNeeded(node.name); break; - case 269 /* NamespaceExport */: + case 266 /* NamespaceExport */: generateNameIfNeeded(node.name); break; - case 264 /* NamedImports */: + case 261 /* NamedImports */: ts.forEach(node.elements, generateNames); break; - case 265 /* ImportSpecifier */: + case 262 /* ImportSpecifier */: generateNameIfNeeded(node.propertyName || node.name); break; } @@ -103353,12 +100985,12 @@ var ts; if (!node) return; switch (node.kind) { - case 288 /* PropertyAssignment */: - case 289 /* ShorthandPropertyAssignment */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 285 /* PropertyAssignment */: + case 286 /* ShorthandPropertyAssignment */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: generateNameIfNeeded(node.name); break; } @@ -103540,23 +101172,23 @@ var ts; switch (node.kind) { case 78 /* Identifier */: return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16 /* Optimistic */), !!(flags & 8 /* ReservedInNestedScopes */)); - case 256 /* ModuleDeclaration */: - case 255 /* EnumDeclaration */: + case 253 /* ModuleDeclaration */: + case 252 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 261 /* ImportDeclaration */: - case 267 /* ExportDeclaration */: + case 258 /* ImportDeclaration */: + case 264 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 251 /* FunctionDeclaration */: - case 252 /* ClassDeclaration */: - case 266 /* ExportAssignment */: + case 248 /* FunctionDeclaration */: + case 249 /* ClassDeclaration */: + case 263 /* ExportAssignment */: return generateNameForExportDefault(); - case 221 /* ClassExpression */: + case 218 /* ClassExpression */: return generateNameForClassExpression(); - case 165 /* MethodDeclaration */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: + case 164 /* MethodDeclaration */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: return generateNameForMethodOrAccessor(node); - case 158 /* ComputedPropertyName */: + case 157 /* ComputedPropertyName */: return makeTempVariableName(0 /* Auto */, /*reserveInNestedScopes*/ true); default: return makeTempVariableName(0 /* Auto */); @@ -103604,7 +101236,7 @@ var ts; hasWrittenComment = false; var emitFlags = ts.getEmitFlags(node); var _a = ts.getCommentRange(node), pos = _a.pos, end = _a.end; - var isEmittedNode = node.kind !== 335 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 330 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; @@ -103628,7 +101260,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 250 /* VariableDeclarationList */) { + if (node.kind === 247 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -103721,12 +101353,7 @@ var ts; function emitLeadingComments(pos, isEmittedNode) { hasWrittenComment = false; if (isEmittedNode) { - if (pos === 0 && (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.isDeclarationFile)) { - forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment); - } - else { - forEachLeadingCommentToEmit(pos, emitLeadingComment); - } + forEachLeadingCommentToEmit(pos, emitLeadingComment); } else if (pos === 0) { // If the node will not be emitted in JS, remove all the comments(normal, pinned and ///) associated with the node, @@ -103745,11 +101372,6 @@ var ts; emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); } } - function emitNonTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { - if (!isTripleSlashComment(commentPos, commentEnd)) { - emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); - } - } function shouldWriteComment(text, pos) { if (printerOptions.onlyPrintJsDocStyle) { return (ts.isJSDocLikeText(text, pos) || ts.isPinnedComment(text, pos)); @@ -103897,7 +101519,7 @@ var ts; else { var _a = ts.getSourceMapRange(node), pos = _a.pos, end = _a.end, _b = _a.source, source = _b === void 0 ? sourceMapSource : _b; var emitFlags = ts.getEmitFlags(node); - if (node.kind !== 335 /* NotEmittedStatement */ + if (node.kind !== 330 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitSourcePos(source, skipSourceTrivia(source, pos)); @@ -103910,7 +101532,7 @@ var ts; else { pipelinePhase(hint, node); } - if (node.kind !== 335 /* NotEmittedStatement */ + if (node.kind !== 330 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitSourcePos(source, end); @@ -103943,10 +101565,9 @@ var ts; function emitSourcePos(source, pos) { if (source !== sourceMapSource) { var savedSourceMapSource = sourceMapSource; - var savedSourceMapSourceIndex = sourceMapSourceIndex; setSourceMapSource(source); emitPos(pos); - resetSourceMapSource(savedSourceMapSource, savedSourceMapSourceIndex); + setSourceMapSource(savedSourceMapSource); } else { emitPos(pos); @@ -103985,12 +101606,6 @@ var ts; return; } sourceMapSource = source; - if (source === mostRecentlyAddedSourceMapSource) { - // Fast path for when the new source map is the most recently added, in which case - // we use its captured index without going through the source map generator. - sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex; - return; - } if (isJsonSourceMapSource(source)) { return; } @@ -103998,12 +101613,6 @@ var ts; if (printerOptions.inlineSources) { sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text); } - mostRecentlyAddedSourceMapSource = source; - mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex; - } - function resetSourceMapSource(source, sourceIndex) { - sourceMapSource = source; - sourceMapSourceIndex = sourceIndex; } function isJsonSourceMapSource(sourceFile) { return ts.fileExtensionIs(sourceFile.fileName, ".json" /* Json */); @@ -104502,7 +102111,6 @@ var ts; if (system === void 0) { system = ts.sys; } var existingDirectories = new ts.Map(); var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames); - var computeHash = ts.maybeBind(system, system.createHash) || ts.generateDjb2Hash; function getSourceFile(fileName, languageVersion, onError) { var text; try { @@ -104547,14 +102155,14 @@ var ts; } var outputFingerprints; function writeFileWorker(fileName, data, writeByteOrderMark) { - if (!ts.isWatchSet(options) || !system.getModifiedTime) { + if (!ts.isWatchSet(options) || !system.createHash || !system.getModifiedTime) { system.writeFile(fileName, data, writeByteOrderMark); return; } if (!outputFingerprints) { outputFingerprints = new ts.Map(); } - var hash = computeHash(data); + var hash = system.createHash(data); var mtimeBefore = system.getModifiedTime(fileName); if (mtimeBefore) { var fingerprint = outputFingerprints.get(fileName); @@ -104907,35 +102515,6 @@ var ts; } ts.loadWithLocalCache = loadWithLocalCache; /* @internal */ - function forEachResolvedProjectReference(resolvedProjectReferences, cb) { - return forEachProjectReference(/*projectReferences*/ undefined, resolvedProjectReferences, function (resolvedRef, parent) { return resolvedRef && cb(resolvedRef, parent); }); - } - ts.forEachResolvedProjectReference = forEachResolvedProjectReference; - function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { - var seenResolvedRefs; - return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined); - function worker(projectReferences, resolvedProjectReferences, parent) { - // Visit project references first - if (cbRef) { - var result = cbRef(projectReferences, parent); - if (result) { - return result; - } - } - return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) { - if (resolvedRef && (seenResolvedRefs === null || seenResolvedRefs === void 0 ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) { - // ignore recursives - return undefined; - } - var result = cbResolvedRef(resolvedRef, parent, index); - if (result || !resolvedRef) - return result; - (seenResolvedRefs || (seenResolvedRefs = new ts.Set())).add(resolvedRef.sourceFile.path); - return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef); - }); - } - } - /* @internal */ ts.inferredTypesContainingFile = "__inferred type names__.ts"; /** * Determines if program structure is upto date or needs to be recreated @@ -105071,8 +102650,6 @@ var ts; var modulesWithElidedImports = new ts.Map(); // Track source files that are source files found by searching under node_modules, as these shouldn't be compiled. var sourceFilesFoundSearchingNodeModules = new ts.Map(); - var tracingData = ["program" /* Program */, "createProgram"]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeProgram"); var host = createProgramOptions.host || createCompilerHost(options); var configParsingHost = parseConfigHostFromCompilerHostLike(host); @@ -105148,16 +102725,12 @@ var ts; getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect, forEachResolvedProjectReference: forEachResolvedProjectReference }), onProgramCreateComplete = _c.onProgramCreateComplete, fileExists = _c.fileExists, directoryExists = _c.directoryExists; - ts.tracing.push("program" /* Program */, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram }); var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); - ts.tracing.pop(); // We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks // `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`. - var structureIsReused; - ts.tracing.push("program" /* Program */, "tryReuseStructureFromOldProgram", {}); - structureIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const - ts.tracing.pop(); - if (structureIsReused !== 2 /* Completely */) { + var structuralIsReused; + structuralIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const + if (structuralIsReused !== 2 /* Completely */) { processingDefaultLibFiles = []; processingOtherFiles = []; if (projectReferences) { @@ -105194,13 +102767,10 @@ var ts; } } } - ts.tracing.push("program" /* Program */, "processRootFiles", { count: rootNames.length }); ts.forEach(rootNames, function (name) { return processRootFile(name, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false); }); - ts.tracing.pop(); // load type declarations specified via 'types' argument or implicitly from types/ and node_modules/@types folders var typeReferences = rootNames.length ? ts.getAutomaticTypeDirectiveNames(options, host) : ts.emptyArray; if (typeReferences.length) { - ts.tracing.push("program" /* Program */, "processTypeReferences", { count: typeReferences.length }); // This containingFilename needs to match with the one used in managed-side var containingDirectory = options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : host.getCurrentDirectory(); var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile); @@ -105208,7 +102778,6 @@ var ts; for (var i = 0; i < typeReferences.length; i++) { processTypeReferenceDirective(typeReferences[i], resolutions[i]); } - ts.tracing.pop(); } // Do not process the default library if: // - The '--noLib' flag is used. @@ -105249,8 +102818,8 @@ var ts; host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path)); } } - oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference) { - if (!getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) { + oldProgram.forEachResolvedProjectReference(function (resolvedProjectReference, resolvedProjectReferencePath) { + if (resolvedProjectReference && !getResolvedProjectReferenceByPath(resolvedProjectReferencePath)) { host.onReleaseOldSourceFile(resolvedProjectReference.sourceFile, oldProgram.getCompilerOptions(), /*hasSourceFileByPath*/ false); } }); @@ -105270,7 +102839,6 @@ var ts; getOptionsDiagnostics: getOptionsDiagnostics, getGlobalDiagnostics: getGlobalDiagnostics, getSemanticDiagnostics: getSemanticDiagnostics, - getCachedSemanticDiagnostics: getCachedSemanticDiagnostics, getSuggestionDiagnostics: getSuggestionDiagnostics, getDeclarationDiagnostics: getDeclarationDiagnostics, getBindAndCheckDiagnostics: getBindAndCheckDiagnostics, @@ -105284,7 +102852,6 @@ var ts; getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, - getTypeCatalog: function () { return getDiagnosticsProducingTypeChecker().getTypeCatalog(); }, getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); }, getInstantiationCount: function () { return getDiagnosticsProducingTypeChecker().getInstantiationCount(); }, getRelationCacheSizes: function () { return getDiagnosticsProducingTypeChecker().getRelationCacheSizes(); }, @@ -105313,73 +102880,26 @@ var ts; getSymlinkCache: getSymlinkCache, realpath: (_b = host.realpath) === null || _b === void 0 ? void 0 : _b.bind(host), useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); }, - structureIsReused: structureIsReused, }; onProgramCreateComplete(); verifyCompilerOptions(); ts.performance.mark("afterProgram"); ts.performance.measure("Program", "beforeProgram", "afterProgram"); - ts.tracing.end.apply(ts.tracing, tracingData); return program; - function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames) { - if (!moduleNames.length) - return ts.emptyArray; - var containingFileName = ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); - var redirectedReference = getRedirectReferenceForResolution(containingFile); - ts.tracing.push("program" /* Program */, "resolveModuleNamesWorker", { containingFileName: containingFileName }); + function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames, redirectedReference) { ts.performance.mark("beforeResolveModule"); - var result = actualResolveModuleNamesWorker(moduleNames, containingFileName, reusedNames, redirectedReference); + var result = actualResolveModuleNamesWorker(moduleNames, containingFile, reusedNames, redirectedReference); ts.performance.mark("afterResolveModule"); ts.performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule"); - ts.tracing.pop(); return result; } - function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile) { - if (!typeDirectiveNames.length) - return []; - var containingFileName = !ts.isString(containingFile) ? ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile; - var redirectedReference = !ts.isString(containingFile) ? getRedirectReferenceForResolution(containingFile) : undefined; - ts.tracing.push("program" /* Program */, "resolveTypeReferenceDirectiveNamesWorker", { containingFileName: containingFileName }); + function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, redirectedReference) { ts.performance.mark("beforeResolveTypeReference"); - var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference); + var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, redirectedReference); ts.performance.mark("afterResolveTypeReference"); ts.performance.measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference"); - ts.tracing.pop(); return result; } - function getRedirectReferenceForResolution(file) { - var redirect = getResolvedProjectReferenceToRedirect(file.originalFileName); - if (redirect || !ts.fileExtensionIs(file.originalFileName, ".d.ts" /* Dts */)) - return redirect; - // The originalFileName could not be actual source file name if file found was d.ts from referecned project - // So in this case try to look up if this is output from referenced project, if it is use the redirected project in that case - var resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.originalFileName, file.path); - if (resultFromDts) - return resultFromDts; - // If preserveSymlinks is true, module resolution wont jump the symlink - // but the resolved real path may be the .d.ts from project reference - // Note:: Currently we try the real path only if the - // file is from node_modules to avoid having to run real path on all file paths - if (!host.realpath || !options.preserveSymlinks || !ts.stringContains(file.originalFileName, ts.nodeModulesPathPart)) - return undefined; - var realDeclarationFileName = host.realpath(file.originalFileName); - var realDeclarationPath = toPath(realDeclarationFileName); - return realDeclarationPath === file.path ? undefined : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationFileName, realDeclarationPath); - } - function getRedirectReferenceForResolutionFromSourceOfProject(fileName, filePath) { - var source = getSourceOfProjectReferenceRedirect(fileName); - if (ts.isString(source)) - return getResolvedProjectReferenceToRedirect(source); - if (!source) - return undefined; - // Output of .d.ts file so return resolved ref that matches the out file name - return forEachResolvedProjectReference(function (resolvedRef) { - var out = ts.outFile(resolvedRef.commandLine.options); - if (!out) - return undefined; - return toPath(out) === filePath ? resolvedRef : undefined; - }); - } function compareDefaultLibFiles(a, b) { return ts.compareValues(getDefaultLibFilePriority(a), getDefaultLibFilePriority(b)); } @@ -105438,13 +102958,13 @@ var ts; } return classifiableNames; } - function resolveModuleNamesReusingOldState(moduleNames, file) { - if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) { + function resolveModuleNamesReusingOldState(moduleNames, containingFile, file) { + if (structuralIsReused === 0 /* Not */ && !file.ambientModuleNames.length) { // If the old program state does not permit reusing resolutions and `file` does not contain locally defined ambient modules, // the best we can do is fallback to the default logic. - return resolveModuleNamesWorker(moduleNames, file, /*reusedNames*/ undefined); + return resolveModuleNamesWorker(moduleNames, containingFile, /*reusedNames*/ undefined, getResolvedProjectReferenceToRedirect(file.originalFileName)); } - var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName); + var oldSourceFile = oldProgram && oldProgram.getSourceFile(containingFile); if (oldSourceFile !== file && file.resolvedModules) { // `file` was created for the new program. // @@ -105454,13 +102974,13 @@ var ts; // which per above occurred during the current program creation. // Since we assume the filesystem does not change during program creation, // it is safe to reuse resolutions from the earlier call. - var result_14 = []; + var result_12 = []; for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) { var moduleName = moduleNames_1[_i]; var resolvedModule = file.resolvedModules.get(moduleName); - result_14.push(resolvedModule); + result_12.push(resolvedModule); } - return result_14; + return result_12; } // At this point, we know at least one of the following hold: // - file has local declarations for ambient modules @@ -105488,7 +103008,7 @@ var ts; var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName); if (oldResolvedModule) { if (ts.isTraceEnabled(options, host)) { - ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + ts.trace(host, ts.Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, containingFile); } (result || (result = new Array(moduleNames.length)))[i] = oldResolvedModule; (reusedNames || (reusedNames = [])).push(moduleName); @@ -105503,7 +103023,7 @@ var ts; if (ts.contains(file.ambientModuleNames, moduleName)) { resolvesToAmbientModuleInNonModifiedFile = true; if (ts.isTraceEnabled(options, host)) { - ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + ts.trace(host, ts.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, containingFile); } } else { @@ -105518,7 +103038,7 @@ var ts; } } var resolutions = unknownModuleNames && unknownModuleNames.length - ? resolveModuleNamesWorker(unknownModuleNames, file, reusedNames) + ? resolveModuleNamesWorker(unknownModuleNames, containingFile, reusedNames, getResolvedProjectReferenceToRedirect(file.originalFileName)) : ts.emptyArray; // Combine results of resolutions and predicted results if (!result) { @@ -105566,7 +103086,7 @@ var ts; } } function canReuseProjectReferences() { - return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, parent, index) { + return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function (oldResolvedRef, index, parent) { var newRef = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; var newResolvedRef = parseProjectReferenceConfigFile(newRef); if (oldResolvedRef) { @@ -105592,19 +103112,19 @@ var ts; // if any of these properties has changed - structure cannot be reused var oldOptions = oldProgram.getCompilerOptions(); if (ts.changesAffectModuleResolution(oldOptions, options)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } // there is an old program, check if we can reuse its structure var oldRootNames = oldProgram.getRootFileNames(); if (!ts.arrayIsEqualTo(oldRootNames, rootNames)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (!ts.arrayIsEqualTo(options.types, oldOptions.types)) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } // Check if any referenced project tsconfig files are different if (!canReuseProjectReferences()) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (projectReferences) { resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); @@ -105612,12 +103132,12 @@ var ts; // check if program source files has changed in the way that can affect structure of the program var newSourceFiles = []; var modifiedSourceFiles = []; - structureIsReused = 2 /* Completely */; + oldProgram.structureIsReused = 2 /* Completely */; // If the missing file paths are now present, it can change the progam structure, // and hence cant reuse the structure. // This is same as how we dont reuse the structure if one of the file from old program is now missing if (oldProgram.getMissingFilePaths().some(function (missingFilePath) { return host.fileExists(missingFilePath); })) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } var oldSourceFiles = oldProgram.getSourceFiles(); var SeenPackageName; @@ -105632,7 +103152,7 @@ var ts; ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, options.target, /*onError*/ undefined, shouldCreateNewSourceFile) : host.getSourceFile(oldSourceFile.fileName, options.target, /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217 if (!newSourceFile) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } ts.Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); var fileChanged = void 0; @@ -105641,7 +103161,7 @@ var ts; // This lets us know if the unredirected file has changed. If it has we should break the redirect. if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { // Underlying file has changed. Might not redirect anymore. Must rebuild program. - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } fileChanged = false; newSourceFile = oldSourceFile; // Use the redirect. @@ -105649,7 +103169,7 @@ var ts; else if (oldProgram.redirectTargetsMap.has(oldSourceFile.path)) { // If a redirected-to source file changes, the redirect may be broken. if (newSourceFile !== oldSourceFile) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } fileChanged = false; } @@ -105668,7 +103188,7 @@ var ts; var prevKind = seenPackageNames.get(packageName); var newKind = fileChanged ? 1 /* Modified */ : 0 /* Exists */; if ((prevKind !== undefined && newKind === 1 /* Modified */) || prevKind === 1 /* Modified */) { - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } seenPackageNames.set(packageName, newKind); } @@ -105676,50 +103196,50 @@ var ts; // The `newSourceFile` object was created for the new program. if (!ts.arrayIsEqualTo(oldSourceFile.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) { // 'lib' references has changed. Matches behavior in changesAffectModuleResolution - return 0 /* Not */; + return oldProgram.structureIsReused = 0 /* Not */; } if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { // value of no-default-lib has changed // this will affect if default library is injected into the list of files - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // check tripleslash references if (!ts.arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) { // tripleslash references has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // check imports and module augmentations collectExternalModuleReferences(newSourceFile); if (!ts.arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) { // imports has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if (!ts.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { // moduleAugmentations has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if ((oldSourceFile.flags & 3145728 /* PermanentlySetIncrementalFlags */) !== (newSourceFile.flags & 3145728 /* PermanentlySetIncrementalFlags */)) { // dynamicImport has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } if (!ts.arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { // 'types' references has changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; } // tentatively approve the file modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); } else if (hasInvalidatedResolution(oldSourceFile.path)) { // 'module/types' references could have changed - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; // add file to the modified list so that we will resolve it later modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile }); } // if file has passed all checks it should be safe to reuse it newSourceFiles.push(newSourceFile); } - if (structureIsReused !== 2 /* Completely */) { - return structureIsReused; + if (oldProgram.structureIsReused !== 2 /* Completely */) { + return oldProgram.structureIsReused; } var modifiedFiles = modifiedSourceFiles.map(function (f) { return f.oldFile; }); for (var _b = 0, oldSourceFiles_3 = oldSourceFiles; _b < oldSourceFiles_3.length; _b++) { @@ -105734,35 +103254,38 @@ var ts; // try to verify results of module resolution for (var _e = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _e < modifiedSourceFiles_1.length; _e++) { var _f = modifiedSourceFiles_1[_e], oldSourceFile = _f.oldFile, newSourceFile = _f.newFile; + var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.originalFileName, currentDirectory); var moduleNames = getModuleNames(newSourceFile); - var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile); + var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile); // ensure that module resolution results are still correct var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo); if (resolutionsChanged) { - structureIsReused = 1 /* SafeModules */; + oldProgram.structureIsReused = 1 /* SafeModules */; newSourceFile.resolvedModules = ts.zipToMap(moduleNames, resolutions); } else { newSourceFile.resolvedModules = oldSourceFile.resolvedModules; } - // We lower-case all type references because npm automatically lowercases all packages. See GH#9824. - var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); }); - var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile); - // ensure that types resolutions are still correct - var typeReferenceEesolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo); - if (typeReferenceEesolutionsChanged) { - structureIsReused = 1 /* SafeModules */; - newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, typeReferenceResolutions); - } - else { - newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; + if (resolveTypeReferenceDirectiveNamesWorker) { + // We lower-case all type references because npm automatically lowercases all packages. See GH#9824. + var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); }); + var resolutions_1 = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFilePath, getResolvedProjectReferenceToRedirect(newSourceFile.originalFileName)); + // ensure that types resolutions are still correct + var resolutionsChanged_1 = ts.hasChangesInResolutions(typesReferenceDirectives, resolutions_1, oldSourceFile.resolvedTypeReferenceDirectiveNames, ts.typeDirectiveIsEqualTo); + if (resolutionsChanged_1) { + oldProgram.structureIsReused = 1 /* SafeModules */; + newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToMap(typesReferenceDirectives, resolutions_1); + } + else { + newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames; + } } } - if (structureIsReused !== 2 /* Completely */) { - return structureIsReused; + if (oldProgram.structureIsReused !== 2 /* Completely */) { + return oldProgram.structureIsReused; } if ((_a = host.hasChangedAutomaticTypeDirectiveNames) === null || _a === void 0 ? void 0 : _a.call(host)) { - return 1 /* SafeModules */; + return oldProgram.structureIsReused = 1 /* SafeModules */; } missingFilePaths = oldProgram.getMissingFilePaths(); refFileMap = oldProgram.getRefFileMap(); @@ -105796,7 +103319,7 @@ var ts; resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); sourceFileToPackageName = oldProgram.sourceFileToPackageName; redirectTargetsMap = oldProgram.redirectTargetsMap; - return 2 /* Completely */; + return oldProgram.structureIsReused = 2 /* Completely */; } function getEmitHost(writeFileCallback) { return { @@ -105836,8 +103359,6 @@ var ts; } function emitBuildInfo(writeFileCallback) { ts.Debug.assert(!ts.outFile(options)); - var tracingData = ["emit" /* Emit */, "emitBuildInfo"]; - ts.tracing.begin.apply(ts.tracing, tracingData); ts.performance.mark("beforeEmit"); var emitResult = ts.emitFiles(ts.notImplementedResolver, getEmitHost(writeFileCallback), /*targetSourceFile*/ undefined, @@ -105846,7 +103367,6 @@ var ts; /*onlyBuildInfo*/ true); ts.performance.mark("afterEmit"); ts.performance.measure("Emit", "beforeEmit", "afterEmit"); - ts.tracing.end.apply(ts.tracing, tracingData); return emitResult; } function getResolvedProjectReferences() { @@ -105892,11 +103412,7 @@ var ts; return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, /*produceDiagnostics:*/ false)); } function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit) { - var tracingData = ["emit" /* Emit */, "emit", { path: sourceFile === null || sourceFile === void 0 ? void 0 : sourceFile.path }]; - ts.tracing.begin.apply(ts.tracing, tracingData); - var result = runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); }); - ts.tracing.end.apply(ts.tracing, tracingData); - return result; + return runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); }); } function isEmitBlocked(emitFileName) { return hasEmitBlockingDiagnostics.has(toPath(emitFileName)); @@ -105946,11 +103462,6 @@ var ts; function getSemanticDiagnostics(sourceFile, cancellationToken) { return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken); } - function getCachedSemanticDiagnostics(sourceFile) { - var _a; - return sourceFile - ? (_a = cachedBindAndCheckDiagnosticsForFile.perFile) === null || _a === void 0 ? void 0 : _a.get(sourceFile.path) : cachedBindAndCheckDiagnosticsForFile.allDiagnostics; - } function getBindAndCheckDiagnostics(sourceFile, cancellationToken) { return getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken); } @@ -106036,17 +103547,17 @@ var ts; sourceFile.scriptKind === 5 /* External */ || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */); var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray; var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray; - return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); + return getMergedBindAndCheckDiagnostics(sourceFile, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined); }); } - function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics) { + function getMergedBindAndCheckDiagnostics(sourceFile) { var _a; var allDiagnostics = []; - for (var _i = 2; _i < arguments.length; _i++) { - allDiagnostics[_i - 2] = arguments[_i]; + for (var _i = 1; _i < arguments.length; _i++) { + allDiagnostics[_i - 1] = arguments[_i]; } var flatDiagnostics = ts.flatten(allDiagnostics); - if (!includeBindAndCheckDiagnostics || !((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { + if (!((_a = sourceFile.commentDirectives) === null || _a === void 0 ? void 0 : _a.length)) { return flatDiagnostics; } var _b = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b.diagnostics, directives = _b.directives; @@ -106107,22 +103618,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 160 /* Parameter */: - case 163 /* PropertyDeclaration */: - case 165 /* MethodDeclaration */: + case 159 /* Parameter */: + case 162 /* PropertyDeclaration */: + case 164 /* MethodDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); return "skip"; } // falls through - case 164 /* MethodSignature */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: - case 249 /* VariableDeclaration */: + case 163 /* MethodSignature */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: + case 246 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); @@ -106130,58 +103641,58 @@ var ts; } } switch (node.kind) { - case 262 /* ImportClause */: + case 259 /* ImportClause */: if (node.isTypeOnly) { - diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); + diagnostics.push(createDiagnosticForNode(node.parent, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); return "skip"; } break; - case 267 /* ExportDeclaration */: + case 264 /* ExportDeclaration */: if (node.isTypeOnly) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); return "skip"; } break; - case 260 /* ImportEqualsDeclaration */: + case 257 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files)); return "skip"; - case 266 /* ExportAssignment */: + case 263 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 286 /* HeritageClause */: + case 283 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 116 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 253 /* InterfaceDeclaration */: + case 250 /* InterfaceDeclaration */: var interfaceKeyword = ts.tokenToString(117 /* InterfaceKeyword */); ts.Debug.assertIsDefined(interfaceKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); return "skip"; - case 256 /* ModuleDeclaration */: - var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(140 /* NamespaceKeyword */) : ts.tokenToString(139 /* ModuleKeyword */); + case 253 /* ModuleDeclaration */: + var moduleKeyword = node.flags & 16 /* Namespace */ ? ts.tokenToString(139 /* NamespaceKeyword */) : ts.tokenToString(138 /* ModuleKeyword */); ts.Debug.assertIsDefined(moduleKeyword); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); return "skip"; - case 254 /* TypeAliasDeclaration */: + case 251 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); return "skip"; - case 255 /* EnumDeclaration */: + case 252 /* EnumDeclaration */: var enumKeyword = ts.Debug.checkDefined(ts.tokenToString(91 /* EnumKeyword */)); diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); return "skip"; - case 225 /* NonNullExpression */: + case 222 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 224 /* AsExpression */: + case 221 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); return "skip"; - case 206 /* TypeAssertionExpression */: + case 203 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } } @@ -106190,29 +103701,29 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); } switch (parent.kind) { - case 252 /* ClassDeclaration */: - case 221 /* ClassExpression */: - case 165 /* MethodDeclaration */: - case 166 /* Constructor */: - case 167 /* GetAccessor */: - case 168 /* SetAccessor */: - case 208 /* FunctionExpression */: - case 251 /* FunctionDeclaration */: - case 209 /* ArrowFunction */: + case 249 /* ClassDeclaration */: + case 218 /* ClassExpression */: + case 164 /* MethodDeclaration */: + case 165 /* Constructor */: + case 166 /* GetAccessor */: + case 167 /* SetAccessor */: + case 205 /* FunctionExpression */: + case 248 /* FunctionDeclaration */: + case 206 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); return "skip"; } // falls through - case 232 /* VariableStatement */: + case 229 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - checkModifiers(parent.modifiers, parent.kind === 232 /* VariableStatement */); + checkModifiers(parent.modifiers, parent.kind === 229 /* VariableStatement */); return "skip"; } break; - case 163 /* PropertyDeclaration */: + case 162 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -106224,19 +103735,19 @@ var ts; return "skip"; } break; - case 160 /* Parameter */: + case 159 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); return "skip"; } break; - case 203 /* CallExpression */: - case 204 /* NewExpression */: - case 223 /* ExpressionWithTypeArguments */: - case 274 /* JsxSelfClosingElement */: - case 275 /* JsxOpeningElement */: - case 205 /* TaggedTemplateExpression */: + case 200 /* CallExpression */: + case 201 /* NewExpression */: + case 220 /* ExpressionWithTypeArguments */: + case 271 /* JsxSelfClosingElement */: + case 272 /* JsxOpeningElement */: + case 202 /* TaggedTemplateExpression */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); @@ -106258,7 +103769,7 @@ var ts; case 122 /* PublicKeyword */: case 120 /* PrivateKeyword */: case 121 /* ProtectedKeyword */: - case 142 /* ReadonlyKeyword */: + case 141 /* ReadonlyKeyword */: case 133 /* DeclareKeyword */: case 125 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind))); @@ -106319,7 +103830,9 @@ var ts; } var diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName); forEachResolvedProjectReference(function (resolvedRef) { - diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + if (resolvedRef) { + diagnostics = ts.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + } }); return diagnostics; } @@ -106340,18 +103853,6 @@ var ts; ? b.kind === 78 /* Identifier */ && a.escapedText === b.escapedText : b.kind === 10 /* StringLiteral */ && a.text === b.text; } - function createSyntheticImport(text, file) { - var externalHelpersModuleReference = ts.factory.createStringLiteral(text); - var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference); - ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */); - ts.setParent(externalHelpersModuleReference, importDecl); - ts.setParent(importDecl, file); - // explicitly unset the synthesized flag on these declarations so the checker API will answer questions about them - // (which is required to build the dependency graph for incremental emit) - externalHelpersModuleReference.flags &= ~8 /* Synthesized */; - importDecl.flags &= ~8 /* Synthesized */; - return externalHelpersModuleReference; - } function collectExternalModuleReferences(file) { if (file.imports) { return; @@ -106364,17 +103865,16 @@ var ts; var ambientModules; // If we are importing helpers, we need to add a synthetic reference to resolve the // helpers library. - if ((options.isolatedModules || isExternalModuleFile) + if (options.importHelpers + && (options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { - if (options.importHelpers) { - // synthesize 'import "tslib"' declaration - imports = [createSyntheticImport(ts.externalHelpersModuleNameText, file)]; - } - var jsxImport = ts.getJSXRuntimeImport(ts.getJSXImplicitImportBase(options, file), options); - if (jsxImport) { - // synthesize `import "base/jsx-runtime"` declaration - (imports || (imports = [])).push(createSyntheticImport(jsxImport, file)); - } + // synthesize 'import "tslib"' declaration + var externalHelpersModuleReference = ts.factory.createStringLiteral(ts.externalHelpersModuleNameText); + var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference); + ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */); + ts.setParent(externalHelpersModuleReference, importDecl); + ts.setParent(importDecl, file); + imports = [externalHelpersModuleReference]; } for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var node = _a[_i]; @@ -106558,16 +104058,6 @@ var ts; } // Get source file from normalized fileName function findSourceFile(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) { - ts.tracing.push("program" /* Program */, "findSourceFile", { - fileName: fileName, - isDefaultLib: isDefaultLib || undefined, - refKind: refFile ? ts.RefFileKind[refFile.kind] : undefined, - }); - var result = findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId); - ts.tracing.pop(); - return result; - } - function findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId) { if (useSourceOfProjectReferenceRedirect) { var source = getSourceOfProjectReferenceRedirect(fileName); // If preserveSymlinks is true, module resolution wont jump the symlink @@ -106755,11 +104245,12 @@ var ts; function getResolvedProjectReferenceToRedirect(fileName) { if (mapFromFileToProjectReferenceRedirects === undefined) { mapFromFileToProjectReferenceRedirects = new ts.Map(); - forEachResolvedProjectReference(function (referencedProject) { + forEachResolvedProjectReference(function (referencedProject, referenceProjectPath) { // not input file from the referenced project, ignore - if (toPath(options.configFilePath) !== referencedProject.sourceFile.path) { + if (referencedProject && + toPath(options.configFilePath) !== referenceProjectPath) { referencedProject.commandLine.fileNames.forEach(function (f) { - return mapFromFileToProjectReferenceRedirects.set(toPath(f), referencedProject.sourceFile.path); + return mapFromFileToProjectReferenceRedirects.set(toPath(f), referenceProjectPath); }); } }); @@ -106768,7 +104259,11 @@ var ts; return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); } function forEachResolvedProjectReference(cb) { - return ts.forEachResolvedProjectReference(resolvedProjectReferences, cb); + return forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { + var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; + var resolvedRefPath = toPath(resolveProjectReferencePath(ref)); + return cb(resolvedRef, resolvedRefPath); + }); } function getSourceOfProjectReferenceRedirect(file) { if (!ts.isDeclarationFileName(file)) @@ -106776,19 +104271,21 @@ var ts; if (mapFromToProjectReferenceRedirectSource === undefined) { mapFromToProjectReferenceRedirectSource = new ts.Map(); forEachResolvedProjectReference(function (resolvedRef) { - var out = ts.outFile(resolvedRef.commandLine.options); - if (out) { - // Dont know which source file it means so return true? - var outputDts = ts.changeExtension(out, ".d.ts" /* Dts */); - mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), true); - } - else { - ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) { - if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { - var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames()); - mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName); - } - }); + if (resolvedRef) { + var out = ts.outFile(resolvedRef.commandLine.options); + if (out) { + // Dont know which source file it means so return true? + var outputDts = ts.changeExtension(out, ".d.ts" /* Dts */); + mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), true); + } + else { + ts.forEach(resolvedRef.commandLine.fileNames, function (fileName) { + if (!ts.fileExtensionIs(fileName, ".d.ts" /* Dts */) && !ts.fileExtensionIs(fileName, ".json" /* Json */)) { + var outputDts = ts.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames()); + mapFromToProjectReferenceRedirectSource.set(toPath(outputDts), fileName); + } + }); + } } }); } @@ -106797,6 +104294,33 @@ var ts; function isSourceOfProjectReferenceRedirect(fileName) { return useSourceOfProjectReferenceRedirect && !!getResolvedProjectReferenceToRedirect(fileName); } + function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { + var seenResolvedRefs; + return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined, cbResolvedRef, cbRef); + function worker(projectReferences, resolvedProjectReferences, parent, cbResolvedRef, cbRef) { + // Visit project references first + if (cbRef) { + var result = cbRef(projectReferences, parent); + if (result) { + return result; + } + } + return ts.forEach(resolvedProjectReferences, function (resolvedRef, index) { + if (ts.contains(seenResolvedRefs, resolvedRef)) { + // ignore recursives + return undefined; + } + var result = cbResolvedRef(resolvedRef, index, parent); + if (result) { + return result; + } + if (!resolvedRef) + return undefined; + (seenResolvedRefs || (seenResolvedRefs = [])).push(resolvedRef); + return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef, cbResolvedRef, cbRef); + }); + } + } function getResolvedProjectReferenceByPath(projectReferencePath) { if (!projectReferenceRedirects) { return undefined; @@ -106823,7 +104347,7 @@ var ts; if (!typeDirectives) { return; } - var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file); + var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file.originalFileName, getResolvedProjectReferenceToRedirect(file.originalFileName)); for (var i = 0; i < typeDirectives.length; i++) { var ref = file.typeReferenceDirectives[i]; var resolvedTypeReferenceDirective = resolutions[i]; @@ -106840,11 +104364,6 @@ var ts; } } function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, refFile) { - ts.tracing.push("program" /* Program */, "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolveModuleNamesReusingOldState, refKind: refFile === null || refFile === void 0 ? void 0 : refFile.kind, refPath: refFile === null || refFile === void 0 ? void 0 : refFile.file.path }); - processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, refFile); - ts.tracing.pop(); - } - function processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, refFile) { // If we already found this library as a primary reference - nothing to do var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective); if (previousResolution && previousResolution.primary) { @@ -106929,7 +104448,7 @@ var ts; if (file.imports.length || file.moduleAugmentations.length) { // Because global augmentation doesn't have string literal name, we can check for global augmentation as such. var moduleNames = getModuleNames(file); - var resolutions = resolveModuleNamesReusingOldState(moduleNames, file); + var resolutions = resolveModuleNamesReusingOldState(moduleNames, ts.getNormalizedAbsolutePath(file.originalFileName, currentDirectory), file); ts.Debug.assert(resolutions.length === moduleNames.length); for (var i = 0; i < moduleNames.length; i++) { var resolution = resolutions[i]; @@ -106957,7 +104476,7 @@ var ts; && !options.noResolve && i < file.imports.length && !elideImport - && !(isJsFile && !ts.getAllowJSCompilerOption(options)) + && !(isJsFile && !options.allowJs) && (ts.isInJSFile(file.imports[i]) || !(file.imports[i].flags & 4194304 /* JSDoc */)); if (elideImport) { modulesWithElidedImports.set(file.path, true); @@ -107073,6 +104592,9 @@ var ts; createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap"); } } + if (options.paths && options.baseUrl === undefined) { + createDiagnosticForOptionName(ts.Diagnostics.Option_paths_cannot_be_used_without_specifying_baseUrl_option, "paths"); + } if (options.composite) { if (options.declaration === false) { createDiagnosticForOptionName(ts.Diagnostics.Composite_projects_may_not_disable_declaration_emit, "declaration"); @@ -107122,9 +104644,6 @@ var ts; if (!ts.hasZeroOrOneAsteriskCharacter(subst)) { createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character, subst, key); } - if (!options.baseUrl && !ts.pathIsRelative(subst) && !ts.pathIsAbsolute(subst)) { - createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash); - } } else { createDiagnosticForOptionPathKeyValue(key, i, ts.Diagnostics.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2, subst, key, typeOfSubst); @@ -107177,7 +104696,7 @@ var ts; var firstNonExternalModuleSourceFile = ts.find(files, function (f) { return !ts.isExternalModule(f) && !ts.isSourceFileJS(f) && !f.isDeclarationFile && f.scriptKind !== 6 /* JSON */; }); if (firstNonExternalModuleSourceFile) { var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); - programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts.getBaseFileName(firstNonExternalModuleSourceFile.fileName))); + programDiagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.All_files_must_be_modules_when_the_isolatedModules_flag_is_provided)); } } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 /* ES2015 */ && options.module === ts.ModuleKind.None) { @@ -107219,7 +104738,7 @@ var ts; if (options.useDefineForClassFields && languageVersion === 0 /* ES3 */) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, "useDefineForClassFields"); } - if (options.checkJs && !ts.getAllowJSCompilerOption(options)) { + if (options.checkJs && !options.allowJs) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); } if (options.emitDeclarationOnly) { @@ -107238,9 +104757,6 @@ var ts; if (options.reactNamespace) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "reactNamespace", "jsxFactory"); } - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFactory", ts.inverseJsxOptionMap.get("" + options.jsx)); - } if (!ts.parseIsolatedEntityName(options.jsxFactory, languageVersion)) { createOptionValueDiagnostic("jsxFactory", ts.Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFactory); } @@ -107252,23 +104768,10 @@ var ts; if (!options.jsxFactory) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "jsxFragmentFactory", "jsxFactory"); } - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFragmentFactory", ts.inverseJsxOptionMap.get("" + options.jsx)); - } if (!ts.parseIsolatedEntityName(options.jsxFragmentFactory, languageVersion)) { createOptionValueDiagnostic("jsxFragmentFactory", ts.Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFragmentFactory); } } - if (options.reactNamespace) { - if (options.jsx === 4 /* ReactJSX */ || options.jsx === 5 /* ReactJSXDev */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "reactNamespace", ts.inverseJsxOptionMap.get("" + options.jsx)); - } - } - if (options.jsxImportSource) { - if (options.jsx === 2 /* React */) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxImportSource", ts.inverseJsxOptionMap.get("" + options.jsx)); - } - } // If the emit is enabled make sure that every output file is unique and not overwriting any of the input files if (!options.noEmit && !options.suppressOutputPathCheck) { var emitHost = getEmitHost(); @@ -107343,7 +104846,7 @@ var ts; } function verifyProjectReferences() { var buildInfoPath = !options.suppressOutputPathCheck ? ts.getTsBuildInfoEmitOutputFilePath(options) : undefined; - forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, parent, index) { + forEachProjectReference(projectReferences, resolvedProjectReferences, function (resolvedRef, index, parent) { var ref = (parent ? parent.commandLine.projectReferences : projectReferences)[index]; var parentFile = parent && parent.sourceFile; if (!resolvedRef) { @@ -107538,6 +105041,8 @@ var ts; if (!setOfDeclarationDirectories) { setOfDeclarationDirectories = new ts.Set(); host.forEachResolvedProjectReference(function (ref) { + if (!ref) + return; var out = ts.outFile(ref.commandLine.options); if (out) { setOfDeclarationDirectories.add(ts.getDirectoryPath(host.toPath(out))); @@ -107770,7 +105275,7 @@ var ts; return options.jsx ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set; } function needAllowJs() { - return ts.getAllowJSCompilerOption(options) || !ts.getStrictOptionValue(options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; + return options.allowJs || !ts.getStrictOptionValue(options, "noImplicitAny") ? undefined : ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; } function needResolveJsonModule() { return options.resolveJsonModule ? undefined : ts.Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used; @@ -107924,7 +105429,7 @@ var ts; // Create the reference map, and set the file infos for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) { var sourceFile = _a[_i]; - var version_2 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); + var version_1 = ts.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); var oldInfo = useOldState ? oldState.fileInfos.get(sourceFile.resolvedPath) : undefined; if (referencedMap) { var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName); @@ -107939,7 +105444,7 @@ var ts; } } } - fileInfos.set(sourceFile.resolvedPath, { version: version_2, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) }); + fileInfos.set(sourceFile.resolvedPath, { version: version_1, signature: oldInfo && oldInfo.signature, affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) }); } return { fileInfos: fileInfos, @@ -108041,7 +105546,7 @@ var ts; emitOutput_1.outputFiles.length > 0 ? emitOutput_1.outputFiles[0] : undefined; if (firstDts_1) { ts.Debug.assert(ts.fileExtensionIs(firstDts_1.name, ".d.ts" /* Dts */), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); }); - latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text); + latestSignature = computeHash(firstDts_1.text); if (exportedModulesMapCache && latestSignature !== prevSignature) { updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache); } @@ -108234,12 +105739,14 @@ var ts; if (!seenFileNamesMap.has(currentPath)) { var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); seenFileNamesMap.set(currentPath, currentSourceFile); - if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) { - queue.push.apply(queue, getReferencedByPaths(state, currentSourceFile.resolvedPath)); + if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) { // TODO: GH#18217 + queue.push.apply(// TODO: GH#18217 + queue, getReferencedByPaths(state, currentSourceFile.resolvedPath)); } } } // Return array of values that needs emit + // Return array of values that needs emit return ts.arrayFrom(ts.mapDefinedIterator(seenFileNamesMap.values(), function (value) { return value; })); } })(BuilderState = ts.BuilderState || (ts.BuilderState = {})); @@ -108360,7 +105867,7 @@ var ts; result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function (r) { return convertToDiagnosticRelatedInformation(r, newProgram, toPath); }) : - [] : + ts.emptyArray : undefined; return result; }); @@ -108552,10 +106059,10 @@ var ts; state.semanticDiagnosticsPerFile.delete(path); return !state.semanticDiagnosticsFromOldState.size; } - function isChangedSignature(state, path) { + function isChangedSignagure(state, path) { var newSignature = ts.Debug.checkDefined(state.currentAffectedFilesSignatures).get(path); - var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature; - return newSignature !== oldSignature; + var oldSignagure = ts.Debug.checkDefined(state.fileInfos.get(path)).signature; + return newSignature !== oldSignagure; } /** * Iterate on referencing modules that export entities from affected file @@ -108566,7 +106073,7 @@ var ts; if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) { return; } - if (!isChangedSignature(state, affectedFile.resolvedPath)) + if (!isChangedSignagure(state, affectedFile.resolvedPath)) return; // Since isolated modules dont change js files, files affected by change in signature is itself // But we need to cleanup semantic diagnostics and queue dts emit for affected files @@ -108579,7 +106086,7 @@ var ts; if (!seenFileNamesMap.has(currentPath)) { seenFileNamesMap.set(currentPath, true); var result = fn(state, currentPath); - if (result && isChangedSignature(state, currentPath)) { + if (result && isChangedSignagure(state, currentPath)) { var currentSourceFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(currentPath); queue.push.apply(queue, ts.BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath)); } @@ -108829,7 +106336,7 @@ var ts; result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function (r) { return convertToReusableDiagnosticRelatedInformation(r, relativeToBuildInfo); }) : - [] : + ts.emptyArray : undefined; return result; }); @@ -108891,7 +106398,7 @@ var ts; /** * Computing hash to for signature verification */ - var computeHash = ts.maybeBind(host, host.createHash); + var computeHash = host.createHash || ts.generateDjb2Hash; var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState); var backupState; newProgram.getProgramBuildInfo = function () { return getProgramBuildInfo(state, getCanonicalFileName); }; @@ -108987,54 +106494,31 @@ var ts; * in that order would be used to write the files */ function emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { - var restorePendingEmitOnHandlingNoEmitSuccess = false; - var savedAffectedFilesPendingEmit; - var savedAffectedFilesPendingEmitKind; - var savedAffectedFilesPendingEmitIndex; - // Backup and restore affected pendings emit state for non emit Builder if noEmitOnError is enabled and emitBuildInfo could be written in case there are errors - // This ensures pending files to emit is updated in tsbuildinfo - // Note that when there are no errors, emit proceeds as if everything is emitted as it is callers reponsibility to write the files to disk if at all (because its builder that doesnt track files to emit) - if (kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram && - !targetSourceFile && - !ts.outFile(state.compilerOptions) && - !state.compilerOptions.noEmit && - state.compilerOptions.noEmitOnError) { - restorePendingEmitOnHandlingNoEmitSuccess = true; - savedAffectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice(); - savedAffectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind); - savedAffectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex; - } if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile); - } - var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken); - if (result) - return result; - if (restorePendingEmitOnHandlingNoEmitSuccess) { - state.affectedFilesPendingEmit = savedAffectedFilesPendingEmit; - state.affectedFilesPendingEmitKind = savedAffectedFilesPendingEmitKind; - state.affectedFilesPendingEmitIndex = savedAffectedFilesPendingEmitIndex; - } - // Emit only affected files if using builder for emit - if (!targetSourceFile && kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { - // Emit and report any errors we ran into. - var sourceMaps = []; - var emitSkipped = false; - var diagnostics = void 0; - var emittedFiles = []; - var affectedEmitResult = void 0; - while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { - emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; - diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); - emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); - sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + var result = ts.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken); + if (result) + return result; + if (!targetSourceFile) { + // Emit and report any errors we ran into. + var sourceMaps = []; + var emitSkipped = false; + var diagnostics = void 0; + var emittedFiles = []; + var affectedEmitResult = void 0; + while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { + emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; + diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); + emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); + sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + } + return { + emitSkipped: emitSkipped, + diagnostics: diagnostics || ts.emptyArray, + emittedFiles: emittedFiles, + sourceMaps: sourceMaps + }; } - return { - emitSkipped: emitSkipped, - diagnostics: diagnostics || ts.emptyArray, - emittedFiles: emittedFiles, - sourceMaps: sourceMaps - }; } return ts.Debug.checkDefined(state.program).emit(targetSourceFile, writeFile || ts.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers); } @@ -109054,8 +106538,7 @@ var ts; return toAffectedFileResult(state, state.program.getSemanticDiagnostics(/*targetSourceFile*/ undefined, cancellationToken), affected); } // Add file to affected file pending emit to handle for later emit time - // Apart for emit builder do this for tsbuildinfo, do this for non emit builder when noEmit is set as tsbuildinfo is written and reused between emitters - if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram || state.compilerOptions.noEmit || state.compilerOptions.noEmitOnError) { + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { addToAffectedFilesPendingEmit(state, affected.resolvedPath, 1 /* Full */); } // Get diagnostics for the affected file if its not ignored @@ -109769,8 +107252,8 @@ var ts; if (!resolutions) return false; var invalidated = false; - for (var _i = 0, resolutions_1 = resolutions; _i < resolutions_1.length; _i++) { - var resolution = resolutions_1[_i]; + for (var _i = 0, resolutions_2 = resolutions; _i < resolutions_2.length; _i++) { + var resolution = resolutions_2[_i]; if (resolution.isInvalidated || !canInvalidate(resolution)) continue; resolution.isInvalidated = invalidated = true; @@ -109982,14 +107465,14 @@ var ts; function getNodeModulesPackageName(compilerOptions, importingSourceFileName, nodeModulesFileName, host) { var info = getInfo(importingSourceFileName, host); var modulePaths = getAllModulePaths(importingSourceFileName, nodeModulesFileName, host); - return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions, /*packageNameOnly*/ true); }); + return ts.firstDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions, /*packageNameOnly*/ true); }); } moduleSpecifiers.getNodeModulesPackageName = getNodeModulesPackageName; function getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, preferences) { var info = getInfo(importingSourceFileName, host); var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host); - return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); }) || - getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences); + return ts.firstDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions); }) || + getLocalModuleSpecifier(toFileName, info, compilerOptions, preferences); } /** Returns an import for each symlink and for the realpath. */ function getModuleSpecifiers(moduleSymbol, compilerOptions, importingSourceFile, host, userPreferences) { @@ -110000,46 +107483,8 @@ var ts; var moduleSourceFile = ts.getSourceFileOfNode(moduleSymbol.valueDeclaration || ts.getNonAugmentationDeclaration(moduleSymbol)); var modulePaths = getAllModulePaths(importingSourceFile.path, moduleSourceFile.originalFileName, host); var preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile); - var importedFileIsInNodeModules = ts.some(modulePaths, function (p) { return p.isInNodeModules; }); - // Module specifier priority: - // 1. "Bare package specifiers" (e.g. "@foo/bar") resulting from a path through node_modules to a package.json's "types" entry - // 2. Specifiers generated using "paths" from tsconfig - // 3. Non-relative specfiers resulting from a path through node_modules (e.g. "@foo/bar/path/to/file") - // 4. Relative paths - var nodeModulesSpecifiers; - var pathsSpecifiers; - var relativeSpecifiers; - for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) { - var modulePath = modulePaths_1[_i]; - var specifier = tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); - nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier); - if (specifier && modulePath.isRedirect) { - // If we got a specifier for a redirect, it was a bare package specifier (e.g. "@foo/bar", - // not "@foo/bar/path/to/file"). No other specifier will be this good, so stop looking. - return nodeModulesSpecifiers; - } - if (!specifier && !modulePath.isRedirect) { - var local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, preferences); - if (ts.pathIsBareSpecifier(local)) { - pathsSpecifiers = ts.append(pathsSpecifiers, local); - } - else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) { - // Why this extra conditional, not just an `else`? If some path to the file contained - // 'node_modules', but we can't create a non-relative specifier (e.g. "@foo/bar/path/to/file"), - // that means we had to go through a *sibling's* node_modules, not one we can access directly. - // If some path to the file was in node_modules but another was not, this likely indicates that - // we have a monorepo structure with symlinks. In this case, the non-node_modules path is - // probably the realpath, e.g. "../bar/path/to/file", but a relative path to another package - // in a monorepo is probably not portable. So, the module specifier we actually go with will be - // the relative path through node_modules, so that the declaration emitter can produce a - // portability error. (See declarationEmitReexportedSymlinkReference3) - relativeSpecifiers = ts.append(relativeSpecifiers, local); - } - } - } - return (pathsSpecifiers === null || pathsSpecifiers === void 0 ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : - (nodeModulesSpecifiers === null || nodeModulesSpecifiers === void 0 ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : - ts.Debug.checkDefined(relativeSpecifiers); + var global = ts.mapDefined(modulePaths, function (moduleFileName) { return tryGetModuleNameAsNodeModule(moduleFileName, info, host, compilerOptions); }); + return global.length ? global : modulePaths.map(function (moduleFileName) { return getLocalModuleSpecifier(moduleFileName, info, compilerOptions, preferences); }); } moduleSpecifiers.getModuleSpecifiers = getModuleSpecifiers; // importingSourceFileName is separate because getEditsForFileRename may need to specify an updated path @@ -110048,26 +107493,22 @@ var ts; var sourceDirectory = ts.getDirectoryPath(importingSourceFileName); return { getCanonicalFileName: getCanonicalFileName, sourceDirectory: sourceDirectory }; } - function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, host, _b) { + function getLocalModuleSpecifier(moduleFileName, _a, compilerOptions, _b) { var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory; var ending = _b.ending, relativePreference = _b.relativePreference; var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs; var relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) || removeExtensionAndIndexPostFix(ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions); - if (!baseUrl && !paths || relativePreference === 0 /* Relative */) { + if (!baseUrl || relativePreference === 0 /* Relative */) { return relativePath; } - var baseDirectory = ts.getPathsBasePath(compilerOptions, host) || baseUrl; - var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseDirectory, getCanonicalFileName); + var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); if (!relativeToBaseUrl) { return relativePath; } var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions); var fromPaths = paths && tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); - var nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths; - if (!nonRelative) { - return relativePath; - } + var nonRelative = fromPaths === undefined ? importRelativeToBaseUrl : fromPaths; if (relativePreference === 1 /* NonRelative */) { return nonRelative; } @@ -110096,8 +107537,8 @@ var ts; var match = str.match(/\//g); return match ? match.length : 0; } - function comparePathsByRedirectAndNumberOfDirectorySeparators(a, b) { - return ts.compareBooleans(b.isRedirect, a.isRedirect) || ts.compareValues(numberOfDirectorySeparators(a.path), numberOfDirectorySeparators(b.path)); + function comparePathsByNumberOfDirectorySeparators(a, b) { + return ts.compareValues(numberOfDirectorySeparators(a), numberOfDirectorySeparators(b)); } function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) { var getCanonicalFileName = ts.hostGetCanonicalFileName(host); @@ -110107,36 +107548,34 @@ var ts; var importedFileNames = __spreadArrays((referenceRedirect ? [referenceRedirect] : ts.emptyArray), [importedFileName], redirects); var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); }); if (!preferSymlinks) { - var result_15 = ts.forEach(targets, function (p) { return cb(p, referenceRedirect === p); }); - if (result_15) - return result_15; + var result_13 = ts.forEach(targets, cb); + if (result_13) + return result_13; } var links = host.getSymlinkCache ? host.getSymlinkCache() : ts.discoverProbableSymlinks(host.getSourceFiles(), getCanonicalFileName, cwd); var symlinkedDirectories = links.getSymlinkedDirectories(); - var useCaseSensitiveFileNames = !host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames(); + var compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive; var result = symlinkedDirectories && ts.forEachEntry(symlinkedDirectories, function (resolved, path) { if (resolved === false) return undefined; if (ts.startsWithDirectory(importingFileName, resolved.realPath, getCanonicalFileName)) { return undefined; // Don't want to a package to globally import from itself } - return ts.forEach(targets, function (target) { - if (!ts.containsPath(resolved.real, target, !useCaseSensitiveFileNames)) { - return; - } - var relative = ts.getRelativePathFromDirectory(resolved.real, target, getCanonicalFileName); - var option = ts.resolvePath(path, relative); - if (!host.fileExists || host.fileExists(option)) { - var result_16 = cb(option, target === referenceRedirect); - if (result_16) - return result_16; - } - }); + var target = ts.find(targets, function (t) { return compareStrings(t.slice(0, resolved.real.length), resolved.real) === 0 /* EqualTo */; }); + if (target === undefined) + return undefined; + var relative = ts.getRelativePathFromDirectory(resolved.real, target, getCanonicalFileName); + var option = ts.resolvePath(path, relative); + if (!host.fileExists || host.fileExists(option)) { + var result_14 = cb(option); + if (result_14) + return result_14; + } }); return result || - (preferSymlinks ? ts.forEach(targets, function (p) { return cb(p, p === referenceRedirect); }) : undefined); + (preferSymlinks ? ts.forEach(targets, cb) : undefined); } moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule; /** @@ -110149,27 +107588,28 @@ var ts; var allFileNames = new ts.Map(); var importedFileFromNodeModules = false; forEachFileNameOfModule(importingFileName, importedFileName, host, - /*preferSymlinks*/ true, function (path, isRedirect) { - var isInNodeModules = ts.pathContainsNodeModules(path); - allFileNames.set(path, { path: getCanonicalFileName(path), isRedirect: isRedirect, isInNodeModules: isInNodeModules }); - importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules; - // don't return value, so we collect everything + /*preferSymlinks*/ true, function (path) { + // dont return value, so we collect everything + allFileNames.set(path, getCanonicalFileName(path)); + importedFileFromNodeModules = importedFileFromNodeModules || ts.pathContainsNodeModules(path); }); // Sort by paths closest to importing file Name directory var sortedPaths = []; - var _loop_24 = function (directory) { + var _loop_23 = function (directory) { var directoryStart = ts.ensureTrailingDirectorySeparator(directory); var pathsInDirectory; - allFileNames.forEach(function (_a, fileName) { - var path = _a.path, isRedirect = _a.isRedirect, isInNodeModules = _a.isInNodeModules; - if (ts.startsWith(path, directoryStart)) { - (pathsInDirectory || (pathsInDirectory = [])).push({ path: fileName, isRedirect: isRedirect, isInNodeModules: isInNodeModules }); + allFileNames.forEach(function (canonicalFileName, fileName) { + if (ts.startsWith(canonicalFileName, directoryStart)) { + // If the importedFile is from node modules, use only paths in node_modules folder as option + if (!importedFileFromNodeModules || ts.pathContainsNodeModules(fileName)) { + (pathsInDirectory || (pathsInDirectory = [])).push(fileName); + } allFileNames.delete(fileName); } }); if (pathsInDirectory) { if (pathsInDirectory.length > 1) { - pathsInDirectory.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + pathsInDirectory.sort(comparePathsByNumberOfDirectorySeparators); } sortedPaths.push.apply(sortedPaths, pathsInDirectory); } @@ -110181,7 +107621,7 @@ var ts; }; var out_directory_1; for (var directory = ts.getDirectoryPath(ts.toPath(importingFileName, cwd, getCanonicalFileName)); allFileNames.size !== 0;) { - var state_8 = _loop_24(directory); + var state_8 = _loop_23(directory); directory = out_directory_1; if (state_8 === "break") break; @@ -110189,7 +107629,7 @@ var ts; if (allFileNames.size) { var remainingPaths = ts.arrayFrom(allFileNames.values()); if (remainingPaths.length > 1) - remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + remainingPaths.sort(comparePathsByNumberOfDirectorySeparators); sortedPaths.push.apply(sortedPaths, remainingPaths); } return sortedPaths; @@ -110234,43 +107674,37 @@ var ts; ? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions) : ts.removeFileExtension(relativePath); } - function tryGetModuleNameAsNodeModule(_a, _b, host, options, packageNameOnly) { - var path = _a.path, isRedirect = _a.isRedirect; - var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory; + function tryGetModuleNameAsNodeModule(moduleFileName, _a, host, options, packageNameOnly) { + var getCanonicalFileName = _a.getCanonicalFileName, sourceDirectory = _a.sourceDirectory; if (!host.fileExists || !host.readFile) { return undefined; } - var parts = getNodeModulePathParts(path); + var parts = getNodeModulePathParts(moduleFileName); if (!parts) { return undefined; } // Simplify the full file path to something that can be resolved by Node. - var moduleSpecifier = path; - var isPackageRootPath = false; + var moduleSpecifier = moduleFileName; if (!packageNameOnly) { var packageRootIndex = parts.packageRootIndex; var moduleFileNameForExtensionless = void 0; while (true) { // If the module could be imported by a directory name, use that directory's name - var _c = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _c.moduleFileToTry, packageRootPath = _c.packageRootPath; + var _b = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _b.moduleFileToTry, packageRootPath = _b.packageRootPath; if (packageRootPath) { moduleSpecifier = packageRootPath; - isPackageRootPath = true; break; } if (!moduleFileNameForExtensionless) moduleFileNameForExtensionless = moduleFileToTry; // try with next level of directory - packageRootIndex = path.indexOf(ts.directorySeparator, packageRootIndex + 1); + packageRootIndex = moduleFileName.indexOf(ts.directorySeparator, packageRootIndex + 1); if (packageRootIndex === -1) { moduleSpecifier = getExtensionlessFileName(moduleFileNameForExtensionless); break; } } } - if (isRedirect && !isPackageRootPath) { - return undefined; - } var globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); // Get a path that's relative to node_modules or the importing file's path // if node_modules folder is in this folder or any of its parent folders, no need to keep it. @@ -110284,16 +107718,16 @@ var ts; // For classic resolution, only allow importing from node_modules/@types, not other node_modules return ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs && packageName === nodeModulesDirectoryName ? undefined : packageName; function tryDirectoryWithPackageJson(packageRootIndex) { - var packageRootPath = path.substring(0, packageRootIndex); + var packageRootPath = moduleFileName.substring(0, packageRootIndex); var packageJsonPath = ts.combinePaths(packageRootPath, "package.json"); - var moduleFileToTry = path; + var moduleFileToTry = moduleFileName; if (host.fileExists(packageJsonPath)) { var packageJsonContent = JSON.parse(host.readFile(packageJsonPath)); var versionPaths = packageJsonContent.typesVersions ? ts.getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions) : undefined; if (versionPaths) { - var subModuleName = path.slice(packageRootPath.length + 1); + var subModuleName = moduleFileName.slice(packageRootPath.length + 1); var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(subModuleName), removeExtensionAndIndexPostFix(subModuleName, 0 /* Minimal */, options), versionPaths.paths); if (fromPaths !== undefined) { moduleFileToTry = ts.combinePaths(packageRootPath, fromPaths); @@ -110697,7 +108131,7 @@ var ts; ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost; function setGetSourceFileAsHashVersioned(compilerHost, host) { var originalGetSourceFile = compilerHost.getSourceFile; - var computeHash = ts.maybeBind(host, host.createHash) || ts.generateDjb2Hash; + var computeHash = host.createHash || ts.generateDjb2Hash; compilerHost.getSourceFile = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -110705,7 +108139,7 @@ var ts; } var result = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArrays([compilerHost], args)); if (result) { - result.version = computeHash(result.text); + result.version = computeHash.call(host, result.text); } return result; }; @@ -111224,7 +108658,7 @@ var ts; } function reloadFileNamesFromConfigFile() { writeLog("Reloading new file names and options"); - var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions); + var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost); if (ts.updateErrorForNoInputFiles(result, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) { hasChangedConfigFileParsingErrors = true; } @@ -111310,7 +108744,6 @@ var ts; fileOrDirectoryPath: fileOrDirectoryPath, configFileName: configFileName, configFileSpecs: configFileSpecs, - extraFileExtensions: extraFileExtensions, options: compilerOptions, program: getCurrentBuilderProgram(), currentDirectory: currentDirectory, @@ -112899,7 +110332,7 @@ var ts; function nowString() { // E.g. "12:34:56.789" var d = new Date(); - return ts.padLeft(d.getHours().toString(), 2, "0") + ":" + ts.padLeft(d.getMinutes().toString(), 2, "0") + ":" + ts.padLeft(d.getSeconds().toString(), 2, "0") + "." + ts.padLeft(d.getMilliseconds().toString(), 3, "0"); + return d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + "." + d.getMilliseconds(); } server.nowString = nowString; })(server = ts.server || (ts.server = {})); @@ -113009,9 +110442,7 @@ var ts; var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); getTypingNamesFromPackagesFolder(nodeModulesPath, filesToWatch); }); - if (!typeAcquisition.disableFilenameBasedTypeAcquisition) { - getTypingNamesFromSourceFileNames(fileNames); - } + getTypingNamesFromSourceFileNames(fileNames); // add typings for unresolved imports if (unresolvedImports) { var module_1 = ts.deduplicate(unresolvedImports.map(nonRelativeModuleNameForTypingCache), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); diff --git a/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json b/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json index a6fc4fc..bc09798 100644 --- a/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +++ b/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json @@ -151,8 +151,6 @@ "Add_undefined_type_to_property_0_95018": "向属性“{0}”添加“未定义”类型", "Add_unknown_conversion_for_non_overlapping_types_95069": "为非重叠类型添加 \"unknown\" 转换", "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": "将 \"unknown\" 添加到非重叠类型的所有转换", - "Add_void_to_Promise_resolved_without_a_value_95143": "将 \"void\" 添加到已解析但没有值的承诺", - "Add_void_to_all_Promises_resolved_without_a_value_95144": "将 \"void\" 添加到所有已解析但没有值的承诺", "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "添加 tsconfig.json 文件有助于组织包含 TypeScript 和 JavaScript 文件的项目。有关详细信息,请访问 https://aka.ms/tsconfig。", "Additional_Checks_6176": "其他检查", "Advanced_Options_6178": "高级选项", @@ -160,8 +158,9 @@ "All_declarations_of_0_must_have_identical_type_parameters_2428": "“{0}”的所有声明都必须具有相同的类型参数。", "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "抽象方法的所有声明必须是连续的。", "All_destructured_elements_are_unused_6198": "未取消使用任何解构元素。", + "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208": "提供 \"--isolatedModules\" 标志时,所有文件都必须是模块。", "All_imports_in_import_declaration_are_unused_6192": "未使用导入声明中的所有导入。", - "All_type_parameters_are_unused_6205": "未使用任何类型参数。", + "All_type_parameters_are_unused_6205": "未使用任何类型参数", "All_variables_are_unused_6199": "所有变量均未使用。", "Allow_accessing_UMD_globals_from_modules_95076": "允许从模块访问 UMD 变量全局。", "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "允许从不带默认输出的模块中默认输入。这不会影响代码发出,只是类型检查。", @@ -193,7 +192,7 @@ "An_export_assignment_cannot_have_modifiers_1120": "导出分配不能具有修饰符。", "An_export_declaration_can_only_be_used_in_a_module_1233": "导出声明只能在模块中使用。", "An_export_declaration_cannot_have_modifiers_1193": "导出声明不能有修饰符。", - "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "无法测试 \"void\" 类型的表达式的真实性。", + "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "无法测试 \"void\" 类型表达式的真实性", "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198": "扩展的 Unicode 转义值必须介于(含) 0x0 和 0x10FFFF 之间。", "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351": "标识符或关键字不能紧跟在数字文本之后。", "An_implementation_cannot_be_declared_in_ambient_contexts_1183": "不能在环境上下文中声明实现。", @@ -235,7 +234,7 @@ "Argument_expression_expected_1135": "应为参数表达式。", "Argument_for_0_option_must_be_Colon_1_6046": "“{0}”选项的参数必须为 {1}。", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "类型“{0}”的参数不能赋给类型“{1}”的参数。", - "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "未提供 rest 形参“{0}”的实参。", + "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "Arguments for the rest parameter '{0}' were not provided.", "Array_element_destructuring_pattern_expected_1181": "应为数组元素析构模式。", "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": "断言要求使用显式类型注释声明调用目标中的每个名称。", "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": "断言要求调用目标为标识符或限定名。", @@ -284,21 +283,21 @@ "Cannot_find_global_value_0_2468": "找不到全局值“{0}”。", "Cannot_find_lib_definition_for_0_2726": "找不到“{0}”的库定义。", "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "找不到“{0}”的库定义。你是指“{1}”?", - "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "找不到模块“{0}”。请考虑使用 \"--resolveJsonModule\" 导入带 \".json\" 扩展的模块。", - "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "找不到模块“{0}”。你的意思是要将 \"moduleResolution\" 选项设置为 \"node\",还是要将别名添加到 \"paths\" 选项中?", + "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "找不到模块 \"{0}\"。请考虑使用 \"--resolveJsonModule\" 导入带 \".json\" 扩展的模块", + "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?", "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "找不到模块“{0}”或其相应的类型声明。", "Cannot_find_name_0_2304": "找不到名称“{0}”。", "Cannot_find_name_0_Did_you_mean_1_2552": "找不到名称“{0}”。你是否指的是“{1}”?", "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "找不到名称“{0}”。你的意思是实例成员“this.{0}”?", "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": "找不到名称“{0}”。你的意思是静态成员“{1}.{0}”?", - "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "找不到名称“{0}”。是否需要更改目标库? 请尝试将 `lib` 编译器选项更改为 {1} 或更高版本。", + "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "找不到名称 \"{0}\"。是否需要更改目标库? 请尝试将 `lib` 编译器选项更改为 es2015 或更高版本。", "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": "找不到名称 \"{0}\"。是否需要更改目标库? 请尝试将 `lib` 编译器选项更改为包含 \"dom\"。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": "找不到名称 \"{0}\"。是否需要安装测试运行器的类型定义? 请尝试使用 `npm i --save-dev @types/jest` 或 `npm i --save-dev @types/mocha`。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": "找不到名称 \"{0}\"。是否需要安装测试运行器的类型定义? 请尝试使用 `npm i --save-dev @types/jest` 或 `npm i --save-dev @types/mocha`,然后在 tsconfig 的 types 字段中添加 `jest` 或 `mocha`。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": "找不到名称 \"{0}\"。是否需要安装 jQuery 的类型定义? 请尝试使用 `npm i --save-dev @types/jquery`。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": "找不到名称 \"{0}\"。是否需要安装 jQuery 的类型定义? 请尝试使用 `npm i --save-dev @types/jquery`,然后在 tsconfig 中将 `jquery` 添加到 types 字段。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": "找不到名称 \"{0}\"。是否需要为节点安装类型定义? 请尝试使用 `npm i --save-dev @types/node`。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": "找不到名称 \"{0}\"。是否需要为节点安装类型定义? 请尝试使用 `npm i --save-dev @types/node`,然后在 tsconfig 中将 `node` 添加到 types 字段。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582": "找不到名称 \"{0}\"。是否需要安装测试运行程序的类型定义? 请尝试使用 `npm i @types/jest` 或 `npm i @types/mocha`。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593": "找不到名称 \"{0}\"。是否需要安装测试运行程序的类型定义? 请尝试使用 `npm i @types/jest` 或 `npm i @types/mocha`,然后在 tsconfig 的 types 字段中添加 `jest` 或 `mocha`。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581": "找不到名称 \"{0}\"。是否需要安装 jQuery 的类型定义? 请尝试 `npm i @types/jquery`。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592": "找不到名称 \"{0}\"。是否需要安装 jQuery 的类型定义? 请尝试使用 `npm i @types/jquery`,然后在 tsconfig 中将 `jquery` 添加到 types 字段。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580": "找不到名称 \"{0}\"。是否需要为节点安装类型定义? 请尝试使用 `npm i @types/node`。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591": "找不到名称 \"{0}\"。是否需要为节点安装类型定义? 请尝试使用 `npm i @types/node`,然后在 tsconfig 中将 \"node\" 添加到 types 字段。", "Cannot_find_namespace_0_2503": "找不到命名空间“{0}”。", "Cannot_find_parameter_0_1225": "找不到参数“{0}”。", "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": "找不到输入文件的公共子目录路径。", @@ -375,7 +374,6 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "未指定包含文件,并且无法确定根目录,正在跳过在 \"node_modules\" 文件夹中查找。", "Containing_function_is_not_an_arrow_function_95128": "包含函数不是箭头函数", "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": "类型 \"{0}\" 到类型 \"{1}\" 的转换可能是错误的,因为两种类型不能充分重叠。如果这是有意的,请先将表达式转换为 \"unknown\"。", - "Convert_0_to_1_in_0_95003": "将“{0}”转换为 {0} 中的 {1}", "Convert_0_to_mapped_object_type_95055": "将“{0}”转换为映射对象类型", "Convert_all_constructor_functions_to_classes_95045": "将所有构造函数都转换为类", "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374": "将不用作值的所有导入转换为仅类型导入", @@ -385,7 +383,6 @@ "Convert_all_to_async_functions_95066": "全部转换为异步函数", "Convert_all_to_bigint_numeric_literals_95092": "全部转换为 bigint 数字文本", "Convert_all_to_default_imports_95035": "全部转换为默认导入", - "Convert_all_type_literals_to_mapped_type_95021": "将所有类型文本转换为映射类型", "Convert_arrow_function_or_function_expression_95122": "转换箭头函数或函数表达式", "Convert_const_to_let_95093": "将 \"const\" 转换为 \"let\"", "Convert_default_export_to_named_export_95061": "将默认导出转换为命名导出", @@ -429,8 +426,6 @@ "Declaration_expected_1146": "应为声明。", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "声明名称与内置全局标识符“{0}”冲突。", "Declaration_or_statement_expected_1128": "应为声明或语句。", - "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": "具有明确赋值断言的声明也必须具有类型批注。", - "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": "具有初始值设定项的声明不能同时具有明确赋值断言。", "Declare_a_private_field_named_0_90053": "声明名为 \"{0}\" 的专用字段。", "Declare_method_0_90023": "声明方法“{0}”", "Declare_private_method_0_90038": "声明私有方法 \"{0}\"", @@ -441,6 +436,7 @@ "Decorators_are_not_valid_here_1206": "修饰器在此处无效。", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "不能向多个同名的 get/set 访问器应用修饰器。", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "模块的默认导出具有或正在使用专用名称“{0}”。", + "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258": "明确赋值断言只能与类型注释一起使用。", "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": "以下标识符的定义与另一个文件中的定义冲突: {0}", "Delete_all_unused_declarations_95024": "删除未使用的所有声明", "Delete_the_outputs_of_all_projects_6365": "删除所有项目的输出", @@ -490,7 +486,7 @@ "Duplicate_number_index_signature_2375": "数字索引签名重复。", "Duplicate_property_0_2718": "重复的属性 \"{0}\"。", "Duplicate_string_index_signature_2374": "字符串索引签名重复。", - "Dynamic_import_cannot_have_type_arguments_1326": "动态导入不能含有类型参数。", + "Dynamic_import_cannot_have_type_arguments_1326": "动态导入不能含有类型参数", "Dynamic_import_must_have_one_specifier_as_an_argument_1324": "动态导入必须具有一个说明符作为参数。", "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "动态导入的说明符类型必须是 \"string\",但此处类型是 \"{0}\"。", "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323": "仅当 \"--module\" 标志设置为 \"es2020\"、\"esnext\"、\"commonjs\"、\"amd\"、\"system\" 或 \"umd\" 时,才支持动态导入。", @@ -532,7 +528,6 @@ "Excessive_stack_depth_comparing_types_0_and_1_2321": "与类型“{0}”和“{1}”相比,堆栈深度过高。", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "应为 {0}-{1} 类型参数;请为这些参数添加 \"@extends\" 标记。", "Expected_0_arguments_but_got_1_2554": "应有 {0} 个参数,但获得 {1} 个。", - "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "应为 {0} 个参数,但得到的却是 {1} 个。你是否忘了将类型参数中的 \"void\" 包含到 \"Promise\"?", "Expected_0_arguments_but_got_1_or_more_2556": "应有 {0} 个参数,但获得的数量大于等于 {1}。", "Expected_0_type_arguments_but_got_1_2558": "应有 {0} 个类型参数,但获得 {1} 个。", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "应为 {0} 类型参数;请为这些参数添加 \"@extends\" 标记。", @@ -617,7 +612,6 @@ "Generate_get_and_set_accessors_for_all_overriding_properties_95119": "为所有重写属性生成 \"get\" 和 \"set\" 访问器", "Generates_a_CPU_profile_6223": "生成 CPU 配置文件。", "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": "为每个相应的 \".d.ts\" 文件生成源映射。", - "Generates_an_event_trace_and_a_list_of_types_6237": "生成事件跟踪和类型列表。", "Generates_corresponding_d_ts_file_6002": "生成相应的 \".d.ts\" 文件。", "Generates_corresponding_map_file_6043": "生成相应的 \".map\" 文件。", "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025": "生成器隐式具有产出类型 \"{0}\" ,因为它不生成任何值。请考虑提供一个返回类型注释。", @@ -662,7 +656,6 @@ "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "在环境枚举声明中,成员初始化表达式必须是常数表达式。", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "在包含多个声明的枚举中,只有一个声明可以省略其第一个枚举元素的初始化表达式。", "Include_modules_imported_with_json_extension_6197": "包括通过 \".json\" 扩展导入的模块", - "Include_undefined_in_index_signature_results_6800": "在索引签名结果中包含“未定义”", "Index_signature_in_type_0_only_permits_reading_2542": "类型“{0}”中的索引签名仅允许读取。", "Index_signature_is_missing_in_type_0_2329": "类型“{0}”中缺少索引签名。", "Index_signatures_are_incompatible_2330": "索引签名不兼容。", @@ -694,7 +687,6 @@ "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "\"jsxFactory\" 的值无效。“{0}”不是有效的标识符或限定名称。", "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": "\"jsxFragmentFactory\" 的值无效。“{0}”不是有效的标识符或限定名称。", "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "\"--reactNamespace\" 的值无效。“{0}”不是有效的标识符。", - "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": "很可能缺少了分隔这两个模板表达式的逗号。它们构成了无法调用的带标记的模板表达式。", "Its_element_type_0_is_not_a_valid_JSX_element_2789": "其元素类型 \"{0}\" 不是有效的 JSX 元素。", "Its_instance_type_0_is_not_a_valid_JSX_element_2788": "其实例类型 \"{0}\" 不是有效的 JSX 元素。", "Its_return_type_0_is_not_a_valid_JSX_element_2787": "其返回类型 \"{0}\" 不是有效的 JSX 元素。", @@ -737,7 +729,7 @@ "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095": "正在将模块作为文件/文件夹进行加载,候选模块位置“{0}”,目标文件类型“{1}”。", "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048": "区域设置必须采用 <语言> 或 <语言>-<区域> 形式。例如“{0}”或“{1}”。", "Longest_matching_prefix_for_0_is_1_6108": "“{0}”的最长匹配前缀为“{1}”。", - "Looking_up_in_node_modules_folder_initial_location_0_6125": "正在 \"node_modules\" 文件夹中查找,初始位置为“{0}”。", + "Looking_up_in_node_modules_folder_initial_location_0_6125": "正在在 \"node_modules\" 文件夹中查找,初始位置“{0}”。", "Make_all_super_calls_the_first_statement_in_their_constructor_95036": "让所有 \"super()\" 调用成为构造函数中的第一个语句", "Make_super_call_the_first_statement_in_the_constructor_90002": "在构造函数中,使 \"super()\" 调用第一个语句", "Mapped_object_type_implicitly_has_an_any_template_type_7039": "映射的对象类型隐式地含有 \"any\" 模板类型。", @@ -750,7 +742,7 @@ "Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101": "导出接口的方法“{0}”具有或正在使用私有模块“{2}”中的名称“{1}”。", "Method_0_of_exported_interface_has_or_is_using_private_name_1_4102": "导出接口的方法“{0}”具有或正在使用专用名称“{1}”。", "Modifiers_cannot_appear_here_1184": "修饰符不能出现在此处。", - "Module_0_can_only_be_default_imported_using_the_1_flag_1259": "模块 \"{0}\" 只能在使用 \"{1}\" 标志时进行默认导入", + "Module_0_can_only_be_default_imported_using_the_1_flag_1259": "模块 \"{0}\" 只能使用 \"{1}\" 标志进行默认导入", "Module_0_declares_1_locally_but_it_is_exported_as_2_2460": "模块 \"{0}\" 在本地声明 \"{1}\",但它被导出为 \"{2}\"。", "Module_0_declares_1_locally_but_it_is_not_exported_2459": "模块 \"{0}\" 在本地声明 \"{1}\",但未导出它。", "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340": "模块 \"{0}\" 不引用类型,但在此处用作类型。你是想使用 \"typeof import('{0}')\" 吗?", @@ -759,6 +751,7 @@ "Module_0_has_no_default_export_1192": "模块“{0}”没有默认导出。", "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": "模块 \"{0}\" 没有默认导出。你是想改为使用 \"import { {1} } from {0}\" 吗?", "Module_0_has_no_exported_member_1_2305": "模块“{0}”没有导出的成员“{1}”。", + "Module_0_has_no_exported_member_1_Did_you_mean_2_2724": "模块“{0}”没有导出的成员“{1}”。你是否指的是“{2}”?", "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": "模块 \"{0}\" 没有导出的成员 \"{1}\"。你是想改用 \"import {1} from {0}\" 吗?", "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": "模块“{0}”被具有相同名称的局部声明隐藏。", "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "模块“{0}”使用 \"export =\" 且无法与 \"export *\" 一起使用。", @@ -794,7 +787,6 @@ "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": "非抽象类“{0}”不会实现继承自“{2}”类的抽象成员“{1}”。", "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "非抽象类表达式不会实现继承自“{1}”类的抽象成员“{0}”。", "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": "非 null 断言只能在 TypeScript 文件中使用。", - "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090": "未设置 \"baseUrl\" 时,不允许使用非相对路径。是否忘记了前导 \"./\"?", "Non_simple_parameter_declared_here_1348": "此处声明了非简单参数。", "Not_all_code_paths_return_a_value_7030": "并非所有代码路径都返回值。", "Not_all_constituents_of_type_0_are_callable_2756": "\"{0}\" 类型的部分要素不可调用。", @@ -830,7 +822,6 @@ "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "选项“{0}”只能在 \"tsconfig.json\" 文件中指定,或者在命令行上设置为 \"false\" 或 \"null\"。", "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "选项“{0}”只能在 \"tsconfig.json\" 文件中指定或在命令行上设置为 \"null\"。", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "仅当提供了选项 \"--inlineSourceMap\" 或选项 \"--sourceMap\" 时,才能使用选项“{0}”。", - "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": "选项 \"jsx\" 为“{1}”时,不能指定选项“{0}”。", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "选项 \"target\" 为 \"ES3\" 时,不能指定选项 \"{0}\"。", "Option_0_cannot_be_specified_with_option_1_5053": "选项“{0}”不能与选项“{1}”同时指定。", "Option_0_cannot_be_specified_without_specifying_option_1_5052": "无法在不指定选项“{1}”的情况下指定选项“{0}”。", @@ -839,6 +830,7 @@ "Option_build_must_be_the_first_command_line_argument_6369": "选项 '--build' 必须是第一个命令行参数。", "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": "选项 \"--incremental\" 只能使用 tsconfig 指定,在发出到单个文件时指定,或在指定了选项 \"--tsBuildInfoFile\" 时指定。", "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "选项 \"isolatedModules\" 只可在提供了选项 \"--module\" 或者选项 \"target\" 是 \"ES2015\" 或更高版本时使用。", + "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "在未指定 \"--baseUrl\" 选项的情况下,无法使用选项 \"paths\"。", "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "选项 \"project\" 在命令行上不能与源文件混合使用。", "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071": "仅当模块代码生成为 \"commonjs\"、\"amd\"、\"es2015\" 或 \"esNext\" 时,才能指定选项 \"--resolveJsonModule\"。", "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "在没有 \"node\" 模块解析策略的情况下,无法指定选项 \"-resolveJsonModule\"。", @@ -891,7 +883,6 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "导出类中的公共静态 setter“{0}”的参数类型具有或正在使用专用名称“{1}”。", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "以严格模式进行分析,并为每个源文件发出 \"use strict\" 指令。", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "模式“{0}”最多只可具有一个 \"*\" 字符。", - "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": "\"--diagnostics\" 或 \"--extendedDiagnostics\" 的性能计时在此会话中不可用。未能找到 Web 性能 API 的本机实现。", "Prefix_0_with_an_underscore_90025": "带下划线的前缀“{0}”", "Prefix_all_incorrect_property_declarations_with_declare_95095": "使用 \"declare\" 作为所有错误的属性声明的前缀", "Prefix_all_unused_declarations_with_where_possible_95025": "尽可能在所有未使用的声明前添加前缀 \"_\"", @@ -905,7 +896,7 @@ "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "不允许在变量声明中使用专用标识符。", "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "不允许在类主体之外使用专用标识符。", "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "专用标识符仅在面向 ECMAScript 2015 和更高版本时可用。", - "Private_identifiers_cannot_be_used_as_parameters_18009": "不能将专用标识符用作参数。", + "Private_identifiers_cannot_be_used_as_parameters_18009": "不能将专用标识符用作参数", "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "不能在类型参数上访问专用或受保护的成员 \"{0}\"。", "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "无法生成项目“{0}”,因为其依赖项“{1}”有错误", "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383": "无法生成项目 \"{0}\" ,因为未生成其依赖项 \"{1}\"", @@ -923,7 +914,6 @@ "Property_0_does_not_exist_on_const_enum_1_2479": "\"const\" 枚举“{1}”上不存在属性“{0}”。", "Property_0_does_not_exist_on_type_1_2339": "类型“{1}”上不存在属性“{0}”。", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "属性“{0}”在类型“{1}”上不存在。你是否指的是“{2}”?", - "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": "在“{1}”上没有“{0}”属性。是否需要更改目标库? 请尝试将 `lib` 编译器选项更改为 {2} 或更高版本。", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "属性“{0}”没有初始化表达式,且未在构造函数中明确赋值。", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "属性“{0}”隐式具有类型 \"any\",因为其 get 访问器缺少返回类型批注。", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "属性“{0}”隐式具有类型 \"any\",因为其 set 访问器缺少参数类型批注。", @@ -932,7 +922,7 @@ "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "类型“{1}”中的属性“{0}”不可分配给基类型“{2}”中的同一属性。", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "类型“{1}”中的属性“{0}”不可分配给类型“{2}”。", "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015": "类型 \"{1}\" 中的属性 \"{0}\" 引用了不能从类型 \"{2}\" 内访问的其他成员。", - "Property_0_is_a_static_member_of_type_1_2576": "属性“{0}”不是类型为“{1}”的静态成员。", + "Property_0_is_a_static_member_of_type_1_2576": "属性 \"{0}\" 不是类型为 \"{1}\" 的静态成员", "Property_0_is_declared_but_its_value_is_never_read_6138": "已声明属性“{0}”,但从未读取其值。", "Property_0_is_incompatible_with_index_signature_2530": "属性“{0}”与索引签名不兼容。", "Property_0_is_incompatible_with_rest_element_type_2573": "属性 \"{0}\" 与 rest 元素类型不兼容。", @@ -961,7 +951,6 @@ "Property_or_signature_expected_1131": "应为属性或签名。", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "属性值只能是字符串文本、数字文本、\"true\"、\"false\"、\"null\"、对象文字或数组文本。", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "以 \"ES5\" 或 \"ES3\" 设为目标时,对 \"for-of\"、传播和析构中的可迭代项提供完全支持。", - "Provides_a_root_package_name_when_using_outFile_with_declarations_1390": "将 outFile 用于声明时提供根包名称。", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "导出类的公共方法“{0}”具有或正在使用外部模块“{2}”中的名称“{1}”,但不能为其命名。", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "导出类的公共方法“{0}”具有或正在使用私有模块“{2}”中的名称“{1}”。", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "导出类的公共方法“{0}”具有或正在使用专用名称“{1}”。", @@ -1088,7 +1077,6 @@ "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "指定发出文件时要使用的行序列结尾: \"CRLF\" (dos)或 \"LF\" (unix)。", "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": "指定调试调试程序应将 TypeScript 文件放置到的位置而不是源位置。", "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "指定调试程序应将映射文件放置到的位置而不是生成的位置。", - "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": "指定要用于从 react 等内容中导入 \"jsx\" 和 \"jsxs\" 工厂函数的模块说明符", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "指定输入文件的根目录。与 --outDir 一起用于控制输出目录结构。", "Split_all_invalid_type_only_imports_1367": "拆分所有无效的仅类型导入", "Split_into_two_separate_import_declarations_1366": "拆分为两个单独的导入声明", @@ -1130,8 +1118,6 @@ "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496": "ES3 和 ES5 中的箭头函数不能引用 \"arguments\" 对象。请考虑使用标准函数表达式。", "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "ES3 和 ES5 中的异步函数或方法不能引用“参数”对象。请考虑使用标准函数或方法。", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "\"if\" 语句的正文不能为空语句。", - "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391": "在将 outFile 和节点模块解析与声明发出一起使用时,必须提供 \"bundledPackageName\" 选项。", - "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": "针对此实现的调用已成功,但重载的实现签名在外部不可见。", "The_character_set_of_the_input_files_6163": "输入文件的字符集。", "The_containing_arrow_function_captures_the_global_value_of_this_7041": "包含箭头函数捕获 \"this\" 的全局值。", "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "包含函数或模块体对于控制流分析而言太大。", @@ -1150,10 +1136,8 @@ "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "如果没有引用 \"{1}\",则无法命名 \"{0}\" 的推断类型。这很可能不可移植。需要类型注释。", "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "推断类型“{0}”引用的类型具有无法简单序列化的循环结构。必须具有类型注释。", "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "“{0}”的推断类型引用不可访问的“{1}”类型。需要类型批注。", - "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": "此节点的推断类型超出编译器将序列化的最大长度。需要显式类型注释。", "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": "由于属性“{1}”存在于多个要素中,但在某些要素中是专用属性,因此已将交集“{0}”缩减为“绝不”。", "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": "由于属性“{1}”在某些要素中具有存在冲突的类型,因此已将交集“{0}”缩减为“绝不”。", - "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": "\"intrinsic\" 关键字只能用于声明编译器提供的内部类型。", "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": "必须提供 \"jsxFragmentFactory\" 编译器选项才能将 JSX 片段与 \"jsxFactory\" 编译器选项一起使用。", "The_last_overload_gave_the_following_error_2770": "最后一个重载给出了以下错误。", "The_last_overload_is_declared_here_2771": "在此处声明最后一个重载。", @@ -1220,7 +1204,7 @@ "This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233": "这是正在扩充的声明。请考虑将扩充声明移到同一个文件中。", "This_may_be_converted_to_an_async_function_80006": "可将此转换为异步函数。", "This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497": "只能通过启用 \"{0}\" 标志并引用其默认导出,使用 ECMAScript 导入/导出来引用此模块。", - "This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594": "此模块是使用 \"export =\" 声明的,只能在使用 \"{0}\" 标志时进行默认导入。", + "This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594": "此模块是使用 \"export =\" 声明的,在使用 \"{0}\" 标志时只能与默认导入一起使用。", "This_overload_signature_is_not_compatible_with_its_implementation_signature_2394": "此重载签名与其实现签名不兼容。", "This_parameter_is_not_allowed_with_use_strict_directive_1346": "此参数不允许与 \"use strict\" 指令一起使用。", "This_spread_always_overwrites_this_property_2785": "此扩张将始终覆盖此属性。", @@ -1230,7 +1214,7 @@ "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts 文件中的顶级声明必须以 \"declare\" 或 \"export\" 修饰符开头。", "Trailing_comma_not_allowed_1009": "不允许使用尾随逗号。", "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "将每个文件转换为单独的模块(类似 \"ts.transpileModule\")。", - "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "尝试使用 `npm i --save-dev @types/{1}` (如果存在),或者添加一个包含 `declare module '{0}';` 的新声明(.d.ts)文件", + "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035": "尝试 `npm install @types/{1}` (如果存在),或者添加一个包含 `declare module '{0}';` 的新声明(.d.ts)文件", "Trying_other_entries_in_rootDirs_6110": "正在尝试 \"rootDirs\" 中的其他条目。", "Trying_substitution_0_candidate_module_location_Colon_1_6093": "正在尝试替换“{0}”,候选模块位置:“{1}”。", "Tuple_members_must_all_have_names_or_all_not_have_names_5084": "元组成员必须全部具有或全部不具有名称。", @@ -1305,7 +1289,6 @@ "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": "======== 类型引用指令“{0}”已成功解析为“{1}”,主要: {2}。========", "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": "======== 类型引用指令 \"{0}\" 已成功解析为 \"{1}\" ,包 ID 为 \"{2}\",主要: {3}。========", "Types_have_separate_declarations_of_a_private_property_0_2442": "类型具有私有属性“{0}”的单独声明。", - "Types_of_construct_signatures_are_incompatible_2419": "构造签名的类型不兼容。", "Types_of_parameters_0_and_1_are_incompatible_2328": "参数“{0}”和“{1}” 的类型不兼容。", "Types_of_property_0_are_incompatible_2326": "属性“{0}”的类型不兼容。", "Unable_to_open_file_0_6050": "无法打开文件“{0}”。", @@ -1378,7 +1361,6 @@ "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": "只能使用 \"require\" 调用或使用默认导入来导入“{0}”。", "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": "仅可使用 \"import {1} = require({2})\" 或默认导入来导入“{0}”。", "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": "仅可使用 \"import {1} = require({2})\" 或通过启用 \"esModuleInterop\" 标志并使用默认导入来导入“{0}”。", - "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208": "无法在 \"--isolatedModules\" 下编译“{0}”,因为它被视为全局脚本文件。请添加导入、导出或空的 \"export {}\" 语句来使它成为模块。", "_0_cannot_be_used_as_a_JSX_component_2786": "“{0}”不能用作 JSX 组件。", "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": "\"{0}\" 是使用 \"export type\" 导出的,因此不能用作值。", "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": "\"{0}\" 是使用 \"import type\" 导入的,因此不能用作值。", @@ -1386,7 +1368,6 @@ "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": "“{0}”可以使用与“{1}”无关的任意类型进行实例化。", "_0_declarations_can_only_be_used_in_TypeScript_files_8006": "\"{0}\" 声明只能在 TypeScript 文件中使用。", "_0_expected_1005": "应为“{0}”。", - "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": "“{0}”没有导出的成员“{1}”。你是否指的是“{2}”?", "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": "\"{0}\" 隐式具有 \"{1}\" 返回类型,但可以从用法中推断出更好的类型。", "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": "由于“{0}'”不具有返回类型批注并且在它的一个返回表达式中得到直接或间接引用,因此它隐式具有返回类型 \"any\"。", "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": "“{0}”隐式具有类型 \"any\",因为它不具有类型批注,且在其自身的初始化表达式中得到直接或间接引用。", @@ -1399,29 +1380,27 @@ "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "\"{0}\" 在类 \"{1}\" 中定义为访问器,但这里在 \"{2}\" 中重写为实例属性。", "_0_is_deprecated_6385": "“{0}”已被弃用", "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "“{0}”不是关键字“{1}”的有效元属性。是否是指“{2}”?", - "_0_is_not_allowed_as_a_variable_declaration_name_1389": "“{0}”不得用作变量声明名称。", "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "“{0}”在其自身的基表达式中得到直接或间接引用。", "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "“{0}”在其自身的类型批注中得到直接或间接引用。", "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": "多次指定了 \"{0}\",因此将重写此用法。", "_0_list_cannot_be_empty_1097": "“{0}”列表不能为空。", "_0_modifier_already_seen_1030": "已看到“{0}”修饰符。", + "_0_modifier_cannot_appear_on_a_class_element_1031": "“{0}”修饰符不能出现在类元素上。", "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": "“{0}”修饰符不能出现在构造函数声明中。", "_0_modifier_cannot_appear_on_a_data_property_1043": "“{0}”修饰符不能出现在数据属性上。", "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": "“{0}”修饰符不可出现在模块或命名空间元素上。", "_0_modifier_cannot_appear_on_a_parameter_1090": "“{0}”修饰符不能出现在参数中。", "_0_modifier_cannot_appear_on_a_type_member_1070": "“{0}”修饰符不可出现在类型成员上。", "_0_modifier_cannot_appear_on_an_index_signature_1071": "“{0}”修饰符不可出现在索引签名上。", - "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": "“{0}”修饰符不能出现在此类型的类元素上。", "_0_modifier_cannot_be_used_here_1042": "“{0}”修饰符不能在此处使用。", "_0_modifier_cannot_be_used_in_an_ambient_context_1040": "“{0}”修饰符不能在环境上下文中使用。", "_0_modifier_cannot_be_used_with_1_modifier_1243": "“{0}”修饰符不能与“{1}”修饰符一起使用。", "_0_modifier_cannot_be_used_with_a_class_declaration_1041": "“{0}”修饰符不能与类声明一起使用。", - "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "“{0}”修饰符不能与专用标识符一起使用。", + "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "\"{0}\" 修饰符不能与专用标识符一起使用。", "_0_modifier_must_precede_1_modifier_1029": "“{0}”修饰符必须位于“{1}”修饰符之前。", "_0_needs_an_explicit_type_annotation_2782": "\"{0}\" 需要显式类型注释。", "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": "“{0}”仅指类型,但在此用作命名空间。", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "“{0}”仅表示类型,但在此处却作为值使用。", - "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": "“{0}”仅引用一个类型,但在此处用作一个值。你是否想要使用“{0} 中的 {1}”?", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "\"{0}\" 仅指类型,但在此处用作值。是否需要更改目标库?请尝试将 `lib` 编译器选项更改为 es2015 或更高版本。", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "“{0}”指 UMD 全局,但当前文件是模块。请考虑改为添加导入。", "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "“{0}”表示值,但在此处用作类型。是否指“类型 {0}”?", diff --git a/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json b/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json index 7663d9c..d96a243 100644 --- a/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +++ b/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json @@ -151,8 +151,6 @@ "Add_undefined_type_to_property_0_95018": "將 'undefined' 類型新增至屬性 '{0}'", "Add_unknown_conversion_for_non_overlapping_types_95069": "新增非重疊類型的 'unknown' 轉換", "Add_unknown_to_all_conversions_of_non_overlapping_types_95070": "將 'unknown' 新增至非重疊類型的所有轉換", - "Add_void_to_Promise_resolved_without_a_value_95143": "為已經解析但不具值的 Promise 新增 'void'", - "Add_void_to_all_Promises_resolved_without_a_value_95144": "為已經解析但不具值的所有 Promise 新增 'void'", "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "新增 tsconfig.json 檔案有助於組織同時包含 TypeScript 及 JavaScript 檔案的專案。若要深入了解,請前往 https://aka.ms/tsconfig。", "Additional_Checks_6176": "其他檢查", "Advanced_Options_6178": "進階選項", @@ -160,8 +158,9 @@ "All_declarations_of_0_must_have_identical_type_parameters_2428": "'{0}' 的所有宣告都必須具有相同的類型參數。", "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "抽象方法的所有宣告必須連續。", "All_destructured_elements_are_unused_6198": "不會使用所有未經結構化的項目。", + "All_files_must_be_modules_when_the_isolatedModules_flag_is_provided_1208": "當提供 '--isolatedModules' 旗標時,所有檔案都必須為模組。", "All_imports_in_import_declaration_are_unused_6192": "匯入宣告中的所有匯入皆未使用。", - "All_type_parameters_are_unused_6205": "未使用任何型別參數。", + "All_type_parameters_are_unused_6205": "所有型別參數皆未使用", "All_variables_are_unused_6199": "所有變數都未使用。", "Allow_accessing_UMD_globals_from_modules_95076": "允許從模組存取 UMD 全域。", "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "允許從沒有預設匯出的模組進行預設匯入。這不會影響程式碼發出,僅為類型檢查。", @@ -193,7 +192,7 @@ "An_export_assignment_cannot_have_modifiers_1120": "匯出指派不得有修飾元。", "An_export_declaration_can_only_be_used_in_a_module_1233": "匯出宣告只可用於模組中。", "An_export_declaration_cannot_have_modifiers_1193": "匯出宣告不得有修飾元。", - "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "無法對 'void' 類型的運算式測試真實性。", + "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345": "無法對 'void' 類型的運算式測試真實性", "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198": "擴充的 Unicode 逸出值必須介於 0x0 與 0x10FFFF (不含) 之間。", "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351": "識別碼或關鍵字不可直接接在數字常值後面。", "An_implementation_cannot_be_declared_in_ambient_contexts_1183": "不得在環境內容中宣告實作。", @@ -235,7 +234,6 @@ "Argument_expression_expected_1135": "必須是引數運算式。", "Argument_for_0_option_must_be_Colon_1_6046": "'{0}' 選項的引數必須是: {1}。", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "類型 '{0}' 的引數不可指派給類型 '{1}' 的參數。", - "Arguments_for_the_rest_parameter_0_were_not_provided_6236": "未提供其餘參數 '{0}' 的引數。", "Array_element_destructuring_pattern_expected_1181": "必須是陣列項目解構模式。", "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775": "判斷提示要求必須以明確的型別註解宣告呼叫目標中的每個名稱。", "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776": "判斷提示要求呼叫目標必須為識別碼或限定名稱。", @@ -261,7 +259,6 @@ "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "缺少傳回型別註解的呼叫簽章隱含了 'any' 傳回型別。", "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204": "無引數呼叫簽章的傳回型別 '{0}' 與 '{1}' 不相容。", "Call_target_does_not_contain_any_signatures_2346": "呼叫目標未包含任何特徵標記。", - "Can_only_convert_logical_AND_access_chains_95142": "只可轉換邏輯 AND 存取鏈結", "Can_only_convert_property_with_modifier_95137": "只能轉換具有修飾元的屬性", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "因為 '{0}' 是類型而非命名空間,所以無法存取 '{0}.{1}'。您要在 '{0}' 中使用 '{0}[\"{1}\"]' 擷取屬性 '{1}' 的類型嗎?", "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748": "當提供 '--isolatedModules' 旗標時,則無法存取環境常數列舉。", @@ -284,21 +281,20 @@ "Cannot_find_global_value_0_2468": "找不到全域值 '{0}'。", "Cannot_find_lib_definition_for_0_2726": "找不到 '{0}' 的程式庫定義。", "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727": "找不到 '{0}' 的程式庫定義。您是指 '{1}' 嗎?", - "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "找不到模組 '{0}'。建議使用 '--resolveJsonModule',匯入副檔名為 '.json' 的模組。", - "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792": "找不到模組 '{0}'。您是要將 'moduleResolution' 選項設為 'node',或是要將別名新增至 'paths' 選項嗎?", + "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "找不到模組 '{0}'。請考慮使用 '--resolveJsonModule' 以匯入副檔名為 '.json' 的模組", "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "找不到模組 '{0}' 或其對應的型別宣告。", "Cannot_find_name_0_2304": "找不到名稱 '{0}'。", "Cannot_find_name_0_Did_you_mean_1_2552": "找不到名稱 '{0}'。您指的是 '{1}' 嗎?", "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "找不到名稱 '{0}'。您要找的是此執行個體成員 'this.{0}' 嗎?", "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662": "找不到名稱 '{0}'。您要找的是此靜態成員 '{1}.{0}' 嗎?", - "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "找不到名稱 '{0}'。要變更您的目標程式庫嗎? 請嘗試將 'lib' 編譯器選項變更為 '{1}' 或更新版本。", + "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583": "找不到名稱 '{0}'。需要變更您的目標程式庫嗎? 請嘗試將 `lib` 編譯器選項變更為 es2015 或更新版本。", "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584": "找不到名稱 '{0}'。需要變更您的目標程式庫嗎? 請嘗試將 `lib` 編譯器選項變更為包含 'dom'。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582": "找不到名稱 '{0}'。需要安裝測試執行器的型別定義嗎? 請嘗試 `npm i --save-dev @types/jest` 或 `npm i --save-dev @types/mocha`。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593": "找不到名稱 '{0}'。需要安裝測試執行器的型別定義嗎? 請嘗試 `npm i --save-dev @types/jest` 或 `npm i --save-dev @types/mocha`,然後將 `jest` 或 `mocha` 新增至 tsconfig 中的型別欄位。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581": "找不到名稱 '{0}'。需要安裝 jQuery 的型別定義嗎? 請嘗試 `npm i --save-dev @types/jquery`。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592": "找不到名稱 '{0}'。需要安裝 jQuery 的型別定義嗎? 請嘗試 `npm i --save-dev @types/jquery`,然後將 `jquery` 新增至 tsconfig 中的型別欄位。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580": "找不到名稱 '{0}'。需要安裝節點的型別定義嗎? 請嘗試 `npm i --save-dev @types/node`。", - "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591": "找不到名稱 '{0}'。需要安裝節點的型別定義嗎? 請嘗試 `npm i --save-dev @types/node`,然後將 `node` 新增至 tsconfig 中的型別欄位。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582": "找不到名稱 '{0}'。需要安裝測試執行器的類型定義嗎? 請嘗試 `npm i @types/jest` 或 `npm i @types/mocha`。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593": "找不到名稱 '{0}'。需要安裝測試執行器的類型定義嗎? 請嘗試 `npm i @types/jest` 或 `npm i @types/mocha`,然後將 `jest` 或 `mocha` 新增至 tsconfig 中的類型欄位。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581": "找不到名稱 '{0}'。需要安裝 jQuery 的類型定義嗎? 請嘗試 `npm i @types/jquery`。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592": "找不到名稱 '{0}'。您需要安裝 jQuery 的類型定義嗎? 請嘗試 `npm i @types/jquery`,然後將 `jquery` 新增至 tsconfig 中的類型欄位。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580": "找不到名稱 '{0}'。需要安裝節點的類型定義嗎? 請嘗試 `npm i @types/node`。", + "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591": "找不到名稱 '{0}'。需要安裝節點的類型定義嗎? 請嘗試 `npm i @types/node`,然後將 `node` 新增至 tsconfig 中的類型欄位。", "Cannot_find_namespace_0_2503": "找不到命名空間 '{0}'。", "Cannot_find_parameter_0_1225": "找不到參數 '{0}'。", "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009": "找不到輸入檔的一般子目錄路徑。", @@ -369,13 +365,10 @@ "Constructor_implementation_is_missing_2390": "缺少建構函式實作。", "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673": "類別 '{0}' 的建構函式為私用,並且只能在類別宣告內存取。", "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674": "類別 '{0}' 的建構函式受到保護,並且只能在類別宣告內存取。", - "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386": "在等位型別中使用建構函式類型標記法時,必須括以括弧。", - "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388": "在交集型別中使用建構函式類型標記法時,必須括以括弧。", "Constructors_for_derived_classes_must_contain_a_super_call_2377": "衍生類別的建構函式必須包含 'super' 呼叫。", "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "未指定包含檔案,因此無法決定根目錄,而將略過 'node_modules' 中的查閱。", "Containing_function_is_not_an_arrow_function_95128": "內含函式不是箭頭函式", "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352": "將類型 '{0}' 轉換為類型 '{1}' 可能會發生錯誤,原因是這兩個類型彼此並未充分重疊。如果是故意轉換的,請先將運算式轉換為 'unknown'。", - "Convert_0_to_1_in_0_95003": "將 '{0}' 轉換成 '{1} in {0}'", "Convert_0_to_mapped_object_type_95055": "將 '{0}' 轉換為對應的物件類型", "Convert_all_constructor_functions_to_classes_95045": "將所有建構函式轉換為類別", "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374": "將所有未作為值使用的匯入轉換為僅限類型的匯入", @@ -385,7 +378,6 @@ "Convert_all_to_async_functions_95066": "全部轉換為非同步函式", "Convert_all_to_bigint_numeric_literals_95092": "全部轉換為 Bigint 數字常值", "Convert_all_to_default_imports_95035": "全部轉換為預設匯入", - "Convert_all_type_literals_to_mapped_type_95021": "將所有類型常值轉換成相對應的類型", "Convert_arrow_function_or_function_expression_95122": "轉換箭頭函式或函式運算式", "Convert_const_to_let_95093": "將 'const' 轉換為 'let'", "Convert_default_export_to_named_export_95061": "將預設匯出轉換為具名匯出", @@ -407,17 +399,14 @@ "Convert_to_async_function_95065": "轉換為非同步函式", "Convert_to_default_import_95013": "轉換為預設匯入", "Convert_to_named_function_95124": "轉換為具名函式", - "Convert_to_optional_chain_expression_95139": "轉換為選擇性鏈結運算式", "Convert_to_template_string_95096": "轉換為範本字串", "Convert_to_type_only_export_1364": "轉換為僅限類型的匯出", "Convert_to_type_only_import_1373": "轉換為僅限類型的匯入", "Corrupted_locale_file_0_6051": "地區設定檔 {0} 已損毀。", "Could_not_find_a_containing_arrow_function_95127": "找不到內含箭頭函式", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "找不到模組 '{0}' 的宣告檔案。'{1}' 隱含具有 'any' 類型。", - "Could_not_find_convertible_access_expression_95140": "找不到可轉換的存取運算式", "Could_not_find_export_statement_95129": "找不到匯出陳述式", "Could_not_find_import_clause_95131": "找不到匯入子句", - "Could_not_find_matching_access_expressions_95141": "找不到相符的存取運算式", "Could_not_find_namespace_import_or_named_imports_95132": "找不到命名空間匯入或具名匯入", "Could_not_find_property_for_which_to_generate_accessor_95135": "找不到要為其產生存取子的屬性", "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231": "無法解析具有下列延伸模組的路徑 '{0}': {1}。", @@ -429,8 +418,6 @@ "Declaration_expected_1146": "必須是宣告。", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "宣告名稱與內建全域識別碼 '{0}' 衝突。", "Declaration_or_statement_expected_1128": "必須是宣告或陳述式。", - "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264": "包含明確指派判斷提示的宣告也必須包含類型註釋。", - "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263": "包含初始設定式的宣告不得同時包含明確指派判斷提示。", "Declare_a_private_field_named_0_90053": "宣告名為 '{0}' 的私人欄位。", "Declare_method_0_90023": "宣告方法 '{0}'", "Declare_private_method_0_90038": "宣告私人方法 '{0}'", @@ -441,6 +428,7 @@ "Decorators_are_not_valid_here_1206": "裝飾項目在此處無效。", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "無法將裝飾項目套用至多個同名的 get/set 存取子。", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "模組的預設匯出具有或正在使用私用名稱 '{0}'。", + "Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258": "明確的指派判斷提示只可搭配型別註解使用。", "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200": "下列識別碼的定義與其他檔案中的定義衝突: {0}", "Delete_all_unused_declarations_95024": "刪除所有未使用的宣告", "Delete_the_outputs_of_all_projects_6365": "刪除所有專案的輸出", @@ -458,7 +446,6 @@ "Digit_expected_1124": "必須是數字。", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "目錄 '{0}' 不存在,將會跳過其中所有查閱。", "Disable_checking_for_this_file_90018": "停用此檔案的檢查", - "Disable_loading_referenced_projects_6235": "停用載入參考的專案。", "Disable_size_limitations_on_JavaScript_projects_6162": "停用 JavaScript 專案的大小限制。", "Disable_solution_searching_for_this_project_6224": "停用此專案的解決方案搜尋。", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "停用函式類型中一般簽章的 Strict 檢查。", @@ -490,7 +477,7 @@ "Duplicate_number_index_signature_2375": "數字索引簽章重複。", "Duplicate_property_0_2718": "屬性 '{0}' 重複。", "Duplicate_string_index_signature_2374": "字串索引簽章重複。", - "Dynamic_import_cannot_have_type_arguments_1326": "動態匯入不可有型別引數。", + "Dynamic_import_cannot_have_type_arguments_1326": "動態匯入不能有型別引數", "Dynamic_import_must_have_one_specifier_as_an_argument_1324": "動態匯入必須有一個指定名稱作為引數。", "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "動態匯入的指定名稱必須屬於類型 'string',但這裡的類型為 '{0}'。", "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_esnext_commonjs_amd_system__1323": "只有在 '--module' 旗標設定為 'es2020'、'esnext'、'commonjs'、'amd'、'system' 或 'umd' 時,才支援動態匯入。", @@ -532,7 +519,6 @@ "Excessive_stack_depth_comparing_types_0_and_1_2321": "比較類型 '{0}' 與 '{1}' 的堆疊深度過深。", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "必須是 {0}-{1} 型別引數; 請提供有 '@ extends' 標記的這類型引數。", "Expected_0_arguments_but_got_1_2554": "應有 {0} 個引數,但得到 {1} 個。", - "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794": "應為 {0} 個引數,但現有 {1} 個。是否忘記將型別引數中的 'void' 納入 'Promise' 中?", "Expected_0_arguments_but_got_1_or_more_2556": "應有 {0} 個引數,但得到 {1} 個或更多。", "Expected_0_type_arguments_but_got_1_2558": "應有 {0} 個型別引數,但得到 {1} 個。", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "必須是 {0} 型別引數; 請提供有 '@ extends' 標記的這類引數。", @@ -610,14 +596,11 @@ "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366": "函式缺少結束 return 陳述式,且傳回類型不包括 'undefined'。", "Function_overload_must_be_static_2387": "函式多載必須為靜態。", "Function_overload_must_not_be_static_2388": "函式多載不可為靜態。", - "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385": "在等位型別中使用函式類型標記法時,必須括以括弧。", - "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387": "在交集型別中使用函式類型標記法時,必須括以括弧。", "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014": "缺少傳回型別註解的函式類型隱含 '{0}' 傳回型別。", "Generate_get_and_set_accessors_95046": "產生 'get' 與 'set' 存取子", "Generate_get_and_set_accessors_for_all_overriding_properties_95119": "為所有覆寫屬性產生 'get' 和 'set' 存取子", "Generates_a_CPU_profile_6223": "產生 CPU 設定檔。", "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000": "為每個相對應的 '.d.ts' 檔案產生 sourcemap。", - "Generates_an_event_trace_and_a_list_of_types_6237": "產生事件追蹤與類型清單。", "Generates_corresponding_d_ts_file_6002": "產生對應的 '.d.ts' 檔案。", "Generates_corresponding_map_file_6043": "產生對應的 '.map' 檔案。", "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025": "因為產生器未產生任何值,所以其隱含產生類型 '{0}'。請考慮提供傳回型別註解。", @@ -662,7 +645,6 @@ "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "在環境列舉宣告中,成員初始設定式必須是常數運算式。", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "在具有多個宣告的列舉中,只有一個宣告可以在其第一個列舉項目中省略初始設定式。", "Include_modules_imported_with_json_extension_6197": "包含匯入有 '.json' 延伸模組的模組", - "Include_undefined_in_index_signature_results_6800": "在索引簽章結果中包含 'undefined'", "Index_signature_in_type_0_only_permits_reading_2542": "類型 '{0}' 中的索引簽章只允許讀取。", "Index_signature_is_missing_in_type_0_2329": "類型 '{0}' 中遺漏索引簽章。", "Index_signatures_are_incompatible_2330": "索引簽章不相容。", @@ -694,7 +676,6 @@ "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "'jsxFactory' 的值無效。'{0}' 不是有效的識別碼或限定名稱。", "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035": "'jsxFragmentFactory' 的值無效。'{0}' 不是有效的識別碼或限定名稱。", "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "'--reactNamespace' 的值無效。'{0}' 不是有效的識別碼。", - "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796": "可能是未使用逗號分隔這兩個範本運算式,因而形成了附加標籤的範本運算式,導致無法叫用。", "Its_element_type_0_is_not_a_valid_JSX_element_2789": "其元素類型 '{0}' 不是有效的 JSX 元素。", "Its_instance_type_0_is_not_a_valid_JSX_element_2788": "其執行個體類型 '{0}' 不是有效的 JSX 元素。", "Its_return_type_0_is_not_a_valid_JSX_element_2787": "其傳回型別 '{0}' 不是有效的 JSX 元素。", @@ -759,6 +740,7 @@ "Module_0_has_no_default_export_1192": "模組 '{0}' 沒有預設匯出。", "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613": "模組 '{0}' 沒有預設匯出。您是要改用 'import { {1} } from {0}' 嗎?", "Module_0_has_no_exported_member_1_2305": "模組 '{0}' 沒有匯出的成員 '{1}'。", + "Module_0_has_no_exported_member_1_Did_you_mean_2_2724": "模組 '{0}' 沒有任何匯出的成員 '{1}'。您是否指的是 '{2}'?", "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614": "模組 '{0}' 沒有匯出的成員 '{1}'。您是要改用 'import {1} from {0}' 嗎?", "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437": "同名的區域宣告隱藏了模組 '{0}'。", "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "模組 '{0}' 使用 'export =',因而無法以 'export *' 的方式使用。", @@ -794,7 +776,6 @@ "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515": "非抽象類別 '{0}' 未實作從類別 '{2}' 繼承而來的抽象成員 '{1}'。", "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "非抽象類別運算式未實作從類別 '{1}' 繼承而來的抽象成員 '{0}'。", "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013": "非 Null 的判斷提示只可用於 TypeScript 檔案中。", - "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090": "未設定 'baseUrl' 時,不得使用非相對路徑。是否忘記使用前置 './'?", "Non_simple_parameter_declared_here_1348": "非簡易參數已宣告於此處。", "Not_all_code_paths_return_a_value_7030": "部分程式碼路徑並未傳回值。", "Not_all_constituents_of_type_0_are_callable_2756": "'{0}' 類型的構件並非都可呼叫。", @@ -830,7 +811,6 @@ "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230": "只能在 'tsconfig.json' 檔案中指定 '{0}' 選項,或在命令列上將其設定為 'false' 或 'null'。", "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064": "只能在 'tsconfig.json' 檔案中指定 '{0}' 選項,或在命令列上將其設定為 'null'。", "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051": "只有在已提供選項 '--inlineSourceMap' 或選項 '--sourceMap' 時,才可使用選項 '{0}'。", - "Option_0_cannot_be_specified_when_option_jsx_is_1_5089": "當選項 'jsx' 為 '{1}' 時,無法指定選項 '{0}'。", "Option_0_cannot_be_specified_when_option_target_is_ES3_5048": "當選項 'target' 為 'ES3' 時,無法指定選項 '{0}'。", "Option_0_cannot_be_specified_with_option_1_5053": "不得同時指定選項 '{0}' 與選項 '{1}'。", "Option_0_cannot_be_specified_without_specifying_option_1_5052": "必須指定選項 '{1}' 才可指定選項 '{0}'。", @@ -839,6 +819,7 @@ "Option_build_must_be_the_first_command_line_argument_6369": "選項 '--build' 必須是第一個命令列引數。", "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": "只有在使用 tsconfig、發出至單一檔案,或指定選項 `--tsBuildInfoFile` 時,才可指定選項 '--incremental'。", "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047": "只有在提供選項 '--module' 或是 'target' 為 'ES2015' 或更高項目時,才可使用選項 'isolatedModules'。", + "Option_paths_cannot_be_used_without_specifying_baseUrl_option_5060": "必須指定 '--baseUrl' 選項才能使用選項 'paths'。", "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042": "在命令列上,'project' 選項不得與原始程式檔並用。", "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071": "只有在模組程式碼產生為 'commonjs'、'amd'、'es2015' 或 'esNext' 時,才可指定選項 '--resolveJsonModule'。", "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070": "指定選項 '-resolveJsonModule' 時,不可沒有 'node' 模組解析策略。", @@ -891,7 +872,6 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "匯出類別中公用靜態 setter '{0}' 的參數類型具有或正在使用私用名稱 '{1}'。", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "在 strict 模式中進行剖析,並為每個來源檔案發出 \"use strict\"。", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "模式 '{0}' 最多只可有一個 '*' 字元。", - "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386": "在此工作階段中無法使用 '--diagnostics ' 或 '--extendedDiagnostics ' 的效能計時。找不到 Web 效能 API 的原生實作。", "Prefix_0_with_an_underscore_90025": "具有底線的前置詞 '{0}'", "Prefix_all_incorrect_property_declarations_with_declare_95095": "在所有不正確屬性宣告的開頭放置 'declare'", "Prefix_all_unused_declarations_with_where_possible_95025": "若可行,為所有未使用的宣告加上前置詞 '_'", @@ -905,7 +885,7 @@ "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "變數宣告中不允許私人識別碼。", "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "不允許私人識別碼位於類別主體外。", "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "只有當目標為 ECMAScript 2015 及更新版本時,才可使用私人識別碼。", - "Private_identifiers_cannot_be_used_as_parameters_18009": "私人識別碼不可用作為參數。", + "Private_identifiers_cannot_be_used_as_parameters_18009": "私人識別碼不可用作參數", "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "無法在型別參數上存取私人或受保護的成員 '{0}'。", "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "因為專案 '{0}' 的相依性 '{1}' 發生錯誤,所以無法建置該專案", "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383": "因為未建置專案 '{0}' 的相依性 '{1}',所以無法建置該專案", @@ -923,7 +903,6 @@ "Property_0_does_not_exist_on_const_enum_1_2479": "'const' 列舉 '{1}' 上並沒有屬性 '{0}'。", "Property_0_does_not_exist_on_type_1_2339": "類型 '{1}' 沒有屬性 '{0}'。", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "類型 '{1}' 沒有屬性 '{0}'。您指的是 '{2}' 嗎?", - "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550": "類型 '{1}' 沒有屬性 '{0}'。要變更您的目標程式庫嗎? 請嘗試將 'lib' 編譯器選項變更為 '{2}' 或更新版本。", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "屬性 '{0}' 沒有初始設定式,且未在建構函式中明確指派。", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "因為屬性 '{0}' 的 get 存取子沒有傳回類型註釋,致使該屬性意味著類型 'any'。", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "因為屬性 '{0}' 的 set 存取子沒有參數類型註釋,致使該屬性意味著類型 'any'。", @@ -932,7 +911,7 @@ "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "類型 '{1}' 中的屬性 '{0}' 無法指派給基底類型 '{2}' 中的相同屬性。", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "不得將類型 '{1}' 的屬性 '{0}' 指派給類型 '{2}'。", "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015": "類型 '{1}' 中的屬性 '{0}' 是無法從類型 '{2}' 中存取的其他成員。", - "Property_0_is_a_static_member_of_type_1_2576": "屬性 '{0}' 為 '{1}' 類型的靜態成員。", + "Property_0_is_a_static_member_of_type_1_2576": "屬性 '{0}' 為 '{1}' 類型的靜態成員", "Property_0_is_declared_but_its_value_is_never_read_6138": "屬性 '{0}' 已宣告但從未讀取其值。", "Property_0_is_incompatible_with_index_signature_2530": "屬性 '{0}' 和索引簽章不相容。", "Property_0_is_incompatible_with_rest_element_type_2573": "屬性 '{0}' 與其餘項目類型不相容。", @@ -961,7 +940,6 @@ "Property_or_signature_expected_1131": "必須是屬性或簽章。", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "屬性值僅能為字串常值、數值常值、'true'、'false'、'null'、物件常值或陣列常值。", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "當目標為 'ES5' 或 'ES3' 時,為 'for-of'、擴張及解構提供完整的支援。", - "Provides_a_root_package_name_when_using_outFile_with_declarations_1390": "使用 outFile 時若有宣告,請提供根套件名稱。", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "匯出類別的公用方法 '{0}' 具有或使用外部模組 {2} 的名稱 '{1}',但無法命名。", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "匯出類別的公用方法 '{0}' 具有或使用私用模組 '{2}' 的名稱 '{1}'。", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "匯出類別的公用方法 '{0}' 具有或使用私用名稱 '{1}'。", @@ -1088,7 +1066,6 @@ "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "指定發出檔案時要用的行尾順序: 'CRLF' (DOS) 或 'LF' (UNIX)。", "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004": "指定偵錯工具尋找 TypeScript 檔案的位置,而非原始檔位置。", "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "指定偵錯工具尋找對應檔的位置,而非產生的位置。", - "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238": "指定用於匯入 `jsx` 與 `jsxs` Factory 函式的模組指定名稱。例如,傳送表情符號", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "指定輸入檔的根目錄。用以控制具有 --outDir 的輸出目錄結構。", "Split_all_invalid_type_only_imports_1367": "分割所有無效的僅限類型匯入", "Split_into_two_separate_import_declarations_1366": "分割為兩個獨立的匯入宣告", @@ -1113,7 +1090,7 @@ "Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337": "建構函式外部或建構函式內的巢狀函式中不允許 super 呼叫。", "Suppress_excess_property_checks_for_object_literals_6072": "不對物件常值進行多餘的屬性檢查。", "Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055": "針對缺少索引簽章的索引物件隱藏 noImplicitAny 錯誤。", - "Switch_each_misused_0_to_1_95138": "將每個誤用的 '{0}' 切換成 '{1}'", + "Switch_each_misused_0_to_1_95138": "將每個誤用的 '{0}' 切換為 '{1}'", "Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object_2470": "'Symbol' 參考不是參考全域 Symbol 建構函式物件。", "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6228": "呼叫回呼,並更新不支援原生遞迴監看之平台上的目錄監控程式狀態。", "Syntax_Colon_0_6023": "語法: {0}", @@ -1130,8 +1107,6 @@ "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496": "無法在 ES3 和 ES5 的箭號函式中參考 'arguments' 物件。請考慮使用標準函式運算式。", "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "在 ES3 與 ES5 的非同步函式或方法中,無法參考 'arguments' 物件。請考慮使用標準函式或方法。", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "'if' 陳述式的主體不能是空白陳述式。", - "The_bundledPackageName_option_must_be_provided_when_using_outFile_and_node_module_resolution_with_de_1391": "使用 outFile 及節點模組解析且發出宣告時,必須提供 `bundledPackageName` 選項。", - "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793": "對此實作的呼叫會成功,但多載的實作簽章未向外部顯示。", "The_character_set_of_the_input_files_6163": "輸入檔的字元集。", "The_containing_arrow_function_captures_the_global_value_of_this_7041": "包含的箭號函式會擷取 'this' 的全域值。", "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "內含的函式或模組主體對控制流程分析而言過大。", @@ -1150,10 +1125,8 @@ "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742": "'{0}' 的推斷類型無法在沒有 '{1}' 參考的情況下命名。其可能非可攜式。必須有型別註解。", "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088": "'{0}' 的推斷型別參考了具有迴圈結構且不是可完整序列化的型別。必須有型別註解。", "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527": "'{0}' 的推斷型別參考了無法存取的 '{1}' 型別。必須有型別註解。", - "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056": "此節點的推斷型別超過編譯器將序列化的長度上限。需要明確的型別註解。", "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032": "因為屬性 '{1}' 存在於多個部分,而且在某些部分為私人性質,所以交集 '{0}' 已縮減為 'never'。", "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031": "因為屬性 '{1}' 在某些部分有衝突的類型,所以交集 '{0}' 已縮減為 'never'。", - "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795": "'intrinsic' 關鍵字只可用於宣告編譯器提供的內建類型。", "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016": "必須提供 'jsxFragmentFactory' 編譯器選項,才能使用具有 'jsxFactory' 編譯器選項的 JSX 片段。", "The_last_overload_gave_the_following_error_2770": "最後一個多載出現下列錯誤。", "The_last_overload_is_declared_here_2771": "最後一個多載宣告於此處。", @@ -1230,7 +1203,7 @@ "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts 檔案中的最上層宣告必須以 'declare' 或 'export' 修飾元開頭。", "Trailing_comma_not_allowed_1009": "尾端不得為逗號。", "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153": "以個別模組的形式轉換每個檔案的語言 (類似於 'ts.transpileModule')。", - "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035": "如有 `npm i --save-dev @types/{1}`,請嘗試使用,或新增包含 `declare module '{0}';` 的宣告 (.d.ts) 檔案", + "Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035": "如有 `npm install @types/{1}`,請嘗試使用,或新增包含 `declare module '{0}';` 的宣告 (.d.ts) 檔案", "Trying_other_entries_in_rootDirs_6110": "正在嘗試 'rootDirs' 中的其他項目。", "Trying_substitution_0_candidate_module_location_Colon_1_6093": "正在嘗試替代 '{0}',候選模組位置: '{1}'。", "Tuple_members_must_all_have_names_or_all_not_have_names_5084": "元組成員必須全數有名稱或都沒有名稱。", @@ -1305,7 +1278,6 @@ "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119": "======== 類型參考指示詞 '{0}' 已成功解析為 '{1}',主要: {2}。========", "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219": "======== 類型參考指示詞 '{0}' 已成功解析為 '{1}',套件識別碼為 '{2}',主要: {3}。========", "Types_have_separate_declarations_of_a_private_property_0_2442": "類型具有私用屬性 '{0}' 的個別宣告。", - "Types_of_construct_signatures_are_incompatible_2419": "建構簽章的類型不相容。", "Types_of_parameters_0_and_1_are_incompatible_2328": "參數 '{0}' 和 '{1}' 的類型不相容。", "Types_of_property_0_are_incompatible_2326": "屬性 '{0}' 的類型不相容。", "Unable_to_open_file_0_6050": "無法開啟檔案 '{0}'。", @@ -1378,7 +1350,6 @@ "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597": "只能使用 'require' 呼叫或預設匯入來匯入 '{0}'。", "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616": "只能使用 'import {1} = require({2})' 或預設匯入來匯入 '{0}'。", "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617": "只能使用 'import {1} = require({2})',或透過開啟 'esModuleInterop' 旗標並使用預設匯入,來匯入 '{0}'。", - "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208": "因為系統將 '{0}' 視為全域指令檔,所以無法在 '--isolatedModules' 下編譯。請新增匯入、匯出或空白的 'export {}' 陳述式,使其成為模組。", "_0_cannot_be_used_as_a_JSX_component_2786": "'{0}' 不能用作 JSX 元件。", "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362": "因為 '{0}' 是使用 'export type' 匯出的,所以無法作為值使用。", "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361": "因為 '{0}' 是使用 'import type' 匯入的,所以無法作為值使用。", @@ -1386,7 +1357,6 @@ "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082": "'{0}' 可以使用與 '{1}' 無關的任意類型來具現化。", "_0_declarations_can_only_be_used_in_TypeScript_files_8006": "'{0}' 宣告只可用於 TypeScript 檔案中。", "_0_expected_1005": "必須是 '{0}'。", - "_0_has_no_exported_member_named_1_Did_you_mean_2_2724": "'{0}' 沒有任何名稱為 '{1}' 的已匯出成員。您是指 '{2}' 嗎?", "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050": "'{0}' 隱含 '{1}' 傳回型別,但可從使用方式推斷更適合的類型。", "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023": "'{0}' 因為沒有傳回型別註解,且在其中一個傳回運算式中直接或間接參考了自己,所以隱含了傳回型別 'any'。", "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022": "'{0}' 因為沒有類型註釋,且在其本身的初始設定式中直接或間接參考了自己,所以隱含有類型 'any'。", @@ -1399,29 +1369,27 @@ "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610": "'{0}' 在類別 '{1}' 中定義為存取子,但在此處的 '{2}' 中卻覆寫為執行個體屬性。", "_0_is_deprecated_6385": "'{0}' 已淘汰", "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012": "'{0}' 對關鍵字 '{1}' 而言不是有效的中繼屬性。您是指 '{2}' 嗎?", - "_0_is_not_allowed_as_a_variable_declaration_name_1389": "'{0}' 不能是變數宣告名稱。", "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506": "'{0}' 在其本身的基底運算式中直接或間接受到參考。", "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502": "'{0}' 在其本身的類型註釋中直接或間接受到參考。", "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783": "多次指定 '{0}',因此將會覆寫此使用方式。", "_0_list_cannot_be_empty_1097": "'{0}' 清單不得為空白。", "_0_modifier_already_seen_1030": "已有 '{0}' 修飾元。", + "_0_modifier_cannot_appear_on_a_class_element_1031": "類別項目不得有 '{0}' 修飾元。", "_0_modifier_cannot_appear_on_a_constructor_declaration_1089": "建構函式宣告不得有 '{0}' 修飾元。", "_0_modifier_cannot_appear_on_a_data_property_1043": "資料屬性不得有 '{0}' 修飾元。", "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044": "模組或命名空間元素不能有 '{0}' 修飾元。", "_0_modifier_cannot_appear_on_a_parameter_1090": "參數不得有 '{0}' 修飾元。", "_0_modifier_cannot_appear_on_a_type_member_1070": "類型成員不能有 '{0}' 修飾元。", "_0_modifier_cannot_appear_on_an_index_signature_1071": "索引簽章不能有 '{0}' 修飾元。", - "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031": "不得在此種類別項目中使用 '{0}' 修飾元。", "_0_modifier_cannot_be_used_here_1042": "無法在此處使用 '{0}' 修飾元。", "_0_modifier_cannot_be_used_in_an_ambient_context_1040": "無法在環境內容中使用 '{0}' 修飾元。", "_0_modifier_cannot_be_used_with_1_modifier_1243": "'{0}' 修飾元無法與 '{1}' 修飾元並用。", "_0_modifier_cannot_be_used_with_a_class_declaration_1041": "'{0}' 修飾元無法與類別宣告並用。", - "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "'{0}' 修飾元不可搭配私人識別碼一起使用。", + "_0_modifier_cannot_be_used_with_a_private_identifier_18019": "'{0}' 修飾元不可搭配私人識別碼使用", "_0_modifier_must_precede_1_modifier_1029": "'{0}' 修飾元必須在 '{1}' 修飾元之前。", "_0_needs_an_explicit_type_annotation_2782": "'{0}' 需要明確的型別註解。", "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702": "'{0}' 只參考類型,但在這裡用作命名空間。", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693": "'{0}' 只會參考類型,但此處將其用為值。", - "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690": "'{0}' 僅限於類型,但此處用為值。您要使用 '{1} in {0}' 嗎?", "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585": "'{0}' 只是類型,但在此處卻作為值使用。需要變更您的目標程式庫嗎? 請嘗試將 `lib` 編譯器選項變更為 es2015 或更新版本。", "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686": "'{0}' 指的是全域的 UMD,但目前的檔案為模組。請考慮改為新增匯入。", "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749": "'{0}' 為值,但在此處卻作為類型使用。您是否是指 'typeof {0}'?", @@ -1458,7 +1426,6 @@ "extends_clause_already_seen_1172": "已經有 'extends' 子句。", "extends_clause_must_precede_implements_clause_1173": "'extends' 子句必須在 'implements' 子句之前。", "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "匯出類別 '{0}' 的 'extends' 子句具有或使用私用名稱 '{1}'。", - "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "匯出類別的 'extends' 子句包含或使用了私人名稱 '{0}'。", "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "匯出介面 '{0}' 的 'extends' 子句具有或使用私用名稱 '{1}'。", "file_6025": "檔案", "get_and_set_accessor_must_have_the_same_this_type_2682": "'get' 和 'set' 存取子必須有相同的 'this' 類型。", diff --git a/node_modules/typescript/package.json b/node_modules/typescript/package.json index c177b36..705f0c7 100644 --- a/node_modules/typescript/package.json +++ b/node_modules/typescript/package.json @@ -1,51 +1,33 @@ { - "_from": "typescript@^4.0.2", - "_id": "typescript@4.1.3", - "_inBundle": false, - "_integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==", - "_location": "/typescript", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "typescript@^4.0.2", - "name": "typescript", - "escapedName": "typescript", - "rawSpec": "^4.0.2", - "saveSpec": null, - "fetchSpec": "^4.0.2" - }, - "_requiredBy": [ - "#DEV:/" + "name": "typescript", + "author": "Microsoft Corp.", + "homepage": "https://www.typescriptlang.org/", + "version": "4.0.2", + "license": "Apache-2.0", + "description": "TypeScript is a language for application scale JavaScript development", + "keywords": [ + "TypeScript", + "Microsoft", + "compiler", + "language", + "javascript" ], - "_resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", - "_shasum": "519d582bd94cba0cf8934c7d8e8467e473f53bb7", - "_spec": "typescript@^4.0.2", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Microsoft Corp." - }, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "browser": { - "fs": false, - "os": false, - "path": false, - "crypto": false, - "buffer": false, - "@microsoft/typescript-etw": false, - "source-map-support": false, - "inspector": false - }, "bugs": { "url": "https://github.com/Microsoft/TypeScript/issues" }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "TypeScript is a language for application scale JavaScript development", + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/TypeScript.git" + }, + "main": "./lib/typescript.js", + "typings": "./lib/typescript.d.ts", + "bin": { + "tsc": "./bin/tsc", + "tsserver": "./bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + }, "devDependencies": { "@octokit/rest": "latest", "@types/browserify": "latest", @@ -72,9 +54,9 @@ "@types/through2": "latest", "@types/travis-fold": "latest", "@types/xml2js": "^0.4.0", - "@typescript-eslint/eslint-plugin": "4.5.0", - "@typescript-eslint/experimental-utils": "4.5.0", - "@typescript-eslint/parser": "4.5.0", + "@typescript-eslint/eslint-plugin": "^3.6.1-alpha.1", + "@typescript-eslint/experimental-utils": "^3.4.1-alpha.1", + "@typescript-eslint/parser": "^3.4.1-alpha.1", "async": "latest", "azure-devops-node-api": "^10.1.0", "browser-resolve": "^1.11.2", @@ -84,10 +66,10 @@ "convert-source-map": "latest", "del": "5.1.0", "diff": "^4.0.2", - "eslint": "7.12.1", - "eslint-formatter-autolinkable-stylish": "1.1.4", - "eslint-plugin-import": "2.22.1", - "eslint-plugin-jsdoc": "30.7.6", + "eslint": "6.8.0", + "eslint-formatter-autolinkable-stylish": "1.1.2", + "eslint-plugin-import": "2.20.2", + "eslint-plugin-jsdoc": "22.1.0", "eslint-plugin-no-null": "1.0.2", "fancy-log": "latest", "fs-extra": "^9.0.0", @@ -106,6 +88,7 @@ "mocha-fivemat-progress-reporter": "latest", "ms": "latest", "node-fetch": "^2.6.0", + "playwright": "0.12.1", "plugin-error": "latest", "pretty-hrtime": "^1.0.3", "prex": "^0.4.3", @@ -119,28 +102,15 @@ "vinyl-sourcemaps-apply": "latest", "xml2js": "^0.4.19" }, - "engines": { - "node": ">=4.2.0" - }, - "homepage": "https://www.typescriptlang.org/", - "keywords": [ - "TypeScript", - "Microsoft", - "compiler", - "language", - "javascript" - ], - "license": "Apache-2.0", - "main": "./lib/typescript.js", - "name": "typescript", - "repository": { - "type": "git", - "url": "git+https://github.com/Microsoft/TypeScript.git" - }, "scripts": { + "prepare": "gulp build-eslint-rules", + "pretest": "gulp tests", + "test": "gulp runtests-parallel --light=false", + "test:eslint-rules": "gulp run-eslint-rules-tests", "build": "npm run build:compiler && npm run build:tests", "build:compiler": "gulp local", "build:tests": "gulp tests", + "start": "node lib/tsc", "clean": "gulp clean", "gulp": "gulp", "jake": "gulp", @@ -148,13 +118,20 @@ "lint:ci": "gulp lint --ci", "lint:compiler": "gulp lint-compiler", "lint:scripts": "gulp lint-scripts", - "prepare": "gulp build-eslint-rules", - "pretest": "gulp tests", - "setup-hooks": "node scripts/link-hooks.js", - "start": "node lib/tsc", - "test": "gulp runtests-parallel --light=false", - "test:eslint-rules": "gulp run-eslint-rules-tests" + "setup-hooks": "node scripts/link-hooks.js" }, - "typings": "./lib/typescript.d.ts", - "version": "4.1.3" -} + "browser": { + "fs": false, + "os": false, + "path": false, + "crypto": false, + "buffer": false, + "@microsoft/typescript-etw": false, + "source-map-support": false, + "inspector": false + }, + "dependencies": {}, + "__npminstall_done": "Sun Sep 06 2020 16:10:13 GMT+0800 (中国标准时间)", + "_from": "typescript@4.0.2", + "_resolved": "https://registry.npm.taobao.org/typescript/download/typescript-4.0.2.tgz?cache=0&sync_timestamp=1599375086064&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypescript%2Fdownload%2Ftypescript-4.0.2.tgz" +} \ No newline at end of file diff --git a/node_modules/unicode-canonical-property-names-ecmascript/package.json b/node_modules/unicode-canonical-property-names-ecmascript/package.json index ea1189f..b9f60dc 100644 --- a/node_modules/unicode-canonical-property-names-ecmascript/package.json +++ b/node_modules/unicode-canonical-property-names-ecmascript/package.json @@ -1,44 +1,9 @@ { - "_args": [ - [ - "unicode-canonical-property-names-ecmascript@1.0.4", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "unicode-canonical-property-names-ecmascript@1.0.4", - "_id": "unicode-canonical-property-names-ecmascript@1.0.4", - "_inBundle": false, - "_integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", - "_location": "/unicode-canonical-property-names-ecmascript", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "unicode-canonical-property-names-ecmascript@1.0.4", - "name": "unicode-canonical-property-names-ecmascript", - "escapedName": "unicode-canonical-property-names-ecmascript", - "rawSpec": "1.0.4", - "saveSpec": null, - "fetchSpec": "1.0.4" - }, - "_requiredBy": [ - "/unicode-match-property-ecmascript" - ], - "_resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "_spec": "1.0.4", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "bugs": { - "url": "https://github.com/mathiasbynens/unicode-canonical-property-names-ecmascript/issues" - }, + "name": "unicode-canonical-property-names-ecmascript", + "version": "1.0.4", "description": "The set of canonical Unicode property names supported in ECMAScript RegExp property escapes.", - "devDependencies": { - "ava": "*" - }, + "homepage": "https://github.com/mathiasbynens/unicode-canonical-property-names-ecmascript", + "main": "index.js", "engines": { "node": ">=4" }, @@ -46,20 +11,27 @@ "LICENSE-MIT.txt", "index.js" ], - "homepage": "https://github.com/mathiasbynens/unicode-canonical-property-names-ecmascript", "keywords": [ "unicode", "unicode properties" ], "license": "MIT", - "main": "index.js", - "name": "unicode-canonical-property-names-ecmascript", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, "repository": { "type": "git", - "url": "git+https://github.com/mathiasbynens/unicode-canonical-property-names-ecmascript.git" + "url": "https://github.com/mathiasbynens/unicode-canonical-property-names-ecmascript.git" + }, + "bugs": "https://github.com/mathiasbynens/unicode-canonical-property-names-ecmascript/issues", + "devDependencies": { + "ava": "*" }, "scripts": { "test": "ava ./tests" }, - "version": "1.0.4" -} + "__npminstall_done": "Sun Sep 06 2020 16:10:18 GMT+0800 (中国标准时间)", + "_from": "unicode-canonical-property-names-ecmascript@1.0.4", + "_resolved": "https://registry.npm.taobao.org/unicode-canonical-property-names-ecmascript/download/unicode-canonical-property-names-ecmascript-1.0.4.tgz" +} \ No newline at end of file diff --git a/node_modules/unicode-match-property-ecmascript/package.json b/node_modules/unicode-match-property-ecmascript/package.json index e3ee6e0..16f8ab6 100644 --- a/node_modules/unicode-match-property-ecmascript/package.json +++ b/node_modules/unicode-match-property-ecmascript/package.json @@ -1,48 +1,9 @@ { - "_args": [ - [ - "unicode-match-property-ecmascript@1.0.4", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "unicode-match-property-ecmascript@1.0.4", - "_id": "unicode-match-property-ecmascript@1.0.4", - "_inBundle": false, - "_integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", - "_location": "/unicode-match-property-ecmascript", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "unicode-match-property-ecmascript@1.0.4", - "name": "unicode-match-property-ecmascript", - "escapedName": "unicode-match-property-ecmascript", - "rawSpec": "1.0.4", - "saveSpec": null, - "fetchSpec": "1.0.4" - }, - "_requiredBy": [ - "/regexpu-core" - ], - "_resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "_spec": "1.0.4", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "bugs": { - "url": "https://github.com/mathiasbynens/unicode-match-property-ecmascript/issues" - }, - "dependencies": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" - }, + "name": "unicode-match-property-ecmascript", + "version": "1.0.4", "description": "Match a Unicode property or property alias to its canonical property name per the algorithm used for RegExp Unicode property escapes in ECMAScript.", - "devDependencies": { - "ava": "*" - }, + "homepage": "https://github.com/mathiasbynens/unicode-match-property-ecmascript", + "main": "index.js", "engines": { "node": ">=4" }, @@ -50,21 +11,32 @@ "LICENSE-MIT.txt", "index.js" ], - "homepage": "https://github.com/mathiasbynens/unicode-match-property-ecmascript", "keywords": [ "unicode", "unicode properties", "unicode property aliases" ], "license": "MIT", - "main": "index.js", - "name": "unicode-match-property-ecmascript", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, "repository": { "type": "git", - "url": "git+https://github.com/mathiasbynens/unicode-match-property-ecmascript.git" + "url": "https://github.com/mathiasbynens/unicode-match-property-ecmascript.git" + }, + "bugs": "https://github.com/mathiasbynens/unicode-match-property-ecmascript/issues", + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + }, + "devDependencies": { + "ava": "*" }, "scripts": { "test": "ava ./tests" }, - "version": "1.0.4" -} + "__npminstall_done": "Sun Sep 06 2020 16:10:18 GMT+0800 (中国标准时间)", + "_from": "unicode-match-property-ecmascript@1.0.4", + "_resolved": "https://registry.npm.taobao.org/unicode-match-property-ecmascript/download/unicode-match-property-ecmascript-1.0.4.tgz" +} \ No newline at end of file diff --git a/node_modules/unicode-match-property-value-ecmascript/package.json b/node_modules/unicode-match-property-value-ecmascript/package.json index 38c5bfe..6f765d2 100644 --- a/node_modules/unicode-match-property-value-ecmascript/package.json +++ b/node_modules/unicode-match-property-value-ecmascript/package.json @@ -1,46 +1,9 @@ { - "_args": [ - [ - "unicode-match-property-value-ecmascript@1.2.0", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "unicode-match-property-value-ecmascript@1.2.0", - "_id": "unicode-match-property-value-ecmascript@1.2.0", - "_inBundle": false, - "_integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", - "_location": "/unicode-match-property-value-ecmascript", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "unicode-match-property-value-ecmascript@1.2.0", - "name": "unicode-match-property-value-ecmascript", - "escapedName": "unicode-match-property-value-ecmascript", - "rawSpec": "1.2.0", - "saveSpec": null, - "fetchSpec": "1.2.0" - }, - "_requiredBy": [ - "/regexpu-core" - ], - "_resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "_spec": "1.2.0", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "bugs": { - "url": "https://github.com/mathiasbynens/unicode-match-property-value-ecmascript/issues" - }, + "name": "unicode-match-property-value-ecmascript", + "version": "1.2.0", "description": "Match a Unicode property or property alias to its canonical property name per the algorithm used for RegExp Unicode property escapes in ECMAScript.", - "devDependencies": { - "ava": "*", - "jsesc": "^2.5.2", - "unicode-property-value-aliases-ecmascript": "^1.1.0" - }, + "homepage": "https://github.com/mathiasbynens/unicode-match-property-value-ecmascript", + "main": "index.js", "engines": { "node": ">=4" }, @@ -49,22 +12,31 @@ "data/mappings.js", "index.js" ], - "homepage": "https://github.com/mathiasbynens/unicode-match-property-value-ecmascript", "keywords": [ "unicode", "unicode property values", "unicode property value aliases" ], "license": "MIT", - "main": "index.js", - "name": "unicode-match-property-value-ecmascript", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, "repository": { "type": "git", - "url": "git+https://github.com/mathiasbynens/unicode-match-property-value-ecmascript.git" + "url": "https://github.com/mathiasbynens/unicode-match-property-value-ecmascript.git" + }, + "bugs": "https://github.com/mathiasbynens/unicode-match-property-value-ecmascript/issues", + "devDependencies": { + "ava": "*", + "jsesc": "^2.5.2", + "unicode-property-value-aliases-ecmascript": "^1.1.0" }, "scripts": { "build": "node scripts/build.js", "test": "ava tests/tests.js" }, - "version": "1.2.0" -} + "__npminstall_done": "Sun Sep 06 2020 16:10:18 GMT+0800 (中国标准时间)", + "_from": "unicode-match-property-value-ecmascript@1.2.0", + "_resolved": "https://registry.npm.taobao.org/unicode-match-property-value-ecmascript/download/unicode-match-property-value-ecmascript-1.2.0.tgz" +} \ No newline at end of file diff --git a/node_modules/unicode-property-aliases-ecmascript/package.json b/node_modules/unicode-property-aliases-ecmascript/package.json index d1d8181..bc11114 100644 --- a/node_modules/unicode-property-aliases-ecmascript/package.json +++ b/node_modules/unicode-property-aliases-ecmascript/package.json @@ -1,46 +1,9 @@ { - "_args": [ - [ - "unicode-property-aliases-ecmascript@1.1.0", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "unicode-property-aliases-ecmascript@1.1.0", - "_id": "unicode-property-aliases-ecmascript@1.1.0", - "_inBundle": false, - "_integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", - "_location": "/unicode-property-aliases-ecmascript", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "unicode-property-aliases-ecmascript@1.1.0", - "name": "unicode-property-aliases-ecmascript", - "escapedName": "unicode-property-aliases-ecmascript", - "rawSpec": "1.1.0", - "saveSpec": null, - "fetchSpec": "1.1.0" - }, - "_requiredBy": [ - "/unicode-match-property-ecmascript" - ], - "_resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "_spec": "1.1.0", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "bugs": { - "url": "https://github.com/mathiasbynens/unicode-property-aliases-ecmascript/issues" - }, + "name": "unicode-property-aliases-ecmascript", + "version": "1.1.0", "description": "Unicode property alias mappings in JavaScript format for property names that are supported in ECMAScript RegExp property escapes.", - "devDependencies": { - "ava": "*", - "jsesc": "^2.5.2", - "unicode-canonical-property-names-ecmascript": "^1.0.4" - }, + "homepage": "https://github.com/mathiasbynens/unicode-property-aliases-ecmascript", + "main": "index.js", "engines": { "node": ">=4" }, @@ -48,7 +11,6 @@ "LICENSE-MIT.txt", "index.js" ], - "homepage": "https://github.com/mathiasbynens/unicode-property-aliases-ecmascript", "keywords": [ "unicode", "unicode-data", @@ -57,16 +19,26 @@ "property alias" ], "license": "MIT", - "main": "index.js", - "name": "unicode-property-aliases-ecmascript", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, "repository": { "type": "git", - "url": "git+https://github.com/mathiasbynens/unicode-property-aliases-ecmascript.git" + "url": "https://github.com/mathiasbynens/unicode-property-aliases-ecmascript.git" + }, + "bugs": "https://github.com/mathiasbynens/unicode-property-aliases-ecmascript/issues", + "devDependencies": { + "ava": "*", + "jsesc": "^2.5.2", + "unicode-canonical-property-names-ecmascript": "^1.0.4" }, "scripts": { - "build": "node scripts/build.js", "download": "curl http://unicode.org/Public/13.0.0/ucd/PropertyAliases.txt > data/PropertyAliases.txt", + "build": "node scripts/build.js", "test": "ava tests/tests.js" }, - "version": "1.1.0" -} + "__npminstall_done": "Sun Sep 06 2020 16:10:18 GMT+0800 (中国标准时间)", + "_from": "unicode-property-aliases-ecmascript@1.1.0", + "_resolved": "https://registry.npm.taobao.org/unicode-property-aliases-ecmascript/download/unicode-property-aliases-ecmascript-1.1.0.tgz" +} \ No newline at end of file diff --git a/node_modules/universalify/package.json b/node_modules/universalify/package.json index f8e7a46..cbcb747 100644 --- a/node_modules/universalify/package.json +++ b/node_modules/universalify/package.json @@ -1,41 +1,26 @@ { - "_args": [ - [ - "universalify@0.1.2", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "universalify@0.1.2", - "_id": "universalify@0.1.2", - "_inBundle": false, - "_integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "_location": "/universalify", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "universalify@0.1.2", - "name": "universalify", - "escapedName": "universalify", - "rawSpec": "0.1.2", - "saveSpec": null, - "fetchSpec": "0.1.2" - }, - "_requiredBy": [ - "/fs-extra" - ], - "_resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "_spec": "0.1.2", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Ryan Zimmerman", - "email": "opensrc@ryanzim.com" - }, - "bugs": { - "url": "https://github.com/RyanZim/universalify/issues" - }, + "name": "universalify", + "version": "0.1.2", "description": "Make a callback- or promise-based function support both promises and callbacks.", + "keywords": [ + "callback", + "native", + "promise" + ], + "homepage": "https://github.com/RyanZim/universalify#readme", + "bugs": "https://github.com/RyanZim/universalify/issues", + "license": "MIT", + "author": "Ryan Zimmerman ", + "files": [ + "index.js" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/RyanZim/universalify.git" + }, + "scripts": { + "test": "standard && nyc tape test/*.js | colortape" + }, "devDependencies": { "colortape": "^0.1.2", "coveralls": "^3.0.1", @@ -46,23 +31,7 @@ "engines": { "node": ">= 4.0.0" }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/RyanZim/universalify#readme", - "keywords": [ - "callback", - "native", - "promise" - ], - "license": "MIT", - "name": "universalify", - "repository": { - "type": "git", - "url": "git+https://github.com/RyanZim/universalify.git" - }, - "scripts": { - "test": "standard && nyc tape test/*.js | colortape" - }, - "version": "0.1.2" -} + "__npminstall_done": "Sun Sep 06 2020 16:10:13 GMT+0800 (中国标准时间)", + "_from": "universalify@0.1.2", + "_resolved": "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz" +} \ No newline at end of file diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json index d6655ac..f0722ae 100644 --- a/node_modules/wrappy/package.json +++ b/node_modules/wrappy/package.json @@ -1,63 +1,32 @@ { - "_args": [ - [ - "wrappy@1.0.2", - "E:\\Project\\npm-project\\vue-baidu-analytics" - ] - ], - "_development": true, - "_from": "wrappy@1.0.2", - "_id": "wrappy@1.0.2", - "_inBundle": false, - "_integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "_location": "/wrappy", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "wrappy@1.0.2", - "name": "wrappy", - "escapedName": "wrappy", - "rawSpec": "1.0.2", - "saveSpec": null, - "fetchSpec": "1.0.2" - }, - "_requiredBy": [ - "/inflight", - "/once" - ], - "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "_spec": "1.0.2", - "_where": "E:\\Project\\npm-project\\vue-baidu-analytics", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/wrappy/issues" - }, - "dependencies": {}, + "name": "wrappy", + "version": "1.0.2", "description": "Callback wrapping utility", - "devDependencies": { - "tap": "^2.3.1" - }, - "directories": { - "test": "test" - }, + "main": "wrappy.js", "files": [ "wrappy.js" ], - "homepage": "https://github.com/npm/wrappy", - "license": "ISC", - "main": "wrappy.js", - "name": "wrappy", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/wrappy.git" + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^2.3.1" }, "scripts": { "test": "tap --coverage test/*.js" }, - "version": "1.0.2" -} + "repository": { + "type": "git", + "url": "https://github.com/npm/wrappy" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/wrappy/issues" + }, + "homepage": "https://github.com/npm/wrappy", + "__npminstall_done": "Sun Sep 06 2020 16:10:08 GMT+0800 (中国标准时间)", + "_from": "wrappy@1.0.2", + "_resolved": "https://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz" +} \ No newline at end of file